@forgezero/agent 0.1.41 → 0.1.42

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 (64) hide show
  1. package/README.md +299 -86
  2. package/dist/agent-heartbeat.js +6 -3
  3. package/dist/agent-update-helper.js +5 -2
  4. package/dist/agent-update.js +5 -2
  5. package/dist/bootstrap.d.ts +17 -8
  6. package/dist/bootstrap.js +1504 -512
  7. package/dist/cli/agent-install.d.ts +6 -5
  8. package/dist/cli/cloudflare-bootstrap.d.ts +12 -1
  9. package/dist/cli/maintenance.d.ts +23 -0
  10. package/dist/cli/run.d.ts +3 -1
  11. package/dist/cli/session-store.d.ts +5 -0
  12. package/dist/cloudflare-bootstrap.d.ts +73 -35
  13. package/dist/cloudflare-bootstrap.js +587 -90
  14. package/dist/cloudflare-edge.d.ts +64 -12
  15. package/dist/cloudflare-edge.js +103 -8
  16. package/dist/community-rehearsal-host.d.ts +51 -0
  17. package/dist/community-rehearsal-host.js +272 -0
  18. package/dist/credential-schema.d.ts +54 -0
  19. package/dist/credential-schema.js +47 -0
  20. package/dist/definition.d.ts +31 -5
  21. package/dist/definition.js +271 -44
  22. package/dist/deploy-file.js +294 -68
  23. package/dist/deployment-runner.js +18 -5
  24. package/dist/deployment.d.ts +13 -1
  25. package/dist/fz-agent.js +3932 -582
  26. package/dist/fz-git-ssh.js +122 -0
  27. package/dist/fz.js +3634 -1266
  28. package/dist/git-ssh.d.ts +5 -0
  29. package/dist/guest-enrolment.d.ts +2 -0
  30. package/dist/guest-enrolment.js +1 -0
  31. package/dist/host-maintenance.d.ts +39 -0
  32. package/dist/host-maintenance.js +135 -0
  33. package/dist/index.d.ts +4 -2
  34. package/dist/mesh-connector.d.ts +16 -0
  35. package/dist/mesh-connector.js +46 -0
  36. package/dist/metal-bootstrap.js +145 -7
  37. package/dist/metal-helper-socket.js +61 -31
  38. package/dist/metal-provision.d.ts +2 -2
  39. package/dist/metal-provision.js +62 -32
  40. package/dist/operator-bootstrap.d.ts +90 -0
  41. package/dist/operator-bootstrap.js +5704 -0
  42. package/dist/otel-collector.d.ts +18 -0
  43. package/dist/pipeline.d.ts +3 -2
  44. package/dist/pipeline.js +1 -1
  45. package/dist/platform-bootstrap-runtime.d.ts +39 -21
  46. package/dist/platform-bootstrap-runtime.js +182 -59
  47. package/dist/platform-fleet-verification.d.ts +19 -0
  48. package/dist/platform-fleet-verification.js +3873 -0
  49. package/dist/platform-genesis-config.d.ts +7 -0
  50. package/dist/platform-genesis.d.ts +17 -0
  51. package/dist/provision.d.ts +76 -3
  52. package/dist/provision.js +1061 -229
  53. package/dist/recovery-host.d.ts +7 -0
  54. package/dist/recovery-host.js +124 -0
  55. package/dist/service-supervisor.d.ts +42 -0
  56. package/dist/software-helper.d.ts +4 -0
  57. package/dist/software-helper.js +865 -63
  58. package/dist/software.d.ts +14 -3
  59. package/dist/software.js +163 -37
  60. package/dist/ssh-bootstrap.d.ts +97 -0
  61. package/dist/supervised-app.d.ts +2 -0
  62. package/dist/version.d.ts +1 -1
  63. package/package.json +175 -164
  64. package/schema/{deploy-v2.json → deploy-v3.json} +53 -6
package/package.json CHANGED
@@ -1,166 +1,177 @@
1
1
  {
2
- "name": "@forgezero/agent",
3
- "version": "0.1.41",
4
- "type": "module",
5
- "scripts": {
6
- "check": "tsc --noEmit",
7
- "prebuild": "rm -rf dist",
8
- "build": "bun build src/index.ts --outfile dist/fz-agent.js --target bun --format esm && bun build src/cli/index.ts --outfile dist/fz.js --target bun --format esm && bun build src/compute.ts src/provision.ts src/subscribe.ts src/pipeline.ts src/definition.ts src/deploy-file.ts src/ssh-server.ts src/ssh-listen.ts src/provisioning-pull.ts src/migration-pull.ts src/guest-enrolment.ts src/node-vault.ts src/credential-schema.ts src/metal-provision.ts src/metal-helper-socket.ts src/lifecycle-helper.ts src/deployment-runner.ts src/agent-update.ts src/agent-update-helper.ts src/agent-heartbeat.ts src/software.ts src/software-helper.ts src/ubuntu.ts src/capacity-calibration.ts src/platform-bootstrap-runtime.ts --root src --outdir dist --target browser --format esm --packages external && bun build src/project-context.ts src/bootstrap.ts src/metal-bootstrap.ts src/cloudflare-bootstrap.ts src/cloudflare-edge.ts --root src --outdir dist --target bun --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
- "@forgezero/access": "0.1.3",
16
- "@noble/curves": "^2.2.0",
17
- "@noble/post-quantum": "^0.6.1"
18
- },
19
- "dependencies": {
20
- "@forgezero/runtime": "0.1.7",
21
- "@forgezero/vault": "0.1.11",
22
- "@noble/curves": "2.2.0",
23
- "@noble/hashes": "2.2.0",
24
- "@noble/post-quantum": "0.6.1",
25
- "@scure/bip39": "2.2.0"
26
- },
27
- "bin": {
28
- "fz-agent": "dist/fz-agent.js",
29
- "fz": "dist/fz.js"
30
- },
31
- "publishConfig": {
32
- "access": "public",
33
- "provenance": true
34
- },
35
- "files": [
36
- "dist",
37
- "schema",
38
- "README.md",
39
- "LICENSE"
40
- ],
41
- "license": "MIT",
42
- "description": "ForgeZero machine tooling: the fz operator command and fz-agent for vault access, provisioning and deployment.",
43
- "keywords": [
44
- "agent",
45
- "forgezero",
46
- "vault",
47
- "secrets",
48
- "systemd",
49
- "attestation",
50
- "sev-snp"
51
- ],
52
- "homepage": "https://www.forgezero.net/docs/agent",
53
- "repository": {
54
- "type": "git",
55
- "url": "git+https://github.com/forgezero-net/packages.git",
56
- "directory": "agent"
57
- },
58
- "bugs": "https://github.com/forgezero-net/packages/issues",
59
- "exports": {
60
- "./provision": {
61
- "types": "./dist/provision.d.ts",
62
- "default": "./dist/provision.js"
63
- },
64
- "./subscribe": {
65
- "types": "./dist/subscribe.d.ts",
66
- "default": "./dist/subscribe.js"
67
- },
68
- "./pipeline": {
69
- "types": "./dist/pipeline.d.ts",
70
- "default": "./dist/pipeline.js"
71
- },
72
- "./definition": {
73
- "types": "./dist/definition.d.ts",
74
- "default": "./dist/definition.js"
75
- },
76
- "./deploy-file": {
77
- "types": "./dist/deploy-file.d.ts",
78
- "default": "./dist/deploy-file.js"
79
- },
80
- "./schema/deploy-v2.json": "./schema/deploy-v2.json",
81
- "./ssh-listen": {
82
- "types": "./dist/ssh-listen.d.ts",
83
- "default": "./dist/ssh-listen.js"
84
- },
85
- "./ssh-server": {
86
- "types": "./dist/ssh-server.d.ts",
87
- "default": "./dist/ssh-server.js"
88
- },
89
- "./compute": {
90
- "types": "./dist/compute.d.ts",
91
- "default": "./dist/compute.js"
92
- },
93
- "./provisioning-pull": {
94
- "types": "./dist/provisioning-pull.d.ts",
95
- "default": "./dist/provisioning-pull.js"
96
- },
97
- "./migration-pull": {
98
- "types": "./dist/migration-pull.d.ts",
99
- "default": "./dist/migration-pull.js"
100
- },
101
- "./lifecycle-helper": {
102
- "types": "./dist/lifecycle-helper.d.ts",
103
- "default": "./dist/lifecycle-helper.js"
104
- },
105
- "./agent-update": {
106
- "types": "./dist/agent-update.d.ts",
107
- "default": "./dist/agent-update.js"
108
- },
109
- "./agent-update-helper": {
110
- "types": "./dist/agent-update-helper.d.ts",
111
- "default": "./dist/agent-update-helper.js"
112
- },
113
- "./agent-heartbeat": {
114
- "types": "./dist/agent-heartbeat.d.ts",
115
- "default": "./dist/agent-heartbeat.js"
116
- },
117
- "./software": {
118
- "types": "./dist/software.d.ts",
119
- "default": "./dist/software.js"
120
- },
121
- "./software-helper": {
122
- "types": "./dist/software-helper.d.ts",
123
- "default": "./dist/software-helper.js"
124
- },
125
- "./metal-provision": {
126
- "types": "./dist/metal-provision.d.ts",
127
- "default": "./dist/metal-provision.js"
128
- },
129
- "./ubuntu": {
130
- "types": "./dist/ubuntu.d.ts",
131
- "default": "./dist/ubuntu.js"
132
- },
133
- "./project-context": {
134
- "types": "./dist/project-context.d.ts",
135
- "default": "./dist/project-context.js"
136
- },
137
- "./capacity-calibration": {
138
- "types": "./dist/capacity-calibration.d.ts",
139
- "default": "./dist/capacity-calibration.js"
140
- },
141
- "./cloudflare-bootstrap": {
142
- "types": "./dist/cloudflare-bootstrap.d.ts",
143
- "default": "./dist/cloudflare-bootstrap.js"
144
- },
145
- "./cloudflare-edge": {
146
- "types": "./dist/cloudflare-edge.d.ts",
147
- "default": "./dist/cloudflare-edge.js"
148
- },
149
- "./bootstrap": {
150
- "types": "./dist/bootstrap.d.ts",
151
- "default": "./dist/bootstrap.js"
152
- },
153
- "./credential-schema": {
154
- "types": "./dist/credential-schema.d.ts",
155
- "default": "./dist/credential-schema.js"
156
- },
157
- "./platform-bootstrap-runtime": {
158
- "types": "./dist/platform-bootstrap-runtime.d.ts",
159
- "default": "./dist/platform-bootstrap-runtime.js"
160
- },
161
- "./metal-bootstrap": {
162
- "types": "./dist/metal-bootstrap.d.ts",
163
- "default": "./dist/metal-bootstrap.js"
164
- }
165
- }
2
+ "name": "@forgezero/agent",
3
+ "version": "0.1.42",
4
+ "type": "module",
5
+ "scripts": {
6
+ "check": "tsc --noEmit",
7
+ "build": "bun ../tools/package-task.ts build agent",
8
+ "prepublishOnly": "bun ../tools/package-task.ts prepublish agent"
9
+ },
10
+ "devDependencies": {
11
+ "typescript": "^5.6.0",
12
+ "@types/bun": "latest",
13
+ "@types/node": "^22.0.0",
14
+ "@forgezero/access": "0.1.4",
15
+ "@noble/curves": "^2.2.0",
16
+ "@noble/post-quantum": "^0.6.1"
17
+ },
18
+ "dependencies": {
19
+ "@forgezero/runtime": "0.1.8",
20
+ "@forgezero/vault": "0.1.12",
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
+ "fz": "dist/fz.js"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public",
32
+ "provenance": false
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "schema",
37
+ "README.md",
38
+ "LICENSE"
39
+ ],
40
+ "license": "MIT",
41
+ "description": "ForgeZero machine tooling: the fz operator command and fz-agent for vault access, provisioning and deployment.",
42
+ "keywords": [
43
+ "agent",
44
+ "forgezero",
45
+ "vault",
46
+ "secrets",
47
+ "systemd",
48
+ "attestation",
49
+ "sev-snp"
50
+ ],
51
+ "homepage": "https://www.forgezero.net/docs/agent",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/forgezero-net/packages.git",
55
+ "directory": "agent"
56
+ },
57
+ "bugs": "https://github.com/forgezero-net/packages/issues",
58
+ "exports": {
59
+ "./provision": {
60
+ "types": "./dist/provision.d.ts",
61
+ "default": "./dist/provision.js"
62
+ },
63
+ "./subscribe": {
64
+ "types": "./dist/subscribe.d.ts",
65
+ "default": "./dist/subscribe.js"
66
+ },
67
+ "./pipeline": {
68
+ "types": "./dist/pipeline.d.ts",
69
+ "default": "./dist/pipeline.js"
70
+ },
71
+ "./definition": {
72
+ "types": "./dist/definition.d.ts",
73
+ "default": "./dist/definition.js"
74
+ },
75
+ "./deploy-file": {
76
+ "types": "./dist/deploy-file.d.ts",
77
+ "default": "./dist/deploy-file.js"
78
+ },
79
+ "./schema/deploy-v3.json": "./schema/deploy-v3.json",
80
+ "./ssh-listen": {
81
+ "types": "./dist/ssh-listen.d.ts",
82
+ "default": "./dist/ssh-listen.js"
83
+ },
84
+ "./ssh-server": {
85
+ "types": "./dist/ssh-server.d.ts",
86
+ "default": "./dist/ssh-server.js"
87
+ },
88
+ "./compute": {
89
+ "types": "./dist/compute.d.ts",
90
+ "default": "./dist/compute.js"
91
+ },
92
+ "./provisioning-pull": {
93
+ "types": "./dist/provisioning-pull.d.ts",
94
+ "default": "./dist/provisioning-pull.js"
95
+ },
96
+ "./migration-pull": {
97
+ "types": "./dist/migration-pull.d.ts",
98
+ "default": "./dist/migration-pull.js"
99
+ },
100
+ "./lifecycle-helper": {
101
+ "types": "./dist/lifecycle-helper.d.ts",
102
+ "default": "./dist/lifecycle-helper.js"
103
+ },
104
+ "./agent-update": {
105
+ "types": "./dist/agent-update.d.ts",
106
+ "default": "./dist/agent-update.js"
107
+ },
108
+ "./agent-update-helper": {
109
+ "types": "./dist/agent-update-helper.d.ts",
110
+ "default": "./dist/agent-update-helper.js"
111
+ },
112
+ "./agent-heartbeat": {
113
+ "types": "./dist/agent-heartbeat.d.ts",
114
+ "default": "./dist/agent-heartbeat.js"
115
+ },
116
+ "./software": {
117
+ "types": "./dist/software.d.ts",
118
+ "default": "./dist/software.js"
119
+ },
120
+ "./software-helper": {
121
+ "types": "./dist/software-helper.d.ts",
122
+ "default": "./dist/software-helper.js"
123
+ },
124
+ "./operator-bootstrap": {
125
+ "types": "./dist/operator-bootstrap.d.ts",
126
+ "default": "./dist/operator-bootstrap.js"
127
+ },
128
+ "./host-maintenance": {
129
+ "types": "./dist/host-maintenance.d.ts",
130
+ "default": "./dist/host-maintenance.js"
131
+ },
132
+ "./metal-provision": {
133
+ "types": "./dist/metal-provision.d.ts",
134
+ "default": "./dist/metal-provision.js"
135
+ },
136
+ "./ubuntu": {
137
+ "types": "./dist/ubuntu.d.ts",
138
+ "default": "./dist/ubuntu.js"
139
+ },
140
+ "./project-context": {
141
+ "types": "./dist/project-context.d.ts",
142
+ "default": "./dist/project-context.js"
143
+ },
144
+ "./capacity-calibration": {
145
+ "types": "./dist/capacity-calibration.d.ts",
146
+ "default": "./dist/capacity-calibration.js"
147
+ },
148
+ "./cloudflare-bootstrap": {
149
+ "types": "./dist/cloudflare-bootstrap.d.ts",
150
+ "default": "./dist/cloudflare-bootstrap.js"
151
+ },
152
+ "./cloudflare-edge": {
153
+ "types": "./dist/cloudflare-edge.d.ts",
154
+ "default": "./dist/cloudflare-edge.js"
155
+ },
156
+ "./mesh-connector": {
157
+ "types": "./dist/mesh-connector.d.ts",
158
+ "default": "./dist/mesh-connector.js"
159
+ },
160
+ "./bootstrap": {
161
+ "types": "./dist/bootstrap.d.ts",
162
+ "default": "./dist/bootstrap.js"
163
+ },
164
+ "./credential-schema": {
165
+ "types": "./dist/credential-schema.d.ts",
166
+ "default": "./dist/credential-schema.js"
167
+ },
168
+ "./platform-bootstrap-runtime": {
169
+ "types": "./dist/platform-bootstrap-runtime.d.ts",
170
+ "default": "./dist/platform-bootstrap-runtime.js"
171
+ },
172
+ "./metal-bootstrap": {
173
+ "types": "./dist/metal-bootstrap.d.ts",
174
+ "default": "./dist/metal-bootstrap.js"
175
+ }
176
+ }
166
177
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://www.forgezero.net/schemas/deploy-v2.json",
3
+ "$id": "https://www.forgezero.net/schemas/deploy-v3.json",
4
4
  "title": "ForgeZero deployment pipeline",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "required": ["version", "name", "profiles", "steps"],
8
8
  "properties": {
9
- "$schema": { "type": "string", "const": "https://www.forgezero.net/schemas/deploy-v2.json" },
10
- "version": { "const": 2 },
9
+ "$schema": { "type": "string", "const": "https://www.forgezero.net/schemas/deploy-v3.json" },
10
+ "version": { "const": 3 },
11
11
  "name": { "type": "string", "minLength": 1, "maxLength": 120 },
12
12
  "requireAttestation": { "type": "boolean" },
13
13
  "profiles": {
@@ -28,11 +28,52 @@
28
28
  "additionalProperties": false,
29
29
  "required": ["id", "version"],
30
30
  "properties": {
31
- "id": { "enum": ["bun", "nginx", "arangodb", "cloudflared", "ufw", "openssh-client"] },
31
+ "id": { "enum": ["bun", "nginx", "arangodb", "cloudflared", "cloudflare-warp", "ufw", "openssh-client"] },
32
32
  "version": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9.-]{0,31}$" }
33
33
  }
34
34
  }
35
35
  },
36
+ "service": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["strategy", "publicPort", "applicationPorts", "command", "healthPath"],
40
+ "properties": {
41
+ "strategy": { "enum": ["direct", "blue-green"] },
42
+ "publicPort": { "type": "integer", "minimum": 1024, "maximum": 65535 },
43
+ "applicationPorts": {
44
+ "oneOf": [
45
+ {
46
+ "type": "object", "additionalProperties": false,
47
+ "required": ["mode", "ports"],
48
+ "properties": {
49
+ "mode": { "const": "fixed" },
50
+ "ports": {
51
+ "type": "array", "minItems": 1, "maxItems": 2, "uniqueItems": true,
52
+ "items": { "type": "integer", "minimum": 1024, "maximum": 65535 }
53
+ }
54
+ }
55
+ },
56
+ {
57
+ "type": "object", "additionalProperties": false,
58
+ "required": ["mode", "from", "to"],
59
+ "properties": {
60
+ "mode": { "const": "dynamic" },
61
+ "from": { "type": "integer", "minimum": 1024, "maximum": 65535 },
62
+ "to": { "type": "integer", "minimum": 1024, "maximum": 65535 }
63
+ }
64
+ }
65
+ ]
66
+ },
67
+ "command": {
68
+ "type": "array", "minItems": 1, "maxItems": 256,
69
+ "items": { "type": "string", "minLength": 1, "maxLength": 16384 }
70
+ },
71
+ "healthPath": { "type": "string", "pattern": "^/", "maxLength": 256 },
72
+ "maxConnections": { "type": "integer", "minimum": 1, "maximum": 1000000 },
73
+ "websocket": { "type": "boolean" },
74
+ "drainMs": { "type": "integer", "minimum": 0, "maximum": 300000 }
75
+ }
76
+ },
36
77
  "capacityCalibration": {
37
78
  "type": "object",
38
79
  "additionalProperties": false,
@@ -53,10 +94,11 @@
53
94
  "steps": {
54
95
  "type": "array",
55
96
  "minItems": 1,
97
+ "maxItems": 256,
56
98
  "items": {
57
99
  "type": "object",
58
100
  "additionalProperties": false,
59
- "required": ["name", "phase", "scope", "run"],
101
+ "required": ["name", "phase", "scope", "exec"],
60
102
  "properties": {
61
103
  "name": { "type": "string", "minLength": 1 },
62
104
  "phase": { "enum": ["build", "release", "migrate", "health"] },
@@ -67,7 +109,12 @@
67
109
  "uniqueItems": true,
68
110
  "items": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,62}$" }
69
111
  },
70
- "run": { "type": "string", "minLength": 1 },
112
+ "exec": {
113
+ "type": "array",
114
+ "minItems": 1,
115
+ "maxItems": 256,
116
+ "items": { "type": "string", "minLength": 1, "maxLength": 16384 }
117
+ },
71
118
  "secrets": { "type": "array", "items": { "type": "string", "pattern": "^[A-Z_][A-Z0-9_]*$" }, "uniqueItems": true },
72
119
  "always": { "type": "boolean" },
73
120
  "when": {