@the-ai-company/cbio-node-runtime 1.58.0 → 1.60.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 +55 -24
- package/dist/clients/agent/client.d.ts +9 -1
- package/dist/clients/agent/client.js +41 -11
- package/dist/clients/agent/client.js.map +1 -1
- package/dist/clients/agent/contracts.d.ts +5 -2
- package/dist/clients/owner/client.d.ts +15 -11
- package/dist/clients/owner/client.js +83 -30
- package/dist/clients/owner/client.js.map +1 -1
- package/dist/clients/owner/contracts.d.ts +32 -22
- package/dist/clients/owner/index.d.ts +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/vault-core/contracts.d.ts +204 -26
- package/dist/vault-core/contracts.js +6 -2
- package/dist/vault-core/contracts.js.map +1 -1
- package/dist/vault-core/core.d.ts +23 -4
- package/dist/vault-core/core.js +480 -121
- package/dist/vault-core/core.js.map +1 -1
- package/dist/vault-core/defaults.d.ts +9 -2
- package/dist/vault-core/defaults.js +41 -14
- package/dist/vault-core/defaults.js.map +1 -1
- package/dist/vault-core/index.d.ts +1 -1
- package/dist/vault-core/index.js.map +1 -1
- package/dist/vault-core/persistence.d.ts +12 -2
- package/dist/vault-core/persistence.js +43 -4
- package/dist/vault-core/persistence.js.map +1 -1
- package/dist/vault-core/ports.d.ts +7 -1
- package/dist/vault-core/tool-metadata.js +27 -10
- package/dist/vault-core/tool-metadata.js.map +1 -1
- package/dist/vault-ingress/defaults.d.ts +2 -0
- package/dist/vault-ingress/defaults.js +6 -0
- package/dist/vault-ingress/defaults.js.map +1 -1
- package/dist/vault-ingress/index.d.ts +54 -9
- package/dist/vault-ingress/index.js +160 -46
- package/dist/vault-ingress/index.js.map +1 -1
- package/dist/vault-ingress/remote-transport.d.ts +2 -0
- package/dist/vault-ingress/remote-transport.js +33 -4
- package/dist/vault-ingress/remote-transport.js.map +1 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/REFERENCE.md +43 -30
- package/docs/WORKS_WITH_CUSTOM_FETCH.md +2 -2
- package/docs/api/README.md +5 -5
- package/docs/api/classes/IdentityError.md +1 -1
- package/docs/api/classes/OwnerClientError.md +1 -1
- package/docs/api/classes/VaultCore.md +176 -16
- package/docs/api/classes/VaultCoreError.md +1 -1
- package/docs/api/enumerations/IdentityErrorCode.md +1 -1
- package/docs/api/enumerations/OwnerClientErrorCode.md +1 -1
- package/docs/api/functions/createAgentClient.md +1 -1
- package/docs/api/functions/createIdentity.md +1 -1
- package/docs/api/functions/createOwnerHttpFlowBoundary.md +1 -1
- package/docs/api/functions/createOwnerSession.md +1 -1
- package/docs/api/functions/createPersistentVaultCoreDependencies.md +1 -1
- package/docs/api/functions/createStandardAcquireBoundary.md +1 -1
- package/docs/api/functions/createStandardDispatchBoundary.md +1 -1
- package/docs/api/functions/createVault.md +1 -1
- package/docs/api/functions/createVaultClient.md +1 -1
- package/docs/api/functions/createVaultCore.md +1 -1
- package/docs/api/functions/createVaultCoreDependencies.md +1 -1
- package/docs/api/functions/createVaultService.md +1 -1
- package/docs/api/functions/createWorkspaceStorage.md +1 -1
- package/docs/api/functions/deriveIdentityId.md +1 -1
- package/docs/api/functions/deriveVaultWorkingKeyFromPassword.md +1 -1
- package/docs/api/functions/getDefaultWorkspaceDir.md +1 -1
- package/docs/api/functions/handleVaultAgentControlHttp.md +1 -1
- package/docs/api/functions/handleVaultHttpDispatch.md +1 -1
- package/docs/api/functions/initializeVaultCustody.md +1 -1
- package/docs/api/functions/listVaults.md +1 -1
- package/docs/api/functions/readVaultProfile.md +1 -1
- package/docs/api/functions/recoverVault.md +1 -1
- package/docs/api/functions/recoverVaultWorkingKey.md +1 -1
- package/docs/api/functions/restoreIdentity.md +1 -1
- package/docs/api/functions/updateVaultMetadata.md +1 -1
- package/docs/api/functions/wrapVaultCoreAsVaultService.md +1 -1
- package/docs/api/functions/writeVaultProfile.md +1 -1
- package/docs/api/interfaces/AgentClient.md +33 -1
- package/docs/api/interfaces/AgentDispatchIntent.md +1 -1
- package/docs/api/interfaces/AgentDispatchTransport.md +33 -1
- package/docs/api/interfaces/AgentIdentity.md +1 -1
- package/docs/api/interfaces/AgentSigner.md +1 -1
- package/docs/api/interfaces/AgentSubmitCapabilityRequestInput.md +9 -9
- package/docs/api/interfaces/CbioRuntime.md +1 -1
- package/docs/api/interfaces/CreateAgentClientOptions.md +1 -1
- package/docs/api/interfaces/CreateIdentityOptions.md +1 -1
- package/docs/api/interfaces/CreateOwnerSessionOptions.md +1 -1
- package/docs/api/interfaces/CreatePersistentVaultCoreDependenciesOptions.md +1 -1
- package/docs/api/interfaces/CreateVaultClientOptions.md +1 -1
- package/docs/api/interfaces/CreateVaultOptions.md +1 -1
- package/docs/api/interfaces/CreatedVault.md +1 -1
- package/docs/api/interfaces/DefaultPolicyEngineOptions.md +1 -1
- package/docs/api/interfaces/IStorageProvider.md +1 -1
- package/docs/api/interfaces/InitializeVaultCustodyOptions.md +1 -1
- package/docs/api/interfaces/InitializedVaultCustody.md +1 -1
- package/docs/api/interfaces/OwnerAgentProvisionResult.md +1 -1
- package/docs/api/interfaces/{OwnerStoreSecretInput.md → OwnerCreateSecretInput.md} +2 -2
- package/docs/api/interfaces/{VaultDeleteSecretInput.md → OwnerRemoveSecretInput.md} +2 -2
- package/docs/api/interfaces/OwnerSensitiveActionConfirmation.md +1 -1
- package/docs/api/interfaces/OwnerSensitiveActionContext.md +1 -1
- package/docs/api/interfaces/OwnerSession.md +1 -1
- package/docs/api/interfaces/{OwnerWriteSecretInput.md → OwnerUpdateSecretInput.md} +2 -2
- package/docs/api/interfaces/RecoverVaultOptions.md +1 -1
- package/docs/api/interfaces/RecoveredVault.md +1 -1
- package/docs/api/interfaces/RestoreIdentityOptions.md +1 -1
- package/docs/api/interfaces/Signer.md +1 -1
- package/docs/api/interfaces/VaultApproveCapabilityRequestInput.md +1 -1
- package/docs/api/interfaces/VaultApproveDispatchInput.md +1 -1
- package/docs/api/interfaces/VaultAuditQueryInput.md +1 -1
- package/docs/api/interfaces/VaultClient.md +112 -48
- package/docs/api/interfaces/VaultCoreDependenciesOptions.md +1 -1
- package/docs/api/interfaces/VaultCreateAgentInput.md +1 -1
- package/docs/api/interfaces/VaultExportSecretInput.md +1 -1
- package/docs/api/interfaces/VaultGrantCapabilityInput.md +9 -21
- package/docs/api/interfaces/VaultGrantCapabilityRequest.md +1 -1
- package/docs/api/interfaces/VaultIdentity.md +1 -1
- package/docs/api/interfaces/VaultImportAgentInput.md +1 -1
- package/docs/api/interfaces/VaultIssueSessionTokenInput.md +1 -1
- package/docs/api/interfaces/VaultListAgentsInput.md +1 -1
- package/docs/api/interfaces/VaultListCapabilitiesInput.md +1 -1
- package/docs/api/interfaces/VaultListSecretsInput.md +1 -1
- package/docs/api/interfaces/VaultMetadata.md +1 -1
- package/docs/api/interfaces/VaultObject.md +1 -1
- package/docs/api/interfaces/VaultProfile.md +1 -1
- package/docs/api/interfaces/VaultReadAgentPrivateKeyInput.md +1 -1
- package/docs/api/interfaces/VaultReadSecretPlaintextInput.md +1 -1
- package/docs/api/interfaces/VaultRegisterFlowInput.md +1 -1
- package/docs/api/interfaces/VaultRevokeCapabilityInput.md +1 -1
- package/docs/api/interfaces/VaultRevokeSessionTokenInput.md +1 -1
- package/docs/api/interfaces/VaultSigner.md +1 -1
- package/docs/api/interfaces/VaultSubmitCapabilityRequestInput.md +11 -17
- package/docs/api/interfaces/VaultUpdateAgentInput.md +1 -1
- package/docs/api/type-aliases/AgentCapabilityEnvelope.md +1 -1
- package/docs/api/type-aliases/AgentVisibleSecretRecord.md +1 -1
- package/docs/api/type-aliases/CbioRuntimeModule.md +1 -1
- package/docs/api/type-aliases/OwnerGrantCapabilityInput.md +1 -1
- package/docs/api/variables/DEFAULT_VAULT_KEY_CUSTODY_BLOB_KEY.md +1 -1
- package/docs/zh/README.md +27 -9
- package/examples/process-isolation.ts +6 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.60.0**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -9,46 +9,41 @@ In Sovereign Vault model, administrative actions are implicitly authorized by th
|
|
|
9
9
|
|
|
10
10
|
## Methods
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### ownerAllowAlways()
|
|
13
13
|
|
|
14
|
-
> **
|
|
15
|
-
|
|
16
|
-
Generates a new identity and registers it as an agent in one step.
|
|
17
|
-
The private key is stored in the vault for managed custody.
|
|
14
|
+
> **ownerAllowAlways**(`input`): `Promise`\<`DispatchResult`\>
|
|
18
15
|
|
|
19
16
|
#### Parameters
|
|
20
17
|
|
|
21
18
|
##### input
|
|
22
19
|
|
|
23
|
-
[`
|
|
20
|
+
[`VaultApproveCapabilityRequestInput`](VaultApproveCapabilityRequestInput.md)
|
|
24
21
|
|
|
25
22
|
#### Returns
|
|
26
23
|
|
|
27
|
-
`Promise
|
|
24
|
+
`Promise`\<`DispatchResult`\>
|
|
28
25
|
|
|
29
26
|
***
|
|
30
27
|
|
|
31
|
-
###
|
|
28
|
+
### ownerAllowOnce()
|
|
32
29
|
|
|
33
|
-
> **
|
|
34
|
-
|
|
35
|
-
Permanently deletes a secret from the vault.
|
|
30
|
+
> **ownerAllowOnce**(`input`): `Promise`\<`DispatchResult`\>
|
|
36
31
|
|
|
37
32
|
#### Parameters
|
|
38
33
|
|
|
39
34
|
##### input
|
|
40
35
|
|
|
41
|
-
[`
|
|
36
|
+
[`VaultApproveCapabilityRequestInput`](VaultApproveCapabilityRequestInput.md)
|
|
42
37
|
|
|
43
38
|
#### Returns
|
|
44
39
|
|
|
45
|
-
`Promise`\<`
|
|
40
|
+
`Promise`\<`DispatchResult`\>
|
|
46
41
|
|
|
47
42
|
***
|
|
48
43
|
|
|
49
|
-
###
|
|
44
|
+
### ownerApproveCapabilityRead()
|
|
50
45
|
|
|
51
|
-
> **
|
|
46
|
+
> **ownerApproveCapabilityRead**(`input`): `Promise`\<`CapabilityStateRecord`\>
|
|
52
47
|
|
|
53
48
|
#### Parameters
|
|
54
49
|
|
|
@@ -58,13 +53,13 @@ Permanently deletes a secret from the vault.
|
|
|
58
53
|
|
|
59
54
|
#### Returns
|
|
60
55
|
|
|
61
|
-
`Promise`\<`
|
|
56
|
+
`Promise`\<`CapabilityStateRecord`\>
|
|
62
57
|
|
|
63
58
|
***
|
|
64
59
|
|
|
65
|
-
###
|
|
60
|
+
### ownerApproveCapabilityWrite()
|
|
66
61
|
|
|
67
|
-
> **
|
|
62
|
+
> **ownerApproveCapabilityWrite**(`input`): `Promise`\<`CapabilityStateRecord`\>
|
|
68
63
|
|
|
69
64
|
#### Parameters
|
|
70
65
|
|
|
@@ -74,7 +69,60 @@ Permanently deletes a secret from the vault.
|
|
|
74
69
|
|
|
75
70
|
#### Returns
|
|
76
71
|
|
|
77
|
-
`Promise`\<`
|
|
72
|
+
`Promise`\<`CapabilityStateRecord`\>
|
|
73
|
+
|
|
74
|
+
***
|
|
75
|
+
|
|
76
|
+
### ownerCreateAgent()
|
|
77
|
+
|
|
78
|
+
> **ownerCreateAgent**(`input`): `Promise`\<[`OwnerAgentProvisionResult`](OwnerAgentProvisionResult.md)\>
|
|
79
|
+
|
|
80
|
+
Generates a new identity and registers it as an agent in one step.
|
|
81
|
+
The private key is stored in the vault for managed custody.
|
|
82
|
+
|
|
83
|
+
#### Parameters
|
|
84
|
+
|
|
85
|
+
##### input
|
|
86
|
+
|
|
87
|
+
[`VaultCreateAgentInput`](VaultCreateAgentInput.md)
|
|
88
|
+
|
|
89
|
+
#### Returns
|
|
90
|
+
|
|
91
|
+
`Promise`\<[`OwnerAgentProvisionResult`](OwnerAgentProvisionResult.md)\>
|
|
92
|
+
|
|
93
|
+
***
|
|
94
|
+
|
|
95
|
+
### ownerCreateSecret()
|
|
96
|
+
|
|
97
|
+
> **ownerCreateSecret**(`input`): `Promise`\<`SecretRecord`\>
|
|
98
|
+
|
|
99
|
+
Inserts a new active secret into the vault.
|
|
100
|
+
|
|
101
|
+
#### Parameters
|
|
102
|
+
|
|
103
|
+
##### input
|
|
104
|
+
|
|
105
|
+
[`OwnerCreateSecretInput`](OwnerCreateSecretInput.md)
|
|
106
|
+
|
|
107
|
+
#### Returns
|
|
108
|
+
|
|
109
|
+
`Promise`\<`SecretRecord`\>
|
|
110
|
+
|
|
111
|
+
***
|
|
112
|
+
|
|
113
|
+
### ownerDeny()
|
|
114
|
+
|
|
115
|
+
> **ownerDeny**(`requestId`): `Promise`\<`CapabilityStateRecord`\>
|
|
116
|
+
|
|
117
|
+
#### Parameters
|
|
118
|
+
|
|
119
|
+
##### requestId
|
|
120
|
+
|
|
121
|
+
`string`
|
|
122
|
+
|
|
123
|
+
#### Returns
|
|
124
|
+
|
|
125
|
+
`Promise`\<`CapabilityStateRecord`\>
|
|
78
126
|
|
|
79
127
|
***
|
|
80
128
|
|
|
@@ -96,6 +144,22 @@ Exports a secret's plaintext.
|
|
|
96
144
|
|
|
97
145
|
***
|
|
98
146
|
|
|
147
|
+
### ownerGetRequest()
|
|
148
|
+
|
|
149
|
+
> **ownerGetRequest**(`input`): `Promise`\<`OwnerRequestRecord`\>
|
|
150
|
+
|
|
151
|
+
#### Parameters
|
|
152
|
+
|
|
153
|
+
##### input
|
|
154
|
+
|
|
155
|
+
`VaultGetRequestInput`
|
|
156
|
+
|
|
157
|
+
#### Returns
|
|
158
|
+
|
|
159
|
+
`Promise`\<`OwnerRequestRecord`\>
|
|
160
|
+
|
|
161
|
+
***
|
|
162
|
+
|
|
99
163
|
### ownerGrantCapability()
|
|
100
164
|
|
|
101
165
|
> **ownerGrantCapability**(`input`): `Promise`\<`AgentCapability`\>
|
|
@@ -208,6 +272,22 @@ Lists all active capabilities granted to agents.
|
|
|
208
272
|
|
|
209
273
|
***
|
|
210
274
|
|
|
275
|
+
### ownerListRequests()
|
|
276
|
+
|
|
277
|
+
> **ownerListRequests**(`input?`): `Promise`\<readonly `OwnerVisibleRequestRecord`[]\>
|
|
278
|
+
|
|
279
|
+
#### Parameters
|
|
280
|
+
|
|
281
|
+
##### input?
|
|
282
|
+
|
|
283
|
+
`VaultListRequestsInput`
|
|
284
|
+
|
|
285
|
+
#### Returns
|
|
286
|
+
|
|
287
|
+
`Promise`\<readonly `OwnerVisibleRequestRecord`[]\>
|
|
288
|
+
|
|
289
|
+
***
|
|
290
|
+
|
|
211
291
|
### ownerListSecrets()
|
|
212
292
|
|
|
213
293
|
> **ownerListSecrets**(`input?`): `Promise`\<readonly `AgentVisibleSecretRecord`[]\>
|
|
@@ -294,7 +374,7 @@ Reads the tamper-evident audit log for the vault.
|
|
|
294
374
|
|
|
295
375
|
> **ownerRegisterFlow**(`input`): `Promise`\<`CustomHttpFlowDefinition`\>
|
|
296
376
|
|
|
297
|
-
Registers a
|
|
377
|
+
Registers a reusable HTTP request template for complex secret exchange patterns.
|
|
298
378
|
|
|
299
379
|
#### Parameters
|
|
300
380
|
|
|
@@ -308,19 +388,21 @@ Registers a custom HTTP flow for complex secret usage.
|
|
|
308
388
|
|
|
309
389
|
***
|
|
310
390
|
|
|
311
|
-
###
|
|
391
|
+
### ownerRemoveSecret()
|
|
312
392
|
|
|
313
|
-
> **
|
|
393
|
+
> **ownerRemoveSecret**(`input`): `Promise`\<`void`\>
|
|
394
|
+
|
|
395
|
+
Logically removes the current active secret.
|
|
314
396
|
|
|
315
397
|
#### Parameters
|
|
316
398
|
|
|
317
|
-
#####
|
|
399
|
+
##### input
|
|
318
400
|
|
|
319
|
-
`
|
|
401
|
+
[`OwnerRemoveSecretInput`](OwnerRemoveSecretInput.md)
|
|
320
402
|
|
|
321
403
|
#### Returns
|
|
322
404
|
|
|
323
|
-
`Promise`\<`
|
|
405
|
+
`Promise`\<`void`\>
|
|
324
406
|
|
|
325
407
|
***
|
|
326
408
|
|
|
@@ -358,24 +440,6 @@ Revokes a previously granted capability.
|
|
|
358
440
|
|
|
359
441
|
***
|
|
360
442
|
|
|
361
|
-
### ownerStoreSecret()
|
|
362
|
-
|
|
363
|
-
> **ownerStoreSecret**(`input`): `Promise`\<`SecretRecord`\>
|
|
364
|
-
|
|
365
|
-
Securely stores a new secret in the vault.
|
|
366
|
-
|
|
367
|
-
#### Parameters
|
|
368
|
-
|
|
369
|
-
##### input
|
|
370
|
-
|
|
371
|
-
[`OwnerStoreSecretInput`](OwnerStoreSecretInput.md)
|
|
372
|
-
|
|
373
|
-
#### Returns
|
|
374
|
-
|
|
375
|
-
`Promise`\<`SecretRecord`\>
|
|
376
|
-
|
|
377
|
-
***
|
|
378
|
-
|
|
379
443
|
### ownerSubmitCapabilityRequest()
|
|
380
444
|
|
|
381
445
|
> **ownerSubmitCapabilityRequest**(`input`): `Promise`\<`CapabilityStateRecord`\>
|
|
@@ -408,17 +472,17 @@ Securely stores a new secret in the vault.
|
|
|
408
472
|
|
|
409
473
|
***
|
|
410
474
|
|
|
411
|
-
###
|
|
475
|
+
### ownerUpdateSecret()
|
|
412
476
|
|
|
413
|
-
> **
|
|
477
|
+
> **ownerUpdateSecret**(`input`): `Promise`\<`SecretRecord`\>
|
|
414
478
|
|
|
415
|
-
|
|
479
|
+
Inserts a new successor secret and marks the previous active version as superseded.
|
|
416
480
|
|
|
417
481
|
#### Parameters
|
|
418
482
|
|
|
419
483
|
##### input
|
|
420
484
|
|
|
421
|
-
[`
|
|
485
|
+
[`OwnerUpdateSecretInput`](OwnerUpdateSecretInput.md)
|
|
422
486
|
|
|
423
487
|
#### Returns
|
|
424
488
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.60.0**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -36,12 +36,6 @@
|
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
39
|
-
### methods
|
|
40
|
-
|
|
41
|
-
> **methods**: readonly `string`[]
|
|
42
|
-
|
|
43
|
-
***
|
|
44
|
-
|
|
45
39
|
### operation?
|
|
46
40
|
|
|
47
41
|
> `optional` **operation?**: `string`
|
|
@@ -62,30 +56,24 @@
|
|
|
62
56
|
|
|
63
57
|
***
|
|
64
58
|
|
|
65
|
-
###
|
|
66
|
-
|
|
67
|
-
> `optional` **requestedAt?**: `string`
|
|
68
|
-
|
|
69
|
-
***
|
|
70
|
-
|
|
71
|
-
### scope
|
|
59
|
+
### read
|
|
72
60
|
|
|
73
|
-
> **
|
|
61
|
+
> **read**: `CapabilityReadPolicy`
|
|
74
62
|
|
|
75
63
|
***
|
|
76
64
|
|
|
77
|
-
###
|
|
65
|
+
### requestedAt?
|
|
78
66
|
|
|
79
|
-
> `optional` **
|
|
67
|
+
> `optional` **requestedAt?**: `string`
|
|
80
68
|
|
|
81
69
|
***
|
|
82
70
|
|
|
83
|
-
###
|
|
71
|
+
### skipAudit?
|
|
84
72
|
|
|
85
|
-
> `optional` **
|
|
73
|
+
> `optional` **skipAudit?**: `boolean`
|
|
86
74
|
|
|
87
75
|
***
|
|
88
76
|
|
|
89
|
-
###
|
|
77
|
+
### write
|
|
90
78
|
|
|
91
|
-
>
|
|
79
|
+
> **write**: `CapabilityWritePolicy`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.60.0**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -24,12 +24,6 @@
|
|
|
24
24
|
|
|
25
25
|
***
|
|
26
26
|
|
|
27
|
-
### methods
|
|
28
|
-
|
|
29
|
-
> **methods**: readonly `string`[]
|
|
30
|
-
|
|
31
|
-
***
|
|
32
|
-
|
|
33
27
|
### operation?
|
|
34
28
|
|
|
35
29
|
> `optional` **operation?**: `string`
|
|
@@ -50,30 +44,30 @@
|
|
|
50
44
|
|
|
51
45
|
***
|
|
52
46
|
|
|
53
|
-
###
|
|
47
|
+
### read
|
|
54
48
|
|
|
55
|
-
>
|
|
49
|
+
> **read**: `CapabilityReadPolicy`
|
|
56
50
|
|
|
57
51
|
***
|
|
58
52
|
|
|
59
|
-
###
|
|
53
|
+
### requestedAt?
|
|
60
54
|
|
|
61
|
-
> **
|
|
55
|
+
> `optional` **requestedAt?**: `string`
|
|
62
56
|
|
|
63
57
|
***
|
|
64
58
|
|
|
65
|
-
###
|
|
59
|
+
### requester
|
|
66
60
|
|
|
67
|
-
> **
|
|
61
|
+
> **requester**: `VaultPrincipal`
|
|
68
62
|
|
|
69
63
|
***
|
|
70
64
|
|
|
71
|
-
###
|
|
65
|
+
### skipAudit?
|
|
72
66
|
|
|
73
|
-
> `optional` **
|
|
67
|
+
> `optional` **skipAudit?**: `boolean`
|
|
74
68
|
|
|
75
69
|
***
|
|
76
70
|
|
|
77
|
-
###
|
|
71
|
+
### write
|
|
78
72
|
|
|
79
|
-
>
|
|
73
|
+
> **write**: `CapabilityWritePolicy`
|
package/docs/zh/README.md
CHANGED
|
@@ -101,9 +101,12 @@ const record = await client.ownerWriteSecret({
|
|
|
101
101
|
|
|
102
102
|
await client.ownerGrantCapability({
|
|
103
103
|
agentId,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
write: {
|
|
105
|
+
secretIds: [record.secretId.value],
|
|
106
|
+
scope: 'https://api.example.com/*',
|
|
107
|
+
methods: ['POST']
|
|
108
|
+
},
|
|
109
|
+
read: { mode: 'full' }
|
|
107
110
|
});
|
|
108
111
|
```
|
|
109
112
|
|
|
@@ -120,24 +123,33 @@ const agent = createAgentClient({
|
|
|
120
123
|
});
|
|
121
124
|
|
|
122
125
|
const result = await agent.agentDispatch({ ... });
|
|
126
|
+
const requests = await agent.agentListRequests();
|
|
127
|
+
const request = await agent.agentGetRequest(result.requestId);
|
|
128
|
+
const ownerView = await client.ownerGetRequest({ requestId: result.requestId });
|
|
123
129
|
```
|
|
124
130
|
|
|
125
131
|
Agent 进程不会直接使用原始私钥执行请求。即使 Agent 拥有身份材料,也应先换取 session token,再进行 dispatch。
|
|
126
132
|
|
|
133
|
+
给 LLM 的直白规则:
|
|
134
|
+
- `agentDispatch(...)` = 立刻尝试执行真实任务
|
|
135
|
+
- `agentSubmitCapabilityRequest(...)` = 只申请权限,不会执行任务
|
|
136
|
+
- `agentListRequests()` / `agentGetRequest(...)` = 在请求执行后查看异步结果
|
|
137
|
+
- `ownerListRequests()` / `ownerGetRequest(...)` = owner 查看完整请求记录,用于决定是否放行 read
|
|
138
|
+
|
|
127
139
|
```ts
|
|
128
140
|
const manifest = await agent.agentIntrospect();
|
|
129
141
|
|
|
130
142
|
console.log(manifest.agent.agentId);
|
|
131
143
|
console.log(manifest.agent.identityId);
|
|
132
144
|
console.log(manifest.agent.nickname);
|
|
133
|
-
console.log(manifest.capabilities); //
|
|
145
|
+
console.log(manifest.capabilities); // 同一组能力载体里包含 write/read 动作状态
|
|
134
146
|
```
|
|
135
147
|
|
|
136
|
-
`agentListCapabilities()`
|
|
148
|
+
`agentListCapabilities()` 返回能力载体视图,`agentListRequests()` / `agentGetRequest()` 则负责暴露请求历史和按权限裁剪后的结果。
|
|
137
149
|
|
|
138
150
|
### 7. 人机协同(HITL)工作流
|
|
139
151
|
|
|
140
|
-
|
|
152
|
+
如果 Agent 尝试执行的动作不在白名单内,dispatch 会返回 `PENDING`,同时运行时会写入一条能力载体记录,其 `write` 动作等待 Owner 审批。
|
|
141
153
|
|
|
142
154
|
```ts
|
|
143
155
|
const result = await agent.agentDispatch({ ... });
|
|
@@ -146,14 +158,20 @@ if (result.status === 'PENDING') {
|
|
|
146
158
|
}
|
|
147
159
|
|
|
148
160
|
client.ownerOnCapabilityState((state) => {
|
|
149
|
-
if (state.status === 'PENDING') {
|
|
161
|
+
if (state.actions.write.status === 'PENDING') {
|
|
150
162
|
console.log('收到新的待审批能力状态:', state.requestId);
|
|
151
163
|
}
|
|
152
164
|
});
|
|
153
165
|
|
|
154
|
-
const pending = await client.ownerListCapabilityStates({
|
|
166
|
+
const pending = await client.ownerListCapabilityStates({ writeStatus: 'PENDING' });
|
|
155
167
|
if (pending.length > 0) {
|
|
156
|
-
await client.
|
|
168
|
+
await client.ownerApproveCapabilityWrite({
|
|
169
|
+
requestId: pending[0].requestId
|
|
170
|
+
});
|
|
171
|
+
await client.ownerAllowAlways({
|
|
172
|
+
requestId: pending[0].requestId
|
|
173
|
+
});
|
|
174
|
+
await client.ownerApproveCapabilityRead({
|
|
157
175
|
requestId: pending[0].requestId
|
|
158
176
|
});
|
|
159
177
|
}
|
|
@@ -128,11 +128,13 @@ async function main() {
|
|
|
128
128
|
vaultId: vault.vaultId,
|
|
129
129
|
capabilityId: "cap-llm-1",
|
|
130
130
|
agentId: agentIdentity.identityId,
|
|
131
|
-
secretIds: [secret.secretId.value],
|
|
132
|
-
secretAliases: ["api-token"],
|
|
133
131
|
operation: "dispatch_http" as const,
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
write: {
|
|
133
|
+
secretIds: [secret.secretId.value],
|
|
134
|
+
scope: "https://httpbin.org/post",
|
|
135
|
+
methods: ["POST"],
|
|
136
|
+
},
|
|
137
|
+
read: { mode: "full" },
|
|
136
138
|
issuedAt: new Date().toISOString(),
|
|
137
139
|
};
|
|
138
140
|
|