@forgezero/agent 0.1.39 → 0.1.41
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 +357 -348
- package/dist/agent-heartbeat.js +16 -14
- package/dist/agent-update-helper.js +15 -13
- package/dist/agent-update.js +15 -13
- package/dist/bootstrap.d.ts +13 -0
- package/dist/bootstrap.js +244 -832
- package/dist/cli/index.d.ts +0 -2
- package/dist/cloudflare-bootstrap.d.ts +21 -128
- package/dist/cloudflare-bootstrap.js +146 -788
- package/dist/cloudflare-edge.d.ts +3 -151
- package/dist/cloudflare-edge.js +28 -248
- package/dist/credential-schema.d.ts +60 -0
- package/dist/credential-schema.js +335 -0
- package/dist/definition.js +2 -2
- package/dist/deploy-file.js +2 -2
- package/dist/fz-agent.js +1787 -3387
- package/dist/fz.js +1938 -4712
- package/dist/index.d.ts +33 -0
- package/dist/metal-bootstrap.js +1 -1
- package/dist/platform-bootstrap-runtime.d.ts +5 -0
- package/dist/platform-bootstrap-runtime.js +25 -6
- package/dist/project-context.js +1 -1
- package/dist/provision.js +18 -16
- package/dist/software-helper.js +2 -2
- package/dist/software.js +2 -2
- package/dist/version.d.ts +1 -1
- package/package.json +9 -5
- package/dist/cli/custody.d.ts +0 -35
package/dist/agent-heartbeat.js
CHANGED
|
@@ -93,6 +93,8 @@ var checked = async (run, input, label) => {
|
|
|
93
93
|
return result;
|
|
94
94
|
};
|
|
95
95
|
async function validateReleaseDirectory(directory, release, run) {
|
|
96
|
+
chmodSync(directory, 493);
|
|
97
|
+
chmodSync(join(directory, "dist"), 493);
|
|
96
98
|
const manifest = JSON.parse(readFileSync(join(directory, "package.json"), "utf8"));
|
|
97
99
|
if (manifest.name !== release.package || manifest.version !== release.version) {
|
|
98
100
|
throw new Error("agent update manifest does not match the selected release");
|
|
@@ -143,19 +145,19 @@ async function stageAgentRelease(releaseInput, options) {
|
|
|
143
145
|
if (!timingSafeEqual(actual, expected))
|
|
144
146
|
throw new Error("agent update integrity mismatch");
|
|
145
147
|
writeFileSync(archive, bytes, { mode: 384, flag: "wx" });
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
148
|
+
for (const [member, relative] of [
|
|
149
|
+
["package/package.json", "package.json"],
|
|
150
|
+
["package/dist/fz-agent.js", "dist/fz-agent.js"],
|
|
151
|
+
["package/dist/fz.js", "dist/fz.js"]
|
|
152
|
+
]) {
|
|
153
|
+
const extracted = await checked(run, {
|
|
154
|
+
command: "/usr/bin/tar",
|
|
155
|
+
args: ["-xOzf", archive, member]
|
|
156
|
+
}, `agent update extraction of ${member}`);
|
|
157
|
+
const destination = join(unpacked, relative);
|
|
158
|
+
mkdirSync(dirname(destination), { recursive: true, mode: 448 });
|
|
159
|
+
writeFileSync(destination, extracted.output, { mode: 384, flag: "wx" });
|
|
160
|
+
}
|
|
159
161
|
await validateReleaseDirectory(unpacked, release, run);
|
|
160
162
|
if (!existsSync(finalDirectory)) {
|
|
161
163
|
renameSync(unpacked, finalDirectory);
|
|
@@ -744,7 +746,7 @@ async function postSignedNode(options, path, body) {
|
|
|
744
746
|
}
|
|
745
747
|
|
|
746
748
|
// src/version.ts
|
|
747
|
-
var VERSION3 = "0.1.
|
|
749
|
+
var VERSION3 = "0.1.41";
|
|
748
750
|
|
|
749
751
|
// src/agent-heartbeat.ts
|
|
750
752
|
var unquote = (value) => value.replace(/^['"]|['"]$/g, "");
|
|
@@ -93,6 +93,8 @@ var checked = async (run, input, label) => {
|
|
|
93
93
|
return result;
|
|
94
94
|
};
|
|
95
95
|
async function validateReleaseDirectory(directory, release, run) {
|
|
96
|
+
chmodSync(directory, 493);
|
|
97
|
+
chmodSync(join(directory, "dist"), 493);
|
|
96
98
|
const manifest = JSON.parse(readFileSync(join(directory, "package.json"), "utf8"));
|
|
97
99
|
if (manifest.name !== release.package || manifest.version !== release.version) {
|
|
98
100
|
throw new Error("agent update manifest does not match the selected release");
|
|
@@ -143,19 +145,19 @@ async function stageAgentRelease(releaseInput, options) {
|
|
|
143
145
|
if (!timingSafeEqual(actual, expected))
|
|
144
146
|
throw new Error("agent update integrity mismatch");
|
|
145
147
|
writeFileSync(archive, bytes, { mode: 384, flag: "wx" });
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
148
|
+
for (const [member, relative] of [
|
|
149
|
+
["package/package.json", "package.json"],
|
|
150
|
+
["package/dist/fz-agent.js", "dist/fz-agent.js"],
|
|
151
|
+
["package/dist/fz.js", "dist/fz.js"]
|
|
152
|
+
]) {
|
|
153
|
+
const extracted = await checked(run, {
|
|
154
|
+
command: "/usr/bin/tar",
|
|
155
|
+
args: ["-xOzf", archive, member]
|
|
156
|
+
}, `agent update extraction of ${member}`);
|
|
157
|
+
const destination = join(unpacked, relative);
|
|
158
|
+
mkdirSync(dirname(destination), { recursive: true, mode: 448 });
|
|
159
|
+
writeFileSync(destination, extracted.output, { mode: 384, flag: "wx" });
|
|
160
|
+
}
|
|
159
161
|
await validateReleaseDirectory(unpacked, release, run);
|
|
160
162
|
if (!existsSync(finalDirectory)) {
|
|
161
163
|
renameSync(unpacked, finalDirectory);
|
package/dist/agent-update.js
CHANGED
|
@@ -93,6 +93,8 @@ var checked = async (run, input, label) => {
|
|
|
93
93
|
return result;
|
|
94
94
|
};
|
|
95
95
|
async function validateReleaseDirectory(directory, release, run) {
|
|
96
|
+
chmodSync(directory, 493);
|
|
97
|
+
chmodSync(join(directory, "dist"), 493);
|
|
96
98
|
const manifest = JSON.parse(readFileSync(join(directory, "package.json"), "utf8"));
|
|
97
99
|
if (manifest.name !== release.package || manifest.version !== release.version) {
|
|
98
100
|
throw new Error("agent update manifest does not match the selected release");
|
|
@@ -143,19 +145,19 @@ async function stageAgentRelease(releaseInput, options) {
|
|
|
143
145
|
if (!timingSafeEqual(actual, expected))
|
|
144
146
|
throw new Error("agent update integrity mismatch");
|
|
145
147
|
writeFileSync(archive, bytes, { mode: 384, flag: "wx" });
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
148
|
+
for (const [member, relative] of [
|
|
149
|
+
["package/package.json", "package.json"],
|
|
150
|
+
["package/dist/fz-agent.js", "dist/fz-agent.js"],
|
|
151
|
+
["package/dist/fz.js", "dist/fz.js"]
|
|
152
|
+
]) {
|
|
153
|
+
const extracted = await checked(run, {
|
|
154
|
+
command: "/usr/bin/tar",
|
|
155
|
+
args: ["-xOzf", archive, member]
|
|
156
|
+
}, `agent update extraction of ${member}`);
|
|
157
|
+
const destination = join(unpacked, relative);
|
|
158
|
+
mkdirSync(dirname(destination), { recursive: true, mode: 448 });
|
|
159
|
+
writeFileSync(destination, extracted.output, { mode: 384, flag: "wx" });
|
|
160
|
+
}
|
|
159
161
|
await validateReleaseDirectory(unpacked, release, run);
|
|
160
162
|
if (!existsSync(finalDirectory)) {
|
|
161
163
|
renameSync(unpacked, finalDirectory);
|
package/dist/bootstrap.d.ts
CHANGED
|
@@ -19,6 +19,12 @@ export interface PlatformBootstrapConfig {
|
|
|
19
19
|
branch: string;
|
|
20
20
|
deployRoot?: string;
|
|
21
21
|
telemetryEndpoint: string;
|
|
22
|
+
/**
|
|
23
|
+
* Pipeline secret name -> encrypted systemd credential source. The Agent asks
|
|
24
|
+
* its project Vault replica first and uses only the same-name entry here while
|
|
25
|
+
* that replica is unavailable or has not received the secret yet.
|
|
26
|
+
*/
|
|
27
|
+
deploymentCredentials?: Record<string, string>;
|
|
22
28
|
database: {
|
|
23
29
|
role: DatabaseBootstrapRole;
|
|
24
30
|
/** Genesis master/joiners are Agency members; elastic joiners normally use `none`. */
|
|
@@ -69,6 +75,8 @@ export interface TenantBootstrapConfig {
|
|
|
69
75
|
realm: string;
|
|
70
76
|
nodeHostname: string;
|
|
71
77
|
telemetryEndpoint: string;
|
|
78
|
+
/** Same Vault-first, same-name systemd fallback contract as platform deploys. */
|
|
79
|
+
deploymentCredentials?: Record<string, string>;
|
|
72
80
|
enrolTokenFile: string;
|
|
73
81
|
repository?: string;
|
|
74
82
|
branch?: string;
|
|
@@ -76,6 +84,11 @@ export interface TenantBootstrapConfig {
|
|
|
76
84
|
deployRoot?: string;
|
|
77
85
|
software?: SoftwareRequirement[];
|
|
78
86
|
installCloudflared?: boolean;
|
|
87
|
+
/** Optional node-specific attended Tunnel/KV handoff, identical to platform hosts. */
|
|
88
|
+
cloudflareHandoff?: {
|
|
89
|
+
handoffFile: string;
|
|
90
|
+
nodeName: string;
|
|
91
|
+
};
|
|
79
92
|
/** Local-only runner authority. The API receives only the resulting node scope. */
|
|
80
93
|
bootstrapRunner?: {
|
|
81
94
|
sshPrivateKeyFile: string;
|