@integrity-labs/agt-cli 0.27.73 → 0.27.75
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 +3 -3
- package/dist/{chunk-WBT4UEOY.js → chunk-AWAKTFWY.js} +1 -1
- package/dist/{chunk-7YM2F3DG.js → chunk-VTAXNSGS.js} +282 -51
- package/dist/chunk-VTAXNSGS.js.map +1 -0
- package/dist/{claude-pair-runtime-2XWSYFSY.js → claude-pair-runtime-XMX2QOGP.js} +2 -2
- package/dist/lib/manager-worker.js +39 -110
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/teams-channel.js +15932 -0
- package/dist/{persistent-session-S7OJTKKE.js → persistent-session-CXKB7FU3.js} +2 -2
- package/dist/{responsiveness-probe-LGNXOX43.js → responsiveness-probe-EKB5VBCX.js} +2 -2
- package/package.json +2 -2
- package/dist/chunk-7YM2F3DG.js.map +0 -1
- /package/dist/{chunk-WBT4UEOY.js.map → chunk-AWAKTFWY.js.map} +0 -0
- /package/dist/{claude-pair-runtime-2XWSYFSY.js.map → claude-pair-runtime-XMX2QOGP.js.map} +0 -0
- /package/dist/{persistent-session-S7OJTKKE.js.map → persistent-session-CXKB7FU3.js.map} +0 -0
- /package/dist/{responsiveness-probe-LGNXOX43.js.map → responsiveness-probe-EKB5VBCX.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
provisionStopHook,
|
|
17
17
|
requireHost,
|
|
18
18
|
safeWriteJsonAtomic
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-AWAKTFWY.js";
|
|
20
20
|
import {
|
|
21
21
|
getProjectDir as getProjectDir2,
|
|
22
22
|
getReadyTasks,
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
} from "../chunk-HR5T2RQF.js";
|
|
27
27
|
import {
|
|
28
28
|
buildAllowedTools,
|
|
29
|
+
checkChannelInputs,
|
|
29
30
|
formatMissingVar,
|
|
30
31
|
getLastFailureContext,
|
|
31
32
|
getProjectDir,
|
|
@@ -51,7 +52,7 @@ import {
|
|
|
51
52
|
stopAllSessionsAndWait,
|
|
52
53
|
stopPersistentSession,
|
|
53
54
|
takeZombieDetection
|
|
54
|
-
} from "../chunk-
|
|
55
|
+
} from "../chunk-VTAXNSGS.js";
|
|
55
56
|
import {
|
|
56
57
|
KANBAN_CHECK_COMMAND,
|
|
57
58
|
appendDmFooter,
|
|
@@ -2510,108 +2511,6 @@ function killAgentChannelProcesses(codeName, opts) {
|
|
|
2510
2511
|
return pids;
|
|
2511
2512
|
}
|
|
2512
2513
|
|
|
2513
|
-
// src/lib/channel-input-watchdog.ts
|
|
2514
|
-
var STUCK_THRESHOLD_MS = 5e3;
|
|
2515
|
-
var ATTACHED_STUCK_THRESHOLD_MS = 15e3;
|
|
2516
|
-
var INPUT_BOX_DIVIDER = /^[─━]{10,}/;
|
|
2517
|
-
var PROMPT_PREFIX = "\u276F ";
|
|
2518
|
-
function decide(pane, prev, now, config2 = {}) {
|
|
2519
|
-
const threshold = config2.stuckThresholdMs ?? STUCK_THRESHOLD_MS;
|
|
2520
|
-
const inputText = extractInputBoxText(pane);
|
|
2521
|
-
if (!inputText) {
|
|
2522
|
-
return { fire: false, next: void 0 };
|
|
2523
|
-
}
|
|
2524
|
-
if (isActivelyProcessing(pane)) {
|
|
2525
|
-
return { fire: false, next: prev };
|
|
2526
|
-
}
|
|
2527
|
-
const hash = simpleHash(inputText);
|
|
2528
|
-
if (!prev || prev.lastInputHash !== hash) {
|
|
2529
|
-
return {
|
|
2530
|
-
fire: false,
|
|
2531
|
-
next: { lastInputHash: hash, firstSeenAt: now, resolved: false }
|
|
2532
|
-
};
|
|
2533
|
-
}
|
|
2534
|
-
if (prev.resolved) return { fire: false, next: prev };
|
|
2535
|
-
if (now - prev.firstSeenAt < threshold) return { fire: false, next: prev };
|
|
2536
|
-
return {
|
|
2537
|
-
fire: true,
|
|
2538
|
-
next: { ...prev, resolved: true }
|
|
2539
|
-
};
|
|
2540
|
-
}
|
|
2541
|
-
function extractInputBoxText(pane) {
|
|
2542
|
-
const lines = pane.split("\n");
|
|
2543
|
-
for (let i = 1; i < lines.length; i++) {
|
|
2544
|
-
const line = lines[i] ?? "";
|
|
2545
|
-
if (!line.startsWith(PROMPT_PREFIX)) continue;
|
|
2546
|
-
let j = i - 1;
|
|
2547
|
-
while (j >= 0 && (lines[j] ?? "").trim() === "") j--;
|
|
2548
|
-
if (j < 0) continue;
|
|
2549
|
-
if (!INPUT_BOX_DIVIDER.test((lines[j] ?? "").trim())) continue;
|
|
2550
|
-
const text = line.slice(PROMPT_PREFIX.length).trim();
|
|
2551
|
-
return text.length > 0 ? text : null;
|
|
2552
|
-
}
|
|
2553
|
-
return null;
|
|
2554
|
-
}
|
|
2555
|
-
function isActivelyProcessing(pane) {
|
|
2556
|
-
const lines = pane.split("\n");
|
|
2557
|
-
for (let i = lines.length - 1; i >= 0; i--) {
|
|
2558
|
-
const line = (lines[i] ?? "").trim();
|
|
2559
|
-
if (!line.startsWith("\u273B")) continue;
|
|
2560
|
-
if (/\bfor\s+\d+s\s*$/.test(line)) return false;
|
|
2561
|
-
if (/\b\w+ing[…\.]{0,3}\s*$/i.test(line)) return true;
|
|
2562
|
-
return false;
|
|
2563
|
-
}
|
|
2564
|
-
return false;
|
|
2565
|
-
}
|
|
2566
|
-
function simpleHash(s) {
|
|
2567
|
-
let h = 0;
|
|
2568
|
-
for (let i = 0; i < s.length; i++) {
|
|
2569
|
-
h = (h << 5) - h + s.charCodeAt(i) | 0;
|
|
2570
|
-
}
|
|
2571
|
-
return h.toString(16);
|
|
2572
|
-
}
|
|
2573
|
-
function checkChannelInputs(codeNames, io, config2 = {}, states = sharedStates) {
|
|
2574
|
-
const live = new Set(codeNames);
|
|
2575
|
-
for (const codeName of codeNames) {
|
|
2576
|
-
try {
|
|
2577
|
-
checkOne(codeName, io, config2, states);
|
|
2578
|
-
} catch (err) {
|
|
2579
|
-
io.log(`[channel-input-watchdog] '${codeName}': ${err.message}`);
|
|
2580
|
-
}
|
|
2581
|
-
}
|
|
2582
|
-
for (const key of [...states.keys()]) {
|
|
2583
|
-
if (!live.has(key)) states.delete(key);
|
|
2584
|
-
}
|
|
2585
|
-
}
|
|
2586
|
-
function checkOne(codeName, io, config2, states) {
|
|
2587
|
-
const pane = io.capturePane(codeName);
|
|
2588
|
-
if (!pane) {
|
|
2589
|
-
states.delete(codeName);
|
|
2590
|
-
return;
|
|
2591
|
-
}
|
|
2592
|
-
const attached = io.isClientAttached(codeName);
|
|
2593
|
-
const effectiveConfig = attached ? {
|
|
2594
|
-
...config2,
|
|
2595
|
-
stuckThresholdMs: config2.attachedStuckThresholdMs ?? ATTACHED_STUCK_THRESHOLD_MS
|
|
2596
|
-
} : config2;
|
|
2597
|
-
const prev = states.get(codeName);
|
|
2598
|
-
const { fire, next } = decide(pane, prev, io.now(), effectiveConfig);
|
|
2599
|
-
if (next === void 0) {
|
|
2600
|
-
states.delete(codeName);
|
|
2601
|
-
} else {
|
|
2602
|
-
states.set(codeName, next);
|
|
2603
|
-
}
|
|
2604
|
-
if (fire) {
|
|
2605
|
-
const text = extractInputBoxText(pane) ?? "";
|
|
2606
|
-
const hash = next?.lastInputHash ?? simpleHash(text);
|
|
2607
|
-
io.log(
|
|
2608
|
-
`[channel-input-watchdog] '${codeName}': stuck channel input \u2014 firing Enter (input_hash=${hash}, len=${text.length})`
|
|
2609
|
-
);
|
|
2610
|
-
io.sendEnter(codeName);
|
|
2611
|
-
}
|
|
2612
|
-
}
|
|
2613
|
-
var sharedStates = /* @__PURE__ */ new Map();
|
|
2614
|
-
|
|
2615
2514
|
// src/lib/delivery-hint.ts
|
|
2616
2515
|
var DEFAULT_PROBABILITY = 0.1;
|
|
2617
2516
|
function envSuffixFor(codeName) {
|
|
@@ -3748,7 +3647,7 @@ var cachedMaintenanceWindow = null;
|
|
|
3748
3647
|
var lastVersionCheckAt = 0;
|
|
3749
3648
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
3750
3649
|
var lastResponsivenessProbeAt = 0;
|
|
3751
|
-
var agtCliVersion = true ? "0.27.
|
|
3650
|
+
var agtCliVersion = true ? "0.27.75" : "dev";
|
|
3752
3651
|
function resolveBrewPath(execFileSync4) {
|
|
3753
3652
|
try {
|
|
3754
3653
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -4862,7 +4761,7 @@ async function pollCycle() {
|
|
|
4862
4761
|
}
|
|
4863
4762
|
try {
|
|
4864
4763
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
4865
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
4764
|
+
const { collectDiagnostics } = await import("../persistent-session-CXKB7FU3.js");
|
|
4866
4765
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
4867
4766
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
|
|
4868
4767
|
let tailscaleHostname;
|
|
@@ -4935,7 +4834,7 @@ async function pollCycle() {
|
|
|
4935
4834
|
const {
|
|
4936
4835
|
collectResponsivenessProbes,
|
|
4937
4836
|
getResponsivenessIntervalMs
|
|
4938
|
-
} = await import("../responsiveness-probe-
|
|
4837
|
+
} = await import("../responsiveness-probe-EKB5VBCX.js");
|
|
4939
4838
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
4940
4839
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
4941
4840
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -5138,6 +5037,26 @@ async function pollCycle() {
|
|
|
5138
5037
|
} catch {
|
|
5139
5038
|
}
|
|
5140
5039
|
},
|
|
5040
|
+
// ENG-6017: dialog-dismissal keys — one send-keys call per key so a
|
|
5041
|
+
// multi-key sequence can't be wrapped into a single bracketed paste
|
|
5042
|
+
// (see defaultArmSender in persistent-session.ts). The inter-key
|
|
5043
|
+
// delay is a blocking sleep; dialog sequences are at most two keys
|
|
5044
|
+
// with a 300ms gap, well within poll-cycle tolerances.
|
|
5045
|
+
sendKeys: (codeName, keys, interKeyDelayMs) => {
|
|
5046
|
+
try {
|
|
5047
|
+
for (let i = 0; i < keys.length; i++) {
|
|
5048
|
+
if (i > 0 && interKeyDelayMs > 0) {
|
|
5049
|
+
const view = new Int32Array(new SharedArrayBuffer(4));
|
|
5050
|
+
Atomics.wait(view, 0, 0, interKeyDelayMs);
|
|
5051
|
+
}
|
|
5052
|
+
syncExecFile("tmux", ["send-keys", "-t", `agt-${codeName}`, keys[i]], {
|
|
5053
|
+
stdio: "ignore",
|
|
5054
|
+
timeout: 2e3
|
|
5055
|
+
});
|
|
5056
|
+
}
|
|
5057
|
+
} catch {
|
|
5058
|
+
}
|
|
5059
|
+
},
|
|
5141
5060
|
log,
|
|
5142
5061
|
now: () => Date.now()
|
|
5143
5062
|
});
|
|
@@ -9093,7 +9012,7 @@ async function processClaudePairSessions(agents) {
|
|
|
9093
9012
|
killPairSession,
|
|
9094
9013
|
pairTmuxSession,
|
|
9095
9014
|
finalizeClaudePairOnboarding
|
|
9096
|
-
} = await import("../claude-pair-runtime-
|
|
9015
|
+
} = await import("../claude-pair-runtime-XMX2QOGP.js");
|
|
9097
9016
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
9098
9017
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
9099
9018
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
|
@@ -9886,9 +9805,19 @@ function deployMcpAssets() {
|
|
|
9886
9805
|
const RESTARTABLE_CHANNEL_FILES = /* @__PURE__ */ new Set([
|
|
9887
9806
|
"slack-channel.js",
|
|
9888
9807
|
"direct-chat-channel.js",
|
|
9889
|
-
"telegram-channel.js"
|
|
9808
|
+
"telegram-channel.js",
|
|
9809
|
+
// ENG-6019: teams-channel was provisioned into .mcp.json but never shipped
|
|
9810
|
+
// in the bundle — the file below has never existed on hosts until now.
|
|
9811
|
+
"teams-channel.js"
|
|
9890
9812
|
]);
|
|
9891
|
-
for (const file of [
|
|
9813
|
+
for (const file of [
|
|
9814
|
+
"index.js",
|
|
9815
|
+
"slack-channel.js",
|
|
9816
|
+
"direct-chat-channel.js",
|
|
9817
|
+
"telegram-channel.js",
|
|
9818
|
+
"teams-channel.js"
|
|
9819
|
+
// ENG-6019
|
|
9820
|
+
]) {
|
|
9892
9821
|
const src = join7(mcpSourceDir, file);
|
|
9893
9822
|
const dst = join7(targetDir, file);
|
|
9894
9823
|
if (!existsSync5(src)) continue;
|