@askexenow/exe-os 0.9.150 → 0.9.154
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/{active-agent-HDUT3T3I.js → active-agent-IVY5D7DJ.js} +2 -2
- package/dist/{active-agent-XHERKXH6.js → active-agent-JN7A2D2E.js} +2 -2
- package/dist/{agentic-ontology-GMK3MB3U.js → agentic-ontology-NU5FACOX.js} +1 -1
- package/dist/{backfill-metadata-7IANPCAL.js → backfill-metadata-XBWBPBN2.js} +3 -3
- package/dist/{behaviors-JG75DNG3.js → behaviors-4USTCRU7.js} +2 -2
- package/dist/bin/agentic-ontology-backfill.js +4 -4
- package/dist/bin/agentic-reflection-backfill.js +5 -5
- package/dist/bin/agentic-semantic-label.js +4 -4
- package/dist/bin/backfill-conversations.js +3 -3
- package/dist/bin/backfill-responses.js +3 -3
- package/dist/bin/backfill-vectors.js +4 -4
- package/dist/bin/bulk-sync-postgres.js +8 -7
- package/dist/bin/cc-doctor.js +1 -1
- package/dist/bin/cleanup-stale-review-tasks.js +7 -7
- package/dist/bin/cli.js +12 -12
- package/dist/bin/exe-agent-config.js +1 -1
- package/dist/bin/exe-agent.js +8 -8
- package/dist/bin/exe-assign.js +4 -4
- package/dist/bin/exe-boot.js +15 -15
- package/dist/bin/exe-call.js +4 -4
- package/dist/bin/exe-cloud.js +3 -3
- package/dist/bin/exe-dispatch.js +7 -7
- package/dist/bin/exe-doctor.js +1 -1
- package/dist/bin/exe-export-behaviors.js +6 -6
- package/dist/bin/exe-forget.js +5 -5
- package/dist/bin/exe-gateway.js +5 -5
- package/dist/bin/exe-healthcheck.js +1 -1
- package/dist/bin/exe-heartbeat.js +7 -7
- package/dist/bin/exe-kill.js +10 -10
- package/dist/bin/exe-launch-agent.js +10 -10
- package/dist/bin/exe-new-employee.js +6 -6
- package/dist/bin/exe-pending-messages.js +8 -8
- package/dist/bin/exe-pending-notifications.js +7 -7
- package/dist/bin/exe-pending-reviews.js +7 -7
- package/dist/bin/exe-rename.js +4 -4
- package/dist/bin/exe-review.js +9 -9
- package/dist/bin/exe-search.js +4 -4
- package/dist/bin/exe-session-cleanup.js +14 -14
- package/dist/bin/exe-settings.js +3 -3
- package/dist/bin/exe-start-codex.js +10 -10
- package/dist/bin/exe-start-opencode.js +7 -7
- package/dist/bin/exe-status.js +8 -8
- package/dist/bin/exe-team.js +2 -2
- package/dist/bin/git-sweep.js +7 -7
- package/dist/bin/graph-backfill.js +3 -3
- package/dist/bin/graph-export.js +4 -4
- package/dist/bin/install.js +5 -5
- package/dist/bin/intercom-check.js +4 -4
- package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
- package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
- package/dist/bin/pre-publish.js +1 -1
- package/dist/bin/scan-tasks.js +7 -7
- package/dist/bin/setup.js +1 -1
- package/dist/bin/shard-migrate.js +3 -3
- package/dist/{capacity-monitor-J3SVO7LJ.js → capacity-monitor-VJLRBE7S.js} +8 -8
- package/dist/{catchup-brief-AIFZT456.js → catchup-brief-T2RPTOTZ.js} +9 -9
- package/dist/{chunk-DMBFPZOP.js → chunk-23H5ZURC.js} +8 -8
- package/dist/{chunk-DJVXUJIR.js → chunk-2BTXFKAV.js} +73 -74
- package/dist/{chunk-MBYJEE3B.js → chunk-2G2KOWBI.js} +12 -0
- package/dist/{chunk-WLSSSDAR.js → chunk-2GUTGEFX.js} +1 -1
- package/dist/{chunk-FSH4VWSL.js → chunk-3CZBCOYI.js} +2 -2
- package/dist/{chunk-GPHURFBS.js → chunk-3I44JXWH.js} +2 -2
- package/dist/{chunk-5NSTNICM.js → chunk-3OGN523Z.js} +1 -1
- package/dist/{chunk-3VHX5XFJ.js → chunk-3RJBXMWJ.js} +1 -1
- package/dist/{chunk-3JR37K7C.js → chunk-3S2HQUP6.js} +12 -8
- package/dist/{chunk-Z43CJQ7T.js → chunk-45APPAB2.js} +61 -22
- package/dist/{chunk-IGYF67K3.js → chunk-5KUJDZ3J.js} +3 -3
- package/dist/{chunk-LJX5SV6L.js → chunk-66RYFM6Z.js} +5 -5
- package/dist/{chunk-26VUCVSE.js → chunk-6M65LFNM.js} +2 -2
- package/dist/{chunk-3TXOH3SJ.js → chunk-A7KEWR6S.js} +1 -1
- package/dist/{chunk-GIAAHYMW.js → chunk-ABVCJBON.js} +2 -2
- package/dist/{chunk-SFV2XRPY.js → chunk-AL7JZARP.js} +1 -1
- package/dist/{chunk-7JTZNHA4.js → chunk-DMUNYW65.js} +25 -17
- package/dist/{chunk-BQ3KXWA7.js → chunk-DTT4TRFR.js} +1 -1
- package/dist/{chunk-72XIEBYJ.js → chunk-DWLDYEGO.js} +6 -6
- package/dist/{chunk-MNIJA5BL.js → chunk-F2WGMIFZ.js} +1 -1
- package/dist/{chunk-XEH3USTI.js → chunk-G7IQNOSY.js} +1 -1
- package/dist/{chunk-EOU4ZLRZ.js → chunk-GCB4MHTG.js} +1 -1
- package/dist/{chunk-X2XE65WV.js → chunk-H5STRY47.js} +9 -4
- package/dist/{chunk-WR45FP7O.js → chunk-HYRYMZRT.js} +2 -2
- package/dist/{chunk-LM7TQYLW.js → chunk-IWSXQKSB.js} +1 -1
- package/dist/{chunk-ODEGQCWW.js → chunk-K23KJITV.js} +3 -3
- package/dist/{chunk-O2Y4WJYW.js → chunk-KSOPUPQX.js} +196 -9
- package/dist/{chunk-EEXG4ZJS.js → chunk-KUPUTWQX.js} +9 -9
- package/dist/{chunk-5NQKE3X4.js → chunk-L3JRSHHU.js} +2 -2
- package/dist/{chunk-4WIWYUU2.js → chunk-LHMOPUZE.js} +2 -2
- package/dist/{chunk-UHL4QL5E.js → chunk-LVEOCWPL.js} +1 -1
- package/dist/{chunk-IT2JDL5L.js → chunk-MLL5ICNL.js} +17 -12
- package/dist/{chunk-XWQKCCCO.js → chunk-MWRHXGAB.js} +7 -0
- package/dist/{chunk-JM4A2E5A.js → chunk-NL4YO6I2.js} +1 -1
- package/dist/{chunk-EYTMNAU7.js → chunk-OC7Q4LOK.js} +19 -9
- package/dist/{chunk-DSKUPORS.js → chunk-OHYMA6C3.js} +2 -2
- package/dist/{chunk-7HONLLJ2.js → chunk-OSPZOCPU.js} +3 -3
- package/dist/{chunk-LLDY5HPV.js → chunk-PE6NCL7A.js} +1 -1
- package/dist/{chunk-GJMHN45Z.js → chunk-Q7TTJD4A.js} +1 -1
- package/dist/{chunk-RAMU6E5T.js → chunk-SE2DYYVB.js} +1 -1
- package/dist/{chunk-CRS6YTBM.js → chunk-SFZUC72J.js} +2 -2
- package/dist/{chunk-OEPEY47B.js → chunk-T2B7637C.js} +1 -1
- package/dist/{chunk-BR5UVRA2.js → chunk-TH2OFEQH.js} +1 -1
- package/dist/{chunk-ZGKU4PMY.js → chunk-TME75K53.js} +2 -2
- package/dist/{chunk-XQSGAG2G.js → chunk-UIAYIZNR.js} +2 -2
- package/dist/{chunk-BV2JVO2U.js → chunk-ULFBLCIP.js} +1 -1
- package/dist/{chunk-UPAEAL6K.js → chunk-UREIHGOQ.js} +3 -3
- package/dist/{chunk-Q7GVSS2J.js → chunk-VRKPBY6D.js} +1 -1
- package/dist/{chunk-4K7HJL37.js → chunk-VZDPV32D.js} +3 -3
- package/dist/{chunk-RLCZBSUB.js → chunk-X347L57O.js} +12 -0
- package/dist/{chunk-CO2SF5SB.js → chunk-XEN5RMGU.js} +1 -1
- package/dist/{chunk-TCKZYGC5.js → chunk-XYFPCAA2.js} +2 -2
- package/dist/{chunk-LBX2VQCC.js → chunk-Y3Z6QHUR.js} +2 -2
- package/dist/{crdt-sync-3VQP2ISB.js → crdt-sync-B7IUR3BR.js} +1 -1
- package/dist/{crm-webhook-AJYXEFZD.js → crm-webhook-YU7PDS7U.js} +2 -2
- package/dist/{cto-delegation-gate-7OIN66NU.js → cto-delegation-gate-JDDOHVQL.js} +6 -6
- package/dist/{daemon-orchestration-EHONVEHN.js → daemon-orchestration-5OYKXYSR.js} +9 -9
- package/dist/{exe-drift-L5ZHO3CZ.js → exe-drift-DXRU4SXJ.js} +2 -2
- package/dist/{exe-export-IVFME5VN.js → exe-export-X3AWJONG.js} +5 -5
- package/dist/{exe-import-O76AYBUE.js → exe-import-GC5HO3TD.js} +5 -5
- package/dist/{exe-key-6HV5GYHH.js → exe-key-R3ER4MYY.js} +1 -1
- package/dist/{fast-db-init-NCOIEAM6.js → fast-db-init-5DTYG5FZ.js} +1 -1
- package/dist/gateway/index.js +9 -9
- package/dist/{git-staleness-MSTOMG55.js → git-staleness-SVUTMS2F.js} +1 -1
- package/dist/{git-task-sweep-NOXCELFQ.js → git-task-sweep-EQHX4LXT.js} +7 -7
- package/dist/{global-procedures-FXWQ35RU.js → global-procedures-P7VOE476.js} +3 -3
- package/dist/{graph-auto-extract-D4I7DF2S.js → graph-auto-extract-UI374EYL.js} +1 -1
- package/dist/{hook-integrity-PR4BPZBT.js → hook-integrity-SA7S2SNI.js} +1 -1
- package/dist/hooks/bug-report-worker.js +8 -8
- package/dist/hooks/codex-stop-task-finalizer.js +8 -8
- package/dist/hooks/commit-complete.js +9 -9
- package/dist/hooks/error-recall.js +5 -5
- package/dist/hooks/exe-heartbeat-hook.js +2 -2
- package/dist/hooks/ingest.js +9 -9
- package/dist/hooks/instructions-loaded.js +3 -3
- package/dist/hooks/notification.js +3 -3
- package/dist/hooks/post-compact.js +8 -8
- package/dist/hooks/post-tool-combined.js +4 -4
- package/dist/hooks/pre-compact.js +9 -9
- package/dist/hooks/pre-tool-use.js +34 -12
- package/dist/hooks/prompt-submit.js +111 -47
- package/dist/hooks/session-end.js +13 -13
- package/dist/hooks/session-start.js +7 -7
- package/dist/hooks/stop.js +12 -12
- package/dist/hooks/subagent-stop.js +8 -8
- package/dist/hooks/summary-worker.js +12 -12
- package/dist/index.js +16 -16
- package/dist/{installer-Q4IWV2GB.js → installer-L72MRJPI.js} +4 -4
- package/dist/{installer-5NAISFMT.js → installer-LX2TU7RS.js} +4 -4
- package/dist/{installer-FTGXXYRA.js → installer-SLJ3YCHB.js} +4 -4
- package/dist/lib/cloud-sync.js +3 -3
- package/dist/lib/consolidation.js +4 -4
- package/dist/lib/database.js +1 -1
- package/dist/lib/db.js +1 -1
- package/dist/lib/employee-templates.js +4 -4
- package/dist/lib/employees.js +1 -1
- package/dist/lib/exe-daemon.js +86 -44
- package/dist/lib/hybrid-search.js +4 -4
- package/dist/lib/identity.js +1 -1
- package/dist/lib/messaging.js +7 -7
- package/dist/lib/reminders.js +2 -2
- package/dist/lib/schedules.js +4 -4
- package/dist/lib/skill-learning.js +3 -3
- package/dist/lib/store.js +3 -3
- package/dist/lib/task-router.js +2 -2
- package/dist/lib/tasks.js +7 -7
- package/dist/lib/tmux-routing.js +6 -6
- package/dist/lib/tmux-transport.js +1 -1
- package/dist/lib/token-spend.js +2 -2
- package/dist/lib/transport.js +2 -2
- package/dist/mcp/register-tools.js +46 -46
- package/dist/mcp/server.js +47 -47
- package/dist/mcp/tools/complete-reminder.js +3 -3
- package/dist/mcp/tools/create-reminder.js +3 -3
- package/dist/mcp/tools/create-task.js +9 -9
- package/dist/mcp/tools/deactivate-behavior.js +4 -4
- package/dist/mcp/tools/list-reminders.js +3 -3
- package/dist/mcp/tools/list-tasks.js +9 -9
- package/dist/mcp/tools/send-message.js +9 -9
- package/dist/mcp/tools/update-task.js +8 -8
- package/dist/{mcp-http-config-PSQCITKG.js → mcp-http-config-T76QB243.js} +2 -2
- package/dist/{memory-cards-SYVGSLXW.js → memory-cards-NTRYLVOU.js} +1 -1
- package/dist/{memory-poisoning-defense-T7AC4LZN.js → memory-poisoning-defense-OJ2DEGBA.js} +1 -1
- package/dist/{memory-reflection-FNJU7VFC.js → memory-reflection-4YOUTIMO.js} +1 -1
- package/dist/{notifications-LD563XOM.js → notifications-SF2XN5JE.js} +6 -6
- package/dist/{orchestrator-WQGPXMLN.js → orchestrator-2W3VNAKG.js} +8 -8
- package/dist/{plan-limits-IAUNTZUW.js → plan-limits-LEM76SOQ.js} +2 -2
- package/dist/{projection-worker-S6LYSY22.js → projection-worker-RQHV4VIR.js} +1 -1
- package/dist/{push-notifications-KDYFOJRI.js → push-notifications-NSYLKFXR.js} +1 -1
- package/dist/{review-polling-J3R7MLT4.js → review-polling-HD26LRW2.js} +7 -7
- package/dist/runtime/index.js +13 -13
- package/dist/{session-events-XDDQ3M4A.js → session-events-NYMENC3B.js} +7 -7
- package/dist/{session-kill-telemetry-TX5NCPUV.js → session-kill-telemetry-LJU2MMZC.js} +2 -2
- package/dist/{session-scope-6MAGVHBA.js → session-scope-QIDIKKFB.js} +6 -6
- package/dist/{setup-wizard-WJ73A2FY.js → setup-wizard-ANL7CVWX.js} +1 -1
- package/dist/signal-paths-4GOIRLGH.js +19 -0
- package/dist/skill-refinement-3W3CIIG3.js +156 -0
- package/dist/{task-enforcement-3RV64YVR.js → task-enforcement-YXEOTTUG.js} +6 -6
- package/dist/{task-scope-2T3WIQQY.js → task-scope-XXPTORGS.js} +6 -6
- package/dist/{tasks-crud-B2BGA44L.js → tasks-crud-3UCNTXKQ.js} +6 -6
- package/dist/{tasks-review-ZO3QDMT7.js → tasks-review-IPOWGI4L.js} +6 -6
- package/dist/{token-budget-LJC7HHKB.js → token-budget-NP22DW2M.js} +1 -1
- package/dist/{tool-telemetry-L3WQDRMH.js → tool-telemetry-5JF2OAHG.js} +1 -1
- package/dist/tui/App.js +15 -15
- package/dist/{tui-data-UAPARPDX.js → tui-data-Z7FCER3K.js} +6 -6
- package/dist/{worker-gate-TG6PR2S5.js → worker-gate-PJYHXNUB.js} +1 -1
- package/dist/{workflow-engine-VIFLD5IV.js → workflow-engine-GA7JS7X2.js} +2 -2
- package/package.json +1 -1
- package/release-notes.json +194 -194
- /package/dist/{chunk-34XNU32S.js → chunk-7E6ZBXO7.js} +0 -0
- /package/dist/{chunk-PJCTBGWN.js → chunk-7U664OM4.js} +0 -0
- /package/dist/{chunk-BRXDLJBU.js → chunk-LYMBXTEO.js} +0 -0
- /package/dist/{chunk-VN6UUZNO.js → chunk-NQND3GFO.js} +0 -0
- /package/dist/{chunk-OU7SLHNA.js → chunk-PBBIAKN5.js} +0 -0
- /package/dist/{chunk-II3NQJGV.js → chunk-UJ2KUF4C.js} +0 -0
- /package/dist/{chunk-OLVZBBVO.js → chunk-Z6UYJ7HZ.js} +0 -0
- /package/dist/{chunk-BF4W2VDS.js → chunk-ZYETFCDX.js} +0 -0
- /package/dist/{core-memory-MT7P34HU.js → core-memory-KL5BOUXU.js} +0 -0
- /package/dist/{wiki-acl-UE3CRAPQ.js → wiki-acl-ZRCU7XYC.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
recordSessionKill
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XEN5RMGU.js";
|
|
4
4
|
import {
|
|
5
5
|
updateTask
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KUPUTWQX.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureEmployee,
|
|
9
9
|
extractRootExe,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
sessionScopeFilter,
|
|
15
15
|
strictSessionScopeFilter,
|
|
16
16
|
writeNotification
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OC7Q4LOK.js";
|
|
18
18
|
import {
|
|
19
19
|
queueIntercom
|
|
20
20
|
} from "./chunk-TXSJ2L5O.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-64WZEXXA.js";
|
|
24
24
|
import {
|
|
25
25
|
getTransport
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-A7KEWR6S.js";
|
|
27
27
|
import {
|
|
28
28
|
listTmuxSessions,
|
|
29
29
|
parseContextPercentage
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
baseAgentName,
|
|
33
33
|
isCoordinatorName,
|
|
34
34
|
shouldAutoInstance
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-2G2KOWBI.js";
|
|
36
36
|
import {
|
|
37
37
|
loadConfigSync
|
|
38
38
|
} from "./chunk-TOWAZ5IV.js";
|
|
@@ -210,7 +210,8 @@ async function checkSessionTTL(deps) {
|
|
|
210
210
|
const contextPct = deps.parseContextPercentage(entry.windowName);
|
|
211
211
|
const killReason = classifyTtlKillReason(ageHours, contextPct);
|
|
212
212
|
if (killReason !== null) {
|
|
213
|
-
|
|
213
|
+
const isContextFull = contextPct !== null && contextPct > 85;
|
|
214
|
+
if (deps.hasActiveTasks && !isContextFull) {
|
|
214
215
|
try {
|
|
215
216
|
const active = await deps.hasActiveTasks(entry.agentId);
|
|
216
217
|
if (active) {
|
|
@@ -228,6 +229,12 @@ async function checkSessionTTL(deps) {
|
|
|
228
229
|
continue;
|
|
229
230
|
}
|
|
230
231
|
}
|
|
232
|
+
if (isContextFull) {
|
|
233
|
+
process.stderr.write(
|
|
234
|
+
`[exed] Session TTL: context-full override for ${entry.windowName} (${contextPct}% used) \u2014 killing despite active tasks
|
|
235
|
+
`
|
|
236
|
+
);
|
|
237
|
+
}
|
|
231
238
|
process.stderr.write(
|
|
232
239
|
`[exed] Session TTL: killing ${entry.windowName} (age=${ageHours.toFixed(1)}h, context=${contextPct}%, reason=${killReason})
|
|
233
240
|
`
|
|
@@ -311,6 +318,16 @@ async function pollIdleKill(deps, idleTickCounts, opts) {
|
|
|
311
318
|
ticksIdle: nextTicks
|
|
312
319
|
});
|
|
313
320
|
deps.killSession(entry.windowName);
|
|
321
|
+
try {
|
|
322
|
+
const { execFileSync: verifyExec } = await import("child_process");
|
|
323
|
+
verifyExec("tmux", ["has-session", "-t", entry.windowName], { timeout: 2e3 });
|
|
324
|
+
process.stderr.write(
|
|
325
|
+
`[exed] Idle kill FAILED for ${entry.windowName} \u2014 session still alive, retrying with force
|
|
326
|
+
`
|
|
327
|
+
);
|
|
328
|
+
verifyExec("tmux", ["kill-session", "-t", entry.windowName], { timeout: 3e3 });
|
|
329
|
+
} catch {
|
|
330
|
+
}
|
|
314
331
|
killed.push(entry.windowName);
|
|
315
332
|
idleTickCounts.delete(entry.windowName);
|
|
316
333
|
} else {
|
|
@@ -501,12 +518,16 @@ async function pollOrphanedTasks(deps, nowMs = Date.now()) {
|
|
|
501
518
|
process.stderr.write("[daemon-orch] list tmux sessions for orphan poll: " + (e instanceof Error ? e.message : String(e)) + "\n");
|
|
502
519
|
return [];
|
|
503
520
|
}
|
|
504
|
-
const
|
|
521
|
+
const liveAgentScopedCounts = /* @__PURE__ */ new Map();
|
|
505
522
|
for (const session of liveSessions) {
|
|
506
523
|
const agent = deps.parseAgentFromSession(session);
|
|
507
|
-
if (agent)
|
|
524
|
+
if (agent) {
|
|
525
|
+
const dashIdx = session.indexOf("-");
|
|
526
|
+
const scope = dashIdx >= 0 ? session.slice(dashIdx + 1) : session;
|
|
527
|
+
const scopedKey = `${agent}::${scope}`;
|
|
528
|
+
liveAgentScopedCounts.set(scopedKey, (liveAgentScopedCounts.get(scopedKey) ?? 0) + 1);
|
|
529
|
+
}
|
|
508
530
|
}
|
|
509
|
-
const liveAgents = new Set(liveAgentCounts.keys());
|
|
510
531
|
const coordinatorSessions = liveSessions.filter((s) => isExeSession(s));
|
|
511
532
|
let tasksByAgent;
|
|
512
533
|
try {
|
|
@@ -538,11 +559,11 @@ async function pollOrphanedTasks(deps, nowMs = Date.now()) {
|
|
|
538
559
|
const sessionScope = tasks[0].sessionScope;
|
|
539
560
|
if (!shouldAutoWake({
|
|
540
561
|
agentId,
|
|
541
|
-
hasRunningSession:
|
|
562
|
+
hasRunningSession: liveAgentScopedCounts.has(key),
|
|
542
563
|
lastSpawnMs: _autoWakeLastSpawn.get(key) ?? 0,
|
|
543
564
|
nowMs,
|
|
544
565
|
cooldownMs: AUTO_WAKE_COOLDOWN_MS,
|
|
545
|
-
runningInstances:
|
|
566
|
+
runningInstances: liveAgentScopedCounts.get(key) ?? 0,
|
|
546
567
|
pendingTaskGroups: tasks.length
|
|
547
568
|
})) {
|
|
548
569
|
continue;
|
|
@@ -738,18 +759,36 @@ async function cleanupStaleReviews(deps) {
|
|
|
738
759
|
function createStaleReviewRealDeps(getClient) {
|
|
739
760
|
return {
|
|
740
761
|
queryStaleReviews: async (thresholdDays) => {
|
|
741
|
-
const
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
projectName: null,
|
|
747
|
-
orderBy: "updated_at ASC",
|
|
748
|
-
limit: 1e3,
|
|
749
|
-
extraConditions: ["updated_at < datetime('now', '-' || ? || ' days')"],
|
|
750
|
-
extraArgs: [String(thresholdDays)]
|
|
762
|
+
const client = getClient();
|
|
763
|
+
const scopeRows = await client.execute({
|
|
764
|
+
sql: `SELECT DISTINCT session_scope FROM tasks
|
|
765
|
+
WHERE session_scope IS NOT NULL AND status NOT IN ('closed', 'cancelled')`,
|
|
766
|
+
args: []
|
|
751
767
|
});
|
|
752
|
-
|
|
768
|
+
const scopes = scopeRows.rows.map((r) => r.session_scope ? String(r.session_scope) : null);
|
|
769
|
+
scopes.push(null);
|
|
770
|
+
const allRows = [];
|
|
771
|
+
for (const scope of scopes) {
|
|
772
|
+
const rows = await queryTaskRows({
|
|
773
|
+
status: "needs_review",
|
|
774
|
+
columns: "id, title, assigned_to, updated_at",
|
|
775
|
+
sessionScope: scope,
|
|
776
|
+
strictSession: scope !== null,
|
|
777
|
+
projectName: null,
|
|
778
|
+
orderBy: "updated_at ASC",
|
|
779
|
+
limit: 1e3,
|
|
780
|
+
extraConditions: ["updated_at < datetime('now', '-' || ? || ' days')"],
|
|
781
|
+
extraArgs: [String(thresholdDays)]
|
|
782
|
+
});
|
|
783
|
+
allRows.push(...rows);
|
|
784
|
+
}
|
|
785
|
+
const seen = /* @__PURE__ */ new Set();
|
|
786
|
+
return allRows.filter((r) => {
|
|
787
|
+
const id = String(r.id);
|
|
788
|
+
if (seen.has(id)) return false;
|
|
789
|
+
seen.add(id);
|
|
790
|
+
return true;
|
|
791
|
+
}).map((r) => ({
|
|
753
792
|
taskId: String(r.id),
|
|
754
793
|
title: String(r.title),
|
|
755
794
|
assignedTo: String(r.assigned_to),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fastDbInit
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7E6ZBXO7.js";
|
|
4
4
|
import {
|
|
5
5
|
sessionScopeFilter
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OC7Q4LOK.js";
|
|
7
7
|
import {
|
|
8
8
|
formatStatusAll,
|
|
9
9
|
formatStatusDeep,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
getClient,
|
|
15
15
|
isCoordinatorRole,
|
|
16
16
|
loadEmployees
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2G2KOWBI.js";
|
|
18
18
|
import {
|
|
19
19
|
isMainModule
|
|
20
20
|
} from "./chunk-6Y4B3QF6.js";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SlackAdapter
|
|
3
|
+
} from "./chunk-ORCCI2VV.js";
|
|
1
4
|
import {
|
|
2
5
|
IMessageAdapter
|
|
3
6
|
} from "./chunk-FLSASUV3.js";
|
|
4
7
|
import {
|
|
5
8
|
createCRMWebhookHandler,
|
|
6
9
|
parseTwentyWebhook
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NL4YO6I2.js";
|
|
8
11
|
import {
|
|
9
12
|
WhatsAppAdapter
|
|
10
13
|
} from "./chunk-ECSNSHZ7.js";
|
|
@@ -17,9 +20,6 @@ import {
|
|
|
17
20
|
import {
|
|
18
21
|
DiscordAdapter
|
|
19
22
|
} from "./chunk-N5RRQOAC.js";
|
|
20
|
-
import {
|
|
21
|
-
SlackAdapter
|
|
22
|
-
} from "./chunk-ORCCI2VV.js";
|
|
23
23
|
import {
|
|
24
24
|
BotRegistry,
|
|
25
25
|
BotRuntime,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
retryWithBackoff,
|
|
43
43
|
routeMessage,
|
|
44
44
|
validateGatewayConfig
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-OHYMA6C3.js";
|
|
46
46
|
import {
|
|
47
47
|
OllamaProvider
|
|
48
48
|
} from "./chunk-FWFFZGSC.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-GNHN5HRQ.js";
|
|
4
4
|
import {
|
|
5
5
|
buildClaudeHttpMcpEntry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XYFPCAA2.js";
|
|
7
7
|
import {
|
|
8
8
|
EXE_HOOKS,
|
|
9
9
|
isLegacyHomeDirHookCommand,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-L3TB7CC3.js";
|
|
12
12
|
import {
|
|
13
13
|
ensureAllAgentSymlinks
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IWSXQKSB.js";
|
|
15
15
|
import {
|
|
16
16
|
MCP_LEGACY_KEY,
|
|
17
17
|
MCP_PRIMARY_KEY
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
recordSessionKill
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XEN5RMGU.js";
|
|
4
4
|
import {
|
|
5
5
|
sessionScopeFilter,
|
|
6
6
|
verifyPaneAtCapacity,
|
|
7
7
|
writeNotification
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OC7Q4LOK.js";
|
|
9
9
|
import {
|
|
10
10
|
listSessions
|
|
11
11
|
} from "./chunk-64WZEXXA.js";
|
|
12
12
|
import {
|
|
13
13
|
getTransport
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-A7KEWR6S.js";
|
|
15
15
|
import {
|
|
16
16
|
getClient,
|
|
17
17
|
isCoordinatorName
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-2G2KOWBI.js";
|
|
19
19
|
|
|
20
20
|
// src/lib/capacity-monitor.ts
|
|
21
21
|
var CAPACITY_PATTERNS = [
|
|
@@ -111,9 +111,9 @@ function _resetPendingCapacityKills() {
|
|
|
111
111
|
function _resetLastRelaunchCache() {
|
|
112
112
|
_lastRelaunch.clear();
|
|
113
113
|
}
|
|
114
|
-
async function lastResumeCreatedAtMs(agentId) {
|
|
114
|
+
async function lastResumeCreatedAtMs(agentId, sessionScope) {
|
|
115
115
|
const client = getClient();
|
|
116
|
-
const cmScope = sessionScopeFilter(null);
|
|
116
|
+
const cmScope = sessionScopeFilter(sessionScope ?? null);
|
|
117
117
|
const result = await client.execute({
|
|
118
118
|
sql: `SELECT MAX(created_at) AS last_created_at
|
|
119
119
|
FROM tasks
|
|
@@ -125,20 +125,21 @@ async function lastResumeCreatedAtMs(agentId) {
|
|
|
125
125
|
const parsed = Date.parse(String(raw));
|
|
126
126
|
return Number.isNaN(parsed) ? null : parsed;
|
|
127
127
|
}
|
|
128
|
-
async function isWithinRelaunchCooldown(agentId, now = Date.now()) {
|
|
129
|
-
const
|
|
128
|
+
async function isWithinRelaunchCooldown(agentId, now = Date.now(), sessionScope) {
|
|
129
|
+
const cacheKey = sessionScope ? `${agentId}::${sessionScope}` : agentId;
|
|
130
|
+
const cached = _lastRelaunch.get(cacheKey);
|
|
130
131
|
if (cached !== void 0) return now - cached < RELAUNCH_COOLDOWN_MS;
|
|
131
|
-
const persisted = await lastResumeCreatedAtMs(agentId);
|
|
132
|
+
const persisted = await lastResumeCreatedAtMs(agentId, sessionScope);
|
|
132
133
|
if (persisted === null) return false;
|
|
133
134
|
if (now - persisted >= RELAUNCH_COOLDOWN_MS) return false;
|
|
134
|
-
_lastRelaunch.set(
|
|
135
|
+
_lastRelaunch.set(cacheKey, persisted);
|
|
135
136
|
return true;
|
|
136
137
|
}
|
|
137
|
-
async function createOrRefreshResumeTask(agentId, projectDir, openTasks) {
|
|
138
|
+
async function createOrRefreshResumeTask(agentId, projectDir, openTasks, sessionScope) {
|
|
138
139
|
const client = getClient();
|
|
139
140
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
140
141
|
const context = buildResumeContext(agentId, openTasks);
|
|
141
|
-
const rdScope = sessionScopeFilter(null);
|
|
142
|
+
const rdScope = sessionScopeFilter(sessionScope ?? null);
|
|
142
143
|
const existing = await client.execute({
|
|
143
144
|
sql: `SELECT id FROM tasks
|
|
144
145
|
WHERE assigned_to = ?
|
|
@@ -182,7 +183,9 @@ async function pollCapacityDead() {
|
|
|
182
183
|
for (const entry of registered) {
|
|
183
184
|
const { windowName, agentId, projectDir } = entry;
|
|
184
185
|
if (!liveSessions.includes(windowName)) continue;
|
|
185
|
-
|
|
186
|
+
const cmDashIdx = windowName.indexOf("-");
|
|
187
|
+
const cmDerivedScope = cmDashIdx >= 0 ? windowName.slice(cmDashIdx + 1) : null;
|
|
188
|
+
if (await isWithinRelaunchCooldown(agentId, Date.now(), cmDerivedScope)) continue;
|
|
186
189
|
let pane;
|
|
187
190
|
try {
|
|
188
191
|
pane = transport.capturePane(windowName, 15);
|
|
@@ -246,7 +249,8 @@ async function pollCapacityDead() {
|
|
|
246
249
|
}
|
|
247
250
|
transport.kill(windowName);
|
|
248
251
|
void recordSessionKill({ sessionName: windowName, agentId, reason: "capacity" });
|
|
249
|
-
|
|
252
|
+
const coordCacheKey = cmDerivedScope ? `${agentId}::${cmDerivedScope}` : agentId;
|
|
253
|
+
_lastRelaunch.set(coordCacheKey, Date.now());
|
|
250
254
|
relaunched.push(agentId);
|
|
251
255
|
} catch (err) {
|
|
252
256
|
process.stderr.write(
|
|
@@ -264,7 +268,9 @@ async function pollCapacityDead() {
|
|
|
264
268
|
reason: "capacity"
|
|
265
269
|
});
|
|
266
270
|
const client = getClient();
|
|
267
|
-
const
|
|
271
|
+
const dashIdx = windowName.indexOf("-");
|
|
272
|
+
const derivedScope = dashIdx >= 0 ? windowName.slice(dashIdx + 1) : null;
|
|
273
|
+
const rlScope = sessionScopeFilter(derivedScope);
|
|
268
274
|
const openTasks = await client.execute({
|
|
269
275
|
sql: `SELECT id, title, priority, task_file, status
|
|
270
276
|
FROM tasks
|
|
@@ -285,7 +291,8 @@ async function pollCapacityDead() {
|
|
|
285
291
|
const { created } = await createOrRefreshResumeTask(
|
|
286
292
|
agentId,
|
|
287
293
|
projectDir,
|
|
288
|
-
openTasks.rows
|
|
294
|
+
openTasks.rows,
|
|
295
|
+
derivedScope
|
|
289
296
|
);
|
|
290
297
|
if (created) {
|
|
291
298
|
await writeNotification({
|
|
@@ -296,7 +303,8 @@ async function pollCapacityDead() {
|
|
|
296
303
|
summary: `${agentId} hit context capacity. Auto-relaunched with ${openTasks.rows.length} open task(s).`
|
|
297
304
|
});
|
|
298
305
|
}
|
|
299
|
-
|
|
306
|
+
const cacheKey = derivedScope ? `${agentId}::${derivedScope}` : agentId;
|
|
307
|
+
_lastRelaunch.set(cacheKey, Date.now());
|
|
300
308
|
if (created) relaunched.push(agentId);
|
|
301
309
|
} catch (err) {
|
|
302
310
|
process.stderr.write(
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
findScopedDuplicate,
|
|
3
3
|
governMemoryRecord,
|
|
4
4
|
schedulePostWriteMemoryHygiene
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LYMBXTEO.js";
|
|
6
6
|
import {
|
|
7
7
|
orgBus
|
|
8
8
|
} from "./chunk-MP2AFCGL.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ensureSchema,
|
|
12
12
|
getClient,
|
|
13
13
|
initTurso
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2G2KOWBI.js";
|
|
15
15
|
import {
|
|
16
16
|
EMBEDDING_DIM
|
|
17
17
|
} from "./chunk-FXU7JOXK.js";
|
|
@@ -119,7 +119,7 @@ async function initStore(options) {
|
|
|
119
119
|
);
|
|
120
120
|
_nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
|
|
121
121
|
try {
|
|
122
|
-
const { loadGlobalProcedures } = await import("./global-procedures-
|
|
122
|
+
const { loadGlobalProcedures } = await import("./global-procedures-P7VOE476.js");
|
|
123
123
|
await loadGlobalProcedures();
|
|
124
124
|
} catch (e) {
|
|
125
125
|
logStoreWarn("catch", e);
|
|
@@ -236,7 +236,7 @@ async function writeMemory(record) {
|
|
|
236
236
|
procedure_for: record.procedure_for ?? null
|
|
237
237
|
};
|
|
238
238
|
try {
|
|
239
|
-
const { checkMemoryPoisoning } = await import("./memory-poisoning-defense-
|
|
239
|
+
const { checkMemoryPoisoning } = await import("./memory-poisoning-defense-OJ2DEGBA.js");
|
|
240
240
|
const poisonResult = await checkMemoryPoisoning({
|
|
241
241
|
memoryId: dbRow.id,
|
|
242
242
|
vector: Array.isArray(dbRow.vector) ? dbRow.vector : void 0,
|
|
@@ -410,13 +410,13 @@ async function flushBatch() {
|
|
|
410
410
|
}
|
|
411
411
|
_nextVersion = baseVersion;
|
|
412
412
|
try {
|
|
413
|
-
const { insertMemoryCardsForBatch } = await import("./memory-cards-
|
|
413
|
+
const { insertMemoryCardsForBatch } = await import("./memory-cards-NTRYLVOU.js");
|
|
414
414
|
await insertMemoryCardsForBatch(batch);
|
|
415
415
|
} catch (e) {
|
|
416
416
|
logStoreWarn("catch", e);
|
|
417
417
|
}
|
|
418
418
|
try {
|
|
419
|
-
const { insertOntologyForBatch } = await import("./agentic-ontology-
|
|
419
|
+
const { insertOntologyForBatch } = await import("./agentic-ontology-NU5FACOX.js");
|
|
420
420
|
await insertOntologyForBatch(batch);
|
|
421
421
|
} catch (e) {
|
|
422
422
|
logStoreWarn("catch", e);
|
|
@@ -26,14 +26,19 @@ function _resetPushConfig() {
|
|
|
26
26
|
_cachedConfig = null;
|
|
27
27
|
_notifyOn = null;
|
|
28
28
|
}
|
|
29
|
-
function sendDesktopNotification(title, body) {
|
|
29
|
+
function sendDesktopNotification(title, body, sessionScope) {
|
|
30
30
|
try {
|
|
31
31
|
const safeTitle = title.replace(/["\\\n]/g, " ").slice(0, 100);
|
|
32
32
|
const safeBody = body.replace(/["\\\n]/g, " ").slice(0, 200);
|
|
33
33
|
try {
|
|
34
34
|
const osc9 = `\x1B]9;${safeTitle}: ${safeBody}\x07`;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
let coordinatorSession;
|
|
36
|
+
if (sessionScope) {
|
|
37
|
+
coordinatorSession = sessionScope;
|
|
38
|
+
} else {
|
|
39
|
+
const sessions = execSync("tmux list-sessions -F '#{session_name}' 2>/dev/null", { encoding: "utf8", timeout: 2e3 }).trim().split("\n");
|
|
40
|
+
coordinatorSession = sessions.find((s) => /^exe\d*$/.test(s));
|
|
41
|
+
}
|
|
37
42
|
if (coordinatorSession) {
|
|
38
43
|
execSync(`printf '${osc9.replace(/'/g, "'\\''")}' > /dev/tty 2>/dev/null || tmux display-message -p -t ${coordinatorSession} '' 2>/dev/null`, { timeout: 2e3, stdio: "ignore" });
|
|
39
44
|
return true;
|
|
@@ -111,7 +116,7 @@ async function pushNotify(msg) {
|
|
|
111
116
|
if (!notifyOn.has(msg.event)) return result;
|
|
112
117
|
const formatted = formatMessage(msg);
|
|
113
118
|
if (config.desktop !== false) {
|
|
114
|
-
result.desktop = sendDesktopNotification(msg.title, msg.body);
|
|
119
|
+
result.desktop = sendDesktopNotification(msg.title, msg.body, msg.sessionScope);
|
|
115
120
|
}
|
|
116
121
|
if (config.telegram?.bot_token && config.telegram?.chat_id) {
|
|
117
122
|
result.telegram = await sendTelegram(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PLATFORM_PROCEDURE_TITLES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MWRHXGAB.js";
|
|
4
4
|
import {
|
|
5
5
|
getClient,
|
|
6
6
|
getIdentity,
|
|
7
7
|
listIdentities,
|
|
8
8
|
updateIdentity
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2G2KOWBI.js";
|
|
10
10
|
import {
|
|
11
11
|
atomicWriteJsonSync
|
|
12
12
|
} from "./chunk-LYH5HE24.js";
|
|
@@ -201,12 +201,12 @@ function checkMcpTransport() {
|
|
|
201
201
|
detail: jsonRpcError ? "MCP HTTP endpoint reachable; missing-session probe returns JSON-RPC (expected)" : "MCP HTTP endpoint reachable but did not return expected JSON-RPC missing-session response"
|
|
202
202
|
});
|
|
203
203
|
} catch (err) {
|
|
204
|
-
const
|
|
205
|
-
const
|
|
204
|
+
const msg = err instanceof Error ? err.message.slice(0, 180) : String(err);
|
|
205
|
+
const timedOut = msg.includes("ETIMEDOUT") || msg.includes("timed out") || msg.includes("killed");
|
|
206
206
|
results.push({
|
|
207
207
|
name: "mcp/http-endpoint",
|
|
208
208
|
pass: false,
|
|
209
|
-
detail:
|
|
209
|
+
detail: timedOut ? "Daemon alive but MCP unresponsive (timed out after 1.5s)" : `MCP HTTP endpoint not reachable: ${msg}`
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
212
|
} else if (daemonAlive) {
|