@integrity-labs/agt-cli 0.28.32 → 0.28.33
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-KJVDXL3L.js → chunk-7V2NY5F6.js} +12 -3
- package/dist/{chunk-KJVDXL3L.js.map → chunk-7V2NY5F6.js.map} +1 -1
- package/dist/{chunk-SR6RHUAV.js → chunk-HTRILMXV.js} +2 -2
- package/dist/{chunk-VIIPFWE4.js → chunk-R5CP4WAO.js} +2 -1
- package/dist/{claude-pair-runtime-RLIUZRLZ.js → claude-pair-runtime-LP4W56RT.js} +2 -2
- package/dist/lib/manager-worker.js +83 -48
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/{persistent-session-JHBXSNVW.js → persistent-session-RNALQ7JD.js} +3 -3
- package/dist/{responsiveness-probe-SKVWT5CO.js → responsiveness-probe-DRP2PPVE.js} +3 -3
- package/package.json +1 -1
- /package/dist/{chunk-SR6RHUAV.js.map → chunk-HTRILMXV.js.map} +0 -0
- /package/dist/{chunk-VIIPFWE4.js.map → chunk-R5CP4WAO.js.map} +0 -0
- /package/dist/{claude-pair-runtime-RLIUZRLZ.js.map → claude-pair-runtime-LP4W56RT.js.map} +0 -0
- /package/dist/{persistent-session-JHBXSNVW.js.map → persistent-session-RNALQ7JD.js.map} +0 -0
- /package/dist/{responsiveness-probe-SKVWT5CO.js.map → responsiveness-probe-DRP2PPVE.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
claudeModelAlias,
|
|
3
3
|
isClaudeFastMode
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-R5CP4WAO.js";
|
|
5
5
|
import {
|
|
6
6
|
reapOrphanChannelMcps
|
|
7
7
|
} from "./chunk-XWVM4KPK.js";
|
|
@@ -1487,4 +1487,4 @@ export {
|
|
|
1487
1487
|
stopAllSessionsAndWait,
|
|
1488
1488
|
getProjectDir
|
|
1489
1489
|
};
|
|
1490
|
-
//# sourceMappingURL=chunk-
|
|
1490
|
+
//# sourceMappingURL=chunk-HTRILMXV.js.map
|
|
@@ -5299,10 +5299,11 @@ export {
|
|
|
5299
5299
|
isEmptyTotals,
|
|
5300
5300
|
attributeTranscriptUsageByRun,
|
|
5301
5301
|
KANBAN_CHECK_COMMAND,
|
|
5302
|
+
FLAG_REGISTRY,
|
|
5302
5303
|
getFlagDefinition,
|
|
5303
5304
|
listFlagDefinitions,
|
|
5304
5305
|
normalizeFlagValue,
|
|
5305
5306
|
coerceEnvValue,
|
|
5306
5307
|
FLAGS_SCHEMA_VERSION
|
|
5307
5308
|
};
|
|
5308
|
-
//# sourceMappingURL=chunk-
|
|
5309
|
+
//# sourceMappingURL=chunk-R5CP4WAO.js.map
|
|
@@ -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-RNALQ7JD.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-LP4W56RT.js.map
|
|
@@ -21,8 +21,9 @@ import {
|
|
|
21
21
|
provisionSessionStateHook,
|
|
22
22
|
provisionStopHook,
|
|
23
23
|
requireHost,
|
|
24
|
-
safeWriteJsonAtomic
|
|
25
|
-
|
|
24
|
+
safeWriteJsonAtomic,
|
|
25
|
+
setConfigHash
|
|
26
|
+
} from "../chunk-7V2NY5F6.js";
|
|
26
27
|
import {
|
|
27
28
|
getProjectDir as getProjectDir2,
|
|
28
29
|
getReadyTasks,
|
|
@@ -64,9 +65,10 @@ import {
|
|
|
64
65
|
takeWatchdogGiveUpCount,
|
|
65
66
|
takeZombieDetection,
|
|
66
67
|
transcriptActivityAgeSeconds
|
|
67
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-HTRILMXV.js";
|
|
68
69
|
import {
|
|
69
70
|
FLAGS_SCHEMA_VERSION,
|
|
71
|
+
FLAG_REGISTRY,
|
|
70
72
|
KANBAN_CHECK_COMMAND,
|
|
71
73
|
MAX_AVATAR_ENV_URL_BYTES,
|
|
72
74
|
SUPPRESS_SENTINEL,
|
|
@@ -97,14 +99,14 @@ import {
|
|
|
97
99
|
sumTranscriptUsageInWindow,
|
|
98
100
|
worseConnectivityOutcome,
|
|
99
101
|
wrapScheduledTaskPrompt
|
|
100
|
-
} from "../chunk-
|
|
102
|
+
} from "../chunk-R5CP4WAO.js";
|
|
101
103
|
import {
|
|
102
104
|
parsePsRows,
|
|
103
105
|
reapOrphanChannelMcps
|
|
104
106
|
} from "../chunk-XWVM4KPK.js";
|
|
105
107
|
|
|
106
108
|
// src/lib/manager-worker.ts
|
|
107
|
-
import { createHash as
|
|
109
|
+
import { createHash as createHash5 } from "crypto";
|
|
108
110
|
import { readFileSync as readFileSync12, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync8, rmSync as rmSync3, readdirSync as readdirSync5, statSync as statSync4, unlinkSync, copyFileSync } from "fs";
|
|
109
111
|
import { execFileSync as syncExecFile } from "child_process";
|
|
110
112
|
import { join as join14, dirname as dirname3 } from "path";
|
|
@@ -1693,6 +1695,32 @@ var DirectChatSpawnGate = class {
|
|
|
1693
1695
|
}
|
|
1694
1696
|
};
|
|
1695
1697
|
|
|
1698
|
+
// ../../packages/core/dist/host-config/capture.js
|
|
1699
|
+
import { createHash as createHash3 } from "crypto";
|
|
1700
|
+
var NON_SECRET_ENV_GATES = [
|
|
1701
|
+
"AGT_MEMORY_EXTRACTION_ENABLED",
|
|
1702
|
+
"AGT_CHANNEL_REPLAY_ENABLED",
|
|
1703
|
+
"AGT_DISABLE_MSTEAMS_HOST_ROUTES",
|
|
1704
|
+
"AGT_DEPLOY_CRONS",
|
|
1705
|
+
"AGT_CONV_EVAL_BACKEND",
|
|
1706
|
+
"AGT_CLI_RELEASE_CHANNEL"
|
|
1707
|
+
];
|
|
1708
|
+
var SECRET_NAME_PATTERN = /(KEY|SECRET|TOKEN|PASSWORD|PASSWD|CREDENTIAL|PRIVATE|SIGNING|WEBHOOK)/i;
|
|
1709
|
+
function listCapturableEnvGateNames() {
|
|
1710
|
+
const fromRegistry = FLAG_REGISTRY.map((f) => f.envVar).filter((v) => typeof v === "string" && v.length > 0);
|
|
1711
|
+
return [.../* @__PURE__ */ new Set([...fromRegistry, ...NON_SECRET_ENV_GATES])].filter((name) => !SECRET_NAME_PATTERN.test(name)).sort();
|
|
1712
|
+
}
|
|
1713
|
+
function collectEnvGates(env) {
|
|
1714
|
+
const out = {};
|
|
1715
|
+
for (const name of listCapturableEnvGateNames()) {
|
|
1716
|
+
const value = env[name];
|
|
1717
|
+
if (typeof value === "string" && value.length > 0) {
|
|
1718
|
+
out[name] = value.length > 128 ? value.slice(0, 128) : value;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
return out;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1696
1724
|
// src/lib/artifact-stream.ts
|
|
1697
1725
|
import { join as join3 } from "path";
|
|
1698
1726
|
import { homedir } from "os";
|
|
@@ -3605,7 +3633,7 @@ function planGlobalSkillSync(globalSkills, prevIds, hashOf, knownHash) {
|
|
|
3605
3633
|
}
|
|
3606
3634
|
|
|
3607
3635
|
// src/lib/manager/runtime.ts
|
|
3608
|
-
import { createHash as
|
|
3636
|
+
import { createHash as createHash4 } from "crypto";
|
|
3609
3637
|
import { readFileSync as readFileSync9, appendFileSync, mkdirSync as mkdirSync2, chmodSync, existsSync as existsSync4 } from "fs";
|
|
3610
3638
|
import { join as join10, dirname as dirname2 } from "path";
|
|
3611
3639
|
import { homedir as homedir4 } from "os";
|
|
@@ -3654,7 +3682,7 @@ function log(msg) {
|
|
|
3654
3682
|
}
|
|
3655
3683
|
}
|
|
3656
3684
|
function sha256(content) {
|
|
3657
|
-
return
|
|
3685
|
+
return createHash4("sha256").update(content, "utf8").digest("hex");
|
|
3658
3686
|
}
|
|
3659
3687
|
function hashFile(filePath) {
|
|
3660
3688
|
try {
|
|
@@ -5812,7 +5840,7 @@ var runningChannelSecretHashes = /* @__PURE__ */ new Map();
|
|
|
5812
5840
|
function projectMcpHash(_codeName, projectDir) {
|
|
5813
5841
|
try {
|
|
5814
5842
|
const raw = readFileSync12(join14(projectDir, ".mcp.json"), "utf-8");
|
|
5815
|
-
return
|
|
5843
|
+
return createHash5("sha256").update(canonicalJson(JSON.parse(raw))).digest("hex");
|
|
5816
5844
|
} catch {
|
|
5817
5845
|
return null;
|
|
5818
5846
|
}
|
|
@@ -6171,7 +6199,7 @@ var cachedMaintenanceWindow = null;
|
|
|
6171
6199
|
var lastVersionCheckAt = 0;
|
|
6172
6200
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
6173
6201
|
var lastResponsivenessProbeAt = 0;
|
|
6174
|
-
var agtCliVersion = true ? "0.28.
|
|
6202
|
+
var agtCliVersion = true ? "0.28.33" : "dev";
|
|
6175
6203
|
function resolveBrewPath(execFileSync4) {
|
|
6176
6204
|
try {
|
|
6177
6205
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -7299,7 +7327,7 @@ async function pollCycle() {
|
|
|
7299
7327
|
}
|
|
7300
7328
|
try {
|
|
7301
7329
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
7302
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
7330
|
+
const { collectDiagnostics } = await import("../persistent-session-RNALQ7JD.js");
|
|
7303
7331
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
7304
7332
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
|
|
7305
7333
|
let tailscaleHostname;
|
|
@@ -7329,7 +7357,7 @@ async function pollCycle() {
|
|
|
7329
7357
|
claudeAuth = await detectClaudeAuth();
|
|
7330
7358
|
} catch (err) {
|
|
7331
7359
|
const errText = err instanceof Error ? err.message : String(err);
|
|
7332
|
-
const errId =
|
|
7360
|
+
const errId = createHash5("sha256").update(errText).digest("hex").slice(0, 12);
|
|
7333
7361
|
log(`Claude auth detection failed (error_id=${errId})`);
|
|
7334
7362
|
}
|
|
7335
7363
|
const hostHasClaudeCode = state6.agents.some(
|
|
@@ -7366,7 +7394,12 @@ async function pollCycle() {
|
|
|
7366
7394
|
// ENG-6251: capability advertisement — the flags schema version this
|
|
7367
7395
|
// CLI compiled with, so the admin UI can show flip reach across a
|
|
7368
7396
|
// mixed-CLI fleet (an older CLI sends an older fingerprint).
|
|
7369
|
-
flags_schema_version: FLAGS_SCHEMA_VERSION
|
|
7397
|
+
flags_schema_version: FLAGS_SCHEMA_VERSION,
|
|
7398
|
+
// ENG-6412: the host's allowlisted, non-secret env gates. The API
|
|
7399
|
+
// combines these with the org's server-resolved flags + versions into a
|
|
7400
|
+
// host_config_snapshots row (on change) so bugs correlate with config.
|
|
7401
|
+
// Allowlist-only by construction — no raw env / secrets ever sent.
|
|
7402
|
+
env_gates: collectEnvGates(process.env)
|
|
7370
7403
|
});
|
|
7371
7404
|
if (hbResp?.maintenance_window) {
|
|
7372
7405
|
cachedMaintenanceWindow = hbResp.maintenance_window;
|
|
@@ -7374,6 +7407,7 @@ async function pollCycle() {
|
|
|
7374
7407
|
if (hbResp?.feature_flags) {
|
|
7375
7408
|
hostFlagStore().applyHeartbeat(hbResp.feature_flags, hbResp.flags_schema_version);
|
|
7376
7409
|
}
|
|
7410
|
+
setConfigHash(hbResp?.config_hash ?? null);
|
|
7377
7411
|
try {
|
|
7378
7412
|
if (decideMaintenanceWindowGate({ window: cachedMaintenanceWindow, now: /* @__PURE__ */ new Date() }) === "proceed") {
|
|
7379
7413
|
const { maybeUpdateClaudeCode } = await import("../claude-code-updater-4E5T2X3Z.js");
|
|
@@ -7387,13 +7421,14 @@ async function pollCycle() {
|
|
|
7387
7421
|
log(`Claude Code updater error: ${err.message}`);
|
|
7388
7422
|
}
|
|
7389
7423
|
} catch (err) {
|
|
7424
|
+
setConfigHash(null);
|
|
7390
7425
|
log(`Heartbeat failed: ${err.message}`);
|
|
7391
7426
|
}
|
|
7392
7427
|
try {
|
|
7393
7428
|
const {
|
|
7394
7429
|
collectResponsivenessProbes,
|
|
7395
7430
|
getResponsivenessIntervalMs
|
|
7396
|
-
} = await import("../responsiveness-probe-
|
|
7431
|
+
} = await import("../responsiveness-probe-DRP2PPVE.js");
|
|
7397
7432
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
7398
7433
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
7399
7434
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -7425,7 +7460,7 @@ async function pollCycle() {
|
|
|
7425
7460
|
collectResponsivenessProbes,
|
|
7426
7461
|
livePendingInboundOldestAgeSeconds,
|
|
7427
7462
|
parkPendingInbound
|
|
7428
|
-
} = await import("../responsiveness-probe-
|
|
7463
|
+
} = await import("../responsiveness-probe-DRP2PPVE.js");
|
|
7429
7464
|
const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
|
|
7430
7465
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
7431
7466
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -8407,7 +8442,7 @@ async function processAgent(agent, agentStates) {
|
|
|
8407
8442
|
const sessionModeForHash = refreshData.agent.session_mode;
|
|
8408
8443
|
const senderPolicyForHash = refreshData.sender_policy ?? null;
|
|
8409
8444
|
const CHANNEL_WRITE_VERSION = 9;
|
|
8410
|
-
const configHash =
|
|
8445
|
+
const configHash = createHash5("sha256").update(
|
|
8411
8446
|
canonicalJson({
|
|
8412
8447
|
writeVersion: CHANNEL_WRITE_VERSION,
|
|
8413
8448
|
config: entry.config,
|
|
@@ -8521,7 +8556,7 @@ async function processAgent(agent, agentStates) {
|
|
|
8521
8556
|
if (channelConfigConverged) {
|
|
8522
8557
|
const hasSenderPolicyChannel = currentChannelIds.has("slack") || currentChannelIds.has("msteams");
|
|
8523
8558
|
const senderPolicyForRestartHash = refreshData.sender_policy ?? null;
|
|
8524
|
-
const senderPolicyHash =
|
|
8559
|
+
const senderPolicyHash = createHash5("sha256").update(canonicalJson({ senderPolicy: senderPolicyForRestartHash })).digest("hex");
|
|
8525
8560
|
const prevSenderPolicyHash = agentState.knownSenderPolicyHashes.get(agent.agent_id);
|
|
8526
8561
|
const senderPolicyDecision = hasSenderPolicyChannel ? decideSenderPolicyRestart({
|
|
8527
8562
|
previousHash: prevSenderPolicyHash,
|
|
@@ -8563,7 +8598,7 @@ async function processAgent(agent, agentStates) {
|
|
|
8563
8598
|
const behaviourSubset = extractMsTeamsBehaviourSubset(
|
|
8564
8599
|
msteamsEntry?.config
|
|
8565
8600
|
);
|
|
8566
|
-
const behaviourHash =
|
|
8601
|
+
const behaviourHash = createHash5("sha256").update(canonicalJson(behaviourSubset)).digest("hex");
|
|
8567
8602
|
const prevBehaviourHash = agentState.knownMsTeamsBehaviourHashes.get(agent.agent_id);
|
|
8568
8603
|
const behaviourDecision = decideSenderPolicyRestart({
|
|
8569
8604
|
previousHash: prevBehaviourHash,
|
|
@@ -8610,7 +8645,7 @@ async function processAgent(agent, agentStates) {
|
|
|
8610
8645
|
const slackBehaviourSubset = extractSlackBehaviourSubset(
|
|
8611
8646
|
slackEntry?.config
|
|
8612
8647
|
);
|
|
8613
|
-
const slackBehaviourHash =
|
|
8648
|
+
const slackBehaviourHash = createHash5("sha256").update(canonicalJson(slackBehaviourSubset)).digest("hex");
|
|
8614
8649
|
const prevSlackBehaviourHash = agentState.knownSlackBehaviourHashes.get(agent.agent_id);
|
|
8615
8650
|
const slackBehaviourDecision = decideSenderPolicyRestart({
|
|
8616
8651
|
previousHash: prevSlackBehaviourHash,
|
|
@@ -8854,10 +8889,10 @@ async function processAgent(agent, agentStates) {
|
|
|
8854
8889
|
desiredEntries.push({ serverId, url, headers: mcpHeaders, name: tk.toolkit_name });
|
|
8855
8890
|
}
|
|
8856
8891
|
const hashBasis = desiredEntries.slice().sort((a, b) => a.serverId.localeCompare(b.serverId)).map((e) => {
|
|
8857
|
-
const headersHash =
|
|
8892
|
+
const headersHash = createHash5("sha256").update(canonicalJson(e.headers ?? {})).digest("hex").slice(0, 16);
|
|
8858
8893
|
return `${e.serverId}|${e.url}|${headersHash}`;
|
|
8859
8894
|
}).join("\n");
|
|
8860
|
-
const mcpHash =
|
|
8895
|
+
const mcpHash = createHash5("sha256").update(hashBasis).digest("hex").slice(0, 16);
|
|
8861
8896
|
const prevMcpHash = agentState.knownManagedMcpHashes.get(agent.agent_id);
|
|
8862
8897
|
const structureHash = managedMcpStructureHash(desiredEntries);
|
|
8863
8898
|
const prevStructureHash = agentState.knownManagedMcpStructure.get(agent.agent_id);
|
|
@@ -8872,7 +8907,7 @@ async function processAgent(agent, agentStates) {
|
|
|
8872
8907
|
if (mcpHash !== prevMcpHash) {
|
|
8873
8908
|
for (const e of desiredEntries) {
|
|
8874
8909
|
frameworkAdapter.writeMcpServer(agent.code_name, e.serverId, { url: e.url, headers: e.headers });
|
|
8875
|
-
const urlHash =
|
|
8910
|
+
const urlHash = createHash5("sha256").update(e.url).digest("hex").slice(0, 12);
|
|
8876
8911
|
log(`[managed-toolkit] ${agent.code_name}: wrote '${e.name}' (serverId=${e.serverId}, url_hash=${urlHash})`);
|
|
8877
8912
|
}
|
|
8878
8913
|
if (frameworkAdapter.removeMcpServer && frameworkAdapter.getMcpPath) {
|
|
@@ -9006,7 +9041,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9006
9041
|
if (frameworkAdapter.installSkillFiles) {
|
|
9007
9042
|
const currentIntegrationSkillIds = /* @__PURE__ */ new Set();
|
|
9008
9043
|
const installedIntegrationSkills = [];
|
|
9009
|
-
const { createHash:
|
|
9044
|
+
const { createHash: createHash6 } = await import("crypto");
|
|
9010
9045
|
const refreshAny = refreshData;
|
|
9011
9046
|
const contexts = refreshAny.integration_contexts ?? refreshAny.plugin_contexts ?? [];
|
|
9012
9047
|
const contextBySlug = /* @__PURE__ */ new Map();
|
|
@@ -9035,7 +9070,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9035
9070
|
)
|
|
9036
9071
|
}));
|
|
9037
9072
|
const bundle = buildIntegrationBundle(renderedScopes);
|
|
9038
|
-
const contentHash =
|
|
9073
|
+
const contentHash = createHash6("sha256").update(bundleFingerprint(bundle.files)).digest("hex").slice(0, 12);
|
|
9039
9074
|
const hashKey = `plugin-skill:${agent.agent_id}:${integrationSkillId}`;
|
|
9040
9075
|
if (agentState.knownSkillHashes.get(hashKey) === contentHash) continue;
|
|
9041
9076
|
frameworkAdapter.installSkillFiles(agent.code_name, integrationSkillId, bundle.files);
|
|
@@ -9094,7 +9129,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9094
9129
|
const plan = planGlobalSkillSync(
|
|
9095
9130
|
refreshAny.global_skills ?? [],
|
|
9096
9131
|
agentState.knownGlobalSkillIds.get(agent.agent_id) ?? /* @__PURE__ */ new Set(),
|
|
9097
|
-
(content) =>
|
|
9132
|
+
(content) => createHash6("sha256").update(content).digest("hex").slice(0, 12),
|
|
9098
9133
|
(skillId) => agentState.knownSkillHashes.get(`global-skill:${agent.agent_id}:${skillId}`)
|
|
9099
9134
|
);
|
|
9100
9135
|
for (const { skillId, content, hash } of plan.installs) {
|
|
@@ -9138,7 +9173,7 @@ async function processAgent(agent, agentStates) {
|
|
|
9138
9173
|
const slug = hook.integration_slug ?? hook.plugin_slug;
|
|
9139
9174
|
if (!slug) continue;
|
|
9140
9175
|
try {
|
|
9141
|
-
const scriptHash =
|
|
9176
|
+
const scriptHash = createHash6("sha256").update(hook.script).digest("hex").slice(0, 12);
|
|
9142
9177
|
const hookKey = `${agent.agent_id}:${frameworkAdapter.id}:plugin-hook:${slug}:on_install`;
|
|
9143
9178
|
if (agentState.knownSkillHashes.get(hookKey) === scriptHash) continue;
|
|
9144
9179
|
const result = await frameworkAdapter.executePluginHook({
|
|
@@ -9153,9 +9188,9 @@ async function processAgent(agent, agentStates) {
|
|
|
9153
9188
|
} else if (result.timedOut) {
|
|
9154
9189
|
log(`Integration hook on_install '${slug}' TIMED OUT for '${agent.code_name}' after ${result.durationMs}ms`);
|
|
9155
9190
|
} else {
|
|
9156
|
-
const stderrHash =
|
|
9191
|
+
const stderrHash = createHash6("sha256").update(result.stderr).digest("hex").slice(0, 12);
|
|
9157
9192
|
const missingCmd = result.exitCode === 127 ? extractCommandNotFound(result.stderr) : null;
|
|
9158
|
-
const missingCmdHash = missingCmd ?
|
|
9193
|
+
const missingCmdHash = missingCmd ? createHash6("sha256").update(missingCmd).digest("hex").slice(0, 8) : null;
|
|
9159
9194
|
log(
|
|
9160
9195
|
`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}]`
|
|
9161
9196
|
);
|
|
@@ -9424,10 +9459,10 @@ async function processAgent(agent, agentStates) {
|
|
|
9424
9459
|
} else if (agentFw === "claude-code" && tasks.length > 0) {
|
|
9425
9460
|
await syncAndCheckClaudeScheduler(agent, tasks, boardItems, refreshData);
|
|
9426
9461
|
} else if (frameworkAdapter.syncScheduledTasks && gatewayRunning && gatewayPort) {
|
|
9427
|
-
const stableTasksHash =
|
|
9428
|
-
const boardHash = boardItems.length > 0 ?
|
|
9462
|
+
const stableTasksHash = createHash5("sha256").update(JSON.stringify(tasks)).digest("hex").slice(0, 16);
|
|
9463
|
+
const boardHash = boardItems.length > 0 ? createHash5("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";
|
|
9429
9464
|
const resolvedModels = resolveModelChain(refreshData);
|
|
9430
|
-
const modelsHash =
|
|
9465
|
+
const modelsHash = createHash5("sha256").update(JSON.stringify(resolvedModels)).digest("hex").slice(0, 16);
|
|
9431
9466
|
const combinedHash = `${stableTasksHash}:${boardHash}:${modelsHash}`;
|
|
9432
9467
|
const prevTasksHash = agentState.knownTasksHashes.get(agent.agent_id);
|
|
9433
9468
|
if (combinedHash !== prevTasksHash) {
|
|
@@ -9839,10 +9874,10 @@ function unregisterClaudeSpawn(pid) {
|
|
|
9839
9874
|
var claudeSchedulerStates = /* @__PURE__ */ new Map();
|
|
9840
9875
|
async function syncAndCheckClaudeScheduler(agent, tasks, boardItems, refreshData) {
|
|
9841
9876
|
const codeName = agent.code_name;
|
|
9842
|
-
const stableTasksHash =
|
|
9843
|
-
const boardHash = boardItems.length > 0 ?
|
|
9877
|
+
const stableTasksHash = createHash5("sha256").update(JSON.stringify(tasks)).digest("hex").slice(0, 16);
|
|
9878
|
+
const boardHash = boardItems.length > 0 ? createHash5("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";
|
|
9844
9879
|
const resolvedModels = resolveModelChain(refreshData);
|
|
9845
|
-
const modelsHash =
|
|
9880
|
+
const modelsHash = createHash5("sha256").update(JSON.stringify(resolvedModels)).digest("hex").slice(0, 16);
|
|
9846
9881
|
const combinedHash = `${stableTasksHash}:${boardHash}:${modelsHash}`;
|
|
9847
9882
|
const prevHash = agentState.knownTasksHashes.get(agent.agent_id);
|
|
9848
9883
|
if (combinedHash !== prevHash) {
|
|
@@ -9908,7 +9943,7 @@ async function startRun(opts) {
|
|
|
9908
9943
|
return { run_id: res.run_id ?? null, kanban_item_id: res.kanban_item_id ?? null };
|
|
9909
9944
|
} catch (err) {
|
|
9910
9945
|
const errText = err instanceof Error ? err.message : String(err);
|
|
9911
|
-
const errId =
|
|
9946
|
+
const errId = createHash5("sha256").update(errText).digest("hex").slice(0, 12);
|
|
9912
9947
|
log(`[runs] start failed for agent_id=${opts.agent_id} source_type=${opts.source_type} error_id=${errId}`);
|
|
9913
9948
|
return { run_id: null, kanban_item_id: null };
|
|
9914
9949
|
}
|
|
@@ -9925,7 +9960,7 @@ async function finishRun(runId, outcome, options = {}) {
|
|
|
9925
9960
|
});
|
|
9926
9961
|
} catch (err) {
|
|
9927
9962
|
const errText = err instanceof Error ? err.message : String(err);
|
|
9928
|
-
const errId =
|
|
9963
|
+
const errId = createHash5("sha256").update(errText).digest("hex").slice(0, 12);
|
|
9929
9964
|
log(`[runs] finish failed for run_id=${runId} outcome=${outcome} error_id=${errId}`);
|
|
9930
9965
|
}
|
|
9931
9966
|
}
|
|
@@ -9942,7 +9977,7 @@ async function fetchPriorScheduledRuns(agentId, taskId) {
|
|
|
9942
9977
|
return rows.filter((r) => typeof r.output_text === "string" && r.output_text.length > 0).map((r) => ({ startedAt: r.started_at, output: r.output_text }));
|
|
9943
9978
|
} catch (err) {
|
|
9944
9979
|
const errText = err instanceof Error ? err.message : String(err);
|
|
9945
|
-
const errId =
|
|
9980
|
+
const errId = createHash5("sha256").update(errText).digest("hex").slice(0, 12);
|
|
9946
9981
|
log(`[runs] prior-runs lookup failed for task_id=${taskId} error_id=${errId}`);
|
|
9947
9982
|
return [];
|
|
9948
9983
|
}
|
|
@@ -10298,10 +10333,10 @@ async function processClaudeTaskResult(codeName, agentId, templateId, rawOutput,
|
|
|
10298
10333
|
const classification = classifyOutput(rawOutput);
|
|
10299
10334
|
if (classification.action === "suppress") {
|
|
10300
10335
|
const trimmed = (rawOutput ?? "").trim();
|
|
10301
|
-
const outputHash = trimmed.length === 0 ? "empty" :
|
|
10336
|
+
const outputHash = trimmed.length === 0 ? "empty" : createHash5("sha256").update(trimmed).digest("hex").slice(0, 12);
|
|
10302
10337
|
log(`[claude-scheduler] Suppressing delivery for '${codeName}' (template=${templateId}, task=${delivery?.taskId ?? "n/a"}) \u2014 output_len=${trimmed.length} output_hash=${outputHash}`);
|
|
10303
10338
|
if (classification.suppressedNotes) {
|
|
10304
|
-
const notesHash =
|
|
10339
|
+
const notesHash = createHash5("sha256").update(classification.suppressedNotes).digest("hex").slice(0, 12);
|
|
10305
10340
|
log(`[claude-scheduler] Suppressed notes for '${codeName}' (task=${delivery?.taskId ?? "n/a"}) \u2014 notes_len=${classification.suppressedNotes.length} notes_hash=${notesHash}`);
|
|
10306
10341
|
}
|
|
10307
10342
|
if (delivery?.mode === "announce" && delivery.to) {
|
|
@@ -10486,7 +10521,7 @@ async function ensurePersistentSession(agent, tasks, boardItems, refreshData) {
|
|
|
10486
10521
|
const ctx = getLastFailureContext(codeName);
|
|
10487
10522
|
const recovery = prepareForRespawn(codeName);
|
|
10488
10523
|
const tailSummary = !ctx.tail ? "" : KNOWN_SAFE_TAIL_SIGNATURES.has(ctx.signature) ? `; last pane output (${PANE_TAIL_PREVIEW_LINES} of ~20 lines):
|
|
10489
|
-
${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${
|
|
10524
|
+
${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash5("sha256").update(ctx.tail).digest("hex").slice(0, 12)} (raw at ~/.augmented/${codeName}/pane.log)`;
|
|
10490
10525
|
const sigSummary = ctx.signature !== "unknown" ? `; signature=${ctx.signature}` : "";
|
|
10491
10526
|
const recoverySummary = recovery ? `; recovery=${recovery}` : "";
|
|
10492
10527
|
log(
|
|
@@ -10500,7 +10535,7 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash4("sha256").
|
|
|
10500
10535
|
);
|
|
10501
10536
|
getHostId().then((hostId) => {
|
|
10502
10537
|
if (!hostId) return;
|
|
10503
|
-
const paneTailHash = zombie.paneTail ? `sha256:${
|
|
10538
|
+
const paneTailHash = zombie.paneTail ? `sha256:${createHash5("sha256").update(zombie.paneTail).digest("hex").slice(0, 12)}` : null;
|
|
10504
10539
|
return api.post("/host/events", {
|
|
10505
10540
|
host_id: hostId,
|
|
10506
10541
|
agent_code_name: codeName,
|
|
@@ -10579,7 +10614,7 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash4("sha256").
|
|
|
10579
10614
|
if (!claudeAuthTupleBySession.has(codeName)) {
|
|
10580
10615
|
claudeAuthTupleBySession.set(codeName, currentAuthTuple);
|
|
10581
10616
|
}
|
|
10582
|
-
const stableTasksHash =
|
|
10617
|
+
const stableTasksHash = createHash5("sha256").update(JSON.stringify(tasks)).digest("hex").slice(0, 16);
|
|
10583
10618
|
const prevHash = agentState.knownTasksHashes.get(agent.agent_id);
|
|
10584
10619
|
if (stableTasksHash !== prevHash) {
|
|
10585
10620
|
const taskInputs = tasks.map((t) => buildSchedulerTaskInput(t));
|
|
@@ -11105,7 +11140,7 @@ ${escapeXml(msg.content)}
|
|
|
11105
11140
|
log(`[direct-chat] Reply sent for '${agent.codeName}'`);
|
|
11106
11141
|
} catch (err) {
|
|
11107
11142
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
11108
|
-
const errorId =
|
|
11143
|
+
const errorId = createHash5("sha256").update(errMsg).digest("hex").slice(0, 12);
|
|
11109
11144
|
log(`[direct-chat] Failed to process message for '${agent.codeName}': error_id=${errorId} error=${errMsg.slice(0, 500)}`);
|
|
11110
11145
|
try {
|
|
11111
11146
|
await api.post("/host/direct-chat/reply", {
|
|
@@ -11397,7 +11432,7 @@ async function processClaudePairSessions(agents) {
|
|
|
11397
11432
|
killPairSession,
|
|
11398
11433
|
pairTmuxSession,
|
|
11399
11434
|
finalizeClaudePairOnboarding
|
|
11400
|
-
} = await import("../claude-pair-runtime-
|
|
11435
|
+
} = await import("../claude-pair-runtime-LP4W56RT.js");
|
|
11401
11436
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
11402
11437
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
11403
11438
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
|
@@ -11661,7 +11696,7 @@ async function syncMemories(agent, configDir, log2) {
|
|
|
11661
11696
|
if (!file.endsWith(".md")) continue;
|
|
11662
11697
|
try {
|
|
11663
11698
|
const raw = readFileSync12(join14(memoryDir, file), "utf-8");
|
|
11664
|
-
const fileHash =
|
|
11699
|
+
const fileHash = createHash5("sha256").update(raw).digest("hex").slice(0, 16);
|
|
11665
11700
|
currentHashes.set(file, fileHash);
|
|
11666
11701
|
if (prevHashes.get(file) === fileHash) continue;
|
|
11667
11702
|
const parsed = parseMemoryFile(raw, file.replace(/\.md$/, ""));
|
|
@@ -11699,14 +11734,14 @@ async function syncMemories(agent, configDir, log2) {
|
|
|
11699
11734
|
}
|
|
11700
11735
|
async function downloadMemories(agent, memoryDir, log2, { force }) {
|
|
11701
11736
|
const localFiles = existsSync8(memoryDir) ? readdirSync5(memoryDir).filter((f) => f.endsWith(".md")).sort() : [];
|
|
11702
|
-
const localListHash =
|
|
11737
|
+
const localListHash = createHash5("sha256").update(localFiles.join(",")).digest("hex").slice(0, 16);
|
|
11703
11738
|
const prevLocalHash = lastLocalFileHash.get(agent.agent_id);
|
|
11704
11739
|
const prevDownload = lastDownloadHash.get(agent.agent_id);
|
|
11705
11740
|
try {
|
|
11706
11741
|
const dbMemories = await api.post("/host/memories", {
|
|
11707
11742
|
agent_id: agent.agent_id
|
|
11708
11743
|
});
|
|
11709
|
-
const responseHash =
|
|
11744
|
+
const responseHash = createHash5("sha256").update(JSON.stringify(dbMemories.memories ?? [])).digest("hex").slice(0, 16);
|
|
11710
11745
|
if (!force && prevDownload && prevLocalHash === localListHash && lastDownloadHash.get(agent.agent_id) === responseHash) {
|
|
11711
11746
|
return true;
|
|
11712
11747
|
}
|
|
@@ -11745,7 +11780,7 @@ ${mem.content}
|
|
|
11745
11780
|
}
|
|
11746
11781
|
if (written > 0 || overwritten > 0) {
|
|
11747
11782
|
const updatedFiles = readdirSync5(memoryDir).filter((f) => f.endsWith(".md")).sort();
|
|
11748
|
-
lastLocalFileHash.set(agent.agent_id,
|
|
11783
|
+
lastLocalFileHash.set(agent.agent_id, createHash5("sha256").update(updatedFiles.join(",")).digest("hex").slice(0, 16));
|
|
11749
11784
|
log2(`Memory download for '${agent.code_name}': wrote ${written} new, overwrote ${overwritten} stale`);
|
|
11750
11785
|
}
|
|
11751
11786
|
}
|
|
@@ -12182,7 +12217,7 @@ function deployMcpAssets() {
|
|
|
12182
12217
|
const fileHash = (p) => {
|
|
12183
12218
|
try {
|
|
12184
12219
|
if (!existsSync8(p)) return null;
|
|
12185
|
-
return
|
|
12220
|
+
return createHash5("sha256").update(readFileSync12(p)).digest("hex");
|
|
12186
12221
|
} catch {
|
|
12187
12222
|
return null;
|
|
12188
12223
|
}
|