@kici-dev/agent 0.7.0 → 0.9.0

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.
@@ -29,23 +29,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  enumerable: true
30
30
  }) : target, mod));
31
31
  var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
32
- /*! *****************************************************************************
33
- Copyright (c) Microsoft Corporation. All rights reserved.
34
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
35
- this file except in compliance with the License. You may obtain a copy of the
36
- License at http://www.apache.org/licenses/LICENSE-2.0
37
-
38
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
39
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
40
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
41
- MERCHANTABILITY OR NON-INFRINGEMENT.
42
-
43
- See the Apache Version 2.0 License for specific language governing permissions
44
- and limitations under the License.
45
- ***************************************************************************** */
46
32
  //#endregion
47
- //#region src/execution/sandbox/container-ts-loader-hook.ts
48
- var import_typescript = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
33
+ //#region ../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/typescript.js
34
+ var require_typescript$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
35
+ /*! *****************************************************************************
36
+ Copyright (c) Microsoft Corporation. All rights reserved.
37
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
38
+ this file except in compliance with the License. You may obtain a copy of the
39
+ License at http://www.apache.org/licenses/LICENSE-2.0
40
+
41
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
42
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
43
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
44
+ MERCHANTABILITY OR NON-INFRINGEMENT.
45
+
46
+ See the Apache Version 2.0 License for specific language governing permissions
47
+ and limitations under the License.
48
+ ***************************************************************************** */
49
49
  var ts = {};
50
50
  ((module$1) => {
51
51
  "use strict";
@@ -8059,8 +8059,8 @@ ${lanes.join("\n")}
8059
8059
  function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) {
8060
8060
  const fromComponents = reducePathComponents(getPathComponents(from));
8061
8061
  const toComponents = reducePathComponents(getPathComponents(to));
8062
- let start;
8063
- for (start = 0; start < fromComponents.length && start < toComponents.length; start++) {
8062
+ let start = 0;
8063
+ for (; start < fromComponents.length && start < toComponents.length; start++) {
8064
8064
  const fromComponent = getCanonicalFileName(fromComponents[start]);
8065
8065
  const toComponent = getCanonicalFileName(toComponents[start]);
8066
8066
  if (!(start === 0 ? equateStringsCaseInsensitive : stringEqualityComparer)(fromComponent, toComponent)) break;
@@ -147892,6 +147892,11 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
147892
147892
  if (typeof module !== "undefined" && module.exports) module.exports = v;
147893
147893
  }
147894
147894
  });
147895
+ }));
147896
+ //#endregion
147897
+ //#region src/execution/sandbox/container-ts-loader-hook.ts
147898
+ var import_typescript = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
147899
+ module.exports = require_typescript$1();
147895
147900
  })))(), 1);
147896
147901
  function resolve(specifier, context, nextResolve) {
147897
147902
  if (specifier.endsWith(".js") && (specifier.startsWith("./") || specifier.startsWith("../"))) try {
@@ -1,6 +1,6 @@
1
1
  import { createRequire, register } from "node:module";
2
2
  import { normalizeLineEndings, sha256, toErrorMessage } from "@kici-dev/shared";
3
- import { buildKiciApi, buildNeedsContext, createFilterContext, setJobOutputsMap, setStepOutputsMap, setStepRefMap } from "@kici-dev/sdk/internal";
3
+ import { buildKiciApi, buildNeedsContext, createFilterContext } from "@kici-dev/sdk/internal";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { format } from "node:util";
6
6
  import path, { join } from "node:path";
@@ -165,28 +165,25 @@ var workflow_loader_exports = /* @__PURE__ */ __exportAll({
165
165
  * ESM modules by resolved URL, so importing that path yields the workflow's live
166
166
  * singleton, not a fresh copy.
167
167
  *
168
- * Both specifiers resolve to the same module-global maps `internal.ts` and the
169
- * root barrel re-export the same `outputs.js` bindings so the fallback below
170
- * changes which entry is imported, never which singleton is mutated.
171
- *
172
- * Falls back to the agent's bundled setters when neither resolves (mirrors
173
- * `resolveSdkSetters` in the compiler's test runner).
168
+ * The setters live only on `@kici-dev/sdk/internal`. A tree whose SDK does not
169
+ * publish that subpath cannot be wired to this agent, and the agent's own
170
+ * bundled setters would mutate a map the workflow's proxies never read so the
171
+ * mismatch is refused here rather than surfacing later as an empty `.result`.
174
172
  */
175
173
  async function resolveWorkflowSdkSetters(workflowFilePath) {
176
174
  const req = createRequire(workflowFilePath);
177
- for (const specifier of ["@kici-dev/sdk/internal", "@kici-dev/sdk"]) try {
178
- const sdkEntry = req.resolve(specifier);
179
- const sdk = await import(pathToFileURL(sdkEntry).href);
180
- if (typeof sdk.setStepOutputsMap === "function" && typeof sdk.setStepRefMap === "function" && typeof sdk.setJobOutputsMap === "function") return {
181
- setStepOutputsMap: sdk.setStepOutputsMap,
182
- setStepRefMap: sdk.setStepRefMap,
183
- setJobOutputsMap: sdk.setJobOutputsMap
184
- };
185
- } catch {}
175
+ let sdk;
176
+ try {
177
+ const sdkEntry = req.resolve("@kici-dev/sdk/internal");
178
+ sdk = await import(pathToFileURL(sdkEntry).href);
179
+ } catch (err) {
180
+ throw new Error(`Could not resolve @kici-dev/sdk/internal from ${workflowFilePath}: the workflow tree must depend on @kici-dev/sdk@>=0.8.0 to run on this agent (agent baked @kici-dev/sdk@${AGENT_SDK_VERSION}). Upgrade the repository's @kici-dev/sdk and recompile: ${toErrorMessage(err)}`);
181
+ }
182
+ if (typeof sdk.setStepOutputsMap !== "function" || typeof sdk.setStepRefMap !== "function" || typeof sdk.setJobOutputsMap !== "function") throw new Error(`@kici-dev/sdk/internal resolved from ${workflowFilePath} carries no output-map setters; the workflow tree must depend on @kici-dev/sdk@>=0.8.0 to run on this agent (agent baked @kici-dev/sdk@${AGENT_SDK_VERSION}).`);
186
183
  return {
187
- setStepOutputsMap,
188
- setStepRefMap,
189
- setJobOutputsMap
184
+ setStepOutputsMap: sdk.setStepOutputsMap,
185
+ setStepRefMap: sdk.setStepRefMap,
186
+ setJobOutputsMap: sdk.setJobOutputsMap
190
187
  };
191
188
  }
192
189
  function ensureLoaderHookRegistered() {
@@ -361,7 +358,7 @@ async function extractStepsFromDynamicJob(workflow, dynamicIndex, jobName, event
361
358
  const dynamicFn = extractDynamicJobFn(workflow, dynamicIndex);
362
359
  const { $ } = await import("zx");
363
360
  const { createLogger } = await import("@kici-dev/shared");
364
- const { buildKiciApi, buildNeedsContext } = await import("@kici-dev/sdk");
361
+ const { buildKiciApi, buildNeedsContext } = await import("@kici-dev/sdk/internal");
365
362
  const log = createLogger({ prefix: `dynamic-job-fn:${workflow.name}` });
366
363
  const kici = buildKiciApi(apiTransport ?? (() => Promise.reject(/* @__PURE__ */ new Error("Agent API not available during re-evaluation"))));
367
364
  const needs = upstreamSnapshot ? buildNeedsContext(upstreamSnapshot, declaredNeeds ?? []) : void 0;
@@ -398,8 +395,8 @@ async function extractStepsFromDynamicJob(workflow, dynamicIndex, jobName, event
398
395
  var AGENT_SDK_VERSION, AGENT_SDK_BUNDLE_HASH, hookRegistered;
399
396
  var init_workflow_loader = __esmMin((() => {
400
397
  init_generator_context();
401
- AGENT_SDK_VERSION = "0.7.0";
402
- AGENT_SDK_BUNDLE_HASH = "065963c7765dc8d87e04d45f57d7e15be1613da705e4ff3ec3742fd1408b7bf5";
398
+ AGENT_SDK_VERSION = "0.9.0";
399
+ AGENT_SDK_BUNDLE_HASH = "b012bd8bace3df9e574252bf290c652bc39766da617acf51729a08586756266d";
403
400
  hookRegistered = false;
404
401
  }));
405
402
  //#endregion
@@ -42,7 +42,7 @@ export interface ArtifactTransport {
42
42
  /** Request a presigned PUT for `name` at `declaredSizeBytes`; enforced before minting. */
43
43
  beginUpload(name: string, declaredSizeBytes: number): Promise<ArtifactBeginUploadResult>;
44
44
  /** Confirm the upload finished — records the DB row. */
45
- completeUpload(name: string, sizeBytes: number, sha256: string, storageKey: string): Promise<void>;
45
+ completeUpload(name: string, sha256: string): Promise<void>;
46
46
  /** Resolve a named artifact of this run to a presigned GET + its size/sha256. */
47
47
  download(name: string): Promise<ArtifactDownloadLookup>;
48
48
  }
@@ -313,12 +313,8 @@ export interface ArtifactRequestIpc {
313
313
  name: string;
314
314
  /** Packed tarball size in bytes — drives the enforcement gates. `beginUpload` only. */
315
315
  declaredSizeBytes?: number;
316
- /** Confirmed tarball size in bytes. `completeUpload` only. */
317
- sizeBytes?: number;
318
316
  /** SHA-256 of the tarball bytes. `completeUpload` only. */
319
317
  sha256?: string;
320
- /** Storage key echoed from the grant response. `completeUpload` only. */
321
- storageKey?: string;
322
318
  }
323
319
  export type RunnerToAgentMessage = ReadyMessage | StepStartMessage | StepCompleteMessage | LogLineMessage | StepSecretMountMessage | JobCompleteMessage | HooksDeclaredMessage | CompletionHooksDoneMessage | EventEmitRequest | ConcurrencyReportMessage | AgentApiRequestIpc | CacheRequestIpc | ProvenanceRequestIpc | ArtifactRequestIpc | GitGrantRequestIpc | StepApprovalRequestIpc;
324
320
  /** Instruct the workflow runner to execute a job. */
@@ -554,7 +550,6 @@ export interface JobExecutionRequest {
554
550
  */
555
551
  credentialHelperPath?: string;
556
552
  /** SHA-256 hash of the source tarball bytes for integrity verification. */
557
- sourceTarHash?: string;
558
553
  sourceTarDigest?: string;
559
554
  /** URL to pre-built dependency tarball (skip install if present). */
560
555
  depsUrl?: string;
@@ -7,18 +7,13 @@
7
7
  * optimization — source tarballs are tiny (kilobytes, not the hundreds of
8
8
  * megabytes a `node_modules/` tarball carries).
9
9
  *
10
- * Two properties this path is responsible for, both of which it previously
11
- * lacked:
10
+ * Two properties this path is responsible for:
12
11
  *
13
12
  * **Verification.** `dispatch.sourceTarDigest` is the SHA-256 of the tarball's
14
13
  * own bytes, so the download is checked before anything is extracted — the same
15
- * contract `restoreDeps` has always had via `depsHash`. The older
16
- * `dispatch.sourceTarHash` field carries the workflow `contentHash` instead, so
17
- * it never could serve this purpose; it stays on the wire for older peers and
18
- * is deliberately not used as a verification input here. When no digest is
19
- * dispatched (an older orchestrator, or a source that did not come from the
20
- * content-addressed cache) the restore proceeds unverified rather than failing,
21
- * so a mixed-version rollout still runs.
14
+ * contract `restoreDeps` has via `depsHash`. When no digest is dispatched (a
15
+ * source that did not come from the content-addressed cache) the restore
16
+ * proceeds unverified rather than failing.
22
17
  *
23
18
  * **Replacement, not overlay.** Extraction lands in a scratch directory and the
24
19
  * result REPLACES `workDir/.kici` wholesale, save for `node_modules/` — the one
@@ -34,12 +34,10 @@ export interface SdkOutputSetters {
34
34
  * ESM modules by resolved URL, so importing that path yields the workflow's live
35
35
  * singleton, not a fresh copy.
36
36
  *
37
- * Both specifiers resolve to the same module-global maps `internal.ts` and the
38
- * root barrel re-export the same `outputs.js` bindings so the fallback below
39
- * changes which entry is imported, never which singleton is mutated.
40
- *
41
- * Falls back to the agent's bundled setters when neither resolves (mirrors
42
- * `resolveSdkSetters` in the compiler's test runner).
37
+ * The setters live only on `@kici-dev/sdk/internal`. A tree whose SDK does not
38
+ * publish that subpath cannot be wired to this agent, and the agent's own
39
+ * bundled setters would mutate a map the workflow's proxies never read so the
40
+ * mismatch is refused here rather than surfacing later as an empty `.result`.
43
41
  */
44
42
  export declare function resolveWorkflowSdkSetters(workflowFilePath: string): Promise<SdkOutputSetters>;
45
43
  /**
@@ -43,8 +43,8 @@ export interface BuildStatementInput {
43
43
  }
44
44
  /**
45
45
  * Agent-local job context used to freeze a provenance statement for a deferred
46
- * attestation. When the Platform mint fails transiently there is no identity
47
- * token to read claims from, so the statement is built from facts the agent
46
+ * attestation. When the orchestrator's mint defers there is no identity token
47
+ * to read claims from, so the statement is built from facts the agent
48
48
  * already holds about the job it just ran. Only the identity token is deferred;
49
49
  * these attested facts are sealed (DSSE-signed) at build time.
50
50
  */
package/dist/server.js CHANGED
@@ -815,6 +815,23 @@ var OrchestratorClient = class OrchestratorClient {
815
815
  * GitHub Actions run hangs until the job timeout.
816
816
  */
817
817
  onClaimFailedPermanently = null;
818
+ /**
819
+ * Fired once when authentication fails permanently — an `auth.failure` frame,
820
+ * or the orchestrator closing with WS_CLOSE_AGENT_AUTH_FAILED (a revoked token,
821
+ * or a protocol version below the orchestrator's floor). The client never
822
+ * reconnects after this, so server.ts wires it to a non-zero graceful
823
+ * shutdown; without it the health HTTP server keeps a process alive that can
824
+ * never register again, and a one-shot GitHub Actions agent holds its runner
825
+ * until the job timeout.
826
+ */
827
+ onAuthFailedPermanently = null;
828
+ /** Marks the auth failure permanent and fires onAuthFailedPermanently exactly once. */
829
+ failAuthPermanently(reason) {
830
+ const first = !this.authFailed;
831
+ this.authFailed = true;
832
+ this.intentionalDisconnect = true;
833
+ if (first) this.onAuthFailedPermanently?.(reason);
834
+ }
818
835
  constructor(options) {
819
836
  this.url = options.url;
820
837
  this.agentId = options.agentId;
@@ -1225,9 +1242,7 @@ var OrchestratorClient = class OrchestratorClient {
1225
1242
  messageId: completeId,
1226
1243
  jobId,
1227
1244
  name: request.name,
1228
- sizeBytes: request.sizeBytes,
1229
- sha256: request.sha256,
1230
- storageKey: request.storageKey
1245
+ sha256: request.sha256
1231
1246
  };
1232
1247
  if (!hasOrchAgentCapability(this.orchCapabilities, "artifactCompleteAck")) {
1233
1248
  this.sendDirect(complete);
@@ -1480,8 +1495,7 @@ var OrchestratorClient = class OrchestratorClient {
1480
1495
  code,
1481
1496
  reason: reason.toString()
1482
1497
  });
1483
- this.authFailed = true;
1484
- this.intentionalDisconnect = true;
1498
+ this.failAuthPermanently(reason.toString() || "orchestrator closed with auth-failed code");
1485
1499
  }
1486
1500
  this._state = "disconnected";
1487
1501
  this.stopHeartbeat();
@@ -1851,8 +1865,7 @@ var OrchestratorClient = class OrchestratorClient {
1851
1865
  break;
1852
1866
  case "auth.failure":
1853
1867
  logger$16.error("Authentication FAILED -- token is invalid or expired. NOT retrying.", { reason: msg.reason });
1854
- this.authFailed = true;
1855
- this.intentionalDisconnect = true;
1868
+ this.failAuthPermanently(msg.reason);
1856
1869
  if (this.ws) {
1857
1870
  this.ws.close(1e3, "Auth failed");
1858
1871
  this.ws = null;
@@ -1918,6 +1931,8 @@ var OrchestratorClient = class OrchestratorClient {
1918
1931
  logWindowHours: msg.logWindowHours
1919
1932
  });
1920
1933
  this.streamFleetBundle(msg);
1934
+ break;
1935
+ case "rate.limit.warning": logger$16.warn("Orchestrator rate-limited this agent and dropped a frame", { retryAfterMs: msg.retryAfterMs });
1921
1936
  }
1922
1937
  return;
1923
1938
  }
@@ -2159,14 +2174,14 @@ function installConsoleCapture() {
2159
2174
  //#region src/routes/health.ts
2160
2175
  function safe(name, fallback = "unknown") {
2161
2176
  switch (name) {
2162
- case "version": return "0.7.0";
2163
- case "buildCommit": return "31843a21c";
2164
- case "sdkVersion": return "0.7.0";
2165
- case "sdkBundleHash": return "065963c7765dc8d87e04d45f57d7e15be1613da705e4ff3ec3742fd1408b7bf5";
2166
- case "sharedVersion": return "0.7.0";
2167
- case "sharedBundleHash": return "a79be949815735b9e36eecc716f7eb07aa36c7bffba62e798e7e19f31a474eff";
2168
- case "engineVersion": return "0.7.0";
2169
- case "engineBundleHash": return "380f6edf7e0e5cfe988fa0f98512de6e6864f4f2a7a8d07f67e2ab84ed637d19";
2177
+ case "version": return "0.9.0";
2178
+ case "buildCommit": return "69765a7ee";
2179
+ case "sdkVersion": return "0.9.0";
2180
+ case "sdkBundleHash": return "b012bd8bace3df9e574252bf290c652bc39766da617acf51729a08586756266d";
2181
+ case "sharedVersion": return "0.9.0";
2182
+ case "sharedBundleHash": return "c1c70e41a1ec14fd7cf3a6047251e9aa11258a21e3694ea89a50e8bf14b99f9d";
2183
+ case "engineVersion": return "0.9.0";
2184
+ case "engineBundleHash": return "c5e0e34d8d7f56f747bba71076a5fbccac4c932be855ef71c596b4211ca8698c";
2170
2185
  default: return fallback;
2171
2186
  }
2172
2187
  }
@@ -3689,18 +3704,13 @@ var init_download = __esmMin((() => {
3689
3704
  * optimization — source tarballs are tiny (kilobytes, not the hundreds of
3690
3705
  * megabytes a `node_modules/` tarball carries).
3691
3706
  *
3692
- * Two properties this path is responsible for, both of which it previously
3693
- * lacked:
3707
+ * Two properties this path is responsible for:
3694
3708
  *
3695
3709
  * **Verification.** `dispatch.sourceTarDigest` is the SHA-256 of the tarball's
3696
3710
  * own bytes, so the download is checked before anything is extracted — the same
3697
- * contract `restoreDeps` has always had via `depsHash`. The older
3698
- * `dispatch.sourceTarHash` field carries the workflow `contentHash` instead, so
3699
- * it never could serve this purpose; it stays on the wire for older peers and
3700
- * is deliberately not used as a verification input here. When no digest is
3701
- * dispatched (an older orchestrator, or a source that did not come from the
3702
- * content-addressed cache) the restore proceeds unverified rather than failing,
3703
- * so a mixed-version rollout still runs.
3711
+ * contract `restoreDeps` has via `depsHash`. When no digest is dispatched (a
3712
+ * source that did not come from the content-addressed cache) the restore
3713
+ * proceeds unverified rather than failing.
3704
3714
  *
3705
3715
  * **Replacement, not overlay.** Extraction lands in a scratch directory and the
3706
3716
  * result REPLACES `workDir/.kici` wholesale, save for `node_modules/` — the one
@@ -6863,7 +6873,6 @@ function buildRequest(dispatch, workDir, extra) {
6863
6873
  ...extra?.credentialHelperPath ? { credentialHelperPath: extra.credentialHelperPath } : {},
6864
6874
  ...extra?.allowInstallScripts ? { allowInstallScripts: true } : {},
6865
6875
  sourceTarUrl: dispatch.sourceTarUrl,
6866
- sourceTarHash: dispatch.sourceTarHash,
6867
6876
  sourceTarDigest: dispatch.sourceTarDigest,
6868
6877
  depsUrl: dispatch.depsUrl,
6869
6878
  depsHash: dispatch.depsHash,
@@ -9861,10 +9870,10 @@ var init_job_runner = __esmMin((() => {
9861
9870
  signal
9862
9871
  });
9863
9872
  buildLog("Packing .kici/ source tarball...");
9864
- const { tarball, hash: sourceTarHash } = await packKiciSource(workDir);
9873
+ const { tarball, hash: sourceTarDigest } = await packKiciSource(workDir);
9865
9874
  const sourceKey = {
9866
9875
  contentHash: buildConfig.contentHash,
9867
- sourceTarDigest: sourceTarHash,
9876
+ sourceTarDigest,
9868
9877
  platform: os.platform(),
9869
9878
  arch: os.arch()
9870
9879
  };
@@ -9881,7 +9890,7 @@ var init_job_runner = __esmMin((() => {
9881
9890
  this.sendJobStatus(dispatch, ExecutionJobStatus.enum.running, {
9882
9891
  buildEvent: "source_packed",
9883
9892
  contentHash: buildConfig.contentHash,
9884
- sourceTarHash
9893
+ sourceTarDigest
9885
9894
  });
9886
9895
  }
9887
9896
  /**
@@ -10657,14 +10666,14 @@ var init_between_jobs_controller = __esmMin((() => {
10657
10666
  * - SIGUSR1: Drain mode (stop accepting, finish current, exit)
10658
10667
  */
10659
10668
  init_npm_resolver();
10660
- const AGENT_VERSION = "0.7.0";
10661
- const BUILD_COMMIT = "31843a21c";
10662
- const SDK_VERSION = "0.7.0";
10663
- const SDK_BUNDLE_HASH = "065963c7765dc8d87e04d45f57d7e15be1613da705e4ff3ec3742fd1408b7bf5";
10664
- const SHARED_VERSION = "0.7.0";
10665
- const SHARED_BUNDLE_HASH = "a79be949815735b9e36eecc716f7eb07aa36c7bffba62e798e7e19f31a474eff";
10666
- const ENGINE_VERSION = "0.7.0";
10667
- const ENGINE_BUNDLE_HASH = "380f6edf7e0e5cfe988fa0f98512de6e6864f4f2a7a8d07f67e2ab84ed637d19";
10669
+ const AGENT_VERSION = "0.9.0";
10670
+ const BUILD_COMMIT = "69765a7ee";
10671
+ const SDK_VERSION = "0.9.0";
10672
+ const SDK_BUNDLE_HASH = "b012bd8bace3df9e574252bf290c652bc39766da617acf51729a08586756266d";
10673
+ const SHARED_VERSION = "0.9.0";
10674
+ const SHARED_BUNDLE_HASH = "c1c70e41a1ec14fd7cf3a6047251e9aa11258a21e3694ea89a50e8bf14b99f9d";
10675
+ const ENGINE_VERSION = "0.9.0";
10676
+ const ENGINE_BUNDLE_HASH = "c5e0e34d8d7f56f747bba71076a5fbccac4c932be855ef71c596b4211ca8698c";
10668
10677
  initTelemetry({
10669
10678
  serviceName: "kici-agent",
10670
10679
  otlpEndpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT
@@ -11053,6 +11062,10 @@ await guardStartup(logger$1, async () => {
11053
11062
  logger$1.error("Self-bootstrap claim failed permanently, shutting down", { reason });
11054
11063
  gracefulShutdown("scaler-claim-failed", 1);
11055
11064
  };
11065
+ client.onAuthFailedPermanently = (reason) => {
11066
+ logger$1.error("Authentication failed permanently, shutting down", { reason });
11067
+ gracefulShutdown("auth-failed", 1);
11068
+ };
11056
11069
  process.on("SIGUSR1", () => {
11057
11070
  logger$1.info("Received SIGUSR1, entering drain mode");
11058
11071
  isDraining = true;