@the-ai-company/cbio-node-runtime 0.33.0 → 1.0.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 (108) hide show
  1. package/README.md +138 -9
  2. package/dist/clients/agent/client.d.ts +9 -0
  3. package/dist/clients/agent/client.js +72 -0
  4. package/dist/clients/agent/client.js.map +1 -0
  5. package/dist/clients/agent/contracts.d.ts +34 -0
  6. package/dist/clients/agent/contracts.js +2 -0
  7. package/dist/clients/agent/contracts.js.map +1 -0
  8. package/dist/clients/agent/index.d.ts +3 -0
  9. package/dist/clients/agent/index.js +2 -0
  10. package/dist/clients/agent/index.js.map +1 -0
  11. package/dist/clients/owner/client.d.ts +18 -0
  12. package/dist/clients/owner/client.js +169 -0
  13. package/dist/clients/owner/client.js.map +1 -0
  14. package/dist/clients/owner/contracts.d.ts +34 -0
  15. package/dist/clients/owner/contracts.js +2 -0
  16. package/dist/clients/owner/contracts.js.map +1 -0
  17. package/dist/clients/owner/index.d.ts +3 -0
  18. package/dist/clients/owner/index.js +2 -0
  19. package/dist/clients/owner/index.js.map +1 -0
  20. package/dist/errors.d.ts +2 -1
  21. package/dist/errors.js +1 -0
  22. package/dist/errors.js.map +1 -1
  23. package/dist/runtime/index.d.ts +8 -8
  24. package/dist/runtime/index.js +8 -5
  25. package/dist/runtime/index.js.map +1 -1
  26. package/dist/storage/fs.d.ts +1 -0
  27. package/dist/storage/fs.js +28 -0
  28. package/dist/storage/fs.js.map +1 -1
  29. package/dist/storage/memory.d.ts +1 -0
  30. package/dist/storage/memory.js +20 -0
  31. package/dist/storage/memory.js.map +1 -1
  32. package/dist/storage/provider.d.ts +2 -0
  33. package/dist/vault-core/contracts.d.ts +230 -0
  34. package/dist/vault-core/contracts.js +2 -0
  35. package/dist/vault-core/contracts.js.map +1 -0
  36. package/dist/vault-core/core.d.ts +21 -0
  37. package/dist/vault-core/core.js +335 -0
  38. package/dist/vault-core/core.js.map +1 -0
  39. package/dist/vault-core/defaults.d.ts +141 -0
  40. package/dist/vault-core/defaults.js +602 -0
  41. package/dist/vault-core/defaults.js.map +1 -0
  42. package/dist/vault-core/errors.d.ts +4 -0
  43. package/dist/vault-core/errors.js +9 -0
  44. package/dist/vault-core/errors.js.map +1 -0
  45. package/dist/vault-core/index.d.ts +6 -0
  46. package/dist/vault-core/index.js +5 -0
  47. package/dist/vault-core/index.js.map +1 -0
  48. package/dist/vault-core/persistence.d.ts +87 -0
  49. package/dist/vault-core/persistence.js +309 -0
  50. package/dist/vault-core/persistence.js.map +1 -0
  51. package/dist/vault-core/ports.d.ts +101 -0
  52. package/dist/vault-core/ports.js +2 -0
  53. package/dist/vault-core/ports.js.map +1 -0
  54. package/dist/vault-ingress/defaults.d.ts +14 -0
  55. package/dist/vault-ingress/defaults.js +41 -0
  56. package/dist/vault-ingress/defaults.js.map +1 -0
  57. package/dist/vault-ingress/flow-factories.d.ts +24 -0
  58. package/dist/vault-ingress/flow-factories.js +48 -0
  59. package/dist/vault-ingress/flow-factories.js.map +1 -0
  60. package/dist/vault-ingress/index.d.ts +81 -0
  61. package/dist/vault-ingress/index.js +357 -0
  62. package/dist/vault-ingress/index.js.map +1 -0
  63. package/docs/ARCHITECTURE.md +44 -76
  64. package/docs/REFERENCE.md +239 -133
  65. package/docs/WORKS_WITH_CUSTOM_FETCH.md +16 -191
  66. package/docs/es/README.md +8 -24
  67. package/docs/fr/README.md +8 -24
  68. package/docs/ja/README.md +8 -24
  69. package/docs/ko/README.md +8 -24
  70. package/docs/pt/README.md +8 -24
  71. package/docs/zh/README.md +21 -7
  72. package/package.json +2 -10
  73. package/dist/agent/agent.d.ts +0 -234
  74. package/dist/agent/agent.js +0 -565
  75. package/dist/agent/agent.js.map +0 -1
  76. package/dist/audit/ActivityLog.d.ts +0 -25
  77. package/dist/audit/ActivityLog.js +0 -66
  78. package/dist/audit/ActivityLog.js.map +0 -1
  79. package/dist/http/authClient.d.ts +0 -26
  80. package/dist/http/authClient.js +0 -132
  81. package/dist/http/authClient.js.map +0 -1
  82. package/dist/http/localAuthProxy.d.ts +0 -33
  83. package/dist/http/localAuthProxy.js +0 -93
  84. package/dist/http/localAuthProxy.js.map +0 -1
  85. package/dist/http/secretAcquisition.d.ts +0 -54
  86. package/dist/http/secretAcquisition.js +0 -177
  87. package/dist/http/secretAcquisition.js.map +0 -1
  88. package/dist/protocol/childSecretNaming.d.ts +0 -7
  89. package/dist/protocol/childSecretNaming.js +0 -12
  90. package/dist/protocol/childSecretNaming.js.map +0 -1
  91. package/dist/protocol/identity.d.ts +0 -8
  92. package/dist/protocol/identity.js +0 -16
  93. package/dist/protocol/identity.js.map +0 -1
  94. package/dist/sealed/index.d.ts +0 -6
  95. package/dist/sealed/index.js +0 -6
  96. package/dist/sealed/index.js.map +0 -1
  97. package/dist/vault/secretPolicy.d.ts +0 -3
  98. package/dist/vault/secretPolicy.js +0 -14
  99. package/dist/vault/secretPolicy.js.map +0 -1
  100. package/dist/vault/vault.d.ts +0 -91
  101. package/dist/vault/vault.js +0 -534
  102. package/dist/vault/vault.js.map +0 -1
  103. package/docs/TODO-multi-vault.md +0 -29
  104. package/docs/spec/runtime/README.md +0 -27
  105. package/docs/spec/runtime/activity-log.md +0 -67
  106. package/docs/spec/runtime/managed-agent-record.md +0 -52
  107. package/docs/spec/runtime/merge-rules.md +0 -52
  108. package/docs/spec/runtime/secret-origin-policy.md +0 -46
package/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # cbio Node Runtime
1
+ # cbio Vault Runtime
2
2
 
3
- Node.js runtime for cbio identity and credential vault. Library only.
4
-
5
- **⚠️ Actively under development — not a stable release.**
3
+ Node.js vault runtime with a hard-cut architecture: vault core first, explicit clients second.
6
4
 
7
5
  **Source:** [https://github.com/TheAICompany/cbio-node-runtime](https://github.com/TheAICompany/cbio-node-runtime)
8
6
 
@@ -21,7 +19,11 @@ Node.js runtime for cbio identity and credential vault. Library only.
21
19
  - No CLI
22
20
  - No TUI
23
21
 
24
- Import and use `CbioIdentity`, `CbioAgent` from the main export.
22
+ Main export now centers on:
23
+ - `vault-core`
24
+ - `vault-ingress`
25
+ - `clients/owner`
26
+ - `clients/agent`
25
27
 
26
28
  ## Install
27
29
 
@@ -34,11 +36,138 @@ npm install @the-ai-company/cbio-node-runtime
34
36
  ## Usage
35
37
 
36
38
  ```ts
37
- import { CbioIdentity, CbioAgent, generateIdentityKeys } from '@the-ai-company/cbio-node-runtime';
39
+ import {
40
+ createVaultService,
41
+ createDefaultVaultCoreDependencies,
42
+ createOwnerHttpFlowBoundary,
43
+ createStandardAcquireBoundary,
44
+ createStandardDispatchBoundary,
45
+ createOwnerClient,
46
+ createAgentClient,
47
+ InMemoryVaultCapabilityResolver,
48
+ LocalVaultTransport,
49
+ } from '@the-ai-company/cbio-node-runtime';
50
+ ```
51
+
52
+ ## Architecture
53
+
54
+ The public runtime surface follows four hard rules:
55
+
56
+ 1. Secret plaintext lives only in vault core.
57
+ 2. Only owner and vault-trusted acquisition paths may write secrets.
58
+ 3. Secrets are dispatched only to owner-approved or issuer-bound targets.
59
+ 4. Vault validates and audits everything.
60
+
61
+ The current HTTP-facing interface distinguishes two supported secret-flow classes:
62
+
63
+ - `A` / `acquire_secret`
64
+ No secret leaves the vault. A secret is extracted from the response and stored into the vault. Agent-visible output includes only protocol metadata plus a redacted response shape.
65
+ - `B` / `send_secret`
66
+ A stored secret is sent to an owner-approved target. The response is treated as normal business output and may be returned to the agent.
67
+
68
+ This is an intentional boundary choice:
69
+
70
+ - acquisition responses are treated as sensitive because they may contain newly issued secret material
71
+ - dispatch responses are treated as ordinary protocol results because the operation itself is a standard secret-backed HTTP call to an owner-approved target
72
+
73
+ The vault does not attempt to second-guess every remote protocol. If a target returns sensitive data during a normal dispatch flow, that is part of the target contract and the owner's authorization decision.
74
+
75
+ The runtime does not claim to understand arbitrary remote protocols. The API boundary makes clear what is supported:
76
+
77
+ - acquisition is explicit and redacted
78
+ - secret-backed dispatch is explicit and capability-gated
79
+ - unsupported `C` / `D` style flows are not part of the current surface
80
+
81
+ Owner-defined HTTP boundaries share one factory layer:
82
+
83
+ - `createOwnerHttpFlowBoundary(...)`
84
+ - `createStandardAcquireBoundary(...)`
85
+ - `createStandardDispatchBoundary(...)`
86
+
87
+ An owner-defined exception path also exists for non-standard but intentional integrations:
88
+
89
+ - owner may register a `custom_http` flow
90
+ - the flow fixes mode, target, method, and response visibility inside the vault
91
+ - agent may only invoke the registered `customFlowId`
92
+ - this is an explicit escape hatch, not the default path
93
+
94
+ ## Modules
95
+
96
+ - `vault-core`
97
+ The vault kernel. Stores plaintext, authorizes writes, authorizes dispatch, executes dispatch, appends audit.
98
+
99
+ - `vault-ingress`
100
+ Vault boundary/facade. Accepts request-shaped calls, handles trusted acquisition paths, and keeps capability resolution plus dispatch ingress inside the vault trust boundary.
38
101
 
39
- const keys = generateIdentityKeys();
40
- const identity = await CbioIdentity.load({ privateKey: keys.privateKey });
41
- const agent: CbioAgent = identity.getAgent(); // minimal permissions: vault:fetch, vault:list
102
+ - `clients/owner`
103
+ Owner-facing client. Writes secrets and reads audit.
104
+
105
+ - `clients/agent`
106
+ Agent-facing client. Creates signed dispatch requests. Never handles plaintext secret.
107
+
108
+ ## Status
109
+
110
+ The old identity-centric runtime is no longer the intended public architecture.
111
+ This package now exposes the production local vault runtime surface as the primary API.
112
+
113
+ ## Example Shape
114
+
115
+ ```ts
116
+ const capabilities = new InMemoryVaultCapabilityResolver();
117
+ const vault = createVaultService(createDefaultVaultCoreDependencies(), { capabilities });
118
+ const owner = createOwnerClient(ownerIdentity, vault, ownerSigner, clock);
119
+ const transport = new LocalVaultTransport(vault, capability.capabilityId);
120
+ const agent = createAgentClient(agentIdentity, capability, signer, transport, clock);
121
+ ```
122
+
123
+ Capability example:
124
+
125
+ ```ts
126
+ const capability = {
127
+ vaultId: vault.vaultId,
128
+ capabilityId: 'cap-1',
129
+ agentId: 'agent-1',
130
+ secretAliases: ['api-token'],
131
+ operation: 'dispatch_http',
132
+ allowedTargets: ['https://api.example.com/endpoint'],
133
+ allowedMethods: ['POST'],
134
+ issuedAt: new Date().toISOString(),
135
+ };
136
+ ```
137
+
138
+ Custom flow example:
139
+
140
+ ```ts
141
+ await owner.registerCustomFlow({
142
+ flowId: 'custom-status-read',
143
+ ...createOwnerHttpFlowBoundary({
144
+ mode: 'send_secret',
145
+ targetUrl: 'https://api.example.com/custom-status',
146
+ method: 'POST',
147
+ responseVisibility: 'shape_only',
148
+ }),
149
+ });
150
+ ```
151
+
152
+ Acquisition example:
153
+
154
+ ```ts
155
+ const acquireBoundary = createStandardAcquireBoundary({
156
+ targetUrl: 'https://issuer.example.com/token',
157
+ responseField: 'access_token',
158
+ storeAlias: 'issuer-token',
159
+ });
160
+
161
+ const acquired = await vault.acquireSecret({
162
+ alias: acquireBoundary.responseSecret.storeAlias,
163
+ issuerId: 'issuer-1',
164
+ url: acquireBoundary.targetUrl,
165
+ flow: 'oauth_token_response.access_token',
166
+ method: acquireBoundary.method,
167
+ });
168
+
169
+ console.log(acquired.responseShape);
170
+ // { token_type: 'Bearer', expires_in: 3600, scope: 'read write' }
42
171
  ```
43
172
 
44
173
  ## Build
@@ -0,0 +1,9 @@
1
+ import type { Clock } from "../../vault-core/index.js";
2
+ import type { AgentCapabilityEnvelope, AgentDispatchIntent, AgentDispatchTransport, AgentSigner } from "./contracts.js";
3
+ export interface AgentIdentity {
4
+ agentId: string;
5
+ }
6
+ export interface AgentClient {
7
+ dispatch(intent: AgentDispatchIntent): Promise<import("../../vault-core/index.js").DispatchResult>;
8
+ }
9
+ export declare function createAgentClient(identity: AgentIdentity, capability: AgentCapabilityEnvelope, signer: AgentSigner, transport: AgentDispatchTransport, clock: Clock): AgentClient;
@@ -0,0 +1,72 @@
1
+ function createDispatchBinding(requestId, requestedAt, agentId, capabilityId, secretAlias, targetUrl, method, body) {
2
+ return JSON.stringify({
3
+ requestId,
4
+ requestedAt,
5
+ agentId,
6
+ capabilityId,
7
+ secretAlias: secretAlias ?? null,
8
+ targetUrl,
9
+ method,
10
+ body: body ?? null,
11
+ });
12
+ }
13
+ class DefaultAgentClient {
14
+ _identity;
15
+ _capability;
16
+ _signer;
17
+ _transport;
18
+ _clock;
19
+ constructor(_identity, _capability, _signer, _transport, _clock) {
20
+ this._identity = _identity;
21
+ this._capability = _capability;
22
+ this._signer = _signer;
23
+ this._transport = _transport;
24
+ this._clock = _clock;
25
+ }
26
+ async dispatch(intent) {
27
+ const requestedAt = intent.requestedAt ?? this._clock.nowIso();
28
+ const requestId = `${this._identity.agentId}:${requestedAt}:${intent.secretAlias ?? "no-secret"}:${intent.method}`;
29
+ const publicKey = await this._signer.getPublicKey();
30
+ const signature = await this._signer.sign(createDispatchBinding(requestId, requestedAt, this._identity.agentId, this._capability.capabilityId, intent.secretAlias, intent.targetUrl, intent.method, intent.body));
31
+ return this._transport.dispatch({
32
+ vaultId: this._capability.vaultId,
33
+ requestId,
34
+ requestedAt,
35
+ agent: {
36
+ kind: "agent",
37
+ id: this._identity.agentId,
38
+ },
39
+ capability: {
40
+ vaultId: this._capability.vaultId,
41
+ capabilityId: this._capability.capabilityId,
42
+ agentId: this._capability.agentId,
43
+ secretIds: this._capability.secretIds,
44
+ secretAliases: this._capability.secretAliases,
45
+ operation: this._capability.operation,
46
+ allowedTargets: this._capability.allowedTargets,
47
+ allowedMethods: this._capability.allowedMethods,
48
+ allowedPaths: this._capability.allowedPaths,
49
+ issuedAt: this._capability.issuedAt,
50
+ expiresAt: this._capability.expiresAt,
51
+ revocationVersion: this._capability.revocationVersion,
52
+ rateLimit: this._capability.rateLimit,
53
+ auditRequired: this._capability.auditRequired,
54
+ },
55
+ proof: {
56
+ agentId: this._identity.agentId,
57
+ signature,
58
+ requestId,
59
+ requestedAt,
60
+ },
61
+ secretAlias: intent.secretAlias,
62
+ targetUrl: intent.targetUrl,
63
+ method: intent.method,
64
+ headers: intent.headers,
65
+ body: intent.body,
66
+ });
67
+ }
68
+ }
69
+ export function createAgentClient(identity, capability, signer, transport, clock) {
70
+ return new DefaultAgentClient(identity, capability, signer, transport, clock);
71
+ }
72
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/clients/agent/client.ts"],"names":[],"mappings":"AAgBA,SAAS,qBAAqB,CAC5B,SAAiB,EACjB,WAAmB,EACnB,OAAe,EACf,YAAoB,EACpB,WAA+B,EAC/B,SAAiB,EACjB,MAAc,EACd,IAAa;IAEb,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,SAAS;QACT,WAAW;QACX,OAAO;QACP,YAAY;QACZ,WAAW,EAAE,WAAW,IAAI,IAAI;QAChC,SAAS;QACT,MAAM;QACN,IAAI,EAAE,IAAI,IAAI,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,kBAAkB;IAEH;IACA;IACA;IACA;IACA;IALnB,YACmB,SAAwB,EACxB,WAAoC,EACpC,OAAoB,EACpB,UAAkC,EAClC,MAAa;QAJb,cAAS,GAAT,SAAS,CAAe;QACxB,gBAAW,GAAX,WAAW,CAAyB;QACpC,YAAO,GAAP,OAAO,CAAa;QACpB,eAAU,GAAV,UAAU,CAAwB;QAClC,WAAM,GAAN,MAAM,CAAO;IAC7B,CAAC;IAEJ,KAAK,CAAC,QAAQ,CAAC,MAA2B;QACxC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QAC/D,MAAM,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,WAAW,IAAI,MAAM,CAAC,WAAW,IAAI,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACnH,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QACpD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CACvC,qBAAqB,CACnB,SAAS,EACT,WAAW,EACX,IAAI,CAAC,SAAS,CAAC,O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AAC,WAAW;YAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,UAAU,iBAAiB,CAC/B,QAAuB,EACvB,UAAmC,EACnC,MAAmB,EACnB,SAAiC,EACjC,KAAY;IAEZ,OAAO,IAAI,kBAAkB,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AAChF,CAAC"}
@@ -0,0 +1,34 @@
1
+ export interface AgentDispatchIntent {
2
+ secretAlias?: string;
3
+ targetUrl: string;
4
+ method: string;
5
+ headers?: Record<string, string>;
6
+ body?: string;
7
+ requestedAt?: string;
8
+ }
9
+ export interface AgentCapabilityEnvelope {
10
+ vaultId: import("../../vault-core/index.js").VaultId;
11
+ capabilityId: string;
12
+ agentId: string;
13
+ secretIds?: readonly string[];
14
+ secretAliases?: readonly string[];
15
+ operation: "dispatch_http";
16
+ allowedTargets: readonly string[];
17
+ allowedMethods: readonly string[];
18
+ allowedPaths?: readonly string[];
19
+ issuedAt: string;
20
+ expiresAt?: string;
21
+ revocationVersion?: number;
22
+ rateLimit?: {
23
+ maxRequests: number;
24
+ windowMs: number;
25
+ };
26
+ auditRequired?: boolean;
27
+ }
28
+ export interface AgentSigner {
29
+ getPublicKey(): Promise<string>;
30
+ sign(input: string): Promise<string>;
31
+ }
32
+ export interface AgentDispatchTransport {
33
+ dispatch(request: import("../../vault-core/index.js").DispatchRequest): Promise<import("../../vault-core/index.js").DispatchResult>;
34
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/clients/agent/contracts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export { createAgentClient } from "./client.js";
2
+ export type { AgentClient, AgentIdentity, } from "./client.js";
3
+ export type { AgentCapabilityEnvelope, AgentDispatchIntent, AgentDispatchTransport, AgentSigner, } from "./contracts.js";
@@ -0,0 +1,2 @@
1
+ export { createAgentClient } from "./client.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/clients/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { Clock } from "../../vault-core/index.js";
2
+ import type { VaultService } from "../../vault-ingress/index.js";
3
+ import type { OwnerAuditQueryInput, OwnerRegisterCustomHttpFlowInput, OwnerRegisterAgentIdentityInput, OwnerRegisterOwnerIdentityInput, OwnerWriteSecretInput } from "./contracts.js";
4
+ export interface OwnerIdentity {
5
+ ownerId: string;
6
+ }
7
+ export interface OwnerSigner {
8
+ getPublicKey(): Promise<string>;
9
+ sign(input: string): Promise<string>;
10
+ }
11
+ export interface OwnerClient {
12
+ writeSecret(input: OwnerWriteSecretInput): Promise<import("../../vault-core/index.js").SecretRecord>;
13
+ getAudit(query?: OwnerAuditQueryInput): Promise<readonly import("../../vault-core/index.js").AuditEntry[]>;
14
+ registerAgentIdentity(input: OwnerRegisterAgentIdentityInput): Promise<void>;
15
+ registerOwnerIdentity(input: OwnerRegisterOwnerIdentityInput): Promise<void>;
16
+ registerCustomFlow(input: OwnerRegisterCustomHttpFlowInput): Promise<void>;
17
+ }
18
+ export declare function createOwnerClient(identity: OwnerIdentity, vault: VaultService, signer: OwnerSigner, clock: Clock): OwnerClient;
@@ -0,0 +1,169 @@
1
+ class DefaultOwnerClient {
2
+ _identity;
3
+ _vault;
4
+ _signer;
5
+ _clock;
6
+ constructor(_identity, _vault, _signer, _clock) {
7
+ this._identity = _identity;
8
+ this._vault = _vault;
9
+ this._signer = _signer;
10
+ this._clock = _clock;
11
+ }
12
+ async writeSecret(input) {
13
+ const requestedAt = input.requestedAt ?? this._clock.nowIso();
14
+ const requestId = `${this._identity.ownerId}:${requestedAt}:${input.alias}:write_secret`;
15
+ const signature = await this._signer.sign(JSON.stringify({
16
+ requestId,
17
+ requestedAt,
18
+ ownerId: this._identity.ownerId,
19
+ alias: input.alias,
20
+ plaintext: input.plaintext,
21
+ targetBindings: input.targetBindings,
22
+ }));
23
+ return this._vault.writeSecret({
24
+ kind: "owner.write_secret",
25
+ vaultId: this._vault.vaultId,
26
+ requestId,
27
+ owner: {
28
+ kind: "owner",
29
+ id: this._identity.ownerId,
30
+ },
31
+ alias: input.alias,
32
+ plaintext: input.plaintext,
33
+ targetBindings: input.targetBindings,
34
+ requestedAt,
35
+ proof: {
36
+ ownerId: this._identity.ownerId,
37
+ signature,
38
+ requestId,
39
+ requestedAt,
40
+ },
41
+ });
42
+ }
43
+ async getAudit(query = {}) {
44
+ const requestedAt = this._clock.nowIso();
45
+ const requestId = `${this._identity.ownerId}:${requestedAt}:read_audit`;
46
+ const signature = await this._signer.sign(JSON.stringify({
47
+ requestId,
48
+ requestedAt,
49
+ ownerId: this._identity.ownerId,
50
+ query,
51
+ }));
52
+ return this._vault.readAudit({
53
+ vaultId: this._vault.vaultId,
54
+ actor: {
55
+ kind: "owner",
56
+ id: this._identity.ownerId,
57
+ },
58
+ query,
59
+ requestId,
60
+ requestedAt,
61
+ proof: {
62
+ ownerId: this._identity.ownerId,
63
+ signature,
64
+ requestId,
65
+ requestedAt,
66
+ },
67
+ });
68
+ }
69
+ async registerAgentIdentity(input) {
70
+ const requestedAt = input.requestedAt ?? this._clock.nowIso();
71
+ const requestId = `${this._identity.ownerId}:${requestedAt}:${input.agentId}:register_agent_identity`;
72
+ const agentIdentity = {
73
+ vaultId: this._vault.vaultId,
74
+ agentId: input.agentId,
75
+ publicKey: input.publicKey,
76
+ };
77
+ const signature = await this._signer.sign(JSON.stringify({
78
+ requestId,
79
+ requestedAt,
80
+ ownerId: this._identity.ownerId,
81
+ agentIdentity,
82
+ }));
83
+ await this._vault.registerAgentIdentity({
84
+ vaultId: this._vault.vaultId,
85
+ requestId,
86
+ owner: {
87
+ kind: "owner",
88
+ id: this._identity.ownerId,
89
+ },
90
+ agentIdentity,
91
+ requestedAt,
92
+ proof: {
93
+ ownerId: this._identity.ownerId,
94
+ signature,
95
+ requestId,
96
+ requestedAt,
97
+ },
98
+ });
99
+ }
100
+ async registerOwnerIdentity(input) {
101
+ const requestedAt = input.requestedAt ?? this._clock.nowIso();
102
+ const requestId = `${this._identity.ownerId}:${requestedAt}:${input.ownerId}:register_owner_identity`;
103
+ const ownerIdentity = {
104
+ vaultId: this._vault.vaultId,
105
+ ownerId: input.ownerId,
106
+ publicKey: input.publicKey,
107
+ };
108
+ const signature = await this._signer.sign(JSON.stringify({
109
+ requestId,
110
+ requestedAt,
111
+ ownerId: this._identity.ownerId,
112
+ ownerIdentity,
113
+ }));
114
+ await this._vault.registerOwnerIdentity({
115
+ vaultId: this._vault.vaultId,
116
+ requestId,
117
+ owner: {
118
+ kind: "owner",
119
+ id: this._identity.ownerId,
120
+ },
121
+ ownerIdentity,
122
+ requestedAt,
123
+ proof: {
124
+ ownerId: this._identity.ownerId,
125
+ signature,
126
+ requestId,
127
+ requestedAt,
128
+ },
129
+ });
130
+ }
131
+ async registerCustomFlow(input) {
132
+ const requestedAt = input.requestedAt ?? this._clock.nowIso();
133
+ const requestId = `${this._identity.ownerId}:${requestedAt}:${input.flowId}:register_custom_flow`;
134
+ const flow = {
135
+ flowId: input.flowId,
136
+ mode: input.mode,
137
+ targetUrl: input.targetUrl,
138
+ method: input.method,
139
+ responseVisibility: input.responseVisibility,
140
+ responseSecret: input.responseSecret,
141
+ };
142
+ const signature = await this._signer.sign(JSON.stringify({
143
+ requestId,
144
+ requestedAt,
145
+ ownerId: this._identity.ownerId,
146
+ flow,
147
+ }));
148
+ await this._vault.registerCustomFlow({
149
+ vaultId: this._vault.vaultId,
150
+ requestId,
151
+ owner: {
152
+ kind: "owner",
153
+ id: this._identity.ownerId,
154
+ },
155
+ flow,
156
+ requestedAt,
157
+ proof: {
158
+ ownerId: this._identity.ownerId,
159
+ signature,
160
+ requestId,
161
+ requestedAt,
162
+ },
163
+ });
164
+ }
165
+ }
166
+ export function createOwnerClient(identity, vault, signer, clock) {
167
+ return new DefaultOwnerClient(identity, vault, signer, clock);
168
+ }
169
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/clients/owner/client.ts"],"names":[],"mappings":"AA2BA,MAAM,kBAAkB;IAEH;IACA;IACA;IACA;IAJnB,YACmB,SAAwB,EACxB,MAAoB,EACpB,OAAoB,EACpB,MAAa;QAHb,cAAS,GAAT,SAAS,CAAe;QACxB,WAAM,GAAN,MAAM,CAAc;QACpB,YAAO,GAAP,OAAO,CAAa;QACpB,WAAM,GAAN,MAAM,CAAO;IAC7B,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,KAA4B;QAC5C,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QAC9D,MAAM,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,WAAW,IAAI,KAAK,CAAC,KAAK,eAAe,CAAC;QACzF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;YACvD,SAAS;YACT,WAAW;YACX,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO;YAC/B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,cAAc,EAAE,KAAK,CAAC,cAAc;SACrC,CAAC,CAAC,CAAC;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;YAC7B,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,IAAI,CAAC,M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I,CAAC,SAAS,CAAC,OAAO;YAC/B,IAAI;SACL,CAAC,CAAC,CAAC;QACJ,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC;YACnC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO;YAC5B,SAAS;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO;aAC3B;YACD,IAAI;YACJ,WAAW;YACX,KAAK,EAAE;gBACL,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO;gBAC/B,SAAS;gBACT,SAAS;gBACT,WAAW;aACZ;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,UAAU,iBAAiB,CAC/B,QAAuB,EACvB,KAAmB,EACnB,MAAmB,EACnB,KAAY;IAEZ,OAAO,IAAI,kBAAkB,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { OwnerHttpFlowBoundary } from "../../vault-ingress/flow-factories.js";
2
+ export interface OwnerSecretTargetBinding {
3
+ kind: "owner" | "site";
4
+ targetId: string;
5
+ targetUrl?: string;
6
+ methods?: readonly string[];
7
+ paths?: readonly string[];
8
+ }
9
+ export interface OwnerWriteSecretInput {
10
+ alias: string;
11
+ plaintext: string;
12
+ targetBindings: readonly OwnerSecretTargetBinding[];
13
+ requestedAt?: string;
14
+ }
15
+ export interface OwnerAuditQueryInput {
16
+ actorId?: string;
17
+ secretAlias?: string;
18
+ requestId?: string;
19
+ since?: string;
20
+ }
21
+ export interface OwnerRegisterAgentIdentityInput {
22
+ agentId: string;
23
+ publicKey: string;
24
+ requestedAt?: string;
25
+ }
26
+ export interface OwnerRegisterOwnerIdentityInput {
27
+ ownerId: string;
28
+ publicKey: string;
29
+ requestedAt?: string;
30
+ }
31
+ export interface OwnerRegisterCustomHttpFlowInput extends OwnerHttpFlowBoundary {
32
+ flowId: string;
33
+ requestedAt?: string;
34
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/clients/owner/contracts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export { createOwnerClient } from "./client.js";
2
+ export type { OwnerClient, OwnerIdentity, OwnerSigner, } from "./client.js";
3
+ export type { OwnerAuditQueryInput, OwnerRegisterCustomHttpFlowInput, OwnerRegisterAgentIdentityInput, OwnerRegisterOwnerIdentityInput, OwnerSecretTargetBinding, OwnerWriteSecretInput, } from "./contracts.js";
@@ -0,0 +1,2 @@
1
+ export { createOwnerClient } from "./client.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/clients/owner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
package/dist/errors.d.ts CHANGED
@@ -19,7 +19,8 @@ export declare enum IdentityErrorCode {
19
19
  SECRET_POLICY_REQUIRED = "SECRET_POLICY_REQUIRED",
20
20
  SECRET_SOURCE_ORIGIN_MISMATCH = "SECRET_SOURCE_ORIGIN_MISMATCH",
21
21
  UNSUPPORTED_SIGNED_BODY = "UNSUPPORTED_SIGNED_BODY",
22
- PERMISSION_DENIED = "PERMISSION_DENIED"
22
+ PERMISSION_DENIED = "PERMISSION_DENIED",
23
+ SECRET_OPERATION_RATE_LIMITED = "SECRET_OPERATION_RATE_LIMITED"
23
24
  }
24
25
  export declare class IdentityError extends Error {
25
26
  readonly code: IdentityErrorCode;
package/dist/errors.js CHANGED
@@ -21,6 +21,7 @@ export var IdentityErrorCode;
21
21
  IdentityErrorCode["SECRET_SOURCE_ORIGIN_MISMATCH"] = "SECRET_SOURCE_ORIGIN_MISMATCH";
22
22
  IdentityErrorCode["UNSUPPORTED_SIGNED_BODY"] = "UNSUPPORTED_SIGNED_BODY";
23
23
  IdentityErrorCode["PERMISSION_DENIED"] = "PERMISSION_DENIED";
24
+ IdentityErrorCode["SECRET_OPERATION_RATE_LIMITED"] = "SECRET_OPERATION_RATE_LIMITED";
24
25
  })(IdentityErrorCode || (IdentityErrorCode = {}));
25
26
  export class IdentityError extends Error {
26
27
  code;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAN,IAAY,iBAmBX;AAnBD,WAAY,iBAAiB;IACzB,0EAAqD,CAAA;IACrD,0DAAqC,CAAA;IACrC,wEAAmD,CAAA;IACnD,kFAA6D,CAAA;IAC7D,gDAA2B,CAAA;IAC3B,wDAAmC,CAAA;IACnC,kEAA6C,CAAA;IAC7C,wEAAmD,CAAA;IACnD,8EAAyD,CAAA;IACzD,gFAA2D,CAAA;IAC3D,kFAA6D,CAAA;IAC7D,gGAA2E,CAAA;IAC3E,oEAA+C,CAAA;IAC/C,kEAA6C,CAAA;IAC7C,sEAAiD,CAAA;IACjD,oFAA+D,CAAA;IAC/D,wEAAmD,CAAA;IACnD,4DAAuC,CAAA;AAC3C,CAAC,EAnBW,iBAAiB,KAAjB,iBAAiB,QAmB5B;AAED,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC3B,IAAI,CAAoB;IAEjC,YAAY,IAAuB,EAAE,OAAe,EAAE,OAAsB;QACxE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,CAAU;QAC7B,OAAO,CAAC,YAAY,aAAa,CAAC;IACtC,CAAC;CACJ"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAN,IAAY,iBAoBX;AApBD,WAAY,iBAAiB;IACzB,0EAAqD,CAAA;IACrD,0DAAqC,CAAA;IACrC,wEAAmD,CAAA;IACnD,kFAA6D,CAAA;IAC7D,gDAA2B,CAAA;IAC3B,wDAAmC,CAAA;IACnC,kEAA6C,CAAA;IAC7C,wEAAmD,CAAA;IACnD,8EAAyD,CAAA;IACzD,gFAA2D,CAAA;IAC3D,kFAA6D,CAAA;IAC7D,gGAA2E,CAAA;IAC3E,oEAA+C,CAAA;IAC/C,kEAA6C,CAAA;IAC7C,sEAAiD,CAAA;IACjD,oFAA+D,CAAA;IAC/D,wEAAmD,CAAA;IACnD,4DAAuC,CAAA;IACvC,oFAA+D,CAAA;AACnE,CAAC,EApBW,iBAAiB,KAAjB,iBAAiB,QAoB5B;AAED,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC3B,IAAI,CAAoB;IAEjC,YAAY,IAAuB,EAAE,OAAe,EAAE,OAAsB;QACxE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,CAAU;QAC7B,OAAO,CAAC,YAAY,aAAa,CAAC;IACtC,CAAC;CACJ"}
@@ -1,14 +1,14 @@
1
1
  /**
2
- * Runtime export. For agent developers.
3
- * Owner, Agent, storage, errors. Consumer surface only.
2
+ * Runtime export.
3
+ * Hard-cut public surface: vault core plus explicit clients only.
4
4
  */
5
- export { CbioIdentity, CbioAgent } from "../agent/agent.js";
6
- export type { ActivityLogConfig, GetAgentOptions, IssuedCapabilityName, ManagedAgentHandleConfig, ManagedAgentCapabilityInfo, ManagedAgentCapabilityStatus, ManagedAgentContext, ManagedAgentIssueConfig, ManagedAgentIssueOptions, ManagedAgentLoadOptions, ManagedAgentStorageConfig, RegisterChildIdentityOptions, RegisterChildIdentityResult, IdentityLoadKeys, IdentityLoadOptions, RuntimePermissionName, RuntimePermissions, } from "../agent/agent.js";
7
- export type { MergeResult } from "../vault/vault.js";
8
- export type { FetchFailure, FetchJsonAndAddSecretOptions, FetchJsonAndUpdateSecretOptions, FetchResult, FetchSuccess, } from "../http/secretAcquisition.js";
9
- export { generateIdentityKeys, derivePublicKey } from "../protocol/crypto.js";
10
5
  export { IdentityError, IdentityErrorCode } from "../errors.js";
6
+ export { generateIdentityKeys, derivePublicKey, LocalSigner } from "../protocol/crypto.js";
11
7
  export type { IStorageProvider } from "../storage/provider.js";
12
8
  export { FsStorageProvider } from "../storage/fs.js";
13
9
  export { MemoryStorageProvider } from "../storage/memory.js";
14
- export { startLocalAuthProxy, type FetchWithAuthLike, type LocalAuthProxyOptions, type LocalAuthProxyHandle, } from "../http/localAuthProxy.js";
10
+ export { createVaultCore, DefaultVaultCore, VaultCoreError, createDefaultVaultCoreDependencies, type CreateDefaultVaultCoreDependenciesOptions, type DefaultPolicyEngineOptions, DefaultPolicyEngine, createPersistentVaultCoreDependencies, PersistentVaultAuditLog, PersistentVaultCapabilityRevocationRegistry, PersistentVaultCustomHttpFlowRegistry, PersistentVaultRateLimitStore, PersistentVaultReplayGuard, PersistentVaultSecretCustody, PersistentVaultSecretRepository, HttpDispatchExecutor, InMemoryAgentIdentityRegistry, InMemoryCapabilityRevocationRegistry, InMemoryCustomHttpFlowRegistry, InMemoryRateLimitStore, InMemoryReplayGuard, InMemoryAuditLog, InMemoryOwnerIdentityRegistry, InMemorySecretCustody, InMemorySecretRepository, RandomIdGenerator, SignatureOwnerProofVerifier, type SignatureAgentProofVerifierOptions, SignatureAgentProofVerifier, SystemClock, type AgentCapability, type AgentIdentityRecord, type AgentProof, type OwnerAuditRequest, type OwnerRegisterAgentIdentityCommand, type OwnerRegisterCustomHttpFlowCommand, type OwnerRegisterOwnerIdentityCommand, type OwnerIdentityRecord, type CustomHttpFlowDefinition, type OwnerProof, type AuditEntry, type AuditLog, type AuditQuery, type Clock, type DispatchAuthorization, type DispatchInstruction, type DispatchRequest, type DispatchResult, type IdGenerator, type OwnerIdentityRegistry, type OwnerProofVerifier, type PolicyEngine, type RateLimitStore, type ReplayGuard, type CustomHttpFlowRegistry, type SecretAlias, type SecretCustody, type SecretId, type SecretRecord, type SecretRepository, type SecretVersion, type TrustedExecutor, type VaultCore, type VaultCoreDependencies, type VaultPrincipal, type VaultPrincipalKind, type VaultTargetBinding, type VaultWriteSecretCommand, type VaultId, type AgentIdentityRegistry, type AgentProofVerifier, type CapabilityRevocationRegistry, } from "../vault-core/index.js";
11
+ export { createOwnerClient, type OwnerClient, type OwnerIdentity, type OwnerSigner, type OwnerAuditQueryInput, type OwnerRegisterCustomHttpFlowInput, type OwnerRegisterAgentIdentityInput, type OwnerRegisterOwnerIdentityInput, type OwnerSecretTargetBinding, type OwnerWriteSecretInput, } from "../clients/owner/index.js";
12
+ export { createAgentClient, type AgentClient, type AgentIdentity, type AgentCapabilityEnvelope, type AgentDispatchIntent, type AgentDispatchTransport, type AgentSigner, } from "../clients/agent/index.js";
13
+ export { createVaultService, wrapVaultCoreAsVaultService, createOwnerHttpFlowBoundary, createStandardAcquireBoundary, createStandardDispatchBoundary, toOwnerHttpFlowBoundary, type VaultService, type VaultAcquireSecretInput, type VaultAcquireSecretResult, type VaultAcquireSecretFlow, type VaultCustomFlowResolver, type VaultCapabilityResolver, type VaultAgentDispatchRequest, type VaultAgentDispatchResponse, type VaultAgentDispatchErrorResponse, type RedactedResponseShape, type OwnerHttpFlowBoundary, } from "../vault-ingress/index.js";
14
+ export { InMemoryVaultCapabilityResolver, LocalVaultTransport, } from "../vault-ingress/defaults.js";
@@ -1,11 +1,14 @@
1
1
  /**
2
- * Runtime export. For agent developers.
3
- * Owner, Agent, storage, errors. Consumer surface only.
2
+ * Runtime export.
3
+ * Hard-cut public surface: vault core plus explicit clients only.
4
4
  */
5
- export { CbioIdentity, CbioAgent } from "../agent/agent.js";
6
- export { generateIdentityKeys, derivePublicKey } from "../protocol/crypto.js";
7
5
  export { IdentityError, IdentityErrorCode } from "../errors.js";
6
+ export { generateIdentityKeys, derivePublicKey, LocalSigner } from "../protocol/crypto.js";
8
7
  export { FsStorageProvider } from "../storage/fs.js";
9
8
  export { MemoryStorageProvider } from "../storage/memory.js";
10
- export { startLocalAuthProxy, } from "../http/localAuthProxy.js";
9
+ export { createVaultCore, DefaultVaultCore, VaultCoreError, createDefaultVaultCoreDependencies, DefaultPolicyEngine, createPersistentVaultCoreDependencies, PersistentVaultAuditLog, PersistentVaultCapabilityRevocationRegistry, PersistentVaultCustomHttpFlowRegistry, PersistentVaultRateLimitStore, PersistentVaultReplayGuard, PersistentVaultSecretCustody, PersistentVaultSecretRepository, HttpDispatchExecutor, InMemoryAgentIdentityRegistry, InMemoryCapabilityRevocationRegistry, InMemoryCustomHttpFlowRegistry, InMemoryRateLimitStore, InMemoryReplayGuard, InMemoryAuditLog, InMemoryOwnerIdentityRegistry, InMemorySecretCustody, InMemorySecretRepository, RandomIdGenerator, SignatureOwnerProofVerifier, SignatureAgentProofVerifier, SystemClock, } from "../vault-core/index.js";
10
+ export { createOwnerClient, } from "../clients/owner/index.js";
11
+ export { createAgentClient, } from "../clients/agent/index.js";
12
+ export { createVaultService, wrapVaultCoreAsVaultService, createOwnerHttpFlowBoundary, createStandardAcquireBoundary, createStandardDispatchBoundary, toOwnerHttpFlowBoundary, } from "../vault-ingress/index.js";
13
+ export { InMemoryVaultCapabilityResolver, LocalVaultTransport, } from "../vault-ingress/defaults.js";
11
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM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