@askexenow/exe-os 0.9.372 → 0.9.374
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 +45 -10
- package/deploy/compose/.env.example +46 -9
- package/deploy/compose/docker-compose.yml +136 -18
- package/deploy/compose/generate-env.ts +142 -34
- package/deploy/compose/sso-edge/default.conf.template +78 -7
- package/deploy/compose/sso-edge/sso-redirect.conf +109 -13
- package/deploy/stack-manifests/v0.9.30-apps.json +1 -1
- package/deploy/stack-manifests/v0.9.json +4 -4
- package/dist/.dist-verified.json +3 -3
- package/dist/{active-agent-GRT5MKD5.js → active-agent-ONPPEWQV.js} +7 -6
- package/dist/{active-agent-L2ZSSXDK.js → active-agent-UJKMG7LJ.js} +7 -6
- package/dist/{agent-defs-generator-M4ZNYIVX.js → agent-defs-generator-ZWI6DXOE.js} +6 -5
- package/dist/{agent-loop-FOK2IRZQ.js → agent-loop-OYHJKNYH.js} +1 -1
- package/dist/{agentic-ontology-DMPRDEUX.js → agentic-ontology-WHFJ3QFS.js} +1 -1
- package/dist/{artifact-backup-767STHSW.js → artifact-backup-WXZNB7KE.js} +2 -1
- package/dist/{backfill-gate-VX2RZTQV.js → backfill-gate-KWJQ35YX.js} +3 -2
- package/dist/{backfill-metadata-ZMEHJQ5M.js → backfill-metadata-3OUSQD5V.js} +8 -7
- package/dist/{background-jobs-LTPWCMA3.js → background-jobs-6VMD55PK.js} +3 -2
- package/dist/{backup-verify-EX2K732J.js → backup-verify-ZKTUYLTA.js} +4 -3
- package/dist/{behavior-injection-22AGMS25.js → behavior-injection-M6UYZCMW.js} +17 -15
- package/dist/{behaviors-DVFXAWF5.js → behaviors-ZJ45TFBJ.js} +21 -13
- package/dist/bin/age-ontology-load.js +3 -2
- package/dist/bin/agentic-ontology-backfill.js +10 -9
- package/dist/bin/agentic-reflection-backfill.js +11 -10
- package/dist/bin/agentic-semantic-label.js +10 -9
- package/dist/bin/backfill-conversations.js +13 -11
- package/dist/bin/backfill-responses.js +13 -11
- package/dist/bin/backfill-vectors.js +17 -15
- package/dist/bin/bulk-sync-postgres.js +22 -20
- package/dist/bin/cc-doctor.js +10 -9
- package/dist/bin/cleanup-stale-review-tasks.js +29 -26
- package/dist/bin/cli.js +36 -26
- package/dist/bin/deferred-daemon-restart.js +114 -110
- package/dist/bin/exe-agent-config.js +6 -5
- package/dist/bin/exe-agent.js +127 -33
- package/dist/bin/exe-assign.js +15 -13
- package/dist/bin/exe-boot.js +57 -54
- package/dist/bin/exe-call.js +8 -7
- package/dist/bin/exe-cloud.js +24 -22
- package/dist/bin/exe-config-dump.js +6 -5
- package/dist/bin/exe-dispatch.js +30 -27
- package/dist/bin/exe-doctor.js +14 -10
- package/dist/bin/exe-export-behaviors.js +19 -17
- package/dist/bin/exe-forget.js +10 -9
- package/dist/bin/exe-gateway.js +199 -19
- package/dist/bin/exe-grant.js +5 -5
- package/dist/bin/exe-healthcheck.js +10 -9
- package/dist/bin/exe-heartbeat.js +35 -32
- package/dist/bin/exe-kill.js +34 -31
- package/dist/bin/exe-launch-agent.js +126 -54
- package/dist/bin/exe-mcp.js +6 -5
- package/dist/bin/exe-memory-reads.js +8 -7
- package/dist/bin/exe-new-employee.js +12 -11
- package/dist/bin/exe-os-mcp-proxy.js +6 -5
- package/dist/bin/exe-pending-messages.js +30 -27
- package/dist/bin/exe-pending-notifications.js +29 -26
- package/dist/bin/exe-pending-reviews.js +30 -27
- package/dist/bin/exe-rename.js +8 -7
- package/dist/bin/exe-repo-truth.js +1 -1
- package/dist/bin/exe-review.js +33 -30
- package/dist/bin/exe-search.js +9 -8
- package/dist/bin/exe-session-cleanup.js +35 -32
- package/dist/bin/exe-settings.js +24 -22
- package/dist/bin/exe-start-codex.js +137 -55
- package/dist/bin/exe-start-opencode.js +121 -23
- package/dist/bin/exe-status.js +31 -28
- package/dist/bin/exe-support.js +5 -4
- package/dist/bin/exe-team.js +7 -6
- package/dist/bin/exe-watchdog.js +31 -11
- package/dist/bin/generate-hook-manifest.js +44 -7
- package/dist/bin/git-sweep.js +31 -28
- package/dist/bin/graph-backfill.js +89 -35
- package/dist/bin/graph-export.js +9 -8
- package/dist/bin/import-history.js +14 -13
- package/dist/bin/install.js +137 -113
- package/dist/bin/intercom-check.js +5 -5
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.js +7 -6
- package/dist/bin/postgres-agentic-reflection-backfill.js +5 -4
- package/dist/bin/postgres-agentic-semantic-backfill.js +4 -3
- package/dist/bin/pre-publish.js +1 -1
- package/dist/bin/reconcile-backlog.js +2 -2
- package/dist/bin/registry-proxy.js +1 -1
- package/dist/bin/scan-tasks.js +29 -26
- package/dist/bin/setup.js +5 -4
- package/dist/bin/shard-migrate.js +9 -8
- package/dist/bin/stack-update.js +40 -9
- package/dist/bin/verify-stack.js +2 -2
- package/dist/bin/vps-health-gate.js +1 -1
- package/dist/{boot-generation-OHXH4YC5.js → boot-generation-JKVZ4ZAT.js} +6 -5
- package/dist/{boot-review-sections-N5IXIGSS.js → boot-review-sections-2M6BTG73.js} +28 -25
- package/dist/{branch-hygiene-KCGXRAWP.js → branch-hygiene-U5GFRSTP.js} +31 -7
- package/dist/{branding-GH43W3PU.js → branding-I6KIMB7F.js} +3 -2
- package/dist/budget-fallback-XJRPMP2D.js +11 -0
- package/dist/build-manifest.json +1318 -1233
- package/dist/{capability-cards-4PXVLIVS.js → capability-cards-5IMJT6J7.js} +5 -4
- package/dist/{capacity-monitor-FKMQXORX.js → capacity-monitor-SAXCQK7O.js} +30 -27
- package/dist/{catchup-brief-SN5EKO4N.js → catchup-brief-U2TXBLHD.js} +34 -31
- package/dist/{chunk-CNC57JCS.js → chunk-23MVDXLY.js} +4 -4
- package/dist/{chunk-V4XAKXXF.js → chunk-2AJGV5UL.js} +1 -1
- package/dist/{chunk-FBYAXTDM.js → chunk-2ZOEC4KC.js} +10 -2
- package/dist/{chunk-ELXFSIIM.js → chunk-32YV32VA.js} +2 -2
- package/dist/{chunk-44C7QNZS.js → chunk-3KDCORDO.js} +1 -1
- package/dist/{chunk-JTB5V6BV.js → chunk-3SXHEQ7X.js} +1 -1
- package/dist/{chunk-HDW4XPDV.js → chunk-3UUX5OY4.js} +1 -1
- package/dist/{chunk-7PSLK36P.js → chunk-44TLJZJ5.js} +1 -1
- package/dist/{chunk-JTWTBX2M.js → chunk-4EN3IZ3Q.js} +2 -1
- package/dist/{chunk-KPMC7PY7.js → chunk-4HKTO2SV.js} +1 -1
- package/dist/{chunk-CDUB5Q6J.js → chunk-4IK2K3B3.js} +1 -1
- package/dist/{chunk-GH6YJOOC.js → chunk-4SJ4LK4V.js} +6 -6
- package/dist/{chunk-PVEM537A.js → chunk-4YLBKEL5.js} +2 -2
- package/dist/chunk-4YNA3CM6.js +872 -0
- package/dist/{chunk-KYFFVTGO.js → chunk-55BEFF4V.js} +3 -3
- package/dist/{chunk-SEP5ITFQ.js → chunk-636LKCKE.js} +2 -2
- package/dist/{chunk-QTI4QAWA.js → chunk-6EZQUNE6.js} +338 -5
- package/dist/{chunk-WAEKYKTK.js → chunk-6RKKVPYF.js} +1 -1
- package/dist/{chunk-VX2F4ZUY.js → chunk-6SCGLHJ7.js} +3 -3
- package/dist/{chunk-MEGRQ53A.js → chunk-6VHOQ3IM.js} +51 -6
- package/dist/{chunk-HIIXCAEE.js → chunk-6YVUR3OU.js} +3 -3
- package/dist/{chunk-L6ZNURWN.js → chunk-7GE2EQ23.js} +1 -1
- package/dist/{chunk-2CWS374F.js → chunk-7RI2CNXJ.js} +1 -1
- package/dist/{chunk-OL3QP3AU.js → chunk-7TSBV3SD.js} +1 -1
- package/dist/{chunk-DSOQUQTV.js → chunk-A27Q27CT.js} +27 -0
- package/dist/{chunk-5AHRZI3R.js → chunk-AETLDRZB.js} +1 -1
- package/dist/{chunk-RNLF3CBB.js → chunk-AKLJ4JH3.js} +1 -1
- package/dist/{chunk-XHYHX6F7.js → chunk-AKLQSC6W.js} +329 -164
- package/dist/chunk-ANLFH23R.js +261 -0
- package/dist/{chunk-QLA3RTH4.js → chunk-AWWKRZMB.js} +5 -5
- package/dist/{chunk-ERVQTR7P.js → chunk-BBSIEYF5.js} +17 -3
- package/dist/{chunk-IPMUWYRQ.js → chunk-BJ7AVSY6.js} +2 -2
- package/dist/{chunk-HV6Y6F4X.js → chunk-C2L622QJ.js} +89 -3
- package/dist/{chunk-TX3Q2GIL.js → chunk-C5HUMAA7.js} +24 -1
- package/dist/{chunk-QTYJPWJN.js → chunk-CBCGDEJA.js} +7 -7
- package/dist/{chunk-XXSNLM6R.js → chunk-DB55JZHU.js} +1 -1
- package/dist/{chunk-LAZKEJMS.js → chunk-DIXXEE3S.js} +840 -607
- package/dist/{chunk-FB343XQX.js → chunk-DJ7YXOTU.js} +2 -2
- package/dist/{chunk-YFCNWQAM.js → chunk-DJOIMFKV.js} +2 -2
- package/dist/{chunk-UTDMTQNH.js → chunk-DSJI76XL.js} +92 -14
- package/dist/{chunk-EEXX4UMQ.js → chunk-DZKPOSFD.js} +1 -1
- package/dist/{chunk-WSOA3WMC.js → chunk-E426DOSY.js} +161 -4
- package/dist/{chunk-ZISQOOER.js → chunk-EKE37MO4.js} +3 -3
- package/dist/{chunk-RIECV7SR.js → chunk-EKYYMIVT.js} +1 -1
- package/dist/{chunk-HIVZ53YB.js → chunk-EXTZSNWL.js} +2 -2
- package/dist/{chunk-YYA5LXCT.js → chunk-FNEZ4BWT.js} +1 -1
- package/dist/chunk-FTZET5YX.js +313 -0
- package/dist/chunk-GHR4ZPJ7.js +70 -0
- package/dist/{chunk-MINXPXAB.js → chunk-GJI77VDO.js} +3 -3
- package/dist/{chunk-AAMGHW5W.js → chunk-GLQEJOXE.js} +1 -0
- package/dist/{chunk-ADNBOKYZ.js → chunk-GM7TLYOK.js} +60 -18
- package/dist/{chunk-RUWWES2K.js → chunk-GNUAL43X.js} +2 -2
- package/dist/{chunk-QZL6E4UB.js → chunk-GOMQ7PVQ.js} +2 -2
- package/dist/{chunk-GB3AHV5F.js → chunk-GQOEWNVM.js} +1 -1
- package/dist/{chunk-NQZUSEAR.js → chunk-GS7LIT34.js} +246 -17
- package/dist/{chunk-XTWHNLGD.js → chunk-GZOG2MAX.js} +1 -1
- package/dist/{chunk-E5HAY3DQ.js → chunk-HDLAB7W3.js} +1 -1
- package/dist/{chunk-E5QQZDQN.js → chunk-HNWS7YHN.js} +358 -136
- package/dist/{chunk-VV5EZZNT.js → chunk-HTBEVCO2.js} +1 -1
- package/dist/{chunk-OZBII5E3.js → chunk-I4DNJFDR.js} +4 -4
- package/dist/{chunk-SI5SZAJA.js → chunk-IBS2FAI4.js} +21 -4
- package/dist/{chunk-J5EYOBFF.js → chunk-IHXW4VUI.js} +1 -1
- package/dist/{chunk-RUVO3NJC.js → chunk-IN6CAM4F.js} +9 -3
- package/dist/{chunk-53PYNYTW.js → chunk-IRVOXUSK.js} +5 -5
- package/dist/{chunk-THM7J6UI.js → chunk-JHI5WMK5.js} +5 -5
- package/dist/{chunk-3KTQWMHI.js → chunk-JSMDRKPJ.js} +12 -4
- package/dist/chunk-JTVIANUB.js +131 -0
- package/dist/{chunk-2ADYTOHQ.js → chunk-K4ESASPL.js} +1 -1
- package/dist/{chunk-YWUQVHDL.js → chunk-KTCXJWJG.js} +1 -1
- package/dist/{chunk-RGUDGC6A.js → chunk-KTU3EAWK.js} +5 -5
- package/dist/{chunk-DKBPCOU4.js → chunk-L6RXG36J.js} +2 -2
- package/dist/{chunk-T4EK56WI.js → chunk-LDNYSMPZ.js} +1 -1
- package/dist/{chunk-RIK5GRWI.js → chunk-LGS2V2XD.js} +3 -3
- package/dist/{chunk-JKXZGRWR.js → chunk-LP4GB656.js} +2 -2
- package/dist/{chunk-H74466TM.js → chunk-M7O7TGGU.js} +1 -1
- package/dist/chunk-MJCSEIFI.js +54 -0
- package/dist/{chunk-IDZPQG2D.js → chunk-MOGA4Q7F.js} +2 -2
- package/dist/{chunk-OYQNNKNS.js → chunk-MXPNVSXI.js} +37 -14
- package/dist/{chunk-UVW7YFAF.js → chunk-N7VEP5B3.js} +4 -4
- package/dist/{chunk-HHE2HV3V.js → chunk-NBXDXKLC.js} +1 -1
- package/dist/{chunk-LDL3S7AC.js → chunk-NKETJCB5.js} +7 -3
- package/dist/{chunk-ECHLVLA7.js → chunk-NMH5ZQPU.js} +1 -1
- package/dist/{chunk-U3XLRMJD.js → chunk-NT7W4RXD.js} +1 -1
- package/dist/{chunk-UQUUNGTP.js → chunk-NUK7EEN5.js} +11 -9
- package/dist/{chunk-GBNB4EWD.js → chunk-ORM7ZFKC.js} +16 -0
- package/dist/{chunk-O4ZFRK6W.js → chunk-OVEQE6YS.js} +244 -49
- package/dist/{chunk-4ZJ5BPY6.js → chunk-PB5S7YOF.js} +2 -2
- package/dist/{chunk-JR23BL74.js → chunk-PDVXWXTL.js} +4 -4
- package/dist/{chunk-3CIMDFXG.js → chunk-PFQ3VEEM.js} +1 -1
- package/dist/{chunk-SBJV2PCU.js → chunk-PHBU4LGO.js} +1 -1
- package/dist/{chunk-W25RLOQ2.js → chunk-PLZSZOZN.js} +3 -3
- package/dist/{chunk-THIJIOE2.js → chunk-PY3FOMRN.js} +18 -6
- package/dist/{chunk-AAUWFXOX.js → chunk-Q3AXXKDF.js} +3 -3
- package/dist/{chunk-VKXS2YGN.js → chunk-QHJR7IMX.js} +2 -2
- package/dist/chunk-QLZ46RCK.js +45 -0
- package/dist/{chunk-UHPMK6QZ.js → chunk-R3CZWFFC.js} +10 -2
- package/dist/{chunk-6XEYELCA.js → chunk-R4CBHKZ2.js} +1 -1
- package/dist/{chunk-5APCDDJZ.js → chunk-R522MWAR.js} +9 -9
- package/dist/chunk-RH4AH3YB.js +80 -0
- package/dist/{chunk-AMKSDKMK.js → chunk-S2WBS6BG.js} +22 -35
- package/dist/{chunk-WUKQVNLP.js → chunk-SEQIPGLU.js} +1 -1
- package/dist/{chunk-7WQRFSZI.js → chunk-SL6KQYDU.js} +26 -6
- package/dist/chunk-SLLLOOEI.js +103 -0
- package/dist/{chunk-5N4SG5NB.js → chunk-T35RCQFE.js} +3 -3
- package/dist/{chunk-7V6M3QUS.js → chunk-T3QUKNLI.js} +1 -1
- package/dist/{chunk-CW2UCKHS.js → chunk-TADAO3HV.js} +2 -2
- package/dist/{chunk-5DCCKHDY.js → chunk-TAMDAOCU.js} +109 -13
- package/dist/{chunk-ZXB56YR2.js → chunk-TFKCERAK.js} +101 -23
- package/dist/{chunk-RBYHJDAT.js → chunk-TQAZTRQ3.js} +3 -3
- package/dist/{chunk-OKGIOWOB.js → chunk-U6SUKSZR.js} +2 -2
- package/dist/{chunk-23QKEUF6.js → chunk-U73AC5AN.js} +34 -12
- package/dist/{chunk-PM6WSWVU.js → chunk-UBK7HK3J.js} +3 -3
- package/dist/{chunk-H37FSTF2.js → chunk-UBMZ3YQU.js} +1 -1
- package/dist/{chunk-JJUGI2YL.js → chunk-UCFC2AEI.js} +1 -1
- package/dist/{chunk-6IWLAQ7O.js → chunk-UCUOGVDX.js} +4 -0
- package/dist/{chunk-E7UCDSUE.js → chunk-UKLN57Q5.js} +2 -2
- package/dist/{chunk-ZYCLSEZT.js → chunk-ULIBLJ6W.js} +33 -11
- package/dist/{chunk-RLR6VVKV.js → chunk-UM3N6VND.js} +4 -4
- package/dist/{chunk-ZNUJFX7L.js → chunk-UQGSBM3U.js} +1 -1
- package/dist/{chunk-ZZXMB5F2.js → chunk-UZDF6FLJ.js} +1 -1
- package/dist/{chunk-LNOS24GV.js → chunk-V3WLC5TJ.js} +2 -95
- package/dist/{chunk-UXLO7VHX.js → chunk-VI4ATC6I.js} +1 -1
- package/dist/{chunk-77JP3LK4.js → chunk-VKJGHAZT.js} +92 -21
- package/dist/{chunk-7R73IAHU.js → chunk-VMTZ4RUW.js} +67 -150
- package/dist/{chunk-TGPQMMQP.js → chunk-VYQ7B7DI.js} +30 -17
- package/dist/{chunk-E2WEFZOR.js → chunk-W75GTHR3.js} +1 -1
- package/dist/{chunk-UKLF7F3Z.js → chunk-WJG344NC.js} +9 -9
- package/dist/{chunk-MBNIJXKI.js → chunk-WMEYJT4R.js} +18 -4
- package/dist/{chunk-R6FLELV6.js → chunk-XFTEX77S.js} +3 -3
- package/dist/{chunk-MDGYXUOV.js → chunk-XH7YL7JM.js} +1 -1
- package/dist/{chunk-JOO35RHR.js → chunk-XL5MFGMR.js} +3 -3
- package/dist/{chunk-OW5RZIDW.js → chunk-XNNECNDL.js} +95 -33
- package/dist/{chunk-5AHDQCTB.js → chunk-XXFKSJYA.js} +6 -6
- package/dist/{chunk-TGEPLJ66.js → chunk-XXOPG4BW.js} +3 -3
- package/dist/{chunk-PGLPUP37.js → chunk-XZ65ST2I.js} +1 -1
- package/dist/{chunk-3TTKAT6V.js → chunk-YKC7QDZH.js} +9 -4
- package/dist/{chunk-KXYFBBZR.js → chunk-YMP2QSOP.js} +20 -3
- package/dist/{chunk-TK4MI6F6.js → chunk-YSLGFPWX.js} +6 -6
- package/dist/{chunk-X2P43TB2.js → chunk-YTSXPJUQ.js} +1 -1
- package/dist/{chunk-HECXZGGZ.js → chunk-ZCERWHY2.js} +33 -35
- package/dist/{chunk-IVU3WN7S.js → chunk-ZG62LIK3.js} +74 -4
- package/dist/{chunk-GU62SNDH.js → chunk-ZGYNKA3O.js} +744 -111
- package/dist/{chunk-QMSEL5YS.js → chunk-ZIG7VPJV.js} +28 -76
- package/dist/{chunk-WZJVGA5I.js → chunk-ZL4AGWAH.js} +258 -13
- package/dist/{chunk-QR624DER.js → chunk-ZSODLMFV.js} +2 -2
- package/dist/{cleanup-graph-garbage-IPYDS5OX.js → cleanup-graph-garbage-DPJGO52H.js} +11 -10
- package/dist/{cloud-sync-command-JLNVG7H4.js → cloud-sync-command-JPNTT4OQ.js} +2 -2
- package/dist/{cloud-sync-db-init-JXUF6GI3.js → cloud-sync-db-init-V2LWIUQU.js} +1 -1
- package/dist/{cloud-sync-shutdown-Z4SBP6PL.js → cloud-sync-shutdown-BNALPWGX.js} +5 -4
- package/dist/{co-activation-74RDFTKS.js → co-activation-CMNSWS6B.js} +5 -4
- package/dist/{co-occurrence-CN3TBYVR.js → co-occurrence-WRI2NAN6.js} +9 -8
- package/dist/{code-context-index-D4MJ4VFX.js → code-context-index-NOJSHLPN.js} +12 -6
- package/dist/code-context-watcher-VZNZU3BO.js +118 -0
- package/dist/{codex-consolidation-PPXNBXCV.js → codex-consolidation-SH4UKFBQ.js} +2 -1
- package/dist/{conversation-entity-extractor-QGTLH4BP.js → conversation-entity-extractor-74252CAO.js} +4 -4
- package/dist/{conversation-wiki-populator-EBUZXYEU.js → conversation-wiki-populator-OS4C6W54.js} +1 -1
- package/dist/conversations-retention-C4BLKFEL.js +54 -0
- package/dist/coordinator-notice-MHUY7AQB.js +55 -0
- package/dist/{crdt-sync-7T4WCOKD.js → crdt-sync-B3JN6AIV.js} +1 -1
- package/dist/{crm-webhook-FTW3XZTO.js → crm-webhook-GYWQRFET.js} +2 -2
- package/dist/{cto-delegation-gate-SZCE34LB.js → cto-delegation-gate-LQHVLEMW.js} +29 -26
- package/dist/{daemon-auth-SSPY5ODS.js → daemon-auth-QZHEO7IQ.js} +3 -2
- package/dist/{daemon-orchestration-IGPHVNFR.js → daemon-orchestration-5HIQALZH.js} +36 -34
- package/dist/{daemon-ready-OT2VQLS7.js → daemon-ready-P2BR2XP5.js} +1 -1
- package/dist/{db-integrity-events-5DTASXJF.js → db-integrity-events-2DTFO37N.js} +3 -2
- package/dist/{db-restore-events-2FI4ZMKA.js → db-restore-events-G6NOQOVE.js} +2 -1
- package/dist/{destructive-data-guard-6I5MDFVD.js → destructive-data-guard-BVFWPPIS.js} +1 -1
- package/dist/doc-graph-extractor-PQHDHQPQ.js +367 -0
- package/dist/{documents-URULIXGM.js → documents-C4SSPJMC.js} +15 -13
- package/dist/{dreaming-VIZO3QDO.js → dreaming-XAO3FCBV.js} +33 -30
- package/dist/{employee-boot-brief-XLOG4ULP.js → employee-boot-brief-W4OHUMRQ.js} +37 -34
- package/dist/{exe-drift-TLQM3IHD.js → exe-drift-AG2KMKD5.js} +6 -5
- package/dist/{exe-export-7YWYWJHY.js → exe-export-IC5BT335.js} +17 -15
- package/dist/{exe-import-DW6VAUKW.js → exe-import-A35ZLDPG.js} +17 -15
- package/dist/{exe-key-TLJP2B4Y.js → exe-key-TCMJNYLA.js} +116 -112
- package/dist/{exe-org-LU46N36E.js → exe-org-JXCR3JYZ.js} +24 -23
- package/dist/{exe-snapshot-QHUZRS62.js → exe-snapshot-SV6SRIG6.js} +36 -33
- package/dist/{fast-db-init-SCTOOIUT.js → fast-db-init-L2RGKJWH.js} +1 -1
- package/dist/{founder-context-ZFZC4UHO.js → founder-context-D4HFIESJ.js} +4 -3
- package/dist/{founder-monitor-envelope-5KTKNL5G.js → founder-monitor-envelope-TFKRGCFE.js} +5 -4
- package/dist/{fts-integrity-LKAZEZJE.js → fts-integrity-4YB34KWX.js} +3 -2
- package/dist/gateway/index.js +19 -17
- package/dist/{git-main-guard-TN27QBAI.js → git-main-guard-VTW4N3CM.js} +7 -1
- package/dist/{git-staleness-GSGP344N.js → git-staleness-TN7CYGFG.js} +5 -4
- package/dist/{global-procedures-YAR7G4C6.js → global-procedures-YFDEIOG7.js} +7 -6
- package/dist/{graph-auto-extract-GNQS64F5.js → graph-auto-extract-3YR3TYRW.js} +9 -8
- package/dist/{graph-rag-RMSFLUOB.js → graph-rag-Z2KCJTPK.js} +6 -4
- package/dist/{hook-integrity-CF567MVN.js → hook-integrity-KGAV6ZC2.js} +14 -4
- package/dist/{hook-prefetch-36BK4F7U.js → hook-prefetch-K5DN3TOQ.js} +29 -26
- package/dist/hooks/bug-report-worker.js +34 -30
- package/dist/hooks/codex-stop-task-finalizer.js +36 -32
- package/dist/hooks/commit-complete.js +33 -30
- package/dist/hooks/error-recall.js +12 -11
- package/dist/hooks/exe-heartbeat-hook.js +8 -7
- package/dist/hooks/ingest-worker.js +23 -11
- package/dist/hooks/ingest.js +18 -17
- package/dist/hooks/instructions-loaded.js +10 -9
- package/dist/hooks/manifest.json +20 -20
- package/dist/hooks/notification.js +9 -8
- package/dist/hooks/post-compact.js +8 -7
- package/dist/hooks/post-tool-combined.js +26 -15
- package/dist/hooks/pre-compact.js +33 -30
- package/dist/hooks/pre-tool-use.js +404 -46
- package/dist/hooks/prompt-submit.js +57 -47
- package/dist/hooks/session-end.js +40 -41
- package/dist/hooks/session-start.js +21 -20
- package/dist/hooks/stop.js +40 -37
- package/dist/hooks/subagent-stop.js +38 -35
- package/dist/hooks/summary-worker.js +39 -36
- package/dist/hyde-MP4QNMU5.js +80 -0
- package/dist/index.js +44 -39
- package/dist/{installer-LUN4HQIC.js → installer-54HTN5RE.js} +8 -7
- package/dist/{installer-OC5VXNC7.js → installer-LK35OX6R.js} +8 -7
- package/dist/{installer-MPRFUQJE.js → installer-LLWKZI2S.js} +8 -7
- package/dist/intercom-ack-VCW755TN.js +13 -0
- package/dist/{intercom-queue-6DZ7BANV.js → intercom-queue-5NOT2RKI.js} +28 -25
- package/dist/{key-backup-status-6L2ARCXW.js → key-backup-status-LQPINQ3W.js} +2 -1
- package/dist/lib/agent-config.js +3 -2
- package/dist/lib/cloud-sync.js +26 -20
- package/dist/lib/config.js +2 -1
- package/dist/lib/consolidation.js +17 -10
- package/dist/lib/database.js +7 -4
- package/dist/lib/db-backup.js +17 -2
- package/dist/lib/db-daemon-client.js +8 -6
- package/dist/lib/db-write-worker-client.js +3 -1
- package/dist/lib/db-write-worker.js +20 -3
- package/dist/lib/db.js +7 -4
- package/dist/lib/device-registry.js +3 -2
- package/dist/lib/embed-worker.js +2 -1
- package/dist/lib/embedder.js +8 -6
- package/dist/lib/employee-templates.js +8 -7
- package/dist/lib/employees.js +5 -4
- package/dist/lib/exe-daemon-client.js +7 -5
- package/dist/lib/exe-daemon.js +467 -221
- package/dist/lib/hybrid-search.js +11 -8
- package/dist/lib/identity.js +5 -4
- package/dist/lib/license.js +4 -3
- package/dist/lib/messaging.js +29 -26
- package/dist/lib/post-tool-memory.js +16 -2
- package/dist/lib/registry-proxy.js +3 -1
- package/dist/lib/reminders.js +6 -5
- package/dist/lib/schedules.js +9 -8
- package/dist/lib/session-registry.js +7 -6
- package/dist/lib/skill-learning.js +16 -14
- package/dist/lib/stack-invariants.js +17 -1
- package/dist/lib/status-brief.js +5 -4
- package/dist/lib/store.js +10 -7
- package/dist/lib/task-router.js +6 -5
- package/dist/lib/tasks.js +31 -27
- package/dist/lib/tmux-routing.js +40 -25
- package/dist/lib/tmux-status.js +3 -1
- package/dist/lib/tmux-transport.js +2 -1
- package/dist/lib/token-spend.js +6 -5
- package/dist/lib/transport.js +3 -2
- package/dist/{license-gate-ESER24PJ.js → license-gate-JVMB6OFD.js} +5 -4
- package/dist/{license-sync-JVG5KNIY.js → license-sync-5VYS2F2W.js} +4 -3
- package/dist/mcp/register-tools.js +113 -109
- package/dist/mcp/server.js +118 -114
- package/dist/mcp/tools/complete-reminder.js +7 -6
- package/dist/mcp/tools/create-reminder.js +7 -6
- package/dist/mcp/tools/create-task.js +34 -30
- package/dist/mcp/tools/deactivate-behavior.js +18 -16
- package/dist/mcp/tools/list-reminders.js +7 -6
- package/dist/mcp/tools/list-tasks.js +34 -30
- package/dist/mcp/tools/send-message.js +32 -29
- package/dist/mcp/tools/update-task.js +32 -28
- package/dist/mcp-child-registry-OTG4MWO7.js +25 -0
- package/dist/{mcp-http-config-6K6IKH5F.js → mcp-http-config-DQWL7U2Z.js} +6 -5
- package/dist/{mcp-session-identity-LRC6WJSD.js → mcp-session-identity-277GASTQ.js} +28 -25
- package/dist/{memory-cards-V3OZHIYP.js → memory-cards-3S2ZQPR7.js} +17 -8
- package/dist/{memory-graph-extractor-JC2Z64L4.js → memory-graph-extractor-A6DFEFIN.js} +10 -9
- package/dist/{memory-poisoning-defense-YM4QJHCX.js → memory-poisoning-defense-ZVP4H6DY.js} +5 -4
- package/dist/{memory-pressure-watchdog-6F6KEQHN.js → memory-pressure-watchdog-6W5F6R7H.js} +29 -26
- package/dist/{memory-queue-QJNWKWKG.js → memory-queue-YF7IDSFY.js} +3 -2
- package/dist/{memory-queue-client-COA4ABEV.js → memory-queue-client-ADSDP6OX.js} +9 -7
- package/dist/{memory-reflection-QXHJPYPC.js → memory-reflection-BKB2YOE6.js} +52 -6
- package/dist/{monitor-grants-BW2WL4IU.js → monitor-grants-EV747HMW.js} +4 -3
- package/dist/{notification-ledger-6QRLQW4Q.js → notification-ledger-CLGM7ODF.js} +30 -27
- package/dist/{notifications-7B6D7Y5C.js → notifications-MACUZPYP.js} +28 -25
- package/dist/{oauth-server-TZFNQAFS.js → oauth-server-AYM37SQ4.js} +25 -4
- package/dist/{orchestration-events-GY5VP5LU.js → orchestration-events-N7LYMUGA.js} +6 -5
- package/dist/{orchestration-phase-UDS24CVQ.js → orchestration-phase-T2WD45UA.js} +3 -2
- package/dist/{orchestrator-JVPVOYWA.js → orchestrator-4X24EWHV.js} +30 -27
- package/dist/{org-brief-session-GRV5R5E3.js → org-brief-session-FZOFMO5U.js} +13 -12
- package/dist/{org-consent-policy-3FHHSYXV.js → org-consent-policy-O5E6HXBL.js} +1 -1
- package/dist/{org-join-BY4PV6UO.js → org-join-POWUG25F.js} +8 -7
- package/dist/{org-key-admin-WSCPT2CZ.js → org-key-admin-E7EMDOZZ.js} +9 -8
- package/dist/{org-key-pin-5WUSPGVN.js → org-key-pin-WHWHVWUO.js} +4 -3
- package/dist/{org-membership-ESALTLLN.js → org-membership-WRT2IHJK.js} +5 -4
- package/dist/{org-partner-config-YKHPDPZR.js → org-partner-config-B7T4CL2T.js} +7 -6
- package/dist/{org-partner-runtime-UJDGECZ4.js → org-partner-runtime-FODONVTM.js} +13 -12
- package/dist/{org-row-visibility-V5DXIHTE.js → org-row-visibility-VX4AVV5Q.js} +1 -1
- package/dist/{pipeline-router-YY5FQKTY.js → pipeline-router-6GGT2ZW3.js} +6 -5
- package/dist/{plan-limits-OVX6SN6B.js → plan-limits-FUN76LYY.js} +8 -7
- package/dist/{platform-procedures-I57ITMDC.js → platform-procedures-7YSCLF4Z.js} +1 -1
- package/dist/{postinstall-failure-B2JHNFPM.js → postinstall-failure-O6TSSNJB.js} +3 -2
- package/dist/{project-boot-LXLU2J32.js → project-boot-3Q65LCIP.js} +2 -1
- package/dist/project-name-LJVFMYTQ.js +30 -0
- package/dist/{projection-worker-D2472IOD.js → projection-worker-4OANGP5K.js} +5 -4
- package/dist/{prospective-memory-JXO2A6PL.js → prospective-memory-KR3P4T6N.js} +5 -4
- package/dist/{push-notifications-HR3FZRDI.js → push-notifications-NCZLH6DI.js} +29 -26
- package/dist/ref-provenance-gate-M4AQO4OT.js +269 -0
- package/dist/{reproject-worktree-memories-OSS3PGRF.js → reproject-worktree-memories-PWYKPB2U.js} +106 -23
- package/dist/{reranker-IMZRPYJ2.js → reranker-6V3C2AO4.js} +3 -2
- package/dist/resolve-image-labels-ZI6UBW5W.js +15 -0
- package/dist/{retrieval-health-W7OD44FE.js → retrieval-health-5D7O6VH6.js} +4 -3
- package/dist/{review-polling-2INP7H6M.js → review-polling-QW3LJ4KN.js} +29 -26
- package/dist/runtime/index.js +38 -34
- package/dist/{session-events-G4XUPVWV.js → session-events-T45SSTMF.js} +31 -26
- package/dist/{session-kill-telemetry-W7MHWJTQ.js → session-kill-telemetry-QSPVJGBF.js} +29 -26
- package/dist/{session-mcp-config-F7KATWOF.js → session-mcp-config-SC5BLWZG.js} +3 -2
- package/dist/{session-scope-LG2J4EMQ.js → session-scope-KRWE54C4.js} +28 -25
- package/dist/{setup-wizard-YQJI3SVM.js → setup-wizard-GP3TBTPF.js} +5 -4
- package/dist/{shard-manager-UROHZE46.js → shard-manager-OE36A4MY.js} +3 -2
- package/dist/{skill-refinement-RA37U756.js → skill-refinement-C7JTMLJG.js} +6 -5
- package/dist/stack-generate-manifest-MFMDWRUP.js +810 -0
- package/dist/{stack-promote-IYBRXHTA.js → stack-promote-EKSCYY63.js} +8 -6
- package/dist/{stack-release-OXWLVVG6.js → stack-release-2GZAAFO4.js} +8 -6
- package/dist/{stack-update-2CZEROPK.js → stack-update-J6JXSTAZ.js} +51 -5
- package/dist/{steward-gate-LTNFB3FY.js → steward-gate-BFCCMCSW.js} +6 -5
- package/dist/{subagent-brief-injection-OHLWLECQ.js → subagent-brief-injection-ED36PLYY.js} +44 -36
- package/dist/{subagent-spawn-ledger-USYZXU3M.js → subagent-spawn-ledger-E6U3OY6Z.js} +3 -2
- package/dist/{supervisor-handoff-CSJQMI53.js → supervisor-handoff-SGLEPOCY.js} +12 -3
- package/dist/{support-inbox-4KCEPAZQ.js → support-inbox-YW47SYJF.js} +20 -5
- package/dist/{task-enforcement-LGXWXGVZ.js → task-enforcement-CECTQX4U.js} +29 -26
- package/dist/{task-request-inbox-WHCOSUCP.js → task-request-inbox-Q5T4N5K7.js} +1 -1
- package/dist/{task-scope-KXF7Y6KA.js → task-scope-ERVEUEYU.js} +28 -25
- package/dist/{tasks-crud-5EM55WRZ.js → tasks-crud-ZRQNJXQ2.js} +28 -25
- package/dist/{tasks-notify-VFMAURTN.js → tasks-notify-MIZH4C2O.js} +29 -26
- package/dist/{tasks-review-MHGMBHUZ.js → tasks-review-Z7J2P6DG.js} +28 -25
- package/dist/{telemetry-upload-6NRTN7QJ.js → telemetry-upload-LVQUQYFP.js} +10 -9
- package/dist/{token-budget-LZPOYTRP.js → token-budget-BU4NOVZF.js} +6 -5
- package/dist/{tool-capability-index-ED5OAPMW.js → tool-capability-index-7F42MOJT.js} +1 -1
- package/dist/{tool-gates-7PLIOLAL.js → tool-gates-JWVSAYTW.js} +1 -1
- package/dist/{tool-gates-2OZY3GZM.js → tool-gates-VXITVRFQ.js} +1 -1
- package/dist/{tool-telemetry-ZX7VSAXK.js → tool-telemetry-O27EVMBR.js} +1 -1
- package/dist/tui/App.js +43 -40
- package/dist/{tui-data-CC5POSUV.js → tui-data-TPWWBIUQ.js} +28 -25
- package/dist/{update-support-KH6NSQON.js → update-support-F2F5537B.js} +22 -20
- package/dist/{whatsapp-QW3X7OCN.js → whatsapp-YM4A2CSK.js} +3 -1
- package/dist/{work-claims-MNK7PEPW.js → work-claims-B73X5NE7.js} +6 -5
- package/dist/{work-state-heartbeat-YEWT5NMZ.js → work-state-heartbeat-P4YX6E2R.js} +1 -1
- package/dist/{worker-gate-BOQSIU2Z.js → worker-gate-BEEIIVWA.js} +3 -2
- package/dist/{workflow-engine-MUUD7ZEX.js → workflow-engine-5X46PFCW.js} +4 -2
- package/dist/{worktree-GOGT2LZP.js → worktree-W47CIMJ6.js} +9 -6
- package/dist/worktree-ownership-guard-OUWJROW2.js +88 -0
- package/dist/{worktree-sweep-46VWPVQT.js → worktree-sweep-BNBD4RFX.js} +8 -7
- package/package.json +14 -5
- package/release-notes.json +5 -5
- package/src/commands/exe/call.md +1 -1
- package/stack.release.json +6 -0
- package/dist/chunk-KZXMP6JG.js +0 -319
- package/dist/chunk-TCTED52S.js +0 -120
- package/dist/chunk-W2IRQJ6R.js +0 -67
- package/dist/doc-graph-extractor-VPTRIEKN.js +0 -149
- package/dist/project-name-ILJTETUE.js +0 -14
- /package/dist/{chunk-3Y5THOU6.js → chunk-6WIFPD2P.js} +0 -0
- /package/dist/{chunk-7XGXRD22.js → chunk-AISULNGL.js} +0 -0
- /package/dist/{chunk-3F2UB4IQ.js → chunk-DN4YVV4Z.js} +0 -0
- /package/dist/{chunk-WV3TOOL7.js → chunk-KQ6RJWRW.js} +0 -0
- /package/dist/{chunk-HR2R2QER.js → chunk-M4IRPXSZ.js} +0 -0
- /package/dist/{chunk-ORA5BWCV.js → chunk-NRG7KZIP.js} +0 -0
- /package/dist/{chunk-7UTJA6HF.js → chunk-VZAFWPAY.js} +0 -0
- /package/dist/{chunk-VJSDGDNS.js → chunk-WSQASFLP.js} +0 -0
- /package/dist/{chunk-FZQWVQJG.js → chunk-YO4BO2CL.js} +0 -0
- /package/dist/{core-memory-6WBNT2HL.js → core-memory-7I7RE2SJ.js} +0 -0
- /package/dist/{entity-boost-MT336PI3.js → entity-boost-3UWGXG5O.js} +0 -0
- /package/dist/{memory-isolation-EJ45IXBH.js → memory-isolation-2TUZ7Z4K.js} +0 -0
- /package/dist/{message-queue-client-MVBTYCSV.js → message-queue-client-XQN7QABL.js} +0 -0
- /package/dist/{webhook-pipe-UQSEHFPO.js → webhook-pipe-W2FVXY7M.js} +0 -0
- /package/dist/{wiki-acl-WXRJGZ5Q.js → wiki-acl-IBQLLBTS.js} +0 -0
- /package/dist/{wiki-client-AXNM5FWY.js → wiki-client-W65IOSWF.js} +0 -0
package/dist/chunk-KZXMP6JG.js
DELETED
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
// src/lib/verification-evidence.ts
|
|
2
|
-
import { execFileSync } from "child_process";
|
|
3
|
-
|
|
4
|
-
// src/shared/verification-artifact.ts
|
|
5
|
-
var ok = { ok: true, code: "ok", message: "verified" };
|
|
6
|
-
function deny(code, message) {
|
|
7
|
-
return { ok: false, code, message };
|
|
8
|
-
}
|
|
9
|
-
var HEX_SHA = /^[0-9a-f]{7,64}$/i;
|
|
10
|
-
var MIN_OBSERVATION_CHARS = 40;
|
|
11
|
-
function isRecord(value) {
|
|
12
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13
|
-
}
|
|
14
|
-
function str(value) {
|
|
15
|
-
return typeof value === "string" ? value.trim() : "";
|
|
16
|
-
}
|
|
17
|
-
function num(value) {
|
|
18
|
-
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
19
|
-
}
|
|
20
|
-
function isSubstantiveCommit(substance) {
|
|
21
|
-
if (!isRecord(substance)) return false;
|
|
22
|
-
const added = num(substance.added);
|
|
23
|
-
const deleted = num(substance.deleted);
|
|
24
|
-
const substantive = num(substance.substantive_added);
|
|
25
|
-
const sourceFiles = num(substance.source_files);
|
|
26
|
-
if (added === null || deleted === null || substantive === null || sourceFiles === null) return false;
|
|
27
|
-
if (added < 0 || deleted < 0 || substantive < 0 || sourceFiles < 0) return false;
|
|
28
|
-
if (substantive > added) return false;
|
|
29
|
-
if (sourceFiles < 1) return false;
|
|
30
|
-
if (substantive < 1 && deleted < 1) return false;
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
function assessVerificationArtifact(raw, context = {}) {
|
|
34
|
-
if (raw === void 0 || raw === null || raw === "") {
|
|
35
|
-
return deny("artifact_missing", "closing requires a verification artifact showing the defect is absent");
|
|
36
|
-
}
|
|
37
|
-
let artifact = raw;
|
|
38
|
-
if (typeof raw === "string") {
|
|
39
|
-
try {
|
|
40
|
-
artifact = JSON.parse(raw);
|
|
41
|
-
} catch {
|
|
42
|
-
return deny("artifact_malformed", "verification artifact must be valid JSON");
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (!isRecord(artifact)) {
|
|
46
|
-
return deny("artifact_malformed", "verification artifact must be an object");
|
|
47
|
-
}
|
|
48
|
-
const kind = str(artifact.kind);
|
|
49
|
-
if (kind !== "regression_test" && kind !== "manual") {
|
|
50
|
-
return deny("artifact_unknown_kind", "verification artifact kind must be regression_test or manual");
|
|
51
|
-
}
|
|
52
|
-
if (!isSubstantiveCommit(artifact.substance)) {
|
|
53
|
-
return deny(
|
|
54
|
-
"commit_not_substantive",
|
|
55
|
-
"the fix commit changes no executable production source (comment-only, whitespace-only, or test-only diffs are not fixes)"
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
if (kind === "regression_test") {
|
|
59
|
-
const testId = str(artifact.test_id);
|
|
60
|
-
const fixCommit = str(artifact.fix_commit);
|
|
61
|
-
const parentCommit = str(artifact.parent_commit);
|
|
62
|
-
if (!testId || !HEX_SHA.test(fixCommit) || !HEX_SHA.test(parentCommit)) {
|
|
63
|
-
return deny("artifact_malformed", "regression_test requires test_id, fix_commit and parent_commit");
|
|
64
|
-
}
|
|
65
|
-
if (fixCommit.toLowerCase() === parentCommit.toLowerCase()) {
|
|
66
|
-
return deny("parent_equals_fix", "parent_commit must be the commit BEFORE the fix");
|
|
67
|
-
}
|
|
68
|
-
if (str(artifact.parent_result) !== "fail") {
|
|
69
|
-
return deny(
|
|
70
|
-
"test_did_not_fail_at_parent",
|
|
71
|
-
"the named test must FAIL at the parent commit \u2014 a test that already passed does not detect the defect"
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
if (str(artifact.fix_result) !== "pass") {
|
|
75
|
-
return deny("test_did_not_pass_at_fix", "the named test must PASS at the fix commit");
|
|
76
|
-
}
|
|
77
|
-
return ok;
|
|
78
|
-
}
|
|
79
|
-
const verifier = str(artifact.verifier);
|
|
80
|
-
if (!verifier) {
|
|
81
|
-
return deny("manual_verifier_missing", "manual verification requires a named verifier");
|
|
82
|
-
}
|
|
83
|
-
const authors = (context.authorIdentities ?? []).map((a) => str(a).toLowerCase()).filter(Boolean);
|
|
84
|
-
if (authors.includes(verifier.toLowerCase())) {
|
|
85
|
-
return deny(
|
|
86
|
-
"manual_verifier_is_author",
|
|
87
|
-
"manual verification must be attested by someone other than the bug's author or assignee"
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
if (!str(artifact.method)) {
|
|
91
|
-
return deny("artifact_malformed", "manual verification requires a method");
|
|
92
|
-
}
|
|
93
|
-
if (str(artifact.observation).length < MIN_OBSERVATION_CHARS) {
|
|
94
|
-
return deny(
|
|
95
|
-
"manual_observation_too_thin",
|
|
96
|
-
"manual verification requires an observation describing the defect's absence"
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
if (!HEX_SHA.test(str(artifact.fix_commit))) {
|
|
100
|
-
return deny("artifact_malformed", "manual verification requires a fix_commit");
|
|
101
|
-
}
|
|
102
|
-
return ok;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// src/lib/verification-evidence.ts
|
|
106
|
-
var TEST_PATH = /(?:^|\/)(?:tests?|__tests__|__mocks__|e2e|fixtures)\//i;
|
|
107
|
-
var TEST_FILE = /\.(?:test|spec)\.[cm]?[jt]sx?$/i;
|
|
108
|
-
var NON_SOURCE_FILE = /\.(?:md|mdx|txt|rst|adoc|snap|lock)$/i;
|
|
109
|
-
var COMMENT_LINE = /^(?:\/\/|\/\*|\*\/|\*(?!\/)|#|--|<!--|-->)/;
|
|
110
|
-
function isTestPath(path) {
|
|
111
|
-
return TEST_PATH.test(path) || TEST_FILE.test(path);
|
|
112
|
-
}
|
|
113
|
-
function isNonSourcePath(path) {
|
|
114
|
-
return NON_SOURCE_FILE.test(path);
|
|
115
|
-
}
|
|
116
|
-
function isCommentOrBlank(line) {
|
|
117
|
-
const trimmed = line.trim();
|
|
118
|
-
if (!trimmed) return true;
|
|
119
|
-
return COMMENT_LINE.test(trimmed);
|
|
120
|
-
}
|
|
121
|
-
function measureUnifiedDiff(diff) {
|
|
122
|
-
let added = 0;
|
|
123
|
-
let deleted = 0;
|
|
124
|
-
let substantiveAdded = 0;
|
|
125
|
-
const sourceFiles = /* @__PURE__ */ new Set();
|
|
126
|
-
let currentPath = "";
|
|
127
|
-
let currentIsSource = false;
|
|
128
|
-
for (const line of diff.split(/\r?\n/)) {
|
|
129
|
-
if (line.startsWith("+++ ")) {
|
|
130
|
-
const path = line.slice(4).replace(/^b\//, "").trim();
|
|
131
|
-
currentPath = path === "/dev/null" ? "" : path;
|
|
132
|
-
currentIsSource = Boolean(currentPath) && !isTestPath(currentPath) && !isNonSourcePath(currentPath);
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
if (line.startsWith("--- ") || line.startsWith("diff ") || line.startsWith("index ") || line.startsWith("@@")) {
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
if (line.startsWith("+")) {
|
|
139
|
-
added += 1;
|
|
140
|
-
if (currentIsSource) {
|
|
141
|
-
const content = line.slice(1);
|
|
142
|
-
if (!isCommentOrBlank(content)) {
|
|
143
|
-
substantiveAdded += 1;
|
|
144
|
-
sourceFiles.add(currentPath);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
} else if (line.startsWith("-")) {
|
|
148
|
-
deleted += 1;
|
|
149
|
-
if (currentIsSource) {
|
|
150
|
-
const content = line.slice(1);
|
|
151
|
-
if (!isCommentOrBlank(content)) sourceFiles.add(currentPath);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return {
|
|
156
|
-
added,
|
|
157
|
-
deleted,
|
|
158
|
-
substantive_added: substantiveAdded,
|
|
159
|
-
source_files: sourceFiles.size
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
function measureCommitSubstance(sha, cwd) {
|
|
163
|
-
if (!/^[0-9a-f]{7,64}$/i.test(sha)) return null;
|
|
164
|
-
try {
|
|
165
|
-
const diff = execFileSync(
|
|
166
|
-
"git",
|
|
167
|
-
["show", "--format=", "--unified=0", "--no-color", sha],
|
|
168
|
-
{ cwd, encoding: "utf8", timeout: 15e3, maxBuffer: 32 * 1024 * 1024 }
|
|
169
|
-
);
|
|
170
|
-
return measureUnifiedDiff(diff);
|
|
171
|
-
} catch {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
function resolveParentCommit(sha, cwd) {
|
|
176
|
-
if (!/^[0-9a-f]{7,64}$/i.test(sha)) return null;
|
|
177
|
-
try {
|
|
178
|
-
const out = execFileSync("git", ["rev-parse", `${sha}^`], {
|
|
179
|
-
cwd,
|
|
180
|
-
encoding: "utf8",
|
|
181
|
-
timeout: 1e4
|
|
182
|
-
});
|
|
183
|
-
const parent = out.trim();
|
|
184
|
-
return /^[0-9a-f]{7,64}$/i.test(parent) ? parent : null;
|
|
185
|
-
} catch {
|
|
186
|
-
return null;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function fail(code, message) {
|
|
190
|
-
return { ok: false, code, message };
|
|
191
|
-
}
|
|
192
|
-
var PLACEHOLDER_VERIFIERS = /* @__PURE__ */ new Set([
|
|
193
|
-
"me",
|
|
194
|
-
"self",
|
|
195
|
-
"myself",
|
|
196
|
-
"i",
|
|
197
|
-
"agent",
|
|
198
|
-
"the agent",
|
|
199
|
-
"assistant",
|
|
200
|
-
"ai",
|
|
201
|
-
"bot",
|
|
202
|
-
"n/a",
|
|
203
|
-
"na",
|
|
204
|
-
"none",
|
|
205
|
-
"unknown",
|
|
206
|
-
"tbd",
|
|
207
|
-
"todo",
|
|
208
|
-
"system",
|
|
209
|
-
"automated",
|
|
210
|
-
"auto",
|
|
211
|
-
"claude",
|
|
212
|
-
"user",
|
|
213
|
-
"test",
|
|
214
|
-
"someone",
|
|
215
|
-
"team"
|
|
216
|
-
]);
|
|
217
|
-
var LOW_CONTENT_OBSERVATION = /^(?:it(?:'s| is)? |the bug (?:is|was) |this (?:is|was) )?(?:fixed|resolved|working|done|good|ok|verified|closed)\b/i;
|
|
218
|
-
function resolveCommit(sha, cwd) {
|
|
219
|
-
if (!/^[0-9a-f]{7,64}$/i.test(sha)) return null;
|
|
220
|
-
try {
|
|
221
|
-
const out = execFileSync("git", ["rev-parse", "--verify", `${sha}^{commit}`], {
|
|
222
|
-
cwd,
|
|
223
|
-
encoding: "utf8",
|
|
224
|
-
timeout: 1e4
|
|
225
|
-
}).trim();
|
|
226
|
-
return /^[0-9a-f]{40}$/i.test(out) ? out : null;
|
|
227
|
-
} catch {
|
|
228
|
-
return null;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
function buildVerificationArtifact(request, context = {}) {
|
|
232
|
-
const repo = request.repo_path;
|
|
233
|
-
if (!repo || !repo.trim()) {
|
|
234
|
-
return fail("repo_path_missing", "repo_path is required: the fix commit must be measured in the repository that contains it");
|
|
235
|
-
}
|
|
236
|
-
const fixCommit = resolveCommit(request.fix_commit ?? "", repo);
|
|
237
|
-
if (!fixCommit) {
|
|
238
|
-
return fail(
|
|
239
|
-
"fix_commit_unresolvable",
|
|
240
|
-
`fix_commit ${request.fix_commit} is not a commit in ${repo} \u2014 verification evidence cannot be measured, and will not be guessed`
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
const substance = measureCommitSubstance(fixCommit, repo);
|
|
244
|
-
if (!substance) {
|
|
245
|
-
return fail("commit_not_measurable", `git could not diff ${fixCommit} in ${repo}`);
|
|
246
|
-
}
|
|
247
|
-
let artifact;
|
|
248
|
-
if (request.kind === "regression_test") {
|
|
249
|
-
const parentCommit = resolveParentCommit(fixCommit, repo);
|
|
250
|
-
if (!parentCommit) {
|
|
251
|
-
return fail(
|
|
252
|
-
"parent_commit_unresolvable",
|
|
253
|
-
`could not resolve the first parent of ${fixCommit} \u2014 a regression_test artifact needs the tree WITHOUT the fix`
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
const testId = (request.test_id ?? "").trim();
|
|
257
|
-
if (!testId) return fail("artifact_malformed", "regression_test requires test_id (e.g. 'tests/foo.test.ts::rejects empty scope')");
|
|
258
|
-
const parentResult = (request.parent_result ?? "").trim();
|
|
259
|
-
const fixResult = (request.fix_result ?? "").trim();
|
|
260
|
-
if (parentResult !== "fail" && parentResult !== "pass" && parentResult !== "error") {
|
|
261
|
-
return fail("artifact_malformed", "parent_result must be the result you OBSERVED running the test at the parent commit: fail, pass or error");
|
|
262
|
-
}
|
|
263
|
-
if (fixResult !== "fail" && fixResult !== "pass" && fixResult !== "error") {
|
|
264
|
-
return fail("artifact_malformed", "fix_result must be the result you OBSERVED running the test at the fix commit: fail, pass or error");
|
|
265
|
-
}
|
|
266
|
-
const regression = {
|
|
267
|
-
kind: "regression_test",
|
|
268
|
-
test_id: testId,
|
|
269
|
-
fix_commit: fixCommit,
|
|
270
|
-
parent_commit: parentCommit,
|
|
271
|
-
parent_result: parentResult,
|
|
272
|
-
fix_result: fixResult,
|
|
273
|
-
substance
|
|
274
|
-
};
|
|
275
|
-
artifact = regression;
|
|
276
|
-
} else if (request.kind === "manual") {
|
|
277
|
-
const verifier = (request.verifier ?? "").trim();
|
|
278
|
-
if (!verifier) return fail("manual_verifier_missing", "manual verification requires a named verifier");
|
|
279
|
-
if (PLACEHOLDER_VERIFIERS.has(verifier.toLowerCase())) {
|
|
280
|
-
return fail(
|
|
281
|
-
"manual_verifier_placeholder",
|
|
282
|
-
`"${verifier}" is not an identity. Name the person or employee who reproduced the original defect and confirmed it is gone.`
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
const method = (request.method ?? "").trim();
|
|
286
|
-
if (!method) return fail("artifact_malformed", "manual verification requires a method someone else could repeat");
|
|
287
|
-
const observation = (request.observation ?? "").replace(/\s+/g, " ").trim();
|
|
288
|
-
if (LOW_CONTENT_OBSERVATION.test(observation)) {
|
|
289
|
-
return fail(
|
|
290
|
-
"manual_observation_too_thin",
|
|
291
|
-
"the observation must describe what you saw that shows the DEFECT IS ABSENT \u2014 not that the bug is 'fixed'"
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
if (observation.toLowerCase() === method.toLowerCase()) {
|
|
295
|
-
return fail("manual_observation_too_thin", "the observation must say what you saw, not repeat the method");
|
|
296
|
-
}
|
|
297
|
-
const manual = {
|
|
298
|
-
kind: "manual",
|
|
299
|
-
verifier,
|
|
300
|
-
method,
|
|
301
|
-
observation,
|
|
302
|
-
fix_commit: fixCommit,
|
|
303
|
-
substance
|
|
304
|
-
};
|
|
305
|
-
artifact = manual;
|
|
306
|
-
} else {
|
|
307
|
-
return fail("artifact_unknown_kind", "verification kind must be regression_test or manual");
|
|
308
|
-
}
|
|
309
|
-
const assessed = assessVerificationArtifact(artifact, context);
|
|
310
|
-
if (!assessed.ok) return fail(assessed.code, assessed.message);
|
|
311
|
-
return { ok: true, artifact, substance };
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export {
|
|
315
|
-
isSubstantiveCommit,
|
|
316
|
-
assessVerificationArtifact,
|
|
317
|
-
measureCommitSubstance,
|
|
318
|
-
buildVerificationArtifact
|
|
319
|
-
};
|
package/dist/chunk-TCTED52S.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
// src/lib/stack-invariants.ts
|
|
2
|
-
import { execFileSync } from "child_process";
|
|
3
|
-
var EXPECTED_GOTRUE_COUNT = 1;
|
|
4
|
-
function isGotrueImage(image) {
|
|
5
|
-
const normalized = image.toLowerCase();
|
|
6
|
-
const repo = (normalized.split("@")[0] ?? "").split(":")[0] ?? "";
|
|
7
|
-
return /(^|\/)gotrue$/.test(repo) || /(^|\/)supabase[/-]gotrue$/.test(repo) || /(^|\/)supabase[/-]auth$/.test(repo) || repo.endsWith("/gotrue");
|
|
8
|
-
}
|
|
9
|
-
function evaluateGotrueInvariant(containers) {
|
|
10
|
-
const instances = containers.filter((c) => isGotrueImage(c.image)).map((c) => c.name).sort();
|
|
11
|
-
if (instances.length === EXPECTED_GOTRUE_COUNT) {
|
|
12
|
-
return {
|
|
13
|
-
pass: true,
|
|
14
|
-
instances,
|
|
15
|
-
detail: `Exactly one GoTrue running (${instances[0]}) \u2014 invariant holds`
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
if (instances.length === 0) {
|
|
19
|
-
return {
|
|
20
|
-
pass: false,
|
|
21
|
-
instances,
|
|
22
|
-
detail: "\u{1F534} NO GoTrue container is running \u2014 auth is down for every product on this host"
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
pass: false,
|
|
27
|
-
instances,
|
|
28
|
-
detail: `\u{1F534} ${instances.length} GoTrue containers running (${instances.join(", ")}) \u2014 exactly ONE may serve auth. Two GoTrues sharing a JWT audience and user table is a split-brain identity provider: sessions minted by one cannot be revoked by the other. Stop the extras; the survivor is the exe-os stack's \`gotrue\`. exe-create's instance is on hold until Q4 and is gated behind the \`exe-create-revival\` compose profile in AskExe/exe-db.`
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function listRunningContainers() {
|
|
32
|
-
try {
|
|
33
|
-
const out = execFileSync(
|
|
34
|
-
"docker",
|
|
35
|
-
["ps", "--format", "{{.Names}} {{.Image}}"],
|
|
36
|
-
{ encoding: "utf-8", timeout: 5e3, stdio: ["ignore", "pipe", "ignore"] }
|
|
37
|
-
);
|
|
38
|
-
return out.split("\n").map((line) => line.trim()).filter(Boolean).map((line) => {
|
|
39
|
-
const [name = "", image = ""] = line.split(" ");
|
|
40
|
-
return { name, image };
|
|
41
|
-
});
|
|
42
|
-
} catch {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function checkSingleGotrueInstance(containers = listRunningContainers()) {
|
|
47
|
-
if (containers === null) {
|
|
48
|
-
return {
|
|
49
|
-
pass: true,
|
|
50
|
-
instances: [],
|
|
51
|
-
available: false,
|
|
52
|
-
detail: "n/a \u2014 Docker not reachable from this host"
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return { ...evaluateGotrueInvariant(containers), available: true };
|
|
56
|
-
}
|
|
57
|
-
var CANONICAL_SSO_COOKIE = "exe_access_token";
|
|
58
|
-
var DEAD_SSO_COOKIES = ["exe_sso_token"];
|
|
59
|
-
function stripHtmlComments(html) {
|
|
60
|
-
return html.replace(/<!--[\s\S]*?-->/g, "");
|
|
61
|
-
}
|
|
62
|
-
function evaluateSsoCookieContract(product, url, html) {
|
|
63
|
-
const source = stripHtmlComments(html);
|
|
64
|
-
const hasCookieGate = source.includes("document.cookie");
|
|
65
|
-
const deadCookiesFound = DEAD_SSO_COOKIES.filter((dead) => source.includes(dead));
|
|
66
|
-
const canonicalFound = source.includes(CANONICAL_SSO_COOKIE);
|
|
67
|
-
if (deadCookiesFound.length > 0) {
|
|
68
|
-
return {
|
|
69
|
-
product,
|
|
70
|
-
url,
|
|
71
|
-
pass: false,
|
|
72
|
-
severity: "violation",
|
|
73
|
-
detail: `\u{1F534} references RETIRED cookie ${deadCookiesFound.join(", ")} \u2014 nothing sets that name, so every visit bounces to auth.<apex> and back, forever. The canonical cookie is \`${CANONICAL_SSO_COOKIE}\`. Third occurrence of this exact bug (wiki f1bb40d8, crm 9f60e8e6, erp 3938ac3d).`,
|
|
74
|
-
deadCookiesFound,
|
|
75
|
-
canonicalFound
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
if (!hasCookieGate) {
|
|
79
|
-
return {
|
|
80
|
-
product,
|
|
81
|
-
url,
|
|
82
|
-
pass: true,
|
|
83
|
-
severity: "pass",
|
|
84
|
-
detail: "no client-side cookie gate (server-side or edge-gated) \u2014 n/a",
|
|
85
|
-
deadCookiesFound: [],
|
|
86
|
-
canonicalFound
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
if (!canonicalFound) {
|
|
90
|
-
return {
|
|
91
|
-
product,
|
|
92
|
-
url,
|
|
93
|
-
pass: true,
|
|
94
|
-
severity: "review",
|
|
95
|
-
detail: `\u{1F7E0} REVIEW: reads document.cookie but the canonical \`${CANONICAL_SSO_COOKIE}\` appears nowhere in the served document. Legitimate when the product gates on its OWN session cookie and bridges to GoTrue server-side (exe-crm gates on \`tokenPair\` and bridges via /api/auth/gotrue-callback). Confirm that is what this is, and not a gate on some third cookie name.`,
|
|
96
|
-
deadCookiesFound,
|
|
97
|
-
canonicalFound
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
product,
|
|
102
|
-
url,
|
|
103
|
-
pass: true,
|
|
104
|
-
severity: "pass",
|
|
105
|
-
detail: `gates on \`${CANONICAL_SSO_COOKIE}\` \u2014 contract holds`,
|
|
106
|
-
deadCookiesFound,
|
|
107
|
-
canonicalFound
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export {
|
|
112
|
-
EXPECTED_GOTRUE_COUNT,
|
|
113
|
-
isGotrueImage,
|
|
114
|
-
evaluateGotrueInvariant,
|
|
115
|
-
listRunningContainers,
|
|
116
|
-
checkSingleGotrueInstance,
|
|
117
|
-
CANONICAL_SSO_COOKIE,
|
|
118
|
-
DEAD_SSO_COOKIES,
|
|
119
|
-
evaluateSsoCookieContract
|
|
120
|
-
};
|
package/dist/chunk-W2IRQJ6R.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getAgentContext
|
|
3
|
-
} from "./chunk-GJV3WDWM.js";
|
|
4
|
-
|
|
5
|
-
// src/lib/project-name.ts
|
|
6
|
-
import { execSync } from "child_process";
|
|
7
|
-
import path from "path";
|
|
8
|
-
var _cached = null;
|
|
9
|
-
var _cachedCwd = null;
|
|
10
|
-
function getProjectName(cwd) {
|
|
11
|
-
if (!cwd) {
|
|
12
|
-
try {
|
|
13
|
-
const ctx = getAgentContext();
|
|
14
|
-
if (ctx?.projectName) return ctx.projectName;
|
|
15
|
-
} catch {
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
const dir = cwd ?? process.cwd();
|
|
19
|
-
if (_cached && _cachedCwd === dir) return _cached;
|
|
20
|
-
try {
|
|
21
|
-
let repoRoot;
|
|
22
|
-
try {
|
|
23
|
-
const gitCommonDir = execSync("git rev-parse --path-format=absolute --git-common-dir", {
|
|
24
|
-
cwd: dir,
|
|
25
|
-
encoding: "utf8",
|
|
26
|
-
timeout: 2e3,
|
|
27
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
28
|
-
}).trim();
|
|
29
|
-
repoRoot = path.dirname(gitCommonDir);
|
|
30
|
-
} catch {
|
|
31
|
-
repoRoot = execSync("git rev-parse --show-toplevel", {
|
|
32
|
-
cwd: dir,
|
|
33
|
-
encoding: "utf8",
|
|
34
|
-
timeout: 2e3,
|
|
35
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
36
|
-
}).trim();
|
|
37
|
-
}
|
|
38
|
-
_cached = path.basename(repoRoot);
|
|
39
|
-
_cachedCwd = dir;
|
|
40
|
-
return _cached;
|
|
41
|
-
} catch {
|
|
42
|
-
_cached = path.basename(dir);
|
|
43
|
-
_cachedCwd = dir;
|
|
44
|
-
return _cached;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
var EPHEMERAL_WORKTREE_RE = /^agent-[0-9a-f]{12,}$/i;
|
|
48
|
-
function isEphemeralWorktreeProject(name) {
|
|
49
|
-
return typeof name === "string" && EPHEMERAL_WORKTREE_RE.test(name.trim());
|
|
50
|
-
}
|
|
51
|
-
function resolveProjectName(cwd) {
|
|
52
|
-
const override = process.env.EXE_PROJECT_NAME?.trim();
|
|
53
|
-
if (override) return override;
|
|
54
|
-
const detected = getProjectName(cwd).trim();
|
|
55
|
-
return detected || "unknown";
|
|
56
|
-
}
|
|
57
|
-
function _resetCache() {
|
|
58
|
-
_cached = null;
|
|
59
|
-
_cachedCwd = null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export {
|
|
63
|
-
getProjectName,
|
|
64
|
-
isEphemeralWorktreeProject,
|
|
65
|
-
resolveProjectName,
|
|
66
|
-
_resetCache
|
|
67
|
-
};
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EXTRACT_TOOL,
|
|
3
|
-
storeExtraction
|
|
4
|
-
} from "./chunk-ZYCLSEZT.js";
|
|
5
|
-
import "./chunk-Z6BZQHP5.js";
|
|
6
|
-
import "./chunk-GUMRIUI5.js";
|
|
7
|
-
import {
|
|
8
|
-
resolveAnthropicAuth
|
|
9
|
-
} from "./chunk-VGMACSEV.js";
|
|
10
|
-
import "./chunk-7UTJA6HF.js";
|
|
11
|
-
import "./chunk-CHCA3ZM2.js";
|
|
12
|
-
import "./chunk-3F2UB4IQ.js";
|
|
13
|
-
import "./chunk-5MOYSU5A.js";
|
|
14
|
-
import "./chunk-4QCFFW2H.js";
|
|
15
|
-
import "./chunk-76CJBM36.js";
|
|
16
|
-
import {
|
|
17
|
-
getClient
|
|
18
|
-
} from "./chunk-5DCCKHDY.js";
|
|
19
|
-
import "./chunk-TKDITWDN.js";
|
|
20
|
-
import "./chunk-BBMTVAE3.js";
|
|
21
|
-
import "./chunk-5YEUPUV4.js";
|
|
22
|
-
import "./chunk-UTDMTQNH.js";
|
|
23
|
-
import "./chunk-YYB5PMTK.js";
|
|
24
|
-
import "./chunk-NJFJWQNN.js";
|
|
25
|
-
import "./chunk-V3W3SATA.js";
|
|
26
|
-
import "./chunk-JY5GAZYC.js";
|
|
27
|
-
import "./chunk-FXU7JOXK.js";
|
|
28
|
-
import "./chunk-QMSEL5YS.js";
|
|
29
|
-
import "./chunk-HSGBZSCA.js";
|
|
30
|
-
import "./chunk-JKKZGDLP.js";
|
|
31
|
-
import "./chunk-MLKGABMK.js";
|
|
32
|
-
|
|
33
|
-
// src/lib/doc-graph-extractor.ts
|
|
34
|
-
var CHUNK_CONTENT_LIMIT = 3e3;
|
|
35
|
-
var MAX_CHUNKS_PER_CALL = 8;
|
|
36
|
-
var DOC_GRAPH_MEMORY_PREFIX = "doc-graph:";
|
|
37
|
-
async function extractConceptsFromChunks(chunks, model = "claude-haiku-4-5-20251001") {
|
|
38
|
-
if (chunks.length === 0) {
|
|
39
|
-
return { entities: [], relationships: [], hyperedges: [] };
|
|
40
|
-
}
|
|
41
|
-
const selectedChunks = chunks.slice(0, MAX_CHUNKS_PER_CALL);
|
|
42
|
-
const combinedText = selectedChunks.map((chunk, i) => `--- Chunk ${i + 1} ---
|
|
43
|
-
${chunk.slice(0, CHUNK_CONTENT_LIMIT)}`).join("\n\n");
|
|
44
|
-
try {
|
|
45
|
-
const auth = resolveAnthropicAuth();
|
|
46
|
-
if (!auth) return { entities: [], relationships: [], hyperedges: [] };
|
|
47
|
-
const Anthropic = (await import("@anthropic-ai/sdk")).default;
|
|
48
|
-
const client = new Anthropic(auth);
|
|
49
|
-
const response = await client.messages.create({
|
|
50
|
-
model,
|
|
51
|
-
max_tokens: 1024,
|
|
52
|
-
system: `You are extracting a knowledge graph from document content. Identify all key entities (people, companies, concepts, locations, projects, tools, decisions, products) and the relationships between them. Focus on explicitly stated facts \u2014 don't over-infer. Use the simplest canonical form for entity names (e.g., "Anthropic" not "Anthropic, PBC"). For relationships, prefer specific types (depends_on, created, uses, part_of, located_at, manages, supplies) over generic related_to.`,
|
|
53
|
-
messages: [{ role: "user", content: combinedText }],
|
|
54
|
-
tools: [EXTRACT_TOOL],
|
|
55
|
-
tool_choice: { type: "tool", name: "extract_entities_and_relationships" }
|
|
56
|
-
});
|
|
57
|
-
const toolBlock = response.content.find((b) => b.type === "tool_use");
|
|
58
|
-
if (toolBlock && toolBlock.type === "tool_use") {
|
|
59
|
-
const input = toolBlock.input;
|
|
60
|
-
const rawEntities = input.entities ?? [];
|
|
61
|
-
const rawRels = input.relationships ?? [];
|
|
62
|
-
const rawHyperedges = input.hyperedges ?? [];
|
|
63
|
-
return {
|
|
64
|
-
entities: rawEntities.map((e) => ({ name: e.name ?? "", type: e.type ?? "concept" })).filter((e) => e.name.length > 0),
|
|
65
|
-
relationships: rawRels.map((r) => ({
|
|
66
|
-
source: r.source ?? "",
|
|
67
|
-
sourceType: r.source_type ?? "concept",
|
|
68
|
-
target: r.target ?? "",
|
|
69
|
-
targetType: r.target_type ?? "concept",
|
|
70
|
-
relationship: r.relationship ?? "related_to",
|
|
71
|
-
confidence: Number(r.confidence ?? 0.8),
|
|
72
|
-
confidenceLabel: String(r.confidence_label ?? "extracted")
|
|
73
|
-
})).filter((r) => r.source.length > 0 && r.target.length > 0),
|
|
74
|
-
hyperedges: rawHyperedges.map((h) => ({
|
|
75
|
-
label: String(h.label ?? ""),
|
|
76
|
-
relation: String(h.relation ?? ""),
|
|
77
|
-
entityNames: h.entity_names ?? [],
|
|
78
|
-
confidence: Number(h.confidence ?? 1)
|
|
79
|
-
})).filter((h) => h.label.length > 0 && h.entityNames.length >= 3)
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
} catch (err) {
|
|
83
|
-
process.stderr.write(
|
|
84
|
-
`[doc-graph-extractor] LLM extraction failed: ${err instanceof Error ? err.message : String(err)}
|
|
85
|
-
`
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
return { entities: [], relationships: [], hyperedges: [] };
|
|
89
|
-
}
|
|
90
|
-
async function extractAndStoreDocumentGraph(documentId, chunks, model = "claude-haiku-4-5-20251001") {
|
|
91
|
-
if (chunks.length === 0) {
|
|
92
|
-
return { entitiesStored: 0, relationshipsStored: 0, chunksProcessed: 0 };
|
|
93
|
-
}
|
|
94
|
-
try {
|
|
95
|
-
let totalEntities = 0;
|
|
96
|
-
let totalRelationships = 0;
|
|
97
|
-
let totalChunks = 0;
|
|
98
|
-
for (let i = 0; i < chunks.length; i += MAX_CHUNKS_PER_CALL) {
|
|
99
|
-
const batch = chunks.slice(i, i + MAX_CHUNKS_PER_CALL);
|
|
100
|
-
const extraction = await extractConceptsFromChunks(batch, model);
|
|
101
|
-
if (extraction.entities.length > 0 || extraction.relationships.length > 0) {
|
|
102
|
-
const client = getClient();
|
|
103
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
104
|
-
const syntheticMemoryId = `${DOC_GRAPH_MEMORY_PREFIX}${documentId}:${i}`;
|
|
105
|
-
const stored = await storeExtraction(client, extraction, syntheticMemoryId, now);
|
|
106
|
-
totalEntities += stored.entitiesStored;
|
|
107
|
-
totalRelationships += stored.relationshipsStored;
|
|
108
|
-
}
|
|
109
|
-
totalChunks += batch.length;
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
entitiesStored: totalEntities,
|
|
113
|
-
relationshipsStored: totalRelationships,
|
|
114
|
-
chunksProcessed: totalChunks
|
|
115
|
-
};
|
|
116
|
-
} catch (err) {
|
|
117
|
-
process.stderr.write(
|
|
118
|
-
`[doc-graph-extractor] extractAndStoreDocumentGraph failed for ${documentId}: ${err instanceof Error ? err.message : String(err)}
|
|
119
|
-
`
|
|
120
|
-
);
|
|
121
|
-
return { entitiesStored: 0, relationshipsStored: 0, chunksProcessed: 0 };
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
async function extractGraphFromExistingDocument(documentId, model = "claude-haiku-4-5-20251001") {
|
|
125
|
-
const client = getClient();
|
|
126
|
-
const docResult = await client.execute({
|
|
127
|
-
sql: "SELECT id FROM documents WHERE id = ?",
|
|
128
|
-
args: [documentId]
|
|
129
|
-
});
|
|
130
|
-
if (docResult.rows.length === 0) {
|
|
131
|
-
throw new Error(`Document not found: ${documentId}`);
|
|
132
|
-
}
|
|
133
|
-
const chunksResult = await client.execute({
|
|
134
|
-
sql: `SELECT raw_text FROM memories
|
|
135
|
-
WHERE document_id = ? AND COALESCE(status, 'active') = 'active'
|
|
136
|
-
ORDER BY char_offset ASC, timestamp ASC`,
|
|
137
|
-
args: [documentId]
|
|
138
|
-
});
|
|
139
|
-
if (chunksResult.rows.length === 0) {
|
|
140
|
-
return { entitiesStored: 0, relationshipsStored: 0, chunksProcessed: 0 };
|
|
141
|
-
}
|
|
142
|
-
const chunkTexts = chunksResult.rows.map((row) => String(row.raw_text));
|
|
143
|
-
return extractAndStoreDocumentGraph(documentId, chunkTexts, model);
|
|
144
|
-
}
|
|
145
|
-
export {
|
|
146
|
-
extractAndStoreDocumentGraph,
|
|
147
|
-
extractConceptsFromChunks,
|
|
148
|
-
extractGraphFromExistingDocument
|
|
149
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
_resetCache,
|
|
3
|
-
getProjectName,
|
|
4
|
-
isEphemeralWorktreeProject,
|
|
5
|
-
resolveProjectName
|
|
6
|
-
} from "./chunk-W2IRQJ6R.js";
|
|
7
|
-
import "./chunk-GJV3WDWM.js";
|
|
8
|
-
import "./chunk-MLKGABMK.js";
|
|
9
|
-
export {
|
|
10
|
-
_resetCache,
|
|
11
|
-
getProjectName,
|
|
12
|
-
isEphemeralWorktreeProject,
|
|
13
|
-
resolveProjectName
|
|
14
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|