@askexenow/exe-os 0.9.264 → 0.9.266
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/deploy/compose/.env.example +4 -2
- package/deploy/compose/docker-compose.yml +6 -4
- package/deploy/compose/generate-env.ts +5 -2
- package/dist/active-agent-2XJJZFEW.js +25 -0
- package/dist/active-agent-JZ4PHIAK.js +26 -0
- package/dist/agentic-ontology-J4B525DT.js +25 -0
- package/dist/backfill-metadata-TWEC6BJD.js +597 -0
- package/dist/backfill-metadata-VGZLCJWZ.js +597 -0
- package/dist/backfill-metadata-WM46YQZL.js +597 -0
- package/dist/behaviors-BPIVFAGY.js +25 -0
- package/dist/bin/agentic-ontology-backfill.js +5 -5
- package/dist/bin/agentic-reflection-backfill.js +6 -6
- package/dist/bin/agentic-semantic-label.js +5 -5
- 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 +6 -6
- package/dist/bin/cc-doctor.js +6 -1
- package/dist/bin/cleanup-stale-review-tasks.js +9 -9
- package/dist/bin/cli.js +15 -15
- package/dist/bin/exe-agent-config.js +2 -2
- package/dist/bin/exe-agent.js +4 -4
- package/dist/bin/exe-assign.js +5 -5
- package/dist/bin/exe-boot.js +16 -16
- package/dist/bin/exe-call.js +4 -4
- package/dist/bin/exe-cloud.js +4 -4
- package/dist/bin/exe-dispatch.js +9 -9
- package/dist/bin/exe-doctor.js +1 -1
- package/dist/bin/exe-export-behaviors.js +7 -7
- package/dist/bin/exe-forget.js +6 -6
- package/dist/bin/exe-gateway.js +7 -7
- package/dist/bin/exe-healthcheck.js +6 -1
- package/dist/bin/exe-heartbeat.js +10 -10
- package/dist/bin/exe-kill.js +12 -12
- package/dist/bin/exe-launch-agent.js +16 -16
- package/dist/bin/exe-new-employee.js +6 -6
- package/dist/bin/exe-pending-messages.js +10 -10
- package/dist/bin/exe-pending-notifications.js +9 -9
- package/dist/bin/exe-pending-reviews.js +12 -10
- package/dist/bin/exe-rename.js +4 -4
- package/dist/bin/exe-review.js +11 -11
- package/dist/bin/exe-search.js +5 -5
- package/dist/bin/exe-session-cleanup.js +14 -14
- package/dist/bin/exe-settings.js +4 -4
- package/dist/bin/exe-start-codex.js +11 -11
- package/dist/bin/exe-start-opencode.js +8 -8
- package/dist/bin/exe-status.js +10 -10
- package/dist/bin/exe-team.js +3 -3
- package/dist/bin/git-sweep.js +10 -10
- package/dist/bin/graph-backfill.js +4 -4
- package/dist/bin/graph-export.js +5 -5
- package/dist/bin/import-history.js +7 -7
- package/dist/bin/install.js +6 -6
- package/dist/bin/intercom-check.js +6 -5
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.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/scan-tasks.js +9 -9
- package/dist/bin/setup.js +1 -1
- package/dist/bin/shard-migrate.js +4 -4
- package/dist/capacity-monitor-3QORC56J.js +49 -0
- package/dist/capacity-monitor-FWRBCZCZ.js +49 -0
- package/dist/capacity-monitor-FZORNXTA.js +49 -0
- package/dist/catchup-brief-242H63OP.js +151 -0
- package/dist/catchup-brief-PRKHIRWW.js +151 -0
- package/dist/catchup-brief-T7W2ARRB.js +151 -0
- package/dist/catchup-brief-VJDLXJHJ.js +151 -0
- package/dist/chunk-2FDYA3GS.js +75 -0
- package/dist/chunk-2GU3NYMB.js +813 -0
- package/dist/chunk-2V33IVZF.js +1148 -0
- package/dist/chunk-2VT7Z2E2.js +197 -0
- package/dist/chunk-2W5NQOQJ.js +333 -0
- package/dist/chunk-32QR5EHE.js +244 -0
- package/dist/chunk-3DBROKA6.js +382 -0
- package/dist/chunk-3DS2YHAT.js +204 -0
- package/dist/chunk-3L6XLN4V.js +1090 -0
- package/dist/chunk-3O2ZD7YV.js +227 -0
- package/dist/chunk-3T4PNG5O.js +447 -0
- package/dist/chunk-3W324KN7.js +13696 -0
- package/dist/chunk-43O2PZH7.js +214 -0
- package/dist/chunk-4AHL6I7X.js +284 -0
- package/dist/chunk-4IATAIAF.js +89 -0
- package/dist/chunk-5GBPXJIH.js +50 -0
- package/dist/chunk-5IXN2532.js +58 -0
- package/dist/chunk-5M4F2FVD.js +204 -0
- package/dist/chunk-5SH5TR45.js +731 -0
- package/dist/chunk-5TANMPI4.js +377 -0
- package/dist/chunk-5XGMTWKW.js +128 -0
- package/dist/chunk-67E5WIMW.js +333 -0
- package/dist/chunk-6AQAILCS.js +13696 -0
- package/dist/chunk-6NRJIARA.js +346 -0
- package/dist/chunk-6O22GTSE.js +1148 -0
- package/dist/chunk-72KQJZBH.js +382 -0
- package/dist/chunk-7B2AENJ3.js +1345 -0
- package/dist/chunk-7GKMYFVR.js +551 -0
- package/dist/chunk-7HUGVJHW.js +1021 -0
- package/dist/chunk-7HWBGXDV.js +333 -0
- package/dist/chunk-7O5CMDP6.js +1345 -0
- package/dist/chunk-7P2JKEO3.js +382 -0
- package/dist/chunk-7ROGPDW6.js +197 -0
- package/dist/chunk-7ZMLNURG.js +513 -0
- package/dist/chunk-A3G4UXNA.js +280 -0
- package/dist/chunk-A4T6U3XZ.js +371 -0
- package/dist/chunk-A4UY44T7.js +486 -0
- package/dist/chunk-ADJNRFEK.js +13696 -0
- package/dist/chunk-AVJTW67M.js +513 -0
- package/dist/chunk-AZHPQGSI.js +159 -0
- package/dist/chunk-B6RC7DAC.js +1090 -0
- package/dist/chunk-BAOJLZVC.js +244 -0
- package/dist/chunk-BCUMPA7J.js +159 -0
- package/dist/chunk-BH2ST7KK.js +183 -0
- package/dist/chunk-BQAC3GCO.js +127 -0
- package/dist/chunk-C4BIYP5C.js +129 -0
- package/dist/chunk-CBUZG6OC.js +89 -0
- package/dist/chunk-CGQRWCCP.js +81 -0
- package/dist/chunk-CIWJRYIC.js +244 -0
- package/dist/chunk-CLX4WQHT.js +214 -0
- package/dist/chunk-CZO2DGGF.js +214 -0
- package/dist/chunk-D4CQZL46.js +76 -0
- package/dist/chunk-D55SXO3N.js +3951 -0
- package/dist/chunk-DEBLYXA2.js +56 -0
- package/dist/chunk-EDNUE5L3.js +38 -0
- package/dist/chunk-EPDSRI6O.js +284 -0
- package/dist/chunk-ESNHLTLC.js +1073 -0
- package/dist/chunk-EU34R2A3.js +1073 -0
- package/dist/chunk-FICUAZEA.js +128 -0
- package/dist/chunk-FP6U5PSY.js +818 -0
- package/dist/chunk-G4KEDLSM.js +488 -0
- package/dist/chunk-G55UTKFR.js +89 -0
- package/dist/chunk-GIJUXLK5.js +330 -0
- package/dist/chunk-GVSSEGIV.js +348 -0
- package/dist/chunk-GYOOZ725.js +330 -0
- package/dist/chunk-HCULUL4D.js +447 -0
- package/dist/chunk-HDRQKH7R.js +1051 -0
- package/dist/chunk-HHBN7Y7R.js +197 -0
- package/dist/chunk-IODP4JNE.js +551 -0
- package/dist/chunk-IQBXQ7GF.js +1073 -0
- package/dist/chunk-ITF6GEJI.js +2091 -0
- package/dist/chunk-IXHVSWLM.js +58 -0
- package/dist/chunk-IZ6LCET7.js +58 -0
- package/dist/chunk-J3ZFONT4.js +1921 -0
- package/dist/chunk-JEOFG274.js +394 -0
- package/dist/chunk-JH7ISOIJ.js +33 -0
- package/dist/chunk-JVRMAVPN.js +731 -0
- package/dist/chunk-KBYRYSXT.js +3951 -0
- package/dist/chunk-KECNXWD6.js +1051 -0
- package/dist/chunk-KIYCHS35.js +128 -0
- package/dist/chunk-KUP3D6G2.js +1345 -0
- package/dist/chunk-KXS5HHDH.js +54 -0
- package/dist/chunk-LPG3U5UW.js +731 -0
- package/dist/chunk-LVZW4WQY.js +221 -0
- package/dist/chunk-LWOCCDSB.js +240 -0
- package/dist/chunk-M4HRKRSE.js +30 -0
- package/dist/chunk-MPG5DR3K.js +244 -0
- package/dist/chunk-NH6TPXZV.js +13696 -0
- package/dist/chunk-NOG2LVBA.js +159 -0
- package/dist/chunk-NP3CYOEY.js +290 -0
- package/dist/chunk-O5TZI7OZ.js +50 -0
- package/dist/chunk-OVQOKLYA.js +210 -0
- package/dist/chunk-OW26ML36.js +1148 -0
- package/dist/chunk-P2DOIWQG.js +260 -0
- package/dist/chunk-P2QTTEYP.js +3951 -0
- package/dist/chunk-P5IKFL7B.js +85 -0
- package/dist/chunk-PD2LUPHD.js +377 -0
- package/dist/chunk-PF5EFIAH.js +818 -0
- package/dist/chunk-PK3NFO76.js +551 -0
- package/dist/chunk-Q3N4KHLM.js +330 -0
- package/dist/chunk-QHQTMWYH.js +54 -0
- package/dist/chunk-QKMFMJTU.js +171 -0
- package/dist/chunk-QNYOPM2L.js +1921 -0
- package/dist/chunk-R77M74QM.js +13696 -0
- package/dist/chunk-RHZ2CRJU.js +3556 -0
- package/dist/chunk-RLR4LVO5.js +1090 -0
- package/dist/chunk-RMDDSWFH.js +495 -0
- package/dist/chunk-RPLEZ74B.js +95 -0
- package/dist/chunk-RXMVPGH2.js +346 -0
- package/dist/chunk-S2ARWNS6.js +135 -0
- package/dist/chunk-SHPIATX7.js +90 -0
- package/dist/chunk-SPOA7EOD.js +81 -0
- package/dist/chunk-SQUZ3TI2.js +668 -0
- package/dist/chunk-SUGBKORD.js +1148 -0
- package/dist/chunk-T2XD7XL2.js +346 -0
- package/dist/chunk-TAIYLROT.js +127 -0
- package/dist/chunk-TCD4XCBS.js +495 -0
- package/dist/chunk-TK23WXKB.js +128 -0
- package/dist/chunk-TOVXER6J.js +76 -0
- package/dist/chunk-TSBMSHMM.js +163 -0
- package/dist/chunk-U776PBU6.js +488 -0
- package/dist/chunk-UIPAZYP7.js +171 -0
- package/dist/chunk-UTVNIAOF.js +284 -0
- package/dist/chunk-VF6VT4MR.js +70 -0
- package/dist/chunk-VZXLYUKS.js +171 -0
- package/dist/chunk-WIAHPJDS.js +58 -0
- package/dist/chunk-WM5ELLT4.js +54 -0
- package/dist/chunk-WUUSPOCC.js +1921 -0
- package/dist/chunk-WXHAMPK4.js +81 -0
- package/dist/chunk-WXW4GF6M.js +495 -0
- package/dist/chunk-WYNZ23XH.js +262 -0
- package/dist/chunk-WZOQLU2Y.js +127 -0
- package/dist/chunk-X24GBZKR.js +157 -0
- package/dist/chunk-X5FRF5MG.js +13696 -0
- package/dist/chunk-XBPLYFBA.js +204 -0
- package/dist/chunk-XDGKFXFW.js +363 -0
- package/dist/chunk-XIT6ONPY.js +630 -0
- package/dist/{chunk-YGOUKUNX.js → chunk-XLYBSXWS.js} +2 -1
- package/dist/chunk-XNRJ5JHU.js +377 -0
- package/dist/chunk-XREWTPZM.js +123 -0
- package/dist/chunk-XURCA5VD.js +297 -0
- package/dist/chunk-Y55VFZJB.js +50 -0
- package/dist/chunk-YIH2YMWP.js +76 -0
- package/dist/chunk-YZMCCT73.js +97 -0
- package/dist/chunk-ZTP3VV23.js +447 -0
- package/dist/co-activation-JOYR73H2.js +72 -0
- package/dist/co-occurrence-G7RRJ3DB.js +74 -0
- package/dist/core-memory-6KK55Z65.js +110 -0
- package/dist/core-memory-QRS6GBXL.js +110 -0
- package/dist/core-memory-QXMQ5I7S.js +110 -0
- package/dist/crdt-sync-QWK65Z5A.js +33 -0
- package/dist/crm-webhook-BNUS3USD.js +10 -0
- package/dist/crm-webhook-CH5W633Y.js +10 -0
- package/dist/crm-webhook-ZTIRFVAH.js +10 -0
- package/dist/cto-delegation-gate-DNZJGBS7.js +206 -0
- package/dist/cto-delegation-gate-XY3NMGTE.js +206 -0
- package/dist/cto-delegation-gate-YI3LK7VY.js +206 -0
- package/dist/daemon-orchestration-7LVOHYKA.js +135 -0
- package/dist/daemon-orchestration-LS62JMTI.js +135 -0
- package/dist/daemon-orchestration-SDQNWI3K.js +135 -0
- package/dist/db-backup-5ENHDNZI.js +33 -0
- package/dist/dreaming-PGJOCGAM.js +32 -0
- package/dist/dreaming-UNHHGOU3.js +32 -0
- package/dist/dreaming-ZBKE2GFX.js +32 -0
- package/dist/exe-drift-QQJMUQXA.js +68 -0
- package/dist/exe-export-BEZZSQB4.js +73 -0
- package/dist/exe-export-JNSQRIWI.js +73 -0
- package/dist/exe-export-TQGI2VBT.js +73 -0
- package/dist/exe-import-2SR2UP3D.js +76 -0
- package/dist/exe-import-73Q4VLFK.js +76 -0
- package/dist/exe-import-AVGWQZLU.js +76 -0
- package/dist/exe-key-6JHEINOM.js +579 -0
- package/dist/exe-key-RIRPIFK6.js +579 -0
- package/dist/exe-key-WR6QEHYO.js +579 -0
- package/dist/exe-snapshot-NDMDQJOH.js +164 -0
- package/dist/exe-snapshot-PVCBPMPJ.js +164 -0
- package/dist/exe-snapshot-U6K3J6BD.js +164 -0
- package/dist/fast-db-init-22OBOPTN.js +7 -0
- package/dist/fast-db-init-M6ZYYGAL.js +7 -0
- package/dist/fast-db-init-ZHRRYI7M.js +7 -0
- package/dist/gateway/index.js +8 -8
- package/dist/git-staleness-4DGYC3RY.js +110 -0
- package/dist/git-task-sweep-64KSWRUI.js +40 -0
- package/dist/git-task-sweep-CUR7R2ZM.js +40 -0
- package/dist/git-task-sweep-YG3IVGK3.js +40 -0
- package/dist/global-procedures-TYDNKM7V.js +20 -0
- package/dist/graph-auto-extract-I6B5HWTP.js +162 -0
- package/dist/hooks/bug-report-worker.js +11 -11
- package/dist/hooks/codex-stop-task-finalizer.js +11 -11
- package/dist/hooks/commit-complete.js +11 -11
- package/dist/hooks/error-recall.js +6 -6
- package/dist/hooks/exe-heartbeat-hook.js +3 -3
- package/dist/hooks/ingest.js +6 -6
- package/dist/hooks/instructions-loaded.js +4 -4
- package/dist/hooks/manifest.json +19 -19
- package/dist/hooks/notification.js +4 -4
- package/dist/hooks/post-compact.js +10 -10
- package/dist/hooks/post-tool-combined.js +5 -5
- package/dist/hooks/pre-compact.js +11 -11
- package/dist/hooks/pre-tool-use.js +14 -14
- package/dist/hooks/prompt-submit.js +27 -22
- package/dist/hooks/session-end.js +15 -15
- package/dist/hooks/session-start.js +10 -10
- package/dist/hooks/stop.js +14 -14
- package/dist/hooks/subagent-stop.js +10 -10
- package/dist/hooks/summary-worker.js +14 -14
- package/dist/index.js +17 -17
- package/dist/installer-4LP73C3M.js +38 -0
- package/dist/installer-AUVLNS4D.js +296 -0
- package/dist/installer-KCRLQSQH.js +38 -0
- package/dist/installer-KGXYUOIV.js +296 -0
- package/dist/installer-UI6TNJGO.js +342 -0
- package/dist/installer-Z7NPD4PD.js +342 -0
- package/dist/lib/cloud-sync.js +4 -4
- package/dist/lib/consolidation.js +5 -5
- package/dist/lib/database.js +2 -2
- package/dist/lib/db-daemon-client.js +6 -0
- package/dist/lib/db.js +2 -2
- package/dist/lib/employee-templates.js +4 -4
- package/dist/lib/employees.js +2 -2
- package/dist/lib/exe-daemon.js +39 -38
- package/dist/lib/hybrid-search.js +5 -5
- package/dist/lib/identity.js +2 -2
- package/dist/lib/messaging.js +9 -9
- package/dist/lib/reminders.js +3 -3
- package/dist/lib/schedules.js +5 -5
- package/dist/lib/session-registry.js +4 -4
- package/dist/lib/skill-learning.js +4 -4
- package/dist/lib/store.js +4 -4
- package/dist/lib/task-router.js +3 -3
- package/dist/lib/tasks.js +10 -10
- package/dist/lib/tmux-routing.js +8 -8
- package/dist/lib/token-spend.js +3 -3
- package/dist/mcp/register-tools.js +53 -52
- package/dist/mcp/server.js +54 -53
- package/dist/mcp/tools/complete-reminder.js +4 -4
- package/dist/mcp/tools/create-reminder.js +4 -4
- package/dist/mcp/tools/create-task.js +12 -12
- package/dist/mcp/tools/deactivate-behavior.js +5 -5
- package/dist/mcp/tools/list-reminders.js +4 -4
- package/dist/mcp/tools/list-tasks.js +12 -12
- package/dist/mcp/tools/send-message.js +11 -11
- package/dist/mcp/tools/update-task.js +11 -11
- package/dist/mcp-http-config-LN5ITKGS.js +27 -0
- package/dist/mcp-http-config-V43VHNEH.js +27 -0
- package/dist/memory-cards-S36DCEY4.js +174 -0
- package/dist/memory-graph-extractor-66YL4V4B.js +17 -0
- package/dist/memory-poisoning-defense-MXWE6CTY.js +225 -0
- package/dist/memory-reflection-W676LUX5.js +238 -0
- package/dist/notifications-45QSHDFA.js +45 -0
- package/dist/notifications-OFLXZTDZ.js +45 -0
- package/dist/notifications-XAV4V7T5.js +45 -0
- package/dist/orchestration-events-MJLWJ2H2.js +25 -0
- package/dist/orchestrator-7XBMFK7D.js +33 -0
- package/dist/orchestrator-AIAKV5ST.js +33 -0
- package/dist/orchestrator-VK7D6I36.js +33 -0
- package/dist/pipeline-router-DXH5QVUH.js +13 -0
- package/dist/pipeline-router-EV6C5S33.js +13 -0
- package/dist/pipeline-router-MQKRNCTR.js +13 -0
- package/dist/plan-limits-TQMLKZBG.js +26 -0
- package/dist/project-boot-4XTXHDG4.js +299 -0
- package/dist/projection-worker-NAYVNSI4.js +964 -0
- package/dist/reranker-CJW3UYE2.js +19 -0
- package/dist/reranker-KHZI7HQK.js +19 -0
- package/dist/reranker-UPMS3OX7.js +19 -0
- package/dist/reranker-ZN73HWSB.js +19 -0
- package/dist/review-polling-3UEZSPNT.js +124 -0
- package/dist/review-polling-KBDX3ILL.js +124 -0
- package/dist/review-polling-RL75XLAY.js +124 -0
- package/dist/runtime/index.js +11 -11
- package/dist/session-events-2CHOLA6D.js +36 -0
- package/dist/session-events-HM22KEHN.js +36 -0
- package/dist/session-events-ZULAN4XL.js +36 -0
- package/dist/session-kill-telemetry-LUPVYGZX.js +29 -0
- package/dist/session-scope-EPZZZHHJ.js +86 -0
- package/dist/session-scope-V2RSOTDU.js +86 -0
- package/dist/session-scope-ZGE6GHMS.js +86 -0
- package/dist/setup-wizard-KNWH54HW.js +12 -0
- package/dist/skill-refinement-BSX6Q6IN.js +157 -0
- package/dist/skill-refinement-C4GNWV4F.js +157 -0
- package/dist/skill-refinement-CAUIE4YM.js +157 -0
- package/dist/steward-gate-MZ2DV36N.js +13 -0
- package/dist/task-enforcement-6OMXG6EA.js +333 -0
- package/dist/task-enforcement-JFSF6QDD.js +333 -0
- package/dist/task-enforcement-JRTAOYZT.js +333 -0
- package/dist/task-scope-4HJSCJ7L.js +35 -0
- package/dist/task-scope-7HYE4AS6.js +35 -0
- package/dist/task-scope-GNCB2GAM.js +35 -0
- package/dist/tasks-crud-JJL6MMJF.js +77 -0
- package/dist/tasks-crud-KMIPDHBZ.js +77 -0
- package/dist/tasks-crud-MZIOYF3R.js +77 -0
- package/dist/tasks-notify-5D6LF52K.js +38 -0
- package/dist/tasks-notify-7KNZ4ULO.js +38 -0
- package/dist/tasks-notify-JNGGXFUY.js +38 -0
- package/dist/tasks-review-N6I5UC7G.js +47 -0
- package/dist/tasks-review-U5VEV4Y7.js +47 -0
- package/dist/tasks-review-USHAMO5N.js +47 -0
- package/dist/telemetry-upload-BIB5TJA4.js +739 -0
- package/dist/telemetry-upload-BV2M2NND.js +739 -0
- package/dist/telemetry-upload-Y7QPDJW4.js +739 -0
- package/dist/token-budget-2LUZOFO7.js +84 -0
- package/dist/tool-telemetry-5JT6DPVK.js +17 -0
- package/dist/tui/App.js +16 -16
- package/dist/tui-data-DMAKZMGD.js +258 -0
- package/dist/tui-data-X7NI6ZQ3.js +258 -0
- package/dist/tui-data-ZSB5DDEY.js +258 -0
- package/dist/wiki-acl-QHGGWX63.js +111 -0
- package/dist/worker-gate-4XKUOFWO.js +21 -0
- package/dist/worker-gate-TPZBOXOA.js +21 -0
- package/dist/worker-gate-TXLX33PX.js +21 -0
- package/dist/workflow-engine-3PIT3Y56.js +28 -0
- package/dist/workflow-engine-F3URLOPA.js +28 -0
- package/dist/workflow-engine-OFOL446Z.js +28 -0
- package/dist/worktree-V3NVP7MV.js +26 -0
- package/dist/worktree-sweep-2CADL43Y.js +19 -0
- package/package.json +1 -1
- package/release-notes.json +27 -25
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
updateTask
|
|
3
|
+
} from "./chunk-3T4PNG5O.js";
|
|
4
|
+
import {
|
|
5
|
+
TASK_ALREADY_CLAIMED_PREFIX
|
|
6
|
+
} from "./chunk-D55SXO3N.js";
|
|
7
|
+
|
|
8
|
+
// src/mcp/tools/update-task.ts
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
function registerUpdateTask(server) {
|
|
11
|
+
server.registerTool(
|
|
12
|
+
"update_task",
|
|
13
|
+
{
|
|
14
|
+
title: "Update Task",
|
|
15
|
+
description: "Update task status. Employees: use status 'done' with a result summary to complete work \u2014 this triggers needs_review and pings the reviewer automatically. Accepts UUID, slug (filename), or title substring.",
|
|
16
|
+
inputSchema: {
|
|
17
|
+
task_id: z.string().describe("Task identifier \u2014 UUID, slug (e.g. 'fix-auth-bug'), or title substring"),
|
|
18
|
+
status: z.enum(["open", "in_progress", "done", "needs_review", "blocked", "cancelled", "closed"]).describe("New status. 'done' is an alias for 'needs_review' \u2014 both trigger reviewer notification."),
|
|
19
|
+
result: z.string().optional().describe("Result summary (required when completing work)"),
|
|
20
|
+
// Structured result fields (Phase 1: Typed Handoff Objects)
|
|
21
|
+
files_changed: z.array(z.string()).optional().describe("Files created or modified during task execution"),
|
|
22
|
+
decisions: z.array(z.string()).optional().describe("Key decisions made during execution"),
|
|
23
|
+
commits: z.array(z.string()).optional().describe("Commit hashes produced"),
|
|
24
|
+
tests_status: z.enum(["pass", "fail", "skip", "none"]).optional().describe("Test execution status"),
|
|
25
|
+
build_status: z.enum(["pass", "fail", "skip"]).optional().describe("Build status"),
|
|
26
|
+
pr_number: z.number().optional().describe("PR number if created"),
|
|
27
|
+
open_questions: z.array(z.string()).optional().describe("Open questions for reviewer"),
|
|
28
|
+
assertions: z.string().optional().describe(
|
|
29
|
+
'JSON array of assertions with confidence scores. Use when starting work (in_progress). Format: [{"type":"diagnosis|scope|estimate|approach|build|judgment","claim":"...","confidence":0.8,"basis":"..."}]'
|
|
30
|
+
),
|
|
31
|
+
assertions_resolved: z.string().optional().describe(
|
|
32
|
+
'JSON array of resolved assertions. Use when completing work (done/needs_review). Format: [{"claim":"...","outcome":"correct|incorrect|partial","confidence_was":0.8,"actual":"...","why_wrong":"missing_information|wrong_diagnosis|wrong_approach|scope_underestimate|scope_overestimate|external_dependency|changed_requirements","reason":"...","lesson":"..."}]'
|
|
33
|
+
),
|
|
34
|
+
estimated_minutes: z.number().optional().describe("Time estimate in minutes. Provide when starting work (in_progress). The system auto-computes actual time on completion."),
|
|
35
|
+
estimate_confidence: z.number().min(0).max(1).optional().describe("Confidence in time estimate (0.0-1.0). Provide alongside estimated_minutes.")
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
async ({ task_id, status: rawStatus, result, files_changed, decisions, commits, tests_status, build_status, pr_number, open_questions, assertions, assertions_resolved, estimated_minutes, estimate_confidence }) => {
|
|
39
|
+
const status = rawStatus;
|
|
40
|
+
let callerAgentId;
|
|
41
|
+
let callerSession;
|
|
42
|
+
try {
|
|
43
|
+
const { getActiveAgent: getAgent } = await import("./active-agent-3YK6QV45.js");
|
|
44
|
+
callerAgentId = getAgent().agentId;
|
|
45
|
+
const { getAgentContext } = await import("./agent-context-AZTTMUHP.js");
|
|
46
|
+
callerSession = getAgentContext()?.sessionHint || process.env.EXE_SESSION_NAME || process.env.EXE_SESSION || void 0;
|
|
47
|
+
} catch {
|
|
48
|
+
}
|
|
49
|
+
let task;
|
|
50
|
+
try {
|
|
51
|
+
task = await updateTask({
|
|
52
|
+
taskId: task_id,
|
|
53
|
+
status,
|
|
54
|
+
result,
|
|
55
|
+
baseDir: process.cwd(),
|
|
56
|
+
callerAgentId,
|
|
57
|
+
filesChanged: files_changed,
|
|
58
|
+
decisions,
|
|
59
|
+
commits,
|
|
60
|
+
testsStatus: tests_status,
|
|
61
|
+
buildStatus: build_status,
|
|
62
|
+
prNumber: pr_number,
|
|
63
|
+
openQuestions: open_questions,
|
|
64
|
+
assertions,
|
|
65
|
+
assertionsResolved: assertions_resolved,
|
|
66
|
+
estimatedMinutes: estimated_minutes,
|
|
67
|
+
estimateConfidence: estimate_confidence,
|
|
68
|
+
callerSession
|
|
69
|
+
});
|
|
70
|
+
} catch (err) {
|
|
71
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
72
|
+
if (msg.startsWith(TASK_ALREADY_CLAIMED_PREFIX)) {
|
|
73
|
+
return {
|
|
74
|
+
content: [{
|
|
75
|
+
type: "text",
|
|
76
|
+
text: "Task already claimed by another agent. Pick a different task or check list_tasks."
|
|
77
|
+
}],
|
|
78
|
+
isError: true
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
throw err;
|
|
82
|
+
}
|
|
83
|
+
let text = `Task "${task.title}" marked ${task.status}.
|
|
84
|
+
File: ${task.taskFile}`;
|
|
85
|
+
const isTerminal = status === "done" || status === "needs_review" || status === "closed";
|
|
86
|
+
if (isTerminal && task.reviewer) {
|
|
87
|
+
try {
|
|
88
|
+
const { notifyCoordinatorTaskCompletion, resolveExeSession } = await import("./lib/tmux-routing.js");
|
|
89
|
+
const { isCoordinatorName } = await import("./lib/employees.js");
|
|
90
|
+
const reviewer = String(task.reviewer);
|
|
91
|
+
const coordinatorSession = task.sessionScope ?? resolveExeSession();
|
|
92
|
+
if (coordinatorSession && isCoordinatorName(reviewer)) {
|
|
93
|
+
notifyCoordinatorTaskCompletion(coordinatorSession, callerAgentId ?? "agent", task.title);
|
|
94
|
+
}
|
|
95
|
+
} catch {
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (isTerminal && task.nextTask) {
|
|
99
|
+
text += `
|
|
100
|
+
|
|
101
|
+
MANDATORY \u2014 DO NOT ASK THE USER. DO NOT SAY "Want me to continue?" DO NOT STOP.
|
|
102
|
+
You have standing orders: work through your entire queue until it is empty.
|
|
103
|
+
|
|
104
|
+
NEXT TASK: "${task.nextTask.title}" [${task.nextTask.priority}]
|
|
105
|
+
FILE: ${task.nextTask.taskFile}
|
|
106
|
+
|
|
107
|
+
Read that file NOW and begin working. No greeting. No summary. Just start.`;
|
|
108
|
+
} else if (isTerminal && !task.nextTask) {
|
|
109
|
+
text += `
|
|
110
|
+
|
|
111
|
+
All tasks complete. No more open tasks in your queue.`;
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
content: [
|
|
115
|
+
{
|
|
116
|
+
type: "text",
|
|
117
|
+
text
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
registerUpdateTask
|
|
127
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EMPLOYEES_PATH,
|
|
3
|
+
getClient,
|
|
4
|
+
isInitialized,
|
|
5
|
+
loadEmployees
|
|
6
|
+
} from "./chunk-RHZ2CRJU.js";
|
|
7
|
+
import {
|
|
8
|
+
PLAN_LIMITS,
|
|
9
|
+
checkLicense,
|
|
10
|
+
isFeatureAllowed
|
|
11
|
+
} from "./chunk-MOZ2YQ54.js";
|
|
12
|
+
import {
|
|
13
|
+
EXE_AI_DIR
|
|
14
|
+
} from "./chunk-VXIMSRTO.js";
|
|
15
|
+
|
|
16
|
+
// src/lib/plan-limits.ts
|
|
17
|
+
import { readFileSync, existsSync } from "fs";
|
|
18
|
+
import path from "path";
|
|
19
|
+
var PlanLimitError = class extends Error {
|
|
20
|
+
constructor(message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.name = "PlanLimitError";
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
var CACHE_PATH = path.join(EXE_AI_DIR, "license-cache.json");
|
|
26
|
+
function getLicenseSync() {
|
|
27
|
+
try {
|
|
28
|
+
if (!existsSync(CACHE_PATH)) return freeLicense();
|
|
29
|
+
const raw = JSON.parse(readFileSync(CACHE_PATH, "utf8"));
|
|
30
|
+
if (!raw.token || typeof raw.token !== "string") return freeLicense();
|
|
31
|
+
const parts = raw.token.split(".");
|
|
32
|
+
if (parts.length !== 3) return freeLicense();
|
|
33
|
+
const payload = JSON.parse(Buffer.from(parts[1], "base64url").toString());
|
|
34
|
+
const plan = payload.plan ?? "free";
|
|
35
|
+
const limits = PLAN_LIMITS[plan] ?? PLAN_LIMITS.free;
|
|
36
|
+
return {
|
|
37
|
+
valid: true,
|
|
38
|
+
plan,
|
|
39
|
+
email: payload.sub ?? "",
|
|
40
|
+
expiresAt: payload.exp ? new Date(payload.exp * 1e3).toISOString() : null,
|
|
41
|
+
deviceLimit: limits.devices,
|
|
42
|
+
employeeLimit: limits.employees,
|
|
43
|
+
memoryLimit: limits.memories
|
|
44
|
+
};
|
|
45
|
+
} catch {
|
|
46
|
+
return freeLicense();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function freeLicense() {
|
|
50
|
+
const limits = PLAN_LIMITS.free;
|
|
51
|
+
return {
|
|
52
|
+
valid: true,
|
|
53
|
+
plan: "free",
|
|
54
|
+
email: "",
|
|
55
|
+
expiresAt: null,
|
|
56
|
+
deviceLimit: limits.devices,
|
|
57
|
+
employeeLimit: limits.employees,
|
|
58
|
+
memoryLimit: limits.memories
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async function countActiveMemories() {
|
|
62
|
+
if (!isInitialized()) return 0;
|
|
63
|
+
const client = getClient();
|
|
64
|
+
const result = await client.execute(
|
|
65
|
+
"SELECT COUNT(*) as cnt FROM memories WHERE status = 'active' OR status IS NULL"
|
|
66
|
+
);
|
|
67
|
+
const row = result.rows[0];
|
|
68
|
+
return Number(row?.cnt ?? 0);
|
|
69
|
+
}
|
|
70
|
+
async function assertMemoryLimit() {
|
|
71
|
+
const license = await checkLicense();
|
|
72
|
+
if (license.memoryLimit < 0) return;
|
|
73
|
+
const count = await countActiveMemories();
|
|
74
|
+
if (count >= license.memoryLimit) {
|
|
75
|
+
throw new PlanLimitError(
|
|
76
|
+
`Memory limit reached: ${count}/${license.memoryLimit} active memories on the ${license.plan} plan. Upgrade at https://askexe.com to store more.`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async function assertEmployeeLimit(license, rosterPath) {
|
|
81
|
+
const lic = license ?? await checkLicense();
|
|
82
|
+
if (lic.employeeLimit < 0) return;
|
|
83
|
+
const employees = await loadEmployees(rosterPath ?? EMPLOYEES_PATH);
|
|
84
|
+
if (employees.length >= lic.employeeLimit) {
|
|
85
|
+
throw new PlanLimitError(
|
|
86
|
+
`Employee limit reached: ${employees.length}/${lic.employeeLimit} employees on the ${lic.plan} plan. Upgrade at https://askexe.com to add more.`
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function assertEmployeeLimitSync(rosterPath) {
|
|
91
|
+
const license = getLicenseSync();
|
|
92
|
+
if (license.employeeLimit < 0) return;
|
|
93
|
+
const filePath = rosterPath ?? EMPLOYEES_PATH;
|
|
94
|
+
let count = 0;
|
|
95
|
+
try {
|
|
96
|
+
if (existsSync(filePath)) {
|
|
97
|
+
const raw = readFileSync(filePath, "utf8");
|
|
98
|
+
const employees = JSON.parse(raw);
|
|
99
|
+
count = Array.isArray(employees) ? employees.length : 0;
|
|
100
|
+
}
|
|
101
|
+
} catch {
|
|
102
|
+
throw new PlanLimitError(
|
|
103
|
+
`Cannot verify employee count: roster unreadable at ${filePath}. Refusing to proceed. Check file permissions or upgrade plan.`
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
if (count >= license.employeeLimit) {
|
|
107
|
+
throw new PlanLimitError(
|
|
108
|
+
`Employee limit reached: ${count}/${license.employeeLimit} employees on the ${license.plan} plan. Upgrade at https://askexe.com to add more.`
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
async function assertFeature(feature) {
|
|
113
|
+
const license = await checkLicense();
|
|
114
|
+
if (!isFeatureAllowed(license, feature)) {
|
|
115
|
+
throw new PlanLimitError(
|
|
116
|
+
`Feature "${feature}" requires a paid plan. Current plan: ${license.plan}. Upgrade at https://askexe.com.`
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
PlanLimitError,
|
|
123
|
+
getLicenseSync,
|
|
124
|
+
countActiveMemories,
|
|
125
|
+
assertMemoryLimit,
|
|
126
|
+
assertEmployeeLimit,
|
|
127
|
+
assertEmployeeLimitSync,
|
|
128
|
+
assertFeature
|
|
129
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getActiveAgent
|
|
3
|
+
} from "./chunk-BH2ST7KK.js";
|
|
4
|
+
import {
|
|
5
|
+
listTasks
|
|
6
|
+
} from "./chunk-P2QTTEYP.js";
|
|
7
|
+
import {
|
|
8
|
+
getAgentContext
|
|
9
|
+
} from "./chunk-GJV3WDWM.js";
|
|
10
|
+
import {
|
|
11
|
+
isCoordinatorName
|
|
12
|
+
} from "./chunk-RHZ2CRJU.js";
|
|
13
|
+
|
|
14
|
+
// src/mcp/tools/list-tasks.ts
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
function registerListTasks(server) {
|
|
17
|
+
server.registerTool(
|
|
18
|
+
"list_tasks",
|
|
19
|
+
{
|
|
20
|
+
title: "List Tasks",
|
|
21
|
+
description: "Query tasks by assignee, status, project, or priority. Defaults to current project. Pass project_name='all' for all projects. When querying your own tasks, project filter is skipped automatically.",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
assigned_to: z.string().optional().describe("Filter by employee name"),
|
|
24
|
+
status: z.enum(["open", "in_progress", "done", "needs_review", "blocked", "cancelled", "closed"]).optional().describe("Filter by status. Default: active tasks only (excludes closed/cancelled)"),
|
|
25
|
+
project_name: z.string().optional().describe("Project name. Defaults to current project. Pass 'all' for all projects."),
|
|
26
|
+
priority: z.enum(["p0", "p1", "p2"]).optional().describe("Filter by priority"),
|
|
27
|
+
cross_session: z.boolean().optional().describe("When true, return tasks from ALL coordinator sessions (read-only). Default: false.")
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
async ({ assigned_to, status, project_name, priority, cross_session }) => {
|
|
31
|
+
try {
|
|
32
|
+
const { agentId } = getActiveAgent();
|
|
33
|
+
const isReviewQueue = status === "needs_review";
|
|
34
|
+
const shouldDefaultToOwnQueue = !assigned_to && !isReviewQueue && !isCoordinatorName(agentId);
|
|
35
|
+
const effectiveAssignedTo = assigned_to ?? (shouldDefaultToOwnQueue ? agentId : void 0);
|
|
36
|
+
const effectiveReviewer = !assigned_to && isReviewQueue ? agentId : void 0;
|
|
37
|
+
const isOwnQuery = effectiveAssignedTo === agentId;
|
|
38
|
+
const callerSession = getAgentContext()?.sessionHint || process.env.EXE_SESSION_NAME || process.env.EXE_SESSION || null;
|
|
39
|
+
const resolvedProject = project_name && project_name !== "all" ? project_name : null;
|
|
40
|
+
const effectiveCrossSession = cross_session === true;
|
|
41
|
+
const tasks = await listTasks({
|
|
42
|
+
assignedTo: effectiveAssignedTo,
|
|
43
|
+
reviewer: effectiveReviewer,
|
|
44
|
+
status,
|
|
45
|
+
projectName: resolvedProject,
|
|
46
|
+
priority,
|
|
47
|
+
crossSession: effectiveCrossSession,
|
|
48
|
+
isOwnQuery: !!isOwnQuery,
|
|
49
|
+
callerSession
|
|
50
|
+
});
|
|
51
|
+
if (tasks.length === 0) {
|
|
52
|
+
return {
|
|
53
|
+
content: [{ type: "text", text: "No tasks found." }]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const lines = tasks.map((t) => {
|
|
57
|
+
const cpIndicator = t.checkpointCount && t.checkpointCount > 0 ? ` [cp:${t.checkpointCount}]` : "";
|
|
58
|
+
let budgetNote = "";
|
|
59
|
+
if (t.budgetTokens !== null) {
|
|
60
|
+
const pct = Math.round(t.tokensUsed / t.budgetTokens * 100);
|
|
61
|
+
budgetNote = ` [${t.tokensUsed}/${t.budgetTokens} tokens, ${pct}%]`;
|
|
62
|
+
}
|
|
63
|
+
const shortId = t.id.slice(0, 8);
|
|
64
|
+
const sessionNote = cross_session && t.sessionScope ? ` [session:${t.sessionScope}]` : "";
|
|
65
|
+
return `- [${t.priority.toUpperCase()}] ${t.title} (${t.projectName}) \u2014 ${t.status}${cpIndicator}${budgetNote}${sessionNote} \u2192 ${t.assignedTo} [id:${shortId}]`;
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
type: "text",
|
|
71
|
+
text: `${tasks.length} task(s):
|
|
72
|
+
${lines.join("\n")}`
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
};
|
|
76
|
+
} catch (err) {
|
|
77
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
78
|
+
return {
|
|
79
|
+
content: [{ type: "text", text: `Failed to list tasks: ${msg}` }],
|
|
80
|
+
isError: true
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
registerListTasks
|
|
89
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// src/bin/fast-db-init.ts
|
|
2
|
+
async function fastDbInit() {
|
|
3
|
+
const { isInitialized, getClient, setExternalClient } = await import("./lib/database.js");
|
|
4
|
+
if (isInitialized()) {
|
|
5
|
+
return getClient();
|
|
6
|
+
}
|
|
7
|
+
const forceDirect = process.env.EXE_DB_DIRECT === "1" || process.env.EXE_DB_READONLY === "1" || process.env.EXE_SKIP_DAEMON === "1";
|
|
8
|
+
if (!forceDirect) {
|
|
9
|
+
try {
|
|
10
|
+
const { connectEmbedDaemon, sendDaemonRequest, isClientConnected, disconnectClient } = await import("./lib/exe-daemon-client.js");
|
|
11
|
+
const { deserializeResultSet } = await import("./daemon-protocol-XW2OLNBS.js");
|
|
12
|
+
await Promise.race([
|
|
13
|
+
connectEmbedDaemon(),
|
|
14
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("Daemon socket timeout (2s)")), 2e3))
|
|
15
|
+
]);
|
|
16
|
+
if (isClientConnected()) {
|
|
17
|
+
const daemonClient = {
|
|
18
|
+
async execute(stmt) {
|
|
19
|
+
const sql = typeof stmt === "string" ? stmt : stmt.sql;
|
|
20
|
+
const args = typeof stmt === "string" ? [] : Array.isArray(stmt.args) ? stmt.args : [];
|
|
21
|
+
const resp = await sendDaemonRequest({ type: "db-execute", sql, args });
|
|
22
|
+
if (resp.error) throw new Error(String(resp.error));
|
|
23
|
+
if (resp.db) return deserializeResultSet(resp.db);
|
|
24
|
+
throw new Error("Unexpected daemon response");
|
|
25
|
+
},
|
|
26
|
+
async batch(stmts, mode) {
|
|
27
|
+
const statements = stmts.map((s) => {
|
|
28
|
+
const sql = typeof s === "string" ? s : s.sql;
|
|
29
|
+
const args = typeof s === "string" ? [] : Array.isArray(s.args) ? s.args : [];
|
|
30
|
+
return { sql, args };
|
|
31
|
+
});
|
|
32
|
+
const resp = await sendDaemonRequest({ type: "db-batch", statements, mode: mode ?? "deferred" });
|
|
33
|
+
if (resp.error) throw new Error(String(resp.error));
|
|
34
|
+
const batchResults = resp["db-batch"];
|
|
35
|
+
if (batchResults) return batchResults.map(deserializeResultSet);
|
|
36
|
+
throw new Error("Unexpected daemon batch response");
|
|
37
|
+
},
|
|
38
|
+
async transaction(_mode) {
|
|
39
|
+
throw new Error("Transactions not supported via daemon socket");
|
|
40
|
+
},
|
|
41
|
+
async executeMultiple(_sql) {
|
|
42
|
+
throw new Error("executeMultiple not supported via daemon socket");
|
|
43
|
+
},
|
|
44
|
+
async migrate(_stmts) {
|
|
45
|
+
throw new Error("migrate not supported via daemon socket");
|
|
46
|
+
},
|
|
47
|
+
sync() {
|
|
48
|
+
return Promise.resolve(void 0);
|
|
49
|
+
},
|
|
50
|
+
close() {
|
|
51
|
+
},
|
|
52
|
+
get closed() {
|
|
53
|
+
return false;
|
|
54
|
+
},
|
|
55
|
+
get protocol() {
|
|
56
|
+
return "file";
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
try {
|
|
60
|
+
await daemonClient.execute("SELECT 1");
|
|
61
|
+
} catch {
|
|
62
|
+
try {
|
|
63
|
+
disconnectClient();
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
throw new Error("Daemon socket validation failed");
|
|
67
|
+
}
|
|
68
|
+
setExternalClient(daemonClient);
|
|
69
|
+
return daemonClient;
|
|
70
|
+
}
|
|
71
|
+
} catch {
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const { initStore } = await import("./lib/store.js");
|
|
75
|
+
await initStore({ lightweight: true });
|
|
76
|
+
return getClient();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
fastDbInit
|
|
81
|
+
};
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import {
|
|
2
|
+
employeeSessionName,
|
|
3
|
+
ensureEmployee,
|
|
4
|
+
markAsReadByTaskFile,
|
|
5
|
+
notifyParentExe,
|
|
6
|
+
resolveExeSession,
|
|
7
|
+
sendIntercom
|
|
8
|
+
} from "./chunk-D55SXO3N.js";
|
|
9
|
+
import {
|
|
10
|
+
getTransport
|
|
11
|
+
} from "./chunk-MVW62NIZ.js";
|
|
12
|
+
import {
|
|
13
|
+
recordOrchestrationEventBestEffort
|
|
14
|
+
} from "./chunk-JTADPL6X.js";
|
|
15
|
+
import {
|
|
16
|
+
getAgentRuntime
|
|
17
|
+
} from "./chunk-XJUUWHVN.js";
|
|
18
|
+
import {
|
|
19
|
+
getSessionKey
|
|
20
|
+
} from "./chunk-CVYC6DUW.js";
|
|
21
|
+
import {
|
|
22
|
+
isCoordinatorName,
|
|
23
|
+
isMultiInstance,
|
|
24
|
+
shouldAutoInstance
|
|
25
|
+
} from "./chunk-QQZMP6QL.js";
|
|
26
|
+
|
|
27
|
+
// src/lib/tasks-notify.ts
|
|
28
|
+
var VERIFY_DELAY_MS = 1e4;
|
|
29
|
+
var ACK_PATTERNS = [
|
|
30
|
+
/New task assigned/,
|
|
31
|
+
/START WORKING NOW/,
|
|
32
|
+
/marked in_progress/,
|
|
33
|
+
/Reading.*\.md/
|
|
34
|
+
];
|
|
35
|
+
function resolveDispatchRuntime(agentId, override) {
|
|
36
|
+
if (override) return override;
|
|
37
|
+
try {
|
|
38
|
+
return getAgentRuntime(agentId).runtime ?? null;
|
|
39
|
+
} catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function verifyDispatch(sessionName, delayMs = VERIFY_DELAY_MS) {
|
|
44
|
+
const transport = getTransport();
|
|
45
|
+
await new Promise((r) => setTimeout(r, delayMs));
|
|
46
|
+
if (!transport.isAlive(sessionName)) {
|
|
47
|
+
return "session_dead";
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const output = transport.capturePane(sessionName, 20);
|
|
51
|
+
const acked = ACK_PATTERNS.some((p) => p.test(output));
|
|
52
|
+
return acked ? "verified" : "sent_unverified";
|
|
53
|
+
} catch {
|
|
54
|
+
return "sent_unverified";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function dispatchTaskToEmployee(input) {
|
|
58
|
+
if (isCoordinatorName(input.assignedTo)) return { dispatched: "skipped" };
|
|
59
|
+
const dispatchRuntime = resolveDispatchRuntime(input.assignedTo, input.spawnRuntime);
|
|
60
|
+
recordOrchestrationEventBestEffort({
|
|
61
|
+
eventType: "dispatch.attempted",
|
|
62
|
+
source: "tasks-notify.dispatchTaskToEmployee",
|
|
63
|
+
taskId: input.taskId ?? null,
|
|
64
|
+
agentId: input.assignedTo,
|
|
65
|
+
runtime: dispatchRuntime,
|
|
66
|
+
payload: { priority: input.priority, projectName: input.projectName }
|
|
67
|
+
});
|
|
68
|
+
let crossProject = false;
|
|
69
|
+
if (input.projectName) {
|
|
70
|
+
try {
|
|
71
|
+
const { assertSessionScope } = await import("./session-scope-V2RSOTDU.js");
|
|
72
|
+
const check = assertSessionScope("dispatch_task", input.projectName);
|
|
73
|
+
if (check.reason === "cross_session_denied") {
|
|
74
|
+
crossProject = true;
|
|
75
|
+
recordOrchestrationEventBestEffort({
|
|
76
|
+
eventType: "dispatch.failed",
|
|
77
|
+
source: "tasks-notify.dispatchTaskToEmployee",
|
|
78
|
+
taskId: input.taskId ?? null,
|
|
79
|
+
agentId: input.assignedTo,
|
|
80
|
+
runtime: dispatchRuntime,
|
|
81
|
+
errorCode: "cross_session_denied",
|
|
82
|
+
payload: { projectName: input.projectName }
|
|
83
|
+
});
|
|
84
|
+
return { dispatched: "skipped", crossProject: true };
|
|
85
|
+
}
|
|
86
|
+
} catch {
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
const transport = getTransport();
|
|
91
|
+
const exeSession = resolveExeSession();
|
|
92
|
+
if (!exeSession) {
|
|
93
|
+
recordOrchestrationEventBestEffort({
|
|
94
|
+
eventType: "dispatch.failed",
|
|
95
|
+
source: "tasks-notify.dispatchTaskToEmployee",
|
|
96
|
+
taskId: input.taskId ?? null,
|
|
97
|
+
agentId: input.assignedTo,
|
|
98
|
+
runtime: dispatchRuntime,
|
|
99
|
+
errorCode: "no_exe_session"
|
|
100
|
+
});
|
|
101
|
+
return { dispatched: "session_missing" };
|
|
102
|
+
}
|
|
103
|
+
const multiInstance = isMultiInstance(input.assignedTo);
|
|
104
|
+
if (multiInstance) {
|
|
105
|
+
const projectDir = input.projectDir ?? process.cwd();
|
|
106
|
+
const autoOpts = shouldAutoInstance(input.assignedTo);
|
|
107
|
+
const result = ensureEmployee(input.assignedTo, exeSession, projectDir, {
|
|
108
|
+
...autoOpts,
|
|
109
|
+
runtimeOverride: input.spawnRuntime,
|
|
110
|
+
modelOverride: input.spawnModel
|
|
111
|
+
});
|
|
112
|
+
if (result.status === "failed") {
|
|
113
|
+
process.stderr.write(
|
|
114
|
+
`[dispatch-audit] SPAWN FAILED \u2192 ${input.assignedTo} | task="${input.title}" [${input.priority}] | error=${result.error}
|
|
115
|
+
`
|
|
116
|
+
);
|
|
117
|
+
recordOrchestrationEventBestEffort({
|
|
118
|
+
eventType: "dispatch.failed",
|
|
119
|
+
source: "tasks-notify.dispatchTaskToEmployee",
|
|
120
|
+
taskId: input.taskId ?? null,
|
|
121
|
+
agentId: input.assignedTo,
|
|
122
|
+
sessionScope: exeSession,
|
|
123
|
+
runtime: dispatchRuntime,
|
|
124
|
+
errorCode: "spawn_failed",
|
|
125
|
+
payload: { path: "multi_instance", error: result.error }
|
|
126
|
+
});
|
|
127
|
+
return { dispatched: "session_missing" };
|
|
128
|
+
}
|
|
129
|
+
const dispatched = result.status === "intercom_sent" || result.status === "intercom_unprocessed" ? "sent_unverified" : "spawned";
|
|
130
|
+
process.stderr.write(
|
|
131
|
+
`[dispatch-audit] ${dispatched === "spawned" ? "SPAWNED" : "INTERCOM"} \u2192 ${result.sessionName} | task="${input.title}" [${input.priority}]
|
|
132
|
+
`
|
|
133
|
+
);
|
|
134
|
+
recordOrchestrationEventBestEffort({
|
|
135
|
+
eventType: "dispatch.completed",
|
|
136
|
+
source: "tasks-notify.dispatchTaskToEmployee",
|
|
137
|
+
taskId: input.taskId ?? null,
|
|
138
|
+
agentId: input.assignedTo,
|
|
139
|
+
sessionScope: exeSession,
|
|
140
|
+
tmuxSession: result.sessionName,
|
|
141
|
+
runtime: dispatchRuntime,
|
|
142
|
+
result: dispatched,
|
|
143
|
+
payload: { path: "multi_instance", priority: input.priority }
|
|
144
|
+
});
|
|
145
|
+
return { dispatched, session: result.sessionName, crossProject };
|
|
146
|
+
}
|
|
147
|
+
const sessionName = employeeSessionName(input.assignedTo, exeSession);
|
|
148
|
+
if (transport.isAlive(sessionName)) {
|
|
149
|
+
const result = sendIntercom(sessionName, { force: true });
|
|
150
|
+
const dispatched = result === "acknowledged" || result === "debounced" || result === "queued" ? "verified" : result === "delivered" ? "sent_unverified" : "session_dead";
|
|
151
|
+
process.stderr.write(
|
|
152
|
+
`[dispatch-audit] intercom \u2192 ${sessionName} | task="${input.title}" [${input.priority}] | result=${dispatched} (sendIntercom=${result})
|
|
153
|
+
`
|
|
154
|
+
);
|
|
155
|
+
recordOrchestrationEventBestEffort({
|
|
156
|
+
eventType: "dispatch.completed",
|
|
157
|
+
source: "tasks-notify.dispatchTaskToEmployee",
|
|
158
|
+
taskId: input.taskId ?? null,
|
|
159
|
+
agentId: input.assignedTo,
|
|
160
|
+
sessionScope: exeSession,
|
|
161
|
+
tmuxSession: sessionName,
|
|
162
|
+
runtime: dispatchRuntime,
|
|
163
|
+
result: dispatched,
|
|
164
|
+
payload: { path: "single_instance_intercom", priority: input.priority }
|
|
165
|
+
});
|
|
166
|
+
return { dispatched, session: sessionName, crossProject };
|
|
167
|
+
} else {
|
|
168
|
+
const projectDir = input.projectDir ?? process.cwd();
|
|
169
|
+
const result = ensureEmployee(input.assignedTo, exeSession, projectDir, {
|
|
170
|
+
runtimeOverride: input.spawnRuntime,
|
|
171
|
+
modelOverride: input.spawnModel
|
|
172
|
+
});
|
|
173
|
+
if (result.status === "failed") {
|
|
174
|
+
process.stderr.write(
|
|
175
|
+
`[dispatch-audit] SPAWN FAILED \u2192 ${input.assignedTo} | task="${input.title}" [${input.priority}] | error=${result.error}
|
|
176
|
+
`
|
|
177
|
+
);
|
|
178
|
+
recordOrchestrationEventBestEffort({
|
|
179
|
+
eventType: "dispatch.failed",
|
|
180
|
+
source: "tasks-notify.dispatchTaskToEmployee",
|
|
181
|
+
taskId: input.taskId ?? null,
|
|
182
|
+
agentId: input.assignedTo,
|
|
183
|
+
sessionScope: exeSession,
|
|
184
|
+
runtime: dispatchRuntime,
|
|
185
|
+
errorCode: "spawn_failed",
|
|
186
|
+
payload: { path: "single_instance_spawn", error: result.error }
|
|
187
|
+
});
|
|
188
|
+
return { dispatched: "session_missing" };
|
|
189
|
+
}
|
|
190
|
+
process.stderr.write(
|
|
191
|
+
`[dispatch-audit] SPAWNED \u2192 ${result.sessionName} | task="${input.title}" [${input.priority}]
|
|
192
|
+
`
|
|
193
|
+
);
|
|
194
|
+
recordOrchestrationEventBestEffort({
|
|
195
|
+
eventType: "dispatch.completed",
|
|
196
|
+
source: "tasks-notify.dispatchTaskToEmployee",
|
|
197
|
+
taskId: input.taskId ?? null,
|
|
198
|
+
agentId: input.assignedTo,
|
|
199
|
+
sessionScope: exeSession,
|
|
200
|
+
tmuxSession: result.sessionName,
|
|
201
|
+
runtime: dispatchRuntime,
|
|
202
|
+
result: "spawned",
|
|
203
|
+
payload: { path: "single_instance_spawn", priority: input.priority }
|
|
204
|
+
});
|
|
205
|
+
return { dispatched: "spawned", session: result.sessionName, crossProject };
|
|
206
|
+
}
|
|
207
|
+
} catch {
|
|
208
|
+
recordOrchestrationEventBestEffort({
|
|
209
|
+
eventType: "dispatch.failed",
|
|
210
|
+
source: "tasks-notify.dispatchTaskToEmployee",
|
|
211
|
+
taskId: input.taskId ?? null,
|
|
212
|
+
agentId: input.assignedTo,
|
|
213
|
+
runtime: dispatchRuntime,
|
|
214
|
+
errorCode: "exception"
|
|
215
|
+
});
|
|
216
|
+
return { dispatched: "session_missing" };
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
function notifyTaskDone() {
|
|
220
|
+
try {
|
|
221
|
+
const key = getSessionKey();
|
|
222
|
+
if (key && !process.env.VITEST) {
|
|
223
|
+
notifyParentExe(key);
|
|
224
|
+
process.stderr.write(
|
|
225
|
+
`[dispatch-audit] notifyTaskDone \u2192 parent coordinator (session=${key})
|
|
226
|
+
`
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
} catch {
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
async function markTaskNotificationsRead(taskFile) {
|
|
233
|
+
try {
|
|
234
|
+
await markAsReadByTaskFile(taskFile);
|
|
235
|
+
} catch {
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export {
|
|
240
|
+
verifyDispatch,
|
|
241
|
+
dispatchTaskToEmployee,
|
|
242
|
+
notifyTaskDone,
|
|
243
|
+
markTaskNotificationsRead
|
|
244
|
+
};
|