@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.
@@ -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
- await checked(run, {
147
- command: "/usr/bin/tar",
148
- args: [
149
- "-xzf",
150
- archive,
151
- "-C",
152
- unpacked,
153
- "--strip-components=1",
154
- "package/package.json",
155
- "package/dist/fz-agent.js",
156
- "package/dist/fz.js"
157
- ]
158
- }, "agent update extraction");
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.39";
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
- await checked(run, {
147
- command: "/usr/bin/tar",
148
- args: [
149
- "-xzf",
150
- archive,
151
- "-C",
152
- unpacked,
153
- "--strip-components=1",
154
- "package/package.json",
155
- "package/dist/fz-agent.js",
156
- "package/dist/fz.js"
157
- ]
158
- }, "agent update extraction");
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);
@@ -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
- await checked(run, {
147
- command: "/usr/bin/tar",
148
- args: [
149
- "-xzf",
150
- archive,
151
- "-C",
152
- unpacked,
153
- "--strip-components=1",
154
- "package/package.json",
155
- "package/dist/fz-agent.js",
156
- "package/dist/fz.js"
157
- ]
158
- }, "agent update extraction");
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);
@@ -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;