@integrity-labs/agt-cli 0.28.134 → 0.28.136
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 +4 -4
- package/dist/{chunk-U3CDNNEK.js → chunk-2WWCHEQT.js} +2 -2
- package/dist/{chunk-Z3UJDIZJ.js → chunk-FDRT52UA.js} +3 -3
- package/dist/{chunk-RIT2OY5S.js → chunk-QKA46UNQ.js} +13 -1
- package/dist/chunk-QKA46UNQ.js.map +1 -0
- package/dist/{claude-pair-runtime-NJDB2EPV.js → claude-pair-runtime-ODRPKNKT.js} +2 -2
- package/dist/lib/manager-worker.js +8 -8
- package/dist/mcp/index.js +97 -0
- package/dist/mcp/slack-channel.js +15 -5
- package/dist/{persistent-session-6MR7EVEN.js → persistent-session-VQCCFN4M.js} +3 -3
- package/dist/{responsiveness-probe-GWJ6TKO2.js → responsiveness-probe-FIXXJ7ZV.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-RIT2OY5S.js.map +0 -1
- /package/dist/{chunk-U3CDNNEK.js.map → chunk-2WWCHEQT.js.map} +0 -0
- /package/dist/{chunk-Z3UJDIZJ.js.map → chunk-FDRT52UA.js.map} +0 -0
- /package/dist/{claude-pair-runtime-NJDB2EPV.js.map → claude-pair-runtime-ODRPKNKT.js.map} +0 -0
- /package/dist/{persistent-session-6MR7EVEN.js.map → persistent-session-VQCCFN4M.js.map} +0 -0
- /package/dist/{responsiveness-probe-GWJ6TKO2.js.map → responsiveness-probe-FIXXJ7ZV.js.map} +0 -0
|
@@ -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-
|
|
103
|
+
const { resolveClaudeBinary } = await import("./persistent-session-VQCCFN4M.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-
|
|
376
|
+
//# sourceMappingURL=claude-pair-runtime-ODRPKNKT.js.map
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
requireHost,
|
|
29
29
|
safeWriteJsonAtomic,
|
|
30
30
|
setConfigHash
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-FDRT52UA.js";
|
|
32
32
|
import {
|
|
33
33
|
getProjectDir as getProjectDir2,
|
|
34
34
|
getReadyTasks,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
takeZombieDetection,
|
|
73
73
|
transcriptActivityAgeSeconds,
|
|
74
74
|
writeEgressAllowlist
|
|
75
|
-
} from "../chunk-
|
|
75
|
+
} from "../chunk-2WWCHEQT.js";
|
|
76
76
|
import {
|
|
77
77
|
FLAGS_SCHEMA_VERSION,
|
|
78
78
|
FLAG_REGISTRY,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
resolveDmTarget,
|
|
111
111
|
sumTranscriptUsageInWindow,
|
|
112
112
|
wrapScheduledTaskPrompt
|
|
113
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-QKA46UNQ.js";
|
|
114
114
|
import {
|
|
115
115
|
parsePsRows,
|
|
116
116
|
reapOrphanChannelMcps
|
|
@@ -7067,7 +7067,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
7067
7067
|
var lastVersionCheckAt = 0;
|
|
7068
7068
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
7069
7069
|
var lastResponsivenessProbeAt = 0;
|
|
7070
|
-
var agtCliVersion = true ? "0.28.
|
|
7070
|
+
var agtCliVersion = true ? "0.28.136" : "dev";
|
|
7071
7071
|
function resolveBrewPath(execFileSync4) {
|
|
7072
7072
|
try {
|
|
7073
7073
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -8197,7 +8197,7 @@ async function pollCycle() {
|
|
|
8197
8197
|
}
|
|
8198
8198
|
try {
|
|
8199
8199
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
8200
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
8200
|
+
const { collectDiagnostics } = await import("../persistent-session-VQCCFN4M.js");
|
|
8201
8201
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
8202
8202
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
|
|
8203
8203
|
let tailscaleHostname;
|
|
@@ -8340,7 +8340,7 @@ async function pollCycle() {
|
|
|
8340
8340
|
const {
|
|
8341
8341
|
collectResponsivenessProbes,
|
|
8342
8342
|
getResponsivenessIntervalMs
|
|
8343
|
-
} = await import("../responsiveness-probe-
|
|
8343
|
+
} = await import("../responsiveness-probe-FIXXJ7ZV.js");
|
|
8344
8344
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
8345
8345
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
8346
8346
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -8372,7 +8372,7 @@ async function pollCycle() {
|
|
|
8372
8372
|
collectResponsivenessProbes,
|
|
8373
8373
|
livePendingInboundOldestAgeSeconds,
|
|
8374
8374
|
parkPendingInbound
|
|
8375
|
-
} = await import("../responsiveness-probe-
|
|
8375
|
+
} = await import("../responsiveness-probe-FIXXJ7ZV.js");
|
|
8376
8376
|
const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
|
|
8377
8377
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
8378
8378
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -11921,7 +11921,7 @@ async function processClaudePairSessions(agents) {
|
|
|
11921
11921
|
killPairSession,
|
|
11922
11922
|
pairTmuxSession,
|
|
11923
11923
|
finalizeClaudePairOnboarding
|
|
11924
|
-
} = await import("../claude-pair-runtime-
|
|
11924
|
+
} = await import("../claude-pair-runtime-ODRPKNKT.js");
|
|
11925
11925
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
11926
11926
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
11927
11927
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
package/dist/mcp/index.js
CHANGED
|
@@ -21078,6 +21078,95 @@ function writeAgentRestartFlag(codeName, reason, nowMs) {
|
|
|
21078
21078
|
return path;
|
|
21079
21079
|
}
|
|
21080
21080
|
|
|
21081
|
+
// src/self-restart-confirm.ts
|
|
21082
|
+
import { existsSync as existsSync3, readdirSync, readFileSync as readFileSync2 } from "fs";
|
|
21083
|
+
import { homedir as homedir2 } from "os";
|
|
21084
|
+
import { join as join2 } from "path";
|
|
21085
|
+
|
|
21086
|
+
// src/restart-confirm.ts
|
|
21087
|
+
import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync, renameSync as renameSync2, unlinkSync, writeFileSync as writeFileSync2 } from "fs";
|
|
21088
|
+
import { dirname } from "path";
|
|
21089
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
21090
|
+
var RESTART_CONFIRM_MAX_AGE_MS = 10 * 60 * 1e3;
|
|
21091
|
+
function writeRestartConfirmMarker(filePath, marker) {
|
|
21092
|
+
const dir = dirname(filePath);
|
|
21093
|
+
if (!existsSync2(dir)) mkdirSync2(dir, { recursive: true, mode: 448 });
|
|
21094
|
+
const tmpPath = `${filePath}.${process.pid}.${randomUUID2()}.tmp`;
|
|
21095
|
+
writeFileSync2(tmpPath, JSON.stringify(marker) + "\n", { encoding: "utf8", mode: 384 });
|
|
21096
|
+
renameSync2(tmpPath, filePath);
|
|
21097
|
+
}
|
|
21098
|
+
|
|
21099
|
+
// src/self-restart-confirm.ts
|
|
21100
|
+
var SELF_RESTART_PENDING_FRESHNESS_MS = 5 * 60 * 1e3;
|
|
21101
|
+
function selfRestartAgentDir(codeName) {
|
|
21102
|
+
return join2(homedir2(), ".augmented", codeName);
|
|
21103
|
+
}
|
|
21104
|
+
function selectFreshestPending(candidates, nowMs, maxAgeMs) {
|
|
21105
|
+
let best = null;
|
|
21106
|
+
for (const c of candidates) {
|
|
21107
|
+
if (!Number.isFinite(c.receivedAtMs)) continue;
|
|
21108
|
+
if (c.receivedAtMs > nowMs) continue;
|
|
21109
|
+
if (nowMs - c.receivedAtMs > maxAgeMs) continue;
|
|
21110
|
+
if (!best || c.receivedAtMs > best.receivedAtMs) best = c;
|
|
21111
|
+
}
|
|
21112
|
+
return best;
|
|
21113
|
+
}
|
|
21114
|
+
function readMarkerDir(dir, toCandidate) {
|
|
21115
|
+
if (!existsSync3(dir)) return [];
|
|
21116
|
+
const out = [];
|
|
21117
|
+
let entries;
|
|
21118
|
+
try {
|
|
21119
|
+
entries = readdirSync(dir);
|
|
21120
|
+
} catch {
|
|
21121
|
+
return [];
|
|
21122
|
+
}
|
|
21123
|
+
for (const entry of entries) {
|
|
21124
|
+
if (!entry.endsWith(".json") || entry.endsWith(".tmp")) continue;
|
|
21125
|
+
try {
|
|
21126
|
+
const parsed = JSON.parse(readFileSync2(join2(dir, entry), "utf8"));
|
|
21127
|
+
if (!parsed || typeof parsed !== "object") continue;
|
|
21128
|
+
const candidate = toCandidate(parsed);
|
|
21129
|
+
if (candidate) out.push(candidate);
|
|
21130
|
+
} catch {
|
|
21131
|
+
}
|
|
21132
|
+
}
|
|
21133
|
+
return out;
|
|
21134
|
+
}
|
|
21135
|
+
function readPendingCandidates(agentDir) {
|
|
21136
|
+
const slack = readMarkerDir(join2(agentDir, "slack-pending-inbound"), (p) => {
|
|
21137
|
+
const channel = p["channel"];
|
|
21138
|
+
if (typeof channel !== "string" || channel.length === 0) return null;
|
|
21139
|
+
const threadTs = p["thread_ts"];
|
|
21140
|
+
const reply = { channel };
|
|
21141
|
+
if (typeof threadTs === "string" && threadTs.length > 0) reply["thread_ts"] = threadTs;
|
|
21142
|
+
return { source: "slack", receivedAtMs: Date.parse(String(p["received_at"])), reply };
|
|
21143
|
+
});
|
|
21144
|
+
const telegram = readMarkerDir(join2(agentDir, "telegram-pending-inbound"), (p) => {
|
|
21145
|
+
const chatId = p["chat_id"];
|
|
21146
|
+
if (chatId == null || typeof chatId !== "string" && typeof chatId !== "number") return null;
|
|
21147
|
+
const reply = { chat_id: chatId };
|
|
21148
|
+
const messageId = p["message_id"];
|
|
21149
|
+
if (typeof messageId === "string" || typeof messageId === "number") reply["message_id"] = messageId;
|
|
21150
|
+
return { source: "telegram", receivedAtMs: Date.parse(String(p["received_at"])), reply };
|
|
21151
|
+
});
|
|
21152
|
+
return [...slack, ...telegram];
|
|
21153
|
+
}
|
|
21154
|
+
function captureSelfRestartConfirm(opts) {
|
|
21155
|
+
const maxAgeMs = opts.maxAgeMs ?? SELF_RESTART_PENDING_FRESHNESS_MS;
|
|
21156
|
+
const best = selectFreshestPending(readPendingCandidates(opts.agentDir), opts.nowMs, maxAgeMs);
|
|
21157
|
+
if (!best) return null;
|
|
21158
|
+
const marker = {
|
|
21159
|
+
source: best.source,
|
|
21160
|
+
requested_at: opts.nowMs,
|
|
21161
|
+
// No requester_name: a self-restart is agent-initiated, not asked by a named
|
|
21162
|
+
// human, so buildBackOnlineText degrades to the generic copy.
|
|
21163
|
+
reply: best.reply
|
|
21164
|
+
};
|
|
21165
|
+
const file = best.source === "slack" ? join2(opts.agentDir, "slack-restart-confirm.json") : join2(opts.agentDir, "telegram-restart-confirm.json");
|
|
21166
|
+
writeRestartConfirmMarker(file, marker);
|
|
21167
|
+
return best.source;
|
|
21168
|
+
}
|
|
21169
|
+
|
|
21081
21170
|
// src/feature-request.ts
|
|
21082
21171
|
var FEATURE_REQUEST_TYPES = [
|
|
21083
21172
|
"integration",
|
|
@@ -23174,6 +23263,10 @@ if (isSelfRestartEnabled(process.env) && AGT_AGENT_CODE_NAME) {
|
|
|
23174
23263
|
};
|
|
23175
23264
|
}
|
|
23176
23265
|
if (resp.mode === "local") {
|
|
23266
|
+
try {
|
|
23267
|
+
captureSelfRestartConfirm({ agentDir: selfRestartAgentDir(codeName), nowMs: Date.now() });
|
|
23268
|
+
} catch {
|
|
23269
|
+
}
|
|
23177
23270
|
try {
|
|
23178
23271
|
writeAgentRestartFlag(codeName, params.reason, Date.now());
|
|
23179
23272
|
} catch (err) {
|
|
@@ -23197,6 +23290,10 @@ if (isSelfRestartEnabled(process.env) && AGT_AGENT_CODE_NAME) {
|
|
|
23197
23290
|
};
|
|
23198
23291
|
}
|
|
23199
23292
|
if (resp.status === "auto_approved") {
|
|
23293
|
+
try {
|
|
23294
|
+
captureSelfRestartConfirm({ agentDir: selfRestartAgentDir(codeName), nowMs: Date.now() });
|
|
23295
|
+
} catch {
|
|
23296
|
+
}
|
|
23200
23297
|
return {
|
|
23201
23298
|
content: [
|
|
23202
23299
|
{
|
|
@@ -19033,7 +19033,12 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
19033
19033
|
description: "Array of Block Kit blocks. Supported block types: header, section, divider, context, actions. Supported interactive elements (inside actions blocks): button. Hard limits: 50 blocks per message, 5 elements per actions block, 3000 chars per section text, 75 chars per button label."
|
|
19034
19034
|
},
|
|
19035
19035
|
text: { type: "string", description: "Plain-text fallback for push notifications and unfurls. Required." },
|
|
19036
|
-
thread_ts: { type: "string", description: "Thread timestamp for
|
|
19036
|
+
thread_ts: { type: "string", description: "Thread timestamp for an existing thread reply (from the thread_ts attribute). Safe to omit: for a channel message the server automatically threads your reply off the message you are answering (via message_ts), and a DM reply posts inline." },
|
|
19037
|
+
// ENG-6763: mirror slack.reply — accept message_ts so a structured
|
|
19038
|
+
// reply to a channel @-mention threads deterministically off the
|
|
19039
|
+
// inbound even when the model omits thread_ts (the ENG-5861/ENG-6296
|
|
19040
|
+
// regression, previously only fixed on the plain-text reply path).
|
|
19041
|
+
message_ts: { type: "string", description: "The message_ts of the specific inbound this reply addresses (from the message_ts attribute on the <channel> tag). On a non-DM channel, lets the server thread the reply off that message when thread_ts is omitted." }
|
|
19037
19042
|
},
|
|
19038
19043
|
required: ["channel", "blocks", "text"]
|
|
19039
19044
|
}
|
|
@@ -19732,13 +19737,18 @@ async function handleSendStructured(args) {
|
|
|
19732
19737
|
}
|
|
19733
19738
|
const runtime = await Promise.resolve().then(() => (init_slack_block_kit_runtime(), slack_block_kit_runtime_exports));
|
|
19734
19739
|
const { validateSlackBlocks: validateSlackBlocks2 } = runtime;
|
|
19735
|
-
const { channel, blocks, text, thread_ts } = args;
|
|
19740
|
+
const { channel, blocks, text, thread_ts, message_ts } = args;
|
|
19736
19741
|
if (typeof channel !== "string" || !channel) {
|
|
19737
19742
|
return errResult("channel is required");
|
|
19738
19743
|
}
|
|
19739
19744
|
if (typeof text !== "string" || !text) {
|
|
19740
19745
|
return errResult("text is required (used as fallback for push notifications and unfurls)");
|
|
19741
19746
|
}
|
|
19747
|
+
const effectiveThreadTs = resolveReplyThreadTs({
|
|
19748
|
+
channel,
|
|
19749
|
+
threadTs: thread_ts,
|
|
19750
|
+
messageTs: message_ts
|
|
19751
|
+
});
|
|
19742
19752
|
const validation = validateSlackBlocks2(blocks);
|
|
19743
19753
|
if (!validation.ok) {
|
|
19744
19754
|
return errResult(`Invalid blocks: ${validation.errors.map((e) => `${e.path}: ${e.message}`).join("; ")}`);
|
|
@@ -19747,12 +19757,12 @@ async function handleSendStructured(args) {
|
|
|
19747
19757
|
channel,
|
|
19748
19758
|
blocks,
|
|
19749
19759
|
text,
|
|
19750
|
-
...
|
|
19760
|
+
...effectiveThreadTs ? { thread_ts: effectiveThreadTs } : {}
|
|
19751
19761
|
});
|
|
19752
19762
|
if (!result.ok || !result.ts) {
|
|
19753
19763
|
return errResult(`Slack chat.postMessage failed: ${result.error ?? "unknown"}`);
|
|
19754
19764
|
}
|
|
19755
|
-
if (
|
|
19765
|
+
if (effectiveThreadTs) clearPendingMessage(channel, effectiveThreadTs);
|
|
19756
19766
|
if (interactiveHostAvailable()) {
|
|
19757
19767
|
const cfg = {
|
|
19758
19768
|
apiHost: AGT_HOST,
|
|
@@ -19760,7 +19770,7 @@ async function handleSendStructured(args) {
|
|
|
19760
19770
|
agentId: AGT_AGENT_ID
|
|
19761
19771
|
};
|
|
19762
19772
|
const tsToRecord = result.ts;
|
|
19763
|
-
const threadTsToRecord =
|
|
19773
|
+
const threadTsToRecord = effectiveThreadTs;
|
|
19764
19774
|
void (async () => {
|
|
19765
19775
|
try {
|
|
19766
19776
|
await runtime.recordSlackDelivery(cfg, {
|
|
@@ -34,8 +34,8 @@ import {
|
|
|
34
34
|
writeDirectChatSessionState,
|
|
35
35
|
writeEgressAllowlist,
|
|
36
36
|
writePersistentClaudeWrapper
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-2WWCHEQT.js";
|
|
38
|
+
import "./chunk-QKA46UNQ.js";
|
|
39
39
|
import "./chunk-XWVM4KPK.js";
|
|
40
40
|
export {
|
|
41
41
|
EGRESS_BASELINE_DOMAINS,
|
|
@@ -74,4 +74,4 @@ export {
|
|
|
74
74
|
writeEgressAllowlist,
|
|
75
75
|
writePersistentClaudeWrapper
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=persistent-session-
|
|
77
|
+
//# sourceMappingURL=persistent-session-VQCCFN4M.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paneLogPath
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-2WWCHEQT.js";
|
|
4
|
+
import "./chunk-QKA46UNQ.js";
|
|
5
5
|
import "./chunk-XWVM4KPK.js";
|
|
6
6
|
|
|
7
7
|
// src/lib/responsiveness-probe.ts
|
|
@@ -304,4 +304,4 @@ export {
|
|
|
304
304
|
readAndResetChannelDeflections,
|
|
305
305
|
readAndResetChannelLaneClassifications
|
|
306
306
|
};
|
|
307
|
-
//# sourceMappingURL=responsiveness-probe-
|
|
307
|
+
//# sourceMappingURL=responsiveness-probe-FIXXJ7ZV.js.map
|