@the-ai-company/cbio-node-runtime 1.56.0 → 1.58.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 +27 -28
- 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 +8 -15
- package/dist/clients/owner/client.js +18 -51
- package/dist/clients/owner/client.js.map +1 -1
- package/dist/clients/owner/contracts.d.ts +11 -23
- package/dist/clients/owner/index.d.ts +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/vault-core/contracts.d.ts +61 -57
- package/dist/vault-core/contracts.js +0 -1
- package/dist/vault-core/contracts.js.map +1 -1
- package/dist/vault-core/core.d.ts +15 -22
- package/dist/vault-core/core.js +222 -211
- package/dist/vault-core/core.js.map +1 -1
- package/dist/vault-core/defaults.d.ts +8 -22
- package/dist/vault-core/defaults.js +18 -97
- 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 -21
- package/dist/vault-ingress/defaults.d.ts +2 -2
- package/dist/vault-ingress/index.d.ts +14 -34
- package/dist/vault-ingress/index.js +20 -42
- 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 -4
- package/docs/api/classes/IdentityError.md +1 -1
- package/docs/api/classes/OwnerClientError.md +1 -1
- package/docs/api/classes/VaultCore.md +29 -105
- 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/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 -7
- 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 +34 -88
- 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 +20 -14
- package/examples/process-isolation.ts +1 -1
- package/package.json +1 -1
- package/docs/api/interfaces/OwnerDefineSecretTargetsInput.md +0 -23
- package/docs/api/interfaces/OwnerSecretTargetBinding.md +0 -35
package/docs/zh/README.md
CHANGED
|
@@ -96,13 +96,7 @@ const sessionToken = createdAgent.sessionToken;
|
|
|
96
96
|
```ts
|
|
97
97
|
const record = await client.ownerWriteSecret({
|
|
98
98
|
alias: 'api-token',
|
|
99
|
-
plaintext: 'secret-value'
|
|
100
|
-
targetBindings: [{
|
|
101
|
-
kind: 'site',
|
|
102
|
-
targetId: 'my-api',
|
|
103
|
-
targetUrl: 'https://api.example.com/endpoint',
|
|
104
|
-
methods: ['POST']
|
|
105
|
-
}]
|
|
99
|
+
plaintext: 'secret-value'
|
|
106
100
|
});
|
|
107
101
|
|
|
108
102
|
await client.ownerGrantCapability({
|
|
@@ -130,9 +124,20 @@ const result = await agent.agentDispatch({ ... });
|
|
|
130
124
|
|
|
131
125
|
Agent 进程不会直接使用原始私钥执行请求。即使 Agent 拥有身份材料,也应先换取 session token,再进行 dispatch。
|
|
132
126
|
|
|
127
|
+
```ts
|
|
128
|
+
const manifest = await agent.agentIntrospect();
|
|
129
|
+
|
|
130
|
+
console.log(manifest.agent.agentId);
|
|
131
|
+
console.log(manifest.agent.identityId);
|
|
132
|
+
console.log(manifest.agent.nickname);
|
|
133
|
+
console.log(manifest.capabilities); // 同一张能力状态表里同时包含 GRANTED 和 PENDING
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`agentListCapabilities()` 现在返回的也是同一张统一能力状态表,因此调度器或 Agent 重启后,不需要分别拼“已授权能力”和“待审批能力”。
|
|
137
|
+
|
|
133
138
|
### 7. 人机协同(HITL)工作流
|
|
134
139
|
|
|
135
|
-
|
|
140
|
+
系统采用统一的 **能力状态(capability state)** 模型。如果 Agent 尝试执行的动作不在白名单内,dispatch 会返回 `PENDING`,同时运行时会写入一条 `PENDING` 能力状态,等待 Owner 审批。
|
|
136
141
|
|
|
137
142
|
```ts
|
|
138
143
|
const result = await agent.agentDispatch({ ... });
|
|
@@ -140,15 +145,16 @@ if (result.status === 'PENDING') {
|
|
|
140
145
|
console.log('触发发现流程:等待所有者审批...');
|
|
141
146
|
}
|
|
142
147
|
|
|
143
|
-
client.
|
|
144
|
-
|
|
148
|
+
client.ownerOnCapabilityState((state) => {
|
|
149
|
+
if (state.status === 'PENDING') {
|
|
150
|
+
console.log('收到新的待审批能力状态:', state.requestId);
|
|
151
|
+
}
|
|
145
152
|
});
|
|
146
153
|
|
|
147
|
-
const pending = await client.
|
|
154
|
+
const pending = await client.ownerListCapabilityStates({ status: 'PENDING' });
|
|
148
155
|
if (pending.length > 0) {
|
|
149
|
-
await client.
|
|
150
|
-
requestId: pending[0].requestId
|
|
151
|
-
permanent: true
|
|
156
|
+
await client.ownerExecuteCapabilityStateAndGrant({
|
|
157
|
+
requestId: pending[0].requestId
|
|
152
158
|
});
|
|
153
159
|
}
|
|
154
160
|
```
|
|
@@ -120,7 +120,7 @@ async function main() {
|
|
|
120
120
|
owner: { kind: "owner", id: ownerIdentity.identityId },
|
|
121
121
|
alias: "api-token",
|
|
122
122
|
plaintext: "SK-PROD-12345",
|
|
123
|
-
|
|
123
|
+
source: { kind: "manual" },
|
|
124
124
|
requestedAt: new Date().toISOString(),
|
|
125
125
|
});
|
|
126
126
|
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.56.0**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# Interface: OwnerDefineSecretTargetsInput
|
|
6
|
-
|
|
7
|
-
## Properties
|
|
8
|
-
|
|
9
|
-
### alias
|
|
10
|
-
|
|
11
|
-
> **alias**: `string`
|
|
12
|
-
|
|
13
|
-
***
|
|
14
|
-
|
|
15
|
-
### requestedAt?
|
|
16
|
-
|
|
17
|
-
> `optional` **requestedAt?**: `string`
|
|
18
|
-
|
|
19
|
-
***
|
|
20
|
-
|
|
21
|
-
### targetBindings
|
|
22
|
-
|
|
23
|
-
> **targetBindings**: readonly [`OwnerSecretTargetBinding`](OwnerSecretTargetBinding.md)[]
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.56.0**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# Interface: OwnerSecretTargetBinding
|
|
6
|
-
|
|
7
|
-
## Properties
|
|
8
|
-
|
|
9
|
-
### kind
|
|
10
|
-
|
|
11
|
-
> **kind**: `"owner"` \| `"site"`
|
|
12
|
-
|
|
13
|
-
***
|
|
14
|
-
|
|
15
|
-
### methods?
|
|
16
|
-
|
|
17
|
-
> `optional` **methods?**: readonly `string`[]
|
|
18
|
-
|
|
19
|
-
***
|
|
20
|
-
|
|
21
|
-
### paths?
|
|
22
|
-
|
|
23
|
-
> `optional` **paths?**: readonly `string`[]
|
|
24
|
-
|
|
25
|
-
***
|
|
26
|
-
|
|
27
|
-
### targetId
|
|
28
|
-
|
|
29
|
-
> **targetId**: `string`
|
|
30
|
-
|
|
31
|
-
***
|
|
32
|
-
|
|
33
|
-
### targetUrl?
|
|
34
|
-
|
|
35
|
-
> `optional` **targetUrl?**: `string`
|