0sec-cli 0.24.1 → 0.26.0
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/0.js +67 -62
- package/README.md +121 -82
- package/chunks/{adapt-loop-L77BWMNE.js → adapt-loop-P4HKONB5.js} +6 -5
- package/chunks/{artifact-scraper-BV67RAP5.js → artifact-scraper-IIRJNYKT.js} +4 -3
- package/chunks/{assumption-mining-RPVR77A3.js → assumption-mining-YA6VJ2V6.js} +22 -20
- package/chunks/{backend-connections-ACIXNYZN.js → backend-connections-64PKYKL7.js} +5 -4
- package/chunks/chunk-36J5ZLFE.js +18729 -0
- package/chunks/{chunk-ZM6ANQZJ.js → chunk-3MWQNNJU.js} +16180 -34467
- package/chunks/{chunk-GV5WXDHY.js → chunk-3VQ5EZKG.js} +11 -9
- package/chunks/chunk-5XOYTAOK.js +1546 -0
- package/chunks/{chunk-UJE4WOQS.js → chunk-6GV5G6U3.js} +1 -1
- package/chunks/{chunk-X2ZMSRTP.js → chunk-6SNOKNCS.js} +333 -3
- package/chunks/{chunk-BMDG6T7D.js → chunk-72PU46MS.js} +178 -133
- package/chunks/{chunk-KCA35IL3.js → chunk-7PUJI64A.js} +11 -9
- package/chunks/chunk-A7G6S5RA.js +90 -0
- package/chunks/chunk-ABKUI3QB.js +196 -0
- package/chunks/{chunk-5ETI27Q3.js → chunk-AFJ2UMPR.js} +3 -3
- package/chunks/{chunk-XA2IBHPB.js → chunk-B7XL6RON.js} +1 -1
- package/chunks/{chunk-TVS6WVSK.js → chunk-BM6EYP2D.js} +3 -3
- package/chunks/{chunk-7UHAXEOV.js → chunk-D4M5WURF.js} +226 -4
- package/chunks/{chunk-K74DRDC5.js → chunk-EHNVP6QB.js} +1 -1
- package/chunks/{chunk-I43YYHDU.js → chunk-FBZBJYZS.js} +5 -50
- package/chunks/{chunk-GXXX7AGH.js → chunk-GYEYTNHK.js} +144 -14
- package/chunks/{chunk-IJ6UPW3H.js → chunk-HS2NQ7K6.js} +393 -58
- package/chunks/chunk-HUZ2EC2R.js +196 -0
- package/chunks/{chunk-SU4IHQQI.js → chunk-IUUNIJPM.js} +1 -1
- package/chunks/chunk-JGDA6EIJ.js +49 -0
- package/chunks/{chunk-CJRZSWII.js → chunk-K3PTYN43.js} +3 -3
- package/chunks/{chunk-2NBZZFRG.js → chunk-KCABBZHN.js} +8 -10
- package/chunks/{chunk-3LPBJMHB.js → chunk-LRD5N2TQ.js} +1 -1
- package/chunks/{chunk-SQCBHFWN.js → chunk-LWMEJYCP.js} +2 -2
- package/chunks/chunk-MNK373HF.js +57 -0
- package/chunks/{chunk-R2XBH476.js → chunk-MOEVVXML.js} +2 -2
- package/chunks/{chunk-F2P25DJY.js → chunk-MOGWEHSC.js} +1448 -1050
- package/chunks/{chunk-6XMFCVJS.js → chunk-N7YCONYR.js} +1 -1
- package/chunks/{chunk-3WUPCZGF.js → chunk-NA3FKCI2.js} +1 -1
- package/chunks/{chunk-S2GITRD5.js → chunk-NABVDAAO.js} +2 -2
- package/chunks/{chunk-SZDD77KX.js → chunk-NNMOTHKC.js} +6 -10
- package/chunks/{chunk-LMP2T4G2.js → chunk-OILVEROI.js} +22 -172
- package/chunks/{chunk-YERUDEXT.js → chunk-PAE7ZAV6.js} +2780 -1255
- package/chunks/{chunk-NBV4I237.js → chunk-PAMJEXE2.js} +1 -1
- package/chunks/{chunk-PJU24AKR.js → chunk-R7VWEY45.js} +337 -257
- package/chunks/{chunk-QNRYOJEB.js → chunk-RZZ6VPRY.js} +1 -1
- package/chunks/{chunk-WUPN3D37.js → chunk-S4DFH2FJ.js} +26 -1
- package/chunks/{chunk-5WAHHZBF.js → chunk-SIR7XW2S.js} +61910 -30777
- package/chunks/{chunk-BD7WULFS.js → chunk-SSPP64FF.js} +3 -2
- package/chunks/{chunk-BOBIAHKA.js → chunk-STPHTPSD.js} +3 -333
- package/chunks/{chunk-Q7JKIKKF.js → chunk-UGCTPKJG.js} +89 -17
- package/chunks/{chunk-5PFRE522.js → chunk-ULRLUXSS.js} +1 -1
- package/chunks/{chunk-GZA7RGK7.js → chunk-UQS7XCBV.js} +2085 -1093
- package/chunks/{chunk-X2IPO5JO.js → chunk-V2KJQVYE.js} +2676 -2959
- package/chunks/{chunk-CGBDEST2.js → chunk-VJBEB2K6.js} +1 -1
- package/chunks/{chunk-ILRMLA6J.js → chunk-VWE36MUN.js} +1 -1
- package/chunks/{chunk-RURJYCWY.js → chunk-WNWDQ2TO.js} +1 -1
- package/chunks/{chunk-GTED3FSZ.js → chunk-WPJMA5AK.js} +4 -99
- package/chunks/{chunk-5NFIY2SJ.js → chunk-XJ2TBEV7.js} +3 -3
- package/chunks/{chunk-PVJUPIQG.js → chunk-XOVYV7TT.js} +6 -6
- package/chunks/{chunk-IXT64DV5.js → chunk-XPDJE537.js} +97 -1
- package/chunks/{chunk-YKWARO3T.js → chunk-YGYJ2FTH.js} +95 -21
- package/chunks/{chunk-JWSOUKFF.js → chunk-YJGPPPUB.js} +66 -21
- package/chunks/chunk-YP2DHYNI.js +650 -0
- package/chunks/{chunk-RVJVM5L4.js → chunk-Z2VLJEQJ.js} +5 -5
- package/chunks/chunk-ZPVSDB63.js +3839 -0
- package/chunks/{codex-models-6XVNFRXZ.js → codex-models-CI22KIHY.js} +9 -8
- package/chunks/{commands-FRPOFIO4.js → commands-C2WRSCNB.js} +909 -610
- package/chunks/dashboard-XO2X2SPD.js +75 -0
- package/chunks/{db-BXJNWUYJ.js → db-FU3OIGQK.js} +5 -4
- package/chunks/{deep-review-GSJEBLCG.js → deep-review-5AL6QYTK.js} +37 -38
- package/chunks/{disclose-OU6Z6GVT.js → disclose-YPV5KIUU.js} +6 -5
- package/chunks/{dist-M2X367VW.js → dist-JAZWL3SC.js} +3 -2
- package/chunks/{dist-TQMHMSBZ.js → dist-ONIRKDH6.js} +376 -333
- package/chunks/{dist-RKLQIXDT.js → dist-QLMPTFT7.js} +4 -3
- package/chunks/{dist-7KSYDDSG.js → dist-QXJKD743.js} +5 -2
- package/chunks/{dist-LNXGATR2.js → dist-WNAOCQGA.js} +5 -4
- package/chunks/eval-runner-D3RUCU3R.js +38 -0
- package/chunks/{exploit-agent-Y2P4GFIY.js → exploit-agent-4E4HXKUA.js} +1 -1
- package/chunks/{exploit-autoclimb-YRZ3TMS2.js → exploit-autoclimb-5GRXI6VQ.js} +1 -1
- package/chunks/{exploit-climb-4LEY4SDW.js → exploit-climb-AHQEJ2I2.js} +4 -3
- package/chunks/{fix-RQSIG75B.js → fix-CHD7LXDS.js} +9 -8
- package/chunks/{harness-3NVC3DDY.js → harness-E63KDHPG.js} +5 -4
- package/chunks/{http-conformance-U5F6GKYG.js → http-conformance-AXMUOE6C.js} +3 -2
- package/chunks/hunt-scan-ME2Z4CTC.js +43 -0
- package/chunks/{kernel-primitive-T47V3RD3.js → kernel-primitive-S566GXWP.js} +4 -3
- package/chunks/{kernel-vm-runner-AEL5E3SV.js → kernel-vm-runner-KREBY4DC.js} +4 -3
- package/chunks/{local-engine-ZCW4YC6E.js → local-engine-ZRTZVSSX.js} +7 -6
- package/chunks/managed-operation-ZMLLRCCQ.js +59 -0
- package/chunks/{memsafety-scan-L2Z7E7TE.js → memsafety-scan-Q2MBZEGJ.js} +1 -2
- package/chunks/{native-loop-26X2CHBV.js → native-loop-UV3Z4Z2F.js} +31 -16
- package/chunks/operator-services-JOCREEBA.js +79 -0
- package/chunks/orchestrate-ZF6ZTSIQ.js +62 -0
- package/chunks/{prepare-C3KGMBXT.js → prepare-PLDVGLDX.js} +7 -6
- package/chunks/{provider-model-discovery-QGUGL3XW.js → provider-model-discovery-3X6DON3Y.js} +7 -2
- package/chunks/{remote-workflow-runtime-DB52SINR.js → remote-workflow-runtime-GOI4TYP5.js} +4 -3
- package/chunks/routing-WCQLO5SP.js +61 -0
- package/chunks/{runtime-AUBLQUOH.js → runtime-6ZIXFTW5.js} +4 -3
- package/chunks/{runtime-U66JNSAY.js → runtime-TVH5ORUK.js} +13 -8
- package/chunks/{scan-stream-34F3LTPV.js → scan-stream-HJVTWZ44.js} +6 -4
- package/chunks/{scope-HSTG63TQ.js → scope-RCYXVGJR.js} +4 -3
- package/chunks/service-plugins-TN6KDX4L.js +63 -0
- package/chunks/{session-store-MKAAP3WL.js → session-store-6QR3CVUA.js} +8 -5
- package/chunks/{variant-candidates-LG767HWH.js → variant-candidates-SGLKPPHI.js} +9 -8
- package/chunks/{web-recon-prepass-NJP6J3E4.js → web-recon-prepass-GO7CTMVQ.js} +7 -6
- package/chunks/{workflow-runtime-AR627I26.js → workflow-runtime-CQTDASFA.js} +50 -49
- package/dashboard/assets/{abnfDiagram-VCTEODGH-Cq149Jpk.js → abnfDiagram-VCTEODGH-DDZsU70-.js} +1 -1
- package/dashboard/assets/{arc-CpP-3TRW.js → arc-iDXNTSL6.js} +1 -1
- package/dashboard/assets/architecture-7GRP2DOG-DJcY9RFg.js +1 -0
- package/dashboard/assets/architectureDiagram-5GKGNRK7-d0ZuOniQ.js +36 -0
- package/dashboard/assets/{blockDiagram-I7D4REHJ-CZYkRRDi.js → blockDiagram-I7D4REHJ-B-EWfMy1.js} +2 -2
- package/dashboard/assets/{c4Diagram-7LVT6UL2-CV7Iu3_Z.js → c4Diagram-7LVT6UL2-KcZRuXZC.js} +1 -1
- package/dashboard/assets/channel-CeWMIm0w.js +1 -0
- package/dashboard/assets/{chunk-4HAMMTFA-PKCyW4m-.js → chunk-4HAMMTFA-DXWulBlo.js} +1 -1
- package/dashboard/assets/{chunk-75Z2AOVW-C5MlFTc_.js → chunk-75Z2AOVW-RiLZItrz.js} +1 -1
- package/dashboard/assets/chunk-DU6HZSFF-MBcaIyTX.js +127 -0
- package/dashboard/assets/{chunk-F27PBJKO-DTAok0qM.js → chunk-F27PBJKO-kLWCBX_W.js} +1 -1
- package/dashboard/assets/{chunk-FOHPRMQF-DHwB1DNv.js → chunk-FOHPRMQF-COOliuUh.js} +14 -14
- package/dashboard/assets/{chunk-GMAD6QVW-CPsr2F33.js → chunk-GMAD6QVW-BeQeSjpW.js} +7 -7
- package/dashboard/assets/{chunk-GVQU2GXP-C2AXGf9A.js → chunk-GVQU2GXP-CjCMlOIB.js} +1 -1
- package/dashboard/assets/{chunk-IMKFNOWR-DMG6yD_O.js → chunk-IMKFNOWR-BwNst53D.js} +1 -1
- package/dashboard/assets/{chunk-L3NEJ4N5-BSvwdbXx.js → chunk-L3NEJ4N5-CHXWQrkL.js} +1 -1
- package/dashboard/assets/{chunk-OSK3NFVY-CfB8V7FU.js → chunk-OSK3NFVY-B2vd19Ed.js} +1 -1
- package/dashboard/assets/{chunk-P2QGCYS3-CvmZvq6n.js → chunk-P2QGCYS3-Dk7Fyh6n.js} +1 -1
- package/dashboard/assets/{chunk-POPQ4Y6H-D_TvwDxL.js → chunk-POPQ4Y6H-CPAgOvYe.js} +1 -1
- package/dashboard/assets/{chunk-PWAF6VOD-Da5GnuOY.js → chunk-PWAF6VOD-BotyfMha.js} +1 -1
- package/dashboard/assets/{chunk-SHT3W25Y-CcsMJpR-.js → chunk-SHT3W25Y-Buz5gLRP.js} +1 -1
- package/dashboard/assets/{chunk-SVP7TREG-COojjieJ.js → chunk-SVP7TREG-_rpYEZcs.js} +1 -1
- package/dashboard/assets/{chunk-TICWLB2K-nBAmJwx6.js → chunk-TICWLB2K-DOJxPoec.js} +2 -2
- package/dashboard/assets/{chunk-XXDRQBXY-r5HyhWDv.js → chunk-XXDRQBXY-EXxKJbAs.js} +1 -1
- package/dashboard/assets/classDiagram-ZZMXUADV-DV_h1NoS.js +1 -0
- package/dashboard/assets/classDiagram-v2-VYDZK3BY-DV_h1NoS.js +1 -0
- package/dashboard/assets/common-VLJRx-Jq.js +5 -0
- package/dashboard/assets/cose-bilkent-JH36ORCC-B1SVC57o.js +1 -0
- package/dashboard/assets/cynefin-OW5HDTMX-BzhRorj4.js +1 -0
- package/dashboard/assets/{cynefinDiagram-5FMLGOSQ-xodkuQtW.js → cynefinDiagram-5FMLGOSQ-JXzRmldX.js} +1 -1
- package/dashboard/assets/cytoscape.esm-BbBREfsg.js +321 -0
- package/dashboard/assets/dagre-D7JM2Yhv.js +1 -0
- package/dashboard/assets/dagre-GXQ25YYZ-1LZ-X0-Z.js +4 -0
- package/dashboard/assets/{diagram-S7CK7UJ4-DNoTMlCO.js → diagram-S7CK7UJ4-C_-J_LQ4.js} +2 -2
- package/dashboard/assets/{diagram-UQ7AKVKN-COccuyew.js → diagram-UQ7AKVKN-CnxL1k8g.js} +1 -1
- package/dashboard/assets/{diagram-VSXAHHWV-g6D1tWRb.js → diagram-VSXAHHWV-WzSb3aby.js} +1 -1
- package/dashboard/assets/{diagram-VX7I27RA-DhO4eVIC.js → diagram-VX7I27RA-DKhrMInE.js} +1 -1
- package/dashboard/assets/{diagram-Z3DM3KII-DeOQFexd.js → diagram-Z3DM3KII-CDhI2WGP.js} +1 -1
- package/dashboard/assets/{dist-BQYeOQg3.js → dist-B0bfBMeP.js} +1 -1
- package/dashboard/assets/{ebnfDiagram-PWID7BFC-MtkX2feM.js → ebnfDiagram-PWID7BFC-iL5NQ1PE.js} +1 -1
- package/dashboard/assets/{erDiagram-RLTQ6QDP-DIWSsoYZ.js → erDiagram-RLTQ6QDP-RK2Voa5O.js} +1 -1
- package/dashboard/assets/eventmodeling-NTZA5JFV-WgE7OJBb.js +1 -0
- package/dashboard/assets/flowDiagram-HODETNUW-B9YcQ0Aq.js +1 -0
- package/dashboard/assets/{ganttDiagram-EL5Y4UJY-DKggkJe0.js → ganttDiagram-EL5Y4UJY-D8CJXHRF.js} +1 -1
- package/dashboard/assets/gitGraph-4MIJSDKK-BuZ9Lg04.js +1 -0
- package/dashboard/assets/{gitGraphDiagram-WWUBYQGX-r_iR8Qzo.js → gitGraphDiagram-WWUBYQGX-LEJMh54j.js} +1 -1
- package/dashboard/assets/info-A6RAGUB7-BL5k3pev.js +1 -0
- package/dashboard/assets/{infoDiagram-27XIBGKW-ClQk7UyQ.js → infoDiagram-27XIBGKW-LJvntUnZ.js} +1 -1
- package/dashboard/assets/{ishikawaDiagram-5VMMS53U-tR7Vziog.js → ishikawaDiagram-5VMMS53U-BYTYgKCG.js} +2 -2
- package/dashboard/assets/{journeyDiagram-3NMN7TZE-Cpb9IqKL.js → journeyDiagram-3NMN7TZE-G25qgQgO.js} +1 -1
- package/dashboard/assets/{kanban-definition-UXKFOSKX-BzUuKbA9.js → kanban-definition-UXKFOSKX-Bk3uLl1i.js} +1 -1
- package/dashboard/assets/{katex-BdBmVSus.js → katex-nLxf_RlZ.js} +2 -2
- package/dashboard/assets/{line-BHY_tSHu.js → line-i4qHBaWO.js} +1 -1
- package/dashboard/assets/linear-DmrqRsKG.js +1 -0
- package/dashboard/assets/mermaid-parser.core-BxbKr4QF.js +7 -0
- package/dashboard/assets/{mermaid.core-D_QsUPU8.js → mermaid.core-Cltee6FS.js} +9 -9
- package/dashboard/assets/{mindmap-definition-YA3MSWOX-CtfLTPPJ.js → mindmap-definition-YA3MSWOX-DkzO2JgS.js} +1 -1
- package/dashboard/assets/operations-B4_timQX.css +1 -0
- package/dashboard/assets/operations-DwppJviL.js +199 -0
- package/dashboard/assets/packet-AYTQ26CC-uZQUKnrE.js +1 -0
- package/dashboard/assets/{pegDiagram-XKGWAZYB-C1Dclbzj.js → pegDiagram-XKGWAZYB-CrOEi00T.js} +1 -1
- package/dashboard/assets/pie-WAS4IAKB-Dn9_tpQT.js +1 -0
- package/dashboard/assets/{pieDiagram-E7YTZNPT-Cd7XwYo5.js → pieDiagram-E7YTZNPT-D-niUkzc.js} +1 -1
- package/dashboard/assets/{quadrantDiagram-AXDQQJYC-CaS-GQ4X.js → quadrantDiagram-AXDQQJYC-CJOTiG5V.js} +1 -1
- package/dashboard/assets/radar-RG4KPBEZ-DIIVz4e8.js +1 -0
- package/dashboard/assets/railroad-74A4TZTK-1kiqDEID.js +1 -0
- package/dashboard/assets/railroad-abnf-HS5TGJTU-DK6rQPZR.js +1 -0
- package/dashboard/assets/railroad-ebnf-LZEXJU2U-C6cOgYW4.js +1 -0
- package/dashboard/assets/railroad-peg-WCYAUIDC-CQ3ptKef.js +1 -0
- package/dashboard/assets/{railroadDiagram-O6MQD6OU-BeesTrqn.js → railroadDiagram-O6MQD6OU-nEfkpa-m.js} +1 -1
- package/dashboard/assets/{requirementDiagram-BXWQKSXE-IjyK0DhW.js → requirementDiagram-BXWQKSXE-CdFMY8tG.js} +1 -1
- package/dashboard/assets/{sankeyDiagram-P5KCCOFB-DmIluQqo.js → sankeyDiagram-P5KCCOFB-C0KxrFYv.js} +1 -1
- package/dashboard/assets/{sequenceDiagram-WJ2MYXX4-CUp8ZjTc.js → sequenceDiagram-WJ2MYXX4-DeZ5ATiu.js} +2 -2
- package/dashboard/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
- package/dashboard/assets/src-Cg-chcoE.js +1 -0
- package/dashboard/assets/{stateDiagram-D77RDMKH-Dy9TQb8P.js → stateDiagram-D77RDMKH-B9MwWL5B.js} +1 -1
- package/dashboard/assets/stateDiagram-v2-MP3YSRHH-SucFndhx.js +1 -0
- package/dashboard/assets/swimlanes-42K2YHIH-DB--fwQE.js +1 -0
- package/dashboard/assets/swimlanesDiagram-VR7AAH4N-BzH-rIaK.js +8 -0
- package/dashboard/assets/{timeline-definition-24CTP7MA-BGdXW-iY.js → timeline-definition-24CTP7MA-DLkkTbWb.js} +1 -1
- package/dashboard/assets/treeView-Q6P3EWNA-XkZ9rl9H.js +1 -0
- package/dashboard/assets/treemap-WGGIJYW6-JCtVKxCE.js +1 -0
- package/dashboard/assets/{vennDiagram-4TSXK5OY-DzKWHJsl.js → vennDiagram-4TSXK5OY-DEb-x29Z.js} +1 -1
- package/dashboard/assets/wardley-WFR3VGLG-DhI7ROY3.js +1 -0
- package/dashboard/assets/{wardleyDiagram-VM6X3IG4-DGsjYmNJ.js → wardleyDiagram-VM6X3IG4-KNckudc5.js} +1 -1
- package/dashboard/assets/{xychartDiagram-S5SC5T6Z-C7_T_tWt.js → xychartDiagram-S5SC5T6Z-D4c0ynCk.js} +1 -1
- package/dashboard/index.html +13 -2
- package/package.json +2 -5
- package/worker-assets/demo-target/README.md +7 -3
- package/chunks/chunk-2XGBEH53.js +0 -4304
- package/chunks/chunk-4ROZFLSR.js +0 -279
- package/chunks/chunk-56UTQKXO.js +0 -56
- package/chunks/chunk-BPU6M42R.js +0 -77
- package/chunks/chunk-H5QURBBK.js +0 -1123
- package/chunks/chunk-IIBNQTOK.js +0 -1532
- package/chunks/chunk-NJLKFC66.js +0 -4790
- package/chunks/chunk-OOMBOLAF.js +0 -295
- package/chunks/chunk-VIT5ALXF.js +0 -4054
- package/chunks/chunk-VU7V2SDW.js +0 -284
- package/chunks/chunk-W624J7NF.js +0 -117
- package/chunks/chunk-YSQWZ67M.js +0 -6027
- package/chunks/dashboard-5HDSNBAU.js +0 -76
- package/chunks/eval-runner-A2DIGVP7.js +0 -31
- package/chunks/hunt-scan-W246VWJC.js +0 -40
- package/chunks/managed-operation-6R2QPPW5.js +0 -60
- package/chunks/orchestrate-OBS37FWQ.js +0 -63
- package/chunks/run-MU3MFL2Z.js +0 -28242
- package/chunks/service-plugins-5B23PWXC.js +0 -64
- package/dashboard/assets/architecture-7GRP2DOG-z5EHYkyH.js +0 -1
- package/dashboard/assets/architectureDiagram-5GKGNRK7-ewtXpjR_.js +0 -36
- package/dashboard/assets/channel-CuYjfiC5.js +0 -1
- package/dashboard/assets/chunk-DU6HZSFF-3M37ulcO.js +0 -127
- package/dashboard/assets/classDiagram-ZZMXUADV-DCuOrWUV.js +0 -1
- package/dashboard/assets/classDiagram-v2-VYDZK3BY-DCuOrWUV.js +0 -1
- package/dashboard/assets/common-C6snVPsk.js +0 -5
- package/dashboard/assets/cose-bilkent-JH36ORCC-BLGcaZHk.js +0 -1
- package/dashboard/assets/cynefin-OW5HDTMX-DbZMK00I.js +0 -1
- package/dashboard/assets/cytoscape.esm-CGd-uY3x.js +0 -321
- package/dashboard/assets/dagre-GXQ25YYZ-CRk9qfSG.js +0 -4
- package/dashboard/assets/dagre-PrKaheQc.js +0 -1
- package/dashboard/assets/eventmodeling-NTZA5JFV-D_3ez4Gv.js +0 -1
- package/dashboard/assets/flowDiagram-HODETNUW-D2boyYEd.js +0 -1
- package/dashboard/assets/gitGraph-4MIJSDKK-DFOQYwXc.js +0 -1
- package/dashboard/assets/info-A6RAGUB7-DeednLoB.js +0 -1
- package/dashboard/assets/linear-naZZ1pHk.js +0 -1
- package/dashboard/assets/mermaid-parser.core-CPvd4cEx.js +0 -7
- package/dashboard/assets/operations-BwCzhVnT.js +0 -130
- package/dashboard/assets/operations-QjKT0Hwi.css +0 -1
- package/dashboard/assets/packet-AYTQ26CC-DDQbkT9I.js +0 -1
- package/dashboard/assets/pie-WAS4IAKB-LpU4ULAs.js +0 -1
- package/dashboard/assets/radar-RG4KPBEZ-CcxW3NJm.js +0 -1
- package/dashboard/assets/railroad-74A4TZTK-9P5Rl8fP.js +0 -1
- package/dashboard/assets/railroad-abnf-HS5TGJTU-CSfpwjna.js +0 -1
- package/dashboard/assets/railroad-ebnf-LZEXJU2U-D6R5qzr-.js +0 -1
- package/dashboard/assets/railroad-peg-WCYAUIDC-DKEX7ITG.js +0 -1
- package/dashboard/assets/sizeCapture-INFHLROL-B0uUizjq.js +0 -1
- package/dashboard/assets/src-r61wDjcA.js +0 -1
- package/dashboard/assets/stateDiagram-v2-MP3YSRHH-CQb0ZtPr.js +0 -1
- package/dashboard/assets/swimlanes-42K2YHIH-CZuDV7V5.js +0 -1
- package/dashboard/assets/swimlanesDiagram-VR7AAH4N-BxgWMq8X.js +0 -8
- package/dashboard/assets/treeView-Q6P3EWNA-DlRrayjM.js +0 -1
- package/dashboard/assets/treemap-WGGIJYW6-C6UqLKfI.js +0 -1
- package/dashboard/assets/wardley-WFR3VGLG-thmyHKb0.js +0 -1
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
homeStateDir,
|
|
9
9
|
parseSecurityWorkflowInput,
|
|
10
10
|
runStateDir
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GYEYTNHK.js";
|
|
12
12
|
import {
|
|
13
13
|
__export
|
|
14
14
|
} from "./chunk-VCSFCHAJ.js";
|
|
@@ -19,6 +19,7 @@ import { BaseSQLiteDatabase } from "drizzle-orm/sqlite-core/db";
|
|
|
19
19
|
import { SQLiteSyncDialect } from "drizzle-orm/sqlite-core/dialect";
|
|
20
20
|
import { createTableRelationsHelpers, extractTablesRelationalConfig } from "drizzle-orm/relations";
|
|
21
21
|
import { createRequire } from "node:module";
|
|
22
|
+
import { closeSync, openSync } from "node:fs";
|
|
22
23
|
function isBunRuntime() {
|
|
23
24
|
const g = globalThis;
|
|
24
25
|
if (typeof g.Bun !== "undefined")
|
|
@@ -91,38 +92,26 @@ var ShimmedDatabase = class {
|
|
|
91
92
|
constructor(engine) {
|
|
92
93
|
this.engine = engine;
|
|
93
94
|
}
|
|
94
|
-
prepare(
|
|
95
|
-
return new StatementShim(this.engine.prepare(
|
|
95
|
+
prepare(sql2) {
|
|
96
|
+
return new StatementShim(this.engine.prepare(sql2));
|
|
96
97
|
}
|
|
97
|
-
exec(
|
|
98
|
-
this.engine.exec(
|
|
98
|
+
exec(sql2) {
|
|
99
|
+
this.engine.exec(sql2);
|
|
99
100
|
return this;
|
|
100
101
|
}
|
|
101
|
-
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* we just `exec()` the pragma and swallow errors — some PRAGMAs (notably
|
|
105
|
-
* WAL journal mode) are not supported by node-sqlite3-wasm's VFS and error
|
|
106
|
-
* here, but losing them is acceptable for 0's single-process workload.
|
|
102
|
+
/** Return PRAGMA rows, or the first row's first value in simple mode.
|
|
103
|
+
* Setting errors propagate so callers cannot assume a safety setting applied
|
|
104
|
+
* after SQLite rejected it. SQLite itself ignores unknown PRAGMA names.
|
|
107
105
|
*/
|
|
108
|
-
pragma(query,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
} catch {
|
|
112
|
-
}
|
|
113
|
-
return void 0;
|
|
106
|
+
pragma(query, opts) {
|
|
107
|
+
const rows = this.prepare(`PRAGMA ${query}`).all();
|
|
108
|
+
return opts?.simple ? rows[0] ? Object.values(rows[0])[0] : void 0 : rows;
|
|
114
109
|
}
|
|
115
|
-
/**
|
|
116
|
-
* better-sqlite3's `db.transaction(fn)` returns a callable object with
|
|
117
|
-
* `.deferred`, `.immediate`, `.exclusive`, and `.default` methods, each
|
|
118
|
-
* running `fn` inside a BEGIN/COMMIT of the corresponding isolation level.
|
|
119
|
-
* All three variants are functionally equivalent for 0's single-writer
|
|
120
|
-
* workload, so we wire them to the same underlying implementation.
|
|
121
|
-
*/
|
|
110
|
+
/** Synchronous transactions with SQLite's actual lock-acquisition modes. */
|
|
122
111
|
transaction(fn) {
|
|
123
112
|
const engine = this.engine;
|
|
124
|
-
const
|
|
125
|
-
engine.exec(
|
|
113
|
+
const wrap = (begin) => (...args) => {
|
|
114
|
+
engine.exec(begin);
|
|
126
115
|
try {
|
|
127
116
|
const result = fn(...args);
|
|
128
117
|
engine.exec("COMMIT");
|
|
@@ -135,11 +124,12 @@ var ShimmedDatabase = class {
|
|
|
135
124
|
throw err;
|
|
136
125
|
}
|
|
137
126
|
};
|
|
127
|
+
const runInTx = wrap("BEGIN");
|
|
138
128
|
return Object.assign(runInTx, {
|
|
139
129
|
default: runInTx,
|
|
140
|
-
deferred:
|
|
141
|
-
immediate:
|
|
142
|
-
exclusive:
|
|
130
|
+
deferred: wrap("BEGIN DEFERRED"),
|
|
131
|
+
immediate: wrap("BEGIN IMMEDIATE"),
|
|
132
|
+
exclusive: wrap("BEGIN EXCLUSIVE")
|
|
143
133
|
});
|
|
144
134
|
}
|
|
145
135
|
close() {
|
|
@@ -157,13 +147,13 @@ function createWasmEngine(path) {
|
|
|
157
147
|
const { Database: WasmDatabaseCtor } = sqliteWasm;
|
|
158
148
|
const wasm = new WasmDatabaseCtor(path);
|
|
159
149
|
const prepared = /* @__PURE__ */ new Set();
|
|
160
|
-
const wrapStatement = (
|
|
161
|
-
let initial = wasm.prepare(
|
|
150
|
+
const wrapStatement = (sql2) => {
|
|
151
|
+
let initial = wasm.prepare(sql2);
|
|
162
152
|
prepared.add(initial);
|
|
163
153
|
const execute = (operation) => {
|
|
164
154
|
if (!wasm.isOpen)
|
|
165
155
|
throw new Error("Database already closed");
|
|
166
|
-
const statement = initial ?? wasm.prepare(
|
|
156
|
+
const statement = initial ?? wasm.prepare(sql2);
|
|
167
157
|
initial = void 0;
|
|
168
158
|
prepared.add(statement);
|
|
169
159
|
let succeeded = false;
|
|
@@ -195,9 +185,9 @@ function createWasmEngine(path) {
|
|
|
195
185
|
};
|
|
196
186
|
};
|
|
197
187
|
return {
|
|
198
|
-
prepare: (
|
|
199
|
-
exec: (
|
|
200
|
-
wasm.exec(
|
|
188
|
+
prepare: (sql2) => wrapStatement(sql2),
|
|
189
|
+
exec: (sql2) => {
|
|
190
|
+
wasm.exec(sql2);
|
|
201
191
|
},
|
|
202
192
|
close: () => {
|
|
203
193
|
for (const statement of prepared)
|
|
@@ -230,9 +220,9 @@ function createBunEngine(path) {
|
|
|
230
220
|
values: (bind) => bind === void 0 ? stmt.values() : stmt.values(bind)
|
|
231
221
|
});
|
|
232
222
|
return {
|
|
233
|
-
prepare: (
|
|
234
|
-
exec: (
|
|
235
|
-
db.exec(
|
|
223
|
+
prepare: (sql2) => wrapStatement(db.prepare(sql2)),
|
|
224
|
+
exec: (sql2) => {
|
|
225
|
+
db.exec(sql2);
|
|
236
226
|
},
|
|
237
227
|
close: () => db.close(),
|
|
238
228
|
get inTransaction() {
|
|
@@ -244,6 +234,14 @@ function createBunEngine(path) {
|
|
|
244
234
|
};
|
|
245
235
|
}
|
|
246
236
|
function createShimmedDatabase(path) {
|
|
237
|
+
if (path && path !== ":memory:" && !path.startsWith("file:")) {
|
|
238
|
+
try {
|
|
239
|
+
closeSync(openSync(path, "wx", 384));
|
|
240
|
+
} catch (error) {
|
|
241
|
+
if (error.code !== "EEXIST")
|
|
242
|
+
throw error;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
247
245
|
const engine = isBunRuntime() ? createBunEngine(path) : createWasmEngine(path);
|
|
248
246
|
return new ShimmedDatabase(engine);
|
|
249
247
|
}
|
|
@@ -276,10 +274,10 @@ function ensureDatabaseDirectory(path) {
|
|
|
276
274
|
}
|
|
277
275
|
|
|
278
276
|
// packages/db/dist/database.js
|
|
279
|
-
import { asc, eq, desc, and, gt, inArray, or } from "drizzle-orm";
|
|
277
|
+
import { asc, eq, desc, and, gt, inArray, or, sql } from "drizzle-orm";
|
|
280
278
|
import { createHash, randomUUID } from "node:crypto";
|
|
281
279
|
import { join } from "node:path";
|
|
282
|
-
import { closeSync, existsSync as existsSync2, openSync, readSync, renameSync, rmSync
|
|
280
|
+
import { closeSync as closeSync2, existsSync as existsSync2, openSync as openSync2, readSync, renameSync, rmSync } from "node:fs";
|
|
283
281
|
|
|
284
282
|
// packages/db/dist/schema.js
|
|
285
283
|
var schema_exports = {};
|
|
@@ -818,17 +816,12 @@ function resetOsecDatabase(dbPath) {
|
|
|
818
816
|
function repairOsecDatabase(dbPath) {
|
|
819
817
|
const path = resolveOsecDbPath(dbPath);
|
|
820
818
|
ensureDatabaseDirectory(path);
|
|
821
|
-
clearStaleLockIfAny(path);
|
|
822
819
|
const backupPath = backupCorruptDatabase(path) ?? void 0;
|
|
823
820
|
resetOsecDatabase(path);
|
|
824
821
|
const db = new osecDB(path);
|
|
825
822
|
db.close();
|
|
826
823
|
return { path, backupPath };
|
|
827
824
|
}
|
|
828
|
-
function isRecoverableDatabaseError(error) {
|
|
829
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
830
|
-
return /database disk image is malformed|file is not a database|malformed|invalid page number|database main|btree|b-tree|database corrupt/i.test(message);
|
|
831
|
-
}
|
|
832
825
|
function timestampTag() {
|
|
833
826
|
return (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
834
827
|
}
|
|
@@ -858,81 +851,22 @@ function ensureDatabaseHealthy(sqlite) {
|
|
|
858
851
|
throw new Error(first);
|
|
859
852
|
}
|
|
860
853
|
}
|
|
861
|
-
function
|
|
862
|
-
if (!existsSync2(path))
|
|
863
|
-
return;
|
|
864
|
-
let size;
|
|
865
|
-
try {
|
|
866
|
-
size = statSync(path).size;
|
|
867
|
-
} catch {
|
|
854
|
+
function assertDatabaseEngineCompatibility(path) {
|
|
855
|
+
if (isBunRuntime() || path === ":memory:" || !existsSync2(path))
|
|
868
856
|
return;
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
const header = Buffer.alloc(100);
|
|
857
|
+
const header = Buffer.alloc(20);
|
|
858
|
+
const fd = openSync2(path, "r");
|
|
859
|
+
let bytesRead;
|
|
873
860
|
try {
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
} finally {
|
|
878
|
-
closeSync(fd);
|
|
879
|
-
}
|
|
880
|
-
} catch {
|
|
881
|
-
return;
|
|
861
|
+
bytesRead = readSync(fd, header, 0, header.length, 0);
|
|
862
|
+
} finally {
|
|
863
|
+
closeSync2(fd);
|
|
882
864
|
}
|
|
883
|
-
if (header.subarray(0,
|
|
865
|
+
if (bytesRead < header.length || header.subarray(0, 16).toString("ascii") !== "SQLite format 3\0")
|
|
884
866
|
return;
|
|
885
867
|
if (header[18] !== 2 && header[19] !== 2)
|
|
886
868
|
return;
|
|
887
|
-
|
|
888
|
-
const shmPath = `${path}-shm`;
|
|
889
|
-
let hadWalData = false;
|
|
890
|
-
try {
|
|
891
|
-
if (existsSync2(walPath) && statSync(walPath).size > 0)
|
|
892
|
-
hadWalData = true;
|
|
893
|
-
} catch {
|
|
894
|
-
}
|
|
895
|
-
try {
|
|
896
|
-
const fd = openSync(path, "r+");
|
|
897
|
-
try {
|
|
898
|
-
writeSync(fd, Buffer.from([1, 1]), 0, 2, 18);
|
|
899
|
-
} finally {
|
|
900
|
-
closeSync(fd);
|
|
901
|
-
}
|
|
902
|
-
} catch (err) {
|
|
903
|
-
return;
|
|
904
|
-
}
|
|
905
|
-
for (const sidecar of [walPath, shmPath]) {
|
|
906
|
-
if (existsSync2(sidecar)) {
|
|
907
|
-
try {
|
|
908
|
-
rmSync(sidecar, { force: true });
|
|
909
|
-
} catch {
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
if (hadWalData) {
|
|
914
|
-
console.warn(`[0] Migrated ${path} from WAL mode to rollback mode for WASM engine compatibility. A non-empty WAL sidecar was present and has been removed; any uncommitted transactions from a prior crashed run were discarded.`);
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
function clearStaleLockIfAny(path) {
|
|
918
|
-
const lockPath = `${path}.lock`;
|
|
919
|
-
let stat;
|
|
920
|
-
try {
|
|
921
|
-
stat = statSync(lockPath);
|
|
922
|
-
} catch {
|
|
923
|
-
return;
|
|
924
|
-
}
|
|
925
|
-
if (!stat.isDirectory())
|
|
926
|
-
return;
|
|
927
|
-
const ageMs = Date.now() - stat.mtimeMs;
|
|
928
|
-
const STALE_THRESHOLD_MS = 1e4;
|
|
929
|
-
if (ageMs < STALE_THRESHOLD_MS)
|
|
930
|
-
return;
|
|
931
|
-
try {
|
|
932
|
-
rmSync(lockPath, { recursive: true, force: true });
|
|
933
|
-
console.warn(`[0] Removed stale database lock at ${lockPath} (age ${Math.floor(ageMs / 1e3)}s \u2014 previous holder likely crashed).`);
|
|
934
|
-
} catch {
|
|
935
|
-
}
|
|
869
|
+
throw new Error(`Cannot open WAL-mode database at ${path} with the Node WASM SQLite engine. The database and WAL/SHM files have been preserved. Stop all database users, back up the database together with its sidecars, then use a native SQLite connection to checkpoint the WAL and set PRAGMA journal_mode=DELETE. Do not delete WAL/SHM files or rewrite the database header. Alternatively, use the Bun native SQLite runtime.`);
|
|
936
870
|
}
|
|
937
871
|
var osecDB = class {
|
|
938
872
|
/** Resolved storage identity for scoped stores sharing this database. */
|
|
@@ -950,11 +884,10 @@ var osecDB = class {
|
|
|
950
884
|
return;
|
|
951
885
|
}
|
|
952
886
|
ensureDatabaseDirectory(path);
|
|
953
|
-
this.
|
|
887
|
+
this.openDatabase(path);
|
|
954
888
|
}
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
clearStaleLockIfAny(path);
|
|
889
|
+
openDatabase(path) {
|
|
890
|
+
assertDatabaseEngineCompatibility(path);
|
|
958
891
|
try {
|
|
959
892
|
this.initializeDatabase(path);
|
|
960
893
|
} catch (error) {
|
|
@@ -962,11 +895,7 @@ var osecDB = class {
|
|
|
962
895
|
this.sqlite?.close();
|
|
963
896
|
} catch {
|
|
964
897
|
}
|
|
965
|
-
|
|
966
|
-
throw error;
|
|
967
|
-
const backupPath = backupCorruptDatabase(path);
|
|
968
|
-
this.initializeDatabase(path);
|
|
969
|
-
console.warn(backupPath ? `[0] Recovered malformed database at ${path}. Backup saved to ${backupPath}.` : `[0] Recovered malformed database state at ${path} by recreating a fresh database.`);
|
|
898
|
+
throw error;
|
|
970
899
|
}
|
|
971
900
|
}
|
|
972
901
|
initializeDatabase(path) {
|
|
@@ -981,6 +910,7 @@ var osecDB = class {
|
|
|
981
910
|
})();
|
|
982
911
|
}
|
|
983
912
|
initializeReadOnlyDatabase(path) {
|
|
913
|
+
assertDatabaseEngineCompatibility(path);
|
|
984
914
|
this.sqlite = createShimmedDatabase(path);
|
|
985
915
|
this.sqlite.pragma("foreign_keys = ON");
|
|
986
916
|
this.db = createDrizzleFromShim(this.sqlite, { schema: schema_exports });
|
|
@@ -1793,10 +1723,10 @@ var osecDB = class {
|
|
|
1793
1723
|
this.updateFindingTriageByFingerprint(finding.fingerprint, triageStatus, triageNote);
|
|
1794
1724
|
}
|
|
1795
1725
|
getLatestFindingByFingerprint(fingerprint) {
|
|
1796
|
-
return this.db.select().from(findings).where(eq(findings.fingerprint, fingerprint)).orderBy(desc(findings.timestamp)).get();
|
|
1726
|
+
return this.db.select().from(findings).where(eq(findings.fingerprint, fingerprint)).orderBy(desc(findings.timestamp), desc(findings.id)).get();
|
|
1797
1727
|
}
|
|
1798
1728
|
getRelatedFindings(fingerprint) {
|
|
1799
|
-
return this.db.select().from(findings).where(eq(findings.fingerprint, fingerprint)).orderBy(desc(findings.timestamp)).all();
|
|
1729
|
+
return this.db.select().from(findings).where(eq(findings.fingerprint, fingerprint)).orderBy(desc(findings.timestamp), desc(findings.id)).all();
|
|
1800
1730
|
}
|
|
1801
1731
|
// ── Status Pipeline: discovered → verified → confirmed → scored → reported → fixed ──
|
|
1802
1732
|
transitionFindingStatus(findingId, newStatus) {
|
|
@@ -1901,6 +1831,14 @@ var osecDB = class {
|
|
|
1901
1831
|
conditions.push(eq(pipelineEvents.eventType, opts.eventType));
|
|
1902
1832
|
return this.db.select().from(pipelineEvents).where(and(...conditions)).orderBy(pipelineEvents.timestamp).all();
|
|
1903
1833
|
}
|
|
1834
|
+
/** Bounded retained receipts for explicit verification lifecycle recovery. */
|
|
1835
|
+
getRecentScanEvents(scanId, eventType, limit2 = 100, tools) {
|
|
1836
|
+
if (!Number.isSafeInteger(limit2) || limit2 < 1 || limit2 > 500)
|
|
1837
|
+
throw new Error("invalid scan event limit");
|
|
1838
|
+
if (tools && (!tools.length || tools.length > 10 || tools.some((tool) => !/^[a-z_]{1,64}$/.test(tool))))
|
|
1839
|
+
throw new Error("invalid receipt tools");
|
|
1840
|
+
return this.db.select().from(pipelineEvents).where(and(eq(pipelineEvents.scanId, scanId), eq(pipelineEvents.eventType, eventType), tools ? inArray(sql`CASE WHEN json_valid(${pipelineEvents.payload}) THEN json_extract(${pipelineEvents.payload}, '$.tool') ELSE '' END`, tools) : void 0)).orderBy(desc(pipelineEvents.timestamp), desc(pipelineEvents.id)).limit(limit2).all();
|
|
1841
|
+
}
|
|
1904
1842
|
listRecentEvents(limit2 = 50) {
|
|
1905
1843
|
return this.db.select({
|
|
1906
1844
|
id: pipelineEvents.id,
|
|
@@ -2906,6 +2844,7 @@ function initializeLearningTables(db) {
|
|
|
2906
2844
|
CREATE TABLE IF NOT EXISTS learning_active(project_id TEXT NOT NULL,kind TEXT NOT NULL,target_id TEXT NOT NULL,candidate_id TEXT NOT NULL,PRIMARY KEY(project_id,kind,target_id));
|
|
2907
2845
|
CREATE TABLE IF NOT EXISTS learning_work(id TEXT PRIMARY KEY,event_id TEXT NOT NULL,kind TEXT NOT NULL,status TEXT NOT NULL,attempts INTEGER NOT NULL DEFAULT 0,available_at INTEGER NOT NULL,lease_until INTEGER,claim_token TEXT,owner TEXT,UNIQUE(event_id,kind));
|
|
2908
2846
|
CREATE INDEX IF NOT EXISTS learning_events_project ON learning_events(project_id,updated_at);
|
|
2847
|
+
CREATE INDEX IF NOT EXISTS learning_knowledge_project_id ON learning_knowledge(project_id,id);
|
|
2909
2848
|
CREATE INDEX IF NOT EXISTS learning_work_ready ON learning_work(status,available_at,lease_until);`);
|
|
2910
2849
|
}
|
|
2911
2850
|
function appendLearningEvent(db, input) {
|
|
@@ -2993,9 +2932,91 @@ var LearningStore = class {
|
|
|
2993
2932
|
listKnowledge(options) {
|
|
2994
2933
|
return this.#list("learning_knowledge", options);
|
|
2995
2934
|
}
|
|
2935
|
+
/** Stable keyset pages for source freshness checks, unaffected by status updates. */
|
|
2936
|
+
listCurrentSourceKnowledgePage(projectId, afterId, pageSize = 200) {
|
|
2937
|
+
bounded(projectId, "project ID");
|
|
2938
|
+
if (afterId !== void 0)
|
|
2939
|
+
bounded(afterId, "knowledge cursor");
|
|
2940
|
+
return this.#db.prepare("SELECT body FROM learning_knowledge WHERE project_id=? AND id>? AND json_extract(body,'$.status')='current' AND json_array_length(body,'$.sourceLinks')>0 ORDER BY id LIMIT ?").all(projectId, afterId ?? "", limit(pageSize)).map((row) => JSON.parse(row.body));
|
|
2941
|
+
}
|
|
2996
2942
|
getKnowledge(id) {
|
|
2997
2943
|
return read(this.#db, "learning_knowledge", id);
|
|
2998
2944
|
}
|
|
2945
|
+
/** Export is explicit and fails rather than silently truncating a large memory library. */
|
|
2946
|
+
exportKnowledge(projectId) {
|
|
2947
|
+
if (projectId !== void 0)
|
|
2948
|
+
bounded(projectId, "project ID");
|
|
2949
|
+
const entries = this.#db.prepare("SELECT body FROM learning_knowledge WHERE (? IS NULL OR project_id=?) ORDER BY updated_at DESC,id LIMIT 201").all(projectId ?? null, projectId ?? null).map((row) => JSON.parse(row.body));
|
|
2950
|
+
if (entries.length > 200)
|
|
2951
|
+
fail("More than 200 lessons. Export one project at a time.", 413);
|
|
2952
|
+
return entries;
|
|
2953
|
+
}
|
|
2954
|
+
#importIdentity(input) {
|
|
2955
|
+
return createHash2("sha256").update(JSON.stringify({ projectId: input.projectId, summary: input.summary, sourceLinks: [...input.sourceLinks].sort((a, b) => a.path.localeCompare(b.path) || a.hash.localeCompare(b.hash)) })).digest("hex");
|
|
2956
|
+
}
|
|
2957
|
+
#existingImport(input) {
|
|
2958
|
+
const identity = this.#importIdentity(input);
|
|
2959
|
+
const entries = this.#db.prepare("SELECT body FROM learning_knowledge WHERE project_id=? AND json_extract(body,'$.summary')=?").all(input.projectId, input.summary);
|
|
2960
|
+
return entries.some((row) => this.#importIdentity(JSON.parse(row.body)) === identity);
|
|
2961
|
+
}
|
|
2962
|
+
previewKnowledgeImport(inputs, exportedAt) {
|
|
2963
|
+
if (!Array.isArray(inputs) || inputs.length > 200)
|
|
2964
|
+
fail("At most 200 lessons can be imported.");
|
|
2965
|
+
if (!Number.isFinite(Date.parse(exportedAt)))
|
|
2966
|
+
fail("Invalid export timestamp.");
|
|
2967
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2968
|
+
return inputs.map((input) => {
|
|
2969
|
+
bounded(input.id, "original lesson ID");
|
|
2970
|
+
bounded(input.projectId, "project ID");
|
|
2971
|
+
bounded(input.summary, "knowledge summary", 4e3);
|
|
2972
|
+
sources(input.sourceLinks);
|
|
2973
|
+
if (!Number.isFinite(Date.parse(input.createdAt)))
|
|
2974
|
+
fail("Invalid lesson timestamp.");
|
|
2975
|
+
for (const link of input.sourceLinks)
|
|
2976
|
+
if (isAbsolute2(link.path) || /^[A-Za-z]:[\\/]|^\\\\/.test(link.path) || /(?:^|[\\/])\.\.(?:[\\/]|$)/.test(link.path) || !/^sha256:[a-f0-9]{64}$/i.test(link.hash))
|
|
2977
|
+
fail("Imported source links must use relative paths and SHA-256 hashes.");
|
|
2978
|
+
if (!Array.isArray(input.provenance) || input.provenance.length > 64)
|
|
2979
|
+
fail("Invalid lesson provenance.");
|
|
2980
|
+
for (const evidence of input.provenance) {
|
|
2981
|
+
bounded(evidence.id, "original evidence ID");
|
|
2982
|
+
bounded(evidence.kind, "evidence kind");
|
|
2983
|
+
if (!Number.isFinite(Date.parse(evidence.createdAt)))
|
|
2984
|
+
fail("Invalid evidence timestamp.");
|
|
2985
|
+
}
|
|
2986
|
+
const identity = this.#importIdentity(input);
|
|
2987
|
+
const duplicate = seen.has(identity) || this.#existingImport(input);
|
|
2988
|
+
seen.add(identity);
|
|
2989
|
+
return duplicate;
|
|
2990
|
+
});
|
|
2991
|
+
}
|
|
2992
|
+
/** Imported prose is retained for inspection only, never admitted as current source evidence. */
|
|
2993
|
+
importKnowledge(inputs, exportedAt) {
|
|
2994
|
+
return this.#db.transaction(() => {
|
|
2995
|
+
const duplicates = this.previewKnowledgeImport(inputs, exportedAt);
|
|
2996
|
+
let imported = 0;
|
|
2997
|
+
inputs.forEach((input, index2) => {
|
|
2998
|
+
if (duplicates[index2])
|
|
2999
|
+
return;
|
|
3000
|
+
const fingerprint = this.#importIdentity(input);
|
|
3001
|
+
const event = appendLearningEvent(this.#db, { idempotencyKey: `memory-import:${fingerprint}`, projectId: input.projectId, kind: "memory-import", outcome: "retained-disabled", evidenceStrength: "hypothesis", summary: "Imported lesson retained as disabled; original provenance is untrusted data.", sourceLinks: input.sourceLinks });
|
|
3002
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3003
|
+
const entry = {
|
|
3004
|
+
id: `knowledge:import:${fingerprint}`,
|
|
3005
|
+
projectId: input.projectId,
|
|
3006
|
+
summary: input.summary,
|
|
3007
|
+
sourceLinks: input.sourceLinks,
|
|
3008
|
+
evidenceEventIds: [event.id],
|
|
3009
|
+
status: "disabled",
|
|
3010
|
+
createdAt: now,
|
|
3011
|
+
updatedAt: now,
|
|
3012
|
+
importedFrom: { id: input.id, projectId: input.projectId, createdAt: input.createdAt, exportedAt, evidence: input.provenance }
|
|
3013
|
+
};
|
|
3014
|
+
write(this.#db, "learning_knowledge", entry);
|
|
3015
|
+
imported++;
|
|
3016
|
+
});
|
|
3017
|
+
return { imported, duplicates: duplicates.filter(Boolean).length, disabled: true };
|
|
3018
|
+
})();
|
|
3019
|
+
}
|
|
2999
3020
|
#checkEvidence(projectId, ids) {
|
|
3000
3021
|
refs(ids, "evidence event IDs");
|
|
3001
3022
|
if (!ids.length)
|
|
@@ -3006,21 +3027,45 @@ var LearningStore = class {
|
|
|
3006
3027
|
fail("Evidence must belong to the same project.");
|
|
3007
3028
|
}
|
|
3008
3029
|
}
|
|
3030
|
+
#knowledgeIdentity(input) {
|
|
3031
|
+
return `knowledge:${createHash2("sha256").update(JSON.stringify({ projectId: input.projectId, summary: input.summary, sourceLinks: [...input.sourceLinks].sort((a, b) => a.path.localeCompare(b.path)), evidenceEventIds: [...input.evidenceEventIds].sort() })).digest("hex")}`;
|
|
3032
|
+
}
|
|
3033
|
+
/** Exact prior admission status, independent of library ordering or pagination. */
|
|
3034
|
+
findSourceKnowledge(projectId, summary, sourceLinks, eventKey) {
|
|
3035
|
+
const disabled = this.findDisabledSourceKnowledge(projectId, summary, sourceLinks);
|
|
3036
|
+
if (disabled)
|
|
3037
|
+
return disabled;
|
|
3038
|
+
const row = this.#db.prepare("SELECT body FROM learning_events WHERE idempotency_key=? AND project_id=?").all(eventKey, projectId)[0];
|
|
3039
|
+
if (!row)
|
|
3040
|
+
return null;
|
|
3041
|
+
const event = JSON.parse(row.body);
|
|
3042
|
+
if (event.kind !== "source-context")
|
|
3043
|
+
return null;
|
|
3044
|
+
return this.getKnowledge(this.#knowledgeIdentity({ projectId, summary, sourceLinks, evidenceEventIds: [event.id] }));
|
|
3045
|
+
}
|
|
3046
|
+
/** Match operator-disabled source lessons independently of library pagination. */
|
|
3047
|
+
findDisabledSourceKnowledge(projectId, summary, sourceLinks) {
|
|
3048
|
+
const fingerprint = (links) => JSON.stringify([...links].sort((a, b) => a.path.localeCompare(b.path) || a.hash.localeCompare(b.hash)));
|
|
3049
|
+
const matching = this.#db.prepare("SELECT body FROM learning_knowledge WHERE project_id=? AND json_extract(body,'$.summary')=? AND json_extract(body,'$.status')='disabled'").all(projectId, summary);
|
|
3050
|
+
const requested = fingerprint(sourceLinks);
|
|
3051
|
+
for (const row of matching) {
|
|
3052
|
+
const prior = JSON.parse(row.body);
|
|
3053
|
+
if (fingerprint(prior.sourceLinks) === requested)
|
|
3054
|
+
return prior;
|
|
3055
|
+
}
|
|
3056
|
+
return null;
|
|
3057
|
+
}
|
|
3009
3058
|
putKnowledge(input) {
|
|
3010
3059
|
bounded(input.projectId, "project ID");
|
|
3011
3060
|
bounded(input.summary, "knowledge summary", 4e3);
|
|
3012
3061
|
sources(input.sourceLinks);
|
|
3013
3062
|
this.#checkEvidence(input.projectId, input.evidenceEventIds);
|
|
3014
3063
|
if (input.sourceLinks.length) {
|
|
3015
|
-
const
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
const prior = JSON.parse(row.body);
|
|
3019
|
-
if (fingerprint(prior.sourceLinks) === fingerprint(input.sourceLinks))
|
|
3020
|
-
return prior;
|
|
3021
|
-
}
|
|
3064
|
+
const disabled = this.findDisabledSourceKnowledge(input.projectId, input.summary, input.sourceLinks);
|
|
3065
|
+
if (disabled)
|
|
3066
|
+
return disabled;
|
|
3022
3067
|
}
|
|
3023
|
-
const identity =
|
|
3068
|
+
const identity = this.#knowledgeIdentity(input);
|
|
3024
3069
|
const existing = this.getKnowledge(identity);
|
|
3025
3070
|
if (existing)
|
|
3026
3071
|
return existing;
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
import { createRequire as __0CreateRequire } from "node:module";
|
|
3
3
|
const require = __0CreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
|
-
EventSourceParserStream
|
|
5
|
+
EventSourceParserStream
|
|
6
|
+
} from "./chunk-ABKUI3QB.js";
|
|
7
|
+
import {
|
|
8
|
+
require_auth_errors,
|
|
9
|
+
require_token_error,
|
|
10
|
+
require_token_util
|
|
11
|
+
} from "./chunk-TRH2PJSN.js";
|
|
12
|
+
import {
|
|
6
13
|
_enum,
|
|
7
14
|
any,
|
|
8
15
|
array,
|
|
@@ -17,12 +24,7 @@ import {
|
|
|
17
24
|
toJSONSchema,
|
|
18
25
|
union,
|
|
19
26
|
unknown
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import {
|
|
22
|
-
require_auth_errors,
|
|
23
|
-
require_token_error,
|
|
24
|
-
require_token_util
|
|
25
|
-
} from "./chunk-TRH2PJSN.js";
|
|
27
|
+
} from "./chunk-36J5ZLFE.js";
|
|
26
28
|
import {
|
|
27
29
|
__commonJS,
|
|
28
30
|
__toESM
|
|
@@ -588,7 +590,7 @@ function isJSONObject(value) {
|
|
|
588
590
|
var WORKFLOW_SERIALIZE = /* @__PURE__ */ Symbol.for("workflow-serialize");
|
|
589
591
|
var WORKFLOW_DESERIALIZE = /* @__PURE__ */ Symbol.for("workflow-deserialize");
|
|
590
592
|
|
|
591
|
-
// node_modules/.pnpm/@ai-sdk+provider-utils@5.0.45_zod@
|
|
593
|
+
// node_modules/.pnpm/@ai-sdk+provider-utils@5.0.45_zod@4.6.6/node_modules/@ai-sdk/provider-utils/dist/index.js
|
|
592
594
|
function asArray(value) {
|
|
593
595
|
return value === void 0 ? [] : Array.isArray(value) ? value : [value];
|
|
594
596
|
}
|
|
@@ -3868,7 +3870,7 @@ function getToolCaller(tool2) {
|
|
|
3868
3870
|
return tool2 == null ? void 0 : tool2.experimental_toolCaller;
|
|
3869
3871
|
}
|
|
3870
3872
|
|
|
3871
|
-
// node_modules/.pnpm/@ai-sdk+gateway@4.0.87_zod@
|
|
3873
|
+
// node_modules/.pnpm/@ai-sdk+gateway@4.0.87_zod@4.6.6/node_modules/@ai-sdk/gateway/dist/index.js
|
|
3872
3874
|
var import_oidc = __toESM(require_dist(), 1);
|
|
3873
3875
|
var import_oidc2 = __toESM(require_dist(), 1);
|
|
3874
3876
|
var GATEWAY_REALTIME_SUBPROTOCOL = "ai-gateway-realtime.v1";
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __0CreateRequire } from "node:module";
|
|
3
|
+
const require = __0CreateRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
expandHomePath,
|
|
6
|
+
isExistingLocalTargetPath,
|
|
7
|
+
isExplicitLocalTargetPath
|
|
8
|
+
} from "./chunk-R7VWEY45.js";
|
|
9
|
+
|
|
10
|
+
// packages/cli/src/engagement-plan.ts
|
|
11
|
+
var PACKAGE_PREFIXES = {
|
|
12
|
+
"npm:": { ecosystem: "npm", targetType: "npm-package" },
|
|
13
|
+
"pypi:": { ecosystem: "pypi", targetType: "pypi-package" },
|
|
14
|
+
"cargo:": { ecosystem: "cargo", targetType: "cargo-package" },
|
|
15
|
+
"oci:": { ecosystem: "oci", targetType: "oci-image" }
|
|
16
|
+
};
|
|
17
|
+
function resolveEngagement(rawTarget) {
|
|
18
|
+
const raw = rawTarget.trim();
|
|
19
|
+
if (raw.length === 0) return { ok: false, message: "Enter a URL, source path, git URL, or ecosystem-prefixed package." };
|
|
20
|
+
for (const [prefix, packagePlan] of Object.entries(PACKAGE_PREFIXES)) {
|
|
21
|
+
if (!raw.startsWith(prefix)) continue;
|
|
22
|
+
const target = raw.slice(prefix.length).trim();
|
|
23
|
+
if (target.length === 0) return { ok: false, message: `${prefix} requires a package name.` };
|
|
24
|
+
return {
|
|
25
|
+
ok: true,
|
|
26
|
+
plan: {
|
|
27
|
+
kind: "package",
|
|
28
|
+
target,
|
|
29
|
+
targetType: packagePlan.targetType,
|
|
30
|
+
ecosystem: packagePlan.ecosystem,
|
|
31
|
+
label: `${packagePlan.ecosystem} package ${target}`
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (raw.startsWith("source:")) {
|
|
36
|
+
const target = raw.slice("source:".length).trim();
|
|
37
|
+
if (target.length === 0) return { ok: false, message: "source: requires a local path or git URL." };
|
|
38
|
+
return {
|
|
39
|
+
ok: true,
|
|
40
|
+
plan: {
|
|
41
|
+
kind: "source",
|
|
42
|
+
target: expandHomePath(target),
|
|
43
|
+
targetType: "source-code",
|
|
44
|
+
label: `source review ${target}`
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (raw.startsWith("git@") || raw.startsWith("git://") || raw.endsWith(".git") || raw.startsWith("https://github.com/")) {
|
|
49
|
+
return {
|
|
50
|
+
ok: true,
|
|
51
|
+
plan: {
|
|
52
|
+
kind: "source",
|
|
53
|
+
target: raw,
|
|
54
|
+
targetType: "source-code",
|
|
55
|
+
label: `source review ${raw}`
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (raw.startsWith("mcp://") || raw.startsWith("http://") || raw.startsWith("https://")) {
|
|
60
|
+
return {
|
|
61
|
+
ok: true,
|
|
62
|
+
plan: {
|
|
63
|
+
kind: "web",
|
|
64
|
+
target: raw,
|
|
65
|
+
targetType: "url",
|
|
66
|
+
label: `web target ${raw}`
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (isExplicitLocalTargetPath(raw) || isExistingLocalTargetPath(raw)) {
|
|
71
|
+
const target = expandHomePath(raw);
|
|
72
|
+
return {
|
|
73
|
+
ok: true,
|
|
74
|
+
plan: {
|
|
75
|
+
kind: "source",
|
|
76
|
+
target,
|
|
77
|
+
targetType: "source-code",
|
|
78
|
+
label: `source review ${target}`
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
ok: false,
|
|
84
|
+
message: "Ambiguous target. Use https://\u2026, ./path, source:\u2026, npm:\u2026, pypi:\u2026, cargo:\u2026, or oci:\u2026."
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
resolveEngagement
|
|
90
|
+
};
|