@the-ai-company/cbio-node-runtime 1.72.0 → 1.73.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.
Files changed (179) hide show
  1. package/README.md +20 -35
  2. package/dist/clients/agent/client.d.ts +3 -6
  3. package/dist/clients/agent/client.js +15 -11
  4. package/dist/clients/agent/client.js.map +1 -1
  5. package/dist/clients/agent/contracts.d.ts +4 -4
  6. package/dist/clients/agent/index.d.ts +1 -1
  7. package/dist/clients/owner/client.js +8 -8
  8. package/dist/clients/owner/client.js.map +1 -1
  9. package/dist/clients/owner/contracts.d.ts +2 -2
  10. package/dist/public-types.d.ts +2 -2
  11. package/dist/public-types.js +1 -1
  12. package/dist/public-types.js.map +1 -1
  13. package/dist/runtime/bootstrap.js +22 -12
  14. package/dist/runtime/bootstrap.js.map +1 -1
  15. package/dist/runtime/index.d.ts +2 -2
  16. package/dist/runtime/index.js +1 -1
  17. package/dist/runtime/index.js.map +1 -1
  18. package/dist/storage/prefix.d.ts +1 -1
  19. package/dist/storage/prefix.js +2 -2
  20. package/dist/storage/prefix.js.map +1 -1
  21. package/dist/vault-core/contracts.d.ts +20 -142
  22. package/dist/vault-core/contracts.js +0 -20
  23. package/dist/vault-core/contracts.js.map +1 -1
  24. package/dist/vault-core/core.d.ts +8 -9
  25. package/dist/vault-core/core.js +69 -225
  26. package/dist/vault-core/core.js.map +1 -1
  27. package/dist/vault-core/defaults.d.ts +2 -4
  28. package/dist/vault-core/defaults.js +50 -47
  29. package/dist/vault-core/defaults.js.map +1 -1
  30. package/dist/vault-core/index.d.ts +2 -2
  31. package/dist/vault-core/index.js +1 -1
  32. package/dist/vault-core/index.js.map +1 -1
  33. package/dist/vault-core/persistence.d.ts +2 -4
  34. package/dist/vault-core/persistence.js +82 -55
  35. package/dist/vault-core/persistence.js.map +1 -1
  36. package/dist/vault-core/ports.d.ts +2 -4
  37. package/dist/vault-ingress/defaults.d.ts +2 -2
  38. package/dist/vault-ingress/defaults.js +3 -3
  39. package/dist/vault-ingress/defaults.js.map +1 -1
  40. package/dist/vault-ingress/index.d.ts +5 -5
  41. package/dist/vault-ingress/index.js +17 -29
  42. package/dist/vault-ingress/index.js.map +1 -1
  43. package/dist/vault-ingress/remote-transport.d.ts +2 -2
  44. package/dist/vault-ingress/remote-transport.js +7 -7
  45. package/dist/vault-ingress/remote-transport.js.map +1 -1
  46. package/dist/vault-ingress/server-utils.d.ts +1 -2
  47. package/dist/vault-ingress/server-utils.js +1 -1
  48. package/dist/vault-ingress/server-utils.js.map +1 -1
  49. package/docs/ARCHITECTURE.md +16 -14
  50. package/docs/REFERENCE.md +20 -37
  51. package/docs/api/README.md +5 -9
  52. package/docs/api/classes/IdentityError.md +1 -1
  53. package/docs/api/classes/OwnerClientError.md +1 -1
  54. package/docs/api/classes/PersistentVaultAgentIdentityRegistry.md +3 -3
  55. package/docs/api/classes/PersistentVaultAgentSecretGrantRegistry.md +6 -6
  56. package/docs/api/classes/PersistentVaultAuditLog.md +2 -2
  57. package/docs/api/classes/PersistentVaultSecretCustody.md +4 -4
  58. package/docs/api/classes/PersistentVaultSecretDestinationGrantRegistry.md +7 -7
  59. package/docs/api/classes/PersistentVaultSecretRepository.md +4 -6
  60. package/docs/api/classes/VaultCore.md +21 -21
  61. package/docs/api/classes/VaultCoreError.md +1 -1
  62. package/docs/api/enumerations/DispatchStatus.md +1 -1
  63. package/docs/api/enumerations/IdentityErrorCode.md +1 -1
  64. package/docs/api/enumerations/OwnerClientErrorCode.md +1 -1
  65. package/docs/api/functions/createAgentClient.md +1 -3
  66. package/docs/api/functions/createIdentity.md +1 -1
  67. package/docs/api/functions/createOwnerClient.md +1 -1
  68. package/docs/api/functions/createPersistentVaultCoreDependencies.md +1 -1
  69. package/docs/api/functions/createVault.md +1 -1
  70. package/docs/api/functions/createVaultCore.md +1 -1
  71. package/docs/api/functions/createVaultCoreDependencies.md +1 -1
  72. package/docs/api/functions/createVaultService.md +1 -1
  73. package/docs/api/functions/createWorkspaceStorage.md +1 -1
  74. package/docs/api/functions/deriveRootAgentId.md +1 -1
  75. package/docs/api/functions/deriveVaultWorkingKeyFromPassword.md +1 -1
  76. package/docs/api/functions/getDefaultWorkspaceDir.md +1 -1
  77. package/docs/api/functions/handleVaultAgentControlHttp.md +1 -1
  78. package/docs/api/functions/handleVaultAuditSse.md +1 -1
  79. package/docs/api/functions/handleVaultHttpDispatch.md +1 -1
  80. package/docs/api/functions/handleVaultPendingDispatchSse.md +1 -1
  81. package/docs/api/functions/initializeVaultCustody.md +1 -1
  82. package/docs/api/functions/listVaults.md +1 -1
  83. package/docs/api/functions/openOwnerSession.md +1 -1
  84. package/docs/api/functions/readVaultProfile.md +1 -1
  85. package/docs/api/functions/recoverVault.md +1 -1
  86. package/docs/api/functions/recoverVaultWorkingKey.md +1 -1
  87. package/docs/api/functions/restoreIdentity.md +1 -1
  88. package/docs/api/functions/updateVaultMetadata.md +1 -1
  89. package/docs/api/functions/writeVaultProfile.md +1 -1
  90. package/docs/api/interfaces/AgentClient.md +5 -5
  91. package/docs/api/interfaces/AgentDispatchIntent.md +1 -1
  92. package/docs/api/interfaces/AgentDispatchTransport.md +5 -5
  93. package/docs/api/interfaces/AgentIdentity.md +1 -1
  94. package/docs/api/interfaces/AgentIdentityRecord.md +2 -2
  95. package/docs/api/interfaces/AgentRequestRecord.md +93 -11
  96. package/docs/api/interfaces/AgentRuntimeManifest.md +1 -1
  97. package/docs/api/interfaces/AgentSecretGrant.md +3 -3
  98. package/docs/api/interfaces/AgentSigner.md +1 -1
  99. package/docs/api/interfaces/AuditEntry.md +9 -59
  100. package/docs/api/interfaces/CbioRuntime.md +1 -3
  101. package/docs/api/interfaces/CreateAgentClientOptions.md +1 -1
  102. package/docs/api/interfaces/CreateIdentityOptions.md +1 -1
  103. package/docs/api/interfaces/CreateOwnerClientOptions.md +1 -1
  104. package/docs/api/interfaces/CreatePersistentVaultCoreDependenciesOptions.md +1 -1
  105. package/docs/api/interfaces/CreateVaultOptions.md +1 -1
  106. package/docs/api/interfaces/CreatedVault.md +1 -1
  107. package/docs/api/interfaces/DefaultPolicyEngineOptions.md +1 -1
  108. package/docs/api/interfaces/DispatchAuthorization.md +3 -3
  109. package/docs/api/interfaces/DispatchInstruction.md +3 -3
  110. package/docs/api/interfaces/DispatchRequest.md +4 -4
  111. package/docs/api/interfaces/DispatchResult.md +2 -2
  112. package/docs/api/interfaces/IStorageProvider.md +1 -1
  113. package/docs/api/interfaces/InitializeVaultCustodyOptions.md +1 -1
  114. package/docs/api/interfaces/InitializedVaultCustody.md +1 -1
  115. package/docs/api/interfaces/OpenOwnerSessionOptions.md +1 -1
  116. package/docs/api/interfaces/OwnerAgentProvisionResult.md +1 -1
  117. package/docs/api/interfaces/OwnerAuditSubscription.md +3 -3
  118. package/docs/api/interfaces/OwnerClient.md +5 -5
  119. package/docs/api/interfaces/OwnerCreateSecretInput.md +1 -1
  120. package/docs/api/interfaces/OwnerPendingDispatchSubscription.md +1 -1
  121. package/docs/api/interfaces/OwnerRemoveSecretInput.md +1 -1
  122. package/docs/api/interfaces/OwnerRequestRecord.md +73 -11
  123. package/docs/api/interfaces/OwnerSensitiveActionConfirmation.md +1 -1
  124. package/docs/api/interfaces/OwnerSensitiveActionContext.md +1 -1
  125. package/docs/api/interfaces/OwnerSession.md +1 -1
  126. package/docs/api/interfaces/OwnerUpdateSecretInput.md +1 -1
  127. package/docs/api/interfaces/PendingDispatchEvent.md +1 -1
  128. package/docs/api/interfaces/RecoverVaultOptions.md +1 -1
  129. package/docs/api/interfaces/RecoveredVault.md +1 -1
  130. package/docs/api/interfaces/RequestRecord.md +8 -7
  131. package/docs/api/interfaces/RestoreIdentityOptions.md +1 -1
  132. package/docs/api/interfaces/SecretDestinationGrant.md +3 -3
  133. package/docs/api/interfaces/SecretRecord.md +7 -7
  134. package/docs/api/interfaces/Signer.md +1 -1
  135. package/docs/api/interfaces/VaultApproveDispatchInput.md +1 -1
  136. package/docs/api/interfaces/VaultAuditQueryInput.md +1 -1
  137. package/docs/api/interfaces/VaultCoreDependenciesOptions.md +1 -1
  138. package/docs/api/interfaces/VaultCreateAgentInput.md +1 -1
  139. package/docs/api/interfaces/VaultExportSecretInput.md +1 -1
  140. package/docs/api/interfaces/VaultGetRequestInput.md +1 -1
  141. package/docs/api/interfaces/VaultGrantAgentSecretInput.md +1 -1
  142. package/docs/api/interfaces/VaultGrantSecretDestinationInput.md +1 -1
  143. package/docs/api/interfaces/VaultImportAgentInput.md +1 -1
  144. package/docs/api/interfaces/VaultIssueSessionTokenInput.md +1 -1
  145. package/docs/api/interfaces/VaultListAgentsInput.md +1 -1
  146. package/docs/api/interfaces/VaultListGrantsInput.md +1 -1
  147. package/docs/api/interfaces/VaultListRequestsInput.md +1 -1
  148. package/docs/api/interfaces/VaultListSecretsInput.md +1 -1
  149. package/docs/api/interfaces/VaultMetadata.md +1 -1
  150. package/docs/api/interfaces/VaultObject.md +1 -1
  151. package/docs/api/interfaces/VaultPrincipal.md +1 -1
  152. package/docs/api/interfaces/VaultProfile.md +1 -1
  153. package/docs/api/interfaces/VaultReadAgentPrivateKeyInput.md +1 -1
  154. package/docs/api/interfaces/VaultReadSecretPlaintextInput.md +1 -1
  155. package/docs/api/interfaces/VaultRevokeAgentSecretInput.md +1 -1
  156. package/docs/api/interfaces/VaultRevokeSecretDestinationInput.md +1 -1
  157. package/docs/api/interfaces/VaultRevokeSessionTokenInput.md +1 -1
  158. package/docs/api/interfaces/VaultService.md +12 -12
  159. package/docs/api/interfaces/VaultUpdateAgentInput.md +1 -1
  160. package/docs/api/type-aliases/AgentId.md +1 -1
  161. package/docs/api/type-aliases/AgentRequestResult.md +1 -1
  162. package/docs/api/type-aliases/CbioRuntimeModule.md +1 -1
  163. package/docs/api/type-aliases/DispatchApprovalDecision.md +1 -1
  164. package/docs/api/type-aliases/GrantStatus.md +1 -1
  165. package/docs/api/type-aliases/SecretAlias.md +7 -0
  166. package/docs/api/type-aliases/SecretId.md +7 -0
  167. package/docs/api/type-aliases/SecretLifecycleStatus.md +1 -1
  168. package/docs/api/type-aliases/VaultId.md +7 -0
  169. package/docs/api/type-aliases/VaultPrincipalKind.md +1 -1
  170. package/docs/api/variables/DEFAULT_VAULT_KEY_CUSTODY_BLOB_KEY.md +1 -1
  171. package/docs/zh/README.md +33 -66
  172. package/package.json +1 -1
  173. package/docs/api/enumerations/AuditOperation.md +0 -107
  174. package/docs/api/interfaces/AgentVisibleRequestRecord.md +0 -59
  175. package/docs/api/interfaces/AgentVisibleSecretRecord.md +0 -65
  176. package/docs/api/interfaces/OwnerVisibleRequestRecord.md +0 -79
  177. package/docs/api/interfaces/SecretAlias.md +0 -11
  178. package/docs/api/interfaces/SecretId.md +0 -11
  179. package/docs/api/interfaces/VaultId.md +0 -11
@@ -10,10 +10,10 @@ export class PrefixStorageProvider {
10
10
  this.prefix = prefix;
11
11
  }
12
12
  getBaseDir() {
13
- if (this.base.getBaseDir) {
13
+ if (typeof this.base.getBaseDir === 'function') {
14
14
  return path.join(this.base.getBaseDir(), this.prefix);
15
15
  }
16
- return this.prefix;
16
+ return undefined; // Trigger falsy check in bootstrap
17
17
  }
18
18
  key(key) {
19
19
  return joinPrefix(this.prefix, key);
@@ -1 +1 @@
1
- {"version":3,"file":"prefix.js","sourceRoot":"","sources":["../../src/storage/prefix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,SAAS,UAAU,CAAC,MAAc,EAAE,GAAW;IAC7C,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AAC3C,CAAC;AAED,MAAM,OAAO,qBAAqB;IAEb;IACA;IAFnB,YACmB,IAAsB,EACtB,MAAc;QADd,SAAI,GAAJ,IAAI,CAAkB;QACtB,WAAM,GAAN,MAAM,CAAQ;IAC9B,CAAC;IAEJ,UAAU;QACR,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACz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AO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAE,OAAe,EAAE,KAAa;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,QAAQ,CAAK,GAAW,EAAE,IAAsB;QAC9C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACxB,OAAO,IAAI,EAAE,CAAC;QAChB,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;CACF;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAsB,EAAE,MAAc;IAC1E,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC"}
@@ -4,24 +4,17 @@ export interface VaultPrincipal {
4
4
  kind: VaultPrincipalKind;
5
5
  id: string;
6
6
  }
7
- export interface VaultId {
8
- readonly value: string;
9
- }
10
- export interface SecretId {
11
- readonly value: string;
12
- }
13
- export interface SecretAlias {
14
- readonly value: string;
15
- }
16
- export interface SecretVersion {
17
- readonly value: string;
18
- }
7
+ export type VaultId = string;
8
+ export type SecretId = string;
9
+ export type SecretAlias = string;
10
+ export type SecretVersion = string;
11
+ export type SecretIdPreference = string;
19
12
  export type SecretLifecycleStatus = "ACTIVE" | "SUPERSEDED" | "REMOVED";
20
13
  export interface SecretRecord {
21
14
  vault_id: VaultId;
22
15
  secret_id: SecretId;
23
16
  alias: SecretAlias;
24
- version: SecretVersion;
17
+ version: string;
25
18
  lifecycle_status: SecretLifecycleStatus;
26
19
  previousSecretId?: SecretId;
27
20
  supersededBySecretId?: SecretId;
@@ -164,18 +157,6 @@ export interface AgentProof {
164
157
  signature?: string;
165
158
  token?: string;
166
159
  }
167
- export interface AgentVisibleSecretRecord {
168
- vault_id: VaultId;
169
- secret_id: SecretId;
170
- alias: SecretAlias;
171
- version: SecretVersion;
172
- lifecycle_status: SecretLifecycleStatus;
173
- issuer_id: string | null;
174
- source: SecretSource;
175
- created_at: string;
176
- updated_at: string;
177
- granted: boolean;
178
- }
179
160
  export interface AgentGetRuntimeManifestRequest {
180
161
  vault_id: VaultId;
181
162
  request_id: string;
@@ -201,7 +182,7 @@ export interface AgentSelfContext {
201
182
  }
202
183
  export interface AgentRuntimeManifest {
203
184
  root_agent_id: string;
204
- vault_id: string;
185
+ vault_id: VaultId;
205
186
  vault_nickname?: string;
206
187
  issued_at: string;
207
188
  agent: AgentSelfContext;
@@ -223,7 +204,6 @@ export interface RequestRecord {
223
204
  method: string;
224
205
  headers?: Record<string, string>;
225
206
  body?: string;
226
- secret_alias?: string;
227
207
  secret_id: SecretId | null;
228
208
  };
229
209
  response?: {
@@ -253,81 +233,9 @@ export interface OwnerPendingDispatchSubscription {
253
233
  afterEventId?: string;
254
234
  onEvent(event: PendingDispatchEvent): void;
255
235
  }
256
- export interface AgentVisibleRequestRecord {
257
- request_id: string;
258
- created_at: string;
259
- reason: string;
260
- target_url: string;
261
- execution_status: DispatchStatus;
262
- response_status?: number;
263
- error?: string;
264
- has_response_body: boolean;
265
- secret_id?: SecretId;
236
+ export interface OwnerRequestRecord extends RequestRecord {
266
237
  }
267
- export interface OwnerVisibleRequestRecord {
268
- request_id: string;
269
- created_at: string;
270
- root_agent_id: string;
271
- reason: string;
272
- target_url: string;
273
- execution_status: DispatchStatus;
274
- response_status?: number;
275
- error?: string;
276
- has_response_body: boolean;
277
- missing_grants?: {
278
- agent_secret?: boolean;
279
- secret_destination?: boolean;
280
- };
281
- secret_id?: SecretId;
282
- }
283
- export interface OwnerRequestRecord {
284
- request_id: string;
285
- created_at: string;
286
- requested_at: string;
287
- root_agent_id: string;
288
- reason: string;
289
- request: {
290
- target_url: string;
291
- method: string;
292
- headers?: Record<string, string>;
293
- body?: string;
294
- secret_alias?: string;
295
- secret_id?: SecretId;
296
- };
297
- response?: {
298
- status?: number;
299
- headers?: Record<string, string>;
300
- body?: string;
301
- error?: string;
302
- };
303
- execution_status: DispatchStatus;
304
- missing_grants?: {
305
- agent_secret?: boolean;
306
- secret_destination?: boolean;
307
- };
308
- secret_id?: SecretId;
309
- }
310
- export interface AgentRequestRecord {
311
- request_id: string;
312
- created_at: string;
313
- requested_at: string;
314
- reason: string;
315
- request: {
316
- target_url: string;
317
- method: string;
318
- headers?: Record<string, string>;
319
- body?: string;
320
- secret_alias?: string;
321
- secret_id?: SecretId;
322
- };
323
- response?: {
324
- status?: number;
325
- headers?: Record<string, string>;
326
- body?: string;
327
- error?: string;
328
- };
329
- execution_status: DispatchStatus;
330
- secret_id?: SecretId;
238
+ export interface AgentRequestRecord extends RequestRecord {
331
239
  }
332
240
  export interface VaultToolDefinition {
333
241
  name: string;
@@ -406,7 +314,7 @@ export interface DispatchRequest {
406
314
  kind: "agent";
407
315
  };
408
316
  proof: AgentProof;
409
- secret_alias?: string;
317
+ secret_id?: SecretId;
410
318
  reason: string;
411
319
  target_url: string;
412
320
  method: string;
@@ -454,52 +362,22 @@ export interface DispatchResult {
454
362
  }
455
363
  export type AgentRequestResult = AgentRequestRecord;
456
364
  export interface AuditQuery {
457
- vault_id: string;
365
+ vault_id: VaultId;
458
366
  actor_id?: string;
459
367
  root_agent_id?: string;
460
- secret_alias?: string;
461
- secret_id?: string;
368
+ secret_id?: SecretId;
462
369
  request_id?: string;
463
370
  since?: string;
464
371
  }
465
- export declare enum AuditOperation {
466
- IDENTITY_REGISTER = "identity.register",
467
- IDENTITY_UPDATE = "identity.update",
468
- IDENTITY_ISSUE_TOKEN = "identity.issue_token",
469
- IDENTITY_REVOKE_TOKEN = "identity.revoke_token",
470
- GRANT_SECRET = "grant.grant_secret",
471
- GRANT_DESTINATION = "grant.grant_destination",
472
- REVOKE_SECRET = "grant.revoke_secret",
473
- REVOKE_DESTINATION = "grant.revoke_destination",
474
- SECRET_WRITE = "secret.write",
475
- SECRET_EXPORT = "secret.export",
476
- SECRET_BATCH_EXPORT = "secret.batch_export",
477
- SECRET_DELETE = "secret.delete",
478
- POLICY_EVALUATE = "policy.evaluate_dispatch",
479
- SECRET_DISPATCH = "secret.dispatch",
480
- DISPATCH_APPROVE = "dispatch.approve",
481
- DISPATCH_REJECT = "dispatch.reject",
482
- DISPATCH_HOLD = "dispatch.pending_approval"
483
- }
484
372
  export interface AuditEntry {
485
373
  event_id: string;
486
374
  ts: string;
487
- vault_id: string;
375
+ vault_id: VaultId;
488
376
  actor: VaultPrincipal;
489
- operation: AuditOperation;
490
- decision: "allowed" | "denied";
491
- execution_status: "not_executed" | "succeeded" | "failed";
492
- request_id?: string;
493
- secret_alias?: string;
494
- secret_id?: string;
495
- root_agent_id?: string;
496
- site_id?: string;
497
- target?: {
498
- kind: "http" | "other";
499
- url: string;
500
- };
501
- detail: string;
502
- error_code?: string | null;
377
+ function_name: string;
378
+ input: Record<string, any>;
379
+ output?: any;
380
+ error?: string;
503
381
  }
504
382
  export interface AgentIdentityRecord {
505
383
  vault_id: VaultId;
@@ -533,7 +411,7 @@ export interface OwnerAuditRequest {
533
411
  }
534
412
  export interface OwnerAuditSubscription {
535
413
  afterEventId?: string;
536
- operations?: readonly AuditOperation[];
414
+ function_names?: readonly string[];
537
415
  root_agent_id?: string;
538
416
  request_id?: string;
539
417
  onEvent(entry: AuditEntry): void;
@@ -550,7 +428,7 @@ export interface OwnerExportSecretRequest {
550
428
  export interface OwnerSecretExport {
551
429
  vault_id: VaultId;
552
430
  secret_id: SecretId;
553
- alias: SecretAlias;
431
+ alias: string;
554
432
  plaintext: string;
555
433
  exported_at: string;
556
434
  }
@@ -569,7 +447,7 @@ export interface OwnerListGrantsRequest {
569
447
  kind: "owner";
570
448
  };
571
449
  root_agent_id?: string;
572
- secret_alias?: string;
450
+ secret_id?: SecretId;
573
451
  site_id?: string;
574
452
  requested_at: string;
575
453
  }
@@ -6,24 +6,4 @@ export var DispatchStatus;
6
6
  DispatchStatus["IN_PROGRESS"] = "IN_PROGRESS";
7
7
  DispatchStatus["AWAITING_APPROVAL"] = "AWAITING_APPROVAL";
8
8
  })(DispatchStatus || (DispatchStatus = {}));
9
- export var AuditOperation;
10
- (function (AuditOperation) {
11
- AuditOperation["IDENTITY_REGISTER"] = "identity.register";
12
- AuditOperation["IDENTITY_UPDATE"] = "identity.update";
13
- AuditOperation["IDENTITY_ISSUE_TOKEN"] = "identity.issue_token";
14
- AuditOperation["IDENTITY_REVOKE_TOKEN"] = "identity.revoke_token";
15
- AuditOperation["GRANT_SECRET"] = "grant.grant_secret";
16
- AuditOperation["GRANT_DESTINATION"] = "grant.grant_destination";
17
- AuditOperation["REVOKE_SECRET"] = "grant.revoke_secret";
18
- AuditOperation["REVOKE_DESTINATION"] = "grant.revoke_destination";
19
- AuditOperation["SECRET_WRITE"] = "secret.write";
20
- AuditOperation["SECRET_EXPORT"] = "secret.export";
21
- AuditOperation["SECRET_BATCH_EXPORT"] = "secret.batch_export";
22
- AuditOperation["SECRET_DELETE"] = "secret.delete";
23
- AuditOperation["POLICY_EVALUATE"] = "policy.evaluate_dispatch";
24
- AuditOperation["SECRET_DISPATCH"] = "secret.dispatch";
25
- AuditOperation["DISPATCH_APPROVE"] = "dispatch.approve";
26
- AuditOperation["DISPATCH_REJECT"] = "dispatch.reject";
27
- AuditOperation["DISPATCH_HOLD"] = "dispatch.pending_approval";
28
- })(AuditOperation || (AuditOperation = {}));
29
9
  //# sourceMappingURL=contracts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/vault-core/contracts.ts"],"names":[],"mappings":"AA+cA,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,yCAAuB,CAAA;IACvB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,6CAA2B,CAAA;IAC3B,yDAAuC,CAAA;AACzC,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AA0BD,MAAM,CAAN,IAAY,cAsBX;AAtBD,WAAY,cAAc;IACxB,yDAAuC,CAAA;IACvC,qDAAmC,CAAA;IACnC,+DAA6C,CAAA;IAC7C,iEAA+C,CAAA;IAE/C,qDAAmC,CAAA;IACnC,+DAA6C,CAAA;IAC7C,uDAAqC,CAAA;IACrC,iEAA+C,CAAA;IAE/C,+CAA6B,CAAA;IAC7B,iDAA+B,CAAA;IAC/B,6DAA2C,CAAA;IAC3C,iDAA+B,CAAA;IAE/B,8DAA4C,CAAA;IAC5C,qDAAmC,CAAA;IAEnC,uDAAqC,CAAA;IACrC,qDAAmC,CAAA;IACnC,6DAA2C,CAAA;AAC7C,CAAC,EAtBW,cAAc,KAAd,cAAc,QAsBzB"}
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/vault-core/contracts.ts"],"names":[],"mappings":"AAsWA,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,yCAAuB,CAAA;IACvB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,6CAA2B,CAAA;IAC3B,yDAAuC,CAAA;AACzC,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB"}
@@ -1,9 +1,9 @@
1
- import { type AgentIdentityRecord, type AgentRuntimeManifest, type AgentVisibleRequestRecord, type AgentRequestRecord, type AgentVisibleSecretRecord, type AuditEntry, type AuditQuery, type DispatchAuthorization, type DispatchRequest, type DispatchResult, type OwnerPendingDispatchSubscription, type OwnerAuditSubscription, type OwnerRequestRecord, type OwnerVisibleRequestRecord, type SecretId, type SecretRecord, type VaultId, type VaultPrincipal, type AgentSecretGrant, type SecretDestinationGrant, type DispatchApprovalDecision, type OwnerCreateSecretCommand, type OwnerUpdateSecretCommand, type OwnerSecretExport } from "./contracts.js";
1
+ import { type AgentIdentityRecord, type AgentRuntimeManifest, type AgentRequestRecord, type AuditEntry, type AuditQuery, type DispatchAuthorization, type DispatchRequest, type DispatchResult, type OwnerPendingDispatchSubscription, type OwnerAuditSubscription, type OwnerRequestRecord, type SecretId, type SecretRecord, type VaultId, type VaultPrincipal, type AgentSecretGrant, type SecretDestinationGrant, type DispatchApprovalDecision, type OwnerCreateSecretCommand, type OwnerUpdateSecretCommand, type OwnerSecretExport } from "./contracts.js";
2
2
  import type { VaultCoreDependencies } from "./ports.js";
3
3
  export declare class VaultCore {
4
4
  private readonly _deps;
5
5
  constructor(deps: VaultCoreDependencies);
6
- get vault_id(): VaultId;
6
+ get vault_id(): string;
7
7
  private _assertOwnerPrincipal;
8
8
  private _appendAudit;
9
9
  private _verifyAgentControlProof;
@@ -53,7 +53,7 @@ export declare class VaultCore {
53
53
  proof: any;
54
54
  request_id: string;
55
55
  requested_at: string;
56
- }): Promise<readonly AgentVisibleSecretRecord[]>;
56
+ }): Promise<readonly SecretRecord[]>;
57
57
  agentListRequests(command: {
58
58
  agent: VaultPrincipal & {
59
59
  kind: "agent";
@@ -61,7 +61,7 @@ export declare class VaultCore {
61
61
  proof: any;
62
62
  request_id: string;
63
63
  requested_at: string;
64
- }): Promise<readonly AgentVisibleRequestRecord[]>;
64
+ }): Promise<readonly AgentRequestRecord[]>;
65
65
  agentGetRequest(command: {
66
66
  agent: VaultPrincipal & {
67
67
  kind: "agent";
@@ -108,13 +108,13 @@ export declare class VaultCore {
108
108
  }): Promise<readonly AgentIdentityRecord[]>;
109
109
  ownerListRequests(actor: VaultPrincipal & {
110
110
  kind: "owner";
111
- }, root_agent_id?: string): Promise<readonly OwnerVisibleRequestRecord[]>;
111
+ }, root_agent_id?: string): Promise<readonly OwnerRequestRecord[]>;
112
112
  ownerGetRequest(actor: VaultPrincipal & {
113
113
  kind: "owner";
114
114
  }, request_id: string): Promise<OwnerRequestRecord>;
115
115
  ownerListSecrets(actor: VaultPrincipal & {
116
116
  kind: "owner";
117
- }): Promise<readonly AgentVisibleSecretRecord[]>;
117
+ }): Promise<readonly SecretRecord[]>;
118
118
  ownerIssueSessionToken(request: {
119
119
  vault_id: VaultId;
120
120
  actor: VaultPrincipal;
@@ -141,9 +141,8 @@ export declare class VaultCore {
141
141
  private _recordRequestInternal;
142
142
  private _createInitialRequestRecord;
143
143
  private _updateRequestRecordInternal;
144
- private toAgentVisibleRequestRecord;
145
- private toOwnerVisibleRequestRecord;
146
- private toOwnerRequestRecord;
147
144
  private toAgentRequestRecord;
145
+ private toOwnerRequestRecord;
146
+ private _appendAuditEntry;
148
147
  }
149
148
  export declare function createVaultCore(deps: VaultCoreDependencies): VaultCore;