@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
|
@@ -1,196 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Custom Fetch Notes
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This repository no longer exposes the old `CbioIdentity` custom-fetch surface.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
In the current first version:
|
|
6
|
+
- agent code creates signed dispatch requests through `clients/agent`
|
|
7
|
+
- transport goes through `vault-ingress`
|
|
8
|
+
- outbound authenticated HTTP is performed inside `vault-core` via `HttpDispatchExecutor`
|
|
9
|
+
- `send_secret` dispatch may return response bodies to the agent
|
|
10
|
+
- `acquire_secret` does not return raw response values; it returns protocol metadata plus a redacted response shape
|
|
11
|
+
- `acquire_secret` currently supports only built-in standard extraction flows, not caller-defined extractors
|
|
12
|
+
- owner-defined HTTP boundaries are created through `createOwnerHttpFlowBoundary(...)`
|
|
13
|
+
- `createStandardAcquireBoundary(...)` and `createStandardDispatchBoundary(...)` derive the two built-in default boundaries
|
|
14
|
+
- `custom_http` exists as an owner-defined exception path with fixed mode/target/method/response visibility
|
|
6
15
|
|
|
7
|
-
|
|
16
|
+
That split is intentional:
|
|
8
17
|
|
|
9
|
-
-
|
|
10
|
-
- the
|
|
11
|
-
- agent logic never needs `identity.getSecret(...)`
|
|
12
|
-
- the integration stays close to normal provider examples
|
|
18
|
+
- `acquire_secret` treats the response path as sensitive
|
|
19
|
+
- `send_secret` treats the downstream HTTP response as standard protocol output after owner approval
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```ts
|
|
17
|
-
const authFetch = agent.createFetchWithAuth('provider-secret-name');
|
|
18
|
-
|
|
19
|
-
const client = new ProviderSDK({
|
|
20
|
-
fetch: authFetch,
|
|
21
|
-
});
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Use `fetchWithAuth(...)` instead when you do not need the provider SDK at all.
|
|
25
|
-
|
|
26
|
-
## OpenAI
|
|
27
|
-
|
|
28
|
-
The official OpenAI JavaScript SDK supports a custom `fetch` function.
|
|
29
|
-
|
|
30
|
-
```ts
|
|
31
|
-
import OpenAI from 'openai';
|
|
32
|
-
import { CbioIdentity } from '@the-ai-company/agent-identity-sdk';
|
|
33
|
-
|
|
34
|
-
const identity = await CbioIdentity.load({
|
|
35
|
-
privateKey: process.env.AGENT_PRIV_KEY!,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const agent = identity.getAgent();
|
|
39
|
-
|
|
40
|
-
const openai = new OpenAI({
|
|
41
|
-
fetch: agent.createFetchWithAuth('openai'),
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const response = await openai.responses.create({
|
|
45
|
-
model: 'gpt-4.1',
|
|
46
|
-
input: 'Say hello in one sentence.',
|
|
47
|
-
});
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Store the secret under a name like `openai`, then reuse that secret name for all OpenAI requests.
|
|
51
|
-
|
|
52
|
-
## Anthropic
|
|
53
|
-
|
|
54
|
-
The official Anthropic TypeScript SDK also supports a custom `fetch` function.
|
|
55
|
-
|
|
56
|
-
```ts
|
|
57
|
-
import Anthropic from '@anthropic-ai/sdk';
|
|
58
|
-
import { CbioIdentity } from '@the-ai-company/agent-identity-sdk';
|
|
59
|
-
|
|
60
|
-
const identity = await CbioIdentity.load({
|
|
61
|
-
privateKey: process.env.AGENT_PRIV_KEY!,
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const agent = identity.getAgent();
|
|
65
|
-
|
|
66
|
-
const anthropic = new Anthropic({
|
|
67
|
-
fetch: agent.createFetchWithAuth('anthropic'),
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
const message = await anthropic.messages.create({
|
|
71
|
-
model: 'claude-sonnet-4-5',
|
|
72
|
-
max_tokens: 256,
|
|
73
|
-
messages: [{ role: 'user', content: 'Say hello in one sentence.' }],
|
|
74
|
-
});
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Use a dedicated secret name such as `anthropic`.
|
|
78
|
-
|
|
79
|
-
## Other SDKs that support custom fetch
|
|
80
|
-
|
|
81
|
-
Use the same pattern for any SDK that accepts:
|
|
82
|
-
|
|
83
|
-
- `fetch`
|
|
84
|
-
- a custom HTTP client built on `fetch`
|
|
85
|
-
- request options that let you swap the transport layer
|
|
86
|
-
|
|
87
|
-
The SDK does not need to know anything about Claw-biometric. It only needs to accept a `fetch` implementation.
|
|
88
|
-
|
|
89
|
-
## If the SDK does not support custom fetch
|
|
90
|
-
|
|
91
|
-
Do not solve that by calling `identity.getSecret(...)` inside agent logic just to feed a constructor that wants `apiKey: string`.
|
|
92
|
-
|
|
93
|
-
Use one of these official alternatives instead:
|
|
94
|
-
|
|
95
|
-
## Option 1: Call the provider API directly
|
|
96
|
-
|
|
97
|
-
Best when:
|
|
98
|
-
|
|
99
|
-
- the provider has a normal HTTP API
|
|
100
|
-
- you only need a few endpoints
|
|
101
|
-
- you want the smallest trusted surface
|
|
102
|
-
|
|
103
|
-
Example:
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
const response = await agent.fetchWithAuth(
|
|
107
|
-
'resend',
|
|
108
|
-
'https://api.resend.com/emails',
|
|
109
|
-
{
|
|
110
|
-
method: 'POST',
|
|
111
|
-
headers: { 'Content-Type': 'application/json' },
|
|
112
|
-
body: JSON.stringify({
|
|
113
|
-
from: 'onboarding@example.com',
|
|
114
|
-
to: ['user@example.com'],
|
|
115
|
-
subject: 'Hello',
|
|
116
|
-
html: '<strong>Welcome</strong>',
|
|
117
|
-
}),
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
This is the recommended path for SDKs whose official client only accepts a raw API key.
|
|
123
|
-
|
|
124
|
-
## Option 2: Use a local trusted proxy or broker
|
|
125
|
-
|
|
126
|
-
Best when:
|
|
127
|
-
|
|
128
|
-
- your team wants to keep the provider's official SDK
|
|
129
|
-
- the SDK only accepts `apiKey: string`
|
|
130
|
-
- you want to isolate key use from agent logic
|
|
131
|
-
|
|
132
|
-
Pattern:
|
|
133
|
-
|
|
134
|
-
```text
|
|
135
|
-
agent/runtime -> local trusted broker -> provider API
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
The agent talks to a local process over HTTP or IPC. The local process holds `identity` privileges or another trusted handle and injects authentication on the outbound request.
|
|
139
|
-
|
|
140
|
-
With the runtime helper, configure the upstream explicitly:
|
|
141
|
-
|
|
142
|
-
```ts
|
|
143
|
-
const proxy = await startLocalAuthProxy({
|
|
144
|
-
authHandle: agent,
|
|
145
|
-
secretName: 'openai',
|
|
146
|
-
upstreamBaseUrl: 'https://api.openai.com',
|
|
147
|
-
});
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
For providers that do not use `Authorization: Bearer ...`, override the auth settings:
|
|
151
|
-
|
|
152
|
-
```ts
|
|
153
|
-
const proxy = await startLocalAuthProxy({
|
|
154
|
-
authHandle: agent,
|
|
155
|
-
secretName: 'anthropic',
|
|
156
|
-
upstreamBaseUrl: 'https://api.anthropic.com',
|
|
157
|
-
authHeaderName: 'x-api-key',
|
|
158
|
-
authPrefix: '',
|
|
159
|
-
});
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Common examples:
|
|
163
|
-
|
|
164
|
-
- OpenAI: `upstreamBaseUrl: 'https://api.openai.com'`
|
|
165
|
-
- Anthropic: `upstreamBaseUrl: 'https://api.anthropic.com'`, `authHeaderName: 'x-api-key'`, `authPrefix: ''`
|
|
166
|
-
- Resend: `upstreamBaseUrl: 'https://api.resend.com'`
|
|
167
|
-
|
|
168
|
-
## Option 3: Run key-holding code in a separate trusted process
|
|
169
|
-
|
|
170
|
-
Best when:
|
|
171
|
-
|
|
172
|
-
- you already have a worker/service boundary
|
|
173
|
-
- you need the provider SDK exactly as-is
|
|
174
|
-
- you want process-level separation without introducing a local HTTP proxy
|
|
175
|
-
|
|
176
|
-
Pattern:
|
|
177
|
-
|
|
178
|
-
1. trusted process loads `AGENT_PRIV_KEY`
|
|
179
|
-
2. trusted process creates `identity`, then `agent`
|
|
180
|
-
3. untrusted process calls into the trusted process over RPC, IPC, or a queue
|
|
181
|
-
|
|
182
|
-
The important part is not the transport. The important part is that the untrusted runtime never gets plaintext credentials and never gets `identity`.
|
|
183
|
-
|
|
184
|
-
## Decision guide
|
|
185
|
-
|
|
186
|
-
Use this order:
|
|
187
|
-
|
|
188
|
-
1. If the SDK supports custom `fetch`, use `createFetchWithAuth(...)`.
|
|
189
|
-
2. If you only need HTTP calls, use `fetchWithAuth(...)` directly.
|
|
190
|
-
3. If the SDK only accepts a raw key, use a trusted proxy or separate trusted process.
|
|
191
|
-
|
|
192
|
-
Avoid:
|
|
193
|
-
|
|
194
|
-
- `identity.getSecret(...)` inside agent logic
|
|
195
|
-
- passing plaintext API keys into prompts, tools, or third-party SDK constructors
|
|
196
|
-
- loading `AGENT_PRIV_KEY` in the same process as untrusted tools or model-driven code
|
|
21
|
+
If a future SDK-facing custom-fetch helper is added, it must be implemented on top of the current vault-first modules.
|
package/docs/es/README.md
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
# cbio
|
|
1
|
+
# cbio Vault Runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Primera version publica del runtime centrado en autoridad.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Superficie principal:
|
|
6
|
+
- `vault-core`
|
|
7
|
+
- `clients/owner`
|
|
8
|
+
- `clients/agent`
|
|
9
|
+
- `vault-ingress`
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @the-ai-company/cbio-node-runtime
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Uso
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { CbioIdentity, generateIdentityKeys } from '@the-ai-company/cbio-node-runtime';
|
|
17
|
-
|
|
18
|
-
const keys = generateIdentityKeys();
|
|
19
|
-
const identity = await CbioIdentity.load({ privateKey: keys.privateKey });
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Compilación
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm run build
|
|
26
|
-
npm run test
|
|
27
|
-
```
|
|
11
|
+
La API antigua centrada en `CbioIdentity` ya no forma parte del producto.
|
package/docs/fr/README.md
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
# cbio
|
|
1
|
+
# cbio Vault Runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Premiere version publique du runtime centre sur l'autorite.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Surface principale :
|
|
6
|
+
- `vault-core`
|
|
7
|
+
- `clients/owner`
|
|
8
|
+
- `clients/agent`
|
|
9
|
+
- `vault-ingress`
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @the-ai-company/cbio-node-runtime
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Utilisation
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { CbioIdentity, generateIdentityKeys } from '@the-ai-company/cbio-node-runtime';
|
|
17
|
-
|
|
18
|
-
const keys = generateIdentityKeys();
|
|
19
|
-
const identity = await CbioIdentity.load({ privateKey: keys.privateKey });
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Compilation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm run build
|
|
26
|
-
npm run test
|
|
27
|
-
```
|
|
11
|
+
L'ancienne API centree sur `CbioIdentity` ne fait plus partie du produit.
|
package/docs/ja/README.md
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
# cbio
|
|
1
|
+
# cbio Vault Runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vault first の第一版ランタイムです。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
主な公開モジュール:
|
|
6
|
+
- `vault-core`
|
|
7
|
+
- `clients/owner`
|
|
8
|
+
- `clients/agent`
|
|
9
|
+
- `vault-ingress`
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @the-ai-company/cbio-node-runtime
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## 使用例
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { CbioIdentity, generateIdentityKeys } from '@the-ai-company/cbio-node-runtime';
|
|
17
|
-
|
|
18
|
-
const keys = generateIdentityKeys();
|
|
19
|
-
const identity = await CbioIdentity.load({ privateKey: keys.privateKey });
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## ビルド
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm run build
|
|
26
|
-
npm run test
|
|
27
|
-
```
|
|
11
|
+
旧 `CbioIdentity` 中心 API は公開面から外れています。
|
package/docs/ko/README.md
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
# cbio
|
|
1
|
+
# cbio Vault Runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
vault-first 1차 공개 런타임입니다.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
주요 공개 모듈:
|
|
6
|
+
- `vault-core`
|
|
7
|
+
- `clients/owner`
|
|
8
|
+
- `clients/agent`
|
|
9
|
+
- `vault-ingress`
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @the-ai-company/cbio-node-runtime
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## 사용법
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { CbioIdentity, generateIdentityKeys } from '@the-ai-company/cbio-node-runtime';
|
|
17
|
-
|
|
18
|
-
const keys = generateIdentityKeys();
|
|
19
|
-
const identity = await CbioIdentity.load({ privateKey: keys.privateKey });
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## 빌드
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm run build
|
|
26
|
-
npm run test
|
|
27
|
-
```
|
|
11
|
+
이전 `CbioIdentity` 중심 API 는 더 이상 제품 표면이 아닙니다.
|
package/docs/pt/README.md
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
# cbio
|
|
1
|
+
# cbio Vault Runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Primeira versao publica do runtime vault-first.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Superficie principal:
|
|
6
|
+
- `vault-core`
|
|
7
|
+
- `clients/owner`
|
|
8
|
+
- `clients/agent`
|
|
9
|
+
- `vault-ingress`
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @the-ai-company/cbio-node-runtime
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Uso
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { CbioIdentity, generateIdentityKeys } from '@the-ai-company/cbio-node-runtime';
|
|
17
|
-
|
|
18
|
-
const keys = generateIdentityKeys();
|
|
19
|
-
const identity = await CbioIdentity.load({ privateKey: keys.privateKey });
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Compilação
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm run build
|
|
26
|
-
npm run test
|
|
27
|
-
```
|
|
11
|
+
A antiga API centrada em `CbioIdentity` nao faz mais parte do produto.
|
package/docs/zh/README.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
# cbio
|
|
1
|
+
# cbio Vault Runtime
|
|
2
2
|
|
|
3
|
-
cbio
|
|
3
|
+
cbio 权限核心运行时。仅库,无 CLI 或 TUI。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
主入口现在围绕四个模块:
|
|
6
|
+
- `vault-core`
|
|
7
|
+
- `clients/owner`
|
|
8
|
+
- `clients/agent`
|
|
9
|
+
- `vault-ingress`
|
|
6
10
|
|
|
7
11
|
## 安装
|
|
8
12
|
|
|
@@ -13,12 +17,22 @@ npm install @the-ai-company/cbio-node-runtime
|
|
|
13
17
|
## 使用
|
|
14
18
|
|
|
15
19
|
```ts
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
import {
|
|
21
|
+
createVaultService,
|
|
22
|
+
InMemoryVaultCapabilityResolver,
|
|
23
|
+
LocalVaultTransport,
|
|
24
|
+
createOwnerClient,
|
|
25
|
+
createAgentClient,
|
|
26
|
+
} from '@the-ai-company/cbio-node-runtime';
|
|
20
27
|
```
|
|
21
28
|
|
|
29
|
+
## 架构
|
|
30
|
+
|
|
31
|
+
1. secret 明文只存在于 `vault-core`
|
|
32
|
+
2. `clients/owner` 负责 owner 写入与审计读取
|
|
33
|
+
3. `clients/agent` 负责 agent 签名 dispatch 请求
|
|
34
|
+
4. `vault-ingress` 负责在 vault 边界内部处理 capability 解析与 dispatch ingress
|
|
35
|
+
|
|
22
36
|
## 构建
|
|
23
37
|
|
|
24
38
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the-ai-company/cbio-node-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Node.js runtime for cbio identity and credential vault. Library only, no CLI or TUI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/runtime/index.js",
|
|
@@ -17,14 +17,6 @@
|
|
|
17
17
|
".": {
|
|
18
18
|
"import": "./dist/runtime/index.js",
|
|
19
19
|
"types": "./dist/runtime/index.d.ts"
|
|
20
|
-
},
|
|
21
|
-
"./protocol": {
|
|
22
|
-
"import": "./dist/protocol/identity.js",
|
|
23
|
-
"types": "./dist/protocol/identity.d.ts"
|
|
24
|
-
},
|
|
25
|
-
"./sealed": {
|
|
26
|
-
"import": "./dist/sealed/index.js",
|
|
27
|
-
"types": "./dist/sealed/index.d.ts"
|
|
28
20
|
}
|
|
29
21
|
},
|
|
30
22
|
"dependencies": {
|
|
@@ -34,7 +26,7 @@
|
|
|
34
26
|
"build": "node ./scripts/clean-dist.mjs && tsc",
|
|
35
27
|
"prepare": "npm run build",
|
|
36
28
|
"test": "npm run build && npm run test:acceptance",
|
|
37
|
-
"test:acceptance": "node tests/
|
|
29
|
+
"test:acceptance": "node tests/smoke/runtime-surface.js && node tests/smoke/policy-and-persistence.js && node tests/smoke/replay-guard.js && node tests/smoke/security-guards.js"
|
|
38
30
|
},
|
|
39
31
|
"keywords": [
|
|
40
32
|
"claw-biometric",
|