@the-ai-company/cbio-node-runtime 1.68.0 → 1.70.1
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 +40 -6
- package/dist/clients/owner/client.js +11 -2
- package/dist/clients/owner/client.js.map +1 -1
- package/dist/clients/owner/contracts.d.ts +4 -2
- package/dist/public-types.d.ts +2 -1
- package/dist/public-types.js.map +1 -1
- package/dist/runtime/index.d.ts +4 -2
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/vault-core/contracts.d.ts +49 -29
- package/dist/vault-core/contracts.js +0 -6
- package/dist/vault-core/contracts.js.map +1 -1
- package/dist/vault-core/core.d.ts +4 -5
- package/dist/vault-core/core.js +65 -37
- package/dist/vault-core/core.js.map +1 -1
- package/dist/vault-core/defaults.d.ts +8 -6
- package/dist/vault-core/defaults.js +98 -16
- 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 +34 -36
- package/dist/vault-core/persistence.js +268 -333
- package/dist/vault-core/persistence.js.map +1 -1
- package/dist/vault-core/ports.d.ts +5 -3
- package/dist/vault-ingress/defaults.d.ts +1 -1
- package/dist/vault-ingress/index.d.ts +2 -1
- package/dist/vault-ingress/index.js +5 -2
- package/dist/vault-ingress/index.js.map +1 -1
- package/dist/vault-ingress/server-utils.d.ts +30 -0
- package/dist/vault-ingress/server-utils.js +151 -0
- package/dist/vault-ingress/server-utils.js.map +1 -1
- package/docs/REFERENCE.md +4 -0
- package/docs/api/README.md +9 -3
- package/docs/api/classes/IdentityError.md +1 -1
- package/docs/api/classes/OwnerClientError.md +1 -1
- package/docs/api/classes/PersistentVaultAgentIdentityRegistry.md +5 -5
- package/docs/api/classes/PersistentVaultAgentSecretGrantRegistry.md +5 -5
- package/docs/api/classes/PersistentVaultAuditLog.md +29 -5
- package/docs/api/classes/PersistentVaultSecretCustody.md +5 -5
- package/docs/api/classes/PersistentVaultSecretDestinationGrantRegistry.md +5 -5
- package/docs/api/classes/PersistentVaultSecretRepository.md +5 -5
- package/docs/api/classes/VaultCore.md +10 -10
- package/docs/api/classes/VaultCoreError.md +1 -1
- package/docs/api/enumerations/AuditOperation.md +1 -37
- package/docs/api/enumerations/DispatchStatus.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/createOwnerClient.md +1 -1
- package/docs/api/functions/createPersistentVaultCoreDependencies.md +1 -1
- package/docs/api/functions/createVault.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/deriveRootAgentId.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/handleVaultAuditSse.md +30 -0
- package/docs/api/functions/handleVaultHttpDispatch.md +1 -1
- package/docs/api/functions/handleVaultPendingDispatchSse.md +30 -0
- package/docs/api/functions/initializeVaultCustody.md +1 -1
- package/docs/api/functions/listVaults.md +1 -1
- package/docs/api/functions/openOwnerSession.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/writeVaultProfile.md +1 -1
- package/docs/api/interfaces/AgentClient.md +3 -3
- package/docs/api/interfaces/AgentDispatchIntent.md +1 -1
- package/docs/api/interfaces/AgentDispatchTransport.md +3 -3
- package/docs/api/interfaces/AgentIdentity.md +1 -1
- package/docs/api/interfaces/AgentIdentityRecord.md +1 -1
- package/docs/api/interfaces/AgentRequestRecord.md +83 -0
- package/docs/api/interfaces/AgentRuntimeManifest.md +1 -1
- package/docs/api/interfaces/AgentSecretGrant.md +1 -1
- package/docs/api/interfaces/AgentSigner.md +1 -1
- package/docs/api/interfaces/AgentVisibleRequestRecord.md +1 -1
- package/docs/api/interfaces/AgentVisibleSecretRecord.md +1 -1
- package/docs/api/interfaces/AuditEntry.md +1 -1
- package/docs/api/interfaces/CbioRuntime.md +59 -1
- package/docs/api/interfaces/CreateAgentClientOptions.md +1 -1
- package/docs/api/interfaces/CreateIdentityOptions.md +1 -1
- package/docs/api/interfaces/CreateOwnerClientOptions.md +1 -1
- package/docs/api/interfaces/CreatePersistentVaultCoreDependenciesOptions.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 -23
- package/docs/api/interfaces/DispatchAuthorization.md +1 -1
- package/docs/api/interfaces/DispatchInstruction.md +1 -1
- package/docs/api/interfaces/DispatchRequest.md +1 -1
- package/docs/api/interfaces/DispatchResult.md +7 -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/OpenOwnerSessionOptions.md +1 -1
- package/docs/api/interfaces/OwnerAgentProvisionResult.md +1 -1
- package/docs/api/interfaces/OwnerAuditSubscription.md +45 -0
- package/docs/api/interfaces/OwnerClient.md +20 -4
- package/docs/api/interfaces/OwnerCreateSecretInput.md +1 -1
- package/docs/api/interfaces/OwnerPendingDispatchSubscription.md +27 -0
- package/docs/api/interfaces/OwnerRemoveSecretInput.md +1 -1
- package/docs/api/interfaces/OwnerRequestRecord.md +7 -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/OwnerUpdateSecretInput.md +9 -3
- package/docs/api/interfaces/OwnerVisibleRequestRecord.md +1 -1
- package/docs/api/interfaces/PendingDispatchEvent.md +23 -0
- package/docs/api/interfaces/RecoverVaultOptions.md +1 -1
- package/docs/api/interfaces/RecoveredVault.md +1 -1
- package/docs/api/interfaces/RequestRecord.md +21 -1
- package/docs/api/interfaces/RestoreIdentityOptions.md +1 -1
- package/docs/api/interfaces/SecretAlias.md +1 -1
- package/docs/api/interfaces/SecretDestinationGrant.md +1 -1
- package/docs/api/interfaces/SecretId.md +1 -1
- package/docs/api/interfaces/SecretRecord.md +1 -1
- package/docs/api/interfaces/Signer.md +1 -1
- package/docs/api/interfaces/VaultApproveDispatchInput.md +1 -1
- package/docs/api/interfaces/VaultAuditQueryInput.md +1 -1
- 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/VaultGetRequestInput.md +1 -1
- package/docs/api/interfaces/VaultGrantAgentSecretInput.md +1 -1
- package/docs/api/interfaces/VaultGrantSecretDestinationInput.md +1 -1
- package/docs/api/interfaces/VaultId.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/VaultListGrantsInput.md +1 -1
- package/docs/api/interfaces/VaultListRequestsInput.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/VaultPrincipal.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/VaultRevokeAgentSecretInput.md +1 -1
- package/docs/api/interfaces/VaultRevokeSecretDestinationInput.md +1 -1
- package/docs/api/interfaces/VaultRevokeSessionTokenInput.md +1 -1
- package/docs/api/interfaces/VaultService.md +22 -6
- package/docs/api/interfaces/VaultUpdateAgentInput.md +1 -1
- package/docs/api/type-aliases/AgentId.md +1 -1
- package/docs/api/type-aliases/AgentRequestResult.md +7 -0
- package/docs/api/type-aliases/CbioRuntimeModule.md +1 -1
- package/docs/api/type-aliases/DispatchApprovalDecision.md +1 -1
- package/docs/api/type-aliases/GrantStatus.md +1 -1
- package/docs/api/type-aliases/SecretLifecycleStatus.md +1 -1
- package/docs/api/type-aliases/VaultPrincipalKind.md +2 -2
- package/docs/api/variables/DEFAULT_VAULT_KEY_CUSTODY_BLOB_KEY.md +1 -1
- package/docs/zh/README.md +11 -3
- package/package.json +5 -3
- package/docs/api/interfaces/AgentRequestResult.md +0 -35
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.70.1**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
### agentGetRequest()
|
|
32
32
|
|
|
33
|
-
> **agentGetRequest**(`request`): `Promise`\<[`
|
|
33
|
+
> **agentGetRequest**(`request`): `Promise`\<[`AgentRequestRecord`](AgentRequestRecord.md)\>
|
|
34
34
|
|
|
35
35
|
#### Parameters
|
|
36
36
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
#### Returns
|
|
42
42
|
|
|
43
|
-
`Promise`\<[`
|
|
43
|
+
`Promise`\<[`AgentRequestRecord`](AgentRequestRecord.md)\>
|
|
44
44
|
|
|
45
45
|
***
|
|
46
46
|
|
|
@@ -342,15 +342,31 @@
|
|
|
342
342
|
|
|
343
343
|
***
|
|
344
344
|
|
|
345
|
+
### ownerOnAudit()
|
|
346
|
+
|
|
347
|
+
> **ownerOnAudit**(`subscription`): () => `void`
|
|
348
|
+
|
|
349
|
+
#### Parameters
|
|
350
|
+
|
|
351
|
+
##### subscription
|
|
352
|
+
|
|
353
|
+
[`OwnerAuditSubscription`](OwnerAuditSubscription.md)
|
|
354
|
+
|
|
355
|
+
#### Returns
|
|
356
|
+
|
|
357
|
+
() => `void`
|
|
358
|
+
|
|
359
|
+
***
|
|
360
|
+
|
|
345
361
|
### ownerOnPendingDispatch()
|
|
346
362
|
|
|
347
|
-
> **ownerOnPendingDispatch**(`
|
|
363
|
+
> **ownerOnPendingDispatch**(`subscription`): () => `void`
|
|
348
364
|
|
|
349
365
|
#### Parameters
|
|
350
366
|
|
|
351
|
-
#####
|
|
367
|
+
##### subscription
|
|
352
368
|
|
|
353
|
-
|
|
369
|
+
[`OwnerPendingDispatchSubscription`](OwnerPendingDispatchSubscription.md)
|
|
354
370
|
|
|
355
371
|
#### Returns
|
|
356
372
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.70.1**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
5
|
# Type Alias: VaultPrincipalKind
|
|
6
6
|
|
|
7
|
-
> **VaultPrincipalKind** = `"owner"` \| `"
|
|
7
|
+
> **VaultPrincipalKind** = `"owner"` \| `"agent"`
|
package/docs/zh/README.md
CHANGED
|
@@ -153,15 +153,23 @@ console.log(manifest.grants.agentSecrets); // 已获得的机密授权
|
|
|
153
153
|
如果 Agent 尝试的请求未获授权,`agentDispatch` 会返回 `AWAITING_APPROVAL` 状态,进入人工审批流。
|
|
154
154
|
|
|
155
155
|
```ts
|
|
156
|
+
const unsubscribe = client.ownerOnPendingDispatch({
|
|
157
|
+
onEvent: (event) => {
|
|
158
|
+
console.log("pending dispatch", event.event_id, event.record.request_id);
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
|
|
156
162
|
// 审批待处理的请求
|
|
157
|
-
const pending = await client.ownerListRequests({ rootAgentId });
|
|
163
|
+
const pending = await client.ownerListRequests({ root_agent_id: rootAgentId });
|
|
158
164
|
if (pending.length > 0) {
|
|
159
165
|
await client.ownerApproveDispatch({
|
|
160
|
-
|
|
161
|
-
decision:
|
|
166
|
+
request_id: pending[0].request_id,
|
|
167
|
+
decision: "allow_and_grant", // 允许执行并自动补齐缺少的授权
|
|
162
168
|
});
|
|
163
169
|
}
|
|
164
170
|
|
|
171
|
+
unsubscribe();
|
|
172
|
+
|
|
165
173
|
// 查看语义化审计日志
|
|
166
174
|
const logs = await client.ownerReadAudit({
|
|
167
175
|
action: 'APPROVE_DISPATCH' // 使用业务感知的语义化动作进行查询
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the-ai-company/cbio-node-runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.70.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@the-ai-company/cbio-protocol": "^1.0.
|
|
26
|
+
"@the-ai-company/cbio-protocol": "^1.0.5",
|
|
27
|
+
"better-sqlite3": "^11.0.0"
|
|
27
28
|
},
|
|
28
29
|
"scripts": {
|
|
29
30
|
"build": "tsc",
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"prepare": "npm run build && npm run build:docs",
|
|
33
34
|
"test": "npm run build && npm run test:types && npm run test:acceptance",
|
|
34
35
|
"test:types": "tsc -p tsconfig.type-tests.json --noEmit",
|
|
35
|
-
"test:acceptance": "node tests/smoke/runtime-surface.js && node tests/smoke/policy-and-persistence.js && node tests/smoke/persistent-runtime-security.js && node tests/smoke/replay-guard.js && node tests/smoke/security-guards.js && node tests/smoke/audit-root-agent-activity.js"
|
|
36
|
+
"test:acceptance": "node tests/smoke/runtime-surface.js && node tests/smoke/policy-and-persistence.js && node tests/smoke/persistent-runtime-security.js && node tests/smoke/replay-guard.js && node tests/smoke/security-guards.js && node tests/smoke/audit-root-agent-activity.js && node tests/smoke/pending-dispatch-subscription.js && node tests/smoke/pending-dispatch-sse.js && node tests/smoke/audit-stream-sse.js"
|
|
36
37
|
},
|
|
37
38
|
"keywords": [
|
|
38
39
|
"claw-biometric",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"license": "MIT",
|
|
47
48
|
"repository": "https://github.com/TheAICompany/cbio-node-runtime",
|
|
48
49
|
"devDependencies": {
|
|
50
|
+
"@types/better-sqlite3": "^7.6.10",
|
|
49
51
|
"@types/node": "^20.0.0",
|
|
50
52
|
"standard-version": "^9.5.0",
|
|
51
53
|
"typedoc": "^0.28.18",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.68.0**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# Interface: AgentRequestResult
|
|
6
|
-
|
|
7
|
-
## Properties
|
|
8
|
-
|
|
9
|
-
### error?
|
|
10
|
-
|
|
11
|
-
> `optional` **error?**: `string`
|
|
12
|
-
|
|
13
|
-
***
|
|
14
|
-
|
|
15
|
-
### execution\_status
|
|
16
|
-
|
|
17
|
-
> **execution\_status**: [`DispatchStatus`](../enumerations/DispatchStatus.md)
|
|
18
|
-
|
|
19
|
-
***
|
|
20
|
-
|
|
21
|
-
### request\_id
|
|
22
|
-
|
|
23
|
-
> **request\_id**: `string`
|
|
24
|
-
|
|
25
|
-
***
|
|
26
|
-
|
|
27
|
-
### response\_body?
|
|
28
|
-
|
|
29
|
-
> `optional` **response\_body?**: `string`
|
|
30
|
-
|
|
31
|
-
***
|
|
32
|
-
|
|
33
|
-
### response\_status?
|
|
34
|
-
|
|
35
|
-
> `optional` **response\_status?**: `number`
|