@askexenow/exe-os 0.9.227 → 0.9.229
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-GJDG4CAW.js +24 -0
- package/dist/active-agent-WOP3ZHLN.js +25 -0
- package/dist/agent-context-ZPDQOAD2.js +9 -0
- package/dist/agent-heartbeat-AWTVGE4C.js +60 -0
- package/dist/agent-loop-7UM2ENGU.js +10 -0
- package/dist/agentic-ontology-ASORFII6.js +25 -0
- package/dist/asana-JN2UF47A.js +129 -0
- package/dist/assets/ghostty.conf +83 -0
- package/dist/assets/statusline-command.sh +44 -0
- package/dist/assets/tmux.conf +56 -0
- package/dist/assets/wezterm.lua +68 -0
- package/dist/backfill-metadata-JRWUECUS.js +596 -0
- package/dist/background-jobs-VTOMOTNA.js +25 -0
- package/dist/bash-XA65M6T6.js +8 -0
- package/dist/behaviors-36T3O2DC.js +24 -0
- package/dist/bin/age-ontology-load.js +85 -0
- package/dist/bin/agentic-ontology-backfill.js +84 -0
- package/dist/bin/agentic-reflection-backfill.js +45 -0
- package/dist/bin/agentic-semantic-label.js +193 -0
- package/dist/bin/backfill-conversations.js +399 -0
- package/dist/bin/backfill-responses.js +227 -0
- package/dist/bin/backfill-vectors.js +149 -0
- package/dist/bin/bulk-sync-postgres.js +92 -0
- package/dist/bin/cc-doctor.js +51 -0
- package/dist/bin/cleanup-stale-review-tasks.js +139 -0
- package/dist/bin/cli.js +1076 -0
- package/dist/bin/customer-readiness.js +389 -0
- package/dist/bin/deferred-daemon-restart.js +123 -0
- package/dist/bin/exe-agent-config.js +87 -0
- package/dist/bin/exe-agent.js +190 -0
- package/dist/bin/exe-assign.js +93 -0
- package/dist/bin/exe-boot.js +1114 -0
- package/dist/bin/exe-call.js +127 -0
- package/dist/bin/exe-cloud.js +484 -0
- package/dist/bin/exe-dispatch.js +72 -0
- package/dist/bin/exe-doctor.js +48 -0
- package/dist/bin/exe-export-behaviors.js +48 -0
- package/dist/bin/exe-forget.js +204 -0
- package/dist/bin/exe-gateway.js +1137 -0
- package/dist/bin/exe-healthcheck.js +14 -0
- package/dist/bin/exe-heartbeat.js +233 -0
- package/dist/bin/exe-kill.js +126 -0
- package/dist/bin/exe-launch-agent.js +678 -0
- package/dist/bin/exe-new-employee.js +160 -0
- package/dist/bin/exe-pending-messages.js +60 -0
- package/dist/bin/exe-pending-notifications.js +107 -0
- package/dist/bin/exe-pending-reviews.js +81 -0
- package/dist/bin/exe-rename.js +219 -0
- package/dist/bin/exe-repo-drift.js +95 -0
- package/dist/bin/exe-review.js +251 -0
- package/dist/bin/exe-search.js +65 -0
- package/dist/bin/exe-session-cleanup.js +331 -0
- package/dist/bin/exe-settings.js +364 -0
- package/dist/bin/exe-start-codex.js +404 -0
- package/dist/bin/exe-start-opencode.js +233 -0
- package/dist/bin/exe-start.sh +194 -0
- package/dist/bin/exe-status.js +34 -0
- package/dist/bin/exe-support.js +17 -0
- package/dist/bin/exe-team.js +83 -0
- package/dist/bin/generate-hook-manifest.js +30 -0
- package/dist/bin/git-sweep.js +74 -0
- package/dist/bin/graph-backfill.js +78 -0
- package/dist/bin/graph-export.js +66 -0
- package/dist/bin/graph-layer-benchmark.js +113 -0
- package/dist/bin/import-history.js +84 -0
- package/dist/bin/install-launchd.js +41 -0
- package/dist/bin/install.js +422 -0
- package/dist/bin/intercom-check.js +137 -0
- package/dist/bin/list-providers.js +128 -0
- package/dist/bin/mcp-sessions.js +194 -0
- package/dist/bin/orchestration-metrics.js +61 -0
- package/dist/bin/postgres-agentic-reflection-backfill.js +123 -0
- package/dist/bin/postgres-agentic-semantic-backfill.js +126 -0
- package/dist/bin/pre-build-guard.js +98 -0
- package/dist/bin/pre-publish.js +224 -0
- package/dist/bin/registry-proxy.js +44 -0
- package/dist/bin/scan-tasks.js +265 -0
- package/dist/bin/setup.js +19 -0
- package/dist/bin/shard-migrate.js +162 -0
- package/dist/bin/stack-update.js +372 -0
- package/dist/bin/update.js +354 -0
- package/dist/bin/verify-stack.js +389 -0
- package/dist/bin/vps-backup.js +170 -0
- package/dist/bin/vps-health-gate.js +232 -0
- package/dist/branding-I2TDZFUH.js +97 -0
- package/dist/browser-sanitizer-MRSSEJZE.js +229 -0
- package/dist/browser-session-store-RF45DSJR.js +232 -0
- package/dist/capacity-monitor-HZPAFQZH.js +48 -0
- package/dist/catchup-brief-CDG4KD5Y.js +150 -0
- package/dist/chunk-26PUEPOY.js +290 -0
- package/dist/chunk-2VZ6SY2R.js +142 -0
- package/dist/chunk-36DAY227.js +297 -0
- package/dist/chunk-3A5BZETG.js +463 -0
- package/dist/chunk-3DQ3IPPO.js +50 -0
- package/dist/chunk-3JP3FY33.js +258 -0
- package/dist/chunk-3MK3R5E6.js +85 -0
- package/dist/chunk-46SQTBQW.js +207 -0
- package/dist/chunk-4JERP7NT.js +132 -0
- package/dist/chunk-557C2IGL.js +0 -0
- package/dist/chunk-5BS5ELMC.js +85 -0
- package/dist/chunk-5NFBE376.js +391 -0
- package/dist/chunk-6A7P74QV.js +53 -0
- package/dist/chunk-6KFICEAT.js +20 -0
- package/dist/chunk-6MP5NOOR.js +151 -0
- package/dist/chunk-6Y4B3QF6.js +19 -0
- package/dist/chunk-7BPKHR4O.js +171 -0
- package/dist/chunk-7DNX45WB.js +244 -0
- package/dist/chunk-7EZCYO76.js +128 -0
- package/dist/chunk-7NNXBDOO.js +541 -0
- package/dist/chunk-ADJXHBEU.js +667 -0
- package/dist/chunk-AHMUF6RO.js +147 -0
- package/dist/chunk-AJWFPKQS.js +573 -0
- package/dist/chunk-AVE2B4DQ.js +140 -0
- package/dist/chunk-AZSCW64F.js +190 -0
- package/dist/chunk-BZAQ4UG7.js +614 -0
- package/dist/chunk-CHCA3ZM2.js +167 -0
- package/dist/chunk-CHT3THVG.js +240 -0
- package/dist/chunk-CLGB3FGL.js +48 -0
- package/dist/chunk-CQDSTBKT.js +1919 -0
- package/dist/chunk-CTFKTUYN.js +627 -0
- package/dist/chunk-CVYC6DUW.js +78 -0
- package/dist/chunk-CX6GL3ZJ.js +274 -0
- package/dist/chunk-D4IVTUNN.js +377 -0
- package/dist/chunk-DGOGCPYU.js +390 -0
- package/dist/chunk-DKRTWILB.js +81 -0
- package/dist/chunk-DLXTKVBO.js +183 -0
- package/dist/chunk-E6ORBQHP.js +225 -0
- package/dist/chunk-ECGTESAP.js +236 -0
- package/dist/chunk-ECQBG62Y.js +363 -0
- package/dist/chunk-ECSNSHZ7.js +431 -0
- package/dist/chunk-EEAKFEEA.js +221 -0
- package/dist/chunk-EGWPJQRQ.js +159 -0
- package/dist/chunk-EHKIJPVX.js +30 -0
- package/dist/chunk-EIT6J37V.js +119 -0
- package/dist/chunk-EQSQ4HBW.js +9 -0
- package/dist/chunk-ETSREHYC.js +55 -0
- package/dist/chunk-F2GUJW5O.js +1090 -0
- package/dist/chunk-F7LU65PQ.js +33 -0
- package/dist/chunk-FF62UWIJ.js +90 -0
- package/dist/chunk-FIPU4BDF.js +123 -0
- package/dist/chunk-FLSASUV3.js +177 -0
- package/dist/chunk-FWFFZGSC.js +94 -0
- package/dist/chunk-FXU7JOXK.js +6 -0
- package/dist/chunk-G4LLKD4Z.js +147 -0
- package/dist/chunk-GFCQJZTO.js +1051 -0
- package/dist/chunk-GGV3PFUW.js +41 -0
- package/dist/chunk-GJV3WDWM.js +14 -0
- package/dist/chunk-GKM7RYN3.js +1020 -0
- package/dist/chunk-GNHN5HRQ.js +40 -0
- package/dist/chunk-GP6G6EQI.js +632 -0
- package/dist/chunk-GUMRIUI5.js +63 -0
- package/dist/chunk-GVP5U4WL.js +113 -0
- package/dist/chunk-HF25XPZE.js +83 -0
- package/dist/chunk-HFJNYSTQ.js +1088 -0
- package/dist/chunk-HO5SBL4B.js +97 -0
- package/dist/chunk-HOKOOBDL.js +52 -0
- package/dist/chunk-HQMEOIUJ.js +69 -0
- package/dist/chunk-HTCBLSIB.js +813 -0
- package/dist/chunk-HYZV25LY.js +34 -0
- package/dist/chunk-I2CDSGQW.js +280 -0
- package/dist/chunk-I7AW4237.js +251 -0
- package/dist/chunk-IKTMX6N7.js +495 -0
- package/dist/chunk-IQT43SDJ.js +357 -0
- package/dist/chunk-IW53DAYO.js +210 -0
- package/dist/chunk-JBKA7F5V.js +2017 -0
- package/dist/chunk-JJNXFW7M.js +330 -0
- package/dist/chunk-JKGAJAM7.js +214 -0
- package/dist/chunk-JQ6TLNIV.js +133 -0
- package/dist/chunk-JSH5MAMM.js +284 -0
- package/dist/chunk-KCUYRZSX.js +72 -0
- package/dist/chunk-KH5Y6RR4.js +360 -0
- package/dist/chunk-L24HYX62.js +498 -0
- package/dist/chunk-L3TB7CC3.js +170 -0
- package/dist/chunk-LHOIY5LQ.js +58 -0
- package/dist/chunk-LWVZLTMD.js +412 -0
- package/dist/chunk-LYH5HE24.js +73 -0
- package/dist/chunk-M37HYGAG.js +346 -0
- package/dist/chunk-MJXEOKIW.js +54 -0
- package/dist/chunk-MKVFPQH2.js +1051 -0
- package/dist/chunk-MLXJ5EZG.js +90 -0
- package/dist/chunk-MP2AFCGL.js +53 -0
- package/dist/chunk-MSCB4ACU.js +356 -0
- package/dist/chunk-MVW62NIZ.js +20 -0
- package/dist/chunk-MZIGUUDQ.js +42 -0
- package/dist/chunk-N5RRQOAC.js +134 -0
- package/dist/chunk-NFB4N53K.js +159 -0
- package/dist/chunk-NGP6LSV2.js +25 -0
- package/dist/chunk-NGVOA6ZQ.js +84 -0
- package/dist/chunk-NRFVWJHP.js +575 -0
- package/dist/chunk-NUVDSQNY.js +1345 -0
- package/dist/chunk-O377P7GM.js +100 -0
- package/dist/chunk-OE6SYHTC.js +157 -0
- package/dist/chunk-OHPRXEUA.js +75 -0
- package/dist/chunk-OI6MVDSY.js +33 -0
- package/dist/chunk-ONKIWA3R.js +249 -0
- package/dist/chunk-OPU3NYOO.js +55 -0
- package/dist/chunk-ORCCI2VV.js +140 -0
- package/dist/chunk-OSMMWGJ2.js +204 -0
- package/dist/chunk-OYNKIAVW.js +181 -0
- package/dist/chunk-PRKVT4KN.js +90 -0
- package/dist/chunk-PW2YH2ZR.js +403 -0
- package/dist/chunk-PWMMIGVQ.js +332 -0
- package/dist/chunk-Q3V7K4ME.js +149 -0
- package/dist/chunk-Q5GUJUDW.js +348 -0
- package/dist/chunk-Q7RGLXQO.js +574 -0
- package/dist/chunk-Q7XA3SQ4.js +13097 -0
- package/dist/chunk-QGGH7LOU.js +93 -0
- package/dist/chunk-QHIGMP2M.js +237 -0
- package/dist/chunk-QI4IXJN7.js +132 -0
- package/dist/chunk-R2E4TV5V.js +56 -0
- package/dist/chunk-R4WMF32C.js +81 -0
- package/dist/chunk-R5U7XKVJ.js +16 -0
- package/dist/chunk-RJT7H2KR.js +349 -0
- package/dist/chunk-RMPAMMYW.js +70 -0
- package/dist/chunk-RTXGUKY3.js +731 -0
- package/dist/chunk-SH45SJQW.js +0 -0
- package/dist/chunk-SUNYJ6YE.js +204 -0
- package/dist/chunk-SVXDCELZ.js +163 -0
- package/dist/chunk-TMEE7AT7.js +72 -0
- package/dist/chunk-TNTFEWU5.js +361 -0
- package/dist/chunk-TOQZO2XX.js +76 -0
- package/dist/chunk-UBMGUX6T.js +3753 -0
- package/dist/chunk-UJOSFVWG.js +3511 -0
- package/dist/chunk-UPSZ2VKV.js +197 -0
- package/dist/chunk-UV4ZHXUP.js +38 -0
- package/dist/chunk-UWISNP4U.js +1073 -0
- package/dist/chunk-V3QAAU2U.js +129 -0
- package/dist/chunk-V4TZI6EO.js +60 -0
- package/dist/chunk-W6TC6A73.js +77 -0
- package/dist/chunk-WA67SFFZ.js +227 -0
- package/dist/chunk-WWPX2LLP.js +262 -0
- package/dist/chunk-WZ2RVKRO.js +121 -0
- package/dist/chunk-X2Z5GT3V.js +118 -0
- package/dist/chunk-X3AVWFWW.js +294 -0
- package/dist/chunk-XEKO37NM.js +43 -0
- package/dist/chunk-YADYM2DE.js +42 -0
- package/dist/chunk-YCTCKUZE.js +128 -0
- package/dist/chunk-YGAAZN3E.js +47 -0
- package/dist/chunk-YKIPAQZG.js +333 -0
- package/dist/chunk-YSU7JB7H.js +0 -0
- package/dist/chunk-YZFZDJWZ.js +107 -0
- package/dist/chunk-YZKJLGWL.js +169 -0
- package/dist/chunk-Z3TT2SVJ.js +135 -0
- package/dist/chunk-Z3ZCLTP7.js +382 -0
- package/dist/chunk-ZVSG2KKG.js +106 -0
- package/dist/co-activation-AJZTQHI3.js +71 -0
- package/dist/co-occurrence-FGEJIMMV.js +73 -0
- package/dist/code-context-index-KHUYATRB.js +29 -0
- package/dist/content-extractor-CUJOBFBU.js +9 -0
- package/dist/conversation-entity-extractor-TW4W57K4.js +114 -0
- package/dist/conversation-wiki-populator-GNFRTS7X.js +105 -0
- package/dist/core-memory-R7QBLN4C.js +110 -0
- package/dist/crdt-sync-K25AKQAD.js +33 -0
- package/dist/crm-bridge-NG5WJMGF.js +19 -0
- package/dist/crm-webhook-3ODT32F7.js +10 -0
- package/dist/cto-delegation-gate-4XDMTK6H.js +205 -0
- package/dist/daemon-auth-WFQMMNSD.js +13 -0
- package/dist/daemon-orchestration-5I7RLXCP.js +133 -0
- package/dist/daemon-protocol-4FUHT5NH.js +17 -0
- package/dist/db-backup-MSQKO6M5.js +25 -0
- package/dist/devtools-J4QYYO7U.js +8 -0
- package/dist/discord-7UHIZNJ3.js +7 -0
- package/dist/dispatch-ack-RMVFHO4I.js +13 -0
- package/dist/dreaming-UL7T5ZXA.js +12 -0
- package/dist/email-T6PQUUY6.js +137 -0
- package/dist/entity-boost-7MB2IYAE.js +332 -0
- package/dist/exe-drift-2KHRPBUK.js +67 -0
- package/dist/exe-export-UZN6EFOR.js +72 -0
- package/dist/exe-import-OSM3U36A.js +75 -0
- package/dist/exe-key-OG35WPBA.js +573 -0
- package/dist/exe-org-JRBBON5H.js +73 -0
- package/dist/exe-snapshot-7TQIN7XI.js +145 -0
- package/dist/factory-UQSRMKJW.js +67 -0
- package/dist/fast-db-init-4VXDSFUY.js +7 -0
- package/dist/file-edit-YORRFENG.js +8 -0
- package/dist/file-read-RMQFDE5L.js +8 -0
- package/dist/file-write-VO4MQW5Y.js +8 -0
- package/dist/founder-context-3N6BMG7B.js +96 -0
- package/dist/gateway/index.js +148 -0
- package/dist/gateway-client-V7NH35Q2.js +11 -0
- package/dist/git-staleness-JW57ZGEJ.js +109 -0
- package/dist/git-task-sweep-HYAPIM44.js +39 -0
- package/dist/glob-2LXRC3F5.js +7 -0
- package/dist/global-procedures-NY3W7L5Q.js +19 -0
- package/dist/graph-auto-extract-5GZ34NXS.js +161 -0
- package/dist/graph-query-YZ4RZEIL.js +26 -0
- package/dist/graph-rag-S5SBJW5J.js +29 -0
- package/dist/grep-OY7KCRLQ.js +7 -0
- package/dist/hook-integrity-OKSYTGVP.js +89 -0
- package/dist/hooks/bug-report-worker.js +179 -0
- package/dist/hooks/codex-stop-task-finalizer.js +258 -0
- package/dist/hooks/commit-complete.js +162 -0
- package/dist/hooks/error-recall.js +129 -0
- package/dist/hooks/exe-heartbeat-hook.js +78 -0
- package/dist/hooks/ingest-worker.js +51 -0
- package/dist/hooks/ingest.js +491 -0
- package/dist/hooks/instructions-loaded.js +119 -0
- package/dist/hooks/manifest.json +25 -0
- package/dist/hooks/notification.js +67 -0
- package/dist/hooks/post-compact.js +138 -0
- package/dist/hooks/post-tool-combined.js +152 -0
- package/dist/hooks/pre-compact.js +159 -0
- package/dist/hooks/pre-tool-use.js +512 -0
- package/dist/hooks/prompt-submit.js +699 -0
- package/dist/hooks/session-end.js +482 -0
- package/dist/hooks/session-start.js +362 -0
- package/dist/hooks/stop.js +332 -0
- package/dist/hooks/subagent-stop.js +85 -0
- package/dist/hooks/summary-worker.js +298 -0
- package/dist/hooks-RPTZV5KX.js +9 -0
- package/dist/imessage-CE5USLTI.js +7 -0
- package/dist/index.js +60 -0
- package/dist/installer-GMIVB2JS.js +341 -0
- package/dist/installer-OBYQ6O3C.js +295 -0
- package/dist/installer-UAMA6ZVH.js +37 -0
- package/dist/intercom-queue-USIXVVJQ.js +17 -0
- package/dist/key-backup-status-TVFMMWTT.js +39 -0
- package/dist/keyword-extractor-OGQRRVTB.js +11 -0
- package/dist/lib/agent-config.js +30 -0
- package/dist/lib/cloud-sync.js +103 -0
- package/dist/lib/cloudflare-dns.js +13 -0
- package/dist/lib/config.js +32 -0
- package/dist/lib/consolidation.js +38 -0
- package/dist/lib/crypto.js +13 -0
- package/dist/lib/database.js +31 -0
- package/dist/lib/db-daemon-client.js +141 -0
- package/dist/lib/db.js +31 -0
- package/dist/lib/device-registry.js +70 -0
- package/dist/lib/embed-worker.js +165 -0
- package/dist/lib/embedder.js +19 -0
- package/dist/lib/employee-templates.js +34 -0
- package/dist/lib/employees.js +63 -0
- package/dist/lib/error-detector.js +16 -0
- package/dist/lib/exe-daemon-client.js +25 -0
- package/dist/lib/exe-daemon.js +4454 -0
- package/dist/lib/file-grep.js +242 -0
- package/dist/lib/hybrid-search.js +28 -0
- package/dist/lib/identity-templates.js +650 -0
- package/dist/lib/identity.js +19 -0
- package/dist/lib/keychain.js +17 -0
- package/dist/lib/license.js +35 -0
- package/dist/lib/messaging.js +59 -0
- package/dist/lib/post-tool-memory.js +13 -0
- package/dist/lib/registry-proxy.js +15 -0
- package/dist/lib/reminders.js +16 -0
- package/dist/lib/runtime-table.js +9 -0
- package/dist/lib/schedules.js +24 -0
- package/dist/lib/session-registry.js +21 -0
- package/dist/lib/session-wrappers.js +7 -0
- package/dist/lib/skill-learning.js +29 -0
- package/dist/lib/status-brief.js +7 -0
- package/dist/lib/store.js +43 -0
- package/dist/lib/task-router.js +22 -0
- package/dist/lib/tasks.js +66 -0
- package/dist/lib/tmux-routing.js +70 -0
- package/dist/lib/tmux-status.js +29 -0
- package/dist/lib/tmux-transport.js +7 -0
- package/dist/lib/token-spend.js +12 -0
- package/dist/lib/transport.js +10 -0
- package/dist/lib/ws-auth.js +11 -0
- package/dist/lib/ws-client.js +190 -0
- package/dist/license-gate-7QVCYARF.js +14 -0
- package/dist/mcp/register-tools.js +102 -0
- package/dist/mcp/server.js +370 -0
- package/dist/mcp/tools/complete-reminder.js +13 -0
- package/dist/mcp/tools/create-reminder.js +13 -0
- package/dist/mcp/tools/create-task.js +34 -0
- package/dist/mcp/tools/deactivate-behavior.js +16 -0
- package/dist/mcp/tools/list-reminders.js +13 -0
- package/dist/mcp/tools/list-tasks.js +33 -0
- package/dist/mcp/tools/send-message.js +33 -0
- package/dist/mcp/tools/update-task.js +32 -0
- package/dist/mcp-diagnostics-5T5OZ52S.js +200 -0
- package/dist/mcp-disconnect-tracker-VINUVEZJ.js +79 -0
- package/dist/mcp-http-config-YPF4WGU5.js +26 -0
- package/dist/memory-cards-XHZEOX7Q.js +173 -0
- package/dist/memory-graph-extractor-J3K7B4GC.js +16 -0
- package/dist/memory-poisoning-defense-I76FGNHK.js +224 -0
- package/dist/memory-queue-WEVFXPZO.js +19 -0
- package/dist/memory-queue-client-5XBHYAQR.js +15 -0
- package/dist/memory-reflection-YJGI6IDI.js +237 -0
- package/dist/message-queue-client-FUKX43JD.js +92 -0
- package/dist/notifications-H4F77BYT.js +44 -0
- package/dist/oauth-server-CCZPDTZJ.js +437 -0
- package/dist/orchestration-events-LXVPJL6S.js +24 -0
- package/dist/orchestration-phase-HXRKMZXM.js +23 -0
- package/dist/orchestrator-HXUZ6LYM.js +32 -0
- package/dist/permission-presets-UPVLJWZD.js +25 -0
- package/dist/permissions-C4EMHPDD.js +14 -0
- package/dist/pg-ssl-GD3332YS.js +7 -0
- package/dist/pipeline-router-QRJQWMFF.js +12 -0
- package/dist/plan-limits-NFQVRHS5.js +25 -0
- package/dist/prediction-log-C2BD3AHR.js +120 -0
- package/dist/preferences-5ARPMYE7.js +10 -0
- package/dist/preflight-TZOGLBZU.js +287 -0
- package/dist/project-boot-JIGOSGCN.js +254 -0
- package/dist/project-name-4SKOH2UO.js +10 -0
- package/dist/projection-worker-JZQTL4NU.js +877 -0
- package/dist/push-notifications-3GNJ5SZS.js +15 -0
- package/dist/reranker-U6DEAT4S.js +19 -0
- package/dist/review-gate-I66GDXNR.js +120 -0
- package/dist/review-polling-W2S3XAAU.js +123 -0
- package/dist/runtime/index.js +129 -0
- package/dist/self-query-router-QMK5ZSZR.js +188 -0
- package/dist/session-events-MNWHGZY5.js +35 -0
- package/dist/session-kill-telemetry-JHSI7D3F.js +28 -0
- package/dist/session-scope-SMT225X3.js +85 -0
- package/dist/setup-wizard-RBUTEZB2.js +12 -0
- package/dist/shard-manager-ON2WWCRM.js +29 -0
- package/dist/signal-KF2LIO7Y.js +7 -0
- package/dist/signal-paths-5ZTWCBUX.js +19 -0
- package/dist/skill-refinement-LKJHUW2U.js +156 -0
- package/dist/slack-JRDUD5Z7.js +7 -0
- package/dist/stack-update-ZIMV4OEQ.js +50 -0
- package/dist/steward-gate-6IKH335D.js +12 -0
- package/dist/support-outbox-HIJVUDA2.js +206 -0
- package/dist/task-enforcement-UIEWTA6H.js +292 -0
- package/dist/task-scanner-5OQBNC2N.js +11 -0
- package/dist/task-scope-DNQURKOQ.js +34 -0
- package/dist/tasks-crud-CLAYZZ4O.js +76 -0
- package/dist/tasks-review-OHR2P4QE.js +46 -0
- package/dist/telegram-COCYUCT7.js +7 -0
- package/dist/telemetry-QKWQKAUC.js +9 -0
- package/dist/telemetry-upload-APVDPCEV.js +609 -0
- package/dist/token-budget-6IQNYKLR.js +83 -0
- package/dist/tool-capability-index-UUNF7VPA.js +10 -0
- package/dist/tool-gates-6A6LE4DZ.js +14 -0
- package/dist/tool-gates-RNWEH5IK.js +13 -0
- package/dist/tool-registry-KL24CAFR.js +11 -0
- package/dist/tool-telemetry-SJSIL5M5.js +17 -0
- package/dist/tui/App.js +10223 -0
- package/dist/tui-data-L6XG4Z52.js +161 -0
- package/dist/typed-messages-53Q7L3LB.js +17 -0
- package/dist/update-check-5IL5I3E2.js +11 -0
- package/dist/webhook-VXGIH7PN.js +96 -0
- package/dist/webhook-pipe-4WPFGGFD.js +114 -0
- package/dist/whatsapp-PSMKCDS7.js +9 -0
- package/dist/whatsapp-accounts-4OKWFRWL.js +15 -0
- package/dist/whatsapp-config-ZG5LX4O4.js +125 -0
- package/dist/wiki-acl-XCT6QQGP.js +111 -0
- package/dist/wiki-client-KE622HKY.js +157 -0
- package/dist/worker-gate-GFKXZ6V5.js +21 -0
- package/dist/workflow-engine-6HTKI2ZE.js +28 -0
- package/dist/working-memory-Z3EB3FW6.js +77 -0
- package/dist/worktree-BO7QQ32T.js +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
generateStatusBrief
|
|
4
|
+
} from "../chunk-LWVZLTMD.js";
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_EXE,
|
|
7
|
+
getSessionPrompt
|
|
8
|
+
} from "../chunk-ADJXHBEU.js";
|
|
9
|
+
import "../chunk-OHPRXEUA.js";
|
|
10
|
+
import "../chunk-5NFBE376.js";
|
|
11
|
+
import {
|
|
12
|
+
initStore
|
|
13
|
+
} from "../chunk-HTCBLSIB.js";
|
|
14
|
+
import "../chunk-CHCA3ZM2.js";
|
|
15
|
+
import "../chunk-IW53DAYO.js";
|
|
16
|
+
import {
|
|
17
|
+
cleanupSessionMarkers,
|
|
18
|
+
writeActiveAgent
|
|
19
|
+
} from "../chunk-DLXTKVBO.js";
|
|
20
|
+
import "../chunk-F7LU65PQ.js";
|
|
21
|
+
import {
|
|
22
|
+
cleanupOldNotifications,
|
|
23
|
+
getMySession,
|
|
24
|
+
markAsRead,
|
|
25
|
+
markDoneTaskNotificationsAsRead,
|
|
26
|
+
migrateJsonNotifications,
|
|
27
|
+
readUnreadNotifications,
|
|
28
|
+
resolveExeSession,
|
|
29
|
+
sessionScopeFilter,
|
|
30
|
+
updateTaskStatus
|
|
31
|
+
} from "../chunk-UBMGUX6T.js";
|
|
32
|
+
import "../chunk-I2CDSGQW.js";
|
|
33
|
+
import "../chunk-QI4IXJN7.js";
|
|
34
|
+
import "../chunk-4JERP7NT.js";
|
|
35
|
+
import {
|
|
36
|
+
pruneStaleSessions,
|
|
37
|
+
registerSession
|
|
38
|
+
} from "../chunk-G4LLKD4Z.js";
|
|
39
|
+
import "../chunk-MVW62NIZ.js";
|
|
40
|
+
import "../chunk-OYNKIAVW.js";
|
|
41
|
+
import "../chunk-CX6GL3ZJ.js";
|
|
42
|
+
import "../chunk-CTFKTUYN.js";
|
|
43
|
+
import "../chunk-GVP5U4WL.js";
|
|
44
|
+
import "../chunk-NGP6LSV2.js";
|
|
45
|
+
import "../chunk-V3QAAU2U.js";
|
|
46
|
+
import "../chunk-CVYC6DUW.js";
|
|
47
|
+
import "../chunk-OPU3NYOO.js";
|
|
48
|
+
import "../chunk-GJV3WDWM.js";
|
|
49
|
+
import "../chunk-MP2AFCGL.js";
|
|
50
|
+
import "../chunk-RMPAMMYW.js";
|
|
51
|
+
import "../chunk-HYZV25LY.js";
|
|
52
|
+
import {
|
|
53
|
+
DEFAULT_COORDINATOR_TEMPLATE_NAME,
|
|
54
|
+
getClient,
|
|
55
|
+
getCoordinatorEmployee,
|
|
56
|
+
isCoordinatorName,
|
|
57
|
+
loadEmployees,
|
|
58
|
+
saveEmployees
|
|
59
|
+
} from "../chunk-UJOSFVWG.js";
|
|
60
|
+
import "../chunk-QHIGMP2M.js";
|
|
61
|
+
import "../chunk-FXU7JOXK.js";
|
|
62
|
+
import "../chunk-7NNXBDOO.js";
|
|
63
|
+
import "../chunk-D4IVTUNN.js";
|
|
64
|
+
import {
|
|
65
|
+
EXE_AI_DIR,
|
|
66
|
+
loadConfig,
|
|
67
|
+
loadConfigSync
|
|
68
|
+
} from "../chunk-TNTFEWU5.js";
|
|
69
|
+
import "../chunk-LYH5HE24.js";
|
|
70
|
+
import {
|
|
71
|
+
isMainModule
|
|
72
|
+
} from "../chunk-6Y4B3QF6.js";
|
|
73
|
+
import "../chunk-R5U7XKVJ.js";
|
|
74
|
+
|
|
75
|
+
// src/bin/exe-boot.ts
|
|
76
|
+
import path from "path";
|
|
77
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
78
|
+
import { existsSync, readFileSync, readdirSync, unlinkSync } from "fs";
|
|
79
|
+
import { execSync } from "child_process";
|
|
80
|
+
import os from "os";
|
|
81
|
+
async function boot(options) {
|
|
82
|
+
const briefOnly = options?.briefOnly ?? false;
|
|
83
|
+
let employees = await loadEmployees();
|
|
84
|
+
if (employees.length === 0) {
|
|
85
|
+
employees = [DEFAULT_EXE];
|
|
86
|
+
await saveEmployees(employees);
|
|
87
|
+
}
|
|
88
|
+
const coordinatorEmployee = getCoordinatorEmployee(employees) ?? DEFAULT_EXE;
|
|
89
|
+
const coordinatorName = coordinatorEmployee.name;
|
|
90
|
+
await initStore();
|
|
91
|
+
cleanupSessionMarkers();
|
|
92
|
+
writeActiveAgent(coordinatorName, coordinatorEmployee.role);
|
|
93
|
+
let licensePlan;
|
|
94
|
+
let employeeLimit;
|
|
95
|
+
try {
|
|
96
|
+
const { checkLicense, loadLicense } = await import("../lib/license.js");
|
|
97
|
+
const hasKey = !!loadLicense();
|
|
98
|
+
if (hasKey) {
|
|
99
|
+
const license = await checkLicense();
|
|
100
|
+
licensePlan = license.plan;
|
|
101
|
+
employeeLimit = license.employeeLimit;
|
|
102
|
+
if (!license.valid) {
|
|
103
|
+
process.stderr.write(
|
|
104
|
+
"\u26A0 License key present but not valid. Check plan status at https://askexe.com.\n"
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
} else {
|
|
108
|
+
licensePlan = "free";
|
|
109
|
+
employeeLimit = 1;
|
|
110
|
+
}
|
|
111
|
+
} catch {
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
const exeWindow = getMySession();
|
|
115
|
+
if (exeWindow) {
|
|
116
|
+
registerSession({
|
|
117
|
+
windowName: exeWindow,
|
|
118
|
+
agentId: coordinatorName,
|
|
119
|
+
projectDir: process.cwd(),
|
|
120
|
+
parentExe: null,
|
|
121
|
+
pid: process.ppid,
|
|
122
|
+
registeredAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
pruneStaleSessions();
|
|
126
|
+
} catch {
|
|
127
|
+
}
|
|
128
|
+
const client = getClient();
|
|
129
|
+
const briefData = {
|
|
130
|
+
pendingReviews: [],
|
|
131
|
+
globalTasks: [],
|
|
132
|
+
flaggedIssues: [],
|
|
133
|
+
completedSinceLastBoot: [],
|
|
134
|
+
workload: [],
|
|
135
|
+
velocity: [],
|
|
136
|
+
activeProjects: [],
|
|
137
|
+
cloudConnected: false,
|
|
138
|
+
exeSession: resolveExeSession() ?? void 0,
|
|
139
|
+
plan: licensePlan,
|
|
140
|
+
employeeLimit
|
|
141
|
+
};
|
|
142
|
+
try {
|
|
143
|
+
const config = await loadConfig();
|
|
144
|
+
briefData.orchestrationPhase = config.orchestration?.phase;
|
|
145
|
+
} catch {
|
|
146
|
+
briefData.orchestrationPhase = "phase_1_coo";
|
|
147
|
+
}
|
|
148
|
+
if (!briefOnly) {
|
|
149
|
+
await migrateJsonNotifications();
|
|
150
|
+
await markDoneTaskNotificationsAsRead(briefData.exeSession);
|
|
151
|
+
try {
|
|
152
|
+
const orphanScope = sessionScopeFilter();
|
|
153
|
+
await client.execute({
|
|
154
|
+
sql: `DELETE FROM notifications
|
|
155
|
+
WHERE task_file IS NOT NULL
|
|
156
|
+
AND task_file NOT IN (SELECT task_file FROM tasks WHERE task_file IS NOT NULL)
|
|
157
|
+
${orphanScope.sql}`,
|
|
158
|
+
args: [...orphanScope.args]
|
|
159
|
+
});
|
|
160
|
+
} catch {
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
const { readdirSync: readdirSync2, readFileSync: readFs } = await import("fs");
|
|
164
|
+
const { STATUS_RE, PRIORITY_RE, TITLE_RE } = await import("../task-scanner-5OQBNC2N.js");
|
|
165
|
+
const { getProjectName } = await import("../project-name-4SKOH2UO.js");
|
|
166
|
+
const exeDir = "exe";
|
|
167
|
+
const entries = readdirSync2(exeDir, { withFileTypes: true });
|
|
168
|
+
const employeeDirs = entries.filter((e) => e.isDirectory() && !["output", "research"].includes(e.name));
|
|
169
|
+
for (const dir of employeeDirs) {
|
|
170
|
+
const employee = dir.name;
|
|
171
|
+
const taskDir = path.join(exeDir, employee);
|
|
172
|
+
let files;
|
|
173
|
+
try {
|
|
174
|
+
files = readdirSync2(taskDir).filter((f) => f.endsWith(".md"));
|
|
175
|
+
} catch {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
for (const file of files) {
|
|
179
|
+
const taskFilePath = `exe/${employee}/${file}`;
|
|
180
|
+
let content;
|
|
181
|
+
try {
|
|
182
|
+
content = readFs(path.join(taskDir, file), "utf8");
|
|
183
|
+
} catch {
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
const statusMatch = content.match(STATUS_RE);
|
|
187
|
+
const status = statusMatch?.[1]?.toLowerCase() ?? "open";
|
|
188
|
+
const titleMatch = content.match(TITLE_RE);
|
|
189
|
+
const title = titleMatch?.[1] ?? file.replace(/\.md$/, "").replace(/-/g, " ");
|
|
190
|
+
const priMatch = content.match(PRIORITY_RE);
|
|
191
|
+
const priority = priMatch?.[1]?.toLowerCase() ?? "p1";
|
|
192
|
+
const assignedByMatch = content.match(/^\*\*Assigned by:\*\*\s*(\w+)/m);
|
|
193
|
+
const assignedBy = assignedByMatch?.[1] ?? coordinatorName;
|
|
194
|
+
const projMatch = content.match(/^\*\*Project:\*\*\s*(.+)/m);
|
|
195
|
+
const projectName = projMatch?.[1]?.trim() ?? getProjectName(process.cwd());
|
|
196
|
+
const existing = await client.execute({
|
|
197
|
+
sql: "SELECT id, status FROM tasks WHERE task_file = ?",
|
|
198
|
+
args: [taskFilePath]
|
|
199
|
+
});
|
|
200
|
+
if (existing.rows.length === 0) {
|
|
201
|
+
const { createTask } = await import("../lib/tasks.js");
|
|
202
|
+
await createTask({
|
|
203
|
+
title,
|
|
204
|
+
assignedTo: employee,
|
|
205
|
+
assignedBy,
|
|
206
|
+
projectName,
|
|
207
|
+
priority,
|
|
208
|
+
context: "",
|
|
209
|
+
taskFile: taskFilePath,
|
|
210
|
+
skipDispatch: true
|
|
211
|
+
});
|
|
212
|
+
} else {
|
|
213
|
+
const dbStatus = String(existing.rows[0].status);
|
|
214
|
+
if (dbStatus !== status) {
|
|
215
|
+
await client.execute({
|
|
216
|
+
sql: "UPDATE tasks SET status = ?, updated_at = ? WHERE task_file = ?",
|
|
217
|
+
args: [status, (/* @__PURE__ */ new Date()).toISOString(), taskFilePath]
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
} catch (e) {
|
|
224
|
+
process.stderr.write("[exe-boot] task reconciliation: " + (e instanceof Error ? e.message : String(e)) + "\n");
|
|
225
|
+
}
|
|
226
|
+
try {
|
|
227
|
+
const staleRevScope = sessionScopeFilter();
|
|
228
|
+
await client.execute({
|
|
229
|
+
sql: `UPDATE tasks SET status = 'done', updated_at = ?
|
|
230
|
+
WHERE (assigned_to = ? OR assigned_to = ?)
|
|
231
|
+
AND status = 'in_progress'
|
|
232
|
+
AND task_file LIKE '%review-%'
|
|
233
|
+
AND updated_at < datetime('now', '-1 hour')
|
|
234
|
+
${staleRevScope.sql}`,
|
|
235
|
+
args: [(/* @__PURE__ */ new Date()).toISOString(), coordinatorName, DEFAULT_COORDINATOR_TEMPLATE_NAME, ...staleRevScope.args]
|
|
236
|
+
});
|
|
237
|
+
} catch {
|
|
238
|
+
}
|
|
239
|
+
try {
|
|
240
|
+
const staleScope = sessionScopeFilter();
|
|
241
|
+
const staleReviews = await client.execute({
|
|
242
|
+
sql: `SELECT id, title, priority FROM tasks
|
|
243
|
+
WHERE status = 'needs_review'
|
|
244
|
+
AND task_file LIKE '%review-%'
|
|
245
|
+
AND updated_at < datetime('now', '-24 hours')${staleScope.sql}`,
|
|
246
|
+
args: [...staleScope.args]
|
|
247
|
+
});
|
|
248
|
+
for (const r of staleReviews.rows) {
|
|
249
|
+
const pri = String(r.priority).toLowerCase();
|
|
250
|
+
if (pri !== "p0") {
|
|
251
|
+
try {
|
|
252
|
+
await updateTaskStatus({ taskId: String(r.id), status: "done", skipReviewCreation: true });
|
|
253
|
+
} catch {
|
|
254
|
+
await client.execute({
|
|
255
|
+
sql: "UPDATE tasks SET status = 'done', updated_at = ? WHERE id = ?",
|
|
256
|
+
args: [(/* @__PURE__ */ new Date()).toISOString(), String(r.id)]
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (staleReviews.rows.length > 0) {
|
|
262
|
+
const p0Count = staleReviews.rows.filter((r) => String(r.priority).toLowerCase() === "p0").length;
|
|
263
|
+
const autoApprovedCount = staleReviews.rows.length - p0Count;
|
|
264
|
+
if (autoApprovedCount > 0) {
|
|
265
|
+
briefData.autoApprovedReviews = [
|
|
266
|
+
...briefData.autoApprovedReviews ?? [],
|
|
267
|
+
`${autoApprovedCount} stale review(s) auto-approved (>24h)`
|
|
268
|
+
];
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
} catch {
|
|
272
|
+
}
|
|
273
|
+
try {
|
|
274
|
+
for (const reviewDirName of /* @__PURE__ */ new Set(["exe", coordinatorName])) {
|
|
275
|
+
const reviewDir = path.join(process.cwd(), "exe", reviewDirName);
|
|
276
|
+
if (existsSync(reviewDir)) {
|
|
277
|
+
for (const f of readdirSync(reviewDir)) {
|
|
278
|
+
if (f.startsWith("review-") && f.endsWith(".md")) {
|
|
279
|
+
try {
|
|
280
|
+
unlinkSync(path.join(reviewDir, f));
|
|
281
|
+
} catch {
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
} catch {
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
let lastBootTimestamp = null;
|
|
291
|
+
try {
|
|
292
|
+
const bootResult = await client.execute({
|
|
293
|
+
sql: "SELECT value FROM sync_meta WHERE key = 'last_exe_boot'",
|
|
294
|
+
args: []
|
|
295
|
+
});
|
|
296
|
+
if (bootResult.rows[0]) {
|
|
297
|
+
lastBootTimestamp = String(bootResult.rows[0].value);
|
|
298
|
+
}
|
|
299
|
+
} catch {
|
|
300
|
+
}
|
|
301
|
+
const autoApproved = [];
|
|
302
|
+
if (!briefOnly) {
|
|
303
|
+
try {
|
|
304
|
+
const approveScope = sessionScopeFilter();
|
|
305
|
+
const pendingReviews = await client.execute({
|
|
306
|
+
sql: `SELECT id, title, priority, result, task_file FROM tasks
|
|
307
|
+
WHERE status = 'needs_review'${approveScope.sql}
|
|
308
|
+
ORDER BY priority ASC`,
|
|
309
|
+
args: [...approveScope.args]
|
|
310
|
+
});
|
|
311
|
+
for (const r of pendingReviews.rows) {
|
|
312
|
+
const taskId = String(r.id);
|
|
313
|
+
const taskTitle = String(r.title);
|
|
314
|
+
const priority = String(r.priority).toLowerCase();
|
|
315
|
+
const resultText = String(r.result ?? "");
|
|
316
|
+
if (priority === "p0") continue;
|
|
317
|
+
const testsPass = /tests?\s*pass/i.test(resultText) || /\d+\s*passed/i.test(resultText);
|
|
318
|
+
if (priority === "p2" && testsPass) {
|
|
319
|
+
try {
|
|
320
|
+
await updateTaskStatus({ taskId, status: "done", skipReviewCreation: true });
|
|
321
|
+
} catch {
|
|
322
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
323
|
+
await client.execute({
|
|
324
|
+
sql: "UPDATE tasks SET status = 'done', updated_at = ? WHERE id = ?",
|
|
325
|
+
args: [now, taskId]
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
autoApproved.push(taskTitle);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
} catch {
|
|
332
|
+
}
|
|
333
|
+
if (autoApproved.length > 0) {
|
|
334
|
+
briefData.autoApprovedReviews = autoApproved;
|
|
335
|
+
}
|
|
336
|
+
try {
|
|
337
|
+
await client.execute({
|
|
338
|
+
sql: `UPDATE behaviors SET active = 0
|
|
339
|
+
WHERE active = 1 AND updated_at < datetime('now', '-180 days')`,
|
|
340
|
+
args: []
|
|
341
|
+
});
|
|
342
|
+
} catch {
|
|
343
|
+
}
|
|
344
|
+
if (!briefOnly) {
|
|
345
|
+
try {
|
|
346
|
+
await client.execute({
|
|
347
|
+
sql: "INSERT OR REPLACE INTO sync_meta (key, value) VALUES ('last_exe_boot', ?)",
|
|
348
|
+
args: [(/* @__PURE__ */ new Date()).toISOString()]
|
|
349
|
+
});
|
|
350
|
+
} catch (e) {
|
|
351
|
+
process.stderr.write("[exe-boot] update last_exe_boot: " + (e instanceof Error ? e.message : String(e)) + "\n");
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
await Promise.all([
|
|
356
|
+
// Pending reviews from tasks table
|
|
357
|
+
(async () => {
|
|
358
|
+
const revScope = sessionScopeFilter();
|
|
359
|
+
try {
|
|
360
|
+
const result = await client.execute({
|
|
361
|
+
sql: `SELECT t.title, t.priority, t.created_at, t.updated_at,
|
|
362
|
+
COALESCE(
|
|
363
|
+
(SELECT orig.assigned_to FROM tasks orig WHERE orig.task_file = REPLACE(REPLACE(t.task_file, 'review-', ''), 'exe/exe/', 'exe/' || orig.assigned_to || '/')),
|
|
364
|
+
REPLACE(SUBSTR(t.title, INSTR(t.title, 'review-') + 7), SUBSTR(t.title, INSTR(t.title, '-')), '')
|
|
365
|
+
) as original_assignee
|
|
366
|
+
FROM tasks t
|
|
367
|
+
WHERE (t.assigned_to = ? OR t.assigned_to = ?) AND t.status IN ('open', 'in_progress')
|
|
368
|
+
AND t.task_file LIKE '%review-%'${revScope.sql}
|
|
369
|
+
ORDER BY t.priority ASC, t.created_at ASC`,
|
|
370
|
+
args: [coordinatorName, DEFAULT_COORDINATOR_TEMPLATE_NAME, ...revScope.args]
|
|
371
|
+
});
|
|
372
|
+
briefData.pendingReviews = result.rows.map((row) => ({
|
|
373
|
+
title: String(row.title),
|
|
374
|
+
priority: String(row.priority),
|
|
375
|
+
originalAssignee: String(row.original_assignee || "unknown"),
|
|
376
|
+
createdAt: String(row.created_at || ""),
|
|
377
|
+
updatedAt: String(row.updated_at || row.created_at || "")
|
|
378
|
+
}));
|
|
379
|
+
} catch {
|
|
380
|
+
try {
|
|
381
|
+
const result = await client.execute({
|
|
382
|
+
sql: `SELECT title, priority, created_at, updated_at
|
|
383
|
+
FROM tasks
|
|
384
|
+
WHERE (assigned_to = ? OR assigned_to = ?) AND status IN ('open', 'in_progress')
|
|
385
|
+
AND task_file LIKE '%review-%'${revScope.sql}
|
|
386
|
+
ORDER BY priority ASC, created_at ASC`,
|
|
387
|
+
args: [coordinatorName, DEFAULT_COORDINATOR_TEMPLATE_NAME, ...revScope.args]
|
|
388
|
+
});
|
|
389
|
+
briefData.pendingReviews = result.rows.map((row) => {
|
|
390
|
+
const title = String(row.title);
|
|
391
|
+
const match = title.match(/Review:\s*(\w+)\//);
|
|
392
|
+
return {
|
|
393
|
+
title,
|
|
394
|
+
priority: String(row.priority),
|
|
395
|
+
originalAssignee: match?.[1] ?? "unknown",
|
|
396
|
+
createdAt: String(row.created_at || ""),
|
|
397
|
+
updatedAt: String(row.updated_at || row.created_at || "")
|
|
398
|
+
};
|
|
399
|
+
});
|
|
400
|
+
} catch {
|
|
401
|
+
briefData.pendingReviews = [];
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
try {
|
|
405
|
+
const nrScope = sessionScopeFilter();
|
|
406
|
+
const nrResult = await client.execute({
|
|
407
|
+
sql: `SELECT title, priority, assigned_to, created_at, updated_at
|
|
408
|
+
FROM tasks WHERE status = 'needs_review'${nrScope.sql}
|
|
409
|
+
ORDER BY updated_at ASC`,
|
|
410
|
+
args: [...nrScope.args]
|
|
411
|
+
});
|
|
412
|
+
const existingTitles = new Set(briefData.pendingReviews.map((r) => r.title));
|
|
413
|
+
for (const row of nrResult.rows) {
|
|
414
|
+
const title = String(row.title);
|
|
415
|
+
if (!existingTitles.has(title)) {
|
|
416
|
+
briefData.pendingReviews.push({
|
|
417
|
+
title,
|
|
418
|
+
priority: String(row.priority),
|
|
419
|
+
originalAssignee: String(row.assigned_to || "unknown"),
|
|
420
|
+
createdAt: String(row.created_at || ""),
|
|
421
|
+
updatedAt: String(row.updated_at || row.created_at || "")
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
} catch {
|
|
426
|
+
}
|
|
427
|
+
})(),
|
|
428
|
+
// Global task queue — all open/in_progress/blocked tasks
|
|
429
|
+
(async () => {
|
|
430
|
+
const qScope = sessionScopeFilter(void 0, "t");
|
|
431
|
+
try {
|
|
432
|
+
const result = await client.execute({
|
|
433
|
+
sql: `SELECT t.assigned_to, t.project_name, t.title, t.priority, t.status,
|
|
434
|
+
b.task_file as blocker_file, t.parent_task_id, t.updated_at
|
|
435
|
+
FROM tasks t
|
|
436
|
+
LEFT JOIN tasks b ON t.blocked_by = b.id
|
|
437
|
+
WHERE t.status IN ('open', 'in_progress', 'blocked')${qScope.sql}
|
|
438
|
+
ORDER BY t.parent_task_id NULLS FIRST, t.priority ASC, t.created_at ASC`,
|
|
439
|
+
args: [...qScope.args]
|
|
440
|
+
});
|
|
441
|
+
briefData.globalTasks = result.rows.map((row) => ({
|
|
442
|
+
assignedTo: String(row.assigned_to),
|
|
443
|
+
projectName: String(row.project_name),
|
|
444
|
+
title: String(row.title),
|
|
445
|
+
priority: String(row.priority),
|
|
446
|
+
status: String(row.status),
|
|
447
|
+
blockerFile: row.blocker_file ? String(row.blocker_file) : void 0,
|
|
448
|
+
parentTaskId: row.parent_task_id ? String(row.parent_task_id) : void 0,
|
|
449
|
+
updatedAt: row.updated_at ? String(row.updated_at) : void 0
|
|
450
|
+
}));
|
|
451
|
+
} catch {
|
|
452
|
+
briefData.globalTasks = [];
|
|
453
|
+
}
|
|
454
|
+
})(),
|
|
455
|
+
// Completed tasks since last boot
|
|
456
|
+
(async () => {
|
|
457
|
+
if (!lastBootTimestamp) return;
|
|
458
|
+
const cScope = sessionScopeFilter();
|
|
459
|
+
try {
|
|
460
|
+
const result = await client.execute({
|
|
461
|
+
sql: `SELECT assigned_to, title, project_name,
|
|
462
|
+
(julianday(updated_at) - julianday(created_at)) * 24 * 60 as duration_minutes
|
|
463
|
+
FROM tasks
|
|
464
|
+
WHERE status = 'done' AND updated_at > ?${cScope.sql}
|
|
465
|
+
ORDER BY assigned_to, updated_at ASC`,
|
|
466
|
+
args: [lastBootTimestamp, ...cScope.args]
|
|
467
|
+
});
|
|
468
|
+
briefData.completedSinceLastBoot = result.rows.map((row) => ({
|
|
469
|
+
assignedTo: String(row.assigned_to),
|
|
470
|
+
title: String(row.title),
|
|
471
|
+
projectName: String(row.project_name),
|
|
472
|
+
durationMinutes: Number(row.duration_minutes) || 0
|
|
473
|
+
}));
|
|
474
|
+
} catch {
|
|
475
|
+
briefData.completedSinceLastBoot = [];
|
|
476
|
+
}
|
|
477
|
+
})(),
|
|
478
|
+
// Workload per employee
|
|
479
|
+
(async () => {
|
|
480
|
+
const wScope = sessionScopeFilter();
|
|
481
|
+
try {
|
|
482
|
+
const result = await client.execute({
|
|
483
|
+
sql: `SELECT assigned_to,
|
|
484
|
+
SUM(CASE WHEN status = 'open' THEN 1 ELSE 0 END) as open_count,
|
|
485
|
+
SUM(CASE WHEN status = 'in_progress' THEN 1 ELSE 0 END) as active_count,
|
|
486
|
+
SUM(CASE WHEN status = 'done' AND updated_at > datetime('now', '-7 days') THEN 1 ELSE 0 END) as done_7d
|
|
487
|
+
FROM tasks
|
|
488
|
+
WHERE 1=1${wScope.sql}
|
|
489
|
+
GROUP BY assigned_to
|
|
490
|
+
ORDER BY open_count DESC`,
|
|
491
|
+
args: [...wScope.args]
|
|
492
|
+
});
|
|
493
|
+
briefData.workload = result.rows.map((row) => ({
|
|
494
|
+
assignedTo: String(row.assigned_to),
|
|
495
|
+
openCount: Number(row.open_count) || 0,
|
|
496
|
+
activeCount: Number(row.active_count) || 0,
|
|
497
|
+
done7d: Number(row.done_7d) || 0
|
|
498
|
+
}));
|
|
499
|
+
} catch {
|
|
500
|
+
briefData.workload = [];
|
|
501
|
+
}
|
|
502
|
+
})(),
|
|
503
|
+
// Velocity (7-day)
|
|
504
|
+
(async () => {
|
|
505
|
+
const vScope = sessionScopeFilter();
|
|
506
|
+
try {
|
|
507
|
+
const velocityResult = await client.execute({
|
|
508
|
+
sql: `SELECT assigned_to,
|
|
509
|
+
COUNT(*) as completed,
|
|
510
|
+
AVG((julianday(updated_at) - julianday(created_at)) * 24) as avg_hours
|
|
511
|
+
FROM tasks
|
|
512
|
+
WHERE status = 'done' AND updated_at > datetime('now', '-7 days')${vScope.sql}
|
|
513
|
+
GROUP BY assigned_to
|
|
514
|
+
ORDER BY completed DESC`,
|
|
515
|
+
args: [...vScope.args]
|
|
516
|
+
});
|
|
517
|
+
const errScope = sessionScopeFilter();
|
|
518
|
+
const errorResult = await client.execute({
|
|
519
|
+
sql: `SELECT agent_id, COUNT(*) as error_count
|
|
520
|
+
FROM notifications
|
|
521
|
+
WHERE event = 'error_spike' AND created_at > datetime('now', '-7 days')
|
|
522
|
+
${errScope.sql}
|
|
523
|
+
GROUP BY agent_id`,
|
|
524
|
+
args: [...errScope.args]
|
|
525
|
+
});
|
|
526
|
+
const errorMap = /* @__PURE__ */ new Map();
|
|
527
|
+
for (const row of errorResult.rows) {
|
|
528
|
+
errorMap.set(String(row.agent_id), Number(row.error_count) || 0);
|
|
529
|
+
}
|
|
530
|
+
briefData.velocity = velocityResult.rows.map((row) => ({
|
|
531
|
+
assignedTo: String(row.assigned_to),
|
|
532
|
+
completed: Number(row.completed) || 0,
|
|
533
|
+
avgHours: Number(row.avg_hours) || 0,
|
|
534
|
+
errors: errorMap.get(String(row.assigned_to)) ?? 0
|
|
535
|
+
}));
|
|
536
|
+
} catch {
|
|
537
|
+
briefData.velocity = [];
|
|
538
|
+
}
|
|
539
|
+
})(),
|
|
540
|
+
// Active projects
|
|
541
|
+
(async () => {
|
|
542
|
+
try {
|
|
543
|
+
const apScope = sessionScopeFilter();
|
|
544
|
+
const result = await client.execute({
|
|
545
|
+
sql: `SELECT DISTINCT project_name FROM tasks
|
|
546
|
+
WHERE status IN ('open', 'in_progress', 'blocked')
|
|
547
|
+
AND project_name IS NOT NULL AND project_name != '' AND project_name != 'unknown'${apScope.sql}`,
|
|
548
|
+
args: [...apScope.args]
|
|
549
|
+
});
|
|
550
|
+
briefData.activeProjects = result.rows.map((row) => String(row.project_name));
|
|
551
|
+
} catch {
|
|
552
|
+
briefData.activeProjects = [];
|
|
553
|
+
}
|
|
554
|
+
})(),
|
|
555
|
+
// Flagged issues
|
|
556
|
+
(async () => {
|
|
557
|
+
try {
|
|
558
|
+
const result = await client.execute({
|
|
559
|
+
sql: `SELECT agent_id, tool_name, timestamp, raw_text
|
|
560
|
+
FROM memories WHERE has_error = 1
|
|
561
|
+
AND timestamp > datetime('now', '-1 day')
|
|
562
|
+
ORDER BY timestamp DESC LIMIT 5`,
|
|
563
|
+
args: []
|
|
564
|
+
});
|
|
565
|
+
briefData.flaggedIssues = result.rows.map((row) => ({
|
|
566
|
+
agentId: row.agent_id,
|
|
567
|
+
timestamp: row.timestamp,
|
|
568
|
+
toolName: row.tool_name,
|
|
569
|
+
rawText: row.raw_text
|
|
570
|
+
}));
|
|
571
|
+
} catch {
|
|
572
|
+
}
|
|
573
|
+
})(),
|
|
574
|
+
// Failed messages
|
|
575
|
+
(async () => {
|
|
576
|
+
try {
|
|
577
|
+
const failScope = sessionScopeFilter();
|
|
578
|
+
const result = await client.execute({
|
|
579
|
+
sql: `SELECT id, target_agent, content, failure_reason
|
|
580
|
+
FROM messages WHERE status = 'failed'
|
|
581
|
+
${failScope.sql}
|
|
582
|
+
ORDER BY created_at DESC LIMIT 10`,
|
|
583
|
+
args: [...failScope.args]
|
|
584
|
+
});
|
|
585
|
+
briefData.failedMessages = result.rows.map((row) => ({
|
|
586
|
+
id: row.id,
|
|
587
|
+
targetAgent: row.target_agent,
|
|
588
|
+
content: row.content,
|
|
589
|
+
failureReason: row.failure_reason ?? null
|
|
590
|
+
}));
|
|
591
|
+
} catch {
|
|
592
|
+
}
|
|
593
|
+
})(),
|
|
594
|
+
// Active reminders
|
|
595
|
+
(async () => {
|
|
596
|
+
try {
|
|
597
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
598
|
+
const result = await client.execute({
|
|
599
|
+
sql: `SELECT text, due_date FROM reminders WHERE completed_at IS NULL ORDER BY due_date ASC NULLS LAST`,
|
|
600
|
+
args: []
|
|
601
|
+
});
|
|
602
|
+
briefData.reminders = result.rows.map((row) => {
|
|
603
|
+
const dueDate = row.due_date ? String(row.due_date) : null;
|
|
604
|
+
const overdue = dueDate ? dueDate < today : false;
|
|
605
|
+
return { text: String(row.text), dueDate, overdue };
|
|
606
|
+
});
|
|
607
|
+
} catch {
|
|
608
|
+
}
|
|
609
|
+
})(),
|
|
610
|
+
// Projects with open tasks + last activity
|
|
611
|
+
(async () => {
|
|
612
|
+
const pScope = sessionScopeFilter();
|
|
613
|
+
try {
|
|
614
|
+
const { getProjectName } = await import("../project-name-4SKOH2UO.js");
|
|
615
|
+
const currentProject = getProjectName(process.cwd());
|
|
616
|
+
const result = await client.execute({
|
|
617
|
+
sql: `SELECT p.project_name,
|
|
618
|
+
COALESCE(t.open_count, 0) as open_count,
|
|
619
|
+
t.assignees,
|
|
620
|
+
m.last_activity
|
|
621
|
+
FROM (
|
|
622
|
+
SELECT DISTINCT project_name FROM tasks WHERE 1=1${pScope.sql}
|
|
623
|
+
UNION
|
|
624
|
+
SELECT DISTINCT project_name FROM memories
|
|
625
|
+
WHERE timestamp > datetime('now', '-30 days')
|
|
626
|
+
) p
|
|
627
|
+
LEFT JOIN (
|
|
628
|
+
SELECT project_name,
|
|
629
|
+
COUNT(*) as open_count,
|
|
630
|
+
GROUP_CONCAT(DISTINCT assigned_to) as assignees
|
|
631
|
+
FROM tasks WHERE status IN ('open', 'in_progress')${pScope.sql}
|
|
632
|
+
GROUP BY project_name
|
|
633
|
+
) t ON p.project_name = t.project_name
|
|
634
|
+
LEFT JOIN (
|
|
635
|
+
SELECT project_name, MAX(timestamp) as last_activity
|
|
636
|
+
FROM memories GROUP BY project_name
|
|
637
|
+
) m ON p.project_name = m.project_name
|
|
638
|
+
WHERE p.project_name IS NOT NULL AND p.project_name != ''
|
|
639
|
+
ORDER BY COALESCE(t.open_count, 0) DESC, m.last_activity DESC`,
|
|
640
|
+
args: [...pScope.args, ...pScope.args]
|
|
641
|
+
});
|
|
642
|
+
const projects = result.rows.map((row) => ({
|
|
643
|
+
projectName: String(row.project_name),
|
|
644
|
+
openTasks: Number(row.open_count) || 0,
|
|
645
|
+
assignees: row.assignees ? String(row.assignees).split(",") : [],
|
|
646
|
+
lastActivity: row.last_activity ? String(row.last_activity) : "",
|
|
647
|
+
isCurrent: String(row.project_name) === currentProject,
|
|
648
|
+
recentTasks: [],
|
|
649
|
+
velocity7d: 0,
|
|
650
|
+
commits7d: void 0,
|
|
651
|
+
blockedCount: void 0,
|
|
652
|
+
sessionName: void 0,
|
|
653
|
+
teamActivity: void 0
|
|
654
|
+
}));
|
|
655
|
+
for (const p of projects) {
|
|
656
|
+
try {
|
|
657
|
+
const tasksResult = await client.execute({
|
|
658
|
+
sql: `SELECT assigned_to, title, updated_at FROM tasks
|
|
659
|
+
WHERE project_name = ? AND status = 'done'${pScope.sql}
|
|
660
|
+
ORDER BY updated_at DESC LIMIT 5`,
|
|
661
|
+
args: [p.projectName, ...pScope.args]
|
|
662
|
+
});
|
|
663
|
+
p.recentTasks = tasksResult.rows.map((r) => ({
|
|
664
|
+
assignedTo: String(r.assigned_to),
|
|
665
|
+
title: String(r.title),
|
|
666
|
+
updatedAt: String(r.updated_at)
|
|
667
|
+
}));
|
|
668
|
+
const actResult = await client.execute({
|
|
669
|
+
sql: `SELECT assigned_to,
|
|
670
|
+
SUM(CASE WHEN task_file NOT LIKE '%review-%' THEN 1 ELSE 0 END) as tasks_done,
|
|
671
|
+
SUM(CASE WHEN task_file LIKE '%review-%' THEN 1 ELSE 0 END) as reviews_cleared
|
|
672
|
+
FROM tasks
|
|
673
|
+
WHERE project_name = ? AND status = 'done'
|
|
674
|
+
AND updated_at > datetime('now', '-7 days')${pScope.sql}
|
|
675
|
+
GROUP BY assigned_to`,
|
|
676
|
+
args: [p.projectName, ...pScope.args]
|
|
677
|
+
});
|
|
678
|
+
const activity = actResult.rows.map((r) => ({
|
|
679
|
+
name: String(r.assigned_to),
|
|
680
|
+
tasksDone: Number(r.tasks_done) || 0,
|
|
681
|
+
reviewsCleared: Number(r.reviews_cleared) || 0
|
|
682
|
+
}));
|
|
683
|
+
const assignedResult = await client.execute({
|
|
684
|
+
sql: `SELECT COUNT(*) as cnt FROM tasks
|
|
685
|
+
WHERE project_name = ? AND assigned_by = ?
|
|
686
|
+
AND created_at > datetime('now', '-7 days')${pScope.sql}`,
|
|
687
|
+
args: [p.projectName, coordinatorName, ...pScope.args]
|
|
688
|
+
});
|
|
689
|
+
const tasksAssigned = Number(assignedResult.rows[0]?.cnt) || 0;
|
|
690
|
+
if (tasksAssigned > 0) {
|
|
691
|
+
const exeEntry = activity.find((a) => a.name === coordinatorName || isCoordinatorName(a.name));
|
|
692
|
+
if (exeEntry) {
|
|
693
|
+
exeEntry.tasksAssigned = tasksAssigned;
|
|
694
|
+
} else {
|
|
695
|
+
activity.push({ name: coordinatorName, tasksDone: 0, reviewsCleared: 0, tasksAssigned });
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
p.teamActivity = activity;
|
|
699
|
+
const blockedResult = await client.execute({
|
|
700
|
+
sql: `SELECT COUNT(*) as cnt FROM tasks
|
|
701
|
+
WHERE project_name = ? AND status = 'blocked'${pScope.sql}`,
|
|
702
|
+
args: [p.projectName, ...pScope.args]
|
|
703
|
+
});
|
|
704
|
+
p.blockedCount = Number(blockedResult.rows[0]?.cnt) || 0;
|
|
705
|
+
} catch {
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
try {
|
|
709
|
+
const { listSessions: listRegistrySessions } = await import("../lib/session-registry.js");
|
|
710
|
+
const regSessions = listRegistrySessions();
|
|
711
|
+
for (const s of regSessions) {
|
|
712
|
+
const projName = s.projectDir.split("/").pop() ?? "";
|
|
713
|
+
const proj = projects.find((p) => p.projectName === projName);
|
|
714
|
+
if (!proj || proj.sessionName) continue;
|
|
715
|
+
if (s.agentId === coordinatorName || isCoordinatorName(s.agentId)) {
|
|
716
|
+
proj.sessionName = s.windowName;
|
|
717
|
+
} else if (s.parentExe) {
|
|
718
|
+
proj.sessionName = s.parentExe;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
} catch {
|
|
722
|
+
}
|
|
723
|
+
try {
|
|
724
|
+
const { execSync: execGit } = await import("child_process");
|
|
725
|
+
const projDirs = /* @__PURE__ */ new Map();
|
|
726
|
+
projDirs.set(currentProject, process.cwd());
|
|
727
|
+
try {
|
|
728
|
+
const { listSessions: ls2 } = await import("../lib/session-registry.js");
|
|
729
|
+
for (const s of ls2()) {
|
|
730
|
+
const name = s.projectDir.split("/").pop() ?? "";
|
|
731
|
+
if (name && !projDirs.has(name)) projDirs.set(name, s.projectDir);
|
|
732
|
+
}
|
|
733
|
+
} catch {
|
|
734
|
+
}
|
|
735
|
+
for (const p of projects) {
|
|
736
|
+
const dir = projDirs.get(p.projectName);
|
|
737
|
+
if (!dir) continue;
|
|
738
|
+
try {
|
|
739
|
+
const count = execGit(
|
|
740
|
+
'git log --oneline --since="7 days ago" --grep="Co-Authored-By: Claude" --grep="^task(" --all-match 2>/dev/null | wc -l; git log --oneline --since="7 days ago" --grep="Co-Authored-By: Claude" 2>/dev/null | wc -l; git log --oneline --since="7 days ago" --grep="^task(" 2>/dev/null | wc -l',
|
|
741
|
+
{ encoding: "utf8", timeout: 3e3, cwd: dir }
|
|
742
|
+
).trim();
|
|
743
|
+
const counts = count.split("\n").map((l) => parseInt(l.trim(), 10) || 0);
|
|
744
|
+
const maxCount = Math.max(...counts);
|
|
745
|
+
if (maxCount > 0) p.commits7d = maxCount;
|
|
746
|
+
} catch {
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
} catch {
|
|
750
|
+
}
|
|
751
|
+
briefData.projects = projects;
|
|
752
|
+
} catch {
|
|
753
|
+
briefData.projects = [];
|
|
754
|
+
}
|
|
755
|
+
})(),
|
|
756
|
+
// Memory stats per employee
|
|
757
|
+
(async () => {
|
|
758
|
+
try {
|
|
759
|
+
const result = await client.execute({
|
|
760
|
+
sql: `SELECT agent_id,
|
|
761
|
+
COUNT(*) as total,
|
|
762
|
+
SUM(CASE WHEN timestamp > datetime('now', '-7 days') THEN 1 ELSE 0 END) as growth_7d
|
|
763
|
+
FROM memories
|
|
764
|
+
WHERE agent_id != 'default'
|
|
765
|
+
GROUP BY agent_id
|
|
766
|
+
ORDER BY total DESC`,
|
|
767
|
+
args: []
|
|
768
|
+
});
|
|
769
|
+
briefData.memoryStats = result.rows.map((row) => ({
|
|
770
|
+
agentId: String(row.agent_id),
|
|
771
|
+
totalMemories: Number(row.total) || 0,
|
|
772
|
+
growth7d: Number(row.growth_7d) || 0
|
|
773
|
+
}));
|
|
774
|
+
} catch {
|
|
775
|
+
briefData.memoryStats = [];
|
|
776
|
+
}
|
|
777
|
+
})(),
|
|
778
|
+
// Recent completed tasks for current project + git commits
|
|
779
|
+
(async () => {
|
|
780
|
+
try {
|
|
781
|
+
const { getProjectName } = await import("../project-name-4SKOH2UO.js");
|
|
782
|
+
const currentProject = getProjectName(process.cwd());
|
|
783
|
+
briefData.currentProject = currentProject;
|
|
784
|
+
const rctScope = sessionScopeFilter();
|
|
785
|
+
const result = await client.execute({
|
|
786
|
+
sql: `SELECT assigned_to, title, updated_at
|
|
787
|
+
FROM tasks
|
|
788
|
+
WHERE project_name = ? AND status = 'done'${rctScope.sql}
|
|
789
|
+
ORDER BY updated_at DESC
|
|
790
|
+
LIMIT 10`,
|
|
791
|
+
args: [currentProject, ...rctScope.args]
|
|
792
|
+
});
|
|
793
|
+
briefData.recentProjectTasks = result.rows.map((row) => ({
|
|
794
|
+
assignedTo: String(row.assigned_to),
|
|
795
|
+
title: String(row.title),
|
|
796
|
+
updatedAt: String(row.updated_at)
|
|
797
|
+
}));
|
|
798
|
+
try {
|
|
799
|
+
const { execSync: execSync2 } = await import("child_process");
|
|
800
|
+
const gitLog = execSync2(
|
|
801
|
+
"git log --oneline -10 --grep='Co-Authored-By: Claude' --grep='task(' --all-match 2>/dev/null || git log --oneline -5 --grep='Co-Authored-By: Claude' 2>/dev/null || git log --oneline -5 --grep='^task(' 2>/dev/null",
|
|
802
|
+
{
|
|
803
|
+
encoding: "utf8",
|
|
804
|
+
timeout: 3e3,
|
|
805
|
+
cwd: process.cwd()
|
|
806
|
+
}
|
|
807
|
+
).trim();
|
|
808
|
+
if (gitLog) {
|
|
809
|
+
const seen = /* @__PURE__ */ new Set();
|
|
810
|
+
briefData.recentCommits = gitLog.split("\n").filter((line) => {
|
|
811
|
+
if (!line || seen.has(line)) return false;
|
|
812
|
+
seen.add(line);
|
|
813
|
+
return true;
|
|
814
|
+
}).slice(0, 3);
|
|
815
|
+
}
|
|
816
|
+
} catch {
|
|
817
|
+
}
|
|
818
|
+
} catch {
|
|
819
|
+
}
|
|
820
|
+
})()
|
|
821
|
+
]);
|
|
822
|
+
try {
|
|
823
|
+
const configPath = path.join(
|
|
824
|
+
process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path.join(os.homedir(), ".exe-os"),
|
|
825
|
+
"config.json"
|
|
826
|
+
);
|
|
827
|
+
if (existsSync(configPath)) {
|
|
828
|
+
const raw = JSON.parse(readFileSync(configPath, "utf8"));
|
|
829
|
+
briefData.cloudConnected = !!(raw.cloud || raw.turso);
|
|
830
|
+
}
|
|
831
|
+
} catch {
|
|
832
|
+
}
|
|
833
|
+
try {
|
|
834
|
+
const backfillFlagPath = path.join(EXE_AI_DIR, "session-cache", "needs-backfill");
|
|
835
|
+
const isBackfillNeeded = () => existsSync(backfillFlagPath);
|
|
836
|
+
const coverageResult = await client.execute({
|
|
837
|
+
sql: `SELECT COUNT(*) as total,
|
|
838
|
+
SUM(CASE WHEN vector IS NOT NULL THEN 1 ELSE 0 END) as with_vectors
|
|
839
|
+
FROM memories`,
|
|
840
|
+
args: []
|
|
841
|
+
});
|
|
842
|
+
const totalMemories = Number(coverageResult.rows[0]?.total) || 0;
|
|
843
|
+
const memoriesWithVectors = Number(coverageResult.rows[0]?.with_vectors) || 0;
|
|
844
|
+
const nullCount = totalMemories - memoriesWithVectors;
|
|
845
|
+
const recentResult = await client.execute({
|
|
846
|
+
sql: `SELECT COUNT(*) as total,
|
|
847
|
+
SUM(CASE WHEN vector IS NOT NULL THEN 1 ELSE 0 END) as with_vec
|
|
848
|
+
FROM memories
|
|
849
|
+
WHERE timestamp > datetime('now', '-24 hours')`,
|
|
850
|
+
args: []
|
|
851
|
+
});
|
|
852
|
+
const recent24hTotal = Number(recentResult.rows[0]?.total) || 0;
|
|
853
|
+
const recent24hWithVectors = Number(recentResult.rows[0]?.with_vec) || 0;
|
|
854
|
+
let daemonRunning = false;
|
|
855
|
+
let daemonUptime;
|
|
856
|
+
let daemonRequestsServed;
|
|
857
|
+
const socketPath = path.join(EXE_AI_DIR, "exed.sock");
|
|
858
|
+
if (existsSync(socketPath)) {
|
|
859
|
+
try {
|
|
860
|
+
const net = await import("net");
|
|
861
|
+
const health = await new Promise((resolve) => {
|
|
862
|
+
const timer = setTimeout(() => {
|
|
863
|
+
sock.destroy();
|
|
864
|
+
resolve(null);
|
|
865
|
+
}, 2e3);
|
|
866
|
+
const sock = net.createConnection({ path: socketPath });
|
|
867
|
+
let buf = "";
|
|
868
|
+
sock.on("connect", () => {
|
|
869
|
+
sock.write(JSON.stringify({ id: "boot-health", type: "health" }) + "\n");
|
|
870
|
+
});
|
|
871
|
+
sock.on("data", (chunk) => {
|
|
872
|
+
buf += chunk.toString();
|
|
873
|
+
for (const line of buf.split("\n")) {
|
|
874
|
+
if (!line) continue;
|
|
875
|
+
try {
|
|
876
|
+
const resp = JSON.parse(line);
|
|
877
|
+
if (resp.health) {
|
|
878
|
+
clearTimeout(timer);
|
|
879
|
+
sock.destroy();
|
|
880
|
+
resolve(resp.health);
|
|
881
|
+
}
|
|
882
|
+
} catch {
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
sock.on("error", () => {
|
|
887
|
+
clearTimeout(timer);
|
|
888
|
+
resolve(null);
|
|
889
|
+
});
|
|
890
|
+
});
|
|
891
|
+
if (health) {
|
|
892
|
+
daemonRunning = true;
|
|
893
|
+
daemonUptime = health.uptime;
|
|
894
|
+
daemonRequestsServed = health.requests_served;
|
|
895
|
+
}
|
|
896
|
+
} catch {
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
if (!daemonRunning) {
|
|
900
|
+
const pidPath = path.join(EXE_AI_DIR, "exed.pid");
|
|
901
|
+
if (existsSync(pidPath)) {
|
|
902
|
+
try {
|
|
903
|
+
const pid = parseInt(readFileSync(pidPath, "utf8").trim(), 10);
|
|
904
|
+
if (pid > 0) {
|
|
905
|
+
process.kill(pid, 0);
|
|
906
|
+
daemonRunning = true;
|
|
907
|
+
}
|
|
908
|
+
} catch {
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
if (nullCount === 0) {
|
|
913
|
+
try {
|
|
914
|
+
const flagPath = path.join(EXE_AI_DIR, "session-cache", "needs-backfill");
|
|
915
|
+
if (existsSync(flagPath)) {
|
|
916
|
+
const { unlinkSync: unlinkSync2 } = await import("fs");
|
|
917
|
+
unlinkSync2(flagPath);
|
|
918
|
+
}
|
|
919
|
+
} catch {
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
briefData.embedding = {
|
|
923
|
+
daemonRunning,
|
|
924
|
+
daemonUptime,
|
|
925
|
+
daemonRequestsServed,
|
|
926
|
+
totalMemories,
|
|
927
|
+
memoriesWithVectors,
|
|
928
|
+
backfillRunning: nullCount > 0 && isBackfillNeeded(),
|
|
929
|
+
recent24hTotal,
|
|
930
|
+
recent24hWithVectors
|
|
931
|
+
};
|
|
932
|
+
if (nullCount > 0) {
|
|
933
|
+
try {
|
|
934
|
+
const { tryAcquireWorkerSlot, registerWorkerPid } = await import("../worker-gate-GFKXZ6V5.js");
|
|
935
|
+
if (!tryAcquireWorkerSlot()) {
|
|
936
|
+
process.stderr.write("[exe-boot] Backfill needed but worker gate full \u2014 skipping\n");
|
|
937
|
+
} else {
|
|
938
|
+
const { spawn } = await import("child_process");
|
|
939
|
+
const { fileURLToPath } = await import("url");
|
|
940
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
941
|
+
const backfillPath = path.resolve(path.dirname(thisFile), "backfill-vectors.js");
|
|
942
|
+
if (existsSync(backfillPath)) {
|
|
943
|
+
const { openSync, closeSync } = await import("fs");
|
|
944
|
+
const workerLogPath = path.join(EXE_AI_DIR, "workers.log");
|
|
945
|
+
let stderrFd = "ignore";
|
|
946
|
+
try {
|
|
947
|
+
stderrFd = openSync(workerLogPath, "a");
|
|
948
|
+
} catch {
|
|
949
|
+
}
|
|
950
|
+
const child = spawn(process.execPath, [backfillPath], {
|
|
951
|
+
detached: true,
|
|
952
|
+
stdio: ["ignore", "ignore", stderrFd]
|
|
953
|
+
});
|
|
954
|
+
child.unref();
|
|
955
|
+
if (child.pid) registerWorkerPid(child.pid);
|
|
956
|
+
if (typeof stderrFd === "number") try {
|
|
957
|
+
closeSync(stderrFd);
|
|
958
|
+
} catch {
|
|
959
|
+
}
|
|
960
|
+
briefData.embedding.backfillRunning = true;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
} catch {
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
} catch {
|
|
967
|
+
}
|
|
968
|
+
try {
|
|
969
|
+
const { fileURLToPath } = await import("url");
|
|
970
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
971
|
+
const criticalBinaries = ["backfill-vectors.js", "scan-tasks.js"];
|
|
972
|
+
const missing = [];
|
|
973
|
+
for (const bin of criticalBinaries) {
|
|
974
|
+
const binPath = path.resolve(path.dirname(thisFile), bin);
|
|
975
|
+
if (!existsSync(binPath)) {
|
|
976
|
+
missing.push(`dist/bin/${bin}`);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
if (missing.length > 0) {
|
|
980
|
+
briefData.missingBinaries = missing;
|
|
981
|
+
}
|
|
982
|
+
} catch {
|
|
983
|
+
}
|
|
984
|
+
try {
|
|
985
|
+
const { countKillsSince } = await import("../session-kill-telemetry-JHSI7D3F.js");
|
|
986
|
+
const { listSessions: listRegistrySessions } = await import("../lib/session-registry.js");
|
|
987
|
+
const todayStart = /* @__PURE__ */ new Date();
|
|
988
|
+
todayStart.setHours(0, 0, 0, 0);
|
|
989
|
+
briefData.sessionsKilledToday = await countKillsSince(todayStart.toISOString());
|
|
990
|
+
const liveSessionCount = listRegistrySessions().length;
|
|
991
|
+
briefData.idleKillSuspectBroken = await updateIdleKillSuspectStreak(
|
|
992
|
+
client,
|
|
993
|
+
briefData.sessionsKilledToday,
|
|
994
|
+
liveSessionCount,
|
|
995
|
+
todayStart.toISOString().slice(0, 10)
|
|
996
|
+
);
|
|
997
|
+
} catch {
|
|
998
|
+
}
|
|
999
|
+
const brief = await generateStatusBrief(employees, briefData);
|
|
1000
|
+
if (briefOnly) {
|
|
1001
|
+
console.log(brief);
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
1004
|
+
const sessionDir = path.join(EXE_AI_DIR, "sessions", coordinatorName);
|
|
1005
|
+
await mkdir(sessionDir, { recursive: true });
|
|
1006
|
+
const coordinatorIdentityPath = path.join(EXE_AI_DIR, "identity", `${coordinatorName}.md`);
|
|
1007
|
+
const coordinatorPrompt = existsSync(coordinatorIdentityPath) ? readFileSync(coordinatorIdentityPath, "utf-8") : coordinatorEmployee.systemPrompt ?? "";
|
|
1008
|
+
const claudeMdContent = `${getSessionPrompt(coordinatorPrompt)}
|
|
1009
|
+
|
|
1010
|
+
---
|
|
1011
|
+
|
|
1012
|
+
# Status Brief
|
|
1013
|
+
|
|
1014
|
+
${brief}`;
|
|
1015
|
+
await writeFile(path.join(sessionDir, "CLAUDE.md"), claudeMdContent, "utf-8");
|
|
1016
|
+
const notificationSessionScope = resolveExeSession();
|
|
1017
|
+
const unread = await readUnreadNotifications(void 0, notificationSessionScope);
|
|
1018
|
+
if (unread.length > 0) {
|
|
1019
|
+
console.log(`\u{1F4EC} ${unread.length} unread notification${unread.length === 1 ? "" : "s"}`);
|
|
1020
|
+
await markAsRead(unread.map((n) => n.id), notificationSessionScope);
|
|
1021
|
+
}
|
|
1022
|
+
await cleanupOldNotifications(void 0, notificationSessionScope);
|
|
1023
|
+
console.log(brief);
|
|
1024
|
+
try {
|
|
1025
|
+
const configPath2 = path.join(
|
|
1026
|
+
process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path.join(os.homedir(), ".exe-os"),
|
|
1027
|
+
"config.json"
|
|
1028
|
+
);
|
|
1029
|
+
if (existsSync(configPath2)) {
|
|
1030
|
+
const rawCfg = JSON.parse(readFileSync(configPath2, "utf8"));
|
|
1031
|
+
const cloudCfg = rawCfg.cloud;
|
|
1032
|
+
if (cloudCfg?.apiKey) {
|
|
1033
|
+
const { initSyncCrypto, isSyncCryptoInitialized } = await import("../lib/crypto.js");
|
|
1034
|
+
if (!isSyncCryptoInitialized()) {
|
|
1035
|
+
const { getMasterKey } = await import("../lib/keychain.js");
|
|
1036
|
+
const mk = await getMasterKey();
|
|
1037
|
+
if (mk) initSyncCrypto(mk);
|
|
1038
|
+
}
|
|
1039
|
+
const { cloudSync } = await import("../lib/cloud-sync.js");
|
|
1040
|
+
cloudSync({ apiKey: cloudCfg.apiKey, endpoint: cloudCfg.endpoint ?? "" }).catch(() => {
|
|
1041
|
+
});
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
} catch {
|
|
1045
|
+
}
|
|
1046
|
+
try {
|
|
1047
|
+
const { listSchedules } = await import("../lib/schedules.js");
|
|
1048
|
+
const schedules = await listSchedules(true);
|
|
1049
|
+
const sessionSchedules = schedules.filter((s) => !s.useCrontab);
|
|
1050
|
+
if (sessionSchedules.length > 0) {
|
|
1051
|
+
console.log(`
|
|
1052
|
+
[SCHEDULES] ${sessionSchedules.length} session-scoped schedule(s) to re-register:`);
|
|
1053
|
+
for (const s of sessionSchedules) {
|
|
1054
|
+
console.log(` CronCreate: cron="${s.cron}" prompt="${s.prompt ?? s.description}"`);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
} catch {
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
async function updateIdleKillSuspectStreak(client, killsToday, liveSessions, todayDate) {
|
|
1061
|
+
try {
|
|
1062
|
+
const {
|
|
1063
|
+
IDLE_KILL_STREAK_META_KEY,
|
|
1064
|
+
computeIdleKillSuspectStreak,
|
|
1065
|
+
parseStreakState
|
|
1066
|
+
} = await import("../session-kill-telemetry-JHSI7D3F.js");
|
|
1067
|
+
const prevResult = await client.execute({
|
|
1068
|
+
sql: "SELECT value FROM sync_meta WHERE key = ?",
|
|
1069
|
+
args: [IDLE_KILL_STREAK_META_KEY]
|
|
1070
|
+
});
|
|
1071
|
+
const prevRaw = prevResult.rows[0]?.value;
|
|
1072
|
+
const prev = parseStreakState(prevRaw ?? null);
|
|
1073
|
+
const { state, suspect } = computeIdleKillSuspectStreak(
|
|
1074
|
+
prev,
|
|
1075
|
+
killsToday,
|
|
1076
|
+
liveSessions,
|
|
1077
|
+
todayDate
|
|
1078
|
+
);
|
|
1079
|
+
await client.execute({
|
|
1080
|
+
sql: "INSERT OR REPLACE INTO sync_meta (key, value) VALUES (?, ?)",
|
|
1081
|
+
args: [IDLE_KILL_STREAK_META_KEY, JSON.stringify(state)]
|
|
1082
|
+
});
|
|
1083
|
+
return suspect;
|
|
1084
|
+
} catch {
|
|
1085
|
+
return false;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
function runSplash() {
|
|
1089
|
+
try {
|
|
1090
|
+
const config = loadConfigSync();
|
|
1091
|
+
if (!config.splashEffect) return;
|
|
1092
|
+
execSync(
|
|
1093
|
+
'echo "EXE OS" | python3 -m terminaltexteffects decrypt --typing-speed 2 --ciphertext-colors 6B4C9A F5D76E --final-gradient-stops F5D76E F0EDE8 --final-gradient-direction vertical',
|
|
1094
|
+
{ stdio: "inherit", timeout: 5e3 }
|
|
1095
|
+
);
|
|
1096
|
+
} catch {
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
if (isMainModule(import.meta.url)) {
|
|
1100
|
+
const briefOnly = process.argv.includes("--brief-only");
|
|
1101
|
+
if (!briefOnly) {
|
|
1102
|
+
runSplash();
|
|
1103
|
+
}
|
|
1104
|
+
boot({ briefOnly }).catch((err) => {
|
|
1105
|
+
console.error(
|
|
1106
|
+
"Boot failed:",
|
|
1107
|
+
err instanceof Error ? err.message : String(err)
|
|
1108
|
+
);
|
|
1109
|
+
process.exit(1);
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1112
|
+
export {
|
|
1113
|
+
boot
|
|
1114
|
+
};
|