@askexenow/exe-os 0.9.127 → 0.9.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/active-agent-3FDJYREJ.js +22 -0
- package/dist/active-agent-WC7YK3L5.js +23 -0
- package/dist/agent-context-CDWUZEXY.js +11 -0
- package/dist/agent-loop-G4VUR5ME.js +10 -0
- package/dist/agentic-ontology-2VYNTMNO.js +25 -0
- package/dist/backfill-metadata-OJWOCLSZ.js +601 -0
- package/dist/background-jobs-LGRDXGXC.js +25 -0
- package/dist/bash-Y5PEW5UQ.js +8 -0
- package/dist/behaviors-CSB2YLDT.js +22 -0
- package/dist/bin/age-ontology-load.js +10 -258
- package/dist/bin/agentic-ontology-backfill.js +23 -5296
- package/dist/bin/agentic-reflection-backfill.js +19 -4739
- package/dist/bin/agentic-semantic-label.js +28 -4723
- package/dist/bin/backfill-conversations.js +42 -5543
- package/dist/bin/backfill-responses.js +41 -5542
- package/dist/bin/backfill-vectors.js +43 -4795
- package/dist/bin/bulk-sync-postgres.js +22 -5313
- package/dist/bin/cc-doctor.js +10 -602
- package/dist/bin/cleanup-stale-review-tasks.js +32 -6803
- package/dist/bin/cli.js +169 -38993
- package/dist/bin/exe-agent-config.js +21 -253
- package/dist/bin/exe-agent.js +63 -2429
- package/dist/bin/exe-assign.js +34 -5810
- package/dist/bin/exe-boot.js +180 -12726
- package/dist/bin/exe-call.js +48 -1409
- package/dist/bin/exe-cloud.js +64 -8516
- package/dist/bin/exe-dispatch.js +35 -10818
- package/dist/bin/exe-doctor.js +24 -7537
- package/dist/bin/exe-export-behaviors.js +18 -6122
- package/dist/bin/exe-forget.js +22 -6274
- package/dist/bin/exe-gateway.js +62 -15286
- package/dist/bin/exe-healthcheck.js +9 -602
- package/dist/bin/exe-heartbeat.js +51 -6898
- package/dist/bin/exe-kill.js +30 -5961
- package/dist/bin/exe-launch-agent.js +101 -6788
- package/dist/bin/exe-new-employee.js +42 -3774
- package/dist/bin/exe-pending-messages.js +28 -6833
- package/dist/bin/exe-pending-notifications.js +31 -6869
- package/dist/bin/exe-pending-reviews.js +38 -6910
- package/dist/bin/exe-rename.js +57 -5766
- package/dist/bin/exe-review.js +29 -5948
- package/dist/bin/exe-search.js +22 -7692
- package/dist/bin/exe-session-cleanup.js +52 -11147
- package/dist/bin/exe-settings.js +35 -524
- package/dist/bin/exe-start-codex.js +70 -6641
- package/dist/bin/exe-start-opencode.js +54 -6584
- package/dist/bin/exe-status.js +26 -7081
- package/dist/bin/exe-support.js +10 -546
- package/dist/bin/exe-team.js +18 -5942
- package/dist/bin/git-sweep.js +26 -10909
- package/dist/bin/graph-backfill.js +24 -5979
- package/dist/bin/graph-export.js +31 -6128
- package/dist/bin/graph-layer-benchmark.js +4 -8
- package/dist/bin/install.js +47 -2322
- package/dist/bin/intercom-check.js +25 -11501
- package/dist/bin/list-providers.js +4 -18
- package/dist/bin/postgres-agentic-reflection-backfill.js +14 -357
- package/dist/bin/postgres-agentic-semantic-backfill.js +14 -404
- package/dist/bin/pre-publish.js +4 -298
- package/dist/bin/registry-proxy.js +8 -172
- package/dist/bin/scan-tasks.js +47 -10881
- package/dist/bin/setup.js +6 -9492
- package/dist/bin/shard-migrate.js +30 -5149
- package/dist/bin/stack-update.js +75 -203
- package/dist/bin/update.js +20 -654
- package/dist/capacity-monitor-3GZIHLB4.js +46 -0
- package/dist/catchup-brief-67QDCINS.js +148 -0
- package/dist/chunk-2QD7KBJN.js +664 -0
- package/dist/chunk-2WGSIVI4.js +149 -0
- package/dist/chunk-35TVNLJI.js +57 -0
- package/dist/chunk-3SYV36U5.js +47 -0
- package/dist/chunk-46SQTBQW.js +207 -0
- package/dist/chunk-4CMVLKEI.js +171 -0
- package/dist/chunk-4FLUOZTR.js +116 -0
- package/dist/chunk-4NYQAS33.js +17 -0
- package/dist/chunk-4QNPADWL.js +902 -0
- package/dist/chunk-4Y6QZBEO.js +58 -0
- package/dist/chunk-557C2IGL.js +0 -0
- package/dist/chunk-55S56YDO.js +305 -0
- package/dist/chunk-5BS5ELMC.js +85 -0
- package/dist/chunk-5DHM77JE.js +256 -0
- package/dist/chunk-5QTWQKNF.js +137 -0
- package/dist/chunk-6A7P74QV.js +53 -0
- package/dist/chunk-6BFIFI5F.js +45 -0
- package/dist/chunk-6KFICEAT.js +20 -0
- package/dist/chunk-6LKDJ5WX.js +317 -0
- package/dist/chunk-6M5II4EV.js +148 -0
- package/dist/chunk-6QEFN3DV.js +302 -0
- package/dist/chunk-6WTMJAG3.js +171 -0
- package/dist/chunk-6Y4B3QF6.js +19 -0
- package/dist/chunk-7RK3AYJE.js +163 -0
- package/dist/chunk-7TCP2XTP.js +390 -0
- package/dist/chunk-A2NZP64U.js +2307 -0
- package/dist/chunk-AFYIYM2K.js +322 -0
- package/dist/chunk-AJWFPKQS.js +573 -0
- package/dist/chunk-AVE2B4DQ.js +140 -0
- package/dist/chunk-B4TT2QQA.js +87 -0
- package/dist/chunk-BCMOO4OQ.js +1066 -0
- package/dist/chunk-BU3ID2WT.js +432 -0
- package/dist/chunk-CFIM43JH.js +862 -0
- package/dist/chunk-CURJUF3W.js +66 -0
- package/dist/chunk-DC4ZD76Y.js +288 -0
- package/dist/chunk-DL52JPGF.js +706 -0
- package/dist/chunk-DRSC6ZRA.js +36 -0
- package/dist/chunk-E2Q4Y22A.js +86 -0
- package/dist/chunk-ECGTESAP.js +236 -0
- package/dist/chunk-EHOJUXYG.js +365 -0
- package/dist/chunk-EIT6J37V.js +119 -0
- package/dist/chunk-ELE2C7L4.js +31 -0
- package/dist/chunk-EQSQ4HBW.js +9 -0
- package/dist/chunk-FWFFZGSC.js +94 -0
- package/dist/chunk-GCNWCYJI.js +249 -0
- package/dist/chunk-GGTUUI7J.js +6 -0
- package/dist/chunk-GU56L7OY.js +223 -0
- package/dist/chunk-HF25XPZE.js +83 -0
- package/dist/chunk-HOKOOBDL.js +52 -0
- package/dist/chunk-HP43GLZ6.js +89 -0
- package/dist/chunk-HSRM6PNM.js +682 -0
- package/dist/chunk-HVRTW3OP.js +164 -0
- package/dist/chunk-IHDHL5ML.js +125 -0
- package/dist/chunk-IHF5RXJM.js +168 -0
- package/dist/chunk-IJ73YE73.js +409 -0
- package/dist/chunk-INO4ZD5Y.js +162 -0
- package/dist/chunk-IRQTM7DY.js +475 -0
- package/dist/chunk-JD4FAPYG.js +1208 -0
- package/dist/chunk-JN44LQ53.js +316 -0
- package/dist/chunk-JQ6TLNIV.js +133 -0
- package/dist/chunk-JT76KRZQ.js +35 -0
- package/dist/chunk-K6OEWZTB.js +262 -0
- package/dist/chunk-KCUYRZSX.js +72 -0
- package/dist/chunk-KFQGP6VL.js +33 -0
- package/dist/chunk-KRLOFIPI.js +83 -0
- package/dist/chunk-KVPG5UT6.js +305 -0
- package/dist/chunk-L3TB7CC3.js +170 -0
- package/dist/chunk-L4X5EUHR.js +283 -0
- package/dist/chunk-LAN26C3W.js +655 -0
- package/dist/chunk-LPGBKR4H.js +54 -0
- package/dist/chunk-LVNMOVGD.js +132 -0
- package/dist/chunk-LX5WEEZ7.js +157 -0
- package/dist/chunk-MBH42QNH.js +295 -0
- package/dist/chunk-MFO7MNSD.js +102 -0
- package/dist/chunk-MILTNDZH.js +736 -0
- package/dist/chunk-MJAE4NB7.js +1090 -0
- package/dist/chunk-MLCUPTP7.js +132 -0
- package/dist/chunk-MPURH6JI.js +445 -0
- package/dist/chunk-MVBWW2EO.js +89 -0
- package/dist/chunk-MZIGUUDQ.js +42 -0
- package/dist/chunk-N3DTSVKE.js +157 -0
- package/dist/chunk-N5RRQOAC.js +134 -0
- package/dist/chunk-N7L33TED.js +1664 -0
- package/dist/chunk-NDYSNVI5.js +122 -0
- package/dist/chunk-NEAHEC5G.js +155 -0
- package/dist/chunk-NGVOA6ZQ.js +84 -0
- package/dist/chunk-NHK5KW6Y.js +193 -0
- package/dist/chunk-NMQKGFEP.js +458 -0
- package/dist/chunk-NPT4EHZK.js +352 -0
- package/dist/chunk-NXFJHTED.js +55 -0
- package/dist/chunk-NZLCDI6Y.js +216 -0
- package/dist/chunk-O377P7GM.js +100 -0
- package/dist/chunk-O4VFZRA5.js +33 -0
- package/dist/chunk-O7YD7JYE.js +237 -0
- package/dist/chunk-OFK72LTZ.js +81 -0
- package/dist/chunk-ORCCI2VV.js +140 -0
- package/dist/chunk-OVQR4KMC.js +579 -0
- package/dist/chunk-P3CVUMEH.js +54 -0
- package/dist/chunk-P4HIF72O.js +30 -0
- package/dist/chunk-PEDLSJBL.js +1039 -0
- package/dist/chunk-PFICKZZ5.js +219 -0
- package/dist/chunk-PGW7TIV6.js +142 -0
- package/dist/chunk-PJHHFJAN.js +63 -0
- package/dist/chunk-PP4SNOJ5.js +471 -0
- package/dist/chunk-PRKVT4KN.js +90 -0
- package/dist/chunk-Q2O4VJHH.js +305 -0
- package/dist/chunk-Q36CMZIX.js +38 -0
- package/dist/chunk-Q3V7K4ME.js +149 -0
- package/dist/chunk-QGYPJGHB.js +81 -0
- package/dist/chunk-R23EMFJV.js +198 -0
- package/dist/chunk-R4M6XCMU.js +39 -0
- package/dist/chunk-R4WMF32C.js +81 -0
- package/dist/chunk-RJT7H2KR.js +349 -0
- package/dist/chunk-RJZMRZNV.js +280 -0
- package/dist/chunk-RMFDPCA2.js +72 -0
- package/dist/chunk-RUG3N6P4.js +292 -0
- package/dist/chunk-RWO327FJ.js +84 -0
- package/dist/chunk-SG7EFHQ7.js +108 -0
- package/dist/chunk-SH45SJQW.js +0 -0
- package/dist/chunk-SPKE5ANC.js +42 -0
- package/dist/chunk-SVMFVPBF.js +104 -0
- package/dist/chunk-SVXDCELZ.js +163 -0
- package/dist/chunk-TMEE7AT7.js +72 -0
- package/dist/chunk-TWYEE4FB.js +125 -0
- package/dist/chunk-TYLF4LSW.js +110 -0
- package/dist/chunk-V4TZI6EO.js +60 -0
- package/dist/chunk-VFZTXKQI.js +372 -0
- package/dist/chunk-VQ4K2MLM.js +199 -0
- package/dist/chunk-VU447UAO.js +173 -0
- package/dist/chunk-WMC3TXJF.js +50 -0
- package/dist/chunk-WPOA7XAE.js +84 -0
- package/dist/chunk-WZQ4CPRG.js +64 -0
- package/dist/chunk-X2IMCCM5.js +49 -0
- package/dist/chunk-X2Z5GT3V.js +118 -0
- package/dist/chunk-XEKO37NM.js +43 -0
- package/dist/chunk-XUHFQHGZ.js +505 -0
- package/dist/chunk-YGAAZN3E.js +47 -0
- package/dist/chunk-YKOW7KMK.js +558 -0
- package/dist/chunk-YOQKMB6N.js +145 -0
- package/dist/chunk-YZFZDJWZ.js +107 -0
- package/dist/chunk-ZBY4AUD4.js +10342 -0
- package/dist/chunk-ZOJYPNCM.js +127 -0
- package/dist/chunk-ZS7MGQSD.js +1494 -0
- package/dist/chunk-ZTZQ5A6B.js +191 -0
- package/dist/code-context-index-HXGC4IJL.js +28 -0
- package/dist/content-extractor-UVZXRIPC.js +8 -0
- package/dist/conversation-entity-extractor-HKSNDF4L.js +113 -0
- package/dist/conversation-wiki-populator-NKDAQEZ5.js +105 -0
- package/dist/crdt-sync-T7MHVQCS.js +33 -0
- package/dist/crm-bridge-Q5JBVJ6P.js +19 -0
- package/dist/crm-webhook-OAFTLJYA.js +10 -0
- package/dist/cto-delegation-gate-XWHZCUJH.js +208 -0
- package/dist/daemon-auth-GWUXTUYO.js +15 -0
- package/dist/daemon-orchestration-2C3TVOHO.js +91 -0
- package/dist/daemon-protocol-RLH2XM2K.js +19 -0
- package/dist/db-backup-CH2KG3JY.js +23 -0
- package/dist/devtools-PLJCAU53.js +8 -0
- package/dist/discord-G4BQJ2VX.js +7 -0
- package/dist/email-XMRNMFXR.js +137 -0
- package/dist/entity-boost-IOER4VRR.js +249 -0
- package/dist/exe-drift-2IJFQV43.js +68 -0
- package/dist/exe-export-Y2RFXGNB.js +71 -0
- package/dist/exe-import-LN6PE2YT.js +74 -0
- package/dist/exe-key-DHKBWLIT.js +571 -0
- package/dist/exe-org-F7LZRHFB.js +73 -0
- package/dist/factory-YTD23AW7.js +67 -0
- package/dist/fast-db-init-IIP6EGWT.js +7 -0
- package/dist/file-edit-FJVEO7XZ.js +8 -0
- package/dist/file-read-Q2NH3J35.js +8 -0
- package/dist/file-write-UNSFXNH4.js +8 -0
- package/dist/gateway/index.js +87 -16563
- package/dist/gateway-client-APTYJNCL.js +11 -0
- package/dist/git-staleness-I2BUEDE2.js +111 -0
- package/dist/git-task-sweep-UEOTXRW4.js +35 -0
- package/dist/glob-GRMXLDMB.js +7 -0
- package/dist/global-procedures-MFE5LGRF.js +19 -0
- package/dist/graph-query-657O5JYJ.js +25 -0
- package/dist/graph-rag-ZE5N7C65.js +28 -0
- package/dist/grep-NBV6SKYZ.js +7 -0
- package/dist/hooks/bug-report-worker.js +41 -10823
- package/dist/hooks/codex-stop-task-finalizer.js +38 -9055
- package/dist/hooks/commit-complete.js +32 -10914
- package/dist/hooks/error-recall.js +35 -7955
- package/dist/hooks/exe-heartbeat-hook.js +17 -327
- package/dist/hooks/ingest-worker.js +16 -565
- package/dist/hooks/ingest.js +98 -11436
- package/dist/hooks/instructions-loaded.js +25 -6209
- package/dist/hooks/notification.js +16 -6098
- package/dist/hooks/post-compact.js +34 -7041
- package/dist/hooks/post-tool-combined.js +27 -9751
- package/dist/hooks/pre-compact.js +38 -11130
- package/dist/hooks/pre-tool-use.js +61 -7233
- package/dist/hooks/prompt-submit.js +113 -13358
- package/dist/hooks/session-end.js +57 -11503
- package/dist/hooks/session-start.js +46 -9423
- package/dist/hooks/stop.js +70 -7210
- package/dist/hooks/subagent-stop.js +33 -6897
- package/dist/hooks/summary-worker.js +86 -8629
- package/dist/hooks-KD3N2D7P.js +9 -0
- package/dist/imessage-L7WKA2WD.js +7 -0
- package/dist/index.js +49 -19391
- package/dist/installer-5N24GXFB.js +32 -0
- package/dist/installer-QSD76YRY.js +291 -0
- package/dist/installer-ZPQUKHU5.js +331 -0
- package/dist/intercom-queue-PEEGAJ33.js +19 -0
- package/dist/key-backup-status-57UB74DU.js +41 -0
- package/dist/lib/agent-config.js +19 -224
- package/dist/lib/cloud-sync.js +44 -5398
- package/dist/lib/cloudflare-dns.js +7 -111
- package/dist/lib/config.js +18 -278
- package/dist/lib/consolidation.js +21 -1047
- package/dist/lib/crypto.js +7 -45
- package/dist/lib/database.js +20 -2932
- package/dist/lib/db-daemon-client.js +24 -460
- package/dist/lib/db.js +22 -2932
- package/dist/lib/device-registry.js +20 -2992
- package/dist/lib/embedder.js +14 -822
- package/dist/lib/employee-templates.js +21 -1102
- package/dist/lib/employees.js +30 -497
- package/dist/lib/error-detector.js +9 -149
- package/dist/lib/exe-daemon-client.js +16 -570
- package/dist/lib/exe-daemon.js +509 -18398
- package/dist/lib/file-grep.js +2 -0
- package/dist/lib/hybrid-search.js +18 -7674
- package/dist/lib/identity-templates.js +2 -0
- package/dist/lib/identity.js +13 -309
- package/dist/lib/keychain.js +9 -499
- package/dist/lib/license.js +21 -549
- package/dist/lib/messaging.js +35 -1631
- package/dist/lib/post-tool-memory.js +8 -370
- package/dist/lib/registry-proxy.js +8 -155
- package/dist/lib/reminders.js +11 -231
- package/dist/lib/runtime-table.js +7 -20
- package/dist/lib/schedules.js +16 -4614
- package/dist/lib/session-registry.js +9 -57
- package/dist/lib/session-wrappers.js +3 -127
- package/dist/lib/skill-learning.js +20 -2101
- package/dist/lib/status-brief.js +4 -368
- package/dist/lib/store.js +25 -5593
- package/dist/lib/task-router.js +12 -254
- package/dist/lib/tasks.js +44 -5801
- package/dist/lib/tmux-routing.js +45 -5804
- package/dist/lib/tmux-status.js +16 -248
- package/dist/lib/tmux-transport.js +6 -90
- package/dist/lib/token-spend.js +9 -337
- package/dist/lib/transport.js +8 -134
- package/dist/lib/ws-auth.js +6 -14
- package/dist/lib/ws-client.js +4 -22
- package/dist/license-gate-NXXDOOAQ.js +14 -0
- package/dist/mcp/register-tools.js +90 -32454
- package/dist/mcp/server.js +139 -32625
- package/dist/mcp/tools/complete-reminder.js +10 -237
- package/dist/mcp/tools/create-reminder.js +10 -222
- package/dist/mcp/tools/create-task.js +28 -6730
- package/dist/mcp/tools/deactivate-behavior.js +13 -476
- package/dist/mcp/tools/list-reminders.js +10 -232
- package/dist/mcp/tools/list-tasks.js +28 -1571
- package/dist/mcp/tools/send-message.js +25 -1672
- package/dist/mcp/tools/update-task.js +27 -6123
- package/dist/mcp-diagnostics-OOZ3TDPY.js +200 -0
- package/dist/memory-cards-RIL5BZHK.js +175 -0
- package/dist/memory-queue-JYIJ7TMQ.js +13 -0
- package/dist/memory-queue-client-PE7757HU.js +14 -0
- package/dist/notifications-CJFULBMN.js +42 -0
- package/dist/orchestration-phase-Y2TYNW5H.js +23 -0
- package/dist/orchestrator-RXIPT6PZ.js +29 -0
- package/dist/permission-presets-WI524OSE.js +25 -0
- package/dist/permissions-TYT6YMNZ.js +14 -0
- package/dist/pg-ssl-KFHNJPGO.js +7 -0
- package/dist/plan-limits-5WY5YK6X.js +27 -0
- package/dist/preferences-MW3BYTQ5.js +10 -0
- package/dist/project-name-PL2ZDWNU.js +11 -0
- package/dist/projection-worker-OY4WYZW6.js +661 -0
- package/dist/reranker-LFJ73RRS.js +19 -0
- package/dist/review-gate-E6K7QQE5.js +120 -0
- package/dist/runtime/index.js +82 -13408
- package/dist/self-query-router-IZANO632.js +83 -0
- package/dist/session-events-TQ6S5KQN.js +32 -0
- package/dist/session-kill-telemetry-46YIJWE2.js +30 -0
- package/dist/session-scope-3MYK3YRV.js +34 -0
- package/dist/setup-wizard-ZJ7UCRBP.js +12 -0
- package/dist/shard-manager-RCFZ6RXY.js +29 -0
- package/dist/signal-XN2C7PIG.js +7 -0
- package/dist/slack-Z77TFJCK.js +7 -0
- package/dist/task-enforcement-337DZI3I.js +252 -0
- package/dist/task-scanner-IMIR3T7T.js +11 -0
- package/dist/task-scope-MUU4KXE6.js +32 -0
- package/dist/tasks-crud-PMLK3MM4.js +53 -0
- package/dist/tasks-review-56LVKKNL.js +44 -0
- package/dist/telegram-CRPZO7JT.js +7 -0
- package/dist/telemetry-SPVGPKU7.js +9 -0
- package/dist/tool-capability-index-XNBSDCH3.js +10 -0
- package/dist/tool-gates-LGH6CSY4.js +14 -0
- package/dist/tool-gates-W7SZCYTX.js +13 -0
- package/dist/tool-registry-436LVVLY.js +11 -0
- package/dist/tool-telemetry-L77WNAYT.js +15 -0
- package/dist/tui/App.js +253 -14668
- package/dist/tui-data-SB45REYU.js +161 -0
- package/dist/update-check-LZGZISRJ.js +11 -0
- package/dist/webhook-VVP7KQVC.js +96 -0
- package/dist/whatsapp-J6QNDBGY.js +9 -0
- package/dist/whatsapp-accounts-RTJF3LM6.js +15 -0
- package/dist/wiki-client-EKCIKCVC.js +136 -0
- package/dist/worker-gate-UYNN62GJ.js +19 -0
- package/dist/worktree-4T4BPWPN.js +205 -0
- package/package.json +1 -1
package/dist/lib/employees.js
CHANGED
|
@@ -1,500 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
PRIVATE_DIR_MODE = 448;
|
|
32
|
-
PRIVATE_FILE_MODE = 384;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// src/lib/config.ts
|
|
37
|
-
import { readFile, writeFile } from "fs/promises";
|
|
38
|
-
import { readFileSync, existsSync as existsSync2, renameSync } from "fs";
|
|
39
|
-
import path from "path";
|
|
40
|
-
import os from "os";
|
|
41
|
-
function resolveDataDir() {
|
|
42
|
-
if (process.env.EXE_OS_DIR) return process.env.EXE_OS_DIR;
|
|
43
|
-
if (process.env.EXE_MEM_DIR) return process.env.EXE_MEM_DIR;
|
|
44
|
-
const newDir = path.join(os.homedir(), ".exe-os");
|
|
45
|
-
const legacyDir = path.join(os.homedir(), ".exe-mem");
|
|
46
|
-
if (!existsSync2(newDir) && existsSync2(legacyDir)) {
|
|
47
|
-
try {
|
|
48
|
-
renameSync(legacyDir, newDir);
|
|
49
|
-
process.stderr.write(`[exe-os] Migrated data directory: ~/.exe-mem \u2192 ~/.exe-os
|
|
50
|
-
`);
|
|
51
|
-
} catch {
|
|
52
|
-
return legacyDir;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return newDir;
|
|
56
|
-
}
|
|
57
|
-
var EXE_AI_DIR, DB_PATH, MODELS_DIR, CONFIG_PATH, LEGACY_LANCE_PATH, CURRENT_CONFIG_VERSION, DEFAULT_CONFIG;
|
|
58
|
-
var init_config = __esm({
|
|
59
|
-
"src/lib/config.ts"() {
|
|
60
|
-
"use strict";
|
|
61
|
-
init_secure_files();
|
|
62
|
-
EXE_AI_DIR = resolveDataDir();
|
|
63
|
-
DB_PATH = path.join(EXE_AI_DIR, "memories.db");
|
|
64
|
-
MODELS_DIR = path.join(EXE_AI_DIR, "models");
|
|
65
|
-
CONFIG_PATH = path.join(EXE_AI_DIR, "config.json");
|
|
66
|
-
LEGACY_LANCE_PATH = path.join(EXE_AI_DIR, "local.lance");
|
|
67
|
-
CURRENT_CONFIG_VERSION = 1;
|
|
68
|
-
DEFAULT_CONFIG = {
|
|
69
|
-
config_version: CURRENT_CONFIG_VERSION,
|
|
70
|
-
dbPath: DB_PATH,
|
|
71
|
-
modelFile: "jina-embeddings-v5-small-q4_k_m.gguf",
|
|
72
|
-
embeddingDim: 1024,
|
|
73
|
-
batchSize: 20,
|
|
74
|
-
flushIntervalMs: 1e4,
|
|
75
|
-
autoIngestion: true,
|
|
76
|
-
autoRetrieval: true,
|
|
77
|
-
searchMode: "hybrid",
|
|
78
|
-
hookSearchMode: "hybrid",
|
|
79
|
-
fileGrepEnabled: true,
|
|
80
|
-
splashEffect: true,
|
|
81
|
-
consolidationEnabled: true,
|
|
82
|
-
consolidationIntervalMs: 6 * 60 * 60 * 1e3,
|
|
83
|
-
consolidationModel: "claude-haiku-4-5-20251001",
|
|
84
|
-
consolidationMaxCallsPerRun: 20,
|
|
85
|
-
selfQueryRouter: true,
|
|
86
|
-
selfQueryModel: "claude-haiku-4-5-20251001",
|
|
87
|
-
rerankerEnabled: true,
|
|
88
|
-
scalingRoadmap: {
|
|
89
|
-
rerankerAutoTrigger: {
|
|
90
|
-
enabled: true,
|
|
91
|
-
broadQueryMinCardinality: 5e4,
|
|
92
|
-
fetchTopK: 150,
|
|
93
|
-
returnTopK: 5
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
graphRagEnabled: true,
|
|
97
|
-
wikiEnabled: false,
|
|
98
|
-
wikiUrl: "",
|
|
99
|
-
wikiApiKey: "",
|
|
100
|
-
wikiSyncIntervalMs: 30 * 60 * 1e3,
|
|
101
|
-
wikiWorkspaceMapping: {},
|
|
102
|
-
wikiAutoUpdate: true,
|
|
103
|
-
wikiAutoUpdateThreshold: 0.5,
|
|
104
|
-
wikiAutoUpdateCreateNew: true,
|
|
105
|
-
skillLearning: true,
|
|
106
|
-
skillThreshold: 3,
|
|
107
|
-
skillModel: "claude-haiku-4-5-20251001",
|
|
108
|
-
exeHeartbeat: {
|
|
109
|
-
enabled: true,
|
|
110
|
-
intervalSeconds: 60,
|
|
111
|
-
staleInProgressThresholdHours: 2
|
|
112
|
-
},
|
|
113
|
-
sessionLifecycle: {
|
|
114
|
-
idleKillEnabled: true,
|
|
115
|
-
idleKillTicksRequired: 3,
|
|
116
|
-
idleKillIntercomAckWindowMs: 1e4,
|
|
117
|
-
maxAutoInstances: 10
|
|
118
|
-
},
|
|
119
|
-
autoUpdate: {
|
|
120
|
-
checkOnBoot: true,
|
|
121
|
-
autoInstall: false,
|
|
122
|
-
checkIntervalMs: 24 * 60 * 60 * 1e3
|
|
123
|
-
},
|
|
124
|
-
support: {
|
|
125
|
-
bugReportEndpoint: "https://askexe.com/v1/support/bug-reports"
|
|
126
|
-
},
|
|
127
|
-
orchestration: {
|
|
128
|
-
phase: "phase_1_coo",
|
|
129
|
-
phaseSetBy: "default"
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
// src/lib/runtime-table.ts
|
|
136
|
-
var RUNTIME_TABLE, DEFAULT_RUNTIME;
|
|
137
|
-
var init_runtime_table = __esm({
|
|
138
|
-
"src/lib/runtime-table.ts"() {
|
|
139
|
-
"use strict";
|
|
140
|
-
RUNTIME_TABLE = {
|
|
141
|
-
codex: {
|
|
142
|
-
binary: "codex",
|
|
143
|
-
launchMode: "interactive",
|
|
144
|
-
autoApproveFlag: "--dangerously-bypass-approvals-and-sandbox",
|
|
145
|
-
inlineFlag: "--no-alt-screen",
|
|
146
|
-
apiKeyEnv: "OPENAI_API_KEY",
|
|
147
|
-
defaultModel: "gpt-5.5"
|
|
148
|
-
},
|
|
149
|
-
opencode: {
|
|
150
|
-
binary: "opencode",
|
|
151
|
-
launchMode: "exec",
|
|
152
|
-
autoApproveFlag: "--dangerously-skip-permissions",
|
|
153
|
-
inlineFlag: "",
|
|
154
|
-
apiKeyEnv: "ANTHROPIC_API_KEY",
|
|
155
|
-
defaultModel: "anthropic/claude-sonnet-4-6"
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
DEFAULT_RUNTIME = "claude";
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
// src/lib/agent-config.ts
|
|
163
|
-
var agent_config_exports = {};
|
|
164
|
-
__export(agent_config_exports, {
|
|
165
|
-
AGENT_CONFIG_PATH: () => AGENT_CONFIG_PATH,
|
|
166
|
-
DEFAULT_MODELS: () => DEFAULT_MODELS,
|
|
167
|
-
KNOWN_RUNTIMES: () => KNOWN_RUNTIMES,
|
|
168
|
-
RUNTIME_LABELS: () => RUNTIME_LABELS,
|
|
169
|
-
clearAgentRuntime: () => clearAgentRuntime,
|
|
170
|
-
getAgentRuntime: () => getAgentRuntime,
|
|
171
|
-
loadAgentConfig: () => loadAgentConfig,
|
|
172
|
-
normalizeCcModelName: () => normalizeCcModelName,
|
|
173
|
-
saveAgentConfig: () => saveAgentConfig,
|
|
174
|
-
setAgentMcps: () => setAgentMcps,
|
|
175
|
-
setAgentRuntime: () => setAgentRuntime
|
|
176
|
-
});
|
|
177
|
-
import { readFileSync as readFileSync2, writeFileSync, existsSync as existsSync3 } from "fs";
|
|
178
|
-
import path2 from "path";
|
|
179
|
-
function loadAgentConfig() {
|
|
180
|
-
if (!existsSync3(AGENT_CONFIG_PATH)) return {};
|
|
181
|
-
try {
|
|
182
|
-
return JSON.parse(readFileSync2(AGENT_CONFIG_PATH, "utf-8"));
|
|
183
|
-
} catch {
|
|
184
|
-
return {};
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
function saveAgentConfig(config) {
|
|
188
|
-
const dir = path2.dirname(AGENT_CONFIG_PATH);
|
|
189
|
-
ensurePrivateDirSync(dir);
|
|
190
|
-
writeFileSync(AGENT_CONFIG_PATH, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
191
|
-
enforcePrivateFileSync(AGENT_CONFIG_PATH);
|
|
192
|
-
}
|
|
193
|
-
function getAgentRuntime(agentId) {
|
|
194
|
-
const config = loadAgentConfig();
|
|
195
|
-
const entry = config[agentId];
|
|
196
|
-
if (entry) return entry;
|
|
197
|
-
const orgDefault = config["default"];
|
|
198
|
-
if (orgDefault) return orgDefault;
|
|
199
|
-
return { runtime: DEFAULT_RUNTIME, model: DEFAULT_MODELS[DEFAULT_RUNTIME] };
|
|
200
|
-
}
|
|
201
|
-
function normalizeCcModelName(model) {
|
|
202
|
-
let ccModel = model.replace(/(\d+)\.(\d+)/g, "$1-$2");
|
|
203
|
-
if (/claude-(opus|sonnet)-4-[6-9]/.test(ccModel) && !ccModel.includes("[1m]")) {
|
|
204
|
-
ccModel += "[1m]";
|
|
205
|
-
}
|
|
206
|
-
return ccModel;
|
|
207
|
-
}
|
|
208
|
-
function setAgentRuntime(agentId, runtime, model, reasoning_effort, mcps) {
|
|
209
|
-
const knownModels = KNOWN_RUNTIMES[runtime];
|
|
210
|
-
if (!knownModels) {
|
|
211
|
-
return {
|
|
212
|
-
ok: false,
|
|
213
|
-
error: `Unknown runtime "${runtime}". Valid: ${Object.keys(KNOWN_RUNTIMES).join(", ")}`
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
if (!knownModels.includes(model)) {
|
|
217
|
-
return {
|
|
218
|
-
ok: false,
|
|
219
|
-
error: `Unknown model "${model}" for runtime "${runtime}". Valid: ${knownModels.join(", ")}`
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
const config = loadAgentConfig();
|
|
223
|
-
const existing = config[agentId];
|
|
224
|
-
const entry = { runtime, model };
|
|
225
|
-
if (reasoning_effort) entry.reasoning_effort = reasoning_effort;
|
|
226
|
-
if (mcps !== void 0) {
|
|
227
|
-
entry.mcps = mcps.includes("exe-os") ? mcps : ["exe-os", ...mcps];
|
|
228
|
-
} else if (existing?.mcps) {
|
|
229
|
-
entry.mcps = existing.mcps;
|
|
230
|
-
}
|
|
231
|
-
config[agentId] = entry;
|
|
232
|
-
saveAgentConfig(config);
|
|
233
|
-
return { ok: true };
|
|
234
|
-
}
|
|
235
|
-
function setAgentMcps(agentId, mcps) {
|
|
236
|
-
const config = loadAgentConfig();
|
|
237
|
-
const existing = config[agentId] ?? getAgentRuntime(agentId);
|
|
238
|
-
existing.mcps = mcps.includes("exe-os") ? mcps : ["exe-os", ...mcps];
|
|
239
|
-
config[agentId] = existing;
|
|
240
|
-
saveAgentConfig(config);
|
|
241
|
-
return { ok: true };
|
|
242
|
-
}
|
|
243
|
-
function clearAgentRuntime(agentId) {
|
|
244
|
-
const config = loadAgentConfig();
|
|
245
|
-
delete config[agentId];
|
|
246
|
-
saveAgentConfig(config);
|
|
247
|
-
}
|
|
248
|
-
var AGENT_CONFIG_PATH, KNOWN_RUNTIMES, RUNTIME_LABELS, DEFAULT_MODELS;
|
|
249
|
-
var init_agent_config = __esm({
|
|
250
|
-
"src/lib/agent-config.ts"() {
|
|
251
|
-
"use strict";
|
|
252
|
-
init_config();
|
|
253
|
-
init_runtime_table();
|
|
254
|
-
init_secure_files();
|
|
255
|
-
AGENT_CONFIG_PATH = path2.join(EXE_AI_DIR, "agent-config.json");
|
|
256
|
-
KNOWN_RUNTIMES = {
|
|
257
|
-
claude: ["claude-opus-4.6", "claude-opus-4", "claude-sonnet-4.6", "claude-sonnet-4", "claude-haiku-4.5"],
|
|
258
|
-
codex: ["gpt-5.4", "gpt-5.5", "gpt-5.3-codex-spark", "o3", "o4-mini"],
|
|
259
|
-
opencode: ["anthropic/claude-sonnet-4-6", "openai/gpt-5.4", "google/gemini-2.5-pro", "deepseek/deepseek-r3", "minimax/minimax-m2.5"]
|
|
260
|
-
};
|
|
261
|
-
RUNTIME_LABELS = {
|
|
262
|
-
claude: "Claude Code (Anthropic)",
|
|
263
|
-
codex: "Codex (OpenAI)",
|
|
264
|
-
opencode: "OpenCode (open source)"
|
|
265
|
-
};
|
|
266
|
-
DEFAULT_MODELS = {
|
|
267
|
-
claude: "claude-opus-4.6",
|
|
268
|
-
codex: RUNTIME_TABLE.codex?.defaultModel ?? "gpt-5.4",
|
|
269
|
-
opencode: RUNTIME_TABLE.opencode?.defaultModel ?? "anthropic/claude-sonnet-4-6"
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
// src/lib/employees.ts
|
|
275
|
-
init_config();
|
|
276
|
-
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
277
|
-
import { existsSync as existsSync4, symlinkSync, readlinkSync, readFileSync as readFileSync3, renameSync as renameSync2, unlinkSync, writeFileSync as writeFileSync2 } from "fs";
|
|
278
|
-
import { execSync } from "child_process";
|
|
279
|
-
import path3 from "path";
|
|
280
|
-
import os2 from "os";
|
|
281
|
-
var EMPLOYEES_PATH = path3.join(EXE_AI_DIR, "exe-employees.json");
|
|
282
|
-
var DEFAULT_COORDINATOR_TEMPLATE_NAME = "exe";
|
|
283
|
-
var COORDINATOR_ROLE = "COO";
|
|
284
|
-
function normalizeRole(role) {
|
|
285
|
-
return (role ?? "").trim().toLowerCase();
|
|
286
|
-
}
|
|
287
|
-
function isCoordinatorRole(role) {
|
|
288
|
-
return normalizeRole(role) === normalizeRole(COORDINATOR_ROLE);
|
|
289
|
-
}
|
|
290
|
-
function getCoordinatorEmployee(employees) {
|
|
291
|
-
return employees.find((e) => isCoordinatorRole(e.role));
|
|
292
|
-
}
|
|
293
|
-
function getCoordinatorName(employees = loadEmployeesSync()) {
|
|
294
|
-
return getCoordinatorEmployee(employees)?.name ?? DEFAULT_COORDINATOR_TEMPLATE_NAME;
|
|
295
|
-
}
|
|
296
|
-
function isCoordinatorName(agentName, employees = loadEmployeesSync()) {
|
|
297
|
-
if (!agentName) return false;
|
|
298
|
-
return agentName.toLowerCase() === getCoordinatorName(employees).toLowerCase();
|
|
299
|
-
}
|
|
300
|
-
function canCoordinate(agentName, agentRole, employees = loadEmployeesSync()) {
|
|
301
|
-
return agentName === "default" || isCoordinatorRole(agentRole) || isCoordinatorName(agentName, employees);
|
|
302
|
-
}
|
|
303
|
-
function validateEmployeeName(name) {
|
|
304
|
-
if (!name) {
|
|
305
|
-
return { valid: false, error: "Name is required" };
|
|
306
|
-
}
|
|
307
|
-
if (name.length > 32) {
|
|
308
|
-
return { valid: false, error: "Name must be 32 characters or fewer" };
|
|
309
|
-
}
|
|
310
|
-
if (!/^[a-z][a-z0-9]*$/.test(name)) {
|
|
311
|
-
return {
|
|
312
|
-
valid: false,
|
|
313
|
-
error: "Name must start with a letter and contain only lowercase alphanumeric characters"
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
return { valid: true };
|
|
317
|
-
}
|
|
318
|
-
async function loadEmployees(employeesPath = EMPLOYEES_PATH) {
|
|
319
|
-
if (!existsSync4(employeesPath)) {
|
|
320
|
-
return [];
|
|
321
|
-
}
|
|
322
|
-
const raw = await readFile2(employeesPath, "utf-8");
|
|
323
|
-
try {
|
|
324
|
-
return JSON.parse(raw);
|
|
325
|
-
} catch {
|
|
326
|
-
return [];
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
async function saveEmployees(employees, employeesPath = EMPLOYEES_PATH) {
|
|
330
|
-
await mkdir2(path3.dirname(employeesPath), { recursive: true });
|
|
331
|
-
await writeFile2(employeesPath, JSON.stringify(employees, null, 2) + "\n", "utf-8");
|
|
332
|
-
}
|
|
333
|
-
function loadEmployeesSync(employeesPath = EMPLOYEES_PATH) {
|
|
334
|
-
if (!existsSync4(employeesPath)) return [];
|
|
335
|
-
try {
|
|
336
|
-
return JSON.parse(readFileSync3(employeesPath, "utf-8"));
|
|
337
|
-
} catch {
|
|
338
|
-
return [];
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
function getEmployee(employees, name) {
|
|
342
|
-
return employees.find((e) => e.name.toLowerCase() === name.toLowerCase());
|
|
343
|
-
}
|
|
344
|
-
function getEmployeeByRole(employees, role) {
|
|
345
|
-
const lower = role.toLowerCase();
|
|
346
|
-
return employees.find((e) => e.role.toLowerCase() === lower);
|
|
347
|
-
}
|
|
348
|
-
function getEmployeeNamesByRole(employees, role) {
|
|
349
|
-
const lower = role.toLowerCase();
|
|
350
|
-
return employees.filter((e) => e.role.toLowerCase() === lower).map((e) => e.name);
|
|
351
|
-
}
|
|
352
|
-
function hasRole(agentName, role) {
|
|
353
|
-
const employees = loadEmployeesSync();
|
|
354
|
-
const emp = getEmployee(employees, agentName);
|
|
355
|
-
return emp ? emp.role.toLowerCase() === role.toLowerCase() : false;
|
|
356
|
-
}
|
|
357
|
-
function baseAgentName(name, employees) {
|
|
358
|
-
const match = name.match(/^([a-zA-Z]+)\d+$/);
|
|
359
|
-
if (!match) return name;
|
|
360
|
-
const base = match[1];
|
|
361
|
-
const roster = employees ?? loadEmployeesSync();
|
|
362
|
-
if (getEmployee(roster, base)) return base;
|
|
363
|
-
return name;
|
|
364
|
-
}
|
|
365
|
-
var MULTI_INSTANCE_ROLES = /* @__PURE__ */ new Set(["principal engineer", "content production specialist", "staff code reviewer"]);
|
|
366
|
-
function isMultiInstance(agentName, employees) {
|
|
367
|
-
const roster = employees ?? loadEmployeesSync();
|
|
368
|
-
const emp = getEmployee(roster, agentName);
|
|
369
|
-
if (!emp) return false;
|
|
370
|
-
return MULTI_INSTANCE_ROLES.has(emp.role.toLowerCase());
|
|
371
|
-
}
|
|
372
|
-
function addEmployee(employees, employee) {
|
|
373
|
-
const { systemPrompt: _legacyPrompt, ...rest } = employee;
|
|
374
|
-
const normalized = { ...rest, name: employee.name.toLowerCase() };
|
|
375
|
-
if (employees.some((e) => e.name.toLowerCase() === normalized.name)) {
|
|
376
|
-
throw new Error(`Employee '${normalized.name}' already exists`);
|
|
377
|
-
}
|
|
378
|
-
return [...employees, normalized];
|
|
379
|
-
}
|
|
380
|
-
var IDENTITY_DIR = path3.join(EXE_AI_DIR, "identity");
|
|
381
|
-
var TEAM_SECTION_RE = /^## Team\b.*$/m;
|
|
382
|
-
function appendToCoordinatorTeam(employee) {
|
|
383
|
-
const coordinator = getCoordinatorEmployee(loadEmployeesSync());
|
|
384
|
-
if (!coordinator) return;
|
|
385
|
-
const idPath = path3.join(IDENTITY_DIR, `${coordinator.name}.md`);
|
|
386
|
-
if (!existsSync4(idPath)) return;
|
|
387
|
-
const content = readFileSync3(idPath, "utf-8");
|
|
388
|
-
if (content.includes(`**${capitalize(employee.name)}`)) return;
|
|
389
|
-
const teamMatch = content.match(TEAM_SECTION_RE);
|
|
390
|
-
if (!teamMatch || teamMatch.index === void 0) return;
|
|
391
|
-
const afterTeam = content.slice(teamMatch.index + teamMatch[0].length);
|
|
392
|
-
const nextHeading = afterTeam.match(/\n## /);
|
|
393
|
-
const entry = `
|
|
394
|
-
**${capitalize(employee.name)} (${employee.role}):** Newly hired. Update this description as the role develops.
|
|
395
|
-
`;
|
|
396
|
-
let updated;
|
|
397
|
-
if (nextHeading && nextHeading.index !== void 0) {
|
|
398
|
-
const insertAt = teamMatch.index + teamMatch[0].length + nextHeading.index;
|
|
399
|
-
updated = content.slice(0, insertAt) + entry + content.slice(insertAt);
|
|
400
|
-
} else {
|
|
401
|
-
updated = content.trimEnd() + "\n" + entry;
|
|
402
|
-
}
|
|
403
|
-
writeFileSync2(idPath, updated, "utf-8");
|
|
404
|
-
}
|
|
405
|
-
function capitalize(s) {
|
|
406
|
-
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
407
|
-
}
|
|
408
|
-
async function hireEmployee(employee) {
|
|
409
|
-
const employees = await loadEmployees();
|
|
410
|
-
const updated = addEmployee(employees, employee);
|
|
411
|
-
await saveEmployees(updated);
|
|
412
|
-
try {
|
|
413
|
-
appendToCoordinatorTeam(employee);
|
|
414
|
-
} catch {
|
|
415
|
-
}
|
|
416
|
-
try {
|
|
417
|
-
const { loadAgentConfig: loadAgentConfig2, saveAgentConfig: saveAgentConfig2 } = await Promise.resolve().then(() => (init_agent_config(), agent_config_exports));
|
|
418
|
-
const config = loadAgentConfig2();
|
|
419
|
-
const name = employee.name.toLowerCase();
|
|
420
|
-
if (!config[name] && config["default"]) {
|
|
421
|
-
config[name] = { ...config["default"] };
|
|
422
|
-
saveAgentConfig2(config);
|
|
423
|
-
}
|
|
424
|
-
} catch {
|
|
425
|
-
}
|
|
426
|
-
return updated;
|
|
427
|
-
}
|
|
428
|
-
async function normalizeRosterCase(rosterPath) {
|
|
429
|
-
const employees = await loadEmployees(rosterPath);
|
|
430
|
-
let changed = false;
|
|
431
|
-
for (const emp of employees) {
|
|
432
|
-
if (emp.name !== emp.name.toLowerCase()) {
|
|
433
|
-
const oldName = emp.name;
|
|
434
|
-
emp.name = emp.name.toLowerCase();
|
|
435
|
-
changed = true;
|
|
436
|
-
try {
|
|
437
|
-
const identityDir = path3.join(os2.homedir(), ".exe-os", "identity");
|
|
438
|
-
const oldPath = path3.join(identityDir, `${oldName}.md`);
|
|
439
|
-
const newPath = path3.join(identityDir, `${emp.name}.md`);
|
|
440
|
-
if (existsSync4(oldPath) && !existsSync4(newPath)) {
|
|
441
|
-
renameSync2(oldPath, newPath);
|
|
442
|
-
} else if (existsSync4(oldPath) && oldPath !== newPath) {
|
|
443
|
-
const content = readFileSync3(oldPath, "utf-8");
|
|
444
|
-
writeFileSync2(newPath, content, "utf-8");
|
|
445
|
-
if (oldPath.toLowerCase() !== newPath.toLowerCase()) {
|
|
446
|
-
unlinkSync(oldPath);
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
} catch {
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
if (changed) {
|
|
454
|
-
await saveEmployees(employees, rosterPath);
|
|
455
|
-
}
|
|
456
|
-
return changed;
|
|
457
|
-
}
|
|
458
|
-
function findExeBin() {
|
|
459
|
-
try {
|
|
460
|
-
return execSync(process.platform === "win32" ? "where exe-os" : "which exe-os", { encoding: "utf8" }).trim();
|
|
461
|
-
} catch {
|
|
462
|
-
return null;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
function registerBinSymlinks(name) {
|
|
466
|
-
const created = [];
|
|
467
|
-
const skipped = [];
|
|
468
|
-
const errors = [];
|
|
469
|
-
const exeBinPath = findExeBin();
|
|
470
|
-
if (!exeBinPath) {
|
|
471
|
-
errors.push("Could not find 'exe-os' in PATH");
|
|
472
|
-
return { created, skipped, errors };
|
|
473
|
-
}
|
|
474
|
-
const binDir = path3.dirname(exeBinPath);
|
|
475
|
-
let target;
|
|
476
|
-
try {
|
|
477
|
-
target = readlinkSync(exeBinPath);
|
|
478
|
-
} catch {
|
|
479
|
-
errors.push("Could not read 'exe' symlink");
|
|
480
|
-
return { created, skipped, errors };
|
|
481
|
-
}
|
|
482
|
-
for (const suffix of ["", "-opencode"]) {
|
|
483
|
-
const linkName = `${name}${suffix}`;
|
|
484
|
-
const linkPath = path3.join(binDir, linkName);
|
|
485
|
-
if (existsSync4(linkPath)) {
|
|
486
|
-
skipped.push(linkName);
|
|
487
|
-
continue;
|
|
488
|
-
}
|
|
489
|
-
try {
|
|
490
|
-
symlinkSync(target, linkPath);
|
|
491
|
-
created.push(linkName);
|
|
492
|
-
} catch (err) {
|
|
493
|
-
errors.push(`${linkName}: ${err instanceof Error ? err.message : String(err)}`);
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
return { created, skipped, errors };
|
|
497
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
COORDINATOR_ROLE,
|
|
3
|
+
DEFAULT_COORDINATOR_TEMPLATE_NAME,
|
|
4
|
+
EMPLOYEES_PATH,
|
|
5
|
+
addEmployee,
|
|
6
|
+
baseAgentName,
|
|
7
|
+
canCoordinate,
|
|
8
|
+
getCoordinatorEmployee,
|
|
9
|
+
getCoordinatorName,
|
|
10
|
+
getEmployee,
|
|
11
|
+
getEmployeeByRole,
|
|
12
|
+
getEmployeeNamesByRole,
|
|
13
|
+
hasRole,
|
|
14
|
+
hireEmployee,
|
|
15
|
+
init_employees,
|
|
16
|
+
isCoordinatorName,
|
|
17
|
+
isCoordinatorRole,
|
|
18
|
+
isMultiInstance,
|
|
19
|
+
loadEmployees,
|
|
20
|
+
loadEmployeesSync,
|
|
21
|
+
normalizeRole,
|
|
22
|
+
normalizeRosterCase,
|
|
23
|
+
registerBinSymlinks,
|
|
24
|
+
saveEmployees,
|
|
25
|
+
validateEmployeeName
|
|
26
|
+
} from "../chunk-RUG3N6P4.js";
|
|
27
|
+
import "../chunk-KVPG5UT6.js";
|
|
28
|
+
import "../chunk-X2IMCCM5.js";
|
|
29
|
+
import "../chunk-KFQGP6VL.js";
|
|
30
|
+
init_employees();
|
|
498
31
|
export {
|
|
499
32
|
COORDINATOR_ROLE,
|
|
500
33
|
DEFAULT_COORDINATOR_TEMPLATE_NAME,
|
|
@@ -1,152 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
];
|
|
11
|
-
function isExeMcpTool(toolName) {
|
|
12
|
-
if (!toolName) return false;
|
|
13
|
-
return MCP_TOOL_PREFIXES.some((p) => toolName.startsWith(p));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// src/lib/error-detector.ts
|
|
17
|
-
var ERROR_PATTERNS = [
|
|
18
|
-
/\bError\b/i,
|
|
19
|
-
/\bERR!\b/,
|
|
20
|
-
/\bFAIL(ED|URE)?\b/i,
|
|
21
|
-
/\bException\b/i,
|
|
22
|
-
/\bTraceback\b/,
|
|
23
|
-
/\bpanic\b/,
|
|
24
|
-
/\bSIGSEGV\b/,
|
|
25
|
-
/\bSIGABRT\b/,
|
|
26
|
-
/exit code [1-9]/i,
|
|
27
|
-
/non-zero (exit|status)/i,
|
|
28
|
-
/command not found/i,
|
|
29
|
-
/permission denied/i,
|
|
30
|
-
/ENOENT/,
|
|
31
|
-
/EACCES/,
|
|
32
|
-
/ENOMEM/
|
|
33
|
-
];
|
|
34
|
-
var FILE_CONTENT_TOOLS = /* @__PURE__ */ new Set([
|
|
35
|
-
"Read",
|
|
36
|
-
"Write",
|
|
37
|
-
"Edit",
|
|
38
|
-
"Glob",
|
|
39
|
-
"Grep",
|
|
40
|
-
"NotebookEdit"
|
|
41
|
-
]);
|
|
42
|
-
var STDERR_IGNORE_PATTERNS = [
|
|
43
|
-
/^warning\b/i,
|
|
44
|
-
/\bDeprecationWarning\b/,
|
|
45
|
-
/^hint:/i,
|
|
46
|
-
/^npm warn\b/i,
|
|
47
|
-
/^npm notice\b/i,
|
|
48
|
-
/^\(node:\d+\) \w*Warning:/,
|
|
49
|
-
/^Cloning into/,
|
|
50
|
-
/^Already on/,
|
|
51
|
-
/^Switched to/,
|
|
52
|
-
/^Your branch is/,
|
|
53
|
-
/^Auto-merging/,
|
|
54
|
-
/^\s*$/
|
|
55
|
-
];
|
|
56
|
-
function isRealStderr(stderr) {
|
|
57
|
-
const lines = stderr.trim().split("\n");
|
|
58
|
-
const meaningful = lines.filter(
|
|
59
|
-
(line) => line.trim().length > 0 && !STDERR_IGNORE_PATTERNS.some((p) => p.test(line))
|
|
60
|
-
);
|
|
61
|
-
return meaningful.length > 0;
|
|
62
|
-
}
|
|
63
|
-
function logSuppression(exitCode, stderr, stdout) {
|
|
64
|
-
process.stderr.write(
|
|
65
|
-
`[error-detector] suppressed bash non-zero exit: code=${exitCode} stderr_len=${stderr.length} stdout_len=${stdout.length}
|
|
66
|
-
`
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
function detectError(data) {
|
|
70
|
-
const response = data.tool_response;
|
|
71
|
-
if (!response) return false;
|
|
72
|
-
const toolName = data.tool_name ?? "";
|
|
73
|
-
if (FILE_CONTENT_TOOLS.has(toolName)) {
|
|
74
|
-
return response.type === "error" || response.error != null;
|
|
75
|
-
}
|
|
76
|
-
if (toolName === "Bash") {
|
|
77
|
-
const exitCode = typeof response.exitCode === "number" ? response.exitCode : 0;
|
|
78
|
-
const stderr = typeof response.stderr === "string" ? response.stderr : "";
|
|
79
|
-
const stdout = typeof response.stdout === "string" ? response.stdout : "";
|
|
80
|
-
if (exitCode === 141) {
|
|
81
|
-
logSuppression(exitCode, stderr, stdout);
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
if (stderr.trim().length > 0 && isRealStderr(stderr)) return true;
|
|
85
|
-
if (exitCode !== 0 && !isRealStderr(stderr) && stdout.trim().length > 0) {
|
|
86
|
-
logSuppression(exitCode, stderr, stdout);
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
if (exitCode !== 0) return true;
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
if (response.type === "error" || response.error != null || response.isError === true) {
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
if (typeof response.stderr === "string" && response.stderr.trim().length > 0) {
|
|
96
|
-
if (isRealStderr(response.stderr)) return true;
|
|
97
|
-
}
|
|
98
|
-
const textParts = [];
|
|
99
|
-
if (typeof response.stdout === "string") textParts.push(response.stdout);
|
|
100
|
-
if (typeof response.output === "string") textParts.push(response.output);
|
|
101
|
-
if (typeof response.text === "string") textParts.push(response.text);
|
|
102
|
-
if (typeof response.message === "string") textParts.push(response.message);
|
|
103
|
-
if (textParts.length === 0) return false;
|
|
104
|
-
const text = textParts.join("\n");
|
|
105
|
-
return ERROR_PATTERNS.some((pattern) => pattern.test(text));
|
|
106
|
-
}
|
|
107
|
-
function isExeOsError(data) {
|
|
108
|
-
const toolName = data.tool_name ?? "";
|
|
109
|
-
if (isExeMcpTool(toolName)) return true;
|
|
110
|
-
if (toolName === "Bash") {
|
|
111
|
-
const cmd = String(data.tool_input?.command ?? "");
|
|
112
|
-
if (/\bexe-os\b|exe-boot|exe-healthcheck|scan-tasks|exe-call/.test(cmd)) return true;
|
|
113
|
-
if (/node.*dist\/(bin|hooks|lib)\//.test(cmd)) return true;
|
|
114
|
-
}
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
var USER_ERROR_PATTERNS = [
|
|
118
|
-
/not found:?\s/i,
|
|
119
|
-
/expected \d+ words/i,
|
|
120
|
-
/provide either/i,
|
|
121
|
-
/invalid.*parameter/i,
|
|
122
|
-
/already exists/i,
|
|
123
|
-
/Multiple tasks match/i,
|
|
124
|
-
/Use a more specific identifier/i
|
|
125
|
-
];
|
|
126
|
-
var SYSTEM_BUG_PATTERNS = [
|
|
127
|
-
/SQLITE_ERROR/,
|
|
128
|
-
/Cannot find module/,
|
|
129
|
-
/ERR_MODULE_NOT_FOUND/,
|
|
130
|
-
/TypeError:/,
|
|
131
|
-
/ReferenceError:/,
|
|
132
|
-
/Cannot read propert/,
|
|
133
|
-
/is not a function/,
|
|
134
|
-
/ENOENT.*dist\//,
|
|
135
|
-
/dimension mismatch/i,
|
|
136
|
-
/unhealthy.*model/i,
|
|
137
|
-
/constraint.*violat/i
|
|
138
|
-
];
|
|
139
|
-
function classifyError(errorText) {
|
|
140
|
-
if (USER_ERROR_PATTERNS.some((p) => p.test(errorText))) return "user";
|
|
141
|
-
if (SYSTEM_BUG_PATTERNS.some((p) => p.test(errorText))) return "system";
|
|
142
|
-
if (/at\s+\S+\s+\(.*exe-os.*\)/m.test(errorText)) return "system";
|
|
143
|
-
if (/at\s+\S+\s+\(.*dist\/(lib|bin|hooks|mcp)\//m.test(errorText)) return "system";
|
|
144
|
-
return "unknown";
|
|
145
|
-
}
|
|
146
|
-
function errorFingerprint(toolName, errorText) {
|
|
147
|
-
const normalized = errorText.replace(/\d{4}-\d{2}-\d{2}T[\d:.]+Z/g, "TIMESTAMP").replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, "UUID").replace(/\/Users\/[^\s]+/g, "PATH").replace(/:\d+:\d+/g, ":LINE:COL").slice(0, 200);
|
|
148
|
-
return crypto.createHash("sha256").update(`${toolName}:${normalized}`).digest("hex").slice(0, 16);
|
|
149
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
ERROR_PATTERNS,
|
|
3
|
+
classifyError,
|
|
4
|
+
detectError,
|
|
5
|
+
errorFingerprint,
|
|
6
|
+
isExeOsError
|
|
7
|
+
} from "../chunk-2WGSIVI4.js";
|
|
8
|
+
import "../chunk-6BFIFI5F.js";
|
|
9
|
+
import "../chunk-KFQGP6VL.js";
|
|
150
10
|
export {
|
|
151
11
|
ERROR_PATTERNS,
|
|
152
12
|
classifyError,
|