@forgezero/agent 0.1.117 → 0.1.118

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
@@ -99,8 +99,12 @@ export default defineDeployment({
99
99
  resources: { cpuCores: input.ref('cpuCores'), memoryMiB: input.ref('memoryMiB'), storageGiB: input.ref('storageGiB') },
100
100
  os: 'ubuntu-24.04', runtime: 'oci-runc', sharing: 'shared', reuse: 'prefer',
101
101
  provisioning: {
102
- planKey: 'app-small', regionKey: 'default', imageKey: 'ubuntu-24.04-x64',
103
- environmentKey: 'production', ownership: 'platform', maxMonthlySpendMinor: '25000'
102
+ regionKey: 'default', imageKey: 'ubuntu-24.04-x64', environmentKey: 'production', ownership: 'platform',
103
+ resources: {
104
+ physicalCores: 1, vcpu: 2, memoryGib: 2, diskGib: 16,
105
+ egressGuaranteedMbps: 100, egressBurstMbps: 200, confidential: false
106
+ },
107
+ monthlyAmountCents: '1200', maxMonthlySpendMinor: '25000'
104
108
  },
105
109
  connectivity: {
106
110
  private: { mode: 'private-lan' },
@@ -917,7 +917,7 @@ async function postSignedNode(options, path, body) {
917
917
  }
918
918
 
919
919
  // src/version.ts
920
- var VERSION3 = "0.1.117";
920
+ var VERSION3 = "0.1.118";
921
921
 
922
922
  // src/agent-heartbeat.ts
923
923
  function readAgentHostMetrics() {
package/dist/bootstrap.js CHANGED
@@ -1460,7 +1460,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
1460
1460
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
1461
1461
 
1462
1462
  // src/version.ts
1463
- var VERSION = "0.1.117";
1463
+ var VERSION = "0.1.118";
1464
1464
 
1465
1465
  // src/software.ts
1466
1466
  var PINNED_BUN_VERSION = "1.3.14";
@@ -10,12 +10,21 @@ export interface DeploymentCompilation {
10
10
  }
11
11
  export type DeploymentInitRuntime = 'native' | 'containerd' | 'kata-snp';
12
12
  export interface DeploymentInitProvisioning {
13
- planKey: string;
14
13
  regionKey: string;
15
14
  imageKey: string;
16
15
  environmentKey: string;
17
16
  ownership: 'platform' | 'tenant-metal';
18
17
  metalHostname?: string;
18
+ resources: {
19
+ physicalCores: number;
20
+ vcpu: number;
21
+ memoryGib: number;
22
+ diskGib: number;
23
+ egressGuaranteedMbps: number;
24
+ egressBurstMbps: number;
25
+ confidential: boolean;
26
+ };
27
+ monthlyAmountCents: string;
19
28
  maxMonthlySpendMinor: string;
20
29
  }
21
30
  export interface DeploymentInitOptions {
@@ -910,13 +910,30 @@ function compileDeployment(sourceValue) {
910
910
  fail(`deployment.spec.targets.${targetName}.allocation.execution`, "cannot satisfy required confidential compute.");
911
911
  if (target.provisioning !== undefined) {
912
912
  const provisioning = object(target.provisioning, `deployment.spec.targets.${targetName}.provisioning`);
913
- exact3(provisioning, ["planKey", "regionKey", "imageKey", "environmentKey", "ownership", "metalHostname", "maxMonthlySpendMinor"], `deployment.spec.targets.${targetName}.provisioning`);
914
- for (const key of ["planKey", "regionKey", "imageKey", "environmentKey"])
913
+ exact3(provisioning, ["regionKey", "imageKey", "environmentKey", "ownership", "metalHostname", "resources", "monthlyAmountCents", "maxMonthlySpendMinor"], `deployment.spec.targets.${targetName}.provisioning`);
914
+ for (const key of ["regionKey", "imageKey", "environmentKey"])
915
915
  named(provisioning[key], `deployment.spec.targets.${targetName}.provisioning.${key}`);
916
916
  if (!["platform", "tenant-metal"].includes(String(provisioning.ownership)) || provisioning.ownership === "tenant-metal" !== Boolean(provisioning.metalHostname))
917
917
  fail(`deployment.spec.targets.${targetName}.provisioning.ownership`, "must bind platform capacity or one tenant metal hostname.");
918
918
  if (provisioning.metalHostname !== undefined && !/^(?=.{1,253}$)[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(String(provisioning.metalHostname)))
919
919
  fail(`deployment.spec.targets.${targetName}.provisioning.metalHostname`, "is invalid.");
920
+ const provisionedResources = object(provisioning.resources, `deployment.spec.targets.${targetName}.provisioning.resources`);
921
+ exact3(provisionedResources, ["physicalCores", "vcpu", "memoryGib", "diskGib", "egressGuaranteedMbps", "egressBurstMbps", "confidential"], `deployment.spec.targets.${targetName}.provisioning.resources`);
922
+ integer(provisionedResources.physicalCores, `deployment.spec.targets.${targetName}.provisioning.resources.physicalCores`, 1, 1024);
923
+ integer(provisionedResources.vcpu, `deployment.spec.targets.${targetName}.provisioning.resources.vcpu`, 1, 4096);
924
+ integer(provisionedResources.memoryGib, `deployment.spec.targets.${targetName}.provisioning.resources.memoryGib`, 1, 4194304);
925
+ integer(provisionedResources.diskGib, `deployment.spec.targets.${targetName}.provisioning.resources.diskGib`, 1, 1048576);
926
+ integer(provisionedResources.egressGuaranteedMbps, `deployment.spec.targets.${targetName}.provisioning.resources.egressGuaranteedMbps`, 0, 1e7);
927
+ integer(provisionedResources.egressBurstMbps, `deployment.spec.targets.${targetName}.provisioning.resources.egressBurstMbps`, Number(provisionedResources.egressGuaranteedMbps), 1e7);
928
+ if (typeof provisionedResources.confidential !== "boolean")
929
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources.confidential`, "must be boolean.");
930
+ if (typeof capacity.cpuCores === "number" && Number(provisionedResources.vcpu) < capacity.cpuCores || typeof capacity.memoryMiB === "number" && Number(provisionedResources.memoryGib) * 1024 < capacity.memoryMiB || typeof capacity.storageGiB === "number" && Number(provisionedResources.diskGib) < capacity.storageGiB) {
931
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources`, "must satisfy the per-slot allocation minimum.");
932
+ }
933
+ if ((selector.confidentialCompute === "required" || allocation.execution === "oci-kata-qemu-snp") && provisionedResources.confidential !== true)
934
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources.confidential`, "must be true for confidential execution.");
935
+ if (typeof provisioning.monthlyAmountCents !== "string" || !/^\d{1,18}$/.test(provisioning.monthlyAmountCents))
936
+ fail(`deployment.spec.targets.${targetName}.provisioning.monthlyAmountCents`, "must be a bounded USD-cent amount.");
920
937
  if (typeof provisioning.maxMonthlySpendMinor !== "string" || !/^\d{1,18}$/.test(provisioning.maxMonthlySpendMinor))
921
938
  fail(`deployment.spec.targets.${targetName}.provisioning.maxMonthlySpendMinor`, "must be a bounded decimal minor-unit amount.");
922
939
  }
@@ -1266,13 +1283,24 @@ function initCoordinates(options) {
1266
1283
  throw new Error("reuse require cannot include provisioning coordinates");
1267
1284
  if (options.provisioning !== undefined) {
1268
1285
  for (const [label, value] of Object.entries({
1269
- plan: options.provisioning.planKey,
1270
1286
  region: options.provisioning.regionKey,
1271
1287
  image: options.provisioning.imageKey,
1272
1288
  environment: options.provisioning.environmentKey
1273
1289
  }))
1274
1290
  if (!/^[a-z][a-z0-9-]{0,62}$/.test(value))
1275
1291
  throw new Error(`deployment provisioning ${label} must be a lowercase typed name`);
1292
+ const resources = options.provisioning.resources;
1293
+ for (const [label, value] of Object.entries(resources).filter(([key]) => key !== "confidential")) {
1294
+ if (!Number.isSafeInteger(value) || Number(value) < 0)
1295
+ throw new Error(`deployment provisioning ${label} must be a non-negative integer`);
1296
+ }
1297
+ if (resources.physicalCores < 1 || resources.vcpu < result.cpuCores || resources.memoryGib * 1024 < result.memoryMiB || resources.diskGib < result.storageGiB || resources.egressBurstMbps < resources.egressGuaranteedMbps) {
1298
+ throw new Error("deployment provisioning resources must satisfy the target allocation and bandwidth bounds");
1299
+ }
1300
+ if (result.isolation === "sev-snp" && !resources.confidential)
1301
+ throw new Error("deployment provisioning must provide confidential capacity for sev-snp");
1302
+ if (!/^\d{1,18}$/.test(options.provisioning.monthlyAmountCents))
1303
+ throw new Error("deployment provisioning monthly amount must be a bounded USD-cent amount");
1276
1304
  if (!/^\d{1,18}$/.test(options.provisioning.maxMonthlySpendMinor))
1277
1305
  throw new Error("deployment provisioning monthly spend must be a bounded decimal minor-unit amount");
1278
1306
  if (options.provisioning.ownership === "tenant-metal" && !options.provisioning.metalHostname)
@@ -1289,7 +1317,7 @@ function defaultTypeScriptDeployment(name, options = {}) {
1289
1317
  const execution = selected.runtime === "native" ? "native" : selected.runtime === "containerd" ? "oci-runc" : "oci-kata-qemu-snp";
1290
1318
  const hostPackageVersion = selected.operatingSystem === "ubuntu-24.04" ? "ubuntu-24.04" : "ubuntu-26.04";
1291
1319
  const provisioningBlock = selected.provisioning === undefined ? "" : `,
1292
- 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}' }`;
1320
+ provisioning: { regionKey: '${selected.provisioning.regionKey}', imageKey: '${selected.provisioning.imageKey}', environmentKey: '${selected.provisioning.environmentKey}', ownership: '${selected.provisioning.ownership}',${selected.provisioning.metalHostname ? ` metalHostname: '${selected.provisioning.metalHostname}',` : ""} resources: ${JSON.stringify(selected.provisioning.resources)}, monthlyAmountCents: '${selected.provisioning.monthlyAmountCents}', maxMonthlySpendMinor: '${selected.provisioning.maxMonthlySpendMinor}' }`;
1293
1321
  const requirementBlock = selected.runtime === "native" ? `bun: providers.bun.require()` : selected.runtime === "containerd" ? `containerd: providers.containerd.require({ version: '${hostPackageVersion}' }),
1294
1322
  nginx: providers.nginx.require({ version: '${hostPackageVersion}' })` : `containerd: providers.containerd.require(),
1295
1323
  kata: providers.kata.require(),
@@ -910,13 +910,30 @@ function compileDeployment(sourceValue) {
910
910
  fail(`deployment.spec.targets.${targetName}.allocation.execution`, "cannot satisfy required confidential compute.");
911
911
  if (target.provisioning !== undefined) {
912
912
  const provisioning = object(target.provisioning, `deployment.spec.targets.${targetName}.provisioning`);
913
- exact3(provisioning, ["planKey", "regionKey", "imageKey", "environmentKey", "ownership", "metalHostname", "maxMonthlySpendMinor"], `deployment.spec.targets.${targetName}.provisioning`);
914
- for (const key of ["planKey", "regionKey", "imageKey", "environmentKey"])
913
+ exact3(provisioning, ["regionKey", "imageKey", "environmentKey", "ownership", "metalHostname", "resources", "monthlyAmountCents", "maxMonthlySpendMinor"], `deployment.spec.targets.${targetName}.provisioning`);
914
+ for (const key of ["regionKey", "imageKey", "environmentKey"])
915
915
  named(provisioning[key], `deployment.spec.targets.${targetName}.provisioning.${key}`);
916
916
  if (!["platform", "tenant-metal"].includes(String(provisioning.ownership)) || provisioning.ownership === "tenant-metal" !== Boolean(provisioning.metalHostname))
917
917
  fail(`deployment.spec.targets.${targetName}.provisioning.ownership`, "must bind platform capacity or one tenant metal hostname.");
918
918
  if (provisioning.metalHostname !== undefined && !/^(?=.{1,253}$)[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(String(provisioning.metalHostname)))
919
919
  fail(`deployment.spec.targets.${targetName}.provisioning.metalHostname`, "is invalid.");
920
+ const provisionedResources = object(provisioning.resources, `deployment.spec.targets.${targetName}.provisioning.resources`);
921
+ exact3(provisionedResources, ["physicalCores", "vcpu", "memoryGib", "diskGib", "egressGuaranteedMbps", "egressBurstMbps", "confidential"], `deployment.spec.targets.${targetName}.provisioning.resources`);
922
+ integer(provisionedResources.physicalCores, `deployment.spec.targets.${targetName}.provisioning.resources.physicalCores`, 1, 1024);
923
+ integer(provisionedResources.vcpu, `deployment.spec.targets.${targetName}.provisioning.resources.vcpu`, 1, 4096);
924
+ integer(provisionedResources.memoryGib, `deployment.spec.targets.${targetName}.provisioning.resources.memoryGib`, 1, 4194304);
925
+ integer(provisionedResources.diskGib, `deployment.spec.targets.${targetName}.provisioning.resources.diskGib`, 1, 1048576);
926
+ integer(provisionedResources.egressGuaranteedMbps, `deployment.spec.targets.${targetName}.provisioning.resources.egressGuaranteedMbps`, 0, 1e7);
927
+ integer(provisionedResources.egressBurstMbps, `deployment.spec.targets.${targetName}.provisioning.resources.egressBurstMbps`, Number(provisionedResources.egressGuaranteedMbps), 1e7);
928
+ if (typeof provisionedResources.confidential !== "boolean")
929
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources.confidential`, "must be boolean.");
930
+ if (typeof capacity.cpuCores === "number" && Number(provisionedResources.vcpu) < capacity.cpuCores || typeof capacity.memoryMiB === "number" && Number(provisionedResources.memoryGib) * 1024 < capacity.memoryMiB || typeof capacity.storageGiB === "number" && Number(provisionedResources.diskGib) < capacity.storageGiB) {
931
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources`, "must satisfy the per-slot allocation minimum.");
932
+ }
933
+ if ((selector.confidentialCompute === "required" || allocation.execution === "oci-kata-qemu-snp") && provisionedResources.confidential !== true)
934
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources.confidential`, "must be true for confidential execution.");
935
+ if (typeof provisioning.monthlyAmountCents !== "string" || !/^\d{1,18}$/.test(provisioning.monthlyAmountCents))
936
+ fail(`deployment.spec.targets.${targetName}.provisioning.monthlyAmountCents`, "must be a bounded USD-cent amount.");
920
937
  if (typeof provisioning.maxMonthlySpendMinor !== "string" || !/^\d{1,18}$/.test(provisioning.maxMonthlySpendMinor))
921
938
  fail(`deployment.spec.targets.${targetName}.provisioning.maxMonthlySpendMinor`, "must be a bounded decimal minor-unit amount.");
922
939
  }
@@ -910,13 +910,30 @@ function compileDeployment(sourceValue) {
910
910
  fail(`deployment.spec.targets.${targetName}.allocation.execution`, "cannot satisfy required confidential compute.");
911
911
  if (target.provisioning !== undefined) {
912
912
  const provisioning = object(target.provisioning, `deployment.spec.targets.${targetName}.provisioning`);
913
- exact3(provisioning, ["planKey", "regionKey", "imageKey", "environmentKey", "ownership", "metalHostname", "maxMonthlySpendMinor"], `deployment.spec.targets.${targetName}.provisioning`);
914
- for (const key of ["planKey", "regionKey", "imageKey", "environmentKey"])
913
+ exact3(provisioning, ["regionKey", "imageKey", "environmentKey", "ownership", "metalHostname", "resources", "monthlyAmountCents", "maxMonthlySpendMinor"], `deployment.spec.targets.${targetName}.provisioning`);
914
+ for (const key of ["regionKey", "imageKey", "environmentKey"])
915
915
  named(provisioning[key], `deployment.spec.targets.${targetName}.provisioning.${key}`);
916
916
  if (!["platform", "tenant-metal"].includes(String(provisioning.ownership)) || provisioning.ownership === "tenant-metal" !== Boolean(provisioning.metalHostname))
917
917
  fail(`deployment.spec.targets.${targetName}.provisioning.ownership`, "must bind platform capacity or one tenant metal hostname.");
918
918
  if (provisioning.metalHostname !== undefined && !/^(?=.{1,253}$)[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(String(provisioning.metalHostname)))
919
919
  fail(`deployment.spec.targets.${targetName}.provisioning.metalHostname`, "is invalid.");
920
+ const provisionedResources = object(provisioning.resources, `deployment.spec.targets.${targetName}.provisioning.resources`);
921
+ exact3(provisionedResources, ["physicalCores", "vcpu", "memoryGib", "diskGib", "egressGuaranteedMbps", "egressBurstMbps", "confidential"], `deployment.spec.targets.${targetName}.provisioning.resources`);
922
+ integer(provisionedResources.physicalCores, `deployment.spec.targets.${targetName}.provisioning.resources.physicalCores`, 1, 1024);
923
+ integer(provisionedResources.vcpu, `deployment.spec.targets.${targetName}.provisioning.resources.vcpu`, 1, 4096);
924
+ integer(provisionedResources.memoryGib, `deployment.spec.targets.${targetName}.provisioning.resources.memoryGib`, 1, 4194304);
925
+ integer(provisionedResources.diskGib, `deployment.spec.targets.${targetName}.provisioning.resources.diskGib`, 1, 1048576);
926
+ integer(provisionedResources.egressGuaranteedMbps, `deployment.spec.targets.${targetName}.provisioning.resources.egressGuaranteedMbps`, 0, 1e7);
927
+ integer(provisionedResources.egressBurstMbps, `deployment.spec.targets.${targetName}.provisioning.resources.egressBurstMbps`, Number(provisionedResources.egressGuaranteedMbps), 1e7);
928
+ if (typeof provisionedResources.confidential !== "boolean")
929
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources.confidential`, "must be boolean.");
930
+ if (typeof capacity.cpuCores === "number" && Number(provisionedResources.vcpu) < capacity.cpuCores || typeof capacity.memoryMiB === "number" && Number(provisionedResources.memoryGib) * 1024 < capacity.memoryMiB || typeof capacity.storageGiB === "number" && Number(provisionedResources.diskGib) < capacity.storageGiB) {
931
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources`, "must satisfy the per-slot allocation minimum.");
932
+ }
933
+ if ((selector.confidentialCompute === "required" || allocation.execution === "oci-kata-qemu-snp") && provisionedResources.confidential !== true)
934
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources.confidential`, "must be true for confidential execution.");
935
+ if (typeof provisioning.monthlyAmountCents !== "string" || !/^\d{1,18}$/.test(provisioning.monthlyAmountCents))
936
+ fail(`deployment.spec.targets.${targetName}.provisioning.monthlyAmountCents`, "must be a bounded USD-cent amount.");
920
937
  if (typeof provisioning.maxMonthlySpendMinor !== "string" || !/^\d{1,18}$/.test(provisioning.maxMonthlySpendMinor))
921
938
  fail(`deployment.spec.targets.${targetName}.provisioning.maxMonthlySpendMinor`, "must be a bounded decimal minor-unit amount.");
922
939
  }
package/dist/deploy.d.ts CHANGED
@@ -185,12 +185,21 @@ export interface TargetDefinition {
185
185
  };
186
186
  /** Required only when the control plane may create capacity after reuse is exhausted. */
187
187
  provisioning?: {
188
- planKey: string;
189
188
  regionKey: string;
190
189
  imageKey: string;
191
190
  environmentKey: string;
192
191
  ownership: 'platform' | 'tenant-metal';
193
192
  metalHostname?: string;
193
+ resources: {
194
+ physicalCores: number;
195
+ vcpu: number;
196
+ memoryGib: number;
197
+ diskGib: number;
198
+ egressGuaranteedMbps: number;
199
+ egressBurstMbps: number;
200
+ confidential: boolean;
201
+ };
202
+ monthlyAmountCents: string;
194
203
  maxMonthlySpendMinor: string;
195
204
  };
196
205
  /** Per-slot connectivity intent. Credential names resolve through the scoped Vault, never to plan values. */
@@ -123,12 +123,21 @@ export interface ResolvedDeploymentTarget {
123
123
  existing: 'prefer' | 'require';
124
124
  };
125
125
  provisioning?: {
126
- planKey: string;
127
126
  regionKey: string;
128
127
  imageKey: string;
129
128
  environmentKey: string;
130
129
  ownership: 'platform' | 'tenant-metal';
131
130
  metalHostname?: string;
131
+ resources: {
132
+ physicalCores: number;
133
+ vcpu: number;
134
+ memoryGib: number;
135
+ diskGib: number;
136
+ egressGuaranteedMbps: number;
137
+ egressBurstMbps: number;
138
+ confidential: boolean;
139
+ };
140
+ monthlyAmountCents: string;
132
141
  maxMonthlySpendMinor: string;
133
142
  };
134
143
  connectivity?: {
package/dist/fz-agent.js CHANGED
@@ -7160,13 +7160,30 @@ function compileDeployment(sourceValue) {
7160
7160
  fail(`deployment.spec.targets.${targetName}.allocation.execution`, "cannot satisfy required confidential compute.");
7161
7161
  if (target.provisioning !== undefined) {
7162
7162
  const provisioning = object(target.provisioning, `deployment.spec.targets.${targetName}.provisioning`);
7163
- exact3(provisioning, ["planKey", "regionKey", "imageKey", "environmentKey", "ownership", "metalHostname", "maxMonthlySpendMinor"], `deployment.spec.targets.${targetName}.provisioning`);
7164
- for (const key of ["planKey", "regionKey", "imageKey", "environmentKey"])
7163
+ exact3(provisioning, ["regionKey", "imageKey", "environmentKey", "ownership", "metalHostname", "resources", "monthlyAmountCents", "maxMonthlySpendMinor"], `deployment.spec.targets.${targetName}.provisioning`);
7164
+ for (const key of ["regionKey", "imageKey", "environmentKey"])
7165
7165
  named(provisioning[key], `deployment.spec.targets.${targetName}.provisioning.${key}`);
7166
7166
  if (!["platform", "tenant-metal"].includes(String(provisioning.ownership)) || provisioning.ownership === "tenant-metal" !== Boolean(provisioning.metalHostname))
7167
7167
  fail(`deployment.spec.targets.${targetName}.provisioning.ownership`, "must bind platform capacity or one tenant metal hostname.");
7168
7168
  if (provisioning.metalHostname !== undefined && !/^(?=.{1,253}$)[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(String(provisioning.metalHostname)))
7169
7169
  fail(`deployment.spec.targets.${targetName}.provisioning.metalHostname`, "is invalid.");
7170
+ const provisionedResources = object(provisioning.resources, `deployment.spec.targets.${targetName}.provisioning.resources`);
7171
+ exact3(provisionedResources, ["physicalCores", "vcpu", "memoryGib", "diskGib", "egressGuaranteedMbps", "egressBurstMbps", "confidential"], `deployment.spec.targets.${targetName}.provisioning.resources`);
7172
+ integer(provisionedResources.physicalCores, `deployment.spec.targets.${targetName}.provisioning.resources.physicalCores`, 1, 1024);
7173
+ integer(provisionedResources.vcpu, `deployment.spec.targets.${targetName}.provisioning.resources.vcpu`, 1, 4096);
7174
+ integer(provisionedResources.memoryGib, `deployment.spec.targets.${targetName}.provisioning.resources.memoryGib`, 1, 4194304);
7175
+ integer(provisionedResources.diskGib, `deployment.spec.targets.${targetName}.provisioning.resources.diskGib`, 1, 1048576);
7176
+ integer(provisionedResources.egressGuaranteedMbps, `deployment.spec.targets.${targetName}.provisioning.resources.egressGuaranteedMbps`, 0, 1e7);
7177
+ integer(provisionedResources.egressBurstMbps, `deployment.spec.targets.${targetName}.provisioning.resources.egressBurstMbps`, Number(provisionedResources.egressGuaranteedMbps), 1e7);
7178
+ if (typeof provisionedResources.confidential !== "boolean")
7179
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources.confidential`, "must be boolean.");
7180
+ if (typeof capacity.cpuCores === "number" && Number(provisionedResources.vcpu) < capacity.cpuCores || typeof capacity.memoryMiB === "number" && Number(provisionedResources.memoryGib) * 1024 < capacity.memoryMiB || typeof capacity.storageGiB === "number" && Number(provisionedResources.diskGib) < capacity.storageGiB) {
7181
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources`, "must satisfy the per-slot allocation minimum.");
7182
+ }
7183
+ if ((selector.confidentialCompute === "required" || allocation.execution === "oci-kata-qemu-snp") && provisionedResources.confidential !== true)
7184
+ fail(`deployment.spec.targets.${targetName}.provisioning.resources.confidential`, "must be true for confidential execution.");
7185
+ if (typeof provisioning.monthlyAmountCents !== "string" || !/^\d{1,18}$/.test(provisioning.monthlyAmountCents))
7186
+ fail(`deployment.spec.targets.${targetName}.provisioning.monthlyAmountCents`, "must be a bounded USD-cent amount.");
7170
7187
  if (typeof provisioning.maxMonthlySpendMinor !== "string" || !/^\d{1,18}$/.test(provisioning.maxMonthlySpendMinor))
7171
7188
  fail(`deployment.spec.targets.${targetName}.provisioning.maxMonthlySpendMinor`, "must be a bounded decimal minor-unit amount.");
7172
7189
  }
@@ -9601,7 +9618,7 @@ async function writeAndCloseProcessInput(input, value) {
9601
9618
  }
9602
9619
 
9603
9620
  // src/version.ts
9604
- var VERSION2 = "0.1.117";
9621
+ var VERSION2 = "0.1.118";
9605
9622
 
9606
9623
  // src/ssh-bootstrap.ts
9607
9624
  class SshBootstrapError extends Error {
package/dist/fz.js CHANGED
@@ -4841,7 +4841,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
4841
4841
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
4842
4842
 
4843
4843
  // src/version.ts
4844
- var VERSION2 = "0.1.117";
4844
+ var VERSION2 = "0.1.118";
4845
4845
 
4846
4846
  // src/software.ts
4847
4847
  var PINNED_BUN_VERSION = "1.3.14";
@@ -11349,13 +11349,30 @@ function compileDeployment(sourceValue) {
11349
11349
  fail2(`deployment.spec.targets.${targetName}.allocation.execution`, "cannot satisfy required confidential compute.");
11350
11350
  if (target.provisioning !== undefined) {
11351
11351
  const provisioning = object(target.provisioning, `deployment.spec.targets.${targetName}.provisioning`);
11352
- exact3(provisioning, ["planKey", "regionKey", "imageKey", "environmentKey", "ownership", "metalHostname", "maxMonthlySpendMinor"], `deployment.spec.targets.${targetName}.provisioning`);
11353
- for (const key of ["planKey", "regionKey", "imageKey", "environmentKey"])
11352
+ exact3(provisioning, ["regionKey", "imageKey", "environmentKey", "ownership", "metalHostname", "resources", "monthlyAmountCents", "maxMonthlySpendMinor"], `deployment.spec.targets.${targetName}.provisioning`);
11353
+ for (const key of ["regionKey", "imageKey", "environmentKey"])
11354
11354
  named(provisioning[key], `deployment.spec.targets.${targetName}.provisioning.${key}`);
11355
11355
  if (!["platform", "tenant-metal"].includes(String(provisioning.ownership)) || provisioning.ownership === "tenant-metal" !== Boolean(provisioning.metalHostname))
11356
11356
  fail2(`deployment.spec.targets.${targetName}.provisioning.ownership`, "must bind platform capacity or one tenant metal hostname.");
11357
11357
  if (provisioning.metalHostname !== undefined && !/^(?=.{1,253}$)[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(String(provisioning.metalHostname)))
11358
11358
  fail2(`deployment.spec.targets.${targetName}.provisioning.metalHostname`, "is invalid.");
11359
+ const provisionedResources = object(provisioning.resources, `deployment.spec.targets.${targetName}.provisioning.resources`);
11360
+ exact3(provisionedResources, ["physicalCores", "vcpu", "memoryGib", "diskGib", "egressGuaranteedMbps", "egressBurstMbps", "confidential"], `deployment.spec.targets.${targetName}.provisioning.resources`);
11361
+ integer(provisionedResources.physicalCores, `deployment.spec.targets.${targetName}.provisioning.resources.physicalCores`, 1, 1024);
11362
+ integer(provisionedResources.vcpu, `deployment.spec.targets.${targetName}.provisioning.resources.vcpu`, 1, 4096);
11363
+ integer(provisionedResources.memoryGib, `deployment.spec.targets.${targetName}.provisioning.resources.memoryGib`, 1, 4194304);
11364
+ integer(provisionedResources.diskGib, `deployment.spec.targets.${targetName}.provisioning.resources.diskGib`, 1, 1048576);
11365
+ integer(provisionedResources.egressGuaranteedMbps, `deployment.spec.targets.${targetName}.provisioning.resources.egressGuaranteedMbps`, 0, 1e7);
11366
+ integer(provisionedResources.egressBurstMbps, `deployment.spec.targets.${targetName}.provisioning.resources.egressBurstMbps`, Number(provisionedResources.egressGuaranteedMbps), 1e7);
11367
+ if (typeof provisionedResources.confidential !== "boolean")
11368
+ fail2(`deployment.spec.targets.${targetName}.provisioning.resources.confidential`, "must be boolean.");
11369
+ if (typeof capacity.cpuCores === "number" && Number(provisionedResources.vcpu) < capacity.cpuCores || typeof capacity.memoryMiB === "number" && Number(provisionedResources.memoryGib) * 1024 < capacity.memoryMiB || typeof capacity.storageGiB === "number" && Number(provisionedResources.diskGib) < capacity.storageGiB) {
11370
+ fail2(`deployment.spec.targets.${targetName}.provisioning.resources`, "must satisfy the per-slot allocation minimum.");
11371
+ }
11372
+ if ((selector.confidentialCompute === "required" || allocation.execution === "oci-kata-qemu-snp") && provisionedResources.confidential !== true)
11373
+ fail2(`deployment.spec.targets.${targetName}.provisioning.resources.confidential`, "must be true for confidential execution.");
11374
+ if (typeof provisioning.monthlyAmountCents !== "string" || !/^\d{1,18}$/.test(provisioning.monthlyAmountCents))
11375
+ fail2(`deployment.spec.targets.${targetName}.provisioning.monthlyAmountCents`, "must be a bounded USD-cent amount.");
11359
11376
  if (typeof provisioning.maxMonthlySpendMinor !== "string" || !/^\d{1,18}$/.test(provisioning.maxMonthlySpendMinor))
11360
11377
  fail2(`deployment.spec.targets.${targetName}.provisioning.maxMonthlySpendMinor`, "must be a bounded decimal minor-unit amount.");
11361
11378
  }
@@ -11701,13 +11718,24 @@ function initCoordinates(options) {
11701
11718
  throw new Error("reuse require cannot include provisioning coordinates");
11702
11719
  if (options.provisioning !== undefined) {
11703
11720
  for (const [label, value] of Object.entries({
11704
- plan: options.provisioning.planKey,
11705
11721
  region: options.provisioning.regionKey,
11706
11722
  image: options.provisioning.imageKey,
11707
11723
  environment: options.provisioning.environmentKey
11708
11724
  }))
11709
11725
  if (!/^[a-z][a-z0-9-]{0,62}$/.test(value))
11710
11726
  throw new Error(`deployment provisioning ${label} must be a lowercase typed name`);
11727
+ const resources = options.provisioning.resources;
11728
+ for (const [label, value] of Object.entries(resources).filter(([key]) => key !== "confidential")) {
11729
+ if (!Number.isSafeInteger(value) || Number(value) < 0)
11730
+ throw new Error(`deployment provisioning ${label} must be a non-negative integer`);
11731
+ }
11732
+ if (resources.physicalCores < 1 || resources.vcpu < result.cpuCores || resources.memoryGib * 1024 < result.memoryMiB || resources.diskGib < result.storageGiB || resources.egressBurstMbps < resources.egressGuaranteedMbps) {
11733
+ throw new Error("deployment provisioning resources must satisfy the target allocation and bandwidth bounds");
11734
+ }
11735
+ if (result.isolation === "sev-snp" && !resources.confidential)
11736
+ throw new Error("deployment provisioning must provide confidential capacity for sev-snp");
11737
+ if (!/^\d{1,18}$/.test(options.provisioning.monthlyAmountCents))
11738
+ throw new Error("deployment provisioning monthly amount must be a bounded USD-cent amount");
11711
11739
  if (!/^\d{1,18}$/.test(options.provisioning.maxMonthlySpendMinor))
11712
11740
  throw new Error("deployment provisioning monthly spend must be a bounded decimal minor-unit amount");
11713
11741
  if (options.provisioning.ownership === "tenant-metal" && !options.provisioning.metalHostname)
@@ -11724,7 +11752,7 @@ function defaultTypeScriptDeployment(name, options = {}) {
11724
11752
  const execution = selected.runtime === "native" ? "native" : selected.runtime === "containerd" ? "oci-runc" : "oci-kata-qemu-snp";
11725
11753
  const hostPackageVersion = selected.operatingSystem === "ubuntu-24.04" ? "ubuntu-24.04" : "ubuntu-26.04";
11726
11754
  const provisioningBlock = selected.provisioning === undefined ? "" : `,
11727
- 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}' }`;
11755
+ provisioning: { regionKey: '${selected.provisioning.regionKey}', imageKey: '${selected.provisioning.imageKey}', environmentKey: '${selected.provisioning.environmentKey}', ownership: '${selected.provisioning.ownership}',${selected.provisioning.metalHostname ? ` metalHostname: '${selected.provisioning.metalHostname}',` : ""} resources: ${JSON.stringify(selected.provisioning.resources)}, monthlyAmountCents: '${selected.provisioning.monthlyAmountCents}', maxMonthlySpendMinor: '${selected.provisioning.maxMonthlySpendMinor}' }`;
11728
11756
  const requirementBlock = selected.runtime === "native" ? `bun: providers.bun.require()` : selected.runtime === "containerd" ? `containerd: providers.containerd.require({ version: '${hostPackageVersion}' }),
11729
11757
  nginx: providers.nginx.require({ version: '${hostPackageVersion}' })` : `containerd: providers.containerd.require(),
11730
11758
  kata: providers.kata.require(),
@@ -18771,9 +18799,6 @@ function parseOptions(argv2) {
18771
18799
  options.deployReuse = value;
18772
18800
  else
18773
18801
  options.optionError = "--reuse must be require or prefer.";
18774
- } else if (token === "--provision-plan") {
18775
- options.deployProvisionPlan = argv2[++index];
18776
- options.deployInitCustomized = true;
18777
18802
  } else if (token === "--provision-region") {
18778
18803
  options.deployProvisionRegion = argv2[++index];
18779
18804
  options.deployInitCustomized = true;
@@ -18793,6 +18818,26 @@ function parseOptions(argv2) {
18793
18818
  } else if (token === "--provision-metal") {
18794
18819
  options.deployProvisionMetal = argv2[++index];
18795
18820
  options.deployInitCustomized = true;
18821
+ } else if (["--provision-physical-cores", "--provision-vcpu", "--provision-memory-gib", "--provision-disk-gib", "--provision-guaranteed-mbps", "--provision-burst-mbps"].includes(token)) {
18822
+ const value = Number(argv2[++index] ?? "");
18823
+ options.deployInitCustomized = true;
18824
+ if (!Number.isSafeInteger(value) || value < 0)
18825
+ options.optionError = `${token} must be a non-negative integer.`;
18826
+ else if (token === "--provision-physical-cores")
18827
+ options.deployProvisionPhysicalCores = value;
18828
+ else if (token === "--provision-vcpu")
18829
+ options.deployProvisionVcpu = value;
18830
+ else if (token === "--provision-memory-gib")
18831
+ options.deployProvisionMemoryGib = value;
18832
+ else if (token === "--provision-disk-gib")
18833
+ options.deployProvisionDiskGib = value;
18834
+ else if (token === "--provision-guaranteed-mbps")
18835
+ options.deployProvisionGuaranteedMbps = value;
18836
+ else
18837
+ options.deployProvisionBurstMbps = value;
18838
+ } else if (token === "--provision-monthly-amount-cents") {
18839
+ options.deployProvisionMonthlyAmountCents = argv2[++index];
18840
+ options.deployInitCustomized = true;
18796
18841
  } else if (token === "--max-monthly-spend-minor") {
18797
18842
  options.deployMaxMonthlySpendMinor = argv2[++index];
18798
18843
  options.deployInitCustomized = true;
@@ -20581,20 +20626,35 @@ async function cmdDeploy(options, args) {
20581
20626
  reuse: options.deployReuse,
20582
20627
  profile: options.deployProfile,
20583
20628
  ...[
20584
- options.deployProvisionPlan,
20585
20629
  options.deployProvisionRegion,
20586
20630
  options.deployProvisionImage,
20587
20631
  options.deployProvisionEnvironment,
20588
20632
  options.deployProvisionOwnership,
20633
+ options.deployProvisionPhysicalCores,
20634
+ options.deployProvisionVcpu,
20635
+ options.deployProvisionMemoryGib,
20636
+ options.deployProvisionDiskGib,
20637
+ options.deployProvisionGuaranteedMbps,
20638
+ options.deployProvisionBurstMbps,
20639
+ options.deployProvisionMonthlyAmountCents,
20589
20640
  options.deployMaxMonthlySpendMinor
20590
20641
  ].some((value) => value !== undefined) ? {
20591
20642
  provisioning: {
20592
- planKey: options.deployProvisionPlan ?? "",
20593
20643
  regionKey: options.deployProvisionRegion ?? "",
20594
20644
  imageKey: options.deployProvisionImage ?? "",
20595
20645
  environmentKey: options.deployProvisionEnvironment ?? "",
20596
20646
  ownership: options.deployProvisionOwnership ?? "platform",
20597
20647
  ...options.deployProvisionMetal ? { metalHostname: options.deployProvisionMetal } : {},
20648
+ resources: {
20649
+ physicalCores: options.deployProvisionPhysicalCores ?? 0,
20650
+ vcpu: options.deployProvisionVcpu ?? 0,
20651
+ memoryGib: options.deployProvisionMemoryGib ?? 0,
20652
+ diskGib: options.deployProvisionDiskGib ?? 0,
20653
+ egressGuaranteedMbps: options.deployProvisionGuaranteedMbps ?? 0,
20654
+ egressBurstMbps: options.deployProvisionBurstMbps ?? 0,
20655
+ confidential: options.deployIsolation === "sev-snp"
20656
+ },
20657
+ monthlyAmountCents: options.deployProvisionMonthlyAmountCents ?? "",
20598
20658
  maxMonthlySpendMinor: options.deployMaxMonthlySpendMinor ?? ""
20599
20659
  }
20600
20660
  } : {}
@@ -20933,9 +20993,13 @@ function usage() {
20933
20993
  --storage-gib <n> Reserved storage GiB per compute
20934
20994
  --sharing <mode> exclusive or shared (native requires exclusive)
20935
20995
  --reuse <mode> require existing capacity or prefer reuse then approved provisioning
20936
- --provision-plan <key> --provision-region <key> --provision-image <key>
20996
+ --provision-region <key> --provision-image <key>
20937
20997
  --provision-environment <key> --provision-ownership <platform|tenant-metal>
20938
20998
  --provision-metal <host> Required only for tenant-metal ownership
20999
+ --provision-physical-cores <n> --provision-vcpu <n>
21000
+ --provision-memory-gib <n> --provision-disk-gib <n>
21001
+ --provision-guaranteed-mbps <n> --provision-burst-mbps <n>
21002
+ --provision-monthly-amount-cents <n> Exact approved USD cost per created compute
20939
21003
  --max-monthly-spend-minor <n> Hard approved scale-out spend ceiling
20940
21004
  --force Init may replace an existing generated target
20941
21005
 
@@ -366,7 +366,7 @@ function systemdAgentEgressDirectives(loopbackTcpPorts = []) {
366
366
  }
367
367
 
368
368
  // src/version.ts
369
- var VERSION = "0.1.117";
369
+ var VERSION = "0.1.118";
370
370
 
371
371
  // src/otel-collector.ts
372
372
  var FORGEZERO_OTEL_COLLECTOR_UNIT = "forgezero-otel-collector.service";
@@ -1460,7 +1460,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
1460
1460
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
1461
1461
 
1462
1462
  // src/version.ts
1463
- var VERSION = "0.1.117";
1463
+ var VERSION = "0.1.118";
1464
1464
 
1465
1465
  // src/software.ts
1466
1466
  var PINNED_BUN_VERSION = "1.3.14";
@@ -3009,7 +3009,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
3009
3009
  }
3010
3010
 
3011
3011
  // src/version.ts
3012
- var VERSION3 = "0.1.117";
3012
+ var VERSION3 = "0.1.118";
3013
3013
 
3014
3014
  // src/egress-policy.ts
3015
3015
  import { realpathSync as realpathSync3 } from "node:fs";
package/dist/provision.js CHANGED
@@ -3009,7 +3009,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
3009
3009
  }
3010
3010
 
3011
3011
  // src/version.ts
3012
- var VERSION3 = "0.1.117";
3012
+ var VERSION3 = "0.1.118";
3013
3013
 
3014
3014
  // src/egress-policy.ts
3015
3015
  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.117";
2
+ export declare const VERSION = "0.1.118";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgezero/agent",
3
- "version": "0.1.117",
3
+ "version": "0.1.118",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "check": "tsc --noEmit",