@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
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
// src/lib/secret-redaction.ts
|
|
2
|
+
import { validateMnemonic, wordlists } from "bip39";
|
|
3
|
+
var URL_CREDENTIAL_PATTERNS = /* @__PURE__ */ new Set(["url_credentials"]);
|
|
4
|
+
var SECRET_PATTERNS = [
|
|
5
|
+
// Any credentialed URL: scheme://user:pass@host. Generalized from the old
|
|
6
|
+
// postgres/mysql/mongodb/redis-only pattern so it also covers HTTP basic-auth
|
|
7
|
+
// (https://user:pass@host) and every other DB scheme (mssql, clickhouse, amqp,
|
|
8
|
+
// mongodb+srv, jdbc:*, ssh, …). Password is redacted; scheme+user preserved.
|
|
9
|
+
//
|
|
10
|
+
// The password class is `[^@\s]+` (NOT `[^@\s/]+`): real passwords frequently
|
|
11
|
+
// contain `/` (and `+`, `=`, percent-encodes), and per RFC 3986 userinfo runs
|
|
12
|
+
// up to the FIRST `@`, so stopping the password at `/` MISSED any password with
|
|
13
|
+
// a slash (e.g. `postgres://u:pa/ss@h` leaked `pa/ss`). Ending the class at `@`
|
|
14
|
+
// preserves the host/path (match stops at `@`; everything after is untouched).
|
|
15
|
+
// A `jdbc:postgresql://u:p@h` matches on the inner `postgresql://…` (the `\b`
|
|
16
|
+
// before `postgresql` after the `:`), and an IPv6 host `…@[::1]:5432` is after
|
|
17
|
+
// the `@` so it is preserved. See the url edge-case test rows.
|
|
18
|
+
//
|
|
19
|
+
// ReDoS: EVERY quantifier here is BOUNDED, never `*`/`+`. Two distinct O(n²)
|
|
20
|
+
// traps, both closed by caps:
|
|
21
|
+
// (1) scheme `{0,30}` — with `*` and `-` in the class, hyphen-rich input
|
|
22
|
+
// (`sk-sk-sk-…`) re-anchors at every word boundary and each start
|
|
23
|
+
// greedily scans to EOF before failing to find `://`.
|
|
24
|
+
// (2) userinfo `{1,64}` / `{1,1024}` — the password `[^@\s]` runs to the next
|
|
25
|
+
// `@` or whitespace; adversarial `a://u:a://u:…` (no `@`, no space) made
|
|
26
|
+
// each of the O(n) candidate URL starts scan+backtrack over the password
|
|
27
|
+
// looking for `@` (measured 1212ms at 80 KB — textbook O(n²)). The cap
|
|
28
|
+
// bounds each start's scan. It is 1024 (WIDENED from 256): a 256-cap MISSED
|
|
29
|
+
// any credentialed URL whose password exceeded 256 chars — a long
|
|
30
|
+
// token-as-password (a JWT or opaque bearer used as the userinfo password,
|
|
31
|
+
// 200–800+ chars) leaked ENTIRELY, since the rule failed to find `@` within
|
|
32
|
+
// 256 chars and gave up. 1024 covers every realistic password (incl. JWTs)
|
|
33
|
+
// while keeping the `a://u:` ReDoS case comfortably under the time bound
|
|
34
|
+
// (4096 measured ~1.1s — too slow; 1024 is ~1/4 of that, well within
|
|
35
|
+
// margin). RESIDUAL (documented, accepted): a URL password LONGER than 1024
|
|
36
|
+
// chars is not matched here — but that is beyond any realistic credential,
|
|
37
|
+
// and a long password of a KNOWN shape (JWT, sk-…, etc.) is still caught by
|
|
38
|
+
// its own rule independently. A miss is unrecoverable; we widen as far as
|
|
39
|
+
// the ReDoS budget safely allows.
|
|
40
|
+
{ name: "url_credentials", pattern: /\b([a-z][a-z0-9+.-]{0,30}):\/\/([^:\s/@]{1,64}):([^@\s]{1,1024})@/gi },
|
|
41
|
+
// Private-key PEM blocks. ENCRYPTED added — the old enum listed only the
|
|
42
|
+
// unencrypted variants so `-----BEGIN ENCRYPTED PRIVATE KEY-----` leaked.
|
|
43
|
+
//
|
|
44
|
+
// ReDoS: the body is BOUNDED `{0,8192}?`, not `*?`. With `*?`, many truncated
|
|
45
|
+
// `-----BEGIN … PRIVATE KEY-----` headers with NO matching `-----END` (a
|
|
46
|
+
// realistic pasted log) make the lazy scan rescan the tail from every BEGIN —
|
|
47
|
+
// O(n²), which becomes a multi-second hang on a large attachment. 8192 chars
|
|
48
|
+
// comfortably covers a real key body (RSA-4096 base64 ≈ 3.2 KB, incl. encrypted
|
|
49
|
+
// PKCS#8 headers), so each BEGIN gives up after ≤8 KB and the pass stays linear.
|
|
50
|
+
// PEM private-key block — ANY label (bug b4fc4a73 round 3, merged from
|
|
51
|
+
// fix/security-validation-20260711). Two deliberate widenings over the old
|
|
52
|
+
// fixed-alternation / 8 KiB form:
|
|
53
|
+
// - LABEL: `[A-Z0-9 ]*PRIVATE KEY[A-Z ]*` admits plain PKCS8, ENCRYPTED, and
|
|
54
|
+
// the PGP `PRIVATE KEY BLOCK` suffix. The old closed alternation missed any
|
|
55
|
+
// label it did not enumerate — a miss here is a raw key shipped upstream.
|
|
56
|
+
// - CAP 8192 -> 65536 (64 KiB): the body cap is what keeps this LINEAR (an
|
|
57
|
+
// unbounded lazy body let repeated *unterminated* BEGIN headers rescan to
|
|
58
|
+
// end-of-input, 6ms -> 572ms). But an 8 KiB cap is SMALLER than a
|
|
59
|
+
// realistically-large key (RSA-16384, a bundled cert chain), so such a key
|
|
60
|
+
// overran the window and LEAKED. 64 KiB covers them and is still linear.
|
|
61
|
+
{ name: "private_key", pattern: /-----BEGIN [A-Z0-9 ]*PRIVATE KEY[A-Z ]*-----[\s\S]{0,65536}?-----END [A-Z0-9 ]*PRIVATE KEY[A-Z ]*-----/g, requires: "-----END" },
|
|
62
|
+
{ name: "exe_license_key", pattern: /\bexe_sk_[A-Za-z0-9_-]{8,}\b/g },
|
|
63
|
+
{ name: "anthropic_key", pattern: /\bsk-ant-[A-Za-z0-9_-]{20,}\b/g },
|
|
64
|
+
// OpenAI keys. FALSE-POSITIVE GUARD — done STRUCTURALLY, not by asserting the
|
|
65
|
+
// body contains any particular character class.
|
|
66
|
+
//
|
|
67
|
+
// Rejected approach (previous revision): requiring the body to contain an
|
|
68
|
+
// uppercase AND a digit. There is no published format contract guaranteeing
|
|
69
|
+
// that, so a short/unlucky all-lowercase-and-digits body would be MISSED — and
|
|
70
|
+
// for a last-line egress redactor a miss (a live key shipped upstream, silent
|
|
71
|
+
// and unrecoverable) is far worse than a false positive (a mangled bug report,
|
|
72
|
+
// visible and recoverable). We must never trade a miss for an FP.
|
|
73
|
+
//
|
|
74
|
+
// Structural discriminator (strategy A: length + charset):
|
|
75
|
+
// - TYPED form — `sk-proj-`/`sk-svcacct-`/`sk-admin-` are unambiguous OpenAI
|
|
76
|
+
// prefixes; match their long body regardless of its character mix.
|
|
77
|
+
// - LEGACY bare `sk-` form — a real legacy key is `sk-` + a 40+ char base62
|
|
78
|
+
// body with NO hyphens/underscores. A kebab identifier
|
|
79
|
+
// (`sk-loading-spinner-container`) breaks at its first `-` (7 chars < 40)
|
|
80
|
+
// so it cannot match, while an all-lowercase-and-digits real key
|
|
81
|
+
// (`sk-abcdef0123…`, 40+ alnum) still does. This discriminates on
|
|
82
|
+
// STRUCTURE (hyphen-free 40+ base62 run) — no assertion about which
|
|
83
|
+
// character classes the body must contain — so the miss is closed.
|
|
84
|
+
{ name: "openai_key", pattern: /\bsk-(?:proj|svcacct|admin)-[A-Za-z0-9_-]{20,}\b/g },
|
|
85
|
+
{ name: "openai_key", pattern: /\bsk-[A-Za-z0-9]{40,}\b/g },
|
|
86
|
+
// Stripe secret + restricted keys (live and test are both secret).
|
|
87
|
+
{ name: "stripe_key", pattern: /\b[sr]k_(?:live|test)_[A-Za-z0-9]{16,}\b/g },
|
|
88
|
+
// Slack bot/user/app tokens.
|
|
89
|
+
// No TRAILING \b (merged from fix/security-validation-20260711): a token whose
|
|
90
|
+
// last char is `-` has no word boundary before a following non-word char, so a
|
|
91
|
+
// trailing \b MISSED it. The leading \b + the b/a/p/r/s discriminator still keep
|
|
92
|
+
// ordinary "xox…" prose from matching.
|
|
93
|
+
{ name: "slack_token", pattern: /\b(?:xox[baprs]|xapp)-[A-Za-z0-9-]{10,}/g },
|
|
94
|
+
// Slack incoming-webhook URL — the full path is the secret (no user:pass@, so
|
|
95
|
+
// url_credentials does not cover it).
|
|
96
|
+
{ name: "slack_webhook", pattern: /\bhttps:\/\/hooks\.slack\.com\/services\/T[A-Z0-9]+\/B[A-Z0-9]+\/[A-Za-z0-9]+/g },
|
|
97
|
+
// npm automation/publish token: `npm_` + 36 base62.
|
|
98
|
+
{ name: "npm_token", pattern: /\bnpm_[A-Za-z0-9]{36}\b/g },
|
|
99
|
+
// Google API key (AIza…, 39 chars) and OAuth access token (ya29.…).
|
|
100
|
+
// Negative lookahead, NOT a trailing \b (merged from
|
|
101
|
+
// fix/security-validation-20260711): a key ending in `-` or `_` has no word
|
|
102
|
+
// boundary before a following non-word char, so \b missed exactly those.
|
|
103
|
+
{ name: "google_api_key", pattern: /\bAIza[0-9A-Za-z_-]{35}(?![A-Za-z0-9_-])/g },
|
|
104
|
+
{ name: "google_oauth_token", pattern: /\bya29\.[0-9A-Za-z_-]{20,}\b/g },
|
|
105
|
+
// GitHub tokens: classic (ghp_/gho_/ghs_/ghu_/ghr_) + fine-grained (github_pat_).
|
|
106
|
+
{ name: "github_token", pattern: /\bgh[pousr]_[A-Za-z0-9_]{30,}\b/g },
|
|
107
|
+
{ name: "github_pat", pattern: /\bgithub_pat_[A-Za-z0-9_]{20,}\b/g },
|
|
108
|
+
// AWS secret access key (the 40-char base64 secret, no distinguishing prefix).
|
|
109
|
+
// HIGH FALSE-POSITIVE CLASS: a bare 40-char base64-ish string also describes a
|
|
110
|
+
// git SHA (40 hex) and countless hashes/ids, so we NEVER blanket-redact one.
|
|
111
|
+
// We redact it in only two safe, high-signal contexts:
|
|
112
|
+
// (1) LABELED — right after a `secret[-_]access[-_]key` label. The `aws`
|
|
113
|
+
// prefix is OPTIONAL and the word-joiner is `[_-]?`, so this matches the
|
|
114
|
+
// snake/UPPER env form (`AWS_SECRET_ACCESS_KEY=…`), the camelCase SDK/JSON
|
|
115
|
+
// form (`"secretAccessKey":"…"` — an AWS SDK error body), AND the
|
|
116
|
+
// positional CLI flag (`--secret-access-key <secret>`, no `=`). The `/i`
|
|
117
|
+
// flag makes `secretAccessKey` match `secret[_-]?access[_-]?key`.
|
|
118
|
+
// (2) PROXIMITY — within 120 chars of a raw AWS access-key id (AKIA/ASIA…).
|
|
119
|
+
// This runs BEFORE the access-key-id patterns so the anchor is intact;
|
|
120
|
+
// it preserves the id + gap and redacts ONLY the trailing secret, so the
|
|
121
|
+
// id is still redacted afterward by `aws_access_key`/`aws_temp_access_key`.
|
|
122
|
+
// RESIDUAL (accepted): a BARE, unlabeled 40-char secret with no access-key id
|
|
123
|
+
// within 120 chars is NOT redacted — it is indistinguishable from a git SHA /
|
|
124
|
+
// hash / opaque id, and blanket-redacting every 40-char token would mangle
|
|
125
|
+
// ordinary bug reports. Likelihood of this exact shape leaking is LOW-TO-MEDIUM
|
|
126
|
+
// (not nil): it needs an unlabeled secret pasted alone. The negative table pins
|
|
127
|
+
// that a git SHA is left untouched so the trade-off is visible.
|
|
128
|
+
// LABELED form. Word-joiner is `[_ -]?` — it MUST admit a literal SPACE, so the
|
|
129
|
+
// human/UI form ("AWS Secret Access Key: …") is caught, not just the snake/env
|
|
130
|
+
// form (merged from fix/security-validation-20260711; HEAD's `[_-]?` MISSED the
|
|
131
|
+
// spaced label = a live-credential leak). Body charset includes `=` so a
|
|
132
|
+
// base64-padded 40-char secret matches; the lookbehind/lookahead keep it from
|
|
133
|
+
// biting into an adjacent longer token.
|
|
134
|
+
{ name: "aws_secret_access_key", pattern: /\b(?:aws[_ -]?)?secret[_ -]?access[_ -]?key\b["'\s:=,]{1,5}["']?(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])/gi },
|
|
135
|
+
{ name: "aws_secret_access_key", pattern: /((?:AKIA|ASIA)[0-9A-Z]{16}[\s\S]{0,120}?)(?<![A-Za-z0-9/+])([A-Za-z0-9/+]{40})(?![A-Za-z0-9/+])/g },
|
|
136
|
+
// AWS access-key ids: ASIA = temporary STS creds; AKIA = long-lived.
|
|
137
|
+
{ name: "aws_temp_access_key", pattern: /\bASIA[0-9A-Z]{16}\b/g },
|
|
138
|
+
{ name: "aws_access_key", pattern: /\bAKIA[0-9A-Z]{16}\b/g },
|
|
139
|
+
// Azure Storage account key: `AccountKey=<base64>` inside a connection string
|
|
140
|
+
// (`DefaultEndpointsProtocol=…;AccountName=…;AccountKey=<88-char base64>==;…`).
|
|
141
|
+
// Real keys are 64 bytes → 88 base64 chars incl. `==` padding; {40,} is a safe
|
|
142
|
+
// floor. Not matched by any other rule.
|
|
143
|
+
{ name: "azure_storage_key", pattern: /\bAccountKey=[A-Za-z0-9+/]{40,}={0,2}/g },
|
|
144
|
+
{ name: "bearer_token", pattern: /\bBearer\s+[A-Za-z0-9._~+/=-]{20,}\b/gi },
|
|
145
|
+
{ name: "jwt", pattern: /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g },
|
|
146
|
+
// Generic catch-alls run LAST. The `(?!\[REDACTED:)` guard makes them refuse to
|
|
147
|
+
// re-enter an already-emitted `[REDACTED:name]` marker: without it,
|
|
148
|
+
// `OPENAI_API_KEY=sk-proj-…` first became `OPENAI_API_KEY=[REDACTED:openai_key]`
|
|
149
|
+
// and then env_secret re-matched the whole assignment, OVER-COUNTING and
|
|
150
|
+
// rewriting the specific marker to the generic one. With the guard the specific
|
|
151
|
+
// marker survives and redactedCount counts each secret exactly once.
|
|
152
|
+
{ name: "assignment_secret", pattern: /\b(api[_-]?key|secret|token|password|passwd|pwd|private[_-]?key|access[_-]?key)\s*[:=]\s*(['\"]?)(?!\[REDACTED:)[^\s'"]{8,}\2/gi },
|
|
153
|
+
{ name: "env_secret", pattern: /\b[A-Z0-9_]*(?:API_KEY|SECRET|TOKEN|PASSWORD|PASSWD|PRIVATE_KEY|ACCESS_KEY)[A-Z0-9_]*\s*=\s*['\"]?(?!\[REDACTED:)[^'"\s]{8,}/g }
|
|
154
|
+
];
|
|
155
|
+
var REDACTION_CLASS_NAMES = [...new Set(SECRET_PATTERNS.map((p) => p.name)), "recovery_phrase"];
|
|
156
|
+
var MNEMONIC_LENGTHS = [24, 21, 18, 15, 12];
|
|
157
|
+
var BIP39_WORDS = new Set(wordlists.english);
|
|
158
|
+
var WORD_TOKEN_RE = /\b[A-Za-z]{3,8}\b/g;
|
|
159
|
+
function redactMnemonics(input) {
|
|
160
|
+
const tokens = [];
|
|
161
|
+
let m;
|
|
162
|
+
WORD_TOKEN_RE.lastIndex = 0;
|
|
163
|
+
while ((m = WORD_TOKEN_RE.exec(input)) !== null) {
|
|
164
|
+
const lower = m[0].toLowerCase();
|
|
165
|
+
tokens.push({ start: m.index, end: m.index + m[0].length, lower, isWordlist: BIP39_WORDS.has(lower) });
|
|
166
|
+
}
|
|
167
|
+
if (tokens.length < 12) return { text: input, count: 0 };
|
|
168
|
+
const spans = [];
|
|
169
|
+
let count = 0;
|
|
170
|
+
let segment = [];
|
|
171
|
+
const flushSegment = () => {
|
|
172
|
+
if (segment.length >= 12) {
|
|
173
|
+
let i = 0;
|
|
174
|
+
while (i < segment.length) {
|
|
175
|
+
let matchedLen = 0;
|
|
176
|
+
for (const len of MNEMONIC_LENGTHS) {
|
|
177
|
+
if (i + len > segment.length) continue;
|
|
178
|
+
const phrase = segment.slice(i, i + len).map((t) => t.lower).join(" ");
|
|
179
|
+
if (validateMnemonic(phrase)) {
|
|
180
|
+
matchedLen = len;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (matchedLen > 0) {
|
|
185
|
+
spans.push({ start: segment[i].start, end: segment[i + matchedLen - 1].end });
|
|
186
|
+
count++;
|
|
187
|
+
i += matchedLen;
|
|
188
|
+
} else {
|
|
189
|
+
i += 1;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
segment = [];
|
|
194
|
+
};
|
|
195
|
+
for (const tok of tokens) {
|
|
196
|
+
if (!tok.isWordlist) {
|
|
197
|
+
flushSegment();
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (segment.length > 0) {
|
|
201
|
+
const gap = input.slice(segment[segment.length - 1].end, tok.start);
|
|
202
|
+
if (/[A-Za-z]/.test(gap)) flushSegment();
|
|
203
|
+
}
|
|
204
|
+
segment.push(tok);
|
|
205
|
+
}
|
|
206
|
+
flushSegment();
|
|
207
|
+
if (spans.length === 0) return { text: input, count: 0 };
|
|
208
|
+
let text = input;
|
|
209
|
+
for (let s = spans.length - 1; s >= 0; s--) {
|
|
210
|
+
text = text.slice(0, spans[s].start) + "[REDACTED:recovery_phrase]" + text.slice(spans[s].end);
|
|
211
|
+
}
|
|
212
|
+
return { text, count };
|
|
213
|
+
}
|
|
214
|
+
function redactSecrets(input) {
|
|
215
|
+
let text = input;
|
|
216
|
+
let redactedCount = 0;
|
|
217
|
+
for (const { name, pattern, requires } of SECRET_PATTERNS) {
|
|
218
|
+
if (requires !== void 0 && !text.includes(requires)) continue;
|
|
219
|
+
text = text.replace(pattern, (_match, ...args) => {
|
|
220
|
+
redactedCount++;
|
|
221
|
+
if (URL_CREDENTIAL_PATTERNS.has(name) && typeof args[0] === "string" && typeof args[1] === "string") {
|
|
222
|
+
return `${args[0]}://${args[1]}:[REDACTED:${name}]@`;
|
|
223
|
+
}
|
|
224
|
+
if (name === "aws_secret_access_key" && typeof args[0] === "string" && typeof args[1] === "string") {
|
|
225
|
+
return `${args[0]}[REDACTED:${name}]`;
|
|
226
|
+
}
|
|
227
|
+
return `[REDACTED:${name}]`;
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
const mnemonic = redactMnemonics(text);
|
|
231
|
+
text = mnemonic.text;
|
|
232
|
+
redactedCount += mnemonic.count;
|
|
233
|
+
return { text, redactedCount };
|
|
234
|
+
}
|
|
235
|
+
var UPSTREAM_ATTACHMENT_MAX_CHARS = 4096;
|
|
236
|
+
function sanitizeUpstreamPayload(payload) {
|
|
237
|
+
let redactedCount = 0;
|
|
238
|
+
let truncatedCount = 0;
|
|
239
|
+
const walk = (value, keyHint) => {
|
|
240
|
+
if (typeof value === "string") {
|
|
241
|
+
const r = redactSecrets(value);
|
|
242
|
+
redactedCount += r.redactedCount;
|
|
243
|
+
let out = r.text;
|
|
244
|
+
if (keyHint === "content" && out.length > UPSTREAM_ATTACHMENT_MAX_CHARS) {
|
|
245
|
+
out = out.slice(0, UPSTREAM_ATTACHMENT_MAX_CHARS) + `
|
|
246
|
+
... [truncated, ${out.length} chars total]`;
|
|
247
|
+
truncatedCount++;
|
|
248
|
+
}
|
|
249
|
+
return out;
|
|
250
|
+
}
|
|
251
|
+
if (Array.isArray(value)) {
|
|
252
|
+
return value.map((item) => walk(item, keyHint));
|
|
253
|
+
}
|
|
254
|
+
if (value && typeof value === "object") {
|
|
255
|
+
const out = {};
|
|
256
|
+
for (const [k, v] of Object.entries(value)) {
|
|
257
|
+
out[k] = walk(v, k);
|
|
258
|
+
}
|
|
259
|
+
return out;
|
|
260
|
+
}
|
|
261
|
+
return value;
|
|
262
|
+
};
|
|
263
|
+
const sanitized = walk(payload);
|
|
264
|
+
return { payload: sanitized, redactedCount, truncatedCount };
|
|
265
|
+
}
|
|
266
|
+
function isTelemetryRedactionEnabled(env = process.env) {
|
|
267
|
+
const raw = (env.EXE_TELEMETRY_REDACT ?? "").trim().toLowerCase();
|
|
268
|
+
return !(raw === "off" || raw === "0" || raw === "false");
|
|
269
|
+
}
|
|
270
|
+
function sanitizedUpstreamBody(payload, label = "support") {
|
|
271
|
+
if (!isTelemetryRedactionEnabled()) {
|
|
272
|
+
console.error(`[${label}] WARNING: EXE_TELEMETRY_REDACT=off \u2014 sending UNREDACTED payload upstream`);
|
|
273
|
+
return JSON.stringify(payload);
|
|
274
|
+
}
|
|
275
|
+
return JSON.stringify(sanitizeUpstreamPayload(payload).payload);
|
|
276
|
+
}
|
|
277
|
+
var CANONICAL_UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
278
|
+
var SHORT_HEX_ID_RE = /^[0-9a-f]{8}$/i;
|
|
279
|
+
function isWellFormedSupportId(id) {
|
|
280
|
+
const s = (id ?? "").trim();
|
|
281
|
+
return CANONICAL_UUID_RE.test(s) || SHORT_HEX_ID_RE.test(s);
|
|
282
|
+
}
|
|
283
|
+
var VERSION_RE = /^v?\d{1,5}(\.\d{1,5}){1,3}(-[0-9A-Za-z][0-9A-Za-z.]{0,14})?$/;
|
|
284
|
+
function isWellFormedVersion(v) {
|
|
285
|
+
const s = (v ?? "").trim();
|
|
286
|
+
return s.length > 0 && s.length <= 40 && VERSION_RE.test(s);
|
|
287
|
+
}
|
|
288
|
+
var GIT_SHA_RE = /^[0-9a-f]{7,40}$/i;
|
|
289
|
+
function isWellFormedCommit(c) {
|
|
290
|
+
return GIT_SHA_RE.test((c ?? "").trim());
|
|
291
|
+
}
|
|
292
|
+
function sanitizeVersionField(v) {
|
|
293
|
+
return typeof v === "string" && isWellFormedVersion(v) ? v : void 0;
|
|
294
|
+
}
|
|
295
|
+
function sanitizeUpstreamId(id) {
|
|
296
|
+
const s = (id ?? "").trim();
|
|
297
|
+
if (isWellFormedSupportId(s)) return s;
|
|
298
|
+
const redacted = redactSecrets(s).text;
|
|
299
|
+
return redacted !== s ? redacted : "invalid-id";
|
|
300
|
+
}
|
|
301
|
+
var SUPPORT_COLLECTIONS = /* @__PURE__ */ new Set(["bug-reports", "feature-requests", "reviews"]);
|
|
302
|
+
function decodeSafe(seg) {
|
|
303
|
+
try {
|
|
304
|
+
return decodeURIComponent(seg);
|
|
305
|
+
} catch {
|
|
306
|
+
return seg;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
function sanitizeSupportEndpointPath(endpointPath) {
|
|
310
|
+
const parts = String(endpointPath ?? "").replace(/^\/+|\/+$/g, "").split("/");
|
|
311
|
+
const collection = parts[0];
|
|
312
|
+
const id = parts[1];
|
|
313
|
+
if (!collection || !SUPPORT_COLLECTIONS.has(collection) || !id || parts.length < 2 || parts.length > 3) {
|
|
314
|
+
return "invalid/invalid-id";
|
|
315
|
+
}
|
|
316
|
+
const safeId = encodeURIComponent(sanitizeUpstreamId(decodeSafe(id)));
|
|
317
|
+
if (parts.length === 3) {
|
|
318
|
+
if (parts[2] !== "comments") return "invalid/invalid-id";
|
|
319
|
+
return `${collection}/${safeId}/comments`;
|
|
320
|
+
}
|
|
321
|
+
return `${collection}/${safeId}`;
|
|
322
|
+
}
|
|
323
|
+
var SUPPORT_PRODUCTS = [
|
|
324
|
+
"exe-os",
|
|
325
|
+
"exe-create",
|
|
326
|
+
"exe-wiki",
|
|
327
|
+
"exe-gateway",
|
|
328
|
+
"exe-crm",
|
|
329
|
+
"exe-build",
|
|
330
|
+
"exe-chat",
|
|
331
|
+
"exe-auth",
|
|
332
|
+
"exe-monitor",
|
|
333
|
+
"exe-db",
|
|
334
|
+
"exe-erp"
|
|
335
|
+
];
|
|
336
|
+
var SUPPORT_PRODUCT_SET = new Set(SUPPORT_PRODUCTS);
|
|
337
|
+
function sanitizeProductFilter(product) {
|
|
338
|
+
return product && SUPPORT_PRODUCT_SET.has(product) ? product : void 0;
|
|
339
|
+
}
|
|
340
|
+
function redactDeepValue(value) {
|
|
341
|
+
const walk = (v) => {
|
|
342
|
+
if (typeof v === "string") return redactSecrets(v).text;
|
|
343
|
+
if (Array.isArray(v)) return v.map(walk);
|
|
344
|
+
if (v && typeof v === "object") {
|
|
345
|
+
const out = {};
|
|
346
|
+
for (const [k, val] of Object.entries(v)) {
|
|
347
|
+
out[redactSecrets(k).text] = walk(val);
|
|
348
|
+
}
|
|
349
|
+
return out;
|
|
350
|
+
}
|
|
351
|
+
return v;
|
|
352
|
+
};
|
|
353
|
+
return walk(value);
|
|
354
|
+
}
|
|
355
|
+
async function redactedToolResult(run) {
|
|
356
|
+
try {
|
|
357
|
+
return redactDeepValue(await run());
|
|
358
|
+
} catch (err) {
|
|
359
|
+
throw new Error(redactSecrets(err instanceof Error ? err.message : String(err)).text);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export {
|
|
364
|
+
redactSecrets,
|
|
365
|
+
UPSTREAM_ATTACHMENT_MAX_CHARS,
|
|
366
|
+
sanitizeUpstreamPayload,
|
|
367
|
+
isTelemetryRedactionEnabled,
|
|
368
|
+
sanitizedUpstreamBody,
|
|
369
|
+
isWellFormedSupportId,
|
|
370
|
+
isWellFormedVersion,
|
|
371
|
+
isWellFormedCommit,
|
|
372
|
+
sanitizeVersionField,
|
|
373
|
+
sanitizeUpstreamId,
|
|
374
|
+
sanitizeSupportEndpointPath,
|
|
375
|
+
SUPPORT_PRODUCTS,
|
|
376
|
+
sanitizeProductFilter,
|
|
377
|
+
redactedToolResult
|
|
378
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ingest
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GBTTBXAF.js";
|
|
4
4
|
import {
|
|
5
5
|
listWorkflowDefinitions,
|
|
6
6
|
runWorkflow,
|
|
7
7
|
startWorkflow
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AJYCFKJR.js";
|
|
9
9
|
import {
|
|
10
10
|
initCRMBridge
|
|
11
11
|
} from "./chunk-ML4S5SHZ.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
routeTask
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G5T6KDG4.js";
|
|
4
4
|
import {
|
|
5
5
|
createTaskCore,
|
|
6
6
|
employeeSessionName,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
isEmployeeAlive,
|
|
10
10
|
sessionScopeFilter,
|
|
11
11
|
updateTaskStatus
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UP75Z5X7.js";
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_COORDINATOR_TEMPLATE_NAME,
|
|
15
15
|
getCoordinatorName
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AOHXREB7.js";
|
|
17
17
|
|
|
18
18
|
// src/runtime/orchestrator.ts
|
|
19
19
|
var STALE_THRESHOLD_MS = 2 * 60 * 60 * 1e3;
|
|
@@ -52,8 +52,9 @@ ${task.context}`,
|
|
|
52
52
|
targetEmployee = routed.employee;
|
|
53
53
|
routingScore = routed.score;
|
|
54
54
|
}
|
|
55
|
+
let createdTaskId;
|
|
55
56
|
try {
|
|
56
|
-
await createTaskCore({
|
|
57
|
+
const created = await createTaskCore({
|
|
57
58
|
title: task.title,
|
|
58
59
|
assignedTo: targetEmployee.name,
|
|
59
60
|
assignedBy: getCoordinatorName(),
|
|
@@ -63,6 +64,7 @@ ${task.context}`,
|
|
|
63
64
|
baseDir: this.config.projectDir,
|
|
64
65
|
skipDispatch: true
|
|
65
66
|
});
|
|
67
|
+
createdTaskId = created?.id;
|
|
66
68
|
} catch (err) {
|
|
67
69
|
return {
|
|
68
70
|
employee: targetEmployee.name,
|
|
@@ -72,12 +74,39 @@ ${task.context}`,
|
|
|
72
74
|
error: `Task creation failed: ${err instanceof Error ? err.message : String(err)}`
|
|
73
75
|
};
|
|
74
76
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
const { tryAcquireDispatchClaim, releaseDispatchClaim } = await import("./dispatch-ack-VYH3ONSS.js");
|
|
78
|
+
if (createdTaskId && !tryAcquireDispatchClaim(createdTaskId, targetEmployee.name, this.config.exeSession)) {
|
|
79
|
+
return {
|
|
80
|
+
employee: targetEmployee.name,
|
|
81
|
+
sessionName: "",
|
|
82
|
+
status: "already_running",
|
|
83
|
+
routingScore,
|
|
84
|
+
error: void 0
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
let result;
|
|
88
|
+
try {
|
|
89
|
+
result = ensureEmployee(
|
|
90
|
+
targetEmployee.name,
|
|
91
|
+
this.config.exeSession,
|
|
92
|
+
this.config.projectDir,
|
|
93
|
+
task.spawnOpts
|
|
94
|
+
);
|
|
95
|
+
} catch (spawnErr) {
|
|
96
|
+
if (createdTaskId) {
|
|
97
|
+
try {
|
|
98
|
+
releaseDispatchClaim(createdTaskId, targetEmployee.name, "dispatch threw");
|
|
99
|
+
} catch {
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
throw spawnErr;
|
|
103
|
+
}
|
|
104
|
+
if (result.status === "failed" && createdTaskId) {
|
|
105
|
+
try {
|
|
106
|
+
releaseDispatchClaim(createdTaskId, targetEmployee.name, result.error ?? "dispatch failed");
|
|
107
|
+
} catch {
|
|
108
|
+
}
|
|
109
|
+
}
|
|
81
110
|
return {
|
|
82
111
|
employee: targetEmployee.name,
|
|
83
112
|
sessionName: result.sessionName,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
getCoordinatorEmployee,
|
|
10
10
|
getEmployee,
|
|
11
11
|
loadEmployeesSync
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AOHXREB7.js";
|
|
13
13
|
import {
|
|
14
14
|
EXE_AI_DIR
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WZHZCDDO.js";
|
|
16
16
|
|
|
17
17
|
// src/lib/active-agent.ts
|
|
18
18
|
import { readFileSync, writeFileSync, mkdirSync, unlinkSync, readdirSync } from "fs";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SUPPORT_PRODUCTS,
|
|
3
|
+
isWellFormedCommit,
|
|
4
|
+
isWellFormedSupportId,
|
|
5
|
+
isWellFormedVersion
|
|
6
|
+
} from "./chunk-4QCFFW2H.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/support-schemas.ts
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
var supportProductSchema = z.enum(SUPPORT_PRODUCTS);
|
|
11
|
+
var supportIdSchema = z.string().refine(isWellFormedSupportId, {
|
|
12
|
+
message: "id must be a canonical UUID (8-4-4-4-12 hex) or an 8-character hex prefix"
|
|
13
|
+
});
|
|
14
|
+
var supportVersionSchema = z.string().refine(isWellFormedVersion, {
|
|
15
|
+
message: "version must look like 1.2.3 (optionally v-prefixed, optional -prerelease), max 40 chars"
|
|
16
|
+
});
|
|
17
|
+
var supportCommitSchema = z.string().refine(isWellFormedCommit, {
|
|
18
|
+
message: "commit must be a 7\u201340 character hex SHA"
|
|
19
|
+
});
|
|
20
|
+
var supportTaskIdSchema = z.string().refine(isWellFormedSupportId, {
|
|
21
|
+
message: "linked_task_id must be a canonical UUID or an 8-character hex prefix"
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
supportProductSchema,
|
|
26
|
+
supportIdSchema,
|
|
27
|
+
supportVersionSchema,
|
|
28
|
+
supportCommitSchema,
|
|
29
|
+
supportTaskIdSchema
|
|
30
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cleanupCardsForMemories,
|
|
3
3
|
cleanupGraphLinksForMemories
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A4DVMPYB.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveAnthropicAuth
|
|
7
7
|
} from "./chunk-VGMACSEV.js";
|
|
8
8
|
import {
|
|
9
9
|
vectorToBlob
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VSRPS3J7.js";
|
|
11
11
|
import {
|
|
12
12
|
extractKeywords,
|
|
13
13
|
keywordsToString
|
|
14
14
|
} from "./chunk-CHCA3ZM2.js";
|
|
15
15
|
import {
|
|
16
16
|
isCoordinatorName
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AOHXREB7.js";
|
|
18
18
|
|
|
19
19
|
// src/lib/consolidation.ts
|
|
20
20
|
import { randomUUID } from "crypto";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
extractMemoryGraph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7V4JADD6.js";
|
|
4
4
|
import {
|
|
5
5
|
flushBatch,
|
|
6
6
|
writeMemory
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VSRPS3J7.js";
|
|
8
8
|
import {
|
|
9
9
|
extractKeywords
|
|
10
10
|
} from "./chunk-CHCA3ZM2.js";
|
|
11
11
|
import {
|
|
12
12
|
getActiveAgent
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5ERDIOV3.js";
|
|
14
14
|
|
|
15
15
|
// src/mcp/tools/import-conversations.ts
|
|
16
16
|
import { z } from "zod";
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// src/lib/current-task-cache.ts
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
function sessionCacheDir() {
|
|
5
|
+
const base = process.env.EXE_OS_DIR ?? path.join(process.env.HOME ?? "", ".exe-os");
|
|
6
|
+
return path.join(base, "session-cache");
|
|
7
|
+
}
|
|
8
|
+
function normalizeSessionScope(hint) {
|
|
9
|
+
if (!hint) return void 0;
|
|
10
|
+
const trimmed = String(hint).trim();
|
|
11
|
+
if (!trimmed) return void 0;
|
|
12
|
+
const dash = trimmed.lastIndexOf("-");
|
|
13
|
+
const scope = dash > 0 ? trimmed.slice(dash + 1) : trimmed;
|
|
14
|
+
const safe = scope.replace(/[^a-zA-Z0-9_]/g, "");
|
|
15
|
+
return safe.length > 0 ? safe : void 0;
|
|
16
|
+
}
|
|
17
|
+
function currentTaskMarkerPaths(agent, sessionScope) {
|
|
18
|
+
const dir = sessionCacheDir();
|
|
19
|
+
const scope = normalizeSessionScope(sessionScope);
|
|
20
|
+
return {
|
|
21
|
+
legacy: path.join(dir, `current-task-${agent}.json`),
|
|
22
|
+
scoped: scope ? path.join(dir, `current-task-${agent}--${scope}.json`) : null
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function readMarker(file) {
|
|
26
|
+
try {
|
|
27
|
+
if (!existsSync(file)) return null;
|
|
28
|
+
const parsed = JSON.parse(readFileSync(file, "utf8"));
|
|
29
|
+
return parsed.taskId ? parsed : null;
|
|
30
|
+
} catch {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function writeCurrentTask(input) {
|
|
35
|
+
const { agent, taskId, title } = input;
|
|
36
|
+
const scope = normalizeSessionScope(input.sessionScope);
|
|
37
|
+
const { legacy, scoped } = currentTaskMarkerPaths(agent, scope);
|
|
38
|
+
const payload = {
|
|
39
|
+
taskId,
|
|
40
|
+
title,
|
|
41
|
+
sessionScope: scope,
|
|
42
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
43
|
+
};
|
|
44
|
+
const body = JSON.stringify(payload);
|
|
45
|
+
try {
|
|
46
|
+
mkdirSync(sessionCacheDir(), { recursive: true });
|
|
47
|
+
writeFileSync(legacy, body, { mode: 384 });
|
|
48
|
+
if (scoped) writeFileSync(scoped, body, { mode: 384 });
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function resolveCurrentTask(agent, sessionScope) {
|
|
53
|
+
const { legacy, scoped } = currentTaskMarkerPaths(agent, sessionScope);
|
|
54
|
+
if (scoped) {
|
|
55
|
+
const hit = readMarker(scoped);
|
|
56
|
+
if (hit) return hit;
|
|
57
|
+
const fallback = readMarker(legacy);
|
|
58
|
+
if (fallback?.sessionScope && fallback.sessionScope !== normalizeSessionScope(sessionScope)) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return fallback;
|
|
62
|
+
}
|
|
63
|
+
return readMarker(legacy);
|
|
64
|
+
}
|
|
65
|
+
function clearCurrentTask(input) {
|
|
66
|
+
const { agent, taskId } = input;
|
|
67
|
+
const { legacy, scoped } = currentTaskMarkerPaths(agent, input.sessionScope);
|
|
68
|
+
if (scoped) {
|
|
69
|
+
try {
|
|
70
|
+
unlinkSync(scoped);
|
|
71
|
+
} catch {
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const legacyMarker = readMarker(legacy);
|
|
75
|
+
if (!legacyMarker) return;
|
|
76
|
+
if (taskId && legacyMarker.taskId !== taskId) return;
|
|
77
|
+
try {
|
|
78
|
+
unlinkSync(legacy);
|
|
79
|
+
} catch {
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
normalizeSessionScope,
|
|
85
|
+
writeCurrentTask,
|
|
86
|
+
resolveCurrentTask,
|
|
87
|
+
clearCurrentTask
|
|
88
|
+
};
|