@askexenow/exe-os 0.9.374 → 0.9.376
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 +59 -63
- 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 +5 -5
- 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
|
@@ -1,19 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
persistSupportArtifact
|
|
3
|
+
} from "./chunk-KO3OHI6V.js";
|
|
1
4
|
import {
|
|
2
5
|
exportOrchestration,
|
|
3
6
|
importOrchestration,
|
|
4
7
|
validatePackage
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LNAFLXL7.js";
|
|
6
9
|
import {
|
|
7
10
|
runDriftProbes
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
persistSupportArtifact
|
|
11
|
-
} from "./chunk-U6SUKSZR.js";
|
|
12
|
-
import {
|
|
13
|
-
queueSupportStatusUpdateSync
|
|
14
|
-
} from "./chunk-GSJLB6JI.js";
|
|
11
|
+
} from "./chunk-LM443ORV.js";
|
|
15
12
|
import {
|
|
16
13
|
assertVerdictAttribution,
|
|
14
|
+
isVerifiedStatus,
|
|
17
15
|
parseDeliveryProof,
|
|
18
16
|
registerAddBugReportComment,
|
|
19
17
|
registerGetBugReport,
|
|
@@ -29,14 +27,20 @@ import {
|
|
|
29
27
|
resolveAttribution,
|
|
30
28
|
resolveVerificationArtifact,
|
|
31
29
|
verificationArtifactInputSchema
|
|
32
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-BNWWVYRN.js";
|
|
33
31
|
import {
|
|
34
32
|
supportCommitSchema,
|
|
35
33
|
supportIdSchema,
|
|
36
34
|
supportProductSchema,
|
|
37
35
|
supportTaskIdSchema,
|
|
38
36
|
supportVersionSchema
|
|
39
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-UWX6MMCX.js";
|
|
38
|
+
import {
|
|
39
|
+
queueSupportStatusUpdateSync
|
|
40
|
+
} from "./chunk-7THUQU44.js";
|
|
41
|
+
import {
|
|
42
|
+
promotedRulesDropped
|
|
43
|
+
} from "./chunk-YLHACCCB.js";
|
|
40
44
|
import {
|
|
41
45
|
DEFAULT_LIST_LIMIT,
|
|
42
46
|
MAX_IMPORTANCE,
|
|
@@ -45,7 +49,11 @@ import {
|
|
|
45
49
|
ingestDocument,
|
|
46
50
|
listDocumentsByWorkspace,
|
|
47
51
|
updateChunksImportance
|
|
48
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-YAACLBZ7.js";
|
|
53
|
+
import {
|
|
54
|
+
isRerankerAvailable,
|
|
55
|
+
rerankWithScores
|
|
56
|
+
} from "./chunk-KM7DAG5J.js";
|
|
49
57
|
import {
|
|
50
58
|
CLAIM_TTL_MINUTES,
|
|
51
59
|
acquireClaim,
|
|
@@ -56,47 +64,25 @@ import {
|
|
|
56
64
|
normalizeTarget,
|
|
57
65
|
releaseClaim,
|
|
58
66
|
resolveHolderSession
|
|
59
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-MFASHRJ6.js";
|
|
60
68
|
import {
|
|
61
69
|
StewardGate
|
|
62
|
-
} from "./chunk-
|
|
63
|
-
import {
|
|
64
|
-
DreamingEngine
|
|
65
|
-
} from "./chunk-UM3N6VND.js";
|
|
66
|
-
import {
|
|
67
|
-
isRerankerAvailable,
|
|
68
|
-
rerankWithScores
|
|
69
|
-
} from "./chunk-2AJGV5UL.js";
|
|
70
|
-
import {
|
|
71
|
-
getEntityByName,
|
|
72
|
-
getEntityNeighbors,
|
|
73
|
-
getGraphStats,
|
|
74
|
-
getHotEntities,
|
|
75
|
-
getRelationships,
|
|
76
|
-
searchEntities
|
|
77
|
-
} from "./chunk-CRCB5S7I.js";
|
|
70
|
+
} from "./chunk-IZLML47J.js";
|
|
78
71
|
import {
|
|
79
72
|
listRecentSessionEvents
|
|
80
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-ND75TGPR.js";
|
|
74
|
+
import {
|
|
75
|
+
DreamingEngine
|
|
76
|
+
} from "./chunk-PFAVHC5N.js";
|
|
81
77
|
import {
|
|
82
78
|
AUTO_WAKE_MAX_RETRIES
|
|
83
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-DDMGQ5Q3.js";
|
|
84
80
|
import {
|
|
85
81
|
DEFAULT_EXPLORE_DURATION_MS,
|
|
86
82
|
getPlayMode,
|
|
87
83
|
listExploreSessions,
|
|
88
84
|
setPlayMode
|
|
89
|
-
} from "./chunk-
|
|
90
|
-
import {
|
|
91
|
-
getToolUsageStats
|
|
92
|
-
} from "./chunk-6WIFPD2P.js";
|
|
93
|
-
import {
|
|
94
|
-
getToolCapabilityIndex
|
|
95
|
-
} from "./chunk-YO4BO2CL.js";
|
|
96
|
-
import {
|
|
97
|
-
isToolAllowed,
|
|
98
|
-
isToolAllowedForPlan
|
|
99
|
-
} from "./chunk-GLQEJOXE.js";
|
|
85
|
+
} from "./chunk-MAXD5JQL.js";
|
|
100
86
|
import {
|
|
101
87
|
analyzeBlastRadius,
|
|
102
88
|
buildCodeContextIndexAsync,
|
|
@@ -106,43 +92,48 @@ import {
|
|
|
106
92
|
searchCodeContext,
|
|
107
93
|
searchCodeContextSemantic,
|
|
108
94
|
traceCodeSymbol
|
|
109
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-IPHLUZ37.js";
|
|
110
96
|
import {
|
|
111
97
|
getCachedLicenseGate,
|
|
112
98
|
refreshLicenseGate
|
|
113
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-MSLWRWTI.js";
|
|
114
100
|
import {
|
|
115
|
-
|
|
116
|
-
} from "./chunk-
|
|
101
|
+
getToolUsageStats
|
|
102
|
+
} from "./chunk-YZ4AEMR7.js";
|
|
117
103
|
import {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
104
|
+
getToolCapabilityIndex
|
|
105
|
+
} from "./chunk-QIEYJ4KZ.js";
|
|
106
|
+
import {
|
|
107
|
+
isToolAllowed,
|
|
108
|
+
isToolAllowedForPlan
|
|
109
|
+
} from "./chunk-GLQEJOXE.js";
|
|
122
110
|
import {
|
|
123
111
|
assertOrgPartnerRuntimeReady,
|
|
124
112
|
orgPartnerRuntimeStatus
|
|
125
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-JVWLHBAV.js";
|
|
126
114
|
import {
|
|
127
115
|
getMailboxInboxState
|
|
128
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-XTQ7R2PA.js";
|
|
129
117
|
import {
|
|
130
118
|
draftOrgUpBrief,
|
|
131
119
|
listOpenDrafts,
|
|
132
120
|
listSentBriefs,
|
|
133
121
|
reviewOpenDraft,
|
|
134
122
|
sendOpenDraft
|
|
135
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-YP6UGVEY.js";
|
|
124
|
+
import {
|
|
125
|
+
createOrg
|
|
126
|
+
} from "./chunk-IKXH4BFC.js";
|
|
127
|
+
import {
|
|
128
|
+
InviteError,
|
|
129
|
+
completeOrgJoin,
|
|
130
|
+
fetchInviteOffer
|
|
131
|
+
} from "./chunk-YZPEQW7H.js";
|
|
136
132
|
import {
|
|
137
133
|
requireOrgPartnerBinding,
|
|
138
134
|
resolveOrgPartnerBindings,
|
|
139
135
|
resolvePartnerIdentities
|
|
140
136
|
} from "./chunk-4YLBKEL5.js";
|
|
141
|
-
import {
|
|
142
|
-
ORG_KEY_FP_DISPLAY_LEN,
|
|
143
|
-
orgKeyPinConfirmation,
|
|
144
|
-
readOrgKeyPin
|
|
145
|
-
} from "./chunk-UBMZ3YQU.js";
|
|
146
137
|
import {
|
|
147
138
|
memberJoinBenefitText,
|
|
148
139
|
seatBenefit
|
|
@@ -151,9 +142,22 @@ import {
|
|
|
151
142
|
loadOrchestrationPhase,
|
|
152
143
|
setOrchestrationPhase
|
|
153
144
|
} from "./chunk-UZDF6FLJ.js";
|
|
145
|
+
import {
|
|
146
|
+
ORG_KEY_FP_DISPLAY_LEN,
|
|
147
|
+
orgKeyPinConfirmation,
|
|
148
|
+
readOrgKeyPin
|
|
149
|
+
} from "./chunk-UBMZ3YQU.js";
|
|
150
|
+
import {
|
|
151
|
+
getEntityByName,
|
|
152
|
+
getEntityNeighbors,
|
|
153
|
+
getGraphStats,
|
|
154
|
+
getHotEntities,
|
|
155
|
+
getRelationships,
|
|
156
|
+
searchEntities
|
|
157
|
+
} from "./chunk-NPXKGBVZ.js";
|
|
154
158
|
import {
|
|
155
159
|
createOrRefreshResumeTask
|
|
156
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-HE34XVD5.js";
|
|
157
161
|
import {
|
|
158
162
|
STRUCTURED_BRIEF_TYPES,
|
|
159
163
|
acceptTaskRequest,
|
|
@@ -166,7 +170,7 @@ import {
|
|
|
166
170
|
listTaskRequests,
|
|
167
171
|
setAutoAcceptPolicy,
|
|
168
172
|
setAutoSendPolicy
|
|
169
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-EHAN752X.js";
|
|
170
174
|
import {
|
|
171
175
|
displayFingerprint
|
|
172
176
|
} from "./chunk-MPVXHYD5.js";
|
|
@@ -174,57 +178,58 @@ import {
|
|
|
174
178
|
getMailboxOutboxStatus,
|
|
175
179
|
listDeliveryReceipts,
|
|
176
180
|
listFailureNotices
|
|
177
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-NY6SBR4O.js";
|
|
182
|
+
import {
|
|
183
|
+
registerDeactivateBehavior
|
|
184
|
+
} from "./chunk-42IFYZUN.js";
|
|
185
|
+
import {
|
|
186
|
+
registerSendMessage,
|
|
187
|
+
resolveMessageTarget
|
|
188
|
+
} from "./chunk-OOZU5H3T.js";
|
|
189
|
+
import {
|
|
190
|
+
registerCreateTask,
|
|
191
|
+
resolveProjectDir
|
|
192
|
+
} from "./chunk-K7UNIEB4.js";
|
|
193
|
+
import {
|
|
194
|
+
registerListTasks
|
|
195
|
+
} from "./chunk-6WKBTZVL.js";
|
|
178
196
|
import {
|
|
179
197
|
registerUpdateTask
|
|
180
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-QFR5EKZG.js";
|
|
181
199
|
import {
|
|
182
200
|
registerCreateReminder
|
|
183
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-FX2QRSRT.js";
|
|
184
202
|
import {
|
|
185
203
|
registerListReminders
|
|
186
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-LK3XQDBP.js";
|
|
187
205
|
import {
|
|
188
206
|
registerCompleteReminder
|
|
189
|
-
} from "./chunk-
|
|
190
|
-
import {
|
|
191
|
-
registerDeactivateBehavior
|
|
192
|
-
} from "./chunk-I4DNJFDR.js";
|
|
207
|
+
} from "./chunk-PEAAX6UA.js";
|
|
193
208
|
import {
|
|
194
209
|
completeReminder,
|
|
195
210
|
createReminder,
|
|
196
211
|
formatAmbiguousReminder,
|
|
197
212
|
listReminders
|
|
198
|
-
} from "./chunk-
|
|
199
|
-
import {
|
|
200
|
-
registerSendMessage
|
|
201
|
-
} from "./chunk-BJ7AVSY6.js";
|
|
202
|
-
import {
|
|
203
|
-
registerCreateTask,
|
|
204
|
-
resolveProjectDir
|
|
205
|
-
} from "./chunk-OVEQE6YS.js";
|
|
206
|
-
import {
|
|
207
|
-
registerListTasks
|
|
208
|
-
} from "./chunk-IRVOXUSK.js";
|
|
213
|
+
} from "./chunk-Q6ZLQMP2.js";
|
|
209
214
|
import {
|
|
210
215
|
registerImportConversations
|
|
211
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-WVBVUVZB.js";
|
|
217
|
+
import {
|
|
218
|
+
status
|
|
219
|
+
} from "./chunk-473JUDCT.js";
|
|
212
220
|
import {
|
|
213
221
|
TOKENS_PER_IDLE_MINUTE,
|
|
214
222
|
countKillsSince,
|
|
215
223
|
sumTokensSavedSince
|
|
216
|
-
} from "./chunk-
|
|
217
|
-
import {
|
|
218
|
-
createSchedule,
|
|
219
|
-
parseHumanCron
|
|
220
|
-
} from "./chunk-DJ7YXOTU.js";
|
|
221
|
-
import {
|
|
222
|
-
status
|
|
223
|
-
} from "./chunk-JHI5WMK5.js";
|
|
224
|
+
} from "./chunk-SVXUT2DN.js";
|
|
224
225
|
import {
|
|
225
226
|
evaluateGlobalSpendCap,
|
|
226
227
|
getAgentSpend
|
|
227
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-GXNBPTPJ.js";
|
|
229
|
+
import {
|
|
230
|
+
createSchedule,
|
|
231
|
+
parseHumanCron
|
|
232
|
+
} from "./chunk-T7EF5CQO.js";
|
|
228
233
|
import {
|
|
229
234
|
exportGraphHTML,
|
|
230
235
|
generateGraphReport
|
|
@@ -232,7 +237,7 @@ import {
|
|
|
232
237
|
import {
|
|
233
238
|
readSupervisionState,
|
|
234
239
|
runHealthCheck
|
|
235
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-4KVSCQND.js";
|
|
236
241
|
import {
|
|
237
242
|
checkCpuStealSync
|
|
238
243
|
} from "./chunk-SSC7EKY2.js";
|
|
@@ -244,16 +249,16 @@ import {
|
|
|
244
249
|
formatReport,
|
|
245
250
|
runAudit,
|
|
246
251
|
shouldFixShards
|
|
247
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-CQFWTWC6.js";
|
|
248
253
|
import {
|
|
249
254
|
formatDegradations,
|
|
250
255
|
getRetrievalHealth
|
|
251
|
-
} from "./chunk-
|
|
256
|
+
} from "./chunk-OQ4FNDRG.js";
|
|
252
257
|
import {
|
|
253
258
|
hasFailures,
|
|
254
259
|
runHealth,
|
|
255
260
|
runTest
|
|
256
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-6F3FQCAQ.js";
|
|
257
262
|
import {
|
|
258
263
|
isSupportReportSentStatus,
|
|
259
264
|
markSupportReportSent
|
|
@@ -264,21 +269,24 @@ import {
|
|
|
264
269
|
} from "./chunk-2XZ6X3PJ.js";
|
|
265
270
|
import {
|
|
266
271
|
renderClientCOOTemplate
|
|
267
|
-
} from "./chunk-
|
|
272
|
+
} from "./chunk-ZS5JO6QV.js";
|
|
268
273
|
import {
|
|
269
274
|
deactivateGlobalProcedure,
|
|
270
275
|
loadGlobalProcedures,
|
|
271
276
|
storeGlobalProcedure
|
|
272
|
-
} from "./chunk-
|
|
277
|
+
} from "./chunk-EPHSISMT.js";
|
|
273
278
|
import {
|
|
274
279
|
PLATFORM_PROCEDURES
|
|
275
|
-
} from "./chunk-
|
|
280
|
+
} from "./chunk-BQEZPRUC.js";
|
|
276
281
|
import {
|
|
282
|
+
beginCloudReupload,
|
|
277
283
|
clearCloudReuploadRequired,
|
|
284
|
+
cloudResetMemoryBlobs,
|
|
278
285
|
cloudSync,
|
|
286
|
+
getCloudReuploadInProgress,
|
|
279
287
|
getCloudReuploadRequired,
|
|
280
|
-
|
|
281
|
-
} from "./chunk-
|
|
288
|
+
markCloudReuploadIncomplete
|
|
289
|
+
} from "./chunk-MGVILAYU.js";
|
|
282
290
|
import {
|
|
283
291
|
orgMembershipPresent,
|
|
284
292
|
readActiveOrgMemberships
|
|
@@ -289,7 +297,7 @@ import {
|
|
|
289
297
|
import {
|
|
290
298
|
findSimilarTrajectories,
|
|
291
299
|
hashSignature
|
|
292
|
-
} from "./chunk-
|
|
300
|
+
} from "./chunk-GOT5ZHPX.js";
|
|
293
301
|
import {
|
|
294
302
|
BEHAVIOR_CONTENT_MAX_LENGTH,
|
|
295
303
|
GHOST_BEHAVIOR_SQL,
|
|
@@ -300,20 +308,20 @@ import {
|
|
|
300
308
|
reactivateBehavior,
|
|
301
309
|
storeBehavior,
|
|
302
310
|
storeReflexBehavior
|
|
303
|
-
} from "./chunk-
|
|
311
|
+
} from "./chunk-6FG34V6D.js";
|
|
304
312
|
import {
|
|
305
313
|
countUnconsolidated,
|
|
306
314
|
groupMemories,
|
|
307
315
|
runConsolidation,
|
|
308
316
|
selectUnconsolidated
|
|
309
|
-
} from "./chunk-
|
|
317
|
+
} from "./chunk-OWVX52XF.js";
|
|
310
318
|
import {
|
|
311
319
|
entityId,
|
|
312
320
|
mergeEntities
|
|
313
|
-
} from "./chunk-
|
|
321
|
+
} from "./chunk-YYC553FO.js";
|
|
314
322
|
import {
|
|
315
323
|
embed
|
|
316
|
-
} from "./chunk-
|
|
324
|
+
} from "./chunk-CKOJP7JI.js";
|
|
317
325
|
import {
|
|
318
326
|
detectDcrIncompatibleConnectorsFromDisk,
|
|
319
327
|
detectExternalMcpFailures,
|
|
@@ -327,7 +335,7 @@ import {
|
|
|
327
335
|
import {
|
|
328
336
|
hybridSearch,
|
|
329
337
|
recentRecords
|
|
330
|
-
} from "./chunk-
|
|
338
|
+
} from "./chunk-HHT527PV.js";
|
|
331
339
|
import {
|
|
332
340
|
buildFtsMatch,
|
|
333
341
|
tokenizeForFts
|
|
@@ -337,21 +345,22 @@ import {
|
|
|
337
345
|
flushBatch,
|
|
338
346
|
initStore,
|
|
339
347
|
writeMemory
|
|
340
|
-
} from "./chunk-
|
|
348
|
+
} from "./chunk-CIEVY5TD.js";
|
|
341
349
|
import {
|
|
342
350
|
updateTask
|
|
343
|
-
} from "./chunk-
|
|
351
|
+
} from "./chunk-4M6RXJEY.js";
|
|
344
352
|
import {
|
|
345
353
|
fastDbInit
|
|
346
|
-
} from "./chunk-
|
|
354
|
+
} from "./chunk-IZA7XW2Q.js";
|
|
347
355
|
import {
|
|
348
356
|
MAX_CONCURRENT_WORKERS
|
|
349
|
-
} from "./chunk-
|
|
357
|
+
} from "./chunk-HIVOLPLD.js";
|
|
350
358
|
import {
|
|
351
359
|
getActiveAgent
|
|
352
|
-
} from "./chunk-
|
|
360
|
+
} from "./chunk-5DF4Y6EC.js";
|
|
353
361
|
import {
|
|
354
362
|
UPSTREAM_ATTACHMENT_MAX_CHARS,
|
|
363
|
+
describeUpstreamFailure,
|
|
355
364
|
isTelemetryRedactionEnabled,
|
|
356
365
|
redactSecrets,
|
|
357
366
|
redactedToolResult,
|
|
@@ -360,25 +369,20 @@ import {
|
|
|
360
369
|
sanitizeUpstreamPayload,
|
|
361
370
|
sanitizeVersionField,
|
|
362
371
|
sanitizedUpstreamBody
|
|
363
|
-
} from "./chunk-
|
|
372
|
+
} from "./chunk-5QCIWWFA.js";
|
|
364
373
|
import {
|
|
365
374
|
getMySession,
|
|
366
|
-
resolveExeSession,
|
|
367
375
|
resolveTask,
|
|
368
376
|
sessionScopeFilter,
|
|
369
377
|
updateTaskStatus,
|
|
370
378
|
writeCheckpoint
|
|
371
|
-
} from "./chunk-
|
|
372
|
-
import {
|
|
373
|
-
isValidSessionScope,
|
|
374
|
-
sanitizeSessionScope
|
|
375
|
-
} from "./chunk-BTSWFMEH.js";
|
|
379
|
+
} from "./chunk-KI7O64XV.js";
|
|
376
380
|
import {
|
|
377
381
|
listSessions
|
|
378
|
-
} from "./chunk-
|
|
382
|
+
} from "./chunk-ZMX22HSS.js";
|
|
379
383
|
import {
|
|
380
384
|
recordOrchestrationEventBestEffort
|
|
381
|
-
} from "./chunk-
|
|
385
|
+
} from "./chunk-3SRZNJKD.js";
|
|
382
386
|
import {
|
|
383
387
|
DEFAULT_MODELS,
|
|
384
388
|
KNOWN_RUNTIMES,
|
|
@@ -392,14 +396,18 @@ import {
|
|
|
392
396
|
assertEmployeeLimit,
|
|
393
397
|
assertFeature,
|
|
394
398
|
assertMemoryLimit
|
|
395
|
-
} from "./chunk-
|
|
399
|
+
} from "./chunk-QR3BUMOS.js";
|
|
396
400
|
import {
|
|
397
401
|
readDaemonToken
|
|
398
|
-
} from "./chunk-
|
|
402
|
+
} from "./chunk-GPUOUUHA.js";
|
|
403
|
+
import {
|
|
404
|
+
isValidSessionScope,
|
|
405
|
+
sanitizeSessionScope
|
|
406
|
+
} from "./chunk-BTSWFMEH.js";
|
|
399
407
|
import {
|
|
400
408
|
getProjectName,
|
|
401
409
|
resolveProjectName
|
|
402
|
-
} from "./chunk-
|
|
410
|
+
} from "./chunk-AEUGIJDO.js";
|
|
403
411
|
import {
|
|
404
412
|
getAgentContext
|
|
405
413
|
} from "./chunk-GJV3WDWM.js";
|
|
@@ -408,18 +416,19 @@ import {
|
|
|
408
416
|
getAccountByName,
|
|
409
417
|
getDefaultAccount
|
|
410
418
|
} from "./chunk-GL57PO3K.js";
|
|
419
|
+
import {
|
|
420
|
+
pushConversationToCRM
|
|
421
|
+
} from "./chunk-ML4S5SHZ.js";
|
|
411
422
|
import {
|
|
412
423
|
createNewTrigger,
|
|
413
424
|
deleteTrigger,
|
|
414
425
|
isScheduledTrigger,
|
|
415
426
|
loadTriggers,
|
|
416
427
|
sanitizeParam
|
|
417
|
-
} from "./chunk-
|
|
418
|
-
import {
|
|
419
|
-
pushConversationToCRM
|
|
420
|
-
} from "./chunk-ML4S5SHZ.js";
|
|
428
|
+
} from "./chunk-K3VDF6II.js";
|
|
421
429
|
import {
|
|
422
430
|
EMPLOYEES_PATH,
|
|
431
|
+
IdentityWriteError,
|
|
423
432
|
addEmployee,
|
|
424
433
|
baseAgentName,
|
|
425
434
|
canCoordinate,
|
|
@@ -434,15 +443,15 @@ import {
|
|
|
434
443
|
loadEmployees,
|
|
435
444
|
loadEmployeesState,
|
|
436
445
|
loadEmployeesSync,
|
|
446
|
+
mutateIdentity,
|
|
437
447
|
repairFtsTable,
|
|
438
|
-
saveEmployees
|
|
439
|
-
|
|
440
|
-
} from "./chunk-TAMDAOCU.js";
|
|
448
|
+
saveEmployees
|
|
449
|
+
} from "./chunk-66CGXQUA.js";
|
|
441
450
|
import {
|
|
442
451
|
getEventLoopLagMs,
|
|
443
452
|
isDaemonAlive,
|
|
444
453
|
isEventLoopDegraded
|
|
445
|
-
} from "./chunk-
|
|
454
|
+
} from "./chunk-CL4J4757.js";
|
|
446
455
|
import {
|
|
447
456
|
DEFAULT_RUNTIME
|
|
448
457
|
} from "./chunk-WNBZJSQT.js";
|
|
@@ -461,7 +470,7 @@ import {
|
|
|
461
470
|
refreshLicense,
|
|
462
471
|
saveLicense,
|
|
463
472
|
validateLicense
|
|
464
|
-
} from "./chunk-
|
|
473
|
+
} from "./chunk-Y2HD2YB7.js";
|
|
465
474
|
import {
|
|
466
475
|
PLAN_LIMITS
|
|
467
476
|
} from "./chunk-A7XLR3K7.js";
|
|
@@ -542,6 +551,47 @@ function formatRetrievalModes() {
|
|
|
542
551
|
|
|
543
552
|
// src/mcp/tools/recall-my-memory.ts
|
|
544
553
|
import { z } from "zod";
|
|
554
|
+
var RAW_FALLBACK_MIN_RELEVANCE = 0.75;
|
|
555
|
+
var RAW_FALLBACK_MIN_IMPROVEMENT = 0.2;
|
|
556
|
+
function fallbackRelevance(query, text5) {
|
|
557
|
+
const queryTerms = tokenizeForFts(query, { maxTerms: 16 });
|
|
558
|
+
if (queryTerms.length === 0) return 0;
|
|
559
|
+
const textTerms = tokenizeForFts(text5, { maxTerms: 2048 });
|
|
560
|
+
const textSet = new Set(textTerms);
|
|
561
|
+
const covered = queryTerms.filter((term) => textSet.has(term)).length;
|
|
562
|
+
const coverage = covered / queryTerms.length;
|
|
563
|
+
let longestOrderedRun = 0;
|
|
564
|
+
for (let textIndex = 0; textIndex < textTerms.length; textIndex++) {
|
|
565
|
+
for (let queryIndex = 0; queryIndex < queryTerms.length; queryIndex++) {
|
|
566
|
+
let run = 0;
|
|
567
|
+
while (textTerms[textIndex + run] !== void 0 && textTerms[textIndex + run] === queryTerms[queryIndex + run]) {
|
|
568
|
+
run++;
|
|
569
|
+
}
|
|
570
|
+
longestOrderedRun = Math.max(longestOrderedRun, run);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
const orderedProximity = longestOrderedRun / queryTerms.length;
|
|
574
|
+
const exact = longestOrderedRun === queryTerms.length ? 1 : 0;
|
|
575
|
+
return coverage * 0.7 + orderedProximity * 0.2 + exact * 0.1;
|
|
576
|
+
}
|
|
577
|
+
function bestFallbackRelevance(query, records) {
|
|
578
|
+
return records.reduce(
|
|
579
|
+
(best, record) => Math.max(best, fallbackRelevance(query, record.raw_text)),
|
|
580
|
+
0
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
function isRawRecord(record) {
|
|
584
|
+
return record.memory_type == null || record.memory_type === "raw";
|
|
585
|
+
}
|
|
586
|
+
function chooseRawFallbackResults(query, curated, rawInclusive) {
|
|
587
|
+
if (curated.length === 0) return rawInclusive;
|
|
588
|
+
const curatedScore = bestFallbackRelevance(query, curated);
|
|
589
|
+
const rawScore = bestFallbackRelevance(query, rawInclusive.filter(isRawRecord));
|
|
590
|
+
if (rawScore >= RAW_FALLBACK_MIN_RELEVANCE && rawScore >= curatedScore + RAW_FALLBACK_MIN_IMPROVEMENT) {
|
|
591
|
+
return rawInclusive;
|
|
592
|
+
}
|
|
593
|
+
return curated;
|
|
594
|
+
}
|
|
545
595
|
function formatMemoryBody(rawText, maxChars, memoryId) {
|
|
546
596
|
if (rawText.length <= maxChars) return rawText;
|
|
547
597
|
const idHint = memoryId ? `get_memory_by_id(id='${memoryId}')` : "get_memory_by_id";
|
|
@@ -615,7 +665,7 @@ function registerRecallMyMemory(server) {
|
|
|
615
665
|
include_source: z.boolean().optional().default(false).describe(
|
|
616
666
|
"When true, attach parent document metadata (filename, mime, source_type) to each result. Default false."
|
|
617
667
|
),
|
|
618
|
-
retrieval_mode: z.enum(RETRIEVAL_MODES).optional().
|
|
668
|
+
retrieval_mode: z.enum(RETRIEVAL_MODES).optional().describe(`Typed retrieval mode. ${formatRetrievalModes()}`),
|
|
619
669
|
kind: z.string().optional().describe(
|
|
620
670
|
"Filter by memory_type: decision, procedure, observation, raw, conversation, behavior."
|
|
621
671
|
),
|
|
@@ -648,7 +698,7 @@ function registerRecallMyMemory(server) {
|
|
|
648
698
|
}) => {
|
|
649
699
|
try {
|
|
650
700
|
{
|
|
651
|
-
const { ensureReadDbReady } = await import("./fast-db-init-
|
|
701
|
+
const { ensureReadDbReady } = await import("./fast-db-init-GWUZ746B.js");
|
|
652
702
|
if (!await ensureReadDbReady()) {
|
|
653
703
|
return {
|
|
654
704
|
content: [{ type: "text", text: "No matching memories found." }]
|
|
@@ -662,7 +712,8 @@ function registerRecallMyMemory(server) {
|
|
|
662
712
|
};
|
|
663
713
|
}
|
|
664
714
|
const { agentId } = getActiveAgent();
|
|
665
|
-
const
|
|
715
|
+
const wasRetrievalModeDefaulted = retrieval_mode === void 0;
|
|
716
|
+
const recentRetrievalMode = recent ? "all" : retrieval_mode ?? "no_raw";
|
|
666
717
|
const searchOptions = applyRetrievalMode({
|
|
667
718
|
projectName: project_name,
|
|
668
719
|
hasError: has_error,
|
|
@@ -690,16 +741,27 @@ function registerRecallMyMemory(server) {
|
|
|
690
741
|
if (results.length === 0 && (has_error !== void 0 || tool_name)) {
|
|
691
742
|
results = await recentRecords(agentId, searchOptions, limit);
|
|
692
743
|
}
|
|
693
|
-
|
|
744
|
+
const curatedScore = bestFallbackRelevance(query, results);
|
|
745
|
+
const shouldProbeRaw = results.length === 0 || curatedScore < RAW_FALLBACK_MIN_RELEVANCE;
|
|
746
|
+
if (shouldProbeRaw && !kind && searchOptions.includeRaw === false && wasRetrievalModeDefaulted) {
|
|
694
747
|
const rawInclusiveOptions = { ...searchOptions, includeRaw: true };
|
|
695
|
-
|
|
748
|
+
const rawInclusiveResults = await hybridSearch(
|
|
749
|
+
query,
|
|
750
|
+
agentId,
|
|
751
|
+
rawInclusiveOptions
|
|
752
|
+
);
|
|
753
|
+
results = chooseRawFallbackResults(
|
|
754
|
+
query,
|
|
755
|
+
results,
|
|
756
|
+
rawInclusiveResults
|
|
757
|
+
);
|
|
696
758
|
}
|
|
697
759
|
}
|
|
698
760
|
const FEDERATION_THRESHOLD = 3;
|
|
699
761
|
let federatedCount = 0;
|
|
700
762
|
if (!recent && query && results.length < FEDERATION_THRESHOLD) {
|
|
701
763
|
try {
|
|
702
|
-
const { searchCodeContextSemantic: searchCodeContextSemantic2 } = await import("./code-context-index-
|
|
764
|
+
const { searchCodeContextSemantic: searchCodeContextSemantic2 } = await import("./code-context-index-LIDOFKOR.js");
|
|
703
765
|
const codeResults = await Promise.race([
|
|
704
766
|
searchCodeContextSemantic2(query, { limit: 5 }),
|
|
705
767
|
new Promise((_, rej) => setTimeout(() => rej(new Error("timeout")), 2e3))
|
|
@@ -860,7 +922,7 @@ function registerAskTeamMemory(server) {
|
|
|
860
922
|
}, safeMode);
|
|
861
923
|
if (!effectiveIncludeRaw) searchOptions.includeRaw = false;
|
|
862
924
|
{
|
|
863
|
-
const { ensureReadDbReady } = await import("./fast-db-init-
|
|
925
|
+
const { ensureReadDbReady } = await import("./fast-db-init-GWUZ746B.js");
|
|
864
926
|
if (!await ensureReadDbReady()) {
|
|
865
927
|
return {
|
|
866
928
|
content: [
|
|
@@ -950,11 +1012,11 @@ function registerStoreMemory(server) {
|
|
|
950
1012
|
}
|
|
951
1013
|
const { agentId, agentRole } = getActiveAgent();
|
|
952
1014
|
if (kind === "prospective") {
|
|
953
|
-
const { createProspectiveMemory } = await import("./prospective-memory-
|
|
1015
|
+
const { createProspectiveMemory } = await import("./prospective-memory-GEO6E3UL.js");
|
|
954
1016
|
let sessionScope = null;
|
|
955
1017
|
try {
|
|
956
|
-
const { resolveExeSession
|
|
957
|
-
sessionScope =
|
|
1018
|
+
const { resolveExeSession } = await import("./lib/tmux-routing.js");
|
|
1019
|
+
sessionScope = resolveExeSession() ?? null;
|
|
958
1020
|
} catch {
|
|
959
1021
|
}
|
|
960
1022
|
const record = await createProspectiveMemory({
|
|
@@ -1328,7 +1390,7 @@ function registerSearchEverything(server) {
|
|
|
1328
1390
|
},
|
|
1329
1391
|
async (params) => {
|
|
1330
1392
|
try {
|
|
1331
|
-
const { ensureReadDbReady } = await import("./fast-db-init-
|
|
1393
|
+
const { ensureReadDbReady } = await import("./fast-db-init-GWUZ746B.js");
|
|
1332
1394
|
if (!await ensureReadDbReady()) {
|
|
1333
1395
|
return {
|
|
1334
1396
|
content: [
|
|
@@ -1950,7 +2012,7 @@ async function handleSupersede(input) {
|
|
|
1950
2012
|
}
|
|
1951
2013
|
try {
|
|
1952
2014
|
const { getClient: getClient2 } = await import("./lib/database.js");
|
|
1953
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
2015
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
1954
2016
|
const { writeMemory: writeMemory2, flushBatch: flushBatch2 } = await import("./lib/store.js");
|
|
1955
2017
|
const { randomUUID: randomUUID2 } = await import("crypto");
|
|
1956
2018
|
const client = getClient2();
|
|
@@ -1985,7 +2047,7 @@ async function handleSupersede(input) {
|
|
|
1985
2047
|
`
|
|
1986
2048
|
);
|
|
1987
2049
|
const sessionId = process.env.SESSION_ID ?? "manual";
|
|
1988
|
-
const { getProjectName: getProjectName2 } = await import("./project-name-
|
|
2050
|
+
const { getProjectName: getProjectName2 } = await import("./project-name-WKSNNKXK.js");
|
|
1989
2051
|
const projectName = input.project_name ?? getProjectName2();
|
|
1990
2052
|
const newId = randomUUID2();
|
|
1991
2053
|
await writeMemory2({
|
|
@@ -2020,7 +2082,7 @@ New memory id: ${newId}`
|
|
|
2020
2082
|
}
|
|
2021
2083
|
async function handleResonanceQuery(input) {
|
|
2022
2084
|
try {
|
|
2023
|
-
const { getHotPairs, getCoActivationNeighbors } = await import("./co-activation-
|
|
2085
|
+
const { getHotPairs, getCoActivationNeighbors } = await import("./co-activation-523TKQPZ.js");
|
|
2024
2086
|
const subAction = input.resonance_action ?? "hot_pairs";
|
|
2025
2087
|
const limit = input.limit ?? 20;
|
|
2026
2088
|
if (subAction === "hot_pairs") {
|
|
@@ -2125,7 +2187,7 @@ function registerMemory(server) {
|
|
|
2125
2187
|
return handleResonanceQuery(input);
|
|
2126
2188
|
}
|
|
2127
2189
|
if (action === "update_working_memory" || action === "get_working_memory") {
|
|
2128
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
2190
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
2129
2191
|
const { agentId } = getActiveAgent2();
|
|
2130
2192
|
const { readWorkingMemoryWithMeta, writeWorkingMemory, WORKING_MEMORY_MAX_BYTES } = await import("./working-memory-DPFRSKH3.js");
|
|
2131
2193
|
if (action === "get_working_memory") {
|
|
@@ -2151,9 +2213,9 @@ function registerMemory(server) {
|
|
|
2151
2213
|
}
|
|
2152
2214
|
}
|
|
2153
2215
|
if (action === "core_get" || action === "core_set" || action === "core_delete") {
|
|
2154
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
2216
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
2155
2217
|
const { agentId } = getActiveAgent2();
|
|
2156
|
-
const { getCoreMemory, setCoreMemory, deleteCoreMemory, formatCoreMemoryBlock } = await import("./core-memory-
|
|
2218
|
+
const { getCoreMemory, setCoreMemory, deleteCoreMemory, formatCoreMemoryBlock } = await import("./core-memory-UIZKCY4L.js");
|
|
2157
2219
|
if (action === "core_get") {
|
|
2158
2220
|
const entries = await getCoreMemory(agentId);
|
|
2159
2221
|
const block = formatCoreMemoryBlock(entries);
|
|
@@ -2183,7 +2245,6 @@ function registerMemory(server) {
|
|
|
2183
2245
|
legacyArgs.limit ??= 10;
|
|
2184
2246
|
legacyArgs.include_archived ??= false;
|
|
2185
2247
|
legacyArgs.include_source ??= false;
|
|
2186
|
-
legacyArgs.retrieval_mode ??= "no_raw";
|
|
2187
2248
|
legacyArgs.debug ??= false;
|
|
2188
2249
|
if (!legacyArgs.recent && !legacyArgs.query) {
|
|
2189
2250
|
return errorResult('memory action "recall" requires query unless recent=true');
|
|
@@ -2205,13 +2266,13 @@ function registerMemory(server) {
|
|
|
2205
2266
|
if (!storeTrigger || !storeTriggerAction) {
|
|
2206
2267
|
return errorResult('memory action "store" with kind="reflex" requires trigger and trigger_action fields');
|
|
2207
2268
|
}
|
|
2208
|
-
const { formatReflexContent, storeReflexBehavior: storeReflexBehavior2 } = await import("./behaviors-
|
|
2269
|
+
const { formatReflexContent, storeReflexBehavior: storeReflexBehavior2 } = await import("./behaviors-GPI4BLTC.js");
|
|
2209
2270
|
const reflexText = formatReflexContent(storeTrigger, storeTriggerAction);
|
|
2210
2271
|
legacyArgs.text ??= reflexText;
|
|
2211
2272
|
legacyArgs.query ??= reflexText;
|
|
2212
2273
|
try {
|
|
2213
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
2214
|
-
const { getProjectName: getProjectName2 } = await import("./project-name-
|
|
2274
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
2275
|
+
const { getProjectName: getProjectName2 } = await import("./project-name-WKSNNKXK.js");
|
|
2215
2276
|
const agent = getActiveAgent2();
|
|
2216
2277
|
const behaviorId = await storeReflexBehavior2({
|
|
2217
2278
|
agentId: agent.agentId,
|
|
@@ -2272,15 +2333,16 @@ function registerQueryRelationships(server) {
|
|
|
2272
2333
|
entity_name: z13.string().optional().describe("Specific entity to explore (for example an agent, project, or vendor name)"),
|
|
2273
2334
|
relationship_type: z13.string().optional().describe("Filter by relationship type (e.g., 'implemented', 'depends_on', 'worked_on')"),
|
|
2274
2335
|
max_depth: z13.number().default(2).describe("How many hops to traverse (default: 2)"),
|
|
2275
|
-
as_of: z13.string().optional().describe("ISO 8601 timestamp for time-travel. Returns relationships valid at that point in time.")
|
|
2336
|
+
as_of: z13.string().optional().describe("ISO 8601 timestamp for time-travel. Returns relationships valid at that point in time."),
|
|
2337
|
+
project_name: z13.string().optional().describe("Scope results to a single project")
|
|
2276
2338
|
}
|
|
2277
2339
|
},
|
|
2278
|
-
async ({ query, entity_name, relationship_type, max_depth, as_of }) => {
|
|
2340
|
+
async ({ query, entity_name, relationship_type, max_depth, as_of, project_name: projectName }) => {
|
|
2279
2341
|
const client = getClient();
|
|
2280
2342
|
if (entity_name) {
|
|
2281
|
-
const entity = await getEntityByName(client, entity_name);
|
|
2343
|
+
const entity = await getEntityByName(client, entity_name, void 0, projectName);
|
|
2282
2344
|
if (!entity) {
|
|
2283
|
-
const matches = await searchEntities(client, entity_name, 5);
|
|
2345
|
+
const matches = await searchEntities(client, entity_name, 5, projectName);
|
|
2284
2346
|
if (matches.length === 0) {
|
|
2285
2347
|
return {
|
|
2286
2348
|
content: [{
|
|
@@ -2300,7 +2362,8 @@ ${matchList}`
|
|
|
2300
2362
|
}
|
|
2301
2363
|
const rels = await getRelationships(client, entity.id, {
|
|
2302
2364
|
type: relationship_type,
|
|
2303
|
-
asOf: as_of
|
|
2365
|
+
asOf: as_of,
|
|
2366
|
+
projectName
|
|
2304
2367
|
});
|
|
2305
2368
|
if (rels.length === 0) {
|
|
2306
2369
|
return {
|
|
@@ -2314,7 +2377,7 @@ ${matchList}`
|
|
|
2314
2377
|
const confLabel = r.confidenceLabel && r.confidenceLabel !== "extracted" ? `[${r.confidenceLabel.toUpperCase()} ${r.confidence.toFixed(1)}] ` : "";
|
|
2315
2378
|
return `- ${confLabel}${r.sourceName} \u2192[${r.type}]\u2192 ${r.targetName} (w: ${r.weight.toFixed(1)})`;
|
|
2316
2379
|
});
|
|
2317
|
-
const neighbors = await getEntityNeighbors(client, entity.id, max_depth, as_of);
|
|
2380
|
+
const neighbors = await getEntityNeighbors(client, entity.id, max_depth, as_of, projectName);
|
|
2318
2381
|
const neighborLine = neighbors.length > 1 ? `
|
|
2319
2382
|
|
|
2320
2383
|
Connected entities (${max_depth} hops): ${neighbors.filter((n) => n.entity.id !== entity.id).map((n) => `${n.entity.name} (${n.entity.type})`).join(", ")}` : "";
|
|
@@ -2330,19 +2393,20 @@ ${relLines.join("\n")}${neighborLine}`
|
|
|
2330
2393
|
};
|
|
2331
2394
|
}
|
|
2332
2395
|
if (query) {
|
|
2333
|
-
const matches = await searchEntities(client, query, 10);
|
|
2396
|
+
const matches = await searchEntities(client, query, 10, projectName);
|
|
2334
2397
|
if (matches.length === 0) {
|
|
2335
|
-
const stats2 = await getGraphStats(client);
|
|
2398
|
+
const stats2 = await getGraphStats(client, projectName);
|
|
2399
|
+
const scopeLabel = projectName ? ` in project "${projectName}"` : "";
|
|
2336
2400
|
return {
|
|
2337
2401
|
content: [{
|
|
2338
2402
|
type: "text",
|
|
2339
|
-
text: `No entities matching "${query}" found. Graph has ${stats2.entities} entities and ${stats2.relationships} relationships.`
|
|
2403
|
+
text: `No entities matching "${query}" found${scopeLabel}. Graph has ${stats2.entities} entities and ${stats2.relationships} relationships${scopeLabel}.`
|
|
2340
2404
|
}]
|
|
2341
2405
|
};
|
|
2342
2406
|
}
|
|
2343
2407
|
const results = [];
|
|
2344
2408
|
for (const entity of matches.slice(0, 5)) {
|
|
2345
|
-
const rels = await getRelationships(client, entity.id, { type: relationship_type, asOf: as_of });
|
|
2409
|
+
const rels = await getRelationships(client, entity.id, { type: relationship_type, asOf: as_of, projectName });
|
|
2346
2410
|
const relSummary = rels.length > 0 ? rels.slice(0, 3).map((r) => ` ${r.sourceName} \u2192[${r.type}]\u2192 ${r.targetName}`).join("\n") : " (no relationships)";
|
|
2347
2411
|
results.push(`### ${entity.name} (${entity.type})
|
|
2348
2412
|
${relSummary}`);
|
|
@@ -2354,12 +2418,12 @@ ${relSummary}`);
|
|
|
2354
2418
|
}]
|
|
2355
2419
|
};
|
|
2356
2420
|
}
|
|
2357
|
-
const stats = await getGraphStats(client);
|
|
2421
|
+
const stats = await getGraphStats(client, projectName);
|
|
2358
2422
|
const typeBreakdown = Object.entries(stats.types).map(([type, count]) => `- ${type}: ${count}`).join("\n");
|
|
2359
2423
|
return {
|
|
2360
2424
|
content: [{
|
|
2361
2425
|
type: "text",
|
|
2362
|
-
text: `Knowledge Graph Summary:
|
|
2426
|
+
text: `Knowledge Graph Summary${projectName ? ` \u2014 ${projectName}` : ""}:
|
|
2363
2427
|
- ${stats.entities} entities
|
|
2364
2428
|
- ${stats.relationships} relationships
|
|
2365
2429
|
|
|
@@ -2466,6 +2530,7 @@ function registerGetTask(server) {
|
|
|
2466
2530
|
lines.push(
|
|
2467
2531
|
"",
|
|
2468
2532
|
`**ID:** ${String(row.id)}`,
|
|
2533
|
+
`**Mode:** ${row.execution_mode === "checklist" ? "checklist (no execution side effects)" : "durable tmux dispatch"}`,
|
|
2469
2534
|
`**Status:** ${String(row.status)}`,
|
|
2470
2535
|
`**Priority:** ${String(row.priority)}`,
|
|
2471
2536
|
`**Assigned by:** ${String(row.assigned_by)}`,
|
|
@@ -2482,6 +2547,16 @@ function registerGetTask(server) {
|
|
|
2482
2547
|
if (row.reviewer) {
|
|
2483
2548
|
lines.push(`**Reviewer:** ${String(row.reviewer)}`);
|
|
2484
2549
|
}
|
|
2550
|
+
const isCompletionStatus = String(row.status) === "done" || String(row.status) === "needs_review" || String(row.status) === "closed";
|
|
2551
|
+
if (row.pr_url) {
|
|
2552
|
+
lines.push(`**PR:** ${String(row.pr_url)}`);
|
|
2553
|
+
} else if (row.pr_number) {
|
|
2554
|
+
lines.push(`**PR:** #${String(row.pr_number)}`);
|
|
2555
|
+
} else if (row.pr_no_reason) {
|
|
2556
|
+
lines.push(`**PR:** none \u2014 ${String(row.pr_no_reason)}`);
|
|
2557
|
+
} else if (isCompletionStatus) {
|
|
2558
|
+
lines.push(`**PR:** untracked (no pr_number/pr_url/pr_no_reason recorded on this task)`);
|
|
2559
|
+
}
|
|
2485
2560
|
const budgetTokens = row.budget_tokens !== null ? Number(row.budget_tokens) : null;
|
|
2486
2561
|
const budgetFallback = row.budget_fallback_model !== null ? String(row.budget_fallback_model) : null;
|
|
2487
2562
|
if (budgetTokens !== null || budgetFallback !== null) {
|
|
@@ -2566,12 +2641,43 @@ function registerGetTask(server) {
|
|
|
2566
2641
|
|
|
2567
2642
|
// src/mcp/tools/close-task.ts
|
|
2568
2643
|
import { z as z15 } from "zod";
|
|
2644
|
+
|
|
2645
|
+
// src/lib/task-request-scope.ts
|
|
2646
|
+
function rootTaskSessionName(value) {
|
|
2647
|
+
const raw = (value ?? "").trim();
|
|
2648
|
+
if (!raw) return "";
|
|
2649
|
+
const lastDash = raw.lastIndexOf("-");
|
|
2650
|
+
return lastDash >= 0 ? raw.slice(lastDash + 1) : raw;
|
|
2651
|
+
}
|
|
2652
|
+
function resolveTaskRequestScope(explicit) {
|
|
2653
|
+
const candidates = [];
|
|
2654
|
+
try {
|
|
2655
|
+
candidates.push([getAgentContext()?.sessionHint ?? "", "als"]);
|
|
2656
|
+
} catch {
|
|
2657
|
+
}
|
|
2658
|
+
candidates.push([process.env.EXE_SESSION_NAME || process.env.EXE_SESSION || "", "env"]);
|
|
2659
|
+
for (const [sessionName, source] of candidates) {
|
|
2660
|
+
const scope2 = rootTaskSessionName(sessionName);
|
|
2661
|
+
if (scope2 && isValidSessionScope(scope2)) return { scope: scope2, sessionName, source };
|
|
2662
|
+
}
|
|
2663
|
+
const explicitValue = (explicit ?? "").trim();
|
|
2664
|
+
if (!explicitValue) return null;
|
|
2665
|
+
const scope = rootTaskSessionName(explicitValue);
|
|
2666
|
+
if (!isValidSessionScope(scope)) {
|
|
2667
|
+
throw new Error(
|
|
2668
|
+
`Invalid session_scope "${explicitValue}". Use a coordinator scope token like exe2, not a tmux command or free text.`
|
|
2669
|
+
);
|
|
2670
|
+
}
|
|
2671
|
+
return { scope, sessionName: explicitValue, source: "explicit_param" };
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
// src/mcp/tools/close-task.ts
|
|
2569
2675
|
var CLOSE_TASK_ALLOWED_ROLES = /* @__PURE__ */ new Set(["CTO"]);
|
|
2570
2676
|
var CLOSEABLE_STATUSES = /* @__PURE__ */ new Set(["needs_review", "done"]);
|
|
2571
2677
|
async function respawnAssigneeAfterClose(input) {
|
|
2572
|
-
const { resolveExeSession
|
|
2678
|
+
const { resolveExeSession, employeeSessionName, ensureEmployee } = await import("./lib/tmux-routing.js");
|
|
2573
2679
|
const { shouldAutoInstance } = await import("./lib/employees.js");
|
|
2574
|
-
const exeSession = input.taskScope ??
|
|
2680
|
+
const exeSession = input.taskScope ?? resolveExeSession();
|
|
2575
2681
|
if (!exeSession) return { respawned: false, reason: "no coordinator session" };
|
|
2576
2682
|
if (!input.projectName) {
|
|
2577
2683
|
process.stderr.write(
|
|
@@ -2596,8 +2702,8 @@ async function respawnAssigneeAfterClose(input) {
|
|
|
2596
2702
|
} catch {
|
|
2597
2703
|
}
|
|
2598
2704
|
try {
|
|
2599
|
-
const { cleanupAgentWorktree } = await import("./worktree-sweep-
|
|
2600
|
-
const { getGitRoot } = await import("./worktree-
|
|
2705
|
+
const { cleanupAgentWorktree } = await import("./worktree-sweep-EV5YQ2OB.js");
|
|
2706
|
+
const { getGitRoot } = await import("./worktree-Q25PZST6.js");
|
|
2601
2707
|
const root = getGitRoot(projectDir);
|
|
2602
2708
|
if (root) {
|
|
2603
2709
|
const notes = await cleanupAgentWorktree(root, input.assignee);
|
|
@@ -2644,6 +2750,35 @@ async function respawnAssigneeAfterClose(input) {
|
|
|
2644
2750
|
);
|
|
2645
2751
|
return { respawned: true, projectDir };
|
|
2646
2752
|
}
|
|
2753
|
+
function resolveTaskPrAttribution(input) {
|
|
2754
|
+
const { matchedPrs, mergedPrs, existingPrNumber, assignee } = input;
|
|
2755
|
+
if (mergedPrs.length === 0) return { prNumber: void 0, prUrl: void 0, note: "" };
|
|
2756
|
+
if (matchedPrs.length > 1) {
|
|
2757
|
+
const list = matchedPrs.map((p) => `#${p.number} (${p.headRefName})`).join(", ");
|
|
2758
|
+
return {
|
|
2759
|
+
prNumber: void 0,
|
|
2760
|
+
prUrl: void 0,
|
|
2761
|
+
note: `\u26A0\uFE0F ${matchedPrs.length} open PRs matched assignee "${assignee}": ${list}. The branch filter matches the ASSIGNEE, not this task, so which PR belongs to THIS task is ambiguous. They were merged as requested, but NONE was auto-recorded as this task's pr_number \u2014 set it with update_task(pr_url=...).`
|
|
2762
|
+
};
|
|
2763
|
+
}
|
|
2764
|
+
const only = mergedPrs[0];
|
|
2765
|
+
const belongsToAssignee = only.headRefName === `${assignee}-work` || only.headRefName.startsWith(`${assignee}-`);
|
|
2766
|
+
if (!belongsToAssignee) {
|
|
2767
|
+
return {
|
|
2768
|
+
prNumber: void 0,
|
|
2769
|
+
prUrl: void 0,
|
|
2770
|
+
note: `\u26A0\uFE0F close_task merged PR #${only.number} from branch "${only.headRefName}", which matched assignee "${assignee}" only by BASE NAME, not by the full assignee id \u2014 for a numbered assignee that branch belongs to a different instance. Not recorded as this task's pr_number; set it with update_task(pr_url=...) if it really is this task's PR.`
|
|
2771
|
+
};
|
|
2772
|
+
}
|
|
2773
|
+
if (existingPrNumber !== null && existingPrNumber !== only.number) {
|
|
2774
|
+
return {
|
|
2775
|
+
prNumber: void 0,
|
|
2776
|
+
prUrl: void 0,
|
|
2777
|
+
note: `\u26A0\uFE0F This task already recorded PR #${existingPrNumber}, but close_task merged #${only.number} from assignee "${assignee}"'s branches. Keeping the already-recorded #${existingPrNumber}: a self-reported PR is task-specific, whereas this match is only assignee-specific.`
|
|
2778
|
+
};
|
|
2779
|
+
}
|
|
2780
|
+
return { prNumber: only.number, prUrl: only.url, note: "" };
|
|
2781
|
+
}
|
|
2647
2782
|
function registerCloseTask(server) {
|
|
2648
2783
|
server.registerTool(
|
|
2649
2784
|
"close_task",
|
|
@@ -2660,10 +2795,20 @@ function registerCloseTask(server) {
|
|
|
2660
2795
|
const agent = getActiveAgent();
|
|
2661
2796
|
const { getClient: getClient2 } = await import("./lib/database.js");
|
|
2662
2797
|
const client = getClient2();
|
|
2663
|
-
const
|
|
2798
|
+
const requestScope = resolveTaskRequestScope();
|
|
2799
|
+
if (!requestScope) {
|
|
2800
|
+
return {
|
|
2801
|
+
content: [{
|
|
2802
|
+
type: "text",
|
|
2803
|
+
text: "close_task requires a resolvable session scope (from X-Exe-Session or the launch environment) and none could be determined. Refusing to close without a session scope to avoid mutating tasks outside this caller's coordinator lane."
|
|
2804
|
+
}],
|
|
2805
|
+
isError: true
|
|
2806
|
+
};
|
|
2807
|
+
}
|
|
2808
|
+
const mySession = requestScope.scope;
|
|
2664
2809
|
let row;
|
|
2665
2810
|
try {
|
|
2666
|
-
row = await resolveTask(client, task_id, mySession);
|
|
2811
|
+
row = await resolveTask(client, task_id, mySession, "mutate", agent.agentId);
|
|
2667
2812
|
} catch {
|
|
2668
2813
|
return {
|
|
2669
2814
|
content: [{
|
|
@@ -2677,7 +2822,7 @@ function registerCloseTask(server) {
|
|
|
2677
2822
|
const callerIsAssignedReviewer = Boolean(agent.agentId) && taskReviewer !== null && agent.agentId === taskReviewer;
|
|
2678
2823
|
const canClose = canCoordinate(agent.agentId, agent.agentRole) || CLOSE_TASK_ALLOWED_ROLES.has(agent.agentRole ?? "") || callerIsAssignedReviewer;
|
|
2679
2824
|
try {
|
|
2680
|
-
const { StewardGate: StewardGate2 } = await import("./steward-gate-
|
|
2825
|
+
const { StewardGate: StewardGate2 } = await import("./steward-gate-KMLS5ECC.js");
|
|
2681
2826
|
const steward = new StewardGate2();
|
|
2682
2827
|
const gateDecision = await steward.checkAuthority(agent.agentId || "unknown", "close_task", task_id);
|
|
2683
2828
|
if (!gateDecision.allowed && !callerIsAssignedReviewer) {
|
|
@@ -2697,6 +2842,7 @@ function registerCloseTask(server) {
|
|
|
2697
2842
|
};
|
|
2698
2843
|
}
|
|
2699
2844
|
const taskStatus = String(row.status);
|
|
2845
|
+
const isLegacyExecution = row.execution_mode !== "checklist";
|
|
2700
2846
|
const assignee = row.assigned_to;
|
|
2701
2847
|
const taskScope = row.session_scope;
|
|
2702
2848
|
const createdAt = row.created_at;
|
|
@@ -2721,7 +2867,7 @@ function registerCloseTask(server) {
|
|
|
2721
2867
|
}
|
|
2722
2868
|
const preflightWarnings = [];
|
|
2723
2869
|
const baseDir = process.cwd();
|
|
2724
|
-
if (assignee) {
|
|
2870
|
+
if (assignee && isLegacyExecution) {
|
|
2725
2871
|
try {
|
|
2726
2872
|
const { execSync } = await import("child_process");
|
|
2727
2873
|
const baseName = assignee.replace(/\d+$/, "") || assignee;
|
|
@@ -2756,7 +2902,7 @@ function registerCloseTask(server) {
|
|
|
2756
2902
|
} catch {
|
|
2757
2903
|
}
|
|
2758
2904
|
}
|
|
2759
|
-
if (assignee && createdAt && status2 === "closed") {
|
|
2905
|
+
if (assignee && createdAt && status2 === "closed" && isLegacyExecution) {
|
|
2760
2906
|
try {
|
|
2761
2907
|
const { execSync } = await import("child_process");
|
|
2762
2908
|
const sinceDate = createdAt.split("T")[0] || createdAt;
|
|
@@ -2780,12 +2926,16 @@ function registerCloseTask(server) {
|
|
|
2780
2926
|
}
|
|
2781
2927
|
}
|
|
2782
2928
|
let mergeNote = "";
|
|
2783
|
-
|
|
2929
|
+
let mergedPrNumber;
|
|
2930
|
+
let mergedPrUrl;
|
|
2931
|
+
const mergedOk = [];
|
|
2932
|
+
let prAmbiguityNote = "";
|
|
2933
|
+
if (assignee && isLegacyExecution) {
|
|
2784
2934
|
try {
|
|
2785
2935
|
const { execSync } = await import("child_process");
|
|
2786
2936
|
try {
|
|
2787
2937
|
const openPRs = execSync(
|
|
2788
|
-
`gh pr list --state open --json number,title,headRefName 2>/dev/null`,
|
|
2938
|
+
`gh pr list --state open --json number,title,headRefName,url 2>/dev/null`,
|
|
2789
2939
|
{ encoding: "utf8", timeout: 5e3 }
|
|
2790
2940
|
).trim();
|
|
2791
2941
|
const allPrs = JSON.parse(openPRs || "[]");
|
|
@@ -2800,11 +2950,27 @@ function registerCloseTask(server) {
|
|
|
2800
2950
|
\u2705 Auto-merged PR #${pr.number}: ${pr.title}`;
|
|
2801
2951
|
process.stderr.write(`[close-task] Auto-merged PR #${pr.number} (${pr.headRefName})
|
|
2802
2952
|
`);
|
|
2953
|
+
mergedOk.push(pr);
|
|
2803
2954
|
} catch (mergeErr) {
|
|
2804
2955
|
mergeNote += `
|
|
2805
2956
|
\u26A0\uFE0F Failed to merge PR #${pr.number}: ${mergeErr instanceof Error ? mergeErr.message : "unknown error"}`;
|
|
2806
2957
|
}
|
|
2807
2958
|
}
|
|
2959
|
+
const attribution = resolveTaskPrAttribution({
|
|
2960
|
+
matchedPrs: prs,
|
|
2961
|
+
mergedPrs: mergedOk,
|
|
2962
|
+
existingPrNumber: row.pr_number == null ? null : Number(row.pr_number),
|
|
2963
|
+
assignee
|
|
2964
|
+
});
|
|
2965
|
+
mergedPrNumber = attribution.prNumber;
|
|
2966
|
+
mergedPrUrl = attribution.prUrl;
|
|
2967
|
+
prAmbiguityNote = attribution.note;
|
|
2968
|
+
if (attribution.note) {
|
|
2969
|
+
mergeNote += `
|
|
2970
|
+
${attribution.note}`;
|
|
2971
|
+
process.stderr.write(`[close-task] PR traceability: ${attribution.note}
|
|
2972
|
+
`);
|
|
2973
|
+
}
|
|
2808
2974
|
if (prs.length > 0) {
|
|
2809
2975
|
try {
|
|
2810
2976
|
execSync("git pull origin main 2>/dev/null", { timeout: 1e4 });
|
|
@@ -2827,13 +2993,24 @@ function registerCloseTask(server) {
|
|
|
2827
2993
|
const task = await updateTask({
|
|
2828
2994
|
taskId: task_id,
|
|
2829
2995
|
status: status2,
|
|
2830
|
-
|
|
2996
|
+
// mergeNote is response-only and evaporates. When PR traceability was
|
|
2997
|
+
// deliberately NOT stamped, the REASON has to live on the record next
|
|
2998
|
+
// to the gap it explains, or the record is just silently missing a PR.
|
|
2999
|
+
result: prAmbiguityNote ? `${result3}
|
|
3000
|
+
${prAmbiguityNote.trim()}` : result3,
|
|
3001
|
+
// Only set when close_task merged exactly one unambiguously-attributable
|
|
3002
|
+
// PR via `gh`. `undefined` never clobbers a pr_number/pr_url the
|
|
3003
|
+
// employee already reported at update_task(needs_review) time (see
|
|
3004
|
+
// resolvePrTraceabilityFields), and is what the ambiguity/clobber guards
|
|
3005
|
+
// above reset it to.
|
|
3006
|
+
prNumber: mergedPrNumber,
|
|
3007
|
+
prUrl: mergedPrUrl,
|
|
2831
3008
|
baseDir,
|
|
2832
3009
|
skipReviewCreation: true
|
|
2833
3010
|
});
|
|
2834
|
-
try {
|
|
2835
|
-
const { releaseClaim: releaseClaim2 } = await import("./work-claims-
|
|
2836
|
-
const holderSession = sanitizeSessionScope(
|
|
3011
|
+
if (isLegacyExecution) try {
|
|
3012
|
+
const { releaseClaim: releaseClaim2 } = await import("./work-claims-PDQNLE5K.js");
|
|
3013
|
+
const holderSession = sanitizeSessionScope(mySession ?? "") || "";
|
|
2837
3014
|
if (holderSession) {
|
|
2838
3015
|
await releaseClaim2({ holderSession, taskId: task.id });
|
|
2839
3016
|
}
|
|
@@ -2852,10 +3029,10 @@ File: ${task.taskFile}`;
|
|
|
2852
3029
|
${preflightWarnings.join("\n")}`;
|
|
2853
3030
|
}
|
|
2854
3031
|
if (mergeNote) text5 += mergeNote;
|
|
2855
|
-
if (status2 === "closed" && assignee) {
|
|
3032
|
+
if (status2 === "closed" && assignee && isLegacyExecution) {
|
|
2856
3033
|
try {
|
|
2857
|
-
const { cleanupAgentWorktree } = await import("./worktree-sweep-
|
|
2858
|
-
const { getGitRoot } = await import("./worktree-
|
|
3034
|
+
const { cleanupAgentWorktree } = await import("./worktree-sweep-EV5YQ2OB.js");
|
|
3035
|
+
const { getGitRoot } = await import("./worktree-Q25PZST6.js");
|
|
2859
3036
|
const repoRoot = getGitRoot(baseDir);
|
|
2860
3037
|
if (repoRoot) {
|
|
2861
3038
|
const cleanupNotes = await cleanupAgentWorktree(repoRoot, assignee);
|
|
@@ -2872,13 +3049,13 @@ ${preflightWarnings.join("\n")}`;
|
|
|
2872
3049
|
}
|
|
2873
3050
|
}
|
|
2874
3051
|
let respawnNote = "";
|
|
2875
|
-
if (status2 === "closed") {
|
|
3052
|
+
if (status2 === "closed" && isLegacyExecution) {
|
|
2876
3053
|
try {
|
|
2877
3054
|
const closedAssignee = assignee || task.assignedTo;
|
|
2878
3055
|
if (closedAssignee) {
|
|
2879
|
-
const respawnScope = sessionScopeFilter(
|
|
3056
|
+
const respawnScope = sessionScopeFilter(mySession);
|
|
2880
3057
|
const remaining = await client.execute({
|
|
2881
|
-
sql: `SELECT COUNT(*) as cnt FROM tasks WHERE assigned_to = ? AND status IN ('open', 'in_progress') ${respawnScope.sql}`,
|
|
3058
|
+
sql: `SELECT COUNT(*) as cnt FROM tasks WHERE assigned_to = ? AND status IN ('open', 'in_progress') AND execution_mode = 'durable_tmux' ${respawnScope.sql}`,
|
|
2882
3059
|
args: [closedAssignee, ...respawnScope.args]
|
|
2883
3060
|
});
|
|
2884
3061
|
const count = Number(remaining.rows[0]?.cnt ?? 0);
|
|
@@ -2886,7 +3063,7 @@ ${preflightWarnings.join("\n")}`;
|
|
|
2886
3063
|
let topOpenTaskId;
|
|
2887
3064
|
try {
|
|
2888
3065
|
const topRes = await client.execute({
|
|
2889
|
-
sql: `SELECT id FROM tasks WHERE assigned_to = ? AND status = 'open' ${respawnScope.sql}
|
|
3066
|
+
sql: `SELECT id FROM tasks WHERE assigned_to = ? AND status = 'open' AND execution_mode = 'durable_tmux' ${respawnScope.sql}
|
|
2890
3067
|
ORDER BY CASE priority WHEN 'p0' THEN 0 WHEN 'p1' THEN 1 WHEN 'p2' THEN 2 ELSE 3 END, created_at ASC LIMIT 1`,
|
|
2891
3068
|
args: [closedAssignee, ...respawnScope.args]
|
|
2892
3069
|
});
|
|
@@ -2999,7 +3176,7 @@ function registerResumeEmployee(server) {
|
|
|
2999
3176
|
async ({ agent_id, project_name }) => {
|
|
3000
3177
|
let client;
|
|
3001
3178
|
if (!isInitialized()) {
|
|
3002
|
-
const { fastDbInit: fastDbInit2 } = await import("./fast-db-init-
|
|
3179
|
+
const { fastDbInit: fastDbInit2 } = await import("./fast-db-init-GWUZ746B.js");
|
|
3003
3180
|
client = await fastDbInit2();
|
|
3004
3181
|
} else {
|
|
3005
3182
|
client = getClient();
|
|
@@ -3009,7 +3186,9 @@ function registerResumeEmployee(server) {
|
|
|
3009
3186
|
sql: `SELECT id, title, priority, task_file, status, assigned_tmux,
|
|
3010
3187
|
session_scope, project_name
|
|
3011
3188
|
FROM tasks
|
|
3012
|
-
WHERE assigned_to = ?
|
|
3189
|
+
WHERE assigned_to = ?
|
|
3190
|
+
AND status IN ('open', 'in_progress', 'blocked')
|
|
3191
|
+
AND execution_mode = 'durable_tmux'${reScope.sql}
|
|
3013
3192
|
ORDER BY
|
|
3014
3193
|
CASE priority WHEN 'p0' THEN 0 WHEN 'p1' THEN 1 WHEN 'p2' THEN 2 ELSE 3 END,
|
|
3015
3194
|
created_at ASC
|
|
@@ -3027,7 +3206,7 @@ function registerResumeEmployee(server) {
|
|
|
3027
3206
|
};
|
|
3028
3207
|
}
|
|
3029
3208
|
try {
|
|
3030
|
-
const { isTmuxSessionAlive } = await import("./tasks-crud-
|
|
3209
|
+
const { isTmuxSessionAlive } = await import("./tasks-crud-45WOIMIM.js");
|
|
3031
3210
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3032
3211
|
for (const row of openTasks.rows) {
|
|
3033
3212
|
const status2 = String(row.status);
|
|
@@ -3055,7 +3234,7 @@ function registerResumeEmployee(server) {
|
|
|
3055
3234
|
}
|
|
3056
3235
|
let checkpointInfo = "";
|
|
3057
3236
|
try {
|
|
3058
|
-
const { readLatestCheckpoint } = await import("./tasks-crud-
|
|
3237
|
+
const { readLatestCheckpoint } = await import("./tasks-crud-45WOIMIM.js");
|
|
3059
3238
|
const checkpointSessionScope = openTasks.rows[0]?.session_scope != null ? String(openTasks.rows[0].session_scope) : reScope.args[0] != null ? String(reScope.args[0]) : "";
|
|
3060
3239
|
const checkpoint = checkpointSessionScope ? await readLatestCheckpoint(agent_id, { sessionScope: checkpointSessionScope }) : null;
|
|
3061
3240
|
if (checkpoint) {
|
|
@@ -3116,7 +3295,7 @@ function registerResumeEmployee(server) {
|
|
|
3116
3295
|
}
|
|
3117
3296
|
let dispatchStatus = "";
|
|
3118
3297
|
try {
|
|
3119
|
-
const { ensureEmployeeAsync, resolveExeSession
|
|
3298
|
+
const { ensureEmployeeAsync, resolveExeSession } = await import("./lib/tmux-routing.js");
|
|
3120
3299
|
let taskScope = null;
|
|
3121
3300
|
if (taskId) {
|
|
3122
3301
|
try {
|
|
@@ -3130,7 +3309,7 @@ function registerResumeEmployee(server) {
|
|
|
3130
3309
|
taskScope = null;
|
|
3131
3310
|
}
|
|
3132
3311
|
}
|
|
3133
|
-
const exeSession = taskScope ??
|
|
3312
|
+
const exeSession = taskScope ?? resolveExeSession();
|
|
3134
3313
|
if (!exeSession) throw new Error("No coordinator session found");
|
|
3135
3314
|
if (!resumeProjectDir) {
|
|
3136
3315
|
throw new Error(
|
|
@@ -3142,6 +3321,17 @@ function registerResumeEmployee(server) {
|
|
|
3142
3321
|
`
|
|
3143
3322
|
);
|
|
3144
3323
|
const { shouldAutoInstance } = await import("./lib/employees.js");
|
|
3324
|
+
if (taskId) {
|
|
3325
|
+
const { liveSessionHoldingTask } = await import("./tasks-crud-45WOIMIM.js");
|
|
3326
|
+
const holder = await liveSessionHoldingTask(taskId, taskScope);
|
|
3327
|
+
if (holder) {
|
|
3328
|
+
dispatchStatus = `
|
|
3329
|
+
Dispatched: suppressed -- task ${taskId} already in progress on live session ${holder}`;
|
|
3330
|
+
process.stderr.write(`[resume_employee] SPAWN SUPPRESSED for ${agent_id} task ${taskId} -- live session ${holder} already working it
|
|
3331
|
+
`);
|
|
3332
|
+
throw new Error("spawn suppressed -- session already live");
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3145
3335
|
const { tryAcquireDispatchClaim, releaseDispatchClaim } = await import("./dispatch-ack-AZL3WKCK.js");
|
|
3146
3336
|
let claimedResume = false;
|
|
3147
3337
|
if (taskId) {
|
|
@@ -3457,12 +3647,13 @@ function registerTask(server) {
|
|
|
3457
3647
|
"task",
|
|
3458
3648
|
{
|
|
3459
3649
|
title: "Task",
|
|
3460
|
-
description: "Consolidated task domain tool. Use action=create/list/get/update/close/checkpoint/resume/dependency_tree/verify_dispatch instead of separate task tools. verify_dispatch checks if a dispatched task was acknowledged by the agent. reminder_create/reminder_list/reminder_complete manage founder reminders shown in boot brief. Legacy task tools remain available during migration.",
|
|
3650
|
+
description: "Consolidated task domain tool. action=create persists a session-scoped checklist item with no execution side effects by default; use execution_mode='durable_tmux' only for explicit legacy dispatch. Use action=create/list/get/update/close/checkpoint/resume/dependency_tree/verify_dispatch instead of separate task tools. verify_dispatch checks if a dispatched task was acknowledged by the agent. reminder_create/reminder_list/reminder_complete manage founder reminders shown in boot brief. Legacy task tools remain available during migration.",
|
|
3461
3651
|
inputSchema: {
|
|
3462
3652
|
action: z19.enum(["create", "list", "get", "update", "close", "checkpoint", "resume", "dependency_tree", "verify_dispatch", "create_group", "group_status", "group_results", "reminder_create", "reminder_list", "reminder_complete"]).describe("Task operation to perform"),
|
|
3653
|
+
execution_mode: z19.enum(["checklist", "durable_tmux"]).optional().describe("For action=create or create_group. Default 'checklist' only persists plan state for native-subagent execution in this coordinator context. 'durable_tmux' explicitly opts into legacy project resolution and tmux dispatch."),
|
|
3463
3654
|
task_id: z19.string().optional().describe("Task identifier \u2014 UUID, slug, filename fragment, or title substring"),
|
|
3464
3655
|
title: z19.string().optional().describe("Task title for action=create"),
|
|
3465
|
-
assigned_to: z19.string().optional().describe("
|
|
3656
|
+
assigned_to: z19.string().optional().describe("Checklist owner/assignee label for action=create, or assignee filter for action=list. Roster validation happens only in execution_mode='durable_tmux'."),
|
|
3466
3657
|
project_name: z19.string().optional().describe("Project name. Use project_name='all' for action=list across projects."),
|
|
3467
3658
|
priority: z19.enum(["p0", "p1", "p2"]).optional().describe("Priority for create or list filter"),
|
|
3468
3659
|
complexity: z19.enum(["routine", "standard", "complex", "critical"]).optional().describe("Task complexity for action=create"),
|
|
@@ -3571,14 +3762,17 @@ function registerTask(server) {
|
|
|
3571
3762
|
const missing2 = missingRequiredFields2(args, REQUIRED_FIELDS2.create_group);
|
|
3572
3763
|
if (missing2.length > 0) return errorResult2(`task action "create_group" missing required field(s): ${missing2.join(", ")}`);
|
|
3573
3764
|
try {
|
|
3574
|
-
const
|
|
3765
|
+
const requestScope = resolveTaskRequestScope(args.session_scope);
|
|
3766
|
+
if (!requestScope) return errorResult2("create_group requires a concrete session_scope from X-Exe-Session, the launch environment, or session_scope");
|
|
3767
|
+
const { createTaskGroup } = await import("./tasks-crud-45WOIMIM.js");
|
|
3575
3768
|
const group = await createTaskGroup({
|
|
3576
3769
|
title: args.title,
|
|
3577
3770
|
coordinator: args.coordinator,
|
|
3578
|
-
sessionScope:
|
|
3771
|
+
sessionScope: requestScope.scope,
|
|
3579
3772
|
projectName: args.project_name ?? void 0,
|
|
3580
3773
|
timeoutMinutes: args.timeout_minutes ?? void 0,
|
|
3581
|
-
onPartialFailure: args.on_partial_failure ?? void 0
|
|
3774
|
+
onPartialFailure: args.on_partial_failure ?? void 0,
|
|
3775
|
+
executionMode: args.execution_mode ?? "checklist"
|
|
3582
3776
|
});
|
|
3583
3777
|
return { content: [{ type: "text", text: JSON.stringify(group, null, 2) }] };
|
|
3584
3778
|
} catch (err) {
|
|
@@ -3590,8 +3784,10 @@ function registerTask(server) {
|
|
|
3590
3784
|
const missing2 = missingRequiredFields2(args, REQUIRED_FIELDS2.group_status);
|
|
3591
3785
|
if (missing2.length > 0) return errorResult2(`task action "group_status" missing required field(s): ${missing2.join(", ")}`);
|
|
3592
3786
|
try {
|
|
3593
|
-
const
|
|
3594
|
-
|
|
3787
|
+
const requestScope = resolveTaskRequestScope(args.session_scope);
|
|
3788
|
+
if (!requestScope) return errorResult2("group_status requires a concrete caller session_scope");
|
|
3789
|
+
const { getGroupStatus } = await import("./tasks-crud-45WOIMIM.js");
|
|
3790
|
+
const status2 = await getGroupStatus(args.group_id, requestScope.scope);
|
|
3595
3791
|
return { content: [{ type: "text", text: JSON.stringify(status2, null, 2) }] };
|
|
3596
3792
|
} catch (err) {
|
|
3597
3793
|
return errorResult2(`group_status failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -3602,8 +3798,10 @@ function registerTask(server) {
|
|
|
3602
3798
|
const missing2 = missingRequiredFields2(args, REQUIRED_FIELDS2.group_results);
|
|
3603
3799
|
if (missing2.length > 0) return errorResult2(`task action "group_results" missing required field(s): ${missing2.join(", ")}`);
|
|
3604
3800
|
try {
|
|
3605
|
-
const
|
|
3606
|
-
|
|
3801
|
+
const requestScope = resolveTaskRequestScope(args.session_scope);
|
|
3802
|
+
if (!requestScope) return errorResult2("group_results requires a concrete caller session_scope");
|
|
3803
|
+
const { getGroupResults } = await import("./tasks-crud-45WOIMIM.js");
|
|
3804
|
+
const results = await getGroupResults(args.group_id, requestScope.scope);
|
|
3607
3805
|
return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
|
|
3608
3806
|
} catch (err) {
|
|
3609
3807
|
return errorResult2(`group_results failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -3621,6 +3819,7 @@ function registerTask(server) {
|
|
|
3621
3819
|
if (action === "create") {
|
|
3622
3820
|
legacyArgs.priority ??= "p1";
|
|
3623
3821
|
legacyArgs.complexity ??= "standard";
|
|
3822
|
+
legacyArgs.execution_mode ??= "checklist";
|
|
3624
3823
|
}
|
|
3625
3824
|
if (action === "close") {
|
|
3626
3825
|
legacyArgs.status ??= "closed";
|
|
@@ -3634,26 +3833,6 @@ function registerTask(server) {
|
|
|
3634
3833
|
return errorResult2(`Legacy task handler not found for action "${action}" (${legacyToolName})`);
|
|
3635
3834
|
}
|
|
3636
3835
|
const result3 = await legacyTool.handler(legacyArgs, extra);
|
|
3637
|
-
if (action === "create" && legacyArgs.group_id && !result3.isError) {
|
|
3638
|
-
try {
|
|
3639
|
-
const resultText = result3.content?.[0]?.text ?? "";
|
|
3640
|
-
const parsed = JSON.parse(resultText);
|
|
3641
|
-
const taskId = parsed?.id;
|
|
3642
|
-
if (taskId) {
|
|
3643
|
-
const { getClient: getClient2 } = await import("./lib/database.js");
|
|
3644
|
-
const client = getClient2();
|
|
3645
|
-
await client.execute({
|
|
3646
|
-
sql: "UPDATE tasks SET group_id = ? WHERE id = ?",
|
|
3647
|
-
args: [String(legacyArgs.group_id), taskId]
|
|
3648
|
-
});
|
|
3649
|
-
parsed.group_id = String(legacyArgs.group_id);
|
|
3650
|
-
return {
|
|
3651
|
-
content: [{ type: "text", text: JSON.stringify(parsed, null, 2) }]
|
|
3652
|
-
};
|
|
3653
|
-
}
|
|
3654
|
-
} catch {
|
|
3655
|
-
}
|
|
3656
|
-
}
|
|
3657
3836
|
return result3;
|
|
3658
3837
|
}
|
|
3659
3838
|
);
|
|
@@ -4015,8 +4194,8 @@ function registerStoreBehavior(server) {
|
|
|
4015
4194
|
});
|
|
4016
4195
|
let responseText = `Behavior stored for ${resolvedAgent}. ID: ${id}`;
|
|
4017
4196
|
try {
|
|
4018
|
-
const { countActiveBehaviors } = await import("./behaviors-
|
|
4019
|
-
const { formatOverCapWarning } = await import("./behavior-injection-
|
|
4197
|
+
const { countActiveBehaviors } = await import("./behaviors-GPI4BLTC.js");
|
|
4198
|
+
const { formatOverCapWarning } = await import("./behavior-injection-GMZKZ3BT.js");
|
|
4020
4199
|
const counts = await countActiveBehaviors(resolvedAgent, resolvedProject);
|
|
4021
4200
|
const warning = formatOverCapWarning(resolvedAgent, counts);
|
|
4022
4201
|
if (warning) responseText += `
|
|
@@ -4133,13 +4312,16 @@ function registerMessage(server) {
|
|
|
4133
4312
|
const action = input.action;
|
|
4134
4313
|
const { action: _action, ...args } = input;
|
|
4135
4314
|
if (action === "send") {
|
|
4136
|
-
|
|
4315
|
+
const target = resolveMessageTarget(args.target_agent);
|
|
4316
|
+
if (!target) {
|
|
4317
|
+
return errorResult4('message action "send" requires target_agent when no dispatcher session is available');
|
|
4318
|
+
}
|
|
4137
4319
|
const msgType = args.type;
|
|
4138
4320
|
const msgPayload = args.payload;
|
|
4139
4321
|
if (msgType && msgPayload) {
|
|
4140
4322
|
try {
|
|
4141
|
-
const { buildTypedMessage, serializeMessage } = await import("./typed-messages-
|
|
4142
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
4323
|
+
const { buildTypedMessage, serializeMessage } = await import("./typed-messages-P2HLLA62.js");
|
|
4324
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
4143
4325
|
const { sendMessage } = await import("./lib/messaging.js");
|
|
4144
4326
|
const { agentId } = getActiveAgent2();
|
|
4145
4327
|
const envelope = buildTypedMessage({
|
|
@@ -4149,9 +4331,10 @@ function registerMessage(server) {
|
|
|
4149
4331
|
});
|
|
4150
4332
|
const msg = await sendMessage({
|
|
4151
4333
|
fromAgent: agentId,
|
|
4152
|
-
targetAgent:
|
|
4334
|
+
targetAgent: target.targetAgent,
|
|
4153
4335
|
targetProject: args.target_project,
|
|
4154
4336
|
targetDevice: args.target_device,
|
|
4337
|
+
sessionScope: target.sessionScope,
|
|
4155
4338
|
content: serializeMessage(envelope),
|
|
4156
4339
|
priority: args.priority ?? "normal"
|
|
4157
4340
|
});
|
|
@@ -4159,7 +4342,7 @@ function registerMessage(server) {
|
|
|
4159
4342
|
return {
|
|
4160
4343
|
content: [{
|
|
4161
4344
|
type: "text",
|
|
4162
|
-
text: `Typed message [${msgType}] sent to ${
|
|
4345
|
+
text: `Typed message [${msgType}] sent to ${target.targetAgent}: ${statusText}
|
|
4163
4346
|
ID: ${msg.id}`
|
|
4164
4347
|
}]
|
|
4165
4348
|
};
|
|
@@ -4173,10 +4356,10 @@ ID: ${msg.id}`
|
|
|
4173
4356
|
if (action === "read") {
|
|
4174
4357
|
try {
|
|
4175
4358
|
const { getPendingMessages } = await import("./lib/messaging.js");
|
|
4176
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
4177
|
-
const { resolveExeSession
|
|
4359
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
4360
|
+
const { resolveExeSession } = await import("./lib/tmux-routing.js");
|
|
4178
4361
|
const { agentId } = getActiveAgent2();
|
|
4179
|
-
const callerScope =
|
|
4362
|
+
const callerScope = resolveExeSession() ?? void 0;
|
|
4180
4363
|
const messages = await getPendingMessages(agentId, callerScope);
|
|
4181
4364
|
if (messages.length === 0) {
|
|
4182
4365
|
return {
|
|
@@ -4370,6 +4553,45 @@ ${identity.body}`
|
|
|
4370
4553
|
|
|
4371
4554
|
// src/mcp/tools/update-identity.ts
|
|
4372
4555
|
import { z as z25 } from "zod";
|
|
4556
|
+
|
|
4557
|
+
// src/lib/identity-contradiction-lint.ts
|
|
4558
|
+
var DELEGATION_VERB = /\b(route|routing|assign|assigning|delegat\w*|dispatch\w*|hand\s*off|handing\s*off)\b/i;
|
|
4559
|
+
var LEGACY_MECHANISM = /\b(create_task|tmux)\b/i;
|
|
4560
|
+
var CAVEAT = /\b(subagent|rung|legacy|Agent\(subagent_type)\b/i;
|
|
4561
|
+
var CONTEXT_WINDOW = 220;
|
|
4562
|
+
function lintIdentityContradictions(content) {
|
|
4563
|
+
const findings = [];
|
|
4564
|
+
const lines = content.split("\n");
|
|
4565
|
+
let offset = 0;
|
|
4566
|
+
const lineOffsets = [];
|
|
4567
|
+
for (const line of lines) {
|
|
4568
|
+
lineOffsets.push(offset);
|
|
4569
|
+
offset += line.length + 1;
|
|
4570
|
+
}
|
|
4571
|
+
for (let i = 0; i < lines.length; i++) {
|
|
4572
|
+
const line = lines[i];
|
|
4573
|
+
if (!DELEGATION_VERB.test(line) || !LEGACY_MECHANISM.test(line)) continue;
|
|
4574
|
+
const start = Math.max(0, lineOffsets[i] - CONTEXT_WINDOW);
|
|
4575
|
+
const end = Math.min(content.length, lineOffsets[i] + line.length + CONTEXT_WINDOW);
|
|
4576
|
+
const context = content.slice(start, end);
|
|
4577
|
+
if (CAVEAT.test(context)) continue;
|
|
4578
|
+
findings.push({
|
|
4579
|
+
rule: "create_task-as-default-delegation",
|
|
4580
|
+
reason: "Reads as if create_task/tmux is the default way to route/assign/delegate work, with no nearby mention of subagent, rung, legacy, or Agent(subagent_type. Per the platform Dispatch Ladder, subagents are the default for delegation and create_task/tmux is a legacy rung-3 exception (work that must outlive the session or cross sessions/projects). Uncaveated wording like this caused a real mis-dispatch incident.",
|
|
4581
|
+
excerpt: line.trim()
|
|
4582
|
+
});
|
|
4583
|
+
}
|
|
4584
|
+
return findings;
|
|
4585
|
+
}
|
|
4586
|
+
function formatIdentityContradictionWarning(agentId, findings) {
|
|
4587
|
+
if (findings.length === 0) return null;
|
|
4588
|
+
const lines = findings.map((f) => ` - "${f.excerpt}"`).join("\n");
|
|
4589
|
+
return `\u26A0\uFE0F Possible policy contradiction in ${agentId}'s new identity content (${findings.length} line${findings.length === 1 ? "" : "s"} flagged, write still applied):
|
|
4590
|
+
${lines}
|
|
4591
|
+
${findings[0].reason} This is a lint, not a block \u2014 review the flagged line(s) and caveat them (mention subagent/rung/legacy) if the concern applies.`;
|
|
4592
|
+
}
|
|
4593
|
+
|
|
4594
|
+
// src/mcp/tools/update-identity.ts
|
|
4373
4595
|
function registerUpdateIdentity(server) {
|
|
4374
4596
|
server.registerTool(
|
|
4375
4597
|
"update_identity",
|
|
@@ -4380,10 +4602,17 @@ function registerUpdateIdentity(server) {
|
|
|
4380
4602
|
agent_id: z25.string().describe("Target agent whose identity to write"),
|
|
4381
4603
|
content: z25.string().describe(
|
|
4382
4604
|
"Full markdown content with YAML frontmatter. Must include ---\\nrole: ...\\ntitle: ...\\n---\\n and body sections."
|
|
4605
|
+
),
|
|
4606
|
+
// OPTIONAL, so every existing caller keeps working unchanged.
|
|
4607
|
+
expected_content_hash: z25.string().optional().describe(
|
|
4608
|
+
"The `contentHash` of the identity you READ before editing. Supply it to make this a compare-and-swap: the write is refused if anyone changed the identity in between, instead of silently overwriting their change. Strongly recommended for any edit derived from a previous read."
|
|
4609
|
+
),
|
|
4610
|
+
confirmShrink: z25.boolean().optional().describe(
|
|
4611
|
+
"Required (set true) to replace an existing identity with a substantially smaller one (a >50% shrink). Default false: a large shrink is refused to prevent accidental data loss. Blanking or near-total truncation is refused even when this is true."
|
|
4383
4612
|
)
|
|
4384
4613
|
}
|
|
4385
4614
|
},
|
|
4386
|
-
async ({ agent_id, content }) => {
|
|
4615
|
+
async ({ agent_id, content, expected_content_hash, confirmShrink }) => {
|
|
4387
4616
|
const caller = getActiveAgent();
|
|
4388
4617
|
const allowed = canCoordinate(caller.agentId, caller.agentRole);
|
|
4389
4618
|
if (!allowed) {
|
|
@@ -4404,13 +4633,59 @@ function registerUpdateIdentity(server) {
|
|
|
4404
4633
|
isError: true
|
|
4405
4634
|
};
|
|
4406
4635
|
}
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4636
|
+
let existed = false;
|
|
4637
|
+
let refusal = null;
|
|
4638
|
+
try {
|
|
4639
|
+
await mutateIdentity(
|
|
4640
|
+
agent_id,
|
|
4641
|
+
(current) => {
|
|
4642
|
+
existed = current !== null;
|
|
4643
|
+
if (expected_content_hash !== void 0 && (current?.contentHash ?? "") !== expected_content_hash) {
|
|
4644
|
+
refusal = `REFUSED: "${agent_id}"'s identity changed after you read it (you expected ${expected_content_hash || "no file"}, it is now ${current?.contentHash ?? "no file"}). Your write was NOT applied. Re-read the identity, re-apply your edit on top of the current content, and retry.`;
|
|
4645
|
+
return null;
|
|
4646
|
+
}
|
|
4647
|
+
const dropped = current ? promotedRulesDropped(current.raw, content) : [];
|
|
4648
|
+
if (dropped.length > 0) {
|
|
4649
|
+
refusal = `REFUSED: this write would delete ${dropped.length} promoted lesson(s) from "${agent_id}"'s identity: ${dropped.join(", ")}. Their source behaviours are already deactivated, so the identity file holds the ONLY remaining copy \u2014 dropping them would leave those rules enforced nowhere. Your write was NOT applied. Re-read the identity, keep the promoted lessons you did not intend to remove, and retry. To remove one deliberately, delete its line in a write that keeps the others.`;
|
|
4650
|
+
return null;
|
|
4651
|
+
}
|
|
4652
|
+
return content;
|
|
4653
|
+
},
|
|
4654
|
+
caller.agentId,
|
|
4655
|
+
// The shrink guard is opt-out per call, never blanket-disabled: only
|
|
4656
|
+
// an explicit confirmShrink relaxes it, and the catastrophic floor
|
|
4657
|
+
// (blank body / frontmatter drop / near-total truncation) holds even
|
|
4658
|
+
// then.
|
|
4659
|
+
confirmShrink ? { allowShrink: true } : {}
|
|
4660
|
+
);
|
|
4661
|
+
} catch (err) {
|
|
4662
|
+
if (err instanceof IdentityWriteError) {
|
|
4663
|
+
return {
|
|
4664
|
+
content: [{
|
|
4665
|
+
type: "text",
|
|
4666
|
+
text: `Identity write refused: ${err.message}` + (confirmShrink ? "" : `
|
|
4667
|
+
|
|
4668
|
+
If this substantial shrink is intentional, re-send with confirmShrink: true. (Blanking, dropping the YAML frontmatter, or near-total truncation is refused even with confirmShrink.)`)
|
|
4669
|
+
}],
|
|
4670
|
+
isError: true
|
|
4671
|
+
};
|
|
4672
|
+
}
|
|
4673
|
+
throw err;
|
|
4674
|
+
}
|
|
4675
|
+
if (refusal !== null) {
|
|
4676
|
+
return { content: [{ type: "text", text: refusal }], isError: true };
|
|
4677
|
+
}
|
|
4678
|
+
const action = existed ? "Updated" : "Created";
|
|
4679
|
+
let responseText = `${action} identity for "${agent_id}". File: ~/.exe-os/identity/${agent_id}.md`;
|
|
4680
|
+
const findings = lintIdentityContradictions(content);
|
|
4681
|
+
const warning = formatIdentityContradictionWarning(agent_id, findings);
|
|
4682
|
+
if (warning) responseText += `
|
|
4683
|
+
|
|
4684
|
+
${warning}`;
|
|
4410
4685
|
return {
|
|
4411
4686
|
content: [{
|
|
4412
4687
|
type: "text",
|
|
4413
|
-
text:
|
|
4688
|
+
text: responseText
|
|
4414
4689
|
}]
|
|
4415
4690
|
};
|
|
4416
4691
|
}
|
|
@@ -4543,8 +4818,8 @@ function registerIngestDocument(server) {
|
|
|
4543
4818
|
},
|
|
4544
4819
|
async (input) => {
|
|
4545
4820
|
try {
|
|
4546
|
-
const { assertFeature: assertFeature2 } = await import("./plan-limits-
|
|
4547
|
-
const { assertMemoryLimit: assertMemoryLimit2 } = await import("./plan-limits-
|
|
4821
|
+
const { assertFeature: assertFeature2 } = await import("./plan-limits-ISRRGF23.js");
|
|
4822
|
+
const { assertMemoryLimit: assertMemoryLimit2 } = await import("./plan-limits-ISRRGF23.js");
|
|
4548
4823
|
await assertFeature2("wiki");
|
|
4549
4824
|
await assertMemoryLimit2();
|
|
4550
4825
|
const result3 = await ingestDocument(input);
|
|
@@ -4615,8 +4890,8 @@ function registerPurgeDocument(server) {
|
|
|
4615
4890
|
},
|
|
4616
4891
|
async ({ document_id }) => {
|
|
4617
4892
|
try {
|
|
4618
|
-
const { StewardGate: StewardGate2 } = await import("./steward-gate-
|
|
4619
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
4893
|
+
const { StewardGate: StewardGate2 } = await import("./steward-gate-KMLS5ECC.js");
|
|
4894
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
4620
4895
|
const steward = new StewardGate2();
|
|
4621
4896
|
const agent = getActiveAgent2();
|
|
4622
4897
|
const gateDecision = await steward.checkAuthority(agent.agentId || "unknown", "purge_document", document_id);
|
|
@@ -4786,7 +5061,7 @@ function registerDocument(server) {
|
|
|
4786
5061
|
const { action: _action, ...legacyArgs } = input;
|
|
4787
5062
|
if (action === "list" && (legacyArgs.workspace_id === void 0 || legacyArgs.workspace_id === null || legacyArgs.workspace_id === "")) {
|
|
4788
5063
|
try {
|
|
4789
|
-
const { resolveDefaultWorkspaceId, listWorkspaces } = await import("./documents-
|
|
5064
|
+
const { resolveDefaultWorkspaceId, listWorkspaces } = await import("./documents-HWEJMONR.js");
|
|
4790
5065
|
const defaultId = await resolveDefaultWorkspaceId();
|
|
4791
5066
|
if (defaultId) {
|
|
4792
5067
|
legacyArgs.workspace_id = defaultId;
|
|
@@ -5786,7 +6061,7 @@ async function handleStatus() {
|
|
|
5786
6061
|
detail: wikiUrl ? `API at ${wikiUrl}` : "EXE_WIKI_API_URL not set"
|
|
5787
6062
|
};
|
|
5788
6063
|
try {
|
|
5789
|
-
await import("./graph-rag-
|
|
6064
|
+
await import("./graph-rag-JA7XN7NO.js");
|
|
5790
6065
|
sinks.entity_extraction = { configured: true, detail: "GraphRAG available" };
|
|
5791
6066
|
} catch {
|
|
5792
6067
|
sinks.entity_extraction = { configured: false, detail: "graph-rag module unavailable" };
|
|
@@ -5813,7 +6088,7 @@ async function handleTrigger(limit) {
|
|
|
5813
6088
|
if (rows.rows.length === 0) {
|
|
5814
6089
|
return text3("No conversations found to re-process.");
|
|
5815
6090
|
}
|
|
5816
|
-
const { ingest } = await import("./pipeline-router-
|
|
6091
|
+
const { ingest } = await import("./pipeline-router-NKYAUR3Y.js");
|
|
5817
6092
|
const results = [];
|
|
5818
6093
|
for (const row of rows.rows) {
|
|
5819
6094
|
const r = row;
|
|
@@ -6278,34 +6553,36 @@ function registerGetHotEntities(server) {
|
|
|
6278
6553
|
description: "Get trending entities \u2014 those with the most new relationships in a time period. Surfaces what's most active in the knowledge graph.",
|
|
6279
6554
|
inputSchema: {
|
|
6280
6555
|
period: z43.enum(["24h", "7d", "30d"]).default("7d").describe("Time period to look back"),
|
|
6281
|
-
limit: z43.number().int().min(1).max(50).default(10).describe("Max entities to return")
|
|
6556
|
+
limit: z43.number().int().min(1).max(50).default(10).describe("Max entities to return"),
|
|
6557
|
+
project_name: z43.string().optional().describe("Scope results to a single project")
|
|
6282
6558
|
}
|
|
6283
6559
|
},
|
|
6284
|
-
async ({ period, limit, since: sinceInput }) => {
|
|
6560
|
+
async ({ period, limit, since: sinceInput, project_name: projectName }) => {
|
|
6285
6561
|
try {
|
|
6286
6562
|
const client = getClient();
|
|
6287
6563
|
let since;
|
|
6288
6564
|
if (sinceInput) {
|
|
6289
6565
|
since = new Date(sinceInput);
|
|
6290
6566
|
} else {
|
|
6291
|
-
since = new Date(Date.now() - (PERIOD_MS[period] ?? PERIOD_MS["7d"]));
|
|
6567
|
+
since = new Date(Date.now() - (PERIOD_MS[period ?? "7d"] ?? PERIOD_MS["7d"]));
|
|
6292
6568
|
}
|
|
6293
6569
|
if (isNaN(since.getTime())) {
|
|
6294
6570
|
since = new Date(Date.now() - PERIOD_MS["7d"]);
|
|
6295
6571
|
}
|
|
6296
|
-
const
|
|
6572
|
+
const periodLabel = period ?? (sinceInput ? `since ${sinceInput}` : "7d");
|
|
6573
|
+
const hotEntities = await getHotEntities(client, since, limit, projectName);
|
|
6297
6574
|
if (hotEntities.length === 0) {
|
|
6298
6575
|
return {
|
|
6299
6576
|
content: [
|
|
6300
6577
|
{
|
|
6301
6578
|
type: "text",
|
|
6302
|
-
text: `No entity activity found in the last ${
|
|
6579
|
+
text: `No entity activity found in the last ${periodLabel}${projectName ? ` for project "${projectName}"` : ""}.`
|
|
6303
6580
|
}
|
|
6304
6581
|
]
|
|
6305
6582
|
};
|
|
6306
6583
|
}
|
|
6307
6584
|
const lines = [];
|
|
6308
|
-
lines.push(`## Hot Entities (${
|
|
6585
|
+
lines.push(`## Hot Entities (${periodLabel}${projectName ? ` \u2014 ${projectName}` : ""})
|
|
6309
6586
|
`);
|
|
6310
6587
|
lines.push("| Rank | Entity | Type | New Relationships |");
|
|
6311
6588
|
lines.push("|------|--------|------|-------------------|");
|
|
@@ -6341,15 +6618,16 @@ function registerGetGraphStats(server) {
|
|
|
6341
6618
|
title: "Get Graph Stats",
|
|
6342
6619
|
description: "Get knowledge graph summary statistics: entity count, relationship count, and entity type breakdown.",
|
|
6343
6620
|
inputSchema: {
|
|
6344
|
-
|
|
6621
|
+
project_name: z44.string().optional().describe("Scope stats to a single project")
|
|
6345
6622
|
}
|
|
6346
6623
|
},
|
|
6347
|
-
async () => {
|
|
6624
|
+
async ({ project_name: projectName }) => {
|
|
6348
6625
|
try {
|
|
6349
6626
|
const client = getClient();
|
|
6350
|
-
const stats = await getGraphStats(client);
|
|
6627
|
+
const stats = await getGraphStats(client, projectName);
|
|
6351
6628
|
const lines = [];
|
|
6352
|
-
lines.push(
|
|
6629
|
+
lines.push(`## Knowledge Graph Stats${projectName ? ` \u2014 ${projectName}` : ""}
|
|
6630
|
+
`);
|
|
6353
6631
|
lines.push(`- **Entities:** ${stats.entities.toLocaleString()}`);
|
|
6354
6632
|
lines.push(`- **Relationships:** ${stats.relationships.toLocaleString()}`);
|
|
6355
6633
|
const density = stats.entities > 1 ? (2 * stats.relationships / (stats.entities * (stats.entities - 1))).toFixed(4) : "N/A";
|
|
@@ -6469,8 +6747,8 @@ function registerMergeEntities(server) {
|
|
|
6469
6747
|
};
|
|
6470
6748
|
}
|
|
6471
6749
|
try {
|
|
6472
|
-
const { StewardGate: StewardGate2 } = await import("./steward-gate-
|
|
6473
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
6750
|
+
const { StewardGate: StewardGate2 } = await import("./steward-gate-KMLS5ECC.js");
|
|
6751
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
6474
6752
|
const steward = new StewardGate2();
|
|
6475
6753
|
const agent = getActiveAgent2();
|
|
6476
6754
|
const sourceLabel2 = source_name ?? source_id;
|
|
@@ -6684,7 +6962,7 @@ async function handleExtractFromDocument(args) {
|
|
|
6684
6962
|
return errorResult8('graph action "extract_from_document" requires document_id');
|
|
6685
6963
|
}
|
|
6686
6964
|
try {
|
|
6687
|
-
const { extractGraphFromExistingDocument } = await import("./doc-graph-extractor-
|
|
6965
|
+
const { extractGraphFromExistingDocument } = await import("./doc-graph-extractor-HOKOV7BE.js");
|
|
6688
6966
|
const result3 = await extractGraphFromExistingDocument(documentId);
|
|
6689
6967
|
const lines = [
|
|
6690
6968
|
`## Graph Extraction for Document ${documentId}`,
|
|
@@ -6711,7 +6989,7 @@ async function handleCleanupGarbage(args) {
|
|
|
6711
6989
|
const doMerge = !garbageOnly;
|
|
6712
6990
|
let mod;
|
|
6713
6991
|
try {
|
|
6714
|
-
mod = await import("./cleanup-graph-garbage-
|
|
6992
|
+
mod = await import("./cleanup-graph-garbage-LAPIZGFX.js");
|
|
6715
6993
|
} catch (err) {
|
|
6716
6994
|
return errorResult8(`cleanup_garbage: failed to load cleanup module \u2014 ${err instanceof Error ? err.message : String(err)}`);
|
|
6717
6995
|
}
|
|
@@ -7492,7 +7770,8 @@ function registerGetAutoWakeStatus(server) {
|
|
|
7492
7770
|
const taskResult = await client.execute({
|
|
7493
7771
|
sql: `SELECT assigned_to, COUNT(*) as cnt
|
|
7494
7772
|
FROM tasks
|
|
7495
|
-
WHERE status IN ('open', 'in_progress')
|
|
7773
|
+
WHERE status IN ('open', 'in_progress')
|
|
7774
|
+
AND execution_mode = 'durable_tmux'${awScope.sql}
|
|
7496
7775
|
GROUP BY assigned_to
|
|
7497
7776
|
ORDER BY cnt DESC`,
|
|
7498
7777
|
args: [...awScope.args]
|
|
@@ -7501,7 +7780,8 @@ function registerGetAutoWakeStatus(server) {
|
|
|
7501
7780
|
const blockedResult = await client.execute({
|
|
7502
7781
|
sql: `SELECT assigned_to, title, result
|
|
7503
7782
|
FROM tasks
|
|
7504
|
-
WHERE status = 'blocked'
|
|
7783
|
+
WHERE status = 'blocked'
|
|
7784
|
+
AND execution_mode = 'durable_tmux'${blScope.sql}
|
|
7505
7785
|
ORDER BY updated_at DESC
|
|
7506
7786
|
LIMIT 10`,
|
|
7507
7787
|
args: [...blScope.args]
|
|
@@ -7608,7 +7888,7 @@ async function getAgentSessionLoad() {
|
|
|
7608
7888
|
return { sessions: [], totalLive: 0, busySessions: 0, idleSessions: 0 };
|
|
7609
7889
|
}
|
|
7610
7890
|
const { getClient: getClient2 } = await import("./lib/database.js");
|
|
7611
|
-
const { sessionScopeFilter: sessionScopeFilter2 } = await import("./task-scope-
|
|
7891
|
+
const { sessionScopeFilter: sessionScopeFilter2 } = await import("./task-scope-QANJJXXB.js");
|
|
7612
7892
|
const client = getClient2();
|
|
7613
7893
|
const scope = sessionScopeFilter2();
|
|
7614
7894
|
for (const s of liveAgentSessions) {
|
|
@@ -8015,7 +8295,7 @@ async function cloudStatusText() {
|
|
|
8015
8295
|
if (lastReuploadedAt) lines.push(`- Last re-upload: ${lastReuploadedAt}`);
|
|
8016
8296
|
lines.push("");
|
|
8017
8297
|
try {
|
|
8018
|
-
const { getRetrievalHealth: getRetrievalHealth2, formatDegradations: formatDegradations2 } = await import("./retrieval-health-
|
|
8298
|
+
const { getRetrievalHealth: getRetrievalHealth2, formatDegradations: formatDegradations2 } = await import("./retrieval-health-FCEDWN2P.js");
|
|
8019
8299
|
const h = await getRetrievalHealth2();
|
|
8020
8300
|
lines.push(formatDegradations2(h.degradations, "Health / Degradations"));
|
|
8021
8301
|
lines.push("");
|
|
@@ -8044,7 +8324,7 @@ function registerCloudSync(server) {
|
|
|
8044
8324
|
confirm_local_db_source_of_truth: z60.string().optional().describe('Required for action=reupload. Must exactly equal "LOCAL DB IS SOURCE OF TRUTH".')
|
|
8045
8325
|
}
|
|
8046
8326
|
},
|
|
8047
|
-
async ({ action = "sync", confirm_local_db_source_of_truth }) => {
|
|
8327
|
+
async ({ action = "sync", force = false, confirm_local_db_source_of_truth }) => {
|
|
8048
8328
|
try {
|
|
8049
8329
|
if (action === "status") {
|
|
8050
8330
|
return result(await cloudStatusText());
|
|
@@ -8067,18 +8347,32 @@ function registerCloudSync(server) {
|
|
|
8067
8347
|
true
|
|
8068
8348
|
);
|
|
8069
8349
|
}
|
|
8070
|
-
await
|
|
8350
|
+
const isRetry = await getCloudReuploadInProgress(client) && !force;
|
|
8351
|
+
if (!isRetry) {
|
|
8352
|
+
await cloudResetMemoryBlobs({ apiKey: cloud.apiKey, endpoint: cloud.endpoint });
|
|
8353
|
+
await beginCloudReupload(client);
|
|
8354
|
+
}
|
|
8071
8355
|
let syncResult2;
|
|
8072
8356
|
try {
|
|
8073
|
-
syncResult2 = await cloudSync(
|
|
8357
|
+
syncResult2 = await cloudSync(
|
|
8358
|
+
{ apiKey: cloud.apiKey, endpoint: cloud.endpoint },
|
|
8359
|
+
{ allowKeyRotationReupload: true }
|
|
8360
|
+
);
|
|
8074
8361
|
} catch (err) {
|
|
8075
|
-
await
|
|
8362
|
+
await markCloudReuploadIncomplete(client);
|
|
8076
8363
|
throw err;
|
|
8077
8364
|
}
|
|
8365
|
+
const reuploadMemoryPushFailed = (syncResult2.memoryPushErrors ?? 0) > 0;
|
|
8366
|
+
const reuploadPendingMemories = syncResult2.pendingMemories ?? 0;
|
|
8367
|
+
if (syncResult2.deferred || reuploadMemoryPushFailed) {
|
|
8368
|
+
await markCloudReuploadIncomplete(client);
|
|
8369
|
+
} else {
|
|
8370
|
+
await clearCloudReuploadRequired(client);
|
|
8371
|
+
}
|
|
8078
8372
|
return result([
|
|
8079
|
-
"## Cloud Re-upload Complete",
|
|
8373
|
+
syncResult2.deferred ? "## Cloud Re-upload Paused" : reuploadMemoryPushFailed ? "## Cloud Re-upload Incomplete" : "## Cloud Re-upload Complete",
|
|
8080
8374
|
"",
|
|
8081
|
-
"Normal cloud sync is safe again. Other devices must reconnect using the current 24-word recovery phrase.",
|
|
8375
|
+
syncResult2.deferred ? "Memories are still queued \u2014 the re-upload stopped after a bounded slice. Run it again until it reports complete." : reuploadMemoryPushFailed ? `Re-upload did NOT complete \u2014 ${reuploadPendingMemories.toLocaleString()} memor${reuploadPendingMemories === 1 ? "y" : "ies"} could not be pushed and remain queued locally. The memory push failed (network error or version conflict). Run it again until it reports complete.` : "Normal cloud sync is safe again. Other devices must reconnect using the current 24-word recovery phrase.",
|
|
8082
8376
|
"",
|
|
8083
8377
|
`- Active memories: ${syncResult2.totalMemories.toLocaleString()} (\u2191 ${syncResult2.pushed.toLocaleString()} syncable rows pushed, \u2193 ${syncResult2.pulled.toLocaleString()} pulled)`,
|
|
8084
8378
|
`- Behaviors: \u2191 ${syncResult2.behaviors.pushed.toLocaleString()}, \u2193 ${syncResult2.behaviors.pulled.toLocaleString()}`,
|
|
@@ -8092,7 +8386,11 @@ function registerCloudSync(server) {
|
|
|
8092
8386
|
endpoint: cloud.endpoint
|
|
8093
8387
|
});
|
|
8094
8388
|
const lines = [];
|
|
8095
|
-
|
|
8389
|
+
const memoryPushFailed = (syncResult.memoryPushErrors ?? 0) > 0;
|
|
8390
|
+
const pendingMemories = syncResult.pendingMemories ?? 0;
|
|
8391
|
+
lines.push(
|
|
8392
|
+
syncResult.deferred ? "## Cloud Sync Paused\n" : memoryPushFailed ? "## Cloud Sync Incomplete\n" : "## Cloud Sync Complete\n"
|
|
8393
|
+
);
|
|
8096
8394
|
lines.push("| Category | Pushed | Pulled |");
|
|
8097
8395
|
lines.push("|----------|--------|--------|");
|
|
8098
8396
|
lines.push(`| Memories | ${syncResult.pushed.toLocaleString()} | ${syncResult.pulled.toLocaleString()} |`);
|
|
@@ -8104,6 +8402,17 @@ function registerCloudSync(server) {
|
|
|
8104
8402
|
lines.push("");
|
|
8105
8403
|
lines.push(`**Active memories:** ${syncResult.totalMemories.toLocaleString()}`);
|
|
8106
8404
|
lines.push(`**Roster:** ${syncResult.roster.employees} employees, ${syncResult.roster.identities} identities`);
|
|
8405
|
+
if (syncResult.deferred) {
|
|
8406
|
+
lines.push("");
|
|
8407
|
+
lines.push(
|
|
8408
|
+
"Sync paused after a bounded memory slice \u2014 memories are still queued and the later stages did not run. Run it again (or let the background sync continue) until it reports complete."
|
|
8409
|
+
);
|
|
8410
|
+
} else if (memoryPushFailed) {
|
|
8411
|
+
lines.push("");
|
|
8412
|
+
lines.push(
|
|
8413
|
+
`Sync did NOT complete \u2014 ${pendingMemories.toLocaleString()} memor${pendingMemories === 1 ? "y" : "ies"} could not be pushed and remain queued locally. The memory push failed (network error or version conflict) and the cursor did not advance, so the cloud copy is missing these rows. Run it again until it reports complete.`
|
|
8414
|
+
);
|
|
8415
|
+
}
|
|
8107
8416
|
return result(lines.join("\n"));
|
|
8108
8417
|
} catch (err) {
|
|
8109
8418
|
return result(`Cloud operation failed: ${err instanceof Error ? err.message : String(err)}`, true);
|
|
@@ -9522,7 +9831,7 @@ function registerCreateTrigger(server) {
|
|
|
9522
9831
|
};
|
|
9523
9832
|
}
|
|
9524
9833
|
const normalizedConditions = conditions == null ? [] : conditions;
|
|
9525
|
-
const { assertFeature: assertFeature2 } = await import("./plan-limits-
|
|
9834
|
+
const { assertFeature: assertFeature2 } = await import("./plan-limits-ISRRGF23.js");
|
|
9526
9835
|
const gatedActions = {
|
|
9527
9836
|
send_whatsapp: "external_agents",
|
|
9528
9837
|
update_wiki: "wiki"
|
|
@@ -10590,8 +10899,8 @@ function buildHandlers5() {
|
|
|
10590
10899
|
}
|
|
10591
10900
|
async function handleDreaming(action, args) {
|
|
10592
10901
|
try {
|
|
10593
|
-
const { DreamingEngine: DreamingEngine2 } = await import("./dreaming-
|
|
10594
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
10902
|
+
const { DreamingEngine: DreamingEngine2 } = await import("./dreaming-FMNDODG2.js");
|
|
10903
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
10595
10904
|
const { getClient: getClient2 } = await import("./lib/database.js");
|
|
10596
10905
|
const agentId = args.agent_id ?? getActiveAgent2().agentId;
|
|
10597
10906
|
if (action === "dreaming_run") {
|
|
@@ -10795,11 +11104,11 @@ function registerConfig(server) {
|
|
|
10795
11104
|
}
|
|
10796
11105
|
if (action === "closeout") {
|
|
10797
11106
|
try {
|
|
10798
|
-
const { DreamingEngine: DreamingEngine2 } = await import("./dreaming-
|
|
10799
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
11107
|
+
const { DreamingEngine: DreamingEngine2 } = await import("./dreaming-FMNDODG2.js");
|
|
11108
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
10800
11109
|
const { writeMemory: writeMemory2, flushBatch: flushBatch2 } = await import("./lib/store.js");
|
|
10801
11110
|
const { randomUUID: randomUUID2 } = await import("crypto");
|
|
10802
|
-
const { getProjectName: getProjectName2 } = await import("./project-name-
|
|
11111
|
+
const { getProjectName: getProjectName2 } = await import("./project-name-WKSNNKXK.js");
|
|
10803
11112
|
const { retryOnDaemonTransportError } = await import("./lib/db-daemon-client.js");
|
|
10804
11113
|
const agentId = args.agent_id ?? getActiveAgent2().agentId;
|
|
10805
11114
|
const hours = args.hours ?? 24;
|
|
@@ -10877,7 +11186,7 @@ function registerConfig(server) {
|
|
|
10877
11186
|
}
|
|
10878
11187
|
if (action === "capability_cards") {
|
|
10879
11188
|
try {
|
|
10880
|
-
const { getAllCapabilityCards, findAgentForTask } = await import("./capability-cards-
|
|
11189
|
+
const { getAllCapabilityCards, findAgentForTask } = await import("./capability-cards-EDZ62HKG.js");
|
|
10881
11190
|
const cards = getAllCapabilityCards();
|
|
10882
11191
|
const taskQuery = args.query;
|
|
10883
11192
|
if (taskQuery) {
|
|
@@ -10928,7 +11237,7 @@ function registerConfig(server) {
|
|
|
10928
11237
|
const existing = loadEmployeesSync2();
|
|
10929
11238
|
if (existing.some((e) => e.name === employeeName)) return errorResult9(`Employee "${employeeName}" already exists.`);
|
|
10930
11239
|
try {
|
|
10931
|
-
const { assertEmployeeLimit: assertEmployeeLimit2 } = await import("./plan-limits-
|
|
11240
|
+
const { assertEmployeeLimit: assertEmployeeLimit2 } = await import("./plan-limits-ISRRGF23.js");
|
|
10932
11241
|
await assertEmployeeLimit2();
|
|
10933
11242
|
} catch (e) {
|
|
10934
11243
|
return errorResult9(e instanceof Error ? e.message : "Employee limit reached.");
|
|
@@ -10969,7 +11278,7 @@ You are ${employeeName}. Role: ${role}.`, "utf-8");
|
|
|
10969
11278
|
}
|
|
10970
11279
|
try {
|
|
10971
11280
|
const { generateSessionWrappers } = await import("./lib/session-wrappers.js");
|
|
10972
|
-
const { resolvePackageRoot } = await import("./installer-
|
|
11281
|
+
const { resolvePackageRoot } = await import("./installer-S624ZOMB.js");
|
|
10973
11282
|
generateSessionWrappers(resolvePackageRoot());
|
|
10974
11283
|
} catch {
|
|
10975
11284
|
}
|
|
@@ -10982,7 +11291,7 @@ You are ${employeeName}. Role: ${role}.`, "utf-8");
|
|
|
10982
11291
|
}
|
|
10983
11292
|
if (action === "restart_telemetry") {
|
|
10984
11293
|
try {
|
|
10985
|
-
const { buildRestartReport, formatRestartReport } = await import("./daemon-restart-report-
|
|
11294
|
+
const { buildRestartReport, formatRestartReport } = await import("./daemon-restart-report-FIO5HZTJ.js");
|
|
10986
11295
|
const report = buildRestartReport();
|
|
10987
11296
|
const humanReadable = formatRestartReport(report);
|
|
10988
11297
|
return {
|
|
@@ -11066,7 +11375,7 @@ function registerListWikiPages(server) {
|
|
|
11066
11375
|
}
|
|
11067
11376
|
},
|
|
11068
11377
|
async ({ workspace, folder }) => {
|
|
11069
|
-
const { assertFeature: assertFeature2 } = await import("./plan-limits-
|
|
11378
|
+
const { assertFeature: assertFeature2 } = await import("./plan-limits-ISRRGF23.js");
|
|
11070
11379
|
await assertFeature2("wiki");
|
|
11071
11380
|
const apiUrl = process.env.EXE_WIKI_API_URL;
|
|
11072
11381
|
const apiKey = process.env.EXE_WIKI_API_KEY;
|
|
@@ -11166,7 +11475,7 @@ function registerGetWikiPage(server) {
|
|
|
11166
11475
|
}
|
|
11167
11476
|
},
|
|
11168
11477
|
async ({ workspace, document_id, title }) => {
|
|
11169
|
-
const { assertFeature: assertFeature2 } = await import("./plan-limits-
|
|
11478
|
+
const { assertFeature: assertFeature2 } = await import("./plan-limits-ISRRGF23.js");
|
|
11170
11479
|
await assertFeature2("wiki");
|
|
11171
11480
|
const apiUrl = process.env.EXE_WIKI_API_URL;
|
|
11172
11481
|
const apiKey = process.env.EXE_WIKI_API_KEY;
|
|
@@ -11360,10 +11669,10 @@ async function handleWikiSearch(input) {
|
|
|
11360
11669
|
const userId = input.user_id;
|
|
11361
11670
|
if (!workspace) return errorResult10('wiki action "search" requires workspace');
|
|
11362
11671
|
if (!query) return errorResult10('wiki action "search" requires query');
|
|
11363
|
-
const { assertFeature: assertFeature2 } = await import("./plan-limits-
|
|
11672
|
+
const { assertFeature: assertFeature2 } = await import("./plan-limits-ISRRGF23.js");
|
|
11364
11673
|
await assertFeature2("wiki");
|
|
11365
11674
|
if (userId) {
|
|
11366
|
-
const { checkWikiAccess } = await import("./wiki-acl-
|
|
11675
|
+
const { checkWikiAccess } = await import("./wiki-acl-MFOYK5F4.js");
|
|
11367
11676
|
const { allowed } = await checkWikiAccess(String(userId), String(workspace), "read");
|
|
11368
11677
|
if (!allowed) {
|
|
11369
11678
|
return errorResult10(`Access denied: user "${userId}" does not have read access to workspace "${workspace}"`);
|
|
@@ -11466,7 +11775,7 @@ function registerWiki(server) {
|
|
|
11466
11775
|
return errorResult10('wiki action "document_rerank" requires at least one candidate');
|
|
11467
11776
|
}
|
|
11468
11777
|
if (user_id && legacyArgs.workspace) {
|
|
11469
|
-
const { checkWikiAccess } = await import("./wiki-acl-
|
|
11778
|
+
const { checkWikiAccess } = await import("./wiki-acl-MFOYK5F4.js");
|
|
11470
11779
|
const { allowed } = await checkWikiAccess(
|
|
11471
11780
|
String(user_id),
|
|
11472
11781
|
String(legacyArgs.workspace),
|
|
@@ -11518,9 +11827,9 @@ function registerBehavior(server) {
|
|
|
11518
11827
|
"behavior",
|
|
11519
11828
|
{
|
|
11520
11829
|
title: "Behavior",
|
|
11521
|
-
description: "Manage behavioral patterns, corrections, and reusable procedures for employees. Actions: store (create new), list (query existing), audit (creation context), deactivate (soft-delete, restricted), reactivate (re-enable deactivated, restricted), purge (hard-delete inactive, or purge_ghosts=true to delete corrupt empty/null-id rows; restricted).",
|
|
11830
|
+
description: "Manage behavioral patterns, corrections, and reusable procedures for employees. Actions: store (create new), list (query existing), audit (creation context), deactivate (soft-delete, restricted), reactivate (re-enable deactivated, restricted), purge (hard-delete inactive, or purge_ghosts=true to delete corrupt empty/null-id rows; restricted), promote (move a long-stable behavior into the agent's identity file and free its injection slot; restricted), promotable (list behaviors that clear the stability filter).",
|
|
11522
11831
|
inputSchema: {
|
|
11523
|
-
action: z83.enum(["store", "list", "deactivate", "reactivate", "audit", "purge"]).describe("Action to perform"),
|
|
11832
|
+
action: z83.enum(["store", "list", "deactivate", "reactivate", "audit", "purge", "promote", "promotable"]).describe("Action to perform"),
|
|
11524
11833
|
content: z83.string().superRefine((val, ctx) => {
|
|
11525
11834
|
if (val.length > BEHAVIOR_CONTENT_MAX_LENGTH) {
|
|
11526
11835
|
ctx.addIssue({
|
|
@@ -11547,10 +11856,12 @@ function registerBehavior(server) {
|
|
|
11547
11856
|
older_than_days: z83.coerce.number().int().min(0).optional().describe("For purge: only hard-delete inactive behaviors older than this many days. Default 30."),
|
|
11548
11857
|
dry_run: z83.boolean().optional().default(true).describe("For purge: preview by default; set false to permanently delete matching inactive behaviors."),
|
|
11549
11858
|
purge_ghosts: z83.boolean().optional().describe("For purge: target ghost rows (empty content or NULL id) regardless of active status / age, instead of aged inactive behaviors. Use to clean up corrupt rows that flood behavior list. (purge)"),
|
|
11859
|
+
min_stable_days: z83.coerce.number().int().min(0).optional().describe("For promote/promotable: how many days a behavior must have been active and unchanged. Default 30. NOTE: this measures stability, not measured adherence \u2014 there is no violation telemetry on behaviors."),
|
|
11860
|
+
force: z83.boolean().optional().describe("For promote: skip the stability filter for a deliberate, human-directed promotion."),
|
|
11550
11861
|
bulk: z83.boolean().optional().describe("For purge with purge_ghosts=true: drain ALL ghost rows in bounded batches in a single call (handles millions of rows safely) and VACUUM. Use when the ghost table is too large to clear 1000-at-a-time. (purge)")
|
|
11551
11862
|
}
|
|
11552
11863
|
},
|
|
11553
|
-
async ({ action, content, domain, priority, trigger, trigger_action, agent_id, project_name, behavior_id, shared_skills, device_scoped, limit, offset, older_than_days, dry_run, purge_ghosts, bulk }) => {
|
|
11864
|
+
async ({ action, content, domain, priority, trigger, trigger_action, agent_id, project_name, behavior_id, shared_skills, device_scoped, limit, offset, older_than_days, dry_run, purge_ghosts, bulk, min_stable_days, force }) => {
|
|
11554
11865
|
if (action === "list") {
|
|
11555
11866
|
if (shared_skills) {
|
|
11556
11867
|
const currentAgent = agent_id ?? getActiveAgent().agentId;
|
|
@@ -11733,8 +12044,8 @@ Trigger: ${trigger}
|
|
|
11733
12044
|
Action: ${trigger_action}
|
|
11734
12045
|
Priority: p0 (always injected). The agent decides whether to act.` : `Behavior stored for ${resolvedAgent}. ID: ${id}`;
|
|
11735
12046
|
try {
|
|
11736
|
-
const { countActiveBehaviors } = await import("./behaviors-
|
|
11737
|
-
const { formatOverCapWarning } = await import("./behavior-injection-
|
|
12047
|
+
const { countActiveBehaviors } = await import("./behaviors-GPI4BLTC.js");
|
|
12048
|
+
const { formatOverCapWarning } = await import("./behavior-injection-GMZKZ3BT.js");
|
|
11738
12049
|
const counts = await countActiveBehaviors(resolvedAgent, resolvedProject);
|
|
11739
12050
|
const warning = formatOverCapWarning(resolvedAgent, counts);
|
|
11740
12051
|
if (warning) responseText += `
|
|
@@ -11822,7 +12133,7 @@ Use /exe-forget to remove any that this supersedes.`;
|
|
|
11822
12133
|
}]
|
|
11823
12134
|
};
|
|
11824
12135
|
}
|
|
11825
|
-
const { bulkPurgeGhostBehaviors } = await import("./behaviors-
|
|
12136
|
+
const { bulkPurgeGhostBehaviors } = await import("./behaviors-GPI4BLTC.js");
|
|
11826
12137
|
const res = await bulkPurgeGhostBehaviors({ batchSize: 5e3, vacuum: true });
|
|
11827
12138
|
return {
|
|
11828
12139
|
content: [{
|
|
@@ -11919,6 +12230,63 @@ Use /exe-forget to remove any that this supersedes.`;
|
|
|
11919
12230
|
content: [{ type: "text", text: `Purged ${ids.length} inactive behavior(s).` }]
|
|
11920
12231
|
};
|
|
11921
12232
|
}
|
|
12233
|
+
if (action === "promotable") {
|
|
12234
|
+
const targetAgent = agent_id ?? getActiveAgent().agentId;
|
|
12235
|
+
const { listPromotionCandidates, DEFAULT_MIN_STABLE_DAYS } = await import("./behavior-promotion-QPC4AQ24.js");
|
|
12236
|
+
const candidates = await listPromotionCandidates(targetAgent, {
|
|
12237
|
+
projectName: project_name,
|
|
12238
|
+
minStableDays: min_stable_days,
|
|
12239
|
+
limit: limit ?? 100
|
|
12240
|
+
});
|
|
12241
|
+
if (candidates.length === 0) {
|
|
12242
|
+
return { content: [{ type: "text", text: `No behaviors for ${targetAgent} have been active and unchanged for ${min_stable_days ?? DEFAULT_MIN_STABLE_DAYS} days.` }] };
|
|
12243
|
+
}
|
|
12244
|
+
const lines = candidates.map(
|
|
12245
|
+
(c) => `- [${c.behavior.priority}] ${c.behavior.content.slice(0, 160)}
|
|
12246
|
+
ID: ${c.behavior.id} \u2014 stable ${c.eligibility.stableDays}d`
|
|
12247
|
+
);
|
|
12248
|
+
return {
|
|
12249
|
+
content: [{
|
|
12250
|
+
type: "text",
|
|
12251
|
+
text: `${candidates.length} promotable behavior(s) for ${targetAgent}.
|
|
12252
|
+
|
|
12253
|
+
Promotion moves a rule into the identity file, which is injected on a SEPARATE path from behaviors \u2014 so each promotion frees one behavior injection slot. "Stable" here means active and unchanged, NOT measured adherence: there is no violation telemetry on behaviors, and a check that implied otherwise would be reporting on nothing.
|
|
12254
|
+
|
|
12255
|
+
` + lines.join("\n")
|
|
12256
|
+
}]
|
|
12257
|
+
};
|
|
12258
|
+
}
|
|
12259
|
+
if (action === "promote") {
|
|
12260
|
+
const caller2 = getActiveAgent();
|
|
12261
|
+
if (!canCoordinate(caller2.agentId, caller2.agentRole)) {
|
|
12262
|
+
return { content: [{ type: "text", text: `Permission denied. Only coordinator or founder can promote behaviors. You are "${caller2.agentId}".` }], isError: true };
|
|
12263
|
+
}
|
|
12264
|
+
if (!behavior_id) {
|
|
12265
|
+
return { content: [{ type: "text", text: "Missing required field: behavior_id is required for promote action." }], isError: true };
|
|
12266
|
+
}
|
|
12267
|
+
const targetAgent = agent_id ?? caller2.agentId;
|
|
12268
|
+
const { promoteBehaviorToIdentity } = await import("./behavior-promotion-QPC4AQ24.js");
|
|
12269
|
+
const result4 = await promoteBehaviorToIdentity({
|
|
12270
|
+
behaviorId: behavior_id,
|
|
12271
|
+
agentId: targetAgent,
|
|
12272
|
+
promotedBy: caller2.agentId,
|
|
12273
|
+
projectName: project_name,
|
|
12274
|
+
minStableDays: min_stable_days,
|
|
12275
|
+
force
|
|
12276
|
+
});
|
|
12277
|
+
if (!result4.promoted) {
|
|
12278
|
+
return { content: [{ type: "text", text: `Not promoted: ${result4.reason}` }], isError: true };
|
|
12279
|
+
}
|
|
12280
|
+
const r = result4.record;
|
|
12281
|
+
return {
|
|
12282
|
+
content: [{
|
|
12283
|
+
type: "text",
|
|
12284
|
+
text: `Promoted behavior ${r.behaviorId} into ${r.agentId}'s identity.
|
|
12285
|
+
Stable for ${r.stableDays} days; promoted by ${r.promotedBy}.
|
|
12286
|
+
` + (r.slotFreed ? `Source behavior deactivated \u2014 ONE behavior injection slot freed.` : `WARNING: the source behavior could NOT be deactivated, so this rule is now live in BOTH the identity file and the behavior set. Deactivate it manually: behavior(action='deactivate', behavior_id='${r.behaviorId}').`)
|
|
12287
|
+
}]
|
|
12288
|
+
};
|
|
12289
|
+
}
|
|
11922
12290
|
if (action === "reactivate") {
|
|
11923
12291
|
const caller2 = getActiveAgent();
|
|
11924
12292
|
if (!canCoordinate(caller2.agentId, caller2.agentRole)) {
|
|
@@ -11933,7 +12301,7 @@ Use /exe-forget to remove any that this supersedes.`;
|
|
|
11933
12301
|
return { content: [{ type: "text", text: `Behavior not found: ${behavior_id}` }], isError: true };
|
|
11934
12302
|
}
|
|
11935
12303
|
const row2 = result4.rows[0];
|
|
11936
|
-
const { reactivateBehavior: reactivateBehavior2 } = await import("./behaviors-
|
|
12304
|
+
const { reactivateBehavior: reactivateBehavior2 } = await import("./behaviors-GPI4BLTC.js");
|
|
11937
12305
|
const wasReactivated = await reactivateBehavior2(behavior_id);
|
|
11938
12306
|
if (!wasReactivated) {
|
|
11939
12307
|
return { content: [{ type: "text", text: `Behavior ${behavior_id} is already active.` }] };
|
|
@@ -12476,7 +12844,7 @@ function registerWorkflowTool(server) {
|
|
|
12476
12844
|
getWorkflowInstance,
|
|
12477
12845
|
listWorkflowInstances,
|
|
12478
12846
|
approveWorkflowStep
|
|
12479
|
-
} = await import("./workflow-engine-
|
|
12847
|
+
} = await import("./workflow-engine-RZ7QEI3Z.js");
|
|
12480
12848
|
try {
|
|
12481
12849
|
switch (input.action) {
|
|
12482
12850
|
case "create_workflow": {
|
|
@@ -12694,7 +13062,7 @@ async function maybeSendUpstream(payload) {
|
|
|
12694
13062
|
body,
|
|
12695
13063
|
signal: AbortSignal.timeout(1e4)
|
|
12696
13064
|
});
|
|
12697
|
-
if (!response.ok) return `failed:
|
|
13065
|
+
if (!response.ok) return `failed: ${await describeUpstreamFailure(response)}`;
|
|
12698
13066
|
if (encrypted) return "sent (encrypted)";
|
|
12699
13067
|
const parts = ["sanitized"];
|
|
12700
13068
|
if (redactedCount > 0) parts.push(`${redactedCount} secret${redactedCount === 1 ? "" : "s"} redacted`);
|
|
@@ -12781,7 +13149,7 @@ function registerCreateBugReport(server) {
|
|
|
12781
13149
|
const version = sanitizeVersionField(package_version) ?? "unknown";
|
|
12782
13150
|
let metricsSnapshot = "";
|
|
12783
13151
|
try {
|
|
12784
|
-
const { getOrchestrationMetrics, formatOrchestrationMetrics } = await import("./orchestration-events-
|
|
13152
|
+
const { getOrchestrationMetrics, formatOrchestrationMetrics } = await import("./orchestration-events-JPHB6NPY.js");
|
|
12785
13153
|
const sinceIso = new Date(Date.now() - 60 * 60 * 1e3).toISOString();
|
|
12786
13154
|
const metrics = await getOrchestrationMetrics({ sinceIso });
|
|
12787
13155
|
if (metrics.totalEvents > 0) {
|
|
@@ -13001,7 +13369,7 @@ async function maybeSendUpstream2(payload) {
|
|
|
13001
13369
|
body: outboundBody,
|
|
13002
13370
|
signal: AbortSignal.timeout(1e4)
|
|
13003
13371
|
});
|
|
13004
|
-
if (!response.ok) return `failed:
|
|
13372
|
+
if (!response.ok) return `failed: ${await describeUpstreamFailure(response)}`;
|
|
13005
13373
|
const parts = ["sanitized"];
|
|
13006
13374
|
if (redactedCount > 0) parts.push(`${redactedCount} secret${redactedCount === 1 ? "" : "s"} redacted`);
|
|
13007
13375
|
if (truncatedCount > 0) parts.push(`${truncatedCount} field${truncatedCount === 1 ? "" : "s"} truncated`);
|
|
@@ -13285,6 +13653,39 @@ async function buildUpdateSection(filePath, opts) {
|
|
|
13285
13653
|
const titleMatch = existing.match(/^# Bug Report — (.+)$/m);
|
|
13286
13654
|
return { title: titleMatch?.[1] ?? "Unknown bug", updateBlock };
|
|
13287
13655
|
}
|
|
13656
|
+
async function collectBugAuthorIdentities(id) {
|
|
13657
|
+
const identities = [];
|
|
13658
|
+
try {
|
|
13659
|
+
const resolved = await findReportFile(id);
|
|
13660
|
+
if (resolved) {
|
|
13661
|
+
const content = await readFile2(resolved.filePath, "utf-8");
|
|
13662
|
+
const filedBy = content.match(/^filed_by:\s*(.+)$/m)?.[1]?.trim();
|
|
13663
|
+
if (filedBy) identities.push(filedBy);
|
|
13664
|
+
}
|
|
13665
|
+
} catch {
|
|
13666
|
+
}
|
|
13667
|
+
try {
|
|
13668
|
+
const config = await loadConfig();
|
|
13669
|
+
const adminToken = resolveSupportAdminToken(config);
|
|
13670
|
+
if (adminToken) {
|
|
13671
|
+
const support = config.support;
|
|
13672
|
+
const base = (process.env.ASKEXE_SUPPORT_ADMIN_ENDPOINT || support?.adminEndpoint || support?.admin_endpoint || "https://api.askexe.com/admin/support/bug-reports").replace(/\/+$/, "");
|
|
13673
|
+
const parsed = new URL(`${base}/${encodeURIComponent(sanitizeUpstreamId(id))}`);
|
|
13674
|
+
if (parsed.protocol === "https:" || ["localhost", "127.0.0.1", "::1"].includes(parsed.hostname)) {
|
|
13675
|
+
const resp = await fetch(parsed, {
|
|
13676
|
+
headers: { authorization: `Bearer ${adminToken}` },
|
|
13677
|
+
signal: AbortSignal.timeout(5e3)
|
|
13678
|
+
});
|
|
13679
|
+
if (resp.ok) {
|
|
13680
|
+
const row = await resp.json();
|
|
13681
|
+
identities.push(row?.agent_id, row?.license_email);
|
|
13682
|
+
}
|
|
13683
|
+
}
|
|
13684
|
+
}
|
|
13685
|
+
} catch {
|
|
13686
|
+
}
|
|
13687
|
+
return identities;
|
|
13688
|
+
}
|
|
13288
13689
|
async function sendUpstream(payload, isAdmin) {
|
|
13289
13690
|
const config = await loadConfig();
|
|
13290
13691
|
const routerUrl = process.env.API_ROUTER_URL?.replace(/\/+$/, "");
|
|
@@ -13318,7 +13719,7 @@ async function sendUpstream(payload, isAdmin) {
|
|
|
13318
13719
|
body: sanitizedUpstreamBody(payload, "update-bug-report"),
|
|
13319
13720
|
signal: AbortSignal.timeout(1e4)
|
|
13320
13721
|
});
|
|
13321
|
-
if (!response.ok) return `failed:
|
|
13722
|
+
if (!response.ok) return `failed: ${await describeUpstreamFailure(response)}`;
|
|
13322
13723
|
return "sent";
|
|
13323
13724
|
} catch (err) {
|
|
13324
13725
|
return `failed: ${err instanceof Error ? err.message : String(err)}`;
|
|
@@ -13382,7 +13783,18 @@ function registerUpdateBugReport(server) {
|
|
|
13382
13783
|
content: [{ type: "text", text: describeOversizeRefusal(oversize) }]
|
|
13383
13784
|
};
|
|
13384
13785
|
}
|
|
13385
|
-
const
|
|
13786
|
+
const attestsByIdentity = verification.verification_kind === "manual" || verification.verification_kind === "ops_transcript" || verification.disposition !== void 0 && verification.disposition !== "fixed";
|
|
13787
|
+
let resolvedVerification = resolveVerificationArtifact(gatedStatus, verification);
|
|
13788
|
+
if (resolvedVerification.ok && isVerifiedStatus(gatedStatus) && attestsByIdentity) {
|
|
13789
|
+
const authorIdentities = await collectBugAuthorIdentities(id);
|
|
13790
|
+
resolvedVerification = resolveVerificationArtifact(gatedStatus, verification, { authorIdentities });
|
|
13791
|
+
if (!resolvedVerification.ok) {
|
|
13792
|
+
const namedAuthors = authorIdentities.filter((a) => typeof a === "string" && a.trim().length > 0).map((a) => a.trim());
|
|
13793
|
+
const authorNote = resolvedVerification.message.includes("manual_verifier_is_author") && namedAuthors.length > 0 ? `
|
|
13794
|
+
This record's author/assignee identities: ${namedAuthors.join(", ")}. Name a DIFFERENT person or employee as the verifier \u2014 a manual close attested by its own author is exactly what the gate exists to refuse, locally and server-side.` : "";
|
|
13795
|
+
return { isError: true, content: [{ type: "text", text: resolvedVerification.message + authorNote }] };
|
|
13796
|
+
}
|
|
13797
|
+
}
|
|
13386
13798
|
if (!resolvedVerification.ok) {
|
|
13387
13799
|
return { isError: true, content: [{ type: "text", text: resolvedVerification.message }] };
|
|
13388
13800
|
}
|
|
@@ -13640,7 +14052,7 @@ async function sendUpstream2(payload) {
|
|
|
13640
14052
|
body: sanitizedUpstreamBody(payload, "update-feature-request"),
|
|
13641
14053
|
signal: AbortSignal.timeout(1e4)
|
|
13642
14054
|
});
|
|
13643
|
-
if (!response.ok) return `failed:
|
|
14055
|
+
if (!response.ok) return `failed: ${await describeUpstreamFailure(response)}`;
|
|
13644
14056
|
return "sent";
|
|
13645
14057
|
} catch (err) {
|
|
13646
14058
|
return `failed: ${err instanceof Error ? err.message : String(err)}`;
|
|
@@ -14273,7 +14685,7 @@ function registerCliParityTools(server) {
|
|
|
14273
14685
|
const out = await runCommand("exe-os", ["cloud", "status"], 45e3);
|
|
14274
14686
|
let healthSection = "";
|
|
14275
14687
|
try {
|
|
14276
|
-
const { getRetrievalHealth: getRetrievalHealth2, formatDegradations: formatDegradations2 } = await import("./retrieval-health-
|
|
14688
|
+
const { getRetrievalHealth: getRetrievalHealth2, formatDegradations: formatDegradations2 } = await import("./retrieval-health-FCEDWN2P.js");
|
|
14277
14689
|
const h = await getRetrievalHealth2();
|
|
14278
14690
|
const lines = [
|
|
14279
14691
|
"",
|
|
@@ -14317,7 +14729,7 @@ function jsonResult2(value) {
|
|
|
14317
14729
|
}
|
|
14318
14730
|
async function ensureCodeContextWatcher(projectRoot) {
|
|
14319
14731
|
try {
|
|
14320
|
-
const { startCodeContextWatcher } = await import("./code-context-watcher-
|
|
14732
|
+
const { startCodeContextWatcher } = await import("./code-context-watcher-4F7K2N3U.js");
|
|
14321
14733
|
startCodeContextWatcher(resolveCodeContextProjectRoot(projectRoot));
|
|
14322
14734
|
} catch {
|
|
14323
14735
|
}
|
|
@@ -14348,7 +14760,7 @@ function registerCodeContext(server) {
|
|
|
14348
14760
|
const index = await buildCodeContextIndexAsync(opts);
|
|
14349
14761
|
let graphExtract;
|
|
14350
14762
|
try {
|
|
14351
|
-
const { autoExtractGraphEntities } = await import("./graph-auto-extract-
|
|
14763
|
+
const { autoExtractGraphEntities } = await import("./graph-auto-extract-7POGAKHM.js");
|
|
14352
14764
|
graphExtract = await autoExtractGraphEntities(index.projectRoot);
|
|
14353
14765
|
} catch {
|
|
14354
14766
|
}
|
|
@@ -14813,7 +15225,7 @@ async function maybeSendUpstream3(payload) {
|
|
|
14813
15225
|
body: sanitizedUpstreamBody(payload, "create-review"),
|
|
14814
15226
|
signal: AbortSignal.timeout(1e4)
|
|
14815
15227
|
});
|
|
14816
|
-
if (!response.ok) return `failed:
|
|
15228
|
+
if (!response.ok) return `failed: ${await describeUpstreamFailure(response)}`;
|
|
14817
15229
|
return "sent";
|
|
14818
15230
|
} catch (err) {
|
|
14819
15231
|
return `failed: ${err instanceof Error ? err.message : String(err)}`;
|
|
@@ -15214,7 +15626,7 @@ function registerDiagnostics(server) {
|
|
|
15214
15626
|
}
|
|
15215
15627
|
if (action === "daemon_restarts") {
|
|
15216
15628
|
try {
|
|
15217
|
-
const { buildRestartReport, formatRestartReport } = await import("./daemon-restart-report-
|
|
15629
|
+
const { buildRestartReport, formatRestartReport } = await import("./daemon-restart-report-FIO5HZTJ.js");
|
|
15218
15630
|
const verbose = input.format === "verbose";
|
|
15219
15631
|
const report = buildRestartReport({ topTimers: verbose ? 25 : 10 });
|
|
15220
15632
|
return { content: [{ type: "text", text: formatRestartReport(report) }] };
|
|
@@ -15224,7 +15636,7 @@ function registerDiagnostics(server) {
|
|
|
15224
15636
|
}
|
|
15225
15637
|
if (action === "timers") {
|
|
15226
15638
|
try {
|
|
15227
|
-
const { buildLiveTimerReport, formatTimerReport } = await import("./daemon-timer-report-
|
|
15639
|
+
const { buildLiveTimerReport, formatTimerReport } = await import("./daemon-timer-report-6UK5PSDP.js");
|
|
15228
15640
|
const report = await buildLiveTimerReport();
|
|
15229
15641
|
const asJson = input.format === "json";
|
|
15230
15642
|
return {
|
|
@@ -15391,7 +15803,7 @@ async function handleReprojectWorktreeMemories(input) {
|
|
|
15391
15803
|
const sessionScope = rawScope;
|
|
15392
15804
|
try {
|
|
15393
15805
|
const { getClient: getClient2 } = await import("./lib/database.js");
|
|
15394
|
-
const { runReprojectWorktreeMemories, formatReprojectReport } = await import("./reproject-worktree-memories-
|
|
15806
|
+
const { runReprojectWorktreeMemories, formatReprojectReport } = await import("./reproject-worktree-memories-DAA5GWMH.js");
|
|
15395
15807
|
const client = await getClient2();
|
|
15396
15808
|
const result3 = await runReprojectWorktreeMemories(
|
|
15397
15809
|
client,
|
|
@@ -15410,7 +15822,7 @@ async function handleReprojectWorktreeMemories(input) {
|
|
|
15410
15822
|
}
|
|
15411
15823
|
async function handleMemoryIsolation(input) {
|
|
15412
15824
|
try {
|
|
15413
|
-
const { queryMemoryIsolation, formatMemoryIsolationReport } = await import("./memory-isolation-
|
|
15825
|
+
const { queryMemoryIsolation, formatMemoryIsolationReport } = await import("./memory-isolation-3GJ6WLYX.js");
|
|
15414
15826
|
const agentId = typeof input.agent_id === "string" ? input.agent_id : void 0;
|
|
15415
15827
|
const allScopes = input.all_scopes === true;
|
|
15416
15828
|
const sessionScope = typeof input.session_scope === "string" ? input.session_scope : void 0;
|
|
@@ -15430,7 +15842,7 @@ async function handleMemoryIsolation(input) {
|
|
|
15430
15842
|
}
|
|
15431
15843
|
async function handleSpawnFailures() {
|
|
15432
15844
|
try {
|
|
15433
|
-
const { getOrchestrationMetrics } = await import("./orchestration-events-
|
|
15845
|
+
const { getOrchestrationMetrics } = await import("./orchestration-events-JPHB6NPY.js");
|
|
15434
15846
|
const metrics = await getOrchestrationMetrics();
|
|
15435
15847
|
const c = metrics.counts;
|
|
15436
15848
|
const attempted = c.tmuxSpawnAttempted;
|
|
@@ -15532,7 +15944,7 @@ async function handleOrchestrationHealth() {
|
|
|
15532
15944
|
async function handleWorkMap() {
|
|
15533
15945
|
try {
|
|
15534
15946
|
const { getAgentLivenessReport } = await import("./agent-heartbeat-CQPGJIFF.js");
|
|
15535
|
-
const { classifyRole } = await import("./session-kill-telemetry-
|
|
15947
|
+
const { classifyRole } = await import("./session-kill-telemetry-OHNJMIVT.js");
|
|
15536
15948
|
const { buildSessionDeathSummary } = await import("./orchestration-health-read-EJWVUARG.js");
|
|
15537
15949
|
const { getPaneCwd } = await import("./lib/tmux-status.js");
|
|
15538
15950
|
const live = getAgentLivenessReport();
|
|
@@ -15602,7 +16014,7 @@ async function handleWorkMap() {
|
|
|
15602
16014
|
async function handleWorkState(input) {
|
|
15603
16015
|
try {
|
|
15604
16016
|
const { getClient: getClient2 } = await import("./lib/database.js");
|
|
15605
|
-
const { readWorkState, listWorkStates } = await import("./work-state-heartbeat-
|
|
16017
|
+
const { readWorkState, listWorkStates } = await import("./work-state-heartbeat-CH6BLQKV.js");
|
|
15606
16018
|
const client = await getClient2();
|
|
15607
16019
|
const sessionScope = typeof input.session_scope === "string" ? input.session_scope.trim() : "";
|
|
15608
16020
|
if (sessionScope) {
|
|
@@ -15704,7 +16116,7 @@ async function handleDrift(input) {
|
|
|
15704
16116
|
}
|
|
15705
16117
|
async function handleSteward(action, input) {
|
|
15706
16118
|
const gate = new StewardGate();
|
|
15707
|
-
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-
|
|
16119
|
+
const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-BOBBUJ74.js");
|
|
15708
16120
|
const inputAgent = input.agent_id;
|
|
15709
16121
|
const operation = input.operation;
|
|
15710
16122
|
const target = input.target;
|
|
@@ -16002,7 +16414,7 @@ function registerResonance(server) {
|
|
|
16002
16414
|
}
|
|
16003
16415
|
}, async ({ action, memory_id, entity_id, limit }) => {
|
|
16004
16416
|
try {
|
|
16005
|
-
const { getHotPairs, getCoActivationNeighbors } = await import("./co-activation-
|
|
16417
|
+
const { getHotPairs, getCoActivationNeighbors } = await import("./co-activation-523TKQPZ.js");
|
|
16006
16418
|
if (action === "hot_pairs") {
|
|
16007
16419
|
const pairs = await getHotPairs(limit ?? 20);
|
|
16008
16420
|
if (pairs.length === 0) return text4("No co-activation data yet. Pairs are recorded as memories are accessed together in searches.");
|
|
@@ -16331,7 +16743,7 @@ function resolveEndpoint(opts) {
|
|
|
16331
16743
|
async function resolveAuth(opts) {
|
|
16332
16744
|
if (opts.authHeader !== void 0) return opts.authHeader ?? {};
|
|
16333
16745
|
try {
|
|
16334
|
-
const { getAuthHeader } = await import("./gotrue-session-
|
|
16746
|
+
const { getAuthHeader } = await import("./gotrue-session-U4H3UGHL.js");
|
|
16335
16747
|
return await getAuthHeader() ?? {};
|
|
16336
16748
|
} catch {
|
|
16337
16749
|
return {};
|