@integrity-labs/agt-cli 0.28.685 → 0.28.687

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/bin/agt.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-Y5GJEUZF.js";
43
+ } from "../chunk-WOWZLCF5.js";
44
44
  import {
45
45
  readDirectChatSessionState
46
46
  } from "../chunk-ZKNKHAHX.js";
@@ -4909,7 +4909,7 @@ import { execFileSync, execSync } from "child_process";
4909
4909
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4910
4910
  import chalk18 from "chalk";
4911
4911
  import ora16 from "ora";
4912
- var cliVersion = true ? "0.28.685" : "dev";
4912
+ var cliVersion = true ? "0.28.687" : "dev";
4913
4913
  async function fetchLatestVersion() {
4914
4914
  const host2 = getHost();
4915
4915
  if (!host2) return null;
@@ -6089,7 +6089,7 @@ function handleError(err) {
6089
6089
  }
6090
6090
 
6091
6091
  // src/bin/agt.ts
6092
- var cliVersion2 = true ? "0.28.685" : "dev";
6092
+ var cliVersion2 = true ? "0.28.687" : "dev";
6093
6093
  var program = new Command();
6094
6094
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6095
6095
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -3438,14 +3438,51 @@ if [ "$STOP_ACTIVE" = "true" ]; then exit 0; fi
3438
3438
  # Standing down whenever a channel reply is OWED fixes it, and matches the
3439
3439
  # ordering documented at the Stop registration: an unanswered person beats an
3440
3440
  # unpulled card. Cheap - a directory test, and it runs before either curl.
3441
+ #
3442
+ # ENG-9413 AC3: stand down for an OWED marker, not for ANY marker.
3443
+ #
3444
+ # This used to be 'ls -A' on each marker dir - a bare non-empty test with NO
3445
+ # field parsing at all. So any pending marker, for any reason, stood the agent
3446
+ # down from pulling scheduled work indefinitely. The marker that most often
3447
+ # lingers is precisely the one that is NOT owed: an inbound the agent already
3448
+ # told the user it could not get to ('undeliverable'), which never clears
3449
+ # because clearing is reply-keyed.
3450
+ #
3451
+ # Measured cost, 2026-08-24, two agents on the same morning: sherlock's Fleet
3452
+ # Alert Sweep starved 2h19m and skipped two firings behind one wedged 529
3453
+ # inbound; my own Backlog-intake card sat 2h21m through two automatic
3454
+ # re-dispatch attempts. In both cases the agent heartbeated fresh, its host was
3455
+ # fine and its integrations were bound - the only symptom was scheduled output
3456
+ # quietly stopping. Nothing in the health signals catches that.
3457
+ #
3458
+ # The INTENT is unchanged and still right - "an unanswered person beats an
3459
+ # unpulled card", per the Stop registration's documented ordering. What changes
3460
+ # is that we now ask whether a person is actually waiting, using the SAME
3461
+ # predicate the ghost-reply hook uses for the same question: a marker is owed
3462
+ # unless it is 'discretionary' (pre-declared "seen, no reply owed", ENG-7736) or
3463
+ # 'undeliverable' (the agent has already replied that it cannot get to it).
3464
+ #
3465
+ # FAIL-SAFE DIRECTION IS DELIBERATE: an unparseable or unreadable marker counts
3466
+ # as OWED, so this can only ever stand down LESS than before, never more, and
3467
+ # only for markers positively identified as not-owed. A wrong stand-down delays
3468
+ # a card; a wrong pull leaves a human waiting. The second is worse, so ambiguity
3469
+ # resolves to the old behaviour.
3441
3470
  CWD_IN="$(printf '%s' "$INPUT" | jq -r '.cwd // empty' 2>/dev/null || true)"
3442
3471
  if [ -n "$CWD_IN" ]; then
3443
3472
  OWED_BASE="$(dirname "$CWD_IN")"
3444
3473
  for d in telegram-pending-inbound slack-pending-inbound direct-chat-pending-inbound msteams-pending-inbound/.markers; do
3445
- if [ -d "$OWED_BASE/$d" ] && [ -n "$(ls -A "$OWED_BASE/$d" 2>/dev/null || true)" ]; then
3446
- echo "agt-backlog-pull-hook: standing down, a channel reply is owed" >&2
3447
- exit 0
3448
- fi
3474
+ [ -d "$OWED_BASE/$d" ] || continue
3475
+ for m in "$OWED_BASE/$d"/*.json; do
3476
+ [ -f "$m" ] || continue
3477
+ # Only an EXPLICIT true excludes. A missing field, a malformed marker, or
3478
+ # a jq failure all leave SKIP empty, which reads as owed - the fail-safe
3479
+ # direction described above.
3480
+ SKIP="$(jq -r 'select((.discretionary // false) == true or (.undeliverable // false) == true) | "skip"' "$m" 2>/dev/null || true)"
3481
+ if [ "$SKIP" != "skip" ]; then
3482
+ echo "agt-backlog-pull-hook: standing down, a channel reply is owed" >&2
3483
+ exit 0
3484
+ fi
3485
+ done
3449
3486
  done
3450
3487
  fi
3451
3488
 
@@ -6489,7 +6526,7 @@ function exchangeFailureKind(err) {
6489
6526
  }
6490
6527
 
6491
6528
  // src/lib/api-client.ts
6492
- var agtCliVersion = true ? "0.28.685" : "dev";
6529
+ var agtCliVersion = true ? "0.28.687" : "dev";
6493
6530
  var lastConfigHash = null;
6494
6531
  function setConfigHash(hash) {
6495
6532
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10231,4 +10268,4 @@ export {
10231
10268
  managerInstallSystemUnitCommand,
10232
10269
  managerUninstallSystemUnitCommand
10233
10270
  };
10234
- //# sourceMappingURL=chunk-Y5GJEUZF.js.map
10271
+ //# sourceMappingURL=chunk-WOWZLCF5.js.map