@roll-agent/protocol 0.2.0 → 0.4.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.
- package/README.md +105 -14
- package/dist/index.d.ts +9487 -663
- package/dist/index.js +1272 -138
- package/dist/schema/roll-runtime-protocol-v1.0.schema.json +2657 -0
- package/dist/schema/roll-runtime-protocol-v1.1.schema.json +2824 -0
- package/dist/schema/roll-runtime-protocol-v1.2.schema.json +4112 -0
- package/dist/schema/roll-runtime-protocol-v1.3.schema.json +5695 -0
- package/dist/schema/roll-runtime-protocol-v1.schema.json +4061 -1223
- package/fixtures/v1/valid-approval-request.json +2 -1
- package/fixtures/v1.2/invalid-duplicate-client-capability-method.json +9 -0
- package/fixtures/v1.2/invalid-legacy-approval-request.json +15 -0
- package/fixtures/v1.2/invalid-legacy-server-request-cancel-notification.json +9 -0
- package/fixtures/v1.2/invalid-sensitive-approval-request.json +19 -0
- package/fixtures/v1.2/invalid-sensitive-user-input-request.json +20 -0
- package/fixtures/v1.2/invalid-thread-snapshot-interaction-payload.json +37 -0
- package/fixtures/v1.2/invalid-user-input-request-response.json +13 -0
- package/fixtures/v1.2/valid-approval-request.json +22 -0
- package/fixtures/v1.2/valid-client-capabilities-set-request.json +9 -0
- package/fixtures/v1.2/valid-client-capabilities-set-response.json +8 -0
- package/fixtures/v1.2/valid-server-request-cancel-notification.json +8 -0
- package/fixtures/v1.2/valid-thread-snapshot-response.json +42 -0
- package/fixtures/v1.2/valid-user-input-request-response.json +11 -0
- package/fixtures/v1.2/valid-user-input-request.json +35 -0
- package/fixtures/v1.3/invalid-durable-delta-event-notification.json +19 -0
- package/fixtures/v1.3/invalid-ephemeral-completed-event-notification.json +15 -0
- package/fixtures/v1.3/invalid-runtime-events-resume-cursor-request.json +9 -0
- package/fixtures/v1.3/invalid-thread-recovery-snapshot-response.json +31 -0
- package/fixtures/v1.3/invalid-thread-recovery-snapshot-timestamp-response.json +21 -0
- package/fixtures/v1.3/valid-runtime-durable-event-notification.json +20 -0
- package/fixtures/v1.3/valid-runtime-ephemeral-event-notification.json +18 -0
- package/fixtures/v1.3/valid-runtime-events-resume-request.json +9 -0
- package/fixtures/v1.3/valid-runtime-events-resume-response.json +8 -0
- package/fixtures/v1.3/valid-thread-recovery-snapshot-request.json +10 -0
- package/fixtures/v1.3/valid-thread-recovery-snapshot-response.json +21 -0
- package/fixtures/v1.3/valid-thread-snapshot-response.json +20 -0
- package/package.json +6 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": "approval-rpc-legacy",
|
|
4
|
+
"method": "approval.request",
|
|
5
|
+
"params": {
|
|
6
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
7
|
+
"approval": {
|
|
8
|
+
"id": "00000000-0000-4000-8000-000000000005",
|
|
9
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
10
|
+
"agentName": "browser-use-agent",
|
|
11
|
+
"toolName": "click",
|
|
12
|
+
"preview": {}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": "approval-rpc-sensitive",
|
|
4
|
+
"method": "approval.request",
|
|
5
|
+
"params": {
|
|
6
|
+
"interactionId": "00000000-0000-4000-8000-000000000006",
|
|
7
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
8
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
9
|
+
"expiresAt": "2026-07-29T12:10:00.000Z",
|
|
10
|
+
"sensitivity": "secret",
|
|
11
|
+
"approval": {
|
|
12
|
+
"id": "00000000-0000-4000-8000-000000000005",
|
|
13
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
14
|
+
"agentName": "browser-use-agent",
|
|
15
|
+
"toolName": "click",
|
|
16
|
+
"preview": {}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": "user-input-rpc-secret",
|
|
4
|
+
"method": "userInput.request",
|
|
5
|
+
"params": {
|
|
6
|
+
"interactionId": "00000000-0000-4000-8000-000000000006",
|
|
7
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
8
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
9
|
+
"expiresAt": "2026-07-29T12:10:00.000Z",
|
|
10
|
+
"sensitivity": "secret",
|
|
11
|
+
"controls": [
|
|
12
|
+
{
|
|
13
|
+
"type": "text",
|
|
14
|
+
"id": "credential",
|
|
15
|
+
"label": "Credential",
|
|
16
|
+
"required": true
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": 2,
|
|
4
|
+
"result": {
|
|
5
|
+
"thread": {
|
|
6
|
+
"id": "00000000-0000-4000-8000-000000000002",
|
|
7
|
+
"title": "Unsafe interaction",
|
|
8
|
+
"createdAt": "2026-07-28T12:00:00.000Z",
|
|
9
|
+
"updatedAt": "2026-07-28T12:01:00.000Z",
|
|
10
|
+
"messageCount": 0
|
|
11
|
+
},
|
|
12
|
+
"messages": {
|
|
13
|
+
"items": [],
|
|
14
|
+
"nextBeforeSequence": null
|
|
15
|
+
},
|
|
16
|
+
"operations": {
|
|
17
|
+
"items": [],
|
|
18
|
+
"nextBeforeSequence": null
|
|
19
|
+
},
|
|
20
|
+
"pendingApprovals": [],
|
|
21
|
+
"pendingInteractions": [
|
|
22
|
+
{
|
|
23
|
+
"method": "approval.request",
|
|
24
|
+
"interactionId": "00000000-0000-4000-8000-000000000006",
|
|
25
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
26
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
27
|
+
"expiresAt": "2026-07-29T12:10:00.000Z",
|
|
28
|
+
"sensitivity": "normal",
|
|
29
|
+
"approvalId": "00000000-0000-4000-8000-000000000005",
|
|
30
|
+
"preview": {
|
|
31
|
+
"selector": "#submit"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"transcriptCompleteness": "complete"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": "approval-rpc-2",
|
|
4
|
+
"method": "approval.request",
|
|
5
|
+
"params": {
|
|
6
|
+
"interactionId": "00000000-0000-4000-8000-000000000006",
|
|
7
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
8
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
9
|
+
"expiresAt": "2026-07-29T12:10:00.000Z",
|
|
10
|
+
"sensitivity": "normal",
|
|
11
|
+
"approval": {
|
|
12
|
+
"id": "00000000-0000-4000-8000-000000000005",
|
|
13
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
14
|
+
"agentName": "browser-use-agent",
|
|
15
|
+
"toolName": "click",
|
|
16
|
+
"preview": {
|
|
17
|
+
"selector": "#submit"
|
|
18
|
+
},
|
|
19
|
+
"reason": "此操作会提交表单"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": 2,
|
|
4
|
+
"result": {
|
|
5
|
+
"thread": {
|
|
6
|
+
"id": "00000000-0000-4000-8000-000000000002",
|
|
7
|
+
"title": "Golden thread",
|
|
8
|
+
"model": "fixture-model",
|
|
9
|
+
"createdAt": "2026-07-28T12:00:00.000Z",
|
|
10
|
+
"updatedAt": "2026-07-28T12:01:00.000Z",
|
|
11
|
+
"messageCount": 1
|
|
12
|
+
},
|
|
13
|
+
"messages": {
|
|
14
|
+
"items": [
|
|
15
|
+
{
|
|
16
|
+
"sequence": 0,
|
|
17
|
+
"role": "user",
|
|
18
|
+
"createdAt": "2026-07-28T12:00:00.000Z",
|
|
19
|
+
"parts": [{ "type": "text", "text": "hello" }]
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"nextBeforeSequence": null
|
|
23
|
+
},
|
|
24
|
+
"operations": {
|
|
25
|
+
"items": [],
|
|
26
|
+
"nextBeforeSequence": null
|
|
27
|
+
},
|
|
28
|
+
"pendingApprovals": [],
|
|
29
|
+
"pendingInteractions": [
|
|
30
|
+
{
|
|
31
|
+
"method": "approval.request",
|
|
32
|
+
"interactionId": "00000000-0000-4000-8000-000000000006",
|
|
33
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
34
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
35
|
+
"expiresAt": "2026-07-29T12:10:00.000Z",
|
|
36
|
+
"sensitivity": "normal",
|
|
37
|
+
"approvalId": "00000000-0000-4000-8000-000000000005"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"transcriptCompleteness": "complete"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": "user-input-rpc-1",
|
|
4
|
+
"method": "userInput.request",
|
|
5
|
+
"params": {
|
|
6
|
+
"interactionId": "00000000-0000-4000-8000-000000000006",
|
|
7
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
8
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
9
|
+
"expiresAt": "2026-07-29T12:10:00.000Z",
|
|
10
|
+
"sensitivity": "normal",
|
|
11
|
+
"title": "部署配置",
|
|
12
|
+
"description": "请确认普通部署配置。",
|
|
13
|
+
"controls": [
|
|
14
|
+
{
|
|
15
|
+
"type": "text",
|
|
16
|
+
"id": "deployment-region",
|
|
17
|
+
"label": "部署区域",
|
|
18
|
+
"required": true,
|
|
19
|
+
"minLength": 2,
|
|
20
|
+
"maxLength": 20
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "choice",
|
|
24
|
+
"id": "target-workspace",
|
|
25
|
+
"label": "目标 Workspace",
|
|
26
|
+
"required": true,
|
|
27
|
+
"multiple": false,
|
|
28
|
+
"options": [
|
|
29
|
+
{ "id": "workspace-a", "label": "Workspace A" },
|
|
30
|
+
{ "id": "workspace-b", "label": "Workspace B" }
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"method": "runtime.event",
|
|
4
|
+
"params": {
|
|
5
|
+
"protocolVersion": "1.3",
|
|
6
|
+
"runtimeInstanceId": "00000000-0000-4000-8000-000000000001",
|
|
7
|
+
"sequence": 10,
|
|
8
|
+
"timestamp": "2026-07-30T12:00:02.000Z",
|
|
9
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
10
|
+
"durability": "durable",
|
|
11
|
+
"eventId": "00000000-0000-4000-8000-000000000007",
|
|
12
|
+
"cursor": "rte1:00000000-0000-4000-8000-000000000008:0:00000000-0000-4000-8000-000000000007",
|
|
13
|
+
"event": {
|
|
14
|
+
"type": "message.delta",
|
|
15
|
+
"streamId": "00000000-0000-4000-8000-000000000004",
|
|
16
|
+
"delta": "unsafe to replay"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"method": "runtime.event",
|
|
4
|
+
"params": {
|
|
5
|
+
"protocolVersion": "1.3",
|
|
6
|
+
"runtimeInstanceId": "00000000-0000-4000-8000-000000000001",
|
|
7
|
+
"sequence": 11,
|
|
8
|
+
"timestamp": "2026-07-30T12:00:03.000Z",
|
|
9
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
10
|
+
"durability": "ephemeral",
|
|
11
|
+
"event": {
|
|
12
|
+
"type": "turn.completed"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": 16,
|
|
4
|
+
"result": {
|
|
5
|
+
"thread": {
|
|
6
|
+
"id": "00000000-0000-4000-8000-000000000002",
|
|
7
|
+
"title": "Invalid recovery",
|
|
8
|
+
"model": "fixture-model",
|
|
9
|
+
"createdAt": "2026-07-30T12:00:00.000Z",
|
|
10
|
+
"updatedAt": "2026-07-30T12:00:00.000Z",
|
|
11
|
+
"messageCount": 1
|
|
12
|
+
},
|
|
13
|
+
"messages": {
|
|
14
|
+
"items": [
|
|
15
|
+
{
|
|
16
|
+
"sequence": 0,
|
|
17
|
+
"role": "assistant",
|
|
18
|
+
"createdAt": "2026-07-30T12:00:00.000Z",
|
|
19
|
+
"parts": [{ "type": "text", "text": "must not appear" }]
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"nextBeforeSequence": null
|
|
23
|
+
},
|
|
24
|
+
"operations": { "items": [], "nextBeforeSequence": null },
|
|
25
|
+
"pendingApprovals": [],
|
|
26
|
+
"pendingInteractions": [],
|
|
27
|
+
"transcriptCompleteness": "complete",
|
|
28
|
+
"eventCursor": null,
|
|
29
|
+
"recoveryProjection": true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": 17,
|
|
4
|
+
"result": {
|
|
5
|
+
"thread": {
|
|
6
|
+
"id": "00000000-0000-4000-8000-000000000002",
|
|
7
|
+
"title": "Invalid recovery timestamp",
|
|
8
|
+
"model": "fixture-model",
|
|
9
|
+
"createdAt": "2026-07-30T12:00:00.1111111111111111111111111111111111111111111111111111111111111111Z",
|
|
10
|
+
"updatedAt": "2026-07-30T12:00:00.000Z",
|
|
11
|
+
"messageCount": 0
|
|
12
|
+
},
|
|
13
|
+
"messages": { "items": [], "nextBeforeSequence": null },
|
|
14
|
+
"operations": { "items": [], "nextBeforeSequence": null },
|
|
15
|
+
"pendingApprovals": [],
|
|
16
|
+
"pendingInteractions": [],
|
|
17
|
+
"transcriptCompleteness": "complete",
|
|
18
|
+
"eventCursor": null,
|
|
19
|
+
"recoveryProjection": true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"method": "runtime.event",
|
|
4
|
+
"params": {
|
|
5
|
+
"protocolVersion": "1.3",
|
|
6
|
+
"runtimeInstanceId": "00000000-0000-4000-8000-000000000001",
|
|
7
|
+
"sequence": 8,
|
|
8
|
+
"timestamp": "2026-07-30T12:00:00.000Z",
|
|
9
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
10
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
11
|
+
"durability": "durable",
|
|
12
|
+
"eventId": "00000000-0000-4000-8000-000000000007",
|
|
13
|
+
"cursor": "rte1:00000000-0000-4000-8000-000000000008:0:00000000-0000-4000-8000-000000000007",
|
|
14
|
+
"event": {
|
|
15
|
+
"type": "message.completed",
|
|
16
|
+
"streamId": "00000000-0000-4000-8000-000000000004",
|
|
17
|
+
"text": "hello"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"method": "runtime.event",
|
|
4
|
+
"params": {
|
|
5
|
+
"protocolVersion": "1.3",
|
|
6
|
+
"runtimeInstanceId": "00000000-0000-4000-8000-000000000001",
|
|
7
|
+
"sequence": 9,
|
|
8
|
+
"timestamp": "2026-07-30T12:00:01.000Z",
|
|
9
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
10
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
11
|
+
"durability": "ephemeral",
|
|
12
|
+
"event": {
|
|
13
|
+
"type": "message.delta",
|
|
14
|
+
"streamId": "00000000-0000-4000-8000-000000000004",
|
|
15
|
+
"delta": "hello"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": 15,
|
|
4
|
+
"result": {
|
|
5
|
+
"thread": {
|
|
6
|
+
"id": "00000000-0000-4000-8000-000000000002",
|
|
7
|
+
"title": "Bounded recovery",
|
|
8
|
+
"model": "fixture-model",
|
|
9
|
+
"createdAt": "2026-07-30T12:00:00.000Z",
|
|
10
|
+
"updatedAt": "2026-07-30T12:00:00.000Z",
|
|
11
|
+
"messageCount": 42
|
|
12
|
+
},
|
|
13
|
+
"messages": { "items": [], "nextBeforeSequence": null },
|
|
14
|
+
"operations": { "items": [], "nextBeforeSequence": null },
|
|
15
|
+
"pendingApprovals": [],
|
|
16
|
+
"pendingInteractions": [],
|
|
17
|
+
"transcriptCompleteness": "complete",
|
|
18
|
+
"eventCursor": null,
|
|
19
|
+
"recoveryProjection": true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": 14,
|
|
4
|
+
"result": {
|
|
5
|
+
"thread": {
|
|
6
|
+
"id": "00000000-0000-4000-8000-000000000002",
|
|
7
|
+
"title": "Empty durable log",
|
|
8
|
+
"model": "fixture-model",
|
|
9
|
+
"createdAt": "2026-07-30T12:00:00.000Z",
|
|
10
|
+
"updatedAt": "2026-07-30T12:00:00.000Z",
|
|
11
|
+
"messageCount": 0
|
|
12
|
+
},
|
|
13
|
+
"messages": { "items": [], "nextBeforeSequence": null },
|
|
14
|
+
"operations": { "items": [], "nextBeforeSequence": null },
|
|
15
|
+
"pendingApprovals": [],
|
|
16
|
+
"pendingInteractions": [],
|
|
17
|
+
"transcriptCompleteness": "complete",
|
|
18
|
+
"eventCursor": null
|
|
19
|
+
}
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roll-agent/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
"default": "./dist/index.js"
|
|
17
17
|
},
|
|
18
18
|
"./schema": "./dist/schema/roll-runtime-protocol-v1.schema.json",
|
|
19
|
+
"./schema/latest": "./dist/schema/roll-runtime-protocol-v1.schema.json",
|
|
20
|
+
"./schema/1.3": "./dist/schema/roll-runtime-protocol-v1.3.schema.json",
|
|
21
|
+
"./schema/1.2": "./dist/schema/roll-runtime-protocol-v1.2.schema.json",
|
|
22
|
+
"./schema/1.1": "./dist/schema/roll-runtime-protocol-v1.1.schema.json",
|
|
23
|
+
"./schema/1.0": "./dist/schema/roll-runtime-protocol-v1.0.schema.json",
|
|
19
24
|
"./fixtures/*": "./fixtures/*"
|
|
20
25
|
},
|
|
21
26
|
"publishConfig": {
|