@roll-agent/relay-protocol 0.1.1 → 0.3.0

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 (51) hide show
  1. package/README.md +134 -39
  2. package/dist/conformance.d.ts +571 -4
  3. package/dist/conformance.js +677 -8
  4. package/dist/control.d.ts +188 -0
  5. package/dist/control.js +180 -0
  6. package/dist/index.d.ts +3991 -287
  7. package/dist/index.js +676 -77
  8. package/dist/reference-adapter.d.ts +56 -0
  9. package/dist/reference-adapter.js +122 -0
  10. package/dist/schema/roll-relay-browser-session-v1.schema.json +23 -0
  11. package/dist/schema/roll-relay-control-v1.schema.json +127 -0
  12. package/dist/schema/roll-relay-protocol-v1.1.schema.json +3791 -0
  13. package/dist/schema/roll-relay-protocol-v1.schema.json +1 -1
  14. package/fixtures/control/v1.0/invalid-browser-session-trailing-whitespace.json +4 -0
  15. package/fixtures/control/v1.0/invalid-browser-session-uppercase-scheme.json +4 -0
  16. package/fixtures/control/v1.0/invalid-browser-session-url.json +4 -0
  17. package/fixtures/control/v1.0/invalid-browser-session-ws.json +4 -0
  18. package/fixtures/control/v1.0/invalid-control-extra-field.json +6 -0
  19. package/fixtures/control/v1.0/invalid-session-ready-wire-version.json +8 -0
  20. package/fixtures/control/v1.0/manifest.json +52 -0
  21. package/fixtures/control/v1.0/valid-browser-session.json +4 -0
  22. package/fixtures/control/v1.0/valid-session-error.json +5 -0
  23. package/fixtures/control/v1.0/valid-session-ready.json +8 -0
  24. package/fixtures/control/v1.0/valid-workspace-status.json +5 -0
  25. package/fixtures/v1.1/invalid-approval-projection-raw-input-leak.json +19 -0
  26. package/fixtures/v1.1/invalid-authentication-local-only.json +12 -0
  27. package/fixtures/v1.1/invalid-file-picker-local-only.json +12 -0
  28. package/fixtures/v1.1/invalid-interaction-cancelled-reason-leak.json +10 -0
  29. package/fixtures/v1.1/invalid-interaction-resolved-result-leak.json +18 -0
  30. package/fixtures/v1.1/invalid-legacy-approval-candidate.json +7 -0
  31. package/fixtures/v1.1/invalid-legacy-approval-respond.json +7 -0
  32. package/fixtures/v1.1/invalid-n-minus-one-device-connect.json +6 -0
  33. package/fixtures/v1.1/invalid-non-normal-sensitivity.json +21 -0
  34. package/fixtures/v1.1/invalid-runtime-event-tool-input-leak.json +22 -0
  35. package/fixtures/v1.1/invalid-runtime-event-tool-output-leak.json +21 -0
  36. package/fixtures/v1.1/invalid-user-input-projection-secret-leak.json +22 -0
  37. package/fixtures/v1.1/manifest.json +673 -0
  38. package/fixtures/v1.1/valid-device-connect.json +6 -0
  39. package/fixtures/v1.1/valid-interaction-cancelled.json +9 -0
  40. package/fixtures/v1.1/valid-interaction-candidate-user-input.json +25 -0
  41. package/fixtures/v1.1/valid-interaction-request-approval.json +17 -0
  42. package/fixtures/v1.1/valid-interaction-request-user-input.json +40 -0
  43. package/fixtures/v1.1/valid-interaction-resolved.json +9 -0
  44. package/fixtures/v1.1/valid-runtime-ack.json +5 -0
  45. package/fixtures/v1.1/valid-runtime-encrypted-interaction.json +10 -0
  46. package/fixtures/v1.1/valid-runtime-event-runtime-n-minus-one.json +16 -0
  47. package/fixtures/v1.1/valid-runtime-event.json +16 -0
  48. package/fixtures/v1.1/valid-runtime-gap.json +7 -0
  49. package/fixtures/v1.1/valid-runtime-request.json +10 -0
  50. package/fixtures/v1.1/valid-runtime-response.json +8 -0
  51. package/package.json +16 -3
@@ -718,7 +718,7 @@
718
718
  }
719
719
  ],
720
720
  "$schema": "https://json-schema.org/draft/2020-12/schema",
721
- "$id": "https://roll-agent.dev/schemas/relay-protocol/1.0",
721
+ "$id": "urn:roll-agent:schema:relay-protocol:1.0",
722
722
  "title": "Roll Relay Protocol v1.0",
723
723
  "description": "Versioned Companion Relay frames shared by Browser, Cloud Relay and Companion.",
724
724
  "$defs": {
@@ -0,0 +1,4 @@
1
+ {
2
+ "connectUrl": "wss://relay.example.test/v1/browser?ticket=single-use ",
3
+ "expiresAt": "2026-08-06T12:00:00.000Z"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "connectUrl": "WSS://relay.example.test/v1/browser?ticket=single-use",
3
+ "expiresAt": "2026-08-06T12:00:00.000Z"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "connectUrl": "wss://not a valid url",
3
+ "expiresAt": "2026-08-06T12:00:00.000Z"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "connectUrl": "ws://relay.example.test/v1/browser?ticket=single-use",
3
+ "expiresAt": "2026-08-06T12:00:00.000Z"
4
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "workspace.status",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000302",
4
+ "status": "online",
5
+ "deviceId": "00000000-0000-4000-8000-000000000303"
6
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "type": "session.ready",
3
+ "controlVersion": "1.0",
4
+ "relayProtocolVersion": "1.0",
5
+ "sessionId": "browser-session-301",
6
+ "workspaceId": "00000000-0000-4000-8000-000000000302",
7
+ "workspaceStatus": "online"
8
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "controlVersion": "1.0",
3
+ "messages": [
4
+ {
5
+ "fixture": "valid-session-ready.json",
6
+ "valid": true,
7
+ "validFirstFrame": true
8
+ },
9
+ {
10
+ "fixture": "valid-workspace-status.json",
11
+ "valid": true,
12
+ "validFirstFrame": false
13
+ },
14
+ {
15
+ "fixture": "valid-session-error.json",
16
+ "valid": true,
17
+ "validFirstFrame": false
18
+ },
19
+ {
20
+ "fixture": "invalid-session-ready-wire-version.json",
21
+ "valid": false,
22
+ "validFirstFrame": false
23
+ },
24
+ {
25
+ "fixture": "invalid-control-extra-field.json",
26
+ "valid": false,
27
+ "validFirstFrame": false
28
+ }
29
+ ],
30
+ "sessions": [
31
+ {
32
+ "fixture": "valid-browser-session.json",
33
+ "valid": true
34
+ },
35
+ {
36
+ "fixture": "invalid-browser-session-ws.json",
37
+ "valid": false
38
+ },
39
+ {
40
+ "fixture": "invalid-browser-session-url.json",
41
+ "valid": false
42
+ },
43
+ {
44
+ "fixture": "invalid-browser-session-uppercase-scheme.json",
45
+ "valid": false
46
+ },
47
+ {
48
+ "fixture": "invalid-browser-session-trailing-whitespace.json",
49
+ "valid": false
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "connectUrl": "wss://relay.example.test/v1/browser?ticket=single-use",
3
+ "expiresAt": "2026-08-06T12:00:00.000Z"
4
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "type": "session.error",
3
+ "code": "CONTROLLER_CONFLICT",
4
+ "retryable": false
5
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "type": "session.ready",
3
+ "controlVersion": "1.0",
4
+ "relayProtocolVersion": "1.1",
5
+ "sessionId": "browser-session-301",
6
+ "workspaceId": "00000000-0000-4000-8000-000000000302",
7
+ "workspaceStatus": "online"
8
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "type": "workspace.status",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000302",
4
+ "status": "offline"
5
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "type": "interaction.request",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
4
+ "relaySequence": 7,
5
+ "interactionId": "00000000-0000-4000-8000-000000000511",
6
+ "threadId": "00000000-0000-4000-8000-000000000502",
7
+ "turnId": "00000000-0000-4000-8000-000000000503",
8
+ "expiresAt": "2026-08-04T00:05:00.000Z",
9
+ "sensitivity": "normal",
10
+ "method": "approval.request",
11
+ "projection": {
12
+ "approvalId": "00000000-0000-4000-8000-000000000504",
13
+ "agentName": "workspace-agent",
14
+ "toolName": "deploy",
15
+ "input": {
16
+ "secret": "relay-security-sentinel"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "type": "interaction.request",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
4
+ "relaySequence": 10,
5
+ "interactionId": "00000000-0000-4000-8000-000000000511",
6
+ "threadId": "00000000-0000-4000-8000-000000000502",
7
+ "turnId": "00000000-0000-4000-8000-000000000503",
8
+ "expiresAt": "2026-08-04T00:05:00.000Z",
9
+ "sensitivity": "normal",
10
+ "method": "authentication.request",
11
+ "projection": {}
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "type": "interaction.request",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
4
+ "relaySequence": 11,
5
+ "interactionId": "00000000-0000-4000-8000-000000000511",
6
+ "threadId": "00000000-0000-4000-8000-000000000502",
7
+ "turnId": "00000000-0000-4000-8000-000000000503",
8
+ "expiresAt": "2026-08-04T00:05:00.000Z",
9
+ "sensitivity": "normal",
10
+ "method": "filePicker.request",
11
+ "projection": {}
12
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "type": "interaction.cancelled",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
4
+ "relaySequence": 13,
5
+ "interactionId": "00000000-0000-4000-8000-000000000511",
6
+ "threadId": "00000000-0000-4000-8000-000000000502",
7
+ "turnId": "00000000-0000-4000-8000-000000000503",
8
+ "method": "approval.request",
9
+ "reason": "relay-security-sentinel"
10
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "type": "interaction.resolved",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
4
+ "relaySequence": 12,
5
+ "interactionId": "00000000-0000-4000-8000-000000000511",
6
+ "threadId": "00000000-0000-4000-8000-000000000502",
7
+ "turnId": "00000000-0000-4000-8000-000000000503",
8
+ "method": "userInput.request",
9
+ "result": {
10
+ "status": "submitted",
11
+ "values": [
12
+ {
13
+ "id": "workspace",
14
+ "value": "relay-security-sentinel"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "runtime.request",
3
+ "requestId": "00000000-0000-4000-8000-000000000505",
4
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
5
+ "method": "approval.candidate",
6
+ "params": {}
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "runtime.request",
3
+ "requestId": "00000000-0000-4000-8000-000000000505",
4
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
5
+ "method": "approval.respond",
6
+ "params": {}
7
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "device.connect",
3
+ "protocolVersion": "1.0",
4
+ "deviceId": "00000000-0000-4000-8000-000000000506",
5
+ "pairingToken": "pairing-token-with-sufficient-length"
6
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "type": "interaction.request",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
4
+ "relaySequence": 9,
5
+ "interactionId": "00000000-0000-4000-8000-000000000511",
6
+ "threadId": "00000000-0000-4000-8000-000000000502",
7
+ "turnId": "00000000-0000-4000-8000-000000000503",
8
+ "expiresAt": "2026-08-04T00:05:00.000Z",
9
+ "sensitivity": "secret",
10
+ "method": "userInput.request",
11
+ "projection": {
12
+ "controls": [
13
+ {
14
+ "id": "workspace",
15
+ "type": "text",
16
+ "label": "目标 Workspace",
17
+ "required": true
18
+ }
19
+ ]
20
+ }
21
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "type": "runtime.event",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
4
+ "relaySequence": 14,
5
+ "event": {
6
+ "protocolVersion": "1.1",
7
+ "runtimeInstanceId": "00000000-0000-4000-8000-000000000501",
8
+ "sequence": 14,
9
+ "timestamp": "2026-08-04T00:00:14.000Z",
10
+ "threadId": "00000000-0000-4000-8000-000000000502",
11
+ "turnId": "00000000-0000-4000-8000-000000000503",
12
+ "event": {
13
+ "type": "tool.started",
14
+ "toolCallId": "tool-1",
15
+ "agentName": "workspace-agent",
16
+ "toolName": "deploy",
17
+ "input": {
18
+ "secret": "relay-security-sentinel"
19
+ }
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "type": "runtime.event",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
4
+ "relaySequence": 15,
5
+ "event": {
6
+ "protocolVersion": "1.1",
7
+ "runtimeInstanceId": "00000000-0000-4000-8000-000000000501",
8
+ "sequence": 15,
9
+ "timestamp": "2026-08-04T00:00:15.000Z",
10
+ "threadId": "00000000-0000-4000-8000-000000000502",
11
+ "turnId": "00000000-0000-4000-8000-000000000503",
12
+ "event": {
13
+ "type": "tool.output",
14
+ "toolCallId": "tool-1",
15
+ "agentName": "workspace-agent",
16
+ "toolName": "deploy",
17
+ "stream": "stdout",
18
+ "delta": "relay-security-sentinel"
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "type": "interaction.request",
3
+ "workspaceId": "00000000-0000-4000-8000-000000000507",
4
+ "relaySequence": 8,
5
+ "interactionId": "00000000-0000-4000-8000-000000000511",
6
+ "threadId": "00000000-0000-4000-8000-000000000502",
7
+ "turnId": "00000000-0000-4000-8000-000000000503",
8
+ "expiresAt": "2026-08-04T00:05:00.000Z",
9
+ "sensitivity": "normal",
10
+ "method": "userInput.request",
11
+ "projection": {
12
+ "controls": [
13
+ {
14
+ "id": "workspace",
15
+ "type": "text",
16
+ "label": "目标 Workspace",
17
+ "required": true
18
+ }
19
+ ],
20
+ "secret": "relay-security-sentinel"
21
+ }
22
+ }