@forgezero/agent 0.1.48 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-heartbeat.js +1 -1
- package/dist/bootstrap.js +1 -1
- package/dist/fz-agent.js +13 -4
- package/dist/fz.js +20 -2
- package/dist/index.d.ts +1 -0
- package/dist/metal-bootstrap.js +1 -1
- package/dist/operator-bootstrap.js +20 -2
- package/dist/platform-fleet-verification.js +1 -1
- package/dist/provision.js +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/agent-heartbeat.js
CHANGED
package/dist/bootstrap.js
CHANGED
package/dist/fz-agent.js
CHANGED
|
@@ -7000,7 +7000,7 @@ function assertSupportedGuestImage(imageKey) {
|
|
|
7000
7000
|
}
|
|
7001
7001
|
|
|
7002
7002
|
// src/version.ts
|
|
7003
|
-
var VERSION = "0.1.
|
|
7003
|
+
var VERSION = "0.1.50";
|
|
7004
7004
|
|
|
7005
7005
|
// src/ssh-bootstrap.ts
|
|
7006
7006
|
class SshBootstrapError extends Error {
|
|
@@ -13511,6 +13511,12 @@ async function runSupervisedApp(path2) {
|
|
|
13511
13511
|
}
|
|
13512
13512
|
|
|
13513
13513
|
// src/index.ts
|
|
13514
|
+
function agentCommandArgs(args, command2) {
|
|
13515
|
+
const index = args.indexOf(command2);
|
|
13516
|
+
if (index < 0)
|
|
13517
|
+
throw new Error(`missing Agent command ${command2}`);
|
|
13518
|
+
return args.slice(index + 1);
|
|
13519
|
+
}
|
|
13514
13520
|
function loadOrCreateSeed(path2) {
|
|
13515
13521
|
if (existsSync18(path2)) {
|
|
13516
13522
|
const seed2 = new Uint8Array(Buffer.from(readFileSync18(path2, "utf8").trim(), "base64url"));
|
|
@@ -14014,15 +14020,17 @@ if (import.meta.main) {
|
|
|
14014
14020
|
process.exit(0);
|
|
14015
14021
|
}
|
|
14016
14022
|
if (command2 === "platform-fleet-verify") {
|
|
14017
|
-
const
|
|
14018
|
-
|
|
14023
|
+
const commandArgs = agentCommandArgs(args, command2);
|
|
14024
|
+
const expectedVersion = commandArgs.find((arg) => arg.startsWith("--expected-version="))?.slice("--expected-version=".length);
|
|
14025
|
+
if (!expectedVersion || commandArgs.length !== 1) {
|
|
14019
14026
|
throw new Error("platform-fleet-verify requires exactly --expected-version=<semver>");
|
|
14020
14027
|
}
|
|
14021
14028
|
console.log(JSON.stringify(await verifyPlatformFleetHost(expectedVersion)));
|
|
14022
14029
|
process.exit(0);
|
|
14023
14030
|
}
|
|
14024
14031
|
if (command2 === "community-rehearsal") {
|
|
14025
|
-
|
|
14032
|
+
const commandArgs = agentCommandArgs(args, command2);
|
|
14033
|
+
if (commandArgs.length !== 1 || commandArgs[0] !== "--request=-") {
|
|
14026
14034
|
throw new Error("community-rehearsal requires exactly --request=-");
|
|
14027
14035
|
}
|
|
14028
14036
|
const raw = readFileSync18("/dev/stdin", "utf8");
|
|
@@ -14609,6 +14617,7 @@ export {
|
|
|
14609
14617
|
applyAgentEgressPolicy,
|
|
14610
14618
|
allocateCpuPool,
|
|
14611
14619
|
allocateAddress,
|
|
14620
|
+
agentCommandArgs,
|
|
14612
14621
|
activateAgentRelease,
|
|
14613
14622
|
VERSION,
|
|
14614
14623
|
SYSTEMD_RESOLVED_STUB,
|
package/dist/fz.js
CHANGED
|
@@ -4830,7 +4830,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
|
|
|
4830
4830
|
var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
|
|
4831
4831
|
|
|
4832
4832
|
// src/version.ts
|
|
4833
|
-
var VERSION2 = "0.1.
|
|
4833
|
+
var VERSION2 = "0.1.50";
|
|
4834
4834
|
|
|
4835
4835
|
// src/software.ts
|
|
4836
4836
|
var PINNED_BUN_VERSION = "1.3.14";
|
|
@@ -14646,6 +14646,23 @@ var remote = async (exec, request, knownHosts, argv2, label, secret = false, std
|
|
|
14646
14646
|
argv2.forEach(safeRemoteArg);
|
|
14647
14647
|
return checked4(exec, ["ssh", ...sshOptions(request, knownHosts), destination2(request.target), "--", ...argv2], label, { secret, stdin });
|
|
14648
14648
|
};
|
|
14649
|
+
var remoteRegularFileExists = async (exec, request, knownHosts, path) => {
|
|
14650
|
+
safeRemoteArg(path);
|
|
14651
|
+
const result = await exec([
|
|
14652
|
+
"ssh",
|
|
14653
|
+
...sshOptions(request, knownHosts),
|
|
14654
|
+
destination2(request.target),
|
|
14655
|
+
"--",
|
|
14656
|
+
"/usr/bin/test",
|
|
14657
|
+
"-f",
|
|
14658
|
+
path
|
|
14659
|
+
]);
|
|
14660
|
+
if (result.exitCode === 0)
|
|
14661
|
+
return true;
|
|
14662
|
+
if (result.exitCode === 1)
|
|
14663
|
+
return false;
|
|
14664
|
+
throw new Error(`remote initialized-state probe failed${result.output ? `: ${result.output.trim()}` : ""}`);
|
|
14665
|
+
};
|
|
14649
14666
|
var copy = async (exec, request, knownHosts, local, remotePath, secret = false) => {
|
|
14650
14667
|
safeRemoteArg(remotePath);
|
|
14651
14668
|
await checked4(exec, [
|
|
@@ -14820,12 +14837,13 @@ async function applyOperatorMetalBootstrap(request, mode, options = {}) {
|
|
|
14820
14837
|
await copy(exec, request, knownHosts, join10(directory, name), `${remoteTemp}/${name}`, true);
|
|
14821
14838
|
for (const name of ["metal-config.json", ...staged.files])
|
|
14822
14839
|
await remote(exec, request, knownHosts, ["/usr/bin/sudo", "-n", "/usr/bin/install", "-m", "0600", `${remoteTemp}/${name}`, `${REMOTE_STAGE}/${name}`], "remote metal handoff", true);
|
|
14840
|
+
const initialized = await remoteRegularFileExists(exec, request, knownHosts, "/etc/forgezero/metal.initialized.json");
|
|
14823
14841
|
const output = await remote(exec, request, knownHosts, [
|
|
14824
14842
|
"/usr/bin/sudo",
|
|
14825
14843
|
"-n",
|
|
14826
14844
|
"/usr/local/bin/fz",
|
|
14827
14845
|
"bootstrap",
|
|
14828
|
-
"metal",
|
|
14846
|
+
initialized ? "repair" : "metal",
|
|
14829
14847
|
"--bootstrap-config",
|
|
14830
14848
|
`${REMOTE_STAGE}/metal-config.json`,
|
|
14831
14849
|
"--apply"
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { type NodeKeyPair } from '@forgezero/runtime/identity';
|
|
3
3
|
import { startAgent, type AgentOptions, type AttestationSource } from './socket';
|
|
4
4
|
import type { SecretCache } from './cache';
|
|
5
|
+
export declare function agentCommandArgs(args: readonly string[], command: string): string[];
|
|
5
6
|
import { type DeploymentCredentialSchema } from './credential-schema';
|
|
6
7
|
export { VERSION } from './version';
|
|
7
8
|
export { startAgent, handleRequest, handleApplicationRequest } from './socket';
|
package/dist/metal-bootstrap.js
CHANGED
|
@@ -292,7 +292,7 @@ function systemdAgentEgressDirectives(loopbackTcpPorts = []) {
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
// src/version.ts
|
|
295
|
-
var VERSION = "0.1.
|
|
295
|
+
var VERSION = "0.1.50";
|
|
296
296
|
|
|
297
297
|
// src/otel-collector.ts
|
|
298
298
|
var FORGEZERO_OTEL_COLLECTOR_UNIT = "forgezero-otel-collector.service";
|
|
@@ -1207,7 +1207,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
|
|
|
1207
1207
|
var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
|
|
1208
1208
|
|
|
1209
1209
|
// src/version.ts
|
|
1210
|
-
var VERSION = "0.1.
|
|
1210
|
+
var VERSION = "0.1.50";
|
|
1211
1211
|
|
|
1212
1212
|
// src/software.ts
|
|
1213
1213
|
var PINNED_BUN_VERSION = "1.3.14";
|
|
@@ -5550,6 +5550,23 @@ var remote = async (exec, request, knownHosts, argv, label, secret = false, stdi
|
|
|
5550
5550
|
argv.forEach(safeRemoteArg);
|
|
5551
5551
|
return checked4(exec, ["ssh", ...sshOptions(request, knownHosts), destination2(request.target), "--", ...argv], label, { secret, stdin });
|
|
5552
5552
|
};
|
|
5553
|
+
var remoteRegularFileExists = async (exec, request, knownHosts, path) => {
|
|
5554
|
+
safeRemoteArg(path);
|
|
5555
|
+
const result = await exec([
|
|
5556
|
+
"ssh",
|
|
5557
|
+
...sshOptions(request, knownHosts),
|
|
5558
|
+
destination2(request.target),
|
|
5559
|
+
"--",
|
|
5560
|
+
"/usr/bin/test",
|
|
5561
|
+
"-f",
|
|
5562
|
+
path
|
|
5563
|
+
]);
|
|
5564
|
+
if (result.exitCode === 0)
|
|
5565
|
+
return true;
|
|
5566
|
+
if (result.exitCode === 1)
|
|
5567
|
+
return false;
|
|
5568
|
+
throw new Error(`remote initialized-state probe failed${result.output ? `: ${result.output.trim()}` : ""}`);
|
|
5569
|
+
};
|
|
5553
5570
|
var copy = async (exec, request, knownHosts, local, remotePath, secret = false) => {
|
|
5554
5571
|
safeRemoteArg(remotePath);
|
|
5555
5572
|
await checked4(exec, [
|
|
@@ -5724,12 +5741,13 @@ async function applyOperatorMetalBootstrap(request, mode, options = {}) {
|
|
|
5724
5741
|
await copy(exec, request, knownHosts, join6(directory, name), `${remoteTemp}/${name}`, true);
|
|
5725
5742
|
for (const name of ["metal-config.json", ...staged.files])
|
|
5726
5743
|
await remote(exec, request, knownHosts, ["/usr/bin/sudo", "-n", "/usr/bin/install", "-m", "0600", `${remoteTemp}/${name}`, `${REMOTE_STAGE}/${name}`], "remote metal handoff", true);
|
|
5744
|
+
const initialized = await remoteRegularFileExists(exec, request, knownHosts, "/etc/forgezero/metal.initialized.json");
|
|
5727
5745
|
const output = await remote(exec, request, knownHosts, [
|
|
5728
5746
|
"/usr/bin/sudo",
|
|
5729
5747
|
"-n",
|
|
5730
5748
|
"/usr/local/bin/fz",
|
|
5731
5749
|
"bootstrap",
|
|
5732
|
-
"metal",
|
|
5750
|
+
initialized ? "repair" : "metal",
|
|
5733
5751
|
"--bootstrap-config",
|
|
5734
5752
|
`${REMOTE_STAGE}/metal-config.json`,
|
|
5735
5753
|
"--apply"
|
|
@@ -1697,7 +1697,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
|
|
|
1697
1697
|
}
|
|
1698
1698
|
|
|
1699
1699
|
// src/version.ts
|
|
1700
|
-
var VERSION3 = "0.1.
|
|
1700
|
+
var VERSION3 = "0.1.50";
|
|
1701
1701
|
|
|
1702
1702
|
// src/egress-policy.ts
|
|
1703
1703
|
import { realpathSync as realpathSync2 } from "node:fs";
|
package/dist/provision.js
CHANGED
|
@@ -1697,7 +1697,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
|
|
|
1697
1697
|
}
|
|
1698
1698
|
|
|
1699
1699
|
// src/version.ts
|
|
1700
|
-
var VERSION3 = "0.1.
|
|
1700
|
+
var VERSION3 = "0.1.50";
|
|
1701
1701
|
|
|
1702
1702
|
// src/egress-policy.ts
|
|
1703
1703
|
import { realpathSync as realpathSync2 } 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.
|
|
2
|
+
export declare const VERSION = "0.1.50";
|