@askexenow/exe-os 0.9.374 → 0.9.377
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/deploy/compose/.env.customer.example +16 -1
- package/deploy/compose/.env.example +16 -1
- package/deploy/compose/docker-compose.yml +80 -18
- package/deploy/compose/gateway-watchdog.sh +17 -0
- package/deploy/compose/generate-env.ts +41 -1
- package/deploy/compose/sso-edge/default.conf.template +92 -64
- package/deploy/compose/sso-edge/error-pages/404.html +129 -0
- package/deploy/compose/sso-edge/error-pages/500.html +129 -0
- package/deploy/compose/sso-edge/error-pages/503.html +118 -0
- package/deploy/compose/sso-edge/sso-redirect.conf +115 -92
- package/dist/.dist-verified.json +3 -3
- package/dist/{active-agent-ONPPEWQV.js → active-agent-BOBBUJ74.js} +6 -6
- package/dist/{active-agent-UJKMG7LJ.js → active-agent-GFGEGK2U.js} +6 -6
- package/dist/{agent-defs-generator-ZWI6DXOE.js → agent-defs-generator-OX6UFPRX.js} +5 -5
- package/dist/{agent-loop-OYHJKNYH.js → agent-loop-7ZRH56EX.js} +1 -1
- package/dist/{agentic-ontology-WHFJ3QFS.js → agentic-ontology-DT3VOXBT.js} +1 -1
- package/dist/{backfill-metadata-3OUSQD5V.js → backfill-metadata-VRP6PTPP.js} +9 -9
- package/dist/{backup-verify-ZKTUYLTA.js → backup-verify-LWHKGOOV.js} +1 -1
- package/dist/behavior-injection-GMZKZ3BT.js +83 -0
- package/dist/behavior-promotion-QPC4AQ24.js +62 -0
- package/dist/{behaviors-ZJ45TFBJ.js → behaviors-GPI4BLTC.js} +16 -14
- package/dist/bin/agentic-ontology-backfill.js +10 -10
- package/dist/bin/agentic-reflection-backfill.js +11 -11
- package/dist/bin/agentic-semantic-label.js +10 -10
- package/dist/bin/backfill-conversations.js +14 -12
- package/dist/bin/backfill-responses.js +14 -12
- package/dist/bin/backfill-vectors.js +16 -14
- package/dist/bin/bulk-sync-postgres.js +21 -19
- package/dist/bin/cc-doctor.js +19 -11
- package/dist/bin/cleanup-stale-review-tasks.js +27 -26
- package/dist/bin/cli.js +83 -109
- package/dist/bin/daemon-restart-handoff.js +2 -1
- package/dist/bin/deferred-daemon-restart.js +118 -110
- package/dist/bin/exe-actions.js +176 -0
- package/dist/bin/exe-agent-config.js +5 -5
- package/dist/bin/exe-agent.js +23 -23
- package/dist/bin/exe-assign.js +16 -14
- package/dist/bin/exe-boot.js +91 -71
- package/dist/bin/exe-call.js +8 -8
- package/dist/bin/exe-cicd.js +1210 -0
- package/dist/bin/exe-cloud.js +70 -37
- package/dist/bin/exe-config-dump.js +5 -5
- package/dist/bin/exe-dispatch.js +28 -27
- package/dist/bin/exe-doctor.js +12 -11
- package/dist/bin/exe-export-behaviors.js +20 -18
- package/dist/bin/exe-forget.js +11 -11
- package/dist/bin/exe-gateway.js +10 -10
- package/dist/bin/exe-healthcheck.js +22 -10
- package/dist/bin/exe-heartbeat.js +33 -32
- package/dist/bin/exe-kill.js +32 -31
- package/dist/bin/exe-launch-agent.js +76 -54
- package/dist/bin/exe-mcp.js +10 -6
- package/dist/bin/exe-memory-reads.js +9 -9
- package/dist/bin/exe-model-supervisor.js +138 -0
- package/dist/bin/exe-new-employee.js +14 -14
- package/dist/bin/exe-os-mcp-proxy.js +10 -6
- package/dist/bin/exe-pending-messages.js +28 -27
- package/dist/bin/exe-pending-notifications.js +27 -26
- package/dist/bin/exe-pending-reviews.js +28 -27
- package/dist/bin/exe-rename.js +9 -9
- package/dist/bin/exe-repo-truth.js +1 -1
- package/dist/bin/exe-review.js +31 -30
- package/dist/bin/exe-search.js +10 -10
- package/dist/bin/exe-session-cleanup.js +32 -31
- package/dist/bin/exe-settings.js +21 -19
- package/dist/bin/exe-start-codex.js +31 -25
- package/dist/bin/exe-start-opencode.js +24 -22
- package/dist/bin/exe-start.sh +11 -2
- package/dist/bin/exe-status.js +29 -28
- package/dist/bin/exe-support.js +3 -3
- package/dist/bin/exe-team.js +7 -7
- package/dist/bin/exe-timers.js +2 -1
- package/dist/bin/exe-watchdog.js +170 -16
- package/dist/bin/generate-hook-manifest.js +8 -41
- package/dist/bin/git-sweep.js +28 -27
- package/dist/bin/graph-backfill.js +11 -11
- package/dist/bin/graph-export.js +10 -10
- package/dist/bin/hooks-cli.js +289 -0
- package/dist/bin/import-history.js +14 -14
- package/dist/bin/install.js +130 -116
- package/dist/bin/intercom-check.js +5 -5
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.js +7 -7
- package/dist/bin/postgres-agentic-reflection-backfill.js +4 -4
- package/dist/bin/postgres-agentic-semantic-backfill.js +4 -4
- package/dist/bin/pre-publish.js +1 -1
- package/dist/bin/reconcile-backlog.js +2 -2
- package/dist/bin/registry-proxy.js +2 -2
- package/dist/bin/scan-tasks.js +52 -38
- package/dist/bin/setup.js +1 -1
- package/dist/bin/shard-migrate.js +9 -9
- package/dist/bin/stack-update.js +10 -5
- package/dist/bin/verify-stack.js +3 -1
- package/dist/bin/vps-health-gate.js +1 -1
- package/dist/{boot-generation-JKVZ4ZAT.js → boot-generation-BN6GKASY.js} +6 -6
- package/dist/{boot-review-sections-2M6BTG73.js → boot-review-sections-OQ5JGSOD.js} +26 -25
- package/dist/{branch-hygiene-U5GFRSTP.js → branch-hygiene-QLD77IMJ.js} +1 -1
- package/dist/build-manifest.json +1186 -1106
- package/dist/{capability-cards-5IMJT6J7.js → capability-cards-EDZ62HKG.js} +5 -5
- package/dist/{capacity-monitor-SAXCQK7O.js → capacity-monitor-6GMTVILS.js} +28 -27
- package/dist/{catchup-brief-U2TXBLHD.js → catchup-brief-SGGBMDUP.js} +32 -31
- package/dist/{cc-binary-detect-6TNIY5JX.js → cc-binary-detect-ZR6WNOUU.js} +1 -3
- package/dist/{chunk-NKETJCB5.js → chunk-2ODXCCMR.js} +18 -3
- package/dist/{hook-integrity-KGAV6ZC2.js → chunk-3L72UBUH.js} +28 -15
- package/dist/chunk-3OX5S7KZ.js +273 -0
- package/dist/{chunk-W75GTHR3.js → chunk-3SRZNJKD.js} +1 -1
- package/dist/{chunk-I4DNJFDR.js → chunk-42IFYZUN.js} +4 -4
- package/dist/{chunk-JHI5WMK5.js → chunk-473JUDCT.js} +5 -5
- package/dist/{chunk-ANLFH23R.js → chunk-4F5CNI65.js} +1 -1
- package/dist/{chunk-AWWKRZMB.js → chunk-4KVSCQND.js} +87 -14
- package/dist/{chunk-ZCERWHY2.js → chunk-4M6RXJEY.js} +33 -23
- package/dist/{chunk-YTSXPJUQ.js → chunk-4YJEEOYT.js} +3 -3
- package/dist/{chunk-6RKKVPYF.js → chunk-4YUGB637.js} +1 -1
- package/dist/{chunk-XXOPG4BW.js → chunk-4ZSOKEDY.js} +3 -3
- package/dist/{chunk-55BEFF4V.js → chunk-5DF4Y6EC.js} +1 -1
- package/dist/{chunk-4QCFFW2H.js → chunk-5QCIWWFA.js} +46 -0
- package/dist/{chunk-3UUX5OY4.js → chunk-5QKLWJ4Z.js} +1 -1
- package/dist/{chunk-YSLGFPWX.js → chunk-5UBWBXLF.js} +3 -3
- package/dist/chunk-5WA4DG2A.js +117 -0
- package/dist/{chunk-4EN3IZ3Q.js → chunk-64ODONK2.js} +67 -1
- package/dist/{chunk-TAMDAOCU.js → chunk-66CGXQUA.js} +239 -39
- package/dist/{chunk-QHJR7IMX.js → chunk-6F3FQCAQ.js} +3 -3
- package/dist/{chunk-WMEYJT4R.js → chunk-6FG34V6D.js} +15 -14
- package/dist/{chunk-NMH5ZQPU.js → chunk-6KQ6WMTI.js} +1 -1
- package/dist/{chunk-IRVOXUSK.js → chunk-6WKBTZVL.js} +10 -4
- package/dist/{chunk-NOKJCF27.js → chunk-7INEFMVU.js} +9 -3
- package/dist/{chunk-GSJLB6JI.js → chunk-7THUQU44.js} +34 -8
- package/dist/{chunk-HDLAB7W3.js → chunk-7UH2JWBF.js} +1 -1
- package/dist/{chunk-KTCXJWJG.js → chunk-7UNMSF5O.js} +1 -1
- package/dist/{chunk-JTVIANUB.js → chunk-AEUGIJDO.js} +3 -1
- package/dist/{chunk-DSJI76XL.js → chunk-AHNVFBVB.js} +113 -16
- package/dist/{chunk-IBS2FAI4.js → chunk-AUKRBHHZ.js} +4 -1
- package/dist/{chunk-AKLJ4JH3.js → chunk-BBK2TSK3.js} +1 -1
- package/dist/{chunk-ZL4AGWAH.js → chunk-BNWWVYRN.js} +6 -5
- package/dist/{chunk-PY3FOMRN.js → chunk-BQEZPRUC.js} +4 -4
- package/dist/{chunk-DIXXEE3S.js → chunk-BQXYXJYC.js} +721 -309
- package/dist/{chunk-ORM7ZFKC.js → chunk-BZ546I4Q.js} +32 -0
- package/dist/{chunk-3KDCORDO.js → chunk-C2UN464N.js} +1 -1
- package/dist/{chunk-75H4R62K.js → chunk-CBPNZFSU.js} +0 -2
- package/dist/{chunk-YLXTKI6M.js → chunk-CHO5SNWR.js} +1 -1
- package/dist/{chunk-MXPNVSXI.js → chunk-CIEVY5TD.js} +11 -11
- package/dist/{chunk-UBK7HK3J.js → chunk-CKLJT2DH.js} +2 -2
- package/dist/{chunk-MOGA4Q7F.js → chunk-CKOJP7JI.js} +1 -1
- package/dist/{chunk-V3W3SATA.js → chunk-CL4J4757.js} +1 -1
- package/dist/{chunk-XNNECNDL.js → chunk-CQFWTWC6.js} +13 -13
- package/dist/{chunk-PDVXWXTL.js → chunk-CROVXJ4S.js} +3 -3
- package/dist/{chunk-WJG344NC.js → chunk-CWSLTSL6.js} +8 -8
- package/dist/{chunk-VMTZ4RUW.js → chunk-DDMGQ5Q3.js} +60 -26
- package/dist/{chunk-YKC7QDZH.js → chunk-DN24VTS5.js} +31 -6
- package/dist/{chunk-IN6CAM4F.js → chunk-EHAN752X.js} +7 -7
- package/dist/{chunk-EXTZSNWL.js → chunk-EPHSISMT.js} +2 -2
- package/dist/{chunk-6EZQUNE6.js → chunk-FCMQVEVL.js} +36 -3
- package/dist/{chunk-3L2QU5ZF.js → chunk-FS7XF7SE.js} +1 -1
- package/dist/{chunk-LGS2V2XD.js → chunk-FUKVP54K.js} +66 -19
- package/dist/{chunk-44TLJZJ5.js → chunk-FX2QRSRT.js} +1 -1
- package/dist/{chunk-PWRC5XZO.js → chunk-FXZ6VGFW.js} +16 -8
- package/dist/{chunk-NT7W4RXD.js → chunk-GKDAQL45.js} +1 -1
- package/dist/{chunk-EKE37MO4.js → chunk-GOT5ZHPX.js} +3 -3
- package/dist/{chunk-SLLLOOEI.js → chunk-GPJIBLP4.js} +1 -0
- package/dist/{chunk-EKYYMIVT.js → chunk-GPUOUUHA.js} +10 -1
- package/dist/{chunk-PB5S7YOF.js → chunk-GXNBPTPJ.js} +1 -1
- package/dist/{chunk-4SJ4LK4V.js → chunk-HE34XVD5.js} +5 -5
- package/dist/{chunk-6VHOQ3IM.js → chunk-HHAKXIKX.js} +12 -9
- package/dist/{chunk-TFKCERAK.js → chunk-HHT527PV.js} +38 -41
- package/dist/{chunk-ZSODLMFV.js → chunk-HIVOLPLD.js} +1 -40
- package/dist/{chunk-UCFC2AEI.js → chunk-I3LDTSWU.js} +1 -1
- package/dist/{chunk-Q3AXXKDF.js → chunk-IKXH4BFC.js} +5 -5
- package/dist/chunk-IMYGYIAI.js +23 -0
- package/dist/{chunk-GS7LIT34.js → chunk-IPHLUZ37.js} +1 -1
- package/dist/{chunk-M4IRPXSZ.js → chunk-IZA7XW2Q.js} +3 -3
- package/dist/{chunk-SEQIPGLU.js → chunk-IZLML47J.js} +1 -1
- package/dist/{chunk-4HKTO2SV.js → chunk-JRMHGO5B.js} +1 -1
- package/dist/{chunk-U73AC5AN.js → chunk-JSTTPYL3.js} +16 -16
- package/dist/{chunk-6SCGLHJ7.js → chunk-JVWLHBAV.js} +4 -4
- package/dist/{chunk-OVEQE6YS.js → chunk-K7UNIEB4.js} +254 -48
- package/dist/{chunk-HNWS7YHN.js → chunk-KBR5LIWD.js} +1 -1
- package/dist/{chunk-AKLQSC6W.js → chunk-KI7O64XV.js} +328 -98
- package/dist/{chunk-XXFKSJYA.js → chunk-KK3MIY5C.js} +5 -5
- package/dist/{chunk-U6SUKSZR.js → chunk-KO3OHI6V.js} +3 -3
- package/dist/{chunk-NJFJWQNN.js → chunk-L5CGXEZC.js} +27 -22
- package/dist/{chunk-NBXDXKLC.js → chunk-LK3XQDBP.js} +1 -1
- package/dist/{chunk-T3QUKNLI.js → chunk-LM443ORV.js} +1 -1
- package/dist/{chunk-BBSIEYF5.js → chunk-LNAFLXL7.js} +12 -4
- package/dist/{chunk-32YV32VA.js → chunk-LTUA5EYI.js} +122 -11
- package/dist/{chunk-23MVDXLY.js → chunk-MAXD5JQL.js} +11 -10
- package/dist/{chunk-GNUAL43X.js → chunk-MFASHRJ6.js} +5 -5
- package/dist/chunk-MFYMDGE7.js +37 -0
- package/dist/{chunk-VKJGHAZT.js → chunk-MGVILAYU.js} +57 -13
- package/dist/{chunk-DB55JZHU.js → chunk-MSLWRWTI.js} +1 -1
- package/dist/{chunk-C2L622QJ.js → chunk-NB5IRTC4.js} +52 -44
- package/dist/{chunk-2ZOEC4KC.js → chunk-ND75TGPR.js} +2 -2
- package/dist/{chunk-VRTCVZND.js → chunk-NE34MWVL.js} +142 -16
- package/dist/{chunk-S2WBS6BG.js → chunk-NMOFLWDY.js} +1 -1
- package/dist/{chunk-CRCB5S7I.js → chunk-NPXKGBVZ.js} +140 -23
- package/dist/{chunk-JSMDRKPJ.js → chunk-NRBGUIPE.js} +1 -1
- package/dist/{chunk-4LWBC7CM.js → chunk-NY6SBR4O.js} +1 -1
- package/dist/{chunk-UCUOGVDX.js → chunk-O3K2C22L.js} +13 -1
- package/dist/{chunk-R522MWAR.js → chunk-OATET4BV.js} +2 -2
- package/dist/chunk-OOZU5H3T.js +86 -0
- package/dist/{chunk-XFTEX77S.js → chunk-OQ4FNDRG.js} +28 -6
- package/dist/{chunk-VYQ7B7DI.js → chunk-OWVX52XF.js} +4 -4
- package/dist/{chunk-AETLDRZB.js → chunk-PEAAX6UA.js} +1 -1
- package/dist/{chunk-UM3N6VND.js → chunk-PFAVHC5N.js} +5 -5
- package/dist/chunk-PMVVUIHH.js +85 -0
- package/dist/chunk-PPMGQFLJ.js +2317 -0
- package/dist/{chunk-7TSBV3SD.js → chunk-PTY2N23C.js} +310 -2
- package/dist/{chunk-UKLN57Q5.js → chunk-PZ5SKYK6.js} +4 -4
- package/dist/{chunk-636LKCKE.js → chunk-Q6ZLQMP2.js} +1 -1
- package/dist/{chunk-N7VEP5B3.js → chunk-QFR5EKZG.js} +29 -7
- package/dist/{chunk-YMP2QSOP.js → chunk-QN56VQ6Z.js} +1 -1
- package/dist/{chunk-6YVUR3OU.js → chunk-QR3BUMOS.js} +2 -2
- package/dist/{chunk-XZ65ST2I.js → chunk-QV5CQLQH.js} +2 -2
- package/dist/{chunk-DJOIMFKV.js → chunk-REZIGNA6.js} +2 -2
- package/dist/{chunk-UQGSBM3U.js → chunk-RFPMXR6B.js} +11 -0
- package/dist/{chunk-DN4YVV4Z.js → chunk-RSABKW6B.js} +1 -1
- package/dist/{chunk-LP4GB656.js → chunk-RZNP35SI.js} +2 -2
- package/dist/{chunk-NUTZJZKW.js → chunk-SKTAZGFI.js} +10 -42
- package/dist/{chunk-TQAZTRQ3.js → chunk-SVXUT2DN.js} +4 -4
- package/dist/{chunk-DJ7YXOTU.js → chunk-T7EF5CQO.js} +3 -3
- package/dist/{chunk-QAEWWYHL.js → chunk-TDF2XKLK.js} +5 -1
- package/dist/{chunk-ZGYNKA3O.js → chunk-TT5BBVLX.js} +29 -31
- package/dist/{chunk-5H47VHB7.js → chunk-UWX6MMCX.js} +1 -1
- package/dist/{chunk-XL5MFGMR.js → chunk-V4YNN7PA.js} +10 -3
- package/dist/{chunk-SL6KQYDU.js → chunk-V5DDXXMP.js} +7 -7
- package/dist/{chunk-DZKPOSFD.js → chunk-VH6SPPNA.js} +1 -1
- package/dist/{chunk-LDNYSMPZ.js → chunk-VJUUI2VT.js} +1 -1
- package/dist/{chunk-CBCGDEJA.js → chunk-VN5WOOAQ.js} +42 -6
- package/dist/{chunk-EXDW3E2R.js → chunk-VPHJ2LUI.js} +165 -15
- package/dist/{chunk-GOMQ7PVQ.js → chunk-WJC6AAJN.js} +1 -1
- package/dist/{chunk-GJI77VDO.js → chunk-WVBVUVZB.js} +6 -5
- package/dist/{chunk-A6PDF4BO.js → chunk-XTQ7R2PA.js} +2 -2
- package/dist/{chunk-L6RXG36J.js → chunk-Y2HD2YB7.js} +1 -1
- package/dist/{chunk-KTU3EAWK.js → chunk-YAACLBZ7.js} +5 -5
- package/dist/{chunk-7GE2EQ23.js → chunk-YGVAKKGJ.js} +11 -6
- package/dist/chunk-YLHACCCB.js +166 -0
- package/dist/{chunk-PLZSZOZN.js → chunk-YP6UGVEY.js} +3 -3
- package/dist/{chunk-ULIBLJ6W.js → chunk-YYC553FO.js} +5 -5
- package/dist/{chunk-T35RCQFE.js → chunk-YZPEQW7H.js} +9 -8
- package/dist/{chunk-KI5PFRG6.js → chunk-ZKGWHT56.js} +60 -2
- package/dist/{chunk-NUK7EEN5.js → chunk-ZKJ5S23O.js} +33 -13
- package/dist/chunk-ZLPS3GR7.js +146 -0
- package/dist/{chunk-XH7YL7JM.js → chunk-ZMX22HSS.js} +50 -6
- package/dist/{chunk-JY5GAZYC.js → chunk-ZQEJ4IX2.js} +4 -0
- package/dist/{chunk-R4CBHKZ2.js → chunk-ZS5JO6QV.js} +7 -6
- package/dist/{cleanup-graph-garbage-DPJGO52H.js → cleanup-graph-garbage-LAPIZGFX.js} +12 -12
- package/dist/{cloud-sync-command-JPNTT4OQ.js → cloud-sync-command-QAZ2NWRA.js} +11 -2
- package/dist/{cloud-sync-db-init-V2LWIUQU.js → cloud-sync-db-init-HAGVF32Y.js} +1 -1
- package/dist/{cloud-sync-shutdown-BNALPWGX.js → cloud-sync-shutdown-DAEPCFVK.js} +5 -5
- package/dist/{co-activation-CMNSWS6B.js → co-activation-523TKQPZ.js} +5 -5
- package/dist/{co-occurrence-WRI2NAN6.js → co-occurrence-PQUCTENN.js} +36 -17
- package/dist/{code-context-index-NOJSHLPN.js → code-context-index-LIDOFKOR.js} +6 -4
- package/dist/{code-context-watcher-VZNZU3BO.js → code-context-watcher-4F7K2N3U.js} +6 -4
- package/dist/{content-extractor-NXYNEF5K.js → content-extractor-DJM5EUDA.js} +2 -2
- package/dist/{conversation-entity-extractor-74252CAO.js → conversation-entity-extractor-THGKQ5RD.js} +5 -5
- package/dist/{crdt-sync-B3JN6AIV.js → crdt-sync-32B55NOJ.js} +1 -1
- package/dist/{crm-webhook-GYWQRFET.js → crm-webhook-FHRISFYQ.js} +2 -2
- package/dist/{cto-delegation-gate-LQHVLEMW.js → cto-delegation-gate-O6XPGECP.js} +27 -26
- package/dist/{daemon-auth-QZHEO7IQ.js → daemon-auth-PNKHERLV.js} +6 -1
- package/dist/daemon-drift-N2GKUBAO.js +15 -0
- package/dist/{daemon-orchestration-5HIQALZH.js → daemon-orchestration-BWLSJG2X.js} +33 -30
- package/dist/{daemon-ready-P2BR2XP5.js → daemon-ready-BN6EZLTQ.js} +1 -1
- package/dist/{daemon-ready-signal-CKXPUMJ2.js → daemon-ready-signal-PNDMVKPJ.js} +3 -1
- package/dist/{daemon-restart-circuit-breaker-SMTWFX27.js → daemon-restart-circuit-breaker-CD4VMCU7.js} +1 -1
- package/dist/daemon-restart-report-FIO5HZTJ.js +15 -0
- package/dist/{daemon-timer-report-TNJH5SFY.js → daemon-timer-report-6UK5PSDP.js} +2 -1
- package/dist/{db-integrity-events-2DTFO37N.js → db-integrity-events-GYGANKZV.js} +1 -1
- package/dist/{destructive-data-guard-BVFWPPIS.js → destructive-data-guard-HHWUBIGS.js} +1 -1
- package/dist/{doc-graph-extractor-PQHDHQPQ.js → doc-graph-extractor-HOKOV7BE.js} +10 -10
- package/dist/{documents-C4SSPJMC.js → documents-HWEJMONR.js} +16 -14
- package/dist/{dreaming-XAO3FCBV.js → dreaming-FMNDODG2.js} +31 -30
- package/dist/{employee-boot-brief-W4OHUMRQ.js → employee-boot-brief-DBFROOQJ.js} +35 -34
- package/dist/{entity-boost-3UWGXG5O.js → entity-boost-5V4W6NFA.js} +1 -1
- package/dist/{exe-drift-AG2KMKD5.js → exe-drift-V55UAYRT.js} +6 -6
- package/dist/{exe-export-IC5BT335.js → exe-export-LHN42ZUS.js} +18 -16
- package/dist/{exe-import-A35ZLDPG.js → exe-import-M536BEZC.js} +18 -16
- package/dist/{exe-key-TCMJNYLA.js → exe-key-37XIR22X.js} +111 -107
- package/dist/{exe-org-JXCR3JYZ.js → exe-org-7TDIRNTE.js} +14 -14
- package/dist/{exe-snapshot-SV6SRIG6.js → exe-snapshot-EOUBCIQK.js} +34 -33
- package/dist/{fast-db-init-L2RGKJWH.js → fast-db-init-GWUZ746B.js} +1 -1
- package/dist/{founder-context-D4HFIESJ.js → founder-context-6LQKET4A.js} +2 -2
- package/dist/{fts-integrity-4YB34KWX.js → fts-integrity-PLAL6NMG.js} +1 -1
- package/dist/gateway/index.js +17 -17
- package/dist/{git-main-guard-VTW4N3CM.js → git-main-guard-BGICS25C.js} +1 -1
- package/dist/{git-staleness-TN7CYGFG.js → git-staleness-QNNXJK3W.js} +5 -5
- package/dist/{global-procedures-YFDEIOG7.js → global-procedures-NMQGF54V.js} +7 -7
- package/dist/{gotrue-session-ODZ2ERJX.js → gotrue-session-U4H3UGHL.js} +1 -3
- package/dist/{graph-auto-extract-3YR3TYRW.js → graph-auto-extract-7POGAKHM.js} +10 -10
- package/dist/{graph-query-AP5R6ZHO.js → graph-query-ZEDO4BDF.js} +1 -1
- package/dist/{graph-rag-Z2KCJTPK.js → graph-rag-JA7XN7NO.js} +5 -5
- package/dist/hook-integrity-6NLSNTXD.js +15 -0
- package/dist/{hook-prefetch-K5DN3TOQ.js → hook-prefetch-4KH3D4YU.js} +28 -26
- package/dist/hook-tamper-log-Z4PWC7N4.js +90 -0
- package/dist/hooks/bug-report-worker.js +31 -30
- package/dist/hooks/codex-stop-task-finalizer.js +33 -32
- package/dist/hooks/commit-complete.js +30 -29
- package/dist/hooks/error-recall.js +12 -12
- package/dist/hooks/exe-heartbeat-hook.js +7 -7
- package/dist/hooks/ingest-worker.js +17 -15
- package/dist/hooks/ingest.js +20 -20
- package/dist/hooks/instructions-loaded.js +9 -9
- package/dist/hooks/manifest.json +20 -20
- package/dist/hooks/notification.js +8 -8
- package/dist/hooks/post-compact.js +7 -7
- package/dist/hooks/post-tool-combined.js +14 -14
- package/dist/hooks/pre-compact.js +30 -29
- package/dist/hooks/pre-tool-use.js +303 -489
- package/dist/hooks/prompt-submit.js +61 -54
- package/dist/hooks/session-end.js +35 -34
- package/dist/hooks/session-start.js +18 -18
- package/dist/hooks/stop.js +36 -35
- package/dist/hooks/subagent-stop.js +32 -31
- package/dist/hooks/summary-worker.js +36 -35
- package/dist/index.js +39 -38
- package/dist/{installer-LK35OX6R.js → installer-M34Q7LAS.js} +25 -10
- package/dist/{installer-54HTN5RE.js → installer-POV6TDQ5.js} +12 -8
- package/dist/{installer-LLWKZI2S.js → installer-S624ZOMB.js} +12 -8
- package/dist/{intercom-queue-5NOT2RKI.js → intercom-queue-MKDWAEUV.js} +26 -25
- package/dist/lib/cloud-sync.js +27 -19
- package/dist/lib/consolidation.js +12 -12
- package/dist/lib/database.js +5 -5
- package/dist/lib/db-backup.js +7 -1
- package/dist/lib/db-daemon-client.js +8 -6
- package/dist/lib/db-write-worker.js +4 -4
- package/dist/lib/db.js +5 -5
- package/dist/lib/device-registry.js +1 -1
- package/dist/lib/embedder.js +6 -4
- package/dist/lib/employee-templates.js +8 -8
- package/dist/lib/employees.js +5 -5
- package/dist/lib/exe-daemon-client.js +5 -3
- package/dist/lib/exe-daemon.js +333 -262
- package/dist/lib/hybrid-search.js +10 -10
- package/dist/lib/identity-templates.js +1 -1
- package/dist/lib/identity.js +17 -7
- package/dist/lib/license.js +2 -2
- package/dist/lib/messaging.js +27 -26
- package/dist/lib/post-tool-memory.js +9 -9
- package/dist/lib/registry-proxy.js +3 -1
- package/dist/lib/reminders.js +6 -6
- package/dist/lib/schedules.js +11 -11
- package/dist/lib/session-registry.js +11 -7
- package/dist/lib/session-wrappers.js +1 -1
- package/dist/lib/skill-learning.js +17 -15
- package/dist/lib/status-brief.js +2 -1
- package/dist/lib/store.js +9 -9
- package/dist/lib/task-router.js +6 -6
- package/dist/lib/tasks.js +28 -27
- package/dist/lib/tmux-routing.js +26 -25
- package/dist/lib/tmux-status.js +5 -1
- package/dist/lib/token-spend.js +6 -6
- package/dist/{license-gate-JVMB6OFD.js → license-gate-2QNMBAZU.js} +3 -3
- package/dist/{license-sync-5VYS2F2W.js → license-sync-FEDKH5MD.js} +2 -2
- package/dist/{mailbox-inbox-4MEUOL3J.js → mailbox-inbox-XE72D3AX.js} +2 -2
- package/dist/{mailbox-outbox-J6WIF3UY.js → mailbox-outbox-DNDDP2HW.js} +1 -1
- package/dist/mcp/register-tools.js +110 -106
- package/dist/mcp/server.js +113 -109
- package/dist/mcp/tools/complete-reminder.js +7 -7
- package/dist/mcp/tools/create-reminder.js +7 -7
- package/dist/mcp/tools/create-task.js +30 -29
- package/dist/mcp/tools/deactivate-behavior.js +18 -16
- package/dist/mcp/tools/list-reminders.js +7 -7
- package/dist/mcp/tools/list-tasks.js +30 -29
- package/dist/mcp/tools/send-message.js +33 -30
- package/dist/mcp/tools/update-task.js +29 -28
- package/dist/{mcp-child-registry-OTG4MWO7.js → mcp-child-registry-DVHYAHPW.js} +2 -2
- package/dist/{mcp-health-HNVSWKFA.js → mcp-health-B5EKRCZG.js} +2 -2
- package/dist/{mcp-http-config-DQWL7U2Z.js → mcp-http-config-ZJ7XHWT7.js} +10 -6
- package/dist/{mcp-session-identity-277GASTQ.js → mcp-session-identity-PEVM7VIP.js} +26 -25
- package/dist/{memory-cards-3S2ZQPR7.js → memory-cards-VN5DEWPD.js} +9 -9
- package/dist/{memory-graph-extractor-A6DFEFIN.js → memory-graph-extractor-TMEB6WLA.js} +11 -11
- package/dist/{memory-poisoning-defense-ZVP4H6DY.js → memory-poisoning-defense-DYHARQ2G.js} +5 -5
- package/dist/{memory-pressure-watchdog-6W5F6R7H.js → memory-pressure-watchdog-J6Q3SIBL.js} +27 -26
- package/dist/{memory-queue-client-ADSDP6OX.js → memory-queue-client-QC2OTMJB.js} +6 -4
- package/dist/{memory-reflection-BKB2YOE6.js → memory-reflection-ZYJUOSFX.js} +9 -9
- package/dist/{message-queue-client-XQN7QABL.js → message-queue-client-OEQCGSWC.js} +1 -25
- package/dist/{notification-ledger-CLGM7ODF.js → notification-ledger-TG6EFYBP.js} +29 -28
- package/dist/{notifications-MACUZPYP.js → notifications-LGYY22W5.js} +26 -25
- package/dist/{orchestration-events-N7LYMUGA.js → orchestration-events-JPHB6NPY.js} +6 -6
- package/dist/{orchestrator-4X24EWHV.js → orchestrator-IC4WGP6L.js} +28 -27
- package/dist/{org-brief-session-FZOFMO5U.js → org-brief-session-DEPHWCQR.js} +9 -9
- package/dist/{org-consent-policy-O5E6HXBL.js → org-consent-policy-T27AO5OJ.js} +2 -2
- package/dist/{org-join-POWUG25F.js → org-join-A3YXC5RB.js} +2 -2
- package/dist/{org-key-admin-E7EMDOZZ.js → org-key-admin-SQFHCVP2.js} +3 -3
- package/dist/{org-partner-runtime-FODONVTM.js → org-partner-runtime-L7L2WWGN.js} +10 -10
- package/dist/{org-row-visibility-VX4AVV5Q.js → org-row-visibility-M54Z6ZH3.js} +1 -1
- package/dist/{pipeline-router-6GGT2ZW3.js → pipeline-router-NKYAUR3Y.js} +6 -6
- package/dist/{plan-limits-FUN76LYY.js → plan-limits-ISRRGF23.js} +8 -8
- package/dist/{platform-procedures-7YSCLF4Z.js → platform-procedures-Z7ZGBJWN.js} +1 -1
- package/dist/{project-boot-3Q65LCIP.js → project-boot-BLYGVUJH.js} +4 -1
- package/dist/{project-name-LJVFMYTQ.js → project-name-WKSNNKXK.js} +6 -6
- package/dist/{projection-worker-4OANGP5K.js → projection-worker-RNYPE46G.js} +2 -2
- package/dist/{prospective-memory-KR3P4T6N.js → prospective-memory-GEO6E3UL.js} +5 -5
- package/dist/{push-notifications-NCZLH6DI.js → push-notifications-EY6BXZUY.js} +27 -26
- package/dist/{reproject-worktree-memories-PWYKPB2U.js → reproject-worktree-memories-DAA5GWMH.js} +28 -27
- package/dist/{reranker-6V3C2AO4.js → reranker-7OADQPMG.js} +1 -1
- package/dist/{retrieval-health-5D7O6VH6.js → retrieval-health-FCEDWN2P.js} +2 -2
- package/dist/{review-polling-QW3LJ4KN.js → review-polling-G52BR4MC.js} +27 -26
- package/dist/runtime/index.js +39 -38
- package/dist/{session-events-T45SSTMF.js → session-events-P6E2373E.js} +27 -26
- package/dist/{session-kill-telemetry-QSPVJGBF.js → session-kill-telemetry-OHNJMIVT.js} +27 -26
- package/dist/{session-mcp-config-SC5BLWZG.js → session-mcp-config-WFZAH6R5.js} +2 -1
- package/dist/{session-scope-KRWE54C4.js → session-scope-DKOHPQPJ.js} +26 -25
- package/dist/{setup-wizard-GP3TBTPF.js → setup-wizard-RNU3RFBE.js} +1 -1
- package/dist/{skill-refinement-C7JTMLJG.js → skill-refinement-AKJTHFXC.js} +6 -6
- package/dist/{stack-generate-manifest-MFMDWRUP.js → stack-generate-manifest-7WJZWSPK.js} +163 -15
- package/dist/{stack-promote-EKSCYY63.js → stack-promote-OP2URGFF.js} +4 -4
- package/dist/{stack-release-2GZAAFO4.js → stack-release-MY6U2QIO.js} +31 -8
- package/dist/{stack-update-J6JXSTAZ.js → stack-update-QSHSLUTZ.js} +3 -3
- package/dist/{steward-gate-BFCCMCSW.js → steward-gate-KMLS5ECC.js} +6 -6
- package/dist/{subagent-brief-injection-ED36PLYY.js → subagent-brief-injection-HCKZQZBF.js} +37 -36
- package/dist/{support-inbox-YW47SYJF.js → support-inbox-UBXU5RKV.js} +11 -11
- package/dist/{support-outbox-HFJWG52M.js → support-outbox-G2NG2U5K.js} +2 -2
- package/dist/{sweep-budget-KMPJ7O5Z.js → sweep-budget-YGLCNXZZ.js} +9 -3
- package/dist/{task-enforcement-CECTQX4U.js → task-enforcement-2GR7HU6V.js} +27 -26
- package/dist/{task-request-inbox-Q5T4N5K7.js → task-request-inbox-ANCVK2VG.js} +2 -2
- package/dist/{task-scope-ERVEUEYU.js → task-scope-QANJJXXB.js} +30 -29
- package/dist/{tasks-crud-ZRQNJXQ2.js → tasks-crud-45WOIMIM.js} +44 -25
- package/dist/{tasks-notify-MIZH4C2O.js → tasks-notify-ZJS4MA3S.js} +29 -26
- package/dist/{tasks-review-Z7J2P6DG.js → tasks-review-ZVPKY47Z.js} +26 -25
- package/dist/{telemetry-upload-LVQUQYFP.js → telemetry-upload-VY3UWAEL.js} +10 -10
- package/dist/{token-budget-BU4NOVZF.js → token-budget-XHX6XFEC.js} +6 -6
- package/dist/{tool-capability-index-7F42MOJT.js → tool-capability-index-6HLZU437.js} +1 -1
- package/dist/{tool-telemetry-O27EVMBR.js → tool-telemetry-GBDI4AXR.js} +1 -1
- package/dist/tui/App.js +36 -35
- package/dist/{tui-data-TPWWBIUQ.js → tui-data-IQFE3UW3.js} +30 -29
- package/dist/{typed-messages-RCMPEKJN.js → typed-messages-P2HLLA62.js} +1 -1
- package/dist/{update-support-F2F5537B.js → update-support-BDN5AK4R.js} +25 -22
- package/dist/{work-claims-B73X5NE7.js → work-claims-PDQNLE5K.js} +7 -7
- package/dist/{work-state-heartbeat-P4YX6E2R.js → work-state-heartbeat-CH6BLQKV.js} +1 -1
- package/dist/{worker-gate-BEEIIVWA.js → worker-gate-NUUSQMBT.js} +1 -3
- package/dist/{workflow-engine-5X46PFCW.js → workflow-engine-RZ7QEI3Z.js} +2 -2
- package/dist/{worktree-W47CIMJ6.js → worktree-Q25PZST6.js} +11 -7
- package/dist/worktree-ownership-guard-4LKMW6PW.js +421 -0
- package/dist/{worktree-sweep-BNBD4RFX.js → worktree-sweep-EV5YQ2OB.js} +8 -8
- package/package.json +15 -3
- package/release-notes.json +13 -6
- package/src/commands/exe.md +16 -16
- package/stack.release.json +9 -8
- package/dist/behavior-injection-M6UYZCMW.js +0 -63
- package/dist/chunk-BJ7AVSY6.js +0 -50
- package/dist/daemon-restart-report-EIVD6WDJ.js +0 -10
- package/dist/worktree-ownership-guard-OUWJROW2.js +0 -88
- /package/dist/{chunk-GQOEWNVM.js → chunk-4EG4DT4F.js} +0 -0
- /package/dist/{chunk-AISULNGL.js → chunk-BRAIWGMF.js} +0 -0
- /package/dist/{chunk-NRG7KZIP.js → chunk-HQEAZDAC.js} +0 -0
- /package/dist/{chunk-VZAFWPAY.js → chunk-IK4344V5.js} +0 -0
- /package/dist/{chunk-GM7TLYOK.js → chunk-K3VDF6II.js} +0 -0
- /package/dist/{chunk-2AJGV5UL.js → chunk-KM7DAG5J.js} +0 -0
- /package/dist/{chunk-YO4BO2CL.js → chunk-QIEYJ4KZ.js} +0 -0
- /package/dist/{chunk-WSQASFLP.js → chunk-VCTK5HRA.js} +0 -0
- /package/dist/{chunk-KQ6RJWRW.js → chunk-VPT6VMBG.js} +0 -0
- /package/dist/{chunk-6WIFPD2P.js → chunk-YZ4AEMR7.js} +0 -0
- /package/dist/{core-memory-7I7RE2SJ.js → core-memory-UIZKCY4L.js} +0 -0
- /package/dist/{memory-isolation-2TUZ7Z4K.js → memory-isolation-3GJ6WLYX.js} +0 -0
- /package/dist/{oauth-server-AYM37SQ4.js → oauth-server-ZRHXIRXQ.js} +0 -0
- /package/dist/{wiki-acl-IBQLLBTS.js → wiki-acl-MFOYK5F4.js} +0 -0
package/dist/lib/exe-daemon.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
restartBootsInWindow,
|
|
6
6
|
restartBreakerAlertPath,
|
|
7
7
|
writeDaemonExitBreadcrumb
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-7INEFMVU.js";
|
|
9
9
|
import {
|
|
10
10
|
pushNotifyAsync
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-NRBGUIPE.js";
|
|
12
12
|
import {
|
|
13
13
|
isDbVerifyStampFresh
|
|
14
14
|
} from "../chunk-SVFNWBLF.js";
|
|
@@ -23,12 +23,23 @@ import {
|
|
|
23
23
|
} from "../chunk-R3CZWFFC.js";
|
|
24
24
|
import {
|
|
25
25
|
shouldScheduleDaemonRestartHandoff
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-FXZ6VGFW.js";
|
|
27
|
+
import {
|
|
28
|
+
computeBootRetryAfterSeconds,
|
|
29
|
+
decideBootBackoff,
|
|
30
|
+
decideDaemonSelfHeal,
|
|
31
|
+
decideOrchestrationTickSkip,
|
|
32
|
+
isHostCpuStarved,
|
|
33
|
+
updateLoadWindow
|
|
34
|
+
} from "../chunk-ZLPS3GR7.js";
|
|
27
35
|
import {
|
|
28
36
|
getMcpToolFamily,
|
|
29
37
|
inferMcpRuntime,
|
|
30
38
|
recordMcpHttpEvent
|
|
31
39
|
} from "../chunk-FNEZ4BWT.js";
|
|
40
|
+
import {
|
|
41
|
+
outsideParkPortionMs
|
|
42
|
+
} from "../chunk-3OX5S7KZ.js";
|
|
32
43
|
import {
|
|
33
44
|
hasPendingCloudSyncSlice,
|
|
34
45
|
readCloudSyncState,
|
|
@@ -45,39 +56,41 @@ import {
|
|
|
45
56
|
findScopedDuplicate,
|
|
46
57
|
governMemoryRecord,
|
|
47
58
|
schedulePostWriteMemoryHygiene
|
|
48
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-RSABKW6B.js";
|
|
49
60
|
import "../chunk-5MOYSU5A.js";
|
|
50
|
-
import "../chunk-
|
|
61
|
+
import "../chunk-5QCIWWFA.js";
|
|
51
62
|
import "../chunk-76CJBM36.js";
|
|
52
63
|
import {
|
|
53
64
|
BUSY_PATTERN
|
|
54
|
-
} from "../chunk-
|
|
55
|
-
import "../chunk-
|
|
56
|
-
import "../chunk-
|
|
57
|
-
import "../chunk-
|
|
65
|
+
} from "../chunk-KI7O64XV.js";
|
|
66
|
+
import "../chunk-4YUGB637.js";
|
|
67
|
+
import "../chunk-64ODONK2.js";
|
|
68
|
+
import "../chunk-C2UN464N.js";
|
|
58
69
|
import {
|
|
70
|
+
currentPauseStartMs,
|
|
71
|
+
isTimerPausedNow,
|
|
59
72
|
recordTimerPauseMs,
|
|
60
73
|
runWithTimerPauseAccounting,
|
|
61
|
-
sweepPauseTotalMs
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
sweepPauseTotalMs,
|
|
75
|
+
timerPauseIntervalsSince
|
|
76
|
+
} from "../chunk-ZKGWHT56.js";
|
|
64
77
|
import "../chunk-WT4RI36X.js";
|
|
65
|
-
import "../chunk-
|
|
66
|
-
import "../chunk-QAEWWYHL.js";
|
|
78
|
+
import "../chunk-TDF2XKLK.js";
|
|
67
79
|
import "../chunk-EIKATSE4.js";
|
|
68
80
|
import "../chunk-MJCSEIFI.js";
|
|
69
|
-
import "../chunk-
|
|
70
|
-
import "../chunk-
|
|
81
|
+
import "../chunk-E23LNUWJ.js";
|
|
82
|
+
import "../chunk-ZMX22HSS.js";
|
|
71
83
|
import "../chunk-VI4ATC6I.js";
|
|
72
84
|
import "../chunk-A27Q27CT.js";
|
|
73
|
-
import "../chunk-
|
|
85
|
+
import "../chunk-BZ546I4Q.js";
|
|
86
|
+
import "../chunk-3SRZNJKD.js";
|
|
74
87
|
import "../chunk-AJIXH5JF.js";
|
|
75
|
-
import "../chunk-
|
|
88
|
+
import "../chunk-YGVAKKGJ.js";
|
|
76
89
|
import "../chunk-GZOG2MAX.js";
|
|
77
90
|
import "../chunk-AM7S2TY6.js";
|
|
78
|
-
import "../chunk-
|
|
91
|
+
import "../chunk-QR3BUMOS.js";
|
|
79
92
|
import "../chunk-CVYC6DUW.js";
|
|
80
|
-
import "../chunk-
|
|
93
|
+
import "../chunk-WJC6AAJN.js";
|
|
81
94
|
import "../chunk-4IK2K3B3.js";
|
|
82
95
|
import {
|
|
83
96
|
attributeSignalSource,
|
|
@@ -85,8 +98,7 @@ import {
|
|
|
85
98
|
isRestartCooldownActive,
|
|
86
99
|
logRestartEvent,
|
|
87
100
|
noteRestartAttempt
|
|
88
|
-
} from "../chunk-
|
|
89
|
-
import "../chunk-ZG62LIK3.js";
|
|
101
|
+
} from "../chunk-ZKJ5S23O.js";
|
|
90
102
|
import {
|
|
91
103
|
AGENT_IDENTITY_TOKEN_HEADER,
|
|
92
104
|
assessInitialBindIdentity,
|
|
@@ -96,7 +108,12 @@ import {
|
|
|
96
108
|
reconcileSessionAgentIdentity,
|
|
97
109
|
shouldEnforceAgentIdentity,
|
|
98
110
|
shouldEnforceSessionIdentity
|
|
99
|
-
} from "../chunk-
|
|
111
|
+
} from "../chunk-GPUOUUHA.js";
|
|
112
|
+
import "../chunk-BTSWFMEH.js";
|
|
113
|
+
import "../chunk-ZG62LIK3.js";
|
|
114
|
+
import {
|
|
115
|
+
sanitizeDaemonKeyCustodyEnv
|
|
116
|
+
} from "../chunk-IMYGYIAI.js";
|
|
100
117
|
import {
|
|
101
118
|
DAEMON_RSS_RESTART_DEBOUNCE,
|
|
102
119
|
DAEMON_RSS_STARTUP_GRACE_MS,
|
|
@@ -115,17 +132,18 @@ import {
|
|
|
115
132
|
} from "../chunk-NLEW62VC.js";
|
|
116
133
|
import {
|
|
117
134
|
killIfSameProcess,
|
|
135
|
+
ownProcessStartedAt,
|
|
118
136
|
processStartedAt
|
|
119
|
-
} from "../chunk-
|
|
137
|
+
} from "../chunk-GPJIBLP4.js";
|
|
120
138
|
import {
|
|
121
139
|
killAttributionLogPath,
|
|
122
140
|
recordKillIntent
|
|
123
141
|
} from "../chunk-V3WLC5TJ.js";
|
|
124
|
-
import "../chunk-
|
|
142
|
+
import "../chunk-AEUGIJDO.js";
|
|
125
143
|
import "../chunk-HYZV25LY.js";
|
|
126
144
|
import "../chunk-GJV3WDWM.js";
|
|
127
145
|
import "../chunk-MP2AFCGL.js";
|
|
128
|
-
import "../chunk-
|
|
146
|
+
import "../chunk-66CGXQUA.js";
|
|
129
147
|
import {
|
|
130
148
|
logBoot,
|
|
131
149
|
logCrash,
|
|
@@ -135,30 +153,31 @@ import {
|
|
|
135
153
|
} from "../chunk-BBMTVAE3.js";
|
|
136
154
|
import "../chunk-TKDITWDN.js";
|
|
137
155
|
import "../chunk-5YEUPUV4.js";
|
|
138
|
-
import "../chunk-
|
|
156
|
+
import "../chunk-AHNVFBVB.js";
|
|
139
157
|
import {
|
|
140
158
|
isPostgresBackendEnabled
|
|
141
159
|
} from "../chunk-YYB5PMTK.js";
|
|
142
|
-
import "../chunk-
|
|
160
|
+
import "../chunk-L5CGXEZC.js";
|
|
143
161
|
import {
|
|
144
162
|
getEventLoopLagMs,
|
|
145
163
|
isEventLoopDegraded,
|
|
146
164
|
markAsDaemonProcess,
|
|
147
165
|
setEventLoopLagMs
|
|
148
|
-
} from "../chunk-
|
|
166
|
+
} from "../chunk-CL4J4757.js";
|
|
149
167
|
import {
|
|
150
168
|
clearDaemonReady,
|
|
151
169
|
eventLoopBlockedMarkerPath,
|
|
152
170
|
eventLoopHeartbeatPath,
|
|
171
|
+
starvationSuppressedMarkerPath,
|
|
153
172
|
writeDaemonReady
|
|
154
|
-
} from "../chunk-
|
|
173
|
+
} from "../chunk-ZQEJ4IX2.js";
|
|
155
174
|
import {
|
|
156
175
|
EMBEDDING_DIM
|
|
157
176
|
} from "../chunk-FXU7JOXK.js";
|
|
158
177
|
import "../chunk-WNBZJSQT.js";
|
|
159
|
-
import "../chunk-
|
|
178
|
+
import "../chunk-Y2HD2YB7.js";
|
|
160
179
|
import "../chunk-A7XLR3K7.js";
|
|
161
|
-
import "../chunk-
|
|
180
|
+
import "../chunk-4EG4DT4F.js";
|
|
162
181
|
import "../chunk-A7JYF4RG.js";
|
|
163
182
|
import "../chunk-ARX6TAGN.js";
|
|
164
183
|
import {
|
|
@@ -638,16 +657,17 @@ function startTimerTimeoutWatchdog(options) {
|
|
|
638
657
|
let lagProbeHandle = null;
|
|
639
658
|
let nextLagProbeDueMs = now() + lagProbeIntervalMs;
|
|
640
659
|
let maxLagMs = 0;
|
|
641
|
-
const recordLag = (lagMs) => {
|
|
660
|
+
const recordLag = (lagMs, windowStartMs, windowEndMs) => {
|
|
642
661
|
const v = validNonNegativeMs(lagMs);
|
|
643
662
|
maxLagMs = Math.max(maxLagMs, v);
|
|
644
|
-
if (v > 0) options.onLagSample?.(v);
|
|
663
|
+
if (v > 0) options.onLagSample?.(v, windowStartMs, windowEndMs);
|
|
645
664
|
};
|
|
646
665
|
const currentMaxLagMs = () => {
|
|
666
|
+
const nowMs = now();
|
|
647
667
|
if (options.eventLoopLagSource) {
|
|
648
|
-
recordLag(options.eventLoopLagSource());
|
|
668
|
+
recordLag(options.eventLoopLagSource(), nowMs, nowMs);
|
|
649
669
|
} else {
|
|
650
|
-
recordLag(
|
|
670
|
+
recordLag(nowMs - nextLagProbeDueMs, nextLagProbeDueMs, nowMs);
|
|
651
671
|
}
|
|
652
672
|
return maxLagMs;
|
|
653
673
|
};
|
|
@@ -656,7 +676,8 @@ function startTimerTimeoutWatchdog(options) {
|
|
|
656
676
|
nextLagProbeDueMs = now() + lagProbeIntervalMs;
|
|
657
677
|
lagProbeHandle = setLagProbeTimer(() => {
|
|
658
678
|
lagProbeHandle = null;
|
|
659
|
-
|
|
679
|
+
const nowMs = now();
|
|
680
|
+
recordLag(nowMs - nextLagProbeDueMs, nextLagProbeDueMs, nowMs);
|
|
660
681
|
armLagProbe();
|
|
661
682
|
}, lagProbeIntervalMs);
|
|
662
683
|
lagProbeHandle.unref?.();
|
|
@@ -696,6 +717,53 @@ function startTimerTimeoutWatchdog(options) {
|
|
|
696
717
|
};
|
|
697
718
|
}
|
|
698
719
|
|
|
720
|
+
// src/lib/daemon-maintenance-admission.ts
|
|
721
|
+
var DAEMON_MAINTENANCE_TIMER_NAMES = [
|
|
722
|
+
"wal_checkpoint",
|
|
723
|
+
"orchestration_tick",
|
|
724
|
+
"memory_queue_drain_batch"
|
|
725
|
+
];
|
|
726
|
+
var DAEMON_MAINTENANCE_TIMERS = new Set(DAEMON_MAINTENANCE_TIMER_NAMES);
|
|
727
|
+
function createDaemonMaintenanceAdmission() {
|
|
728
|
+
let active = null;
|
|
729
|
+
const waiters = [];
|
|
730
|
+
const noOpPermit = () => ({ admitted: true, release: () => void 0 });
|
|
731
|
+
const grant = (timer) => {
|
|
732
|
+
active = timer;
|
|
733
|
+
let released = false;
|
|
734
|
+
return {
|
|
735
|
+
admitted: true,
|
|
736
|
+
release: () => {
|
|
737
|
+
if (released) return;
|
|
738
|
+
released = true;
|
|
739
|
+
if (active !== timer) return;
|
|
740
|
+
const next = waiters.shift();
|
|
741
|
+
if (!next) {
|
|
742
|
+
active = null;
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
next.resolve(grant(next.timer));
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
const tryAcquire = (timer) => {
|
|
750
|
+
if (!DAEMON_MAINTENANCE_TIMERS.has(timer)) return noOpPermit();
|
|
751
|
+
if (active !== null) return { admitted: false, blockedBy: active };
|
|
752
|
+
return grant(timer);
|
|
753
|
+
};
|
|
754
|
+
return {
|
|
755
|
+
tryAcquire,
|
|
756
|
+
async acquire(timer) {
|
|
757
|
+
const immediate = tryAcquire(timer);
|
|
758
|
+
if (immediate.admitted) return immediate;
|
|
759
|
+
return new Promise((resolve) => {
|
|
760
|
+
waiters.push({ timer, resolve });
|
|
761
|
+
});
|
|
762
|
+
},
|
|
763
|
+
activeTimer: () => active
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
|
|
699
767
|
// src/lib/cloud-sync-daemon-runner.ts
|
|
700
768
|
function launchCloudSyncDaemonAttempt(options) {
|
|
701
769
|
if (options.isBusy()) {
|
|
@@ -1199,127 +1267,6 @@ function measureSpan(prev) {
|
|
|
1199
1267
|
return { monoMs, wallMs, sleptMs };
|
|
1200
1268
|
}
|
|
1201
1269
|
|
|
1202
|
-
// src/lib/daemon-starvation.ts
|
|
1203
|
-
function isHostCpuStarved(load1m, cpuCount, ratio) {
|
|
1204
|
-
if (!Number.isFinite(ratio) || ratio <= 0) return false;
|
|
1205
|
-
if (!Number.isFinite(load1m) || load1m <= 0) return false;
|
|
1206
|
-
const cores = Number.isFinite(cpuCount) && cpuCount > 0 ? cpuCount : 1;
|
|
1207
|
-
return load1m > cores * ratio;
|
|
1208
|
-
}
|
|
1209
|
-
function pruneLoadSamples(samples, keepSinceMs) {
|
|
1210
|
-
return samples.filter((sample) => Number.isFinite(sample.ts) && sample.ts >= keepSinceMs);
|
|
1211
|
-
}
|
|
1212
|
-
function maxLoadOverWindow(samples, windowStartMs, currentLoad1m) {
|
|
1213
|
-
const candidates = [currentLoad1m];
|
|
1214
|
-
for (const sample of samples) {
|
|
1215
|
-
if (sample.ts >= windowStartMs && Number.isFinite(sample.load1m)) {
|
|
1216
|
-
candidates.push(sample.load1m);
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
const finite = candidates.filter((load) => Number.isFinite(load));
|
|
1220
|
-
return finite.length > 0 ? Math.max(...finite) : currentLoad1m;
|
|
1221
|
-
}
|
|
1222
|
-
function updateLoadWindow(samples, nowMs, load1m, wallElapsedMs, keepMs) {
|
|
1223
|
-
const blockStartMs = nowMs - wallElapsedMs - 2500;
|
|
1224
|
-
const next = pruneLoadSamples(
|
|
1225
|
-
[...samples, { ts: nowMs, load1m }],
|
|
1226
|
-
Math.min(nowMs - keepMs, blockStartMs)
|
|
1227
|
-
);
|
|
1228
|
-
return {
|
|
1229
|
-
samples: next,
|
|
1230
|
-
maxLoad1mOverWindow: maxLoadOverWindow(next, blockStartMs, load1m),
|
|
1231
|
-
blockStartMs
|
|
1232
|
-
};
|
|
1233
|
-
}
|
|
1234
|
-
function decideDaemonSelfHeal(s) {
|
|
1235
|
-
const alive = s.processAlive ?? true;
|
|
1236
|
-
if (!alive) {
|
|
1237
|
-
return { restart: true, reason: "process_dead", consecutiveSevereAfter: 0, selfInflictedWindowAfter: [], selfInflictedStreakAfter: 0, selfInflictedSuppressedMsAfter: 0 };
|
|
1238
|
-
}
|
|
1239
|
-
if (typeof s.rssBytes === "number" && Number.isFinite(s.rssBytes) && typeof s.rssCapBytes === "number" && Number.isFinite(s.rssCapBytes) && s.rssCapBytes > 0 && s.rssBytes > s.rssCapBytes) {
|
|
1240
|
-
return { restart: true, reason: "rss_over_cap", consecutiveSevereAfter: 0, selfInflictedWindowAfter: [], selfInflictedStreakAfter: 0, selfInflictedSuppressedMsAfter: 0 };
|
|
1241
|
-
}
|
|
1242
|
-
const now = typeof s.nowMs === "number" && Number.isFinite(s.nowMs) ? s.nowMs : 0;
|
|
1243
|
-
const windowMs = typeof s.selfInflictedRollingWindowMs === "number" && s.selfInflictedRollingWindowMs > 0 ? s.selfInflictedRollingWindowMs : 3e5;
|
|
1244
|
-
const prunedWindow = (s.selfInflictedWindow ?? []).filter((e) => now - e.ts < windowMs);
|
|
1245
|
-
const sumOf = (w) => w.reduce((a, e) => a + e.lagMs, 0);
|
|
1246
|
-
const carry = {
|
|
1247
|
-
selfInflictedWindowAfter: prunedWindow,
|
|
1248
|
-
selfInflictedStreakAfter: prunedWindow.length,
|
|
1249
|
-
selfInflictedSuppressedMsAfter: sumOf(prunedWindow)
|
|
1250
|
-
};
|
|
1251
|
-
const cleared = { selfInflictedWindowAfter: [], selfInflictedStreakAfter: 0, selfInflictedSuppressedMsAfter: 0 };
|
|
1252
|
-
const loadCandidates = [s.load1m, s.maxLoad1mOverWindow].filter(
|
|
1253
|
-
(load) => typeof load === "number" && Number.isFinite(load) && load > 0
|
|
1254
|
-
);
|
|
1255
|
-
const effectiveLoad1m = loadCandidates.length > 0 ? Math.max(...loadCandidates) : s.load1m;
|
|
1256
|
-
if (isHostCpuStarved(effectiveLoad1m, s.cpuCount, s.starvationRatio)) {
|
|
1257
|
-
return { restart: false, reason: "starved_backoff", consecutiveSevereAfter: 0, ...carry };
|
|
1258
|
-
}
|
|
1259
|
-
if (s.catchUpActive) {
|
|
1260
|
-
return { restart: false, reason: "catchup_backoff", consecutiveSevereAfter: 0, ...carry };
|
|
1261
|
-
}
|
|
1262
|
-
const selfCpuRatio = Number.isFinite(s.selfCpuBusyRatio) ? s.selfCpuBusyRatio : 0.5;
|
|
1263
|
-
if (s.lagMs > s.severeThresholdMs && typeof s.selfCpuBusyFraction === "number" && Number.isFinite(s.selfCpuBusyFraction) && s.selfCpuBusyFraction >= selfCpuRatio) {
|
|
1264
|
-
const countLimit = typeof s.selfInflictedLimit === "number" && s.selfInflictedLimit > 0 ? s.selfInflictedLimit : 5;
|
|
1265
|
-
const suppressCapMs = typeof s.selfInflictedSuppressCapMs === "number" && s.selfInflictedSuppressCapMs > 0 ? s.selfInflictedSuppressCapMs : 15e4;
|
|
1266
|
-
const windowAfter = [...prunedWindow, { ts: now, lagMs: s.lagMs }];
|
|
1267
|
-
const sumInWindow = sumOf(windowAfter);
|
|
1268
|
-
if (sumInWindow > suppressCapMs || windowAfter.length >= countLimit) {
|
|
1269
|
-
return { restart: true, reason: "single_block", consecutiveSevereAfter: 0, ...cleared };
|
|
1270
|
-
}
|
|
1271
|
-
return {
|
|
1272
|
-
restart: false,
|
|
1273
|
-
reason: "self_inflicted_backoff",
|
|
1274
|
-
consecutiveSevereAfter: 0,
|
|
1275
|
-
selfInflictedWindowAfter: windowAfter,
|
|
1276
|
-
selfInflictedStreakAfter: windowAfter.length,
|
|
1277
|
-
selfInflictedSuppressedMsAfter: sumInWindow
|
|
1278
|
-
};
|
|
1279
|
-
}
|
|
1280
|
-
if (s.lagMs > s.singleBlockMs) {
|
|
1281
|
-
return { restart: true, reason: "single_block", consecutiveSevereAfter: 0, ...cleared };
|
|
1282
|
-
}
|
|
1283
|
-
if (s.lagMs > s.severeThresholdMs) {
|
|
1284
|
-
const next = s.consecutiveSevere + 1;
|
|
1285
|
-
if (next >= s.consecutiveLimit) {
|
|
1286
|
-
return { restart: true, reason: "consecutive_blocks", consecutiveSevereAfter: next, ...cleared };
|
|
1287
|
-
}
|
|
1288
|
-
return { restart: false, reason: "counting", consecutiveSevereAfter: next, ...carry };
|
|
1289
|
-
}
|
|
1290
|
-
return { restart: false, reason: "not_critical", consecutiveSevereAfter: 0, ...carry };
|
|
1291
|
-
}
|
|
1292
|
-
function decideOrchestrationTickSkip(s) {
|
|
1293
|
-
if (isHostCpuStarved(s.load1m, s.cpuCount, s.starvationRatio)) {
|
|
1294
|
-
return { skip: true, reason: "starved_skip" };
|
|
1295
|
-
}
|
|
1296
|
-
return { skip: false, reason: "run" };
|
|
1297
|
-
}
|
|
1298
|
-
function decideBootBackoff(s) {
|
|
1299
|
-
if (!isHostCpuStarved(s.load1m, s.cpuCount, s.starvationRatio)) {
|
|
1300
|
-
return { wait: false, delayMs: 0, reason: "not_starved" };
|
|
1301
|
-
}
|
|
1302
|
-
const clientsWaiting = s.clientsWaiting === true;
|
|
1303
|
-
const baseDelayMs = clientsWaiting ? s.baseDelayMs / 2 : s.baseDelayMs;
|
|
1304
|
-
const maxDelayMs = clientsWaiting ? s.maxDelayMs / 2 : s.maxDelayMs;
|
|
1305
|
-
const maxAttempts = clientsWaiting ? Math.min(s.maxAttempts, 2) : s.maxAttempts;
|
|
1306
|
-
if (s.attempt >= maxAttempts) {
|
|
1307
|
-
return { wait: false, delayMs: 0, reason: "max_attempts_proceed" };
|
|
1308
|
-
}
|
|
1309
|
-
const base = Number.isFinite(baseDelayMs) && baseDelayMs > 0 ? baseDelayMs : 0;
|
|
1310
|
-
const cap = Number.isFinite(maxDelayMs) && maxDelayMs > 0 ? maxDelayMs : base;
|
|
1311
|
-
const exp = base * Math.pow(2, Math.max(0, s.attempt));
|
|
1312
|
-
const delayMs = Math.min(cap, exp);
|
|
1313
|
-
return { wait: true, delayMs, reason: "backoff" };
|
|
1314
|
-
}
|
|
1315
|
-
function computeBootRetryAfterSeconds(nowMs, readyEtaMs, opts = {}) {
|
|
1316
|
-
const defaultS = opts.defaultS ?? 3;
|
|
1317
|
-
if (readyEtaMs === null) return defaultS;
|
|
1318
|
-
const minS = opts.minS ?? 1;
|
|
1319
|
-
const maxS = opts.maxS ?? 60;
|
|
1320
|
-
return Math.min(maxS, Math.max(minS, Math.ceil((readyEtaMs - nowMs) / 1e3)));
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
1270
|
// src/lib/daemon-health-selfexit.ts
|
|
1324
1271
|
var DEFAULT_BOOT_GRACE_MS = 12e4;
|
|
1325
1272
|
var DEFAULT_SPIN_THRESHOLD = 2;
|
|
@@ -1386,6 +1333,15 @@ function decideSweepSkip(signal) {
|
|
|
1386
1333
|
import { existsSync as existsSync5, mkdirSync as mkdirSync4, readFileSync as readFileSync4, unlinkSync as unlinkSync3, writeFileSync as writeFileSync4 } from "fs";
|
|
1387
1334
|
import { homedir as homedir2 } from "os";
|
|
1388
1335
|
import { dirname as dirname2, join as join2 } from "path";
|
|
1336
|
+
var KEY_CUSTODY_RECOVERY = "Run 'exe-os key status'. Restore or unlock the existing key, then restart the daemon; do not generate a replacement key for an existing encrypted database.";
|
|
1337
|
+
var DB_INIT_RECOVERY = "Run 'exe-os doctor' and inspect the daemon bootstrap failure detail. Do not run 'exe-os setup' or generate a replacement key for an existing encrypted database unless key diagnostics prove the original key is unavailable.";
|
|
1338
|
+
function classifyBootstrapFailure(error) {
|
|
1339
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1340
|
+
return /(?:no|missing|locked|unavailable|not found).{0,32}(?:master |encryption )?key|keychain/i.test(message) ? "key_custody" : "db_init";
|
|
1341
|
+
}
|
|
1342
|
+
function recoveryForBootstrapFailure(reason) {
|
|
1343
|
+
return reason === "key_custody" ? KEY_CUSTODY_RECOVERY : DB_INIT_RECOVERY;
|
|
1344
|
+
}
|
|
1389
1345
|
function exeDir() {
|
|
1390
1346
|
return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? join2(homedir2(), ".exe-os");
|
|
1391
1347
|
}
|
|
@@ -1400,7 +1356,7 @@ function writeBootstrapFailureMarker(reason, detail) {
|
|
|
1400
1356
|
detectedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1401
1357
|
reason,
|
|
1402
1358
|
detail,
|
|
1403
|
-
recovery:
|
|
1359
|
+
recovery: recoveryForBootstrapFailure(reason)
|
|
1404
1360
|
}, null, 2), { mode: 384 });
|
|
1405
1361
|
} catch {
|
|
1406
1362
|
}
|
|
@@ -1414,11 +1370,12 @@ function clearBootstrapFailureMarker() {
|
|
|
1414
1370
|
}
|
|
1415
1371
|
function buildBootstrapResponse(input) {
|
|
1416
1372
|
const headers = { "Content-Type": "application/json" };
|
|
1373
|
+
const recovery = input.failedReason === null ? DB_INIT_RECOVERY : recoveryForBootstrapFailure(input.failedReason);
|
|
1417
1374
|
if (input.method === "GET" && input.path === "/health") {
|
|
1418
1375
|
return {
|
|
1419
1376
|
statusCode: 200,
|
|
1420
1377
|
headers,
|
|
1421
|
-
body: JSON.stringify(input.failedReason === null ? { status: "starting", version: input.version } : { status: "failed", reason: input.failedReason, version: input.version, recovery
|
|
1378
|
+
body: JSON.stringify(input.failedReason === null ? { status: "starting", version: input.version } : { status: "failed", reason: input.failedReason, version: input.version, recovery })
|
|
1422
1379
|
};
|
|
1423
1380
|
}
|
|
1424
1381
|
if (input.failedReason !== null) {
|
|
@@ -1429,7 +1386,7 @@ function buildBootstrapResponse(input) {
|
|
|
1429
1386
|
jsonrpc: "2.0",
|
|
1430
1387
|
error: {
|
|
1431
1388
|
code: -32002,
|
|
1432
|
-
message: `Terminal DB init failure (${input.failedReason}) - MCP will not start. Recover:
|
|
1389
|
+
message: `Terminal DB init failure (${input.failedReason}) - MCP will not start. Recover: ${recovery}`
|
|
1433
1390
|
},
|
|
1434
1391
|
id: null
|
|
1435
1392
|
})
|
|
@@ -1505,6 +1462,13 @@ function loadDaemonEnv(path5 = daemonEnvPath()) {
|
|
|
1505
1462
|
|
|
1506
1463
|
// src/lib/exe-daemon.ts
|
|
1507
1464
|
loadDaemonEnv();
|
|
1465
|
+
var strippedKeyCustodyEnv = sanitizeDaemonKeyCustodyEnv(process.env);
|
|
1466
|
+
if (strippedKeyCustodyEnv.length > 0) {
|
|
1467
|
+
process.stderr.write(
|
|
1468
|
+
`[exed] Ignored host-incompatible inherited key-custody override(s): ${strippedKeyCustodyEnv.join(", ")}.
|
|
1469
|
+
`
|
|
1470
|
+
);
|
|
1471
|
+
}
|
|
1508
1472
|
function stabilizeDaemonCwd() {
|
|
1509
1473
|
try {
|
|
1510
1474
|
process.cwd();
|
|
@@ -1893,6 +1857,7 @@ var _lastSelfHealShutdownAtMs = 0;
|
|
|
1893
1857
|
var _postRestartGraceLogged = /* @__PURE__ */ new Set();
|
|
1894
1858
|
process.env.EXE_DAEMON_STARTED_AT_ISO ??= new Date(_startedAt2).toISOString();
|
|
1895
1859
|
var BOOT_CATCHUP_GRACE_MS = Number(process.env.EXE_BOOT_CATCHUP_GRACE_MS) || 3 * 60 * 1e3;
|
|
1860
|
+
var POST_DB_READY_CATCHUP_GRACE_MS = Number(process.env.EXE_POST_DB_READY_CATCHUP_GRACE_MS) || 5 * 60 * 1e3;
|
|
1896
1861
|
var _bootCatchUpUntilMs = _startedAt2 + BOOT_CATCHUP_GRACE_MS;
|
|
1897
1862
|
function inBootCatchUpGrace() {
|
|
1898
1863
|
return Date.now() < _bootCatchUpUntilMs;
|
|
@@ -1931,6 +1896,7 @@ var TIMER_TRACE_SLOW_MS = Number(process.env.EXE_TIMER_TRACE_SLOW_MS) || 500;
|
|
|
1931
1896
|
var TIMER_TIMEOUT_MS = Number(process.env.EXE_TIMER_TIMEOUT_MS) || 1e4;
|
|
1932
1897
|
var TIMER_SLOW_WARN_MS = Number(process.env.EXE_TIMER_SLOW_WARN_MS) || 1e3;
|
|
1933
1898
|
var _timerInFlight = /* @__PURE__ */ new Set();
|
|
1899
|
+
var _maintenanceAdmission = createDaemonMaintenanceAdmission();
|
|
1934
1900
|
function shouldTraceDaemonTimer(durationMs = 0) {
|
|
1935
1901
|
return Date.now() - _startedAt2 < TIMER_TRACE_BOOT_WINDOW_MS || durationMs >= TIMER_TRACE_SLOW_MS;
|
|
1936
1902
|
}
|
|
@@ -1949,6 +1915,7 @@ function flushStallEpisode() {
|
|
|
1949
1915
|
const blk = _lastLongSyncCallback && Date.now() - _lastLongSyncCallback.ts < 6e4 ? _lastLongSyncCallback : null;
|
|
1950
1916
|
const blockerName = blk?.name ?? "unknown";
|
|
1951
1917
|
const blockerExecMs = Math.round(blk?.execMs ?? 0);
|
|
1918
|
+
const blockerAttribution = blk?.attribution ?? null;
|
|
1952
1919
|
const followers = [...ep.followers];
|
|
1953
1920
|
const n = followers.length;
|
|
1954
1921
|
const stallS = (ep.maxWallMs / 1e3).toFixed(1);
|
|
@@ -1963,6 +1930,8 @@ function flushStallEpisode() {
|
|
|
1963
1930
|
type: "event_loop_stall",
|
|
1964
1931
|
blocker: blockerName,
|
|
1965
1932
|
blockerExecMs,
|
|
1933
|
+
// Additive; absent on records written before bug 87ca694a.
|
|
1934
|
+
...blockerAttribution !== null ? { blockerAttribution } : {},
|
|
1966
1935
|
followerCount: n,
|
|
1967
1936
|
followers,
|
|
1968
1937
|
maxWallMs: Math.round(ep.maxWallMs)
|
|
@@ -2084,6 +2053,17 @@ var SELF_HEAL_ACTION_DEPS = {
|
|
|
2084
2053
|
process.exit(code);
|
|
2085
2054
|
}
|
|
2086
2055
|
};
|
|
2056
|
+
function creditedOutsideParkLagMs(timer, sinceMs, windowStartMs, windowEndMs, lagMs) {
|
|
2057
|
+
const intervals = timerPauseIntervalsSince(timer, sinceMs);
|
|
2058
|
+
if (isTimerPausedNow(timer)) {
|
|
2059
|
+
const activePauseStartMs = currentPauseStartMs(timer);
|
|
2060
|
+
if (activePauseStartMs !== null) {
|
|
2061
|
+
intervals.push({ startMs: activePauseStartMs, endMs: Math.max(windowEndMs, Date.now()) });
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
const nonParkMs = outsideParkPortionMs(windowStartMs, windowEndMs, intervals);
|
|
2065
|
+
return Math.min(lagMs, nonParkMs);
|
|
2066
|
+
}
|
|
2087
2067
|
async function traceDaemonTimer(name, fn) {
|
|
2088
2068
|
if (_timerInFlight.has(name)) {
|
|
2089
2069
|
process.stderr.write(`[exed] Timer SKIPPED (overlap): ${name} \u2014 previous tick still running
|
|
@@ -2091,6 +2071,7 @@ async function traceDaemonTimer(name, fn) {
|
|
|
2091
2071
|
return void 0;
|
|
2092
2072
|
}
|
|
2093
2073
|
_timerInFlight.add(name);
|
|
2074
|
+
const maintenancePermit = await _maintenanceAdmission.acquire(name);
|
|
2094
2075
|
const probe = captureClockProbe();
|
|
2095
2076
|
const pauseSnapshot = sweepPauseTotalMs(name);
|
|
2096
2077
|
const traceStart = shouldTraceDaemonTimer();
|
|
@@ -2101,13 +2082,39 @@ async function traceDaemonTimer(name, fn) {
|
|
|
2101
2082
|
const watchdogStart = Date.now();
|
|
2102
2083
|
let timeoutWatchdogSawBlocking = false;
|
|
2103
2084
|
let peakLoopLagMs = 0;
|
|
2085
|
+
let peakLoopLagOutsideParkMs = 0;
|
|
2104
2086
|
const stopTimeoutWatchdog = startTimerTimeoutWatchdog({
|
|
2105
2087
|
timeoutMs: TIMER_TIMEOUT_MS,
|
|
2106
2088
|
startedAtMs: watchdogStart,
|
|
2107
2089
|
pauseSnapshotMs: pauseSnapshot,
|
|
2108
2090
|
pauseTotalMs: () => sweepPauseTotalMs(name),
|
|
2109
|
-
|
|
2091
|
+
// Bug set following 7eaaf4f3 (codex-review P1s on PR #962, findings #1/#3):
|
|
2092
|
+
// a live `isTimerPausedNow(name)` check at sample-fire time is racy for a
|
|
2093
|
+
// sample whose MEASURED WINDOW straddles a pause boundary — e.g. the probe
|
|
2094
|
+
// due before a pause, fires again only after the pause ended AND a
|
|
2095
|
+
// post-pause CPU burn followed (the burn itself blocks the loop, so no
|
|
2096
|
+
// probe can fire mid-burn to split it out). By the time this callback
|
|
2097
|
+
// runs the pause has already ended, so the flag alone cannot tell "all
|
|
2098
|
+
// active" from "straddles a park" from "wholly inside a park that hasn't
|
|
2099
|
+
// been recorded yet". Use the sample's own window plus the timer's
|
|
2100
|
+
// recorded pause intervals to credit only the portion NOT explained by a
|
|
2101
|
+
// park, instead of either fully crediting the window (launders park time
|
|
2102
|
+
// in) or fully discarding it (hides a genuine post-pause burn).
|
|
2103
|
+
//
|
|
2104
|
+
// Bug bdea15f6 follow-up (codex-review P1 against this PR, round 4):
|
|
2105
|
+
// "paused right now" used to short-circuit this whole callback the moment
|
|
2106
|
+
// it was true, unconditionally zeroing the credit for the ENTIRE sample
|
|
2107
|
+
// window — including any real blocking work that happened BEFORE the
|
|
2108
|
+
// pause started but is still inside this same window (a probe delayed by
|
|
2109
|
+
// CPU work can fire only after a subsequent budgeted sleep has begun).
|
|
2110
|
+
// See `creditedOutsideParkLagMs` above for the fix: fold the in-progress
|
|
2111
|
+
// pause in as a synthetic "open" interval and reuse the same
|
|
2112
|
+
// `outsideParkPortionMs` machinery used for completed pauses, instead of
|
|
2113
|
+
// an all-or-nothing point-in-time check.
|
|
2114
|
+
onLagSample: (lagMs, windowStartMs, windowEndMs) => {
|
|
2110
2115
|
if (lagMs > peakLoopLagMs) peakLoopLagMs = lagMs;
|
|
2116
|
+
const creditedLagMs = creditedOutsideParkLagMs(name, watchdogStart, windowStartMs, windowEndMs, lagMs);
|
|
2117
|
+
if (creditedLagMs > peakLoopLagOutsideParkMs) peakLoopLagOutsideParkMs = creditedLagMs;
|
|
2111
2118
|
},
|
|
2112
2119
|
onTimeout: () => {
|
|
2113
2120
|
timeoutWatchdogSawBlocking = true;
|
|
@@ -2148,6 +2155,7 @@ async function traceDaemonTimer(name, fn) {
|
|
|
2148
2155
|
syncExecMs = Math.max(0, monotonicNowMs() - syncStart);
|
|
2149
2156
|
return await pending;
|
|
2150
2157
|
} finally {
|
|
2158
|
+
maintenancePermit.release();
|
|
2151
2159
|
const finalWatchdogLagMs = stopTimeoutWatchdog();
|
|
2152
2160
|
if (finalWatchdogLagMs > peakLoopLagMs) peakLoopLagMs = finalWatchdogLagMs;
|
|
2153
2161
|
_timerInFlight.delete(name);
|
|
@@ -2158,6 +2166,11 @@ async function traceDaemonTimer(name, fn) {
|
|
|
2158
2166
|
const busyMs = Math.max(0, durationMs - sweepPausedMs);
|
|
2159
2167
|
const syncExecMsRounded = Math.round(syncExecMs);
|
|
2160
2168
|
const peakLagMsRounded = Math.round(peakLoopLagMs);
|
|
2169
|
+
const peakLagOutsideParkMsRounded = Math.round(peakLoopLagOutsideParkMs);
|
|
2170
|
+
const pausedIntervals = timerPauseIntervalsSince(name, watchdogStart).map((iv) => ({
|
|
2171
|
+
startOffsetMs: Math.max(0, Math.round(iv.startMs - watchdogStart)),
|
|
2172
|
+
endOffsetMs: Math.max(0, Math.round(iv.endMs - watchdogStart))
|
|
2173
|
+
}));
|
|
2161
2174
|
const ownSyncBlocked = syncExecMs >= TIMER_SLOW_WARN_MS;
|
|
2162
2175
|
const loopStalledDuringTick = peakLoopLagMs >= TIMER_SLOW_WARN_MS;
|
|
2163
2176
|
const anotherBlockerNamed = _lastLongSyncCallback !== null && _lastLongSyncCallback.name !== name && Date.now() - _lastLongSyncCallback.ts < STALL_EPISODE_FLUSH_MS * 4;
|
|
@@ -2168,7 +2181,7 @@ async function traceDaemonTimer(name, fn) {
|
|
|
2168
2181
|
if (shouldWarnSlowTimer(busyMs, slept, TIMER_SLOW_WARN_MS)) {
|
|
2169
2182
|
if (selfHeldLoop) {
|
|
2170
2183
|
const attribution = ownSyncBlocked ? "sync-prefix" : "post-await/continuation";
|
|
2171
|
-
_lastLongSyncCallback = { name, execMs: ownSyncBlocked ? syncExecMs : busyMs, ts: Date.now() };
|
|
2184
|
+
_lastLongSyncCallback = { name, execMs: ownSyncBlocked ? syncExecMs : busyMs, ts: Date.now(), attribution };
|
|
2172
2185
|
const msg = `[exed] Timer SLOW: ${name} busy ${busyMs}ms (wall ${durationMs}ms, sync-exec ${syncExecMsRounded}ms, peak-lag ${peakLagMsRounded}ms, sweep-paused ${sweepPausedMs}ms) \u2014 exceeded ${TIMER_SLOW_WARN_MS}ms per-tick budget (event loop was held; attribution ${attribution})`;
|
|
2173
2186
|
process.stderr.write(`${msg}
|
|
2174
2187
|
`);
|
|
@@ -2185,6 +2198,10 @@ async function traceDaemonTimer(name, fn) {
|
|
|
2185
2198
|
peakLagMs: peakLagMsRounded,
|
|
2186
2199
|
attribution,
|
|
2187
2200
|
sweepPausedMs,
|
|
2201
|
+
// Bug 7eaaf4f3: see comment above peakLagOutsideParkMsRounded — additive,
|
|
2202
|
+
// omit intervals when there were none so old-shaped records stay old-shaped.
|
|
2203
|
+
peakLagOutsideParkMs: peakLagOutsideParkMsRounded,
|
|
2204
|
+
...pausedIntervals.length > 0 ? { pausedIntervals } : {},
|
|
2188
2205
|
thresholdMs: TIMER_SLOW_WARN_MS,
|
|
2189
2206
|
wallMs: Math.round(span.wallMs),
|
|
2190
2207
|
sleptMs: Math.round(span.sleptMs),
|
|
@@ -2215,6 +2232,9 @@ async function traceDaemonTimer(name, fn) {
|
|
|
2215
2232
|
// a blocker.
|
|
2216
2233
|
busyMs,
|
|
2217
2234
|
sweepPausedMs,
|
|
2235
|
+
// Bug 7eaaf4f3: same additive fields as the timer_slow record above.
|
|
2236
|
+
peakLagOutsideParkMs: peakLagOutsideParkMsRounded,
|
|
2237
|
+
...pausedIntervals.length > 0 ? { pausedIntervals } : {},
|
|
2218
2238
|
wallMs: Math.round(span.wallMs),
|
|
2219
2239
|
sleptMs: Math.round(span.sleptMs),
|
|
2220
2240
|
clockJump: slept,
|
|
@@ -2636,7 +2656,7 @@ async function loadModel() {
|
|
|
2636
2656
|
void (async () => {
|
|
2637
2657
|
try {
|
|
2638
2658
|
if (_storeInitialized) {
|
|
2639
|
-
const { writeNotification } = await import("../notifications-
|
|
2659
|
+
const { writeNotification } = await import("../notifications-LGYY22W5.js");
|
|
2640
2660
|
await writeNotification({
|
|
2641
2661
|
agentId: "exe",
|
|
2642
2662
|
agentRole: "system",
|
|
@@ -2773,7 +2793,7 @@ function disableEmbeddingsForInferenceTimeouts() {
|
|
|
2773
2793
|
void (async () => {
|
|
2774
2794
|
try {
|
|
2775
2795
|
if (_storeInitialized) {
|
|
2776
|
-
const { writeNotification } = await import("../notifications-
|
|
2796
|
+
const { writeNotification } = await import("../notifications-LGYY22W5.js");
|
|
2777
2797
|
await writeNotification({
|
|
2778
2798
|
agentId: "exe",
|
|
2779
2799
|
agentRole: "system",
|
|
@@ -2940,7 +2960,7 @@ async function shutdown(exitCode = 0, reason = null, restartKind) {
|
|
|
2940
2960
|
_shuttingDown = true;
|
|
2941
2961
|
_drainingWrites = true;
|
|
2942
2962
|
try {
|
|
2943
|
-
const { stopOrgPartnerRuntime } = await import("../org-partner-runtime-
|
|
2963
|
+
const { stopOrgPartnerRuntime } = await import("../org-partner-runtime-L7L2WWGN.js");
|
|
2944
2964
|
stopOrgPartnerRuntime();
|
|
2945
2965
|
} catch {
|
|
2946
2966
|
}
|
|
@@ -3023,7 +3043,7 @@ async function shutdown(exitCode = 0, reason = null, restartKind) {
|
|
|
3023
3043
|
dbBytes = dbPath ? statSync4(dbPath).size : 0;
|
|
3024
3044
|
} catch {
|
|
3025
3045
|
}
|
|
3026
|
-
const { getAvailableMemoryBytesSync } = await import("../memory-pressure-watchdog-
|
|
3046
|
+
const { getAvailableMemoryBytesSync } = await import("../memory-pressure-watchdog-J6Q3SIBL.js");
|
|
3027
3047
|
const freeBytes = getAvailableMemoryBytesSync();
|
|
3028
3048
|
if (shouldSkipBackupUnderMemoryPressure(freeBytes, dbBytes)) {
|
|
3029
3049
|
memoryGateSkip = true;
|
|
@@ -3076,7 +3096,7 @@ async function shutdown(exitCode = 0, reason = null, restartKind) {
|
|
|
3076
3096
|
`);
|
|
3077
3097
|
}
|
|
3078
3098
|
try {
|
|
3079
|
-
const { stopProjectionWorker } = await import("../projection-worker-
|
|
3099
|
+
const { stopProjectionWorker } = await import("../projection-worker-RNYPE46G.js");
|
|
3080
3100
|
stopProjectionWorker();
|
|
3081
3101
|
} catch {
|
|
3082
3102
|
}
|
|
@@ -3086,7 +3106,7 @@ async function shutdown(exitCode = 0, reason = null, restartKind) {
|
|
|
3086
3106
|
} catch {
|
|
3087
3107
|
}
|
|
3088
3108
|
try {
|
|
3089
|
-
const { disposeAllCodeContextWatchers } = await import("../code-context-watcher-
|
|
3109
|
+
const { disposeAllCodeContextWatchers } = await import("../code-context-watcher-4F7K2N3U.js");
|
|
3090
3110
|
disposeAllCodeContextWatchers();
|
|
3091
3111
|
} catch {
|
|
3092
3112
|
}
|
|
@@ -3144,7 +3164,7 @@ async function handleHealthCheck(socket, requestId) {
|
|
|
3144
3164
|
let pipelineStatus = "unknown";
|
|
3145
3165
|
if (dbConnected) {
|
|
3146
3166
|
try {
|
|
3147
|
-
await import("../pipeline-router-
|
|
3167
|
+
await import("../pipeline-router-NKYAUR3Y.js");
|
|
3148
3168
|
pipelineStatus = "ok";
|
|
3149
3169
|
} catch {
|
|
3150
3170
|
pipelineStatus = "unavailable";
|
|
@@ -3610,7 +3630,7 @@ async function _writeMemoryRecordInner(entry, syncOnly = false) {
|
|
|
3610
3630
|
const vRow = await client.execute({ sql: "SELECT version FROM memories WHERE id = ?", args: [id] });
|
|
3611
3631
|
const version = Number(vRow.rows[0]?.version) || 0;
|
|
3612
3632
|
try {
|
|
3613
|
-
const { insertOntologyForMemory } = await import("../agentic-ontology-
|
|
3633
|
+
const { insertOntologyForMemory } = await import("../agentic-ontology-DT3VOXBT.js");
|
|
3614
3634
|
await insertOntologyForMemory({
|
|
3615
3635
|
id,
|
|
3616
3636
|
agent_id: record.agent_id,
|
|
@@ -3648,18 +3668,49 @@ function startMemoryQueueDrain() {
|
|
|
3648
3668
|
const useTxBatch = !_embedWorkerReady && !(isWriteWorkerEnabled() && isDbWriteWorkerReady());
|
|
3649
3669
|
const txClient = useTxBatch ? (await import("./database.js")).getClient() : null;
|
|
3650
3670
|
const drainSyncOnly = useTxBatch;
|
|
3651
|
-
|
|
3671
|
+
let drainBatchPermit = null;
|
|
3672
|
+
const acquireDrainBatch = async () => {
|
|
3673
|
+
if (drainBatchPermit) throw new Error("memory drain batch permit already held");
|
|
3674
|
+
drainBatchPermit = await _maintenanceAdmission.acquire("memory_queue_drain_batch");
|
|
3675
|
+
};
|
|
3676
|
+
const releaseDrainBatch = () => {
|
|
3677
|
+
drainBatchPermit?.release();
|
|
3678
|
+
drainBatchPermit = null;
|
|
3679
|
+
};
|
|
3680
|
+
const writeDrainEntry = async (entry) => {
|
|
3681
|
+
if (drainBatchPermit) {
|
|
3682
|
+
return writeMemoryRecord(entry, { syncOnly: drainSyncOnly });
|
|
3683
|
+
}
|
|
3684
|
+
const permit = await _maintenanceAdmission.acquire("memory_queue_drain_batch");
|
|
3685
|
+
try {
|
|
3686
|
+
return await writeMemoryRecord(entry, { syncOnly: drainSyncOnly });
|
|
3687
|
+
} finally {
|
|
3688
|
+
permit.release();
|
|
3689
|
+
}
|
|
3690
|
+
};
|
|
3691
|
+
const result = await processQueueEntries(entries, writeDrainEntry, {
|
|
3652
3692
|
isDraining: () => _drainingWrites,
|
|
3653
3693
|
batchSize: useTxBatch ? MEMORY_DRAIN_TX_BATCH : MEMORY_DRAIN_BATCH,
|
|
3654
3694
|
yieldFn: yieldToEventLoop,
|
|
3655
3695
|
beginBatch: txClient ? async () => {
|
|
3656
|
-
await
|
|
3696
|
+
await acquireDrainBatch();
|
|
3697
|
+
try {
|
|
3698
|
+
await txClient.execute("BEGIN IMMEDIATE");
|
|
3699
|
+
} catch (err) {
|
|
3700
|
+
releaseDrainBatch();
|
|
3701
|
+
throw err;
|
|
3702
|
+
}
|
|
3657
3703
|
} : void 0,
|
|
3658
3704
|
commitBatch: txClient ? async () => {
|
|
3659
3705
|
await txClient.execute("COMMIT");
|
|
3706
|
+
releaseDrainBatch();
|
|
3660
3707
|
} : void 0,
|
|
3661
3708
|
rollbackBatch: txClient ? async () => {
|
|
3662
|
-
|
|
3709
|
+
try {
|
|
3710
|
+
await txClient.execute("ROLLBACK");
|
|
3711
|
+
} finally {
|
|
3712
|
+
releaseDrainBatch();
|
|
3713
|
+
}
|
|
3663
3714
|
} : void 0,
|
|
3664
3715
|
onWriteError: (_entry, err) => {
|
|
3665
3716
|
process.stderr.write(
|
|
@@ -3727,7 +3778,7 @@ function startMessageQueueDrain() {
|
|
|
3727
3778
|
fired("message_queue_drain");
|
|
3728
3779
|
if (!await ensureStoreForPolling()) return;
|
|
3729
3780
|
try {
|
|
3730
|
-
const { claimMessageQueue, ackMessageQueue } = await import("../message-queue-client-
|
|
3781
|
+
const { claimMessageQueue, ackMessageQueue } = await import("../message-queue-client-OEQCGSWC.js");
|
|
3731
3782
|
const lease = claimMessageQueue();
|
|
3732
3783
|
if (!lease || lease.entries.length === 0) return;
|
|
3733
3784
|
acted("message_queue_drain");
|
|
@@ -4274,7 +4325,7 @@ async function startMcpHttpServer() {
|
|
|
4274
4325
|
`);
|
|
4275
4326
|
}
|
|
4276
4327
|
try {
|
|
4277
|
-
void import("../mcp-child-registry-
|
|
4328
|
+
void import("../mcp-child-registry-DVHYAHPW.js").then(({ reapOrphanedMcpChildren }) => reapOrphanedMcpChildren({
|
|
4278
4329
|
// A session the reaper cannot decide on must not vanish into a
|
|
4279
4330
|
// silent `continue` — an orphan nobody can see is worse than one
|
|
4280
4331
|
// that is reported. It is deliberately NOT terminated (unverified
|
|
@@ -4438,12 +4489,14 @@ async function startMcpHttpServer() {
|
|
|
4438
4489
|
process.stderr.write("[exed] MCP HTTP: SDK imports done, initializing DB...\n");
|
|
4439
4490
|
const dbReady = await ensureStoreForPolling();
|
|
4440
4491
|
if (!dbReady) {
|
|
4441
|
-
|
|
4492
|
+
const failureReason = _lastStoreInitFailureReason ?? "db_init";
|
|
4493
|
+
writeBootstrapFailureMarker(failureReason, "MCP HTTP bootstrap reached terminal DB init failure; server remains alive with 503 responses until process exit.");
|
|
4442
4494
|
process.stderr.write(
|
|
4443
|
-
|
|
4495
|
+
`[exed] MCP HTTP: DB init failed (${failureReason}) \u2014 MCP HTTP endpoint will NOT start. Run 'exe-os doctor'; do not replace an existing database key unless key diagnostics prove it unavailable.
|
|
4496
|
+
`
|
|
4444
4497
|
);
|
|
4445
4498
|
if (_bootstrapServerRef) {
|
|
4446
|
-
_bootstrapFailedReason =
|
|
4499
|
+
_bootstrapFailedReason = failureReason;
|
|
4447
4500
|
process.stderr.write(
|
|
4448
4501
|
"[exed] MCP HTTP: failed-health responder remains alive on the port so tooling can distinguish terminal DB init failure from startup.\n"
|
|
4449
4502
|
);
|
|
@@ -4455,7 +4508,7 @@ async function startMcpHttpServer() {
|
|
|
4455
4508
|
setBootPhase("db_ready");
|
|
4456
4509
|
_storeInitialized = true;
|
|
4457
4510
|
markDbInitCompleted();
|
|
4458
|
-
const { initLicenseGate, getCachedLicenseGate } = await import("../license-gate-
|
|
4511
|
+
const { initLicenseGate, getCachedLicenseGate } = await import("../license-gate-2QNMBAZU.js");
|
|
4459
4512
|
const gateResult = await initLicenseGate();
|
|
4460
4513
|
if (!gateResult.hasKey) {
|
|
4461
4514
|
process.stderr.write(
|
|
@@ -4470,13 +4523,13 @@ async function startMcpHttpServer() {
|
|
|
4470
4523
|
let _cachedWrapTelemetry = null;
|
|
4471
4524
|
async function getWrapTelemetry() {
|
|
4472
4525
|
if (!_cachedWrapTelemetry) {
|
|
4473
|
-
const { wrapServerWithTelemetry } = await import("../tool-telemetry-
|
|
4526
|
+
const { wrapServerWithTelemetry } = await import("../tool-telemetry-GBDI4AXR.js");
|
|
4474
4527
|
_cachedWrapTelemetry = wrapServerWithTelemetry;
|
|
4475
4528
|
}
|
|
4476
4529
|
return _cachedWrapTelemetry;
|
|
4477
4530
|
}
|
|
4478
4531
|
Promise.all([
|
|
4479
|
-
import("../tool-capability-index-
|
|
4532
|
+
import("../tool-capability-index-6HLZU437.js"),
|
|
4480
4533
|
import("../tool-gates-VXITVRFQ.js")
|
|
4481
4534
|
]).then(async ([{ getToolCapabilityIndex }, { TOOL_CATEGORIES }]) => {
|
|
4482
4535
|
const gateState = getCachedLicenseGate();
|
|
@@ -4542,7 +4595,7 @@ async function startMcpHttpServer() {
|
|
|
4542
4595
|
const expectedBuf = Buffer.from(_daemonToken);
|
|
4543
4596
|
if (tokenBuf.length === expectedBuf.length && timingSafeEqual(tokenBuf, expectedBuf)) return true;
|
|
4544
4597
|
try {
|
|
4545
|
-
const { verifyAccessToken } = await import("../oauth-server-
|
|
4598
|
+
const { verifyAccessToken } = await import("../oauth-server-ZRHXIRXQ.js");
|
|
4546
4599
|
const result = verifyAccessToken(token);
|
|
4547
4600
|
return result.valid;
|
|
4548
4601
|
} catch {
|
|
@@ -4766,7 +4819,7 @@ async function startMcpHttpServer() {
|
|
|
4766
4819
|
// process: traceDaemonTimer writes tick *starts* to stderr only, never
|
|
4767
4820
|
// durably. When a tick blocks the loop this is the field that names it.
|
|
4768
4821
|
timersInFlight: [..._timerInFlight],
|
|
4769
|
-
...blockedNow && { warning: "
|
|
4822
|
+
...blockedNow && { warning: "A recent event-loop block was recorded; MCP requests remain enabled while the marker ages out (~10s)" },
|
|
4770
4823
|
...!blockedNow && degraded && { warning: `Event loop lag ${Math.round(elLag)}ms exceeds 5000ms threshold \u2014 daemon may be unresponsive` }
|
|
4771
4824
|
}));
|
|
4772
4825
|
return;
|
|
@@ -4795,7 +4848,7 @@ async function startMcpHttpServer() {
|
|
|
4795
4848
|
return;
|
|
4796
4849
|
}
|
|
4797
4850
|
try {
|
|
4798
|
-
const { handleOAuthRoute } = await import("../oauth-server-
|
|
4851
|
+
const { handleOAuthRoute } = await import("../oauth-server-ZRHXIRXQ.js");
|
|
4799
4852
|
const handled = await handleOAuthRoute(req, res, url, MCP_HTTP_PORT, _daemonToken);
|
|
4800
4853
|
if (handled) return;
|
|
4801
4854
|
} catch (err) {
|
|
@@ -4923,7 +4976,7 @@ async function startMcpHttpServer() {
|
|
|
4923
4976
|
contextPct: body.context_pct
|
|
4924
4977
|
});
|
|
4925
4978
|
if (body.context_pct !== void 0 && body.context_pct > 70) {
|
|
4926
|
-
void import("../orchestration-events-
|
|
4979
|
+
void import("../orchestration-events-JPHB6NPY.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
|
|
4927
4980
|
recordOE({
|
|
4928
4981
|
eventType: "context.pressure",
|
|
4929
4982
|
source: "exe-daemon.heartbeat",
|
|
@@ -4960,22 +5013,6 @@ async function startMcpHttpServer() {
|
|
|
4960
5013
|
res.end(JSON.stringify({ error: "not_found" }));
|
|
4961
5014
|
return;
|
|
4962
5015
|
}
|
|
4963
|
-
if (isEventLoopBlockedNow()) {
|
|
4964
|
-
res.writeHead(503, { "Content-Type": "application/json", "Retry-After": "3" });
|
|
4965
|
-
res.end(JSON.stringify({
|
|
4966
|
-
jsonrpc: "2.0",
|
|
4967
|
-
error: { code: -32001, message: "Daemon event loop blocked \u2014 MCP temporarily degraded. Retry in a few seconds." },
|
|
4968
|
-
id: null
|
|
4969
|
-
}));
|
|
4970
|
-
recordMcpHttpEvent({
|
|
4971
|
-
level: "warn",
|
|
4972
|
-
message: "event_loop_blocked_503",
|
|
4973
|
-
method: req.method,
|
|
4974
|
-
status: 503,
|
|
4975
|
-
error: `path=${url.pathname}`
|
|
4976
|
-
});
|
|
4977
|
-
return;
|
|
4978
|
-
}
|
|
4979
5016
|
const authed = await verifyHttpBearerAuth(req.headers.authorization);
|
|
4980
5017
|
if (!authed) {
|
|
4981
5018
|
sendJsonRpcError2(res, 401, "Unauthorized: Bearer token required", "unknown", {
|
|
@@ -5035,7 +5072,7 @@ async function startMcpHttpServer() {
|
|
|
5035
5072
|
let sessionHint = req.headers["x-exe-session-name"] || req.headers["x-exe-session"] || "";
|
|
5036
5073
|
if (sessionHint) {
|
|
5037
5074
|
try {
|
|
5038
|
-
const { sanitizeSessionHintHeader, rejectForgedSessionHint } = await import("../mcp-session-identity-
|
|
5075
|
+
const { sanitizeSessionHintHeader, rejectForgedSessionHint } = await import("../mcp-session-identity-PEVM7VIP.js");
|
|
5039
5076
|
const rawHint = sessionHint;
|
|
5040
5077
|
sessionHint = sanitizeSessionHintHeader(sessionHint);
|
|
5041
5078
|
if (!sessionHint) {
|
|
@@ -5074,7 +5111,7 @@ async function startMcpHttpServer() {
|
|
|
5074
5111
|
try {
|
|
5075
5112
|
const liveSessions = await getTmuxSessionsAsync();
|
|
5076
5113
|
const paneCommands = await getPaneCommandsAsync();
|
|
5077
|
-
const { resolveMcpSessionHint } = await import("../mcp-session-identity-
|
|
5114
|
+
const { resolveMcpSessionHint } = await import("../mcp-session-identity-PEVM7VIP.js");
|
|
5078
5115
|
let registrySessions = [];
|
|
5079
5116
|
try {
|
|
5080
5117
|
const { listSessions: listRegistrySessions } = await import("./session-registry.js");
|
|
@@ -5211,7 +5248,7 @@ async function startMcpHttpServer() {
|
|
|
5211
5248
|
bindLive = await getTmuxSessionsAsync();
|
|
5212
5249
|
} catch {
|
|
5213
5250
|
}
|
|
5214
|
-
const { isLauncherCorroboratedIdentity } = await import("../mcp-session-identity-
|
|
5251
|
+
const { isLauncherCorroboratedIdentity } = await import("../mcp-session-identity-PEVM7VIP.js");
|
|
5215
5252
|
const corroborated = isLauncherCorroboratedIdentity({
|
|
5216
5253
|
agentId,
|
|
5217
5254
|
registrySessions: bindRegistry,
|
|
@@ -5454,7 +5491,7 @@ async function startMcpHttpServer() {
|
|
|
5454
5491
|
}
|
|
5455
5492
|
}
|
|
5456
5493
|
try {
|
|
5457
|
-
const { reconcileHintWithRegistryIdentity } = await import("../mcp-session-identity-
|
|
5494
|
+
const { reconcileHintWithRegistryIdentity } = await import("../mcp-session-identity-PEVM7VIP.js");
|
|
5458
5495
|
const { listSessions: listRegistrySessions } = await import("./session-registry.js");
|
|
5459
5496
|
const recon = reconcileHintWithRegistryIdentity({
|
|
5460
5497
|
agentId,
|
|
@@ -5635,6 +5672,22 @@ var _dbInitEverCompleted = false;
|
|
|
5635
5672
|
function markDbInitCompleted() {
|
|
5636
5673
|
if (_dbInitEverCompleted) return;
|
|
5637
5674
|
_dbInitEverCompleted = true;
|
|
5675
|
+
extendBootCatchUp(POST_DB_READY_CATCHUP_GRACE_MS);
|
|
5676
|
+
try {
|
|
5677
|
+
const markerDir = path4.join(EXE_AI_DIR, "session-cache");
|
|
5678
|
+
mkdirSync5(markerDir, { recursive: true });
|
|
5679
|
+
const markerPath = path4.join(markerDir, "db-init-complete");
|
|
5680
|
+
writeFileSync5(markerPath, JSON.stringify({
|
|
5681
|
+
pid: process.pid,
|
|
5682
|
+
startedAt: ownProcessStartedAt(),
|
|
5683
|
+
completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
5684
|
+
}), { mode: 384 });
|
|
5685
|
+
try {
|
|
5686
|
+
unlinkSync4(path4.join(EXE_AI_DIR, "daemon-bootstrap-stall.ALERT.json"));
|
|
5687
|
+
} catch {
|
|
5688
|
+
}
|
|
5689
|
+
} catch {
|
|
5690
|
+
}
|
|
5638
5691
|
clearHealthExitStreak();
|
|
5639
5692
|
}
|
|
5640
5693
|
function healthExitStreakPath() {
|
|
@@ -5662,6 +5715,7 @@ function clearHealthExitStreak() {
|
|
|
5662
5715
|
} catch {
|
|
5663
5716
|
}
|
|
5664
5717
|
}
|
|
5718
|
+
var _lastStoreInitFailureReason = null;
|
|
5665
5719
|
async function ensureStoreForPolling() {
|
|
5666
5720
|
if (_storeInitialized) return true;
|
|
5667
5721
|
try {
|
|
@@ -5697,10 +5751,10 @@ async function ensureStoreForPolling() {
|
|
|
5697
5751
|
await initDatabase({ dbPath: config.dbPath, encryptionKey: masterKey.toString("hex") });
|
|
5698
5752
|
await ensureSchema();
|
|
5699
5753
|
try {
|
|
5700
|
-
const { isLedgerEnabled } = await import("../notification-ledger-
|
|
5754
|
+
const { isLedgerEnabled } = await import("../notification-ledger-TG6EFYBP.js");
|
|
5701
5755
|
if (isLedgerEnabled()) {
|
|
5702
|
-
const { bumpBootGeneration } = await import("../boot-generation-
|
|
5703
|
-
const { setDaemonReadyGeneration } = await import("../daemon-ready-signal-
|
|
5756
|
+
const { bumpBootGeneration } = await import("../boot-generation-BN6GKASY.js");
|
|
5757
|
+
const { setDaemonReadyGeneration } = await import("../daemon-ready-signal-PNDMVKPJ.js");
|
|
5704
5758
|
const generation = await bumpBootGeneration();
|
|
5705
5759
|
setDaemonReadyGeneration(generation);
|
|
5706
5760
|
process.stderr.write(`[exed] notification ledger enabled \u2014 boot generation ${generation}
|
|
@@ -5727,9 +5781,11 @@ async function ensureStoreForPolling() {
|
|
|
5727
5781
|
}
|
|
5728
5782
|
}
|
|
5729
5783
|
_storeInitialized = true;
|
|
5784
|
+
_lastStoreInitFailureReason = null;
|
|
5730
5785
|
markDbInitCompleted();
|
|
5731
5786
|
return true;
|
|
5732
5787
|
} catch (err) {
|
|
5788
|
+
_lastStoreInitFailureReason = classifyBootstrapFailure(err);
|
|
5733
5789
|
process.stderr.write(
|
|
5734
5790
|
`[exed] ensureStoreForPolling failed: ${err instanceof Error ? err.message : String(err)}
|
|
5735
5791
|
`
|
|
@@ -5738,13 +5794,13 @@ async function ensureStoreForPolling() {
|
|
|
5738
5794
|
}
|
|
5739
5795
|
}
|
|
5740
5796
|
async function startReviewPolling() {
|
|
5741
|
-
const polling = await import("../review-polling-
|
|
5797
|
+
const polling = await import("../review-polling-G52BR4MC.js");
|
|
5742
5798
|
const state = {
|
|
5743
5799
|
lastIntercomSent: /* @__PURE__ */ new Map(),
|
|
5744
5800
|
lastNudgeSent: /* @__PURE__ */ new Map(),
|
|
5745
5801
|
intervalMs: REVIEW_POLL_INTERVAL_MS
|
|
5746
5802
|
};
|
|
5747
|
-
const { pollReviewNudge, createReviewNudgeRealDeps, loadNudgeState } = await import("../daemon-orchestration-
|
|
5803
|
+
const { pollReviewNudge, createReviewNudgeRealDeps, loadNudgeState } = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
5748
5804
|
const nudgeState = loadNudgeState();
|
|
5749
5805
|
const tick = async () => traceDaemonTimer("review_polling", async () => {
|
|
5750
5806
|
fired("review_polling");
|
|
@@ -5752,7 +5808,7 @@ async function startReviewPolling() {
|
|
|
5752
5808
|
try {
|
|
5753
5809
|
const { getClient } = await import("./database.js");
|
|
5754
5810
|
const deps = polling.createRealDeps(getClient);
|
|
5755
|
-
const { strictSessionScopeFilter } = await import("../task-scope-
|
|
5811
|
+
const { strictSessionScopeFilter } = await import("../task-scope-QANJJXXB.js");
|
|
5756
5812
|
const { getCoordinatorName, DEFAULT_COORDINATOR_TEMPLATE_NAME } = await import("./employees.js");
|
|
5757
5813
|
deps.findOrphanedDoneTasks = async (sessionScope) => {
|
|
5758
5814
|
const coordinatorName = getCoordinatorName();
|
|
@@ -5772,7 +5828,7 @@ async function startReviewPolling() {
|
|
|
5772
5828
|
deps.findTieredReviewCandidates = async (sessionScope) => {
|
|
5773
5829
|
let project = null;
|
|
5774
5830
|
try {
|
|
5775
|
-
const { getProjectName } = await import("../project-name-
|
|
5831
|
+
const { getProjectName } = await import("../project-name-WKSNNKXK.js");
|
|
5776
5832
|
project = getProjectName() || null;
|
|
5777
5833
|
} catch {
|
|
5778
5834
|
project = null;
|
|
@@ -5831,7 +5887,7 @@ function startSessionTTL() {
|
|
|
5831
5887
|
if (!await ensureStoreForPolling()) return;
|
|
5832
5888
|
if (inPostRestartDestructiveGrace("session_ttl")) return;
|
|
5833
5889
|
const { getClient } = await import("./database.js");
|
|
5834
|
-
const { checkSessionTTL, createSessionTTLRealDeps } = await import("../daemon-orchestration-
|
|
5890
|
+
const { checkSessionTTL, createSessionTTLRealDeps } = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
5835
5891
|
const deps = createSessionTTLRealDeps(getClient);
|
|
5836
5892
|
const killed = await checkSessionTTL(deps, _wedgeObservations);
|
|
5837
5893
|
if (killed.length > 0) acted("session_ttl");
|
|
@@ -5891,7 +5947,7 @@ function startIdleKill() {
|
|
|
5891
5947
|
const cfg = await getCachedConfig();
|
|
5892
5948
|
if (!cfg) return;
|
|
5893
5949
|
const { getClient } = await import("./database.js");
|
|
5894
|
-
const { pollIdleKill, createIdleKillRealDeps } = await import("../daemon-orchestration-
|
|
5950
|
+
const { pollIdleKill, createIdleKillRealDeps } = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
5895
5951
|
const { sessions: liveSessions, paneCache, aliveSessions } = await getSharedOrchestrationCaches();
|
|
5896
5952
|
const realDeps = createIdleKillRealDeps(
|
|
5897
5953
|
getClient,
|
|
@@ -6280,7 +6336,7 @@ function startSkillRefinement() {
|
|
|
6280
6336
|
if (!shouldRunHeavyJob("skill_refinement")) return;
|
|
6281
6337
|
try {
|
|
6282
6338
|
if (!await ensureStoreForPolling()) return;
|
|
6283
|
-
const { runSkillRefinement } = await import("../skill-refinement-
|
|
6339
|
+
const { runSkillRefinement } = await import("../skill-refinement-AKJTHFXC.js");
|
|
6284
6340
|
const result = await runSkillRefinement();
|
|
6285
6341
|
if (result.reviewed > 0) {
|
|
6286
6342
|
acted("skill_refinement");
|
|
@@ -6345,7 +6401,7 @@ function startStalledDispatchSweep() {
|
|
|
6345
6401
|
});
|
|
6346
6402
|
const { notifications, nextState } = decideStalledDispatchEscalations(intents, previousState);
|
|
6347
6403
|
if (notifications.length > 0 && _storeInitialized) {
|
|
6348
|
-
const { writeNotification } = await import("../notifications-
|
|
6404
|
+
const { writeNotification } = await import("../notifications-LGYY22W5.js");
|
|
6349
6405
|
for (const note of notifications) {
|
|
6350
6406
|
try {
|
|
6351
6407
|
await writeNotification({
|
|
@@ -6395,9 +6451,9 @@ function startStaleBranchSweep() {
|
|
|
6395
6451
|
fired("stale_branch_sweep");
|
|
6396
6452
|
if (sweepStarved("stale_branch_sweep")) return;
|
|
6397
6453
|
try {
|
|
6398
|
-
const { discoverRepoPathsAsync } = await import("../worktree-sweep-
|
|
6399
|
-
const { scanUnmergedBranchesCached } = await import("../branch-hygiene-
|
|
6400
|
-
const { runBudgetedSweep } = await import("../sweep-budget-
|
|
6454
|
+
const { discoverRepoPathsAsync } = await import("../worktree-sweep-EV5YQ2OB.js");
|
|
6455
|
+
const { scanUnmergedBranchesCached } = await import("../branch-hygiene-QLD77IMJ.js");
|
|
6456
|
+
const { runBudgetedSweep } = await import("../sweep-budget-YGLCNXZZ.js");
|
|
6401
6457
|
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
6402
6458
|
for (const k of _staleBranchAlertedToday) {
|
|
6403
6459
|
if (!k.endsWith(today)) _staleBranchAlertedToday.delete(k);
|
|
@@ -6428,7 +6484,7 @@ function startStaleBranchSweep() {
|
|
|
6428
6484
|
if (!_storeInitialized) return;
|
|
6429
6485
|
const stale = scan.branches.filter((b) => b.ageHours >= STALE_BRANCH_HOURS).slice(0, 5).map((b) => `${b.name} (${b.aheadUnknown ? "+? commits" : `+${b.ahead} commits`}, ${(b.ageHours / 24).toFixed(1)}d)`).join("; ");
|
|
6430
6486
|
try {
|
|
6431
|
-
const { writeNotification } = await import("../notifications-
|
|
6487
|
+
const { writeNotification } = await import("../notifications-LGYY22W5.js");
|
|
6432
6488
|
await writeNotification({
|
|
6433
6489
|
agentId: "exe",
|
|
6434
6490
|
agentRole: "system",
|
|
@@ -6491,7 +6547,7 @@ function startWorkStateHeartbeat() {
|
|
|
6491
6547
|
const { getClient } = await import("./database.js");
|
|
6492
6548
|
const { listSessions } = await import("./session-registry.js");
|
|
6493
6549
|
const { isCoordinatorName } = await import("./employees.js");
|
|
6494
|
-
const { runWorkStateTick } = await import("../work-state-heartbeat-
|
|
6550
|
+
const { runWorkStateTick } = await import("../work-state-heartbeat-CH6BLQKV.js");
|
|
6495
6551
|
let liveTmux = null;
|
|
6496
6552
|
const loadLiveTmux = async () => {
|
|
6497
6553
|
if (!liveTmux) liveTmux = await listTmuxSessionNamesAsync();
|
|
@@ -6557,7 +6613,7 @@ function startGraphExtraction() {
|
|
|
6557
6613
|
if (!await ensureStoreForPolling()) return;
|
|
6558
6614
|
const { getClient } = await import("./database.js");
|
|
6559
6615
|
const client = getClient();
|
|
6560
|
-
const { extractBatch } = await import("../graph-rag-
|
|
6616
|
+
const { extractBatch } = await import("../graph-rag-JA7XN7NO.js");
|
|
6561
6617
|
const result = await extractBatch(client, 50, config.selfQueryModel);
|
|
6562
6618
|
if (result.processed > 0) {
|
|
6563
6619
|
acted("graph_extraction");
|
|
@@ -6854,7 +6910,7 @@ async function refreshAgentData() {
|
|
|
6854
6910
|
let spend30d = new Map(_cachedAgentData?.spend30d ?? []);
|
|
6855
6911
|
try {
|
|
6856
6912
|
const { getAgentSpend } = await import("./token-spend.js");
|
|
6857
|
-
const { runBudgetedSweep } = await import("../sweep-budget-
|
|
6913
|
+
const { runBudgetedSweep } = await import("../sweep-budget-YGLCNXZZ.js");
|
|
6858
6914
|
let r24 = [];
|
|
6859
6915
|
const windows = [
|
|
6860
6916
|
async () => {
|
|
@@ -6878,7 +6934,7 @@ async function refreshAgentData() {
|
|
|
6878
6934
|
const decision = evaluateSpendCapAlert(_lastSpendCapLevel, capStatus);
|
|
6879
6935
|
_lastSpendCapLevel = decision.level;
|
|
6880
6936
|
if (decision.shouldAlert && decision.summary) {
|
|
6881
|
-
const { writeNotification } = await import("../notifications-
|
|
6937
|
+
const { writeNotification } = await import("../notifications-LGYY22W5.js");
|
|
6882
6938
|
await writeNotification({
|
|
6883
6939
|
agentId: "system",
|
|
6884
6940
|
agentRole: "system",
|
|
@@ -7000,14 +7056,14 @@ function startReflectionSweep() {
|
|
|
7000
7056
|
);
|
|
7001
7057
|
let runReflection;
|
|
7002
7058
|
try {
|
|
7003
|
-
({ runReflection } = await import("../memory-reflection-
|
|
7059
|
+
({ runReflection } = await import("../memory-reflection-ZYJUOSFX.js"));
|
|
7004
7060
|
} catch (importErr) {
|
|
7005
7061
|
_reflectionImportFailed = true;
|
|
7006
7062
|
process.stderr.write(`[exed] Reflection module unavailable (stale chunk hash?) \u2014 disabled until daemon restart: ${importErr instanceof Error ? importErr.message : String(importErr)}
|
|
7007
7063
|
`);
|
|
7008
7064
|
return;
|
|
7009
7065
|
}
|
|
7010
|
-
const { runBudgetedSweep } = await import("../sweep-budget-
|
|
7066
|
+
const { runBudgetedSweep } = await import("../sweep-budget-YGLCNXZZ.js");
|
|
7011
7067
|
let totalInsights = 0;
|
|
7012
7068
|
await runBudgetedSweep(
|
|
7013
7069
|
agents.rows,
|
|
@@ -7041,7 +7097,7 @@ function startReflectionSweep() {
|
|
|
7041
7097
|
if (memories > 100 && cards < memories * 0.1) {
|
|
7042
7098
|
process.stderr.write(`[exed] Memory cards sparse (${cards} cards / ${memories} memories) \u2014 running backfill...
|
|
7043
7099
|
`);
|
|
7044
|
-
const { insertMemoryCardsForBatch } = await import("../memory-cards-
|
|
7100
|
+
const { insertMemoryCardsForBatch } = await import("../memory-cards-VN5DEWPD.js");
|
|
7045
7101
|
const batchSize = 500;
|
|
7046
7102
|
let offset = 0;
|
|
7047
7103
|
let totalCards = 0;
|
|
@@ -7122,7 +7178,7 @@ function startDatabaseBackup() {
|
|
|
7122
7178
|
`
|
|
7123
7179
|
);
|
|
7124
7180
|
try {
|
|
7125
|
-
const { maybeVerifyDailyBackup } = await import("../backup-verify-
|
|
7181
|
+
const { maybeVerifyDailyBackup } = await import("../backup-verify-LWHKGOOV.js");
|
|
7126
7182
|
const verdict = await maybeVerifyDailyBackup(backupPath);
|
|
7127
7183
|
if (verdict && !verdict.ok) {
|
|
7128
7184
|
process.stderr.write(
|
|
@@ -7198,7 +7254,7 @@ function startSessionEventsRetention() {
|
|
|
7198
7254
|
fired("session_events_retention");
|
|
7199
7255
|
if (!await ensureStoreForPolling()) return;
|
|
7200
7256
|
try {
|
|
7201
|
-
const { DEFAULT_SESSION_EVENTS_RETENTION_DAYS, sessionEventsRetentionMode } = await import("../session-events-
|
|
7257
|
+
const { DEFAULT_SESSION_EVENTS_RETENTION_DAYS, sessionEventsRetentionMode } = await import("../session-events-P6E2373E.js");
|
|
7202
7258
|
const days = SESSION_EVENTS_RETENTION_DAYS ?? DEFAULT_SESSION_EVENTS_RETENTION_DAYS;
|
|
7203
7259
|
const decision = sessionEventsRetentionMode(isWriteWorkerEnabled(), isDbWriteWorkerReady());
|
|
7204
7260
|
if (decision.mode === "skip") {
|
|
@@ -7249,7 +7305,7 @@ function startConversationsRetention() {
|
|
|
7249
7305
|
if (!await ensureStoreForPolling()) return;
|
|
7250
7306
|
try {
|
|
7251
7307
|
const { DEFAULT_CONVERSATIONS_RETENTION_DAYS } = await import("../conversations-retention-C4BLKFEL.js");
|
|
7252
|
-
const { sessionEventsRetentionMode } = await import("../session-events-
|
|
7308
|
+
const { sessionEventsRetentionMode } = await import("../session-events-P6E2373E.js");
|
|
7253
7309
|
const days = CONVERSATIONS_RETENTION_DAYS ?? DEFAULT_CONVERSATIONS_RETENTION_DAYS;
|
|
7254
7310
|
const decision = sessionEventsRetentionMode(isWriteWorkerEnabled(), isDbWriteWorkerReady());
|
|
7255
7311
|
if (decision.mode === "skip") {
|
|
@@ -7297,7 +7353,7 @@ function startIntercomQueueDrain() {
|
|
|
7297
7353
|
const tick = async () => traceDaemonTimer("intercom_queue_drain", async () => {
|
|
7298
7354
|
fired("intercom_queue_drain");
|
|
7299
7355
|
try {
|
|
7300
|
-
const { drainQueueAsync, readQueue } = await import("../intercom-queue-
|
|
7356
|
+
const { drainQueueAsync, readQueue } = await import("../intercom-queue-MKDWAEUV.js");
|
|
7301
7357
|
const {
|
|
7302
7358
|
sendIntercomAsync: centralSendIntercomAsync,
|
|
7303
7359
|
countScopedPendingReviews,
|
|
@@ -7429,7 +7485,7 @@ function startLedgerDrain() {
|
|
|
7429
7485
|
const tick = async () => traceDaemonTimer("ledger_drain", async () => {
|
|
7430
7486
|
fired("ledger_drain");
|
|
7431
7487
|
try {
|
|
7432
|
-
const { isLedgerEnabled, drainLedger } = await import("../notification-ledger-
|
|
7488
|
+
const { isLedgerEnabled, drainLedger } = await import("../notification-ledger-TG6EFYBP.js");
|
|
7433
7489
|
if (!isLedgerEnabled()) return;
|
|
7434
7490
|
const result = await drainLedger({
|
|
7435
7491
|
// Shadow "would-deliver": idle target = would-deliver, busy = retry.
|
|
@@ -7467,8 +7523,9 @@ var ORPHAN_REAP_INTERVAL_MS = 5 * 60 * 1e3;
|
|
|
7467
7523
|
function startOrphanReaper() {
|
|
7468
7524
|
const tick = async () => traceDaemonTimer("orphan_reaper", async () => {
|
|
7469
7525
|
fired("orphan_reaper");
|
|
7526
|
+
if (sweepStarved("orphan_reaper")) return;
|
|
7470
7527
|
try {
|
|
7471
|
-
const { reapOrphanedMcpProcesses, createOrphanReaperRealDepsAsync } = await import("../daemon-orchestration-
|
|
7528
|
+
const { reapOrphanedMcpProcesses, createOrphanReaperRealDepsAsync } = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
7472
7529
|
const deps = await createOrphanReaperRealDepsAsync();
|
|
7473
7530
|
const reaped = await reapOrphanedMcpProcesses(deps);
|
|
7474
7531
|
if (reaped.length > 0) acted("orphan_reaper");
|
|
@@ -7492,8 +7549,9 @@ var ZOMBIE_AGENT_REAP_INTERVAL_MS = 5 * 60 * 1e3;
|
|
|
7492
7549
|
function startZombieAgentReaper() {
|
|
7493
7550
|
const tick = async () => traceDaemonTimer("zombie_agent_reaper", async () => {
|
|
7494
7551
|
fired("zombie_agent_reaper");
|
|
7552
|
+
if (sweepStarved("zombie_agent_reaper")) return;
|
|
7495
7553
|
try {
|
|
7496
|
-
const { reapZombieAgentProcesses, createZombieAgentReaperRealDepsAsync } = await import("../daemon-orchestration-
|
|
7554
|
+
const { reapZombieAgentProcesses, createZombieAgentReaperRealDepsAsync } = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
7497
7555
|
const deps = await createZombieAgentReaperRealDepsAsync();
|
|
7498
7556
|
const reaped = reapZombieAgentProcesses(deps);
|
|
7499
7557
|
if (reaped.length > 0) acted("zombie_agent_reaper");
|
|
@@ -7517,7 +7575,7 @@ async function startDaemonMemoryPressureWatchdog() {
|
|
|
7517
7575
|
try {
|
|
7518
7576
|
const cfg = await getCachedConfig();
|
|
7519
7577
|
if (!cfg) return;
|
|
7520
|
-
const { startMemoryPressureWatchdog: startWatchdog, MEMORY_PRESSURE_WATCHDOG_DEFAULTS } = await import("../memory-pressure-watchdog-
|
|
7578
|
+
const { startMemoryPressureWatchdog: startWatchdog, MEMORY_PRESSURE_WATCHDOG_DEFAULTS } = await import("../memory-pressure-watchdog-J6Q3SIBL.js");
|
|
7521
7579
|
const watchdogCfg = {
|
|
7522
7580
|
...MEMORY_PRESSURE_WATCHDOG_DEFAULTS,
|
|
7523
7581
|
...cfg.memoryPressureWatchdog ?? {}
|
|
@@ -7549,7 +7607,7 @@ function startWorktreeReaper() {
|
|
|
7549
7607
|
fired("worktree_reaper");
|
|
7550
7608
|
if (sweepStarved("worktree_reaper")) return;
|
|
7551
7609
|
try {
|
|
7552
|
-
const { reapOrphanedWorktrees, createWorktreeReaperRealDeps } = await import("../daemon-orchestration-
|
|
7610
|
+
const { reapOrphanedWorktrees, createWorktreeReaperRealDeps } = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
7553
7611
|
const deps = await createWorktreeReaperRealDeps();
|
|
7554
7612
|
const result = await reapOrphanedWorktrees(deps);
|
|
7555
7613
|
if (result.pruned.length > 0) {
|
|
@@ -7575,7 +7633,7 @@ function startWorktreeReaper() {
|
|
|
7575
7633
|
}
|
|
7576
7634
|
{
|
|
7577
7635
|
const files = (await readdir(signalDir)).filter((f) => f.endsWith(".json"));
|
|
7578
|
-
const { runBudgetedSweep } = await import("../sweep-budget-
|
|
7636
|
+
const { runBudgetedSweep } = await import("../sweep-budget-YGLCNXZZ.js");
|
|
7579
7637
|
await runBudgetedSweep(files, async (file) => {
|
|
7580
7638
|
try {
|
|
7581
7639
|
const fullPath = path4.join(signalDir, file);
|
|
@@ -7593,8 +7651,8 @@ function startWorktreeReaper() {
|
|
|
7593
7651
|
}
|
|
7594
7652
|
return;
|
|
7595
7653
|
}
|
|
7596
|
-
const { cleanupAgentWorktree } = await import("../worktree-sweep-
|
|
7597
|
-
const { getMainRepoRootAsync } = await import("../worktree-
|
|
7654
|
+
const { cleanupAgentWorktree } = await import("../worktree-sweep-EV5YQ2OB.js");
|
|
7655
|
+
const { getMainRepoRootAsync } = await import("../worktree-Q25PZST6.js");
|
|
7598
7656
|
const repoRoot = await getMainRepoRootAsync(signal.worktreePath);
|
|
7599
7657
|
if (repoRoot && signal.agentId) {
|
|
7600
7658
|
const notes = await cleanupAgentWorktree(repoRoot, signal.agentId);
|
|
@@ -7631,7 +7689,7 @@ function startAutoWake() {
|
|
|
7631
7689
|
if (!await ensureStoreForPolling()) return;
|
|
7632
7690
|
try {
|
|
7633
7691
|
const { getClient } = await import("./database.js");
|
|
7634
|
-
const { pollOrphanedTasks, createAutoWakeRealDeps } = await import("../daemon-orchestration-
|
|
7692
|
+
const { pollOrphanedTasks, createAutoWakeRealDeps } = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
7635
7693
|
const deps = createAutoWakeRealDeps(getClient, process.cwd(), getTmuxSessionsAsync);
|
|
7636
7694
|
const woken = await pollOrphanedTasks(deps);
|
|
7637
7695
|
if (woken.length > 0) acted("auto_wake");
|
|
@@ -7649,7 +7707,7 @@ function startAutoWake() {
|
|
|
7649
7707
|
}
|
|
7650
7708
|
{
|
|
7651
7709
|
const { sendIntercomAsync, extractRootExe } = await import("./tmux-routing.js");
|
|
7652
|
-
const { runBudgetedSweep } = await import("../sweep-budget-
|
|
7710
|
+
const { runBudgetedSweep } = await import("../sweep-budget-YGLCNXZZ.js");
|
|
7653
7711
|
const sessionCache = path4.join(os4.homedir(), ".exe-os", "session-cache");
|
|
7654
7712
|
const sessions = await getTmuxSessionsAsync();
|
|
7655
7713
|
const signalDirs = [];
|
|
@@ -7706,7 +7764,7 @@ function startAutoWake() {
|
|
|
7706
7764
|
if (age > 60 * 60 * 1e3) {
|
|
7707
7765
|
try {
|
|
7708
7766
|
await unlink(signalPath);
|
|
7709
|
-
void import("../orchestration-events-
|
|
7767
|
+
void import("../orchestration-events-JPHB6NPY.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
|
|
7710
7768
|
recordOE({ eventType: "signal.stale", source: "exe-daemon.autoWake", severity: "warn", payload: { file, ageMinutes: Math.round(age / 6e4) } });
|
|
7711
7769
|
}).catch(() => {
|
|
7712
7770
|
});
|
|
@@ -7855,8 +7913,8 @@ function startStuckTaskRelease() {
|
|
|
7855
7913
|
createStaleClaimRealDeps,
|
|
7856
7914
|
escalateStuckBlockedTasks,
|
|
7857
7915
|
createStuckBlockedRealDeps
|
|
7858
|
-
} = await import("../daemon-orchestration-
|
|
7859
|
-
const { runBudgetedSweep } = await import("../sweep-budget-
|
|
7916
|
+
} = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
7917
|
+
const { runBudgetedSweep } = await import("../sweep-budget-YGLCNXZZ.js");
|
|
7860
7918
|
const steps = [
|
|
7861
7919
|
async () => {
|
|
7862
7920
|
const deps = createStuckTaskRealDeps(getClient);
|
|
@@ -8120,12 +8178,12 @@ function startTaskEnforcementScanner() {
|
|
|
8120
8178
|
const tick = async () => traceDaemonTimer("task_enforcement", async () => {
|
|
8121
8179
|
fired("task_enforcement");
|
|
8122
8180
|
try {
|
|
8123
|
-
const { runTaskEnforcementTick } = await import("../task-enforcement-
|
|
8181
|
+
const { runTaskEnforcementTick } = await import("../task-enforcement-2GR7HU6V.js");
|
|
8124
8182
|
const { getTransport } = await import("./transport.js");
|
|
8125
8183
|
const { loadAgentConfig } = await import("./agent-config.js");
|
|
8126
8184
|
const { getClient } = await import("./database.js");
|
|
8127
8185
|
const { loadEmployeesSync } = await import("./employees.js");
|
|
8128
|
-
const { sessionScopeFilter } = await import("../task-scope-
|
|
8186
|
+
const { sessionScopeFilter } = await import("../task-scope-QANJJXXB.js");
|
|
8129
8187
|
const transport = getTransport();
|
|
8130
8188
|
const { sessions: allSessions, paneCache, aliveSessions } = await getSharedOrchestrationCaches();
|
|
8131
8189
|
await yieldToEventLoop();
|
|
@@ -8136,10 +8194,10 @@ function startTaskEnforcementScanner() {
|
|
|
8136
8194
|
sendKeysLiteral: transport.sendKeysLiteral?.bind(transport),
|
|
8137
8195
|
isAlive: (session) => aliveSessions.has(session)
|
|
8138
8196
|
};
|
|
8139
|
-
const { checkAutoWakeGates } = await import("../daemon-orchestration-
|
|
8197
|
+
const { checkAutoWakeGates } = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
8140
8198
|
const { ensureEmployeeAsync, employeeSessionName, sendIntercomAsync } = await import("./tmux-routing.js");
|
|
8141
8199
|
const { shouldAutoInstance } = await import("./employees.js");
|
|
8142
|
-
const { recordOrchestrationEventBestEffort } = await import("../orchestration-events-
|
|
8200
|
+
const { recordOrchestrationEventBestEffort } = await import("../orchestration-events-JPHB6NPY.js");
|
|
8143
8201
|
const projectDir = process.cwd();
|
|
8144
8202
|
await runTaskEnforcementTick({
|
|
8145
8203
|
transport: enforcementTransport,
|
|
@@ -8465,7 +8523,7 @@ async function sweepExpiredTracesFromDaemonTimer() {
|
|
|
8465
8523
|
const memoryIds = idsResult.rows.map((r) => String(r.id)).filter(Boolean);
|
|
8466
8524
|
if (memoryIds.length === 0) return 0;
|
|
8467
8525
|
const { getClient } = await import("./database.js");
|
|
8468
|
-
const { cleanupGraphLinksForMemories, cleanupCardsForMemories } = await import("../graph-rag-
|
|
8526
|
+
const { cleanupGraphLinksForMemories, cleanupCardsForMemories } = await import("../graph-rag-JA7XN7NO.js");
|
|
8469
8527
|
const client = getClient();
|
|
8470
8528
|
await cleanupGraphLinksForMemories(client, memoryIds);
|
|
8471
8529
|
await cleanupCardsForMemories(client, memoryIds);
|
|
@@ -8662,6 +8720,7 @@ function startBugAutoFix() {
|
|
|
8662
8720
|
sql: `SELECT id, title, priority, assigned_to, status FROM tasks
|
|
8663
8721
|
WHERE priority IN ('p0', 'p1')
|
|
8664
8722
|
AND status = 'open'
|
|
8723
|
+
AND execution_mode = 'durable_tmux'
|
|
8665
8724
|
AND assigned_to IS NULL
|
|
8666
8725
|
AND (title LIKE '%bug%' OR title LIKE '%fix%' OR title LIKE '%CRITICAL%' OR title LIKE '%security%')
|
|
8667
8726
|
ORDER BY priority ASC, created_at ASC
|
|
@@ -9187,7 +9246,7 @@ function startEventLoopLagDetector() {
|
|
|
9187
9246
|
const msg = `[exed] EVENT LOOP BLOCKED ${(lag / 1e3).toFixed(1)}s \u2014 MCP UNRESPONSIVE. Sessions will die.`;
|
|
9188
9247
|
process.stderr.write(msg + "\n");
|
|
9189
9248
|
logDaemonHealth({ event: "event_loop_blocked", pid: process.pid, message: msg, data: { lagMs: lag } });
|
|
9190
|
-
void import("../orchestration-events-
|
|
9249
|
+
void import("../orchestration-events-JPHB6NPY.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
|
|
9191
9250
|
recordOE({ eventType: "daemon.event_loop_blocked", source: "exe-daemon.lagDetector", severity: "error", durationMs: lag });
|
|
9192
9251
|
}).catch(() => {
|
|
9193
9252
|
});
|
|
@@ -9251,6 +9310,13 @@ function startEventLoopLagDetector() {
|
|
|
9251
9310
|
message: `CPU starved (load=${load1m.toFixed(2)} maxOverWindow=${maxLoad1mOverWindow.toFixed(2)} / cpus=${cpuCount}) \u2014 restart skipped`,
|
|
9252
9311
|
data: { lagMs: lag, load1m, maxLoad1mOverWindow, cpuCount }
|
|
9253
9312
|
});
|
|
9313
|
+
try {
|
|
9314
|
+
const markerPath = starvationSuppressedMarkerPath();
|
|
9315
|
+
mkdirSync5(path4.dirname(markerPath), { recursive: true });
|
|
9316
|
+
writeFileSync5(markerPath, `starved_backoff lag=${Math.round(lag)}ms load=${load1m.toFixed(2)} cpus=${cpuCount} at ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
9317
|
+
`);
|
|
9318
|
+
} catch {
|
|
9319
|
+
}
|
|
9254
9320
|
return;
|
|
9255
9321
|
}
|
|
9256
9322
|
if (decision.reason === "catchup_backoff") {
|
|
@@ -9336,7 +9402,7 @@ function startTaskFileResync() {
|
|
|
9336
9402
|
if (!await ensureStoreForPolling()) return;
|
|
9337
9403
|
const { readdir: readdir2, readFile: readFile2 } = await import("fs/promises");
|
|
9338
9404
|
const { getClient } = await import("./database.js");
|
|
9339
|
-
const { runBudgetedSweep } = await import("../sweep-budget-
|
|
9405
|
+
const { runBudgetedSweep } = await import("../sweep-budget-YGLCNXZZ.js");
|
|
9340
9406
|
const client = getClient();
|
|
9341
9407
|
const tasksRoot = path4.join(os4.homedir(), ".exe-os", "tasks");
|
|
9342
9408
|
let synced = 0;
|
|
@@ -9381,7 +9447,7 @@ function startTaskFileResync() {
|
|
|
9381
9447
|
});
|
|
9382
9448
|
if (Number(res.rowsAffected ?? 0) > 0) {
|
|
9383
9449
|
synced++;
|
|
9384
|
-
void import("../orchestration-events-
|
|
9450
|
+
void import("../orchestration-events-JPHB6NPY.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
|
|
9385
9451
|
recordOE({
|
|
9386
9452
|
eventType: "task_file.resynced",
|
|
9387
9453
|
source: "exe-daemon.taskFileResync",
|
|
@@ -9415,7 +9481,7 @@ function startTaskGroupBarriers() {
|
|
|
9415
9481
|
fired("task_group_barriers");
|
|
9416
9482
|
if (!await ensureStoreForPolling()) return;
|
|
9417
9483
|
try {
|
|
9418
|
-
const { pollTaskGroupBarriers } = await import("../daemon-orchestration-
|
|
9484
|
+
const { pollTaskGroupBarriers } = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
9419
9485
|
const firedCount = await pollTaskGroupBarriers();
|
|
9420
9486
|
if (firedCount > 0) {
|
|
9421
9487
|
acted("task_group_barriers");
|
|
@@ -9437,7 +9503,7 @@ function startCheckpointGc() {
|
|
|
9437
9503
|
fired("checkpoint_gc");
|
|
9438
9504
|
if (!await ensureStoreForPolling()) return;
|
|
9439
9505
|
try {
|
|
9440
|
-
const { gcStaleCheckpoints } = await import("../daemon-orchestration-
|
|
9506
|
+
const { gcStaleCheckpoints } = await import("../daemon-orchestration-BWLSJG2X.js");
|
|
9441
9507
|
const cleared = await gcStaleCheckpoints();
|
|
9442
9508
|
if (cleared > 0) {
|
|
9443
9509
|
acted("checkpoint_gc");
|
|
@@ -9477,14 +9543,14 @@ function startDispatchAckCleanup() {
|
|
|
9477
9543
|
function startProjectionWorkerDeferred() {
|
|
9478
9544
|
setTimeout(async () => {
|
|
9479
9545
|
try {
|
|
9480
|
-
const { startProjectionWorker } = await import("../projection-worker-
|
|
9546
|
+
const { startProjectionWorker } = await import("../projection-worker-RNYPE46G.js");
|
|
9481
9547
|
startProjectionWorker();
|
|
9482
9548
|
} catch {
|
|
9483
9549
|
}
|
|
9484
9550
|
}, 2e4);
|
|
9485
9551
|
}
|
|
9486
9552
|
async function startToolTelemetry() {
|
|
9487
|
-
const { startToolTelemetryFlush } = await import("../tool-telemetry-
|
|
9553
|
+
const { startToolTelemetryFlush } = await import("../tool-telemetry-GBDI4AXR.js");
|
|
9488
9554
|
startToolTelemetryFlush();
|
|
9489
9555
|
process.stderr.write("[exed] Tool telemetry started (flush every 5m)\n");
|
|
9490
9556
|
}
|
|
@@ -9654,7 +9720,7 @@ function startLocalFirstTimers() {
|
|
|
9654
9720
|
fired("orphan_task_cleanup");
|
|
9655
9721
|
try {
|
|
9656
9722
|
if (!await ensureStoreForPolling()) return;
|
|
9657
|
-
const { cleanOrphanedTaskFiles } = await import("../tasks-crud-
|
|
9723
|
+
const { cleanOrphanedTaskFiles } = await import("../tasks-crud-45WOIMIM.js");
|
|
9658
9724
|
const count = await cleanOrphanedTaskFiles();
|
|
9659
9725
|
if (count > 0) {
|
|
9660
9726
|
acted("orphan_task_cleanup");
|
|
@@ -9670,7 +9736,7 @@ function startLocalFirstTimers() {
|
|
|
9670
9736
|
fired("task_file_consistency");
|
|
9671
9737
|
try {
|
|
9672
9738
|
if (!await ensureStoreForPolling()) return;
|
|
9673
|
-
const { checkTaskFileConsistency } = await import("../tasks-crud-
|
|
9739
|
+
const { checkTaskFileConsistency } = await import("../tasks-crud-45WOIMIM.js");
|
|
9674
9740
|
const mismatches = await checkTaskFileConsistency();
|
|
9675
9741
|
if (mismatches > 0) {
|
|
9676
9742
|
acted("task_file_consistency");
|
|
@@ -9689,7 +9755,7 @@ function startLocalFirstTimers() {
|
|
|
9689
9755
|
const TELEMETRY_DAILY_MS = 24 * 60 * 60 * 1e3;
|
|
9690
9756
|
const telemetryDaily = async () => {
|
|
9691
9757
|
try {
|
|
9692
|
-
const { sendTelemetry, isTelemetryEnabled } = await import("../telemetry-upload-
|
|
9758
|
+
const { sendTelemetry, isTelemetryEnabled } = await import("../telemetry-upload-VY3UWAEL.js");
|
|
9693
9759
|
if (!isTelemetryEnabled()) return;
|
|
9694
9760
|
const { upstream } = await sendTelemetry(24);
|
|
9695
9761
|
if (upstream.startsWith("sent")) {
|
|
@@ -9882,7 +9948,11 @@ try {
|
|
|
9882
9948
|
} catch {
|
|
9883
9949
|
coverageGap = void 0;
|
|
9884
9950
|
}
|
|
9885
|
-
const
|
|
9951
|
+
const priorRestartIntent = consumeRestartIntentDetail({
|
|
9952
|
+
pid: process.pid,
|
|
9953
|
+
startedAt: ownProcessStartedAt()
|
|
9954
|
+
});
|
|
9955
|
+
const breaker = recordDaemonRestart(void 0, coverageGap, priorRestartIntent);
|
|
9886
9956
|
process.stderr.write(
|
|
9887
9957
|
`[exed] Boot classified as ${breaker.bootClass} (${breaker.reasonLabel}); crashes=${breaker.crashInWindow}/${RESTART_BREAKER_THRESHOLD}, restarts=${breaker.restartsInWindow} in window.
|
|
9888
9958
|
`
|
|
@@ -9928,7 +9998,7 @@ try {
|
|
|
9928
9998
|
});
|
|
9929
9999
|
}
|
|
9930
10000
|
try {
|
|
9931
|
-
const { initOrgPartnerRuntime } = await import("../org-partner-runtime-
|
|
10001
|
+
const { initOrgPartnerRuntime } = await import("../org-partner-runtime-L7L2WWGN.js");
|
|
9932
10002
|
await initOrgPartnerRuntime();
|
|
9933
10003
|
} catch (err) {
|
|
9934
10004
|
process.stderr.write(
|
|
@@ -9977,6 +10047,7 @@ try {
|
|
|
9977
10047
|
process.exit(1);
|
|
9978
10048
|
}
|
|
9979
10049
|
export {
|
|
10050
|
+
creditedOutsideParkLagMs,
|
|
9980
10051
|
decidePortHolderAction,
|
|
9981
10052
|
getLastBlockingTimer,
|
|
9982
10053
|
injectRegisterAllTools,
|