agent-transport-system 0.7.59 → 0.7.60

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/ats.js CHANGED
@@ -27,7 +27,7 @@ import wrapAnsi from "wrap-ansi";
27
27
  import { Box, Container, Editor, Key, ProcessTerminal, TUI, Text, getEditorKeybindings, matchesKey } from "@mariozechner/pi-tui";
28
28
 
29
29
  //#region package.json
30
- var version = "0.7.59";
30
+ var version = "0.7.60";
31
31
  var package_default = {
32
32
  $schema: "https://www.schemastore.org/package.json",
33
33
  name: "agent-transport-system",
@@ -16619,6 +16619,7 @@ function sanitizeDaemonServiceEnvironmentValue(value) {
16619
16619
  //#endregion
16620
16620
  //#region src/local-service/lifecycle/daemon-lifecycle-journal.ts
16621
16621
  const DAEMON_LIFECYCLE_EVENT_TYPES = [
16622
+ "connection.state",
16622
16623
  "lifecycle.command.begin",
16623
16624
  "lifecycle.command.end",
16624
16625
  "owner.snapshot",
@@ -47176,7 +47177,19 @@ async function loadInitialDaemonRouteCatalog(input) {
47176
47177
  ownerUserId: input.ownerUserId,
47177
47178
  serviceBundleId: input.serviceBundleId
47178
47179
  });
47179
- if (!cached) throw error;
47180
+ if (!cached) {
47181
+ emitRunLine({
47182
+ presenter: input.presenter,
47183
+ code: "daemon.run.route_catalog_initial_load_failed",
47184
+ text: `initial route catalog load failed; starting with an empty catalog and retrying via catalog sync: ${toErrorMessage$29(error)}`,
47185
+ payload: { reason: "initial_load_failed_no_cache" }
47186
+ });
47187
+ return {
47188
+ profileIds: [],
47189
+ routeByProfileId: /* @__PURE__ */ new Map(),
47190
+ skippedProfiles: []
47191
+ };
47192
+ }
47180
47193
  emitRunLine({
47181
47194
  presenter: input.presenter,
47182
47195
  code: "daemon.run.route_catalog_cache_recovered",
@@ -47420,6 +47433,14 @@ function createRunLoopConnectionStateTracker(presenter) {
47420
47433
  updatedAt: next.updatedAt
47421
47434
  }
47422
47435
  });
47436
+ emitDaemonLifecycleEvent({
47437
+ type: "connection.state",
47438
+ result: next.state,
47439
+ metadata: {
47440
+ detail: next.detail,
47441
+ reason: next.reason
47442
+ }
47443
+ }).catch(() => void 0);
47423
47444
  } });
47424
47445
  }
47425
47446
  function noteReconnectFailureState(input) {
@@ -47996,7 +48017,7 @@ const DEFAULT_DAEMON_RUN_MODE = DAEMON_RUN_MODE_CHOICES.background;
47996
48017
  const STOP_WAIT_MS = 2e3;
47997
48018
  const STOP_POLL_INTERVAL_MS = 200;
47998
48019
  const SERVICE_STARTUP_CHECK_MS = 5e3;
47999
- const LAUNCHD_SERVICE_STARTUP_CHECK_MS = 3e4;
48020
+ const LAUNCHD_SERVICE_STARTUP_CHECK_MS = 9e4;
48000
48021
  const SERVICE_STARTUP_POLL_MS = 120;
48001
48022
  const SERVICE_STOP_CHECK_MS = 3e3;
48002
48023
  const SERVICE_STOP_POLL_MS = 200;
@@ -48922,12 +48943,28 @@ async function autoStartDaemonAfterReinstall(input) {
48922
48943
  });
48923
48944
  }
48924
48945
  const blockReason = resolveDaemonReinstallStartBlockedReason(startOutcome);
48925
- if (blockReason) return createDaemonReinstallStartBlockedOutcome({
48926
- backupDataPath: null,
48927
- blockReason,
48928
- desiredState: input.desiredState,
48929
- forceUsed: input.forceUsed
48930
- });
48946
+ if (blockReason) {
48947
+ const recheckedInventory = await inspectDaemonServiceInventory({
48948
+ expectedVersion: input.resolved.daemonVersion,
48949
+ intendedMode: "background",
48950
+ intent: "reinstall"
48951
+ }).catch(() => null);
48952
+ if (recheckedInventory && isDaemonInventoryRunningAndAligned(recheckedInventory)) {
48953
+ await clearDaemonStartFailureStateSafely();
48954
+ return createDaemonReinstallCompletedOutcome({
48955
+ backupDataPath: null,
48956
+ desiredState: input.desiredState,
48957
+ forceUsed: input.forceUsed,
48958
+ serviceState: "running"
48959
+ });
48960
+ }
48961
+ return createDaemonReinstallStartBlockedOutcome({
48962
+ backupDataPath: null,
48963
+ blockReason,
48964
+ desiredState: input.desiredState,
48965
+ forceUsed: input.forceUsed
48966
+ });
48967
+ }
48931
48968
  if (startOutcome === "start_failed") return createDaemonReinstallStartFailedOutcome({
48932
48969
  backupDataPath: null,
48933
48970
  desiredState: input.desiredState,
@@ -65714,7 +65751,7 @@ function buildAgentTraceCompactSummary(input) {
65714
65751
  if (finalVisibleOutcome.status === "not_applicable" && trace.finalVisibleMessageLinkage?.status === "projection_pending") return {
65715
65752
  currentState: "final_projection_pending",
65716
65753
  delivered: false,
65717
- nextAction: "wait, then rerun trace with the same selector",
65754
+ nextAction: "wait - if the target computer is offline, this Wake is delivered automatically when its ATS Service reconnects; rerun trace with the same selector to confirm",
65718
65755
  reasonCode: trace.finalVisibleMessageLinkage.reasonCode,
65719
65756
  visibleOutcome: finalVisibleOutcome.status
65720
65757
  };