@the-ai-company/cbio-node-runtime 1.56.0 → 1.57.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 -20
- package/dist/clients/agent/client.d.ts +2 -2
- package/dist/clients/agent/contracts.d.ts +3 -2
- package/dist/clients/owner/client.d.ts +7 -10
- package/dist/clients/owner/client.js +16 -32
- package/dist/clients/owner/client.js.map +1 -1
- package/dist/clients/owner/contracts.d.ts +11 -9
- package/dist/vault-core/contracts.d.ts +48 -35
- package/dist/vault-core/contracts.js.map +1 -1
- package/dist/vault-core/core.d.ts +15 -21
- package/dist/vault-core/core.js +209 -152
- package/dist/vault-core/core.js.map +1 -1
- package/dist/vault-core/defaults.d.ts +8 -20
- package/dist/vault-core/defaults.js +14 -37
- package/dist/vault-core/defaults.js.map +1 -1
- package/dist/vault-core/index.d.ts +3 -3
- package/dist/vault-core/index.js +1 -1
- package/dist/vault-core/index.js.map +1 -1
- package/dist/vault-core/persistence.d.ts +8 -6
- package/dist/vault-core/persistence.js +16 -8
- package/dist/vault-core/persistence.js.map +1 -1
- package/dist/vault-core/ports.d.ts +8 -20
- package/dist/vault-ingress/defaults.d.ts +2 -2
- package/dist/vault-ingress/index.d.ts +14 -33
- package/dist/vault-ingress/index.js +18 -31
- package/dist/vault-ingress/index.js.map +1 -1
- package/dist/vault-ingress/remote-transport.d.ts +2 -2
- package/dist/vault-ingress/remote-transport.js.map +1 -1
- package/docs/MIGRATION-1.51.md +1 -1
- package/docs/REFERENCE.md +26 -28
- package/docs/api/README.md +2 -2
- package/docs/api/classes/IdentityError.md +1 -1
- package/docs/api/classes/OwnerClientError.md +1 -1
- package/docs/api/classes/VaultCore.md +34 -94
- 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 +5 -5
- package/docs/api/interfaces/AgentDispatchIntent.md +1 -1
- package/docs/api/interfaces/AgentDispatchTransport.md +5 -5
- package/docs/api/interfaces/AgentIdentity.md +1 -1
- package/docs/api/interfaces/AgentSigner.md +1 -1
- package/docs/api/interfaces/AgentSubmitCapabilityRequestInput.md +1 -1
- 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/OwnerDefineSecretTargetsInput.md +1 -1
- package/docs/api/interfaces/OwnerSecretTargetBinding.md +1 -1
- 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/OwnerStoreSecretInput.md +1 -1
- package/docs/api/interfaces/OwnerWriteSecretInput.md +1 -1
- 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 +40 -76
- package/docs/api/interfaces/VaultCoreDependenciesOptions.md +1 -1
- package/docs/api/interfaces/VaultCreateAgentInput.md +1 -1
- package/docs/api/interfaces/VaultDeleteSecretInput.md +1 -1
- package/docs/api/interfaces/VaultExportSecretInput.md +1 -1
- package/docs/api/interfaces/VaultGrantCapabilityInput.md +1 -1
- 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 +1 -1
- 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 +19 -7
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.57.0**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -9,90 +9,90 @@ In Sovereign Vault model, administrative actions are implicitly authorized by th
|
|
|
9
9
|
|
|
10
10
|
## Methods
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### ownerCreateAgent()
|
|
13
|
+
|
|
14
|
+
> **ownerCreateAgent**(`input`): `Promise`\<[`OwnerAgentProvisionResult`](OwnerAgentProvisionResult.md)\>
|
|
13
15
|
|
|
14
|
-
|
|
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.
|
|
15
18
|
|
|
16
19
|
#### Parameters
|
|
17
20
|
|
|
18
21
|
##### input
|
|
19
22
|
|
|
20
|
-
[`
|
|
23
|
+
[`VaultCreateAgentInput`](VaultCreateAgentInput.md)
|
|
21
24
|
|
|
22
25
|
#### Returns
|
|
23
26
|
|
|
24
|
-
`Promise
|
|
27
|
+
`Promise`\<[`OwnerAgentProvisionResult`](OwnerAgentProvisionResult.md)\>
|
|
25
28
|
|
|
26
29
|
***
|
|
27
30
|
|
|
28
|
-
###
|
|
31
|
+
### ownerDefineSecretTargets()
|
|
32
|
+
|
|
33
|
+
> **ownerDefineSecretTargets**(`input`): `Promise`\<`SecretRecord`\>
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
Refines the allowed targets for an existing secret.
|
|
31
36
|
|
|
32
37
|
#### Parameters
|
|
33
38
|
|
|
34
39
|
##### input
|
|
35
40
|
|
|
36
|
-
[`
|
|
41
|
+
[`OwnerDefineSecretTargetsInput`](OwnerDefineSecretTargetsInput.md)
|
|
37
42
|
|
|
38
43
|
#### Returns
|
|
39
44
|
|
|
40
|
-
`Promise`\<`
|
|
45
|
+
`Promise`\<`SecretRecord`\>
|
|
41
46
|
|
|
42
47
|
***
|
|
43
48
|
|
|
44
|
-
###
|
|
49
|
+
### ownerDeleteSecret()
|
|
45
50
|
|
|
46
|
-
> **
|
|
51
|
+
> **ownerDeleteSecret**(`input`): `Promise`\<`void`\>
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
The private key is stored in the vault for managed custody.
|
|
53
|
+
Permanently deletes a secret from the vault.
|
|
50
54
|
|
|
51
55
|
#### Parameters
|
|
52
56
|
|
|
53
57
|
##### input
|
|
54
58
|
|
|
55
|
-
[`
|
|
59
|
+
[`VaultDeleteSecretInput`](VaultDeleteSecretInput.md)
|
|
56
60
|
|
|
57
61
|
#### Returns
|
|
58
62
|
|
|
59
|
-
`Promise
|
|
63
|
+
`Promise`\<`void`\>
|
|
60
64
|
|
|
61
65
|
***
|
|
62
66
|
|
|
63
|
-
###
|
|
67
|
+
### ownerExecuteCapabilityStateAndGrant()
|
|
64
68
|
|
|
65
|
-
> **
|
|
66
|
-
|
|
67
|
-
Refines the allowed targets for an existing secret.
|
|
69
|
+
> **ownerExecuteCapabilityStateAndGrant**(`input`): `Promise`\<`DispatchResult`\>
|
|
68
70
|
|
|
69
71
|
#### Parameters
|
|
70
72
|
|
|
71
73
|
##### input
|
|
72
74
|
|
|
73
|
-
[`
|
|
75
|
+
[`VaultApproveCapabilityRequestInput`](VaultApproveCapabilityRequestInput.md)
|
|
74
76
|
|
|
75
77
|
#### Returns
|
|
76
78
|
|
|
77
|
-
`Promise`\<`
|
|
79
|
+
`Promise`\<`DispatchResult`\>
|
|
78
80
|
|
|
79
81
|
***
|
|
80
82
|
|
|
81
|
-
###
|
|
82
|
-
|
|
83
|
-
> **ownerDeleteSecret**(`input`): `Promise`\<`void`\>
|
|
83
|
+
### ownerExecuteCapabilityStateOnce()
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
> **ownerExecuteCapabilityStateOnce**(`input`): `Promise`\<`DispatchResult`\>
|
|
86
86
|
|
|
87
87
|
#### Parameters
|
|
88
88
|
|
|
89
89
|
##### input
|
|
90
90
|
|
|
91
|
-
[`
|
|
91
|
+
[`VaultApproveCapabilityRequestInput`](VaultApproveCapabilityRequestInput.md)
|
|
92
92
|
|
|
93
93
|
#### Returns
|
|
94
94
|
|
|
95
|
-
`Promise`\<`
|
|
95
|
+
`Promise`\<`DispatchResult`\>
|
|
96
96
|
|
|
97
97
|
***
|
|
98
98
|
|
|
@@ -210,23 +210,19 @@ Lists all active capabilities granted to agents.
|
|
|
210
210
|
|
|
211
211
|
***
|
|
212
212
|
|
|
213
|
-
###
|
|
214
|
-
|
|
215
|
-
> **ownerListPendingCapabilityRequests**(): `Promise`\<readonly `PendingCapabilityRequestRecord`[]\>
|
|
213
|
+
### ownerListCapabilityStates()
|
|
216
214
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
`Promise`\<readonly `PendingCapabilityRequestRecord`[]\>
|
|
215
|
+
> **ownerListCapabilityStates**(`input?`): `Promise`\<readonly `CapabilityStateRecord`[]\>
|
|
220
216
|
|
|
221
|
-
|
|
217
|
+
#### Parameters
|
|
222
218
|
|
|
223
|
-
|
|
219
|
+
##### input?
|
|
224
220
|
|
|
225
|
-
|
|
221
|
+
`VaultListCapabilityStatesInput`
|
|
226
222
|
|
|
227
223
|
#### Returns
|
|
228
224
|
|
|
229
|
-
`Promise`\<readonly `
|
|
225
|
+
`Promise`\<readonly `CapabilityStateRecord`[]\>
|
|
230
226
|
|
|
231
227
|
***
|
|
232
228
|
|
|
@@ -246,25 +242,9 @@ Lists all active capabilities granted to agents.
|
|
|
246
242
|
|
|
247
243
|
***
|
|
248
244
|
|
|
249
|
-
###
|
|
245
|
+
### ownerOnCapabilityState()
|
|
250
246
|
|
|
251
|
-
> **
|
|
252
|
-
|
|
253
|
-
#### Parameters
|
|
254
|
-
|
|
255
|
-
##### callback
|
|
256
|
-
|
|
257
|
-
(`record`) => `void`
|
|
258
|
-
|
|
259
|
-
#### Returns
|
|
260
|
-
|
|
261
|
-
() => `void`
|
|
262
|
-
|
|
263
|
-
***
|
|
264
|
-
|
|
265
|
-
### ownerOnPendingDispatch()
|
|
266
|
-
|
|
267
|
-
> **ownerOnPendingDispatch**(`callback`): () => `void`
|
|
247
|
+
> **ownerOnCapabilityState**(`callback`): () => `void`
|
|
268
248
|
|
|
269
249
|
#### Parameters
|
|
270
250
|
|
|
@@ -346,9 +326,9 @@ Registers a custom HTTP flow for complex secret usage.
|
|
|
346
326
|
|
|
347
327
|
***
|
|
348
328
|
|
|
349
|
-
###
|
|
329
|
+
### ownerRejectCapabilityState()
|
|
350
330
|
|
|
351
|
-
> **
|
|
331
|
+
> **ownerRejectCapabilityState**(`requestId`): `Promise`\<`CapabilityStateRecord`\>
|
|
352
332
|
|
|
353
333
|
#### Parameters
|
|
354
334
|
|
|
@@ -358,23 +338,7 @@ Registers a custom HTTP flow for complex secret usage.
|
|
|
358
338
|
|
|
359
339
|
#### Returns
|
|
360
340
|
|
|
361
|
-
`Promise`\<`
|
|
362
|
-
|
|
363
|
-
***
|
|
364
|
-
|
|
365
|
-
### ownerRejectDispatch()
|
|
366
|
-
|
|
367
|
-
> **ownerRejectDispatch**(`requestId`): `Promise`\<`void`\>
|
|
368
|
-
|
|
369
|
-
#### Parameters
|
|
370
|
-
|
|
371
|
-
##### requestId
|
|
372
|
-
|
|
373
|
-
`string`
|
|
374
|
-
|
|
375
|
-
#### Returns
|
|
376
|
-
|
|
377
|
-
`Promise`\<`void`\>
|
|
341
|
+
`Promise`\<`CapabilityStateRecord`\>
|
|
378
342
|
|
|
379
343
|
***
|
|
380
344
|
|
|
@@ -432,7 +396,7 @@ Securely stores a new secret in the vault.
|
|
|
432
396
|
|
|
433
397
|
### ownerSubmitCapabilityRequest()
|
|
434
398
|
|
|
435
|
-
> **ownerSubmitCapabilityRequest**(`input`): `Promise`\<`
|
|
399
|
+
> **ownerSubmitCapabilityRequest**(`input`): `Promise`\<`CapabilityStateRecord`\>
|
|
436
400
|
|
|
437
401
|
#### Parameters
|
|
438
402
|
|
|
@@ -442,7 +406,7 @@ Securely stores a new secret in the vault.
|
|
|
442
406
|
|
|
443
407
|
#### Returns
|
|
444
408
|
|
|
445
|
-
`Promise`\<`
|
|
409
|
+
`Promise`\<`CapabilityStateRecord`\>
|
|
446
410
|
|
|
447
411
|
***
|
|
448
412
|
|
package/docs/zh/README.md
CHANGED
|
@@ -130,9 +130,20 @@ const result = await agent.agentDispatch({ ... });
|
|
|
130
130
|
|
|
131
131
|
Agent 进程不会直接使用原始私钥执行请求。即使 Agent 拥有身份材料,也应先换取 session token,再进行 dispatch。
|
|
132
132
|
|
|
133
|
+
```ts
|
|
134
|
+
const manifest = await agent.agentIntrospect();
|
|
135
|
+
|
|
136
|
+
console.log(manifest.agent.agentId);
|
|
137
|
+
console.log(manifest.agent.identityId);
|
|
138
|
+
console.log(manifest.agent.nickname);
|
|
139
|
+
console.log(manifest.capabilities); // 同一张能力状态表里同时包含 GRANTED 和 PENDING
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
`agentListCapabilities()` 现在返回的也是同一张统一能力状态表,因此调度器或 Agent 重启后,不需要分别拼“已授权能力”和“待审批能力”。
|
|
143
|
+
|
|
133
144
|
### 7. 人机协同(HITL)工作流
|
|
134
145
|
|
|
135
|
-
|
|
146
|
+
系统采用统一的 **能力状态(capability state)** 模型。如果 Agent 尝试执行的动作不在白名单内,dispatch 会返回 `PENDING`,同时运行时会写入一条 `PENDING` 能力状态,等待 Owner 审批。
|
|
136
147
|
|
|
137
148
|
```ts
|
|
138
149
|
const result = await agent.agentDispatch({ ... });
|
|
@@ -140,15 +151,16 @@ if (result.status === 'PENDING') {
|
|
|
140
151
|
console.log('触发发现流程:等待所有者审批...');
|
|
141
152
|
}
|
|
142
153
|
|
|
143
|
-
client.
|
|
144
|
-
|
|
154
|
+
client.ownerOnCapabilityState((state) => {
|
|
155
|
+
if (state.status === 'PENDING') {
|
|
156
|
+
console.log('收到新的待审批能力状态:', state.requestId);
|
|
157
|
+
}
|
|
145
158
|
});
|
|
146
159
|
|
|
147
|
-
const pending = await client.
|
|
160
|
+
const pending = await client.ownerListCapabilityStates({ status: 'PENDING' });
|
|
148
161
|
if (pending.length > 0) {
|
|
149
|
-
await client.
|
|
150
|
-
requestId: pending[0].requestId
|
|
151
|
-
permanent: true
|
|
162
|
+
await client.ownerExecuteCapabilityStateAndGrant({
|
|
163
|
+
requestId: pending[0].requestId
|
|
152
164
|
});
|
|
153
165
|
}
|
|
154
166
|
```
|