@integrity-labs/agt-cli 0.28.268 → 0.28.269
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-GBVZDTCB.js → chunk-JW6CWBNF.js} +14 -2
- package/dist/chunk-JW6CWBNF.js.map +1 -0
- package/dist/{chunk-PA3PWATY.js → chunk-ZH3CEX2A.js} +8 -4
- package/dist/{chunk-PA3PWATY.js.map → chunk-ZH3CEX2A.js.map} +1 -1
- package/dist/{claude-pair-runtime-CXIVEO6R.js → claude-pair-runtime-CXM2IH7U.js} +2 -2
- package/dist/lib/manager-worker.js +10 -10
- package/dist/mcp/remote-oauth-proxy.js +66 -0
- package/dist/{persistent-session-FGGXFAJH.js → persistent-session-ZQDTWV3D.js} +2 -2
- package/dist/{responsiveness-probe-2734PYS6.js → responsiveness-probe-74SDDDGN.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-GBVZDTCB.js.map +0 -1
- /package/dist/{claude-pair-runtime-CXIVEO6R.js.map → claude-pair-runtime-CXM2IH7U.js.map} +0 -0
- /package/dist/{persistent-session-FGGXFAJH.js.map → persistent-session-ZQDTWV3D.js.map} +0 -0
- /package/dist/{responsiveness-probe-2734PYS6.js.map → responsiveness-probe-74SDDDGN.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-ZQDTWV3D.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-CXM2IH7U.js.map
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
requireHost,
|
|
39
39
|
safeWriteJsonAtomic,
|
|
40
40
|
setConfigHash
|
|
41
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-ZH3CEX2A.js";
|
|
42
42
|
import {
|
|
43
43
|
getProjectDir as getProjectDir2,
|
|
44
44
|
getReadyTasks,
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
takeZombieDetection,
|
|
124
124
|
transcriptActivityAgeSeconds,
|
|
125
125
|
writeEgressAllowlist
|
|
126
|
-
} from "../chunk-
|
|
126
|
+
} from "../chunk-JW6CWBNF.js";
|
|
127
127
|
import {
|
|
128
128
|
reapOrphanChannelMcps
|
|
129
129
|
} from "../chunk-XWVM4KPK.js";
|
|
@@ -6700,7 +6700,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
6700
6700
|
var lastVersionCheckAt = 0;
|
|
6701
6701
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
6702
6702
|
var lastResponsivenessProbeAt = 0;
|
|
6703
|
-
var agtCliVersion = true ? "0.28.
|
|
6703
|
+
var agtCliVersion = true ? "0.28.269" : "dev";
|
|
6704
6704
|
function resolveBrewPath(execFileSync2) {
|
|
6705
6705
|
try {
|
|
6706
6706
|
const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -7550,7 +7550,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
|
|
|
7550
7550
|
if (codeNames.length === 0) return;
|
|
7551
7551
|
void (async () => {
|
|
7552
7552
|
try {
|
|
7553
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
7553
|
+
const { collectDiagnostics } = await import("../persistent-session-ZQDTWV3D.js");
|
|
7554
7554
|
await api.post("/host/heartbeat", {
|
|
7555
7555
|
host_id: hostId,
|
|
7556
7556
|
agent_diagnostics: collectDiagnostics(codeNames)
|
|
@@ -7648,7 +7648,7 @@ async function pollCycle() {
|
|
|
7648
7648
|
}
|
|
7649
7649
|
try {
|
|
7650
7650
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
7651
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
7651
|
+
const { collectDiagnostics } = await import("../persistent-session-ZQDTWV3D.js");
|
|
7652
7652
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
7653
7653
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
|
|
7654
7654
|
let tailscaleHostname;
|
|
@@ -7796,7 +7796,7 @@ async function pollCycle() {
|
|
|
7796
7796
|
const {
|
|
7797
7797
|
collectResponsivenessProbes,
|
|
7798
7798
|
getResponsivenessIntervalMs
|
|
7799
|
-
} = await import("../responsiveness-probe-
|
|
7799
|
+
} = await import("../responsiveness-probe-74SDDDGN.js");
|
|
7800
7800
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
7801
7801
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
7802
7802
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -7828,7 +7828,7 @@ async function pollCycle() {
|
|
|
7828
7828
|
collectResponsivenessProbes,
|
|
7829
7829
|
livePendingInboundOldestAgeSeconds,
|
|
7830
7830
|
parkPendingInbound
|
|
7831
|
-
} = await import("../responsiveness-probe-
|
|
7831
|
+
} = await import("../responsiveness-probe-74SDDDGN.js");
|
|
7832
7832
|
const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
|
|
7833
7833
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
7834
7834
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -10686,7 +10686,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
10686
10686
|
void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
|
|
10687
10687
|
void (async () => {
|
|
10688
10688
|
try {
|
|
10689
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
10689
|
+
const { collectDiagnostics } = await import("../persistent-session-ZQDTWV3D.js");
|
|
10690
10690
|
await api.post("/host/heartbeat", {
|
|
10691
10691
|
host_id: hostId,
|
|
10692
10692
|
agent_diagnostics: collectDiagnostics([codeName])
|
|
@@ -10736,7 +10736,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
|
|
|
10736
10736
|
}
|
|
10737
10737
|
try {
|
|
10738
10738
|
const hostId = await getHostId();
|
|
10739
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
10739
|
+
const { collectDiagnostics } = await import("../persistent-session-ZQDTWV3D.js");
|
|
10740
10740
|
await api.post("/host/heartbeat", {
|
|
10741
10741
|
host_id: hostId,
|
|
10742
10742
|
agent_diagnostics: collectDiagnostics([codeName])
|
|
@@ -11127,7 +11127,7 @@ async function processClaudePairSessions(agents) {
|
|
|
11127
11127
|
killPairSession,
|
|
11128
11128
|
pairTmuxSession,
|
|
11129
11129
|
finalizeClaudePairOnboarding
|
|
11130
|
-
} = await import("../claude-pair-runtime-
|
|
11130
|
+
} = await import("../claude-pair-runtime-CXM2IH7U.js");
|
|
11131
11131
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
11132
11132
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
11133
11133
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
|
@@ -11,16 +11,38 @@ var URL_ENV = "AGT_REMOTE_MCP_URL";
|
|
|
11
11
|
var TOKEN_FILE_ENV = "AGT_REMOTE_MCP_TOKEN_FILE";
|
|
12
12
|
var TOKEN_VAR_ENV = "AGT_REMOTE_MCP_TOKEN_VAR";
|
|
13
13
|
var ALLOWLIST_ENV = "AGT_REMOTE_MCP_TOOL_ALLOWLIST";
|
|
14
|
+
var PREENABLE_ENV = "AGT_REMOTE_MCP_PREENABLE_TOOLSETS";
|
|
14
15
|
var REMOTE_FETCH_TIMEOUT_MS = 3e4;
|
|
15
16
|
var remoteUrl = process.env[URL_ENV] ?? "";
|
|
16
17
|
var tokenFile = process.env[TOKEN_FILE_ENV] ?? "";
|
|
17
18
|
var tokenVar = process.env[TOKEN_VAR_ENV] ?? "";
|
|
18
19
|
var label = process.env["AGT_REMOTE_MCP_LABEL"] || tokenVar || "remote-oauth";
|
|
19
20
|
var toolAllowlist = parseToolAllowlist(process.env[ALLOWLIST_ENV] ?? "");
|
|
21
|
+
var preEnableToolsets = parsePreEnableToolsets(process.env[PREENABLE_ENV] ?? "");
|
|
20
22
|
function logErr(msg) {
|
|
21
23
|
process.stderr.write(`[remote-oauth-proxy:${label}] ${msg}
|
|
22
24
|
`);
|
|
23
25
|
}
|
|
26
|
+
function parsePreEnableToolsets(raw) {
|
|
27
|
+
const seen = /* @__PURE__ */ new Set();
|
|
28
|
+
const out = [];
|
|
29
|
+
for (const part of (raw || "").split(",")) {
|
|
30
|
+
const name = part.trim();
|
|
31
|
+
if (name && !seen.has(name)) {
|
|
32
|
+
seen.add(name);
|
|
33
|
+
out.push(name);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
function buildEnableToolsetRequest(toolset) {
|
|
39
|
+
return JSON.stringify({
|
|
40
|
+
jsonrpc: "2.0",
|
|
41
|
+
id: `agt-preenable-${toolset}`,
|
|
42
|
+
method: "tools/call",
|
|
43
|
+
params: { name: "enable_toolset", arguments: { name: toolset } }
|
|
44
|
+
});
|
|
45
|
+
}
|
|
24
46
|
function parseToolAllowlist(raw) {
|
|
25
47
|
const out = /* @__PURE__ */ new Set();
|
|
26
48
|
for (const part of (raw || "").split(",")) {
|
|
@@ -104,12 +126,54 @@ function extractJsonRpcMessages(contentType, body) {
|
|
|
104
126
|
}
|
|
105
127
|
return out;
|
|
106
128
|
}
|
|
129
|
+
var preEnabledOnce = null;
|
|
130
|
+
function ensurePreEnabled(token) {
|
|
131
|
+
if (preEnabledOnce) return preEnabledOnce;
|
|
132
|
+
preEnabledOnce = Promise.allSettled(
|
|
133
|
+
preEnableToolsets.map(async (name) => {
|
|
134
|
+
const res = await fetch(remoteUrl, {
|
|
135
|
+
method: "POST",
|
|
136
|
+
headers: {
|
|
137
|
+
"Content-Type": "application/json",
|
|
138
|
+
Accept: "application/json, text/event-stream",
|
|
139
|
+
Authorization: `Bearer ${token}`
|
|
140
|
+
},
|
|
141
|
+
body: buildEnableToolsetRequest(name),
|
|
142
|
+
signal: AbortSignal.timeout(REMOTE_FETCH_TIMEOUT_MS)
|
|
143
|
+
});
|
|
144
|
+
const body = await res.text().catch(() => "");
|
|
145
|
+
if (!res.ok) {
|
|
146
|
+
throw new Error(`HTTP ${res.status}${body ? ` (${body.slice(0, 200).replace(/\s+/g, " ").trim()})` : ""}`);
|
|
147
|
+
}
|
|
148
|
+
let rpcError;
|
|
149
|
+
try {
|
|
150
|
+
rpcError = JSON.parse(body)?.error?.message;
|
|
151
|
+
} catch {
|
|
152
|
+
}
|
|
153
|
+
if (rpcError) throw new Error(rpcError);
|
|
154
|
+
return name;
|
|
155
|
+
})
|
|
156
|
+
).then((results) => {
|
|
157
|
+
results.forEach((r, i) => {
|
|
158
|
+
const name = preEnableToolsets[i];
|
|
159
|
+
if (r.status === "fulfilled") {
|
|
160
|
+
logErr(`pre-enabled toolset "${name}"`);
|
|
161
|
+
} else {
|
|
162
|
+
logErr(`pre-enable toolset "${name}" failed: ${r.reason.message}`);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
return preEnabledOnce;
|
|
167
|
+
}
|
|
107
168
|
async function forward(line, id, isNotification, method) {
|
|
108
169
|
const token = readCurrentToken(tokenFile, tokenVar);
|
|
109
170
|
if (!token) {
|
|
110
171
|
logErr(`no token in ${tokenFile} (var ${tokenVar})`);
|
|
111
172
|
return isNotification ? [] : [jsonRpcError(id, -32e3, `${label}: no current access token available (reconnect the integration)`)];
|
|
112
173
|
}
|
|
174
|
+
if (method === "tools/list" && preEnableToolsets.length > 0) {
|
|
175
|
+
await ensurePreEnabled(token);
|
|
176
|
+
}
|
|
113
177
|
let res;
|
|
114
178
|
try {
|
|
115
179
|
res = await fetch(remoteUrl, {
|
|
@@ -224,10 +288,12 @@ if (invokedDirectly) {
|
|
|
224
288
|
void main();
|
|
225
289
|
}
|
|
226
290
|
export {
|
|
291
|
+
buildEnableToolsetRequest,
|
|
227
292
|
extractJsonRpcMessages,
|
|
228
293
|
filterToolsListMessage,
|
|
229
294
|
isToolCallBlocked,
|
|
230
295
|
main,
|
|
296
|
+
parsePreEnableToolsets,
|
|
231
297
|
parseToolAllowlist,
|
|
232
298
|
readCurrentToken
|
|
233
299
|
};
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
writeDirectChatSessionState,
|
|
37
37
|
writeEgressAllowlist,
|
|
38
38
|
writePersistentClaudeWrapper
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-JW6CWBNF.js";
|
|
40
40
|
import "./chunk-XWVM4KPK.js";
|
|
41
41
|
export {
|
|
42
42
|
EGRESS_BASELINE_DOMAINS,
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
writeEgressAllowlist,
|
|
78
78
|
writePersistentClaudeWrapper
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=persistent-session-
|
|
80
|
+
//# sourceMappingURL=persistent-session-ZQDTWV3D.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paneLogPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JW6CWBNF.js";
|
|
4
4
|
import "./chunk-XWVM4KPK.js";
|
|
5
5
|
|
|
6
6
|
// src/lib/responsiveness-probe.ts
|
|
@@ -418,4 +418,4 @@ export {
|
|
|
418
418
|
readAndResetSlackReplyBindingClassifications,
|
|
419
419
|
readAndResetSlackReplyTargetClassifications
|
|
420
420
|
};
|
|
421
|
-
//# sourceMappingURL=responsiveness-probe-
|
|
421
|
+
//# sourceMappingURL=responsiveness-probe-74SDDDGN.js.map
|