0sec-cli 0.22.4 → 0.24.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 +73 -68
- package/README.md +95 -61
- package/chunks/{adapt-loop-3CCOWE43.js → adapt-loop-TEJPXWFG.js} +4 -4
- package/chunks/{artifact-scraper-Z4UUIOH3.js → artifact-scraper-AJZ3LOQY.js} +2 -2
- package/chunks/{assumption-mining-2UAKQB6V.js → assumption-mining-EATDC4BB.js} +18 -18
- package/chunks/backend-connections-QE4NASAK.js +23 -0
- package/chunks/chunk-3XLEDCFX.js +566 -0
- package/chunks/{chunk-BGX53365.js → chunk-3XLFB46W.js} +5 -3
- package/chunks/{chunk-IXAHQICR.js → chunk-4TUR47H5.js} +8 -3
- package/chunks/{chunk-5WAJGLCW.js → chunk-4YRXIVPZ.js} +3 -3
- package/chunks/{chunk-4ZYYX5GY.js → chunk-52AWIBCT.js} +1 -1
- package/chunks/{chunk-TO35Y326.js → chunk-554D4AYM.js} +5 -2
- package/chunks/{chunk-GQ3DGHWE.js → chunk-5FHFG5P2.js} +174 -710
- package/chunks/chunk-5POT5OYF.js +733 -0
- package/chunks/chunk-62PGWN7Y.js +700 -0
- package/chunks/{chunk-H6Q2QAIY.js → chunk-A3EKBUEM.js} +1424 -859
- package/chunks/{chunk-6WQDXWQC.js → chunk-A6AZZ6XX.js} +2 -2
- package/chunks/{chunk-6YZE552K.js → chunk-AV5BF4V7.js} +1281 -2580
- package/chunks/{chunk-2WWAPKAW.js → chunk-BIJPMYFA.js} +6 -6
- package/chunks/{chunk-SCWWLABR.js → chunk-CIMN2AO6.js} +1 -1
- package/chunks/{chunk-H4DH7COV.js → chunk-CSPF47S3.js} +30 -20
- package/chunks/{chunk-RCRTSKQN.js → chunk-DNV3ZMPX.js} +1 -1
- package/chunks/{chunk-GVY3S5E5.js → chunk-E42XEJTK.js} +2 -2
- package/chunks/{chunk-VDOWARMJ.js → chunk-ESM447R6.js} +15 -1
- package/chunks/{chunk-WBRGXCU2.js → chunk-EXTN4SQV.js} +1 -1
- package/chunks/{chunk-QVIRWJ45.js → chunk-EYBMTELO.js} +108 -24
- package/chunks/chunk-FEOPHBMY.js +56 -0
- package/chunks/{chunk-IHPTOTLL.js → chunk-FKGFHLLS.js} +1 -1
- package/chunks/chunk-G2EJ3R5I.js +5198 -0
- package/chunks/chunk-GHEBZKUS.js +5417 -0
- package/chunks/chunk-GNR3APR6.js +295 -0
- package/chunks/{chunk-ELI3BVIK.js → chunk-H76JYUPE.js} +3 -3
- package/chunks/{chunk-E74LXQFY.js → chunk-HRBOZBMC.js} +1 -1
- package/chunks/{chunk-TM74SSHC.js → chunk-IIBNQTOK.js} +3 -2
- package/chunks/{chunk-UELXHK2Y.js → chunk-IK27KMVV.js} +16 -5
- package/chunks/{chunk-WHUAUFSX.js → chunk-J6G73WYF.js} +1 -1
- package/chunks/chunk-JSTLXPJS.js +284 -0
- package/chunks/{chunk-G2BE2FC7.js → chunk-O3ADFN2A.js} +1 -1
- package/chunks/chunk-O7Q2G2KW.js +117 -0
- package/chunks/{chunk-XODDLNBI.js → chunk-QEA2VHBD.js} +284 -33
- package/chunks/{chunk-C6JPA32H.js → chunk-RBOMXUYL.js} +3 -111
- package/chunks/{chunk-L2CCO4KE.js → chunk-RCHAFSWS.js} +838 -39
- package/chunks/{chunk-3BPX75OR.js → chunk-RD4FKFWR.js} +1 -1
- package/chunks/{chunk-DPUXXMJW.js → chunk-RPTO5FY2.js} +1 -1
- package/chunks/{chunk-6KFB6AYN.js → chunk-RZR2XXAK.js} +531 -17
- package/chunks/chunk-SGILXLR3.js +289 -0
- package/chunks/{chunk-E3OOBVOK.js → chunk-TOAAYJVN.js} +2 -2
- package/chunks/chunk-TOFIGQ63.js +83 -0
- package/chunks/{chunk-QWK4R3DB.js → chunk-TTDFBFNZ.js} +6 -6
- package/chunks/chunk-TZRHWP7R.js +736 -0
- package/chunks/chunk-UHUW45S3.js +164 -0
- package/chunks/{chunk-5JNTMWPK.js → chunk-V4BD7GSP.js} +2 -2
- package/chunks/{chunk-OAS5SAVZ.js → chunk-V5I5GAQH.js} +3226 -1683
- package/chunks/{chunk-PS5E7LUQ.js → chunk-W6IYTSZH.js} +79 -9
- package/chunks/{chunk-RTBZ36BD.js → chunk-WUPN3D37.js} +22 -248
- package/chunks/{chunk-CF3MNS3O.js → chunk-Y7KV7WV6.js} +2 -2
- package/chunks/{chunk-2OQOQ2FZ.js → chunk-YERUDEXT.js} +763 -688
- package/chunks/{chunk-CPCHLL6A.js → chunk-YJU7QACE.js} +1 -1
- package/chunks/{chunk-YED25PA4.js → chunk-YORL5S5V.js} +1 -1
- package/chunks/{chunk-YAZARMJY.js → chunk-YYOQADBB.js} +4 -3
- package/chunks/chunk-ZPFBQ3SD.js +127 -0
- package/chunks/{codex-models-Z43V3427.js → codex-models-FQPCWRPC.js} +7 -7
- package/chunks/{commands-EUGF4FUZ.js → commands-I5L3VD2A.js} +6187 -12196
- package/chunks/dashboard-B2AEGCFM.js +76 -0
- package/chunks/{db-NVAW4WWR.js → db-P5EIKMLP.js} +3 -3
- package/chunks/deep-review-I7RD5QSS.js +82 -0
- package/chunks/{disclose-LDNKAVRH.js → disclose-PFBWESVJ.js} +4 -2
- package/chunks/{dist-7RUOKPRJ.js → dist-3SWWY5FZ.js} +18 -2
- package/chunks/{dist-27BNG6WD.js → dist-AJU25UXA.js} +112 -63
- package/chunks/{dist-NG2HT5XU.js → dist-VK2M4HNW.js} +85 -1
- package/chunks/eval-runner-XVRX3R2Y.js +31 -0
- package/chunks/{exploit-agent-FCCR2HYX.js → exploit-agent-A4RTIJ4J.js} +1 -1
- package/chunks/{exploit-autoclimb-X5ZS5FAO.js → exploit-autoclimb-ABMMBC3M.js} +1 -1
- package/chunks/{exploit-climb-3JHGEO36.js → exploit-climb-BQ2SVU63.js} +2 -2
- package/chunks/{fix-NSNPU33B.js → fix-4YCLHFDT.js} +7 -7
- package/chunks/{harness-KXQOVIDQ.js → harness-DHWULEIZ.js} +3 -3
- package/chunks/{hunt-scan-ELTKGKC4.js → hunt-scan-DXV5H6YN.js} +16 -16
- package/chunks/{kernel-primitive-MT7YZSIG.js → kernel-primitive-SF4NALVR.js} +2 -2
- package/chunks/{kernel-vm-runner-YFRHYC6G.js → kernel-vm-runner-WEBEZEIC.js} +2 -2
- package/chunks/local-engine-XUG7XRKM.js +21 -0
- package/chunks/managed-operation-SQFMBWHG.js +60 -0
- package/chunks/{memsafety-scan-FCPAXIZE.js → memsafety-scan-L2Z7E7TE.js} +2 -2
- package/chunks/{native-loop-OFJDRHPI.js → native-loop-ZNAELJGB.js} +14 -13
- package/chunks/orchestrate-YHFJXGID.js +63 -0
- package/chunks/{prepare-72GWTRVI.js → prepare-SODWQN6O.js} +5 -5
- package/chunks/provider-model-discovery-QGUGL3XW.js +277 -0
- package/chunks/remote-workflow-runtime-XNNGI2PG.js +12 -0
- package/chunks/{run-WTJCZZHV.js → run-5T4Z3Q2D.js} +924 -327
- package/chunks/{runtime-LCJ4XSKE.js → runtime-HFFRUOPL.js} +4 -2
- package/chunks/{runtime-FCKOUB7V.js → runtime-MB4GEFBY.js} +7 -7
- package/chunks/{scan-stream-GT6GKQ3U.js → scan-stream-GXBJHCDF.js} +3 -2
- package/chunks/{scope-E5QZUOOH.js → scope-M7L3CD6X.js} +2 -2
- package/chunks/service-plugins-BGS6QKSZ.js +64 -0
- package/chunks/{session-store-H3Q7KCYG.js → session-store-K7I4GLNH.js} +2 -2
- package/chunks/{variant-candidates-SZKDCOLK.js → variant-candidates-2KSP5EHH.js} +7 -7
- package/chunks/{web-recon-prepass-IO3GXQMW.js → web-recon-prepass-RAXXTEWH.js} +5 -5
- package/chunks/workflow-runtime-V26HIJO3.js +178 -0
- package/dashboard/assets/abnfDiagram-VCTEODGH-CGCueOp5.js +1 -0
- package/dashboard/assets/arc-BjZaQcCc.js +1 -0
- package/dashboard/assets/architecture-7GRP2DOG-hcbO-9zX.js +1 -0
- package/dashboard/assets/architectureDiagram-5GKGNRK7-DReOXTSq.js +36 -0
- package/dashboard/assets/array-BifhSqXX.js +1 -0
- package/dashboard/assets/blockDiagram-I7D4REHJ-C-byT12_.js +129 -0
- package/dashboard/assets/c4Diagram-7LVT6UL2-DoYjz-Uv.js +38 -0
- package/dashboard/assets/channel-CUURBnpZ.js +1 -0
- package/dashboard/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/dashboard/assets/chunk-4HAMMTFA-NBNp2zdt.js +62 -0
- package/dashboard/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/dashboard/assets/chunk-75Z2AOVW-BHmkuP0B.js +2 -0
- package/dashboard/assets/chunk-DU6HZSFF-DgfLNaL2.js +127 -0
- package/dashboard/assets/chunk-F27PBJKO-3wwNFUgZ.js +1 -0
- package/dashboard/assets/chunk-FOHPRMQF-DHwB1DNv.js +161 -0
- package/dashboard/assets/chunk-GMAD6QVW-Btg7huZW.js +72 -0
- package/dashboard/assets/chunk-GVQU2GXP-ihCURK5O.js +1 -0
- package/dashboard/assets/chunk-IMKFNOWR-FsXj7slg.js +231 -0
- package/dashboard/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/dashboard/assets/chunk-L3NEJ4N5-DorFIxJY.js +1 -0
- package/dashboard/assets/chunk-OSK3NFVY-DKun_KfC.js +10 -0
- package/dashboard/assets/chunk-P2QGCYS3-XGgiU1Bz.js +1 -0
- package/dashboard/assets/chunk-POPQ4Y6H-BTXEnGhJ.js +1 -0
- package/dashboard/assets/chunk-PWAF6VOD-DYZcGkTL.js +1 -0
- package/dashboard/assets/chunk-SHT3W25Y-C4WQfwf8.js +168 -0
- package/dashboard/assets/chunk-SVP7TREG-C4nCh0-1.js +88 -0
- package/dashboard/assets/chunk-TICWLB2K-DSB-IiGc.js +206 -0
- package/dashboard/assets/chunk-XXDRQBXY-CS6fjUcj.js +1 -0
- package/dashboard/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/dashboard/assets/classDiagram-ZZMXUADV-CD1Buc26.js +1 -0
- package/dashboard/assets/classDiagram-v2-VYDZK3BY-CD1Buc26.js +1 -0
- package/dashboard/assets/common-BMdQBwfR.js +5 -0
- package/dashboard/assets/cose-bilkent-JH36ORCC-CUjQHTML.js +1 -0
- package/dashboard/assets/cynefin-OW5HDTMX-BC7zCtFq.js +1 -0
- package/dashboard/assets/cynefinDiagram-5FMLGOSQ-CgDOOY67.js +62 -0
- package/dashboard/assets/cytoscape.esm-CGd-uY3x.js +321 -0
- package/dashboard/assets/dagre-GXQ25YYZ-Dqc8FS9x.js +4 -0
- package/dashboard/assets/dagre-PrKaheQc.js +1 -0
- package/dashboard/assets/defaultLocale-BFoDCU3G.js +1 -0
- package/dashboard/assets/diagram-S7CK7UJ4-CrKqRXZb.js +30 -0
- package/dashboard/assets/diagram-UQ7AKVKN-Cu6Es0-v.js +41 -0
- package/dashboard/assets/diagram-VSXAHHWV-eK4d8FwS.js +3 -0
- package/dashboard/assets/diagram-VX7I27RA-bFxeFKOc.js +24 -0
- package/dashboard/assets/diagram-Z3DM3KII-C0ClmnhC.js +24 -0
- package/dashboard/assets/dist-BZh8Kb3O.js +1 -0
- package/dashboard/assets/ebnfDiagram-PWID7BFC-CUqxFPzf.js +1 -0
- package/dashboard/assets/erDiagram-RLTQ6QDP-CcYM7pLi.js +99 -0
- package/dashboard/assets/eventmodeling-NTZA5JFV-D8ZNnPkV.js +1 -0
- package/dashboard/assets/flowDiagram-HODETNUW-pDb1AYm8.js +1 -0
- package/dashboard/assets/ganttDiagram-EL5Y4UJY-UmZfbMyD.js +292 -0
- package/dashboard/assets/gitGraph-4MIJSDKK-mvNUo0ZA.js +1 -0
- package/dashboard/assets/gitGraphDiagram-WWUBYQGX-CvzeCxVy.js +106 -0
- package/dashboard/assets/graphlib-DS17s2tU.js +1 -0
- package/dashboard/assets/info-A6RAGUB7-DChKqZMi.js +1 -0
- package/dashboard/assets/infoDiagram-27XIBGKW-DjkpNtVW.js +2 -0
- package/dashboard/assets/init-C-OQMol4.js +1 -0
- package/dashboard/assets/ishikawaDiagram-5VMMS53U-8FhjJaWT.js +70 -0
- package/dashboard/assets/journeyDiagram-3NMN7TZE-DyNJ755f.js +139 -0
- package/dashboard/assets/kanban-definition-UXKFOSKX-_jCmtaY1.js +89 -0
- package/dashboard/assets/katex-BdBmVSus.js +257 -0
- package/dashboard/assets/line-Bf0nxyWf.js +1 -0
- package/dashboard/assets/linear-Bl6JKbf4.js +1 -0
- package/dashboard/assets/mermaid-parser.core-Cc6sgCzs.js +7 -0
- package/dashboard/assets/mermaid.core-B4yCwiN-.js +44 -0
- package/dashboard/assets/mindmap-definition-YA3MSWOX-D5DjWyXj.js +96 -0
- package/dashboard/assets/operations-B7JAWOi6.js +130 -0
- package/dashboard/assets/operations-QjKT0Hwi.css +1 -0
- package/dashboard/assets/ordinal-BDEzSJ7C.js +1 -0
- package/dashboard/assets/packet-AYTQ26CC-bQXLDhQC.js +1 -0
- package/dashboard/assets/path-fybaL0A-.js +1 -0
- package/dashboard/assets/pegDiagram-XKGWAZYB-Bf6a1vaf.js +1 -0
- package/dashboard/assets/pie-WAS4IAKB-DfzoABIi.js +1 -0
- package/dashboard/assets/pieDiagram-E7YTZNPT-D0L1qbch.js +39 -0
- package/dashboard/assets/quadrantDiagram-AXDQQJYC-CbFyy2Pe.js +7 -0
- package/dashboard/assets/radar-RG4KPBEZ-CZ2pyeUT.js +1 -0
- package/dashboard/assets/railroad-74A4TZTK-CP4Jazfd.js +1 -0
- package/dashboard/assets/railroad-abnf-HS5TGJTU-3MvEiHwD.js +1 -0
- package/dashboard/assets/railroad-ebnf-LZEXJU2U-BWto6cXE.js +1 -0
- package/dashboard/assets/railroad-peg-WCYAUIDC-DasEjbyf.js +1 -0
- package/dashboard/assets/railroadDiagram-O6MQD6OU-t7Gp9g2R.js +1 -0
- package/dashboard/assets/requirementDiagram-BXWQKSXE-LYmqeBXi.js +84 -0
- package/dashboard/assets/rough.esm-Dy-Kn_BL.js +1 -0
- package/dashboard/assets/sankeyDiagram-P5KCCOFB-DnpfA_94.js +40 -0
- package/dashboard/assets/sequenceDiagram-WJ2MYXX4-C8s3pTUE.js +162 -0
- package/dashboard/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
- package/dashboard/assets/src-CaNUT1AQ.js +1 -0
- package/dashboard/assets/stateDiagram-D77RDMKH-BMzm6fK1.js +1 -0
- package/dashboard/assets/stateDiagram-v2-MP3YSRHH-B3REMjpY.js +1 -0
- package/dashboard/assets/swimlanes-42K2YHIH-uJE05Tt_.js +1 -0
- package/dashboard/assets/swimlanesDiagram-VR7AAH4N-CIaVMZEy.js +8 -0
- package/dashboard/assets/timeline-definition-24CTP7MA-BfLJMVeG.js +120 -0
- package/dashboard/assets/treeView-Q6P3EWNA-ZOE2enu2.js +1 -0
- package/dashboard/assets/treemap-WGGIJYW6-yIZoPBF5.js +1 -0
- package/dashboard/assets/vennDiagram-4TSXK5OY-BYJRHEaL.js +34 -0
- package/dashboard/assets/wardley-WFR3VGLG-D5V-jLbB.js +1 -0
- package/dashboard/assets/wardleyDiagram-VM6X3IG4-DgPN4nSe.js +78 -0
- package/dashboard/assets/xychartDiagram-S5SC5T6Z-BhkAMAOT.js +7 -0
- package/dashboard/index.html +3 -3
- package/package.json +3 -2
- package/worker-assets/demo-target/README.md +15 -0
- package/worker-assets/demo-target/include/decoder.h +27 -0
- package/worker-assets/demo-target/patched-decoder.c +40 -0
- package/worker-assets/demo-target/src/decoder.c +50 -0
- package/worker-assets/demo-target/witness-65537x1.bin +0 -0
- package/chunks/chunk-FFHRANYC.js +0 -547
- package/chunks/eval-runner-6Q3H52SP.js +0 -30
- package/chunks/orchestrate-DRZ2SVCP.js +0 -62
- package/chunks/service-plugins-MSK2EQP6.js +0 -62
- package/dashboard/assets/operations-BvB5Qpmk.css +0 -1
- package/dashboard/assets/operations-D8Ii01SV.js +0 -114
- package/dashboard/assets/zero-peek-Dzm3MT3X.png +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __0CreateRequire } from "node:module";
|
|
3
3
|
const require = __0CreateRequire(import.meta.url);
|
|
4
|
-
import {
|
|
5
|
-
redactAuthHeaders
|
|
6
|
-
} from "./chunk-UELXHK2Y.js";
|
|
7
4
|
import {
|
|
8
5
|
eventBus
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-52AWIBCT.js";
|
|
7
|
+
import {
|
|
8
|
+
redactAuthHeaders
|
|
9
|
+
} from "./chunk-IK27KMVV.js";
|
|
10
10
|
import {
|
|
11
11
|
ScopePolicy
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RBOMXUYL.js";
|
|
13
13
|
import {
|
|
14
14
|
allowlistedChildEnv,
|
|
15
15
|
sanitizedEnv
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
VERSION,
|
|
19
19
|
cloudStateDir,
|
|
20
20
|
homeStateDir
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RZR2XXAK.js";
|
|
22
22
|
import {
|
|
23
23
|
external_exports
|
|
24
24
|
} from "./chunk-VIT5ALXF.js";
|
|
@@ -3,7 +3,7 @@ import { createRequire as __0CreateRequire } from "node:module";
|
|
|
3
3
|
const require = __0CreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
homeStateDir
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RZR2XXAK.js";
|
|
7
7
|
|
|
8
8
|
// packages/core/dist/scope/waf-detect.js
|
|
9
9
|
function readHeader(headers, name) {
|
|
@@ -17,40 +17,40 @@ import {
|
|
|
17
17
|
registerSignalCleanup,
|
|
18
18
|
runNativeAgentLoop,
|
|
19
19
|
toolCallPreview
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-A3EKBUEM.js";
|
|
21
21
|
import {
|
|
22
22
|
WafDetector
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CIMN2AO6.js";
|
|
24
24
|
import {
|
|
25
25
|
RECIPE_LIBRARY
|
|
26
26
|
} from "./chunk-UEX7PFSE.js";
|
|
27
|
+
import {
|
|
28
|
+
CLI_RUNTIME_TYPES
|
|
29
|
+
} from "./chunk-YJU7QACE.js";
|
|
30
|
+
import {
|
|
31
|
+
addRuntimeUsage,
|
|
32
|
+
scanGoalPrompt
|
|
33
|
+
} from "./chunk-YYOQADBB.js";
|
|
27
34
|
import {
|
|
28
35
|
createRuntime,
|
|
29
36
|
detectAvailableRuntimes,
|
|
30
37
|
pickRuntimeForStage
|
|
31
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-EXTN4SQV.js";
|
|
32
39
|
import {
|
|
33
40
|
osecDB
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import {
|
|
36
|
-
CLI_RUNTIME_TYPES
|
|
37
|
-
} from "./chunk-CPCHLL6A.js";
|
|
38
|
-
import {
|
|
39
|
-
addRuntimeUsage,
|
|
40
|
-
scanGoalPrompt
|
|
41
|
-
} from "./chunk-YAZARMJY.js";
|
|
41
|
+
} from "./chunk-RCHAFSWS.js";
|
|
42
42
|
import {
|
|
43
43
|
LlmApiRuntime,
|
|
44
44
|
features
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-EYBMTELO.js";
|
|
46
46
|
import {
|
|
47
47
|
analyticsPipeline,
|
|
48
48
|
reportUnsupportedContributionMode
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-BIJPMYFA.js";
|
|
50
50
|
import {
|
|
51
51
|
estimateCost,
|
|
52
52
|
modelProvider
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-RZR2XXAK.js";
|
|
54
54
|
import {
|
|
55
55
|
external_exports
|
|
56
56
|
} from "./chunk-VIT5ALXF.js";
|
|
@@ -5087,7 +5087,7 @@ function cleanupHuntDb(path2) {
|
|
|
5087
5087
|
}
|
|
5088
5088
|
}
|
|
5089
5089
|
async function runSourceHunt(config, hint, purpose, emit = () => {
|
|
5090
|
-
}) {
|
|
5090
|
+
}, nativeRuntime) {
|
|
5091
5091
|
const dbPath = freshHuntDb();
|
|
5092
5092
|
const db = new osecDB(dbPath);
|
|
5093
5093
|
try {
|
|
@@ -5100,7 +5100,7 @@ async function runSourceHunt(config, hint, purpose, emit = () => {
|
|
|
5100
5100
|
scopePath: sourceRoot,
|
|
5101
5101
|
target: config.target,
|
|
5102
5102
|
scanId,
|
|
5103
|
-
config,
|
|
5103
|
+
config: { ...config, ...nativeRuntime ? { nativeRuntime } : {} },
|
|
5104
5104
|
db,
|
|
5105
5105
|
emit,
|
|
5106
5106
|
cliPrompt: prompt,
|
|
@@ -5316,6 +5316,8 @@ LENS FOCUS \u2014 concentrate this refute pass specifically on: ${opts.focus}`;
|
|
|
5316
5316
|
const baseConfig = {
|
|
5317
5317
|
...opts.costCeilingUsd !== void 0 ? { costCeilingUsd: opts.costCeilingUsd } : {},
|
|
5318
5318
|
...opts.costLedger ? { costLedger: opts.costLedger } : {},
|
|
5319
|
+
...opts.signal ? { signal: opts.signal } : {},
|
|
5320
|
+
...opts.plan ? { plan: opts.plan } : {},
|
|
5319
5321
|
target: resolve(opts.sourceRoot, candidate.path),
|
|
5320
5322
|
depth: "quick",
|
|
5321
5323
|
format: "json",
|
|
@@ -5326,7 +5328,7 @@ LENS FOCUS \u2014 concentrate this refute pass specifically on: ${opts.focus}`;
|
|
|
5326
5328
|
};
|
|
5327
5329
|
const refutePass = async (model) => {
|
|
5328
5330
|
const config = { ...baseConfig, ...model ? { model } : {} };
|
|
5329
|
-
const report = await runSourceHunt(config, hint, "verify");
|
|
5331
|
+
const report = await runSourceHunt(config, hint, "verify", void 0, opts.nativeRuntime);
|
|
5330
5332
|
return report.findings.length > 0;
|
|
5331
5333
|
};
|
|
5332
5334
|
let choice = refuter;
|
|
@@ -5404,6 +5406,9 @@ function makeMultiLensVerifier(lenses, opts) {
|
|
|
5404
5406
|
const makePass = opts.makePass ?? ((lens) => makeSkepticVerifier({
|
|
5405
5407
|
sourceRoot: opts.sourceRoot,
|
|
5406
5408
|
runtime: opts.runtime,
|
|
5409
|
+
...opts.signal ? { signal: opts.signal } : {},
|
|
5410
|
+
...opts.nativeRuntime ? { nativeRuntime: opts.nativeRuntime } : {},
|
|
5411
|
+
...opts.plan ? { plan: opts.plan } : {},
|
|
5407
5412
|
...opts.model ? { model: opts.model } : {},
|
|
5408
5413
|
...opts.negatives ? { negatives: opts.negatives } : {},
|
|
5409
5414
|
...opts.costCeilingUsd !== void 0 ? { costCeilingUsd: opts.costCeilingUsd } : {},
|
|
@@ -5474,6 +5479,7 @@ function siteGroupKey(candidatePath, model, lensId) {
|
|
|
5474
5479
|
return lensId ? `${base} ${lensId}` : base;
|
|
5475
5480
|
}
|
|
5476
5481
|
async function runHuntScan(opts) {
|
|
5482
|
+
opts.signal?.throwIfAborted();
|
|
5477
5483
|
const log = opts.log ?? (() => {
|
|
5478
5484
|
});
|
|
5479
5485
|
const models = opts.models && opts.models.length > 0 ? opts.models : [void 0];
|
|
@@ -5515,6 +5521,7 @@ async function runHuntScan(opts) {
|
|
|
5515
5521
|
const aimd = huntAimdEnabled() ? new AimdState(concurrency) : null;
|
|
5516
5522
|
const effectiveConcurrency = costCeilingEnabled ? 1 : aimd ?? concurrency;
|
|
5517
5523
|
const reports = await pool(runs, effectiveConcurrency, async (run) => {
|
|
5524
|
+
opts.signal?.throwIfAborted();
|
|
5518
5525
|
const version = run.lens.versionDigest ? { lensVersionDigest: run.lens.versionDigest } : {};
|
|
5519
5526
|
if (costCeilingReached()) {
|
|
5520
5527
|
return {
|
|
@@ -5538,7 +5545,7 @@ async function runHuntScan(opts) {
|
|
|
5538
5545
|
model: run.model,
|
|
5539
5546
|
attempt: run.attempt,
|
|
5540
5547
|
challengeHint: huntHint(opts.brief, run.candidate, run.lens.challengeHint),
|
|
5541
|
-
...finderAbort ? { signal: finderAbort.signal } : {}
|
|
5548
|
+
...opts.signal || finderAbort ? { signal: opts.signal && finderAbort ? AbortSignal.any([opts.signal, finderAbort.signal]) : opts.signal ?? finderAbort?.signal } : {}
|
|
5542
5549
|
});
|
|
5543
5550
|
lateRef.current = scanPromise2;
|
|
5544
5551
|
return await scanPromise2;
|
|
@@ -5553,7 +5560,9 @@ async function runHuntScan(opts) {
|
|
|
5553
5560
|
repoPath: opts.sourceRoot,
|
|
5554
5561
|
...run.model ? { model: run.model } : {},
|
|
5555
5562
|
...costCeilingUsd !== void 0 ? { costCeilingUsd } : {},
|
|
5556
|
-
...costLedger ? { costLedger } : {}
|
|
5563
|
+
...costLedger ? { costLedger } : {},
|
|
5564
|
+
...opts.signal ? { signal: opts.signal } : {},
|
|
5565
|
+
...opts.plan ? { plan: opts.plan } : {}
|
|
5557
5566
|
};
|
|
5558
5567
|
const scanPromise = runSourceHunt(config, huntHint(opts.brief, run.candidate, run.lens.challengeHint), "research", (event) => {
|
|
5559
5568
|
if (event.type !== "finding")
|
|
@@ -5561,11 +5570,12 @@ async function runHuntScan(opts) {
|
|
|
5561
5570
|
const partial = partialFindingFromEvent(event.data);
|
|
5562
5571
|
if (partial)
|
|
5563
5572
|
partials.push(partial);
|
|
5564
|
-
});
|
|
5573
|
+
}, opts.nativeRuntime);
|
|
5565
5574
|
lateRef.current = scanPromise;
|
|
5566
5575
|
return await scanPromise;
|
|
5567
5576
|
};
|
|
5568
5577
|
const outcome = await runFinderResilient(attemptOnce, { timeoutMs: finderTimeoutMs, maxRetries: finderMaxRetries });
|
|
5578
|
+
opts.signal?.throwIfAborted();
|
|
5569
5579
|
if (outcome.status === "timed-out")
|
|
5570
5580
|
finderAbort?.abort();
|
|
5571
5581
|
let findings;
|
|
@@ -3,7 +3,7 @@ import { createRequire as __0CreateRequire } from "node:module";
|
|
|
3
3
|
const require = __0CreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
homeStateDir
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RZR2XXAK.js";
|
|
7
7
|
|
|
8
8
|
// packages/core/dist/triage/kernel-vm-runner.js
|
|
9
9
|
import { execFileSync, spawn } from "node:child_process";
|
|
@@ -3,10 +3,10 @@ import { createRequire as __0CreateRequire } from "node:module";
|
|
|
3
3
|
const require = __0CreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
bufferToString
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YJU7QACE.js";
|
|
7
7
|
import {
|
|
8
8
|
scanExecutionTimeout
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YYOQADBB.js";
|
|
10
10
|
|
|
11
11
|
// packages/core/dist/prepare.js
|
|
12
12
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __0CreateRequire } from "node:module";
|
|
3
3
|
const require = __0CreateRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
connectionConfigEnvPatch,
|
|
6
|
+
credentialEnvPatch,
|
|
7
|
+
loadCredentials
|
|
8
|
+
} from "./chunk-62PGWN7Y.js";
|
|
4
9
|
|
|
5
10
|
// packages/cli/src/herdr-state.ts
|
|
6
11
|
var sink = null;
|
|
@@ -49,6 +54,14 @@ function reportHerdrSessionClose() {
|
|
|
49
54
|
});
|
|
50
55
|
}
|
|
51
56
|
|
|
57
|
+
// packages/cli/src/connection-env.ts
|
|
58
|
+
function savedConnectionEnvPatch(env, homeDir) {
|
|
59
|
+
return {
|
|
60
|
+
...connectionConfigEnvPatch(env, homeDir),
|
|
61
|
+
...credentialEnvPatch(loadCredentials(homeDir), env)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
52
65
|
export {
|
|
53
66
|
setHerdrSink,
|
|
54
67
|
reportOperatorGate,
|
|
@@ -59,5 +72,6 @@ export {
|
|
|
59
72
|
reportHerdrActivity,
|
|
60
73
|
reportHerdrCompaction,
|
|
61
74
|
reportHerdrSession,
|
|
62
|
-
reportHerdrSessionClose
|
|
75
|
+
reportHerdrSessionClose,
|
|
76
|
+
savedConnectionEnvPatch
|
|
63
77
|
};
|
|
@@ -3,7 +3,7 @@ import { createRequire as __0CreateRequire } from "node:module";
|
|
|
3
3
|
const require = __0CreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
isAdmittedSmolvmWorkbench
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BIJPMYFA.js";
|
|
7
7
|
import {
|
|
8
8
|
MESSAGE_CACHE_BREAKPOINTS,
|
|
9
9
|
planMessageBreakpoints,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-RS4MAN3Q.js";
|
|
14
14
|
import {
|
|
15
15
|
VERSION
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RZR2XXAK.js";
|
|
17
17
|
|
|
18
18
|
// packages/core/dist/agent/feature-presets.js
|
|
19
19
|
var FP_MOAT_FLAGS = [
|
|
@@ -556,17 +556,11 @@ var features = {
|
|
|
556
556
|
return env("ZERO_FEATURE_PER_ITEM_ORCHESTRATION", true);
|
|
557
557
|
},
|
|
558
558
|
/**
|
|
559
|
-
*
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
*
|
|
565
|
-
* Default OFF unless an assigned cloud methodology manifest opts this run in.
|
|
566
|
-
* An explicit feature flag still takes precedence over that default.
|
|
567
|
-
* Implemented as a getter so the CLI `--features` flag — which sets
|
|
568
|
-
* the env var inside the command action, AFTER this module has been
|
|
569
|
-
* imported — is still honored at tool-dispatch time.
|
|
559
|
+
* Additional skill-discovery hints in security task prompts.
|
|
560
|
+
* The list_skills and load_skill tools are always available; this legacy
|
|
561
|
+
* flag controls extra prompting, rather than access to skill folders.
|
|
562
|
+
* Default OFF unless an assigned cloud methodology manifest opts the run in.
|
|
563
|
+
* Explicit feature settings take precedence over that default.
|
|
570
564
|
*/
|
|
571
565
|
get jitSkills() {
|
|
572
566
|
return env("ZERO_FEATURE_JIT_SKILLS", Boolean(process.env["ZERO_AUDIT_SKILLS_MANIFEST"]?.trim()));
|
|
@@ -1486,6 +1480,26 @@ var DEEPSEEK_DEFAULT_MODEL = "deepseek-flash";
|
|
|
1486
1480
|
var QWEN_TOKEN_PLAN_DEEPSEEK_MODEL = "deepseek-v4-flash-0731";
|
|
1487
1481
|
var XAI_DEFAULT_BASE_URL = "https://api.x.ai/v1";
|
|
1488
1482
|
var XAI_DEFAULT_MODEL = "grok-4.6";
|
|
1483
|
+
var CLINE_DEFAULT_BASE_URL = "https://api.cline.bot/api/v1";
|
|
1484
|
+
var CLINE_DEFAULT_MODEL = "anthropic/claude-sonnet-4-6";
|
|
1485
|
+
function clineModelId(model) {
|
|
1486
|
+
return model.replace(/^cline\//i, "");
|
|
1487
|
+
}
|
|
1488
|
+
function clineChatResponse(value) {
|
|
1489
|
+
const record = (input) => input !== null && typeof input === "object" && !Array.isArray(input);
|
|
1490
|
+
if (!record(value))
|
|
1491
|
+
throw new Error("Cline returned an invalid chat response.");
|
|
1492
|
+
let response = value;
|
|
1493
|
+
if (Object.hasOwn(value, "success")) {
|
|
1494
|
+
if (value.success !== true || !record(value.data))
|
|
1495
|
+
throw new Error("Cline returned an unsuccessful or invalid chat response.");
|
|
1496
|
+
response = value.data;
|
|
1497
|
+
}
|
|
1498
|
+
if (!Array.isArray(response.choices) || response.choices.length === 0 || !record(response.choices[0]) || !record(response.choices[0].message)) {
|
|
1499
|
+
throw new Error("Cline returned an invalid chat response.");
|
|
1500
|
+
}
|
|
1501
|
+
return response;
|
|
1502
|
+
}
|
|
1489
1503
|
var OPENCODE_DEFAULT_BASE_URL = "https://opencode.ai/zen/v1";
|
|
1490
1504
|
var OPENCODE_DEFAULT_MODEL = "muse-spark-1.3-contributor-free";
|
|
1491
1505
|
function openAICompatibleWireApi(env2, variable, fallback = "chat_completions") {
|
|
@@ -1560,6 +1574,7 @@ function parseLlmFallbackChain(env2 = process.env) {
|
|
|
1560
1574
|
qwen: true,
|
|
1561
1575
|
xai: true,
|
|
1562
1576
|
opencode: true,
|
|
1577
|
+
cline: true,
|
|
1563
1578
|
copilot: true,
|
|
1564
1579
|
google: true
|
|
1565
1580
|
};
|
|
@@ -1604,10 +1619,11 @@ function resolveFailoverProvider(provider, model, env2 = process.env, apiKey) {
|
|
|
1604
1619
|
const key = apiKey ?? env2.AZURE_OPENAI_API_KEY;
|
|
1605
1620
|
if (!key)
|
|
1606
1621
|
return void 0;
|
|
1607
|
-
const
|
|
1622
|
+
const azureConfig = parseCodexAzureConfig(env2);
|
|
1623
|
+
const url = env2.AZURE_OPENAI_BASE_URL ?? env2.OPENAI_BASE_URL ?? azureConfig.baseUrl;
|
|
1608
1624
|
if (!url)
|
|
1609
1625
|
return void 0;
|
|
1610
|
-
return { apiKey: key, baseUrl: url, wireApi: openAICompatibleWireApi(env2, "AZURE_OPENAI_WIRE_API") };
|
|
1626
|
+
return { apiKey: key, baseUrl: url, wireApi: openAICompatibleWireApi(env2, "AZURE_OPENAI_WIRE_API", azureConfig.wireApi) };
|
|
1611
1627
|
}
|
|
1612
1628
|
case "openai": {
|
|
1613
1629
|
const key = apiKey ?? env2.OPENAI_API_KEY;
|
|
@@ -1650,6 +1666,12 @@ function resolveFailoverProvider(provider, model, env2 = process.env, apiKey) {
|
|
|
1650
1666
|
return void 0;
|
|
1651
1667
|
return { apiKey: key, baseUrl: env2.XAI_BASE_URL ?? XAI_DEFAULT_BASE_URL, wireApi: openAICompatibleWireApi(env2, "XAI_WIRE_API") };
|
|
1652
1668
|
}
|
|
1669
|
+
case "cline": {
|
|
1670
|
+
const key = apiKey ?? env2.CLINE_API_KEY;
|
|
1671
|
+
if (!key?.trim())
|
|
1672
|
+
return void 0;
|
|
1673
|
+
return { apiKey: key, baseUrl: env2.CLINE_BASE_URL ?? CLINE_DEFAULT_BASE_URL, wireApi: "chat_completions" };
|
|
1674
|
+
}
|
|
1653
1675
|
case "opencode": {
|
|
1654
1676
|
const key = apiKey ?? env2.OPENCODE_API_KEY;
|
|
1655
1677
|
if (!key)
|
|
@@ -2137,6 +2159,8 @@ function providerForModel(model, env2) {
|
|
|
2137
2159
|
if (m === QWEN_TOKEN_PLAN_DEEPSEEK_MODEL) {
|
|
2138
2160
|
return env2.QWEN_API_KEY ? "qwen" : void 0;
|
|
2139
2161
|
}
|
|
2162
|
+
if (m.startsWith("cline/") || m.startsWith("cline-pass/"))
|
|
2163
|
+
return env2.CLINE_API_KEY?.trim() ? "cline" : void 0;
|
|
2140
2164
|
if (m.startsWith("openrouter/"))
|
|
2141
2165
|
return env2.OPENROUTER_API_KEY ? "openrouter" : void 0;
|
|
2142
2166
|
if (m.startsWith("glm-") || m.startsWith("z-ai/") || m.includes("glm")) {
|
|
@@ -2187,6 +2211,7 @@ var DEFAULT_PROVIDER_MODELS = {
|
|
|
2187
2211
|
kimi: KIMI_DEFAULT_MODEL,
|
|
2188
2212
|
qwen: QWEN_DEFAULT_MODEL,
|
|
2189
2213
|
xai: XAI_DEFAULT_MODEL,
|
|
2214
|
+
cline: CLINE_DEFAULT_MODEL,
|
|
2190
2215
|
opencode: OPENCODE_DEFAULT_MODEL,
|
|
2191
2216
|
copilot: COPILOT_DEFAULT_MODEL,
|
|
2192
2217
|
google: GEMINI_DEFAULT_MODEL
|
|
@@ -2211,6 +2236,17 @@ function detectProvider(configApiKey, preferredModel, env2, configProvider) {
|
|
|
2211
2236
|
const primaryModel = env2["ZERO_MODEL"]?.trim();
|
|
2212
2237
|
const selectedProviderApplies = configProvider !== void 0 || !preferredModel || !primaryModel || preferredModel === primaryModel;
|
|
2213
2238
|
const pinnedProviderRaw = forcedProviderRaw ?? (selectedProviderApplies ? selectedProviderRaw : void 0);
|
|
2239
|
+
if (preferredModel && /^(?:cline\/|cline-pass\/)/i.test(preferredModel)) {
|
|
2240
|
+
if (pinnedProviderRaw && pinnedProviderRaw !== "cline") {
|
|
2241
|
+
throw new Error("Cline model IDs require the Cline provider; choose the Cline connection.");
|
|
2242
|
+
}
|
|
2243
|
+
if (configApiKey && !pinnedProviderRaw) {
|
|
2244
|
+
throw new Error("Cline model IDs with RuntimeConfig.apiKey require an explicit Cline provider.");
|
|
2245
|
+
}
|
|
2246
|
+
if (!configApiKey && !env2.CLINE_API_KEY?.trim()) {
|
|
2247
|
+
throw new Error("Cline model requires CLINE_API_KEY credentials. Connect Cline in Connections.");
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2214
2250
|
if (pinnedProviderRaw) {
|
|
2215
2251
|
const source = pinnedProviderRaw === forcedProviderRaw ? "ZERO_FORCE_PROVIDER" : configProvider !== void 0 ? "RuntimeConfig.provider" : "ZERO_SELECTED_PROVIDER";
|
|
2216
2252
|
if (!Object.hasOwn(DEFAULT_PROVIDER_MODELS, pinnedProviderRaw)) {
|
|
@@ -2318,6 +2354,14 @@ function detectProvider(configApiKey, preferredModel, env2, configProvider) {
|
|
|
2318
2354
|
defaultModel: XAI_DEFAULT_MODEL,
|
|
2319
2355
|
wireApi: openAICompatibleWireApi(env2, "XAI_WIRE_API")
|
|
2320
2356
|
};
|
|
2357
|
+
case "cline":
|
|
2358
|
+
return {
|
|
2359
|
+
provider: "cline",
|
|
2360
|
+
apiKey: env2.CLINE_API_KEY,
|
|
2361
|
+
baseUrl: env2.CLINE_BASE_URL ?? CLINE_DEFAULT_BASE_URL,
|
|
2362
|
+
defaultModel: CLINE_DEFAULT_MODEL,
|
|
2363
|
+
wireApi: "chat_completions"
|
|
2364
|
+
};
|
|
2321
2365
|
case "opencode":
|
|
2322
2366
|
return {
|
|
2323
2367
|
provider: "opencode",
|
|
@@ -2487,6 +2531,15 @@ function detectProvider(configApiKey, preferredModel, env2, configProvider) {
|
|
|
2487
2531
|
wireApi: opencodeWireApiForModel(preferredModel)
|
|
2488
2532
|
};
|
|
2489
2533
|
}
|
|
2534
|
+
if (env2.CLINE_API_KEY?.trim()) {
|
|
2535
|
+
return {
|
|
2536
|
+
provider: "cline",
|
|
2537
|
+
apiKey: env2.CLINE_API_KEY,
|
|
2538
|
+
baseUrl: env2.CLINE_BASE_URL ?? CLINE_DEFAULT_BASE_URL,
|
|
2539
|
+
defaultModel: CLINE_DEFAULT_MODEL,
|
|
2540
|
+
wireApi: "chat_completions"
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2490
2543
|
const copilotToken = env2["ZERO_COPILOT_GITHUB_TOKEN"];
|
|
2491
2544
|
if (copilotToken) {
|
|
2492
2545
|
return {
|
|
@@ -2646,6 +2699,8 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2646
2699
|
if (this.provider === "copilot") {
|
|
2647
2700
|
this.model = copilotModelId(this.model);
|
|
2648
2701
|
}
|
|
2702
|
+
if (this.provider === "cline")
|
|
2703
|
+
this.model = clineModelId(this.model);
|
|
2649
2704
|
this.applyModelWireApi();
|
|
2650
2705
|
if (this.apiKey && !this.env["ZERO_SKIP_PROVIDER_BANNER"]) {
|
|
2651
2706
|
void logProviderStartup(this.provider, this.providerLabel, this.baseUrl, this.model, this.wireApi, this.apiKey).catch(() => {
|
|
@@ -2710,9 +2765,21 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2710
2765
|
const state = this.codexAuthState;
|
|
2711
2766
|
if (this.provider !== "chatgpt-codex" || !state)
|
|
2712
2767
|
throw new Error("No active Codex subscription");
|
|
2713
|
-
const { loadCodexModelCatalog } = await import("./codex-models-
|
|
2768
|
+
const { loadCodexModelCatalog } = await import("./codex-models-FQPCWRPC.js");
|
|
2714
2769
|
return loadCodexModelCatalog({ signal, resolveCredentials: () => refreshChatGptCodexAuthState(state) });
|
|
2715
2770
|
}
|
|
2771
|
+
/** Discover endpoint inventory; Cline explicitly marks its public catalog provenance. */
|
|
2772
|
+
async availableModelCatalog(signal) {
|
|
2773
|
+
if (this.provider === "chatgpt-codex")
|
|
2774
|
+
return this.codexModelCatalog(signal);
|
|
2775
|
+
const { discoverProviderModels } = await import("./provider-model-discovery-QGUGL3XW.js");
|
|
2776
|
+
return discoverProviderModels({
|
|
2777
|
+
provider: this.provider,
|
|
2778
|
+
baseUrl: this.baseUrl,
|
|
2779
|
+
headers: this.provider === "google" ? {} : await this.ensureFreshHeaders(),
|
|
2780
|
+
signal
|
|
2781
|
+
});
|
|
2782
|
+
}
|
|
2716
2783
|
/** Host-only inference grant bound to this captured account, including after
|
|
2717
2784
|
* later logins or runtime reconfiguration. Never serialize the closure or
|
|
2718
2785
|
* its result into guest admission, workspace files or environment. */
|
|
@@ -2755,7 +2822,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2755
2822
|
this.config = { ...this.config, autoRoute: sel.autoRoute };
|
|
2756
2823
|
}
|
|
2757
2824
|
if (sel.model !== void 0) {
|
|
2758
|
-
const model = this.provider === "opencode" ? opencodeModelId(sel.model) : this.provider === "copilot" ? copilotModelId(sel.model) : sel.model;
|
|
2825
|
+
const model = this.provider === "opencode" ? opencodeModelId(sel.model) : this.provider === "copilot" ? copilotModelId(sel.model) : this.provider === "cline" ? clineModelId(sel.model) : sel.model;
|
|
2759
2826
|
if (model !== this.model) {
|
|
2760
2827
|
this.model = model;
|
|
2761
2828
|
this.config = { ...this.config, model };
|
|
@@ -2770,6 +2837,18 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2770
2837
|
}
|
|
2771
2838
|
}
|
|
2772
2839
|
}
|
|
2840
|
+
/** Explicit idle-boundary reconnect; ordinary model picks retain captured credentials. */
|
|
2841
|
+
refreshConnection(env2) {
|
|
2842
|
+
const effort = this.reasoningEffort;
|
|
2843
|
+
this.applyConfiguration({
|
|
2844
|
+
...this.config,
|
|
2845
|
+
apiKey: void 0,
|
|
2846
|
+
provider: this.provider,
|
|
2847
|
+
model: this.model,
|
|
2848
|
+
env: Object.fromEntries(Object.entries(env2).filter((entry) => entry[1] !== void 0))
|
|
2849
|
+
});
|
|
2850
|
+
this.reasoningEffort = effort;
|
|
2851
|
+
}
|
|
2773
2852
|
/** Modern OpenAI tool calls use Responses, shared by roots and forks. */
|
|
2774
2853
|
applyModelWireApi() {
|
|
2775
2854
|
const normalizedModel = this.model.toLowerCase();
|
|
@@ -2839,7 +2918,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2839
2918
|
if (typeof selectedModel !== "string" || !selectedModel.trim()) {
|
|
2840
2919
|
throw new Error("Subagent model must be a non-empty model ID");
|
|
2841
2920
|
}
|
|
2842
|
-
const stripProviderPrefix = (id) => this.provider === "opencode" ? opencodeModelId(id) : this.provider === "copilot" ? copilotModelId(id) : id;
|
|
2921
|
+
const stripProviderPrefix = (id) => this.provider === "opencode" ? opencodeModelId(id) : this.provider === "copilot" ? copilotModelId(id) : this.provider === "cline" ? clineModelId(id) : id;
|
|
2843
2922
|
const model = stripProviderPrefix(selectedModel);
|
|
2844
2923
|
const approvedByAllowlist = model === this.model || Object.values(this.config.agentModels ?? {}).some((id) => id !== AUTO_MODEL_SENTINEL && stripProviderPrefix(id) === model);
|
|
2845
2924
|
const approved = approvedByAllowlist || autoInEffect && this.isModelAccessible(selectedModel);
|
|
@@ -2867,7 +2946,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2867
2946
|
* inert default — it is intentionally unused for these two providers.
|
|
2868
2947
|
*/
|
|
2869
2948
|
get isOpenAICompat() {
|
|
2870
|
-
return this.provider === "openrouter" || this.provider === "openai" || this.provider === "azure" || this.provider === "deepseek" || this.provider === "qwen" || this.provider === "xai" || this.provider === "copilot" || this.provider === "opencode" && (this.wireApi === "chat_completions" || this.wireApi === "responses") || // chatgpt-codex always speaks Responses API; treat it as
|
|
2949
|
+
return this.provider === "openrouter" || this.provider === "openai" || this.provider === "azure" || this.provider === "deepseek" || this.provider === "qwen" || this.provider === "xai" || this.provider === "copilot" || this.provider === "cline" || this.provider === "opencode" && (this.wireApi === "chat_completions" || this.wireApi === "responses") || // chatgpt-codex always speaks Responses API; treat it as
|
|
2871
2950
|
// OpenAI-compat for body-shape branching purposes (the Responses
|
|
2872
2951
|
// wire-API code paths below already key on `wireApi === "responses"`
|
|
2873
2952
|
// and produce a body codex's backend accepts as-is).
|
|
@@ -2973,7 +3052,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2973
3052
|
} else {
|
|
2974
3053
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
2975
3054
|
}
|
|
2976
|
-
if (this.provider === "openrouter") {
|
|
3055
|
+
if (this.provider === "openrouter" || this.provider === "cline") {
|
|
2977
3056
|
headers["HTTP-Referer"] = "https://0.security";
|
|
2978
3057
|
headers["X-Title"] = "0 Security Scanner";
|
|
2979
3058
|
}
|
|
@@ -3200,6 +3279,8 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
3200
3279
|
return "xAI (Grok)";
|
|
3201
3280
|
case "opencode":
|
|
3202
3281
|
return "OpenCode Zen";
|
|
3282
|
+
case "cline":
|
|
3283
|
+
return "Cline";
|
|
3203
3284
|
case "copilot":
|
|
3204
3285
|
return "GitHub Copilot";
|
|
3205
3286
|
case "google":
|
|
@@ -3207,7 +3288,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
3207
3288
|
}
|
|
3208
3289
|
}
|
|
3209
3290
|
noKeyError() {
|
|
3210
|
-
return "No provider credential found. Set one of:\n env ZERO_CHATGPT_OAUTH_REFRESH_TOKEN=... 0 <command> (ChatGPT Codex subscription auth)\n export OPENROUTER_API_KEY=sk-or-... (OpenRouter \u2014 many models, one key)\n export DEEPSEEK_API_KEY=... (DeepSeek \u2014 direct Flash 0731 inference)\n export ANTHROPIC_API_KEY=sk-ant-... (Anthropic \u2014 direct Claude access)\n export AZURE_OPENAI_API_KEY=... (Azure OpenAI \u2014 reuse your Codex Azure provider)\n export OPENAI_API_KEY=sk-... (OpenAI \u2014 direct GPT access)\n export Z_AI_API_KEY=... (Z.ai GLM \u2014 flat-rate Coding Plan, Anthropic-compatible)\n export KIMI_API_KEY=... (Moonshot Kimi K3 \u2014 flat-rate coding, Anthropic-compatible)\n export QWEN_API_KEY=... (Alibaba Qwen \u2014 Token Plan sub, OpenAI-compatible)\n export XAI_API_KEY=... (xAI Grok \u2014 OpenAI-compatible)\n export OPENCODE_API_KEY=... (OpenCode Zen \u2014 multi-wire gateway)\n export ZERO_COPILOT_GITHUB_TOKEN=... (GitHub Copilot \u2014 device-code OAuth token)";
|
|
3291
|
+
return "No provider credential found. Set one of:\n env ZERO_CHATGPT_OAUTH_REFRESH_TOKEN=... 0 <command> (ChatGPT Codex subscription auth)\n export OPENROUTER_API_KEY=sk-or-... (OpenRouter \u2014 many models, one key)\n export DEEPSEEK_API_KEY=... (DeepSeek \u2014 direct Flash 0731 inference)\n export ANTHROPIC_API_KEY=sk-ant-... (Anthropic \u2014 direct Claude access)\n export AZURE_OPENAI_API_KEY=... (Azure OpenAI \u2014 reuse your Codex Azure provider)\n export OPENAI_API_KEY=sk-... (OpenAI \u2014 direct GPT access)\n export Z_AI_API_KEY=... (Z.ai GLM \u2014 flat-rate Coding Plan, Anthropic-compatible)\n export KIMI_API_KEY=... (Moonshot Kimi K3 \u2014 flat-rate coding, Anthropic-compatible)\n export QWEN_API_KEY=... (Alibaba Qwen \u2014 Token Plan sub, OpenAI-compatible)\n export XAI_API_KEY=... (xAI Grok \u2014 OpenAI-compatible)\n export CLINE_API_KEY=... (Cline \u2014 API key; cline-pass/* needs ClinePass)\n export OPENCODE_API_KEY=... (OpenCode Zen \u2014 multi-wire gateway)\n export ZERO_COPILOT_GITHUB_TOKEN=... (GitHub Copilot \u2014 device-code OAuth token)";
|
|
3211
3292
|
}
|
|
3212
3293
|
getConfigurationDiagnostics() {
|
|
3213
3294
|
if (!this.apiKey && this.provider !== "chatgpt-codex") {
|
|
@@ -3296,7 +3377,7 @@ Missing: ${missing.join("; ")}
|
|
|
3296
3377
|
continue;
|
|
3297
3378
|
}
|
|
3298
3379
|
this.provider = entry.provider;
|
|
3299
|
-
this.model = entry.provider === "opencode" ? opencodeModelId(entry.model) : entry.provider === "copilot" ? copilotModelId(entry.model) : entry.model;
|
|
3380
|
+
this.model = entry.provider === "opencode" ? opencodeModelId(entry.model) : entry.provider === "copilot" ? copilotModelId(entry.model) : entry.provider === "cline" ? clineModelId(entry.model) : entry.model;
|
|
3300
3381
|
this.apiKey = cfg.apiKey;
|
|
3301
3382
|
this.baseUrl = cfg.baseUrl;
|
|
3302
3383
|
this.wireApi = cfg.wireApi;
|
|
@@ -3499,6 +3580,7 @@ Missing: ${missing.join("; ")}
|
|
|
3499
3580
|
messages.push({ role: "user", content: prompt });
|
|
3500
3581
|
res = await this.postWithRetry(() => JSON.stringify({
|
|
3501
3582
|
model: this.model,
|
|
3583
|
+
...this.provider === "cline" ? { stream: false } : {},
|
|
3502
3584
|
[this.maxTokensParamKey]: NATIVE_COMPLETION_TOKEN_LIMIT,
|
|
3503
3585
|
messages,
|
|
3504
3586
|
// See executeNative: explicit reasoning_effort passthrough only.
|
|
@@ -3565,7 +3647,7 @@ Missing: ${missing.join("; ")}
|
|
|
3565
3647
|
};
|
|
3566
3648
|
}
|
|
3567
3649
|
const parsedBody = JSON.parse(body);
|
|
3568
|
-
const json = this.isGeminiCodeAssist ? parsedBody.response ?? parsedBody : parsedBody;
|
|
3650
|
+
const json = this.provider === "cline" ? clineChatResponse(parsedBody) : this.isGeminiCodeAssist ? parsedBody.response ?? parsedBody : parsedBody;
|
|
3569
3651
|
let text;
|
|
3570
3652
|
if (this.isOpenAICompat && this.wireApi === "chat_completions") {
|
|
3571
3653
|
const msg = json.choices?.[0]?.message;
|
|
@@ -3716,6 +3798,8 @@ Missing: ${missing.join("; ")}
|
|
|
3716
3798
|
}
|
|
3717
3799
|
const body = {
|
|
3718
3800
|
model: this.model,
|
|
3801
|
+
// Cline defaults to SSE; this path consumes a complete JSON response.
|
|
3802
|
+
...this.provider === "cline" ? { stream: false } : {},
|
|
3719
3803
|
[this.maxTokensParamKey]: NATIVE_COMPLETION_TOKEN_LIMIT,
|
|
3720
3804
|
messages: chatMessages
|
|
3721
3805
|
};
|
|
@@ -3965,7 +4049,7 @@ Missing: ${missing.join("; ")}
|
|
|
3965
4049
|
};
|
|
3966
4050
|
}
|
|
3967
4051
|
const parsedResponse = JSON.parse(responseText);
|
|
3968
|
-
const json = this.isGeminiCodeAssist ? parsedResponse.response ?? parsedResponse : parsedResponse;
|
|
4052
|
+
const json = this.provider === "cline" ? clineChatResponse(parsedResponse) : this.isGeminiCodeAssist ? parsedResponse.response ?? parsedResponse : parsedResponse;
|
|
3969
4053
|
appendNativeTrace({
|
|
3970
4054
|
kind: "native-response",
|
|
3971
4055
|
provider: this.providerLabel,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __0CreateRequire } from "node:module";
|
|
3
|
+
const require = __0CreateRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
createPresentationEvent
|
|
6
|
+
} from "./chunk-RZR2XXAK.js";
|
|
7
|
+
|
|
8
|
+
// packages/cli/src/presentation/event-bus.ts
|
|
9
|
+
var PresentationEventBus = class {
|
|
10
|
+
listeners = [];
|
|
11
|
+
subscribe(listener) {
|
|
12
|
+
this.listeners.push(listener);
|
|
13
|
+
return () => {
|
|
14
|
+
const index = this.listeners.indexOf(listener);
|
|
15
|
+
if (index >= 0) this.listeners.splice(index, 1);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
emit(event) {
|
|
19
|
+
for (const listener of [...this.listeners]) {
|
|
20
|
+
try {
|
|
21
|
+
listener.emit(event);
|
|
22
|
+
} catch {
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
get size() {
|
|
27
|
+
return this.listeners.length;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var presentationEventBus = new PresentationEventBus();
|
|
31
|
+
function createPresentationEmitter(options = {}) {
|
|
32
|
+
const source = options.source ?? "cli";
|
|
33
|
+
const now = options.now ?? (() => (/* @__PURE__ */ new Date()).toISOString());
|
|
34
|
+
const bus = options.bus ?? presentationEventBus;
|
|
35
|
+
let sequence = 0;
|
|
36
|
+
return {
|
|
37
|
+
emit(eventType, payload, correlation = {}) {
|
|
38
|
+
const event = createPresentationEvent({
|
|
39
|
+
source,
|
|
40
|
+
sequence: ++sequence,
|
|
41
|
+
at: now(),
|
|
42
|
+
eventType,
|
|
43
|
+
payload,
|
|
44
|
+
...correlation.scanId ? { scanId: correlation.scanId } : {},
|
|
45
|
+
...correlation.sessionId ? { sessionId: correlation.sessionId } : {}
|
|
46
|
+
});
|
|
47
|
+
bus.emit(event);
|
|
48
|
+
return event;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
presentationEventBus,
|
|
55
|
+
createPresentationEmitter
|
|
56
|
+
};
|