@integrity-labs/agt-cli 0.27.108 → 0.27.110

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.
@@ -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-HGR5D4DJ.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-3ZWAGNNO.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-AI37D2CT.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-DS7675XI.js.map
@@ -7,7 +7,7 @@ import {
7
7
  markTaskFired,
8
8
  saveSchedulerState,
9
9
  syncTasksToScheduler
10
- } from "./chunk-HR5T2RQF.js";
10
+ } from "./chunk-I3YS5WFV.js";
11
11
  export {
12
12
  computeNextFire,
13
13
  findTaskByTemplate,
@@ -18,4 +18,4 @@ export {
18
18
  saveSchedulerState,
19
19
  syncTasksToScheduler
20
20
  };
21
- //# sourceMappingURL=claude-scheduler-EM24LTGV.js.map
21
+ //# sourceMappingURL=claude-scheduler-FATCLHDM.js.map
@@ -17,14 +17,14 @@ import {
17
17
  provisionStopHook,
18
18
  requireHost,
19
19
  safeWriteJsonAtomic
20
- } from "../chunk-N4YEE4O7.js";
20
+ } from "../chunk-CS7BEFJ7.js";
21
21
  import {
22
22
  getProjectDir as getProjectDir2,
23
23
  getReadyTasks,
24
24
  loadSchedulerState,
25
25
  markTaskFired,
26
26
  syncTasksToScheduler
27
- } from "../chunk-HR5T2RQF.js";
27
+ } from "../chunk-I3YS5WFV.js";
28
28
  import {
29
29
  buildAllowedTools,
30
30
  checkChannelInputs,
@@ -55,7 +55,7 @@ import {
55
55
  stopPersistentSession,
56
56
  takeWatchdogGiveUpCount,
57
57
  takeZombieDetection
58
- } from "../chunk-DFQ2EOHB.js";
58
+ } from "../chunk-D2EJL2KI.js";
59
59
  import {
60
60
  KANBAN_CHECK_COMMAND,
61
61
  SUPPRESS_SENTINEL,
@@ -79,7 +79,7 @@ import {
79
79
  resolveConnectivityProbe,
80
80
  resolveDmTarget,
81
81
  wrapScheduledTaskPrompt
82
- } from "../chunk-BP4D3ZPJ.js";
82
+ } from "../chunk-Z3YQYO43.js";
83
83
  import {
84
84
  parsePsRows,
85
85
  reapOrphanChannelMcps
@@ -4133,7 +4133,7 @@ var cachedMaintenanceWindow = null;
4133
4133
  var lastVersionCheckAt = 0;
4134
4134
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
4135
4135
  var lastResponsivenessProbeAt = 0;
4136
- var agtCliVersion = true ? "0.27.108" : "dev";
4136
+ var agtCliVersion = true ? "0.27.110" : "dev";
4137
4137
  function resolveBrewPath(execFileSync4) {
4138
4138
  try {
4139
4139
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -5326,7 +5326,7 @@ async function pollCycle() {
5326
5326
  }
5327
5327
  try {
5328
5328
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
5329
- const { collectDiagnostics } = await import("../persistent-session-HGR5D4DJ.js");
5329
+ const { collectDiagnostics } = await import("../persistent-session-3ZWAGNNO.js");
5330
5330
  const diagCodeNames = [...agentState.persistentSessionAgents];
5331
5331
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
5332
5332
  let tailscaleHostname;
@@ -5413,12 +5413,12 @@ async function pollCycle() {
5413
5413
  const {
5414
5414
  collectResponsivenessProbes,
5415
5415
  getResponsivenessIntervalMs
5416
- } = await import("../responsiveness-probe-FS376EVY.js");
5416
+ } = await import("../responsiveness-probe-EGXJFJBW.js");
5417
5417
  const probeIntervalMs = getResponsivenessIntervalMs();
5418
5418
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
5419
5419
  const probeCodeNames = [...agentState.persistentSessionAgents];
5420
5420
  if (probeCodeNames.length > 0) {
5421
- const { takeAcpxExecFailureCount, creditAcpxExecFailureCount } = await import("../persistent-session-HGR5D4DJ.js");
5421
+ const { takeAcpxExecFailureCount, creditAcpxExecFailureCount } = await import("../persistent-session-3ZWAGNNO.js");
5422
5422
  const drainedGiveUps = /* @__PURE__ */ new Map();
5423
5423
  const drainedAcpxFailures = /* @__PURE__ */ new Map();
5424
5424
  const probes = collectResponsivenessProbes(probeCodeNames).map((p) => {
@@ -7526,6 +7526,26 @@ function cleanupOldFiles(dir, maxAgeDays, ext) {
7526
7526
  } catch {
7527
7527
  }
7528
7528
  }
7529
+ function buildSchedulerTaskInput(t) {
7530
+ return {
7531
+ id: t.id,
7532
+ template_id: t.template_id,
7533
+ name: t.name,
7534
+ schedule_kind: t.schedule_kind,
7535
+ schedule_expr: t.schedule_expr ?? null,
7536
+ schedule_every: t.schedule_every ?? null,
7537
+ schedule_at: t.schedule_at ?? null,
7538
+ timezone: t.timezone ?? "UTC",
7539
+ prompt: t.prompt ?? "",
7540
+ session_target: t.session_target ?? "isolated",
7541
+ delivery_mode: t.delivery_mode ?? "none",
7542
+ delivery_policy: t.delivery_policy ?? "always",
7543
+ delivery_channel: t.delivery_channel ?? null,
7544
+ delivery_to: t.delivery_to ?? null,
7545
+ enabled: t.enabled ?? true,
7546
+ triggered_at: t.triggered_at ?? null
7547
+ };
7548
+ }
7529
7549
  var inFlightClaudeTasks = /* @__PURE__ */ new Set();
7530
7550
  var claudeTaskConcurrency = /* @__PURE__ */ new Map();
7531
7551
  var MAX_CLAUDE_CONCURRENCY = 2;
@@ -7558,23 +7578,7 @@ async function syncAndCheckClaudeScheduler(agent, tasks, boardItems, refreshData
7558
7578
  const combinedHash = `${stableTasksHash}:${boardHash}:${modelsHash}`;
7559
7579
  const prevHash = agentState.knownTasksHashes.get(agent.agent_id);
7560
7580
  if (combinedHash !== prevHash) {
7561
- const taskInputs = tasks.map((t) => ({
7562
- id: t.id,
7563
- template_id: t.template_id,
7564
- name: t.name,
7565
- schedule_kind: t.schedule_kind,
7566
- schedule_expr: t.schedule_expr ?? null,
7567
- schedule_every: t.schedule_every ?? null,
7568
- schedule_at: t.schedule_at ?? null,
7569
- timezone: t.timezone ?? "UTC",
7570
- prompt: t.prompt ?? "",
7571
- session_target: t.session_target ?? "isolated",
7572
- delivery_mode: t.delivery_mode ?? "none",
7573
- delivery_channel: t.delivery_channel ?? null,
7574
- delivery_to: t.delivery_to ?? null,
7575
- enabled: t.enabled ?? true,
7576
- triggered_at: t.triggered_at ?? null
7577
- }));
7581
+ const taskInputs = tasks.map((t) => buildSchedulerTaskInput(t));
7578
7582
  const state7 = syncTasksToScheduler(codeName, agent.agent_id, taskInputs);
7579
7583
  claudeSchedulerStates.set(codeName, state7);
7580
7584
  agentState.knownTasksHashes.set(agent.agent_id, combinedHash);
@@ -7756,6 +7760,20 @@ async function deliverScheduledCardResult(codeName, agentId, cardId) {
7756
7760
  markScheduledCardDeliveryComplete(cardId);
7757
7761
  return "terminal";
7758
7762
  }
7763
+ const deliveryPolicy = task.deliveryPolicy ?? "always";
7764
+ if (deliveryPolicy === "never" || deliveryPolicy === "conditional" && card.suppress_delivery !== false) {
7765
+ log(
7766
+ `[scheduled-kanban] Suppressed by delivery_policy=${deliveryPolicy} for card ${cardId} (task '${task.name}') on '${codeName}' \u2014 result recorded on the card only (tombstone)`
7767
+ );
7768
+ if (task.deliveryMode === "announce" && task.deliveryTo) {
7769
+ await reportDeliveryStatus(agentId, task.taskId, {
7770
+ status: "skipped",
7771
+ error_code: "SUPPRESSED_BY_POLICY"
7772
+ });
7773
+ }
7774
+ markScheduledCardDeliveryComplete(cardId);
7775
+ return "delivered";
7776
+ }
7759
7777
  if (card.suppress_delivery === true) {
7760
7778
  log(`[scheduled-kanban] Suppressing delivery (structured flag) for card ${cardId} (task '${task.name}') on '${codeName}' \u2014 result recorded on the card only`);
7761
7779
  if (task.deliveryMode === "announce" && task.deliveryTo) {
@@ -7821,9 +7839,11 @@ async function routeScheduledTaskViaKanban(codeName, agentId, task, prompt) {
7821
7839
  if (run_id) void finishRun(run_id, "failed", { outcomeMessage: "kanban materialise incomplete", completeKanbanItemId: kanban_item_id });
7822
7840
  return false;
7823
7841
  }
7842
+ const suppressionTeaching = (task.deliveryPolicy ?? "always") === "conditional" ? `THIS task is CONDITIONAL: quiet runs stay SILENT automatically. Write your findings on the card and mark it done \u2014 if nothing met the user's criteria, NOTHING will be sent (no flag needed). If something DID meet the criteria and the user must be told, call kanban_done with suppress_delivery: false \u2014 that explicit assert is the ONLY way this result reaches the user.
7843
+ ` : `If \u2014 and ONLY if \u2014 the task description contains explicit opt-out wording the user typed (e.g. "DO NOT notify me unless urgent", "only if X", "stay silent unless \u2026") and that condition is NOT met this run, call kanban_done with suppress_delivery: true \u2014 your result stays on the card but will NOT be messaged to the user. That is how you honor the user's do-not-notify instruction: a "nothing urgent" result without the flag would still be DELIVERED as a message. A report with zero items is only a valid deliverable when the task asks for a digest WITHOUT opt-out wording \u2014 when in doubt, deliver.
7844
+ `;
7824
7845
  const nudge = `You have a new scheduled task on your kanban board: id=${kanban_item_id} title=${JSON.stringify(task.name)}. Call kanban_move("${kanban_item_id}", "in_progress"), do the work described on the card, then write the finished result onto the card and mark it done. Do NOT send, post, or message the result to anyone yourself \u2014 the result you write on the card IS the message that will be delivered to the user; delivery happens automatically from the card.
7825
- If \u2014 and ONLY if \u2014 the task description contains explicit opt-out wording the user typed (e.g. "DO NOT notify me unless urgent", "only if X", "stay silent unless \u2026") and that condition is NOT met this run, call kanban_done with suppress_delivery: true \u2014 your result stays on the card but will NOT be messaged to the user. That is how you honor the user's do-not-notify instruction: a "nothing urgent" result without the flag would still be DELIVERED as a message. A report with zero items is only a valid deliverable when the task asks for a digest WITHOUT opt-out wording \u2014 when in doubt, deliver.
7826
- ` + formatRunMarker(run_id);
7846
+ ` + suppressionTeaching + formatRunMarker(run_id);
7827
7847
  let injectStatus;
7828
7848
  try {
7829
7849
  injectStatus = await injectMessageWithStatus(codeName, "task", nudge, { task_name: "scheduled-task" }, log);
@@ -8284,23 +8304,7 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash3("sha256").
8284
8304
  const stableTasksHash = createHash3("sha256").update(JSON.stringify(tasks)).digest("hex").slice(0, 16);
8285
8305
  const prevHash = agentState.knownTasksHashes.get(agent.agent_id);
8286
8306
  if (stableTasksHash !== prevHash) {
8287
- const taskInputs = tasks.map((t) => ({
8288
- id: t.id,
8289
- template_id: t.template_id,
8290
- name: t.name,
8291
- schedule_kind: t.schedule_kind,
8292
- schedule_expr: t.schedule_expr ?? null,
8293
- schedule_every: t.schedule_every ?? null,
8294
- schedule_at: t.schedule_at ?? null,
8295
- timezone: t.timezone ?? "UTC",
8296
- prompt: t.prompt ?? "",
8297
- session_target: t.session_target ?? "isolated",
8298
- delivery_mode: t.delivery_mode ?? "none",
8299
- delivery_channel: t.delivery_channel ?? null,
8300
- delivery_to: t.delivery_to ?? null,
8301
- enabled: t.enabled ?? true,
8302
- triggered_at: t.triggered_at ?? null
8303
- }));
8307
+ const taskInputs = tasks.map((t) => buildSchedulerTaskInput(t));
8304
8308
  const schedulerState = syncTasksToScheduler(codeName, agent.agent_id, taskInputs);
8305
8309
  claudeSchedulerStates.set(codeName, schedulerState);
8306
8310
  agentState.knownTasksHashes.set(agent.agent_id, stableTasksHash);
@@ -8719,7 +8723,7 @@ ${escapeXml(msg.content)}
8719
8723
  return;
8720
8724
  }
8721
8725
  log(`[direct-chat] One-shot spawn for '${agent.codeName}' (msg=${msg.id}; host in-flight=${directChatSpawnGate.hostInFlight}, queued=${directChatSpawnGate.queuedCount})`);
8722
- const { getProjectDir: ccProjectDir } = await import("../claude-scheduler-EM24LTGV.js");
8726
+ const { getProjectDir: ccProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
8723
8727
  const projDir = ccProjectDir(agent.codeName);
8724
8728
  const mcpConfigPath = join8(projDir, ".mcp.json");
8725
8729
  const serverNames = [];
@@ -9790,7 +9794,7 @@ async function processClaudePairSessions(agents) {
9790
9794
  killPairSession,
9791
9795
  pairTmuxSession,
9792
9796
  finalizeClaudePairOnboarding
9793
- } = await import("../claude-pair-runtime-AI37D2CT.js");
9797
+ } = await import("../claude-pair-runtime-DS7675XI.js");
9794
9798
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
9795
9799
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
9796
9800
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -10677,6 +10681,7 @@ export {
10677
10681
  __setAgentChannelTokensForTest,
10678
10682
  applyRestartAcks,
10679
10683
  buildDoneCardNotification,
10684
+ buildSchedulerTaskInput,
10680
10685
  claudeCodeUpgradeMarkerPath,
10681
10686
  claudeCodeUpgradeThrottled,
10682
10687
  claudeManagedSettingsPath,