@forgezero/agent 0.1.76 → 0.1.77
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 +23 -8
- package/dist/fz.js +1 -1
- package/dist/metal-bootstrap.js +1 -1
- package/dist/operator-bootstrap.js +1 -1
- package/dist/platform-fleet-verification.js +1 -1
- package/dist/provision.js +1 -1
- package/dist/stdin.d.ts +6 -0
- 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
|
@@ -9193,7 +9193,7 @@ async function writeAndCloseProcessInput(input, value) {
|
|
|
9193
9193
|
}
|
|
9194
9194
|
|
|
9195
9195
|
// src/version.ts
|
|
9196
|
-
var VERSION2 = "0.1.
|
|
9196
|
+
var VERSION2 = "0.1.77";
|
|
9197
9197
|
|
|
9198
9198
|
// src/ssh-bootstrap.ts
|
|
9199
9199
|
class SshBootstrapError extends Error {
|
|
@@ -16394,6 +16394,25 @@ async function runSupervisedApp(path2) {
|
|
|
16394
16394
|
}
|
|
16395
16395
|
}
|
|
16396
16396
|
|
|
16397
|
+
// src/stdin.ts
|
|
16398
|
+
async function readBoundedStdin(maxBytes) {
|
|
16399
|
+
if (!Number.isSafeInteger(maxBytes) || maxBytes < 1) {
|
|
16400
|
+
throw new Error("stdin byte limit must be a positive safe integer");
|
|
16401
|
+
}
|
|
16402
|
+
if (process.stdin.isTTY)
|
|
16403
|
+
throw new Error("stdin request pipe is required");
|
|
16404
|
+
const chunks = [];
|
|
16405
|
+
let bytes = 0;
|
|
16406
|
+
for await (const value of process.stdin) {
|
|
16407
|
+
const chunk = Buffer.isBuffer(value) ? value : Buffer.from(value);
|
|
16408
|
+
bytes += chunk.byteLength;
|
|
16409
|
+
if (bytes > maxBytes)
|
|
16410
|
+
throw new Error(`stdin request exceeds ${maxBytes} bytes`);
|
|
16411
|
+
chunks.push(chunk);
|
|
16412
|
+
}
|
|
16413
|
+
return Buffer.concat(chunks, bytes).toString("utf8");
|
|
16414
|
+
}
|
|
16415
|
+
|
|
16397
16416
|
// src/index.ts
|
|
16398
16417
|
function agentCommandArgs(args, command3) {
|
|
16399
16418
|
const index = args.indexOf(command3);
|
|
@@ -16892,7 +16911,7 @@ if (import.meta.main) {
|
|
|
16892
16911
|
if (claimArg !== "-" && !claimArg.startsWith("/")) {
|
|
16893
16912
|
throw new Error("metal-apply claim path must be absolute");
|
|
16894
16913
|
}
|
|
16895
|
-
const raw =
|
|
16914
|
+
const raw = claimArg === "-" ? await readBoundedStdin(32 * 1024) : readFileSync20(claimArg, "utf8");
|
|
16896
16915
|
if (Buffer.byteLength(raw) > 32 * 1024)
|
|
16897
16916
|
throw new Error("metal-apply claim exceeds 32 KiB");
|
|
16898
16917
|
const claim = JSON.parse(raw);
|
|
@@ -16917,9 +16936,7 @@ if (import.meta.main) {
|
|
|
16917
16936
|
if (commandArgs.length !== 1 || commandArgs[0] !== "--request=-") {
|
|
16918
16937
|
throw new Error("community-rehearsal requires exactly --request=-");
|
|
16919
16938
|
}
|
|
16920
|
-
const raw =
|
|
16921
|
-
if (Buffer.byteLength(raw) > 128 * 1024)
|
|
16922
|
-
throw new Error("community rehearsal request exceeds 128 KiB");
|
|
16939
|
+
const raw = await readBoundedStdin(128 * 1024);
|
|
16923
16940
|
const request = parseCommunityRehearsalHostRequest(JSON.parse(raw));
|
|
16924
16941
|
console.log(JSON.stringify(await runCommunityRehearsalHost(request)));
|
|
16925
16942
|
process.exit(0);
|
|
@@ -16928,9 +16945,7 @@ if (import.meta.main) {
|
|
|
16928
16945
|
if (args.length !== 1 || args[0] !== "--request=-") {
|
|
16929
16946
|
throw new Error("metal-admission-proof requires exactly --request=-");
|
|
16930
16947
|
}
|
|
16931
|
-
const raw =
|
|
16932
|
-
if (Buffer.byteLength(raw) > 32 * 1024)
|
|
16933
|
-
throw new Error("metal admission proof request exceeds 32 KiB");
|
|
16948
|
+
const raw = await readBoundedStdin(32 * 1024);
|
|
16934
16949
|
const request = JSON.parse(raw);
|
|
16935
16950
|
if (!/^[A-Za-z0-9_-]{1,64}$/.test(request.jobKey) || !/^[A-Za-z0-9_-]{1,64}$/.test(request.tenantKey) || !/^[A-Za-z0-9_-]{1,64}$/.test(request.projectKey) || !/^[a-z0-9][a-z0-9.-]{1,252}$/.test(request.hostname) || !/^[A-Za-z0-9_-]{32,128}$/.test(request.challenge) || !request.runnerNodeKey || !request.target?.host || !/^SHA256:[A-Za-z0-9+/]{43}$/.test(request.target.hostKeySha256)) {
|
|
16936
16951
|
throw new Error("metal admission proof request is malformed");
|
package/dist/fz.js
CHANGED
package/dist/metal-bootstrap.js
CHANGED
|
@@ -354,7 +354,7 @@ function systemdAgentEgressDirectives(loopbackTcpPorts = []) {
|
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
// src/version.ts
|
|
357
|
-
var VERSION = "0.1.
|
|
357
|
+
var VERSION = "0.1.77";
|
|
358
358
|
|
|
359
359
|
// src/otel-collector.ts
|
|
360
360
|
var FORGEZERO_OTEL_COLLECTOR_UNIT = "forgezero-otel-collector.service";
|
|
@@ -2498,7 +2498,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
|
|
|
2498
2498
|
}
|
|
2499
2499
|
|
|
2500
2500
|
// src/version.ts
|
|
2501
|
-
var VERSION3 = "0.1.
|
|
2501
|
+
var VERSION3 = "0.1.77";
|
|
2502
2502
|
|
|
2503
2503
|
// src/egress-policy.ts
|
|
2504
2504
|
import { realpathSync as realpathSync3 } from "node:fs";
|
package/dist/provision.js
CHANGED
|
@@ -2498,7 +2498,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
|
|
|
2498
2498
|
}
|
|
2499
2499
|
|
|
2500
2500
|
// src/version.ts
|
|
2501
|
-
var VERSION3 = "0.1.
|
|
2501
|
+
var VERSION3 = "0.1.77";
|
|
2502
2502
|
|
|
2503
2503
|
// src/egress-policy.ts
|
|
2504
2504
|
import { realpathSync as realpathSync3 } from "node:fs";
|
package/dist/stdin.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read one bounded request from stdin without using a synchronous `/dev/stdin`
|
|
3
|
+
* read. Bun can busy-loop on a synchronous read when stdin is an SSH pipe;
|
|
4
|
+
* async iteration observes pipe backpressure and EOF correctly.
|
|
5
|
+
*/
|
|
6
|
+
export declare function readBoundedStdin(maxBytes: number): Promise<string>;
|
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.77";
|