@the-ai-company/cbio-node-runtime 1.48.6 → 1.49.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 +40 -25
- package/dist/clients/agent/client.d.ts +8 -6
- package/dist/clients/agent/client.js +67 -49
- package/dist/clients/agent/client.js.map +1 -1
- package/dist/clients/agent/contracts.d.ts +13 -1
- package/dist/clients/agent/index.d.ts +1 -1
- package/dist/clients/owner/client.d.ts +20 -14
- package/dist/clients/owner/client.js +136 -51
- package/dist/clients/owner/client.js.map +1 -1
- package/dist/clients/owner/contracts.d.ts +58 -26
- package/dist/clients/owner/index.d.ts +1 -1
- package/dist/runtime/index.d.ts +4 -3
- package/dist/runtime/index.js +5 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/vault-core/contracts.d.ts +90 -3
- package/dist/vault-core/contracts.js +3 -0
- package/dist/vault-core/contracts.js.map +1 -1
- package/dist/vault-core/core.d.ts +44 -25
- package/dist/vault-core/core.js +290 -73
- package/dist/vault-core/core.js.map +1 -1
- package/dist/vault-core/defaults.d.ts +9 -1
- package/dist/vault-core/defaults.js +39 -6
- 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 +1 -0
- package/dist/vault-core/persistence.js +7 -1
- package/dist/vault-core/persistence.js.map +1 -1
- package/dist/vault-core/ports.d.ts +8 -0
- package/dist/vault-ingress/defaults.d.ts +4 -1
- package/dist/vault-ingress/defaults.js +12 -3
- package/dist/vault-ingress/defaults.js.map +1 -1
- package/dist/vault-ingress/index.d.ts +137 -21
- package/dist/vault-ingress/index.js +156 -46
- package/dist/vault-ingress/index.js.map +1 -1
- package/dist/vault-ingress/remote-transport.d.ts +7 -2
- package/dist/vault-ingress/remote-transport.js +61 -3
- package/dist/vault-ingress/remote-transport.js.map +1 -1
- package/dist/vault-ingress/server-utils.d.ts +2 -1
- package/dist/vault-ingress/server-utils.js +42 -1
- package/dist/vault-ingress/server-utils.js.map +1 -1
- package/docs/REFERENCE.md +46 -17
- package/docs/api/README.md +10 -3
- package/docs/api/classes/IdentityError.md +1 -1
- package/docs/api/classes/VaultCore.md +258 -102
- package/docs/api/classes/VaultCoreError.md +1 -1
- package/docs/api/enumerations/IdentityErrorCode.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/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 +21 -0
- 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 +41 -5
- package/docs/api/interfaces/AgentDispatchIntent.md +1 -1
- package/docs/api/interfaces/AgentDispatchTransport.md +51 -3
- package/docs/api/interfaces/AgentIdentity.md +1 -1
- package/docs/api/interfaces/AgentSigner.md +1 -1
- package/docs/api/interfaces/AgentSubmitCapabilityRequestInput.md +41 -0
- package/docs/api/interfaces/CbioRuntime.md +21 -1
- package/docs/api/interfaces/CreateAgentClientOptions.md +3 -9
- package/docs/api/interfaces/CreateIdentityOptions.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 +17 -0
- package/docs/api/interfaces/OwnerDefineSecretTargetsInput.md +1 -1
- package/docs/api/interfaces/OwnerSecretTargetBinding.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 +23 -0
- package/docs/api/interfaces/VaultAuditQueryInput.md +1 -1
- package/docs/api/interfaces/VaultClient.md +123 -33
- 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 +13 -19
- package/docs/api/interfaces/VaultIdentity.md +1 -1
- package/docs/api/interfaces/{VaultRegisterAgentInput.md → VaultImportAgentInput.md} +4 -10
- package/docs/api/interfaces/VaultListAgentsInput.md +1 -1
- package/docs/api/interfaces/VaultListCapabilitiesInput.md +1 -1
- package/docs/api/interfaces/VaultListSecretsInput.md +11 -0
- 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/VaultRegisterFlowInput.md +1 -1
- package/docs/api/interfaces/VaultRevokeCapabilityInput.md +1 -1
- package/docs/api/interfaces/VaultSigner.md +1 -1
- package/docs/api/interfaces/VaultSubmitCapabilityRequestInput.md +79 -0
- package/docs/api/type-aliases/AgentCapabilityEnvelope.md +1 -1
- package/docs/api/type-aliases/AgentVisibleSecretRecord.md +7 -0
- package/docs/api/type-aliases/CbioRuntimeModule.md +1 -1
- package/docs/api/variables/DEFAULT_VAULT_KEY_CUSTODY_BLOB_KEY.md +1 -1
- package/examples/process-isolation.ts +24 -15
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.49.0**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -9,9 +9,25 @@ In Sovereign Vault model, administrative actions are implicitly authorized by th
|
|
|
9
9
|
|
|
10
10
|
## Methods
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### ownerApproveCapabilityRequest()
|
|
13
13
|
|
|
14
|
-
> **
|
|
14
|
+
> **ownerApproveCapabilityRequest**(`input`): `Promise`\<`AgentCapability`\>
|
|
15
|
+
|
|
16
|
+
#### Parameters
|
|
17
|
+
|
|
18
|
+
##### input
|
|
19
|
+
|
|
20
|
+
[`VaultApproveCapabilityRequestInput`](VaultApproveCapabilityRequestInput.md)
|
|
21
|
+
|
|
22
|
+
#### Returns
|
|
23
|
+
|
|
24
|
+
`Promise`\<`AgentCapability`\>
|
|
25
|
+
|
|
26
|
+
***
|
|
27
|
+
|
|
28
|
+
### ownerCreateAgent()
|
|
29
|
+
|
|
30
|
+
> **ownerCreateAgent**(`input`): `Promise`\<[`OwnerAgentProvisionResult`](OwnerAgentProvisionResult.md)\>
|
|
15
31
|
|
|
16
32
|
Generates a new identity and registers it as an agent in one step.
|
|
17
33
|
The private key is stored in the vault for managed custody.
|
|
@@ -24,13 +40,13 @@ The private key is stored in the vault for managed custody.
|
|
|
24
40
|
|
|
25
41
|
#### Returns
|
|
26
42
|
|
|
27
|
-
`Promise`\<
|
|
43
|
+
`Promise`\<[`OwnerAgentProvisionResult`](OwnerAgentProvisionResult.md)\>
|
|
28
44
|
|
|
29
45
|
***
|
|
30
46
|
|
|
31
|
-
###
|
|
47
|
+
### ownerDefineSecretTargets()
|
|
32
48
|
|
|
33
|
-
> **
|
|
49
|
+
> **ownerDefineSecretTargets**(`input`): `Promise`\<`SecretRecord`\>
|
|
34
50
|
|
|
35
51
|
Refines the allowed targets for an existing secret.
|
|
36
52
|
|
|
@@ -46,9 +62,9 @@ Refines the allowed targets for an existing secret.
|
|
|
46
62
|
|
|
47
63
|
***
|
|
48
64
|
|
|
49
|
-
###
|
|
65
|
+
### ownerDeleteSecret()
|
|
50
66
|
|
|
51
|
-
> **
|
|
67
|
+
> **ownerDeleteSecret**(`input`): `Promise`\<`void`\>
|
|
52
68
|
|
|
53
69
|
Permanently deletes a secret from the vault.
|
|
54
70
|
|
|
@@ -64,9 +80,9 @@ Permanently deletes a secret from the vault.
|
|
|
64
80
|
|
|
65
81
|
***
|
|
66
82
|
|
|
67
|
-
###
|
|
83
|
+
### ownerExportSecret()
|
|
68
84
|
|
|
69
|
-
> **
|
|
85
|
+
> **ownerExportSecret**(`input`): `Promise`\<`OwnerSecretExport`\>
|
|
70
86
|
|
|
71
87
|
Exports a secret's plaintext.
|
|
72
88
|
|
|
@@ -82,9 +98,9 @@ Exports a secret's plaintext.
|
|
|
82
98
|
|
|
83
99
|
***
|
|
84
100
|
|
|
85
|
-
###
|
|
101
|
+
### ownerGrantCapability()
|
|
86
102
|
|
|
87
|
-
> **
|
|
103
|
+
> **ownerGrantCapability**(`input`): `Promise`\<`void`\>
|
|
88
104
|
|
|
89
105
|
Grants a specific capability to an agent.
|
|
90
106
|
|
|
@@ -100,9 +116,25 @@ Grants a specific capability to an agent.
|
|
|
100
116
|
|
|
101
117
|
***
|
|
102
118
|
|
|
103
|
-
###
|
|
119
|
+
### ownerImportAgent()
|
|
120
|
+
|
|
121
|
+
> **ownerImportAgent**(`input`): `Promise`\<[`OwnerAgentProvisionResult`](OwnerAgentProvisionResult.md)\>
|
|
122
|
+
|
|
123
|
+
#### Parameters
|
|
104
124
|
|
|
105
|
-
|
|
125
|
+
##### input
|
|
126
|
+
|
|
127
|
+
[`VaultImportAgentInput`](VaultImportAgentInput.md)
|
|
128
|
+
|
|
129
|
+
#### Returns
|
|
130
|
+
|
|
131
|
+
`Promise`\<[`OwnerAgentProvisionResult`](OwnerAgentProvisionResult.md)\>
|
|
132
|
+
|
|
133
|
+
***
|
|
134
|
+
|
|
135
|
+
### ownerListAgents()
|
|
136
|
+
|
|
137
|
+
> **ownerListAgents**(`input?`): `Promise`\<readonly `AgentIdentityRecord`[]\>
|
|
106
138
|
|
|
107
139
|
Lists all agents registered in the vault.
|
|
108
140
|
|
|
@@ -118,9 +150,9 @@ Lists all agents registered in the vault.
|
|
|
118
150
|
|
|
119
151
|
***
|
|
120
152
|
|
|
121
|
-
###
|
|
153
|
+
### ownerListCapabilities()
|
|
122
154
|
|
|
123
|
-
> **
|
|
155
|
+
> **ownerListCapabilities**(`input?`): `Promise`\<readonly `AgentCapability`[]\>
|
|
124
156
|
|
|
125
157
|
Lists all active capabilities granted to agents.
|
|
126
158
|
|
|
@@ -136,9 +168,51 @@ Lists all active capabilities granted to agents.
|
|
|
136
168
|
|
|
137
169
|
***
|
|
138
170
|
|
|
139
|
-
###
|
|
171
|
+
### ownerListPendingCapabilityRequests()
|
|
172
|
+
|
|
173
|
+
> **ownerListPendingCapabilityRequests**(): `Promise`\<readonly `PendingCapabilityRequestRecord`[]\>
|
|
174
|
+
|
|
175
|
+
#### Returns
|
|
176
|
+
|
|
177
|
+
`Promise`\<readonly `PendingCapabilityRequestRecord`[]\>
|
|
178
|
+
|
|
179
|
+
***
|
|
180
|
+
|
|
181
|
+
### ownerListSecrets()
|
|
140
182
|
|
|
141
|
-
> **
|
|
183
|
+
> **ownerListSecrets**(`input?`): `Promise`\<readonly `AgentVisibleSecretRecord`[]\>
|
|
184
|
+
|
|
185
|
+
#### Parameters
|
|
186
|
+
|
|
187
|
+
##### input?
|
|
188
|
+
|
|
189
|
+
[`VaultListSecretsInput`](VaultListSecretsInput.md)
|
|
190
|
+
|
|
191
|
+
#### Returns
|
|
192
|
+
|
|
193
|
+
`Promise`\<readonly `AgentVisibleSecretRecord`[]\>
|
|
194
|
+
|
|
195
|
+
***
|
|
196
|
+
|
|
197
|
+
### ownerOnPendingCapabilityRequest()
|
|
198
|
+
|
|
199
|
+
> **ownerOnPendingCapabilityRequest**(`callback`): () => `void`
|
|
200
|
+
|
|
201
|
+
#### Parameters
|
|
202
|
+
|
|
203
|
+
##### callback
|
|
204
|
+
|
|
205
|
+
(`record`) => `void`
|
|
206
|
+
|
|
207
|
+
#### Returns
|
|
208
|
+
|
|
209
|
+
() => `void`
|
|
210
|
+
|
|
211
|
+
***
|
|
212
|
+
|
|
213
|
+
### ownerReadAudit()
|
|
214
|
+
|
|
215
|
+
> **ownerReadAudit**(`query?`): `Promise`\<readonly `AuditEntry`[]\>
|
|
142
216
|
|
|
143
217
|
Reads the tamper-evident audit log for the vault.
|
|
144
218
|
|
|
@@ -154,15 +228,17 @@ Reads the tamper-evident audit log for the vault.
|
|
|
154
228
|
|
|
155
229
|
***
|
|
156
230
|
|
|
157
|
-
###
|
|
231
|
+
### ownerRegisterFlow()
|
|
232
|
+
|
|
233
|
+
> **ownerRegisterFlow**(`input`): `Promise`\<`void`\>
|
|
158
234
|
|
|
159
|
-
|
|
235
|
+
Registers a custom HTTP flow for complex secret usage.
|
|
160
236
|
|
|
161
237
|
#### Parameters
|
|
162
238
|
|
|
163
239
|
##### input
|
|
164
240
|
|
|
165
|
-
[`
|
|
241
|
+
[`VaultRegisterFlowInput`](VaultRegisterFlowInput.md)
|
|
166
242
|
|
|
167
243
|
#### Returns
|
|
168
244
|
|
|
@@ -170,17 +246,15 @@ Reads the tamper-evident audit log for the vault.
|
|
|
170
246
|
|
|
171
247
|
***
|
|
172
248
|
|
|
173
|
-
###
|
|
249
|
+
### ownerRejectCapabilityRequest()
|
|
174
250
|
|
|
175
|
-
> **
|
|
176
|
-
|
|
177
|
-
Registers a custom HTTP flow for complex secret usage.
|
|
251
|
+
> **ownerRejectCapabilityRequest**(`requestId`): `Promise`\<`void`\>
|
|
178
252
|
|
|
179
253
|
#### Parameters
|
|
180
254
|
|
|
181
|
-
#####
|
|
255
|
+
##### requestId
|
|
182
256
|
|
|
183
|
-
|
|
257
|
+
`string`
|
|
184
258
|
|
|
185
259
|
#### Returns
|
|
186
260
|
|
|
@@ -188,9 +262,9 @@ Registers a custom HTTP flow for complex secret usage.
|
|
|
188
262
|
|
|
189
263
|
***
|
|
190
264
|
|
|
191
|
-
###
|
|
265
|
+
### ownerRevokeCapability()
|
|
192
266
|
|
|
193
|
-
> **
|
|
267
|
+
> **ownerRevokeCapability**(`input`): `Promise`\<`void`\>
|
|
194
268
|
|
|
195
269
|
Revokes a previously granted capability.
|
|
196
270
|
|
|
@@ -206,9 +280,9 @@ Revokes a previously granted capability.
|
|
|
206
280
|
|
|
207
281
|
***
|
|
208
282
|
|
|
209
|
-
###
|
|
283
|
+
### ownerStoreSecret()
|
|
210
284
|
|
|
211
|
-
> **
|
|
285
|
+
> **ownerStoreSecret**(`input`): `Promise`\<`SecretRecord`\>
|
|
212
286
|
|
|
213
287
|
Securely stores a new secret in the vault.
|
|
214
288
|
|
|
@@ -224,9 +298,25 @@ Securely stores a new secret in the vault.
|
|
|
224
298
|
|
|
225
299
|
***
|
|
226
300
|
|
|
227
|
-
###
|
|
301
|
+
### ownerSubmitCapabilityRequest()
|
|
302
|
+
|
|
303
|
+
> **ownerSubmitCapabilityRequest**(`input`): `Promise`\<`PendingCapabilityRequestRecord`\>
|
|
304
|
+
|
|
305
|
+
#### Parameters
|
|
306
|
+
|
|
307
|
+
##### input
|
|
308
|
+
|
|
309
|
+
[`VaultSubmitCapabilityRequestInput`](VaultSubmitCapabilityRequestInput.md)
|
|
310
|
+
|
|
311
|
+
#### Returns
|
|
312
|
+
|
|
313
|
+
`Promise`\<`PendingCapabilityRequestRecord`\>
|
|
314
|
+
|
|
315
|
+
***
|
|
316
|
+
|
|
317
|
+
### ownerWriteSecret()
|
|
228
318
|
|
|
229
|
-
> **
|
|
319
|
+
> **ownerWriteSecret**(`input`): `Promise`\<`SecretRecord`\>
|
|
230
320
|
|
|
231
321
|
Atomic operation to store a secret and define its targets in one step.
|
|
232
322
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.49.0**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -12,24 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
***
|
|
14
14
|
|
|
15
|
-
### allowedMethods?
|
|
16
|
-
|
|
17
|
-
> `optional` **allowedMethods?**: readonly `string`[]
|
|
18
|
-
|
|
19
|
-
***
|
|
20
|
-
|
|
21
|
-
### allowedPaths?
|
|
22
|
-
|
|
23
|
-
> `optional` **allowedPaths?**: readonly `string`[]
|
|
24
|
-
|
|
25
|
-
***
|
|
26
|
-
|
|
27
|
-
### allowedTargets?
|
|
28
|
-
|
|
29
|
-
> `optional` **allowedTargets?**: readonly `string`[]
|
|
30
|
-
|
|
31
|
-
***
|
|
32
|
-
|
|
33
15
|
### capabilityId?
|
|
34
16
|
|
|
35
17
|
> `optional` **capabilityId?**: `string`
|
|
@@ -42,6 +24,12 @@
|
|
|
42
24
|
|
|
43
25
|
***
|
|
44
26
|
|
|
27
|
+
### methods
|
|
28
|
+
|
|
29
|
+
> **methods**: readonly `string`[]
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
45
33
|
### operation?
|
|
46
34
|
|
|
47
35
|
> `optional` **operation?**: `string`
|
|
@@ -68,6 +56,12 @@
|
|
|
68
56
|
|
|
69
57
|
***
|
|
70
58
|
|
|
59
|
+
### scope
|
|
60
|
+
|
|
61
|
+
> **scope**: `string`
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
71
65
|
### secretAliases?
|
|
72
66
|
|
|
73
67
|
> `optional` **secretAliases?**: readonly `string`[]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.49.0**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
# Interface:
|
|
5
|
+
# Interface: VaultImportAgentInput
|
|
6
6
|
|
|
7
7
|
## Properties
|
|
8
8
|
|
|
@@ -24,15 +24,9 @@
|
|
|
24
24
|
|
|
25
25
|
***
|
|
26
26
|
|
|
27
|
-
### privateKey
|
|
27
|
+
### privateKey
|
|
28
28
|
|
|
29
|
-
>
|
|
30
|
-
|
|
31
|
-
***
|
|
32
|
-
|
|
33
|
-
### publicKey
|
|
34
|
-
|
|
35
|
-
> **publicKey**: `string`
|
|
29
|
+
> **privateKey**: `string`
|
|
36
30
|
|
|
37
31
|
***
|
|
38
32
|
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.49.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
# Interface: VaultSubmitCapabilityRequestInput
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
### agentId
|
|
10
|
+
|
|
11
|
+
> **agentId**: `string`
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### expiresAt?
|
|
16
|
+
|
|
17
|
+
> `optional` **expiresAt?**: `string`
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### justification?
|
|
22
|
+
|
|
23
|
+
> `optional` **justification?**: `string`
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### methods
|
|
28
|
+
|
|
29
|
+
> **methods**: readonly `string`[]
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### operation?
|
|
34
|
+
|
|
35
|
+
> `optional` **operation?**: `string`
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### rateLimit?
|
|
40
|
+
|
|
41
|
+
> `optional` **rateLimit?**: `object`
|
|
42
|
+
|
|
43
|
+
#### maxRequests
|
|
44
|
+
|
|
45
|
+
> **maxRequests**: `number`
|
|
46
|
+
|
|
47
|
+
#### windowMs
|
|
48
|
+
|
|
49
|
+
> **windowMs**: `number`
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
53
|
+
### requestedAt?
|
|
54
|
+
|
|
55
|
+
> `optional` **requestedAt?**: `string`
|
|
56
|
+
|
|
57
|
+
***
|
|
58
|
+
|
|
59
|
+
### requester
|
|
60
|
+
|
|
61
|
+
> **requester**: `VaultPrincipal`
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### scope
|
|
66
|
+
|
|
67
|
+
> **scope**: `string`
|
|
68
|
+
|
|
69
|
+
***
|
|
70
|
+
|
|
71
|
+
### secretAliases?
|
|
72
|
+
|
|
73
|
+
> `optional` **secretAliases?**: readonly `string`[]
|
|
74
|
+
|
|
75
|
+
***
|
|
76
|
+
|
|
77
|
+
### skipAudit?
|
|
78
|
+
|
|
79
|
+
> `optional` **skipAudit?**: `boolean`
|
|
@@ -8,13 +8,12 @@ import {
|
|
|
8
8
|
AgentDispatchHttpTransport,
|
|
9
9
|
MemoryStorageProvider,
|
|
10
10
|
} from "../src/runtime/index.js";
|
|
11
|
-
import { LocalSigner } from "../src/protocol/crypto.js";
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* This example demonstrates the A/B Process Architecture (Process Isolation).
|
|
15
14
|
*
|
|
16
15
|
* - Process B (The Vault): Hosts the actual secrets and performs the HTTP dispatch.
|
|
17
|
-
* - Process A (The Agent):
|
|
16
|
+
* - Process A (The Agent): Uses a session token to call Process B. A never sees the secret.
|
|
18
17
|
*/
|
|
19
18
|
|
|
20
19
|
// --- Process B: The Vault Server Logic ---
|
|
@@ -25,7 +24,7 @@ async function startVaultServer(port: number) {
|
|
|
25
24
|
// Create a real vault in memory
|
|
26
25
|
const { core } = await createVault(storage, {
|
|
27
26
|
vaultId: "vault-isolated-server",
|
|
28
|
-
|
|
27
|
+
password: "process-isolation-demo-password",
|
|
29
28
|
});
|
|
30
29
|
|
|
31
30
|
// Wrap as a Service
|
|
@@ -61,7 +60,7 @@ async function startVaultServer(port: number) {
|
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
// --- Process A: The LLM Agent Logic ---
|
|
64
|
-
async function runAgentDemo(port: number, agentIdentity: any, capability: any) {
|
|
63
|
+
async function runAgentDemo(port: number, agentIdentity: any, capability: any, token: string) {
|
|
65
64
|
// Process A ONLY knows the remote URL and its own Agent Identity.
|
|
66
65
|
// It has NO access to the Vault's master key or storage.
|
|
67
66
|
const transport = new AgentDispatchHttpTransport(`http://localhost:${port}/dispatch`);
|
|
@@ -70,13 +69,13 @@ async function runAgentDemo(port: number, agentIdentity: any, capability: any) {
|
|
|
70
69
|
agentIdentity,
|
|
71
70
|
capability,
|
|
72
71
|
transport,
|
|
73
|
-
|
|
72
|
+
token,
|
|
74
73
|
});
|
|
75
74
|
|
|
76
75
|
console.log("[Process A] LLM Agent requesting secret-backed dispatch...");
|
|
77
76
|
|
|
78
77
|
try {
|
|
79
|
-
const result = await agentClient.
|
|
78
|
+
const result = await agentClient.agentDispatch({
|
|
80
79
|
secretAlias: "api-token",
|
|
81
80
|
targetUrl: "https://httpbin.org/post",
|
|
82
81
|
method: "POST",
|
|
@@ -102,27 +101,28 @@ async function main() {
|
|
|
102
101
|
const agentIdentity = createIdentity({ nickname: "llm-agent-1" });
|
|
103
102
|
|
|
104
103
|
// Owner registers the agent and a capability (simulated local call for setup)
|
|
105
|
-
await vault.
|
|
104
|
+
await vault.ownerRegisterAgentIdentity({
|
|
106
105
|
vaultId: vault.vaultId,
|
|
106
|
+
requestId: `setup:${Date.now()}:register_agent`,
|
|
107
107
|
owner: { kind: "owner", id: ownerIdentity.identityId },
|
|
108
108
|
agentIdentity: {
|
|
109
109
|
vaultId: vault.vaultId,
|
|
110
110
|
agentId: agentIdentity.identityId,
|
|
111
111
|
publicKey: agentIdentity.publicKey,
|
|
112
112
|
},
|
|
113
|
-
|
|
113
|
+
requestedAt: new Date().toISOString(),
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
// Owner writes a secret (simulated local call for setup)
|
|
117
|
-
const secret = await vault.
|
|
117
|
+
const secret = await vault.ownerWriteSecret({
|
|
118
118
|
kind: "owner.write_secret",
|
|
119
119
|
vaultId: vault.vaultId,
|
|
120
|
+
requestId: `setup:${Date.now()}:write_secret`,
|
|
120
121
|
owner: { kind: "owner", id: ownerIdentity.identityId },
|
|
121
122
|
alias: "api-token",
|
|
122
123
|
plaintext: "SK-PROD-12345",
|
|
123
124
|
targetBindings: [{ kind: "site", targetId: "httpbin.org", targetUrl: "https://httpbin.org/post", methods: ["POST"] }],
|
|
124
125
|
requestedAt: new Date().toISOString(),
|
|
125
|
-
proof: { signature: "setup-proof", ownerId: ownerIdentity.identityId, requestedAt: new Date().toISOString() },
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
const capability = {
|
|
@@ -132,20 +132,29 @@ async function main() {
|
|
|
132
132
|
secretIds: [secret.secretId.value],
|
|
133
133
|
secretAliases: ["api-token"],
|
|
134
134
|
operation: "dispatch_http" as const,
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
scope: "https://httpbin.org/post",
|
|
136
|
+
methods: ["POST"],
|
|
137
137
|
issuedAt: new Date().toISOString(),
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
await vault.
|
|
140
|
+
await vault.ownerRegisterCapability({
|
|
141
141
|
vaultId: vault.vaultId,
|
|
142
|
+
requestId: `setup:${Date.now()}:register_capability`,
|
|
142
143
|
owner: { kind: "owner", id: ownerIdentity.identityId },
|
|
143
144
|
capability,
|
|
144
|
-
|
|
145
|
+
requestedAt: new Date().toISOString(),
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const session = await vault.ownerIssueSessionToken({
|
|
149
|
+
vaultId: vault.vaultId,
|
|
150
|
+
requestId: `setup:${Date.now()}:issue_session_token`,
|
|
151
|
+
actor: { kind: "owner", id: ownerIdentity.identityId },
|
|
152
|
+
agentId: agentIdentity.identityId,
|
|
153
|
+
requestedAt: new Date().toISOString(),
|
|
145
154
|
});
|
|
146
155
|
|
|
147
156
|
// 3. Run the "LLM Agent" (Process A)
|
|
148
|
-
await runAgentDemo(PORT, agentIdentity, capability);
|
|
157
|
+
await runAgentDemo(PORT, agentIdentity, capability, session.token);
|
|
149
158
|
|
|
150
159
|
// 4. Cleanup
|
|
151
160
|
server.close();
|