@integrity-labs/agt-cli 0.28.88 → 0.28.90
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-ULHJX4A2.js → chunk-BNQ5JQGO.js} +3 -3
- package/dist/{chunk-5Z43ORR6.js → chunk-II75Z6KB.js} +2 -2
- package/dist/{chunk-3G2D4VXI.js → chunk-UB2LZXAL.js} +8 -1
- package/dist/chunk-UB2LZXAL.js.map +1 -0
- package/dist/{claude-pair-runtime-RIVCQTC3.js → claude-pair-runtime-UYTK55XK.js} +2 -2
- package/dist/lib/manager-worker.js +75 -63
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/{persistent-session-OMLGMEGO.js → persistent-session-IODNIQ2L.js} +3 -3
- package/dist/{responsiveness-probe-ANX4EOCH.js → responsiveness-probe-SBJXVSQH.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-3G2D4VXI.js.map +0 -1
- /package/dist/{chunk-ULHJX4A2.js.map → chunk-BNQ5JQGO.js.map} +0 -0
- /package/dist/{chunk-5Z43ORR6.js.map → chunk-II75Z6KB.js.map} +0 -0
- /package/dist/{claude-pair-runtime-RIVCQTC3.js.map → claude-pair-runtime-UYTK55XK.js.map} +0 -0
- /package/dist/{persistent-session-OMLGMEGO.js.map → persistent-session-IODNIQ2L.js.map} +0 -0
- /package/dist/{responsiveness-probe-ANX4EOCH.js.map → responsiveness-probe-SBJXVSQH.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-IODNIQ2L.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-UYTK55XK.js.map
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
requireHost,
|
|
29
29
|
safeWriteJsonAtomic,
|
|
30
30
|
setConfigHash
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-BNQ5JQGO.js";
|
|
32
32
|
import {
|
|
33
33
|
getProjectDir as getProjectDir2,
|
|
34
34
|
getReadyTasks,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
takeWatchdogGiveUpCount,
|
|
67
67
|
takeZombieDetection,
|
|
68
68
|
transcriptActivityAgeSeconds
|
|
69
|
-
} from "../chunk-
|
|
69
|
+
} from "../chunk-II75Z6KB.js";
|
|
70
70
|
import {
|
|
71
71
|
FLAGS_SCHEMA_VERSION,
|
|
72
72
|
FLAG_REGISTRY,
|
|
@@ -80,6 +80,7 @@ import {
|
|
|
80
80
|
classifyActor,
|
|
81
81
|
classifyOutput,
|
|
82
82
|
coerceOnboardingState,
|
|
83
|
+
describeOnboardingChannel,
|
|
83
84
|
extractFrontmatter,
|
|
84
85
|
formatActorId,
|
|
85
86
|
formatMissingVar,
|
|
@@ -100,14 +101,14 @@ import {
|
|
|
100
101
|
resolveDmTarget,
|
|
101
102
|
sumTranscriptUsageInWindow,
|
|
102
103
|
wrapScheduledTaskPrompt
|
|
103
|
-
} from "../chunk-
|
|
104
|
+
} from "../chunk-UB2LZXAL.js";
|
|
104
105
|
import {
|
|
105
106
|
parsePsRows,
|
|
106
107
|
reapOrphanChannelMcps
|
|
107
108
|
} from "../chunk-XWVM4KPK.js";
|
|
108
109
|
|
|
109
110
|
// src/lib/manager-worker.ts
|
|
110
|
-
import { createHash as
|
|
111
|
+
import { createHash as createHash9 } from "crypto";
|
|
111
112
|
import { readFileSync as readFileSync15, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, existsSync as existsSync9, rmSync as rmSync4, readdirSync as readdirSync5, statSync as statSync4, unlinkSync, copyFileSync } from "fs";
|
|
112
113
|
import { execFileSync as syncExecFile } from "child_process";
|
|
113
114
|
import { join as join16, dirname as dirname5 } from "path";
|
|
@@ -865,14 +866,11 @@ var AREA_DIRECTIVE = {
|
|
|
865
866
|
integrations: "Wire up your tools \u2014 ask your manager which integrations your role uses and request access to the ones they confirm (connecting is a human OAuth step)",
|
|
866
867
|
reporting: "Agree how you keep your manager posted \u2014 settle on a cadence and channel, then create a recurring report scheduled task for it"
|
|
867
868
|
};
|
|
868
|
-
function channelLabel(channel) {
|
|
869
|
-
return channel.kind === "slack" ? "Slack" : "Telegram";
|
|
870
|
-
}
|
|
871
869
|
function buildOnboardingDirective(step, completed = [], opts = {}) {
|
|
872
870
|
const { channel, reminder = false } = opts;
|
|
873
871
|
const doneAreas = completed.filter(isOnboardingArea);
|
|
874
872
|
const alreadyCovered = doneAreas.length > 0 ? `You've already covered ${doneAreas.join(", ")} \u2014 re-orient, don't re-ask about those. ` : "";
|
|
875
|
-
const where = channel ? `your manager in ${
|
|
873
|
+
const where = channel ? `your manager in ${describeOnboardingChannel(channel)} (the channel onboarding was triggered from)` : "your manager over your usual channel";
|
|
876
874
|
const askAndWait = `Ask ${where} this area's question and WAIT for their reply. Do NOT self-answer, and do NOT call \`onboarding_advance\` until they respond. ${AREA_DIRECTIVE[step]} only once they have. `;
|
|
877
875
|
if (reminder) {
|
|
878
876
|
return `\u23F3 Onboarding (${step}): still waiting on your manager's answer for this area. If you haven't asked yet, ask now; otherwise give them a gentle nudge, but don't move on without a reply. ` + askAndWait + `Advance with \`onboarding_advance\` (ADVANCE) once this area is done.`;
|
|
@@ -3382,6 +3380,23 @@ function normalize(value) {
|
|
|
3382
3380
|
return sorted;
|
|
3383
3381
|
}
|
|
3384
3382
|
|
|
3383
|
+
// src/lib/channel-config-hash.ts
|
|
3384
|
+
import { createHash as createHash4 } from "crypto";
|
|
3385
|
+
var CHANNEL_WRITE_VERSION = 9;
|
|
3386
|
+
function computeChannelConfigHash(input) {
|
|
3387
|
+
return createHash4("sha256").update(
|
|
3388
|
+
canonicalJson({
|
|
3389
|
+
writeVersion: CHANNEL_WRITE_VERSION,
|
|
3390
|
+
cliVersion: input.cliVersion,
|
|
3391
|
+
config: input.config,
|
|
3392
|
+
team: input.team,
|
|
3393
|
+
peers: input.peers,
|
|
3394
|
+
sessionMode: input.sessionMode ?? null,
|
|
3395
|
+
senderPolicy: input.senderPolicy
|
|
3396
|
+
})
|
|
3397
|
+
).digest("hex");
|
|
3398
|
+
}
|
|
3399
|
+
|
|
3385
3400
|
// src/lib/channel-hash-cache.ts
|
|
3386
3401
|
import { existsSync as existsSync3, readFileSync as readFileSync10, writeFileSync as writeFileSync4 } from "fs";
|
|
3387
3402
|
import { join as join10 } from "path";
|
|
@@ -3794,7 +3809,7 @@ function planGlobalSkillSync(globalSkills, prevIds, hashOf, knownHash) {
|
|
|
3794
3809
|
}
|
|
3795
3810
|
|
|
3796
3811
|
// src/lib/manager/runtime.ts
|
|
3797
|
-
import { createHash as
|
|
3812
|
+
import { createHash as createHash5 } from "crypto";
|
|
3798
3813
|
import { readFileSync as readFileSync11, appendFileSync, mkdirSync as mkdirSync4, chmodSync, existsSync as existsSync4 } from "fs";
|
|
3799
3814
|
import { join as join11, dirname as dirname4 } from "path";
|
|
3800
3815
|
import { homedir as homedir5 } from "os";
|
|
@@ -3843,7 +3858,7 @@ function log(msg) {
|
|
|
3843
3858
|
}
|
|
3844
3859
|
}
|
|
3845
3860
|
function sha256(content) {
|
|
3846
|
-
return
|
|
3861
|
+
return createHash5("sha256").update(content, "utf8").digest("hex");
|
|
3847
3862
|
}
|
|
3848
3863
|
function hashFile(filePath) {
|
|
3849
3864
|
try {
|
|
@@ -4611,7 +4626,7 @@ function isScheduledViaKanbanEnabled() {
|
|
|
4611
4626
|
}
|
|
4612
4627
|
|
|
4613
4628
|
// src/lib/manager/scheduler/runs.ts
|
|
4614
|
-
import { createHash as
|
|
4629
|
+
import { createHash as createHash6 } from "crypto";
|
|
4615
4630
|
async function startRun(opts) {
|
|
4616
4631
|
try {
|
|
4617
4632
|
const res = await api.post(
|
|
@@ -4621,7 +4636,7 @@ async function startRun(opts) {
|
|
|
4621
4636
|
return { run_id: res.run_id ?? null, kanban_item_id: res.kanban_item_id ?? null };
|
|
4622
4637
|
} catch (err) {
|
|
4623
4638
|
const errText = err instanceof Error ? err.message : String(err);
|
|
4624
|
-
const errId =
|
|
4639
|
+
const errId = createHash6("sha256").update(errText).digest("hex").slice(0, 12);
|
|
4625
4640
|
log(`[runs] start failed for agent_id=${opts.agent_id} source_type=${opts.source_type} error_id=${errId}`);
|
|
4626
4641
|
return { run_id: null, kanban_item_id: null };
|
|
4627
4642
|
}
|
|
@@ -4638,7 +4653,7 @@ async function finishRun(runId, outcome, options = {}) {
|
|
|
4638
4653
|
});
|
|
4639
4654
|
} catch (err) {
|
|
4640
4655
|
const errText = err instanceof Error ? err.message : String(err);
|
|
4641
|
-
const errId =
|
|
4656
|
+
const errId = createHash6("sha256").update(errText).digest("hex").slice(0, 12);
|
|
4642
4657
|
log(`[runs] finish failed for run_id=${runId} outcome=${outcome} error_id=${errId}`);
|
|
4643
4658
|
}
|
|
4644
4659
|
}
|
|
@@ -4655,7 +4670,7 @@ async function fetchPriorScheduledRuns(agentId, taskId) {
|
|
|
4655
4670
|
return rows.filter((r) => typeof r.output_text === "string" && r.output_text.length > 0).map((r) => ({ startedAt: r.started_at, output: r.output_text }));
|
|
4656
4671
|
} catch (err) {
|
|
4657
4672
|
const errText = err instanceof Error ? err.message : String(err);
|
|
4658
|
-
const errId =
|
|
4673
|
+
const errId = createHash6("sha256").update(errText).digest("hex").slice(0, 12);
|
|
4659
4674
|
log(`[runs] prior-runs lookup failed for task_id=${taskId} error_id=${errId}`);
|
|
4660
4675
|
return [];
|
|
4661
4676
|
}
|
|
@@ -4704,7 +4719,7 @@ function closeScheduledRunsForCode(codeName, outcome, reason) {
|
|
|
4704
4719
|
}
|
|
4705
4720
|
|
|
4706
4721
|
// src/lib/manager/scheduler/kanban-route.ts
|
|
4707
|
-
import { createHash as
|
|
4722
|
+
import { createHash as createHash7 } from "crypto";
|
|
4708
4723
|
|
|
4709
4724
|
// src/lib/delivery-schedule-link.ts
|
|
4710
4725
|
function envSuffixFor2(codeName) {
|
|
@@ -5119,10 +5134,10 @@ async function processClaudeTaskResult(codeName, agentId, templateId, rawOutput,
|
|
|
5119
5134
|
const classification = classifyOutput(rawOutput);
|
|
5120
5135
|
if (classification.action === "suppress") {
|
|
5121
5136
|
const trimmed = (rawOutput ?? "").trim();
|
|
5122
|
-
const outputHash = trimmed.length === 0 ? "empty" :
|
|
5137
|
+
const outputHash = trimmed.length === 0 ? "empty" : createHash7("sha256").update(trimmed).digest("hex").slice(0, 12);
|
|
5123
5138
|
log(`[claude-scheduler] Suppressing delivery for '${codeName}' (template=${templateId}, task=${delivery?.taskId ?? "n/a"}) \u2014 output_len=${trimmed.length} output_hash=${outputHash}`);
|
|
5124
5139
|
if (classification.suppressedNotes) {
|
|
5125
|
-
const notesHash =
|
|
5140
|
+
const notesHash = createHash7("sha256").update(classification.suppressedNotes).digest("hex").slice(0, 12);
|
|
5126
5141
|
log(`[claude-scheduler] Suppressed notes for '${codeName}' (task=${delivery?.taskId ?? "n/a"}) \u2014 notes_len=${classification.suppressedNotes.length} notes_hash=${notesHash}`);
|
|
5127
5142
|
}
|
|
5128
5143
|
if (delivery?.mode === "announce" && delivery.to) {
|
|
@@ -5188,7 +5203,7 @@ async function processClaudeTaskResult(codeName, agentId, templateId, rawOutput,
|
|
|
5188
5203
|
}
|
|
5189
5204
|
|
|
5190
5205
|
// src/lib/manager/scheduler/execution.ts
|
|
5191
|
-
import { createHash as
|
|
5206
|
+
import { createHash as createHash8 } from "crypto";
|
|
5192
5207
|
import { readFileSync as readFileSync13, existsSync as existsSync7 } from "fs";
|
|
5193
5208
|
import { homedir as homedir7 } from "os";
|
|
5194
5209
|
import { join as join14 } from "path";
|
|
@@ -5213,10 +5228,10 @@ function unregisterClaudeSpawn(pid) {
|
|
|
5213
5228
|
}
|
|
5214
5229
|
async function syncAndCheckClaudeScheduler(agent, tasks, boardItems, refreshData) {
|
|
5215
5230
|
const codeName = agent.code_name;
|
|
5216
|
-
const stableTasksHash =
|
|
5217
|
-
const boardHash = boardItems.length > 0 ?
|
|
5231
|
+
const stableTasksHash = createHash8("sha256").update(JSON.stringify(tasks)).digest("hex").slice(0, 16);
|
|
5232
|
+
const boardHash = boardItems.length > 0 ? createHash8("sha256").update(JSON.stringify(boardItems.map((b) => ({ id: b.id, title: b.title, status: b.status, priority: b.priority, deliverable: b.deliverable })))).digest("hex").slice(0, 16) : "empty";
|
|
5218
5233
|
const resolvedModels = resolveModelChain(refreshData);
|
|
5219
|
-
const modelsHash =
|
|
5234
|
+
const modelsHash = createHash8("sha256").update(JSON.stringify(resolvedModels)).digest("hex").slice(0, 16);
|
|
5220
5235
|
const combinedHash = `${stableTasksHash}:${boardHash}:${modelsHash}`;
|
|
5221
5236
|
const prevHash = agentState.knownTasksHashes.get(agent.agent_id);
|
|
5222
5237
|
if (combinedHash !== prevHash) {
|
|
@@ -6642,7 +6657,7 @@ var runningChannelSecretHashes = /* @__PURE__ */ new Map();
|
|
|
6642
6657
|
function projectMcpHash(_codeName, projectDir) {
|
|
6643
6658
|
try {
|
|
6644
6659
|
const raw = readFileSync15(join16(projectDir, ".mcp.json"), "utf-8");
|
|
6645
|
-
return
|
|
6660
|
+
return createHash9("sha256").update(canonicalJson(JSON.parse(raw))).digest("hex");
|
|
6646
6661
|
} catch {
|
|
6647
6662
|
return null;
|
|
6648
6663
|
}
|
|
@@ -6895,7 +6910,7 @@ var cachedMaintenanceWindow = null;
|
|
|
6895
6910
|
var lastVersionCheckAt = 0;
|
|
6896
6911
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
6897
6912
|
var lastResponsivenessProbeAt = 0;
|
|
6898
|
-
var agtCliVersion = true ? "0.28.
|
|
6913
|
+
var agtCliVersion = true ? "0.28.90" : "dev";
|
|
6899
6914
|
function resolveBrewPath(execFileSync4) {
|
|
6900
6915
|
try {
|
|
6901
6916
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -8006,7 +8021,7 @@ async function pollCycle() {
|
|
|
8006
8021
|
}
|
|
8007
8022
|
try {
|
|
8008
8023
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
8009
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
8024
|
+
const { collectDiagnostics } = await import("../persistent-session-IODNIQ2L.js");
|
|
8010
8025
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
8011
8026
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
|
|
8012
8027
|
let tailscaleHostname;
|
|
@@ -8036,7 +8051,7 @@ async function pollCycle() {
|
|
|
8036
8051
|
claudeAuth = await detectClaudeAuth();
|
|
8037
8052
|
} catch (err) {
|
|
8038
8053
|
const errText = err instanceof Error ? err.message : String(err);
|
|
8039
|
-
const errId =
|
|
8054
|
+
const errId = createHash9("sha256").update(errText).digest("hex").slice(0, 12);
|
|
8040
8055
|
log(`Claude auth detection failed (error_id=${errId})`);
|
|
8041
8056
|
}
|
|
8042
8057
|
const hostHasClaudeCode = state6.agents.some(
|
|
@@ -8107,7 +8122,7 @@ async function pollCycle() {
|
|
|
8107
8122
|
const {
|
|
8108
8123
|
collectResponsivenessProbes,
|
|
8109
8124
|
getResponsivenessIntervalMs
|
|
8110
|
-
} = await import("../responsiveness-probe-
|
|
8125
|
+
} = await import("../responsiveness-probe-SBJXVSQH.js");
|
|
8111
8126
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
8112
8127
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
8113
8128
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -8139,7 +8154,7 @@ async function pollCycle() {
|
|
|
8139
8154
|
collectResponsivenessProbes,
|
|
8140
8155
|
livePendingInboundOldestAgeSeconds,
|
|
8141
8156
|
parkPendingInbound
|
|
8142
|
-
} = await import("../responsiveness-probe-
|
|
8157
|
+
} = await import("../responsiveness-probe-SBJXVSQH.js");
|
|
8143
8158
|
const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
|
|
8144
8159
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
8145
8160
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -9120,17 +9135,14 @@ async function processAgent(agent, agentStates) {
|
|
|
9120
9135
|
const peersForHash = channelId === "telegram" ? extractCharterTelegramPeers(refreshData.charter?.raw_content ?? "", gateContext) : channelId === "slack" ? extractCharterSlackPeers(refreshData.charter?.raw_content ?? "", gateContext) : null;
|
|
9121
9136
|
const sessionModeForHash = refreshData.agent.session_mode;
|
|
9122
9137
|
const senderPolicyForHash = refreshData.sender_policy ?? null;
|
|
9123
|
-
const
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
senderPolicy: senderPolicyForHash
|
|
9132
|
-
})
|
|
9133
|
-
).digest("hex");
|
|
9138
|
+
const configHash = computeChannelConfigHash({
|
|
9139
|
+
cliVersion: agtCliVersion,
|
|
9140
|
+
config: entry.config,
|
|
9141
|
+
team: teamSettingsForHash,
|
|
9142
|
+
peers: peersForHash,
|
|
9143
|
+
sessionMode: sessionModeForHash,
|
|
9144
|
+
senderPolicy: senderPolicyForHash
|
|
9145
|
+
});
|
|
9134
9146
|
const cacheKey = `${agent.agent_id}:${channelId}`;
|
|
9135
9147
|
let onDiskPresent = true;
|
|
9136
9148
|
try {
|
|
@@ -9259,7 +9271,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9259
9271
|
if (channelConfigConverged) {
|
|
9260
9272
|
const hasSenderPolicyChannel = currentChannelIds.has("slack") || currentChannelIds.has("msteams");
|
|
9261
9273
|
const senderPolicyForRestartHash = refreshData.sender_policy ?? null;
|
|
9262
|
-
const senderPolicyHash =
|
|
9274
|
+
const senderPolicyHash = createHash9("sha256").update(canonicalJson({ senderPolicy: senderPolicyForRestartHash })).digest("hex");
|
|
9263
9275
|
const prevSenderPolicyHash = agentState.knownSenderPolicyHashes.get(agent.agent_id);
|
|
9264
9276
|
const senderPolicyDecision = hasSenderPolicyChannel ? decideSenderPolicyRestart({
|
|
9265
9277
|
previousHash: prevSenderPolicyHash,
|
|
@@ -9301,7 +9313,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9301
9313
|
const behaviourSubset = extractMsTeamsBehaviourSubset(
|
|
9302
9314
|
msteamsEntry?.config
|
|
9303
9315
|
);
|
|
9304
|
-
const behaviourHash =
|
|
9316
|
+
const behaviourHash = createHash9("sha256").update(canonicalJson(behaviourSubset)).digest("hex");
|
|
9305
9317
|
const prevBehaviourHash = agentState.knownMsTeamsBehaviourHashes.get(agent.agent_id);
|
|
9306
9318
|
const behaviourDecision = decideSenderPolicyRestart({
|
|
9307
9319
|
previousHash: prevBehaviourHash,
|
|
@@ -9348,7 +9360,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9348
9360
|
const slackBehaviourSubset = extractSlackBehaviourSubset(
|
|
9349
9361
|
slackEntry?.config
|
|
9350
9362
|
);
|
|
9351
|
-
const slackBehaviourHash =
|
|
9363
|
+
const slackBehaviourHash = createHash9("sha256").update(canonicalJson(slackBehaviourSubset)).digest("hex");
|
|
9352
9364
|
const prevSlackBehaviourHash = agentState.knownSlackBehaviourHashes.get(agent.agent_id);
|
|
9353
9365
|
const slackBehaviourDecision = decideSenderPolicyRestart({
|
|
9354
9366
|
previousHash: prevSlackBehaviourHash,
|
|
@@ -9592,10 +9604,10 @@ async function processAgent(agent, agentStates) {
|
|
|
9592
9604
|
desiredEntries.push({ serverId, url, headers: mcpHeaders, name: tk.toolkit_name });
|
|
9593
9605
|
}
|
|
9594
9606
|
const hashBasis = desiredEntries.slice().sort((a, b) => a.serverId.localeCompare(b.serverId)).map((e) => {
|
|
9595
|
-
const headersHash =
|
|
9607
|
+
const headersHash = createHash9("sha256").update(canonicalJson(e.headers ?? {})).digest("hex").slice(0, 16);
|
|
9596
9608
|
return `${e.serverId}|${e.url}|${headersHash}`;
|
|
9597
9609
|
}).join("\n");
|
|
9598
|
-
const mcpHash =
|
|
9610
|
+
const mcpHash = createHash9("sha256").update(hashBasis).digest("hex").slice(0, 16);
|
|
9599
9611
|
const prevMcpHash = agentState.knownManagedMcpHashes.get(agent.agent_id);
|
|
9600
9612
|
const structureHash = managedMcpStructureHash(desiredEntries);
|
|
9601
9613
|
const prevStructureHash = agentState.knownManagedMcpStructure.get(agent.agent_id);
|
|
@@ -9610,7 +9622,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9610
9622
|
if (mcpHash !== prevMcpHash) {
|
|
9611
9623
|
for (const e of desiredEntries) {
|
|
9612
9624
|
frameworkAdapter.writeMcpServer(agent.code_name, e.serverId, { url: e.url, headers: e.headers });
|
|
9613
|
-
const urlHash =
|
|
9625
|
+
const urlHash = createHash9("sha256").update(e.url).digest("hex").slice(0, 12);
|
|
9614
9626
|
log(`[managed-toolkit] ${agent.code_name}: wrote '${e.name}' (serverId=${e.serverId}, url_hash=${urlHash})`);
|
|
9615
9627
|
}
|
|
9616
9628
|
if (frameworkAdapter.removeMcpServer && frameworkAdapter.getMcpPath) {
|
|
@@ -9744,7 +9756,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9744
9756
|
if (frameworkAdapter.installSkillFiles) {
|
|
9745
9757
|
const currentIntegrationSkillIds = /* @__PURE__ */ new Set();
|
|
9746
9758
|
const installedIntegrationSkills = [];
|
|
9747
|
-
const { createHash:
|
|
9759
|
+
const { createHash: createHash10 } = await import("crypto");
|
|
9748
9760
|
const refreshAny = refreshData;
|
|
9749
9761
|
const contexts = refreshAny.integration_contexts ?? refreshAny.plugin_contexts ?? [];
|
|
9750
9762
|
const contextBySlug = /* @__PURE__ */ new Map();
|
|
@@ -9773,7 +9785,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9773
9785
|
)
|
|
9774
9786
|
}));
|
|
9775
9787
|
const bundle = buildIntegrationBundle(renderedScopes);
|
|
9776
|
-
const contentHash =
|
|
9788
|
+
const contentHash = createHash10("sha256").update(bundleFingerprint(bundle.files)).digest("hex").slice(0, 12);
|
|
9777
9789
|
const hashKey = `plugin-skill:${agent.agent_id}:${integrationSkillId}`;
|
|
9778
9790
|
if (agentState.knownSkillHashes.get(hashKey) === contentHash) continue;
|
|
9779
9791
|
frameworkAdapter.installSkillFiles(agent.code_name, integrationSkillId, bundle.files);
|
|
@@ -9832,7 +9844,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9832
9844
|
const plan = planGlobalSkillSync(
|
|
9833
9845
|
refreshAny.global_skills ?? [],
|
|
9834
9846
|
agentState.knownGlobalSkillIds.get(agent.agent_id) ?? /* @__PURE__ */ new Set(),
|
|
9835
|
-
(content) =>
|
|
9847
|
+
(content) => createHash10("sha256").update(content).digest("hex").slice(0, 12),
|
|
9836
9848
|
(skillId) => agentState.knownSkillHashes.get(`global-skill:${agent.agent_id}:${skillId}`)
|
|
9837
9849
|
);
|
|
9838
9850
|
for (const { skillId, content, hash } of plan.installs) {
|
|
@@ -9876,7 +9888,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9876
9888
|
const slug = hook.integration_slug ?? hook.plugin_slug;
|
|
9877
9889
|
if (!slug) continue;
|
|
9878
9890
|
try {
|
|
9879
|
-
const scriptHash =
|
|
9891
|
+
const scriptHash = createHash10("sha256").update(hook.script).digest("hex").slice(0, 12);
|
|
9880
9892
|
const hookKey = `${agent.agent_id}:${frameworkAdapter.id}:plugin-hook:${slug}:on_install`;
|
|
9881
9893
|
if (agentState.knownSkillHashes.get(hookKey) === scriptHash) continue;
|
|
9882
9894
|
const result = await frameworkAdapter.executePluginHook({
|
|
@@ -9891,9 +9903,9 @@ async function processAgent(agent, agentStates) {
|
|
|
9891
9903
|
} else if (result.timedOut) {
|
|
9892
9904
|
log(`Integration hook on_install '${slug}' TIMED OUT for '${agent.code_name}' after ${result.durationMs}ms`);
|
|
9893
9905
|
} else {
|
|
9894
|
-
const stderrHash =
|
|
9906
|
+
const stderrHash = createHash10("sha256").update(result.stderr).digest("hex").slice(0, 12);
|
|
9895
9907
|
const missingCmd = result.exitCode === 127 ? extractCommandNotFound(result.stderr) : null;
|
|
9896
|
-
const missingCmdHash = missingCmd ?
|
|
9908
|
+
const missingCmdHash = missingCmd ? createHash10("sha256").update(missingCmd).digest("hex").slice(0, 8) : null;
|
|
9897
9909
|
log(
|
|
9898
9910
|
`Integration hook on_install '${slug}' exited ${result.exitCode} for '${agent.code_name}' ` + (missingCmdHash ? `[missing_command_hash=${missingCmdHash}] ` : "") + `[stderr_hash=${stderrHash} stderr_len=${result.stderr.length}]`
|
|
9899
9911
|
);
|
|
@@ -10168,10 +10180,10 @@ async function processAgent(agent, agentStates) {
|
|
|
10168
10180
|
} else if (agentFw === "claude-code" && tasks.length > 0) {
|
|
10169
10181
|
await syncAndCheckClaudeScheduler(agent, tasks, boardItems, refreshData);
|
|
10170
10182
|
} else if (frameworkAdapter.syncScheduledTasks && gatewayRunning && gatewayPort) {
|
|
10171
|
-
const stableTasksHash =
|
|
10172
|
-
const boardHash = boardItems.length > 0 ?
|
|
10183
|
+
const stableTasksHash = createHash9("sha256").update(JSON.stringify(tasks)).digest("hex").slice(0, 16);
|
|
10184
|
+
const boardHash = boardItems.length > 0 ? createHash9("sha256").update(JSON.stringify(boardItems.map((b) => ({ id: b.id, title: b.title, status: b.status, priority: b.priority, deliverable: b.deliverable })))).digest("hex").slice(0, 16) : "empty";
|
|
10173
10185
|
const resolvedModels = resolveModelChain(refreshData);
|
|
10174
|
-
const modelsHash =
|
|
10186
|
+
const modelsHash = createHash9("sha256").update(JSON.stringify(resolvedModels)).digest("hex").slice(0, 16);
|
|
10175
10187
|
const combinedHash = `${stableTasksHash}:${boardHash}:${modelsHash}`;
|
|
10176
10188
|
const prevTasksHash = agentState.knownTasksHashes.get(agent.agent_id);
|
|
10177
10189
|
if (combinedHash !== prevTasksHash) {
|
|
@@ -10697,7 +10709,7 @@ async function ensurePersistentSession(agent, tasks, boardItems, refreshData) {
|
|
|
10697
10709
|
const ctx = getLastFailureContext(codeName);
|
|
10698
10710
|
const recovery = prepareForRespawn(codeName);
|
|
10699
10711
|
const tailSummary = !ctx.tail ? "" : KNOWN_SAFE_TAIL_SIGNATURES.has(ctx.signature) ? `; last pane output (${PANE_TAIL_PREVIEW_LINES} of ~20 lines):
|
|
10700
|
-
${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${
|
|
10712
|
+
${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash9("sha256").update(ctx.tail).digest("hex").slice(0, 12)} (raw at ~/.augmented/${codeName}/pane.log)`;
|
|
10701
10713
|
const sigSummary = ctx.signature !== "unknown" ? `; signature=${ctx.signature}` : "";
|
|
10702
10714
|
const recoverySummary = recovery ? `; recovery=${recovery}` : "";
|
|
10703
10715
|
log(
|
|
@@ -10711,7 +10723,7 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash8("sha256").
|
|
|
10711
10723
|
);
|
|
10712
10724
|
getHostId().then((hostId) => {
|
|
10713
10725
|
if (!hostId) return;
|
|
10714
|
-
const paneTailHash = zombie.paneTail ? `sha256:${
|
|
10726
|
+
const paneTailHash = zombie.paneTail ? `sha256:${createHash9("sha256").update(zombie.paneTail).digest("hex").slice(0, 12)}` : null;
|
|
10715
10727
|
return api.post("/host/events", {
|
|
10716
10728
|
host_id: hostId,
|
|
10717
10729
|
agent_code_name: codeName,
|
|
@@ -10795,7 +10807,7 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash8("sha256").
|
|
|
10795
10807
|
if (!claudeAuthTupleBySession.has(codeName)) {
|
|
10796
10808
|
claudeAuthTupleBySession.set(codeName, currentAuthTuple);
|
|
10797
10809
|
}
|
|
10798
|
-
const stableTasksHash =
|
|
10810
|
+
const stableTasksHash = createHash9("sha256").update(JSON.stringify(tasks)).digest("hex").slice(0, 16);
|
|
10799
10811
|
const prevHash = agentState.knownTasksHashes.get(agent.agent_id);
|
|
10800
10812
|
if (stableTasksHash !== prevHash) {
|
|
10801
10813
|
const taskInputs = tasks.map((t) => buildSchedulerTaskInput(t));
|
|
@@ -11321,7 +11333,7 @@ ${escapeXml(msg.content)}
|
|
|
11321
11333
|
log(`[direct-chat] Reply sent for '${agent.codeName}'`);
|
|
11322
11334
|
} catch (err) {
|
|
11323
11335
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
11324
|
-
const errorId =
|
|
11336
|
+
const errorId = createHash9("sha256").update(errMsg).digest("hex").slice(0, 12);
|
|
11325
11337
|
log(`[direct-chat] Failed to process message for '${agent.codeName}': error_id=${errorId} error=${errMsg.slice(0, 500)}`);
|
|
11326
11338
|
try {
|
|
11327
11339
|
await api.post("/host/direct-chat/reply", {
|
|
@@ -11613,7 +11625,7 @@ async function processClaudePairSessions(agents) {
|
|
|
11613
11625
|
killPairSession,
|
|
11614
11626
|
pairTmuxSession,
|
|
11615
11627
|
finalizeClaudePairOnboarding
|
|
11616
|
-
} = await import("../claude-pair-runtime-
|
|
11628
|
+
} = await import("../claude-pair-runtime-UYTK55XK.js");
|
|
11617
11629
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
11618
11630
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
11619
11631
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
|
@@ -11877,7 +11889,7 @@ async function syncMemories(agent, configDir, log2) {
|
|
|
11877
11889
|
if (!file.endsWith(".md")) continue;
|
|
11878
11890
|
try {
|
|
11879
11891
|
const raw = readFileSync15(join16(memoryDir, file), "utf-8");
|
|
11880
|
-
const fileHash =
|
|
11892
|
+
const fileHash = createHash9("sha256").update(raw).digest("hex").slice(0, 16);
|
|
11881
11893
|
currentHashes.set(file, fileHash);
|
|
11882
11894
|
if (prevHashes.get(file) === fileHash) continue;
|
|
11883
11895
|
const parsed = parseMemoryFile(raw, file.replace(/\.md$/, ""));
|
|
@@ -11915,14 +11927,14 @@ async function syncMemories(agent, configDir, log2) {
|
|
|
11915
11927
|
}
|
|
11916
11928
|
async function downloadMemories(agent, memoryDir, log2, { force }) {
|
|
11917
11929
|
const localFiles = existsSync9(memoryDir) ? readdirSync5(memoryDir).filter((f) => f.endsWith(".md")).sort() : [];
|
|
11918
|
-
const localListHash =
|
|
11930
|
+
const localListHash = createHash9("sha256").update(localFiles.join(",")).digest("hex").slice(0, 16);
|
|
11919
11931
|
const prevLocalHash = lastLocalFileHash.get(agent.agent_id);
|
|
11920
11932
|
const prevDownload = lastDownloadHash.get(agent.agent_id);
|
|
11921
11933
|
try {
|
|
11922
11934
|
const dbMemories = await api.post("/host/memories", {
|
|
11923
11935
|
agent_id: agent.agent_id
|
|
11924
11936
|
});
|
|
11925
|
-
const responseHash =
|
|
11937
|
+
const responseHash = createHash9("sha256").update(JSON.stringify(dbMemories.memories ?? [])).digest("hex").slice(0, 16);
|
|
11926
11938
|
if (!force && prevDownload && prevLocalHash === localListHash && lastDownloadHash.get(agent.agent_id) === responseHash) {
|
|
11927
11939
|
return true;
|
|
11928
11940
|
}
|
|
@@ -11961,7 +11973,7 @@ ${mem.content}
|
|
|
11961
11973
|
}
|
|
11962
11974
|
if (written > 0 || overwritten > 0) {
|
|
11963
11975
|
const updatedFiles = readdirSync5(memoryDir).filter((f) => f.endsWith(".md")).sort();
|
|
11964
|
-
lastLocalFileHash.set(agent.agent_id,
|
|
11976
|
+
lastLocalFileHash.set(agent.agent_id, createHash9("sha256").update(updatedFiles.join(",")).digest("hex").slice(0, 16));
|
|
11965
11977
|
log2(`Memory download for '${agent.code_name}': wrote ${written} new, overwrote ${overwritten} stale`);
|
|
11966
11978
|
}
|
|
11967
11979
|
}
|
|
@@ -12398,7 +12410,7 @@ function deployMcpAssets() {
|
|
|
12398
12410
|
const fileHash = (p) => {
|
|
12399
12411
|
try {
|
|
12400
12412
|
if (!existsSync9(p)) return null;
|
|
12401
|
-
return
|
|
12413
|
+
return createHash9("sha256").update(readFileSync15(p)).digest("hex");
|
|
12402
12414
|
} catch {
|
|
12403
12415
|
return null;
|
|
12404
12416
|
}
|