forked from Dicklesworthstone/pi_agent_rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextension.wit
More file actions
32 lines (25 loc) · 1.07 KB
/
extension.wit
File metadata and controls
32 lines (25 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package pi:extension;
/// Host-provided connector surface (capability-gated by Pi).
///
/// This is intentionally narrow. Extensions should call into Pi using a small
/// set of connector operations rather than Node/Bun OS APIs.
interface host {
/// Generic connector call. Input/output are JSON strings.
call: func(name: string, input-json: string) -> result<string, string>;
}
interface extension {
/// Initialize the extension and return its registration payload (JSON).
init: func(manifest-json: string) -> result<string, string>;
/// Handle a tool call. Returns tool_result JSON.
handle-tool: func(name: string, input-json: string) -> result<string, string>;
/// Handle a slash command. Returns slash_result JSON.
handle-slash: func(command: string, args: list<string>, input-json: string) -> result<string, string>;
/// Handle an event hook. Returns optional event response JSON.
handle-event: func(event-json: string) -> result<string, string>;
/// Clean shutdown (optional).
shutdown: func();
}
world pi-extension {
import host;
export extension;
}