@integrity-labs/agt-cli 0.28.1250 → 0.28.1252
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/api-client-6A36YH3M.js +39 -0
- package/dist/bin/agt.js +17 -15
- package/dist/bin/agt.js.map +1 -1
- package/dist/{chunk-IUMFAYZO.js → chunk-3HRBU4H6.js} +3 -3
- package/dist/{chunk-SMD577FW.js → chunk-4VOQ6D7X.js} +2 -2
- package/dist/chunk-5ZNYCNMI.js +471 -0
- package/dist/chunk-5ZNYCNMI.js.map +1 -0
- package/dist/{chunk-DFJ5E5EW.js → chunk-RUKGOBVA.js} +214 -1
- package/dist/chunk-RUKGOBVA.js.map +1 -0
- package/dist/{chunk-5ALBA7KT.js → chunk-S3DUSCWR.js} +94 -552
- package/dist/chunk-S3DUSCWR.js.map +1 -0
- package/dist/{chunk-JOBL3ZF4.js → chunk-XTFVVZIR.js} +2 -2
- package/dist/{claude-code-updater-5MPOBIWN.js → claude-code-updater-WSQTK6TQ.js} +3 -3
- package/dist/{claude-pair-runtime-SNU3CU3K.js → claude-pair-runtime-WWF5BCK3.js} +3 -3
- package/dist/lib/manager-worker.js +172 -61
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +92 -4
- package/dist/mcp/index.js +27 -0
- package/dist/mcp/origami.js +27 -0
- package/dist/mcp/slack-channel.js +27 -0
- package/dist/mcp/telegram-channel.js +389 -186
- package/dist/{persistent-session-SYCA6MW2.js → persistent-session-HS33PGZZ.js} +4 -4
- package/dist/persistent-session-HS33PGZZ.js.map +1 -0
- package/dist/{responsiveness-probe-BUXWVOSA.js → responsiveness-probe-32AWSVSL.js} +4 -4
- package/dist/{session-auth-dead-G5NHWSRP.js → session-auth-dead-2L2NLMMB.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-5ALBA7KT.js.map +0 -1
- package/dist/chunk-DFJ5E5EW.js.map +0 -1
- /package/dist/{claude-code-updater-5MPOBIWN.js.map → api-client-6A36YH3M.js.map} +0 -0
- /package/dist/{chunk-IUMFAYZO.js.map → chunk-3HRBU4H6.js.map} +0 -0
- /package/dist/{chunk-SMD577FW.js.map → chunk-4VOQ6D7X.js.map} +0 -0
- /package/dist/{chunk-JOBL3ZF4.js.map → chunk-XTFVVZIR.js.map} +0 -0
- /package/dist/{persistent-session-SYCA6MW2.js.map → claude-code-updater-WSQTK6TQ.js.map} +0 -0
- /package/dist/{claude-pair-runtime-SNU3CU3K.js.map → claude-pair-runtime-WWF5BCK3.js.map} +0 -0
- /package/dist/{responsiveness-probe-BUXWVOSA.js.map → responsiveness-probe-32AWSVSL.js.map} +0 -0
- /package/dist/{session-auth-dead-G5NHWSRP.js.map → session-auth-dead-2L2NLMMB.js.map} +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-XWVM4KPK.js";
|
|
5
5
|
import {
|
|
6
6
|
FORCED_UPDATE_HARD_DEADLINE_MS
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RUKGOBVA.js";
|
|
8
8
|
import {
|
|
9
9
|
effectiveClaudeJsonPath
|
|
10
10
|
} from "./chunk-AIUIMEUS.js";
|
|
@@ -722,4 +722,4 @@ export {
|
|
|
722
722
|
probeClaudeInstalls,
|
|
723
723
|
maybeUpdateClaudeCode
|
|
724
724
|
};
|
|
725
|
-
//# sourceMappingURL=chunk-
|
|
725
|
+
//# sourceMappingURL=chunk-XTFVVZIR.js.map
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
probeClaudeInstalls,
|
|
14
14
|
readsAsNativeInstall,
|
|
15
15
|
shouldRunClaudeCodeUpdater
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XTFVVZIR.js";
|
|
17
17
|
import "./chunk-XWVM4KPK.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-RUKGOBVA.js";
|
|
19
19
|
import "./chunk-AIUIMEUS.js";
|
|
20
20
|
import "./chunk-DGUM43GV.js";
|
|
21
21
|
export {
|
|
@@ -34,4 +34,4 @@ export {
|
|
|
34
34
|
readsAsNativeInstall,
|
|
35
35
|
shouldRunClaudeCodeUpdater
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=claude-code-updater-
|
|
37
|
+
//# sourceMappingURL=claude-code-updater-WSQTK6TQ.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
redactPaneFrame,
|
|
10
10
|
sanitizeTerminalFrame
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RUKGOBVA.js";
|
|
12
12
|
import {
|
|
13
13
|
CLAUDE_CONFIG_DIR_ENV,
|
|
14
14
|
claudeConfigDirFor,
|
|
@@ -321,7 +321,7 @@ async function spawnPairSession(session) {
|
|
|
321
321
|
return { ok: true };
|
|
322
322
|
} catch {
|
|
323
323
|
}
|
|
324
|
-
const { resolveClaudeBinary } = await import("./persistent-session-
|
|
324
|
+
const { resolveClaudeBinary } = await import("./persistent-session-HS33PGZZ.js");
|
|
325
325
|
const claudeBin = resolveClaudeBinary();
|
|
326
326
|
const pairEnv = {
|
|
327
327
|
...process.env,
|
|
@@ -836,4 +836,4 @@ export {
|
|
|
836
836
|
startClaudePair,
|
|
837
837
|
submitClaudePairCode
|
|
838
838
|
};
|
|
839
|
-
//# sourceMappingURL=claude-pair-runtime-
|
|
839
|
+
//# sourceMappingURL=claude-pair-runtime-WWF5BCK3.js.map
|
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
hostClaudeOneShotArgs
|
|
3
3
|
} from "../chunk-MM3OF6UT.js";
|
|
4
4
|
import {
|
|
5
|
-
ApiError,
|
|
6
5
|
COMPUTER_USE_MCP_KEY,
|
|
7
6
|
DEAD_CHANNEL_MS,
|
|
8
7
|
FIRST_CONNECT_WINDOW_MS,
|
|
@@ -11,8 +10,6 @@ import {
|
|
|
11
10
|
RestartBreaker,
|
|
12
11
|
SUPERVISOR_RESTART_EXIT_CODE,
|
|
13
12
|
TunnelWatcher,
|
|
14
|
-
adoptHostKeyInProcess,
|
|
15
|
-
api,
|
|
16
13
|
atomicWriteFileSync,
|
|
17
14
|
buildClaudeAgentMatcher,
|
|
18
15
|
buildConnectivityProbeDeps,
|
|
@@ -31,33 +28,22 @@ import {
|
|
|
31
28
|
diffEnvIntegrations,
|
|
32
29
|
drainTranscriptFlushDeps,
|
|
33
30
|
envOnlyRespawnVars,
|
|
34
|
-
exchangeApiKey,
|
|
35
|
-
exchangeFailureKind,
|
|
36
31
|
executeConnectivityProbe,
|
|
37
32
|
extractCommandNotFound,
|
|
38
33
|
findMcpServersUsingVars,
|
|
39
34
|
flushAgentTranscriptsOnDrain,
|
|
40
|
-
forceNextExchange,
|
|
41
35
|
gatherSessionToolBindProbe,
|
|
42
|
-
getApiKey,
|
|
43
|
-
getCachedClaudeAuthMode,
|
|
44
|
-
getCachedClaudeAuthModeRaw,
|
|
45
|
-
getHostId,
|
|
46
36
|
givenUpMcpServerKeys,
|
|
47
37
|
guardrailsForProvision,
|
|
48
38
|
isIntegrationBucketedReason,
|
|
49
39
|
isProvisioningReloadReason,
|
|
50
|
-
isTransientAuthFailure,
|
|
51
40
|
isWithinReconnectQuiesceWindow,
|
|
52
41
|
liveProxyExtraHeaderVars,
|
|
53
42
|
liveProxyTokenVars,
|
|
54
43
|
markQuarantinedForProbe,
|
|
55
44
|
migrateAgentDirToIdKeyed,
|
|
56
|
-
mintAgentKey,
|
|
57
|
-
mintRotatedHostKey,
|
|
58
45
|
parseRmPolicy,
|
|
59
46
|
pinAllowsUrgent,
|
|
60
|
-
probeHostKey,
|
|
61
47
|
provision,
|
|
62
48
|
provisionAutoKanbanProgressHook,
|
|
63
49
|
provisionChannelProgressHook,
|
|
@@ -77,42 +63,31 @@ import {
|
|
|
77
63
|
reaperRestartBreakerReason,
|
|
78
64
|
reconstructQuarantinedMcpServerEntry,
|
|
79
65
|
redactKnownValues,
|
|
80
|
-
requireHost,
|
|
81
66
|
resolveEffectivePinRaw,
|
|
82
67
|
safeWriteJsonAtomic,
|
|
83
|
-
setConfigHash,
|
|
84
68
|
shellGuard,
|
|
85
69
|
tripClass,
|
|
86
70
|
writeEtcEnvironment,
|
|
87
71
|
writeProfileDScript
|
|
88
|
-
} from "../chunk-
|
|
89
|
-
import {
|
|
90
|
-
CLAUDE_CODE_SECURITY_FLOOR,
|
|
91
|
-
SELF_UPDATE_TIMEOUTS,
|
|
92
|
-
anyPackageInstallRunning,
|
|
93
|
-
compareVersions,
|
|
94
|
-
effectiveSecurityFloor,
|
|
95
|
-
ensureDiskForSelfUpdate,
|
|
96
|
-
maybeRunDiskGuard,
|
|
97
|
-
readDiskStat,
|
|
98
|
-
rearmForcedDiskHoldAnnounce,
|
|
99
|
-
runSafeCleanup,
|
|
100
|
-
tightestDiskStat,
|
|
101
|
-
withPackageCacheLock
|
|
102
|
-
} from "../chunk-JOBL3ZF4.js";
|
|
103
|
-
import {
|
|
104
|
-
rewriteSupervisorApiKey,
|
|
105
|
-
supervisorChannelsRefusing
|
|
106
|
-
} from "../chunk-H3JMPEH7.js";
|
|
72
|
+
} from "../chunk-S3DUSCWR.js";
|
|
107
73
|
import {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
74
|
+
ApiError,
|
|
75
|
+
adoptHostKeyInProcess,
|
|
76
|
+
api,
|
|
77
|
+
exchangeApiKey,
|
|
78
|
+
exchangeFailureKind,
|
|
79
|
+
forceNextExchange,
|
|
80
|
+
getApiKey,
|
|
81
|
+
getCachedClaudeAuthMode,
|
|
82
|
+
getCachedClaudeAuthModeRaw,
|
|
83
|
+
getHostId,
|
|
84
|
+
isTransientAuthFailure,
|
|
85
|
+
mintAgentKey,
|
|
86
|
+
mintRotatedHostKey,
|
|
87
|
+
probeHostKey,
|
|
88
|
+
requireHost,
|
|
89
|
+
setConfigHash
|
|
90
|
+
} from "../chunk-5ZNYCNMI.js";
|
|
116
91
|
import {
|
|
117
92
|
BLOCKED_ON_PROMPT_DECISION,
|
|
118
93
|
CHANNEL_SECRET_ENV_KEYS,
|
|
@@ -196,7 +171,7 @@ import {
|
|
|
196
171
|
webFetchBaselineValue,
|
|
197
172
|
webFetchRestartNeeded,
|
|
198
173
|
writeEgressAllowlist
|
|
199
|
-
} from "../chunk-
|
|
174
|
+
} from "../chunk-3HRBU4H6.js";
|
|
200
175
|
import {
|
|
201
176
|
isAgentIdle,
|
|
202
177
|
isStaleForToday,
|
|
@@ -207,7 +182,7 @@ import {
|
|
|
207
182
|
subagentActivityAgeSeconds,
|
|
208
183
|
subagentTranscriptDir,
|
|
209
184
|
transcriptActivityAgeSeconds
|
|
210
|
-
} from "../chunk-
|
|
185
|
+
} from "../chunk-4VOQ6D7X.js";
|
|
211
186
|
import {
|
|
212
187
|
classifyUnanswerablePane,
|
|
213
188
|
focusedConfirmDialogBlock,
|
|
@@ -218,6 +193,20 @@ import {
|
|
|
218
193
|
simpleTextHash
|
|
219
194
|
} from "../chunk-HYQ7VOC3.js";
|
|
220
195
|
import "../chunk-6HBXEJHO.js";
|
|
196
|
+
import {
|
|
197
|
+
CLAUDE_CODE_SECURITY_FLOOR,
|
|
198
|
+
SELF_UPDATE_TIMEOUTS,
|
|
199
|
+
anyPackageInstallRunning,
|
|
200
|
+
compareVersions,
|
|
201
|
+
effectiveSecurityFloor,
|
|
202
|
+
ensureDiskForSelfUpdate,
|
|
203
|
+
maybeRunDiskGuard,
|
|
204
|
+
readDiskStat,
|
|
205
|
+
rearmForcedDiskHoldAnnounce,
|
|
206
|
+
runSafeCleanup,
|
|
207
|
+
tightestDiskStat,
|
|
208
|
+
withPackageCacheLock
|
|
209
|
+
} from "../chunk-XTFVVZIR.js";
|
|
221
210
|
import {
|
|
222
211
|
parsePsRows,
|
|
223
212
|
reapOrphanChannelMcps
|
|
@@ -239,6 +228,7 @@ import {
|
|
|
239
228
|
FLAG_REGISTRY,
|
|
240
229
|
FORCED_UPDATE_HARD_DEADLINE_MS,
|
|
241
230
|
FORCED_UPDATE_RELAX_AFTER_MS,
|
|
231
|
+
GROUP_CLAIMED_REPLY,
|
|
242
232
|
HITL_TIER_ORDER,
|
|
243
233
|
HOST_KEY_ROTATION_RETRY_MS,
|
|
244
234
|
HOST_USAGE_POLL_INTERVAL_MS,
|
|
@@ -260,12 +250,14 @@ import {
|
|
|
260
250
|
agentRulesRestartBasis,
|
|
261
251
|
analyzeFailingTurnRun,
|
|
262
252
|
appendDmFooter,
|
|
253
|
+
applyMigrationToAllowlist,
|
|
263
254
|
attributeTranscriptUsageByRun,
|
|
264
255
|
bannerRemedyFor,
|
|
265
256
|
buildFailureCategoryPromptLines,
|
|
266
257
|
buildHostUsageReading,
|
|
267
258
|
buildScheduledTaskContextBlocks,
|
|
268
259
|
buildSlackThirdPartyBotsEnvValue,
|
|
260
|
+
claimTelegramGroupLinkCode,
|
|
269
261
|
classifyActor,
|
|
270
262
|
classifyCursorAdvance,
|
|
271
263
|
classifyOutput,
|
|
@@ -275,6 +267,7 @@ import {
|
|
|
275
267
|
claudeHostModelFromCandidate,
|
|
276
268
|
claudeModelOption,
|
|
277
269
|
coerceOnboardingState,
|
|
270
|
+
createMigrationReportQueue,
|
|
278
271
|
cursorAdvanceCounterKey,
|
|
279
272
|
decideInboundAccess,
|
|
280
273
|
describeOnboardingChannel,
|
|
@@ -316,6 +309,7 @@ import {
|
|
|
316
309
|
pairToolCallBrackets,
|
|
317
310
|
parseDeliverAssertion,
|
|
318
311
|
parseDeliveryTarget,
|
|
312
|
+
parseTelegramGroupLinkStart,
|
|
319
313
|
parseTranscriptUsage,
|
|
320
314
|
parseUsageBanner,
|
|
321
315
|
parseUsageReport,
|
|
@@ -323,6 +317,7 @@ import {
|
|
|
323
317
|
recordBackgroundTaskLine,
|
|
324
318
|
redactPaneFrame,
|
|
325
319
|
remoteMcpServerKey,
|
|
320
|
+
reportTelegramGroupMigrationOutcome,
|
|
326
321
|
resolveAgentTimezone,
|
|
327
322
|
resolveAvatarEnvUrl,
|
|
328
323
|
resolveChannels,
|
|
@@ -338,7 +333,7 @@ import {
|
|
|
338
333
|
stabiliseResetInstant,
|
|
339
334
|
sumTranscriptUsageInWindow,
|
|
340
335
|
summarizeTranscriptActivity
|
|
341
|
-
} from "../chunk-
|
|
336
|
+
} from "../chunk-RUKGOBVA.js";
|
|
342
337
|
import {
|
|
343
338
|
CLAUDE_CONFIG_DIR_ENV,
|
|
344
339
|
claudeConfigDirFor,
|
|
@@ -346,6 +341,19 @@ import {
|
|
|
346
341
|
effectiveClaudeJsonPath,
|
|
347
342
|
seedClaudeConfigFromLegacy
|
|
348
343
|
} from "../chunk-AIUIMEUS.js";
|
|
344
|
+
import {
|
|
345
|
+
rewriteSupervisorApiKey,
|
|
346
|
+
supervisorChannelsRefusing
|
|
347
|
+
} from "../chunk-H3JMPEH7.js";
|
|
348
|
+
import {
|
|
349
|
+
catchUpNote,
|
|
350
|
+
describeCatchUp,
|
|
351
|
+
getProjectDir as getProjectDir2,
|
|
352
|
+
getReadyTasks,
|
|
353
|
+
loadSchedulerState,
|
|
354
|
+
markTaskFired,
|
|
355
|
+
syncTasksToScheduler
|
|
356
|
+
} from "../chunk-FIGZJ6AU.js";
|
|
349
357
|
import "../chunk-DGUM43GV.js";
|
|
350
358
|
|
|
351
359
|
// src/lib/manager-restart-gate.ts
|
|
@@ -13776,9 +13784,46 @@ var BoundedSet2 = class {
|
|
|
13776
13784
|
async function dispatchTelegramInbound(update, ctx) {
|
|
13777
13785
|
const msg = update.message;
|
|
13778
13786
|
const chatId = String(msg.chat.id);
|
|
13787
|
+
if (typeof msg.migrate_to_chat_id === "number") {
|
|
13788
|
+
const toChatId = String(msg.migrate_to_chat_id);
|
|
13789
|
+
const admittedNow = applyMigrationToAllowlist(ctx.allowedChats, chatId, toChatId);
|
|
13790
|
+
let reported = "none";
|
|
13791
|
+
if (ctx.migrationReports) {
|
|
13792
|
+
ctx.migrationReports.enqueue(chatId, toChatId);
|
|
13793
|
+
const outcomes = await ctx.migrationReports.flushDue();
|
|
13794
|
+
reported = outcomes.get(`${chatId}->${toChatId}`) ?? "retry";
|
|
13795
|
+
}
|
|
13796
|
+
ctx.log(
|
|
13797
|
+
`[telegram-ingest:${ctx.codeName}] group migrated ${redactId(chatId)} -> ${redactId(toChatId)} admitted_now=${admittedNow} reported=${reported}`
|
|
13798
|
+
);
|
|
13799
|
+
return "migrated";
|
|
13800
|
+
}
|
|
13779
13801
|
const dedupKey = String(update.update_id);
|
|
13780
13802
|
if (ctx.seen.has(dedupKey)) return "dropped_duplicate";
|
|
13781
13803
|
ctx.seen.add(dedupKey);
|
|
13804
|
+
const groupCode = ctx.claimGroupCode ? parseTelegramGroupLinkStart({ chatType: msg.chat.type, isBot: msg.from?.is_bot, text: msg.text }) : null;
|
|
13805
|
+
if (groupCode && ctx.claimGroupCode) {
|
|
13806
|
+
let claimed = false;
|
|
13807
|
+
try {
|
|
13808
|
+
claimed = await ctx.claimGroupCode({
|
|
13809
|
+
code: groupCode,
|
|
13810
|
+
chatId,
|
|
13811
|
+
chatType: msg.chat.type,
|
|
13812
|
+
...msg.chat.title ? { chatTitle: msg.chat.title } : {},
|
|
13813
|
+
...msg.from ? { fromId: String(msg.from.id) } : {},
|
|
13814
|
+
...msg.from?.first_name ? { firstName: msg.from.first_name } : {},
|
|
13815
|
+
...msg.from?.last_name ? { lastName: msg.from.last_name } : {}
|
|
13816
|
+
});
|
|
13817
|
+
} catch {
|
|
13818
|
+
claimed = false;
|
|
13819
|
+
}
|
|
13820
|
+
if (claimed) {
|
|
13821
|
+
ctx.log(`[telegram-ingest:${ctx.codeName}] group-link claimed chat=${redactId(chatId)}`);
|
|
13822
|
+
await ctx.sendReply({ chatId, text: GROUP_CLAIMED_REPLY });
|
|
13823
|
+
return "group_claimed";
|
|
13824
|
+
}
|
|
13825
|
+
ctx.log(`[telegram-ingest:${ctx.codeName}] group-link not claimed chat=${redactId(chatId)}, falling through`);
|
|
13826
|
+
}
|
|
13782
13827
|
const decision = evaluateTelegramInboundGate(msg, {
|
|
13783
13828
|
allowedChats: ctx.allowedChats,
|
|
13784
13829
|
peerConfig: ctx.peerConfig,
|
|
@@ -13906,13 +13951,17 @@ function startTelegramIngest(config2) {
|
|
|
13906
13951
|
...config2.ackReaction ? { ackReaction: config2.ackReaction } : {},
|
|
13907
13952
|
...config2.skipReaction ? { skipReaction: config2.skipReaction } : {},
|
|
13908
13953
|
log: config2.log,
|
|
13909
|
-
seen
|
|
13954
|
+
seen,
|
|
13955
|
+
...config2.claimGroupCode ? { claimGroupCode: config2.claimGroupCode } : {},
|
|
13956
|
+
...config2.migrationReports ? { migrationReports: config2.migrationReports } : {}
|
|
13910
13957
|
};
|
|
13911
13958
|
let stopped = false;
|
|
13912
13959
|
let controller = null;
|
|
13913
13960
|
let nextOffset = offsetStore.load();
|
|
13914
13961
|
const pollLoop = async () => {
|
|
13915
13962
|
while (!stopped) {
|
|
13963
|
+
if (config2.migrationReports) await config2.migrationReports.flushDue();
|
|
13964
|
+
if (stopped) return;
|
|
13916
13965
|
try {
|
|
13917
13966
|
controller = new AbortController();
|
|
13918
13967
|
const timeout = AbortSignal.timeout(POLL_HTTP_TIMEOUT_MS);
|
|
@@ -13980,6 +14029,7 @@ function anySignal(signals) {
|
|
|
13980
14029
|
|
|
13981
14030
|
// src/lib/opencode-telegram-ingest.ts
|
|
13982
14031
|
var ingests2 = /* @__PURE__ */ new Map();
|
|
14032
|
+
var migrationQueues = /* @__PURE__ */ new Map();
|
|
13983
14033
|
function fingerprint2(params) {
|
|
13984
14034
|
return createHash19("sha256").update(
|
|
13985
14035
|
JSON.stringify({
|
|
@@ -14052,6 +14102,46 @@ function createFileOffsetStore(codeName, log2, currentBotId) {
|
|
|
14052
14102
|
}
|
|
14053
14103
|
};
|
|
14054
14104
|
}
|
|
14105
|
+
function createFileMigrationReportIO(codeName, log2) {
|
|
14106
|
+
let dir;
|
|
14107
|
+
let filePath;
|
|
14108
|
+
try {
|
|
14109
|
+
dir = getFramework("opencode").getAgentDir(codeName);
|
|
14110
|
+
filePath = join41(dir, "telegram-migration-reports-opencode.json");
|
|
14111
|
+
} catch {
|
|
14112
|
+
dir = null;
|
|
14113
|
+
filePath = null;
|
|
14114
|
+
}
|
|
14115
|
+
return {
|
|
14116
|
+
load() {
|
|
14117
|
+
if (!filePath) return null;
|
|
14118
|
+
try {
|
|
14119
|
+
return readFileSync32(filePath, "utf-8");
|
|
14120
|
+
} catch {
|
|
14121
|
+
return null;
|
|
14122
|
+
}
|
|
14123
|
+
},
|
|
14124
|
+
save(data) {
|
|
14125
|
+
if (!filePath || !dir) return;
|
|
14126
|
+
try {
|
|
14127
|
+
mkdirSync13(dir, { recursive: true, mode: 448 });
|
|
14128
|
+
atomicWriteFileSync(filePath, data, { mode: 384 });
|
|
14129
|
+
} catch (err) {
|
|
14130
|
+
log2(`[telegram-ingest:${codeName}] migration-report persist failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
14131
|
+
}
|
|
14132
|
+
}
|
|
14133
|
+
};
|
|
14134
|
+
}
|
|
14135
|
+
var managerHostPost = async (path, body) => {
|
|
14136
|
+
const { api: api2, ApiError: ApiError3 } = await import("../api-client-6A36YH3M.js");
|
|
14137
|
+
try {
|
|
14138
|
+
const json = await api2.post(path, body);
|
|
14139
|
+
return { status: 200, json };
|
|
14140
|
+
} catch (err) {
|
|
14141
|
+
if (err instanceof ApiError3) return { status: err.status, json: err.body };
|
|
14142
|
+
throw err;
|
|
14143
|
+
}
|
|
14144
|
+
};
|
|
14055
14145
|
async function ensureOpencodeTelegramIngest(opts) {
|
|
14056
14146
|
const { codeName, agentId, log: log2 } = opts;
|
|
14057
14147
|
const readEnv = opts.readEnv ?? readChannelServerEnv;
|
|
@@ -14092,9 +14182,30 @@ async function ensureOpencodeTelegramIngest(opts) {
|
|
|
14092
14182
|
existing.key === key ? `[telegram-ingest:${codeName}] bot identity resolved; restarting ingest` : `[telegram-ingest:${codeName}] config changed; restarting ingest`
|
|
14093
14183
|
);
|
|
14094
14184
|
}
|
|
14185
|
+
const hostPost = opts.hostPost ?? managerHostPost;
|
|
14186
|
+
let queued = migrationQueues.get(codeName);
|
|
14187
|
+
if (!queued || queued.io !== opts.migrationReportIO) {
|
|
14188
|
+
const target = { hostPost, agentId };
|
|
14189
|
+
queued = {
|
|
14190
|
+
io: opts.migrationReportIO,
|
|
14191
|
+
target,
|
|
14192
|
+
queue: createMigrationReportQueue({
|
|
14193
|
+
io: opts.migrationReportIO ?? createFileMigrationReportIO(codeName, log2),
|
|
14194
|
+
report: (fromChatId, toChatId) => reportTelegramGroupMigrationOutcome(target.hostPost, { agentId: target.agentId, fromChatId, toChatId }),
|
|
14195
|
+
log: (m) => log2(`[telegram-ingest:${codeName}] ${m}`)
|
|
14196
|
+
})
|
|
14197
|
+
};
|
|
14198
|
+
migrationQueues.set(codeName, queued);
|
|
14199
|
+
} else {
|
|
14200
|
+
queued.target.hostPost = hostPost;
|
|
14201
|
+
queued.target.agentId = agentId;
|
|
14202
|
+
}
|
|
14203
|
+
const migrationReports = queued.queue;
|
|
14095
14204
|
const handle = startTelegramIngest({
|
|
14096
14205
|
codeName,
|
|
14097
14206
|
agentId,
|
|
14207
|
+
claimGroupCode: (input) => claimTelegramGroupLinkCode(hostPost, { ...input, agentId }),
|
|
14208
|
+
migrationReports,
|
|
14098
14209
|
botToken: params.botToken,
|
|
14099
14210
|
allowedChats: params.allowedChats,
|
|
14100
14211
|
peerConfig: params.peerConfig,
|
|
@@ -16061,7 +16172,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
|
|
|
16061
16172
|
var dayRolloverInboundHold = /* @__PURE__ */ new Map();
|
|
16062
16173
|
var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
|
|
16063
16174
|
async function channelInboundActivityAgeSecondsFor(codeName) {
|
|
16064
|
-
const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-
|
|
16175
|
+
const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-32AWSVSL.js");
|
|
16065
16176
|
const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
|
|
16066
16177
|
if (newest === null) return null;
|
|
16067
16178
|
return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
|
|
@@ -16877,7 +16988,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
16877
16988
|
var lastVersionCheckAt = 0;
|
|
16878
16989
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
16879
16990
|
var lastResponsivenessProbeAt = 0;
|
|
16880
|
-
var agtCliVersion = true ? "0.28.
|
|
16991
|
+
var agtCliVersion = true ? "0.28.1252" : "dev";
|
|
16881
16992
|
function resolveBrewPath(execFileSync4) {
|
|
16882
16993
|
try {
|
|
16883
16994
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -18876,7 +18987,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
|
|
|
18876
18987
|
if (codeNames.length === 0) return;
|
|
18877
18988
|
void (async () => {
|
|
18878
18989
|
try {
|
|
18879
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
18990
|
+
const { collectDiagnostics } = await import("../persistent-session-HS33PGZZ.js");
|
|
18880
18991
|
await api.post("/host/heartbeat", {
|
|
18881
18992
|
host_id: hostId,
|
|
18882
18993
|
agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
|
|
@@ -19019,7 +19130,7 @@ async function pollCycleInner() {
|
|
|
19019
19130
|
}
|
|
19020
19131
|
try {
|
|
19021
19132
|
const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
|
|
19022
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
19133
|
+
const { collectDiagnostics } = await import("../persistent-session-HS33PGZZ.js");
|
|
19023
19134
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
19024
19135
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor) : void 0;
|
|
19025
19136
|
let tailscaleHostname;
|
|
@@ -19284,7 +19395,7 @@ async function pollCycleInner() {
|
|
|
19284
19395
|
}
|
|
19285
19396
|
try {
|
|
19286
19397
|
const desiredClaudeCodeVersion = hbResp?.desired_claude_code_version?.trim();
|
|
19287
|
-
const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-
|
|
19398
|
+
const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-WSQTK6TQ.js");
|
|
19288
19399
|
const securityFloor = currentSecurityFloor();
|
|
19289
19400
|
claudeUpdaterInFlight = true;
|
|
19290
19401
|
if (desiredClaudeCodeVersion && (claudePairLoop.busy || claudePairingInProgress())) {
|
|
@@ -19319,7 +19430,7 @@ async function pollCycleInner() {
|
|
|
19319
19430
|
collectPanelessActivityProbes,
|
|
19320
19431
|
getResponsivenessIntervalMs,
|
|
19321
19432
|
occupancyQualificationClassifications
|
|
19322
|
-
} = await import("../responsiveness-probe-
|
|
19433
|
+
} = await import("../responsiveness-probe-32AWSVSL.js");
|
|
19323
19434
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
19324
19435
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
19325
19436
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -19436,7 +19547,7 @@ async function pollCycleInner() {
|
|
|
19436
19547
|
collectResponsivenessProbes,
|
|
19437
19548
|
livePendingInboundOldestAgeSeconds,
|
|
19438
19549
|
parkPendingInbound
|
|
19439
|
-
} = await import("../responsiveness-probe-
|
|
19550
|
+
} = await import("../responsiveness-probe-32AWSVSL.js");
|
|
19440
19551
|
const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-5PCBGRNY.js");
|
|
19441
19552
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
19442
19553
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -19722,7 +19833,7 @@ async function pollCycleInner() {
|
|
|
19722
19833
|
}
|
|
19723
19834
|
}
|
|
19724
19835
|
);
|
|
19725
|
-
const { parkPendingInbound } = await import("../responsiveness-probe-
|
|
19836
|
+
const { parkPendingInbound } = await import("../responsiveness-probe-32AWSVSL.js");
|
|
19726
19837
|
const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
|
|
19727
19838
|
paneFatalStreak.delete(codeName);
|
|
19728
19839
|
paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
|
|
@@ -19753,7 +19864,7 @@ async function pollCycleInner() {
|
|
|
19753
19864
|
TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
|
|
19754
19865
|
bindSourceEscalations
|
|
19755
19866
|
} = await import("../transcript-mount-health-OHE6IVJV.js");
|
|
19756
|
-
const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-
|
|
19867
|
+
const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-HS33PGZZ.js");
|
|
19757
19868
|
const mountConfig = resolveTranscriptMountConfig();
|
|
19758
19869
|
const liveAgents = agentState.persistentSessionAgents;
|
|
19759
19870
|
for (const tracked of [
|
|
@@ -19918,7 +20029,7 @@ async function pollCycleInner() {
|
|
|
19918
20029
|
}
|
|
19919
20030
|
try {
|
|
19920
20031
|
const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
|
|
19921
|
-
const { probeSessionAuth } = await import("../session-auth-dead-
|
|
20032
|
+
const { probeSessionAuth } = await import("../session-auth-dead-2L2NLMMB.js");
|
|
19922
20033
|
const observations = [];
|
|
19923
20034
|
const pendingCacheCommits = [];
|
|
19924
20035
|
const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
|
|
@@ -24846,7 +24957,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
24846
24957
|
if (!refreshData) return;
|
|
24847
24958
|
const framework = refreshData.agent?.framework ?? agentFrameworkCache.get(codeName) ?? DEFAULT_FRAMEWORK;
|
|
24848
24959
|
const hostId = await getHostId();
|
|
24849
|
-
const parkForRestart = await import("../responsiveness-probe-
|
|
24960
|
+
const parkForRestart = await import("../responsiveness-probe-32AWSVSL.js").then(
|
|
24850
24961
|
(m) => m.parkPendingInbound,
|
|
24851
24962
|
(err) => err
|
|
24852
24963
|
);
|
|
@@ -24919,7 +25030,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
24919
25030
|
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}`));
|
|
24920
25031
|
void (async () => {
|
|
24921
25032
|
try {
|
|
24922
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
25033
|
+
const { collectDiagnostics } = await import("../persistent-session-HS33PGZZ.js");
|
|
24923
25034
|
await api.post("/host/heartbeat", {
|
|
24924
25035
|
host_id: hostId,
|
|
24925
25036
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
|
|
@@ -24970,7 +25081,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
|
|
|
24970
25081
|
}
|
|
24971
25082
|
try {
|
|
24972
25083
|
const hostId = await getHostId();
|
|
24973
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
25084
|
+
const { collectDiagnostics } = await import("../persistent-session-HS33PGZZ.js");
|
|
24974
25085
|
await api.post("/host/heartbeat", {
|
|
24975
25086
|
host_id: hostId,
|
|
24976
25087
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
|
|
@@ -25672,7 +25783,7 @@ async function processClaudePairSessions(agents) {
|
|
|
25672
25783
|
snapshotPairConfig,
|
|
25673
25784
|
// ENG-11659: result -> report body + the manager.log line that records it.
|
|
25674
25785
|
planPairStartReport
|
|
25675
|
-
} = await import("../claude-pair-runtime-
|
|
25786
|
+
} = await import("../claude-pair-runtime-WWF5BCK3.js");
|
|
25676
25787
|
const { resetClaudeSignin, describeSigninResetForLog, describeSigninResetFailure } = await import("../claude-signin-reset-6IJMMVYG.js");
|
|
25677
25788
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
25678
25789
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|