@the-ai-company/cbio-node-runtime 1.46.0 → 1.47.2

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.
Files changed (115) hide show
  1. package/README.md +85 -239
  2. package/dist/clients/agent/client.d.ts +1 -0
  3. package/dist/clients/agent/client.js +25 -9
  4. package/dist/clients/agent/client.js.map +1 -1
  5. package/dist/clients/owner/client.d.ts +6 -4
  6. package/dist/clients/owner/client.js +41 -0
  7. package/dist/clients/owner/client.js.map +1 -1
  8. package/dist/clients/owner/contracts.d.ts +36 -0
  9. package/dist/clients/owner/index.d.ts +1 -1
  10. package/dist/runtime/bootstrap.d.ts +7 -7
  11. package/dist/runtime/bootstrap.js +2 -2
  12. package/dist/runtime/index.d.ts +3 -3
  13. package/dist/runtime/index.js +1 -1
  14. package/dist/runtime/index.js.map +1 -1
  15. package/dist/runtime/vault-metadata.js +1 -1
  16. package/dist/runtime/vault-metadata.js.map +1 -1
  17. package/dist/vault-core/contracts.d.ts +28 -2
  18. package/dist/vault-core/contracts.js +2 -0
  19. package/dist/vault-core/contracts.js.map +1 -1
  20. package/dist/vault-core/core.d.ts +10 -2
  21. package/dist/vault-core/core.js +24 -0
  22. package/dist/vault-core/core.js.map +1 -1
  23. package/dist/vault-core/defaults.d.ts +15 -3
  24. package/dist/vault-core/defaults.js +53 -14
  25. package/dist/vault-core/defaults.js.map +1 -1
  26. package/dist/vault-core/index.d.ts +1 -1
  27. package/dist/vault-core/index.js.map +1 -1
  28. package/dist/vault-core/persistence.js +5 -2
  29. package/dist/vault-core/persistence.js.map +1 -1
  30. package/dist/vault-core/ports.d.ts +6 -0
  31. package/dist/vault-ingress/index.d.ts +11 -2
  32. package/dist/vault-ingress/index.js +8 -0
  33. package/dist/vault-ingress/index.js.map +1 -1
  34. package/dist/vault-ingress/remote-transport.js +4 -1
  35. package/dist/vault-ingress/remote-transport.js.map +1 -1
  36. package/docs/ARCHITECTURE.md +34 -107
  37. package/docs/CUSTODY_MODEL.md +27 -129
  38. package/docs/IDENTITY_MODEL.md +34 -112
  39. package/docs/REFERENCE.md +57 -404
  40. package/docs/api/README.md +4 -3
  41. package/docs/api/classes/IdentityError.md +2 -2
  42. package/docs/api/classes/VaultCore.md +43 -1
  43. package/docs/api/classes/VaultCoreError.md +1 -1
  44. package/docs/api/enumerations/IdentityErrorCode.md +1 -1
  45. package/docs/api/functions/createAgentClient.md +1 -1
  46. package/docs/api/functions/createIdentity.md +1 -1
  47. package/docs/api/functions/createOwnerHttpFlowBoundary.md +1 -1
  48. package/docs/api/functions/createPersistentVaultCoreDependencies.md +1 -1
  49. package/docs/api/functions/createStandardAcquireBoundary.md +1 -1
  50. package/docs/api/functions/createStandardDispatchBoundary.md +1 -1
  51. package/docs/api/functions/createVault.md +3 -3
  52. package/docs/api/functions/createVaultClient.md +1 -1
  53. package/docs/api/functions/createVaultCore.md +1 -1
  54. package/docs/api/functions/createVaultCoreDependencies.md +1 -1
  55. package/docs/api/functions/createVaultService.md +1 -1
  56. package/docs/api/functions/createWorkspaceStorage.md +1 -1
  57. package/docs/api/functions/deriveIdentityId.md +1 -1
  58. package/docs/api/functions/deriveVaultWorkingKeyFromPassword.md +1 -1
  59. package/docs/api/functions/getDefaultWorkspaceDir.md +1 -1
  60. package/docs/api/functions/handleVaultHttpDispatch.md +1 -1
  61. package/docs/api/functions/initializeVaultCustody.md +1 -1
  62. package/docs/api/functions/listVaults.md +3 -3
  63. package/docs/api/functions/readVaultProfile.md +1 -1
  64. package/docs/api/functions/recoverVault.md +4 -4
  65. package/docs/api/functions/recoverVaultWorkingKey.md +1 -1
  66. package/docs/api/functions/restoreIdentity.md +1 -1
  67. package/docs/api/functions/updateVaultMetadata.md +1 -1
  68. package/docs/api/functions/wrapVaultCoreAsVaultService.md +1 -1
  69. package/docs/api/functions/writeVaultProfile.md +1 -1
  70. package/docs/api/interfaces/AgentClient.md +1 -1
  71. package/docs/api/interfaces/AgentDispatchIntent.md +1 -1
  72. package/docs/api/interfaces/AgentDispatchTransport.md +1 -1
  73. package/docs/api/interfaces/AgentIdentity.md +1 -1
  74. package/docs/api/interfaces/AgentSigner.md +1 -1
  75. package/docs/api/interfaces/CbioRuntime.md +8 -8
  76. package/docs/api/interfaces/CreateAgentClientOptions.md +7 -1
  77. package/docs/api/interfaces/CreateIdentityOptions.md +1 -1
  78. package/docs/api/interfaces/CreatePersistentVaultCoreDependenciesOptions.md +1 -1
  79. package/docs/api/interfaces/CreateVaultClientOptions.md +1 -1
  80. package/docs/api/interfaces/CreateVaultOptions.md +1 -1
  81. package/docs/api/interfaces/CreatedVault.md +1 -1
  82. package/docs/api/interfaces/DefaultPolicyEngineOptions.md +1 -1
  83. package/docs/api/interfaces/IStorageProvider.md +1 -1
  84. package/docs/api/interfaces/InitializeVaultCustodyOptions.md +1 -1
  85. package/docs/api/interfaces/InitializedVaultCustody.md +1 -1
  86. package/docs/api/interfaces/OwnerDefineSecretTargetsInput.md +1 -1
  87. package/docs/api/interfaces/OwnerSecretTargetBinding.md +1 -1
  88. package/docs/api/interfaces/OwnerStoreSecretInput.md +1 -1
  89. package/docs/api/interfaces/OwnerWriteSecretInput.md +1 -1
  90. package/docs/api/interfaces/RecoverVaultOptions.md +1 -1
  91. package/docs/api/interfaces/RecoveredVault.md +1 -1
  92. package/docs/api/interfaces/RestoreIdentityOptions.md +1 -1
  93. package/docs/api/interfaces/Signer.md +1 -1
  94. package/docs/api/interfaces/VaultAuditQueryInput.md +1 -1
  95. package/docs/api/interfaces/VaultClient.md +20 -3
  96. package/docs/api/interfaces/VaultCoreDependenciesOptions.md +1 -1
  97. package/docs/api/interfaces/VaultCreateAgentInput.md +29 -0
  98. package/docs/api/interfaces/VaultDeleteSecretInput.md +1 -1
  99. package/docs/api/interfaces/VaultExportSecretInput.md +1 -1
  100. package/docs/api/interfaces/VaultGrantCapabilityInput.md +1 -1
  101. package/docs/api/interfaces/VaultIdentity.md +1 -1
  102. package/docs/api/interfaces/VaultListAgentsInput.md +1 -1
  103. package/docs/api/interfaces/VaultListCapabilitiesInput.md +1 -1
  104. package/docs/api/interfaces/{VaultPublicMetadata.md → VaultMetadata.md} +2 -2
  105. package/docs/api/interfaces/VaultObject.md +1 -1
  106. package/docs/api/interfaces/VaultProfile.md +1 -1
  107. package/docs/api/interfaces/VaultRegisterAgentInput.md +19 -1
  108. package/docs/api/interfaces/VaultRegisterFlowInput.md +1 -1
  109. package/docs/api/interfaces/VaultRevokeCapabilityInput.md +1 -1
  110. package/docs/api/interfaces/VaultSigner.md +1 -1
  111. package/docs/api/type-aliases/AgentCapabilityEnvelope.md +1 -1
  112. package/docs/api/type-aliases/CbioRuntimeModule.md +1 -1
  113. package/docs/api/variables/DEFAULT_VAULT_KEY_CUSTODY_BLOB_KEY.md +1 -1
  114. package/docs/zh/README.md +64 -39
  115. package/package.json +1 -1
package/docs/REFERENCE.md CHANGED
@@ -1,428 +1,81 @@
1
- # CBIO Vault Runtime Reference
1
+ # CBIO Vault Runtime Reference (v1.47.0)
2
2
 
3
- This document describes the current implemented runtime surface.
3
+ This document describes the current implemented runtime surface for the **Sovereign Vault**.
4
4
 
5
- This file is intentionally narrower: it documents what the shipped API does today.
5
+ ## Primary API Surface
6
6
 
7
- ## Public Surface
7
+ The v1.47.0 runtime centers on a simplified, authority-centric model.
8
8
 
9
- The current top-level surface centers on:
9
+ ### Main Constructors and Entrypoints
10
10
 
11
- - identity creation and recovery
12
- - persistent vault bootstrap and recovery
13
- - owner and agent clients
14
- - owner flow-boundary helpers
11
+ - `createVault(...)` - Initialize a new vault using a master password.
12
+ - `recoverVault(...)` - Reopen an existing vault using its master password.
13
+ - `listVaults(...)` - Scan the workspace for available vault IDs.
14
+ - `updateVaultMetadata(...)` - Update the nickname or other metadata of an unlocked vault.
15
+ - `createVaultClient(...)` - Create an administrative client for an unlocked vault.
16
+ - `createAgentClient(...)` - Create a delegated client for an agent.
17
+ - `createIdentity(...)` - Generate a standalone cryptographic identity keypair.
18
+ - `restoreIdentity(...)` - Restore an identity from a private key.
15
19
 
16
- The main constructors are:
20
+ ### Vault Lifecycle
17
21
 
18
- - `createIdentity(...)`
19
- - `createChildIdentity(...)`
20
- - `deriveChildIdentity(...)`
21
- - `ensureIdentityPrivateVault(...)`
22
- - `readIdentityPrivateVaultProfile(...)`
23
- - `readIdentityPrivateVaultChildrenState(...)`
24
- - `restoreIdentity(...)`
25
- - `createVault(...)`
26
- - `recoverVault(...)`
27
- - `createVaultClient(...)`
28
- - `createAgentClient(...)`
22
+ #### `createVault(storage, { vaultId, password, nickname, metadata })`
23
+ Creates a secure vault.
24
+ - **Authority**: Rooted in the `password`.
25
+ - **Storage**: All data is encrypted using a key derived from the password via `scrypt`.
29
26
 
30
- Related design note:
27
+ #### `recoverVault(storage, { vaultId, password })`
28
+ Unlocks and reopens a vault.
29
+ - Returns a `RecoveredVault` object containing the `VaultService` and metadata.
31
30
 
32
- - [Custody Model](CUSTODY_MODEL.md)
31
+ #### `listVaults(storage)`
32
+ Returns a `string[]` of vault IDs found in the storage.
33
+ - **Privacy**: No metadata (like nicknames) is leaked during listing. You must recover a vault to see its details.
33
34
 
34
- Recommended persistent-vault entrypoints:
35
+ ## Identity Models
35
36
 
36
- - `createVault(...)`
37
- - `recoverVault(...)`
37
+ ### 1. Managed Identity (Recommended)
38
+ Identity material (private keys) generated and stored securely within the vault's own registry.
39
+ - Use `client.createAgent(...)` to manage these.
38
40
 
39
- `createVault({ ownerIdentity, nickname, publicMetadata })` creates a vault in the default workspace. `publicMetadata` follows the `VaultPublicMetadata` interface.
41
+ ### 2. External Identity
42
+ Identity material managed by the user outside the vault. Registered via `client.registerAgent({ publicKey, ... })`.
40
43
 
41
- `createVault(storage, { ownerIdentity, nickname, publicMetadata })` overrides the workspace storage explicitly.
44
+ ## Vault Client (Owner/Admin)
42
45
 
43
- `recoverVault({ vaultId, ownerIdentity })` reopens a vault and returns metadata (including `nickname`) from the **public signed profile**.
46
+ The `VaultClient` provides the administrative interface for the vault.
44
47
 
45
- `recoverVault(storage, { vaultId, ownerIdentity })` overrides the workspace storage explicitly.
48
+ ### Core Operations
49
+ - `writeSecret(...)`: Store a secret and bind it to specific targets in one step.
50
+ - `createAgent(...)`: Generate and host a new agent identity.
51
+ - `listAgents()`: Enumerate authorized agents and retrieve managed private keys.
52
+ - `grantCapability(...)`: Assign specific secret-use permissions to an agent.
53
+ - `exportSecret(...)`: Reveal a secret's plaintext (requires active authority).
54
+ - `readAudit(...)`: Access the append-only record of all vault actions.
46
55
 
47
- ### Storage Anchoring
56
+ ## Agent Client (Consumer)
48
57
 
49
- When you call `createVault` or `recoverVault`, the returned `storage` object is **anchored** to the vault's specific sub-directory (e.g., `/vaults/<vault-id>/`).
50
- - **Workspace Storage**: The initial storage passed to the SDK (or the default one) points to the root of all vaults.
51
- - **Vault Storage**: The storage returned by `createVault` / `recoverVault` is already scoped. You should pass this scoped storage to subsequent calls like `listIdentities` or `updateVaultMetadata`.
52
- - **Warning**: Do not manually attempt to read files like `working-key.sealed` relative to the workspace root if you are using high-level SDK methods. The SDK handles these paths relative to the anchored storage.
58
+ The `AgentClient` is used by delegated processes (e.g., LLMs or background workers) to perform authorized actions.
53
59
 
54
- ### Discovery Metadata
60
+ ### Core Operations
61
+ - `dispatch(...)`: Use a granted capability to send a secret to an authorized target.
62
+ - **Security**: The agent never handles the vault's master password or the secret's plaintext.
55
63
 
56
- New in v1.28.0, the SDK exports the `VaultPublicMetadata` interface to standardize vault discovery:
64
+ ## Storage Layout
57
65
 
58
- ```ts
59
- export interface VaultPublicMetadata extends Record<string, any> {
60
- nickname?: string;
61
- ownerId?: string;
62
- }
63
- ```
64
-
65
- ## Terms
66
-
67
- - `identity`
68
- An external principal represented by a public/private keypair.
69
- - `owner`
70
- The single admin role that a vault binds to one identity.
71
- - `agent`
72
- A delegated role that a vault binds to an identity registered by the owner.
73
-
74
- Role rules:
75
-
76
- - outside the vault there are only identities
77
- - inside a vault, identities are bound to roles such as `owner` or `agent`
78
- - root identities are independent
79
- - child identities may be deterministically derived from a parent identity
80
- - the same identity may be `owner` in one vault and `agent` in another
81
-
82
- ## Identity Creation
83
-
84
- `createIdentity(...)` returns:
85
-
86
- - `identityId`
87
- - `publicKey`
88
- - `privateKey`
89
- - optional `nickname`
90
- - optional `parentIdentityId` for child identities
91
- - optional `childIndex` for child identities
92
-
93
- `nickname` is human-readable only. It does not affect the derived `identityId`, cryptographic verification, or vault-local role binding.
94
-
95
- `createChildIdentity(storage, parentIdentity, { nickname })` allocates the next `childIndex` from storage and creates a child identity.
96
-
97
- `deriveChildIdentity(parentIdentity, childIndex, { nickname })` deterministically reconstructs a child identity for a known `childIndex`.
98
-
99
- `ensureIdentityPrivateVault(storage, identity)` creates or refreshes the identity's fixed namespace under `identities/<identityId>/...`.
100
-
101
- That namespace stores identity-level files such as:
102
-
103
- - `sealed/profile.sealed`
104
- - `sealed/children.sealed`
105
-
106
- Those files are encrypted at rest in the `sealed/` sub-directory and are not readable as plain JSON on disk.
107
-
108
- Identities also maintain a **public discovery area**. This region is encrypted with a key derived from the identity ID, making it accessible via the API without the owner's private key, while ensuring all data on disk remains fully encrypted and tamper-resistant.
109
-
110
- `restoreIdentity(privateKey)` returns the same shape for an existing private key.
111
-
112
- `readIdentityPrivateVaultProfile(storage, identityOrPrivateKey)` decrypts and returns the current identity profile for the supplied identity or private key.
113
-
114
- `readIdentityPrivateVaultChildrenState(storage, identityOrPrivateKey)` decrypts and returns the child index state for the supplied identity or private key.
115
-
116
- `readIdentityMetadata(storage, identityId, [privateKey])` is the unified metadata reader.
117
- If `privateKey` is provided, it returns the full sealed profile.
118
- If `privateKey` is missing, it returns the public discovery profile (`IdentityPublicProfile`).
119
-
120
- `listIdentities(storage)` returns `Promise<IdentityPublicProfile[]>`. These profiles are automatically verified for signature integrity.
121
-
122
- `listVaults(storage)` returns `Promise<Array<{ vaultId: string; public: VaultPublicMetadata }>>`. These summaries are pulled from the public signed profiles and verified.
123
-
124
- Typical relationship lookup flow when you already have a private key:
125
-
126
- 1. `const identity = restoreIdentity(privateKey)`
127
- 2. `const profile = await readIdentityPrivateVaultProfile(storage, identity)`
128
- 3. `const children = await readIdentityPrivateVaultChildrenState(storage, identity)`
129
-
130
- `profile.parentIdentityId` tells you whether the identity is a child. `children.children` tells you which child identities were created beneath that identity.
131
-
132
- ## Secret-Flow Model
133
-
134
- The current HTTP-facing API supports two explicit secret-flow classes:
66
+ The vault uses a unified encrypted partition:
67
+ - `vault/sealed/profile.sealed`: Unified vault profile.
68
+ - `vault/sealed/secrets.sealed`: Secret registry.
69
+ - `vault/sealed/custody/`: Encrypted secret material.
70
+ - `vault/sealed/identities/`: Agent and capability registries.
135
71
 
136
- - `acquire_secret`
137
- No secret leaves the vault. A response-derived secret is stored into the vault. Agent-visible output is limited to protocol metadata and a redacted response shape.
72
+ ## Build & Integration
138
73
 
139
- - `send_secret`
140
- A stored secret is sent to an owner-approved target. The remote response is treated as normal business output and may be returned to the agent.
74
+ Ensure you are using the latest distribution:
75
+ - `dist/runtime/index.js`
76
+ - `dist/runtime/index.d.ts`
141
77
 
142
- This is a deliberate protocol boundary:
143
-
144
- - acquisition responses are assumed sensitive and are therefore redacted on the way back to the agent
145
- - dispatch responses are treated as ordinary HTTP results once the owner has authorized sending the secret to that target
146
-
147
- The runtime does not try to reinterpret every remote protocol. If an approved target returns sensitive values during a normal dispatch call, that is part of the target contract and owner authorization scope rather than a vault-side parsing obligation.
148
-
149
- The runtime does not claim to understand arbitrary network protocols. The API communicates only the currently supported boundary:
150
-
151
- - supported: explicit acquisition into vault through built-in standard flows
152
- - supported: explicit secret-backed outbound dispatch
153
- - supported: owner-defined `custom_http` flows for explicit exception cases
154
- - unsupported: mixed bidirectional-secret flows as a first-class surface
155
- - unsupported: no-secret operations as a first-class vault primitive
156
-
157
- ## Vault Client
158
-
159
- `clients/owner` implements the public vault-management client surface for the identity currently bound to the vault's single admin role.
160
-
161
- Current management operations:
162
-
163
- - `storeSecret(...)`
164
- - `defineSecretTargets(...)`
165
- - `writeSecret(...)`
166
- - `deleteSecret(...)`
167
- - `exportSecret(...)`
168
- - `readAudit(...)`
169
- - `registerAgent(...)`
170
- - `listAgents()`
171
- - `grantCapability(...)`
172
- - `listCapabilities(...)`
173
- - `revokeCapability(...)`
174
- - `registerFlow(...)`
175
-
176
- Example:
177
-
178
- ```ts
179
- const client = createVaultClient({ ownerIdentity, vault });
180
-
181
- const storedSecret = await client.storeSecret({
182
- alias: 'api-token',
183
- plaintext: 'secret-value',
184
- });
185
-
186
- await client.defineSecretTargets({
187
- alias: storedSecret.alias.value,
188
- targetBindings: [
189
- {
190
- kind: 'site',
191
- targetId: 'api.example.com',
192
- targetUrl: 'https://api.example.com/endpoint',
193
- methods: ['POST'],
194
- },
195
- ],
196
- });
197
-
198
- await client.registerAgent({
199
- agentId: 'agent-1',
200
- publicKey: agentPublicKey,
201
- });
202
-
203
- await client.registerFlow({
204
- flowId: 'custom-status-read',
205
- mode: 'send_secret',
206
- targetUrl: 'https://api.example.com/custom-status',
207
- method: 'POST',
208
- responseVisibility: 'shape_only',
209
- });
210
-
211
- await client.writeSecret({
212
- alias: 'secondary-token',
213
- plaintext: 'secret-value',
214
- targetBindings: [
215
- {
216
- kind: 'site',
217
- targetId: 'api.example.com',
218
- targetUrl: 'https://api.example.com/endpoint',
219
- methods: ['POST'],
220
- },
221
- ],
222
- });
223
-
224
- const exportedSecret = await client.exportSecret({
225
- alias: 'api-token',
226
- });
227
-
228
- await client.deleteSecret({
229
- alias: 'secondary-token',
230
- });
78
+ For a full generated API reference, run:
79
+ ```bash
80
+ npm run build:docs
231
81
  ```
232
-
233
- `writeSecret(...)` is the one-step variant and requires `targetBindings`.
234
-
235
- ## Agent Client
236
-
237
- `clients/agent` creates signed dispatch requests for an identity currently bound to an agent role in that vault. It never receives plaintext secrets.
238
-
239
- Current dispatch capabilities use `dispatch_http` as the explicit secret-send operation.
240
- It is intended for standard secret-backed resource access, not for token mint / refresh / exchange / registration-finalize style acquisition flows.
241
-
242
- The runtime also supports `custom_http` as an owner-defined exception path. A `custom_http` capability must reference a registered `customFlowId`.
243
- Owner-defined HTTP boundaries share one factory layer:
244
-
245
- - `createOwnerHttpFlowBoundary(...)`
246
- - `createStandardAcquireBoundary(...)`
247
- - `createStandardDispatchBoundary(...)`
248
-
249
- The owner-defined flow may use one of three modes:
250
-
251
- - `acquire_secret`
252
- - `send_secret`
253
- - `bidirectional_secret`
254
-
255
- Example:
256
-
257
- ```ts
258
- const capability = {
259
- vaultId: vault.vaultId,
260
- capabilityId: 'cap-1',
261
- agentId: agentIdentity.identityId,
262
- secretAliases: ['api-token'],
263
- operation: 'dispatch_http',
264
- allowedTargets: ['https://api.example.com/endpoint'],
265
- allowedMethods: ['POST'],
266
- issuedAt: new Date().toISOString(),
267
- };
268
-
269
- await client.grantCapability({ capability });
270
- ```
271
-
272
- The public agent capability type is the same shape as core `AgentCapability`, so `custom_http` capabilities are valid here too.
273
-
274
- Custom capability example:
275
-
276
- ```ts
277
- const customCapability = {
278
- vaultId: vault.vaultId,
279
- capabilityId: 'cap-custom',
280
- agentId: agentIdentity.identityId,
281
- customFlowId: 'custom-status-read',
282
- secretAliases: ['api-token'],
283
- operation: 'custom_http',
284
- allowedTargets: ['https://api.example.com/custom-status'],
285
- allowedMethods: ['POST'],
286
- issuedAt: new Date().toISOString(),
287
- };
288
-
289
- await client.grantCapability({ capability: customCapability });
290
- ```
291
-
292
- Recommended agent client shape:
293
-
294
- ```ts
295
- const agent = createAgentClient({
296
- agentIdentity,
297
- capability,
298
- vault,
299
- });
300
- ```
301
-
302
- ## Acquisition Result Shape
303
-
304
- `acquireSecret(...)` is the explicit acquisition operation.
305
-
306
- It no longer accepts an open-ended extractor callback. The current surface only supports built-in protocol flows:
307
-
308
- - `oauth_token_response.access_token`
309
- - `oauth_token_response.refresh_token`
310
- - `openid_token_response.id_token`
311
-
312
- Input:
313
-
314
- ```ts
315
- const acquireBoundary = createStandardAcquireBoundary({
316
- targetUrl: 'https://issuer.example.com/token',
317
- responseField: 'access_token',
318
- storeAlias: 'issuer-token',
319
- });
320
-
321
- const acquired = await vault.acquireSecret({
322
- alias: acquireBoundary.responseSecret.storeAlias,
323
- issuerId: 'issuer-1',
324
- url: acquireBoundary.targetUrl,
325
- flow: 'oauth_token_response.access_token',
326
- method: acquireBoundary.method,
327
- });
328
- ```
329
-
330
- Output:
331
-
332
- ```ts
333
- type VaultAcquireSecretResult = {
334
- vaultId: VaultId;
335
- alias: string;
336
- status: 'stored';
337
- responseStatus: number;
338
- contentType: string | null;
339
- responseShape: RedactedResponseShape;
340
- };
341
- ```
342
-
343
- `responseShape` is flow-specific. It preserves only the protocol-defined non-sensitive fields that the runtime explicitly allows for that built-in flow.
344
-
345
- Example:
346
-
347
- ```ts
348
- {
349
- token_type: 'Bearer',
350
- expires_in: 3600,
351
- scope: 'read write',
352
- }
353
- ```
354
-
355
- ## Dispatch Result Shape
356
-
357
- `dispatch_http` returns normal remote output:
358
-
359
- ```ts
360
- type DispatchResult = {
361
- vaultId: VaultId;
362
- requestId: string;
363
- status: 'succeeded' | 'denied' | 'failed';
364
- targetUrl: string;
365
- method: string;
366
- responseStatus?: number;
367
- responseBody?: string;
368
- error?: string;
369
- };
370
- ```
371
-
372
- This is an intentional current-surface choice: `dispatch_http` is treated as secret-out / non-secret-in.
373
-
374
- In other words, the vault respects the standard HTTP response surface for normal dispatch. It does not attempt to retroactively sanitize every downstream response body, because doing so would shift responsibility away from the target protocol and the owner's authorization decision.
375
-
376
- For `custom_http`, response visibility is chosen by the owner at flow registration time:
377
-
378
- - `passthrough`: return the remote body
379
- - `shape_only`: return a redacted shape-only body
380
-
381
- If the custom flow mode includes secret acquisition, the owner also defines a response secret rule. The current built-in rule shape is:
382
-
383
- ```ts
384
- {
385
- kind: 'json_field',
386
- field: 'access_token',
387
- storeAlias: 'new-token',
388
- }
389
- ```
390
-
391
- ## Public-Ready Discovery (Encrypted)
392
-
393
- The CBIO Node Runtime implements a **Public-Ready Encryption** model for discovery metadata. This allows public information (like nicknames) to be accessible via the API without requiring a private key, while ensuring all data on disk is encrypted.
394
-
395
- - **Storage**: Managed internally within the `sealed/` directory.
396
- - **Integrity**: These files are encrypted using a key derived from the Vault or Identity ID (`sha256(cbio:vault-public-metadata:v1 + id)`). This provides tamper-resistance and ensures that the file content remains a black box on disk.
397
- - **Verification**: The SDK automatically derives the required discovery keys during `listVaults`, `listIdentities`, and retrieval. Corrupted or tampered files are identified by the cryptographic layer and safely ignored.
398
-
399
- ## Persistent Dependencies
400
-
401
- `createPersistentVaultCoreDependencies(...)` builds a file-backed single-node profile under `vault/sealed/` with:
402
-
403
- - persistent secret metadata
404
- - sealed secret custody blobs
405
- - append-only tamper-evident audit
406
- - persistent replay guard
407
- - persistent rate-limit state
408
- - persistent capability revocation state
409
- - persistent owner identity record
410
- - persistent agent identity registry
411
- - persistent capability registry
412
-
413
- ## Storage Provider
414
-
415
- Any backend can be used by implementing `IStorageProvider`:
416
-
417
- ```ts
418
- export interface IStorageProvider {
419
- read(key: string): Promise<Buffer | null>;
420
- write(key: string, data: Buffer): Promise<void>;
421
- delete(key: string): Promise<void>;
422
- has(key: string): Promise<boolean>;
423
- rename?(fromKey: string, toKey: string): Promise<void>;
424
- withLock?<T>(key: string, task: () => Promise<T>): Promise<T>;
425
- }
426
- ```
427
-
428
- `withLock(...)` is used when present to serialize read-modify-write persistence sequences.
@@ -1,8 +1,8 @@
1
- **CBIO Node Runtime Agent API v1.46.0**
1
+ **CBIO Node Runtime Agent API v1.47.2**
2
2
 
3
3
  ***
4
4
 
5
- # CBIO Node Runtime Agent API v1.46.0
5
+ # CBIO Node Runtime Agent API v1.47.2
6
6
 
7
7
  ## Enumerations
8
8
 
@@ -43,15 +43,16 @@
43
43
  - [VaultAuditQueryInput](interfaces/VaultAuditQueryInput.md)
44
44
  - [VaultClient](interfaces/VaultClient.md)
45
45
  - [VaultCoreDependenciesOptions](interfaces/VaultCoreDependenciesOptions.md)
46
+ - [VaultCreateAgentInput](interfaces/VaultCreateAgentInput.md)
46
47
  - [VaultDeleteSecretInput](interfaces/VaultDeleteSecretInput.md)
47
48
  - [VaultExportSecretInput](interfaces/VaultExportSecretInput.md)
48
49
  - [VaultGrantCapabilityInput](interfaces/VaultGrantCapabilityInput.md)
49
50
  - [VaultIdentity](interfaces/VaultIdentity.md)
50
51
  - [VaultListAgentsInput](interfaces/VaultListAgentsInput.md)
51
52
  - [VaultListCapabilitiesInput](interfaces/VaultListCapabilitiesInput.md)
53
+ - [VaultMetadata](interfaces/VaultMetadata.md)
52
54
  - [VaultObject](interfaces/VaultObject.md)
53
55
  - [VaultProfile](interfaces/VaultProfile.md)
54
- - [VaultPublicMetadata](interfaces/VaultPublicMetadata.md)
55
56
  - [VaultRegisterAgentInput](interfaces/VaultRegisterAgentInput.md)
56
57
  - [VaultRegisterFlowInput](interfaces/VaultRegisterFlowInput.md)
57
58
  - [VaultRevokeCapabilityInput](interfaces/VaultRevokeCapabilityInput.md)
@@ -1,11 +1,11 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
5
5
  # Class: IdentityError
6
6
 
7
7
  Runtime export.
8
- Public surface: typed high-level runtime plus supported low-level building blocks.
8
+ Main API: typed high-level runtime plus supported low-level building blocks.
9
9
 
10
10
  ## Extends
11
11
 
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -173,6 +173,22 @@ This is the primary implementation of the Vault logic.
173
173
 
174
174
  ***
175
175
 
176
+ ### issueAgentSessionToken()
177
+
178
+ > **issueAgentSessionToken**(`request`): `Promise`\<`OwnerSessionToken`\>
179
+
180
+ #### Parameters
181
+
182
+ ##### request
183
+
184
+ `OwnerIssueSessionTokenRequest`
185
+
186
+ #### Returns
187
+
188
+ `Promise`\<`OwnerSessionToken`\>
189
+
190
+ ***
191
+
176
192
  ### listAgents()
177
193
 
178
194
  > **listAgents**(`actor`, `request?`): `Promise`\<readonly `AgentIdentityRecord`[]\>
@@ -265,6 +281,32 @@ This is the primary implementation of the Vault logic.
265
281
 
266
282
  ***
267
283
 
284
+ ### revokeAgentSessionToken()
285
+
286
+ > **revokeAgentSessionToken**(`request`): `Promise`\<`void`\>
287
+
288
+ #### Parameters
289
+
290
+ ##### request
291
+
292
+ ###### actor
293
+
294
+ `VaultPrincipal` & `object`
295
+
296
+ ###### token
297
+
298
+ `string`
299
+
300
+ ###### vaultId
301
+
302
+ `VaultId`
303
+
304
+ #### Returns
305
+
306
+ `Promise`\<`void`\>
307
+
308
+ ***
309
+
268
310
  ### revokeCapability()
269
311
 
270
312
  > **revokeCapability**(`command`): `Promise`\<`void`\>
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -22,7 +22,7 @@ Workspace storage (or path string) where vaults are stored.
22
22
 
23
23
  [`CreateVaultOptions`](../interfaces/CreateVaultOptions.md)
24
24
 
25
- Configuration including owner identity and metadata.
25
+ Configuration including password and metadata.
26
26
 
27
27
  ### Returns
28
28
 
@@ -34,7 +34,7 @@ A [CreatedVault](../interfaces/CreatedVault.md) instance.
34
34
 
35
35
  ```ts
36
36
  const vault = await createVault({
37
- ownerIdentity,
37
+ password: 'my-strong-password',
38
38
  nickname: 'production-secrets'
39
39
  });
40
40
  ```
@@ -1,4 +1,4 @@
1
- [**CBIO Node Runtime Agent API v1.46.0**](../README.md)
1
+ [**CBIO Node Runtime Agent API v1.47.2**](../README.md)
2
2
 
3
3
  ***
4
4