@integrity-labs/agt-cli 0.28.120 → 0.28.122
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-4GZLRVHO.js → chunk-HRE2TNEH.js} +11 -1
- package/dist/chunk-HRE2TNEH.js.map +1 -0
- package/dist/{chunk-NBMKBGZA.js → chunk-NNQKDZSC.js} +6 -4
- package/dist/chunk-NNQKDZSC.js.map +1 -0
- package/dist/{chunk-O3NKAOGE.js → chunk-YKLRH7ND.js} +3 -3
- package/dist/{claude-pair-runtime-IT2PZNJP.js → claude-pair-runtime-U53EWPTI.js} +2 -2
- package/dist/lib/manager-worker.js +8 -8
- package/dist/mcp/direct-chat-channel.js +111 -0
- package/dist/{persistent-session-A5A7YNLH.js → persistent-session-5J4AXHQH.js} +3 -3
- package/dist/{responsiveness-probe-ORKASAGP.js → responsiveness-probe-CLADKEMT.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-4GZLRVHO.js.map +0 -1
- package/dist/chunk-NBMKBGZA.js.map +0 -1
- /package/dist/{chunk-O3NKAOGE.js.map → chunk-YKLRH7ND.js.map} +0 -0
- /package/dist/{claude-pair-runtime-IT2PZNJP.js.map → claude-pair-runtime-U53EWPTI.js.map} +0 -0
- /package/dist/{persistent-session-A5A7YNLH.js.map → persistent-session-5J4AXHQH.js.map} +0 -0
- /package/dist/{responsiveness-probe-ORKASAGP.js.map → responsiveness-probe-CLADKEMT.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-5J4AXHQH.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-U53EWPTI.js.map
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
requireHost,
|
|
29
29
|
safeWriteJsonAtomic,
|
|
30
30
|
setConfigHash
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-YKLRH7ND.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-NNQKDZSC.js";
|
|
76
76
|
import {
|
|
77
77
|
FLAGS_SCHEMA_VERSION,
|
|
78
78
|
FLAG_REGISTRY,
|
|
@@ -108,7 +108,7 @@ import {
|
|
|
108
108
|
resolveDmTarget,
|
|
109
109
|
sumTranscriptUsageInWindow,
|
|
110
110
|
wrapScheduledTaskPrompt
|
|
111
|
-
} from "../chunk-
|
|
111
|
+
} from "../chunk-HRE2TNEH.js";
|
|
112
112
|
import {
|
|
113
113
|
parsePsRows,
|
|
114
114
|
reapOrphanChannelMcps
|
|
@@ -7000,7 +7000,7 @@ var cachedMaintenanceWindow = null;
|
|
|
7000
7000
|
var lastVersionCheckAt = 0;
|
|
7001
7001
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
7002
7002
|
var lastResponsivenessProbeAt = 0;
|
|
7003
|
-
var agtCliVersion = true ? "0.28.
|
|
7003
|
+
var agtCliVersion = true ? "0.28.122" : "dev";
|
|
7004
7004
|
function resolveBrewPath(execFileSync4) {
|
|
7005
7005
|
try {
|
|
7006
7006
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -8111,7 +8111,7 @@ async function pollCycle() {
|
|
|
8111
8111
|
}
|
|
8112
8112
|
try {
|
|
8113
8113
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
8114
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
8114
|
+
const { collectDiagnostics } = await import("../persistent-session-5J4AXHQH.js");
|
|
8115
8115
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
8116
8116
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
|
|
8117
8117
|
let tailscaleHostname;
|
|
@@ -8212,7 +8212,7 @@ async function pollCycle() {
|
|
|
8212
8212
|
const {
|
|
8213
8213
|
collectResponsivenessProbes,
|
|
8214
8214
|
getResponsivenessIntervalMs
|
|
8215
|
-
} = await import("../responsiveness-probe-
|
|
8215
|
+
} = await import("../responsiveness-probe-CLADKEMT.js");
|
|
8216
8216
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
8217
8217
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
8218
8218
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -8244,7 +8244,7 @@ async function pollCycle() {
|
|
|
8244
8244
|
collectResponsivenessProbes,
|
|
8245
8245
|
livePendingInboundOldestAgeSeconds,
|
|
8246
8246
|
parkPendingInbound
|
|
8247
|
-
} = await import("../responsiveness-probe-
|
|
8247
|
+
} = await import("../responsiveness-probe-CLADKEMT.js");
|
|
8248
8248
|
const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
|
|
8249
8249
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
8250
8250
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -11776,7 +11776,7 @@ async function processClaudePairSessions(agents) {
|
|
|
11776
11776
|
killPairSession,
|
|
11777
11777
|
pairTmuxSession,
|
|
11778
11778
|
finalizeClaudePairOnboarding
|
|
11779
|
-
} = await import("../claude-pair-runtime-
|
|
11779
|
+
} = await import("../claude-pair-runtime-U53EWPTI.js");
|
|
11780
11780
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
11781
11781
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
11782
11782
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
|
@@ -14197,6 +14197,43 @@ function resolveHostBooleanFlag(opts) {
|
|
|
14197
14197
|
return opts.defaultValue;
|
|
14198
14198
|
}
|
|
14199
14199
|
|
|
14200
|
+
// src/direct-chat-stream.ts
|
|
14201
|
+
var DEFAULT_STREAM_SLICE_CONFIG = {
|
|
14202
|
+
minContentLength: 120,
|
|
14203
|
+
targetSteps: 12,
|
|
14204
|
+
minStepChars: 24,
|
|
14205
|
+
maxSteps: 40
|
|
14206
|
+
};
|
|
14207
|
+
function computeStreamSlices(content, config2 = DEFAULT_STREAM_SLICE_CONFIG) {
|
|
14208
|
+
const len = content.length;
|
|
14209
|
+
if (len < config2.minContentLength) return [];
|
|
14210
|
+
const byTarget = Math.ceil(len / config2.targetSteps);
|
|
14211
|
+
const byMax = Math.ceil(len / config2.maxSteps);
|
|
14212
|
+
const stepSize = Math.max(config2.minStepChars, byTarget, byMax);
|
|
14213
|
+
const slices = [];
|
|
14214
|
+
let cursor = 0;
|
|
14215
|
+
while (cursor < len) {
|
|
14216
|
+
let next = Math.min(len, cursor + stepSize);
|
|
14217
|
+
if (next < len) {
|
|
14218
|
+
const space = content.indexOf(" ", next);
|
|
14219
|
+
const newline = content.indexOf("\n", next);
|
|
14220
|
+
const candidates = [space, newline].filter((i) => i !== -1);
|
|
14221
|
+
if (candidates.length > 0) {
|
|
14222
|
+
const breakAt = Math.min(...candidates);
|
|
14223
|
+
if (breakAt - next <= stepSize) next = breakAt;
|
|
14224
|
+
} else if (len - next < stepSize) {
|
|
14225
|
+
next = len;
|
|
14226
|
+
}
|
|
14227
|
+
}
|
|
14228
|
+
cursor = next;
|
|
14229
|
+
slices.push(content.slice(0, cursor));
|
|
14230
|
+
}
|
|
14231
|
+
if (slices.length === 0 || slices[slices.length - 1] !== content) {
|
|
14232
|
+
slices.push(content);
|
|
14233
|
+
}
|
|
14234
|
+
return slices;
|
|
14235
|
+
}
|
|
14236
|
+
|
|
14200
14237
|
// src/maintenance-mode.ts
|
|
14201
14238
|
var FLAG_KEY = "platform-maintenance-mode";
|
|
14202
14239
|
var MAINTENANCE_OFFLINE_MESSAGE = "The Augmented Team platform is offline for scheduled maintenance right now, so I can't pick this up \u2014 please try again shortly.";
|
|
@@ -14266,6 +14303,12 @@ async function getAuthToken() {
|
|
|
14266
14303
|
authExpiry = data.expires_at ? new Date(data.expires_at).getTime() - 12e4 : Date.now() + 55 * 6e4;
|
|
14267
14304
|
return authToken;
|
|
14268
14305
|
}
|
|
14306
|
+
var STREAM_REPLY_FLUSH_MS = (() => {
|
|
14307
|
+
const raw = process.env["AGT_DIRECT_CHAT_STREAM_FLUSH_MS"];
|
|
14308
|
+
const n = raw ? Number(raw) : NaN;
|
|
14309
|
+
return Number.isFinite(n) && n >= 0 ? n : 60;
|
|
14310
|
+
})();
|
|
14311
|
+
var sleep = (ms) => ms > 0 ? new Promise((resolve) => setTimeout(resolve, ms)) : Promise.resolve();
|
|
14269
14312
|
async function apiPost(path, body) {
|
|
14270
14313
|
const token = await getAuthToken();
|
|
14271
14314
|
const res = await fetchWithTimeout(`${AGT_HOST}${path}`, {
|
|
@@ -14291,6 +14334,21 @@ async function apiPost(path, body) {
|
|
|
14291
14334
|
}
|
|
14292
14335
|
return res;
|
|
14293
14336
|
}
|
|
14337
|
+
async function postDirectChatUpdate(messageId, sessionId, content) {
|
|
14338
|
+
try {
|
|
14339
|
+
const res = await apiPost("/host/direct-chat/update", {
|
|
14340
|
+
agent_id: AGT_AGENT_ID,
|
|
14341
|
+
session_id: sessionId,
|
|
14342
|
+
message_id: messageId,
|
|
14343
|
+
content
|
|
14344
|
+
});
|
|
14345
|
+
if (!res.ok) return false;
|
|
14346
|
+
const data = await res.json().catch(() => ({}));
|
|
14347
|
+
return data.error == null;
|
|
14348
|
+
} catch {
|
|
14349
|
+
return false;
|
|
14350
|
+
}
|
|
14351
|
+
}
|
|
14294
14352
|
var mcp = new Server(
|
|
14295
14353
|
{ name: "direct-chat", version: "0.1.0" },
|
|
14296
14354
|
{
|
|
@@ -14409,6 +14467,59 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
14409
14467
|
if (name === "direct_chat.reply") {
|
|
14410
14468
|
const { session_id, content } = args;
|
|
14411
14469
|
const message_ids = claimTracker.peek(session_id);
|
|
14470
|
+
const streamEnabled = resolveHostBooleanFlag({
|
|
14471
|
+
key: "direct-chat-stream-reply",
|
|
14472
|
+
envVar: "AGT_DIRECT_CHAT_STREAM_REPLY_ENABLED",
|
|
14473
|
+
defaultValue: false
|
|
14474
|
+
});
|
|
14475
|
+
const slices = streamEnabled ? computeStreamSlices(content) : [];
|
|
14476
|
+
if (slices.length > 0) {
|
|
14477
|
+
try {
|
|
14478
|
+
const res = await apiPost("/host/direct-chat/reply", {
|
|
14479
|
+
agent_id: AGT_AGENT_ID,
|
|
14480
|
+
session_id,
|
|
14481
|
+
content: slices[0],
|
|
14482
|
+
message_ids
|
|
14483
|
+
});
|
|
14484
|
+
const data = await res.json();
|
|
14485
|
+
if (!res.ok || data.error || !data.message_id) {
|
|
14486
|
+
return {
|
|
14487
|
+
content: [
|
|
14488
|
+
{ type: "text", text: `Reply failed: ${data.error ?? res.statusText}` }
|
|
14489
|
+
],
|
|
14490
|
+
isError: true
|
|
14491
|
+
};
|
|
14492
|
+
}
|
|
14493
|
+
claimTracker.clear(session_id, message_ids);
|
|
14494
|
+
const messageId = data.message_id;
|
|
14495
|
+
for (let i = 1; i < slices.length; i++) {
|
|
14496
|
+
await sleep(STREAM_REPLY_FLUSH_MS);
|
|
14497
|
+
const isFinal = i === slices.length - 1;
|
|
14498
|
+
let ok = await postDirectChatUpdate(messageId, session_id, slices[i]);
|
|
14499
|
+
if (!ok && isFinal) {
|
|
14500
|
+
await sleep(STREAM_REPLY_FLUSH_MS);
|
|
14501
|
+
ok = await postDirectChatUpdate(messageId, session_id, slices[i]);
|
|
14502
|
+
if (!ok) {
|
|
14503
|
+
return {
|
|
14504
|
+
content: [
|
|
14505
|
+
{
|
|
14506
|
+
type: "text",
|
|
14507
|
+
text: "sent, but the final streamed frame failed to persist; the visible reply may be truncated until the next reconciliation."
|
|
14508
|
+
}
|
|
14509
|
+
],
|
|
14510
|
+
isError: true
|
|
14511
|
+
};
|
|
14512
|
+
}
|
|
14513
|
+
}
|
|
14514
|
+
}
|
|
14515
|
+
return { content: [{ type: "text", text: "sent" }] };
|
|
14516
|
+
} catch (err) {
|
|
14517
|
+
return {
|
|
14518
|
+
content: [{ type: "text", text: `Failed: ${err.message}` }],
|
|
14519
|
+
isError: true
|
|
14520
|
+
};
|
|
14521
|
+
}
|
|
14522
|
+
}
|
|
14412
14523
|
try {
|
|
14413
14524
|
const res = await apiPost("/host/direct-chat/reply", {
|
|
14414
14525
|
agent_id: AGT_AGENT_ID,
|
|
@@ -34,8 +34,8 @@ import {
|
|
|
34
34
|
writeDirectChatSessionState,
|
|
35
35
|
writeEgressAllowlist,
|
|
36
36
|
writePersistentClaudeWrapper
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-NNQKDZSC.js";
|
|
38
|
+
import "./chunk-HRE2TNEH.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-5J4AXHQH.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paneLogPath
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-NNQKDZSC.js";
|
|
4
|
+
import "./chunk-HRE2TNEH.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-CLADKEMT.js.map
|