@askexenow/exe-os 0.9.199 → 0.9.200
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-O433V5SV.js → active-agent-J3YKAXE2.js} +2 -2
- package/dist/{active-agent-PWI2YWBG.js → active-agent-LCEW3PSL.js} +2 -2
- package/dist/{agentic-ontology-64X76FKF.js → agentic-ontology-N5HXDWIN.js} +1 -1
- package/dist/{backfill-metadata-RL7T4XGY.js → backfill-metadata-LIACQP2F.js} +3 -3
- package/dist/{behaviors-ZW4BWUGD.js → behaviors-GXMZW7B3.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 +4 -4
- package/dist/bin/backfill-responses.js +4 -4
- package/dist/bin/backfill-vectors.js +5 -5
- package/dist/bin/bulk-sync-postgres.js +5 -5
- package/dist/bin/cleanup-stale-review-tasks.js +7 -6
- package/dist/bin/cli.js +13 -13
- package/dist/bin/deferred-daemon-restart.js +1 -1
- package/dist/bin/exe-agent-config.js +1 -1
- package/dist/bin/exe-agent.js +4 -4
- package/dist/bin/exe-assign.js +6 -6
- package/dist/bin/exe-boot.js +14 -13
- package/dist/bin/exe-call.js +3 -3
- package/dist/bin/exe-cloud.js +3 -3
- package/dist/bin/exe-dispatch.js +7 -6
- 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-heartbeat.js +7 -6
- package/dist/bin/exe-kill.js +10 -9
- package/dist/bin/exe-launch-agent.js +9 -9
- package/dist/bin/exe-new-employee.js +5 -5
- package/dist/bin/exe-pending-messages.js +8 -7
- package/dist/bin/exe-pending-notifications.js +7 -6
- package/dist/bin/exe-pending-reviews.js +7 -6
- package/dist/bin/exe-rename.js +3 -3
- package/dist/bin/exe-review.js +9 -8
- package/dist/bin/exe-search.js +4 -4
- package/dist/bin/exe-session-cleanup.js +11 -10
- 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 -7
- package/dist/bin/exe-team.js +2 -2
- package/dist/bin/git-sweep.js +7 -6
- package/dist/bin/graph-backfill.js +3 -3
- package/dist/bin/graph-export.js +4 -4
- package/dist/bin/import-history.js +4 -4
- package/dist/bin/install.js +6 -6
- package/dist/bin/intercom-check.js +4 -4
- package/dist/bin/orchestration-metrics.js +47 -0
- package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
- package/dist/bin/postgres-agentic-semantic-backfill.js +4 -4
- package/dist/bin/scan-tasks.js +7 -6
- package/dist/bin/setup.js +1 -1
- package/dist/bin/shard-migrate.js +3 -3
- package/dist/bin/stack-update.js +1 -1
- package/dist/bin/vps-health-gate.js +1 -1
- package/dist/{capacity-monitor-2TRPP3AX.js → capacity-monitor-HJSJ2PCF.js} +8 -7
- package/dist/{catchup-brief-74ORL525.js → catchup-brief-XD7IJBMN.js} +9 -8
- package/dist/{chunk-7WUBXLK2.js → chunk-2EYYW724.js} +2 -2
- package/dist/{chunk-TGOJR5SS.js → chunk-3HM6MZ4O.js} +36 -0
- package/dist/{chunk-JRLSQFIE.js → chunk-43HRNKQX.js} +68 -68
- package/dist/{chunk-4X7CMJDN.js → chunk-6UZHYTLV.js} +42 -7
- package/dist/{chunk-M7NGABPF.js → chunk-7BNZUXFJ.js} +1 -1
- package/dist/{chunk-5YVGHP2B.js → chunk-7Y4F7IPJ.js} +8 -8
- package/dist/{chunk-GIIRWR35.js → chunk-7YTVWNSS.js} +2 -2
- package/dist/{chunk-JW3MATT5.js → chunk-ATVB6CY7.js} +1 -1
- package/dist/{chunk-6BJ5GZD4.js → chunk-AVRQWLQR.js} +6 -6
- package/dist/{chunk-2DWKMJPE.js → chunk-AWYLVIGA.js} +2 -2
- package/dist/chunk-BDRSCPCG.js +221 -0
- package/dist/{chunk-WSYFZZCP.js → chunk-C5A3L3HS.js} +2 -2
- package/dist/{chunk-KTJ57PVS.js → chunk-CBAW3YFB.js} +1 -1
- package/dist/{chunk-L7ZYZCJ5.js → chunk-D42R5MZU.js} +1 -1
- package/dist/{chunk-65K2BQTG.js → chunk-E5P2TY4E.js} +1 -1
- package/dist/{chunk-K6K55GMZ.js → chunk-EEG6E34W.js} +1 -1
- package/dist/{chunk-JDHB6I4O.js → chunk-F3QROFHP.js} +2 -2
- package/dist/{chunk-5XAGTHF2.js → chunk-GKQXZZBT.js} +1 -1
- package/dist/{chunk-2HEXCZGP.js → chunk-GR53PEEH.js} +1 -1
- package/dist/{chunk-FDD7KX7Q.js → chunk-GSKJ72LT.js} +7 -7
- package/dist/{chunk-OO5EWGC6.js → chunk-HGO5VFED.js} +1 -1
- package/dist/{chunk-JSMOQRIV.js → chunk-HUIYZHN3.js} +1 -1
- package/dist/{chunk-V5U3FYDZ.js → chunk-HVUBZOOT.js} +2 -2
- package/dist/{chunk-JPZQM7VW.js → chunk-IOEK5ZX6.js} +1 -1
- package/dist/{chunk-JDGCEOT4.js → chunk-K3FJHQ3F.js} +2 -2
- package/dist/{chunk-QPSUK5HA.js → chunk-K6A7ZE2F.js} +1 -1
- package/dist/{chunk-BO3ZQIWF.js → chunk-KEJ3HOBN.js} +1 -1
- package/dist/{chunk-FBTIOBF6.js → chunk-KVVCXK3J.js} +3 -3
- package/dist/{chunk-ACOQS4ZL.js → chunk-LKBN6BFL.js} +2 -2
- package/dist/{chunk-RUKOGGQG.js → chunk-LLYF22CH.js} +2 -2
- package/dist/{chunk-YT67TJQZ.js → chunk-LPPCJZVI.js} +1 -1
- package/dist/{chunk-JQLWMZZJ.js → chunk-LWM3FUGY.js} +1 -1
- package/dist/{chunk-PHIQW2IU.js → chunk-LWYXWPZZ.js} +6 -6
- package/dist/{chunk-KRYEHI4V.js → chunk-NOSCV7MH.js} +3 -3
- package/dist/{chunk-OYU7TCBG.js → chunk-OOMA2AEM.js} +1 -1
- package/dist/{chunk-SKXHR35T.js → chunk-OW4QI3K4.js} +3 -3
- package/dist/{chunk-CGAYSKQF.js → chunk-P4LUVVX4.js} +5 -5
- package/dist/{chunk-FXVTLBBA.js → chunk-P6PKNRFD.js} +3 -3
- package/dist/{chunk-DNEOEKWA.js → chunk-PIJSZELU.js} +2 -2
- package/dist/{chunk-BDYUENC7.js → chunk-QOW5EEYO.js} +1 -1
- package/dist/{chunk-ZAF4GJTD.js → chunk-QQXMGLSN.js} +9 -9
- package/dist/{chunk-OF6TXNOC.js → chunk-SUNFUS3O.js} +1 -1
- package/dist/{chunk-ZLP5TNRU.js → chunk-TBZB4PPZ.js} +3 -3
- package/dist/{chunk-YZIUQ77U.js → chunk-TJHE2HYS.js} +3 -3
- package/dist/{chunk-ZHINF5CG.js → chunk-VQB4VBEQ.js} +1 -1
- package/dist/{chunk-IFFVONU6.js → chunk-WVNKXOWZ.js} +1 -1
- package/dist/{chunk-MABQMUCQ.js → chunk-WXQRFDY4.js} +230 -18
- package/dist/{chunk-CWY3M4SR.js → chunk-X2KLWLCB.js} +1 -1
- package/dist/{chunk-MWGAC2ER.js → chunk-X33TOTUD.js} +2 -2
- package/dist/{chunk-WATDOTGK.js → chunk-XZQWEY5S.js} +1 -1
- package/dist/{chunk-2GJWENBT.js → chunk-Y35YW6EL.js} +1 -1
- package/dist/{chunk-6FBYGI2H.js → chunk-YZNGBIXU.js} +1 -1
- package/dist/{chunk-UWMFQKOB.js → chunk-Z4FV45FW.js} +1 -1
- package/dist/{chunk-XNXTN5XZ.js → chunk-Z6AUK6YH.js} +1 -1
- package/dist/{chunk-OGQX7HLN.js → chunk-ZB3TDCXG.js} +1 -1
- package/dist/{chunk-WRCETUYE.js → chunk-ZZODXCWK.js} +1 -1
- package/dist/{co-occurrence-OVDIX3OS.js → co-occurrence-6OAMOUTF.js} +1 -1
- package/dist/{code-context-index-TBCTP47N.js → code-context-index-JPQDRTTX.js} +2 -2
- package/dist/{crdt-sync-L42FZQ7O.js → crdt-sync-6EI7LAPI.js} +1 -1
- package/dist/{crm-webhook-OFWPEK33.js → crm-webhook-LEWQNEDD.js} +2 -2
- package/dist/{cto-delegation-gate-7PGS5IN4.js → cto-delegation-gate-GXRHD4WX.js} +6 -5
- package/dist/{daemon-orchestration-MP3PPX7Q.js → daemon-orchestration-QOKZVECP.js} +9 -8
- package/dist/{exe-drift-BUFQKOM5.js → exe-drift-N2IDPAQ7.js} +2 -2
- package/dist/{exe-export-QMGWH3PL.js → exe-export-63FYZTV3.js} +4 -4
- package/dist/{exe-import-7NNKSCKI.js → exe-import-T5OPTK5T.js} +4 -4
- package/dist/{exe-key-QZ5GWV6D.js → exe-key-ROFJ6HUG.js} +1 -1
- package/dist/{fast-db-init-DAZZ7ZUP.js → fast-db-init-GC4SYSFV.js} +1 -1
- package/dist/gateway/index.js +9 -9
- package/dist/{git-staleness-JY7PJT6F.js → git-staleness-QKURDEMW.js} +1 -1
- package/dist/{git-task-sweep-SLANXCSW.js → git-task-sweep-5YHZF2E5.js} +7 -6
- package/dist/{global-procedures-GKQGLYXQ.js → global-procedures-PQKUKKM6.js} +2 -2
- package/dist/{graph-auto-extract-5OYWXUKD.js → graph-auto-extract-GUEMG3Q3.js} +1 -1
- package/dist/hooks/bug-report-worker.js +8 -7
- package/dist/hooks/codex-stop-task-finalizer.js +8 -7
- package/dist/hooks/commit-complete.js +9 -8
- package/dist/hooks/error-recall.js +5 -5
- package/dist/hooks/exe-heartbeat-hook.js +2 -2
- package/dist/hooks/ingest-worker.js +2 -2
- package/dist/hooks/ingest.js +5 -5
- package/dist/hooks/instructions-loaded.js +3 -3
- package/dist/hooks/manifest.json +20 -20
- package/dist/hooks/notification.js +3 -3
- package/dist/hooks/post-compact.js +8 -7
- package/dist/hooks/post-tool-combined.js +5 -5
- package/dist/hooks/pre-compact.js +11 -10
- package/dist/hooks/pre-tool-use.js +12 -11
- package/dist/hooks/prompt-submit.js +18 -17
- package/dist/hooks/session-end.js +14 -13
- package/dist/hooks/session-start.js +7 -7
- package/dist/hooks/stop.js +15 -14
- package/dist/hooks/subagent-stop.js +8 -7
- package/dist/hooks/summary-worker.js +14 -13
- package/dist/index.js +15 -14
- package/dist/{installer-CWKEI7SE.js → installer-AYN7WB62.js} +4 -4
- package/dist/{installer-DWVZFKAH.js → installer-D4XB27FY.js} +4 -4
- package/dist/{installer-GSA2KOSE.js → installer-Z4LBQTL6.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-daemon-client.js +1 -1
- package/dist/lib/db.js +1 -1
- package/dist/lib/embedder.js +2 -2
- package/dist/lib/employee-templates.js +3 -3
- package/dist/lib/employees.js +1 -1
- package/dist/lib/exe-daemon-client.js +1 -1
- package/dist/lib/exe-daemon.js +47 -23
- package/dist/lib/hybrid-search.js +4 -4
- package/dist/lib/identity.js +1 -1
- package/dist/lib/messaging.js +7 -6
- 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 -6
- package/dist/lib/tmux-routing.js +6 -5
- package/dist/lib/token-spend.js +2 -2
- package/dist/mcp/register-tools.js +49 -48
- package/dist/mcp/server.js +50 -49
- 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 -8
- 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 -8
- package/dist/mcp/tools/send-message.js +9 -8
- package/dist/mcp/tools/update-task.js +8 -7
- package/dist/{mcp-http-config-YOB4QWYP.js → mcp-http-config-JFGNXQ5M.js} +2 -2
- package/dist/{memory-cards-UPFWA3YQ.js → memory-cards-QHCHERFV.js} +1 -1
- package/dist/{memory-graph-extractor-XTH3U6QS.js → memory-graph-extractor-RAF4M3YY.js} +2 -2
- package/dist/{memory-poisoning-defense-WDSEUEBW.js → memory-poisoning-defense-M4E6D6NI.js} +1 -1
- package/dist/{memory-queue-client-FJOLJYUK.js → memory-queue-client-XCBQIT3T.js} +2 -2
- package/dist/{memory-reflection-A2PLKX7A.js → memory-reflection-OVQDAOKW.js} +1 -1
- package/dist/{notifications-WYNI5OG6.js → notifications-QCZJTMU4.js} +6 -5
- package/dist/{orchestrator-FRFCMLW3.js → orchestrator-RETZBZNU.js} +8 -7
- package/dist/{plan-limits-FKTRN25T.js → plan-limits-KY5FB6FM.js} +2 -2
- package/dist/{projection-worker-R2JOVCXX.js → projection-worker-B4FYF4FS.js} +1 -1
- package/dist/{reranker-2ZWUZRUF.js → reranker-DLESU7S4.js} +1 -1
- package/dist/{review-polling-ADP5YFHW.js → review-polling-S4HD536T.js} +7 -6
- package/dist/runtime/index.js +13 -12
- package/dist/{session-events-JA3MCMZK.js → session-events-TRCSYKGW.js} +7 -6
- package/dist/{session-kill-telemetry-GV7LE56P.js → session-kill-telemetry-WBB7YHWC.js} +2 -2
- package/dist/{session-scope-LXQKQDIS.js → session-scope-H6H7EVMH.js} +6 -5
- package/dist/{setup-wizard-GRR4F4TX.js → setup-wizard-QGJEHEJP.js} +1 -1
- package/dist/{skill-refinement-3UVLBCZD.js → skill-refinement-DDFALKOD.js} +1 -1
- package/dist/{stack-update-C4BAPLXJ.js → stack-update-Q2WQOJTS.js} +1 -1
- package/dist/{task-enforcement-KSLBFILH.js → task-enforcement-7NCE6NJC.js} +25 -5
- package/dist/{task-scope-AI62AIPT.js → task-scope-C7QECQSB.js} +6 -5
- package/dist/{tasks-crud-IEOK55IV.js → tasks-crud-4VGXAUW5.js} +6 -5
- package/dist/{tasks-review-ID7V6RSR.js → tasks-review-ATHR7IZK.js} +6 -5
- package/dist/{token-budget-Z4ONSQLC.js → token-budget-2ZZRFSHF.js} +1 -1
- package/dist/{tool-capability-index-2MHWYQH5.js → tool-capability-index-6ICPKH5O.js} +1 -1
- package/dist/{tool-telemetry-Z46QEUD5.js → tool-telemetry-EWE2YR2K.js} +1 -1
- package/dist/tui/App.js +14 -13
- package/dist/{tui-data-HIFVW2PE.js → tui-data-LQQ66HCW.js} +6 -5
- package/dist/{worker-gate-F3L7XDMJ.js → worker-gate-POIBNVX7.js} +1 -1
- package/dist/{workflow-engine-H5KTDDJG.js → workflow-engine-MA2H5JEZ.js} +2 -2
- package/package.json +2 -1
- package/release-notes.json +101 -104
- /package/dist/{chunk-MQLMIY6U.js → chunk-2GHDAIDB.js} +0 -0
- /package/dist/{chunk-NF4AEKQK.js → chunk-35ES3HTI.js} +0 -0
- /package/dist/{chunk-MNNWWEVJ.js → chunk-6YFGFW4V.js} +0 -0
- /package/dist/{chunk-KBZM7HRB.js → chunk-GOA7VQT7.js} +0 -0
- /package/dist/{chunk-54MZI4PK.js → chunk-I3B4QG5C.js} +0 -0
- /package/dist/{chunk-AFJWUI3Y.js → chunk-JMMYWY7C.js} +0 -0
- /package/dist/{chunk-G5GFP5J6.js → chunk-LZPZ67IT.js} +0 -0
- /package/dist/{chunk-OO5CPMT3.js → chunk-SY4TZ224.js} +0 -0
- /package/dist/{chunk-GHCVD7WV.js → chunk-XJTHRKML.js} +0 -0
- /package/dist/{core-memory-VQKCHGFX.js → core-memory-4QNM6MZ5.js} +0 -0
- /package/dist/{entity-boost-WEQDV6P6.js → entity-boost-QXR3LCYV.js} +0 -0
- /package/dist/{message-queue-client-BR7DXK7J.js → message-queue-client-CUCAQME6.js} +0 -0
- /package/dist/{wiki-acl-DDF2QQOD.js → wiki-acl-UTITDXLT.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionScopeFilter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WXQRFDY4.js";
|
|
4
4
|
|
|
5
5
|
// src/lib/git-task-sweep.ts
|
|
6
6
|
import { execSync } from "child_process";
|
|
@@ -178,7 +178,7 @@ async function sweepTasks(projectName, options = {}) {
|
|
|
178
178
|
}
|
|
179
179
|
if (!dryRun) {
|
|
180
180
|
try {
|
|
181
|
-
const { updateTaskStatus } = await import("./tasks-crud-
|
|
181
|
+
const { updateTaskStatus } = await import("./tasks-crud-4VGXAUW5.js");
|
|
182
182
|
await updateTaskStatus({
|
|
183
183
|
taskId: task.id,
|
|
184
184
|
status: "needs_review",
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
buildRawVisibilityFilter,
|
|
4
4
|
buildWikiScopeFilter,
|
|
5
5
|
searchMemories
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6UZHYTLV.js";
|
|
7
7
|
import {
|
|
8
8
|
getClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3HM6MZ4O.js";
|
|
10
10
|
|
|
11
11
|
// src/lib/hybrid-search.ts
|
|
12
12
|
var RRF_K = 60;
|
|
@@ -233,7 +233,7 @@ async function hybridSearch(queryText, agentId, options) {
|
|
|
233
233
|
let rerankerAvailable = false;
|
|
234
234
|
if (process.env.EXE_IS_DAEMON === "1") {
|
|
235
235
|
try {
|
|
236
|
-
const { isRerankerAvailable } = await import("./reranker-
|
|
236
|
+
const { isRerankerAvailable } = await import("./reranker-DLESU7S4.js");
|
|
237
237
|
rerankerAvailable = isRerankerAvailable();
|
|
238
238
|
} catch {
|
|
239
239
|
}
|
|
@@ -288,7 +288,7 @@ async function hybridSearch(queryText, agentId, options) {
|
|
|
288
288
|
]).catch(() => []),
|
|
289
289
|
includeStructuredCards ? (async () => {
|
|
290
290
|
try {
|
|
291
|
-
const { searchMemoryCards } = await import("./memory-cards-
|
|
291
|
+
const { searchMemoryCards } = await import("./memory-cards-QHCHERFV.js");
|
|
292
292
|
return await searchMemoryCards(effectiveQuery, agentId, fetchOptions);
|
|
293
293
|
} catch {
|
|
294
294
|
return [];
|
|
@@ -297,7 +297,7 @@ async function hybridSearch(queryText, agentId, options) {
|
|
|
297
297
|
// Reflection insights: patterns, contradictions, summaries across sessions
|
|
298
298
|
includeStructuredCards ? (async () => {
|
|
299
299
|
try {
|
|
300
|
-
const { searchReflections } = await import("./memory-reflection-
|
|
300
|
+
const { searchReflections } = await import("./memory-reflection-OVQDAOKW.js");
|
|
301
301
|
const insights = await searchReflections(effectiveQuery, agentId, 5);
|
|
302
302
|
return insights.map((ins) => ({
|
|
303
303
|
id: ins.id,
|
|
@@ -373,7 +373,7 @@ async function hybridSearch(queryText, agentId, options) {
|
|
|
373
373
|
let entityBoostRan = false;
|
|
374
374
|
if (merged.length > 0) {
|
|
375
375
|
try {
|
|
376
|
-
const { applyEntityBoost } = await import("./entity-boost-
|
|
376
|
+
const { applyEntityBoost } = await import("./entity-boost-QXR3LCYV.js");
|
|
377
377
|
const boosted = await applyEntityBoost(merged, effectiveQuery, getClient());
|
|
378
378
|
merged = boosted.results;
|
|
379
379
|
graphContextMap = boosted.graphContext;
|
|
@@ -397,7 +397,7 @@ async function hybridSearch(queryText, agentId, options) {
|
|
|
397
397
|
try {
|
|
398
398
|
let rerankedRecords;
|
|
399
399
|
if (graphContextMap.size > 0) {
|
|
400
|
-
const { rerankWithContext } = await import("./reranker-
|
|
400
|
+
const { rerankWithContext } = await import("./reranker-DLESU7S4.js");
|
|
401
401
|
const candidates = merged.map((m) => ({
|
|
402
402
|
text: m.raw_text,
|
|
403
403
|
context: graphContextMap.get(m.id)
|
|
@@ -405,7 +405,7 @@ async function hybridSearch(queryText, agentId, options) {
|
|
|
405
405
|
const scored = await rerankWithContext(effectiveQuery, candidates, rerankReturnLimit);
|
|
406
406
|
rerankedRecords = scored.map((s) => merged[s.index]);
|
|
407
407
|
} else {
|
|
408
|
-
const { rerank } = await import("./reranker-
|
|
408
|
+
const { rerank } = await import("./reranker-DLESU7S4.js");
|
|
409
409
|
rerankedRecords = await rerank(effectiveQuery, merged, rerankReturnLimit);
|
|
410
410
|
}
|
|
411
411
|
if (rerankedRecords.length > 0) {
|
|
@@ -722,7 +722,7 @@ async function lightweightSearch(queryText, agentId, options) {
|
|
|
722
722
|
}
|
|
723
723
|
if (options?.includeStructuredCards !== true) return results;
|
|
724
724
|
try {
|
|
725
|
-
const { searchMemoryCards } = await import("./memory-cards-
|
|
725
|
+
const { searchMemoryCards } = await import("./memory-cards-QHCHERFV.js");
|
|
726
726
|
const cardResults = await searchMemoryCards(queryText, agentId, options);
|
|
727
727
|
if (cardResults.length > 0) {
|
|
728
728
|
return rrfMergeMulti([results, cardResults], limit, RRF_K, [1, 0.85]);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
recordSessionKill
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZZODXCWK.js";
|
|
4
4
|
import {
|
|
5
5
|
sessionScopeFilter,
|
|
6
6
|
verifyPaneAtCapacity,
|
|
7
7
|
writeNotification
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WXQRFDY4.js";
|
|
9
9
|
import {
|
|
10
10
|
listSessions
|
|
11
11
|
} from "./chunk-64WZEXXA.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
getClient,
|
|
17
17
|
isCoordinatorName
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3HM6MZ4O.js";
|
|
19
19
|
|
|
20
20
|
// src/lib/capacity-monitor.ts
|
|
21
21
|
var CAPACITY_PATTERNS = [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateTask
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AVRQWLQR.js";
|
|
4
4
|
import {
|
|
5
5
|
TASK_ALREADY_CLAIMED_PREFIX
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WXQRFDY4.js";
|
|
7
7
|
|
|
8
8
|
// src/mcp/tools/update-task.ts
|
|
9
9
|
import { z } from "zod";
|
|
@@ -23,7 +23,7 @@ function registerUpdateTask(server) {
|
|
|
23
23
|
const status = rawStatus;
|
|
24
24
|
let callerAgentId;
|
|
25
25
|
try {
|
|
26
|
-
const { getActiveAgent: getAgent } = await import("./active-agent-
|
|
26
|
+
const { getActiveAgent: getAgent } = await import("./active-agent-J3YKAXE2.js");
|
|
27
27
|
callerAgentId = getAgent().agentId;
|
|
28
28
|
} catch {
|
|
29
29
|
}
|
|
@@ -111,7 +111,7 @@ function releaseBackfillLock() {
|
|
|
111
111
|
}
|
|
112
112
|
async function getTaskAwareCapacity() {
|
|
113
113
|
const { getClient } = await import("./lib/database.js");
|
|
114
|
-
const { sessionScopeFilter } = await import("./task-scope-
|
|
114
|
+
const { sessionScopeFilter } = await import("./task-scope-C7QECQSB.js");
|
|
115
115
|
const client = getClient();
|
|
116
116
|
const scope = sessionScopeFilter();
|
|
117
117
|
const result = await client.execute({
|
|
@@ -7,12 +7,15 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
registerSession
|
|
9
9
|
} from "./chunk-64WZEXXA.js";
|
|
10
|
+
import {
|
|
11
|
+
getTransport
|
|
12
|
+
} from "./chunk-TXWQPL2U.js";
|
|
10
13
|
import {
|
|
11
14
|
listTmuxSessions
|
|
12
15
|
} from "./chunk-GZIAQYGI.js";
|
|
13
16
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
recordOrchestrationEventBestEffort
|
|
18
|
+
} from "./chunk-BDRSCPCG.js";
|
|
16
19
|
import {
|
|
17
20
|
DEFAULT_PROVIDER,
|
|
18
21
|
PROVIDER_TABLE,
|
|
@@ -30,7 +33,7 @@ import {
|
|
|
30
33
|
import {
|
|
31
34
|
PlanLimitError,
|
|
32
35
|
assertEmployeeLimitSync
|
|
33
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-VQB4VBEQ.js";
|
|
34
37
|
import {
|
|
35
38
|
getSessionKey
|
|
36
39
|
} from "./chunk-CVYC6DUW.js";
|
|
@@ -45,7 +48,7 @@ import {
|
|
|
45
48
|
} from "./chunk-MP2AFCGL.js";
|
|
46
49
|
import {
|
|
47
50
|
ensureAgentSymlink
|
|
48
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-ATVB6CY7.js";
|
|
49
52
|
import {
|
|
50
53
|
expandDualPrefixTools
|
|
51
54
|
} from "./chunk-HYZV25LY.js";
|
|
@@ -57,7 +60,7 @@ import {
|
|
|
57
60
|
isCoordinatorName,
|
|
58
61
|
loadEmployees,
|
|
59
62
|
loadEmployeesSync
|
|
60
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-3HM6MZ4O.js";
|
|
61
64
|
import {
|
|
62
65
|
loadDeviceId
|
|
63
66
|
} from "./chunk-MVMMULOJ.js";
|
|
@@ -360,7 +363,7 @@ async function createTaskCore(input) {
|
|
|
360
363
|
if (isCoordinatorSession) {
|
|
361
364
|
earlySessionScope = resolved;
|
|
362
365
|
} else {
|
|
363
|
-
const { getSessionProject } = await import("./session-scope-
|
|
366
|
+
const { getSessionProject } = await import("./session-scope-H6H7EVMH.js");
|
|
364
367
|
const sessionProject = getSessionProject(resolved);
|
|
365
368
|
if (sessionProject && sessionProject !== input.projectName) {
|
|
366
369
|
scopeMismatchWarning = `session/project mismatch: session "${resolved}" owns "${sessionProject}" but task targets "${input.projectName}". Routed to default scope.`;
|
|
@@ -476,6 +479,24 @@ ${scopeMismatchWarning}` : scopeMismatchWarning;
|
|
|
476
479
|
);
|
|
477
480
|
throw dbErr;
|
|
478
481
|
}
|
|
482
|
+
recordOrchestrationEventBestEffort({
|
|
483
|
+
eventType: "task.created",
|
|
484
|
+
source: "tasks-crud.createTaskCore",
|
|
485
|
+
taskId: id,
|
|
486
|
+
agentId: input.assignedTo,
|
|
487
|
+
reviewer: input.reviewer ?? null,
|
|
488
|
+
sessionScope,
|
|
489
|
+
projectName: input.projectName,
|
|
490
|
+
instanceId: null,
|
|
491
|
+
result: initialStatus,
|
|
492
|
+
payload: {
|
|
493
|
+
priority: input.priority,
|
|
494
|
+
complexity,
|
|
495
|
+
hasBlockedBy: Boolean(blockedById),
|
|
496
|
+
hasParentTask: Boolean(parentTaskId),
|
|
497
|
+
titleLength: input.title.length
|
|
498
|
+
}
|
|
499
|
+
});
|
|
479
500
|
logTaskCreated({
|
|
480
501
|
taskId: id,
|
|
481
502
|
title: input.title,
|
|
@@ -734,6 +755,9 @@ async function updateTaskStatus(input) {
|
|
|
734
755
|
const taskId = String(row.id);
|
|
735
756
|
const taskFile = String(row.task_file);
|
|
736
757
|
const requestedStatus = input.status;
|
|
758
|
+
const eventSessionScope = row.session_scope ? String(row.session_scope) : null;
|
|
759
|
+
const eventProjectName = row.project_name ? String(row.project_name) : null;
|
|
760
|
+
const eventAgentId = row.assigned_to ? String(row.assigned_to) : null;
|
|
737
761
|
const previousStatus = String(row.status);
|
|
738
762
|
if (input.status === "done") {
|
|
739
763
|
input.status = "needs_review";
|
|
@@ -747,7 +771,7 @@ async function updateTaskStatus(input) {
|
|
|
747
771
|
if (exeSession) {
|
|
748
772
|
if (isCoordinatorName(reviewer)) {
|
|
749
773
|
if (isExeSession2(exeSession)) {
|
|
750
|
-
sendIntercom2(exeSession, { force: true });
|
|
774
|
+
sendIntercom2(exeSession, { force: true, reason: "completion" });
|
|
751
775
|
process.stderr.write(
|
|
752
776
|
`[tasks-crud] Review intercom sent to ${exeSession}: "${String(row.title)}" by ${String(row.assigned_to)}
|
|
753
777
|
`
|
|
@@ -755,7 +779,7 @@ async function updateTaskStatus(input) {
|
|
|
755
779
|
}
|
|
756
780
|
} else {
|
|
757
781
|
const reviewerSession = employeeSessionName2(reviewer, exeSession);
|
|
758
|
-
sendIntercom2(reviewerSession, { force: true });
|
|
782
|
+
sendIntercom2(reviewerSession, { force: true, reason: "completion" });
|
|
759
783
|
process.stderr.write(
|
|
760
784
|
`[tasks-crud] Review intercom sent to ${reviewerSession}: "${String(row.title)}" by ${String(row.assigned_to)}
|
|
761
785
|
`
|
|
@@ -788,7 +812,7 @@ async function updateTaskStatus(input) {
|
|
|
788
812
|
} catch {
|
|
789
813
|
}
|
|
790
814
|
try {
|
|
791
|
-
const { writeNotification: writeNotification2 } = await import("./notifications-
|
|
815
|
+
const { writeNotification: writeNotification2 } = await import("./notifications-QCZJTMU4.js");
|
|
792
816
|
await writeNotification2({
|
|
793
817
|
agentId: reviewer,
|
|
794
818
|
agentRole: isCoordinatorName(reviewer) ? "COO" : "manager",
|
|
@@ -810,7 +834,7 @@ async function updateTaskStatus(input) {
|
|
|
810
834
|
if (exeSession) {
|
|
811
835
|
if (isCoordinatorName(dispatcher)) {
|
|
812
836
|
if (isExeSession2(exeSession)) {
|
|
813
|
-
sendIntercom2(exeSession, { force: true });
|
|
837
|
+
sendIntercom2(exeSession, { force: true, reason: "completion" });
|
|
814
838
|
process.stderr.write(
|
|
815
839
|
`[tasks-crud] Blocked intercom sent to ${exeSession}: "${String(row.title)}" blocked by ${String(row.assigned_to)}
|
|
816
840
|
`
|
|
@@ -818,7 +842,7 @@ async function updateTaskStatus(input) {
|
|
|
818
842
|
}
|
|
819
843
|
} else {
|
|
820
844
|
const dispatcherSession = employeeSessionName2(dispatcher, exeSession);
|
|
821
|
-
sendIntercom2(dispatcherSession, { force: true });
|
|
845
|
+
sendIntercom2(dispatcherSession, { force: true, reason: "completion" });
|
|
822
846
|
process.stderr.write(
|
|
823
847
|
`[tasks-crud] Blocked intercom sent to ${dispatcherSession}: "${String(row.title)}" blocked by ${String(row.assigned_to)}
|
|
824
848
|
`
|
|
@@ -911,6 +935,26 @@ ${input.result}` : `\u26A0\uFE0F ${warning}`;
|
|
|
911
935
|
});
|
|
912
936
|
} catch {
|
|
913
937
|
}
|
|
938
|
+
recordOrchestrationEventBestEffort({
|
|
939
|
+
eventType: "task.claimed",
|
|
940
|
+
source: "tasks-crud.updateTaskStatus",
|
|
941
|
+
taskId,
|
|
942
|
+
agentId: eventAgentId,
|
|
943
|
+
sessionScope: eventSessionScope,
|
|
944
|
+
projectName: eventProjectName,
|
|
945
|
+
tmuxSession,
|
|
946
|
+
result: "reclaimed_dead_session"
|
|
947
|
+
});
|
|
948
|
+
recordOrchestrationEventBestEffort({
|
|
949
|
+
eventType: "task.in_progress",
|
|
950
|
+
source: "tasks-crud.updateTaskStatus",
|
|
951
|
+
taskId,
|
|
952
|
+
agentId: eventAgentId,
|
|
953
|
+
sessionScope: eventSessionScope,
|
|
954
|
+
projectName: eventProjectName,
|
|
955
|
+
tmuxSession,
|
|
956
|
+
result: "reclaimed_dead_session"
|
|
957
|
+
});
|
|
914
958
|
return { row, taskFile, now, taskId };
|
|
915
959
|
}
|
|
916
960
|
}
|
|
@@ -931,9 +975,42 @@ ${input.result}` : `\u26A0\uFE0F ${warning}`;
|
|
|
931
975
|
});
|
|
932
976
|
} catch {
|
|
933
977
|
}
|
|
978
|
+
recordOrchestrationEventBestEffort({
|
|
979
|
+
eventType: "task.claimed",
|
|
980
|
+
source: "tasks-crud.updateTaskStatus",
|
|
981
|
+
taskId,
|
|
982
|
+
agentId: eventAgentId,
|
|
983
|
+
sessionScope: eventSessionScope,
|
|
984
|
+
projectName: eventProjectName,
|
|
985
|
+
tmuxSession,
|
|
986
|
+
result: "assigner_override",
|
|
987
|
+
payload: { callerAgentId: input.callerAgentId }
|
|
988
|
+
});
|
|
989
|
+
recordOrchestrationEventBestEffort({
|
|
990
|
+
eventType: "task.in_progress",
|
|
991
|
+
source: "tasks-crud.updateTaskStatus",
|
|
992
|
+
taskId,
|
|
993
|
+
agentId: eventAgentId,
|
|
994
|
+
sessionScope: eventSessionScope,
|
|
995
|
+
projectName: eventProjectName,
|
|
996
|
+
tmuxSession,
|
|
997
|
+
result: "assigner_override"
|
|
998
|
+
});
|
|
934
999
|
return { row, taskFile, now, taskId };
|
|
935
1000
|
}
|
|
936
1001
|
const claimedBy = claimedBySession ? ` (claimed by ${claimedBySession})` : "";
|
|
1002
|
+
recordOrchestrationEventBestEffort({
|
|
1003
|
+
eventType: "claim.collision",
|
|
1004
|
+
source: "tasks-crud.updateTaskStatus",
|
|
1005
|
+
severity: "warn",
|
|
1006
|
+
taskId,
|
|
1007
|
+
agentId: eventAgentId,
|
|
1008
|
+
sessionScope: eventSessionScope,
|
|
1009
|
+
projectName: eventProjectName,
|
|
1010
|
+
tmuxSession,
|
|
1011
|
+
result: curStatus,
|
|
1012
|
+
payload: { hasClaimedBy: Boolean(claimedBySession) }
|
|
1013
|
+
});
|
|
937
1014
|
throw new Error(`${TASK_ALREADY_CLAIMED_PREFIX}: task ${taskId} is ${curStatus}${claimedBy}`);
|
|
938
1015
|
}
|
|
939
1016
|
try {
|
|
@@ -944,6 +1021,26 @@ ${input.result}` : `\u26A0\uFE0F ${warning}`;
|
|
|
944
1021
|
});
|
|
945
1022
|
} catch {
|
|
946
1023
|
}
|
|
1024
|
+
recordOrchestrationEventBestEffort({
|
|
1025
|
+
eventType: "task.claimed",
|
|
1026
|
+
source: "tasks-crud.updateTaskStatus",
|
|
1027
|
+
taskId,
|
|
1028
|
+
agentId: eventAgentId,
|
|
1029
|
+
sessionScope: eventSessionScope,
|
|
1030
|
+
projectName: eventProjectName,
|
|
1031
|
+
tmuxSession,
|
|
1032
|
+
result: "open_to_in_progress"
|
|
1033
|
+
});
|
|
1034
|
+
recordOrchestrationEventBestEffort({
|
|
1035
|
+
eventType: "task.in_progress",
|
|
1036
|
+
source: "tasks-crud.updateTaskStatus",
|
|
1037
|
+
taskId,
|
|
1038
|
+
agentId: eventAgentId,
|
|
1039
|
+
sessionScope: eventSessionScope,
|
|
1040
|
+
projectName: eventProjectName,
|
|
1041
|
+
tmuxSession,
|
|
1042
|
+
result: "open_to_in_progress"
|
|
1043
|
+
});
|
|
947
1044
|
return { row, taskFile, now, taskId };
|
|
948
1045
|
}
|
|
949
1046
|
if (input.result) {
|
|
@@ -957,13 +1054,49 @@ ${input.result}` : `\u26A0\uFE0F ${warning}`;
|
|
|
957
1054
|
args: [input.status, now, taskId]
|
|
958
1055
|
});
|
|
959
1056
|
}
|
|
1057
|
+
if (requestedStatus === "done") {
|
|
1058
|
+
recordOrchestrationEventBestEffort({
|
|
1059
|
+
eventType: "task.done",
|
|
1060
|
+
source: "tasks-crud.updateTaskStatus",
|
|
1061
|
+
taskId,
|
|
1062
|
+
agentId: eventAgentId,
|
|
1063
|
+
reviewer: row.reviewer ? String(row.reviewer) : null,
|
|
1064
|
+
sessionScope: eventSessionScope,
|
|
1065
|
+
projectName: eventProjectName,
|
|
1066
|
+
result: input.status
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
if (input.status === "needs_review" && previousStatus !== "needs_review" && previousStatus !== "closed") {
|
|
1070
|
+
recordOrchestrationEventBestEffort({
|
|
1071
|
+
eventType: "review.ready",
|
|
1072
|
+
source: "tasks-crud.updateTaskStatus",
|
|
1073
|
+
taskId,
|
|
1074
|
+
agentId: eventAgentId,
|
|
1075
|
+
reviewer: row.reviewer ? String(row.reviewer) : null,
|
|
1076
|
+
sessionScope: eventSessionScope,
|
|
1077
|
+
projectName: eventProjectName,
|
|
1078
|
+
result: "needs_review"
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
if (input.status === "closed") {
|
|
1082
|
+
recordOrchestrationEventBestEffort({
|
|
1083
|
+
eventType: "task.closed",
|
|
1084
|
+
source: "tasks-crud.updateTaskStatus",
|
|
1085
|
+
taskId,
|
|
1086
|
+
agentId: eventAgentId,
|
|
1087
|
+
reviewer: row.reviewer ? String(row.reviewer) : null,
|
|
1088
|
+
sessionScope: eventSessionScope,
|
|
1089
|
+
projectName: eventProjectName,
|
|
1090
|
+
result: "closed"
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
960
1093
|
try {
|
|
961
1094
|
await client.execute("PRAGMA wal_checkpoint(PASSIVE)");
|
|
962
1095
|
} catch {
|
|
963
1096
|
}
|
|
964
1097
|
if (input.status === "done" || input.status === "needs_review") {
|
|
965
1098
|
try {
|
|
966
|
-
const { incrementSkillSuccess } = await import("./skill-refinement-
|
|
1099
|
+
const { incrementSkillSuccess } = await import("./skill-refinement-DDFALKOD.js");
|
|
967
1100
|
await incrementSkillSuccess(
|
|
968
1101
|
String(row.assigned_to),
|
|
969
1102
|
row.project_name ? String(row.project_name) : null
|
|
@@ -1539,13 +1672,13 @@ async function createReviewForCompletedTask(row, result, _baseDir, now) {
|
|
|
1539
1672
|
const taskScope = row.session_scope ? String(row.session_scope) : null;
|
|
1540
1673
|
const exeSession = taskScope || getParentExe(getSessionKey());
|
|
1541
1674
|
if (exeSession) {
|
|
1542
|
-
sendIntercom(exeSession, { force: true });
|
|
1675
|
+
sendIntercom(exeSession, { force: true, reason: "completion" });
|
|
1543
1676
|
}
|
|
1544
1677
|
if (reviewer && reviewer !== coordinatorName && reviewer !== exeSession) {
|
|
1545
1678
|
const { employeeSessionName: employeeSessionName2 } = await import("./lib/tmux-routing.js");
|
|
1546
1679
|
if (exeSession) {
|
|
1547
1680
|
const reviewerSession = employeeSessionName2(reviewer, exeSession);
|
|
1548
|
-
sendIntercom(reviewerSession, { force: true });
|
|
1681
|
+
sendIntercom(reviewerSession, { force: true, reason: "completion" });
|
|
1549
1682
|
}
|
|
1550
1683
|
}
|
|
1551
1684
|
} catch {
|
|
@@ -2041,7 +2174,7 @@ async function verifyPaneAtCapacity(sessionName) {
|
|
|
2041
2174
|
reason: `capture-pane failed: ${err instanceof Error ? err.message : String(err)}`
|
|
2042
2175
|
};
|
|
2043
2176
|
}
|
|
2044
|
-
const { isAtCapacity } = await import("./capacity-monitor-
|
|
2177
|
+
const { isAtCapacity } = await import("./capacity-monitor-HJSJ2PCF.js");
|
|
2045
2178
|
if (!isAtCapacity(pane)) {
|
|
2046
2179
|
return {
|
|
2047
2180
|
atCapacity: false,
|
|
@@ -2159,6 +2292,33 @@ function isExeSession(sessionName) {
|
|
|
2159
2292
|
}
|
|
2160
2293
|
function sendIntercom(targetSession, opts) {
|
|
2161
2294
|
const transport = getTransport();
|
|
2295
|
+
const startedAt = Date.now();
|
|
2296
|
+
const reason = opts?.reason ?? "nudge";
|
|
2297
|
+
const rawAgent = targetSession.split("-")[0] ?? targetSession;
|
|
2298
|
+
const eventAgent = baseAgentName(rawAgent);
|
|
2299
|
+
const eventSessionScope = extractRootExe(targetSession);
|
|
2300
|
+
const recordResult = (result, errorCode) => {
|
|
2301
|
+
recordOrchestrationEventBestEffort({
|
|
2302
|
+
eventType: "tmux.nudge.completed",
|
|
2303
|
+
source: "tmux-routing.sendIntercom",
|
|
2304
|
+
severity: result === "failed" ? "warn" : "info",
|
|
2305
|
+
agentId: eventAgent,
|
|
2306
|
+
sessionScope: eventSessionScope,
|
|
2307
|
+
tmuxSession: targetSession,
|
|
2308
|
+
durationMs: Date.now() - startedAt,
|
|
2309
|
+
result,
|
|
2310
|
+
errorCode: errorCode ?? null,
|
|
2311
|
+
payload: { reason, force: Boolean(opts?.force) }
|
|
2312
|
+
});
|
|
2313
|
+
};
|
|
2314
|
+
recordOrchestrationEventBestEffort({
|
|
2315
|
+
eventType: "tmux.nudge.attempted",
|
|
2316
|
+
source: "tmux-routing.sendIntercom",
|
|
2317
|
+
agentId: eventAgent,
|
|
2318
|
+
sessionScope: eventSessionScope,
|
|
2319
|
+
tmuxSession: targetSession,
|
|
2320
|
+
payload: { reason, force: Boolean(opts?.force) }
|
|
2321
|
+
});
|
|
2162
2322
|
try {
|
|
2163
2323
|
const callerScope = resolveExeSession();
|
|
2164
2324
|
if (callerScope && isExeSession(callerScope) && targetSession.includes("-")) {
|
|
@@ -2169,6 +2329,17 @@ function sendIntercom(targetSession, opts) {
|
|
|
2169
2329
|
`[intercom] BLOCKED: cross-session intercom from ${callerScope} to ${targetSession}. Session isolation enforced.
|
|
2170
2330
|
`
|
|
2171
2331
|
);
|
|
2332
|
+
recordOrchestrationEventBestEffort({
|
|
2333
|
+
eventType: "session.scope_violation",
|
|
2334
|
+
source: "tmux-routing.sendIntercom",
|
|
2335
|
+
severity: "warn",
|
|
2336
|
+
agentId: eventAgent,
|
|
2337
|
+
sessionScope: targetScope,
|
|
2338
|
+
tmuxSession: targetSession,
|
|
2339
|
+
result: "blocked",
|
|
2340
|
+
payload: { callerScope }
|
|
2341
|
+
});
|
|
2342
|
+
recordResult("failed", "scope_violation");
|
|
2172
2343
|
return "failed";
|
|
2173
2344
|
}
|
|
2174
2345
|
}
|
|
@@ -2176,12 +2347,14 @@ function sendIntercom(targetSession, opts) {
|
|
|
2176
2347
|
}
|
|
2177
2348
|
if (!opts?.force && isDebounced(targetSession)) {
|
|
2178
2349
|
logIntercom(`DEBOUNCE \u2192 ${targetSession} (nudge batched, task safe in DB)`);
|
|
2350
|
+
recordResult("debounced");
|
|
2179
2351
|
return "debounced";
|
|
2180
2352
|
}
|
|
2181
2353
|
try {
|
|
2182
2354
|
const sessions = transport.listSessions();
|
|
2183
2355
|
if (!sessions.includes(targetSession)) {
|
|
2184
2356
|
logIntercom(`SKIP \u2192 ${targetSession} (session not found)`);
|
|
2357
|
+
recordResult("failed", "session_not_found");
|
|
2185
2358
|
return "failed";
|
|
2186
2359
|
}
|
|
2187
2360
|
const sessionState = getSessionState(targetSession);
|
|
@@ -2189,21 +2362,24 @@ function sendIntercom(targetSession, opts) {
|
|
|
2189
2362
|
queueIntercom(targetSession, "claude not running in session");
|
|
2190
2363
|
const batched2 = recordDebounce(targetSession);
|
|
2191
2364
|
logIntercom(`QUEUED \u2192 ${targetSession} (no claude process)${batched2 > 0 ? ` [${batched2} batched]` : ""}`);
|
|
2365
|
+
recordResult("queued", "no_claude");
|
|
2192
2366
|
return "queued";
|
|
2193
2367
|
}
|
|
2194
2368
|
if (!opts?.force && (sessionState === "thinking" || sessionState === "tool")) {
|
|
2195
2369
|
queueIntercom(targetSession, "session busy at send time");
|
|
2196
2370
|
const batched2 = recordDebounce(targetSession);
|
|
2197
2371
|
logIntercom(`QUEUED \u2192 ${targetSession} (session busy)${batched2 > 0 ? ` [${batched2} batched]` : ""}`);
|
|
2372
|
+
recordResult("queued", "session_busy");
|
|
2198
2373
|
return "queued";
|
|
2199
2374
|
}
|
|
2200
2375
|
if (sessionState !== "idle") {
|
|
2201
2376
|
try {
|
|
2202
|
-
const
|
|
2203
|
-
const agent = baseAgentName(
|
|
2377
|
+
const rawAgent2 = targetSession.split("-")[0] ?? targetSession;
|
|
2378
|
+
const agent = baseAgentName(rawAgent2);
|
|
2204
2379
|
const markerPath = path5.join(SESSION_CACHE, `current-task-${agent}.json`);
|
|
2205
2380
|
if (existsSync5(markerPath)) {
|
|
2206
2381
|
logIntercom(`SKIP \u2192 ${targetSession} (has in_progress task marker + not idle \u2014 will auto-chain)`);
|
|
2382
|
+
recordResult("debounced", "in_progress_marker");
|
|
2207
2383
|
return "debounced";
|
|
2208
2384
|
}
|
|
2209
2385
|
} catch {
|
|
@@ -2213,15 +2389,16 @@ function sendIntercom(targetSession, opts) {
|
|
|
2213
2389
|
logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
|
|
2214
2390
|
transport.sendKeys(targetSession, "q");
|
|
2215
2391
|
}
|
|
2216
|
-
const reason = opts?.reason ?? "nudge";
|
|
2217
2392
|
const msg = reason === "completion" ? `An employee completed work. Run task(action='list', status='needs_review') to review it.` : `P0: You have a new task dispatched. Run task(action='list', status='open') to find it. Start immediately.`;
|
|
2218
2393
|
transport.sendKeysLiteral(targetSession, msg);
|
|
2219
2394
|
const batched = recordDebounce(targetSession);
|
|
2220
2395
|
logIntercom(`DELIVERED \u2192 ${targetSession}${batched > 0 ? ` [${batched} nudges batched during debounce]` : ""} (fire-and-forget)`);
|
|
2396
|
+
recordResult("delivered");
|
|
2221
2397
|
return "delivered";
|
|
2222
2398
|
} catch (e) {
|
|
2223
2399
|
process.stderr.write("[tmux-routing] sendIntercom to " + targetSession + ": " + (e instanceof Error ? e.message : String(e)) + "\n");
|
|
2224
2400
|
logIntercom(`FAIL \u2192 ${targetSession}`);
|
|
2401
|
+
recordResult("failed", e instanceof Error ? e.name : "send_error");
|
|
2225
2402
|
return "failed";
|
|
2226
2403
|
}
|
|
2227
2404
|
}
|
|
@@ -2374,9 +2551,20 @@ function ensureEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
2374
2551
|
function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
2375
2552
|
const transport = getTransport();
|
|
2376
2553
|
const sessionName = employeeSessionName(employeeName, exeSession, opts?.instance);
|
|
2554
|
+
const spawnStartedAt = Date.now();
|
|
2377
2555
|
const instanceLabel = opts?.instance != null && opts.instance > 0 ? `${employeeName}${opts.instance}` : employeeName;
|
|
2378
2556
|
const logDir = path5.join(os4.homedir(), ".exe-os", "session-logs");
|
|
2379
2557
|
const logFile = path5.join(logDir, `${instanceLabel}-${Date.now()}.log`);
|
|
2558
|
+
recordOrchestrationEventBestEffort({
|
|
2559
|
+
eventType: "tmux.spawn.attempted",
|
|
2560
|
+
source: "tmux-routing.spawnEmployee",
|
|
2561
|
+
agentId: employeeName,
|
|
2562
|
+
sessionScope: exeSession,
|
|
2563
|
+
instanceId: opts?.instance != null ? String(opts.instance) : null,
|
|
2564
|
+
tmuxSession: sessionName,
|
|
2565
|
+
runtime: opts?.runtimeOverride ?? null,
|
|
2566
|
+
payload: { hasCwdOverride: Boolean(opts?.cwd), autoInstance: Boolean(opts?.autoInstance) }
|
|
2567
|
+
});
|
|
2380
2568
|
if (!existsSync5(logDir)) {
|
|
2381
2569
|
mkdirSync2(logDir, { recursive: true });
|
|
2382
2570
|
}
|
|
@@ -2576,6 +2764,19 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
2576
2764
|
});
|
|
2577
2765
|
if (spawnResult.error) {
|
|
2578
2766
|
releaseSpawnLock(sessionName);
|
|
2767
|
+
recordOrchestrationEventBestEffort({
|
|
2768
|
+
eventType: "tmux.spawn.completed",
|
|
2769
|
+
source: "tmux-routing.spawnEmployee",
|
|
2770
|
+
severity: "warn",
|
|
2771
|
+
agentId: employeeName,
|
|
2772
|
+
sessionScope: exeSession,
|
|
2773
|
+
instanceId: opts?.instance != null ? String(opts.instance) : null,
|
|
2774
|
+
tmuxSession: sessionName,
|
|
2775
|
+
runtime: useCodex ? "codex" : useOpencode ? "opencode" : useExeAgent ? "exe-agent" : "claude",
|
|
2776
|
+
durationMs: Date.now() - spawnStartedAt,
|
|
2777
|
+
result: "failed",
|
|
2778
|
+
errorCode: "tmux_new_session_failed"
|
|
2779
|
+
});
|
|
2579
2780
|
return { sessionName, error: `tmux new-session failed: ${spawnResult.error}` };
|
|
2580
2781
|
}
|
|
2581
2782
|
transport.pipeLog(sessionName, logFile);
|
|
@@ -2675,6 +2876,17 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
2675
2876
|
registeredAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2676
2877
|
});
|
|
2677
2878
|
releaseSpawnLock(sessionName);
|
|
2879
|
+
recordOrchestrationEventBestEffort({
|
|
2880
|
+
eventType: "tmux.spawn.completed",
|
|
2881
|
+
source: "tmux-routing.spawnEmployee",
|
|
2882
|
+
agentId: employeeName,
|
|
2883
|
+
sessionScope: exeSession,
|
|
2884
|
+
instanceId: opts?.instance != null ? String(opts.instance) : null,
|
|
2885
|
+
tmuxSession: sessionName,
|
|
2886
|
+
runtime: useCodex ? "codex" : useOpencode ? "opencode" : useExeAgent ? "exe-agent" : "claude",
|
|
2887
|
+
durationMs: Date.now() - spawnStartedAt,
|
|
2888
|
+
result: booted ? "spawned_booted" : "spawned_unverified"
|
|
2889
|
+
});
|
|
2678
2890
|
return { sessionName };
|
|
2679
2891
|
}
|
|
2680
2892
|
|