@forgezero/agent 0.1.59 → 0.1.61

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
@@ -302,7 +302,7 @@ import type { OperatorPlatformBootstrapOptions, OperatorPlatformBootstrapPlan, O
302
302
 
303
303
  ## @forgezero/agent/operator-bootstrap — Run the same typed platform bootstrap from an operator laptop
304
304
 
305
- The request contains only an explicit target IP, pinned host public key/fingerprint, the caller public-key file, SSH-agent socket and a path to the reviewed platform config. Credential values stay in owner-only files, the private SSH key stays in the operator agent, and the default command is a non-contacting plan.
305
+ The request contains only an explicit target IP, pinned host public key/fingerprint, the caller public-key file, SSH-agent socket and a path to the reviewed secret-free platform config. Credential values come from hidden prompts or authenticated SSH stdin and are sealed immediately as systemd credentials; the private SSH key stays in the operator agent, and the default command is a non-contacting plan.
306
306
 
307
307
  ```text
308
308
  fz bootstrap platform remote prepare \
@@ -749,7 +749,7 @@ async function postSignedNode(options, path, body) {
749
749
  }
750
750
 
751
751
  // src/version.ts
752
- var VERSION3 = "0.1.59";
752
+ var VERSION3 = "0.1.61";
753
753
 
754
754
  // src/agent-heartbeat.ts
755
755
  var unquote = (value) => value.replace(/^['"]|['"]$/g, "");
package/dist/bootstrap.js CHANGED
@@ -1240,7 +1240,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
1240
1240
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
1241
1241
 
1242
1242
  // src/version.ts
1243
- var VERSION = "0.1.59";
1243
+ var VERSION = "0.1.61";
1244
1244
 
1245
1245
  // src/software.ts
1246
1246
  var PINNED_BUN_VERSION = "1.3.14";
package/dist/fz-agent.js CHANGED
@@ -8448,7 +8448,7 @@ function assertSupportedGuestImage(imageKey) {
8448
8448
  }
8449
8449
 
8450
8450
  // src/version.ts
8451
- var VERSION2 = "0.1.59";
8451
+ var VERSION2 = "0.1.61";
8452
8452
 
8453
8453
  // src/ssh-bootstrap.ts
8454
8454
  class SshBootstrapError extends Error {
package/dist/fz.js CHANGED
@@ -4829,7 +4829,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
4829
4829
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
4830
4830
 
4831
4831
  // src/version.ts
4832
- var VERSION2 = "0.1.59";
4832
+ var VERSION2 = "0.1.61";
4833
4833
 
4834
4834
  // src/software.ts
4835
4835
  var PINNED_BUN_VERSION = "1.3.14";
@@ -15586,6 +15586,17 @@ function platformCommunityRehearsalClaims(sshPublicKeys) {
15586
15586
  }
15587
15587
  }];
15588
15588
  }
15589
+ function platformCommunityRehearsalDeletionClaims(sshPublicKeys) {
15590
+ return platformCommunityRehearsalClaims(sshPublicKeys).map((claim) => ({
15591
+ computeKey: claim.computeKey,
15592
+ claimToken: claim.claimToken,
15593
+ claimExpiresAtTs: claim.claimExpiresAtTs,
15594
+ attempt: claim.attempt,
15595
+ action: "delete",
15596
+ bootstrap: { kind: "platform-genesis" },
15597
+ spec: claim.spec
15598
+ }));
15599
+ }
15589
15600
 
15590
15601
  // src/operator-bootstrap.ts
15591
15602
  var REQUEST_LIMIT = 64 * 1024;
@@ -15739,17 +15750,17 @@ function readOperatorMetalBootstrapRequest(path) {
15739
15750
  }
15740
15751
  function planOperatorMetalBootstrap(request, mode) {
15741
15752
  const config = readMetalBootstrapConfig(request.metalConfigFile);
15742
- if (mode === "rehearsal" && request.genesis.environment !== "development") {
15753
+ if ((mode === "rehearsal" || mode === "rehearsal-cleanup") && request.genesis.environment !== "development") {
15743
15754
  throw new Error("the disposable four-node Community rehearsal is development-only");
15744
15755
  }
15745
15756
  const keys = request.genesis.sshPublicKeyFiles.map((path) => publicIdentity(path));
15746
- const claims = mode === "rehearsal" ? platformCommunityRehearsalClaims(keys) : platformGenesisClaims(request.genesis.environment, keys);
15757
+ const claims = mode === "rehearsal" || mode === "rehearsal-cleanup" ? mode === "rehearsal-cleanup" ? platformCommunityRehearsalDeletionClaims(keys) : platformCommunityRehearsalClaims(keys) : platformGenesisClaims(request.genesis.environment, keys);
15747
15758
  return {
15748
15759
  kind: "metal-remote",
15749
15760
  mode,
15750
15761
  mutation: mode !== "status",
15751
15762
  target: { address: request.target.address, port: request.target.port, user: request.target.user },
15752
- steps: mode === "status" ? ["verify pinned SSH transport", "run typed fz bootstrap status"] : mode === "genesis" || mode === "rehearsal" ? ["verify pinned SSH transport", mode === "rehearsal" ? "send the fixed three-node seed plus ordinary n4 Community rehearsal claim to the constrained Metal helper" : "send three fixed platform-genesis claims to the constrained Metal helper"] : [
15763
+ steps: mode === "status" ? ["verify pinned SSH transport", "run typed fz bootstrap status"] : mode === "genesis" || mode === "rehearsal" || mode === "rehearsal-cleanup" ? ["verify pinned SSH transport", mode === "rehearsal" ? "send the fixed three-node seed plus ordinary n4 Community rehearsal claim to the constrained Metal helper" : mode === "rehearsal-cleanup" ? "delete the exact disposable dev-fz-n1..n4 guests and their owned disks, units, seed data and inventory" : "send three fixed platform-genesis claims to the constrained Metal helper"] : [
15753
15764
  "verify pinned SSH transport and caller-approved SSH agent",
15754
15765
  "copy pinned Bun and packaged fz artifacts to private staging",
15755
15766
  "stage the strict owner-only metal config and optional seed handoff",
@@ -16043,10 +16054,10 @@ async function applyOperatorMetalBootstrap(request, mode, options = {}) {
16043
16054
  const output2 = await remote(exec, request, knownHosts, ["/usr/bin/sudo", "-n", "/usr/local/bin/fz", "bootstrap", "status"], "remote metal status");
16044
16055
  return { plan, output: output2 };
16045
16056
  }
16046
- if (mode === "genesis" || mode === "rehearsal") {
16057
+ if (mode === "genesis" || mode === "rehearsal" || mode === "rehearsal-cleanup") {
16047
16058
  const keys = request.genesis.sshPublicKeyFiles.map((path) => publicIdentity(path));
16048
16059
  const outputs = [];
16049
- const claims = mode === "rehearsal" ? platformCommunityRehearsalClaims(keys) : platformGenesisClaims(request.genesis.environment, keys);
16060
+ const claims = mode === "rehearsal" || mode === "rehearsal-cleanup" ? mode === "rehearsal-cleanup" ? platformCommunityRehearsalDeletionClaims(keys) : platformCommunityRehearsalClaims(keys) : platformGenesisClaims(request.genesis.environment, keys);
16050
16061
  for (const claim of claims) {
16051
16062
  outputs.push(await remote(exec, request, knownHosts, ["/usr/bin/sudo", "-n", "/usr/local/bin/fz-agent", "metal-apply", "--claim=-"], `provision ${claim.spec.guestName}`, false, `${JSON.stringify(claim)}
16052
16063
  `));
@@ -17488,8 +17499,8 @@ async function cmdBootstrap(options, args) {
17488
17499
  }
17489
17500
  if (operation === "metal" && args[1] === "remote") {
17490
17501
  const mode = args[2];
17491
- if (!mode || !["apply", "genesis", "rehearsal", "status"].includes(mode) || args[3] !== undefined) {
17492
- throw new Error("Usage: fz bootstrap metal remote <apply|genesis|rehearsal|status> --bootstrap-config <owner-only-request.json> [--apply]");
17502
+ if (!mode || !["apply", "genesis", "rehearsal", "rehearsal-cleanup", "status"].includes(mode) || args[3] !== undefined) {
17503
+ throw new Error("Usage: fz bootstrap metal remote <apply|genesis|rehearsal|rehearsal-cleanup|status> --bootstrap-config <owner-only-request.json> [--apply]");
17493
17504
  }
17494
17505
  if (!options.bootstrapConfigPath)
17495
17506
  throw new Error("remote metal bootstrap requires --bootstrap-config");
@@ -17607,7 +17618,7 @@ async function cmdBootstrap(options, args) {
17607
17618
  return 0;
17608
17619
  }
17609
17620
  if (!["platform", "repair"].includes(operation)) {
17610
- throw new Error("Usage: fz bootstrap config <metal|platform|cloudflare>|platform [prepare|remote <prepare|apply|status>|cloudflare [verify|finalize]]|metal [remote <apply|genesis|rehearsal|status>]|status|repair [--bootstrap-config <path>] [--apply]");
17621
+ throw new Error("Usage: fz bootstrap config <metal|platform|cloudflare>|platform [prepare|remote <prepare|apply|status>|cloudflare [verify|finalize]]|metal [remote <apply|genesis|rehearsal|rehearsal-cleanup|status>]|status|repair [--bootstrap-config <path>] [--apply]");
17611
17622
  }
17612
17623
  const config = options.bootstrapConfigPath ? readBootstrapConfig(options.bootstrapConfigPath) : operation === "repair" ? (() => {
17613
17624
  throw new Error("repair requires --bootstrap-config so immutable coordinates are revalidated");
@@ -18199,7 +18210,7 @@ function usage() {
18199
18210
  Persist secret-free public-node acceptance, then remove
18200
18211
  the completed non-secret checkpoint and node handoffs
18201
18212
  fz bootstrap metal Plan/install an identity-only physical provisioner
18202
- fz bootstrap metal remote <apply|genesis|rehearsal|status>
18213
+ fz bootstrap metal remote <apply|genesis|rehearsal|rehearsal-cleanup|status>
18203
18214
  Install/bootstrap one pinned blank metal target, then
18204
18215
  provision the exact selected three-node genesis seed
18205
18216
  fz bootstrap status Verify persisted profile and supervised units
@@ -18264,7 +18275,8 @@ function usage() {
18264
18275
  --json Machine-readable output
18265
18276
  --apply Apply the reviewed operation instead of planning it
18266
18277
  --bootstrap-config <p> Private JSON coordinates for unattended bootstrap;
18267
- secret values remain in separate owner-only files
18278
+ secrets come from hidden prompts or authenticated stdin
18279
+ and are sealed immediately as systemd credentials
18268
18280
  --output <path> Canonical absolute destination for generated bootstrap config
18269
18281
  --root <path> Project root for project/deploy commands
18270
18282
  --name <name> Project or deploy name during init
@@ -292,7 +292,7 @@ function systemdAgentEgressDirectives(loopbackTcpPorts = []) {
292
292
  }
293
293
 
294
294
  // src/version.ts
295
- var VERSION = "0.1.59";
295
+ var VERSION = "0.1.61";
296
296
 
297
297
  // src/otel-collector.ts
298
298
  var FORGEZERO_OTEL_COLLECTOR_UNIT = "forgezero-otel-collector.service";
@@ -26,7 +26,7 @@ export interface OperatorMetalBootstrapRequest {
26
26
  };
27
27
  }
28
28
  export type OperatorPlatformBootstrapMode = 'prepare' | 'apply' | 'status';
29
- export type OperatorMetalBootstrapMode = 'apply' | 'genesis' | 'rehearsal' | 'status';
29
+ export type OperatorMetalBootstrapMode = 'apply' | 'genesis' | 'rehearsal' | 'rehearsal-cleanup' | 'status';
30
30
  export interface OperatorPlatformBootstrapPlan {
31
31
  kind: 'platform-remote';
32
32
  mode: OperatorPlatformBootstrapMode;
@@ -1240,7 +1240,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
1240
1240
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
1241
1241
 
1242
1242
  // src/version.ts
1243
- var VERSION = "0.1.59";
1243
+ var VERSION = "0.1.61";
1244
1244
 
1245
1245
  // src/software.ts
1246
1246
  var PINNED_BUN_VERSION = "1.3.14";
@@ -5443,6 +5443,17 @@ function platformCommunityRehearsalClaims(sshPublicKeys) {
5443
5443
  }
5444
5444
  }];
5445
5445
  }
5446
+ function platformCommunityRehearsalDeletionClaims(sshPublicKeys) {
5447
+ return platformCommunityRehearsalClaims(sshPublicKeys).map((claim) => ({
5448
+ computeKey: claim.computeKey,
5449
+ claimToken: claim.claimToken,
5450
+ claimExpiresAtTs: claim.claimExpiresAtTs,
5451
+ attempt: claim.attempt,
5452
+ action: "delete",
5453
+ bootstrap: { kind: "platform-genesis" },
5454
+ spec: claim.spec
5455
+ }));
5456
+ }
5446
5457
 
5447
5458
  // src/operator-bootstrap.ts
5448
5459
  var REQUEST_LIMIT = 64 * 1024;
@@ -5596,17 +5607,17 @@ function readOperatorMetalBootstrapRequest(path) {
5596
5607
  }
5597
5608
  function planOperatorMetalBootstrap(request, mode) {
5598
5609
  const config = readMetalBootstrapConfig(request.metalConfigFile);
5599
- if (mode === "rehearsal" && request.genesis.environment !== "development") {
5610
+ if ((mode === "rehearsal" || mode === "rehearsal-cleanup") && request.genesis.environment !== "development") {
5600
5611
  throw new Error("the disposable four-node Community rehearsal is development-only");
5601
5612
  }
5602
5613
  const keys = request.genesis.sshPublicKeyFiles.map((path) => publicIdentity(path));
5603
- const claims = mode === "rehearsal" ? platformCommunityRehearsalClaims(keys) : platformGenesisClaims(request.genesis.environment, keys);
5614
+ const claims = mode === "rehearsal" || mode === "rehearsal-cleanup" ? mode === "rehearsal-cleanup" ? platformCommunityRehearsalDeletionClaims(keys) : platformCommunityRehearsalClaims(keys) : platformGenesisClaims(request.genesis.environment, keys);
5604
5615
  return {
5605
5616
  kind: "metal-remote",
5606
5617
  mode,
5607
5618
  mutation: mode !== "status",
5608
5619
  target: { address: request.target.address, port: request.target.port, user: request.target.user },
5609
- steps: mode === "status" ? ["verify pinned SSH transport", "run typed fz bootstrap status"] : mode === "genesis" || mode === "rehearsal" ? ["verify pinned SSH transport", mode === "rehearsal" ? "send the fixed three-node seed plus ordinary n4 Community rehearsal claim to the constrained Metal helper" : "send three fixed platform-genesis claims to the constrained Metal helper"] : [
5620
+ steps: mode === "status" ? ["verify pinned SSH transport", "run typed fz bootstrap status"] : mode === "genesis" || mode === "rehearsal" || mode === "rehearsal-cleanup" ? ["verify pinned SSH transport", mode === "rehearsal" ? "send the fixed three-node seed plus ordinary n4 Community rehearsal claim to the constrained Metal helper" : mode === "rehearsal-cleanup" ? "delete the exact disposable dev-fz-n1..n4 guests and their owned disks, units, seed data and inventory" : "send three fixed platform-genesis claims to the constrained Metal helper"] : [
5610
5621
  "verify pinned SSH transport and caller-approved SSH agent",
5611
5622
  "copy pinned Bun and packaged fz artifacts to private staging",
5612
5623
  "stage the strict owner-only metal config and optional seed handoff",
@@ -5900,10 +5911,10 @@ async function applyOperatorMetalBootstrap(request, mode, options = {}) {
5900
5911
  const output2 = await remote(exec, request, knownHosts, ["/usr/bin/sudo", "-n", "/usr/local/bin/fz", "bootstrap", "status"], "remote metal status");
5901
5912
  return { plan, output: output2 };
5902
5913
  }
5903
- if (mode === "genesis" || mode === "rehearsal") {
5914
+ if (mode === "genesis" || mode === "rehearsal" || mode === "rehearsal-cleanup") {
5904
5915
  const keys = request.genesis.sshPublicKeyFiles.map((path) => publicIdentity(path));
5905
5916
  const outputs = [];
5906
- const claims = mode === "rehearsal" ? platformCommunityRehearsalClaims(keys) : platformGenesisClaims(request.genesis.environment, keys);
5917
+ const claims = mode === "rehearsal" || mode === "rehearsal-cleanup" ? mode === "rehearsal-cleanup" ? platformCommunityRehearsalDeletionClaims(keys) : platformCommunityRehearsalClaims(keys) : platformGenesisClaims(request.genesis.environment, keys);
5907
5918
  for (const claim of claims) {
5908
5919
  outputs.push(await remote(exec, request, knownHosts, ["/usr/bin/sudo", "-n", "/usr/local/bin/fz-agent", "metal-apply", "--claim=-"], `provision ${claim.spec.guestName}`, false, `${JSON.stringify(claim)}
5909
5920
  `));
@@ -2086,7 +2086,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
2086
2086
  }
2087
2087
 
2088
2088
  // src/version.ts
2089
- var VERSION3 = "0.1.59";
2089
+ var VERSION3 = "0.1.61";
2090
2090
 
2091
2091
  // src/egress-policy.ts
2092
2092
  import { realpathSync as realpathSync3 } from "node:fs";
@@ -24,3 +24,5 @@ export declare const DEVELOPMENT_COMMUNITY_REHEARSAL_GUEST: PlatformGenesisGuest
24
24
  export declare function platformGenesisClaims(environment: PlatformGenesisEnvironment, sshPublicKeys: readonly string[]): readonly RemoteProvisionClaim[];
25
25
  /** Exact disposable four-host development fleet: three seed guests plus n4. */
26
26
  export declare function platformCommunityRehearsalClaims(sshPublicKeys: readonly string[]): readonly RemoteProvisionClaim[];
27
+ /** Exact inverse of the disposable four-host rehearsal claims. */
28
+ export declare function platformCommunityRehearsalDeletionClaims(sshPublicKeys: readonly string[]): readonly RemoteProvisionClaim[];
package/dist/provision.js CHANGED
@@ -2086,7 +2086,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
2086
2086
  }
2087
2087
 
2088
2088
  // src/version.ts
2089
- var VERSION3 = "0.1.59";
2089
+ var VERSION3 = "0.1.61";
2090
2090
 
2091
2091
  // src/egress-policy.ts
2092
2092
  import { realpathSync as realpathSync3 } from "node:fs";
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** One package version shared by both public binaries. Pinned to package.json by tests. */
2
- export declare const VERSION = "0.1.59";
2
+ export declare const VERSION = "0.1.61";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgezero/agent",
3
- "version": "0.1.59",
3
+ "version": "0.1.61",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "check": "tsc --noEmit",