@the-ai-company/cbio-node-runtime 1.58.0 → 1.60.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 +55 -24
- package/dist/clients/agent/client.d.ts +9 -1
- package/dist/clients/agent/client.js +41 -11
- package/dist/clients/agent/client.js.map +1 -1
- package/dist/clients/agent/contracts.d.ts +5 -2
- package/dist/clients/owner/client.d.ts +15 -11
- package/dist/clients/owner/client.js +83 -30
- package/dist/clients/owner/client.js.map +1 -1
- package/dist/clients/owner/contracts.d.ts +32 -22
- package/dist/clients/owner/index.d.ts +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/vault-core/contracts.d.ts +204 -26
- package/dist/vault-core/contracts.js +6 -2
- package/dist/vault-core/contracts.js.map +1 -1
- package/dist/vault-core/core.d.ts +23 -4
- package/dist/vault-core/core.js +480 -121
- package/dist/vault-core/core.js.map +1 -1
- package/dist/vault-core/defaults.d.ts +9 -2
- package/dist/vault-core/defaults.js +41 -14
- package/dist/vault-core/defaults.js.map +1 -1
- package/dist/vault-core/index.d.ts +1 -1
- package/dist/vault-core/index.js.map +1 -1
- package/dist/vault-core/persistence.d.ts +12 -2
- package/dist/vault-core/persistence.js +43 -4
- package/dist/vault-core/persistence.js.map +1 -1
- package/dist/vault-core/ports.d.ts +7 -1
- package/dist/vault-core/tool-metadata.js +27 -10
- package/dist/vault-core/tool-metadata.js.map +1 -1
- package/dist/vault-ingress/defaults.d.ts +2 -0
- package/dist/vault-ingress/defaults.js +6 -0
- package/dist/vault-ingress/defaults.js.map +1 -1
- package/dist/vault-ingress/index.d.ts +54 -9
- package/dist/vault-ingress/index.js +160 -46
- package/dist/vault-ingress/index.js.map +1 -1
- package/dist/vault-ingress/remote-transport.d.ts +2 -0
- package/dist/vault-ingress/remote-transport.js +33 -4
- package/dist/vault-ingress/remote-transport.js.map +1 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/REFERENCE.md +43 -30
- package/docs/WORKS_WITH_CUSTOM_FETCH.md +2 -2
- package/docs/api/README.md +5 -5
- package/docs/api/classes/IdentityError.md +1 -1
- package/docs/api/classes/OwnerClientError.md +1 -1
- package/docs/api/classes/VaultCore.md +176 -16
- 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 +33 -1
- package/docs/api/interfaces/AgentDispatchIntent.md +1 -1
- package/docs/api/interfaces/AgentDispatchTransport.md +33 -1
- package/docs/api/interfaces/AgentIdentity.md +1 -1
- package/docs/api/interfaces/AgentSigner.md +1 -1
- package/docs/api/interfaces/AgentSubmitCapabilityRequestInput.md +9 -9
- 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/{OwnerStoreSecretInput.md → OwnerCreateSecretInput.md} +2 -2
- package/docs/api/interfaces/{VaultDeleteSecretInput.md → OwnerRemoveSecretInput.md} +2 -2
- 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/{OwnerWriteSecretInput.md → OwnerUpdateSecretInput.md} +2 -2
- 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 +112 -48
- 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/VaultGrantCapabilityInput.md +9 -21
- 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 +11 -17
- 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 +27 -9
- package/examples/process-isolation.ts +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,8 +114,8 @@ const tokens = await client.ownerIssueAllSessionTokens();
|
|
|
114
114
|
### 5. Secret Management (Owner)
|
|
115
115
|
|
|
116
116
|
```ts
|
|
117
|
-
//
|
|
118
|
-
const record = await client.
|
|
117
|
+
// Create a secret. Active aliases must stay unique.
|
|
118
|
+
const record = await client.ownerCreateSecret({
|
|
119
119
|
alias: 'api-token',
|
|
120
120
|
plaintext: 'super-secret-value'
|
|
121
121
|
});
|
|
@@ -123,9 +123,12 @@ const record = await client.ownerWriteSecret({
|
|
|
123
123
|
// 4. Grant agent capabilities
|
|
124
124
|
await client.ownerGrantCapability({
|
|
125
125
|
agentId,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
write: {
|
|
127
|
+
secretIds: [record.secretId.value],
|
|
128
|
+
scope: 'https://api.example.com/*',
|
|
129
|
+
methods: ['POST']
|
|
130
|
+
},
|
|
131
|
+
read: { mode: 'full' }
|
|
129
132
|
});
|
|
130
133
|
```
|
|
131
134
|
|
|
@@ -145,37 +148,59 @@ const agent = createAgentClient({
|
|
|
145
148
|
});
|
|
146
149
|
|
|
147
150
|
const result = await agent.agentDispatch({ ... });
|
|
151
|
+
const requests = await agent.agentListRequests();
|
|
152
|
+
const request = await agent.agentGetRequest(result.requestId);
|
|
153
|
+
const ownerView = await client.ownerGetRequest({ requestId: result.requestId });
|
|
148
154
|
```
|
|
149
155
|
|
|
150
156
|
The agent process does not execute directly with its raw private key. If it has an identity key, it still needs to exchange that trust for a session token before dispatching.
|
|
151
157
|
|
|
158
|
+
LLM-facing rule of thumb:
|
|
159
|
+
- `agentDispatch(...)` means "do the task now". It attempts real execution immediately.
|
|
160
|
+
- `agentSubmitCapabilityRequest(...)` means "ask for permission". It never executes the task by itself.
|
|
161
|
+
- `agentListRequests()` / `agentGetRequest(...)` are how the agent checks asynchronous results after execution.
|
|
162
|
+
- `ownerListRequests()` / `ownerGetRequest(...)` are how the owner reviews the full sealed request record before approving read.
|
|
163
|
+
|
|
152
164
|
### 7. Proactive Capability Requests
|
|
153
165
|
|
|
154
|
-
If an LLM or orchestration layer already knows it needs a broader scope, it can create a
|
|
166
|
+
If an LLM or orchestration layer already knows it needs a broader scope, it can create a capability carrier up front instead of discovering one URL at a time through failed dispatch attempts.
|
|
155
167
|
|
|
156
168
|
```ts
|
|
157
169
|
const request = await client.ownerSubmitCapabilityRequest({
|
|
158
170
|
requester: { kind: 'trusted_executor', id: 'llm-planner' },
|
|
159
171
|
agentId,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
172
|
+
write: {
|
|
173
|
+
secretIds: [record.secretId.value],
|
|
174
|
+
scope: 'https://api.example.com/users/*',
|
|
175
|
+
methods: ['GET']
|
|
176
|
+
},
|
|
177
|
+
read: { mode: 'full' },
|
|
163
178
|
justification: 'Need collection-level user read access'
|
|
164
179
|
});
|
|
165
180
|
|
|
166
|
-
const pendingRequests = await client.ownerListCapabilityStates({
|
|
181
|
+
const pendingRequests = await client.ownerListCapabilityStates({ writeStatus: 'PENDING' });
|
|
182
|
+
|
|
183
|
+
await client.ownerApproveCapabilityWrite({
|
|
184
|
+
requestId: pendingRequests[0].requestId
|
|
185
|
+
});
|
|
167
186
|
|
|
168
|
-
await client.
|
|
187
|
+
await client.ownerAllowAlways({
|
|
188
|
+
requestId: pendingRequests[0].requestId
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
await client.ownerApproveCapabilityRead({
|
|
169
192
|
requestId: pendingRequests[0].requestId
|
|
170
193
|
});
|
|
171
194
|
```
|
|
172
195
|
|
|
173
|
-
This uses the same
|
|
174
|
-
- `ownerSubmitCapabilityRequest(...)` creates a
|
|
175
|
-
- `ownerOnCapabilityState(...)` pushes new
|
|
176
|
-
- `
|
|
177
|
-
- `
|
|
178
|
-
- `
|
|
196
|
+
This uses the same carrier model as dispatch discovery:
|
|
197
|
+
- `ownerSubmitCapabilityRequest(...)` creates a capability carrier for owner review.
|
|
198
|
+
- `ownerOnCapabilityState(...)` pushes new carrier changes to the owner UI or controller.
|
|
199
|
+
- `ownerApproveCapabilityWrite(...)` approves the outbound write action first.
|
|
200
|
+
- `ownerAllowAlways(...)` persists the carrier as an active capability. For dispatch discovery it also executes the blocked request; for explicit requests it grants the capability without sending network traffic.
|
|
201
|
+
- `ownerAllowOnce(...)` executes the approved write action once and then deletes the carrier record. This option is only valid for dispatch discovery carriers that already contain a concrete blocked request.
|
|
202
|
+
- `ownerApproveCapabilityRead(...)` approves response release separately on the same carrier record.
|
|
203
|
+
- `ownerDeny(...)` rejects the currently pending action on the carrier.
|
|
179
204
|
|
|
180
205
|
### 8. Zero-Configuration Agent Discovery (v1.56.0+)
|
|
181
206
|
|
|
@@ -187,13 +212,13 @@ const manifest = await agent.agentIntrospect();
|
|
|
187
212
|
console.log(manifest.agent.agentId); // Vault-known agent ID
|
|
188
213
|
console.log(manifest.agent.identityId); // Stable identity ID
|
|
189
214
|
console.log(manifest.agent.nickname); // Optional nickname
|
|
190
|
-
console.log(manifest.capabilities); //
|
|
215
|
+
console.log(manifest.capabilities); // Capability carriers with write/read action states
|
|
191
216
|
console.log(manifest.tools); // List of available API tools with JSON-Schema
|
|
192
217
|
```
|
|
193
218
|
|
|
194
219
|
This manifest can be directly fed into an LLM's system prompt or tool-calling configuration to enable fully autonomous, zero-config integration.
|
|
195
220
|
|
|
196
|
-
`agentListCapabilities()`
|
|
221
|
+
`agentListCapabilities()` returns the same carrier view used by the manifest, and `agentListRequests()` / `agentGetRequest()` expose sealed request history and per-request results through controlled interfaces.
|
|
197
222
|
|
|
198
223
|
---
|
|
199
224
|
|
|
@@ -211,7 +236,7 @@ This manifest can be directly fed into an LLM's system prompt or tool-calling co
|
|
|
211
236
|
|
|
212
237
|
### Human-in-the-Loop (HITL) Workflow
|
|
213
238
|
|
|
214
|
-
|
|
239
|
+
If an agent attempts an action not explicitly in its white-list, the dispatch returns `PENDING` and the runtime records a capability carrier whose `write` action is still pending owner approval:
|
|
215
240
|
|
|
216
241
|
```ts
|
|
217
242
|
// In Agent process
|
|
@@ -222,15 +247,21 @@ if (result.status === 'PENDING') {
|
|
|
222
247
|
|
|
223
248
|
// OR: Use the observer for real-time push
|
|
224
249
|
client.ownerOnCapabilityState((state) => {
|
|
225
|
-
if (state.status === 'PENDING') {
|
|
226
|
-
console.log("New pending capability
|
|
250
|
+
if (state.actions.write.status === 'PENDING') {
|
|
251
|
+
console.log("New pending capability carrier:", state.requestId);
|
|
227
252
|
}
|
|
228
253
|
});
|
|
229
254
|
|
|
230
255
|
// In Owner process (GUI or Script)
|
|
231
|
-
const pending = await client.ownerListCapabilityStates({
|
|
256
|
+
const pending = await client.ownerListCapabilityStates({ writeStatus: 'PENDING' });
|
|
232
257
|
if (pending.length > 0) {
|
|
233
|
-
await client.
|
|
258
|
+
await client.ownerApproveCapabilityWrite({
|
|
259
|
+
requestId: pending[0].requestId
|
|
260
|
+
});
|
|
261
|
+
await client.ownerAllowAlways({
|
|
262
|
+
requestId: pending[0].requestId
|
|
263
|
+
});
|
|
264
|
+
await client.ownerApproveCapabilityRead({
|
|
234
265
|
requestId: pending[0].requestId
|
|
235
266
|
});
|
|
236
267
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { CreatedIdentity } from "../../runtime/identity.js";
|
|
2
2
|
import { type Clock } from "../../vault-core/index.js";
|
|
3
3
|
import type { VaultService } from "../../vault-ingress/index.js";
|
|
4
|
-
import type { AgentCapabilityEnvelope, AgentDispatchIntent, AgentDispatchTransport, AgentSubmitCapabilityRequestInput, AgentVisibleSecretRecord } from "./contracts.js";
|
|
4
|
+
import type { AgentCapabilityEnvelope, AgentDispatchIntent, AgentDispatchTransport, AgentSubmitCapabilityRequestInput, AgentVisibleRequestRecord, AgentVisibleSecretRecord } from "./contracts.js";
|
|
5
5
|
export interface AgentIdentity {
|
|
6
6
|
agentId: string;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* A client for agents to perform authorized operations (e.g., dispatch HTTP requests with secrets).
|
|
10
10
|
* This client uses a delegated capability granted by the owner.
|
|
11
|
+
* Agents can use secrets and request broader access, but they do not directly manage
|
|
12
|
+
* the secret lifecycle inside the vault. Newly obtained credentials are persisted only
|
|
13
|
+
* through owner actions or owner-configured vault flows that explicitly capture them.
|
|
11
14
|
*/
|
|
12
15
|
export interface AgentClient {
|
|
13
16
|
/**
|
|
@@ -29,9 +32,14 @@ export interface AgentClient {
|
|
|
29
32
|
agentDispatch(intent: AgentDispatchIntent): Promise<import("../../vault-core/index.js").DispatchResult>;
|
|
30
33
|
agentListCapabilities(): Promise<readonly import("../../vault-core/index.js").AgentCapabilityState[]>;
|
|
31
34
|
agentListSecrets(): Promise<readonly AgentVisibleSecretRecord[]>;
|
|
35
|
+
agentListRequests(): Promise<readonly AgentVisibleRequestRecord[]>;
|
|
36
|
+
agentGetRequest(requestId: string): Promise<import("../../vault-core/index.js").AgentRequestResult>;
|
|
32
37
|
/**
|
|
33
38
|
* Introspects the current runtime environment, providing identity, capabilities, and a toolbox manifest.
|
|
34
39
|
* Equivalent to '--help' or 'llms.txt' for the agent.
|
|
40
|
+
* This is the primary place where an agent should learn its operational boundary:
|
|
41
|
+
* it can use existing secrets and request more permission, but it cannot directly
|
|
42
|
+
* create, update, or remove secrets in the vault.
|
|
35
43
|
*/
|
|
36
44
|
agentIntrospect(): Promise<import("../../vault-core/index.js").AgentRuntimeManifest>;
|
|
37
45
|
agentSubmitCapabilityRequest(input: AgentSubmitCapabilityRequestInput): Promise<import("../../vault-core/index.js").CapabilityStateRecord>;
|
|
@@ -29,11 +29,10 @@ class DefaultAgentClient {
|
|
|
29
29
|
vaultId: this._capability.vaultId,
|
|
30
30
|
capabilityId: this._capability.capabilityId,
|
|
31
31
|
agentId: this._capability.agentId,
|
|
32
|
-
secretIds: this._capability.secretIds,
|
|
33
|
-
secretAliases: this._capability.secretAliases,
|
|
34
32
|
operation: this._capability.operation,
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
customFlowId: this._capability.customFlowId,
|
|
34
|
+
write: this._capability.write,
|
|
35
|
+
read: this._capability.read,
|
|
37
36
|
issuedAt: this._capability.issuedAt,
|
|
38
37
|
expiresAt: this._capability.expiresAt,
|
|
39
38
|
revocationVersion: this._capability.revocationVersion,
|
|
@@ -94,14 +93,39 @@ class DefaultAgentClient {
|
|
|
94
93
|
proof: await this._createProof(requestId, requestedAt, "get_manifest"),
|
|
95
94
|
});
|
|
96
95
|
}
|
|
96
|
+
async agentListRequests() {
|
|
97
|
+
const requestedAt = this._clock.nowIso();
|
|
98
|
+
const requestId = createRequestIdValue("list_requests");
|
|
99
|
+
return this._transport.agentListRequests({
|
|
100
|
+
vaultId: this._capability.vaultId,
|
|
101
|
+
requestId,
|
|
102
|
+
requestedAt,
|
|
103
|
+
agent: { kind: "agent", id: this._identity.agentId },
|
|
104
|
+
proof: await this._createProof(requestId, requestedAt, "list_requests"),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
async agentGetRequest(targetRequestId) {
|
|
108
|
+
const requestedAt = this._clock.nowIso();
|
|
109
|
+
const requestId = createRequestIdValue("read_request_result");
|
|
110
|
+
return this._transport.agentGetRequest({
|
|
111
|
+
vaultId: this._capability.vaultId,
|
|
112
|
+
requestId,
|
|
113
|
+
requestedAt,
|
|
114
|
+
targetRequestId,
|
|
115
|
+
agent: { kind: "agent", id: this._identity.agentId },
|
|
116
|
+
proof: await this._createProof(requestId, requestedAt, "read_request_result", { targetRequestId }),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
97
119
|
async agentSubmitCapabilityRequest(input) {
|
|
98
120
|
const requestedAt = input.requestedAt ?? this._clock.nowIso();
|
|
99
121
|
const requestId = createRequestIdValue("submit_capability_request");
|
|
100
122
|
const payload = {
|
|
101
|
-
|
|
102
|
-
|
|
123
|
+
write: {
|
|
124
|
+
...input.write,
|
|
125
|
+
secretAliases: input.secretAliases ?? null,
|
|
126
|
+
},
|
|
127
|
+
read: input.read,
|
|
103
128
|
operation: input.operation ?? "dispatch_http",
|
|
104
|
-
secretAliases: input.secretAliases ?? [],
|
|
105
129
|
justification: input.justification ?? null,
|
|
106
130
|
};
|
|
107
131
|
return this._transport.agentSubmitCapabilityRequest({
|
|
@@ -110,12 +134,18 @@ class DefaultAgentClient {
|
|
|
110
134
|
requestedAt,
|
|
111
135
|
agent: { kind: "agent", id: this._identity.agentId },
|
|
112
136
|
proof: await this._createProof(requestId, requestedAt, "submit_capability_request", payload),
|
|
113
|
-
|
|
137
|
+
capability: {
|
|
114
138
|
operation: input.operation ?? "dispatch_http",
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
139
|
+
write: {
|
|
140
|
+
scope: input.write.scope,
|
|
141
|
+
methods: [...input.write.methods],
|
|
142
|
+
},
|
|
143
|
+
read: {
|
|
144
|
+
mode: input.read.mode,
|
|
145
|
+
paths: input.read.paths ? [...input.read.paths] : undefined,
|
|
146
|
+
},
|
|
118
147
|
},
|
|
148
|
+
secretAliases: input.secretAliases ? [...input.secretAliases] : undefined,
|
|
119
149
|
justification: input.justification,
|
|
120
150
|
});
|
|
121
151
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/clients/agent/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAc,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/clients/agent/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAc,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAgEtE,MAAM,kBAAkB;IAEH;IACA;IACA;IACA;IACA;IALnB,YACmB,SAAwB,EACxB,WAAoC,EACpC,UAAkC,EAClC,MAAa,EACb,MAAc;QAJd,cAAS,GA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,CAC5B,OAAiC;IAEjC,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,OAAO,OAAO,CAAC,SAAS,CAAC;IAC3B,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IACjE,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,IAAI,kBAAkB,CAC3B,oBAAoB,CAAC,OAAO,CAAC,EAC7B,OAAO,CAAC,UAAU,EAClB,qBAAqB,CAAC,OAAO,CAAC,EAC9B,OAAO,CAAC,KAAK,IAAI,IAAI,WAAW,EAAE,EAClC,iBAAiB,CAAC,OAAO,CAAC,CAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -9,14 +9,15 @@ export interface AgentDispatchIntent {
|
|
|
9
9
|
export interface AgentSubmitCapabilityRequestInput {
|
|
10
10
|
operation?: "dispatch_http" | "custom_http";
|
|
11
11
|
secretAliases?: readonly string[];
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
write: Omit<import("../../vault-core/index.js").CapabilityWritePolicy, "secretIds">;
|
|
13
|
+
read: import("../../vault-core/index.js").CapabilityReadPolicy;
|
|
14
14
|
justification?: string;
|
|
15
15
|
requestedAt?: string;
|
|
16
16
|
}
|
|
17
17
|
export type AgentCapabilityEnvelope = import("../../vault-core/index.js").AgentCapability;
|
|
18
18
|
export type AgentCapabilityState = import("../../vault-core/index.js").AgentCapabilityState;
|
|
19
19
|
export type AgentVisibleSecretRecord = import("../../vault-core/index.js").AgentVisibleSecretRecord;
|
|
20
|
+
export type AgentVisibleRequestRecord = import("../../vault-core/index.js").AgentVisibleRequestRecord;
|
|
20
21
|
export interface AgentSigner {
|
|
21
22
|
sign(input: string): Promise<string>;
|
|
22
23
|
}
|
|
@@ -24,6 +25,8 @@ export interface AgentDispatchTransport {
|
|
|
24
25
|
agentDispatch(request: import("../../vault-core/index.js").DispatchRequest): Promise<import("../../vault-core/index.js").DispatchResult>;
|
|
25
26
|
agentListCapabilities(request: import("../../vault-core/index.js").AgentListCapabilitiesRequest): Promise<readonly AgentCapabilityState[]>;
|
|
26
27
|
agentListSecrets(request: import("../../vault-core/index.js").AgentListSecretsRequest): Promise<readonly AgentVisibleSecretRecord[]>;
|
|
28
|
+
agentListRequests(request: import("../../vault-core/index.js").AgentListRequestsRequest): Promise<readonly AgentVisibleRequestRecord[]>;
|
|
29
|
+
agentGetRequest(request: import("../../vault-core/index.js").AgentGetRequestRequest): Promise<import("../../vault-core/index.js").AgentRequestResult>;
|
|
27
30
|
agentGetRuntimeManifest(request: import("../../vault-core/index.js").AgentGetRuntimeManifestRequest): Promise<import("../../vault-core/index.js").AgentRuntimeManifest>;
|
|
28
31
|
agentSubmitCapabilityRequest(request: import("../../vault-core/index.js").AgentSubmitCapabilityRequestCommand): Promise<import("../../vault-core/index.js").CapabilityStateRecord>;
|
|
29
32
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CreatedIdentity } from "../../runtime/identity.js";
|
|
2
2
|
import { type Clock } from "../../vault-core/index.js";
|
|
3
3
|
import type { VaultService } from "../../vault-ingress/index.js";
|
|
4
|
-
import type { VaultAuditQueryInput, VaultExportSecretInput, VaultReadSecretPlaintextInput, VaultReadAgentPrivateKeyInput, OwnerGrantCapabilityInput, VaultRegisterFlowInput, VaultImportAgentInput, VaultCreateAgentInput, OwnerAgentProvisionResult,
|
|
4
|
+
import type { VaultAuditQueryInput, VaultExportSecretInput, VaultReadSecretPlaintextInput, VaultReadAgentPrivateKeyInput, OwnerGrantCapabilityInput, VaultRegisterFlowInput, VaultImportAgentInput, VaultCreateAgentInput, OwnerAgentProvisionResult, OwnerCreateSecretInput, OwnerUpdateSecretInput, OwnerRemoveSecretInput, VaultUpdateAgentInput, VaultListAgentsInput, VaultListCapabilitiesInput, VaultListRequestsInput, VaultGetRequestInput, VaultListCapabilityStatesInput, VaultListSecretsInput, VaultRevokeCapabilityInput, VaultIssueSessionTokenInput, VaultRevokeSessionTokenInput, VaultSubmitCapabilityRequestInput, VaultApproveCapabilityRequestInput, OwnerSensitiveActionConfirmation, OwnerSensitiveActionContext } from "./contracts.js";
|
|
5
5
|
export interface VaultIdentity {
|
|
6
6
|
identityId: string;
|
|
7
7
|
}
|
|
@@ -14,13 +14,13 @@ export interface VaultSigner {
|
|
|
14
14
|
*/
|
|
15
15
|
export interface VaultClient {
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Inserts a new active secret into the vault.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
ownerCreateSecret(input: OwnerCreateSecretInput): Promise<import("../../vault-core/index.js").SecretRecord>;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Inserts a new successor secret and marks the previous active version as superseded.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
ownerUpdateSecret(input: OwnerUpdateSecretInput): Promise<import("../../vault-core/index.js").SecretRecord>;
|
|
24
24
|
/**
|
|
25
25
|
* Exports a secret's plaintext.
|
|
26
26
|
*/
|
|
@@ -43,13 +43,13 @@ export interface VaultClient {
|
|
|
43
43
|
ownerCreateAgent(input: VaultCreateAgentInput): Promise<OwnerAgentProvisionResult>;
|
|
44
44
|
ownerUpdateAgent(input: VaultUpdateAgentInput): Promise<import("../../vault-core/index.js").AgentIdentityRecord>;
|
|
45
45
|
/**
|
|
46
|
-
* Registers a
|
|
46
|
+
* Registers a reusable HTTP request template for complex secret exchange patterns.
|
|
47
47
|
*/
|
|
48
48
|
ownerRegisterFlow(input: VaultRegisterFlowInput): Promise<import("../../vault-core/index.js").CustomHttpFlowDefinition>;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Logically removes the current active secret.
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
ownerRemoveSecret(input: OwnerRemoveSecretInput): Promise<void>;
|
|
53
53
|
/**
|
|
54
54
|
* Lists all agents registered in the vault.
|
|
55
55
|
*/
|
|
@@ -58,6 +58,8 @@ export interface VaultClient {
|
|
|
58
58
|
* Lists all active capabilities granted to agents.
|
|
59
59
|
*/
|
|
60
60
|
ownerListCapabilities(input?: VaultListCapabilitiesInput): Promise<readonly import("../../vault-core/index.js").AgentCapability[]>;
|
|
61
|
+
ownerListRequests(input?: VaultListRequestsInput): Promise<readonly import("../../vault-core/index.js").OwnerVisibleRequestRecord[]>;
|
|
62
|
+
ownerGetRequest(input: VaultGetRequestInput): Promise<import("../../vault-core/index.js").OwnerRequestRecord>;
|
|
61
63
|
ownerListCapabilityStates(input?: VaultListCapabilityStatesInput): Promise<readonly import("../../vault-core/index.js").CapabilityStateRecord[]>;
|
|
62
64
|
ownerListSecrets(input?: VaultListSecretsInput): Promise<readonly import("../../vault-core/index.js").AgentVisibleSecretRecord[]>;
|
|
63
65
|
/**
|
|
@@ -68,9 +70,11 @@ export interface VaultClient {
|
|
|
68
70
|
ownerIssueAllSessionTokens(): Promise<readonly import("../../vault-core/index.js").OwnerSessionToken[]>;
|
|
69
71
|
ownerRevokeSessionToken(input: VaultRevokeSessionTokenInput): Promise<void>;
|
|
70
72
|
ownerSubmitCapabilityRequest(input: VaultSubmitCapabilityRequestInput): Promise<import("../../vault-core/index.js").CapabilityStateRecord>;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
ownerApproveCapabilityWrite(input: VaultApproveCapabilityRequestInput): Promise<import("../../vault-core/index.js").CapabilityStateRecord>;
|
|
74
|
+
ownerApproveCapabilityRead(input: VaultApproveCapabilityRequestInput): Promise<import("../../vault-core/index.js").CapabilityStateRecord>;
|
|
75
|
+
ownerAllowOnce(input: VaultApproveCapabilityRequestInput): Promise<import("../../vault-core/index.js").DispatchResult>;
|
|
76
|
+
ownerAllowAlways(input: VaultApproveCapabilityRequestInput): Promise<import("../../vault-core/index.js").DispatchResult>;
|
|
77
|
+
ownerDeny(requestId: string): Promise<import("../../vault-core/index.js").CapabilityStateRecord>;
|
|
74
78
|
ownerOnCapabilityState(callback: (record: import("../../vault-core/index.js").CapabilityStateRecord) => void): () => void;
|
|
75
79
|
}
|
|
76
80
|
export interface CreateVaultClientOptions {
|
|
@@ -55,11 +55,9 @@ class DefaultVaultClient {
|
|
|
55
55
|
capabilityId: input.capability.capabilityId,
|
|
56
56
|
agentId: input.capability.agentId,
|
|
57
57
|
operation: input.capability.operation,
|
|
58
|
-
secretAliases: input.capability.secretAliases,
|
|
59
|
-
secretIds: input.capability.secretIds,
|
|
60
58
|
customFlowId: input.capability.customFlowId,
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
write: input.capability.write,
|
|
60
|
+
read: input.capability.read,
|
|
63
61
|
issuedAt: input.capability.issuedAt,
|
|
64
62
|
expiresAt: input.capability.expiresAt,
|
|
65
63
|
rateLimit: input.capability.rateLimit,
|
|
@@ -73,11 +71,11 @@ class DefaultVaultClient {
|
|
|
73
71
|
capability: input,
|
|
74
72
|
};
|
|
75
73
|
}
|
|
76
|
-
async
|
|
74
|
+
async ownerCreateSecret(input) {
|
|
77
75
|
const requestedAt = input.requestedAt ?? this._clock.nowIso();
|
|
78
|
-
const requestId = createRequestIdValue("
|
|
79
|
-
return this._vault.
|
|
80
|
-
kind: "owner.
|
|
76
|
+
const requestId = createRequestIdValue("create_secret");
|
|
77
|
+
return this._vault.ownerCreateSecret({
|
|
78
|
+
kind: "owner.create_secret",
|
|
81
79
|
vaultId: this._vault.vaultId,
|
|
82
80
|
requestId,
|
|
83
81
|
owner: {
|
|
@@ -90,11 +88,11 @@ class DefaultVaultClient {
|
|
|
90
88
|
requestedAt,
|
|
91
89
|
});
|
|
92
90
|
}
|
|
93
|
-
async
|
|
91
|
+
async ownerUpdateSecret(input) {
|
|
94
92
|
const requestedAt = input.requestedAt ?? this._clock.nowIso();
|
|
95
|
-
const requestId = createRequestIdValue("
|
|
96
|
-
return this._vault.
|
|
97
|
-
kind: "owner.
|
|
93
|
+
const requestId = createRequestIdValue("update_secret");
|
|
94
|
+
return this._vault.ownerUpdateSecret({
|
|
95
|
+
kind: "owner.update_secret",
|
|
98
96
|
vaultId: this._vault.vaultId,
|
|
99
97
|
requestId,
|
|
100
98
|
owner: {
|
|
@@ -288,11 +286,16 @@ class DefaultVaultClient {
|
|
|
288
286
|
agentId: normalized.capability.agentId,
|
|
289
287
|
capabilityId,
|
|
290
288
|
operation: normalized.capability.operation ?? "dispatch_http",
|
|
291
|
-
secretAliases: normalized.capability.secretAliases ? [...normalized.capability.secretAliases] : undefined,
|
|
292
|
-
secretIds: normalized.capability.secretIds ? [...normalized.capability.secretIds] : undefined,
|
|
293
289
|
customFlowId: normalized.capability.customFlowId,
|
|
294
|
-
|
|
295
|
-
|
|
290
|
+
write: {
|
|
291
|
+
secretIds: normalized.capability.write.secretIds ? [...normalized.capability.write.secretIds] : undefined,
|
|
292
|
+
scope: normalized.capability.write.scope,
|
|
293
|
+
methods: [...normalized.capability.write.methods],
|
|
294
|
+
},
|
|
295
|
+
read: {
|
|
296
|
+
mode: normalized.capability.read.mode,
|
|
297
|
+
paths: normalized.capability.read.paths ? [...normalized.capability.read.paths] : undefined,
|
|
298
|
+
},
|
|
296
299
|
expiresAt: normalized.capability.expiresAt,
|
|
297
300
|
rateLimit: normalized.capability.rateLimit,
|
|
298
301
|
skipAudit,
|
|
@@ -344,7 +347,7 @@ class DefaultVaultClient {
|
|
|
344
347
|
createdAt: requestedAt,
|
|
345
348
|
};
|
|
346
349
|
}
|
|
347
|
-
async
|
|
350
|
+
async ownerRemoveSecret(input) {
|
|
348
351
|
await this._confirmSensitiveAction({
|
|
349
352
|
password: input.password,
|
|
350
353
|
verificationCode: input.verificationCode,
|
|
@@ -353,8 +356,9 @@ class DefaultVaultClient {
|
|
|
353
356
|
subject: input.alias,
|
|
354
357
|
});
|
|
355
358
|
const requestedAt = input.requestedAt ?? this._clock.nowIso();
|
|
356
|
-
const requestId = createRequestIdValue("
|
|
357
|
-
await this._vault.
|
|
359
|
+
const requestId = createRequestIdValue("remove_secret");
|
|
360
|
+
await this._vault.ownerRemoveSecret({
|
|
361
|
+
kind: "owner.remove_secret",
|
|
358
362
|
vaultId: this._vault.vaultId,
|
|
359
363
|
requestId,
|
|
360
364
|
owner: {
|
|
@@ -396,12 +400,41 @@ class DefaultVaultClient {
|
|
|
396
400
|
agentId: input.agentId,
|
|
397
401
|
});
|
|
398
402
|
}
|
|
403
|
+
async ownerListRequests(input = {}) {
|
|
404
|
+
const requestedAt = input.requestedAt ?? this._clock.nowIso();
|
|
405
|
+
const requestId = createRequestIdValue("list_requests");
|
|
406
|
+
return this._vault.ownerListRequests({
|
|
407
|
+
vaultId: this._vault.vaultId,
|
|
408
|
+
requestId,
|
|
409
|
+
requestedAt,
|
|
410
|
+
actor: {
|
|
411
|
+
kind: "owner",
|
|
412
|
+
id: this._identityId,
|
|
413
|
+
},
|
|
414
|
+
agentId: input.agentId,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
async ownerGetRequest(input) {
|
|
418
|
+
const requestedAt = input.requestedAt ?? this._clock.nowIso();
|
|
419
|
+
const requestId = createRequestIdValue("get_request");
|
|
420
|
+
return this._vault.ownerGetRequest({
|
|
421
|
+
vaultId: this._vault.vaultId,
|
|
422
|
+
requestId,
|
|
423
|
+
requestedAt,
|
|
424
|
+
actor: {
|
|
425
|
+
kind: "owner",
|
|
426
|
+
id: this._identityId,
|
|
427
|
+
},
|
|
428
|
+
targetRequestId: input.requestId,
|
|
429
|
+
});
|
|
430
|
+
}
|
|
399
431
|
async ownerListCapabilityStates(input = {}) {
|
|
400
432
|
return this._vault.ownerListCapabilityStates({
|
|
401
433
|
vaultId: this._vault.vaultId,
|
|
402
434
|
owner: { kind: "owner", id: this._identityId },
|
|
403
435
|
agentId: input.agentId,
|
|
404
|
-
|
|
436
|
+
writeStatus: input.writeStatus,
|
|
437
|
+
readStatus: input.readStatus,
|
|
405
438
|
});
|
|
406
439
|
}
|
|
407
440
|
async ownerListSecrets(input = {}) {
|
|
@@ -463,11 +496,17 @@ class DefaultVaultClient {
|
|
|
463
496
|
requestId,
|
|
464
497
|
requester: input.requester,
|
|
465
498
|
agentId: input.agentId,
|
|
466
|
-
|
|
499
|
+
capability: {
|
|
467
500
|
operation: input.operation ?? "dispatch_http",
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
501
|
+
write: {
|
|
502
|
+
secretIds: input.write.secretIds ? [...input.write.secretIds] : undefined,
|
|
503
|
+
scope: input.write.scope,
|
|
504
|
+
methods: [...input.write.methods],
|
|
505
|
+
},
|
|
506
|
+
read: {
|
|
507
|
+
mode: input.read.mode,
|
|
508
|
+
paths: input.read.paths ? [...input.read.paths] : undefined,
|
|
509
|
+
},
|
|
471
510
|
rateLimit: input.rateLimit,
|
|
472
511
|
skipAudit: input.skipAudit,
|
|
473
512
|
expiresAt: input.expiresAt,
|
|
@@ -482,22 +521,36 @@ class DefaultVaultClient {
|
|
|
482
521
|
actor: { kind: "owner", id: this._identityId },
|
|
483
522
|
});
|
|
484
523
|
}
|
|
485
|
-
async
|
|
486
|
-
return this._vault.
|
|
524
|
+
async ownerApproveCapabilityWrite(input) {
|
|
525
|
+
return this._vault.ownerApproveCapabilityWrite({
|
|
526
|
+
vaultId: this._vault.vaultId,
|
|
527
|
+
requestId: input.requestId,
|
|
528
|
+
owner: { kind: "owner", id: this._identityId },
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
async ownerApproveCapabilityRead(input) {
|
|
532
|
+
return this._vault.ownerApproveCapabilityRead({
|
|
533
|
+
vaultId: this._vault.vaultId,
|
|
534
|
+
requestId: input.requestId,
|
|
535
|
+
owner: { kind: "owner", id: this._identityId },
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
async ownerAllowOnce(input) {
|
|
539
|
+
return this._vault.ownerAllowOnce({
|
|
487
540
|
vaultId: this._vault.vaultId,
|
|
488
541
|
requestId: input.requestId,
|
|
489
542
|
owner: { kind: "owner", id: this._identityId },
|
|
490
543
|
});
|
|
491
544
|
}
|
|
492
|
-
async
|
|
493
|
-
return this._vault.
|
|
545
|
+
async ownerAllowAlways(input) {
|
|
546
|
+
return this._vault.ownerAllowAlways({
|
|
494
547
|
vaultId: this._vault.vaultId,
|
|
495
548
|
requestId: input.requestId,
|
|
496
549
|
owner: { kind: "owner", id: this._identityId },
|
|
497
550
|
});
|
|
498
551
|
}
|
|
499
|
-
async
|
|
500
|
-
return this._vault.
|
|
552
|
+
async ownerDeny(requestId) {
|
|
553
|
+
return this._vault.ownerDeny({
|
|
501
554
|
vaultId: this._vault.vaultId,
|
|
502
555
|
requestId,
|
|
503
556
|
owner: { kind: "owner", id: this._identityId },
|