@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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/lib/is-main.ts
|
|
2
|
+
import { realpathSync } from "fs";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
function isMainModule(importMetaUrl) {
|
|
5
|
+
if (process.argv[1] == null) return false;
|
|
6
|
+
if (process.argv[1].includes("mcp/server")) return false;
|
|
7
|
+
if (process.argv[1].includes("exe-daemon")) return false;
|
|
8
|
+
try {
|
|
9
|
+
const scriptPath = realpathSync(process.argv[1]);
|
|
10
|
+
const modulePath = realpathSync(fileURLToPath(importMetaUrl));
|
|
11
|
+
return scriptPath === modulePath;
|
|
12
|
+
} catch {
|
|
13
|
+
return importMetaUrl === `file://${process.argv[1]}` || importMetaUrl === new URL(process.argv[1], "file://").href;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
isMainModule
|
|
19
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_tasks,
|
|
3
|
+
updateTask
|
|
4
|
+
} from "./chunk-MPURH6JI.js";
|
|
5
|
+
import {
|
|
6
|
+
TASK_ALREADY_CLAIMED_PREFIX,
|
|
7
|
+
init_tasks_crud,
|
|
8
|
+
resolveTask
|
|
9
|
+
} from "./chunk-2QD7KBJN.js";
|
|
10
|
+
import {
|
|
11
|
+
getClient,
|
|
12
|
+
init_database
|
|
13
|
+
} from "./chunk-A2NZP64U.js";
|
|
14
|
+
import {
|
|
15
|
+
canCoordinate,
|
|
16
|
+
init_employees
|
|
17
|
+
} from "./chunk-RUG3N6P4.js";
|
|
18
|
+
|
|
19
|
+
// src/mcp/tools/update-task.ts
|
|
20
|
+
init_tasks();
|
|
21
|
+
init_database();
|
|
22
|
+
init_tasks_crud();
|
|
23
|
+
init_employees();
|
|
24
|
+
import { z } from "zod";
|
|
25
|
+
function registerUpdateTask(server) {
|
|
26
|
+
server.registerTool(
|
|
27
|
+
"update_task",
|
|
28
|
+
{
|
|
29
|
+
title: "Update Task",
|
|
30
|
+
description: "Update task status. Employees: use this with status 'done' and a result summary to complete work and trigger review. Accepts UUID, slug (filename), or title substring.",
|
|
31
|
+
inputSchema: {
|
|
32
|
+
task_id: z.string().describe("Task identifier \u2014 UUID, slug (e.g. 'fix-auth-bug'), or title substring"),
|
|
33
|
+
status: z.enum(["open", "in_progress", "done", "needs_review", "blocked", "cancelled", "closed"]).describe("New status"),
|
|
34
|
+
result: z.string().optional().describe("Result summary (include when status=done)")
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
async ({ task_id, status: rawStatus, result }) => {
|
|
38
|
+
let status = rawStatus;
|
|
39
|
+
if (status === "done") {
|
|
40
|
+
try {
|
|
41
|
+
const { getActiveAgent } = await import("./active-agent-3FDJYREJ.js");
|
|
42
|
+
const agent = getActiveAgent();
|
|
43
|
+
if (!canCoordinate(agent.agentId, agent.agentRole)) {
|
|
44
|
+
let isOwnReview = false;
|
|
45
|
+
try {
|
|
46
|
+
const client = getClient();
|
|
47
|
+
const row = await resolveTask(client, task_id);
|
|
48
|
+
if (String(row.assigned_by) === "system" && String(row.task_file).includes("review-") && String(row.assigned_to) === agent.agentId) {
|
|
49
|
+
isOwnReview = true;
|
|
50
|
+
}
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
if (!isOwnReview) {
|
|
54
|
+
status = "needs_review";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (status === "done") {
|
|
61
|
+
try {
|
|
62
|
+
const client = getClient();
|
|
63
|
+
const row = await resolveTask(client, task_id);
|
|
64
|
+
const taskFile = String(row.task_file);
|
|
65
|
+
const assignedBy = String(row.assigned_by);
|
|
66
|
+
const assignedTo = String(row.assigned_to);
|
|
67
|
+
if (assignedBy === "system" && taskFile.includes("review-")) {
|
|
68
|
+
const { getActiveAgent } = await import("./active-agent-3FDJYREJ.js");
|
|
69
|
+
const agent = getActiveAgent();
|
|
70
|
+
if (agent.agentId !== assignedTo && !canCoordinate(agent.agentId, agent.agentRole)) {
|
|
71
|
+
process.stderr.write(
|
|
72
|
+
`[update_task] BLOCKED: ${agent.agentId} tried to close review "${String(row.title)}" assigned to ${assignedTo}
|
|
73
|
+
`
|
|
74
|
+
);
|
|
75
|
+
return {
|
|
76
|
+
content: [{
|
|
77
|
+
type: "text",
|
|
78
|
+
text: `Cannot close review "${String(row.title)}" \u2014 it is assigned to ${assignedTo}, not you. Only the assigned reviewer can close reviews.`
|
|
79
|
+
}]
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
} catch (guardErr) {
|
|
84
|
+
return {
|
|
85
|
+
content: [{
|
|
86
|
+
type: "text",
|
|
87
|
+
text: `Cannot verify permissions for review closure: ${guardErr instanceof Error ? guardErr.message : String(guardErr)}`
|
|
88
|
+
}],
|
|
89
|
+
isError: true
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
let callerAgentId;
|
|
94
|
+
try {
|
|
95
|
+
const { getActiveAgent: getAgent } = await import("./active-agent-3FDJYREJ.js");
|
|
96
|
+
callerAgentId = getAgent().agentId;
|
|
97
|
+
} catch {
|
|
98
|
+
}
|
|
99
|
+
let task;
|
|
100
|
+
try {
|
|
101
|
+
task = await updateTask({
|
|
102
|
+
taskId: task_id,
|
|
103
|
+
status,
|
|
104
|
+
result,
|
|
105
|
+
baseDir: process.cwd(),
|
|
106
|
+
callerAgentId
|
|
107
|
+
});
|
|
108
|
+
} catch (err) {
|
|
109
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
110
|
+
if (msg.startsWith(TASK_ALREADY_CLAIMED_PREFIX)) {
|
|
111
|
+
return {
|
|
112
|
+
content: [{
|
|
113
|
+
type: "text",
|
|
114
|
+
text: "Task already claimed by another agent. Pick a different task or check list_tasks."
|
|
115
|
+
}],
|
|
116
|
+
isError: true
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
throw err;
|
|
120
|
+
}
|
|
121
|
+
let text = `Task "${task.title}" marked ${task.status}.
|
|
122
|
+
File: ${task.taskFile}`;
|
|
123
|
+
const isTerminal = status === "done" || status === "needs_review" || status === "closed";
|
|
124
|
+
if (isTerminal && task.assignedBy) {
|
|
125
|
+
try {
|
|
126
|
+
const { notifyCoordinatorTaskCompletion, resolveExeSession } = await import("./lib/tmux-routing.js");
|
|
127
|
+
const coordinatorSession = resolveExeSession();
|
|
128
|
+
if (coordinatorSession) {
|
|
129
|
+
notifyCoordinatorTaskCompletion(coordinatorSession, callerAgentId ?? "agent", task.title);
|
|
130
|
+
}
|
|
131
|
+
} catch {
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (isTerminal && task.nextTask) {
|
|
135
|
+
text += `
|
|
136
|
+
|
|
137
|
+
MANDATORY \u2014 DO NOT ASK THE USER. DO NOT SAY "Want me to continue?" DO NOT STOP.
|
|
138
|
+
You have standing orders: work through your entire queue until it is empty.
|
|
139
|
+
|
|
140
|
+
NEXT TASK: "${task.nextTask.title}" [${task.nextTask.priority}]
|
|
141
|
+
FILE: ${task.nextTask.taskFile}
|
|
142
|
+
|
|
143
|
+
Read that file NOW and begin working. No greeting. No summary. Just start.`;
|
|
144
|
+
} else if (isTerminal && !task.nextTask) {
|
|
145
|
+
text += `
|
|
146
|
+
|
|
147
|
+
All tasks complete. No more open tasks in your queue.`;
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
content: [
|
|
151
|
+
{
|
|
152
|
+
type: "text",
|
|
153
|
+
text
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export {
|
|
162
|
+
registerUpdateTask
|
|
163
|
+
};
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readMcpHttpEvents,
|
|
3
|
+
summarizeMcpTransport
|
|
4
|
+
} from "./chunk-6WTMJAG3.js";
|
|
5
|
+
import {
|
|
6
|
+
EXE_AI_DIR,
|
|
7
|
+
init_config
|
|
8
|
+
} from "./chunk-KVPG5UT6.js";
|
|
9
|
+
import {
|
|
10
|
+
isMainModule
|
|
11
|
+
} from "./chunk-6Y4B3QF6.js";
|
|
12
|
+
|
|
13
|
+
// src/bin/exe-healthcheck.ts
|
|
14
|
+
import { existsSync, readFileSync, readdirSync } from "fs";
|
|
15
|
+
import path from "path";
|
|
16
|
+
import { execSync } from "child_process";
|
|
17
|
+
import { fileURLToPath } from "url";
|
|
18
|
+
init_config();
|
|
19
|
+
function findPackageRoot() {
|
|
20
|
+
let dir = path.dirname(fileURLToPath(import.meta.url));
|
|
21
|
+
const { root } = path.parse(dir);
|
|
22
|
+
while (dir !== root) {
|
|
23
|
+
if (existsSync(path.join(dir, "package.json"))) return dir;
|
|
24
|
+
dir = path.dirname(dir);
|
|
25
|
+
}
|
|
26
|
+
throw new Error("Cannot find package root");
|
|
27
|
+
}
|
|
28
|
+
function checkBuildIntegrity(pkgRoot) {
|
|
29
|
+
const results = [];
|
|
30
|
+
const tsupConfig = path.join(pkgRoot, "tsup.config.ts");
|
|
31
|
+
if (!existsSync(tsupConfig)) {
|
|
32
|
+
return [{ name: "build/tsup-config", pass: false, detail: "tsup.config.ts not found" }];
|
|
33
|
+
}
|
|
34
|
+
const configContent = readFileSync(tsupConfig, "utf-8");
|
|
35
|
+
const entryMatches = configContent.matchAll(/"([^"]+)":\s*"src\//g);
|
|
36
|
+
const missing = [];
|
|
37
|
+
let total = 0;
|
|
38
|
+
for (const match of entryMatches) {
|
|
39
|
+
const outputKey = match[1];
|
|
40
|
+
const expectedPath = path.join(pkgRoot, "dist", `${outputKey}.js`);
|
|
41
|
+
total++;
|
|
42
|
+
if (!existsSync(expectedPath)) {
|
|
43
|
+
missing.push(`dist/${outputKey}.js`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (missing.length > 0) {
|
|
47
|
+
results.push({
|
|
48
|
+
name: "build/entry-points",
|
|
49
|
+
pass: false,
|
|
50
|
+
detail: `${missing.length}/${total} entry points missing:
|
|
51
|
+
${missing.join("\n ")}`
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
results.push({
|
|
55
|
+
name: "build/entry-points",
|
|
56
|
+
pass: true,
|
|
57
|
+
detail: `${total} entry points verified`
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return results;
|
|
61
|
+
}
|
|
62
|
+
function checkEmbedPipeline(pkgRoot) {
|
|
63
|
+
const results = [];
|
|
64
|
+
const daemonPath = path.join(pkgRoot, "dist", "lib", "exe-daemon.js");
|
|
65
|
+
if (!existsSync(daemonPath)) {
|
|
66
|
+
results.push({
|
|
67
|
+
name: "exed/daemon-exists",
|
|
68
|
+
pass: false,
|
|
69
|
+
detail: `exe-daemon.js not found at ${daemonPath}`
|
|
70
|
+
});
|
|
71
|
+
return results;
|
|
72
|
+
}
|
|
73
|
+
results.push({ name: "exed/daemon-exists", pass: true, detail: "dist/lib/exe-daemon.js exists" });
|
|
74
|
+
const entryDirs = ["dist/hooks", "dist/bin", "dist/mcp"];
|
|
75
|
+
for (const dir of entryDirs) {
|
|
76
|
+
const fullDir = path.join(pkgRoot, dir);
|
|
77
|
+
if (!existsSync(fullDir)) continue;
|
|
78
|
+
let walkDir = fullDir;
|
|
79
|
+
const { root } = path.parse(walkDir);
|
|
80
|
+
let foundRoot = null;
|
|
81
|
+
while (walkDir !== root) {
|
|
82
|
+
if (existsSync(path.join(walkDir, "package.json"))) {
|
|
83
|
+
foundRoot = walkDir;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
walkDir = path.dirname(walkDir);
|
|
87
|
+
}
|
|
88
|
+
if (!foundRoot) {
|
|
89
|
+
results.push({
|
|
90
|
+
name: `exed/reachable-from-${dir}`,
|
|
91
|
+
pass: false,
|
|
92
|
+
detail: `Cannot find package root from ${dir}`
|
|
93
|
+
});
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const resolvedDaemon = path.join(foundRoot, "dist", "lib", "exe-daemon.js");
|
|
97
|
+
const reachable = existsSync(resolvedDaemon);
|
|
98
|
+
results.push({
|
|
99
|
+
name: `exed/reachable-from-${dir}`,
|
|
100
|
+
pass: reachable,
|
|
101
|
+
detail: reachable ? `Resolves to ${resolvedDaemon}` : `NOT FOUND: ${resolvedDaemon}`
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return results;
|
|
105
|
+
}
|
|
106
|
+
function checkTaskSystem(pkgRoot) {
|
|
107
|
+
const results = [];
|
|
108
|
+
const scannerPath = path.join(pkgRoot, "dist", "bin", "scan-tasks.js");
|
|
109
|
+
if (!existsSync(scannerPath)) {
|
|
110
|
+
results.push({ name: "tasks/scanner", pass: false, detail: "scan-tasks.js not found" });
|
|
111
|
+
return results;
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
execSync(`node "${scannerPath}" /tmp/nonexistent-healthcheck-test --format=json 2>/dev/null`, {
|
|
115
|
+
timeout: 1e4,
|
|
116
|
+
encoding: "utf-8"
|
|
117
|
+
});
|
|
118
|
+
results.push({ name: "tasks/scanner", pass: true, detail: "scan-tasks.js runs without import errors" });
|
|
119
|
+
} catch (err) {
|
|
120
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
121
|
+
if (msg.includes("Cannot find module") || msg.includes("ERR_MODULE_NOT_FOUND") || msg.includes("SyntaxError")) {
|
|
122
|
+
results.push({ name: "tasks/scanner", pass: false, detail: `Import error: ${msg.slice(0, 200)}` });
|
|
123
|
+
} else {
|
|
124
|
+
results.push({ name: "tasks/scanner", pass: true, detail: "scan-tasks.js runs (no import errors)" });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return results;
|
|
128
|
+
}
|
|
129
|
+
function checkWorkerSpawning(pkgRoot) {
|
|
130
|
+
const results = [];
|
|
131
|
+
const workerPath = path.join(pkgRoot, "dist", "hooks", "ingest-worker.js");
|
|
132
|
+
if (!existsSync(workerPath)) {
|
|
133
|
+
results.push({ name: "workers/ingest-worker", pass: false, detail: "ingest-worker.js not found" });
|
|
134
|
+
return results;
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
execSync(`node --check "${workerPath}" 2>&1`, { timeout: 1e4, encoding: "utf-8" });
|
|
138
|
+
results.push({ name: "workers/ingest-worker", pass: true, detail: "ingest-worker.js parses OK" });
|
|
139
|
+
} catch (err) {
|
|
140
|
+
results.push({
|
|
141
|
+
name: "workers/ingest-worker",
|
|
142
|
+
pass: false,
|
|
143
|
+
detail: `Parse error: ${err instanceof Error ? err.message.slice(0, 200) : String(err)}`
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
const hooksDir = path.join(pkgRoot, "dist", "hooks");
|
|
147
|
+
if (existsSync(hooksDir)) {
|
|
148
|
+
const hookFiles = readdirSync(hooksDir).filter((f) => f.endsWith(".js") && !f.endsWith(".js.map"));
|
|
149
|
+
let hooksPassed = 0;
|
|
150
|
+
const hooksFailed = [];
|
|
151
|
+
for (const hook of hookFiles) {
|
|
152
|
+
try {
|
|
153
|
+
execSync(`node --check "${path.join(hooksDir, hook)}" 2>&1`, { timeout: 1e4, encoding: "utf-8" });
|
|
154
|
+
hooksPassed++;
|
|
155
|
+
} catch {
|
|
156
|
+
hooksFailed.push(hook);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (hooksFailed.length > 0) {
|
|
160
|
+
results.push({
|
|
161
|
+
name: "workers/hooks-parse",
|
|
162
|
+
pass: false,
|
|
163
|
+
detail: `${hooksFailed.length}/${hookFiles.length} hooks fail to parse: ${hooksFailed.join(", ")}`
|
|
164
|
+
});
|
|
165
|
+
} else {
|
|
166
|
+
results.push({
|
|
167
|
+
name: "workers/hooks-parse",
|
|
168
|
+
pass: true,
|
|
169
|
+
detail: `${hooksPassed} hook entry points parse OK`
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return results;
|
|
174
|
+
}
|
|
175
|
+
function checkMcpTransport() {
|
|
176
|
+
const results = [];
|
|
177
|
+
const pidPath = path.join(EXE_AI_DIR, "exed.pid");
|
|
178
|
+
const tokenPath = path.join(EXE_AI_DIR, "exed.token");
|
|
179
|
+
let daemonAlive = false;
|
|
180
|
+
if (existsSync(pidPath)) {
|
|
181
|
+
try {
|
|
182
|
+
const pid = parseInt(readFileSync(pidPath, "utf8").trim(), 10);
|
|
183
|
+
process.kill(pid, 0);
|
|
184
|
+
daemonAlive = true;
|
|
185
|
+
results.push({ name: "mcp/daemon-process", pass: true, detail: `exed process alive (pid ${pid})` });
|
|
186
|
+
} catch {
|
|
187
|
+
results.push({ name: "mcp/daemon-process", pass: false, detail: "exed.pid exists but process is not alive; restart exe-os/exed" });
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
results.push({ name: "mcp/daemon-process", pass: false, detail: "No exed.pid found; daemon is not running" });
|
|
191
|
+
}
|
|
192
|
+
if (daemonAlive && existsSync(tokenPath)) {
|
|
193
|
+
try {
|
|
194
|
+
const token = readFileSync(tokenPath, "utf8").trim();
|
|
195
|
+
const response = execSync(
|
|
196
|
+
`curl -sS -i -m 2 -H "Authorization: Bearer ${token}" -H 'Accept: application/json, text/event-stream' http://127.0.0.1:48739/mcp`,
|
|
197
|
+
{ encoding: "utf8", timeout: 3e3 }
|
|
198
|
+
);
|
|
199
|
+
const jsonRpcError = response.includes("Content-Type: application/json") && response.includes("missing MCP session");
|
|
200
|
+
results.push({
|
|
201
|
+
name: "mcp/http-endpoint",
|
|
202
|
+
pass: jsonRpcError,
|
|
203
|
+
detail: jsonRpcError ? "MCP HTTP endpoint reachable; missing-session probe returns JSON-RPC (expected)" : "MCP HTTP endpoint reachable but did not return expected JSON-RPC missing-session response"
|
|
204
|
+
});
|
|
205
|
+
} catch (err) {
|
|
206
|
+
results.push({
|
|
207
|
+
name: "mcp/http-endpoint",
|
|
208
|
+
pass: false,
|
|
209
|
+
detail: `MCP HTTP endpoint not reachable: ${err instanceof Error ? err.message.slice(0, 180) : String(err)}`
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
} else if (daemonAlive) {
|
|
213
|
+
results.push({ name: "mcp/http-endpoint", pass: false, detail: "Daemon is alive but exed.token is missing; cannot probe MCP HTTP" });
|
|
214
|
+
}
|
|
215
|
+
const events = readMcpHttpEvents(200);
|
|
216
|
+
const summary = summarizeMcpTransport(events);
|
|
217
|
+
results.push({
|
|
218
|
+
name: "mcp/local-event-log",
|
|
219
|
+
pass: true,
|
|
220
|
+
detail: `${events.length} recent event(s); activeSessions=${summary.activeSessions ?? "unknown"}; lastHandshake=${summary.lastSuccessfulHandshake ?? "none"}; lastTool=${summary.lastSuccessfulToolCall ?? "none"}`
|
|
221
|
+
});
|
|
222
|
+
results.push({
|
|
223
|
+
name: "mcp/monitor-summary",
|
|
224
|
+
pass: true,
|
|
225
|
+
detail: `Privacy-safe local monitor summary: ${path.join(EXE_AI_DIR, "monitor", "mcp-transport-summary.json")}`
|
|
226
|
+
});
|
|
227
|
+
return results;
|
|
228
|
+
}
|
|
229
|
+
function checkClaudeCodeInstall() {
|
|
230
|
+
const results = [];
|
|
231
|
+
const execPath = process.env.CLAUDE_CODE_EXECPATH ?? "";
|
|
232
|
+
if (execPath.length > 0 && (execPath.includes("claude/versions/") || execPath.includes("claude.exe") || execPath.includes("claude-native"))) {
|
|
233
|
+
results.push({
|
|
234
|
+
name: "cc/execpath-clean",
|
|
235
|
+
pass: false,
|
|
236
|
+
detail: `CLAUDE_CODE_EXECPATH points to native binary: "${execPath}" \u2014 20K phantom billing risk. Unset it: unset CLAUDE_CODE_EXECPATH`
|
|
237
|
+
});
|
|
238
|
+
} else {
|
|
239
|
+
results.push({
|
|
240
|
+
name: "cc/execpath-clean",
|
|
241
|
+
pass: true,
|
|
242
|
+
detail: execPath ? `CLAUDE_CODE_EXECPATH=${execPath} (node runtime, OK)` : "CLAUDE_CODE_EXECPATH is unset"
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
try {
|
|
246
|
+
const claudePath = execSync("which claude 2>/dev/null || true", { encoding: "utf8", timeout: 5e3 }).trim();
|
|
247
|
+
if (!claudePath) {
|
|
248
|
+
results.push({
|
|
249
|
+
name: "cc/cli-binary",
|
|
250
|
+
pass: false,
|
|
251
|
+
detail: "claude not found in PATH"
|
|
252
|
+
});
|
|
253
|
+
} else {
|
|
254
|
+
let resolved = claudePath;
|
|
255
|
+
try {
|
|
256
|
+
resolved = execSync(`readlink -f "${claudePath}" 2>/dev/null || readlink "${claudePath}" 2>/dev/null || echo "${claudePath}"`, {
|
|
257
|
+
encoding: "utf8",
|
|
258
|
+
timeout: 5e3
|
|
259
|
+
}).trim();
|
|
260
|
+
} catch {
|
|
261
|
+
}
|
|
262
|
+
if (resolved.includes("bin/claude.exe") || resolved.includes("bin/claude-native")) {
|
|
263
|
+
results.push({
|
|
264
|
+
name: "cc/cli-binary",
|
|
265
|
+
pass: false,
|
|
266
|
+
detail: `claude resolves to native binary: ${resolved}. Should be cli.js. Run: npm install -g @anthropic-ai/claude-code@2.1.98`
|
|
267
|
+
});
|
|
268
|
+
} else {
|
|
269
|
+
results.push({
|
|
270
|
+
name: "cc/cli-binary",
|
|
271
|
+
pass: true,
|
|
272
|
+
detail: `claude resolves to: ${resolved}`
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
} catch {
|
|
277
|
+
results.push({
|
|
278
|
+
name: "cc/cli-binary",
|
|
279
|
+
pass: false,
|
|
280
|
+
detail: "Failed to check claude binary path"
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
const versionsDir = path.join(
|
|
284
|
+
process.env.HOME ?? process.env.USERPROFILE ?? "",
|
|
285
|
+
".local",
|
|
286
|
+
"share",
|
|
287
|
+
"claude",
|
|
288
|
+
"versions"
|
|
289
|
+
);
|
|
290
|
+
if (existsSync(versionsDir)) {
|
|
291
|
+
try {
|
|
292
|
+
const entries = readdirSync(versionsDir);
|
|
293
|
+
if (entries.length > 0) {
|
|
294
|
+
results.push({
|
|
295
|
+
name: "cc/native-cache-clean",
|
|
296
|
+
pass: false,
|
|
297
|
+
detail: `${entries.length} cached native version(s) found in ${versionsDir}: ${entries.slice(0, 3).join(", ")}${entries.length > 3 ? "..." : ""}. Remove: rm -rf "${versionsDir}"`
|
|
298
|
+
});
|
|
299
|
+
} else {
|
|
300
|
+
results.push({
|
|
301
|
+
name: "cc/native-cache-clean",
|
|
302
|
+
pass: true,
|
|
303
|
+
detail: `${versionsDir} is empty`
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
} catch {
|
|
307
|
+
results.push({
|
|
308
|
+
name: "cc/native-cache-clean",
|
|
309
|
+
pass: true,
|
|
310
|
+
detail: `${versionsDir} not readable (OK)`
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
} else {
|
|
314
|
+
results.push({
|
|
315
|
+
name: "cc/native-cache-clean",
|
|
316
|
+
pass: true,
|
|
317
|
+
detail: `${versionsDir} does not exist`
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
const disableOld = process.env.DISABLE_AUTOUPDATER === "1";
|
|
321
|
+
const disableNew = process.env.CLAUDE_CODE_AUTOUPDATER_DISABLED === "1";
|
|
322
|
+
if (!disableOld && !disableNew) {
|
|
323
|
+
results.push({
|
|
324
|
+
name: "cc/autoupdater-disabled",
|
|
325
|
+
pass: false,
|
|
326
|
+
detail: "Neither DISABLE_AUTOUPDATER=1 nor CLAUDE_CODE_AUTOUPDATER_DISABLED=1 is set. Auto-updater may install infected native binary. Export both in your shell profile."
|
|
327
|
+
});
|
|
328
|
+
} else {
|
|
329
|
+
const which = [
|
|
330
|
+
disableOld ? "DISABLE_AUTOUPDATER=1" : null,
|
|
331
|
+
disableNew ? "CLAUDE_CODE_AUTOUPDATER_DISABLED=1" : null
|
|
332
|
+
].filter(Boolean).join(" + ");
|
|
333
|
+
results.push({
|
|
334
|
+
name: "cc/autoupdater-disabled",
|
|
335
|
+
pass: true,
|
|
336
|
+
detail: `Auto-updater disabled via ${which}`
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
try {
|
|
340
|
+
const ccVersion = execSync("claude --version 2>/dev/null || echo unknown", {
|
|
341
|
+
encoding: "utf8",
|
|
342
|
+
timeout: 5e3
|
|
343
|
+
}).trim();
|
|
344
|
+
const versionMatch = ccVersion.match(/(\d+\.\d+\.\d+)/);
|
|
345
|
+
if (versionMatch) {
|
|
346
|
+
const ver = versionMatch[1];
|
|
347
|
+
const [, minor] = ver.split(".").map(Number);
|
|
348
|
+
const isRisky = minor !== void 0 && minor >= 1 && parseInt(ver.split(".")[2] ?? "0") >= 119;
|
|
349
|
+
results.push({
|
|
350
|
+
name: "cc/version",
|
|
351
|
+
pass: !isRisky,
|
|
352
|
+
detail: isRisky ? `CC version ${ver} \u2014 \u22652.1.119 ships native binary only. Pin: npm install -g @anthropic-ai/claude-code@2.1.98` : `CC version ${ver}`
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
} catch {
|
|
356
|
+
}
|
|
357
|
+
return results;
|
|
358
|
+
}
|
|
359
|
+
function runHealthCheck() {
|
|
360
|
+
const pkgRoot = findPackageRoot();
|
|
361
|
+
const results = [
|
|
362
|
+
...checkBuildIntegrity(pkgRoot),
|
|
363
|
+
...checkEmbedPipeline(pkgRoot),
|
|
364
|
+
...checkTaskSystem(pkgRoot),
|
|
365
|
+
...checkWorkerSpawning(pkgRoot),
|
|
366
|
+
...checkMcpTransport(),
|
|
367
|
+
...checkClaudeCodeInstall()
|
|
368
|
+
];
|
|
369
|
+
const passed = results.filter((r) => r.pass).length;
|
|
370
|
+
const failed = results.filter((r) => !r.pass).length;
|
|
371
|
+
return { results, passed, failed };
|
|
372
|
+
}
|
|
373
|
+
if (isMainModule(import.meta.url) && (process.argv[1] ?? "").includes("exe-healthcheck")) {
|
|
374
|
+
const { results, passed, failed } = runHealthCheck();
|
|
375
|
+
console.log("\n exe-os Health Check\n");
|
|
376
|
+
for (const r of results) {
|
|
377
|
+
const icon = r.pass ? "\x1B[32m\u2713\x1B[0m" : "\x1B[31m\u2717\x1B[0m";
|
|
378
|
+
console.log(` ${icon} ${r.name}`);
|
|
379
|
+
console.log(` ${r.detail}`);
|
|
380
|
+
}
|
|
381
|
+
console.log(`
|
|
382
|
+
${passed} passed, ${failed} failed
|
|
383
|
+
`);
|
|
384
|
+
process.exit(failed > 0 ? 1 : 0);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export {
|
|
388
|
+
checkClaudeCodeInstall,
|
|
389
|
+
runHealthCheck
|
|
390
|
+
};
|