@av-pi-studio/protocol 0.0.116 → 0.0.118

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.
Files changed (40) hide show
  1. package/dist/client-capabilities.d.ts +5 -0
  2. package/dist/client-capabilities.js +7 -0
  3. package/dist/messages.d.ts +1606 -1
  4. package/dist/messages.js +37 -1
  5. package/fixtures/external-clients/.signatures.json +174 -0
  6. package/fixtures/external-clients/CHANGELOG.md +28 -0
  7. package/fixtures/external-clients/README.md +52 -0
  8. package/fixtures/external-clients/binary/file_transfer.begin.json +18 -0
  9. package/fixtures/external-clients/binary/file_transfer.chunk.json +13 -0
  10. package/fixtures/external-clients/binary/file_transfer.end.json +13 -0
  11. package/fixtures/external-clients/binary/file_transfer.error.json +13 -0
  12. package/fixtures/external-clients/binary/manifest.json +59 -0
  13. package/fixtures/external-clients/binary/terminal.input.json +13 -0
  14. package/fixtures/external-clients/binary/terminal.output.json +13 -0
  15. package/fixtures/external-clients/binary/terminal.resize.json +14 -0
  16. package/fixtures/external-clients/binary/terminal.restore.json +13 -0
  17. package/fixtures/external-clients/binary/terminal.snapshot.json +13 -0
  18. package/fixtures/external-clients/capture_terminal_request.json +17 -0
  19. package/fixtures/external-clients/capture_terminal_response.json +19 -0
  20. package/fixtures/external-clients/create_terminal_request.json +22 -0
  21. package/fixtures/external-clients/create_terminal_response.json +31 -0
  22. package/fixtures/external-clients/file_download_request.json +18 -0
  23. package/fixtures/external-clients/file_download_response.json +19 -0
  24. package/fixtures/external-clients/file_download_token_request.json +17 -0
  25. package/fixtures/external-clients/file_download_token_response.json +19 -0
  26. package/fixtures/external-clients/file_upload_complete.json +19 -0
  27. package/fixtures/external-clients/file_upload_request.json +19 -0
  28. package/fixtures/external-clients/file_upload_response.json +18 -0
  29. package/fixtures/external-clients/hello.platform.json +20 -0
  30. package/fixtures/external-clients/kill_terminal_request.json +17 -0
  31. package/fixtures/external-clients/kill_terminal_response.json +18 -0
  32. package/fixtures/external-clients/list_terminals_request.json +16 -0
  33. package/fixtures/external-clients/list_terminals_response.json +33 -0
  34. package/fixtures/external-clients/manifest.json +115 -0
  35. package/fixtures/external-clients/rename_terminal_request.json +18 -0
  36. package/fixtures/external-clients/rename_terminal_response.json +18 -0
  37. package/fixtures/external-clients/subscribe_terminal_request.json +19 -0
  38. package/fixtures/external-clients/subscribe_terminal_response.json +21 -0
  39. package/fixtures/external-clients/terminals_update.json +31 -0
  40. package/package.json +1 -1
@@ -0,0 +1,31 @@
1
+ {
2
+ "type": "create_terminal_response",
3
+ "direction": "server_to_client",
4
+ "description": "The new terminal's inventory entry (the PTY's real grid size). `service` appears only for script-backed terminals.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": [
9
+ "/message/requestId",
10
+ "/message/terminal/slot",
11
+ "/message/terminal/name",
12
+ "/message/terminal/cwd"
13
+ ],
14
+ "frame": {
15
+ "type": "session",
16
+ "message": {
17
+ "type": "create_terminal_response",
18
+ "terminal": {
19
+ "slot": 1,
20
+ "workspaceId": "workspace-1",
21
+ "name": "terminal-1",
22
+ "cwd": "/tmp/pi-studio-fixture",
23
+ "shell": "/bin/sh",
24
+ "cols": 80,
25
+ "rows": 24,
26
+ "closed": false
27
+ },
28
+ "requestId": "req-1"
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "type": "file_download_request",
3
+ "direction": "client_to_server",
4
+ "description": "Redeem the token: the daemon streams Begin/Chunk*/End binary file-transfer frames on `stream` (omit `stream` to let the daemon pick), then answers.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/token", "/message/stream"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "file_download_request",
13
+ "requestId": "req-1",
14
+ "token": "FAKE",
15
+ "stream": 1
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "type": "file_download_response",
3
+ "direction": "server_to_client",
4
+ "description": "Sent after the End frame. On failure `ok:false` with `error` (invalid_or_expired_token, invalid_stream, read_failed, connection_closed).",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/stream", "/message/transferId"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "file_download_response",
13
+ "stream": 1,
14
+ "ok": true,
15
+ "transferId": "dl-1-1767225600000",
16
+ "requestId": "req-1"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "type": "file_download_token_request",
3
+ "direction": "client_to_server",
4
+ "description": "Ask for a single-use download token for a file path on the daemon host.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/path"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "file_download_token_request",
13
+ "requestId": "req-1",
14
+ "path": "/tmp/pi-studio-fixture/download.txt"
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "type": "file_download_token_response",
3
+ "direction": "server_to_client",
4
+ "description": "Token plus its expiry (epoch ms). Failure is `{ok:false,error:\"not_found\"}` with no token.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/token", "/message/expiresAt"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "file_download_token_response",
13
+ "ok": true,
14
+ "token": "FAKE",
15
+ "expiresAt": 1767225600000,
16
+ "requestId": "req-1"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "type": "file_upload_complete",
3
+ "direction": "server_to_client",
4
+ "description": "Push after an upload stream ends, only when the request carried `ack:true`. `error` is present only when `ok` is false.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": "fileTransferAck",
8
+ "volatile": ["/message/transferId", "/message/stream", "/message/bytesWritten"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "file_upload_complete",
13
+ "transferId": "transfer-1",
14
+ "stream": 1,
15
+ "ok": true,
16
+ "bytesWritten": 30
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "type": "file_upload_request",
3
+ "direction": "client_to_server",
4
+ "description": "Open an upload: the daemon assigns a stream; the client then sends Begin/Chunk*/End binary frames on it. `ack:true` asks for a `file_upload_complete` push when the stream ends.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": "fileTransferAck",
8
+ "volatile": ["/message/requestId", "/message/path", "/message/transferId"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "file_upload_request",
13
+ "requestId": "req-1",
14
+ "path": "/tmp/pi-studio-fixture/upload.txt",
15
+ "transferId": "transfer-1",
16
+ "ack": true
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "type": "file_upload_response",
3
+ "direction": "server_to_client",
4
+ "description": "The stream the client must use. Failure: `ok:false` with `error` (missing_fields, no_free_stream).",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/stream"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "file_upload_response",
13
+ "ok": true,
14
+ "stream": 1,
15
+ "requestId": "req-1"
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "type": "hello",
3
+ "direction": "client_to_server",
4
+ "description": "Handshake from the desktop app: clientType stays \"browser\" (the enum is closed; a daemon up to 0.0.117 rejects unknown values), and the optional platform string says what kind of client it is. Daemons that predate the field ignore it.",
5
+ "since": "0.0.118",
6
+ "stage": 1,
7
+ "requiresFeature": null,
8
+ "volatile": ["/clientId"],
9
+ "frame": {
10
+ "type": "hello",
11
+ "clientId": "client-1",
12
+ "clientType": "browser",
13
+ "platform": "desktop",
14
+ "protocolVersion": 1,
15
+ "appVersion": "pistudiodesktop/0.1.0",
16
+ "capabilities": {
17
+ "reasoning_merge_enum": true
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "type": "kill_terminal_request",
3
+ "direction": "client_to_server",
4
+ "description": "Kill a terminal's PTY.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/slot"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "kill_terminal_request",
13
+ "requestId": "req-1",
14
+ "slot": 1
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "type": "kill_terminal_response",
3
+ "direction": "server_to_client",
4
+ "description": "`ok:false` when the slot does not exist. A kill also broadcasts `terminals_update`.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/slot"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "kill_terminal_response",
13
+ "slot": 1,
14
+ "ok": true,
15
+ "requestId": "req-1"
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "type": "list_terminals_request",
3
+ "direction": "client_to_server",
4
+ "description": "List every live terminal.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "list_terminals_request",
13
+ "requestId": "req-1"
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "type": "list_terminals_response",
3
+ "direction": "server_to_client",
4
+ "description": "The terminal inventory (one representative element).",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": [
9
+ "/message/requestId",
10
+ "/message/terminals/0/slot",
11
+ "/message/terminals/0/name",
12
+ "/message/terminals/0/cwd"
13
+ ],
14
+ "frame": {
15
+ "type": "session",
16
+ "message": {
17
+ "type": "list_terminals_response",
18
+ "terminals": [
19
+ {
20
+ "slot": 1,
21
+ "workspaceId": "workspace-1",
22
+ "name": "terminal-1",
23
+ "cwd": "/tmp/pi-studio-fixture",
24
+ "shell": "/bin/sh",
25
+ "cols": 80,
26
+ "rows": 24,
27
+ "closed": false
28
+ }
29
+ ],
30
+ "requestId": "req-1"
31
+ }
32
+ }
33
+ }
@@ -187,6 +187,28 @@
187
187
  "type": "agent_update",
188
188
  "direction": "server_to_client"
189
189
  },
190
+ {
191
+ "file": "capture_terminal_request.json",
192
+ "type": "capture_terminal_request",
193
+ "direction": "client_to_server",
194
+ "response": "capture_terminal_response.json"
195
+ },
196
+ {
197
+ "file": "capture_terminal_response.json",
198
+ "type": "capture_terminal_response",
199
+ "direction": "server_to_client"
200
+ },
201
+ {
202
+ "file": "create_terminal_request.json",
203
+ "type": "create_terminal_request",
204
+ "direction": "client_to_server",
205
+ "response": "create_terminal_response.json"
206
+ },
207
+ {
208
+ "file": "create_terminal_response.json",
209
+ "type": "create_terminal_response",
210
+ "direction": "server_to_client"
211
+ },
190
212
  {
191
213
  "file": "daemon_log_lines.json",
192
214
  "type": "daemon_log_lines",
@@ -263,6 +285,44 @@
263
285
  "type": "fetch_agent_timeline_response",
264
286
  "direction": "server_to_client"
265
287
  },
288
+ {
289
+ "file": "file_download_request.json",
290
+ "type": "file_download_request",
291
+ "direction": "client_to_server",
292
+ "response": "file_download_response.json"
293
+ },
294
+ {
295
+ "file": "file_download_response.json",
296
+ "type": "file_download_response",
297
+ "direction": "server_to_client"
298
+ },
299
+ {
300
+ "file": "file_download_token_request.json",
301
+ "type": "file_download_token_request",
302
+ "direction": "client_to_server",
303
+ "response": "file_download_token_response.json"
304
+ },
305
+ {
306
+ "file": "file_download_token_response.json",
307
+ "type": "file_download_token_response",
308
+ "direction": "server_to_client"
309
+ },
310
+ {
311
+ "file": "file_upload_complete.json",
312
+ "type": "file_upload_complete",
313
+ "direction": "server_to_client"
314
+ },
315
+ {
316
+ "file": "file_upload_request.json",
317
+ "type": "file_upload_request",
318
+ "direction": "client_to_server",
319
+ "response": "file_upload_response.json"
320
+ },
321
+ {
322
+ "file": "file_upload_response.json",
323
+ "type": "file_upload_response",
324
+ "direction": "server_to_client"
325
+ },
266
326
  {
267
327
  "file": "health.json",
268
328
  "type": "health",
@@ -274,6 +334,12 @@
274
334
  "direction": "client_to_server",
275
335
  "response": "status.server_info.json"
276
336
  },
337
+ {
338
+ "file": "hello.platform.json",
339
+ "type": "hello",
340
+ "direction": "client_to_server",
341
+ "response": "status.server_info.json"
342
+ },
277
343
  {
278
344
  "file": "interrupt_agent.json",
279
345
  "type": "interrupt_agent",
@@ -285,6 +351,17 @@
285
351
  "type": "interrupt_response",
286
352
  "direction": "server_to_client"
287
353
  },
354
+ {
355
+ "file": "kill_terminal_request.json",
356
+ "type": "kill_terminal_request",
357
+ "direction": "client_to_server",
358
+ "response": "kill_terminal_response.json"
359
+ },
360
+ {
361
+ "file": "kill_terminal_response.json",
362
+ "type": "kill_terminal_response",
363
+ "direction": "server_to_client"
364
+ },
288
365
  {
289
366
  "file": "list_agents_request.json",
290
367
  "type": "list_agents_request",
@@ -296,6 +373,17 @@
296
373
  "type": "list_agents_response",
297
374
  "direction": "server_to_client"
298
375
  },
376
+ {
377
+ "file": "list_terminals_request.json",
378
+ "type": "list_terminals_request",
379
+ "direction": "client_to_server",
380
+ "response": "list_terminals_response.json"
381
+ },
382
+ {
383
+ "file": "list_terminals_response.json",
384
+ "type": "list_terminals_response",
385
+ "direction": "server_to_client"
386
+ },
299
387
  {
300
388
  "file": "ping.json",
301
389
  "type": "ping",
@@ -307,6 +395,17 @@
307
395
  "type": "pong",
308
396
  "direction": "server_to_client"
309
397
  },
398
+ {
399
+ "file": "rename_terminal_request.json",
400
+ "type": "rename_terminal_request",
401
+ "direction": "client_to_server",
402
+ "response": "rename_terminal_response.json"
403
+ },
404
+ {
405
+ "file": "rename_terminal_response.json",
406
+ "type": "rename_terminal_response",
407
+ "direction": "server_to_client"
408
+ },
310
409
  {
311
410
  "file": "rpc_error.json",
312
411
  "type": "rpc_error",
@@ -316,6 +415,22 @@
316
415
  "file": "status.server_info.json",
317
416
  "type": "status",
318
417
  "direction": "server_to_client"
418
+ },
419
+ {
420
+ "file": "subscribe_terminal_request.json",
421
+ "type": "subscribe_terminal_request",
422
+ "direction": "client_to_server",
423
+ "response": "subscribe_terminal_response.json"
424
+ },
425
+ {
426
+ "file": "subscribe_terminal_response.json",
427
+ "type": "subscribe_terminal_response",
428
+ "direction": "server_to_client"
429
+ },
430
+ {
431
+ "file": "terminals_update.json",
432
+ "type": "terminals_update",
433
+ "direction": "server_to_client"
319
434
  }
320
435
  ]
321
436
  }
@@ -0,0 +1,18 @@
1
+ {
2
+ "type": "rename_terminal_request",
3
+ "direction": "client_to_server",
4
+ "description": "Rename a terminal.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/slot"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "rename_terminal_request",
13
+ "requestId": "req-1",
14
+ "slot": 1,
15
+ "name": "renamed"
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "type": "rename_terminal_response",
3
+ "direction": "server_to_client",
4
+ "description": "`ok:false` when the slot does not exist. A successful rename also broadcasts `terminals_update`.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/slot"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "rename_terminal_response",
13
+ "slot": 1,
14
+ "ok": true,
15
+ "requestId": "req-1"
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "type": "subscribe_terminal_request",
3
+ "direction": "client_to_server",
4
+ "description": "Attach to one terminal's binary stream; `cols`/`rows` (optional) resize the PTY before the snapshot. `restoreMode` is optional.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/slot"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "subscribe_terminal_request",
13
+ "requestId": "req-1",
14
+ "slot": 1,
15
+ "cols": 80,
16
+ "rows": 24
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "type": "subscribe_terminal_response",
3
+ "direction": "server_to_client",
4
+ "description": "Subscription result; `cols`/`rows` echo the PTY's real size. Failure: `ok:false`, `error:\"no_such_terminal\"`.",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": ["/message/requestId", "/message/slot"],
9
+ "frame": {
10
+ "type": "session",
11
+ "message": {
12
+ "type": "subscribe_terminal_response",
13
+ "slot": 1,
14
+ "ok": true,
15
+ "restoreMode": "basic",
16
+ "cols": 80,
17
+ "rows": 24,
18
+ "requestId": "req-1"
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "type": "terminals_update",
3
+ "direction": "server_to_client",
4
+ "description": "Broadcast to every session when the terminal inventory changes (create, rename, resize, exit/kill).",
5
+ "since": "0.0.118",
6
+ "stage": 3,
7
+ "requiresFeature": null,
8
+ "volatile": [
9
+ "/message/terminals/0/slot",
10
+ "/message/terminals/0/name",
11
+ "/message/terminals/0/cwd"
12
+ ],
13
+ "frame": {
14
+ "type": "session",
15
+ "message": {
16
+ "type": "terminals_update",
17
+ "terminals": [
18
+ {
19
+ "slot": 1,
20
+ "workspaceId": "workspace-1",
21
+ "name": "terminal-1",
22
+ "cwd": "/tmp/pi-studio-fixture",
23
+ "shell": "/bin/sh",
24
+ "cols": 80,
25
+ "rows": 24,
26
+ "closed": false
27
+ }
28
+ ]
29
+ }
30
+ }
31
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@av-pi-studio/protocol",
3
- "version": "0.0.116",
3
+ "version": "0.0.118",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.map",