@av-pi-studio/protocol 0.0.115 → 0.0.116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/client-capabilities.d.ts +1 -0
- package/dist/client-capabilities.js +3 -0
- package/dist/messages.d.ts +13384 -0
- package/dist/messages.js +164 -1
- package/fixtures/external-clients/.signatures.json +559 -0
- package/fixtures/external-clients/CHANGELOG.md +18 -0
- package/fixtures/external-clients/README.md +94 -0
- package/fixtures/external-clients/agent_archived.json +17 -0
- package/fixtures/external-clients/agent_deleted.json +16 -0
- package/fixtures/external-clients/agent_session_stats_request.json +17 -0
- package/fixtures/external-clients/agent_session_stats_response.json +30 -0
- package/fixtures/external-clients/agent_status.json +17 -0
- package/fixtures/external-clients/agent_stream.assistant_message.json +29 -0
- package/fixtures/external-clients/agent_stream.compaction.json +29 -0
- package/fixtures/external-clients/agent_stream.error.json +22 -0
- package/fixtures/external-clients/agent_stream.reasoning.json +22 -0
- package/fixtures/external-clients/agent_stream.tool_call.json +27 -0
- package/fixtures/external-clients/agent_stream.tool_call.partial.json +28 -0
- package/fixtures/external-clients/agent_stream.turn_canceled.json +22 -0
- package/fixtures/external-clients/agent_stream.turn_completed.json +22 -0
- package/fixtures/external-clients/agent_stream.turn_failed.json +23 -0
- package/fixtures/external-clients/agent_stream.turn_started.json +22 -0
- package/fixtures/external-clients/agent_stream.user_message.json +28 -0
- package/fixtures/external-clients/agent_timeline_reset.json +17 -0
- package/fixtures/external-clients/agent_ui_list_request.json +17 -0
- package/fixtures/external-clients/agent_ui_list_response.json +50 -0
- package/fixtures/external-clients/agent_ui_request.confirm.json +24 -0
- package/fixtures/external-clients/agent_ui_request.editor.json +24 -0
- package/fixtures/external-clients/agent_ui_request.input.json +24 -0
- package/fixtures/external-clients/agent_ui_request.notify.json +23 -0
- package/fixtures/external-clients/agent_ui_request.select.json +24 -0
- package/fixtures/external-clients/agent_ui_request.setStatus.json +24 -0
- package/fixtures/external-clients/agent_ui_request.setStatus.removed.json +23 -0
- package/fixtures/external-clients/agent_ui_resolved.aborted.json +18 -0
- package/fixtures/external-clients/agent_ui_resolved.answered.json +18 -0
- package/fixtures/external-clients/agent_ui_resolved.cancelled.json +18 -0
- package/fixtures/external-clients/agent_ui_resolved.timeout.json +18 -0
- package/fixtures/external-clients/agent_ui_respond_request.confirm.json +20 -0
- package/fixtures/external-clients/agent_ui_respond_request.select.json +20 -0
- package/fixtures/external-clients/agent_ui_respond_response.not_found.json +20 -0
- package/fixtures/external-clients/agent_ui_respond_response.ok.json +19 -0
- package/fixtures/external-clients/agent_update.json +18 -0
- package/fixtures/external-clients/agent_update.model.json +18 -0
- package/fixtures/external-clients/daemon_log_lines.json +23 -0
- package/fixtures/external-clients/daemon_logs_subscribe_request.json +18 -0
- package/fixtures/external-clients/daemon_logs_subscribe_response.json +34 -0
- package/fixtures/external-clients/daemon_logs_unsubscribe_request.json +16 -0
- package/fixtures/external-clients/daemon_logs_unsubscribe_response.json +19 -0
- package/fixtures/external-clients/daemon_status_request.json +16 -0
- package/fixtures/external-clients/daemon_status_response.json +60 -0
- package/fixtures/external-clients/daemon_status_subscribe_request.json +16 -0
- package/fixtures/external-clients/daemon_status_subscribe_response.json +64 -0
- package/fixtures/external-clients/daemon_status_unsubscribe_request.json +16 -0
- package/fixtures/external-clients/daemon_status_unsubscribe_response.json +19 -0
- package/fixtures/external-clients/daemon_status_update.json +58 -0
- package/fixtures/external-clients/fetch_agent_timeline_request.json +19 -0
- package/fixtures/external-clients/fetch_agent_timeline_response.json +55 -0
- package/fixtures/external-clients/health.json +16 -0
- package/fixtures/external-clients/hello.json +19 -0
- package/fixtures/external-clients/interrupt_agent.json +17 -0
- package/fixtures/external-clients/interrupt_response.json +18 -0
- package/fixtures/external-clients/list_agents_request.json +16 -0
- package/fixtures/external-clients/list_agents_response.json +39 -0
- package/fixtures/external-clients/manifest.json +321 -0
- package/fixtures/external-clients/ping.json +14 -0
- package/fixtures/external-clients/pong.json +16 -0
- package/fixtures/external-clients/rpc_error.json +18 -0
- package/fixtures/external-clients/status.server_info.json +27 -0
- package/package.json +5 -3
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# External-client wire fixtures
|
|
2
|
+
|
|
3
|
+
Canonical JSON frames for every Pi Studio wire message that a client **outside this repository**
|
|
4
|
+
consumes or sends (first consumer: the Rust Pi Studio Dashboard). They are the machine-checkable
|
|
5
|
+
contract the Zod-only protocol cannot give: many list/stat/orchestration responses have no schema.
|
|
6
|
+
|
|
7
|
+
- **Location (published):** `packages/protocol/fixtures/external-clients/` — shipped in the
|
|
8
|
+
`@av-pi-studio/protocol` npm package under `fixtures/external-clients/`. The path is part of the
|
|
9
|
+
contract; external vendoring scripts reference it verbatim.
|
|
10
|
+
- **Consumer workflow:** copy this directory into your repo (record the pi-studio version or git
|
|
11
|
+
commit you copied from) and deserialize every fixture with your own types in your own tests.
|
|
12
|
+
- **Enforcement here:** `src/external-fixtures.test.ts` (this package, no daemon) and
|
|
13
|
+
`packages/server/src/daemon/external-fixtures-e2e.test.ts` (an in-process dev daemon) fail when a
|
|
14
|
+
fixture is malformed, unlisted, schema-invalid, or no longer matches what the daemon really sends.
|
|
15
|
+
|
|
16
|
+
## Files
|
|
17
|
+
|
|
18
|
+
| File | Purpose |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `manifest.json` | `{"formatVersion": N, "messages": [{"file","type","direction","response?","exception?"}]}` — lists every fixture; a file not in the manifest (or vice versa) fails the test |
|
|
21
|
+
| `<type>[.<variant>].json` | One fixture per message type; a type with materially different shapes gets one file per variant (`agent_stream.tool_call.partial.json`, `agent_ui_request.confirm.json`) |
|
|
22
|
+
| `CHANGELOG.md` | Dated entries for every breaking change (see below) |
|
|
23
|
+
| `.signatures.json` | Generated shape signatures used by the breaking-change guard — never edit by hand |
|
|
24
|
+
|
|
25
|
+
## Fixture format
|
|
26
|
+
|
|
27
|
+
```jsonc
|
|
28
|
+
{
|
|
29
|
+
"type": "agent_session_stats_response", // the message `type`
|
|
30
|
+
"direction": "server_to_client", // | "client_to_server" | "http" (health)
|
|
31
|
+
"description": "…",
|
|
32
|
+
"since": "0.0.115", // pi-studio version that introduced this shape
|
|
33
|
+
"stage": 1, // informational (dashboard staging)
|
|
34
|
+
"requiresFeature": null, // e.g. "extensionUi": a status.features flag
|
|
35
|
+
"volatile": ["/message/requestId", "/message/payload/sessionId"], // JSON Pointers into `frame`
|
|
36
|
+
"frame": { … } // the COMPLETE frame as sent on the socket
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- `frame` is the full top-level frame: `{"type":"session","message":{…}}` for session messages, the
|
|
41
|
+
bare `{"type":"status","payload":…}` / `{"type":"ping"}` / `{"type":"pong"}` forms for the rest.
|
|
42
|
+
For `health` (HTTP) it is `{status, contentType, body}`.
|
|
43
|
+
- `volatile` lists JSON Pointers whose **values** change per run (ids, timestamps, counters, paths,
|
|
44
|
+
model names). Their presence and JSON type are still part of the contract; only the value is not
|
|
45
|
+
compared. Every other value is literal and compared exactly against the live daemon.
|
|
46
|
+
- Arrays hold **one representative element**; the daemon may send more. `null` and an absent key
|
|
47
|
+
are different: a field shown as `null` is emitted as `null`.
|
|
48
|
+
- `status.server_info.features` pins only a few stable flags; the daemon may send more.
|
|
49
|
+
- Timestamps use the form the daemon emits: epoch milliseconds for `pong`, `agent_ui_*` and
|
|
50
|
+
`list_agents_response.lastActivity`; ISO-8601 strings for `agent_stream.timestamp` and
|
|
51
|
+
`agent_archived.archivedAt`.
|
|
52
|
+
- Fixtures contain **no secrets**: no real tokens, passwords, hosts or home paths — use obviously
|
|
53
|
+
fake literals. The Layer A test scans for secret-looking keys.
|
|
54
|
+
|
|
55
|
+
### Manifest `response` and `exception`
|
|
56
|
+
|
|
57
|
+
- A `client_to_server` entry carries `response`: the fixture the daemon must answer with when the
|
|
58
|
+
request is sent (never `rpc_error`).
|
|
59
|
+
- `exception` marks a fixture that **no daemon code path emits today** (schema only). It is
|
|
60
|
+
validated against its Zod schema but has no live-output check. A message with no Zod schema can
|
|
61
|
+
never be an exception. Current exceptions: `agent_status`, `agent_ui_resolved.cancelled`.
|
|
62
|
+
- The tool-permission family (`agent_permission_*`, `agent.permission.respond.*`) was retired in
|
|
63
|
+
sprint-086 and deliberately has no fixtures.
|
|
64
|
+
|
|
65
|
+
## Compatibility rule ("bump + note")
|
|
66
|
+
|
|
67
|
+
These files are the published contract for clients outside this repo. Therefore:
|
|
68
|
+
|
|
69
|
+
- **Additive change** — a new optional field, a new variant file, a new message: add or extend the
|
|
70
|
+
fixture. Nothing else is required; the live test accepts extra daemon fields.
|
|
71
|
+
- **Breaking change** — a field removed, renamed or retyped (including narrowing, or optional →
|
|
72
|
+
required), a variant file removed, or a `requiresFeature` changed. Allowed only with **all** of:
|
|
73
|
+
1. the fixture edited in the same commit as the daemon/schema change;
|
|
74
|
+
2. `formatVersion` in `manifest.json` incremented **and** a dated entry in `CHANGELOG.md` naming
|
|
75
|
+
the changed file(s) and the migration for consumers;
|
|
76
|
+
3. a `COMPAT(...)` note if an older daemon still emits the old shape (MAIN-SCOPE § 9 already
|
|
77
|
+
forbids breaking wire changes — this makes the consequence mechanical for external readers).
|
|
78
|
+
|
|
79
|
+
The signature guard enforces (2): it fails when a leaf path that existed in `.signatures.json` is
|
|
80
|
+
missing or has a different JSON type in the current fixtures, unless `formatVersion` is higher than
|
|
81
|
+
the recorded one and `CHANGELOG.md` mentions the file. Added leaves always pass.
|
|
82
|
+
|
|
83
|
+
## Adding or changing a fixture
|
|
84
|
+
|
|
85
|
+
1. Print a candidate from a real dev daemon (not run in CI):
|
|
86
|
+
`npm run build:server && node packages/server/scripts/record-external-fixtures.ts`
|
|
87
|
+
(`--write <dir>` writes `{ "frame": … }` candidates, never overwriting without `--force`).
|
|
88
|
+
2. Author/edit `<type>[.<variant>].json` with the metadata above; canonicalize ids to fake values and
|
|
89
|
+
list every per-run value in `volatile`.
|
|
90
|
+
3. Add it to `manifest.json` (with `response` for requests).
|
|
91
|
+
4. Run `npx vitest run packages/protocol/src/external-fixtures.test.ts` and
|
|
92
|
+
`npx vitest run packages/server/src/daemon/external-fixtures-e2e.test.ts`.
|
|
93
|
+
5. Regenerate signatures: `npm run fixtures:update -w @av-pi-studio/protocol`.
|
|
94
|
+
6. Breaking change? Bump `formatVersion` first and add the `CHANGELOG.md` entry (rule above).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_archived",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "An agent was archived (soft delete).",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId", "/message/archivedAt"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_archived",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"archivedAt": "2026-01-01T00:00:00.000Z"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_deleted",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "An agent was deleted.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_deleted",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_session_stats_request",
|
|
3
|
+
"direction": "client_to_server",
|
|
4
|
+
"description": "Poll session statistics for one live agent.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/requestId", "/message/agentId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_session_stats_request",
|
|
13
|
+
"requestId": "req-1",
|
|
14
|
+
"agentId": "agent-1"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_session_stats_response",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "Session statistics. payload is passthrough; the dev daemon's stable subset is pinned, a real Pi agent adds more fields.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": [
|
|
9
|
+
"/message/payload/sessionId",
|
|
10
|
+
"/message/payload/totalMessages",
|
|
11
|
+
"/message/requestId",
|
|
12
|
+
"/message/payload/model",
|
|
13
|
+
"/message/payload/tokens/total"
|
|
14
|
+
],
|
|
15
|
+
"frame": {
|
|
16
|
+
"type": "session",
|
|
17
|
+
"message": {
|
|
18
|
+
"type": "agent_session_stats_response",
|
|
19
|
+
"payload": {
|
|
20
|
+
"sessionId": "00000000-0000-4000-8000-000000000001",
|
|
21
|
+
"totalMessages": 22,
|
|
22
|
+
"tokens": {
|
|
23
|
+
"total": 0
|
|
24
|
+
},
|
|
25
|
+
"model": "mock-model"
|
|
26
|
+
},
|
|
27
|
+
"requestId": "req-1"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_status",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "Agent status message. Defined by agentStatusMessageSchema but no daemon code path emits it today.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_status",
|
|
13
|
+
"agentId": "agent-1",
|
|
14
|
+
"status": "idle"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "agent_stream frame carrying a assistant_message event.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": [
|
|
9
|
+
"/message/agentId",
|
|
10
|
+
"/message/seq",
|
|
11
|
+
"/message/timestamp",
|
|
12
|
+
"/message/event/messageId"
|
|
13
|
+
],
|
|
14
|
+
"frame": {
|
|
15
|
+
"type": "session",
|
|
16
|
+
"message": {
|
|
17
|
+
"type": "agent_stream",
|
|
18
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
19
|
+
"seq": 2,
|
|
20
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
21
|
+
"event": {
|
|
22
|
+
"kind": "assistant_message",
|
|
23
|
+
"messageId": "00000000-0000-4000-8000-000000000002",
|
|
24
|
+
"text": "echo: hello",
|
|
25
|
+
"final": true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "Context compaction lifecycle event (this one is the started phase).",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": "compactionEvents",
|
|
8
|
+
"volatile": [
|
|
9
|
+
"/message/agentId",
|
|
10
|
+
"/message/seq",
|
|
11
|
+
"/message/timestamp",
|
|
12
|
+
"/message/event/compactionId"
|
|
13
|
+
],
|
|
14
|
+
"frame": {
|
|
15
|
+
"type": "session",
|
|
16
|
+
"message": {
|
|
17
|
+
"type": "agent_stream",
|
|
18
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
19
|
+
"seq": 26,
|
|
20
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
21
|
+
"event": {
|
|
22
|
+
"kind": "compaction",
|
|
23
|
+
"compactionId": "00000000-0000-4000-8000-000000000002",
|
|
24
|
+
"phase": "started",
|
|
25
|
+
"reason": "manual"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "agent_stream frame carrying a error event.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId", "/message/seq", "/message/timestamp"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_stream",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"seq": 21,
|
|
15
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
16
|
+
"event": {
|
|
17
|
+
"kind": "error",
|
|
18
|
+
"message": "mock stream error"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "agent_stream frame carrying a reasoning event.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId", "/message/seq", "/message/timestamp"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_stream",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"seq": 12,
|
|
15
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
16
|
+
"event": {
|
|
17
|
+
"kind": "reasoning",
|
|
18
|
+
"text": "mock reasoning"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "agent_stream frame carrying a tool_call event.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId", "/message/seq", "/message/timestamp", "/message/event/callId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_stream",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"seq": 6,
|
|
15
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
16
|
+
"event": {
|
|
17
|
+
"kind": "tool_call",
|
|
18
|
+
"callId": "00000000-0000-4000-8000-000000000002",
|
|
19
|
+
"status": "running",
|
|
20
|
+
"tool": {
|
|
21
|
+
"kind": "shell",
|
|
22
|
+
"command": "npm test"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "Ephemeral in-flight tool output snapshot: broadcast WITHOUT seq, never persisted or replayed; supersedes earlier output by callId.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId", "/message/timestamp", "/message/event/callId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_stream",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
15
|
+
"event": {
|
|
16
|
+
"kind": "tool_call",
|
|
17
|
+
"callId": "00000000-0000-4000-8000-000000000002",
|
|
18
|
+
"status": "running",
|
|
19
|
+
"partial": true,
|
|
20
|
+
"tool": {
|
|
21
|
+
"kind": "shell",
|
|
22
|
+
"command": "npm test",
|
|
23
|
+
"output": "> running suite A"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "agent_stream frame carrying a turn_canceled event.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId", "/message/seq", "/message/timestamp", "/message/event/turnId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_stream",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"seq": 25,
|
|
15
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
16
|
+
"event": {
|
|
17
|
+
"kind": "turn_canceled",
|
|
18
|
+
"turnId": "00000000-0000-4000-8000-000000000002"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "agent_stream frame carrying a turn_completed event.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId", "/message/seq", "/message/timestamp", "/message/event/turnId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_stream",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"seq": 3,
|
|
15
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
16
|
+
"event": {
|
|
17
|
+
"kind": "turn_completed",
|
|
18
|
+
"turnId": "00000000-0000-4000-8000-000000000002"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "agent_stream frame carrying a turn_failed event.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId", "/message/seq", "/message/timestamp", "/message/event/turnId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_stream",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"seq": 18,
|
|
15
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
16
|
+
"event": {
|
|
17
|
+
"kind": "turn_failed",
|
|
18
|
+
"turnId": "00000000-0000-4000-8000-000000000002",
|
|
19
|
+
"error": "mock turn failure"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "agent_stream frame carrying a turn_started event.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": ["/message/agentId", "/message/seq", "/message/timestamp", "/message/event/turnId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_stream",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"seq": 1,
|
|
15
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
16
|
+
"event": {
|
|
17
|
+
"kind": "turn_started",
|
|
18
|
+
"turnId": "00000000-0000-4000-8000-000000000002"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_stream",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "agent_stream frame carrying a user_message event.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": null,
|
|
8
|
+
"volatile": [
|
|
9
|
+
"/message/agentId",
|
|
10
|
+
"/message/seq",
|
|
11
|
+
"/message/timestamp",
|
|
12
|
+
"/message/event/messageId"
|
|
13
|
+
],
|
|
14
|
+
"frame": {
|
|
15
|
+
"type": "session",
|
|
16
|
+
"message": {
|
|
17
|
+
"type": "agent_stream",
|
|
18
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
19
|
+
"seq": 0,
|
|
20
|
+
"timestamp": "2026-01-01T00:00:00.000Z",
|
|
21
|
+
"event": {
|
|
22
|
+
"kind": "user_message",
|
|
23
|
+
"messageId": "00000000-0000-4000-8000-000000000002",
|
|
24
|
+
"text": "hello"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_timeline_reset",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "The agent's timeline was replaced (after a fork); clients must refetch it. No Zod schema.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": "forkTimelineSync",
|
|
8
|
+
"volatile": ["/message/agentId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_timeline_reset",
|
|
13
|
+
"agentId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"reason": "fork"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_ui_list_request",
|
|
3
|
+
"direction": "client_to_server",
|
|
4
|
+
"description": "Late-join catch-up: list pending dialogs and retained surfaces for one agent (omit agentId for all agents).",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": "extensionUi",
|
|
8
|
+
"volatile": ["/message/requestId", "/message/agentId"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_ui_list_request",
|
|
13
|
+
"requestId": "req-1",
|
|
14
|
+
"agentId": "agent-1"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_ui_list_response",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "Pending dialogs and retained surfaces (each array holds one representative element).",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": "extensionUi",
|
|
8
|
+
"volatile": [
|
|
9
|
+
"/message/payload/pending/0/requestId",
|
|
10
|
+
"/message/payload/pending/0/agentId",
|
|
11
|
+
"/message/payload/pending/0/createdAt",
|
|
12
|
+
"/message/payload/surfaces/0/agentId",
|
|
13
|
+
"/message/payload/surfaces/0/updatedAt",
|
|
14
|
+
"/message/requestId"
|
|
15
|
+
],
|
|
16
|
+
"frame": {
|
|
17
|
+
"type": "session",
|
|
18
|
+
"message": {
|
|
19
|
+
"type": "agent_ui_list_response",
|
|
20
|
+
"payload": {
|
|
21
|
+
"ok": true,
|
|
22
|
+
"pending": [
|
|
23
|
+
{
|
|
24
|
+
"requestId": "00000000-0000-4000-8000-000000000001",
|
|
25
|
+
"agentId": "00000000-0000-4000-8000-000000000002",
|
|
26
|
+
"method": "select",
|
|
27
|
+
"expectsResponse": true,
|
|
28
|
+
"payload": {
|
|
29
|
+
"title": "Pick one",
|
|
30
|
+
"options": ["a", "b"]
|
|
31
|
+
},
|
|
32
|
+
"createdAt": 1767225600000
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"surfaces": [
|
|
36
|
+
{
|
|
37
|
+
"agentId": "00000000-0000-4000-8000-000000000002",
|
|
38
|
+
"method": "setStatus",
|
|
39
|
+
"surfaceKey": "status:build",
|
|
40
|
+
"payload": {
|
|
41
|
+
"statusText": "building"
|
|
42
|
+
},
|
|
43
|
+
"updatedAt": 1767225600000
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"requestId": "req-1"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_ui_request",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "Answerable dialog: yes/no (expectsResponse true).",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": "extensionUi",
|
|
8
|
+
"volatile": ["/message/requestId", "/message/agentId", "/message/createdAt"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_ui_request",
|
|
13
|
+
"requestId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"agentId": "00000000-0000-4000-8000-000000000002",
|
|
15
|
+
"method": "confirm",
|
|
16
|
+
"expectsResponse": true,
|
|
17
|
+
"payload": {
|
|
18
|
+
"title": "Proceed?",
|
|
19
|
+
"message": "Apply the change?"
|
|
20
|
+
},
|
|
21
|
+
"createdAt": 1767225600000
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_ui_request",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "Multi-line editor dialog; the dashboard hands this off to the web client.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": "extensionUi",
|
|
8
|
+
"volatile": ["/message/requestId", "/message/agentId", "/message/createdAt"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_ui_request",
|
|
13
|
+
"requestId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"agentId": "00000000-0000-4000-8000-000000000002",
|
|
15
|
+
"method": "editor",
|
|
16
|
+
"expectsResponse": true,
|
|
17
|
+
"payload": {
|
|
18
|
+
"title": "Edit",
|
|
19
|
+
"prefill": "text"
|
|
20
|
+
},
|
|
21
|
+
"createdAt": 1767225600000
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "agent_ui_request",
|
|
3
|
+
"direction": "server_to_client",
|
|
4
|
+
"description": "Free-text dialog; the dashboard hands this off to the web client.",
|
|
5
|
+
"since": "0.0.115",
|
|
6
|
+
"stage": 1,
|
|
7
|
+
"requiresFeature": "extensionUi",
|
|
8
|
+
"volatile": ["/message/requestId", "/message/agentId", "/message/createdAt"],
|
|
9
|
+
"frame": {
|
|
10
|
+
"type": "session",
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "agent_ui_request",
|
|
13
|
+
"requestId": "00000000-0000-4000-8000-000000000001",
|
|
14
|
+
"agentId": "00000000-0000-4000-8000-000000000002",
|
|
15
|
+
"method": "input",
|
|
16
|
+
"expectsResponse": true,
|
|
17
|
+
"payload": {
|
|
18
|
+
"title": "Name",
|
|
19
|
+
"placeholder": "name"
|
|
20
|
+
},
|
|
21
|
+
"createdAt": 1767225600000
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|