@forgezero/agent 0.1.0 → 0.1.2
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/dist/fz-agent.js +26 -1
- package/dist/index.d.ts +1 -1
- package/package.json +75 -71
package/dist/fz-agent.js
CHANGED
|
@@ -339,7 +339,7 @@ function createSecretCache(options) {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
// src/index.ts
|
|
342
|
-
var VERSION = "0.1.
|
|
342
|
+
var VERSION = "0.1.2";
|
|
343
343
|
function loadOrCreateSeed(path) {
|
|
344
344
|
if (existsSync2(path)) {
|
|
345
345
|
const seed2 = new Uint8Array(Buffer.from(readFileSync(path, "utf8").trim(), "base64url"));
|
|
@@ -371,6 +371,31 @@ function runAgent(config = {}) {
|
|
|
371
371
|
return { server, keys, nodeKey };
|
|
372
372
|
}
|
|
373
373
|
if (import.meta.main) {
|
|
374
|
+
const args = process.argv.slice(2);
|
|
375
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
376
|
+
console.log([
|
|
377
|
+
`fz-agent ${VERSION}`,
|
|
378
|
+
"",
|
|
379
|
+
"Runs on the metal and answers secret requests over a local socket.",
|
|
380
|
+
"It holds no configuration of its own \u2014 everything comes from the",
|
|
381
|
+
"environment, so a systemd unit is the whole deployment.",
|
|
382
|
+
"",
|
|
383
|
+
" FZ_SOCKET_PATH where to listen (default: " + DEFAULT_SOCKET_PATH + ")",
|
|
384
|
+
" FZ_SEED_PATH node identity seed (default: " + DEFAULT_SEED_PATH + ")",
|
|
385
|
+
" FZ_NODE_KEY override the node key (default: derived from the seed)",
|
|
386
|
+
"",
|
|
387
|
+
" --help, -h this text",
|
|
388
|
+
" --version, -v print the version and exit",
|
|
389
|
+
"",
|
|
390
|
+
"The seed is created on first run and never leaves the machine."
|
|
391
|
+
].join(`
|
|
392
|
+
`));
|
|
393
|
+
process.exit(0);
|
|
394
|
+
}
|
|
395
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
396
|
+
console.log(VERSION);
|
|
397
|
+
process.exit(0);
|
|
398
|
+
}
|
|
374
399
|
const { nodeKey } = runAgent({
|
|
375
400
|
socketPath: process.env.FZ_SOCKET_PATH ?? DEFAULT_SOCKET_PATH,
|
|
376
401
|
seedPath: process.env.FZ_SEED_PATH ?? DEFAULT_SEED_PATH,
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import type { SecretCache } from './cache';
|
|
|
25
25
|
* That preference was implemented in the client long before anything listened.
|
|
26
26
|
* See `socket.ts` for why it signs rather than handing back a token.
|
|
27
27
|
*/
|
|
28
|
-
export declare const VERSION = "0.1.
|
|
28
|
+
export declare const VERSION = "0.1.2";
|
|
29
29
|
export { startAgent, handleRequest } from './socket';
|
|
30
30
|
export type { AgentOptions, AttestationSource, Request, Response } from './socket';
|
|
31
31
|
export { createSecretCache, CacheError } from './cache';
|
package/package.json
CHANGED
|
@@ -1,73 +1,77 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
2
|
+
"//": "Publishing happens from an operator's machine, not CI \u2014 CLAUDE.md records that the absence of CI is deliberate. npm's `provenance` attests a tarball was built by a recognised CI provider from a named commit, so it cannot be produced here: it was set, and the first publish failed with `Automatic provenance generation not supported for provider: null`. A setting that can never be satisfied is worse than none, because it reads as a guarantee nobody is getting. Restore it the day this publishes from CI, and not before.",
|
|
3
|
+
"name": "@forgezero/agent",
|
|
4
|
+
"version": "0.1.2",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"check": "tsc --noEmit",
|
|
8
|
+
"build": "bun build src/index.ts --outfile dist/fz-agent.js --target bun --format esm --packages external && bun build src/provision.ts src/subscribe.ts src/pipeline.ts src/ssh-server.ts src/ssh-listen.ts --root src --outdir dist --target browser --format esm --packages external && tsc --emitDeclarationOnly --declaration --noEmit false --outDir dist",
|
|
9
|
+
"prepublishOnly": "bun run check && bun run build"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"typescript": "^5.6.0",
|
|
13
|
+
"@types/bun": "latest",
|
|
14
|
+
"@types/node": "^22.0.0",
|
|
15
|
+
"@noble/curves": "^2.2.0",
|
|
16
|
+
"@noble/post-quantum": "^0.6.1"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@forgezero/runtime": "^0.1.0",
|
|
20
|
+
"@forgezero/vault": "^0.1.0",
|
|
21
|
+
"@noble/curves": "^2.2.0",
|
|
22
|
+
"@noble/hashes": "^2.2.0",
|
|
23
|
+
"@noble/post-quantum": "^0.6.1",
|
|
24
|
+
"@scure/bip39": "^2.2.0"
|
|
25
|
+
},
|
|
26
|
+
"bin": {
|
|
27
|
+
"fz-agent": "./dist/fz-agent.js"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"README.md",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"description": "The ForgeZero node agent \u2014 holds a project-scoped vault replica in RAM and serves it over a unix socket, so applications hold no credential.",
|
|
39
|
+
"keywords": [
|
|
40
|
+
"agent",
|
|
41
|
+
"forgezero",
|
|
42
|
+
"vault",
|
|
43
|
+
"secrets",
|
|
44
|
+
"systemd",
|
|
45
|
+
"attestation",
|
|
46
|
+
"sev-snp"
|
|
47
|
+
],
|
|
48
|
+
"homepage": "https://forgezero.net/docs/agent",
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/axxra/forgezero.git",
|
|
52
|
+
"directory": "packages/agent"
|
|
53
|
+
},
|
|
54
|
+
"bugs": "https://github.com/axxra/forgezero/issues",
|
|
55
|
+
"exports": {
|
|
56
|
+
"./provision": {
|
|
57
|
+
"types": "./dist/provision.d.ts",
|
|
58
|
+
"default": "./dist/provision.js"
|
|
59
|
+
},
|
|
60
|
+
"./subscribe": {
|
|
61
|
+
"types": "./dist/subscribe.d.ts",
|
|
62
|
+
"default": "./dist/subscribe.js"
|
|
63
|
+
},
|
|
64
|
+
"./pipeline": {
|
|
65
|
+
"types": "./dist/pipeline.d.ts",
|
|
66
|
+
"default": "./dist/pipeline.js"
|
|
67
|
+
},
|
|
68
|
+
"./ssh-listen": {
|
|
69
|
+
"types": "./dist/ssh-listen.d.ts",
|
|
70
|
+
"default": "./dist/ssh-listen.js"
|
|
71
|
+
},
|
|
72
|
+
"./ssh-server": {
|
|
73
|
+
"types": "./dist/ssh-server.d.ts",
|
|
74
|
+
"default": "./dist/ssh-server.js"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
73
77
|
}
|