@forgezero/vault 0.1.11 → 0.1.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  GENERATED FILE — do not edit.
3
3
 
4
- Change scripts/generate-guides.ts or its typed sources, run `bun run guides`,
4
+ Change tools/generate-guides.ts or its typed sources, run `bun run guides`,
5
5
  and commit the generator and rendered files together.
6
6
  -->
7
7
 
@@ -9,14 +9,39 @@
9
9
 
10
10
  One scoped contract over platform-direct, managed-agent and external API-key trust paths.
11
11
 
12
- ## Global package root and supported runtimes
12
+ ## Package overview
13
13
 
14
- The scoped vault facade. A tenant application uses its local agent or an API key; trusted platform code injects a direct realm backend instead of calling itself. The one package that ends up in somebody else's production dependency tree, which is why it stays alone and stays small. Supported runtimes: bun, node, workers, deno. The global base/root import is @forgezero/vault. Every public import or command is listed below; the documentation inventory is checked in both directions against package.json exports.
14
+ The scoped vault facade. A tenant application uses its local agent or an API key; trusted platform code injects a direct realm backend instead of calling itself. The one package that ends up in somebody else's production dependency tree, which is why it stays alone and stays small. Supported runtimes: bun, node, workers, deno. Package root: @forgezero/vault. The sections below show the actual named imports emitted by each declaration entry point; wildcard imports are intentionally not used in the documentation.
15
15
 
16
16
  ```text
17
- import * as root from '@forgezero/vault';
17
+ bun add @forgezero/vault
18
18
  ```
19
19
 
20
+ ## ForgeZero package family
21
+
22
+ The five packages are installation boundaries. Choose a package by who installs it; choose a subpath by the capability used in that file.
23
+
24
+ | package | short description | runtimes | documentation |
25
+ |---|---|---|---|
26
+ | @forgezero/vault | Scoped secret access with Agent, API-key and systemd-credential sources. | bun, node, workers, deno | [Open](https://www.forgezero.net/docs/vault-package) |
27
+ | @forgezero/access | Typed route, principal, factor, RBAC and request-pipeline contracts. | bun, node, workers, deno | [Open](https://www.forgezero.net/docs/access) |
28
+ | @forgezero/providers | Typed external providers with priority, health and classified fallback. | bun, node, workers, deno | [Open](https://www.forgezero.net/docs/providers) |
29
+ | @forgezero/runtime | Portable runtime primitives for queries, jobs, events, schemas and finance. | bun, node | [Open](https://www.forgezero.net/docs/runtime) |
30
+ | @forgezero/agent | Operator CLI and managed-node agent for bootstrap, deploy and lifecycle. | bun, node | [Open](https://www.forgezero.net/docs/agent) |
31
+
32
+ ## @forgezero/vault public imports and commands
33
+
34
+ Every row links to the detailed explanation and named-import/example area below. This table and those details are generated from the package inventory and emitted declarations.
35
+
36
+ | public entry | short description | runtime | details |
37
+ |---|---|---|---|
38
+ | @forgezero/vault | One scoped contract over an explicitly injected platform backend, a managed tenant socket or an automatically derived external API-key signer. | portable | [Details + example](#forgezero-vault) |
39
+ | @forgezero/vault/schema | Where an entry’s shape comes from: pulled from the platform when ForgeZero has to render it, declared locally when only the tenant needs it. | portable | [Details + example](#forgezero-vault-schema) |
40
+ | @forgezero/vault/config | Read `.fz/config.json` — which project, which environment, which secrets, and what to call them. | portable | [Details + example](#forgezero-vault-config) |
41
+ | @forgezero/vault/env | Envless: fill `process.env` from the vault at boot, refusing to run during a build. | portable | [Details + example](#forgezero-vault-env) |
42
+ | @forgezero/vault/frameworks | SvelteKit and Next.js wiring, attached at the one place that runs once, on the server, before any request. | portable | [Details + example](#forgezero-vault-frameworks) |
43
+ | @forgezero/vault/providers | Adapters that make Vault a provider-configuration and credential source without coupling the providers package to ForgeZero. | portable | [Details + example](#forgezero-vault-providers) |
44
+
20
45
  ## Commands
21
46
 
22
47
  bun add @forgezero/vault — Install the scoped Vault client and its public subpaths.
@@ -25,63 +50,185 @@ bun add @forgezero/vault — Install the scoped Vault client and its public subp
25
50
  bun add @forgezero/vault
26
51
  ```
27
52
 
53
+ <a id="forgezero-vault"></a>
28
54
  ## @forgezero/vault
29
55
 
30
- One scoped contract over an explicitly injected platform backend, a managed tenant socket or an automatically derived external API-key signer.
56
+ One scoped contract over an explicitly injected platform backend, a managed tenant socket or an automatically derived external API-key signer. This entry exposes 13 named value exports and 12 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
31
57
 
32
58
  ```text
33
- import * as api from '@forgezero/vault';
59
+ import {
60
+ DEFAULT_API_URL,
61
+ DEFAULT_REQUEST_TIMEOUT_MS,
62
+ DEFAULT_SOCKET,
63
+ ForgeZero,
64
+ VERSION,
65
+ VaultError,
66
+ createVault,
67
+ directCredentials,
68
+ discover,
69
+ managedAgentTransport,
70
+ signerFromApiKey,
71
+ systemdCredentials,
72
+ vaultCredentials,
73
+ } from '@forgezero/vault';
74
+
75
+ import type {
76
+ AgentRequest,
77
+ AgentResponse,
78
+ AgentTransport,
79
+ Change,
80
+ Credential,
81
+ CredentialMode,
82
+ DiscoveryEnvironment,
83
+ EntryMeta,
84
+ SignRequest,
85
+ Signer,
86
+ SystemdCredentialOptions,
87
+ VaultOptions,
88
+ } from '@forgezero/vault';
34
89
  ```
35
90
 
36
- ## @forgezero/vault/schema
91
+ ## @forgezero/vault — Read a scoped secret
37
92
 
38
- Where an entry’s shape comes from: pulled from the platform when ForgeZero has to render it, declared locally when only the tenant needs it.
93
+ The same client discovers the managed Agent socket or uses an external API-key signer. Project and environment remain explicit.
39
94
 
40
95
  ```text
41
- import * as api from '@forgezero/vault/schema';
96
+ import {
97
+ createVault,
98
+ } from '@forgezero/vault';
99
+
100
+ const vault = createVault({ project: 'payments', environment: 'production' });
101
+ const token = await vault.get('STRIPE_KEY');
42
102
  ```
43
103
 
44
- ## @forgezero/vault/config
104
+ <a id="forgezero-vault-schema"></a>
105
+ ## @forgezero/vault/schema
45
106
 
46
- Read `.fz/config.json` which project, which environment, which secrets, and what to call them.
107
+ Where an entry’s shape comes from: pulled from the platform when ForgeZero has to render it, declared locally when only the tenant needs it. This entry exposes 3 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
47
108
 
48
109
  ```text
49
- import * as api from '@forgezero/vault/config';
110
+ import {
111
+ localSchemas,
112
+ managedSchemas,
113
+ preferManaged,
114
+ } from '@forgezero/vault/schema';
115
+
116
+ import type {
117
+ SchemaRef,
118
+ SchemaSource,
119
+ } from '@forgezero/vault/schema';
50
120
  ```
51
121
 
52
- ## @forgezero/vault/env
122
+ ## @forgezero/vault/schema — Managed schema with a local fallback
53
123
 
54
- Envless: fill `process.env` from the vault at boot, refusing to run during a build.
124
+ Managed schemas let ForgeZero render and validate a provider form. Local schemas keep tenant-owned extensions independent. Managed wins when both define the same name; the version travels with the shape and no credential value is stored in the schema.
55
125
 
56
126
  ```text
57
- import * as api from '@forgezero/vault/env';
127
+ import {
128
+ managedSchemas,
129
+ localSchemas,
130
+ preferManaged,
131
+ } from '@forgezero/vault/schema';
132
+ import {
133
+ createVault,
134
+ } from '@forgezero/vault';
135
+
136
+ const vault = createVault({ project: 'payments', environment: 'production' });
137
+ const schemas = preferManaged(
138
+ managedSchemas(vault),
139
+ localSchemas({
140
+ postmark: { version: 1, schema: {
141
+ type: 'object', additionalProperties: false,
142
+ properties: { apiKey: { type: 'string', title: 'API key', writeOnly: true } },
143
+ required: ['apiKey']
144
+ } }
145
+ })
146
+ );
147
+ const { schema, version } = await schemas.get('postmark');
58
148
  ```
59
149
 
60
- ## @forgezero/vault/frameworks
150
+ <a id="forgezero-vault-config"></a>
151
+ ## @forgezero/vault/config
61
152
 
62
- SvelteKit and Next.js wiring, attached at the one place that runs once, on the server, before any request.
153
+ Read `.fz/config.json` — which project, which environment, which secrets, and what to call them. This entry exposes 8 named value exports and 3 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
63
154
 
64
155
  ```text
65
- import * as api from '@forgezero/vault/frameworks';
156
+ import {
157
+ CONFIG_PATHS,
158
+ ConfigError,
159
+ assertNoSecrets,
160
+ bindingsOf,
161
+ exampleConfig,
162
+ loadConfig,
163
+ parseConfig,
164
+ resolveConfig,
165
+ } from '@forgezero/vault/config';
166
+
167
+ import type {
168
+ FzConfig,
169
+ LoadOptions,
170
+ SecretBinding,
171
+ } from '@forgezero/vault/config';
66
172
  ```
67
173
 
68
- ## @forgezero/vault/providers
174
+ <a id="forgezero-vault-env"></a>
175
+ ## @forgezero/vault/env
69
176
 
70
- Adapters that make Vault a provider-configuration and credential source without coupling the providers package to ForgeZero.
177
+ Envless: fill `process.env` from the vault at boot, refusing to run during a build. This entry exposes 5 named value exports and 3 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
71
178
 
72
179
  ```text
73
- import * as api from '@forgezero/vault/providers';
180
+ import {
181
+ EnvError,
182
+ clearEnv,
183
+ describeReport,
184
+ hydrateEnv,
185
+ isBuildTime,
186
+ } from '@forgezero/vault/env';
187
+
188
+ import type {
189
+ HydrateOptions,
190
+ HydrateReport,
191
+ SecretReader,
192
+ } from '@forgezero/vault/env';
74
193
  ```
75
194
 
76
- ## Read a scoped secret
195
+ <a id="forgezero-vault-frameworks"></a>
196
+ ## @forgezero/vault/frameworks
77
197
 
78
- The same client discovers the managed Agent socket or uses an external API-key signer. Project and environment remain explicit.
198
+ SvelteKit and Next.js wiring, attached at the one place that runs once, on the server, before any request. This entry exposes 6 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
79
199
 
80
200
  ```text
81
- import { createVault } from '@forgezero/vault';
201
+ import {
202
+ bootstrapEnv,
203
+ forgeZeroHandle,
204
+ forgeZeroInit,
205
+ forgeZeroRegister,
206
+ resetHydration,
207
+ setupEnv,
208
+ } from '@forgezero/vault/frameworks';
209
+
210
+ import type {
211
+ SetupOptions,
212
+ SvelteKitHandleEvent,
213
+ } from '@forgezero/vault/frameworks';
214
+ ```
82
215
 
83
- const vault = createVault({ project: 'payments', environment: 'production' });
84
- const token = await vault.get('STRIPE_KEY');
216
+ <a id="forgezero-vault-providers"></a>
217
+ ## @forgezero/vault/providers
218
+
219
+ Adapters that make Vault a provider-configuration and credential source without coupling the providers package to ForgeZero. This entry exposes 2 named value exports and 3 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
220
+
221
+ ```text
222
+ import {
223
+ vaultConfig,
224
+ vaultCredentials,
225
+ } from '@forgezero/vault/providers';
226
+
227
+ import type {
228
+ StoredProviderInstance,
229
+ StoredServiceMethodAttachment,
230
+ VaultConfigOptions,
231
+ } from '@forgezero/vault/providers';
85
232
  ```
86
233
 
87
234
  ## Three paths, and why they stay explicit
@@ -111,7 +258,9 @@ bun add @forgezero/vault
111
258
  The project and environment are explicit application scope. Managed compute uses the local Agent socket; external runtimes use the stable API origin and their scoped key.
112
259
 
113
260
  ```text
114
- import { ForgeZero } from '@forgezero/vault';
261
+ import {
262
+ ForgeZero,
263
+ } from '@forgezero/vault';
115
264
 
116
265
  const fz = new ForgeZero({ project: 'altpilot', environment: 'production' });
117
266
 
package/dist/index.d.ts CHANGED
@@ -282,4 +282,4 @@ export declare function systemdCredentials(options?: SystemdCredentialOptions):
282
282
  readonly name: 'systemd';
283
283
  get(reference: string, field: string): Promise<string>;
284
284
  };
285
- export declare const VERSION = "0.1.11";
285
+ export declare const VERSION = "0.1.13";
package/dist/index.js CHANGED
@@ -382,7 +382,7 @@ function systemdCredentials(options = {}) {
382
382
  }
383
383
  };
384
384
  }
385
- var VERSION = "0.1.11";
385
+ var VERSION = "0.1.13";
386
386
  export {
387
387
  vaultCredentials,
388
388
  systemdCredentials,
package/dist/providers.js CHANGED
@@ -382,7 +382,7 @@ function systemdCredentials(options = {}) {
382
382
  }
383
383
  };
384
384
  }
385
- var VERSION = "0.1.11";
385
+ var VERSION = "0.1.13";
386
386
 
387
387
  // src/providers.ts
388
388
  var MISSING = new Set(["ENTRY_NOT_FOUND", "VERSION_NOT_FOUND"]);
package/dist/schema.js CHANGED
@@ -382,7 +382,7 @@ function systemdCredentials(options = {}) {
382
382
  }
383
383
  };
384
384
  }
385
- var VERSION = "0.1.11";
385
+ var VERSION = "0.1.13";
386
386
 
387
387
  // src/schema.ts
388
388
  function managedSchemas(vault, options = {}) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@forgezero/vault",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
- "publishConfig": {
6
- "access": "public",
7
- "provenance": true
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "provenance": false
8
8
  },
9
9
  "exports": {
10
10
  ".": {
@@ -32,18 +32,17 @@
32
32
  "default": "./dist/providers.js"
33
33
  }
34
34
  },
35
- "scripts": {
36
- "check": "tsc --noEmit",
37
- "prebuild": "rm -rf dist",
38
- "build": "bun build src/index.ts src/config.ts src/schema.ts src/env.ts src/frameworks.ts src/providers.ts --root src --outdir dist --target browser --format esm --packages external && tsc --emitDeclarationOnly --declaration --noEmit false --outDir dist",
39
- "prepublishOnly": "bun run check && bun run build"
35
+ "scripts": {
36
+ "check": "tsc --noEmit",
37
+ "build": "bun ../tools/package-task.ts build vault",
38
+ "prepublishOnly": "bun ../tools/package-task.ts prepublish vault"
40
39
  },
41
40
  "devDependencies": {
42
41
  "typescript": "^5.6.0",
43
42
  "@types/bun": "latest"
44
43
  },
45
44
  "dependencies": {
46
- "@forgezero/runtime": "^0.1.7"
45
+ "@forgezero/runtime": "^0.1.9"
47
46
  },
48
47
  "peerDependencies": {
49
48
  "@noble/curves": "^2.2.0",