@integrity-labs/agt-cli 0.28.91 → 0.28.93

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.
@@ -22,7 +22,7 @@ import {
22
22
  resolveConnectivityProbe,
23
23
  worseConnectivityOutcome,
24
24
  wrapScheduledTaskPrompt
25
- } from "./chunk-ELCO6VIJ.js";
25
+ } from "./chunk-GLBWCCZD.js";
26
26
 
27
27
  // ../../packages/core/dist/integrations/registry.js
28
28
  var INTEGRATION_REGISTRY = [
@@ -7533,7 +7533,7 @@ function requireHost() {
7533
7533
  }
7534
7534
 
7535
7535
  // src/lib/api-client.ts
7536
- var agtCliVersion = true ? "0.28.91" : "dev";
7536
+ var agtCliVersion = true ? "0.28.93" : "dev";
7537
7537
  var lastConfigHash = null;
7538
7538
  function setConfigHash(hash) {
7539
7539
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8830,4 +8830,4 @@ export {
8830
8830
  managerInstallSystemUnitCommand,
8831
8831
  managerUninstallSystemUnitCommand
8832
8832
  };
8833
- //# sourceMappingURL=chunk-Y4UI2QAF.js.map
8833
+ //# sourceMappingURL=chunk-W2VRPZ5M.js.map
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
100
100
  return { ok: true };
101
101
  } catch {
102
102
  }
103
- const { resolveClaudeBinary } = await import("./persistent-session-JNYVPBFG.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-4HWN54DY.js");
104
104
  const claudeBin = resolveClaudeBinary();
105
105
  const pairEnv = {
106
106
  ...process.env,
@@ -373,4 +373,4 @@ export {
373
373
  startClaudePair,
374
374
  submitClaudePairCode
375
375
  };
376
- //# sourceMappingURL=claude-pair-runtime-4OZQZQEP.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-FA7DXRHH.js.map
@@ -28,7 +28,7 @@ import {
28
28
  requireHost,
29
29
  safeWriteJsonAtomic,
30
30
  setConfigHash
31
- } from "../chunk-Y4UI2QAF.js";
31
+ } from "../chunk-W2VRPZ5M.js";
32
32
  import {
33
33
  getProjectDir as getProjectDir2,
34
34
  getReadyTasks,
@@ -66,7 +66,7 @@ import {
66
66
  takeWatchdogGiveUpCount,
67
67
  takeZombieDetection,
68
68
  transcriptActivityAgeSeconds
69
- } from "../chunk-GO3OXGPM.js";
69
+ } from "../chunk-CSTDOXOK.js";
70
70
  import {
71
71
  FLAGS_SCHEMA_VERSION,
72
72
  FLAG_REGISTRY,
@@ -101,7 +101,7 @@ import {
101
101
  resolveDmTarget,
102
102
  sumTranscriptUsageInWindow,
103
103
  wrapScheduledTaskPrompt
104
- } from "../chunk-ELCO6VIJ.js";
104
+ } from "../chunk-GLBWCCZD.js";
105
105
  import {
106
106
  parsePsRows,
107
107
  reapOrphanChannelMcps
@@ -848,17 +848,33 @@ function extractSlackBehaviourSubset(config2) {
848
848
  // src/lib/onboarding-drive.ts
849
849
  import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, rmSync, writeFileSync as writeFileSync2 } from "fs";
850
850
  import { dirname as dirname2 } from "path";
851
- var ONBOARDING_REINJECT_INTERVAL_MS = 20 * 6e4;
852
- function decideOnboardingDrive(step, marker, nowMs, reinjectIntervalMs = ONBOARDING_REINJECT_INTERVAL_MS) {
851
+ var ONBOARDING_REINJECT_INTERVAL_MS = 5 * 6e4;
852
+ var ONBOARDING_MAX_NUDGES = 3;
853
+ function decideOnboardingDrive(step, marker, nowMs, reinjectIntervalMs = ONBOARDING_REINJECT_INTERVAL_MS, maxNudges = ONBOARDING_MAX_NUDGES) {
853
854
  if (isOnboardingArea(step)) {
854
855
  const sameStep = marker?.step === step;
855
- const stale = sameStep && nowMs - marker.injectedAtMs >= reinjectIntervalMs;
856
- if (!sameStep || stale) {
857
- return { inject: true, clearMarker: false, nextMarker: { step, injectedAtMs: nowMs }, reminder: stale };
856
+ const current = sameStep ? marker : null;
857
+ if (current?.gaveUp) {
858
+ return { inject: false, clearMarker: false, nextMarker: current, reminder: false, standDown: false };
858
859
  }
859
- return { inject: false, clearMarker: false, nextMarker: marker, reminder: false };
860
+ const fresh = current === null;
861
+ const stale = current !== null && nowMs - current.injectedAtMs >= reinjectIntervalMs;
862
+ if (!fresh && !stale) {
863
+ return { inject: false, clearMarker: false, nextMarker: current, reminder: false, standDown: false };
864
+ }
865
+ const nudgeCount = fresh ? 1 : current.nudgeCount + 1;
866
+ const isFinal = nudgeCount >= maxNudges;
867
+ return {
868
+ inject: true,
869
+ clearMarker: false,
870
+ nextMarker: { step, injectedAtMs: nowMs, nudgeCount, gaveUp: isFinal },
871
+ // A middle re-fire (not fresh, not final) is a gentle "still waiting"
872
+ // reminder; the final one is a stand-down, not a reminder.
873
+ reminder: !fresh && !isFinal,
874
+ standDown: isFinal
875
+ };
860
876
  }
861
- return { inject: false, clearMarker: marker !== null, nextMarker: null, reminder: false };
877
+ return { inject: false, clearMarker: marker !== null, nextMarker: null, reminder: false, standDown: false };
862
878
  }
863
879
  var AREA_DIRECTIVE = {
864
880
  framing: "Frame the work \u2014 ask your manager what matters in week one and what success looks like, then record it with memory_save",
@@ -867,11 +883,15 @@ var AREA_DIRECTIVE = {
867
883
  reporting: "Agree how you keep your manager posted \u2014 settle on a cadence and channel, then create a recurring report scheduled task for it"
868
884
  };
869
885
  function buildOnboardingDirective(step, completed = [], opts = {}) {
870
- const { channel, reminder = false } = opts;
886
+ const { channel, reminder = false, standDown = false, code } = opts;
871
887
  const doneAreas = completed.filter(isOnboardingArea);
872
888
  const alreadyCovered = doneAreas.length > 0 ? `You've already covered ${doneAreas.join(", ")} \u2014 re-orient, don't re-ask about those. ` : "";
873
889
  const where = channel ? `your manager in ${describeOnboardingChannel(channel)} (the channel onboarding was triggered from)` : "your manager over your usual channel";
874
890
  const askAndWait = `Ask ${where} this area's question and WAIT for their reply. Do NOT self-answer, and do NOT call \`onboarding_advance\` until they respond. ${AREA_DIRECTIVE[step]} only once they have. `;
891
+ if (standDown) {
892
+ const resumeCmd = code ? `/onboard-${code}` : "/onboard";
893
+ return `\u{1F6D1} Onboarding (${step}): your manager hasn't replied after a few nudges, so stand down on this for now. Post exactly this once to ${where}, then STOP nudging this area and do NOT call \`onboarding_advance\`: "Let me know if you'd like me to stop nudging you on this. You can resume onboarding at any time using ${resumeCmd}." After posting, leave onboarding parked; your manager can resume it whenever they're ready.`;
894
+ }
875
895
  if (reminder) {
876
896
  return `\u23F3 Onboarding (${step}): still waiting on your manager's answer for this area. If you haven't asked yet, ask now; otherwise give them a gentle nudge, but don't move on without a reply. ` + askAndWait + `Advance with \`onboarding_advance\` (ADVANCE) once this area is done.`;
877
897
  }
@@ -884,7 +904,13 @@ function readOnboardingDriveMarker(path) {
884
904
  try {
885
905
  const raw = JSON.parse(readFileSync2(path, "utf8"));
886
906
  if (typeof raw.step === "string" && isOnboardingArea(raw.step) && typeof raw.injectedAtMs === "number" && Number.isFinite(raw.injectedAtMs)) {
887
- return { step: raw.step, injectedAtMs: raw.injectedAtMs };
907
+ const nudgeCount = typeof raw.nudgeCount === "number" && Number.isFinite(raw.nudgeCount) && raw.nudgeCount >= 1 ? Math.floor(raw.nudgeCount) : 1;
908
+ return {
909
+ step: raw.step,
910
+ injectedAtMs: raw.injectedAtMs,
911
+ nudgeCount,
912
+ gaveUp: raw.gaveUp === true
913
+ };
888
914
  }
889
915
  } catch {
890
916
  }
@@ -6910,7 +6936,7 @@ var cachedMaintenanceWindow = null;
6910
6936
  var lastVersionCheckAt = 0;
6911
6937
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
6912
6938
  var lastResponsivenessProbeAt = 0;
6913
- var agtCliVersion = true ? "0.28.91" : "dev";
6939
+ var agtCliVersion = true ? "0.28.93" : "dev";
6914
6940
  function resolveBrewPath(execFileSync4) {
6915
6941
  try {
6916
6942
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -8021,7 +8047,7 @@ async function pollCycle() {
8021
8047
  }
8022
8048
  try {
8023
8049
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
8024
- const { collectDiagnostics } = await import("../persistent-session-JNYVPBFG.js");
8050
+ const { collectDiagnostics } = await import("../persistent-session-4HWN54DY.js");
8025
8051
  const diagCodeNames = [...agentState.persistentSessionAgents];
8026
8052
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
8027
8053
  let tailscaleHostname;
@@ -8122,7 +8148,7 @@ async function pollCycle() {
8122
8148
  const {
8123
8149
  collectResponsivenessProbes,
8124
8150
  getResponsivenessIntervalMs
8125
- } = await import("../responsiveness-probe-OKAANVK6.js");
8151
+ } = await import("../responsiveness-probe-C2N4UJSE.js");
8126
8152
  const probeIntervalMs = getResponsivenessIntervalMs();
8127
8153
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
8128
8154
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -8154,7 +8180,7 @@ async function pollCycle() {
8154
8180
  collectResponsivenessProbes,
8155
8181
  livePendingInboundOldestAgeSeconds,
8156
8182
  parkPendingInbound
8157
- } = await import("../responsiveness-probe-OKAANVK6.js");
8183
+ } = await import("../responsiveness-probe-C2N4UJSE.js");
8158
8184
  const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
8159
8185
  const wedgeNow = /* @__PURE__ */ new Date();
8160
8186
  const liveAgents = agentState.persistentSessionAgents;
@@ -9431,7 +9457,17 @@ async function processAgent(agent, agentStates) {
9431
9457
  // AGT_API_KEY to every spawn env (getApiKey()); Claude Code
9432
9458
  // substitutes at MCP-launch. No literal in .mcp.json.
9433
9459
  AGT_API_KEY: "${AGT_API_KEY}",
9434
- AGT_AGENT_ID: agent.agent_id
9460
+ AGT_AGENT_ID: agent.agent_id,
9461
+ // ENG-6587 (D16): per-turn initiator marker path. The direct-chat MCP
9462
+ // (writer) and the broker MCPs (readers) share no other state-dir env,
9463
+ // so we inject the SAME absolute path buildMcpJson gives the brokers:
9464
+ // ~/.augmented/<codeName>/.current-turn-initiator.json. Note getAgentDir
9465
+ // returns the agent root (NOT the /provision subdir `agentDir` points at),
9466
+ // so it byte-matches the broker readers' path.
9467
+ AGT_TURN_INITIATOR_FILE: join16(
9468
+ frameworkAdapter.getAgentDir(agent.code_name),
9469
+ ".current-turn-initiator.json"
9470
+ )
9435
9471
  };
9436
9472
  if (directChatTz) directChatEnv["TZ"] = directChatTz;
9437
9473
  if (!frameworkAdapter.writeMcpServer) {
@@ -10420,17 +10456,22 @@ In progress for ${age} minutes \u2014 auto-failed`).catch(() => {
10420
10456
  agent.code_name,
10421
10457
  "system",
10422
10458
  // ENG-6583: anchor the ask to the channel onboarding was triggered
10423
- // from, and phrase a staleness re-fire as a gentle reminder.
10459
+ // from, and phrase a staleness re-fire as a gentle reminder. ENG-6626:
10460
+ // the final bounded nudge flips to the stand-down message, which names
10461
+ // the agent's /onboard-<code> resume command.
10424
10462
  buildOnboardingDirective(obStep, obState.completed, {
10425
10463
  channel: obState.channel,
10426
- reminder: decision.reminder
10464
+ reminder: decision.reminder,
10465
+ standDown: decision.standDown,
10466
+ code: agent.code_name
10427
10467
  }),
10428
10468
  { task_name: "onboarding" },
10429
10469
  log
10430
10470
  ).catch(() => ({ delivered: false, fallbackUsed: false }));
10431
10471
  if (onboardingNudgeReachedSession(injectResult) && decision.nextMarker) {
10432
10472
  writeOnboardingDriveMarker(markerPath, decision.nextMarker);
10433
- log(`[onboarding] nudged '${agent.code_name}' into '${obStep}'`);
10473
+ const tag = decision.standDown ? `stand-down (nudge ${decision.nextMarker.nudgeCount})` : `nudge ${decision.nextMarker.nudgeCount}`;
10474
+ log(`[onboarding] ${tag} '${agent.code_name}' into '${obStep}'`);
10434
10475
  }
10435
10476
  }
10436
10477
  }
@@ -11625,7 +11666,7 @@ async function processClaudePairSessions(agents) {
11625
11666
  killPairSession,
11626
11667
  pairTmuxSession,
11627
11668
  finalizeClaudePairOnboarding
11628
- } = await import("../claude-pair-runtime-4OZQZQEP.js");
11669
+ } = await import("../claude-pair-runtime-FA7DXRHH.js");
11629
11670
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
11630
11671
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
11631
11672
  const killed = await killPairSession(pairTmuxSession(pairId));