@roll-agent/protocol 0.0.0 → 0.2.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 +25 -4
- package/dist/index.d.ts +159 -5
- package/dist/index.js +131 -4
- package/dist/schema/roll-runtime-protocol-v1.schema.json +664 -502
- package/fixtures/v1/invalid-approval-request-response.json +7 -0
- package/fixtures/v1/invalid-v1-approval-resolved-event-notification.json +20 -0
- package/fixtures/v1/valid-approval-request-response.json +8 -0
- package/fixtures/v1/valid-approval-request.json +19 -0
- package/fixtures/v1/valid-approval-resolved-event-notification.json +21 -0
- package/fixtures/v1/valid-server-request-cancel-notification.json +9 -0
- package/package.json +4 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"method": "runtime.event",
|
|
4
|
+
"params": {
|
|
5
|
+
"protocolVersion": "1.0",
|
|
6
|
+
"runtimeInstanceId": "00000000-0000-4000-8000-000000000001",
|
|
7
|
+
"sequence": 8,
|
|
8
|
+
"timestamp": "2026-07-29T12:00:00.000Z",
|
|
9
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
10
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
11
|
+
"event": {
|
|
12
|
+
"type": "approval.resolved",
|
|
13
|
+
"approvalId": "00000000-0000-4000-8000-000000000005",
|
|
14
|
+
"resolution": {
|
|
15
|
+
"status": "resolved",
|
|
16
|
+
"decision": "approve"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"id": "approval-rpc-1",
|
|
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
|
+
"selector": "#submit"
|
|
14
|
+
},
|
|
15
|
+
"reason": "此操作会提交表单"
|
|
16
|
+
},
|
|
17
|
+
"expiresAt": "2026-07-29T12:10:00.000Z"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsonrpc": "2.0",
|
|
3
|
+
"method": "runtime.event",
|
|
4
|
+
"params": {
|
|
5
|
+
"protocolVersion": "1.1",
|
|
6
|
+
"runtimeInstanceId": "00000000-0000-4000-8000-000000000001",
|
|
7
|
+
"sequence": 8,
|
|
8
|
+
"timestamp": "2026-07-29T12:00:00.000Z",
|
|
9
|
+
"threadId": "00000000-0000-4000-8000-000000000002",
|
|
10
|
+
"turnId": "00000000-0000-4000-8000-000000000003",
|
|
11
|
+
"event": {
|
|
12
|
+
"type": "approval.resolved",
|
|
13
|
+
"approvalId": "00000000-0000-4000-8000-000000000005",
|
|
14
|
+
"resolution": {
|
|
15
|
+
"status": "resolved",
|
|
16
|
+
"decision": "reject",
|
|
17
|
+
"reason": "用户取消"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roll-agent/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
"zod": "3.25.76"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^22.0.0"
|
|
32
|
+
"@types/node": "^22.0.0",
|
|
33
|
+
"ajv": "8.18.0",
|
|
34
|
+
"ajv-formats": "3.0.1"
|
|
33
35
|
},
|
|
34
36
|
"scripts": {
|
|
35
37
|
"build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/generate-schema.mjs",
|