sealbridge 0.4.2 → 0.6.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.ja.md +6 -4
- package/README.md +9 -4
- package/dist/cli/dist/accept.d.ts +2 -1
- package/dist/cli/dist/accept.js +18 -7
- package/dist/cli/dist/accept.js.map +1 -1
- package/dist/cli/dist/index.js +46 -13
- package/dist/cli/dist/index.js.map +1 -1
- package/dist/cli/dist/invite-links.d.ts +14 -0
- package/dist/cli/dist/invite-links.js +263 -0
- package/dist/cli/dist/invite-links.js.map +1 -0
- package/dist/cli/dist/invite-output.d.ts +1 -1
- package/dist/cli/dist/invite-output.js +3 -2
- package/dist/cli/dist/invite-output.js.map +1 -1
- package/dist/cli/dist/network.js +16 -23
- package/dist/cli/dist/network.js.map +1 -1
- package/dist/cli/dist/receipt.d.ts +12 -2
- package/dist/cli/dist/receipt.js +6 -5
- package/dist/cli/dist/receipt.js.map +1 -1
- package/dist/cli/dist/sdk.d.ts +6 -4
- package/dist/cli/dist/sdk.js +3 -2
- package/dist/cli/dist/sdk.js.map +1 -1
- package/dist/cli/dist/task-review.d.ts +1 -8
- package/dist/cli/dist/task-review.js +4 -17
- package/dist/cli/dist/task-review.js.map +1 -1
- package/dist/cli/dist/tasks.js +1 -1
- package/dist/cli/dist/tasks.js.map +1 -1
- package/dist/examples/two-owner-demo/dist/run-demo.js +3 -1
- package/dist/examples/two-owner-demo/dist/run-demo.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/packages/core/dist/content-inspection-rules.d.ts +22 -0
- package/dist/packages/core/dist/content-inspection-rules.js +34 -0
- package/dist/packages/core/dist/content-inspection-rules.js.map +1 -0
- package/dist/packages/core/dist/content-inspection.d.ts +43 -0
- package/dist/packages/core/dist/content-inspection.js +192 -0
- package/dist/packages/core/dist/content-inspection.js.map +1 -0
- package/dist/packages/core/dist/context-grant.d.ts +13 -0
- package/dist/packages/core/dist/context-grant.js +65 -0
- package/dist/packages/core/dist/context-grant.js.map +1 -0
- package/dist/packages/core/dist/delegation.d.ts +17 -0
- package/dist/packages/core/dist/delegation.js +126 -0
- package/dist/packages/core/dist/delegation.js.map +1 -0
- package/dist/packages/core/dist/edge.d.ts +2 -0
- package/dist/packages/core/dist/edge.js +2 -0
- package/dist/packages/core/dist/edge.js.map +1 -1
- package/dist/packages/core/dist/index.d.ts +6 -0
- package/dist/packages/core/dist/index.js +6 -0
- package/dist/packages/core/dist/index.js.map +1 -1
- package/dist/packages/core/dist/invite-link.d.ts +72 -0
- package/dist/packages/core/dist/invite-link.js +225 -0
- package/dist/packages/core/dist/invite-link.js.map +1 -0
- package/dist/packages/core/dist/invite-sas.d.ts +7 -0
- package/dist/packages/core/dist/invite-sas.js +15 -0
- package/dist/packages/core/dist/invite-sas.js.map +1 -0
- package/dist/packages/core/dist/relay-auth.d.ts +1 -1
- package/dist/packages/core/dist/relay-auth.js +1 -1
- package/dist/packages/core/dist/relay-auth.js.map +1 -1
- package/dist/packages/core/dist/schema.d.ts +1 -1
- package/dist/packages/core/dist/schema.js +4 -0
- package/dist/packages/core/dist/schema.js.map +1 -1
- package/dist/packages/core/dist/types.d.ts +52 -0
- package/dist/packages/ledger/dist/index.d.ts +70 -2
- package/dist/packages/ledger/dist/index.js +404 -26
- package/dist/packages/ledger/dist/index.js.map +1 -1
- package/dist/packages/relay/dist/fetch.js +4 -0
- package/dist/packages/relay/dist/fetch.js.map +1 -1
- package/dist/packages/relay/dist/invites.d.ts +42 -0
- package/dist/packages/relay/dist/invites.js +347 -0
- package/dist/packages/relay/dist/invites.js.map +1 -0
- package/dist/packages/relay/dist/worker.d.ts +3 -0
- package/dist/packages/relay/dist/worker.js +21 -0
- package/dist/packages/relay/dist/worker.js.map +1 -1
- package/dist/packages/runtime/dist/a2a.js +1 -1
- package/dist/packages/runtime/dist/adapter.d.ts +1 -0
- package/dist/packages/runtime/dist/application-config.js +69 -6
- package/dist/packages/runtime/dist/application-config.js.map +1 -1
- package/dist/packages/runtime/dist/approval-providers.d.ts +4 -0
- package/dist/packages/runtime/dist/approval-providers.js +3 -0
- package/dist/packages/runtime/dist/approval-providers.js.map +1 -1
- package/dist/packages/runtime/dist/connection-persistence.d.ts +1 -1
- package/dist/packages/runtime/dist/context-grant-audit.d.ts +8 -0
- package/dist/packages/runtime/dist/context-grant-audit.js +41 -0
- package/dist/packages/runtime/dist/context-grant-audit.js.map +1 -0
- package/dist/packages/runtime/dist/delegation.d.ts +37 -0
- package/dist/packages/runtime/dist/delegation.js +125 -0
- package/dist/packages/runtime/dist/delegation.js.map +1 -0
- package/dist/packages/runtime/dist/gateway.d.ts +1 -0
- package/dist/packages/runtime/dist/gateway.js.map +1 -1
- package/dist/packages/runtime/dist/held-request-store.d.ts +2 -0
- package/dist/packages/runtime/dist/held-request-store.js +3 -2
- package/dist/packages/runtime/dist/held-request-store.js.map +1 -1
- package/dist/packages/runtime/dist/held-task-content.d.ts +14 -0
- package/dist/packages/runtime/dist/held-task-content.js +33 -0
- package/dist/packages/runtime/dist/held-task-content.js.map +1 -0
- package/dist/packages/runtime/dist/index.d.ts +4 -0
- package/dist/packages/runtime/dist/index.js +4 -0
- package/dist/packages/runtime/dist/index.js.map +1 -1
- package/dist/packages/runtime/dist/mcp-server.js +22 -8
- package/dist/packages/runtime/dist/mcp-server.js.map +1 -1
- package/dist/packages/runtime/dist/mcp-tool-catalog.js +44 -5
- package/dist/packages/runtime/dist/mcp-tool-catalog.js.map +1 -1
- package/dist/packages/runtime/dist/rule-content-review-child.d.ts +1 -0
- package/dist/packages/runtime/dist/rule-content-review-child.js +25 -0
- package/dist/packages/runtime/dist/rule-content-review-child.js.map +1 -0
- package/dist/packages/runtime/dist/rule-content-review.d.ts +9 -0
- package/dist/packages/runtime/dist/rule-content-review.js +217 -0
- package/dist/packages/runtime/dist/rule-content-review.js.map +1 -0
- package/dist/packages/runtime/dist/session-audit.d.ts +6 -1
- package/dist/packages/runtime/dist/session-audit.js +35 -4
- package/dist/packages/runtime/dist/session-audit.js.map +1 -1
- package/dist/packages/runtime/dist/session.d.ts +21 -1
- package/dist/packages/runtime/dist/session.js +429 -63
- package/dist/packages/runtime/dist/session.js.map +1 -1
- package/dist/packages/runtime/dist/task-journal.d.ts +10 -1
- package/dist/packages/runtime/dist/task-journal.js +26 -1
- package/dist/packages/runtime/dist/task-journal.js.map +1 -1
- package/dist/packages/runtime/dist/verifier.d.ts +5 -2
- package/dist/packages/runtime/dist/verifier.js +14 -4
- package/dist/packages/runtime/dist/verifier.js.map +1 -1
- package/dist/spec/audit-entry.schema.json +25 -1
- package/dist/spec/audit-evidence.schema.json +179 -0
- package/dist/spec/audit-file-record.schema.json +177 -0
- package/dist/spec/audit-interruption.schema.json +110 -0
- package/dist/spec/context-grant-audit-payload.schema.json +24 -0
- package/dist/spec/context-grant.schema.json +146 -0
- package/dist/spec/delegation-attachment.schema.json +167 -0
- package/dist/spec/delegation-link.schema.json +141 -0
- package/dist/spec/examples/context-pooling/approval_redelegation/sample-delegation-attachment.json +413 -0
- package/dist/spec/examples/context-pooling/hand_over/sample-context-grant.json +18 -0
- package/dist/spec/examples/context-pooling/hand_over/sample-task-manifest.0.2.0.json +94 -0
- package/dist/spec/examples/context-pooling/sample-context-grant-audit-payload.json +4 -0
- package/dist/spec/examples/context-pooling/view_only/sample-context-grant.json +18 -0
- package/dist/spec/examples/context-pooling/view_only/sample-task-manifest.0.2.0.json +94 -0
- package/dist/spec/examples/sample-audit-evidence.json +138 -0
- package/dist/spec/examples/sample-audit-file-record.json +31 -0
- package/dist/spec/examples/sample-audit-interruption.json +29 -0
- package/dist/spec/task-manifest.0.2.0.schema.json +87 -1
- package/docs/context-grants.md +221 -0
- package/docs/sdk.ja.md +108 -2
- package/docs/sdk.md +120 -2
- package/package.json +3 -2
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
{
|
|
4
|
+
"body": {
|
|
5
|
+
"taskId": "task_58ba4c65aebe441ca9d2b3f253fea677",
|
|
6
|
+
"seq": 0,
|
|
7
|
+
"prevEntryHash": null,
|
|
8
|
+
"actorDid": "did:key:z6Mkj6gKgj855yaUZd1FS1CcBv7C5VWSv9eJmmLfuxt3Ppqk",
|
|
9
|
+
"receiverDid": "did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD",
|
|
10
|
+
"eventType": "PROPOSE",
|
|
11
|
+
"payload": {
|
|
12
|
+
"proposal": {
|
|
13
|
+
"payload": {
|
|
14
|
+
"protocolVersion": "0.2.0",
|
|
15
|
+
"taskId": "task_58ba4c65aebe441ca9d2b3f253fea677",
|
|
16
|
+
"createdAt": "2026-11-05T00:00:00.000Z",
|
|
17
|
+
"deadline": "2026-11-05T00:10:00.000Z",
|
|
18
|
+
"requester": {
|
|
19
|
+
"ownerDid": "did:key:z6Mkj6gKgj855yaUZd1FS1CcBv7C5VWSv9eJmmLfuxt3Ppqk",
|
|
20
|
+
"agentDid": "did:key:z6Mkj6gKgj855yaUZd1FS1CcBv7C5VWSv9eJmmLfuxt3Ppqk"
|
|
21
|
+
},
|
|
22
|
+
"worker": {
|
|
23
|
+
"ownerDid": "did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD",
|
|
24
|
+
"agentDid": "did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD"
|
|
25
|
+
},
|
|
26
|
+
"task": {
|
|
27
|
+
"title": "Sample interruption",
|
|
28
|
+
"description": "Worker-only observation of a PROPOSE prefix",
|
|
29
|
+
"acceptanceCriteria": [
|
|
30
|
+
{
|
|
31
|
+
"id": "ac_schema",
|
|
32
|
+
"description": "Output satisfies the agreed JSON schema",
|
|
33
|
+
"required": true
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"io": {
|
|
38
|
+
"inputSchema": {},
|
|
39
|
+
"outputSchema": {}
|
|
40
|
+
},
|
|
41
|
+
"verification": {
|
|
42
|
+
"mode": "hybrid",
|
|
43
|
+
"requireUsageReceipt": true,
|
|
44
|
+
"requireExecutionAttestation": true,
|
|
45
|
+
"maxRetries": 0
|
|
46
|
+
},
|
|
47
|
+
"budget": {
|
|
48
|
+
"costBearer": "worker_byok",
|
|
49
|
+
"maxInputTokens": 50000,
|
|
50
|
+
"maxOutputTokens": 10000,
|
|
51
|
+
"maxToolInvocations": 10,
|
|
52
|
+
"maxWallClockSeconds": 60,
|
|
53
|
+
"onOverrun": "hard_stop"
|
|
54
|
+
},
|
|
55
|
+
"permissions": {
|
|
56
|
+
"maxDelegationDepth": 0,
|
|
57
|
+
"grantedCapabilities": []
|
|
58
|
+
},
|
|
59
|
+
"sandboxPolicy": {
|
|
60
|
+
"isolationLevel": "subprocess_restricted",
|
|
61
|
+
"networkAccess": "none",
|
|
62
|
+
"filesystemScope": "ephemeral_workspace_only"
|
|
63
|
+
},
|
|
64
|
+
"hitlPolicy": {
|
|
65
|
+
"requiredGates": [
|
|
66
|
+
"GATE_CONTRACT_ACCEPT",
|
|
67
|
+
"GATE_DELIVERY_ACCEPT"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"signature": {
|
|
72
|
+
"signerDid": "did:key:z6Mkj6gKgj855yaUZd1FS1CcBv7C5VWSv9eJmmLfuxt3Ppqk",
|
|
73
|
+
"canonicalization": "RFC8785-JCS",
|
|
74
|
+
"payloadDigest": "sha256:abf8b10ee34ed8774fe4b4f9634fd2a46f02b9c574204f4d93f7fd496b7d5595",
|
|
75
|
+
"signedAt": "2026-11-05T00:00:00.000Z",
|
|
76
|
+
"signature": "ed25519:Bnu3IQj4_w9_Tr-x72xh_CcylwfKDl2CYsuQKCworMebRxVqFFFyGAGTlDk3m9kSyQk4Cc0cfo934Tm8fbYBCA"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"input": {},
|
|
80
|
+
"capabilityChains": []
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"entryHash": "sha256:533936cbbede60ba3617394ed7b99babd3a56109cc5139db011ba56b780f0e51",
|
|
84
|
+
"actorSignature": {
|
|
85
|
+
"signerDid": "did:key:z6Mkj6gKgj855yaUZd1FS1CcBv7C5VWSv9eJmmLfuxt3Ppqk",
|
|
86
|
+
"canonicalization": "RFC8785-JCS",
|
|
87
|
+
"payloadDigest": "sha256:533936cbbede60ba3617394ed7b99babd3a56109cc5139db011ba56b780f0e51",
|
|
88
|
+
"signedAt": "2026-11-05T12:08:18.830Z",
|
|
89
|
+
"signature": "ed25519:gcjAXj9pEsUQXQ4nixpSDqaFFjf1De2ayIt6XTIuSwVTrFMPmofMRZYbRbWcF4gMiz9_wqVVzArIjOmQ6JEYCw"
|
|
90
|
+
},
|
|
91
|
+
"counterSignature": {
|
|
92
|
+
"payload": {
|
|
93
|
+
"type": "AckReceipt",
|
|
94
|
+
"taskId": "task_58ba4c65aebe441ca9d2b3f253fea677",
|
|
95
|
+
"entryHash": "sha256:533936cbbede60ba3617394ed7b99babd3a56109cc5139db011ba56b780f0e51",
|
|
96
|
+
"actorDid": "did:key:z6Mkj6gKgj855yaUZd1FS1CcBv7C5VWSv9eJmmLfuxt3Ppqk",
|
|
97
|
+
"receiverDid": "did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD"
|
|
98
|
+
},
|
|
99
|
+
"signature": {
|
|
100
|
+
"signerDid": "did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD",
|
|
101
|
+
"canonicalization": "RFC8785-JCS",
|
|
102
|
+
"payloadDigest": "sha256:5981ecd15643250116b0655697bea324505e496b428797d6447f3314b014f166",
|
|
103
|
+
"signedAt": "2026-11-05T12:08:18.831Z",
|
|
104
|
+
"signature": "ed25519:XqX00TUcPJOkZjzFcyFHx7_hCCWgL5gZ5AglBkO1yfIjTNlWHu5U_a45H-tR1wx72RQVd4ShZT5ZVVLW7w53BA"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"interruption": {
|
|
110
|
+
"payload": {
|
|
111
|
+
"type": "AuditInterruption",
|
|
112
|
+
"formatVersion": 1,
|
|
113
|
+
"taskId": "task_58ba4c65aebe441ca9d2b3f253fea677",
|
|
114
|
+
"actors": [
|
|
115
|
+
"did:key:z6Mkj6gKgj855yaUZd1FS1CcBv7C5VWSv9eJmmLfuxt3Ppqk",
|
|
116
|
+
"did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD"
|
|
117
|
+
],
|
|
118
|
+
"seq": 1,
|
|
119
|
+
"prevEntryHash": "sha256:533936cbbede60ba3617394ed7b99babd3a56109cc5139db011ba56b780f0e51",
|
|
120
|
+
"acknowledgedPrefix": {
|
|
121
|
+
"count": 1,
|
|
122
|
+
"lastSeq": 0,
|
|
123
|
+
"head": "sha256:533936cbbede60ba3617394ed7b99babd3a56109cc5139db011ba56b780f0e51",
|
|
124
|
+
"entriesDigest": "sha256:4fb32f5f4591aba0759f49b85d839277f17ba15261446c40aa92bc54f9c34602"
|
|
125
|
+
},
|
|
126
|
+
"phase": "OWNER_APPROVAL",
|
|
127
|
+
"reason": "SESSION_TIMEOUT",
|
|
128
|
+
"observedAt": "2026-11-05T00:01:00.000Z"
|
|
129
|
+
},
|
|
130
|
+
"signature": {
|
|
131
|
+
"signerDid": "did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD",
|
|
132
|
+
"canonicalization": "RFC8785-JCS",
|
|
133
|
+
"payloadDigest": "sha256:9b3e500d642b0731f02ac523f976f6854e623a7c1cfcd5396f2bbb21f0167b06",
|
|
134
|
+
"signedAt": "2026-11-05T00:01:00.000Z",
|
|
135
|
+
"signature": "ed25519:vn43o4hIZCRT5R_8xjCeT-MLibvv9kLVrgzmj-LIa9N019cCWBGL6tkVEJGGXFMVBthvrPB4tgR9Qq0iOpdGDg"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"interruption": {
|
|
3
|
+
"payload": {
|
|
4
|
+
"type": "AuditInterruption",
|
|
5
|
+
"formatVersion": 1,
|
|
6
|
+
"taskId": "task_58ba4c65aebe441ca9d2b3f253fea677",
|
|
7
|
+
"actors": [
|
|
8
|
+
"did:key:z6Mkj6gKgj855yaUZd1FS1CcBv7C5VWSv9eJmmLfuxt3Ppqk",
|
|
9
|
+
"did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD"
|
|
10
|
+
],
|
|
11
|
+
"seq": 1,
|
|
12
|
+
"prevEntryHash": "sha256:533936cbbede60ba3617394ed7b99babd3a56109cc5139db011ba56b780f0e51",
|
|
13
|
+
"acknowledgedPrefix": {
|
|
14
|
+
"count": 1,
|
|
15
|
+
"lastSeq": 0,
|
|
16
|
+
"head": "sha256:533936cbbede60ba3617394ed7b99babd3a56109cc5139db011ba56b780f0e51",
|
|
17
|
+
"entriesDigest": "sha256:4fb32f5f4591aba0759f49b85d839277f17ba15261446c40aa92bc54f9c34602"
|
|
18
|
+
},
|
|
19
|
+
"phase": "OWNER_APPROVAL",
|
|
20
|
+
"reason": "SESSION_TIMEOUT",
|
|
21
|
+
"observedAt": "2026-11-05T00:01:00.000Z"
|
|
22
|
+
},
|
|
23
|
+
"signature": {
|
|
24
|
+
"signerDid": "did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD",
|
|
25
|
+
"canonicalization": "RFC8785-JCS",
|
|
26
|
+
"payloadDigest": "sha256:9b3e500d642b0731f02ac523f976f6854e623a7c1cfcd5396f2bbb21f0167b06",
|
|
27
|
+
"signedAt": "2026-11-05T00:01:00.000Z",
|
|
28
|
+
"signature": "ed25519:vn43o4hIZCRT5R_8xjCeT-MLibvv9kLVrgzmj-LIa9N019cCWBGL6tkVEJGGXFMVBthvrPB4tgR9Qq0iOpdGDg"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"payload": {
|
|
3
|
+
"type": "AuditInterruption",
|
|
4
|
+
"formatVersion": 1,
|
|
5
|
+
"taskId": "task_58ba4c65aebe441ca9d2b3f253fea677",
|
|
6
|
+
"actors": [
|
|
7
|
+
"did:key:z6Mkj6gKgj855yaUZd1FS1CcBv7C5VWSv9eJmmLfuxt3Ppqk",
|
|
8
|
+
"did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD"
|
|
9
|
+
],
|
|
10
|
+
"seq": 1,
|
|
11
|
+
"prevEntryHash": "sha256:533936cbbede60ba3617394ed7b99babd3a56109cc5139db011ba56b780f0e51",
|
|
12
|
+
"acknowledgedPrefix": {
|
|
13
|
+
"count": 1,
|
|
14
|
+
"lastSeq": 0,
|
|
15
|
+
"head": "sha256:533936cbbede60ba3617394ed7b99babd3a56109cc5139db011ba56b780f0e51",
|
|
16
|
+
"entriesDigest": "sha256:4fb32f5f4591aba0759f49b85d839277f17ba15261446c40aa92bc54f9c34602"
|
|
17
|
+
},
|
|
18
|
+
"phase": "OWNER_APPROVAL",
|
|
19
|
+
"reason": "SESSION_TIMEOUT",
|
|
20
|
+
"observedAt": "2026-11-05T00:01:00.000Z"
|
|
21
|
+
},
|
|
22
|
+
"signature": {
|
|
23
|
+
"signerDid": "did:key:z6Mkvo3zuWyhTjVCMZMTVERfBUvyQM372AnuN1XvHVE61CfD",
|
|
24
|
+
"canonicalization": "RFC8785-JCS",
|
|
25
|
+
"payloadDigest": "sha256:9b3e500d642b0731f02ac523f976f6854e623a7c1cfcd5396f2bbb21f0167b06",
|
|
26
|
+
"signedAt": "2026-11-05T00:01:00.000Z",
|
|
27
|
+
"signature": "ed25519:vn43o4hIZCRT5R_8xjCeT-MLibvv9kLVrgzmj-LIa9N019cCWBGL6tkVEJGGXFMVBthvrPB4tgR9Qq0iOpdGDg"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"hitlPolicy"
|
|
21
21
|
],
|
|
22
22
|
"properties": {
|
|
23
|
+
"contextGrant": { "$ref": "https://acp-spec.local/schemas/v0.2/context-grant.schema.json" },
|
|
23
24
|
"protocolVersion": {
|
|
24
25
|
"type": "string",
|
|
25
26
|
"const": "0.2.0",
|
|
@@ -418,5 +419,90 @@
|
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
}
|
|
421
|
-
}
|
|
422
|
+
},
|
|
423
|
+
"allOf": [
|
|
424
|
+
{
|
|
425
|
+
"if": {
|
|
426
|
+
"required": ["contextGrant"],
|
|
427
|
+
"properties": {
|
|
428
|
+
"contextGrant": {
|
|
429
|
+
"properties": {
|
|
430
|
+
"deliveryMode": { "enum": ["view_only", "hand_over"] }
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
"then": {
|
|
436
|
+
"properties": {
|
|
437
|
+
"permissions": {
|
|
438
|
+
"properties": {
|
|
439
|
+
"maxDelegationDepth": {
|
|
440
|
+
"const": 0
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
"allOf": [
|
|
446
|
+
{
|
|
447
|
+
"if": {
|
|
448
|
+
"properties": {
|
|
449
|
+
"contextGrant": {
|
|
450
|
+
"properties": {
|
|
451
|
+
"deliveryMode": {
|
|
452
|
+
"const": "view_only"
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
"then": {
|
|
459
|
+
"properties": {
|
|
460
|
+
"sandboxPolicy": {
|
|
461
|
+
"properties": {
|
|
462
|
+
"filesystemScope": {
|
|
463
|
+
"const": "ephemeral_workspace_only"
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"if": {
|
|
475
|
+
"required": [
|
|
476
|
+
"contextGrant"
|
|
477
|
+
],
|
|
478
|
+
"properties": {
|
|
479
|
+
"contextGrant": {
|
|
480
|
+
"properties": {
|
|
481
|
+
"deliveryMode": {
|
|
482
|
+
"const": "approval_redelegation"
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
"then": {
|
|
489
|
+
"properties": {
|
|
490
|
+
"permissions": {
|
|
491
|
+
"properties": {
|
|
492
|
+
"maxDelegationDepth": {
|
|
493
|
+
"const": 1
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
"sandboxPolicy": {
|
|
498
|
+
"properties": {
|
|
499
|
+
"filesystemScope": {
|
|
500
|
+
"const": "ephemeral_workspace_only"
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
]
|
|
422
508
|
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Context grants (CP1 and CP5a)
|
|
2
|
+
|
|
3
|
+
`TaskManifest.contextGrant` is an optional 0.2.0 contract property for a
|
|
4
|
+
sender's selected context. Existing manifests without it remain valid in both
|
|
5
|
+
supported versions. No protocol version, peer floor, or release clock changes.
|
|
6
|
+
A peer with the older closed 0.2.0 schema will reject this optional extension;
|
|
7
|
+
use it only with CP1-capable peers. There is no automatic downgrade that strips
|
|
8
|
+
the grant.
|
|
9
|
+
|
|
10
|
+
| Delivery mode | Delegation depth | Retention declaration | Input retention |
|
|
11
|
+
| --- | --- | --- | --- |
|
|
12
|
+
| `view_only` (builder default) | 0 | `ephemeral_view` | false |
|
|
13
|
+
| `hand_over` | 0 | `keep_deliverable` | false |
|
|
14
|
+
| `approval_redelegation` (explicit opt-in) | 1 | either; default `ephemeral_view` | false |
|
|
15
|
+
|
|
16
|
+
`hand_over` permits keeping the agreed, accepted deliverable. It does not permit
|
|
17
|
+
keeping the input selection. CP5a enables `approval_redelegation` only with the
|
|
18
|
+
owner decision and host prerequisites described below. Desktop controls are outside this slice.
|
|
19
|
+
|
|
20
|
+
## Build and validate
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { buildTaskManifest, validateManifest, validateContextGrantUse } from 'sealbridge/sdk';
|
|
24
|
+
|
|
25
|
+
const manifest = buildTaskManifest({
|
|
26
|
+
ownerDid, workerDid, title: 'Production feasibility',
|
|
27
|
+
description: 'Review selected dimensions and material.',
|
|
28
|
+
contextGrant: {
|
|
29
|
+
selectors: ['$.items[*]'],
|
|
30
|
+
fieldsAllowed: ['dimensions', 'material'],
|
|
31
|
+
fieldsDenied: ['customerName'],
|
|
32
|
+
angle: 'Report feasibility and missing dimensions.',
|
|
33
|
+
// Optional: deliveryMode: 'hand_over'
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
validateManifest(manifest);
|
|
37
|
+
validateContextGrantUse(manifest, selectedInput);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The opt-in builder defaults to `view_only`, 24 hours from manifest `createdAt`,
|
|
41
|
+
64 KiB, the mode's retention declaration, and `inputRetentionAllowed: false`.
|
|
42
|
+
It does not change default manifests. `RequesterClient.delegate` also accepts
|
|
43
|
+
these builder options as `contextGrant`; a supplied `manifest` is authoritative.
|
|
44
|
+
|
|
45
|
+
Selectors are non-empty opaque strings describing the sender's selection.
|
|
46
|
+
CP1 does not define a selector language, fetch source data, or filter input.
|
|
47
|
+
The sender must construct the selection before submitting it. Allowed and denied
|
|
48
|
+
field identifiers are compared literally; any identical identifier in both lists
|
|
49
|
+
is refused. Empty selectors, blank angles, unknown grant properties (including a
|
|
50
|
+
second `maxDelegationDepth`), and mismatched depth, retention or filesystem scope
|
|
51
|
+
are refused. `view_only` requires the existing
|
|
52
|
+
`filesystemScope: ephemeral_workspace_only` declaration. The builder uses that
|
|
53
|
+
scope for both modes. CP1 refuses `inputRetentionAllowed: true` in either mode.
|
|
54
|
+
A worker configured with the persistent plaintext `inboxPath` refuses grants.
|
|
55
|
+
|
|
56
|
+
The schema caps `maxBytes` at 65,536. Live use checks the UTF-8 byte length of the
|
|
57
|
+
entire JSON-serialized inline input, including JSON syntax, against that limit.
|
|
58
|
+
This is an input limit, not a promise that envelope overhead fits every relay's
|
|
59
|
+
configured admission cap. CP1 does not add attachment transfer or source access.
|
|
60
|
+
`expiresAt` must be after manifest `createdAt` and at most seven days after it.
|
|
61
|
+
Live proposal, acceptance and execution handoff additionally reject expired
|
|
62
|
+
grants, including expiry during owner review. Historical contract verification
|
|
63
|
+
checks the declared interval without consulting the current clock. Expiry does
|
|
64
|
+
not extend the task deadline or prove deletion. Existing execution timeouts still
|
|
65
|
+
control a running adapter.
|
|
66
|
+
|
|
67
|
+
`outputSchema` in a grant is an optional declaration. CP1 does not add angle or
|
|
68
|
+
grant-output verification; existing `io.outputSchema` behavior continues.
|
|
69
|
+
|
|
70
|
+
## Audit lifecycle
|
|
71
|
+
|
|
72
|
+
Context events are `CONTEXT_GRANT`, `CONTEXT_MODE`, `CONTEXT_OPENED`,
|
|
73
|
+
`CONTEXT_DISCARDED`, and `CONTEXT_DELETION_ATTEMPTED`. Each payload contains only
|
|
74
|
+
`{ grantDigest, deliveryMode }`, with the digest computed over the exact grant
|
|
75
|
+
using the existing canonical JSON digest. Extra lifecycle payload fields are
|
|
76
|
+
rejected by the audit-entry schema.
|
|
77
|
+
|
|
78
|
+
The worker records grant and mode after proposal admission, opened after contract
|
|
79
|
+
approval, and discarded on a subsequent terminal failure where its audit channel
|
|
80
|
+
is still available. Pending intake is not recorded as discarded. On normal
|
|
81
|
+
execution completion it attempts the existing temporary workspace cleanup before
|
|
82
|
+
delivery and records deletion attempted before the bilateral checkpoint. The
|
|
83
|
+
event describes an attempt, including cleanup failures; the existing cleanup
|
|
84
|
+
error callback still reports residual files. Existing cancellation and failure
|
|
85
|
+
cleanup paths remain; they do not claim a deletion event after a sealed or
|
|
86
|
+
unavailable audit channel. Pre-admission refusals have no new bilateral entries.
|
|
87
|
+
|
|
88
|
+
For grant-bearing sessions, proposal audit payloads contain proposal/manifest
|
|
89
|
+
and frame digests plus the grant digest and mode, rather than the manifest and
|
|
90
|
+
input. Acceptance audit payloads contain digests, worker identity, and the
|
|
91
|
+
worker's signed acceptance proof, rather than the full contract. The encrypted
|
|
92
|
+
wire frames still carry the complete signed contract. Replay/recovery verifies
|
|
93
|
+
the compact evidence against the supplied manifest. Sessions without a grant
|
|
94
|
+
keep their existing audit payloads. Depth-zero delivery and progress evidence retain their
|
|
95
|
+
existing shapes and may contain application data; CP1 is not a general content
|
|
96
|
+
scrubber for adapter output.
|
|
97
|
+
|
|
98
|
+
AuditInterruption local format 1 remains limited to one acknowledged PROPOSE
|
|
99
|
+
containing the full signed manifest. Compact grant proposals and their lifecycle
|
|
100
|
+
entries are outside that scope, including when `auditInterruptionFormat: 1` is
|
|
101
|
+
enabled on the worker. Grant sessions keep their existing lifecycle and recovery
|
|
102
|
+
behavior; sessions without grants retain format-1 interruption closure. The
|
|
103
|
+
interruption verifier's manifest and prefix checks are unchanged.
|
|
104
|
+
|
|
105
|
+
Embedders can use `appendContextGrantAuditEvent(append, eventType, grant)` from
|
|
106
|
+
`sealbridge/sdk` for an actual local lifecycle action. The append port owns
|
|
107
|
+
signing, countersigning and persistence; for example, it can call an existing
|
|
108
|
+
`BilateralLedger.append`. The helper never appends a grant body. Do not report
|
|
109
|
+
opened or deletion attempted unless the corresponding action occurred.
|
|
110
|
+
|
|
111
|
+
The filesystem and retention fields are contract declarations. A temporary
|
|
112
|
+
workspace cleanup attempt does not prove erasure of copies, provider records,
|
|
113
|
+
held input, owner-managed files, or application logs. CP1 adds neither a deletion
|
|
114
|
+
proof nor a deliverable storage UI.
|
|
115
|
+
|
|
116
|
+
Schemas: [ContextGrant](../spec/context-grant.schema.json),
|
|
117
|
+
[audit payload](../spec/context-grant-audit-payload.schema.json),
|
|
118
|
+
[manifest 0.2.0](../spec/task-manifest.0.2.0.schema.json).
|
|
119
|
+
Examples: [view only](../spec/examples/context-pooling/view_only/sample-task-manifest.0.2.0.json),
|
|
120
|
+
[hand over](../spec/examples/context-pooling/hand_over/sample-task-manifest.0.2.0.json).
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
## CP5a: one approved child edge
|
|
124
|
+
|
|
125
|
+
For A → B → C, A explicitly selects `approval_redelegation` on A → B at depth 1.
|
|
126
|
+
The builder adds the existing `GATE_SUB_DELEGATION`. B can dispatch separate
|
|
127
|
+
B → C tasks with strictly narrower `view_only` grants at depth 0. Only one
|
|
128
|
+
edge is supported; siblings are independent one-edge chains.
|
|
129
|
+
|
|
130
|
+
The root requires protocol 0.2.0, `ephemeral_workspace_only`, and absent/false
|
|
131
|
+
input retention. Both root retention declarations remain available. No required
|
|
132
|
+
manifest field or protocol version changes. Use this mode only with a known
|
|
133
|
+
CP5a worker: version 0.2.0 alone does not advertise support. C receives an ordinary
|
|
134
|
+
CP1 task; its host handles inspection and owner opening.
|
|
135
|
+
|
|
136
|
+
### Host configuration and owner decisions
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
import { WorkerNode, RequesterClient } from 'sealbridge/sdk';
|
|
140
|
+
|
|
141
|
+
const childRequester = new RequesterClient({
|
|
142
|
+
owner: bOwner, relay, approvalProvider: bOwnerDecisionProvider,
|
|
143
|
+
});
|
|
144
|
+
const worker = new WorkerNode({
|
|
145
|
+
owner: bOwner, relay, adapter, auditPath,
|
|
146
|
+
approvalProvider: bOwnerDecisionProvider,
|
|
147
|
+
redelegation: { requester: childRequester, ownerApprovalProvider: bOwnerDecisionProvider },
|
|
148
|
+
});
|
|
149
|
+
// Inside an admitted root adapter:
|
|
150
|
+
const partial = await context.redelegate!({
|
|
151
|
+
to: cInvitation, manifest: fullyBuiltChildManifest, input: alreadySelectedJson,
|
|
152
|
+
});
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The worker needs `auditPath` for its durable journal and a requester using B's
|
|
156
|
+
same owner identity. Configure ordinary connection and inspection policy
|
|
157
|
+
separately. The child method exists only during an admitted approval-mode root.
|
|
158
|
+
`ChildDelegationRequest` accepts `to`, optional `relay`, complete `manifest`,
|
|
159
|
+
selected JSON `input`, and optional `auditPath`. Resolve saved references before
|
|
160
|
+
calling. Capability chains, automatic approval/retry flags and supplied proofs
|
|
161
|
+
are not accepted. The helper adds no root identifiers or parent input to C's
|
|
162
|
+
frames; owner-supplied child content can still disclose them.
|
|
163
|
+
|
|
164
|
+
A approves the exact root manifest/input/worker target before send. B separately
|
|
165
|
+
opens the root, approves each child manifest/input/owner target, and reviews its
|
|
166
|
+
result. A reviews the final root delivery. These live boundaries require a
|
|
167
|
+
provider declaring `ownerDecision: true` and fresh target-bound owner receipts.
|
|
168
|
+
Interactive CLI and MCP form providers declare it; webhooks declare it in
|
|
169
|
+
owner-decision response mode. Policy providers cannot operate this mode. The
|
|
170
|
+
marker is a host assertion, not independent evidence of a physical human action.
|
|
171
|
+
|
|
172
|
+
### Link checks and delivery
|
|
173
|
+
|
|
174
|
+
`createDelegationLink` signs after authenticated child acceptance and copies the
|
|
175
|
+
actual child limits. `verifyDelegationChain` checks signed contracts, task IDs,
|
|
176
|
+
owner continuity, digests, timestamps and remaining depth without consulting
|
|
177
|
+
today's clock. `assertDelegationAttenuation` compares declarations literally:
|
|
178
|
+
child selectors must be a nonempty subset, parent allowed fields cannot widen,
|
|
179
|
+
denied fields persist, and selectors or allowed fields must strictly narrow.
|
|
180
|
+
Reducing only bytes, budget or depth is insufficient. Parent grant `outputSchema`
|
|
181
|
+
is preserved. Numeric budgets, deadline, expiry and bytes cannot increase;
|
|
182
|
+
other budget fields, sandbox policy and verification policy must be equal.
|
|
183
|
+
Child capabilities are empty. These are per-task ceilings; sibling budgets are
|
|
184
|
+
not added together. The checks do not establish semantic provenance, interpret
|
|
185
|
+
selectors, verify an angle, prove erasure or establish child-output acceptance.
|
|
186
|
+
|
|
187
|
+
The host persists approved attempts before dispatch and accepted proofs before
|
|
188
|
+
parent delivery, retaining proofs even when later child execution fails. It
|
|
189
|
+
waits for managed children and attaches every issued proof; unresolved attempts,
|
|
190
|
+
duplicate IDs, invalid proofs and empty attachments prevent delivery. Restart
|
|
191
|
+
uses existing terminal recovery and does not replay child sends. An otherwise
|
|
192
|
+
valid subset cannot reveal an out-of-band sibling to A.
|
|
193
|
+
|
|
194
|
+
`Delivery.delegation` contains `{ parentContract, children }`, with each child
|
|
195
|
+
`{ link, childContract }`. The optional attachment is required for depth-one
|
|
196
|
+
contracts carrying a ContextGrant. Contracts without a ContextGrant keep their
|
|
197
|
+
origin/main delivery, verification, recovery and retained-result behavior at
|
|
198
|
+
all existing depths, including depth one without proof. CP1 depth-zero grants
|
|
199
|
+
keep their ordinary path; attaching CP5a evidence to them is refused. There is
|
|
200
|
+
no signed empty-child alternative: B cancels/rejects if it cannot produce a
|
|
201
|
+
linked child; A may explicitly submit a fresh depth-zero task.
|
|
202
|
+
|
|
203
|
+
Full signed parent and child contracts disclose selectors, angles, task text,
|
|
204
|
+
limits and owner DIDs to A. B reviews that disclosure before dispatch. Proof and
|
|
205
|
+
new journal fields add no raw input or child artifact body. Existing application
|
|
206
|
+
records and relay byte limits still apply; proofs are never stripped to fit.
|
|
207
|
+
|
|
208
|
+
`verifyDelegationAttachment(attachment, trustedContract)` checks every sibling
|
|
209
|
+
against the exact root. Live verification runs before output checks, callbacks
|
|
210
|
+
and owner review, adding `delegation_chain` only for the grant-bearing depth-one
|
|
211
|
+
path. Direct live verification also requires `ownerDecision: true`. Final review
|
|
212
|
+
includes verified child owner DIDs and proof digests. Recovery binds the embedded
|
|
213
|
+
root to retained proposal/acceptance evidence; historical expiry is not a new
|
|
214
|
+
refusal. Existing hashes and checkpoints retain the delivery attachment, and
|
|
215
|
+
version-1 task journals retain optional child-attempt state. `verifyAudit`
|
|
216
|
+
continues to check ledger hashes/signatures only.
|
|
217
|
+
|
|
218
|
+
Diagnostics are `DELEGATION_PROOF_REQUIRED`, `DELEGATION_INVALID`, and
|
|
219
|
+
`DELEGATION_APPROVAL_REQUIRED`. Schemas: [link](../spec/delegation-link.schema.json)
|
|
220
|
+
and [attachment](../spec/delegation-attachment.schema.json). See the
|
|
221
|
+
[complete attachment example](../spec/examples/context-pooling/approval_redelegation/sample-delegation-attachment.json).
|
package/docs/sdk.ja.md
CHANGED
|
@@ -36,10 +36,12 @@ import だけでは、鍵の作成・招待の読み取り・待受開始・rela
|
|
|
36
36
|
| 接続の metadata | `WorkerTrustStore`(`listConnections` を含む), `workerIntakePath` |
|
|
37
37
|
| 接続交換 | `ConnectionService`, `ConnectionRouter`, `StoredConnectionExchange`, `syncConnections` |
|
|
38
38
|
| 所有者の確認コマンド | `connectionsCommand`, `connectionHumanReview` |
|
|
39
|
-
| 保留の審査 | `ConnectionAdmissionReview`, `HeldRequestReview`, `unavailableHeldContentReviewProvider` |
|
|
39
|
+
| 保留の審査 | `ConnectionAdmissionReview`, `HeldRequestReview`, `unavailableHeldContentReviewProvider`, `createRuleBasedContentReviewProvider` |
|
|
40
|
+
| 検証済みタスク内容 | `taskContent` |
|
|
40
41
|
| 検索・招待 | `createSignedAgentCard`, `verifySignedAgentCard`, `createInviteToken`, `inviteTokenFromUri`, `isInviteTarget`, `parseAndVerifyInviteToken`, `discoverAgentCards`, `findDiscoveredAgentCard` |
|
|
41
42
|
| 鍵の生成 | `generateKeyPair` |
|
|
42
43
|
| MCP のホスト | `AcpMcpServer`, `mcpServerCommand`, `parseMcpServerArgs`, `mcpServerOptionsFromArgs` |
|
|
44
|
+
| 内容のルール検査 | `inspectRuleContent`, `CONTENT_INSPECTION_RULES`, `CONTENT_INSPECTION_RULESET_VERSION`, `CONTENT_INSPECTION_RULESET_DIGEST`, `CONTENT_INSPECTION_LIMITS` |
|
|
43
45
|
|
|
44
46
|
名前付きの型 exports:
|
|
45
47
|
|
|
@@ -57,7 +59,7 @@ import だけでは、鍵の作成・招待の読み取り・待受開始・rela
|
|
|
57
59
|
`ConnectionRouterOptions`, `ConnectedEvent`, `ConnectionsCommandOptions`。
|
|
58
60
|
- 審査: `HeldRequestReviewOptions`, `HeldContentReviewProvider`,
|
|
59
61
|
`HeldInspectionContext`, `InspectionCompletion`, `ConnectionAdmissionReviewOptions`,
|
|
60
|
-
`InboundConnectionSummary`。
|
|
62
|
+
`InboundConnectionSummary`, `HeldTaskContent`。
|
|
61
63
|
- MCP: `AcpMcpServerOptions`, `ApprovalProvider`, `ParsedMcpServerArgs`。
|
|
62
64
|
- core・転送: `KeyPair`, `Json`, `Signed`, `SignedEnvelope`, `Invite`,
|
|
63
65
|
`AgentSkill`, `DiscoveryAgentCard`, `CreateAgentCardOptions`, `SignedAgentCard`,
|
|
@@ -126,6 +128,31 @@ JSON の metadata・イベントを受け取ります。`now`・`transportFactor
|
|
|
126
128
|
任意の `peerDisplayName` を含み、表示名は情報として扱います。組み込み検査の対象は接続情報だけです。
|
|
127
129
|
[受信接続の審査](connections/admission.ja.md#受信接続の審査)を参照してください。
|
|
128
130
|
|
|
131
|
+
## 保留タスク内容の検証と取り出し
|
|
132
|
+
|
|
133
|
+
`taskContent(envelope, owner, contentDigest, envelopeDigest?)` は
|
|
134
|
+
`HeldTaskContent` として `{manifest, input, capabilityChains}` だけを返します。
|
|
135
|
+
能力の既定値は `[]` です。復号前に封筒の署名と宛先を検証し、暗号化と自身の `input`
|
|
136
|
+
欄を必須とします。manifest と提案の署名、PROPOSE・連番0・タスク・依頼者・
|
|
137
|
+
ワーカー所有者・内容ダイジェストの対応も検証します。保留レコードの `envelopeDigest`
|
|
138
|
+
を渡すと封筒全体との一致も検証します。招待・接続・転送用の欄は返しません。
|
|
139
|
+
既存 CLI の内部パスからの import を含め、3引数の呼び出しも維持します。
|
|
140
|
+
|
|
141
|
+
結果は機微な平文をメモリ内に含みます。ログや永続保存に入れず、文字列データとして
|
|
142
|
+
表示してください。所有者向けに表示する呼び出し側は、`HeldRequestReview` による
|
|
143
|
+
検査完了(所有者・内容・封筒に結び付いた受領書を含む)を別途必須にしてください。
|
|
144
|
+
取り出し自体は検査状態を確認せず、開封・接続同意・実行を承認しません。
|
|
145
|
+
検査 provider は検査中にこの関数を使えます。能力チェーンの権限・信頼・現在の grant や
|
|
146
|
+
依頼期限の有効性は検証しません。期限を過ぎた終端タスクも内容を検証でき、
|
|
147
|
+
ライブ受付は従来の別の検証を維持します。構造と署名などの検証であり、
|
|
148
|
+
内容に対するヒューリスティックな検出・評価は行いません。
|
|
149
|
+
|
|
150
|
+
検証失敗は `INVALID_PROPOSAL`、暗号化入力の失敗は従来の
|
|
151
|
+
`UNENCRYPTED_ENVELOPE_REJECTED` または `ENVELOPE_DECRYPTION_FAILED` です。
|
|
152
|
+
スキーマやネイティブパーサーの詳細は返しません。検査受領書の作成・ファイル書き込み・
|
|
153
|
+
通信は行わず、プロトコル・スキーマ・必須欄・保存形式は変更しません。
|
|
154
|
+
[保留内容の審査](connections/held-content.ja.md)を参照してください。
|
|
155
|
+
|
|
129
156
|
## MCP のライフサイクル
|
|
130
157
|
|
|
131
158
|
専用の stdio MCP プロセスでは `mcpServerCommand(args, identityOptions)` が既存 CLI
|
|
@@ -136,3 +163,82 @@ JSON の metadata・イベントを受け取ります。`now`・`transportFactor
|
|
|
136
163
|
無指定時の policy-auto の既定値は変わりません。送信前の承認と最終検収は別です。
|
|
137
164
|
接続の審査には別の `connectionReview` を使います。[MCP の説明](../README.ja.md)も
|
|
138
165
|
参照してください。
|
|
166
|
+
|
|
167
|
+
## 監査の中断証拠
|
|
168
|
+
|
|
169
|
+
`parseJsonl` / `verifyAudit` は双方署名の形式専用を維持します。`parseAuditJsonl` / `verifyAuditEvidence` は `AuditEvidence`(`AuditBundle | InterruptedAuditBundle`)を扱い、ワーカー単独の形式 1 の終端は、外部ピンが一致しても `UNILATERALLY_CLOSED`・`valid:false` です。`createAuditInterruption`・対応ストア・関連公開型も `sealbridge/sdk` から利用できます。[保存形式・ピン・永続化・依頼者との照合規則(英語)](audit-interruption.md)を参照してください。
|
|
170
|
+
|
|
171
|
+
## 明示的に選ぶオフラインの内容検査
|
|
172
|
+
|
|
173
|
+
`inspectRuleContent({manifest,input,capabilityChains?}, limits?, signal?)` は
|
|
174
|
+
core のメモリ上の検査器です。公開する型は `RuleInspectionInput`、
|
|
175
|
+
`RuleInspectionOptions`、`RuleInspectionRule`、`RuleInspectionKind`、
|
|
176
|
+
`RuleInspectionFinding`、`RuleInspectionDiagnosticCode`、`RuleInspectionReport`、
|
|
177
|
+
`RuleBasedContentReviewOptions` です。ルールと走査は core、子プロセス管理は runtime
|
|
178
|
+
が担当します。edge の入口は変えません。
|
|
179
|
+
|
|
180
|
+
保留中のタスクには、プロバイダを明示的に渡します。
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
import { HeldRequestReview, WorkerNode, createRuleBasedContentReviewProvider } from 'sealbridge/sdk';
|
|
184
|
+
|
|
185
|
+
const inspectionTimeoutMs = 5000;
|
|
186
|
+
const heldReview = new HeldRequestReview(owner, {
|
|
187
|
+
...identityOptions,
|
|
188
|
+
inspectionTimeoutMs,
|
|
189
|
+
provider: createRuleBasedContentReviewProvider({
|
|
190
|
+
timeoutMs: inspectionTimeoutMs,
|
|
191
|
+
onReport(recordId, report) {
|
|
192
|
+
// 所有者向けの資料として、メモリ上で文字どおり表示する。
|
|
193
|
+
renderInspection(recordId, report);
|
|
194
|
+
},
|
|
195
|
+
}),
|
|
196
|
+
});
|
|
197
|
+
const worker = new WorkerNode({ ...workerOptions, owner, heldReview });
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
`owner`・`identityOptions`・`workerOptions`・`renderInspection` は組み込み側が用意します。
|
|
201
|
+
プロバイダの制限時間は review 以下にします。両方の既定は5秒、指定範囲は1〜45,000 ms
|
|
202
|
+
です。中止、どちらかの時間切れ、失敗で子を終了します。コールバックの例外・拒否・中断・
|
|
203
|
+
時間超過でも完了になりません。コールバックへ渡すレポートは複製なので、変更しても受領の
|
|
204
|
+
内容は変わりません。これはホストの処理であり、任意のコードを隔離する口ではありません。
|
|
205
|
+
|
|
206
|
+
外側の封筒署名、暗号化された宛先、署名付き proposal、manifest、タスク・送信者・
|
|
207
|
+
ワーカーと保留ダイジェストの一致を確認してから、manifest・input・capabilities だけを
|
|
208
|
+
固定のビルド済み検査器へ IPC で渡します。所有者の鍵と通信用の資格情報は渡しません。
|
|
209
|
+
環境変数は許可リストから作り、結果は64 KiBまでとし、中止・時間切れ・失敗で子を終了します。
|
|
210
|
+
平文ファイルやログを書かず、ネットワーク要求・DNS照会・実行・アーカイブの展開をしません。
|
|
211
|
+
カーネルのネットワーク隔離ではなく、固定の信頼したコードです。外部プラグイン、ダウンロード
|
|
212
|
+
したルール、呼び出し側の正規表現・ソースコードは受け付けません。
|
|
213
|
+
|
|
214
|
+
変更不可の記述子・検出器の版・既定の上限から `CONTENT_INSPECTION_RULESET_DIGEST` を
|
|
215
|
+
作ります。既定は直列化した内容256 KiB、深さ32、ノードとキー合計100,000、文字列ごと
|
|
216
|
+
UTF-8で64 KiB、所見100件、base64復号合計64 KiBです。`limits` では下げることだけができます。
|
|
217
|
+
作業量・出力の上限超過は `error` とし、切り詰めて成功にはしません。manifest の全欄・
|
|
218
|
+
input・capabilities・文字列のキーを JSON Pointer 順で検査します。位置は元の文字列の
|
|
219
|
+
UTF-16単位です。パスは `~0`・`~1` でエスケープし、機微な内容の可能性があるキーは
|
|
220
|
+
`[redacted]` に置き換えます。所見の説明と診断は固定コードで、証拠の抜粋やURLの値は
|
|
221
|
+
含めません。通常のキーは位置に含まれるため、レポートも確認用の資料として扱います。
|
|
222
|
+
|
|
223
|
+
見えない文字・制御文字、英語と日本語の指示表現、URLの形、秘密を求める語と動詞の
|
|
224
|
+
組み合わせ、資格情報の典型的な形、コードの目印、長いbase64を検出します。復号は上限を
|
|
225
|
+
設けて1回だけ行い、実行形式・アーカイブの先頭バイトなら `block` にします。検出は
|
|
226
|
+
ヒューリスティックです。通常の引用文にも反応し、未対応の表現は通ることがあります。
|
|
227
|
+
資格情報をオンラインで確認しません。`pass` はこのルールで所見が出なかったことを示します。
|
|
228
|
+
`pass`・`warn`・`block` の完了はいずれも既存受領の `complete` になり、`block` は
|
|
229
|
+
所有者への最も強い注意です。実行許可や開封にはならず、その会期の人間による契約承認は
|
|
230
|
+
引き続き必要です。失敗は途中の所見より優先し `error` になり、検査完了前の表示を許可しません。
|
|
231
|
+
|
|
232
|
+
`contentDigest` は `digest({manifest,input})` です。capabilities と実効上限はレポートと
|
|
233
|
+
正確な封筒を通じて結び付けます。core 単体で上限内の JSON 複製を作る前に失敗した場合は、
|
|
234
|
+
不完全な値として `digest(null)` を返します。エラーレポートを内容の検証に使わないでください。
|
|
235
|
+
runtime は認証できた保留のダイジェストにエラーレポートを結び付けます。既存受領の
|
|
236
|
+
`reportDigest` は `{recordId,ownerDid,kind,contentDigest,envelopeDigest,report}` の
|
|
237
|
+
ハッシュです。保存するのはこのダイジェストだけで、レポート全体は `onReport` のメモリ内に
|
|
238
|
+
とどめます。既存受領に所見はなく、`HeldRequestReview.inspect` はキャッシュ済み完了を返す
|
|
239
|
+
場合があります。再起動後にレポートが必要なら、保存済み封筒と対応する inspection context
|
|
240
|
+
でプロバイダを明示的に再実行します。受領から所見なしと推定せず、ディスクにレポートの
|
|
241
|
+
キャッシュを作らないでください。
|
|
242
|
+
|
|
243
|
+
task 以外は `unavailable` です。既定の検査、CLI の表示、trusted の受付、MCP、自動承認の
|
|
244
|
+
動作は変わりません。protocol・schema・manifest 必須欄・通信形式・保存形式を変えません。
|