@the-ai-company/cbio-node-runtime 0.39.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.
- package/README.md +116 -54
- package/dist/clients/agent/client.d.ts +9 -0
- package/dist/clients/agent/client.js +72 -0
- package/dist/clients/agent/client.js.map +1 -0
- package/dist/clients/agent/contracts.d.ts +34 -0
- package/dist/clients/agent/contracts.js +2 -0
- package/dist/clients/agent/contracts.js.map +1 -0
- package/dist/clients/agent/index.d.ts +3 -0
- package/dist/clients/agent/index.js +2 -0
- package/dist/clients/agent/index.js.map +1 -0
- package/dist/clients/owner/client.d.ts +18 -0
- package/dist/clients/owner/client.js +169 -0
- package/dist/clients/owner/client.js.map +1 -0
- package/dist/clients/owner/contracts.d.ts +34 -0
- package/dist/clients/owner/contracts.js +2 -0
- package/dist/clients/owner/contracts.js.map +1 -0
- package/dist/clients/owner/index.d.ts +3 -0
- package/dist/clients/owner/index.js +2 -0
- package/dist/clients/owner/index.js.map +1 -0
- package/dist/runtime/index.d.ts +8 -10
- package/dist/runtime/index.js +8 -7
- package/dist/runtime/index.js.map +1 -1
- package/dist/storage/fs.d.ts +1 -0
- package/dist/storage/fs.js +28 -0
- package/dist/storage/fs.js.map +1 -1
- package/dist/storage/memory.d.ts +1 -0
- package/dist/storage/memory.js +20 -0
- package/dist/storage/memory.js.map +1 -1
- package/dist/storage/provider.d.ts +2 -0
- package/dist/vault-core/contracts.d.ts +230 -0
- package/dist/vault-core/contracts.js +2 -0
- package/dist/vault-core/contracts.js.map +1 -0
- package/dist/vault-core/core.d.ts +21 -0
- package/dist/vault-core/core.js +335 -0
- package/dist/vault-core/core.js.map +1 -0
- package/dist/vault-core/defaults.d.ts +141 -0
- package/dist/vault-core/defaults.js +602 -0
- package/dist/vault-core/defaults.js.map +1 -0
- package/dist/vault-core/errors.d.ts +4 -0
- package/dist/vault-core/errors.js +9 -0
- package/dist/vault-core/errors.js.map +1 -0
- package/dist/vault-core/index.d.ts +6 -0
- package/dist/vault-core/index.js +5 -0
- package/dist/vault-core/index.js.map +1 -0
- package/dist/vault-core/persistence.d.ts +87 -0
- package/dist/vault-core/persistence.js +309 -0
- package/dist/vault-core/persistence.js.map +1 -0
- package/dist/vault-core/ports.d.ts +101 -0
- package/dist/vault-core/ports.js +2 -0
- package/dist/vault-core/ports.js.map +1 -0
- package/dist/vault-ingress/defaults.d.ts +14 -0
- package/dist/vault-ingress/defaults.js +41 -0
- package/dist/vault-ingress/defaults.js.map +1 -0
- package/dist/vault-ingress/flow-factories.d.ts +24 -0
- package/dist/vault-ingress/flow-factories.js +48 -0
- package/dist/vault-ingress/flow-factories.js.map +1 -0
- package/dist/vault-ingress/index.d.ts +81 -0
- package/dist/vault-ingress/index.js +357 -0
- package/dist/vault-ingress/index.js.map +1 -0
- package/docs/ARCHITECTURE.md +44 -76
- package/docs/REFERENCE.md +217 -218
- package/docs/WORKS_WITH_CUSTOM_FETCH.md +16 -191
- package/docs/es/README.md +8 -24
- package/docs/fr/README.md +8 -24
- package/docs/ja/README.md +8 -24
- package/docs/ko/README.md +8 -24
- package/docs/pt/README.md +8 -24
- package/docs/zh/README.md +21 -7
- package/package.json +2 -10
- package/dist/agent/agent.d.ts +0 -267
- package/dist/agent/agent.js +0 -689
- package/dist/agent/agent.js.map +0 -1
- package/dist/audit/ActivityLog.d.ts +0 -25
- package/dist/audit/ActivityLog.js +0 -71
- package/dist/audit/ActivityLog.js.map +0 -1
- package/dist/http/authClient.d.ts +0 -26
- package/dist/http/authClient.js +0 -132
- package/dist/http/authClient.js.map +0 -1
- package/dist/http/genericSecretValidator.d.ts +0 -11
- package/dist/http/genericSecretValidator.js +0 -42
- package/dist/http/genericSecretValidator.js.map +0 -1
- package/dist/http/localAuthProxy.d.ts +0 -33
- package/dist/http/localAuthProxy.js +0 -93
- package/dist/http/localAuthProxy.js.map +0 -1
- package/dist/http/localSecretIngress.d.ts +0 -33
- package/dist/http/localSecretIngress.js +0 -162
- package/dist/http/localSecretIngress.js.map +0 -1
- package/dist/http/secretAcquisition.d.ts +0 -54
- package/dist/http/secretAcquisition.js +0 -177
- package/dist/http/secretAcquisition.js.map +0 -1
- package/dist/protocol/childSecretNaming.d.ts +0 -7
- package/dist/protocol/childSecretNaming.js +0 -12
- package/dist/protocol/childSecretNaming.js.map +0 -1
- package/dist/protocol/identity.d.ts +0 -8
- package/dist/protocol/identity.js +0 -16
- package/dist/protocol/identity.js.map +0 -1
- package/dist/sealed/index.d.ts +0 -6
- package/dist/sealed/index.js +0 -6
- package/dist/sealed/index.js.map +0 -1
- package/dist/vault/secretPolicy.d.ts +0 -3
- package/dist/vault/secretPolicy.js +0 -14
- package/dist/vault/secretPolicy.js.map +0 -1
- package/dist/vault/vault.d.ts +0 -100
- package/dist/vault/vault.js +0 -603
- package/dist/vault/vault.js.map +0 -1
- package/docs/TODO-multi-vault.md +0 -29
- package/docs/spec/runtime/README.md +0 -44
- package/docs/spec/runtime/activity-log.md +0 -71
- package/docs/spec/runtime/exposure-surfaces.md +0 -99
- package/docs/spec/runtime/managed-agent-record.md +0 -52
- package/docs/spec/runtime/merge-rules.md +0 -52
- package/docs/spec/runtime/secret-origin-policy.md +0 -46
- package/docs/spec/runtime/secret-validation.md +0 -113
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
# cbio
|
|
1
|
+
# cbio Vault Runtime
|
|
2
2
|
|
|
3
|
-
Node.js runtime
|
|
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,9 +19,11 @@ Node.js runtime for cbio identity and credential vault. Library only.
|
|
|
21
19
|
- No CLI
|
|
22
20
|
- No TUI
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
Main export now centers on:
|
|
23
|
+
- `vault-core`
|
|
24
|
+
- `vault-ingress`
|
|
25
|
+
- `clients/owner`
|
|
26
|
+
- `clients/agent`
|
|
27
27
|
|
|
28
28
|
## Install
|
|
29
29
|
|
|
@@ -36,76 +36,138 @@ npm install @the-ai-company/cbio-node-runtime
|
|
|
36
36
|
## Usage
|
|
37
37
|
|
|
38
38
|
```ts
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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';
|
|
44
50
|
```
|
|
45
51
|
|
|
46
|
-
##
|
|
52
|
+
## Architecture
|
|
47
53
|
|
|
48
|
-
|
|
54
|
+
The public runtime surface follows four hard rules:
|
|
49
55
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- Validate a stored secret through a controlled validator: `validateSecret(...)`
|
|
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.
|
|
55
60
|
|
|
56
|
-
The
|
|
61
|
+
The current HTTP-facing interface distinguishes two supported secret-flow classes:
|
|
57
62
|
|
|
58
|
-
|
|
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.
|
|
59
67
|
|
|
60
|
-
|
|
68
|
+
This is an intentional boundary choice:
|
|
61
69
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
secretName: 'service-token',
|
|
65
|
-
url: 'https://issuer.example.com/token',
|
|
66
|
-
extractKey: (response: { token?: string }) => response.token ?? '',
|
|
67
|
-
});
|
|
68
|
-
```
|
|
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
|
|
69
72
|
|
|
70
|
-
|
|
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.
|
|
71
74
|
|
|
72
|
-
|
|
73
|
-
const ingress = await identity.startLocalSecretIngress({
|
|
74
|
-
secretName: 'service-token',
|
|
75
|
-
});
|
|
75
|
+
The runtime does not claim to understand arbitrary remote protocols. The API boundary makes clear what is supported:
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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.
|
|
101
|
+
|
|
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);
|
|
85
121
|
```
|
|
86
122
|
|
|
87
|
-
|
|
123
|
+
Capability example:
|
|
88
124
|
|
|
89
125
|
```ts
|
|
90
|
-
const
|
|
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
|
+
};
|
|
91
136
|
```
|
|
92
137
|
|
|
93
|
-
|
|
138
|
+
Custom flow example:
|
|
94
139
|
|
|
95
140
|
```ts
|
|
96
|
-
|
|
97
|
-
|
|
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
|
+
});
|
|
98
150
|
```
|
|
99
151
|
|
|
152
|
+
Acquisition example:
|
|
153
|
+
|
|
100
154
|
```ts
|
|
101
|
-
|
|
155
|
+
const acquireBoundary = createStandardAcquireBoundary({
|
|
156
|
+
targetUrl: 'https://issuer.example.com/token',
|
|
157
|
+
responseField: 'access_token',
|
|
158
|
+
storeAlias: 'issuer-token',
|
|
159
|
+
});
|
|
102
160
|
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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' }
|
|
109
171
|
```
|
|
110
172
|
|
|
111
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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AkB,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 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/clients/agent/contracts.ts"],"names":[],"mappings":""}
|
|
@@ -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,MAAM,CAAC,OAAO;YAC5B,SAAS;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO;aAC3B;YACD,KAAK,EAAE,KAAK,CAAC,KA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AO;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 @@
|
|
|
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 @@
|
|
|
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/runtime/index.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Runtime export.
|
|
3
|
-
*
|
|
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, SecretValidationResult, SecretValidationStatus, SecretValidator, SecretValidatorHandle, SecretProofAlgorithm, StartLocalSecretIngressOptions, } 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 {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
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";
|