@forgezero/agent 0.1.83 → 0.1.84

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
@@ -1406,7 +1406,7 @@ await runDeploymentPlan({
1406
1406
  <a id="forgezero-agent-deploy-compiler"></a>
1407
1407
  ## @forgezero/agent/deploy-compiler
1408
1408
 
1409
- Explicit developer/CI compiler from forgezero.deploy.ts to canonical .fz/deploy.plan.json; never used to execute project TypeScript in production. This entry exposes 7 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.
1409
+ Explicit developer/CI compiler from forgezero.deploy.ts to canonical .fz/deploy.plan.json; never used to execute project TypeScript in production. This entry exposes 7 named value exports and 4 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
1410
1410
 
1411
1411
  ```text
1412
1412
  import {
@@ -1422,6 +1422,7 @@ import {
1422
1422
  import type {
1423
1423
  DeploymentCompilation,
1424
1424
  DeploymentInitOptions,
1425
+ DeploymentInitProvisioning,
1425
1426
  DeploymentInitRuntime,
1426
1427
  } from '@forgezero/agent/deploy-compiler';
1427
1428
  ```
@@ -750,7 +750,7 @@ async function postSignedNode(options, path, body) {
750
750
  }
751
751
 
752
752
  // src/version.ts
753
- var VERSION3 = "0.1.83";
753
+ var VERSION3 = "0.1.84";
754
754
 
755
755
  // src/agent-heartbeat.ts
756
756
  function readAgentHostMetrics() {
package/dist/bootstrap.js CHANGED
@@ -1416,7 +1416,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
1416
1416
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
1417
1417
 
1418
1418
  // src/version.ts
1419
- var VERSION = "0.1.83";
1419
+ var VERSION = "0.1.84";
1420
1420
 
1421
1421
  // src/software.ts
1422
1422
  var PINNED_BUN_VERSION = "1.3.14";
@@ -9,6 +9,15 @@ export interface DeploymentCompilation {
9
9
  changed: boolean;
10
10
  }
11
11
  export type DeploymentInitRuntime = 'native' | 'containerd' | 'kata-snp';
12
+ export interface DeploymentInitProvisioning {
13
+ planKey: string;
14
+ regionKey: string;
15
+ imageKey: string;
16
+ environmentKey: string;
17
+ ownership: 'platform' | 'tenant-metal';
18
+ metalHostname?: string;
19
+ maxMonthlySpendMinor: string;
20
+ }
12
21
  export interface DeploymentInitOptions {
13
22
  runtime?: DeploymentInitRuntime;
14
23
  operatingSystem?: 'ubuntu-24.04' | 'ubuntu-26.04';
@@ -20,6 +29,7 @@ export interface DeploymentInitOptions {
20
29
  sharing?: 'exclusive' | 'shared';
21
30
  reuse?: 'require' | 'prefer';
22
31
  profile?: string;
32
+ provisioning?: DeploymentInitProvisioning;
23
33
  }
24
34
  export declare function defaultTypeScriptDeployment(name: string, options?: DeploymentInitOptions): string;
25
35
  export declare function initializeTypeScriptDeployment(rootValue: string, options: {
@@ -1186,12 +1186,36 @@ function initCoordinates(options) {
1186
1186
  throw new Error("sev-snp requires ubuntu-26.04");
1187
1187
  if (runtime === "native" && result.sharing !== "exclusive")
1188
1188
  throw new Error("native deployments require exclusive compute");
1189
- return result;
1189
+ if (result.reuse === "prefer" && options.provisioning === undefined)
1190
+ throw new Error("reuse prefer requires approved provisioning coordinates");
1191
+ if (result.reuse === "require" && options.provisioning !== undefined)
1192
+ throw new Error("reuse require cannot include provisioning coordinates");
1193
+ if (options.provisioning !== undefined) {
1194
+ for (const [label, value] of Object.entries({
1195
+ plan: options.provisioning.planKey,
1196
+ region: options.provisioning.regionKey,
1197
+ image: options.provisioning.imageKey,
1198
+ environment: options.provisioning.environmentKey
1199
+ }))
1200
+ if (!/^[a-z][a-z0-9-]{0,62}$/.test(value))
1201
+ throw new Error(`deployment provisioning ${label} must be a lowercase typed name`);
1202
+ if (!/^\d{1,18}$/.test(options.provisioning.maxMonthlySpendMinor))
1203
+ throw new Error("deployment provisioning monthly spend must be a bounded decimal minor-unit amount");
1204
+ if (options.provisioning.ownership === "tenant-metal" && !options.provisioning.metalHostname)
1205
+ throw new Error("tenant-metal provisioning requires a metal hostname");
1206
+ if (options.provisioning.ownership === "platform" && options.provisioning.metalHostname)
1207
+ throw new Error("platform provisioning cannot bind a tenant metal hostname");
1208
+ if (options.provisioning.metalHostname && !/^(?=.{1,253}$)[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(options.provisioning.metalHostname))
1209
+ throw new Error("deployment provisioning metal hostname is invalid");
1210
+ }
1211
+ return { ...result, ...options.provisioning ? { provisioning: options.provisioning } : {} };
1190
1212
  }
1191
1213
  function defaultTypeScriptDeployment(name, options = {}) {
1192
1214
  const selected = initCoordinates(options);
1193
1215
  const execution = selected.runtime === "native" ? "native" : selected.runtime === "containerd" ? "oci-runc" : "oci-kata-qemu-snp";
1194
1216
  const hostPackageVersion = selected.operatingSystem === "ubuntu-24.04" ? "ubuntu-24.04" : "ubuntu-26.04";
1217
+ const provisioningBlock = selected.provisioning === undefined ? "" : `,
1218
+ provisioning: { planKey: '${selected.provisioning.planKey}', regionKey: '${selected.provisioning.regionKey}', imageKey: '${selected.provisioning.imageKey}', environmentKey: '${selected.provisioning.environmentKey}', ownership: '${selected.provisioning.ownership}',${selected.provisioning.metalHostname ? ` metalHostname: '${selected.provisioning.metalHostname}',` : ""} maxMonthlySpendMinor: '${selected.provisioning.maxMonthlySpendMinor}' }`;
1195
1219
  const requirementBlock = selected.runtime === "native" ? `bun: providers.bun.require()` : selected.runtime === "containerd" ? `containerd: providers.containerd.require({ version: '${hostPackageVersion}' }),
1196
1220
  nginx: providers.nginx.require({ version: '${hostPackageVersion}' })` : `containerd: providers.containerd.require(),
1197
1221
  kata: providers.kata.require(),
@@ -1259,7 +1283,7 @@ export default defineDeployment({
1259
1283
  profiles: ['${selected.profile}'], replicas: ${selected.replicas},
1260
1284
  resources: { cpuCores: ${selected.cpuCores}, memoryMiB: ${selected.memoryMiB}, storageGiB: ${selected.storageGiB} },
1261
1285
  os: '${selected.operatingSystem}', runtime: '${execution}', isolation: '${selected.isolation}',
1262
- sharing: '${selected.sharing}', reuse: '${selected.reuse}'
1286
+ sharing: '${selected.sharing}', reuse: '${selected.reuse}'${provisioningBlock}
1263
1287
  })
1264
1288
  },
1265
1289
  requirements: { ${requirementBlock} },
package/dist/fz-agent.js CHANGED
@@ -9331,7 +9331,7 @@ async function writeAndCloseProcessInput(input, value) {
9331
9331
  }
9332
9332
 
9333
9333
  // src/version.ts
9334
- var VERSION2 = "0.1.83";
9334
+ var VERSION2 = "0.1.84";
9335
9335
 
9336
9336
  // src/ssh-bootstrap.ts
9337
9337
  class SshBootstrapError extends Error {
package/dist/fz.js CHANGED
@@ -4634,7 +4634,7 @@ var VaultError, runtimeEnvironment = () => typeof process !== "undefined" && pro
4634
4634
  } catch {
4635
4635
  return;
4636
4636
  }
4637
- }, VERSION = "0.1.16";
4637
+ }, VERSION = "0.1.17";
4638
4638
  var init_dist = __esm(() => {
4639
4639
  init_identity();
4640
4640
  VaultError = class VaultError extends Error {
@@ -4837,7 +4837,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
4837
4837
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
4838
4838
 
4839
4839
  // src/version.ts
4840
- var VERSION2 = "0.1.83";
4840
+ var VERSION2 = "0.1.84";
4841
4841
 
4842
4842
  // src/software.ts
4843
4843
  var PINNED_BUN_VERSION = "1.3.14";
@@ -11553,12 +11553,36 @@ function initCoordinates(options) {
11553
11553
  throw new Error("sev-snp requires ubuntu-26.04");
11554
11554
  if (runtime === "native" && result.sharing !== "exclusive")
11555
11555
  throw new Error("native deployments require exclusive compute");
11556
- return result;
11556
+ if (result.reuse === "prefer" && options.provisioning === undefined)
11557
+ throw new Error("reuse prefer requires approved provisioning coordinates");
11558
+ if (result.reuse === "require" && options.provisioning !== undefined)
11559
+ throw new Error("reuse require cannot include provisioning coordinates");
11560
+ if (options.provisioning !== undefined) {
11561
+ for (const [label, value] of Object.entries({
11562
+ plan: options.provisioning.planKey,
11563
+ region: options.provisioning.regionKey,
11564
+ image: options.provisioning.imageKey,
11565
+ environment: options.provisioning.environmentKey
11566
+ }))
11567
+ if (!/^[a-z][a-z0-9-]{0,62}$/.test(value))
11568
+ throw new Error(`deployment provisioning ${label} must be a lowercase typed name`);
11569
+ if (!/^\d{1,18}$/.test(options.provisioning.maxMonthlySpendMinor))
11570
+ throw new Error("deployment provisioning monthly spend must be a bounded decimal minor-unit amount");
11571
+ if (options.provisioning.ownership === "tenant-metal" && !options.provisioning.metalHostname)
11572
+ throw new Error("tenant-metal provisioning requires a metal hostname");
11573
+ if (options.provisioning.ownership === "platform" && options.provisioning.metalHostname)
11574
+ throw new Error("platform provisioning cannot bind a tenant metal hostname");
11575
+ if (options.provisioning.metalHostname && !/^(?=.{1,253}$)[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(options.provisioning.metalHostname))
11576
+ throw new Error("deployment provisioning metal hostname is invalid");
11577
+ }
11578
+ return { ...result, ...options.provisioning ? { provisioning: options.provisioning } : {} };
11557
11579
  }
11558
11580
  function defaultTypeScriptDeployment(name, options = {}) {
11559
11581
  const selected = initCoordinates(options);
11560
11582
  const execution = selected.runtime === "native" ? "native" : selected.runtime === "containerd" ? "oci-runc" : "oci-kata-qemu-snp";
11561
11583
  const hostPackageVersion = selected.operatingSystem === "ubuntu-24.04" ? "ubuntu-24.04" : "ubuntu-26.04";
11584
+ const provisioningBlock = selected.provisioning === undefined ? "" : `,
11585
+ provisioning: { planKey: '${selected.provisioning.planKey}', regionKey: '${selected.provisioning.regionKey}', imageKey: '${selected.provisioning.imageKey}', environmentKey: '${selected.provisioning.environmentKey}', ownership: '${selected.provisioning.ownership}',${selected.provisioning.metalHostname ? ` metalHostname: '${selected.provisioning.metalHostname}',` : ""} maxMonthlySpendMinor: '${selected.provisioning.maxMonthlySpendMinor}' }`;
11562
11586
  const requirementBlock = selected.runtime === "native" ? `bun: providers.bun.require()` : selected.runtime === "containerd" ? `containerd: providers.containerd.require({ version: '${hostPackageVersion}' }),
11563
11587
  nginx: providers.nginx.require({ version: '${hostPackageVersion}' })` : `containerd: providers.containerd.require(),
11564
11588
  kata: providers.kata.require(),
@@ -11626,7 +11650,7 @@ export default defineDeployment({
11626
11650
  profiles: ['${selected.profile}'], replicas: ${selected.replicas},
11627
11651
  resources: { cpuCores: ${selected.cpuCores}, memoryMiB: ${selected.memoryMiB}, storageGiB: ${selected.storageGiB} },
11628
11652
  os: '${selected.operatingSystem}', runtime: '${execution}', isolation: '${selected.isolation}',
11629
- sharing: '${selected.sharing}', reuse: '${selected.reuse}'
11653
+ sharing: '${selected.sharing}', reuse: '${selected.reuse}'${provisioningBlock}
11630
11654
  })
11631
11655
  },
11632
11656
  requirements: { ${requirementBlock} },
@@ -17947,6 +17971,31 @@ function parseOptions(argv2) {
17947
17971
  options.deployReuse = value;
17948
17972
  else
17949
17973
  options.optionError = "--reuse must be require or prefer.";
17974
+ } else if (token === "--provision-plan") {
17975
+ options.deployProvisionPlan = argv2[++index];
17976
+ options.deployInitCustomized = true;
17977
+ } else if (token === "--provision-region") {
17978
+ options.deployProvisionRegion = argv2[++index];
17979
+ options.deployInitCustomized = true;
17980
+ } else if (token === "--provision-image") {
17981
+ options.deployProvisionImage = argv2[++index];
17982
+ options.deployInitCustomized = true;
17983
+ } else if (token === "--provision-environment") {
17984
+ options.deployProvisionEnvironment = argv2[++index];
17985
+ options.deployInitCustomized = true;
17986
+ } else if (token === "--provision-ownership") {
17987
+ const value = argv2[++index];
17988
+ options.deployInitCustomized = true;
17989
+ if (value === "platform" || value === "tenant-metal")
17990
+ options.deployProvisionOwnership = value;
17991
+ else
17992
+ options.optionError = "--provision-ownership must be platform or tenant-metal.";
17993
+ } else if (token === "--provision-metal") {
17994
+ options.deployProvisionMetal = argv2[++index];
17995
+ options.deployInitCustomized = true;
17996
+ } else if (token === "--max-monthly-spend-minor") {
17997
+ options.deployMaxMonthlySpendMinor = argv2[++index];
17998
+ options.deployInitCustomized = true;
17950
17999
  } else if (token === "--force")
17951
18000
  options.force = true;
17952
18001
  else if (token === "--browser")
@@ -19636,7 +19685,25 @@ async function cmdDeploy(options, args) {
19636
19685
  storageGiB: options.deployStorageGiB,
19637
19686
  sharing: options.deploySharing,
19638
19687
  reuse: options.deployReuse,
19639
- profile: options.deployProfile
19688
+ profile: options.deployProfile,
19689
+ ...[
19690
+ options.deployProvisionPlan,
19691
+ options.deployProvisionRegion,
19692
+ options.deployProvisionImage,
19693
+ options.deployProvisionEnvironment,
19694
+ options.deployProvisionOwnership,
19695
+ options.deployMaxMonthlySpendMinor
19696
+ ].some((value) => value !== undefined) ? {
19697
+ provisioning: {
19698
+ planKey: options.deployProvisionPlan ?? "",
19699
+ regionKey: options.deployProvisionRegion ?? "",
19700
+ imageKey: options.deployProvisionImage ?? "",
19701
+ environmentKey: options.deployProvisionEnvironment ?? "",
19702
+ ownership: options.deployProvisionOwnership ?? "platform",
19703
+ ...options.deployProvisionMetal ? { metalHostname: options.deployProvisionMetal } : {},
19704
+ maxMonthlySpendMinor: options.deployMaxMonthlySpendMinor ?? ""
19705
+ }
19706
+ } : {}
19640
19707
  });
19641
19708
  const compiled = await compileDeploymentProject(options.projectRoot);
19642
19709
  if (options.json)
@@ -19971,6 +20038,10 @@ function usage() {
19971
20038
  --storage-gib <n> Reserved storage GiB per compute
19972
20039
  --sharing <mode> exclusive or shared (native requires exclusive)
19973
20040
  --reuse <mode> require existing capacity or prefer reuse then approved provisioning
20041
+ --provision-plan <key> --provision-region <key> --provision-image <key>
20042
+ --provision-environment <key> --provision-ownership <platform|tenant-metal>
20043
+ --provision-metal <host> Required only for tenant-metal ownership
20044
+ --max-monthly-spend-minor <n> Hard approved scale-out spend ceiling
19974
20045
  --force Init may replace an existing generated target
19975
20046
 
19976
20047
  REMOTE DEPLOY OPTIONS
@@ -366,7 +366,7 @@ function systemdAgentEgressDirectives(loopbackTcpPorts = []) {
366
366
  }
367
367
 
368
368
  // src/version.ts
369
- var VERSION = "0.1.83";
369
+ var VERSION = "0.1.84";
370
370
 
371
371
  // src/otel-collector.ts
372
372
  var FORGEZERO_OTEL_COLLECTOR_UNIT = "forgezero-otel-collector.service";
@@ -1416,7 +1416,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
1416
1416
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
1417
1417
 
1418
1418
  // src/version.ts
1419
- var VERSION = "0.1.83";
1419
+ var VERSION = "0.1.84";
1420
1420
 
1421
1421
  // src/software.ts
1422
1422
  var PINNED_BUN_VERSION = "1.3.14";
@@ -2647,7 +2647,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
2647
2647
  }
2648
2648
 
2649
2649
  // src/version.ts
2650
- var VERSION3 = "0.1.83";
2650
+ var VERSION3 = "0.1.84";
2651
2651
 
2652
2652
  // src/egress-policy.ts
2653
2653
  import { realpathSync as realpathSync3 } from "node:fs";
package/dist/provision.js CHANGED
@@ -2647,7 +2647,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
2647
2647
  }
2648
2648
 
2649
2649
  // src/version.ts
2650
- var VERSION3 = "0.1.83";
2650
+ var VERSION3 = "0.1.84";
2651
2651
 
2652
2652
  // src/egress-policy.ts
2653
2653
  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.83";
2
+ export declare const VERSION = "0.1.84";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgezero/agent",
3
- "version": "0.1.83",
3
+ "version": "0.1.84",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "check": "tsc --noEmit",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@forgezero/runtime": "0.1.12",
20
- "@forgezero/vault": "0.1.16",
20
+ "@forgezero/vault": "0.1.17",
21
21
  "@noble/curves": "2.2.0",
22
22
  "@noble/hashes": "2.2.0",
23
23
  "@noble/post-quantum": "0.6.1",