@askexenow/exe-os 0.9.341 → 0.9.342
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/README.md +159 -196
- package/deploy/compose/.env.customer.example +1 -0
- package/deploy/compose/.env.example +1 -0
- package/deploy/compose/docker-compose.yml +13 -4
- package/deploy/compose/generate-env.ts +4 -0
- package/dist/{active-agent-AIQP4DFL.js → active-agent-PVGE57FY.js} +5 -5
- package/dist/{active-agent-LW45DSJ4.js → active-agent-TNIO6IY3.js} +5 -5
- package/dist/{agentic-ontology-RVUNRCQY.js → agentic-ontology-3FXYMHKW.js} +1 -1
- package/dist/{backfill-gate-J7UXFNXU.js → backfill-gate-65LSYVE5.js} +3 -3
- package/dist/{backfill-metadata-ZSDJ4O2T.js → backfill-metadata-ZSMZC45J.js} +8 -8
- package/dist/{background-jobs-STURKDCS.js → background-jobs-EXR5RVGG.js} +3 -3
- package/dist/{backup-verify-ZAJLEL4X.js → backup-verify-3Y2FHGZU.js} +4 -4
- package/dist/{behaviors-EO7KCP3H.js → behaviors-KYRB3NGJ.js} +9 -9
- package/dist/bin/age-ontology-load.js +3 -3
- package/dist/bin/agentic-ontology-backfill.js +10 -10
- package/dist/bin/agentic-reflection-backfill.js +11 -11
- package/dist/bin/agentic-semantic-label.js +10 -10
- package/dist/bin/backfill-conversations.js +10 -10
- package/dist/bin/backfill-responses.js +10 -10
- package/dist/bin/backfill-vectors.js +14 -14
- package/dist/bin/bulk-sync-postgres.js +19 -19
- package/dist/bin/cc-doctor.js +10 -8
- package/dist/bin/cleanup-stale-review-tasks.js +25 -23
- package/dist/bin/cli.js +79 -25
- package/dist/bin/customer-readiness.js +1 -1
- package/dist/bin/deferred-daemon-restart.js +98 -92
- package/dist/bin/exe-agent-config.js +9 -8
- package/dist/bin/exe-agent.js +17 -17
- package/dist/bin/exe-assign.js +12 -12
- package/dist/bin/exe-boot.js +200 -67
- package/dist/bin/exe-call.js +7 -7
- package/dist/bin/exe-cloud.js +20 -20
- package/dist/bin/exe-config-dump.js +9 -8
- package/dist/bin/exe-dispatch.js +25 -23
- package/dist/bin/exe-doctor.js +10 -6
- package/dist/bin/exe-export-behaviors.js +11 -11
- package/dist/bin/exe-forget.js +12 -10
- package/dist/bin/exe-gateway.js +15 -10
- package/dist/bin/exe-grant.js +5 -5
- package/dist/bin/exe-healthcheck.js +14 -8
- package/dist/bin/exe-heartbeat.js +28 -27
- package/dist/bin/exe-kill.js +30 -28
- package/dist/bin/exe-launch-agent.js +128 -67
- package/dist/bin/exe-memory-reads.js +257 -0
- package/dist/bin/exe-new-employee.js +12 -11
- package/dist/bin/exe-pending-messages.js +26 -24
- package/dist/bin/exe-pending-notifications.js +25 -23
- package/dist/bin/exe-pending-reviews.js +25 -23
- package/dist/bin/exe-rename.js +7 -7
- package/dist/bin/exe-review.js +29 -27
- package/dist/bin/exe-search.js +11 -9
- package/dist/bin/exe-session-cleanup.js +115 -85
- package/dist/bin/exe-settings.js +24 -23
- package/dist/bin/exe-start-codex.js +163 -41
- package/dist/bin/exe-start-opencode.js +15 -15
- package/dist/bin/exe-status.js +26 -24
- package/dist/bin/exe-support.js +5 -5
- package/dist/bin/exe-team.js +5 -5
- package/dist/bin/exe-timers.js +32 -213
- package/dist/bin/exe-watchdog.js +6 -5
- package/dist/bin/git-sweep.js +26 -24
- package/dist/bin/graph-backfill.js +11 -11
- package/dist/bin/graph-export.js +9 -9
- package/dist/bin/import-history.js +13 -13
- package/dist/bin/install.js +103 -97
- package/dist/bin/intercom-check.js +4 -4
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.js +6 -6
- package/dist/bin/postgres-agentic-reflection-backfill.js +5 -5
- package/dist/bin/postgres-agentic-semantic-backfill.js +7 -7
- package/dist/bin/pre-publish.js +5 -3
- package/dist/bin/reconcile-backlog.js +2 -2
- package/dist/bin/registry-proxy.js +1 -1
- package/dist/bin/scan-tasks.js +25 -23
- package/dist/bin/setup.js +6 -5
- package/dist/bin/shard-migrate.js +9 -9
- package/dist/bin/stack-update.js +6 -6
- package/dist/bin/update.js +1 -1
- package/dist/bin/vps-health-gate.js +1 -1
- package/dist/{boot-generation-GSMPJOWM.js → boot-generation-BL2ISK4U.js} +5 -5
- package/dist/boot-review-sections-DBMQJT5N.js +107 -0
- package/dist/branch-hygiene-TZWK6QCF.js +224 -0
- package/dist/{branding-JTEOF4ZV.js → branding-DVXBGVDH.js} +3 -3
- package/dist/{browser-session-store-CXQMOSEC.js → browser-session-store-B2NR3LIX.js} +2 -1
- package/dist/{capability-cards-OBYQNAKZ.js → capability-cards-DN5UIKVN.js} +4 -4
- package/dist/{capacity-monitor-MG3FTUD5.js → capacity-monitor-ZG5GGFR2.js} +26 -24
- package/dist/{catchup-brief-BVJOF3GL.js → catchup-brief-D6HH6DWS.js} +31 -28
- package/dist/{chunk-Q5AIPSSC.js → chunk-25X4JD2V.js} +10 -6
- package/dist/{chunk-6MVI4QH2.js → chunk-2KZNGDSW.js} +1 -1
- package/dist/{chunk-WH7XN5ER.js → chunk-2WAVZ5UJ.js} +1 -1
- package/dist/{chunk-PTJBWC77.js → chunk-2ZYO73KO.js} +4 -3
- package/dist/{chunk-CLAYNAXC.js → chunk-3EUMUSLE.js} +1 -1
- package/dist/{chunk-BVV6NHKQ.js → chunk-3SW4OEHB.js} +5 -5
- package/dist/{task-enforcement-X5QVL6RE.js → chunk-4CMVFVFC.js} +173 -69
- package/dist/{chunk-2YCFNBC4.js → chunk-4J4PMPXZ.js} +3 -2
- package/dist/{chunk-EDOO23B2.js → chunk-4N2NRGCM.js} +2 -2
- package/dist/chunk-4QCFFW2H.js +378 -0
- package/dist/{chunk-6MVC43X7.js → chunk-4VSV5P4D.js} +2 -2
- package/dist/{chunk-HJX6NCJF.js → chunk-4ZCD2UWW.js} +39 -10
- package/dist/{chunk-C445WRUX.js → chunk-5ERDIOV3.js} +2 -2
- package/dist/chunk-5H47VHB7.js +30 -0
- package/dist/{chunk-BJ23BNED.js → chunk-5TY4FPH6.js} +1 -1
- package/dist/{chunk-WD55PEBM.js → chunk-6CH3TPHR.js} +3 -3
- package/dist/{chunk-TIXTHUVJ.js → chunk-6WQ3NNCE.js} +3 -3
- package/dist/{chunk-7LF5DS3A.js → chunk-6XWTQUO4.js} +1 -1
- package/dist/chunk-76CJBM36.js +88 -0
- package/dist/{chunk-NFBW7N4D.js → chunk-7CTRGNLW.js} +2 -2
- package/dist/{chunk-ITMEE7PQ.js → chunk-7V4JADD6.js} +3 -3
- package/dist/{chunk-RMOBQ6A5.js → chunk-AD2VCHSS.js} +1 -1
- package/dist/{chunk-DNVFWFYF.js → chunk-AJYCFKJR.js} +1 -1
- package/dist/chunk-AM7S2TY6.js +54 -0
- package/dist/{chunk-RWSLVYTE.js → chunk-AOHXREB7.js} +295 -67
- package/dist/{chunk-DGGDUKH6.js → chunk-ASAFVDVR.js} +1 -1
- package/dist/{chunk-NTI22F3R.js → chunk-BUCXNV32.js} +1 -1
- package/dist/{chunk-SHIICYJW.js → chunk-BYTDMAGB.js} +4 -2
- package/dist/{chunk-32SXNM3G.js → chunk-C5QAPURN.js} +1 -1
- package/dist/{chunk-BMHQPIJ2.js → chunk-CE7F6RHG.js} +585 -75
- package/dist/{chunk-YWQMWFYR.js → chunk-CNVBKDEY.js} +21 -15
- package/dist/{chunk-KPIN44GZ.js → chunk-CWXVH7WV.js} +1 -1
- package/dist/chunk-D74XYSA3.js +621 -0
- package/dist/{chunk-A47MXY2I.js → chunk-EQHQF5IM.js} +50 -32
- package/dist/{chunk-YHUNDGVV.js → chunk-EUS4QUKP.js} +1 -1
- package/dist/{chunk-6D2PI4QD.js → chunk-EV46QTD3.js} +1 -1
- package/dist/{chunk-N7A5D25S.js → chunk-F27XXN6C.js} +1 -1
- package/dist/{chunk-XQNNB5GY.js → chunk-F55P3H4S.js} +37 -2
- package/dist/{chunk-MWZFF3Q7.js → chunk-F5O7V7UK.js} +1 -1
- package/dist/{chunk-MC4ATFJV.js → chunk-FPFPLPUY.js} +6 -6
- package/dist/{chunk-UU4UINUX.js → chunk-G4RGKBCA.js} +2 -2
- package/dist/{chunk-HAZO7TRD.js → chunk-G5T6KDG4.js} +1 -1
- package/dist/{chunk-TWXZM34M.js → chunk-GBTTBXAF.js} +6 -6
- package/dist/{chunk-LA2Z6RMS.js → chunk-GDIJE6D7.js} +1 -1
- package/dist/{chunk-4QSJVMMT.js → chunk-GG5NDQNN.js} +2 -2
- package/dist/{chunk-6BQG7EKO.js → chunk-GJ26DULE.js} +2 -2
- package/dist/chunk-GL57PO3K.js +104 -0
- package/dist/chunk-GWDSB25T.js +6 -0
- package/dist/{chunk-HSYJ6DZ2.js → chunk-H6BV5TKD.js} +39 -24
- package/dist/{chunk-HCJCW7X4.js → chunk-H7I47RS5.js} +34 -1
- package/dist/{chunk-GFDGDFBF.js → chunk-HA5R6USD.js} +22 -5
- package/dist/{chunk-L2YGXJGF.js → chunk-HAF2DJYV.js} +3 -3
- package/dist/chunk-HJ447YER.js +224 -0
- package/dist/{chunk-6QW6JHRE.js → chunk-HV4KESRY.js} +59 -32
- package/dist/{chunk-BJOBR6P2.js → chunk-I26FWCSP.js} +216 -9
- package/dist/{chunk-X2FHTDIU.js → chunk-IBYL4DHM.js} +1 -1
- package/dist/{chunk-JCBKARSK.js → chunk-IOEUAQWP.js} +1 -1
- package/dist/{chunk-2UGGBIDL.js → chunk-JGIPOUIK.js} +3 -3
- package/dist/{chunk-LLU6WZLK.js → chunk-JLZ4RYSD.js} +2 -2
- package/dist/{chunk-WWNQFOSP.js → chunk-JMYHW3AL.js} +2 -2
- package/dist/{chunk-KP4PY2Z2.js → chunk-JPUZPAAF.js} +4 -4
- package/dist/{chunk-4LWV633D.js → chunk-JTBIS4R5.js} +1 -1
- package/dist/{chunk-PPZOWQHP.js → chunk-K7KFGDWF.js} +1 -1
- package/dist/{chunk-HNLXMD2V.js → chunk-KGWRTRKC.js} +2 -2
- package/dist/{chunk-IB336P52.js → chunk-KP3U5QGJ.js} +1 -1
- package/dist/{chunk-OUEFW4RK.js → chunk-KW2SD2FL.js} +2 -2
- package/dist/{chunk-2P4WJNN5.js → chunk-KWZMQACA.js} +11 -7
- package/dist/{chunk-ATKW3SYL.js → chunk-L2R3LN2P.js} +1 -1
- package/dist/{chunk-IELUDZAA.js → chunk-L4A5DL6Z.js} +3 -3
- package/dist/{chunk-2C455MU3.js → chunk-LU2FALL6.js} +3 -3
- package/dist/{chunk-LOBCQXV5.js → chunk-MKYFAKDW.js} +4 -4
- package/dist/{chunk-3BRVLPPA.js → chunk-MOPUCPXK.js} +4 -0
- package/dist/{chunk-BR4423AS.js → chunk-MR6LHP4F.js} +1 -1
- package/dist/chunk-MVYB76QG.js +341 -0
- package/dist/{chunk-ZNE6H2JO.js → chunk-MZM6EJCU.js} +4 -4
- package/dist/{chunk-FOV57K47.js → chunk-N7QJKQMX.js} +258 -14
- package/dist/{chunk-AYLNJGCS.js → chunk-NBZL5CGA.js} +93 -12
- package/dist/{chunk-YLQXP7T7.js → chunk-NN2B2QKU.js} +1 -1
- package/dist/chunk-NX5INHHG.js +40 -0
- package/dist/{chunk-B75BOKEI.js → chunk-NXUSDL37.js} +2 -2
- package/dist/{chunk-TPHCZDE3.js → chunk-O5V57XYE.js} +1 -1
- package/dist/chunk-O7LWR36Z.js +269 -0
- package/dist/{chunk-BV6GBSRP.js → chunk-OLMQ4UOF.js} +42 -10
- package/dist/{chunk-UIU2DGRV.js → chunk-OTF44GXL.js} +4 -4
- package/dist/{chunk-GOGSWXNZ.js → chunk-OZEBAGKR.js} +277 -137
- package/dist/{chunk-NDSNM5OH.js → chunk-P5HIWY2E.js} +1 -1
- package/dist/{chunk-MJB5ZFQM.js → chunk-PDWS3E22.js} +55 -4
- package/dist/{chunk-4FJZ6SO7.js → chunk-PPCDBE6Z.js} +1 -1
- package/dist/{chunk-7SEC2AG5.js → chunk-PQIDGXSG.js} +13 -4
- package/dist/chunk-PWUFMX75.js +186 -0
- package/dist/{chunk-GPW32HVB.js → chunk-QDGZJ653.js} +3 -3
- package/dist/{chunk-CYA5S5OD.js → chunk-QOO5RW3K.js} +6 -5
- package/dist/{chunk-IXBIVKWZ.js → chunk-QQ4E2RYW.js} +95 -18
- package/dist/{chunk-2WMTTIAZ.js → chunk-QRYVCDWS.js} +2 -2
- package/dist/{chunk-Z42MXYWW.js → chunk-QWVXN224.js} +110 -28
- package/dist/{chunk-XSMRR4IW.js → chunk-QYZJHTNE.js} +26 -27
- package/dist/{chunk-I7ECEP3W.js → chunk-R2NN3JKH.js} +43 -6
- package/dist/{chunk-B7CUBLF7.js → chunk-RACAOE2Z.js} +13 -13
- package/dist/{chunk-5RACW3LX.js → chunk-RAXVPNMR.js} +1 -1
- package/dist/{chunk-CMR64RYM.js → chunk-RHWZUUS4.js} +17 -17
- package/dist/{chunk-RNAYCUNM.js → chunk-S3THSOWV.js} +1 -1
- package/dist/{chunk-U2MREVXQ.js → chunk-S7QUM2UK.js} +2 -2
- package/dist/{chunk-SSTLTIF3.js → chunk-SKGMF2SO.js} +25 -2
- package/dist/{chunk-J6SEDDOR.js → chunk-SQKXKV2Y.js} +2 -2
- package/dist/{chunk-DPFQ2WQX.js → chunk-TLT7NZCW.js} +4 -4
- package/dist/chunk-TTCUG2CF.js +91 -0
- package/dist/{chunk-W6K4XB6G.js → chunk-UEA3LXOB.js} +1 -1
- package/dist/{chunk-WNKVKNOM.js → chunk-UNXQBELK.js} +1 -1
- package/dist/{chunk-KKOLHBNC.js → chunk-UP75Z5X7.js} +904 -167
- package/dist/{chunk-Y3S4H77G.js → chunk-USSB56WK.js} +1 -1
- package/dist/{chunk-PVIH3ZGV.js → chunk-UUEKJDK6.js} +90 -10
- package/dist/{chunk-T2PYVVZ5.js → chunk-UUQBZPJJ.js} +1 -1
- package/dist/{chunk-32YHCHWW.js → chunk-V3EEVY4L.js} +1 -1
- package/dist/{chunk-2IWBY7XK.js → chunk-VPZHJCKW.js} +2 -2
- package/dist/chunk-VRAQTFD6.js +265 -0
- package/dist/{chunk-EDH54E5A.js → chunk-VSRPS3J7.js} +14 -14
- package/dist/{chunk-5ZNY7IZI.js → chunk-WMESXBJM.js} +37 -3
- package/dist/{chunk-54QCG45Y.js → chunk-WOYADZF5.js} +56 -5
- package/dist/{chunk-7Y5UDEVM.js → chunk-WZHZCDDO.js} +6 -5
- package/dist/{chunk-3NGZ4PL7.js → chunk-X2Q5NLUL.js} +11 -2
- package/dist/{chunk-CCIEIRV2.js → chunk-X33NYQYJ.js} +2 -2
- package/dist/{chunk-K6KRBXQP.js → chunk-XHK3FS3W.js} +3 -2
- package/dist/{chunk-AP455LBW.js → chunk-XZXBB3TN.js} +2 -2
- package/dist/{chunk-JSKBHUR7.js → chunk-YCANDMI2.js} +2 -2
- package/dist/{chunk-YIIME2OW.js → chunk-YLXTKI6M.js} +1 -1
- package/dist/{chunk-LEJ25726.js → chunk-YTCFACP4.js} +650 -434
- package/dist/{chunk-HUSVERE6.js → chunk-Z6RSN7KS.js} +7 -6
- package/dist/{cleanup-graph-garbage-MXQ4Q2MA.js → cleanup-graph-garbage-XWUFAMFO.js} +8 -8
- package/dist/{co-activation-QI5BK4RT.js → co-activation-ZCHPLLP6.js} +4 -4
- package/dist/{co-occurrence-BYSQNZSV.js → co-occurrence-KG3LKALN.js} +6 -6
- package/dist/{code-context-index-BNBHDXHW.js → code-context-index-WSOJQ72R.js} +5 -5
- package/dist/{content-extractor-JRJDNIHP.js → content-extractor-NXYNEF5K.js} +2 -2
- package/dist/{conversation-entity-extractor-FPAMTL3C.js → conversation-entity-extractor-D3EFTLT4.js} +2 -2
- package/dist/{conversation-wiki-populator-WU4HEQ7C.js → conversation-wiki-populator-WQN3IUU6.js} +1 -1
- package/dist/{crdt-sync-ETPKNBCU.js → crdt-sync-4PFGPZXV.js} +8 -1
- package/dist/{crm-webhook-M566ZMZS.js → crm-webhook-II7Z45Q6.js} +2 -2
- package/dist/cto-delegation-gate-JWWOJPNC.js +669 -0
- package/dist/{daemon-auth-7IFSV5FG.js → daemon-auth-3FEAHFWC.js} +5 -3
- package/dist/{daemon-orchestration-XV5GN73R.js → daemon-orchestration-FX4XZDR5.js} +45 -26
- package/dist/{daemon-ready-RKKB4P6K.js → daemon-ready-4JTSFKAY.js} +1 -1
- package/dist/{daemon-ready-signal-WKEJQNRA.js → daemon-ready-signal-LPAZWQOV.js} +3 -1
- package/dist/daemon-restart-circuit-breaker-PEGEIP6H.js +35 -0
- package/dist/daemon-timer-report-NM44WQRH.js +25 -0
- package/dist/{db-backup-MX2G3CEK.js → db-backup-W2QFSYQC.js} +15 -5
- package/dist/{db-restore-events-JVEEP52Z.js → db-restore-events-MQ2DBGEQ.js} +2 -2
- package/dist/dispatch-ack-VYH3ONSS.js +27 -0
- package/dist/{doc-graph-extractor-LR5KMPH7.js → doc-graph-extractor-F6ODFIID.js} +6 -6
- package/dist/{documents-FA6N7QDA.js → documents-23WX2FPQ.js} +12 -12
- package/dist/dreaming-NWD22UQ5.js +46 -0
- package/dist/{exe-drift-TUKTCXZE.js → exe-drift-CW72FBGE.js} +5 -5
- package/dist/{exe-export-ZLHBXMZC.js → exe-export-AUJ7CV7G.js} +11 -11
- package/dist/{exe-import-VVKBZWSA.js → exe-import-JX4I52VE.js} +11 -11
- package/dist/{exe-key-QJXFBF6G.js → exe-key-2N6LY2BU.js} +242 -228
- package/dist/{exe-org-BGZNNE4H.js → exe-org-X4CSNCKS.js} +3 -3
- package/dist/{exe-snapshot-JRLUO645.js → exe-snapshot-XZ7FVCYZ.js} +30 -28
- package/dist/{fast-db-init-JKJEEHUI.js → fast-db-init-4CWHSOOR.js} +1 -1
- package/dist/{founder-context-HWPLMZVR.js → founder-context-7L3CFPYN.js} +4 -4
- package/dist/gateway/index.js +25 -25
- package/dist/{gateway-client-GRBOJQYC.js → gateway-client-7LMZKHTH.js} +1 -1
- package/dist/git-main-guard-UZP3KXYI.js +39 -0
- package/dist/{git-staleness-X5XZONX3.js → git-staleness-CI2R4QOJ.js} +4 -4
- package/dist/{global-procedures-VIIVWB6R.js → global-procedures-XQX3LUH6.js} +6 -6
- package/dist/{graph-auto-extract-HCQQF5AG.js → graph-auto-extract-OURWMGBS.js} +6 -6
- package/dist/{graph-rag-WAK2BRJH.js → graph-rag-JZZAB7PC.js} +2 -2
- package/dist/{hook-integrity-WURH6DS3.js → hook-integrity-XY47IM7G.js} +1 -1
- package/dist/hook-prefetch-PHRRKY4C.js +137 -0
- package/dist/hooks/bug-report-worker.js +31 -27
- package/dist/hooks/codex-stop-task-finalizer.js +31 -27
- package/dist/hooks/commit-complete.js +28 -26
- package/dist/hooks/error-recall.js +12 -11
- package/dist/hooks/exe-heartbeat-hook.js +6 -6
- package/dist/hooks/ingest-worker.js +11 -11
- package/dist/hooks/ingest.js +18 -18
- package/dist/hooks/instructions-loaded.js +7 -7
- package/dist/hooks/manifest.json +20 -20
- package/dist/hooks/notification.js +7 -7
- package/dist/hooks/post-compact.js +27 -25
- package/dist/hooks/post-tool-combined.js +12 -12
- package/dist/hooks/pre-compact.js +28 -26
- package/dist/hooks/pre-tool-use.js +179 -46
- package/dist/hooks/prompt-submit.js +323 -272
- package/dist/hooks/session-end.js +34 -32
- package/dist/hooks/session-start.js +28 -21
- package/dist/hooks/stop.js +34 -32
- package/dist/hooks/subagent-stop.js +27 -25
- package/dist/hooks/summary-worker.js +35 -33
- package/dist/index.js +40 -38
- package/dist/{installer-6IFVEQI4.js → installer-G3JAO3NT.js} +9 -9
- package/dist/{installer-NX2CLNV5.js → installer-JND3RJ6Q.js} +9 -9
- package/dist/{installer-T2LGHZKL.js → installer-L7EVH5U5.js} +9 -9
- package/dist/{intercom-queue-KYHXXZCQ.js → intercom-queue-ZFEQALR3.js} +24 -22
- package/dist/{key-backup-status-TNEHXA2X.js → key-backup-status-LOSMVATJ.js} +2 -2
- package/dist/lib/agent-config.js +4 -3
- package/dist/lib/cloud-sync.js +19 -19
- package/dist/lib/config.js +2 -2
- package/dist/lib/consolidation.js +11 -11
- package/dist/lib/crypto.js +3 -3
- package/dist/lib/database.js +6 -4
- package/dist/lib/db-daemon-client.js +5 -5
- package/dist/lib/db-read-worker-client.js +9 -3
- package/dist/lib/db.js +6 -4
- package/dist/lib/device-registry.js +3 -3
- package/dist/lib/embed-worker.js +2 -2
- package/dist/lib/embedder.js +5 -5
- package/dist/lib/employee-templates.js +7 -7
- package/dist/lib/employees.js +10 -4
- package/dist/lib/exe-daemon-client.js +4 -4
- package/dist/lib/exe-daemon.js +588 -164
- package/dist/lib/hybrid-search.js +11 -9
- package/dist/lib/identity.js +4 -4
- package/dist/lib/keychain.js +1 -1
- package/dist/lib/license.js +4 -4
- package/dist/lib/messaging.js +27 -23
- package/dist/lib/post-tool-memory.js +3 -3
- package/dist/lib/registry-proxy.js +1 -1
- package/dist/lib/reminders.js +15 -7
- package/dist/lib/schedules.js +9 -9
- package/dist/lib/session-registry.js +6 -6
- package/dist/lib/skill-learning.js +10 -10
- package/dist/lib/status-brief.js +4 -4
- package/dist/lib/store.js +8 -8
- package/dist/lib/task-router.js +5 -5
- package/dist/lib/tasks.js +28 -24
- package/dist/lib/tmux-routing.js +55 -24
- package/dist/lib/tmux-status.js +9 -3
- package/dist/lib/tmux-transport.js +1 -1
- package/dist/lib/token-spend.js +5 -5
- package/dist/lib/transport.js +2 -2
- package/dist/lib/ws-client.js +1 -1
- package/dist/{license-gate-MGDR4YNI.js → license-gate-QTRQHV4F.js} +5 -5
- package/dist/{license-sync-UWE6GEB4.js → license-sync-N3UJFWAW.js} +4 -4
- package/dist/mcp/register-tools.js +97 -91
- package/dist/mcp/server.js +99 -93
- package/dist/mcp/tools/complete-reminder.js +6 -6
- package/dist/mcp/tools/create-reminder.js +6 -6
- package/dist/mcp/tools/create-task.js +36 -27
- package/dist/mcp/tools/deactivate-behavior.js +11 -11
- package/dist/mcp/tools/list-reminders.js +6 -6
- package/dist/mcp/tools/list-tasks.js +34 -28
- package/dist/mcp/tools/send-message.js +27 -25
- package/dist/mcp/tools/update-task.js +33 -27
- package/dist/{mcp-http-config-RQLYEPTL.js → mcp-http-config-BDL36JZ3.js} +6 -6
- package/dist/{mcp-port-config-FFAMMLLE.js → mcp-port-config-6HYY6J7K.js} +2 -2
- package/dist/mcp-session-identity-T7H2EKFQ.js +177 -0
- package/dist/{memory-cards-VYQ5DPMR.js → memory-cards-ZRDW7QBX.js} +8 -8
- package/dist/{memory-graph-extractor-GX2HNYLU.js → memory-graph-extractor-QLXDMHRS.js} +7 -7
- package/dist/{memory-poisoning-defense-TX7627BD.js → memory-poisoning-defense-HJTXYCWH.js} +4 -4
- package/dist/{memory-pressure-watchdog-MLNNH26B.js → memory-pressure-watchdog-HN5X7AVN.js} +75 -36
- package/dist/{memory-queue-X2CSEAKE.js → memory-queue-2UOOF27L.js} +5 -3
- package/dist/{memory-queue-client-YRL6XTGU.js → memory-queue-client-O5U6F6XP.js} +6 -6
- package/dist/{memory-reflection-KIGEFSI4.js → memory-reflection-WVNFBJAA.js} +4 -4
- package/dist/{monitor-grants-RZOVSYVO.js → monitor-grants-E3ELDEWD.js} +5 -5
- package/dist/{monitor-identity-MOXISYNG.js → monitor-identity-GLFZSEAH.js} +2 -2
- package/dist/{notification-ledger-B6AVEGMV.js → notification-ledger-SZEPGJQ7.js} +25 -23
- package/dist/{notifications-DWXV7SVL.js → notifications-4UT53CDG.js} +24 -22
- package/dist/{orchestration-events-ZG7O4HRY.js → orchestration-events-WV4NWKZH.js} +5 -5
- package/dist/{orchestration-phase-CXRCBCK7.js → orchestration-phase-AWBXPO52.js} +3 -3
- package/dist/orchestrator-UAC3RW2T.js +47 -0
- package/dist/{pipeline-router-RTLAGZTA.js → pipeline-router-LM53NMWJ.js} +5 -5
- package/dist/{plan-limits-WLQZTCSF.js → plan-limits-2FEY2GOS.js} +7 -7
- package/dist/platform-procedures-X5DFJFV7.js +13 -0
- package/dist/{preferences-TYTGDXQZ.js → preferences-TWIXZBKS.js} +2 -2
- package/dist/{project-boot-6CGQ3EAH.js → project-boot-4NUH5FRU.js} +2 -2
- package/dist/{projection-worker-44SEKTZ5.js → projection-worker-FZ7YSN3G.js} +5 -5
- package/dist/{prospective-memory-UACFTYXK.js → prospective-memory-6D2ASWM3.js} +4 -4
- package/dist/{push-notifications-W5JRXLKJ.js → push-notifications-U6FIBQRW.js} +3 -3
- package/dist/{reranker-NL4YAV6R.js → reranker-GYYRPANK.js} +3 -3
- package/dist/{retrieval-health-4C2PO6HH.js → retrieval-health-4Z242P3B.js} +1 -1
- package/dist/{review-polling-W5AMHNLT.js → review-polling-HXAFJZDA.js} +25 -23
- package/dist/runtime/index.js +35 -33
- package/dist/{session-events-PGL5GJEB.js → session-events-O3BV56ZX.js} +25 -23
- package/dist/{session-kill-telemetry-6YDGEF27.js → session-kill-telemetry-AELE4JDK.js} +25 -23
- package/dist/session-mcp-config-YKNXG5DW.js +50 -0
- package/dist/{session-scope-3MEOO557.js → session-scope-5EAPUT45.js} +24 -22
- package/dist/setup-wizard-NB6R4QVS.js +14 -0
- package/dist/{shard-manager-MBWQEYNG.js → shard-manager-35PWFR3B.js} +3 -3
- package/dist/{skill-refinement-EOROTBPX.js → skill-refinement-DVSYXBBP.js} +5 -5
- package/dist/{stack-release-PR2XKJ4Q.js → stack-release-HGFFFCGC.js} +90 -15
- package/dist/{stack-update-LMDM27ZW.js → stack-update-ATCJFOEK.js} +5 -5
- package/dist/{steward-gate-4A2XHYFD.js → steward-gate-3GQ5XKMJ.js} +5 -5
- package/dist/{support-inbox-Z77ACQUY.js → support-inbox-4L62P4EP.js} +7 -6
- package/dist/{support-outbox-GB5SQFRJ.js → support-outbox-WHGPUYL2.js} +2 -2
- package/dist/task-enforcement-IPIZX2MM.js +90 -0
- package/dist/{task-scope-EKYDCVUF.js → task-scope-FOIW25HR.js} +26 -22
- package/dist/{tasks-crud-6LBNU43G.js → tasks-crud-HBDKE6C5.js} +34 -22
- package/dist/tasks-notify-G2U2U2YA.js +53 -0
- package/dist/{tasks-review-PBIUYXAL.js → tasks-review-27SFX5XN.js} +26 -22
- package/dist/{telemetry-upload-WQDFABTF.js → telemetry-upload-ZOXHRWR5.js} +9 -9
- package/dist/tmux-command-guard-KSJKIX3C.js +117 -0
- package/dist/{token-budget-KWGL5DY7.js → token-budget-5Y4YPDO3.js} +5 -5
- package/dist/{tool-capability-index-EH3HQVHU.js → tool-capability-index-VYF5GNJ2.js} +1 -1
- package/dist/{tool-telemetry-UC55LSIH.js → tool-telemetry-KBXSBDTK.js} +1 -1
- package/dist/tui/App.js +39 -37
- package/dist/{tui-data-M3RBSJL3.js → tui-data-NLFMBIQI.js} +24 -22
- package/dist/{update-check-HFO4VHO4.js → update-check-3FHAWIG2.js} +7 -3
- package/dist/{update-support-VPBD5SD2.js → update-support-UVUSZG7R.js} +93 -93
- package/dist/{whatsapp-accounts-BWRZUY23.js → whatsapp-accounts-BFIOXYW5.js} +1 -1
- package/dist/{whatsapp-config-GOSELKTE.js → whatsapp-config-FAX6EA5K.js} +20 -13
- package/dist/{worker-gate-4QLLMXZM.js → worker-gate-3KUBAU32.js} +3 -3
- package/dist/{workflow-engine-MMEHKUN4.js → workflow-engine-YITHXZR5.js} +2 -2
- package/dist/{working-memory-PY4AG577.js → working-memory-NUVB5SFV.js} +1 -1
- package/dist/worktree-LL62PLQB.js +47 -0
- package/dist/{worktree-sweep-5WKBU7E6.js → worktree-sweep-WTK3MTKH.js} +7 -7
- package/package.json +3 -2
- package/release-notes.json +75 -43
- package/dist/branch-hygiene-R5NVTRAY.js +0 -138
- package/dist/chunk-7YORGTXC.js +0 -138
- package/dist/chunk-CCPHEPLU.js +0 -30
- package/dist/chunk-HMP5VT6A.js +0 -118
- package/dist/chunk-PVYR4FCQ.js +0 -113
- package/dist/chunk-RP5GETX5.js +0 -140
- package/dist/chunk-YGAAZN3E.js +0 -47
- package/dist/cto-delegation-gate-S734XDXT.js +0 -290
- package/dist/dispatch-ack-4S44HBWB.js +0 -15
- package/dist/dreaming-UKGTQT6I.js +0 -44
- package/dist/orchestrator-PGHJDUUT.js +0 -45
- package/dist/setup-wizard-CJIYDSSP.js +0 -13
- package/dist/tasks-notify-TFJLSQ3B.js +0 -50
- package/dist/worktree-YXBDRYOC.js +0 -31
- package/dist/{chunk-7UMCQQWS.js → chunk-A4DVMPYB.js} +3 -3
- /package/dist/{chunk-2KLAYDFB.js → chunk-GIBYNT6W.js} +0 -0
- /package/dist/{chunk-MC6VPZKS.js → chunk-JRM4TAGS.js} +0 -0
- /package/dist/{chunk-3NCZKWPO.js → chunk-MGGOSFCR.js} +0 -0
- /package/dist/{chunk-C2SRRCRK.js → chunk-QIFYLIUF.js} +0 -0
- /package/dist/{chunk-OADURIIN.js → chunk-WTH4CSAP.js} +0 -0
- /package/dist/{core-memory-3IBWM4WR.js → core-memory-GAC6EWOQ.js} +0 -0
- /package/dist/{entity-boost-DWAWXFKN.js → entity-boost-NT6UO2Z3.js} +0 -0
- /package/dist/{message-queue-client-3PTHPG5Q.js → message-queue-client-4EOQRUXW.js} +0 -0
- /package/dist/{oauth-server-M5TGXT6D.js → oauth-server-67YBDP32.js} +0 -0
- /package/dist/{webhook-pipe-FZYLO6RR.js → webhook-pipe-LEXMUQ5B.js} +0 -0
- /package/dist/{wiki-acl-7CROE3MJ.js → wiki-acl-74BLWG6J.js} +0 -0
- /package/dist/{wiki-client-VNDOBK63.js → wiki-client-EAN7F5LV.js} +0 -0
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
exportOrchestration,
|
|
3
3
|
importOrchestration,
|
|
4
4
|
validatePackage
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TLT7NZCW.js";
|
|
6
6
|
import {
|
|
7
7
|
runDriftProbes
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UUQBZPJJ.js";
|
|
9
9
|
import {
|
|
10
10
|
registerAddBugReportComment,
|
|
11
11
|
registerGetBugReport,
|
|
@@ -18,7 +18,20 @@ import {
|
|
|
18
18
|
registerTriageBugReport,
|
|
19
19
|
registerTriageFeatureRequest,
|
|
20
20
|
registerTriageReview
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HV4KESRY.js";
|
|
22
|
+
import {
|
|
23
|
+
persistSupportArtifact
|
|
24
|
+
} from "./chunk-TTCUG2CF.js";
|
|
25
|
+
import {
|
|
26
|
+
supportCommitSchema,
|
|
27
|
+
supportIdSchema,
|
|
28
|
+
supportProductSchema,
|
|
29
|
+
supportTaskIdSchema,
|
|
30
|
+
supportVersionSchema
|
|
31
|
+
} from "./chunk-5H47VHB7.js";
|
|
32
|
+
import {
|
|
33
|
+
StewardGate
|
|
34
|
+
} from "./chunk-EUS4QUKP.js";
|
|
22
35
|
import {
|
|
23
36
|
DEFAULT_LIST_LIMIT,
|
|
24
37
|
MAX_IMPORTANCE,
|
|
@@ -27,26 +40,11 @@ import {
|
|
|
27
40
|
ingestDocument,
|
|
28
41
|
listDocumentsByWorkspace,
|
|
29
42
|
updateChunksImportance
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import {
|
|
32
|
-
analyzeBlastRadius,
|
|
33
|
-
buildCodeContextIndex,
|
|
34
|
-
buildCodeContextIndexWithEmbeddings,
|
|
35
|
-
getCodeContextStats,
|
|
36
|
-
searchCodeContext,
|
|
37
|
-
searchCodeContextSemantic,
|
|
38
|
-
traceCodeSymbol
|
|
39
|
-
} from "./chunk-U2MREVXQ.js";
|
|
40
|
-
import {
|
|
41
|
-
StewardGate
|
|
42
|
-
} from "./chunk-YHUNDGVV.js";
|
|
43
|
-
import {
|
|
44
|
-
DreamingEngine
|
|
45
|
-
} from "./chunk-L2YGXJGF.js";
|
|
43
|
+
} from "./chunk-MKYFAKDW.js";
|
|
46
44
|
import {
|
|
47
45
|
isRerankerAvailable,
|
|
48
46
|
rerankWithScores
|
|
49
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-UNXQBELK.js";
|
|
50
48
|
import {
|
|
51
49
|
getEntityByName,
|
|
52
50
|
getEntityNeighbors,
|
|
@@ -55,28 +53,40 @@ import {
|
|
|
55
53
|
getRelationships,
|
|
56
54
|
searchEntities
|
|
57
55
|
} from "./chunk-CRCB5S7I.js";
|
|
56
|
+
import {
|
|
57
|
+
analyzeBlastRadius,
|
|
58
|
+
buildCodeContextIndex,
|
|
59
|
+
buildCodeContextIndexWithEmbeddings,
|
|
60
|
+
getCodeContextStats,
|
|
61
|
+
searchCodeContext,
|
|
62
|
+
searchCodeContextSemantic,
|
|
63
|
+
traceCodeSymbol
|
|
64
|
+
} from "./chunk-S7QUM2UK.js";
|
|
58
65
|
import {
|
|
59
66
|
listRecentSessionEvents
|
|
60
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-NN2B2QKU.js";
|
|
68
|
+
import {
|
|
69
|
+
DreamingEngine
|
|
70
|
+
} from "./chunk-HAF2DJYV.js";
|
|
71
|
+
import {
|
|
72
|
+
AUTO_WAKE_MAX_RETRIES
|
|
73
|
+
} from "./chunk-CE7F6RHG.js";
|
|
61
74
|
import {
|
|
62
75
|
DEFAULT_EXPLORE_DURATION_MS,
|
|
63
76
|
getPlayMode,
|
|
64
77
|
listExploreSessions,
|
|
65
78
|
setPlayMode
|
|
66
|
-
} from "./chunk-
|
|
67
|
-
import {
|
|
68
|
-
AUTO_WAKE_MAX_RETRIES
|
|
69
|
-
} from "./chunk-BMHQPIJ2.js";
|
|
79
|
+
} from "./chunk-4CMVFVFC.js";
|
|
70
80
|
import {
|
|
71
81
|
getCachedLicenseGate,
|
|
72
82
|
refreshLicenseGate
|
|
73
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-P5HIWY2E.js";
|
|
74
84
|
import {
|
|
75
85
|
getToolUsageStats
|
|
76
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-JRM4TAGS.js";
|
|
77
87
|
import {
|
|
78
88
|
getToolCapabilityIndex
|
|
79
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-MGGOSFCR.js";
|
|
80
90
|
import {
|
|
81
91
|
isToolAllowed,
|
|
82
92
|
isToolAllowedForPlan
|
|
@@ -84,58 +94,59 @@ import {
|
|
|
84
94
|
import {
|
|
85
95
|
loadOrchestrationPhase,
|
|
86
96
|
setOrchestrationPhase
|
|
87
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-C5QAPURN.js";
|
|
88
98
|
import {
|
|
89
99
|
createOrRefreshResumeTask
|
|
90
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-FPFPLPUY.js";
|
|
91
101
|
import {
|
|
92
|
-
|
|
93
|
-
} from "./chunk-
|
|
102
|
+
registerSendMessage
|
|
103
|
+
} from "./chunk-JMYHW3AL.js";
|
|
104
|
+
import {
|
|
105
|
+
registerCreateTask,
|
|
106
|
+
resolveProjectDir
|
|
107
|
+
} from "./chunk-OZEBAGKR.js";
|
|
94
108
|
import {
|
|
95
109
|
registerListTasks
|
|
96
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-QOO5RW3K.js";
|
|
97
111
|
import {
|
|
98
112
|
registerUpdateTask
|
|
99
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-Z6RSN7KS.js";
|
|
100
114
|
import {
|
|
101
115
|
registerCreateReminder
|
|
102
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-NX5INHHG.js";
|
|
103
117
|
import {
|
|
104
118
|
registerListReminders
|
|
105
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-4J4PMPXZ.js";
|
|
106
120
|
import {
|
|
107
121
|
registerCompleteReminder
|
|
108
|
-
} from "./chunk-
|
|
109
|
-
import {
|
|
110
|
-
registerDeactivateBehavior
|
|
111
|
-
} from "./chunk-ZNE6H2JO.js";
|
|
122
|
+
} from "./chunk-F27XXN6C.js";
|
|
112
123
|
import {
|
|
113
124
|
completeReminder,
|
|
114
125
|
createReminder,
|
|
115
126
|
listReminders
|
|
116
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-UUEKJDK6.js";
|
|
117
128
|
import {
|
|
118
|
-
|
|
119
|
-
} from "./chunk-
|
|
129
|
+
registerDeactivateBehavior
|
|
130
|
+
} from "./chunk-MZM6EJCU.js";
|
|
120
131
|
import {
|
|
121
|
-
|
|
122
|
-
} from "./chunk-
|
|
132
|
+
registerImportConversations
|
|
133
|
+
} from "./chunk-6WQ3NNCE.js";
|
|
123
134
|
import {
|
|
124
135
|
TOKENS_PER_IDLE_MINUTE,
|
|
125
136
|
countKillsSince,
|
|
126
137
|
sumTokensSavedSince
|
|
127
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-L4A5DL6Z.js";
|
|
128
139
|
import {
|
|
129
140
|
createSchedule,
|
|
130
141
|
parseHumanCron
|
|
131
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-SQKXKV2Y.js";
|
|
132
143
|
import {
|
|
133
144
|
status
|
|
134
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-JPUZPAAF.js";
|
|
135
146
|
import {
|
|
136
147
|
evaluateGlobalSpendCap,
|
|
137
148
|
getAgentSpend
|
|
138
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-QRYVCDWS.js";
|
|
139
150
|
import {
|
|
140
151
|
exportGraphHTML,
|
|
141
152
|
generateGraphReport
|
|
@@ -148,14 +159,14 @@ import {
|
|
|
148
159
|
formatReport,
|
|
149
160
|
runAudit,
|
|
150
161
|
shouldFixShards
|
|
151
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-QQ4E2RYW.js";
|
|
152
163
|
import {
|
|
153
164
|
formatDegradations,
|
|
154
165
|
getRetrievalHealth
|
|
155
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-2KZNGDSW.js";
|
|
156
167
|
import {
|
|
157
168
|
runHealthCheck
|
|
158
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-PDWS3E22.js";
|
|
159
170
|
import {
|
|
160
171
|
checkCpuStealSync
|
|
161
172
|
} from "./chunk-SSC7EKY2.js";
|
|
@@ -163,7 +174,7 @@ import {
|
|
|
163
174
|
hasFailures,
|
|
164
175
|
runHealth,
|
|
165
176
|
runTest
|
|
166
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-OTF44GXL.js";
|
|
167
178
|
import {
|
|
168
179
|
isSupportReportSentStatus,
|
|
169
180
|
markSupportReportSent
|
|
@@ -174,28 +185,28 @@ import {
|
|
|
174
185
|
} from "./chunk-2XZ6X3PJ.js";
|
|
175
186
|
import {
|
|
176
187
|
renderClientCOOTemplate
|
|
177
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-XHK3FS3W.js";
|
|
178
189
|
import {
|
|
179
190
|
deactivateGlobalProcedure,
|
|
180
191
|
loadGlobalProcedures,
|
|
181
192
|
storeGlobalProcedure
|
|
182
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-GJ26DULE.js";
|
|
183
194
|
import {
|
|
184
195
|
PLATFORM_PROCEDURES
|
|
185
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-EQHQF5IM.js";
|
|
186
197
|
import {
|
|
187
198
|
clearCloudReuploadRequired,
|
|
188
199
|
cloudSync,
|
|
189
200
|
getCloudReuploadRequired,
|
|
190
201
|
markCloudReuploadRequired
|
|
191
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-CNVBKDEY.js";
|
|
192
203
|
import {
|
|
193
204
|
createARecord
|
|
194
205
|
} from "./chunk-X2Z5GT3V.js";
|
|
195
206
|
import {
|
|
196
207
|
findSimilarTrajectories,
|
|
197
208
|
hashSignature
|
|
198
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-QDGZJ653.js";
|
|
199
210
|
import {
|
|
200
211
|
GHOST_BEHAVIOR_SQL,
|
|
201
212
|
deactivateBehavior,
|
|
@@ -204,40 +215,40 @@ import {
|
|
|
204
215
|
reactivateBehavior,
|
|
205
216
|
storeBehavior,
|
|
206
217
|
storeReflexBehavior
|
|
207
|
-
} from "./chunk-
|
|
218
|
+
} from "./chunk-KW2SD2FL.js";
|
|
208
219
|
import {
|
|
209
220
|
countUnconsolidated,
|
|
210
221
|
groupMemories,
|
|
211
222
|
runConsolidation,
|
|
212
223
|
selectUnconsolidated
|
|
213
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-6CH3TPHR.js";
|
|
214
225
|
import {
|
|
215
226
|
entityId,
|
|
216
227
|
mergeEntities
|
|
217
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-A4DVMPYB.js";
|
|
218
229
|
import {
|
|
219
230
|
embed
|
|
220
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-XZXBB3TN.js";
|
|
221
232
|
import {
|
|
222
233
|
detectDcrIncompatibleConnectorsFromDisk,
|
|
223
234
|
detectExternalMcpFailures,
|
|
224
235
|
readMcpHttpEvents,
|
|
225
236
|
summarizeMcpTransport,
|
|
226
237
|
writeMcpTransportSummary
|
|
227
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-RAXVPNMR.js";
|
|
228
239
|
import {
|
|
229
240
|
updateTask
|
|
230
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-QYZJHTNE.js";
|
|
231
242
|
import {
|
|
232
243
|
fastDbInit
|
|
233
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-PWUFMX75.js";
|
|
234
245
|
import {
|
|
235
246
|
MAX_CONCURRENT_WORKERS
|
|
236
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-VPZHJCKW.js";
|
|
237
248
|
import {
|
|
238
249
|
hybridSearch,
|
|
239
250
|
recentRecords
|
|
240
|
-
} from "./chunk-
|
|
251
|
+
} from "./chunk-N7QJKQMX.js";
|
|
241
252
|
import {
|
|
242
253
|
buildFtsMatch,
|
|
243
254
|
tokenizeForFts
|
|
@@ -247,16 +258,21 @@ import {
|
|
|
247
258
|
flushBatch,
|
|
248
259
|
initStore,
|
|
249
260
|
writeMemory
|
|
250
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-VSRPS3J7.js";
|
|
251
262
|
import {
|
|
252
263
|
getActiveAgent
|
|
253
|
-
} from "./chunk-
|
|
264
|
+
} from "./chunk-5ERDIOV3.js";
|
|
254
265
|
import {
|
|
255
266
|
UPSTREAM_ATTACHMENT_MAX_CHARS,
|
|
256
267
|
isTelemetryRedactionEnabled,
|
|
268
|
+
redactSecrets,
|
|
269
|
+
redactedToolResult,
|
|
270
|
+
sanitizeProductFilter,
|
|
271
|
+
sanitizeUpstreamId,
|
|
257
272
|
sanitizeUpstreamPayload,
|
|
273
|
+
sanitizeVersionField,
|
|
258
274
|
sanitizedUpstreamBody
|
|
259
|
-
} from "./chunk-
|
|
275
|
+
} from "./chunk-4QCFFW2H.js";
|
|
260
276
|
import {
|
|
261
277
|
getMySession,
|
|
262
278
|
resolveExeSession,
|
|
@@ -265,13 +281,13 @@ import {
|
|
|
265
281
|
sessionScopeFilter,
|
|
266
282
|
updateTaskStatus,
|
|
267
283
|
writeCheckpoint
|
|
268
|
-
} from "./chunk-
|
|
284
|
+
} from "./chunk-UP75Z5X7.js";
|
|
269
285
|
import {
|
|
270
286
|
listSessions
|
|
271
|
-
} from "./chunk-
|
|
287
|
+
} from "./chunk-KGWRTRKC.js";
|
|
272
288
|
import {
|
|
273
289
|
recordOrchestrationEventBestEffort
|
|
274
|
-
} from "./chunk-
|
|
290
|
+
} from "./chunk-2WAVZ5UJ.js";
|
|
275
291
|
import {
|
|
276
292
|
DEFAULT_MODELS,
|
|
277
293
|
KNOWN_RUNTIMES,
|
|
@@ -279,35 +295,33 @@ import {
|
|
|
279
295
|
getAgentRuntime,
|
|
280
296
|
loadAgentConfig,
|
|
281
297
|
setAgentRuntime
|
|
282
|
-
} from "./chunk-
|
|
283
|
-
import {
|
|
284
|
-
DEFAULT_RUNTIME
|
|
285
|
-
} from "./chunk-NGP6LSV2.js";
|
|
298
|
+
} from "./chunk-HA5R6USD.js";
|
|
286
299
|
import {
|
|
287
300
|
PlanLimitError,
|
|
288
301
|
assertEmployeeLimit,
|
|
289
302
|
assertFeature,
|
|
290
303
|
assertMemoryLimit
|
|
291
|
-
} from "./chunk-
|
|
304
|
+
} from "./chunk-JGIPOUIK.js";
|
|
292
305
|
import {
|
|
293
306
|
getProjectName
|
|
294
307
|
} from "./chunk-OPU3NYOO.js";
|
|
295
308
|
import {
|
|
296
309
|
readDaemonToken
|
|
297
|
-
} from "./chunk-
|
|
310
|
+
} from "./chunk-X2Q5NLUL.js";
|
|
298
311
|
import {
|
|
299
312
|
getAgentContext
|
|
300
313
|
} from "./chunk-GJV3WDWM.js";
|
|
301
314
|
import {
|
|
315
|
+
_resetCache,
|
|
302
316
|
getAccountByName,
|
|
303
317
|
getDefaultAccount
|
|
304
|
-
} from "./chunk-
|
|
318
|
+
} from "./chunk-GL57PO3K.js";
|
|
305
319
|
import {
|
|
306
320
|
createNewTrigger,
|
|
307
321
|
isScheduledTrigger,
|
|
308
322
|
loadTriggers,
|
|
309
323
|
sanitizeParam
|
|
310
|
-
} from "./chunk-
|
|
324
|
+
} from "./chunk-KP3U5QGJ.js";
|
|
311
325
|
import {
|
|
312
326
|
pushConversationToCRM
|
|
313
327
|
} from "./chunk-ML4S5SHZ.js";
|
|
@@ -325,10 +339,11 @@ import {
|
|
|
325
339
|
isInitialized,
|
|
326
340
|
listIdentities,
|
|
327
341
|
loadEmployees,
|
|
342
|
+
loadEmployeesState,
|
|
328
343
|
loadEmployeesSync,
|
|
329
344
|
saveEmployees,
|
|
330
345
|
updateIdentity
|
|
331
|
-
} from "./chunk-
|
|
346
|
+
} from "./chunk-AOHXREB7.js";
|
|
332
347
|
import {
|
|
333
348
|
getEventLoopLagMs,
|
|
334
349
|
isDaemonAlive,
|
|
@@ -336,10 +351,13 @@ import {
|
|
|
336
351
|
} from "./chunk-7HLWBYH7.js";
|
|
337
352
|
import {
|
|
338
353
|
getMasterKey
|
|
339
|
-
} from "./chunk-
|
|
354
|
+
} from "./chunk-QWVXN224.js";
|
|
355
|
+
import {
|
|
356
|
+
DEFAULT_RUNTIME
|
|
357
|
+
} from "./chunk-NGP6LSV2.js";
|
|
340
358
|
import {
|
|
341
359
|
checkForUpdate
|
|
342
|
-
} from "./chunk-
|
|
360
|
+
} from "./chunk-F55P3H4S.js";
|
|
343
361
|
import {
|
|
344
362
|
PLAN_LIMITS,
|
|
345
363
|
checkLicense,
|
|
@@ -350,16 +368,16 @@ import {
|
|
|
350
368
|
refreshLicense,
|
|
351
369
|
saveLicense,
|
|
352
370
|
validateLicense
|
|
353
|
-
} from "./chunk-
|
|
371
|
+
} from "./chunk-PQIDGXSG.js";
|
|
354
372
|
import {
|
|
355
373
|
EXE_AI_DIR,
|
|
356
374
|
loadConfig
|
|
357
|
-
} from "./chunk-
|
|
375
|
+
} from "./chunk-WZHZCDDO.js";
|
|
358
376
|
|
|
359
377
|
// src/mcp/register-tools.ts
|
|
360
378
|
import { readFileSync as readFileSync7 } from "fs";
|
|
361
379
|
import { join as join4 } from "path";
|
|
362
|
-
import { homedir as
|
|
380
|
+
import { homedir as homedir5 } from "os";
|
|
363
381
|
|
|
364
382
|
// src/mcp/tools/memory.ts
|
|
365
383
|
import { z as z12 } from "zod";
|
|
@@ -534,7 +552,7 @@ function registerRecallMyMemory(server) {
|
|
|
534
552
|
}) => {
|
|
535
553
|
try {
|
|
536
554
|
if (!isInitialized()) {
|
|
537
|
-
const { fastDbInit: fastDbInit2 } = await import("./fast-db-init-
|
|
555
|
+
const { fastDbInit: fastDbInit2 } = await import("./fast-db-init-4CWHSOOR.js");
|
|
538
556
|
await fastDbInit2();
|
|
539
557
|
}
|
|
540
558
|
if (!recent && !query) {
|
|
@@ -581,7 +599,7 @@ function registerRecallMyMemory(server) {
|
|
|
581
599
|
let federatedCount = 0;
|
|
582
600
|
if (!recent && query && results.length < FEDERATION_THRESHOLD) {
|
|
583
601
|
try {
|
|
584
|
-
const { searchCodeContextSemantic: searchCodeContextSemantic2 } = await import("./code-context-index-
|
|
602
|
+
const { searchCodeContextSemantic: searchCodeContextSemantic2 } = await import("./code-context-index-WSOJQ72R.js");
|
|
585
603
|
const codeResults = await Promise.race([
|
|
586
604
|
searchCodeContextSemantic2(query, { limit: 5 }),
|
|
587
605
|
new Promise((_, rej) => setTimeout(() => rej(new Error("timeout")), 2e3))
|
|
@@ -819,7 +837,7 @@ function registerStoreMemory(server) {
|
|
|
819
837
|
}
|
|
820
838
|
const { agentId, agentRole } = getActiveAgent();
|
|
821
839
|
if (kind === "prospective") {
|
|
822
|
-
const { createProspectiveMemory } = await import("./prospective-memory-
|
|
840
|
+
const { createProspectiveMemory } = await import("./prospective-memory-6D2ASWM3.js");
|
|
823
841
|
let sessionScope = null;
|
|
824
842
|
try {
|
|
825
843
|
const { resolveExeSession: resolveExeSession2 } = await import("./lib/tmux-routing.js");
|
|
@@ -919,7 +937,7 @@ function registerCommitMemory(server) {
|
|
|
919
937
|
project: z4.string().optional().describe("Project name (auto-detected if omitted)"),
|
|
920
938
|
key_decisions: z4.array(z4.string()).optional().describe("List of key decisions made in this session"),
|
|
921
939
|
metadata_tags: z4.array(z4.string()).optional().describe("Tags for categorization (e.g., 'architecture', 'bugfix', 'design')"),
|
|
922
|
-
topic: z4.string().optional().describe("Topic heading, e.g. '
|
|
940
|
+
topic: z4.string().optional().describe("Topic heading, e.g. 'Acme Phase 2 architecture decisions'"),
|
|
923
941
|
current_state: z4.string().optional().describe("What is true NOW \u2014 snapshot of current system state"),
|
|
924
942
|
historical_context: z4.string().optional().describe("What led here \u2014 decisions, trade-offs, prior approaches"),
|
|
925
943
|
importance: z4.number().min(1).max(10).optional().describe("Override importance (default 9)"),
|
|
@@ -1085,7 +1103,7 @@ async function searchConversations(query, limit) {
|
|
|
1085
1103
|
}
|
|
1086
1104
|
async function searchWiki(query, limit) {
|
|
1087
1105
|
try {
|
|
1088
|
-
const { createWikiClient, chatInWorkspace, listWorkspaces } = await import("./wiki-client-
|
|
1106
|
+
const { createWikiClient, chatInWorkspace, listWorkspaces } = await import("./wiki-client-EAN7F5LV.js");
|
|
1089
1107
|
const client = await createWikiClient();
|
|
1090
1108
|
if (!client) return [];
|
|
1091
1109
|
const workspaces = await listWorkspaces(client);
|
|
@@ -1481,7 +1499,7 @@ function registerGetMemoryCardinality(server) {
|
|
|
1481
1499
|
title: "Get Memory Cardinality",
|
|
1482
1500
|
description: "Get memory counts: total active memories and per-project breakdown. Optionally filter by agent.",
|
|
1483
1501
|
inputSchema: {
|
|
1484
|
-
agent_id: z9.string().optional().describe("Filter to a specific agent (e.g. '
|
|
1502
|
+
agent_id: z9.string().optional().describe("Filter to a specific agent (e.g. 'engineer', 'coordinator')")
|
|
1485
1503
|
}
|
|
1486
1504
|
},
|
|
1487
1505
|
async ({ agent_id }) => {
|
|
@@ -1805,7 +1823,7 @@ async function handleSupersede(input) {
|
|
|
1805
1823
|
}
|
|
1806
1824
|
try {
|
|
1807
1825
|
const { getClient: getClient2 } = await import("./lib/database.js");
|
|
1808
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
1826
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
1809
1827
|
const { writeMemory: writeMemory2, flushBatch: flushBatch2 } = await import("./lib/store.js");
|
|
1810
1828
|
const { randomUUID: randomUUID2 } = await import("crypto");
|
|
1811
1829
|
const client = getClient2();
|
|
@@ -1858,7 +1876,7 @@ New memory id: ${newId}`
|
|
|
1858
1876
|
}
|
|
1859
1877
|
async function handleResonanceQuery(input) {
|
|
1860
1878
|
try {
|
|
1861
|
-
const { getHotPairs, getCoActivationNeighbors } = await import("./co-activation-
|
|
1879
|
+
const { getHotPairs, getCoActivationNeighbors } = await import("./co-activation-ZCHPLLP6.js");
|
|
1862
1880
|
const subAction = input.resonance_action ?? "hot_pairs";
|
|
1863
1881
|
const limit = input.limit ?? 20;
|
|
1864
1882
|
if (subAction === "hot_pairs") {
|
|
@@ -1886,7 +1904,7 @@ function registerMemory(server) {
|
|
|
1886
1904
|
title: "Memory",
|
|
1887
1905
|
description: "Consolidated memory domain tool. Actions: recall, ask_team, store, commit, search, session_context, get_by_id, consolidate, cardinality, supersede, decision_store, decision_get, resonance_query. Legacy memory tools remain available during migration.",
|
|
1888
1906
|
inputSchema: {
|
|
1889
|
-
action: z12.enum(["recall", "ask_team", "store", "commit", "search", "session_context", "consolidate", "cardinality", "supersede", "core_get", "core_set", "core_delete", "update_working_memory", "get_working_memory", "decision_store", "decision_get", "resonance_query"]).describe("Memory operation to perform. core_get/core_set/core_delete manage always-in-context key facts. update_working_memory/get_working_memory manage the runtime scratchpad. decision_store/decision_get manage authoritative decisions. resonance_query queries co-activation network."),
|
|
1907
|
+
action: z12.enum(["recall", "ask_team", "store", "commit", "search", "session_context", "get_by_id", "consolidate", "cardinality", "supersede", "core_get", "core_set", "core_delete", "update_working_memory", "get_working_memory", "decision_store", "decision_get", "resonance_query"]).describe("Memory operation to perform. core_get/core_set/core_delete manage always-in-context key facts. update_working_memory/get_working_memory manage the runtime scratchpad. decision_store/decision_get manage authoritative decisions. resonance_query queries co-activation network."),
|
|
1890
1908
|
query: z12.string().optional().describe("Search query. Also accepted as store text alias."),
|
|
1891
1909
|
text: z12.string().optional().describe("Memory text for action=store"),
|
|
1892
1910
|
summary: z12.string().optional().describe("High-importance summary for action=commit"),
|
|
@@ -1917,6 +1935,9 @@ function registerMemory(server) {
|
|
|
1917
1935
|
session_id: z12.string().optional().describe("Session ID for action=session_context"),
|
|
1918
1936
|
target_timestamp: z12.string().optional().describe("Center timestamp for action=session_context"),
|
|
1919
1937
|
window_size: z12.number().optional().describe("Window size for action=session_context"),
|
|
1938
|
+
id: z12.string().optional().describe("Memory UUID for action=get_by_id."),
|
|
1939
|
+
max_chars: z12.coerce.number().int().min(100).max(5e4).optional().describe("Max characters per memory body for action=recall/session_context. Use higher values for long runbooks."),
|
|
1940
|
+
body_chars: z12.coerce.number().int().min(100).max(5e4).optional().describe("Alias for max_chars for action=recall/session_context."),
|
|
1920
1941
|
max_clusters: z12.coerce.number().optional().describe("Max clusters for action=consolidate"),
|
|
1921
1942
|
model: z12.string().optional().describe("Model for action=consolidate"),
|
|
1922
1943
|
agent_id: z12.string().optional().describe("Agent filter for action=cardinality"),
|
|
@@ -1953,9 +1974,9 @@ function registerMemory(server) {
|
|
|
1953
1974
|
return handleResonanceQuery(input);
|
|
1954
1975
|
}
|
|
1955
1976
|
if (action === "update_working_memory" || action === "get_working_memory") {
|
|
1956
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
1977
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
1957
1978
|
const { agentId } = getActiveAgent2();
|
|
1958
|
-
const { readWorkingMemoryWithMeta, writeWorkingMemory, WORKING_MEMORY_MAX_BYTES } = await import("./working-memory-
|
|
1979
|
+
const { readWorkingMemoryWithMeta, writeWorkingMemory, WORKING_MEMORY_MAX_BYTES } = await import("./working-memory-NUVB5SFV.js");
|
|
1959
1980
|
if (action === "get_working_memory") {
|
|
1960
1981
|
const wm = readWorkingMemoryWithMeta(agentId);
|
|
1961
1982
|
if (!wm) {
|
|
@@ -1979,9 +2000,9 @@ function registerMemory(server) {
|
|
|
1979
2000
|
}
|
|
1980
2001
|
}
|
|
1981
2002
|
if (action === "core_get" || action === "core_set" || action === "core_delete") {
|
|
1982
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
2003
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
1983
2004
|
const { agentId } = getActiveAgent2();
|
|
1984
|
-
const { getCoreMemory, setCoreMemory, deleteCoreMemory, formatCoreMemoryBlock } = await import("./core-memory-
|
|
2005
|
+
const { getCoreMemory, setCoreMemory, deleteCoreMemory, formatCoreMemoryBlock } = await import("./core-memory-GAC6EWOQ.js");
|
|
1985
2006
|
if (action === "core_get") {
|
|
1986
2007
|
const entries = await getCoreMemory(agentId);
|
|
1987
2008
|
const block = formatCoreMemoryBlock(entries);
|
|
@@ -2033,12 +2054,12 @@ function registerMemory(server) {
|
|
|
2033
2054
|
if (!storeTrigger || !storeTriggerAction) {
|
|
2034
2055
|
return errorResult('memory action "store" with kind="reflex" requires trigger and trigger_action fields');
|
|
2035
2056
|
}
|
|
2036
|
-
const { formatReflexContent, storeReflexBehavior: storeReflexBehavior2 } = await import("./behaviors-
|
|
2057
|
+
const { formatReflexContent, storeReflexBehavior: storeReflexBehavior2 } = await import("./behaviors-KYRB3NGJ.js");
|
|
2037
2058
|
const reflexText = formatReflexContent(storeTrigger, storeTriggerAction);
|
|
2038
2059
|
legacyArgs.text ??= reflexText;
|
|
2039
2060
|
legacyArgs.query ??= reflexText;
|
|
2040
2061
|
try {
|
|
2041
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
2062
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
2042
2063
|
const { getProjectName: getProjectName2 } = await import("./project-name-EWG5KAZP.js");
|
|
2043
2064
|
const agent = getActiveAgent2();
|
|
2044
2065
|
const behaviorId = await storeReflexBehavior2({
|
|
@@ -2379,6 +2400,82 @@ function registerGetTask(server) {
|
|
|
2379
2400
|
import { z as z15 } from "zod";
|
|
2380
2401
|
var CLOSE_TASK_ALLOWED_ROLES = /* @__PURE__ */ new Set(["CTO"]);
|
|
2381
2402
|
var CLOSEABLE_STATUSES = /* @__PURE__ */ new Set(["needs_review", "done"]);
|
|
2403
|
+
async function respawnAssigneeAfterClose(input) {
|
|
2404
|
+
const { resolveExeSession: resolveExeSession2, employeeSessionName, ensureEmployee } = await import("./lib/tmux-routing.js");
|
|
2405
|
+
const { shouldAutoInstance } = await import("./lib/employees.js");
|
|
2406
|
+
const exeSession = input.taskScope ?? resolveExeSession2();
|
|
2407
|
+
if (!exeSession) return { respawned: false, reason: "no coordinator session" };
|
|
2408
|
+
if (!input.projectName) {
|
|
2409
|
+
process.stderr.write(
|
|
2410
|
+
`[close-task] respawn SKIPPED for ${input.assignee}: task has no project_name to resolve \u2014 never respawning into process.cwd().
|
|
2411
|
+
`
|
|
2412
|
+
);
|
|
2413
|
+
return { respawned: false, reason: "task has no project_name" };
|
|
2414
|
+
}
|
|
2415
|
+
const { resolveProjectDir: resolveProjectDir2 } = await import("./mcp/tools/create-task.js");
|
|
2416
|
+
const projectDir = await resolveProjectDir2(input.projectName, exeSession);
|
|
2417
|
+
if (!projectDir) {
|
|
2418
|
+
process.stderr.write(
|
|
2419
|
+
`[close-task] respawn SKIPPED for ${input.assignee}: could not resolve project dir for "${input.projectName}" in scope ${exeSession} \u2014 never respawning into process.cwd(). Manual nudge can follow.
|
|
2420
|
+
`
|
|
2421
|
+
);
|
|
2422
|
+
return { respawned: false, reason: "project dir unresolved" };
|
|
2423
|
+
}
|
|
2424
|
+
const oldSession = employeeSessionName(input.assignee, exeSession);
|
|
2425
|
+
const { execSync } = await import("child_process");
|
|
2426
|
+
try {
|
|
2427
|
+
execSync(`tmux kill-session -t ${oldSession} 2>/dev/null`, { timeout: 3e3 });
|
|
2428
|
+
} catch {
|
|
2429
|
+
}
|
|
2430
|
+
try {
|
|
2431
|
+
const { cleanupAgentWorktree } = await import("./worktree-sweep-WTK3MTKH.js");
|
|
2432
|
+
const { getGitRoot } = await import("./worktree-LL62PLQB.js");
|
|
2433
|
+
const root = getGitRoot(projectDir);
|
|
2434
|
+
if (root) {
|
|
2435
|
+
const notes = await cleanupAgentWorktree(root, input.assignee);
|
|
2436
|
+
if (notes) process.stderr.write(`[close-task] Deferred worktree cleanup: ${notes.replace(/\n/g, "; ")}
|
|
2437
|
+
`);
|
|
2438
|
+
}
|
|
2439
|
+
} catch {
|
|
2440
|
+
}
|
|
2441
|
+
if (!input.topTaskId) {
|
|
2442
|
+
process.stderr.write(
|
|
2443
|
+
`[close-task] Deferred respawn SKIPPED for ${input.assignee} \u2014 no open task id to gate the claim on; auto-wake will cover any orphan
|
|
2444
|
+
`
|
|
2445
|
+
);
|
|
2446
|
+
return { respawned: false, reason: "no open task id to gate the claim on" };
|
|
2447
|
+
}
|
|
2448
|
+
const { tryAcquireDispatchClaim, releaseDispatchClaim } = await import("./dispatch-ack-VYH3ONSS.js");
|
|
2449
|
+
if (!tryAcquireDispatchClaim(input.topTaskId, input.assignee, exeSession)) {
|
|
2450
|
+
process.stderr.write(
|
|
2451
|
+
`[close-task] Deferred respawn DEDUPED for ${input.assignee} task ${input.topTaskId} \u2014 another dispatch is already in flight
|
|
2452
|
+
`
|
|
2453
|
+
);
|
|
2454
|
+
return { respawned: false, reason: "another dispatch holds the claim" };
|
|
2455
|
+
}
|
|
2456
|
+
let result3;
|
|
2457
|
+
try {
|
|
2458
|
+
result3 = ensureEmployee(input.assignee, exeSession, projectDir, shouldAutoInstance(input.assignee));
|
|
2459
|
+
} catch (spawnErr) {
|
|
2460
|
+
try {
|
|
2461
|
+
releaseDispatchClaim(input.topTaskId, input.assignee, "respawn threw");
|
|
2462
|
+
} catch {
|
|
2463
|
+
}
|
|
2464
|
+
throw spawnErr;
|
|
2465
|
+
}
|
|
2466
|
+
if (result3.status === "failed") {
|
|
2467
|
+
try {
|
|
2468
|
+
releaseDispatchClaim(input.topTaskId, input.assignee, result3.error ?? "respawn failed");
|
|
2469
|
+
} catch {
|
|
2470
|
+
}
|
|
2471
|
+
return { respawned: false, reason: result3.error ?? "respawn failed", projectDir };
|
|
2472
|
+
}
|
|
2473
|
+
process.stderr.write(
|
|
2474
|
+
`[close-task] Deferred respawn complete: ${result3.sessionName ?? "fresh instance"} in ${projectDir}
|
|
2475
|
+
`
|
|
2476
|
+
);
|
|
2477
|
+
return { respawned: true, projectDir };
|
|
2478
|
+
}
|
|
2382
2479
|
function registerCloseTask(server) {
|
|
2383
2480
|
server.registerTool(
|
|
2384
2481
|
"close_task",
|
|
@@ -2394,7 +2491,7 @@ function registerCloseTask(server) {
|
|
|
2394
2491
|
async ({ task_id, result: result3, status: status2 }) => {
|
|
2395
2492
|
const agent = getActiveAgent();
|
|
2396
2493
|
try {
|
|
2397
|
-
const { StewardGate: StewardGate2 } = await import("./steward-gate-
|
|
2494
|
+
const { StewardGate: StewardGate2 } = await import("./steward-gate-3GQ5XKMJ.js");
|
|
2398
2495
|
const steward = new StewardGate2();
|
|
2399
2496
|
const gateDecision = await steward.checkAuthority(agent.agentId || "unknown", "close_task", task_id);
|
|
2400
2497
|
if (!gateDecision.allowed) {
|
|
@@ -2575,8 +2672,8 @@ ${preflightWarnings.join("\n")}`;
|
|
|
2575
2672
|
if (mergeNote) text5 += mergeNote;
|
|
2576
2673
|
if (status2 === "closed" && assignee) {
|
|
2577
2674
|
try {
|
|
2578
|
-
const { cleanupAgentWorktree } = await import("./worktree-sweep-
|
|
2579
|
-
const { getGitRoot } = await import("./worktree-
|
|
2675
|
+
const { cleanupAgentWorktree } = await import("./worktree-sweep-WTK3MTKH.js");
|
|
2676
|
+
const { getGitRoot } = await import("./worktree-LL62PLQB.js");
|
|
2580
2677
|
const repoRoot = getGitRoot(baseDir);
|
|
2581
2678
|
if (repoRoot) {
|
|
2582
2679
|
const cleanupNotes = await cleanupAgentWorktree(repoRoot, assignee);
|
|
@@ -2604,6 +2701,16 @@ ${preflightWarnings.join("\n")}`;
|
|
|
2604
2701
|
});
|
|
2605
2702
|
const count = Number(remaining.rows[0]?.cnt ?? 0);
|
|
2606
2703
|
if (count > 0) {
|
|
2704
|
+
let topOpenTaskId;
|
|
2705
|
+
try {
|
|
2706
|
+
const topRes = await client.execute({
|
|
2707
|
+
sql: `SELECT id FROM tasks WHERE assigned_to = ? AND status = 'open' ${respawnScope.sql}
|
|
2708
|
+
ORDER BY CASE priority WHEN 'p0' THEN 0 WHEN 'p1' THEN 1 WHEN 'p2' THEN 2 ELSE 3 END, created_at ASC LIMIT 1`,
|
|
2709
|
+
args: [closedAssignee, ...respawnScope.args]
|
|
2710
|
+
});
|
|
2711
|
+
topOpenTaskId = topRes.rows[0]?.id != null ? String(topRes.rows[0].id) : void 0;
|
|
2712
|
+
} catch {
|
|
2713
|
+
}
|
|
2607
2714
|
try {
|
|
2608
2715
|
const { isMultiInstance } = await import("./lib/employees.js");
|
|
2609
2716
|
if (isMultiInstance(closedAssignee)) {
|
|
@@ -2611,37 +2718,14 @@ ${preflightWarnings.join("\n")}`;
|
|
|
2611
2718
|
|
|
2612
2719
|
\u{1F504} Auto-respawn: ${closedAssignee} has ${count} more task(s). Respawn scheduled (deferred to avoid MCP disruption).`;
|
|
2613
2720
|
const _assignee = closedAssignee;
|
|
2614
|
-
const
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
const { execSync } = await import("child_process");
|
|
2623
|
-
try {
|
|
2624
|
-
execSync(`tmux kill-session -t ${oldSession} 2>/dev/null`, { timeout: 3e3 });
|
|
2625
|
-
} catch {
|
|
2626
|
-
}
|
|
2627
|
-
try {
|
|
2628
|
-
const { cleanupAgentWorktree } = await import("./worktree-sweep-5WKBU7E6.js");
|
|
2629
|
-
const { getGitRoot } = await import("./worktree-YXBDRYOC.js");
|
|
2630
|
-
const root = getGitRoot(_baseDir);
|
|
2631
|
-
if (root) {
|
|
2632
|
-
const notes = await cleanupAgentWorktree(root, _assignee);
|
|
2633
|
-
if (notes) process.stderr.write(`[close-task] Deferred worktree cleanup: ${notes.replace(/\n/g, "; ")}
|
|
2634
|
-
`);
|
|
2635
|
-
}
|
|
2636
|
-
} catch {
|
|
2637
|
-
}
|
|
2638
|
-
const result4 = ensureEmployee(_assignee, exeSession, _baseDir, shouldAutoInstance(_assignee));
|
|
2639
|
-
process.stderr.write(`[close-task] Deferred respawn complete: ${result4.sessionName ?? "fresh instance"}
|
|
2640
|
-
`);
|
|
2641
|
-
} catch (e) {
|
|
2642
|
-
process.stderr.write(`[close-task] Deferred respawn failed: ${e instanceof Error ? e.message : String(e)}
|
|
2643
|
-
`);
|
|
2644
|
-
}
|
|
2721
|
+
const _topTaskId = topOpenTaskId ?? null;
|
|
2722
|
+
const _projectName = row.project_name != null ? String(row.project_name) : null;
|
|
2723
|
+
const _taskScope = sanitizeSessionScope(row.session_scope == null ? null : String(row.session_scope));
|
|
2724
|
+
setTimeout(() => {
|
|
2725
|
+
respawnAssigneeAfterClose({ assignee: _assignee, projectName: _projectName, taskScope: _taskScope, topTaskId: _topTaskId }).catch((e) => process.stderr.write(
|
|
2726
|
+
`[close-task] Deferred respawn failed: ${e instanceof Error ? e.message : String(e)}
|
|
2727
|
+
`
|
|
2728
|
+
));
|
|
2645
2729
|
}, 500);
|
|
2646
2730
|
}
|
|
2647
2731
|
} catch {
|
|
@@ -2715,6 +2799,7 @@ function registerCheckpointTask(server) {
|
|
|
2715
2799
|
|
|
2716
2800
|
// src/mcp/tools/resume-employee.ts
|
|
2717
2801
|
import { z as z17 } from "zod";
|
|
2802
|
+
import { homedir } from "os";
|
|
2718
2803
|
var RESUME_CONTEXT_TASK_LIMIT = 10;
|
|
2719
2804
|
function registerResumeEmployee(server) {
|
|
2720
2805
|
server.registerTool(
|
|
@@ -2729,7 +2814,7 @@ function registerResumeEmployee(server) {
|
|
|
2729
2814
|
},
|
|
2730
2815
|
async ({ agent_id, project_name }) => {
|
|
2731
2816
|
if (!isInitialized()) {
|
|
2732
|
-
const { fastDbInit: fastDbInit2 } = await import("./fast-db-init-
|
|
2817
|
+
const { fastDbInit: fastDbInit2 } = await import("./fast-db-init-4CWHSOOR.js");
|
|
2733
2818
|
await fastDbInit2();
|
|
2734
2819
|
}
|
|
2735
2820
|
const client = getClient();
|
|
@@ -2755,7 +2840,7 @@ function registerResumeEmployee(server) {
|
|
|
2755
2840
|
};
|
|
2756
2841
|
}
|
|
2757
2842
|
try {
|
|
2758
|
-
const { isTmuxSessionAlive } = await import("./tasks-crud-
|
|
2843
|
+
const { isTmuxSessionAlive } = await import("./tasks-crud-HBDKE6C5.js");
|
|
2759
2844
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
2760
2845
|
for (const row of openTasks.rows) {
|
|
2761
2846
|
const status2 = String(row.status);
|
|
@@ -2783,7 +2868,7 @@ function registerResumeEmployee(server) {
|
|
|
2783
2868
|
}
|
|
2784
2869
|
let checkpointInfo = "";
|
|
2785
2870
|
try {
|
|
2786
|
-
const { readLatestCheckpoint } = await import("./tasks-crud-
|
|
2871
|
+
const { readLatestCheckpoint } = await import("./tasks-crud-HBDKE6C5.js");
|
|
2787
2872
|
const checkpoint = await readLatestCheckpoint(agent_id);
|
|
2788
2873
|
if (checkpoint) {
|
|
2789
2874
|
const filesTouched = checkpoint.files_touched?.length > 0 ? checkpoint.files_touched.join(", ") : "none";
|
|
@@ -2800,9 +2885,18 @@ function registerResumeEmployee(server) {
|
|
|
2800
2885
|
}
|
|
2801
2886
|
} catch {
|
|
2802
2887
|
}
|
|
2888
|
+
let callerScope;
|
|
2889
|
+
try {
|
|
2890
|
+
const { getAgentContext: getAgentContext2 } = await import("./agent-context-AZTTMUHP.js");
|
|
2891
|
+
const hint = getAgentContext2()?.sessionHint;
|
|
2892
|
+
if (hint) callerScope = hint;
|
|
2893
|
+
} catch {
|
|
2894
|
+
}
|
|
2895
|
+
if (!callerScope) callerScope = process.env.EXE_SESSION_NAME || process.env.EXE_SESSION || void 0;
|
|
2896
|
+
const resumeProjectDir = await resolveProjectDir(project_name, callerScope);
|
|
2803
2897
|
const { created, taskId } = await createOrRefreshResumeTask(
|
|
2804
2898
|
agent_id,
|
|
2805
|
-
|
|
2899
|
+
resumeProjectDir ?? homedir(),
|
|
2806
2900
|
openTasks.rows
|
|
2807
2901
|
);
|
|
2808
2902
|
if (checkpointInfo && taskId) {
|
|
@@ -2824,7 +2918,7 @@ function registerResumeEmployee(server) {
|
|
|
2824
2918
|
}
|
|
2825
2919
|
let dispatchStatus = "";
|
|
2826
2920
|
try {
|
|
2827
|
-
const {
|
|
2921
|
+
const { ensureEmployeeAsync, resolveExeSession: resolveExeSession2 } = await import("./lib/tmux-routing.js");
|
|
2828
2922
|
let taskScope = null;
|
|
2829
2923
|
if (taskId) {
|
|
2830
2924
|
try {
|
|
@@ -2840,17 +2934,60 @@ function registerResumeEmployee(server) {
|
|
|
2840
2934
|
}
|
|
2841
2935
|
const exeSession = taskScope ?? resolveExeSession2();
|
|
2842
2936
|
if (!exeSession) throw new Error("No coordinator session found");
|
|
2937
|
+
if (!resumeProjectDir) {
|
|
2938
|
+
throw new Error(
|
|
2939
|
+
`could not resolve project dir for "${project_name}" within scope \u2014 RESUME task left for manual dispatch`
|
|
2940
|
+
);
|
|
2941
|
+
}
|
|
2843
2942
|
process.stderr.write(
|
|
2844
2943
|
`[resume_employee] dispatch lane=${exeSession} source=${taskScope ? "task.session_scope" : "caller.resolveExeSession (task has no scope)"} task=${taskId} agent=${agent_id}
|
|
2845
2944
|
`
|
|
2846
2945
|
);
|
|
2847
2946
|
const { shouldAutoInstance } = await import("./lib/employees.js");
|
|
2848
|
-
const
|
|
2947
|
+
const { tryAcquireDispatchClaim, releaseDispatchClaim } = await import("./dispatch-ack-VYH3ONSS.js");
|
|
2948
|
+
let claimedResume = false;
|
|
2949
|
+
if (taskId) {
|
|
2950
|
+
claimedResume = tryAcquireDispatchClaim(taskId, agent_id, exeSession);
|
|
2951
|
+
if (!claimedResume) {
|
|
2952
|
+
dispatchStatus = `
|
|
2953
|
+
Dispatched: deduped \u2014 another dispatch for task ${taskId} is already in flight`;
|
|
2954
|
+
process.stderr.write(`[resume_employee] DEDUPED spawn for ${agent_id} task ${taskId} \u2014 a fresh dispatch is already in flight
|
|
2955
|
+
`);
|
|
2956
|
+
throw new Error("dispatch deduped");
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
let result3;
|
|
2960
|
+
try {
|
|
2961
|
+
result3 = await ensureEmployeeAsync(
|
|
2962
|
+
agent_id,
|
|
2963
|
+
exeSession,
|
|
2964
|
+
resumeProjectDir,
|
|
2965
|
+
shouldAutoInstance(agent_id)
|
|
2966
|
+
);
|
|
2967
|
+
} catch (spawnErr) {
|
|
2968
|
+
if (taskId && claimedResume) {
|
|
2969
|
+
try {
|
|
2970
|
+
releaseDispatchClaim(taskId, agent_id, "resume spawn threw");
|
|
2971
|
+
} catch {
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
throw spawnErr;
|
|
2975
|
+
}
|
|
2976
|
+
if (result3.status === "failed" && taskId && claimedResume) {
|
|
2977
|
+
try {
|
|
2978
|
+
releaseDispatchClaim(taskId, agent_id, result3.error ?? "resume spawn failed");
|
|
2979
|
+
} catch {
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2849
2982
|
switch (result3.status) {
|
|
2850
2983
|
case "intercom_sent":
|
|
2851
2984
|
dispatchStatus = `
|
|
2852
2985
|
Dispatched: intercom sent to ${result3.sessionName}`;
|
|
2853
2986
|
break;
|
|
2987
|
+
case "intercom_unprocessed":
|
|
2988
|
+
dispatchStatus = `
|
|
2989
|
+
Dispatched: intercom delivered to ${result3.sessionName}`;
|
|
2990
|
+
break;
|
|
2854
2991
|
case "spawned":
|
|
2855
2992
|
dispatchStatus = `
|
|
2856
2993
|
Dispatched: spawned ${result3.sessionName}`;
|
|
@@ -3134,6 +3271,8 @@ function registerTask(server) {
|
|
|
3134
3271
|
budget_fallback_model: z19.string().optional().describe("Fallback model for action=create"),
|
|
3135
3272
|
spawn_runtime: z19.string().optional().describe("Override runtime for spawned session (e.g., 'claude', 'codex', 'opencode') for action=create"),
|
|
3136
3273
|
spawn_model: z19.string().optional().describe("Override model for spawned session (e.g., 'claude-sonnet-4.6') for action=create"),
|
|
3274
|
+
idempotency_key: z19.string().optional().describe("Idempotency key for action=create (bug c06a8803): retrying with the SAME key returns the ORIGINAL task instead of creating a duplicate + duplicate spawn. Must be stable across the original call and its retry \u2014 no timestamp. Optional; omitted = no dedup."),
|
|
3275
|
+
idempotency_window: z19.string().optional().describe("Optional nonce to DERIVE an idempotency key for action=create when idempotency_key is not given. Reuse the same window on a retry to dedup."),
|
|
3137
3276
|
status: z19.enum(["open", "in_progress", "done", "needs_review", "blocked", "cancelled", "closed"]).optional().describe("Status for action=update/list/close"),
|
|
3138
3277
|
result: z19.string().optional().describe("Result summary for action=update or action=close"),
|
|
3139
3278
|
step: z19.string().optional().describe("Checkpoint step for action=checkpoint"),
|
|
@@ -3148,6 +3287,7 @@ function registerTask(server) {
|
|
|
3148
3287
|
// Reminder params (absorbed from standalone reminder tool)
|
|
3149
3288
|
text: z19.string().optional().describe("Reminder text for action=reminder_create"),
|
|
3150
3289
|
due_date: z19.string().optional().describe("Optional due date \u2014 ISO date (2026-04-01) or null for persistent (reminder_create)"),
|
|
3290
|
+
daily_push: z19.string().optional().describe('Optional daily push schedule for action=reminder_create \u2014 JSON {"hours":[9,18]} (0\u201323, founder timezone). A gateway channel pushes this reminder at those hours. Omit for a normal boot-brief-only reminder.'),
|
|
3151
3291
|
reminder_id: z19.string().optional().describe("Reminder UUID or text substring to match (reminder_complete)"),
|
|
3152
3292
|
include_completed: z19.boolean().optional().describe("Include completed reminders (reminder_list). Default: false.")
|
|
3153
3293
|
}
|
|
@@ -3158,9 +3298,15 @@ function registerTask(server) {
|
|
|
3158
3298
|
const args = input;
|
|
3159
3299
|
const reminderText = args.text;
|
|
3160
3300
|
if (!reminderText) return errorResult2('task action "reminder_create" requires text');
|
|
3161
|
-
|
|
3301
|
+
let reminder;
|
|
3302
|
+
try {
|
|
3303
|
+
reminder = await createReminder(reminderText, args.due_date, args.daily_push);
|
|
3304
|
+
} catch (err) {
|
|
3305
|
+
return errorResult2(err instanceof Error ? err.message : String(err));
|
|
3306
|
+
}
|
|
3162
3307
|
const dueStr = reminder.dueDate ? ` (due: ${reminder.dueDate})` : "";
|
|
3163
|
-
|
|
3308
|
+
const pushStr = reminder.dailyPush ? ` (daily push: ${reminder.dailyPush})` : "";
|
|
3309
|
+
return { content: [{ type: "text", text: `Reminder set: "${reminder.text}"${dueStr}${pushStr}` }] };
|
|
3164
3310
|
}
|
|
3165
3311
|
if (action === "reminder_list") {
|
|
3166
3312
|
const args = input;
|
|
@@ -3168,8 +3314,9 @@ function registerTask(server) {
|
|
|
3168
3314
|
if (reminders.length === 0) return { content: [{ type: "text", text: "No active reminders." }] };
|
|
3169
3315
|
const lines = reminders.map((r) => {
|
|
3170
3316
|
const due = r.dueDate ? ` (due: ${r.dueDate})` : "";
|
|
3317
|
+
const push = r.dailyPush ? ` (daily push: ${r.dailyPush})` : "";
|
|
3171
3318
|
const done = r.completedAt ? " [DONE]" : "";
|
|
3172
|
-
return `\u2022 ${r.text}${due}${done} [id: ${r.id.slice(0, 8)}]`;
|
|
3319
|
+
return `\u2022 ${r.text}${due}${push}${done} [id: ${r.id.slice(0, 8)}]`;
|
|
3173
3320
|
});
|
|
3174
3321
|
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
3175
3322
|
}
|
|
@@ -3185,7 +3332,7 @@ function registerTask(server) {
|
|
|
3185
3332
|
const taskId = input.task_id;
|
|
3186
3333
|
if (!taskId) return errorResult2("verify_dispatch requires task_id");
|
|
3187
3334
|
try {
|
|
3188
|
-
const { checkDispatchStatus } = await import("./dispatch-ack-
|
|
3335
|
+
const { checkDispatchStatus } = await import("./dispatch-ack-VYH3ONSS.js");
|
|
3189
3336
|
const result4 = checkDispatchStatus(taskId);
|
|
3190
3337
|
return {
|
|
3191
3338
|
content: [{ type: "text", text: JSON.stringify(result4, null, 2) }]
|
|
@@ -3199,7 +3346,7 @@ function registerTask(server) {
|
|
|
3199
3346
|
const missing2 = missingRequiredFields2(args, REQUIRED_FIELDS2.create_group);
|
|
3200
3347
|
if (missing2.length > 0) return errorResult2(`task action "create_group" missing required field(s): ${missing2.join(", ")}`);
|
|
3201
3348
|
try {
|
|
3202
|
-
const { createTaskGroup } = await import("./tasks-crud-
|
|
3349
|
+
const { createTaskGroup } = await import("./tasks-crud-HBDKE6C5.js");
|
|
3203
3350
|
const group = await createTaskGroup({
|
|
3204
3351
|
title: args.title,
|
|
3205
3352
|
coordinator: args.coordinator,
|
|
@@ -3218,7 +3365,7 @@ function registerTask(server) {
|
|
|
3218
3365
|
const missing2 = missingRequiredFields2(args, REQUIRED_FIELDS2.group_status);
|
|
3219
3366
|
if (missing2.length > 0) return errorResult2(`task action "group_status" missing required field(s): ${missing2.join(", ")}`);
|
|
3220
3367
|
try {
|
|
3221
|
-
const { getGroupStatus } = await import("./tasks-crud-
|
|
3368
|
+
const { getGroupStatus } = await import("./tasks-crud-HBDKE6C5.js");
|
|
3222
3369
|
const status2 = await getGroupStatus(args.group_id);
|
|
3223
3370
|
return { content: [{ type: "text", text: JSON.stringify(status2, null, 2) }] };
|
|
3224
3371
|
} catch (err) {
|
|
@@ -3230,7 +3377,7 @@ function registerTask(server) {
|
|
|
3230
3377
|
const missing2 = missingRequiredFields2(args, REQUIRED_FIELDS2.group_results);
|
|
3231
3378
|
if (missing2.length > 0) return errorResult2(`task action "group_results" missing required field(s): ${missing2.join(", ")}`);
|
|
3232
3379
|
try {
|
|
3233
|
-
const { getGroupResults } = await import("./tasks-crud-
|
|
3380
|
+
const { getGroupResults } = await import("./tasks-crud-HBDKE6C5.js");
|
|
3234
3381
|
const results = await getGroupResults(args.group_id);
|
|
3235
3382
|
return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
|
|
3236
3383
|
} catch (err) {
|
|
@@ -3481,7 +3628,7 @@ function registerMessage(server) {
|
|
|
3481
3628
|
if (msgType && msgPayload) {
|
|
3482
3629
|
try {
|
|
3483
3630
|
const { buildTypedMessage, serializeMessage } = await import("./typed-messages-TKDGVPHS.js");
|
|
3484
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
3631
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
3485
3632
|
const { sendMessage } = await import("./lib/messaging.js");
|
|
3486
3633
|
const { agentId } = getActiveAgent2();
|
|
3487
3634
|
const envelope = buildTypedMessage({
|
|
@@ -3515,9 +3662,11 @@ ID: ${msg.id}`
|
|
|
3515
3662
|
if (action === "read") {
|
|
3516
3663
|
try {
|
|
3517
3664
|
const { getPendingMessages } = await import("./lib/messaging.js");
|
|
3518
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
3665
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
3666
|
+
const { resolveExeSession: resolveExeSession2 } = await import("./lib/tmux-routing.js");
|
|
3519
3667
|
const { agentId } = getActiveAgent2();
|
|
3520
|
-
const
|
|
3668
|
+
const callerScope = resolveExeSession2() ?? void 0;
|
|
3669
|
+
const messages = await getPendingMessages(agentId, callerScope);
|
|
3521
3670
|
if (messages.length === 0) {
|
|
3522
3671
|
return {
|
|
3523
3672
|
content: [{ type: "text", text: `No pending messages for ${agentId}.` }]
|
|
@@ -3878,8 +4027,8 @@ function registerIngestDocument(server) {
|
|
|
3878
4027
|
},
|
|
3879
4028
|
async (input) => {
|
|
3880
4029
|
try {
|
|
3881
|
-
const { assertFeature: assertFeature2 } = await import("./plan-limits-
|
|
3882
|
-
const { assertMemoryLimit: assertMemoryLimit2 } = await import("./plan-limits-
|
|
4030
|
+
const { assertFeature: assertFeature2 } = await import("./plan-limits-2FEY2GOS.js");
|
|
4031
|
+
const { assertMemoryLimit: assertMemoryLimit2 } = await import("./plan-limits-2FEY2GOS.js");
|
|
3883
4032
|
await assertFeature2("wiki");
|
|
3884
4033
|
await assertMemoryLimit2();
|
|
3885
4034
|
const result3 = await ingestDocument(input);
|
|
@@ -3950,8 +4099,8 @@ function registerPurgeDocument(server) {
|
|
|
3950
4099
|
},
|
|
3951
4100
|
async ({ document_id }) => {
|
|
3952
4101
|
try {
|
|
3953
|
-
const { StewardGate: StewardGate2 } = await import("./steward-gate-
|
|
3954
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
4102
|
+
const { StewardGate: StewardGate2 } = await import("./steward-gate-3GQ5XKMJ.js");
|
|
4103
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
3955
4104
|
const steward = new StewardGate2();
|
|
3956
4105
|
const agent = getActiveAgent2();
|
|
3957
4106
|
const gateDecision = await steward.checkAuthority(agent.agentId || "unknown", "purge_document", document_id);
|
|
@@ -4121,7 +4270,7 @@ function registerDocument(server) {
|
|
|
4121
4270
|
const { action: _action, ...legacyArgs } = input;
|
|
4122
4271
|
if (action === "list" && (legacyArgs.workspace_id === void 0 || legacyArgs.workspace_id === null || legacyArgs.workspace_id === "")) {
|
|
4123
4272
|
try {
|
|
4124
|
-
const { resolveDefaultWorkspaceId, listWorkspaces } = await import("./documents-
|
|
4273
|
+
const { resolveDefaultWorkspaceId, listWorkspaces } = await import("./documents-23WX2FPQ.js");
|
|
4125
4274
|
const defaultId = await resolveDefaultWorkspaceId();
|
|
4126
4275
|
if (defaultId) {
|
|
4127
4276
|
legacyArgs.workspace_id = defaultId;
|
|
@@ -4159,14 +4308,14 @@ ${lines.join("\n")}`
|
|
|
4159
4308
|
|
|
4160
4309
|
// src/mcp/tools/gateway.ts
|
|
4161
4310
|
import { z as z40 } from "zod";
|
|
4162
|
-
import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync3, mkdirSync } from "fs";
|
|
4311
|
+
import { chmodSync, existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync3, mkdirSync } from "fs";
|
|
4163
4312
|
import { join as join2 } from "path";
|
|
4164
|
-
import { homedir as
|
|
4313
|
+
import { homedir as homedir3 } from "os";
|
|
4165
4314
|
|
|
4166
4315
|
// src/mcp/tools/send-whatsapp.ts
|
|
4167
4316
|
import { z as z33 } from "zod";
|
|
4168
4317
|
import { existsSync, readFileSync } from "fs";
|
|
4169
|
-
import { homedir } from "os";
|
|
4318
|
+
import { homedir as homedir2 } from "os";
|
|
4170
4319
|
import { join } from "path";
|
|
4171
4320
|
var GRAPH_API_VERSION = "v21.0";
|
|
4172
4321
|
var GRAPH_API_BASE = `https://graph.facebook.com/${GRAPH_API_VERSION}`;
|
|
@@ -4222,7 +4371,7 @@ function normalizeGatewaySendUrl(value) {
|
|
|
4222
4371
|
return `${raw}/api/send`;
|
|
4223
4372
|
}
|
|
4224
4373
|
function loadGatewayJson() {
|
|
4225
|
-
const configPath = process.env.EXE_GATEWAY_CONFIG?.trim() || process.env.EXE_GATEWAY_CONFIG_PATH?.trim() || join(
|
|
4374
|
+
const configPath = process.env.EXE_GATEWAY_CONFIG?.trim() || process.env.EXE_GATEWAY_CONFIG_PATH?.trim() || join(homedir2(), ".exe-os", "gateway.json");
|
|
4226
4375
|
if (!existsSync(configPath)) return {};
|
|
4227
4376
|
try {
|
|
4228
4377
|
return JSON.parse(readFileSync(configPath, "utf8"));
|
|
@@ -5121,7 +5270,7 @@ async function handleStatus() {
|
|
|
5121
5270
|
detail: wikiUrl ? `API at ${wikiUrl}` : "EXE_WIKI_API_URL not set"
|
|
5122
5271
|
};
|
|
5123
5272
|
try {
|
|
5124
|
-
await import("./graph-rag-
|
|
5273
|
+
await import("./graph-rag-JZZAB7PC.js");
|
|
5125
5274
|
sinks.entity_extraction = { configured: true, detail: "GraphRAG available" };
|
|
5126
5275
|
} catch {
|
|
5127
5276
|
sinks.entity_extraction = { configured: false, detail: "graph-rag module unavailable" };
|
|
@@ -5148,7 +5297,7 @@ async function handleTrigger(limit) {
|
|
|
5148
5297
|
if (rows.rows.length === 0) {
|
|
5149
5298
|
return text3("No conversations found to re-process.");
|
|
5150
5299
|
}
|
|
5151
|
-
const { ingest } = await import("./pipeline-router-
|
|
5300
|
+
const { ingest } = await import("./pipeline-router-LM53NMWJ.js");
|
|
5152
5301
|
const results = [];
|
|
5153
5302
|
for (const row of rows.rows) {
|
|
5154
5303
|
const r = row;
|
|
@@ -5240,7 +5389,7 @@ function registerPipeline(server) {
|
|
|
5240
5389
|
}
|
|
5241
5390
|
|
|
5242
5391
|
// src/mcp/tools/gateway.ts
|
|
5243
|
-
var GATEWAY_CONFIG_PATH = join2(
|
|
5392
|
+
var GATEWAY_CONFIG_PATH = join2(homedir3(), ".exe-os", "gateway.json");
|
|
5244
5393
|
function okResult(text5) {
|
|
5245
5394
|
return { content: [{ type: "text", text: text5 }] };
|
|
5246
5395
|
}
|
|
@@ -5270,9 +5419,17 @@ function loadGatewayConfig() {
|
|
|
5270
5419
|
return {};
|
|
5271
5420
|
}
|
|
5272
5421
|
function saveGatewayConfig(config) {
|
|
5273
|
-
const dir = join2(
|
|
5274
|
-
mkdirSync(dir, { recursive: true });
|
|
5275
|
-
|
|
5422
|
+
const dir = join2(homedir3(), ".exe-os");
|
|
5423
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
5424
|
+
try {
|
|
5425
|
+
chmodSync(dir, 448);
|
|
5426
|
+
} catch {
|
|
5427
|
+
}
|
|
5428
|
+
writeFileSync3(GATEWAY_CONFIG_PATH, JSON.stringify(config, null, 2), { encoding: "utf8", mode: 384 });
|
|
5429
|
+
try {
|
|
5430
|
+
chmodSync(GATEWAY_CONFIG_PATH, 384);
|
|
5431
|
+
} catch {
|
|
5432
|
+
}
|
|
5276
5433
|
}
|
|
5277
5434
|
function registerGateway(server) {
|
|
5278
5435
|
const legacy = buildHandlers3();
|
|
@@ -5330,7 +5487,7 @@ function registerGateway(server) {
|
|
|
5330
5487
|
'gateway action "configure_whatsapp" requires phone_number_id, access_token, and verify_token'
|
|
5331
5488
|
);
|
|
5332
5489
|
}
|
|
5333
|
-
const { configureWhatsApp } = await import("./whatsapp-config-
|
|
5490
|
+
const { configureWhatsApp } = await import("./whatsapp-config-FAX6EA5K.js");
|
|
5334
5491
|
const result3 = await configureWhatsApp({
|
|
5335
5492
|
phoneNumberId,
|
|
5336
5493
|
accessToken,
|
|
@@ -5351,7 +5508,7 @@ Phone: ${result3.phoneDisplay ?? "verified"}
|
|
|
5351
5508
|
);
|
|
5352
5509
|
}
|
|
5353
5510
|
if (action === "whatsapp_status") {
|
|
5354
|
-
const { getWhatsAppStatus } = await import("./whatsapp-config-
|
|
5511
|
+
const { getWhatsAppStatus } = await import("./whatsapp-config-FAX6EA5K.js");
|
|
5355
5512
|
const status2 = getWhatsAppStatus();
|
|
5356
5513
|
if (!status2.connected) {
|
|
5357
5514
|
return okResult(
|
|
@@ -5390,6 +5547,7 @@ Accounts: ${status2.accounts}
|
|
|
5390
5547
|
adapterConfig.accounts = accounts;
|
|
5391
5548
|
config.adapters = adapters;
|
|
5392
5549
|
saveGatewayConfig(config);
|
|
5550
|
+
_resetCache();
|
|
5393
5551
|
return okResult(
|
|
5394
5552
|
`Account "${accountName}" added to ${accountPlatform} in gateway.json.
|
|
5395
5553
|
Note: Restart the gateway process for changes to take effect.`
|
|
@@ -5418,6 +5576,7 @@ Note: Restart the gateway process for changes to take effect.`
|
|
|
5418
5576
|
}
|
|
5419
5577
|
config.adapters = adapters;
|
|
5420
5578
|
saveGatewayConfig(config);
|
|
5579
|
+
_resetCache();
|
|
5421
5580
|
return okResult(
|
|
5422
5581
|
`Account "${accountName}" removed from gateway.json.
|
|
5423
5582
|
Note: Restart the gateway process for changes to take effect.`
|
|
@@ -5779,8 +5938,8 @@ function registerMergeEntities(server) {
|
|
|
5779
5938
|
},
|
|
5780
5939
|
async ({ source_name, source_type, target_name, target_type }) => {
|
|
5781
5940
|
try {
|
|
5782
|
-
const { StewardGate: StewardGate2 } = await import("./steward-gate-
|
|
5783
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
5941
|
+
const { StewardGate: StewardGate2 } = await import("./steward-gate-3GQ5XKMJ.js");
|
|
5942
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
5784
5943
|
const steward = new StewardGate2();
|
|
5785
5944
|
const agent = getActiveAgent2();
|
|
5786
5945
|
const gateDecision = await steward.checkAuthority(agent.agentId || "unknown", "merge_entities", `${source_name}\u2192${target_name}`);
|
|
@@ -5988,7 +6147,7 @@ async function handleExtractFromDocument(args) {
|
|
|
5988
6147
|
return errorResult7('graph action "extract_from_document" requires document_id');
|
|
5989
6148
|
}
|
|
5990
6149
|
try {
|
|
5991
|
-
const { extractGraphFromExistingDocument } = await import("./doc-graph-extractor-
|
|
6150
|
+
const { extractGraphFromExistingDocument } = await import("./doc-graph-extractor-F6ODFIID.js");
|
|
5992
6151
|
const result3 = await extractGraphFromExistingDocument(documentId);
|
|
5993
6152
|
const lines = [
|
|
5994
6153
|
`## Graph Extraction for Document ${documentId}`,
|
|
@@ -6015,7 +6174,7 @@ async function handleCleanupGarbage(args) {
|
|
|
6015
6174
|
const doMerge = !garbageOnly;
|
|
6016
6175
|
let mod;
|
|
6017
6176
|
try {
|
|
6018
|
-
mod = await import("./cleanup-graph-garbage-
|
|
6177
|
+
mod = await import("./cleanup-graph-garbage-XWUFAMFO.js");
|
|
6019
6178
|
} catch (err) {
|
|
6020
6179
|
return errorResult7(`cleanup_garbage: failed to load cleanup module \u2014 ${err instanceof Error ? err.message : String(err)}`);
|
|
6021
6180
|
}
|
|
@@ -6169,7 +6328,7 @@ function registerSetAgentConfig(server) {
|
|
|
6169
6328
|
inputSchema: {
|
|
6170
6329
|
agent_id: z48.string().optional().describe("Agent name, or 'default' for org-wide default. Omit to view all agents."),
|
|
6171
6330
|
runtime: z48.string().optional().describe(`Runtime: ${Object.keys(KNOWN_RUNTIMES).join(", ")}`),
|
|
6172
|
-
model: z48.string().optional().describe("Model name (e.g. claude-opus-4, gpt-5.
|
|
6331
|
+
model: z48.string().optional().describe("Model name (e.g. claude-opus-4, gpt-5.5, anthropic/claude-sonnet-4-6). Codex model availability depends on auth type (ChatGPT account vs OpenAI API key); gpt-5.5 is the verified-usable Codex default."),
|
|
6173
6332
|
reasoning_effort: z48.string().optional().describe("Codex reasoning effort: low, medium, high, xhigh. Per-agent override for thinking/reasoning depth."),
|
|
6174
6333
|
mcps: z48.array(z48.string()).optional().describe("MCP server allowlist. Only these servers load for this agent. exe-os always included. Omit to load all MCPs.")
|
|
6175
6334
|
}
|
|
@@ -6377,7 +6536,7 @@ function registerGetAgentSpend(server) {
|
|
|
6377
6536
|
description: "Get per-agent token spend attribution. Shows input, output, and cache tokens consumed by each agent over a time period, with estimated cost.",
|
|
6378
6537
|
inputSchema: {
|
|
6379
6538
|
period: z50.enum(["24h", "7d", "30d"]).default("7d").describe("Time period to query"),
|
|
6380
|
-
agent_id: z50.string().optional().describe("Filter to a specific agent (e.g. '
|
|
6539
|
+
agent_id: z50.string().optional().describe("Filter to a specific agent (e.g. 'engineer', 'architect')")
|
|
6381
6540
|
}
|
|
6382
6541
|
},
|
|
6383
6542
|
async ({ period, agent_id }) => {
|
|
@@ -6660,8 +6819,8 @@ ${extHealth.remediation}`);
|
|
|
6660
6819
|
} catch {
|
|
6661
6820
|
}
|
|
6662
6821
|
try {
|
|
6663
|
-
const { homedir:
|
|
6664
|
-
const dcrConnectors = detectDcrIncompatibleConnectorsFromDisk(
|
|
6822
|
+
const { homedir: homedir6 } = await import("os");
|
|
6823
|
+
const dcrConnectors = detectDcrIncompatibleConnectorsFromDisk(homedir6());
|
|
6665
6824
|
if (dcrConnectors.length > 0) {
|
|
6666
6825
|
lines.push("\n### Google MCP connectors (auth-incompatible)");
|
|
6667
6826
|
lines.push("| Connector | Endpoint |");
|
|
@@ -6895,7 +7054,7 @@ async function getAgentSessionLoad() {
|
|
|
6895
7054
|
return { sessions: [], totalLive: 0, busySessions: 0, idleSessions: 0 };
|
|
6896
7055
|
}
|
|
6897
7056
|
const { getClient: getClient2 } = await import("./lib/database.js");
|
|
6898
|
-
const { sessionScopeFilter: sessionScopeFilter2 } = await import("./task-scope-
|
|
7057
|
+
const { sessionScopeFilter: sessionScopeFilter2 } = await import("./task-scope-FOIW25HR.js");
|
|
6899
7058
|
const client = getClient2();
|
|
6900
7059
|
const scope = sessionScopeFilter2();
|
|
6901
7060
|
for (const s of liveAgentSessions) {
|
|
@@ -6994,27 +7153,40 @@ function registerRunMemoryAudit(server) {
|
|
|
6994
7153
|
agent_id: z57.string().optional().describe("Filter audit to a specific agent"),
|
|
6995
7154
|
project_name: z57.string().optional().describe("Filter audit to a specific project"),
|
|
6996
7155
|
fix: z57.boolean().optional().default(false).describe("Apply fixes: delete duplicates, chunk bloated records, rebuild FTS, archive shards"),
|
|
6997
|
-
dry_run: z57.boolean().optional().default(false).describe("Preview fixes without applying them")
|
|
7156
|
+
dry_run: z57.boolean().optional().default(false).describe("Preview fixes without applying them"),
|
|
7157
|
+
bounded: z57.boolean().optional().default(true).describe("Cap expensive scans so large memory DBs return promptly. Set false for full CLI-equivalent audit."),
|
|
7158
|
+
duplicate_group_limit: z57.number().int().positive().max(500).optional().describe("Bounded mode: maximum duplicate candidate buckets to inspect"),
|
|
7159
|
+
duplicate_member_limit: z57.number().int().positive().max(1e4).optional().describe("Bounded mode: maximum rows to inspect inside each duplicate candidate bucket")
|
|
6998
7160
|
}
|
|
6999
7161
|
},
|
|
7000
|
-
async ({ agent_id, project_name, fix, dry_run }) => {
|
|
7162
|
+
async ({ agent_id, project_name, fix, dry_run, bounded, duplicate_group_limit, duplicate_member_limit }) => {
|
|
7001
7163
|
try {
|
|
7002
7164
|
const client = getClient();
|
|
7003
7165
|
const shouldFix = fix === true;
|
|
7004
7166
|
const isDryRun = dry_run === true;
|
|
7167
|
+
const boundedAudit = bounded !== false;
|
|
7005
7168
|
const flags = {
|
|
7006
7169
|
fix: shouldFix,
|
|
7007
7170
|
dryRun: isDryRun,
|
|
7008
|
-
verbose:
|
|
7171
|
+
verbose: !boundedAudit,
|
|
7009
7172
|
conflicts: false,
|
|
7010
7173
|
// O(n²) — opt-in only via CLI --conflicts
|
|
7011
7174
|
restarts: false,
|
|
7012
7175
|
// daemon restart report is a separate CLI mode
|
|
7013
7176
|
agent: agent_id,
|
|
7014
|
-
project: project_name
|
|
7177
|
+
project: project_name,
|
|
7178
|
+
bounded: boundedAudit,
|
|
7179
|
+
duplicateGroupLimit: duplicate_group_limit,
|
|
7180
|
+
duplicateMemberLimit: duplicate_member_limit,
|
|
7181
|
+
deleteLocalSecretResidue: false
|
|
7015
7182
|
};
|
|
7016
7183
|
const report = await runAudit(client, flags);
|
|
7017
7184
|
let formatted = formatReport(report, flags);
|
|
7185
|
+
if (boundedAudit) {
|
|
7186
|
+
formatted += `
|
|
7187
|
+
|
|
7188
|
+
Bounded MCP mode: duplicate scan is capped (${duplicate_group_limit ?? 25} bucket(s), ${duplicate_member_limit ?? 250} row(s)/bucket). Set bounded=false for a full audit or run \`exe-os doctor --verbose\` locally.`;
|
|
7189
|
+
}
|
|
7018
7190
|
if (shouldFix || isDryRun) {
|
|
7019
7191
|
const mode = isDryRun ? "[dry-run]" : "[fix]";
|
|
7020
7192
|
const fixLog = [`
|
|
@@ -7022,7 +7194,7 @@ ${mode} Applying repairs...
|
|
|
7022
7194
|
`];
|
|
7023
7195
|
if (!isDryRun) {
|
|
7024
7196
|
try {
|
|
7025
|
-
const { createBackup: createBackup2 } = await import("./db-backup-
|
|
7197
|
+
const { createBackup: createBackup2 } = await import("./db-backup-W2QFSYQC.js");
|
|
7026
7198
|
const backupPath = await createBackup2("pre-fix");
|
|
7027
7199
|
if (backupPath) {
|
|
7028
7200
|
fixLog.push(` Backup created: ${backupPath.split("/").pop()}`);
|
|
@@ -7261,7 +7433,7 @@ async function cloudStatusText() {
|
|
|
7261
7433
|
if (lastReuploadedAt) lines.push(`- Last re-upload: ${lastReuploadedAt}`);
|
|
7262
7434
|
lines.push("");
|
|
7263
7435
|
try {
|
|
7264
|
-
const { getRetrievalHealth: getRetrievalHealth2, formatDegradations: formatDegradations2 } = await import("./retrieval-health-
|
|
7436
|
+
const { getRetrievalHealth: getRetrievalHealth2, formatDegradations: formatDegradations2 } = await import("./retrieval-health-4Z242P3B.js");
|
|
7265
7437
|
const h = await getRetrievalHealth2();
|
|
7266
7438
|
lines.push(formatDegradations2(h.degradations, "Health / Degradations"));
|
|
7267
7439
|
lines.push("");
|
|
@@ -8756,7 +8928,7 @@ function registerCreateTrigger(server) {
|
|
|
8756
8928
|
}
|
|
8757
8929
|
},
|
|
8758
8930
|
async ({ name, event, conditions, actions, project, enabled, schedule, query }) => {
|
|
8759
|
-
const { assertFeature: assertFeature2 } = await import("./plan-limits-
|
|
8931
|
+
const { assertFeature: assertFeature2 } = await import("./plan-limits-2FEY2GOS.js");
|
|
8760
8932
|
const gatedActions = {
|
|
8761
8933
|
send_whatsapp: "external_agents",
|
|
8762
8934
|
update_wiki: "wiki"
|
|
@@ -9215,8 +9387,8 @@ ${err.message}`
|
|
|
9215
9387
|
import { z as z72 } from "zod";
|
|
9216
9388
|
import { readFileSync as readFileSync4, readdirSync as readdirSync3, statSync } from "fs";
|
|
9217
9389
|
import path10 from "path";
|
|
9218
|
-
import { homedir as
|
|
9219
|
-
var SKILLS_DIR = path10.join(
|
|
9390
|
+
import { homedir as homedir4 } from "os";
|
|
9391
|
+
var SKILLS_DIR = path10.join(homedir4(), ".claude", "skills");
|
|
9220
9392
|
function listAvailableSkills() {
|
|
9221
9393
|
try {
|
|
9222
9394
|
const entries = readdirSync3(SKILLS_DIR);
|
|
@@ -9726,8 +9898,8 @@ function buildHandlers5() {
|
|
|
9726
9898
|
}
|
|
9727
9899
|
async function handleDreaming(action, args) {
|
|
9728
9900
|
try {
|
|
9729
|
-
const { DreamingEngine: DreamingEngine2 } = await import("./dreaming-
|
|
9730
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
9901
|
+
const { DreamingEngine: DreamingEngine2 } = await import("./dreaming-NWD22UQ5.js");
|
|
9902
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
9731
9903
|
const { getClient: getClient2 } = await import("./lib/database.js");
|
|
9732
9904
|
const agentId = args.agent_id ?? getActiveAgent2().agentId;
|
|
9733
9905
|
if (action === "dreaming_run") {
|
|
@@ -9885,8 +10057,8 @@ function registerConfig(server) {
|
|
|
9885
10057
|
}
|
|
9886
10058
|
if (action === "closeout") {
|
|
9887
10059
|
try {
|
|
9888
|
-
const { DreamingEngine: DreamingEngine2 } = await import("./dreaming-
|
|
9889
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
10060
|
+
const { DreamingEngine: DreamingEngine2 } = await import("./dreaming-NWD22UQ5.js");
|
|
10061
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
9890
10062
|
const { writeMemory: writeMemory2, flushBatch: flushBatch2 } = await import("./lib/store.js");
|
|
9891
10063
|
const { randomUUID: randomUUID2 } = await import("crypto");
|
|
9892
10064
|
const { getProjectName: getProjectName2 } = await import("./project-name-EWG5KAZP.js");
|
|
@@ -9957,7 +10129,7 @@ function registerConfig(server) {
|
|
|
9957
10129
|
}
|
|
9958
10130
|
if (action === "capability_cards") {
|
|
9959
10131
|
try {
|
|
9960
|
-
const { getAllCapabilityCards, findAgentForTask } = await import("./capability-cards-
|
|
10132
|
+
const { getAllCapabilityCards, findAgentForTask } = await import("./capability-cards-DN5UIKVN.js");
|
|
9961
10133
|
const cards = getAllCapabilityCards();
|
|
9962
10134
|
const taskQuery = args.query;
|
|
9963
10135
|
if (taskQuery) {
|
|
@@ -10008,7 +10180,7 @@ function registerConfig(server) {
|
|
|
10008
10180
|
const existing = loadEmployeesSync2();
|
|
10009
10181
|
if (existing.some((e) => e.name === employeeName)) return errorResult8(`Employee "${employeeName}" already exists.`);
|
|
10010
10182
|
try {
|
|
10011
|
-
const { assertEmployeeLimit: assertEmployeeLimit2 } = await import("./plan-limits-
|
|
10183
|
+
const { assertEmployeeLimit: assertEmployeeLimit2 } = await import("./plan-limits-2FEY2GOS.js");
|
|
10012
10184
|
await assertEmployeeLimit2();
|
|
10013
10185
|
} catch (e) {
|
|
10014
10186
|
return errorResult8(e instanceof Error ? e.message : "Employee limit reached.");
|
|
@@ -10049,7 +10221,7 @@ You are ${employeeName}. Role: ${role}.`, "utf-8");
|
|
|
10049
10221
|
}
|
|
10050
10222
|
try {
|
|
10051
10223
|
const { generateSessionWrappers } = await import("./lib/session-wrappers.js");
|
|
10052
|
-
const { resolvePackageRoot } = await import("./installer-
|
|
10224
|
+
const { resolvePackageRoot } = await import("./installer-L7EVH5U5.js");
|
|
10053
10225
|
generateSessionWrappers(resolvePackageRoot());
|
|
10054
10226
|
} catch {
|
|
10055
10227
|
}
|
|
@@ -10136,7 +10308,7 @@ function registerListWikiPages(server) {
|
|
|
10136
10308
|
}
|
|
10137
10309
|
},
|
|
10138
10310
|
async ({ workspace, folder }) => {
|
|
10139
|
-
const { assertFeature: assertFeature2 } = await import("./plan-limits-
|
|
10311
|
+
const { assertFeature: assertFeature2 } = await import("./plan-limits-2FEY2GOS.js");
|
|
10140
10312
|
await assertFeature2("wiki");
|
|
10141
10313
|
const apiUrl = process.env.EXE_WIKI_API_URL;
|
|
10142
10314
|
const apiKey = process.env.EXE_WIKI_API_KEY;
|
|
@@ -10236,7 +10408,7 @@ function registerGetWikiPage(server) {
|
|
|
10236
10408
|
}
|
|
10237
10409
|
},
|
|
10238
10410
|
async ({ workspace, document_id, title }) => {
|
|
10239
|
-
const { assertFeature: assertFeature2 } = await import("./plan-limits-
|
|
10411
|
+
const { assertFeature: assertFeature2 } = await import("./plan-limits-2FEY2GOS.js");
|
|
10240
10412
|
await assertFeature2("wiki");
|
|
10241
10413
|
const apiUrl = process.env.EXE_WIKI_API_URL;
|
|
10242
10414
|
const apiKey = process.env.EXE_WIKI_API_KEY;
|
|
@@ -10430,10 +10602,10 @@ async function handleWikiSearch(input) {
|
|
|
10430
10602
|
const userId = input.user_id;
|
|
10431
10603
|
if (!workspace) return errorResult9('wiki action "search" requires workspace');
|
|
10432
10604
|
if (!query) return errorResult9('wiki action "search" requires query');
|
|
10433
|
-
const { assertFeature: assertFeature2 } = await import("./plan-limits-
|
|
10605
|
+
const { assertFeature: assertFeature2 } = await import("./plan-limits-2FEY2GOS.js");
|
|
10434
10606
|
await assertFeature2("wiki");
|
|
10435
10607
|
if (userId) {
|
|
10436
|
-
const { checkWikiAccess } = await import("./wiki-acl-
|
|
10608
|
+
const { checkWikiAccess } = await import("./wiki-acl-74BLWG6J.js");
|
|
10437
10609
|
const { allowed } = await checkWikiAccess(String(userId), String(workspace), "read");
|
|
10438
10610
|
if (!allowed) {
|
|
10439
10611
|
return errorResult9(`Access denied: user "${userId}" does not have read access to workspace "${workspace}"`);
|
|
@@ -10536,7 +10708,7 @@ function registerWiki(server) {
|
|
|
10536
10708
|
return errorResult9('wiki action "document_rerank" requires at least one candidate');
|
|
10537
10709
|
}
|
|
10538
10710
|
if (user_id && legacyArgs.workspace) {
|
|
10539
|
-
const { checkWikiAccess } = await import("./wiki-acl-
|
|
10711
|
+
const { checkWikiAccess } = await import("./wiki-acl-74BLWG6J.js");
|
|
10540
10712
|
const { allowed } = await checkWikiAccess(
|
|
10541
10713
|
String(user_id),
|
|
10542
10714
|
String(legacyArgs.workspace),
|
|
@@ -10717,12 +10889,22 @@ ${lines.join("\n")}`
|
|
|
10717
10889
|
};
|
|
10718
10890
|
}
|
|
10719
10891
|
const caller2 = getActiveAgent();
|
|
10720
|
-
const
|
|
10892
|
+
const rosterState = loadEmployeesState();
|
|
10893
|
+
const roster = rosterState.employees;
|
|
10721
10894
|
const rawAgent = agent_id ?? caller2.agentId;
|
|
10722
10895
|
const resolvedAgent = baseAgentName(rawAgent, roster);
|
|
10723
10896
|
const callerBase = baseAgentName(caller2.agentId, roster);
|
|
10724
10897
|
const isCrossAgentWrite = resolvedAgent !== callerBase;
|
|
10725
10898
|
if (isCrossAgentWrite) {
|
|
10899
|
+
if (rosterState.status === "error") {
|
|
10900
|
+
return {
|
|
10901
|
+
content: [{
|
|
10902
|
+
type: "text",
|
|
10903
|
+
text: `Permission denied: the employee roster is unreadable or corrupt, so the chain of command cannot be verified. Cross-agent behavior writes are blocked until the roster (exe-employees.json) is repaired.`
|
|
10904
|
+
}],
|
|
10905
|
+
isError: true
|
|
10906
|
+
};
|
|
10907
|
+
}
|
|
10726
10908
|
const allowed2 = canManage(callerBase, caller2.agentRole, resolvedAgent, roster);
|
|
10727
10909
|
if (!allowed2) {
|
|
10728
10910
|
return {
|
|
@@ -10857,7 +11039,7 @@ Use /exe-forget to remove any that this supersedes.`;
|
|
|
10857
11039
|
}]
|
|
10858
11040
|
};
|
|
10859
11041
|
}
|
|
10860
|
-
const { bulkPurgeGhostBehaviors } = await import("./behaviors-
|
|
11042
|
+
const { bulkPurgeGhostBehaviors } = await import("./behaviors-KYRB3NGJ.js");
|
|
10861
11043
|
const res = await bulkPurgeGhostBehaviors({ batchSize: 5e3, vacuum: true });
|
|
10862
11044
|
return {
|
|
10863
11045
|
content: [{
|
|
@@ -10968,7 +11150,7 @@ Use /exe-forget to remove any that this supersedes.`;
|
|
|
10968
11150
|
return { content: [{ type: "text", text: `Behavior not found: ${behavior_id}` }], isError: true };
|
|
10969
11151
|
}
|
|
10970
11152
|
const row2 = result4.rows[0];
|
|
10971
|
-
const { reactivateBehavior: reactivateBehavior2 } = await import("./behaviors-
|
|
11153
|
+
const { reactivateBehavior: reactivateBehavior2 } = await import("./behaviors-KYRB3NGJ.js");
|
|
10972
11154
|
const wasReactivated = await reactivateBehavior2(behavior_id);
|
|
10973
11155
|
if (!wasReactivated) {
|
|
10974
11156
|
return { content: [{ type: "text", text: `Behavior ${behavior_id} is already active.` }] };
|
|
@@ -11049,11 +11231,12 @@ function registerReminder(server) {
|
|
|
11049
11231
|
action: z82.enum(["create", "list", "complete"]).describe("Action to perform"),
|
|
11050
11232
|
text: z82.string().optional().describe("What to remind about (create)"),
|
|
11051
11233
|
due_date: z82.string().optional().describe("Optional due date \u2014 ISO date (2026-04-01) or null for persistent (create)"),
|
|
11234
|
+
daily_push: z82.string().optional().describe('Optional daily push schedule (create) \u2014 JSON {"hours":[9,18]} (0\u201323, founder timezone). A gateway channel pushes this reminder at those hours.'),
|
|
11052
11235
|
reminder_id: z82.string().optional().describe("Reminder UUID or text substring to match (complete)"),
|
|
11053
11236
|
include_completed: z82.boolean().optional().default(false).describe("Include completed reminders (list)")
|
|
11054
11237
|
}
|
|
11055
11238
|
},
|
|
11056
|
-
async ({ action, text: text5, due_date, reminder_id, include_completed }) => {
|
|
11239
|
+
async ({ action, text: text5, due_date, daily_push, reminder_id, include_completed }) => {
|
|
11057
11240
|
if (action === "create") {
|
|
11058
11241
|
if (!text5) {
|
|
11059
11242
|
return {
|
|
@@ -11061,10 +11244,19 @@ function registerReminder(server) {
|
|
|
11061
11244
|
isError: true
|
|
11062
11245
|
};
|
|
11063
11246
|
}
|
|
11064
|
-
|
|
11247
|
+
let reminder2;
|
|
11248
|
+
try {
|
|
11249
|
+
reminder2 = await createReminder(text5, due_date, daily_push);
|
|
11250
|
+
} catch (err) {
|
|
11251
|
+
return {
|
|
11252
|
+
content: [{ type: "text", text: err instanceof Error ? err.message : String(err) }],
|
|
11253
|
+
isError: true
|
|
11254
|
+
};
|
|
11255
|
+
}
|
|
11065
11256
|
const dueStr = reminder2.dueDate ? ` (due: ${reminder2.dueDate})` : "";
|
|
11257
|
+
const pushStr = reminder2.dailyPush ? ` (daily push: ${reminder2.dailyPush})` : "";
|
|
11066
11258
|
return {
|
|
11067
|
-
content: [{ type: "text", text: `Reminder set: "${reminder2.text}"${dueStr}` }]
|
|
11259
|
+
content: [{ type: "text", text: `Reminder set: "${reminder2.text}"${dueStr}${pushStr}` }]
|
|
11068
11260
|
};
|
|
11069
11261
|
}
|
|
11070
11262
|
if (action === "list") {
|
|
@@ -11076,8 +11268,9 @@ function registerReminder(server) {
|
|
|
11076
11268
|
}
|
|
11077
11269
|
const lines = reminders.map((r) => {
|
|
11078
11270
|
const due = r.dueDate ? ` (due: ${r.dueDate})` : "";
|
|
11271
|
+
const push = r.dailyPush ? ` (daily push: ${r.dailyPush})` : "";
|
|
11079
11272
|
const done = r.completedAt ? " [DONE]" : "";
|
|
11080
|
-
return `\u2022 ${r.text}${due}${done} [id: ${r.id.slice(0, 8)}]`;
|
|
11273
|
+
return `\u2022 ${r.text}${due}${push}${done} [id: ${r.id.slice(0, 8)}]`;
|
|
11081
11274
|
});
|
|
11082
11275
|
return {
|
|
11083
11276
|
content: [{ type: "text", text: lines.join("\n") }]
|
|
@@ -11489,7 +11682,7 @@ function registerWorkflowTool(server) {
|
|
|
11489
11682
|
getWorkflowInstance,
|
|
11490
11683
|
listWorkflowInstances,
|
|
11491
11684
|
approveWorkflowStep
|
|
11492
|
-
} = await import("./workflow-engine-
|
|
11685
|
+
} = await import("./workflow-engine-YITHXZR5.js");
|
|
11493
11686
|
try {
|
|
11494
11687
|
switch (input.action) {
|
|
11495
11688
|
case "create_workflow": {
|
|
@@ -11614,7 +11807,6 @@ function formatInstanceStatus(inst, def) {
|
|
|
11614
11807
|
// src/mcp/tools/create-bug-report.ts
|
|
11615
11808
|
import { z as z88 } from "zod";
|
|
11616
11809
|
import crypto4 from "crypto";
|
|
11617
|
-
import { mkdir as mkdir2, writeFile as writeFile2 } from "fs/promises";
|
|
11618
11810
|
import path13 from "path";
|
|
11619
11811
|
var CLASSIFICATION = z88.enum([
|
|
11620
11812
|
"upstream_bug",
|
|
@@ -11738,7 +11930,7 @@ function registerCreateBugReport(server) {
|
|
|
11738
11930
|
files_changed: z88.array(z88.string()).optional().describe("Files changed or suspected"),
|
|
11739
11931
|
workaround: z88.string().optional().describe("Temporary local workaround/hotfix, if any"),
|
|
11740
11932
|
local_patch_diff: z88.string().optional().describe("Small local diff or patch summary"),
|
|
11741
|
-
product:
|
|
11933
|
+
product: supportProductSchema.optional().describe("Product this bug is for: exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build. Defaults to exe-os."),
|
|
11742
11934
|
package_version: z88.string().optional().describe("Installed package version"),
|
|
11743
11935
|
project_name: z88.string().optional().describe("Project/customer context"),
|
|
11744
11936
|
implementing_branch: z88.string().optional().describe("Branch name or PR URL that implements/fixes this bug. Recorded on the report so future work can find existing fixes instead of redoing them (bug e324f244)."),
|
|
@@ -11750,6 +11942,7 @@ function registerCreateBugReport(server) {
|
|
|
11750
11942
|
on_behalf_of_email: z88.string().email().optional().describe("ADMIN ONLY: file this request owned by another customer's license email; ignored unless caller holds the support admin token")
|
|
11751
11943
|
}
|
|
11752
11944
|
},
|
|
11945
|
+
// Structural sink guard (round 6): deep-redact the whole return object + errors.
|
|
11753
11946
|
async ({
|
|
11754
11947
|
title,
|
|
11755
11948
|
classification,
|
|
@@ -11769,7 +11962,7 @@ function registerCreateBugReport(server) {
|
|
|
11769
11962
|
attachments,
|
|
11770
11963
|
send_upstream,
|
|
11771
11964
|
on_behalf_of_email
|
|
11772
|
-
}) => {
|
|
11965
|
+
}) => redactedToolResult(async () => {
|
|
11773
11966
|
if (!summary || summary.trim().length === 0) {
|
|
11774
11967
|
return {
|
|
11775
11968
|
content: [{
|
|
@@ -11782,10 +11975,10 @@ function registerCreateBugReport(server) {
|
|
|
11782
11975
|
const { agentId, agentRole } = getActiveAgent();
|
|
11783
11976
|
const id = crypto4.randomUUID();
|
|
11784
11977
|
const resolvedProduct = product ?? "exe-os";
|
|
11785
|
-
const version = package_version ?? "unknown";
|
|
11978
|
+
const version = sanitizeVersionField(package_version) ?? "unknown";
|
|
11786
11979
|
let metricsSnapshot = "";
|
|
11787
11980
|
try {
|
|
11788
|
-
const { getOrchestrationMetrics, formatOrchestrationMetrics } = await import("./orchestration-events-
|
|
11981
|
+
const { getOrchestrationMetrics, formatOrchestrationMetrics } = await import("./orchestration-events-WV4NWKZH.js");
|
|
11789
11982
|
const sinceIso = new Date(Date.now() - 60 * 60 * 1e3).toISOString();
|
|
11790
11983
|
const metrics = await getOrchestrationMetrics({ sinceIso });
|
|
11791
11984
|
if (metrics.totalEvents > 0) {
|
|
@@ -11831,46 +12024,38 @@ ${formatOrchestrationMetrics(metrics)}
|
|
|
11831
12024
|
}
|
|
11832
12025
|
const fullMarkdown = markdown + metricsSnapshot + attachmentSection;
|
|
11833
12026
|
const outDir = path13.join(EXE_AI_DIR, "bug-reports");
|
|
11834
|
-
|
|
11835
|
-
const
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
12027
|
+
const reportPath = path13.join(outDir, `${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}-${slugify(redactSecrets(title).text)}-${id.slice(0, 8)}.md`);
|
|
12028
|
+
const attachDir = path13.join(outDir, `${id.slice(0, 8)}-attachments`);
|
|
12029
|
+
const persistAttachments = (attachments ?? []).map((att) => ({
|
|
12030
|
+
// Sanitize filename — redact secrets first (F6: filename lands on disk),
|
|
12031
|
+
// then strip path separators to prevent directory traversal.
|
|
12032
|
+
path: path13.join(attachDir, redactSecrets(att.filename).text.replace(/[/\\]/g, "_").replace(/\.\./g, "_")),
|
|
12033
|
+
content: att.content
|
|
12034
|
+
}));
|
|
12035
|
+
const persisted = await persistSupportArtifact({
|
|
12036
|
+
memoryText: fullMarkdown,
|
|
12037
|
+
file: { path: reportPath, content: fullMarkdown },
|
|
12038
|
+
attachments: persistAttachments,
|
|
12039
|
+
memory: {
|
|
12040
|
+
id,
|
|
12041
|
+
agent_id: agentId,
|
|
12042
|
+
agent_role: agentRole,
|
|
12043
|
+
session_id: process.env.SESSION_ID ?? "manual",
|
|
12044
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12045
|
+
tool_name: "create_bug_report",
|
|
12046
|
+
project_name: project_name ?? "support",
|
|
12047
|
+
has_error: classification === "upstream_bug" || classification === "emergency_hotfix",
|
|
12048
|
+
source_path: reportPath,
|
|
12049
|
+
source_type: "bug_report",
|
|
12050
|
+
memory_type: "bug_report",
|
|
12051
|
+
tier: 1,
|
|
12052
|
+
importance: severity === "p0" ? 10 : severity === "p1" ? 9 : 7,
|
|
12053
|
+
intent: "report",
|
|
12054
|
+
domain: "support",
|
|
12055
|
+
file_paths: files_changed ? JSON.stringify(files_changed) : null
|
|
11845
12056
|
}
|
|
11846
|
-
}
|
|
11847
|
-
let vector = null;
|
|
11848
|
-
try {
|
|
11849
|
-
vector = await embed(fullMarkdown);
|
|
11850
|
-
} catch {
|
|
11851
|
-
vector = null;
|
|
11852
|
-
}
|
|
11853
|
-
await writeMemory({
|
|
11854
|
-
id,
|
|
11855
|
-
agent_id: agentId,
|
|
11856
|
-
agent_role: agentRole,
|
|
11857
|
-
session_id: process.env.SESSION_ID ?? "manual",
|
|
11858
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11859
|
-
tool_name: "create_bug_report",
|
|
11860
|
-
project_name: project_name ?? "support",
|
|
11861
|
-
has_error: classification === "upstream_bug" || classification === "emergency_hotfix",
|
|
11862
|
-
raw_text: fullMarkdown,
|
|
11863
|
-
vector,
|
|
11864
|
-
source_path: reportPath,
|
|
11865
|
-
source_type: "bug_report",
|
|
11866
|
-
memory_type: "bug_report",
|
|
11867
|
-
tier: 1,
|
|
11868
|
-
importance: severity === "p0" ? 10 : severity === "p1" ? 9 : 7,
|
|
11869
|
-
intent: "report",
|
|
11870
|
-
domain: "support",
|
|
11871
|
-
file_paths: files_changed ? JSON.stringify(files_changed) : null
|
|
11872
12057
|
});
|
|
11873
|
-
|
|
12058
|
+
savedAttachmentPaths.push(...persisted.attachmentPaths);
|
|
11874
12059
|
const upstreamAttachments = attachments?.map((att) => ({
|
|
11875
12060
|
filename: att.filename,
|
|
11876
12061
|
content: att.content,
|
|
@@ -11919,14 +12104,13 @@ Upstream status: ${upstreamStatus}`
|
|
|
11919
12104
|
}
|
|
11920
12105
|
]
|
|
11921
12106
|
};
|
|
11922
|
-
}
|
|
12107
|
+
})
|
|
11923
12108
|
);
|
|
11924
12109
|
}
|
|
11925
12110
|
|
|
11926
12111
|
// src/mcp/tools/create-feature-request.ts
|
|
11927
12112
|
import { z as z89 } from "zod";
|
|
11928
12113
|
import crypto5 from "crypto";
|
|
11929
|
-
import { mkdir as mkdir3, writeFile as writeFile3 } from "fs/promises";
|
|
11930
12114
|
import path14 from "path";
|
|
11931
12115
|
var CATEGORY = z89.enum([
|
|
11932
12116
|
"upstream_feature",
|
|
@@ -12033,7 +12217,7 @@ function registerCreateFeatureRequest(server) {
|
|
|
12033
12217
|
current_workaround: z89.string().optional().describe("How the need is currently addressed, if at all"),
|
|
12034
12218
|
proposed_solution: z89.string().optional().describe("Suggested implementation approach"),
|
|
12035
12219
|
business_impact: z89.string().optional().describe("Impact on business/workflow if this ships"),
|
|
12036
|
-
product:
|
|
12220
|
+
product: supportProductSchema.optional().describe("Product this feature is for: exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build. Defaults to exe-os."),
|
|
12037
12221
|
package_version: z89.string().optional().describe("Installed package version"),
|
|
12038
12222
|
project_name: z89.string().optional().describe("Project/customer context"),
|
|
12039
12223
|
implementing_branch: z89.string().optional().describe("Branch name or PR URL that implements this feature. Recorded on the request so future work can find existing implementations instead of redoing them (bug e324f244)."),
|
|
@@ -12045,6 +12229,7 @@ function registerCreateFeatureRequest(server) {
|
|
|
12045
12229
|
on_behalf_of_email: z89.string().email().optional().describe("ADMIN ONLY: file this request owned by another customer's license email; ignored unless caller holds the support admin token")
|
|
12046
12230
|
}
|
|
12047
12231
|
},
|
|
12232
|
+
// Structural sink guard (round 6): deep-redact the whole return object + errors.
|
|
12048
12233
|
async ({
|
|
12049
12234
|
title,
|
|
12050
12235
|
category,
|
|
@@ -12061,11 +12246,11 @@ function registerCreateFeatureRequest(server) {
|
|
|
12061
12246
|
attachments,
|
|
12062
12247
|
send_upstream,
|
|
12063
12248
|
on_behalf_of_email
|
|
12064
|
-
}) => {
|
|
12249
|
+
}) => redactedToolResult(async () => {
|
|
12065
12250
|
const { agentId, agentRole } = getActiveAgent();
|
|
12066
12251
|
const id = crypto5.randomUUID();
|
|
12067
12252
|
const resolvedProduct = product ?? "exe-os";
|
|
12068
|
-
const version = package_version ?? "unknown";
|
|
12253
|
+
const version = sanitizeVersionField(package_version) ?? "unknown";
|
|
12069
12254
|
const markdownBase = buildMarkdown2({
|
|
12070
12255
|
id,
|
|
12071
12256
|
title,
|
|
@@ -12095,46 +12280,37 @@ function registerCreateFeatureRequest(server) {
|
|
|
12095
12280
|
}
|
|
12096
12281
|
const markdown = markdownBase + attachmentSection;
|
|
12097
12282
|
const outDir = path14.join(EXE_AI_DIR, "feature-requests");
|
|
12098
|
-
|
|
12099
|
-
const
|
|
12100
|
-
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12283
|
+
const reportPath = path14.join(outDir, `${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}-${slugify2(redactSecrets(title).text)}-${id.slice(0, 8)}.md`);
|
|
12284
|
+
const attachDir = path14.join(outDir, `${id.slice(0, 8)}-attachments`);
|
|
12285
|
+
const persistAttachments = (attachments ?? []).map((att) => ({
|
|
12286
|
+
// F6: redact secrets from the filename before it lands on disk.
|
|
12287
|
+
path: path14.join(attachDir, redactSecrets(att.filename).text.replace(/[/\\]/g, "_").replace(/\.\./g, "_")),
|
|
12288
|
+
content: att.content
|
|
12289
|
+
}));
|
|
12290
|
+
const persisted = await persistSupportArtifact({
|
|
12291
|
+
memoryText: markdown,
|
|
12292
|
+
file: { path: reportPath, content: markdown },
|
|
12293
|
+
attachments: persistAttachments,
|
|
12294
|
+
memory: {
|
|
12295
|
+
id,
|
|
12296
|
+
agent_id: agentId,
|
|
12297
|
+
agent_role: agentRole,
|
|
12298
|
+
session_id: process.env.SESSION_ID ?? "manual",
|
|
12299
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12300
|
+
tool_name: "create_feature_request",
|
|
12301
|
+
project_name: project_name ?? "support",
|
|
12302
|
+
has_error: false,
|
|
12303
|
+
source_path: reportPath,
|
|
12304
|
+
source_type: "feature_request",
|
|
12305
|
+
memory_type: "feature_request",
|
|
12306
|
+
tier: 1,
|
|
12307
|
+
importance: priority === "p0" ? 10 : priority === "p1" ? 9 : priority === "p2" ? 7 : 5,
|
|
12308
|
+
intent: "request",
|
|
12309
|
+
domain: "support",
|
|
12310
|
+
file_paths: null
|
|
12109
12311
|
}
|
|
12110
|
-
}
|
|
12111
|
-
let vector = null;
|
|
12112
|
-
try {
|
|
12113
|
-
vector = await embed(markdown);
|
|
12114
|
-
} catch {
|
|
12115
|
-
vector = null;
|
|
12116
|
-
}
|
|
12117
|
-
await writeMemory({
|
|
12118
|
-
id,
|
|
12119
|
-
agent_id: agentId,
|
|
12120
|
-
agent_role: agentRole,
|
|
12121
|
-
session_id: process.env.SESSION_ID ?? "manual",
|
|
12122
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12123
|
-
tool_name: "create_feature_request",
|
|
12124
|
-
project_name: project_name ?? "support",
|
|
12125
|
-
has_error: false,
|
|
12126
|
-
raw_text: markdown,
|
|
12127
|
-
vector,
|
|
12128
|
-
source_path: reportPath,
|
|
12129
|
-
source_type: "feature_request",
|
|
12130
|
-
memory_type: "feature_request",
|
|
12131
|
-
tier: 1,
|
|
12132
|
-
importance: priority === "p0" ? 10 : priority === "p1" ? 9 : priority === "p2" ? 7 : 5,
|
|
12133
|
-
intent: "request",
|
|
12134
|
-
domain: "support",
|
|
12135
|
-
file_paths: null
|
|
12136
12312
|
});
|
|
12137
|
-
|
|
12313
|
+
savedAttachmentPaths.push(...persisted.attachmentPaths);
|
|
12138
12314
|
const upstreamAttachments = attachments?.map((att) => ({
|
|
12139
12315
|
filename: att.filename,
|
|
12140
12316
|
content: att.content,
|
|
@@ -12191,13 +12367,13 @@ Upstream status: ${upstreamStatus}`
|
|
|
12191
12367
|
}
|
|
12192
12368
|
]
|
|
12193
12369
|
};
|
|
12194
|
-
}
|
|
12370
|
+
})
|
|
12195
12371
|
);
|
|
12196
12372
|
}
|
|
12197
12373
|
|
|
12198
12374
|
// src/mcp/tools/update-bug-report.ts
|
|
12199
12375
|
import { z as z90 } from "zod";
|
|
12200
|
-
import { readdir, readFile as readFile2
|
|
12376
|
+
import { readdir, readFile as readFile2 } from "fs/promises";
|
|
12201
12377
|
import path15 from "path";
|
|
12202
12378
|
var STATUS = z90.enum(["open", "triaged", "fixed", "closed", "wontfix"]);
|
|
12203
12379
|
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
@@ -12247,8 +12423,13 @@ async function findReportFile(id) {
|
|
|
12247
12423
|
}
|
|
12248
12424
|
return null;
|
|
12249
12425
|
}
|
|
12250
|
-
async function
|
|
12251
|
-
|
|
12426
|
+
async function buildUpdateSection(filePath, opts) {
|
|
12427
|
+
let existing = "";
|
|
12428
|
+
try {
|
|
12429
|
+
existing = await readFile2(filePath, "utf-8");
|
|
12430
|
+
} catch {
|
|
12431
|
+
existing = "";
|
|
12432
|
+
}
|
|
12252
12433
|
const heading = opts.reopen ? "Reopen Request" : "Status Update";
|
|
12253
12434
|
const updateBlock = [
|
|
12254
12435
|
"",
|
|
@@ -12260,8 +12441,7 @@ async function appendUpdateSection(filePath, opts) {
|
|
|
12260
12441
|
...opts.evidence ? [``, `Evidence: ${opts.evidence}`] : []
|
|
12261
12442
|
].join("\n");
|
|
12262
12443
|
const titleMatch = existing.match(/^# Bug Report — (.+)$/m);
|
|
12263
|
-
|
|
12264
|
-
return titleMatch?.[1] ?? "Unknown bug";
|
|
12444
|
+
return { title: titleMatch?.[1] ?? "Unknown bug", updateBlock };
|
|
12265
12445
|
}
|
|
12266
12446
|
async function sendUpstream(payload, isAdmin) {
|
|
12267
12447
|
const config = await loadConfig();
|
|
@@ -12274,7 +12454,7 @@ async function sendUpstream(payload, isAdmin) {
|
|
|
12274
12454
|
if (!baseEndpoint) return "not_configured";
|
|
12275
12455
|
try {
|
|
12276
12456
|
const base = baseEndpoint.replace(/\/+$/, "");
|
|
12277
|
-
const url = `${base}/${encodeURIComponent(payload.id)}`;
|
|
12457
|
+
const url = `${base}/${encodeURIComponent(sanitizeUpstreamId(payload.id))}`;
|
|
12278
12458
|
const parsed = new URL(url);
|
|
12279
12459
|
if (parsed.protocol !== "https:" && !["localhost", "127.0.0.1", "::1"].includes(parsed.hostname)) {
|
|
12280
12460
|
return "failed: insecure endpoint rejected";
|
|
@@ -12309,12 +12489,12 @@ function registerUpdateBugReport(server) {
|
|
|
12309
12489
|
title: "Update Bug Report",
|
|
12310
12490
|
description: "Update a previously filed bug report. As the filing customer (owner) you can add follow-up notes (notes/add_note), attach additional evidence (add_evidence), and request a reopen on a recurring fixed bug (reopen_request). AskExe support (with an admin token) can also move status: open \u2192 triaged \u2192 fixed \u2192 closed (or wontfix). Updates the local file, POSTs the change to AskExe support, and stores a memory.",
|
|
12311
12491
|
inputSchema: {
|
|
12312
|
-
id:
|
|
12492
|
+
id: supportIdSchema.describe("Bug report UUID (full or 8-char prefix)"),
|
|
12313
12493
|
status: STATUS.optional().describe(
|
|
12314
12494
|
"New status (admin only): open, triaged, fixed, closed, wontfix. Owners cannot set this \u2014 use reopen_request instead."
|
|
12315
12495
|
),
|
|
12316
|
-
fix_version:
|
|
12317
|
-
product:
|
|
12496
|
+
fix_version: supportVersionSchema.optional().describe("Version that fixes this bug (admin only, e.g. '0.9.161')"),
|
|
12497
|
+
product: supportProductSchema.optional().describe("Re-label this bug's product (admin only): exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build, exe-chat, exe-auth, exe-monitor, exe-db, exe-erp"),
|
|
12318
12498
|
notes: z90.string().optional().describe("Follow-up notes about the bug or status change"),
|
|
12319
12499
|
add_note: z90.string().optional().describe("Owner follow-up note (alias of notes)"),
|
|
12320
12500
|
add_evidence: z90.string().optional().describe("Additional evidence: logs, repro details, stack traces"),
|
|
@@ -12323,7 +12503,7 @@ function registerUpdateBugReport(server) {
|
|
|
12323
12503
|
send_upstream: z90.boolean().default(true).describe("POST the change to AskExe support endpoint")
|
|
12324
12504
|
}
|
|
12325
12505
|
},
|
|
12326
|
-
async ({ id, status: status2, fix_version, product, notes, add_note, add_evidence, reopen_request, reopen_reason, send_upstream }) => {
|
|
12506
|
+
async ({ id, status: status2, fix_version, product, notes, add_note, add_evidence, reopen_request, reopen_reason, send_upstream }) => redactedToolResult(async () => {
|
|
12327
12507
|
const { agentId, agentRole } = getActiveAgent();
|
|
12328
12508
|
const config = await loadConfig();
|
|
12329
12509
|
const isAdmin = !!resolveSupportAdminToken(config);
|
|
@@ -12349,67 +12529,69 @@ These do not match \u2014 not updating to avoid mutating the wrong bug. Verify t
|
|
|
12349
12529
|
}
|
|
12350
12530
|
const fullId = resolved?.fullId ?? id;
|
|
12351
12531
|
let localTitle = "Unknown bug";
|
|
12532
|
+
let updateBlock = null;
|
|
12352
12533
|
if (localFile) {
|
|
12353
12534
|
try {
|
|
12354
|
-
|
|
12535
|
+
const built = await buildUpdateSection(localFile, {
|
|
12355
12536
|
status: reopen ? "open" : status2,
|
|
12356
12537
|
notes: followUpNote,
|
|
12357
12538
|
fixVersion: fix_version,
|
|
12358
12539
|
evidence: add_evidence,
|
|
12359
12540
|
reopen
|
|
12360
12541
|
});
|
|
12542
|
+
localTitle = built.title;
|
|
12543
|
+
updateBlock = built.updateBlock;
|
|
12361
12544
|
} catch {
|
|
12362
12545
|
}
|
|
12363
12546
|
}
|
|
12364
12547
|
const changeParts = [];
|
|
12365
12548
|
if (reopen) changeParts.push("reopen requested");
|
|
12366
12549
|
else if (status2) changeParts.push(`marked ${status2}`);
|
|
12367
|
-
if (fix_version) changeParts.push(`fix v${fix_version}`);
|
|
12550
|
+
if (fix_version) changeParts.push(`fix v ${fix_version}`);
|
|
12368
12551
|
if (product) changeParts.push(`product \u2192 ${product}`);
|
|
12369
12552
|
if (add_evidence) changeParts.push("evidence added");
|
|
12370
12553
|
if (followUpNote && !reopen && !status2) changeParts.push("note added");
|
|
12371
12554
|
const change = changeParts.length > 0 ? changeParts.join(", ") : "updated";
|
|
12372
12555
|
const memoryText = `Bug "${localTitle}" (${fullId.slice(0, 8)}) ${change}` + (reopen_reason ? `. Reopen reason: ${reopen_reason}` : "") + (followUpNote ? `. Notes: ${followUpNote}` : "");
|
|
12373
|
-
let vector = null;
|
|
12374
|
-
try {
|
|
12375
|
-
vector = await embed(memoryText);
|
|
12376
|
-
} catch {
|
|
12377
|
-
vector = null;
|
|
12378
|
-
}
|
|
12379
12556
|
const memoryId = `${fullId}-update-${Date.now()}`;
|
|
12380
|
-
await
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
-
|
|
12557
|
+
await persistSupportArtifact({
|
|
12558
|
+
memoryText,
|
|
12559
|
+
file: localFile && updateBlock !== null ? { path: localFile, content: updateBlock, append: true } : void 0,
|
|
12560
|
+
memory: {
|
|
12561
|
+
id: memoryId,
|
|
12562
|
+
agent_id: agentId,
|
|
12563
|
+
agent_role: agentRole,
|
|
12564
|
+
session_id: process.env.SESSION_ID ?? "manual",
|
|
12565
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12566
|
+
tool_name: "update_bug_report",
|
|
12567
|
+
project_name: "support",
|
|
12568
|
+
has_error: false,
|
|
12569
|
+
source_path: localFile ?? null,
|
|
12570
|
+
source_type: "bug_report",
|
|
12571
|
+
memory_type: "bug_report",
|
|
12572
|
+
tier: 1,
|
|
12573
|
+
importance: status2 === "fixed" || status2 === "closed" ? 8 : 6,
|
|
12574
|
+
intent: "update",
|
|
12575
|
+
domain: "support",
|
|
12576
|
+
file_paths: null
|
|
12577
|
+
}
|
|
12399
12578
|
});
|
|
12400
|
-
await flushBatch();
|
|
12401
12579
|
const payload = {
|
|
12402
|
-
|
|
12580
|
+
// Body belt (round 9): even past ingress validation, sanitize the id so a
|
|
12581
|
+
// value from a non-schema caller can't put a raw id in the JSON body.
|
|
12582
|
+
id: sanitizeUpstreamId(fullId),
|
|
12403
12583
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12404
12584
|
agent_id: agentId
|
|
12405
12585
|
};
|
|
12406
12586
|
if (isAdmin) {
|
|
12407
12587
|
if (status2) payload.status = status2;
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
payload.
|
|
12588
|
+
const safeFixVersion = sanitizeVersionField(fix_version);
|
|
12589
|
+
if (safeFixVersion) {
|
|
12590
|
+
payload.fixed_version = safeFixVersion;
|
|
12591
|
+
payload.fix_version = safeFixVersion;
|
|
12411
12592
|
}
|
|
12412
|
-
|
|
12593
|
+
const safeProduct = sanitizeProductFilter(product);
|
|
12594
|
+
if (safeProduct) payload.product = safeProduct;
|
|
12413
12595
|
if (followUpNote) payload.triage_notes = followUpNote;
|
|
12414
12596
|
} else {
|
|
12415
12597
|
if (followUpNote) payload.add_note = followUpNote;
|
|
@@ -12439,13 +12621,13 @@ Upstream status: ${upstreamStatus}`
|
|
|
12439
12621
|
}
|
|
12440
12622
|
]
|
|
12441
12623
|
};
|
|
12442
|
-
}
|
|
12624
|
+
})
|
|
12443
12625
|
);
|
|
12444
12626
|
}
|
|
12445
12627
|
|
|
12446
12628
|
// src/mcp/tools/update-feature-request.ts
|
|
12447
12629
|
import { z as z91 } from "zod";
|
|
12448
|
-
import { readdir as readdir2, readFile as readFile3
|
|
12630
|
+
import { readdir as readdir2, readFile as readFile3 } from "fs/promises";
|
|
12449
12631
|
import path16 from "path";
|
|
12450
12632
|
var STATUS2 = z91.enum(["open", "planned", "in_progress", "shipped", "closed", "wontdo"]);
|
|
12451
12633
|
async function findRequestFile(id) {
|
|
@@ -12459,9 +12641,8 @@ async function findRequestFile(id) {
|
|
|
12459
12641
|
return null;
|
|
12460
12642
|
}
|
|
12461
12643
|
}
|
|
12462
|
-
|
|
12463
|
-
|
|
12464
|
-
const updateBlock = [
|
|
12644
|
+
function buildStatusUpdate(status2, notes, shippedVersion) {
|
|
12645
|
+
return [
|
|
12465
12646
|
"",
|
|
12466
12647
|
`## Status Update \u2014 ${(/* @__PURE__ */ new Date()).toISOString()}`,
|
|
12467
12648
|
"",
|
|
@@ -12469,7 +12650,6 @@ async function appendStatusUpdate(filePath, status2, notes, shippedVersion) {
|
|
|
12469
12650
|
...shippedVersion ? [`shipped_version: ${shippedVersion}`] : [],
|
|
12470
12651
|
...notes ? [``, `${notes}`] : []
|
|
12471
12652
|
].join("\n");
|
|
12472
|
-
await writeFile5(filePath, existing + updateBlock, "utf-8");
|
|
12473
12653
|
}
|
|
12474
12654
|
async function sendUpstream2(payload) {
|
|
12475
12655
|
const config = await loadConfig();
|
|
@@ -12482,7 +12662,7 @@ async function sendUpstream2(payload) {
|
|
|
12482
12662
|
if (!baseEndpoint) return "not_configured";
|
|
12483
12663
|
try {
|
|
12484
12664
|
const base = baseEndpoint.replace(/\/+$/, "");
|
|
12485
|
-
const url = `${base}/${encodeURIComponent(payload.id)}`;
|
|
12665
|
+
const url = `${base}/${encodeURIComponent(sanitizeUpstreamId(payload.id))}`;
|
|
12486
12666
|
const parsed = new URL(url);
|
|
12487
12667
|
if (parsed.protocol !== "https:" && !["localhost", "127.0.0.1", "::1"].includes(parsed.hostname)) {
|
|
12488
12668
|
return "failed: insecure endpoint rejected";
|
|
@@ -12514,59 +12694,59 @@ function registerUpdateFeatureRequest(server) {
|
|
|
12514
12694
|
title: "Update Feature Request",
|
|
12515
12695
|
description: "Update the status of a previously filed feature request. Updates local file, POSTs change to AskExe support, and stores a memory. Status flow: open \u2192 planned \u2192 in_progress \u2192 shipped \u2192 closed (or wontdo at any point).",
|
|
12516
12696
|
inputSchema: {
|
|
12517
|
-
id:
|
|
12697
|
+
id: supportIdSchema.describe("Feature request UUID (full or 8-char prefix)"),
|
|
12518
12698
|
status: STATUS2.describe("New status: open, planned, in_progress, shipped, closed, wontdo"),
|
|
12519
|
-
shipped_version:
|
|
12699
|
+
shipped_version: supportVersionSchema.optional().describe("Version that ships this feature (e.g. '0.9.161')"),
|
|
12520
12700
|
notes: z91.string().optional().describe("Notes about the status change"),
|
|
12521
12701
|
send_upstream: z91.boolean().default(true).describe("POST status change to AskExe support endpoint")
|
|
12522
12702
|
}
|
|
12523
12703
|
},
|
|
12524
|
-
async ({ id, status: status2, shipped_version, notes, send_upstream }) => {
|
|
12704
|
+
async ({ id, status: status2, shipped_version, notes, send_upstream }) => redactedToolResult(async () => {
|
|
12525
12705
|
const { agentId, agentRole } = getActiveAgent();
|
|
12526
12706
|
const localFile = await findRequestFile(id);
|
|
12527
12707
|
let localTitle = "Unknown feature";
|
|
12708
|
+
let updateBlock = null;
|
|
12528
12709
|
if (localFile) {
|
|
12529
12710
|
try {
|
|
12530
12711
|
const content = await readFile3(localFile, "utf-8");
|
|
12531
12712
|
const titleMatch = content.match(/^# Feature Request — (.+)$/m);
|
|
12532
12713
|
if (titleMatch?.[1]) localTitle = titleMatch[1];
|
|
12533
|
-
|
|
12714
|
+
updateBlock = buildStatusUpdate(status2, notes, shipped_version);
|
|
12534
12715
|
} catch {
|
|
12535
12716
|
}
|
|
12536
12717
|
}
|
|
12537
|
-
const memoryText = `Feature "${localTitle}" (${id.slice(0, 8)}) marked ${status2}` + (shipped_version ? ` in v${shipped_version}` : "") + (notes ? `. Notes: ${notes}` : "");
|
|
12538
|
-
let vector = null;
|
|
12539
|
-
try {
|
|
12540
|
-
vector = await embed(memoryText);
|
|
12541
|
-
} catch {
|
|
12542
|
-
vector = null;
|
|
12543
|
-
}
|
|
12718
|
+
const memoryText = `Feature "${localTitle}" (${id.slice(0, 8)}) marked ${status2}` + (shipped_version ? ` in v ${shipped_version}` : "") + (notes ? `. Notes: ${notes}` : "");
|
|
12544
12719
|
const memoryId = `${id}-update-${Date.now()}`;
|
|
12545
|
-
await
|
|
12546
|
-
|
|
12547
|
-
|
|
12548
|
-
|
|
12549
|
-
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
|
|
12555
|
-
|
|
12556
|
-
|
|
12557
|
-
|
|
12558
|
-
|
|
12559
|
-
|
|
12560
|
-
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
|
|
12720
|
+
await persistSupportArtifact({
|
|
12721
|
+
memoryText,
|
|
12722
|
+
file: localFile && updateBlock !== null ? { path: localFile, content: updateBlock, append: true } : void 0,
|
|
12723
|
+
memory: {
|
|
12724
|
+
id: memoryId,
|
|
12725
|
+
agent_id: agentId,
|
|
12726
|
+
agent_role: agentRole,
|
|
12727
|
+
session_id: process.env.SESSION_ID ?? "manual",
|
|
12728
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12729
|
+
tool_name: "update_feature_request",
|
|
12730
|
+
project_name: "support",
|
|
12731
|
+
has_error: false,
|
|
12732
|
+
source_path: localFile ?? null,
|
|
12733
|
+
source_type: "feature_request",
|
|
12734
|
+
memory_type: "feature_request",
|
|
12735
|
+
tier: 1,
|
|
12736
|
+
importance: status2 === "shipped" || status2 === "closed" ? 8 : 6,
|
|
12737
|
+
intent: "update",
|
|
12738
|
+
domain: "support",
|
|
12739
|
+
file_paths: null
|
|
12740
|
+
}
|
|
12564
12741
|
});
|
|
12565
|
-
await flushBatch();
|
|
12566
12742
|
const upstreamStatus = send_upstream ? await sendUpstream2({
|
|
12567
|
-
id
|
|
12743
|
+
// Body belt (round 9): sanitize the id so a non-schema caller can't put
|
|
12744
|
+
// a raw id in the JSON body (the URL is sanitized separately).
|
|
12745
|
+
id: sanitizeUpstreamId(id),
|
|
12568
12746
|
status: status2,
|
|
12569
|
-
|
|
12747
|
+
// Body belt (round 10): shape-validate the version so a schema-bypassing
|
|
12748
|
+
// caller can't put a raw credential-shaped version in the body.
|
|
12749
|
+
shipped_version: sanitizeVersionField(shipped_version),
|
|
12570
12750
|
notes,
|
|
12571
12751
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12572
12752
|
agent_id: agentId
|
|
@@ -12585,7 +12765,7 @@ Upstream status: ${upstreamStatus}`
|
|
|
12585
12765
|
}
|
|
12586
12766
|
]
|
|
12587
12767
|
};
|
|
12588
|
-
}
|
|
12768
|
+
})
|
|
12589
12769
|
);
|
|
12590
12770
|
}
|
|
12591
12771
|
|
|
@@ -13075,7 +13255,7 @@ function registerCliParityTools(server) {
|
|
|
13075
13255
|
const out = await runCommand("exe-os", ["cloud", "status"], 45e3);
|
|
13076
13256
|
let healthSection = "";
|
|
13077
13257
|
try {
|
|
13078
|
-
const { getRetrievalHealth: getRetrievalHealth2, formatDegradations: formatDegradations2 } = await import("./retrieval-health-
|
|
13258
|
+
const { getRetrievalHealth: getRetrievalHealth2, formatDegradations: formatDegradations2 } = await import("./retrieval-health-4Z242P3B.js");
|
|
13079
13259
|
const h = await getRetrievalHealth2();
|
|
13080
13260
|
const lines = [
|
|
13081
13261
|
"",
|
|
@@ -13143,7 +13323,7 @@ function registerCodeContext(server) {
|
|
|
13143
13323
|
const index = buildCodeContextIndex(opts);
|
|
13144
13324
|
let graphExtract;
|
|
13145
13325
|
try {
|
|
13146
|
-
const { autoExtractGraphEntities } = await import("./graph-auto-extract-
|
|
13326
|
+
const { autoExtractGraphEntities } = await import("./graph-auto-extract-OURWMGBS.js");
|
|
13147
13327
|
graphExtract = await autoExtractGraphEntities(opts.projectRoot);
|
|
13148
13328
|
} catch {
|
|
13149
13329
|
}
|
|
@@ -13391,7 +13571,6 @@ import { z as z98 } from "zod";
|
|
|
13391
13571
|
// src/mcp/tools/create-review.ts
|
|
13392
13572
|
import { z as z97 } from "zod";
|
|
13393
13573
|
import crypto6 from "crypto";
|
|
13394
|
-
import { mkdir as mkdir4, writeFile as writeFile6 } from "fs/promises";
|
|
13395
13574
|
import path17 from "path";
|
|
13396
13575
|
var PRIORITY2 = z97.enum(["p0", "p1", "p2", "p3"]);
|
|
13397
13576
|
function slugify3(input) {
|
|
@@ -13467,12 +13646,13 @@ function registerCreateReview(server) {
|
|
|
13467
13646
|
priority: PRIORITY2.default("p1").describe("p0 critical -> p3 low"),
|
|
13468
13647
|
source: z97.string().optional().describe("Source: self-improve, manual, ci, etc."),
|
|
13469
13648
|
pr_url: z97.string().optional().describe("PR URL if applicable"),
|
|
13470
|
-
product:
|
|
13649
|
+
product: supportProductSchema.optional().describe("Product: exe-os (default), exe-create, exe-wiki, exe-gateway, exe-crm, exe-build"),
|
|
13471
13650
|
package_version: z97.string().optional().describe("Installed package version"),
|
|
13472
13651
|
project_name: z97.string().optional().describe("Project/customer context"),
|
|
13473
13652
|
send_upstream: z97.boolean().default(false).describe("Attempt to POST to configured AskExe support endpoint (disabled by default \u2014 review route not yet live)")
|
|
13474
13653
|
}
|
|
13475
13654
|
},
|
|
13655
|
+
// Structural sink guard (round 6): deep-redact the whole return object + errors.
|
|
13476
13656
|
async ({
|
|
13477
13657
|
title,
|
|
13478
13658
|
description,
|
|
@@ -13483,11 +13663,11 @@ function registerCreateReview(server) {
|
|
|
13483
13663
|
package_version,
|
|
13484
13664
|
project_name,
|
|
13485
13665
|
send_upstream
|
|
13486
|
-
}) => {
|
|
13666
|
+
}) => redactedToolResult(async () => {
|
|
13487
13667
|
const { agentId, agentRole } = getActiveAgent();
|
|
13488
13668
|
const id = crypto6.randomUUID();
|
|
13489
13669
|
const resolvedProduct = product ?? "exe-os";
|
|
13490
|
-
const version = package_version ?? "unknown";
|
|
13670
|
+
const version = sanitizeVersionField(package_version) ?? "unknown";
|
|
13491
13671
|
const markdown = buildMarkdown3({
|
|
13492
13672
|
id,
|
|
13493
13673
|
title,
|
|
@@ -13502,36 +13682,29 @@ function registerCreateReview(server) {
|
|
|
13502
13682
|
projectName: project_name
|
|
13503
13683
|
});
|
|
13504
13684
|
const outDir = path17.join(EXE_AI_DIR, "reviews");
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13510
|
-
|
|
13511
|
-
|
|
13512
|
-
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
-
|
|
13518
|
-
|
|
13519
|
-
|
|
13520
|
-
|
|
13521
|
-
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
|
|
13525
|
-
|
|
13526
|
-
|
|
13527
|
-
memory_type: "review",
|
|
13528
|
-
tier: 1,
|
|
13529
|
-
importance: priority === "p0" ? 10 : priority === "p1" ? 9 : priority === "p2" ? 7 : 5,
|
|
13530
|
-
intent: "review",
|
|
13531
|
-
domain: "support",
|
|
13532
|
-
file_paths: null
|
|
13685
|
+
const reportPath = path17.join(outDir, `${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}-${slugify3(redactSecrets(title).text)}-${id.slice(0, 8)}.md`);
|
|
13686
|
+
await persistSupportArtifact({
|
|
13687
|
+
memoryText: markdown,
|
|
13688
|
+
file: { path: reportPath, content: markdown },
|
|
13689
|
+
memory: {
|
|
13690
|
+
id,
|
|
13691
|
+
agent_id: agentId,
|
|
13692
|
+
agent_role: agentRole,
|
|
13693
|
+
session_id: process.env.SESSION_ID ?? "manual",
|
|
13694
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
13695
|
+
tool_name: "create_review",
|
|
13696
|
+
project_name: project_name ?? "support",
|
|
13697
|
+
has_error: false,
|
|
13698
|
+
source_path: reportPath,
|
|
13699
|
+
source_type: "review",
|
|
13700
|
+
memory_type: "review",
|
|
13701
|
+
tier: 1,
|
|
13702
|
+
importance: priority === "p0" ? 10 : priority === "p1" ? 9 : priority === "p2" ? 7 : 5,
|
|
13703
|
+
intent: "review",
|
|
13704
|
+
domain: "support",
|
|
13705
|
+
file_paths: null
|
|
13706
|
+
}
|
|
13533
13707
|
});
|
|
13534
|
-
await flushBatch();
|
|
13535
13708
|
const upstreamPayload = {
|
|
13536
13709
|
id,
|
|
13537
13710
|
title,
|
|
@@ -13564,7 +13737,7 @@ Upstream status: ${upstreamStatus}`
|
|
|
13564
13737
|
}
|
|
13565
13738
|
]
|
|
13566
13739
|
};
|
|
13567
|
-
}
|
|
13740
|
+
})
|
|
13568
13741
|
);
|
|
13569
13742
|
}
|
|
13570
13743
|
|
|
@@ -13624,7 +13797,7 @@ function registerSupportConsolidated(server) {
|
|
|
13624
13797
|
"support",
|
|
13625
13798
|
{
|
|
13626
13799
|
title: "Support",
|
|
13627
|
-
description: "Bug reports, feature requests, reviews, and support system. Actions: create_bug, create_feature, create_review, update_bug, update_feature, list_my_bugs, list_my_features, list_my_reviews, list_bugs, get_bug, add_comment, get_comments, triage_bug, list_features, get_feature, triage_feature, list_reviews, get_review, triage_review, health, test. Use 'product' param to file bugs for any AskExe product.",
|
|
13800
|
+
description: "Bug reports, feature requests, reviews, and support system. Actions: create_bug, create_feature, create_review, update_bug, update_feature, list_my_bugs, list_my_features, list_my_reviews, list_bugs, get_bug, add_comment, get_comments, triage_bug, list_features, get_feature, triage_feature, list_reviews, get_review, triage_review, health, test. Use 'product' param to file/route bugs AND feature requests for any AskExe product.",
|
|
13628
13801
|
inputSchema: {
|
|
13629
13802
|
action: z98.enum([
|
|
13630
13803
|
"create_bug",
|
|
@@ -13654,23 +13827,51 @@ function registerSupportConsolidated(server) {
|
|
|
13654
13827
|
steps_to_reproduce: z98.string().optional().describe("Steps to reproduce (bugs)"),
|
|
13655
13828
|
expected_behavior: z98.string().optional().describe("Expected behavior (bugs)"),
|
|
13656
13829
|
actual_behavior: z98.string().optional().describe("Actual behavior (bugs)"),
|
|
13657
|
-
|
|
13658
|
-
|
|
13830
|
+
// Round 10: these are ENUM fields — on list actions they reach the vendor URL
|
|
13831
|
+
// query, and on triage/create the body. Constrained to the UNION of valid values
|
|
13832
|
+
// across bug/feature/review actions so a non-enum value is rejected at ingress.
|
|
13833
|
+
severity: z98.enum(["p0", "p1", "p2", "p3"]).optional().describe("Severity: p0/p1/p2/p3"),
|
|
13834
|
+
// bug b8e990ed: product works for BOTH bugs and features (create default exe-os;
|
|
13835
|
+
// list_bugs/list_features filter; triage_bug/triage_feature admin re-label).
|
|
13836
|
+
// Kept on the strict ingress schema (round 10) rather than a loose string.
|
|
13837
|
+
product: supportProductSchema.optional().describe("Product \u2014 works for BOTH bugs and features (create default exe-os; list_bugs/list_features filter; triage_bug/triage_feature admin re-label): exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build, exe-chat, exe-auth, exe-monitor, exe-db, exe-erp"),
|
|
13659
13838
|
use_case: z98.string().optional().describe("Use case (features)"),
|
|
13660
13839
|
proposed_solution: z98.string().optional().describe("Proposed solution (features)"),
|
|
13661
|
-
priority: z98.
|
|
13840
|
+
priority: z98.enum(["p0", "p1", "p2", "p3"]).optional().describe("Priority (features)"),
|
|
13662
13841
|
on_behalf_of_email: z98.string().email().optional().describe("ADMIN ONLY: file this request owned by another customer's license email; ignored unless caller holds the support admin token (create_bug/create_feature)"),
|
|
13663
|
-
|
|
13842
|
+
// Round 10: constrained fields are shape-validated at ingress (this is the
|
|
13843
|
+
// DEFAULT surface and calls handlers directly, bypassing their per-tool schemas).
|
|
13844
|
+
id: supportIdSchema.optional().describe("Bug/feature ID for get/triage/add_comment/get_comments"),
|
|
13664
13845
|
comment: z98.string().optional().describe("Comment text to append to a bug report thread (add_comment)"),
|
|
13665
|
-
status: z98.
|
|
13666
|
-
|
|
13846
|
+
status: z98.enum([
|
|
13847
|
+
"all",
|
|
13848
|
+
"open",
|
|
13849
|
+
"triaged",
|
|
13850
|
+
"fixed",
|
|
13851
|
+
"closed",
|
|
13852
|
+
"wontfix",
|
|
13853
|
+
"planned",
|
|
13854
|
+
"in_progress",
|
|
13855
|
+
"shipped",
|
|
13856
|
+
"wontdo",
|
|
13857
|
+
"in_review",
|
|
13858
|
+
"approved",
|
|
13859
|
+
"merged",
|
|
13860
|
+
"rejected"
|
|
13861
|
+
]).optional().describe("Filter by status (union across bug/feature/review)"),
|
|
13862
|
+
classification: z98.enum([
|
|
13863
|
+
"upstream_bug",
|
|
13864
|
+
"customer_customization",
|
|
13865
|
+
"emergency_hotfix",
|
|
13866
|
+
"unclear"
|
|
13867
|
+
]).optional().describe("Triage classification"),
|
|
13667
13868
|
resolution: z98.string().optional().describe("Triage resolution"),
|
|
13668
13869
|
notes: z98.string().optional().describe("Triage notes (mapped to triage_notes for bug/feature triage)"),
|
|
13669
13870
|
triage_notes: z98.string().optional().describe("Triage notes (legacy field name)"),
|
|
13670
|
-
linked_task_id:
|
|
13671
|
-
linked_commit:
|
|
13672
|
-
fixed_version:
|
|
13673
|
-
shipped_version:
|
|
13871
|
+
linked_task_id: supportTaskIdSchema.optional().describe("Linked task ID for triage"),
|
|
13872
|
+
linked_commit: supportCommitSchema.optional().describe("Linked commit hash for triage"),
|
|
13873
|
+
fixed_version: supportVersionSchema.optional().describe("Version that fixes this bug"),
|
|
13874
|
+
shipped_version: supportVersionSchema.optional().describe("Version that ships this feature (features only)"),
|
|
13674
13875
|
add_evidence: z98.string().optional().describe("Owner self-service: additional evidence (logs, repro, stack traces) for update_bug"),
|
|
13675
13876
|
reopen_request: z98.boolean().optional().describe("Owner self-service: request a reopen on a recurring fixed bug (update_bug)"),
|
|
13676
13877
|
reopen_reason: z98.string().optional().describe("Owner self-service: why the bug should be reopened (update_bug)"),
|
|
@@ -13681,8 +13882,8 @@ function registerSupportConsolidated(server) {
|
|
|
13681
13882
|
source: z98.string().optional().describe("Review source: self-improve, manual, ci"),
|
|
13682
13883
|
pr_url: z98.string().optional().describe("PR URL (reviews)"),
|
|
13683
13884
|
review_resolution: z98.string().optional().describe("Resolution text (reviews)"),
|
|
13684
|
-
limit: z98.coerce.number().optional().describe("Max results per page (up to 500)"),
|
|
13685
|
-
offset: z98.coerce.number().optional().describe("Number of results to skip for pagination (list_my_bugs
|
|
13885
|
+
limit: z98.coerce.number().int().min(1).max(500).optional().describe("Max results per page (up to 500)"),
|
|
13886
|
+
offset: z98.coerce.number().int().min(0).optional().describe("Number of results to skip for pagination (list_bugs, list_features, list_reviews, list_my_bugs, list_my_features). Use next_offset from a prior response.")
|
|
13686
13887
|
}
|
|
13687
13888
|
},
|
|
13688
13889
|
async (input, extra) => {
|
|
@@ -13782,12 +13983,12 @@ function buildHandlers9() {
|
|
|
13782
13983
|
function registerDiagnostics(server) {
|
|
13783
13984
|
const handlers = buildHandlers9();
|
|
13784
13985
|
const toolNames = Array.from(handlers.keys());
|
|
13785
|
-
toolNames.push("tool_search", "drift", "merge_agent_memories", "agent_liveness", "steward_check", "steward_audit_log", "steward_override", "daemon_restarts", "spawn_failures", "orchestration_health", "work_map");
|
|
13986
|
+
toolNames.push("tool_search", "drift", "merge_agent_memories", "agent_liveness", "steward_check", "steward_audit_log", "steward_override", "daemon_restarts", "timers", "spawn_failures", "orchestration_health", "work_map");
|
|
13786
13987
|
server.registerTool(
|
|
13787
13988
|
"diagnostics",
|
|
13788
13989
|
{
|
|
13789
13990
|
title: "Diagnostics",
|
|
13790
|
-
description: `System diagnostics and admin operations. Actions: ${toolNames.join(", ")}. Covers health checks, update status, cloud status, key management, employee rename, semantic tool discovery (tool_search), identity drift detection (drift), agent liveness monitoring (agent_liveness), agent memory reassignment (merge_agent_memories), steward identity gate (steward_check, steward_audit_log, steward_override), daemon restart forensics (daemon_restarts \u2014 'why did the daemon restart?': restart-cause breakdown, slowest-timer leaderboard, event-loop-block frequency), and orchestration-health visibility: spawn_failures ('why did dispatch fail?': tmux spawn fail count + cause breakdown path_not_found/claude_launch_failed/timeout + success-vs-fail ratio), orchestration_health ('is the box healthy / is the spiral happening?': load/core, event-loop lag, direct-SQLite-fallback count, event-loop blocks), and work_map ('who's doing what / who died and why?': live sessions \xD7 role \xD7 task \xD7 worktree flag, plus recent session deaths with cause/load + worktree violations).`,
|
|
13991
|
+
description: `System diagnostics and admin operations. Actions: ${toolNames.join(", ")}. Covers health checks, update status, cloud status, key management, employee rename, semantic tool discovery (tool_search), identity drift detection (drift), agent liveness monitoring (agent_liveness), agent memory reassignment (merge_agent_memories), steward identity gate (steward_check, steward_audit_log, steward_override), daemon restart forensics (daemon_restarts \u2014 'why did the daemon restart?': restart-cause breakdown, slowest-timer leaderboard, event-loop-block frequency), timer health dashboard (timers \u2014 'which background timer is about to take the daemon down?': per-timer last/avg/p95/max tick duration, watchdog trips past the 10s event-loop-block budget, whether the timer is executing right now, projected next fire \u2014 sorted worst-first; read-only over already-emitted daemon health logs), and orchestration-health visibility: spawn_failures ('why did dispatch fail?': tmux spawn fail count + cause breakdown path_not_found/claude_launch_failed/timeout + success-vs-fail ratio), orchestration_health ('is the box healthy / is the spiral happening?': load/core, event-loop lag, direct-SQLite-fallback count, event-loop blocks), and work_map ('who's doing what / who died and why?': live sessions \xD7 role \xD7 task \xD7 worktree flag, plus recent session deaths with cause/load + worktree violations).`,
|
|
13791
13992
|
inputSchema: {
|
|
13792
13993
|
action: z99.string().describe(`Diagnostic operation: ${toolNames.join(", ")}`),
|
|
13793
13994
|
// Pass-through params used by various sub-tools
|
|
@@ -13836,6 +14037,21 @@ function registerDiagnostics(server) {
|
|
|
13836
14037
|
return { content: [{ type: "text", text: `daemon_restarts failed: ${err instanceof Error ? err.message : String(err)}` }], isError: true };
|
|
13837
14038
|
}
|
|
13838
14039
|
}
|
|
14040
|
+
if (action === "timers") {
|
|
14041
|
+
try {
|
|
14042
|
+
const { buildLiveTimerReport, formatTimerReport } = await import("./daemon-timer-report-NM44WQRH.js");
|
|
14043
|
+
const report = await buildLiveTimerReport();
|
|
14044
|
+
const asJson = input.format === "json";
|
|
14045
|
+
return {
|
|
14046
|
+
content: [{
|
|
14047
|
+
type: "text",
|
|
14048
|
+
text: asJson ? JSON.stringify(report, null, 2) : formatTimerReport(report)
|
|
14049
|
+
}]
|
|
14050
|
+
};
|
|
14051
|
+
} catch (err) {
|
|
14052
|
+
return { content: [{ type: "text", text: `timers failed: ${err instanceof Error ? err.message : String(err)}` }], isError: true };
|
|
14053
|
+
}
|
|
14054
|
+
}
|
|
13839
14055
|
if (action === "spawn_failures") {
|
|
13840
14056
|
return handleSpawnFailures();
|
|
13841
14057
|
}
|
|
@@ -13968,7 +14184,7 @@ async function handleMergeAgentMemories(input) {
|
|
|
13968
14184
|
}
|
|
13969
14185
|
async function handleSpawnFailures() {
|
|
13970
14186
|
try {
|
|
13971
|
-
const { getOrchestrationMetrics } = await import("./orchestration-events-
|
|
14187
|
+
const { getOrchestrationMetrics } = await import("./orchestration-events-WV4NWKZH.js");
|
|
13972
14188
|
const metrics = await getOrchestrationMetrics();
|
|
13973
14189
|
const c = metrics.counts;
|
|
13974
14190
|
const attempted = c.tmuxSpawnAttempted;
|
|
@@ -14070,7 +14286,7 @@ async function handleOrchestrationHealth() {
|
|
|
14070
14286
|
async function handleWorkMap() {
|
|
14071
14287
|
try {
|
|
14072
14288
|
const { getAgentLivenessReport } = await import("./agent-heartbeat-I5UPGXAU.js");
|
|
14073
|
-
const { classifyRole } = await import("./session-kill-telemetry-
|
|
14289
|
+
const { classifyRole } = await import("./session-kill-telemetry-AELE4JDK.js");
|
|
14074
14290
|
const { buildSessionDeathSummary } = await import("./orchestration-health-read-EJWVUARG.js");
|
|
14075
14291
|
const { getPaneCwd } = await import("./lib/tmux-status.js");
|
|
14076
14292
|
const live = getAgentLivenessReport();
|
|
@@ -14205,7 +14421,7 @@ async function handleDrift(input) {
|
|
|
14205
14421
|
}
|
|
14206
14422
|
async function handleSteward(action, input) {
|
|
14207
14423
|
const gate = new StewardGate();
|
|
14208
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
14424
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-PVGE57FY.js");
|
|
14209
14425
|
const inputAgent = input.agent_id;
|
|
14210
14426
|
const operation = input.operation;
|
|
14211
14427
|
const target = input.target;
|
|
@@ -14503,7 +14719,7 @@ function registerResonance(server) {
|
|
|
14503
14719
|
}
|
|
14504
14720
|
}, async ({ action, memory_id, entity_id, limit }) => {
|
|
14505
14721
|
try {
|
|
14506
|
-
const { getHotPairs, getCoActivationNeighbors } = await import("./co-activation-
|
|
14722
|
+
const { getHotPairs, getCoActivationNeighbors } = await import("./co-activation-ZCHPLLP6.js");
|
|
14507
14723
|
if (action === "hot_pairs") {
|
|
14508
14724
|
const pairs = await getHotPairs(limit ?? 20);
|
|
14509
14725
|
if (pairs.length === 0) return text4("No co-activation data yet. Pairs are recorded as memories are accessed together in searches.");
|
|
@@ -14917,7 +15133,7 @@ ${err.stack ?? ""}` : String(err);
|
|
|
14917
15133
|
gate("registerSupportTools", registerSupportTools);
|
|
14918
15134
|
const hasAdminToken = !!(process.env.ASKEXE_SUPPORT_ADMIN_TOKEN || process.env.EXE_SUPPORT_ADMIN_TOKEN || (() => {
|
|
14919
15135
|
try {
|
|
14920
|
-
const c = JSON.parse(readFileSync7(join4(process.env.EXE_OS_DIR ?? join4(
|
|
15136
|
+
const c = JSON.parse(readFileSync7(join4(process.env.EXE_OS_DIR ?? join4(homedir5(), ".exe-os"), "config.json"), "utf-8"));
|
|
14921
15137
|
return c.support?.adminToken || c.support?.admin_token;
|
|
14922
15138
|
} catch {
|
|
14923
15139
|
return "";
|