Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ file = "my-capsule.wasm"
type = "executable"

[capabilities]
ipc_publish = ["tool.v1.execute.*"]
kv = ["*"]

[publish]
"tool.v1.execute.*" = { wit = "opaque" }
```

`src/index.ts`:
Expand Down
2 changes: 1 addition & 1 deletion contracts
12 changes: 8 additions & 4 deletions examples/test-capsule/Capsule.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ file = "test-capsule.wasm"
type = "executable"

[capabilities]
ipc_publish = ["tool.v1.execute.*", "test.v1.event.*"]
kv = ["*"]

[[interceptor]]
event = "test.v1.event"
action = "test.v1.event"
[publish]
"tool.v1.execute.*" = { wit = "opaque" }
"test.v1.event.*" = { wit = "opaque" }

# Interceptor binding: a [subscribe] entry's `handler` binds the topic to the
# guest handler (the key also grants the subscribe ACL).
[subscribe]
"test.v1.event" = { wit = "opaque", handler = "test.v1.event" }
2 changes: 1 addition & 1 deletion packages/astrid-sdk/src/interceptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type { InterceptorBinding } from "./ipc.js";
/**
* Query the runtime for auto-subscribed interceptor handles. Returns an
* empty array if this capsule has no auto-subscribed interceptors (i.e. it
* does not have both `@run` and `[[interceptor]]`).
* does not have both `@run` and a `[subscribe]` entry with a `handler`).
*/
export function bindings(): InterceptorBinding[] {
return runtimeInterceptors();
Expand Down
Loading