0sec-cli 0.25.0 → 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 +41 -40
- package/chunks/{adapt-loop-L2PXCD4J.js → adapt-loop-P4HKONB5.js} +4 -4
- package/chunks/{artifact-scraper-W3LGLXBM.js → artifact-scraper-IIRJNYKT.js} +2 -2
- package/chunks/{assumption-mining-7IJ6ZWZE.js → assumption-mining-YA6VJ2V6.js} +17 -17
- package/chunks/{backend-connections-MYH4QRQG.js → backend-connections-64PKYKL7.js} +3 -3
- package/chunks/{chunk-EEP6GBUO.js → chunk-3MWQNNJU.js} +151 -58
- package/chunks/{chunk-ZZV56ACK.js → chunk-3VQ5EZKG.js} +9 -9
- package/chunks/{chunk-I4VIAQHM.js → chunk-6GV5G6U3.js} +1 -1
- package/chunks/{chunk-OFPF26WL.js → chunk-6SNOKNCS.js} +2 -2
- package/chunks/{chunk-YXTV2FRE.js → chunk-72PU46MS.js} +66 -112
- package/chunks/{chunk-NO543ZBU.js → chunk-A7G6S5RA.js} +1 -1
- package/chunks/{chunk-ITEMDJAB.js → chunk-AFJ2UMPR.js} +2 -2
- package/chunks/{chunk-FOLTHXRH.js → chunk-B7XL6RON.js} +1 -1
- package/chunks/{chunk-76CLUI54.js → chunk-BM6EYP2D.js} +3 -3
- package/chunks/{chunk-NBLKIQCW.js → chunk-D4M5WURF.js} +2 -2
- package/chunks/{chunk-DHNYJ2ML.js → chunk-EHNVP6QB.js} +1 -1
- package/chunks/{chunk-C6ZMPXN2.js → chunk-FBZBJYZS.js} +3 -3
- package/chunks/{chunk-S3B6HFSM.js → chunk-GYEYTNHK.js} +1 -1
- package/chunks/{chunk-EIONVEFN.js → chunk-HS2NQ7K6.js} +192 -36
- package/chunks/{chunk-HJKJ4NQP.js → chunk-HUZ2EC2R.js} +1 -1
- package/chunks/{chunk-5H2PXZ7Q.js → chunk-IUUNIJPM.js} +1 -1
- package/chunks/{chunk-3DF55BWV.js → chunk-JGDA6EIJ.js} +2 -2
- package/chunks/{chunk-GOUGG7IQ.js → chunk-K3PTYN43.js} +2 -2
- package/chunks/{chunk-7TIWL6E5.js → chunk-KCABBZHN.js} +7 -7
- package/chunks/{chunk-ACYZMJHC.js → chunk-LRD5N2TQ.js} +1 -1
- package/chunks/{chunk-ITHDAIRY.js → chunk-MNK373HF.js} +1 -1
- package/chunks/{chunk-JCRQV4FE.js → chunk-MOEVVXML.js} +2 -2
- package/chunks/{chunk-3HMO42M2.js → chunk-MOGWEHSC.js} +68 -771
- package/chunks/{chunk-TFKY6D7O.js → chunk-N7YCONYR.js} +1 -1
- package/chunks/{chunk-FI2H6HV2.js → chunk-NA3FKCI2.js} +1 -1
- package/chunks/{chunk-PMAKX6KP.js → chunk-NABVDAAO.js} +2 -2
- package/chunks/{chunk-YYFODVZG.js → chunk-NNMOTHKC.js} +4 -4
- package/chunks/{chunk-RBTJYREN.js → chunk-OILVEROI.js} +17 -4
- package/chunks/{chunk-GXSECFUE.js → chunk-PAMJEXE2.js} +1 -1
- package/chunks/{chunk-2J3STRJT.js → chunk-R7VWEY45.js} +1 -1
- package/chunks/{chunk-27SXCYWH.js → chunk-RZZ6VPRY.js} +1 -1
- package/chunks/{chunk-HFUOUT2B.js → chunk-SIR7XW2S.js} +1392 -826
- package/chunks/{chunk-HDJSHLRM.js → chunk-SSPP64FF.js} +2 -2
- package/chunks/{chunk-WK6VUCKK.js → chunk-STPHTPSD.js} +1 -1
- package/chunks/{chunk-SEWZ76MN.js → chunk-UGCTPKJG.js} +14 -6
- package/chunks/{chunk-MY44EZKD.js → chunk-ULRLUXSS.js} +1 -1
- package/chunks/{chunk-BWUW6ZQR.js → chunk-UQS7XCBV.js} +75 -60
- package/chunks/{chunk-6TA3CWND.js → chunk-V2KJQVYE.js} +42 -21
- package/chunks/{chunk-RFK5F45W.js → chunk-VJBEB2K6.js} +1 -1
- package/chunks/{chunk-D4IBEO2K.js → chunk-VWE36MUN.js} +1 -1
- package/chunks/{chunk-B5TIXHCO.js → chunk-WNWDQ2TO.js} +1 -1
- package/chunks/{chunk-S2WCYEK2.js → chunk-WPJMA5AK.js} +2 -2
- package/chunks/{chunk-FI5YL4R2.js → chunk-XJ2TBEV7.js} +3 -3
- package/chunks/{chunk-3T5R7P4T.js → chunk-XOVYV7TT.js} +4 -4
- package/chunks/{chunk-DJGJECBV.js → chunk-YGYJ2FTH.js} +4 -3
- package/chunks/{chunk-ZWAWZU6C.js → chunk-YJGPPPUB.js} +37 -9
- package/chunks/chunk-YP2DHYNI.js +650 -0
- package/chunks/{chunk-DMDWIW3E.js → chunk-Z2VLJEQJ.js} +4 -4
- package/chunks/{chunk-EQBC2ZWL.js → chunk-ZPVSDB63.js} +1604 -246
- package/chunks/{codex-models-KCUIVS3R.js → codex-models-CI22KIHY.js} +7 -7
- package/chunks/{commands-MPPAADGY.js → commands-C2WRSCNB.js} +210 -101
- package/chunks/dashboard-XO2X2SPD.js +75 -0
- package/chunks/{db-R2AQSESC.js → db-FU3OIGQK.js} +3 -3
- package/chunks/{deep-review-Q6BJKEV4.js → deep-review-5AL6QYTK.js} +30 -30
- package/chunks/{disclose-GGULOW27.js → disclose-YPV5KIUU.js} +3 -3
- package/chunks/{dist-6RNAVFAY.js → dist-ONIRKDH6.js} +29 -29
- package/chunks/{dist-OLGNKDB2.js → dist-QLMPTFT7.js} +2 -2
- package/chunks/{dist-DWN7U5OV.js → dist-QXJKD743.js} +1 -1
- package/chunks/{eval-runner-WCTTIYN4.js → eval-runner-D3RUCU3R.js} +17 -17
- package/chunks/{exploit-agent-M3KUMZJH.js → exploit-agent-4E4HXKUA.js} +1 -1
- package/chunks/{exploit-autoclimb-QTTWC5WM.js → exploit-autoclimb-5GRXI6VQ.js} +1 -1
- package/chunks/{exploit-climb-E4KDELTN.js → exploit-climb-AHQEJ2I2.js} +2 -2
- package/chunks/{fix-U5FFJD4F.js → fix-CHD7LXDS.js} +7 -7
- package/chunks/{harness-FMKIMEH5.js → harness-E63KDHPG.js} +3 -3
- package/chunks/{hunt-scan-RYPWRUQD.js → hunt-scan-ME2Z4CTC.js} +16 -16
- package/chunks/{kernel-primitive-CVG2E7MJ.js → kernel-primitive-S566GXWP.js} +2 -2
- package/chunks/{kernel-vm-runner-62KISULQ.js → kernel-vm-runner-KREBY4DC.js} +2 -2
- package/chunks/{local-engine-WP3I7K7G.js → local-engine-ZRTZVSSX.js} +5 -5
- package/chunks/managed-operation-ZMLLRCCQ.js +59 -0
- package/chunks/{native-loop-HC77R5NQ.js → native-loop-UV3Z4Z2F.js} +16 -16
- package/chunks/{operator-services-E2NONBQS.js → operator-services-JOCREEBA.js} +35 -35
- package/chunks/{orchestrate-Z3DW265M.js → orchestrate-ZF6ZTSIQ.js} +30 -30
- package/chunks/{prepare-7DTS6RJT.js → prepare-PLDVGLDX.js} +5 -5
- package/chunks/{provider-model-discovery-QGUGL3XW.js → provider-model-discovery-3X6DON3Y.js} +7 -2
- package/chunks/{remote-workflow-runtime-6CEVRZXS.js → remote-workflow-runtime-GOI4TYP5.js} +2 -2
- package/chunks/routing-WCQLO5SP.js +61 -0
- package/chunks/{runtime-W6JNDQRO.js → runtime-6ZIXFTW5.js} +2 -2
- package/chunks/{runtime-PZJ77QES.js → runtime-TVH5ORUK.js} +11 -7
- package/chunks/{scan-stream-6VOJTHTR.js → scan-stream-HJVTWZ44.js} +4 -4
- package/chunks/{scope-FHXW6EX6.js → scope-RCYXVGJR.js} +2 -2
- package/chunks/service-plugins-TN6KDX4L.js +63 -0
- package/chunks/{session-store-DBBI544Y.js → session-store-6QR3CVUA.js} +2 -2
- package/chunks/{variant-candidates-DPR6DJ3N.js → variant-candidates-SGLKPPHI.js} +7 -7
- package/chunks/{web-recon-prepass-HWDHDQMN.js → web-recon-prepass-GO7CTMVQ.js} +5 -5
- package/chunks/{workflow-runtime-PLB32XC3.js → workflow-runtime-CQTDASFA.js} +43 -43
- package/dashboard/assets/{abnfDiagram-VCTEODGH-6e39CQKz.js → abnfDiagram-VCTEODGH-DDZsU70-.js} +1 -1
- package/dashboard/assets/{arc-ClYun86B.js → arc-iDXNTSL6.js} +1 -1
- package/dashboard/assets/{architecture-7GRP2DOG-rM-lWo7E.js → architecture-7GRP2DOG-DJcY9RFg.js} +1 -1
- package/dashboard/assets/{architectureDiagram-5GKGNRK7-C9gEGZIU.js → architectureDiagram-5GKGNRK7-d0ZuOniQ.js} +1 -1
- package/dashboard/assets/{blockDiagram-I7D4REHJ-Dgh2n5Lf.js → blockDiagram-I7D4REHJ-B-EWfMy1.js} +1 -1
- package/dashboard/assets/{c4Diagram-7LVT6UL2-CsorW08z.js → c4Diagram-7LVT6UL2-KcZRuXZC.js} +1 -1
- package/dashboard/assets/channel-CeWMIm0w.js +1 -0
- package/dashboard/assets/{chunk-4HAMMTFA-4_b_LGGQ.js → chunk-4HAMMTFA-DXWulBlo.js} +1 -1
- package/dashboard/assets/{chunk-75Z2AOVW-qzNlKGCp.js → chunk-75Z2AOVW-RiLZItrz.js} +1 -1
- package/dashboard/assets/{chunk-DU6HZSFF-SAPICW28.js → chunk-DU6HZSFF-MBcaIyTX.js} +1 -1
- package/dashboard/assets/{chunk-F27PBJKO-DlLotIQx.js → chunk-F27PBJKO-kLWCBX_W.js} +1 -1
- package/dashboard/assets/{chunk-GMAD6QVW-DNnr65Nb.js → chunk-GMAD6QVW-BeQeSjpW.js} +1 -1
- package/dashboard/assets/{chunk-GVQU2GXP-DTwv0VfU.js → chunk-GVQU2GXP-CjCMlOIB.js} +1 -1
- package/dashboard/assets/{chunk-IMKFNOWR-B1fk1q_W.js → chunk-IMKFNOWR-BwNst53D.js} +1 -1
- package/dashboard/assets/{chunk-L3NEJ4N5-ByVjFIox.js → chunk-L3NEJ4N5-CHXWQrkL.js} +1 -1
- package/dashboard/assets/{chunk-OSK3NFVY-DUDCzjbh.js → chunk-OSK3NFVY-B2vd19Ed.js} +1 -1
- package/dashboard/assets/{chunk-P2QGCYS3-D_D5qEso.js → chunk-P2QGCYS3-Dk7Fyh6n.js} +1 -1
- package/dashboard/assets/{chunk-POPQ4Y6H-CetM-tVm.js → chunk-POPQ4Y6H-CPAgOvYe.js} +1 -1
- package/dashboard/assets/{chunk-PWAF6VOD-BcJX4exl.js → chunk-PWAF6VOD-BotyfMha.js} +1 -1
- package/dashboard/assets/{chunk-SHT3W25Y-BWQql238.js → chunk-SHT3W25Y-Buz5gLRP.js} +1 -1
- package/dashboard/assets/{chunk-SVP7TREG-BSLOD1JE.js → chunk-SVP7TREG-_rpYEZcs.js} +1 -1
- package/dashboard/assets/{chunk-TICWLB2K-DReOl-g_.js → chunk-TICWLB2K-DOJxPoec.js} +1 -1
- package/dashboard/assets/{chunk-XXDRQBXY-DSdSMeei.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-CRRsylCH.js → common-VLJRx-Jq.js} +1 -1
- package/dashboard/assets/{cose-bilkent-JH36ORCC-fg-DIBqt.js → cose-bilkent-JH36ORCC-B1SVC57o.js} +1 -1
- package/dashboard/assets/{cynefin-OW5HDTMX-XmrbEIFh.js → cynefin-OW5HDTMX-BzhRorj4.js} +1 -1
- package/dashboard/assets/{cynefinDiagram-5FMLGOSQ-CoQ7QEPl.js → cynefinDiagram-5FMLGOSQ-JXzRmldX.js} +1 -1
- package/dashboard/assets/{dagre-GXQ25YYZ-qtQtsg6c.js → dagre-GXQ25YYZ-1LZ-X0-Z.js} +1 -1
- package/dashboard/assets/{diagram-S7CK7UJ4-B_ts4_58.js → diagram-S7CK7UJ4-C_-J_LQ4.js} +1 -1
- package/dashboard/assets/{diagram-UQ7AKVKN-DwHbbxFy.js → diagram-UQ7AKVKN-CnxL1k8g.js} +1 -1
- package/dashboard/assets/{diagram-VSXAHHWV-2Tg_RG89.js → diagram-VSXAHHWV-WzSb3aby.js} +1 -1
- package/dashboard/assets/{diagram-VX7I27RA-BFYp-YjF.js → diagram-VX7I27RA-DKhrMInE.js} +1 -1
- package/dashboard/assets/{diagram-Z3DM3KII-DrPiS4V0.js → diagram-Z3DM3KII-CDhI2WGP.js} +1 -1
- package/dashboard/assets/{dist-cbVssBvx.js → dist-B0bfBMeP.js} +1 -1
- package/dashboard/assets/{ebnfDiagram-PWID7BFC-DCMOZtU2.js → ebnfDiagram-PWID7BFC-iL5NQ1PE.js} +1 -1
- package/dashboard/assets/{erDiagram-RLTQ6QDP-CW4rUJGU.js → erDiagram-RLTQ6QDP-RK2Voa5O.js} +1 -1
- package/dashboard/assets/{eventmodeling-NTZA5JFV-C2q-Aaav.js → eventmodeling-NTZA5JFV-WgE7OJBb.js} +1 -1
- package/dashboard/assets/flowDiagram-HODETNUW-B9YcQ0Aq.js +1 -0
- package/dashboard/assets/{ganttDiagram-EL5Y4UJY-C1AqcwIF.js → ganttDiagram-EL5Y4UJY-D8CJXHRF.js} +1 -1
- package/dashboard/assets/{gitGraph-4MIJSDKK-DYR76gtd.js → gitGraph-4MIJSDKK-BuZ9Lg04.js} +1 -1
- package/dashboard/assets/{gitGraphDiagram-WWUBYQGX-B7hL98CE.js → gitGraphDiagram-WWUBYQGX-LEJMh54j.js} +1 -1
- package/dashboard/assets/{info-A6RAGUB7-TXB43LiH.js → info-A6RAGUB7-BL5k3pev.js} +1 -1
- package/dashboard/assets/{infoDiagram-27XIBGKW-Dk5dXmh_.js → infoDiagram-27XIBGKW-LJvntUnZ.js} +1 -1
- package/dashboard/assets/{ishikawaDiagram-5VMMS53U-BQDuNMka.js → ishikawaDiagram-5VMMS53U-BYTYgKCG.js} +1 -1
- package/dashboard/assets/{journeyDiagram-3NMN7TZE-DkustddD.js → journeyDiagram-3NMN7TZE-G25qgQgO.js} +1 -1
- package/dashboard/assets/{kanban-definition-UXKFOSKX-BW7Ann84.js → kanban-definition-UXKFOSKX-Bk3uLl1i.js} +1 -1
- package/dashboard/assets/{line-DVxcLeru.js → line-i4qHBaWO.js} +1 -1
- package/dashboard/assets/{linear-DOM_l9bO.js → linear-DmrqRsKG.js} +1 -1
- package/dashboard/assets/{mermaid-parser.core-CKg9fDvJ.js → mermaid-parser.core-BxbKr4QF.js} +3 -3
- package/dashboard/assets/{mermaid.core-DruW_5-Y.js → mermaid.core-Cltee6FS.js} +4 -4
- package/dashboard/assets/{mindmap-definition-YA3MSWOX-Di5W5VB3.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-BABwqtNu.js → packet-AYTQ26CC-uZQUKnrE.js} +1 -1
- package/dashboard/assets/{pegDiagram-XKGWAZYB-Cx4ABT6q.js → pegDiagram-XKGWAZYB-CrOEi00T.js} +1 -1
- package/dashboard/assets/{pie-WAS4IAKB-CNdXyrze.js → pie-WAS4IAKB-Dn9_tpQT.js} +1 -1
- package/dashboard/assets/{pieDiagram-E7YTZNPT-BilfQbIs.js → pieDiagram-E7YTZNPT-D-niUkzc.js} +1 -1
- package/dashboard/assets/{quadrantDiagram-AXDQQJYC-BVmMQHE5.js → quadrantDiagram-AXDQQJYC-CJOTiG5V.js} +1 -1
- package/dashboard/assets/{radar-RG4KPBEZ-fKNmDeoK.js → radar-RG4KPBEZ-DIIVz4e8.js} +1 -1
- package/dashboard/assets/{railroad-74A4TZTK-DhcvDCOh.js → railroad-74A4TZTK-1kiqDEID.js} +1 -1
- package/dashboard/assets/{railroad-abnf-HS5TGJTU-BTRVAmf0.js → railroad-abnf-HS5TGJTU-DK6rQPZR.js} +1 -1
- package/dashboard/assets/{railroad-ebnf-LZEXJU2U-CwS8fgC_.js → railroad-ebnf-LZEXJU2U-C6cOgYW4.js} +1 -1
- package/dashboard/assets/{railroad-peg-WCYAUIDC-CXuhXlNp.js → railroad-peg-WCYAUIDC-CQ3ptKef.js} +1 -1
- package/dashboard/assets/{railroadDiagram-O6MQD6OU-DnBru-jf.js → railroadDiagram-O6MQD6OU-nEfkpa-m.js} +1 -1
- package/dashboard/assets/{requirementDiagram-BXWQKSXE-FwdvUZ7_.js → requirementDiagram-BXWQKSXE-CdFMY8tG.js} +1 -1
- package/dashboard/assets/{sankeyDiagram-P5KCCOFB-BQvDORai.js → sankeyDiagram-P5KCCOFB-C0KxrFYv.js} +1 -1
- package/dashboard/assets/{sequenceDiagram-WJ2MYXX4-FWYQLzcY.js → sequenceDiagram-WJ2MYXX4-DeZ5ATiu.js} +1 -1
- package/dashboard/assets/{src-BwkPhlcp.js → src-Cg-chcoE.js} +1 -1
- package/dashboard/assets/{stateDiagram-D77RDMKH-CjPBd_Sa.js → stateDiagram-D77RDMKH-B9MwWL5B.js} +1 -1
- package/dashboard/assets/stateDiagram-v2-MP3YSRHH-SucFndhx.js +1 -0
- package/dashboard/assets/{swimlanes-42K2YHIH-SQLNsa4J.js → swimlanes-42K2YHIH-DB--fwQE.js} +1 -1
- package/dashboard/assets/swimlanesDiagram-VR7AAH4N-BzH-rIaK.js +8 -0
- package/dashboard/assets/{timeline-definition-24CTP7MA-BxCf20k1.js → timeline-definition-24CTP7MA-DLkkTbWb.js} +1 -1
- package/dashboard/assets/{treeView-Q6P3EWNA-BGLYAyGp.js → treeView-Q6P3EWNA-XkZ9rl9H.js} +1 -1
- package/dashboard/assets/{treemap-WGGIJYW6-BlzAwncU.js → treemap-WGGIJYW6-JCtVKxCE.js} +1 -1
- package/dashboard/assets/{vennDiagram-4TSXK5OY-D76RIZLz.js → vennDiagram-4TSXK5OY-DEb-x29Z.js} +1 -1
- package/dashboard/assets/{wardley-WFR3VGLG-Ba_reiVw.js → wardley-WFR3VGLG-DhI7ROY3.js} +1 -1
- package/dashboard/assets/{wardleyDiagram-VM6X3IG4-Cux4coOD.js → wardleyDiagram-VM6X3IG4-KNckudc5.js} +1 -1
- package/dashboard/assets/{xychartDiagram-S5SC5T6Z-Ch5mvnlH.js → xychartDiagram-S5SC5T6Z-D4c0ynCk.js} +1 -1
- package/dashboard/index.html +13 -2
- package/package.json +1 -1
- package/worker-assets/demo-target/README.md +7 -3
- package/chunks/chunk-AL32F74R.js +0 -1123
- package/chunks/dashboard-MN7GZLLX.js +0 -75
- package/chunks/managed-operation-642WPTLC.js +0 -59
- package/chunks/routing-ITJZBJIU.js +0 -61
- package/chunks/service-plugins-CN6Q2NSN.js +0 -63
- package/dashboard/assets/channel-BBlDqIBl.js +0 -1
- package/dashboard/assets/classDiagram-ZZMXUADV-CRH2kB8G.js +0 -1
- package/dashboard/assets/classDiagram-v2-VYDZK3BY-CRH2kB8G.js +0 -1
- package/dashboard/assets/flowDiagram-HODETNUW-3NOabgG3.js +0 -1
- package/dashboard/assets/operations-B-t_k60U.js +0 -194
- package/dashboard/assets/operations-D2ZKZFOF.css +0 -1
- package/dashboard/assets/stateDiagram-v2-MP3YSRHH-DHmenujm.js +0 -1
- package/dashboard/assets/swimlanesDiagram-VR7AAH4N-D1bH4ETZ.js +0 -8
|
@@ -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-XOVYV7TT.js";
|
|
7
7
|
import {
|
|
8
8
|
MESSAGE_CACHE_BREAKPOINTS,
|
|
9
9
|
planMessageBreakpoints,
|
|
@@ -13,7 +13,45 @@ import {
|
|
|
13
13
|
} from "./chunk-RS4MAN3Q.js";
|
|
14
14
|
import {
|
|
15
15
|
VERSION
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GYEYTNHK.js";
|
|
17
|
+
|
|
18
|
+
// packages/core/dist/runtime/siwc-connection.js
|
|
19
|
+
function captureSiwcConnection(connection) {
|
|
20
|
+
if (!connection.accountId || !connection.clientId || connection.clientId === "dynamic_agent_client" || !connection.hostId || typeof connection.resolveCredentials !== "function") {
|
|
21
|
+
throw new Error("ChatGPT plan requires a verified account, issued client ID and stable host ID");
|
|
22
|
+
}
|
|
23
|
+
return Object.freeze({ accountId: connection.accountId, clientId: connection.clientId, hostId: connection.hostId, resolveCredentials: connection.resolveCredentials });
|
|
24
|
+
}
|
|
25
|
+
async function abortable(pending, signal) {
|
|
26
|
+
if (!signal)
|
|
27
|
+
return pending;
|
|
28
|
+
signal.throwIfAborted();
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
const abort = () => reject(signal.reason ?? new Error("ChatGPT plan request cancelled"));
|
|
31
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
32
|
+
pending.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
33
|
+
if (signal.aborted)
|
|
34
|
+
abort();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async function siwcHeaders(connection, signal) {
|
|
38
|
+
signal?.throwIfAborted();
|
|
39
|
+
const credentials = await abortable(connection.resolveCredentials(signal), signal);
|
|
40
|
+
signal?.throwIfAborted();
|
|
41
|
+
if (typeof credentials.accessToken !== "string" || !credentials.accessToken || credentials.accessToken.length > 65536 || /[\s\x00-\x1f\x7f]/.test(credentials.accessToken) || !Array.isArray(credentials.scopes) || !["resource.invoke", "chatgpt.tokens.use.direct"].every((scope) => credentials.scopes.includes(scope))) {
|
|
42
|
+
throw new Error("ChatGPT plan permission is not enabled; authorize plan usage for this account");
|
|
43
|
+
}
|
|
44
|
+
return { Authorization: `Bearer ${credentials.accessToken}`, "Content-Type": "application/json" };
|
|
45
|
+
}
|
|
46
|
+
async function listSiwcModels(connection, fetchImpl = fetch, signal) {
|
|
47
|
+
const response = await fetchImpl("https://api.openai.com/v1/models", { headers: await siwcHeaders(captureSiwcConnection(connection), signal), signal, redirect: "error" });
|
|
48
|
+
if (!response.ok)
|
|
49
|
+
throw new Error(`ChatGPT plan model discovery failed (HTTP ${response.status})`);
|
|
50
|
+
const data = await response.json();
|
|
51
|
+
if (!data || typeof data !== "object" || !("models" in data) || !Array.isArray(data.models))
|
|
52
|
+
throw new Error("Invalid ChatGPT plan model catalog");
|
|
53
|
+
return data.models.filter((model) => !!model && typeof model === "object" && model.visibility === "list" && typeof model.slug === "string" && !!model.slug && typeof model.display_name === "string").map(({ slug, display_name }) => ({ slug, display_name }));
|
|
54
|
+
}
|
|
17
55
|
|
|
18
56
|
// packages/core/dist/runtime/request-admission.js
|
|
19
57
|
var LOCAL_ADMISSION_LIMIT = "LOCAL_REQUEST_ADMISSION_LIMIT:";
|
|
@@ -150,7 +188,7 @@ var features = {
|
|
|
150
188
|
},
|
|
151
189
|
/** Allow the agent to search the web for CVE details, docs, and technique references */
|
|
152
190
|
get webSearch() {
|
|
153
|
-
return env("ZERO_FEATURE_WEB_SEARCH",
|
|
191
|
+
return env("ZERO_FEATURE_WEB_SEARCH", true);
|
|
154
192
|
},
|
|
155
193
|
/** Interactive PTY sessions for exploits requiring interactivity (reverse shells, DB clients, SSH) */
|
|
156
194
|
get ptySession() {
|
|
@@ -1273,6 +1311,31 @@ function shouldRetryNativeStream(result) {
|
|
|
1273
1311
|
return false;
|
|
1274
1312
|
return true;
|
|
1275
1313
|
}
|
|
1314
|
+
var RESPONSES_TERMINAL_FAILURE_MARKER = "Responses terminal failure ";
|
|
1315
|
+
function isPolicyRefusalResult(result) {
|
|
1316
|
+
if (result.stopReason !== "error" || result.cancelled)
|
|
1317
|
+
return false;
|
|
1318
|
+
const error = result.error ?? "";
|
|
1319
|
+
const at = error.indexOf(RESPONSES_TERMINAL_FAILURE_MARKER);
|
|
1320
|
+
if (at < 0)
|
|
1321
|
+
return false;
|
|
1322
|
+
try {
|
|
1323
|
+
const failure = JSON.parse(error.slice(at + RESPONSES_TERMINAL_FAILURE_MARKER.length));
|
|
1324
|
+
return typeof failure.code === "string" && failure.code.length > 0 && /_policy$/.test(failure.code);
|
|
1325
|
+
} catch {
|
|
1326
|
+
return false;
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
function mergeRuntimeUsage(a, b) {
|
|
1330
|
+
const cached = (a?.cachedInputTokens ?? 0) + (b?.cachedInputTokens ?? 0);
|
|
1331
|
+
const cacheWrites = (a?.cacheWriteTokens ?? 0) + (b?.cacheWriteTokens ?? 0);
|
|
1332
|
+
return {
|
|
1333
|
+
inputTokens: (a?.inputTokens ?? 0) + (b?.inputTokens ?? 0),
|
|
1334
|
+
outputTokens: (a?.outputTokens ?? 0) + (b?.outputTokens ?? 0),
|
|
1335
|
+
...cached > 0 ? { cachedInputTokens: cached } : {},
|
|
1336
|
+
...cacheWrites > 0 ? { cacheWriteTokens: cacheWrites } : {}
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1276
1339
|
function isRetryableTransportCode(code) {
|
|
1277
1340
|
return [
|
|
1278
1341
|
"EAI_AGAIN",
|
|
@@ -1509,6 +1572,9 @@ async function logProviderStartup(provider, providerLabel, baseUrl, model, wireA
|
|
|
1509
1572
|
var DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-6";
|
|
1510
1573
|
var DEFAULT_OPENROUTER_MODEL = "anthropic/claude-sonnet-4.6";
|
|
1511
1574
|
var FREE_OPENROUTER_MODEL = "nvidia/nemotron-3-super-120b-a12b:free";
|
|
1575
|
+
function openrouterModelId(model) {
|
|
1576
|
+
return model.replace(/^openrouter\//i, "");
|
|
1577
|
+
}
|
|
1512
1578
|
var DEFAULT_OPENAI_MODEL = "gpt-4o";
|
|
1513
1579
|
var DEEPSEEK_DEFAULT_BASE_URL = "https://api.deepseek.com";
|
|
1514
1580
|
var DEEPSEEK_DEFAULT_MODEL = "deepseek-flash";
|
|
@@ -1959,15 +2025,20 @@ async function refreshChatGptCodexAuthState(state) {
|
|
|
1959
2025
|
return { accessToken: state.accessToken, accountId: state.accountId };
|
|
1960
2026
|
}
|
|
1961
2027
|
var geminiCodeAssistAuthStates = /* @__PURE__ */ new Map();
|
|
1962
|
-
function geminiAuthStateKey(refreshToken, accessToken) {
|
|
1963
|
-
return JSON.stringify([refreshToken, refreshToken ? void 0 : accessToken]);
|
|
2028
|
+
function geminiAuthStateKey(refreshToken, accessToken, oauthClient) {
|
|
2029
|
+
return JSON.stringify([refreshToken, refreshToken ? void 0 : accessToken, oauthClient]);
|
|
1964
2030
|
}
|
|
1965
2031
|
function readGeminiCodeAssistEnv(env2 = process.env) {
|
|
1966
2032
|
const access = env2["ZERO_GEMINI_ACCESS_TOKEN"];
|
|
1967
2033
|
const refresh = env2["ZERO_GEMINI_OAUTH_REFRESH_TOKEN"];
|
|
1968
2034
|
if ((!access || access.length === 0) && (!refresh || refresh.length === 0))
|
|
1969
2035
|
return void 0;
|
|
2036
|
+
const clientId = env2["ZERO_GEMINI_OAUTH_CLIENT_ID"]?.trim();
|
|
2037
|
+
const clientSecret = env2["ZERO_GEMINI_OAUTH_CLIENT_SECRET"]?.trim();
|
|
2038
|
+
if (!clientId && clientSecret)
|
|
2039
|
+
throw new Error("Google OAuth client secret requires its matching client ID");
|
|
1970
2040
|
return {
|
|
2041
|
+
...clientId ? { oauthClient: { clientId, ...clientSecret ? { clientSecret } : {} } } : {},
|
|
1971
2042
|
accessToken: access && access.length > 0 ? access : void 0,
|
|
1972
2043
|
refreshToken: refresh && refresh.length > 0 ? refresh : void 0
|
|
1973
2044
|
};
|
|
@@ -1977,11 +2048,12 @@ function resolveGeminiCodeAssistAuthState(env2) {
|
|
|
1977
2048
|
if (!tokens) {
|
|
1978
2049
|
throw new Error("Google Gemini Code Assist auth: neither ZERO_GEMINI_ACCESS_TOKEN nor ZERO_GEMINI_OAUTH_REFRESH_TOKEN is set. Sign in with your Google account (0 connect) or forward a fresh access token.");
|
|
1979
2050
|
}
|
|
1980
|
-
const key = geminiAuthStateKey(tokens.refreshToken ?? "", tokens.accessToken);
|
|
2051
|
+
const key = geminiAuthStateKey(tokens.refreshToken ?? "", tokens.accessToken, tokens.oauthClient);
|
|
1981
2052
|
const existing = geminiCodeAssistAuthStates.get(key);
|
|
1982
2053
|
if (existing)
|
|
1983
2054
|
return existing;
|
|
1984
2055
|
const state = {
|
|
2056
|
+
oauthClient: tokens.oauthClient,
|
|
1985
2057
|
refreshToken: tokens.refreshToken ?? "",
|
|
1986
2058
|
accessToken: tokens.accessToken,
|
|
1987
2059
|
// A forwarded access token with no `exp` we can read: treat as immediately
|
|
@@ -1991,15 +2063,15 @@ function resolveGeminiCodeAssistAuthState(env2) {
|
|
|
1991
2063
|
geminiCodeAssistAuthStates.set(key, state);
|
|
1992
2064
|
return state;
|
|
1993
2065
|
}
|
|
1994
|
-
async function refreshGoogleAccessToken(refreshToken) {
|
|
2066
|
+
async function refreshGoogleAccessToken(refreshToken, oauthClient) {
|
|
1995
2067
|
const res = await fetch(GEMINI_OAUTH_TOKEN_URL, {
|
|
1996
2068
|
method: "POST",
|
|
1997
2069
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
1998
2070
|
body: new URLSearchParams({
|
|
1999
2071
|
grant_type: "refresh_token",
|
|
2000
2072
|
refresh_token: refreshToken,
|
|
2001
|
-
client_id: GEMINI_OAUTH_CLIENT_ID,
|
|
2002
|
-
client_secret: GEMINI_OAUTH_CLIENT_SECRET
|
|
2073
|
+
client_id: oauthClient?.clientId ?? GEMINI_OAUTH_CLIENT_ID,
|
|
2074
|
+
...(oauthClient ? oauthClient.clientSecret : GEMINI_OAUTH_CLIENT_SECRET) ? { client_secret: oauthClient ? oauthClient.clientSecret : GEMINI_OAUTH_CLIENT_SECRET } : {}
|
|
2003
2075
|
}).toString()
|
|
2004
2076
|
});
|
|
2005
2077
|
const bodyText = await res.text().catch(() => "");
|
|
@@ -2010,7 +2082,7 @@ async function refreshGoogleAccessToken(refreshToken) {
|
|
|
2010
2082
|
parsed = {};
|
|
2011
2083
|
}
|
|
2012
2084
|
if (!res.ok) {
|
|
2013
|
-
const err = new Error(`Google token refresh failed
|
|
2085
|
+
const err = new Error(`Google token refresh failed (HTTP ${res.status}${parsed.error === "invalid_grant" ? ": invalid_grant; reconnect this account" : ""})`);
|
|
2014
2086
|
err.invalidGrant = parsed.error === "invalid_grant";
|
|
2015
2087
|
throw err;
|
|
2016
2088
|
}
|
|
@@ -2029,7 +2101,7 @@ async function refreshGeminiCodeAssistAuthState(state) {
|
|
|
2029
2101
|
const usedRefresh = state.refreshToken;
|
|
2030
2102
|
state.inflightRefresh = (async () => {
|
|
2031
2103
|
try {
|
|
2032
|
-
const tokens = await refreshGoogleAccessToken(usedRefresh);
|
|
2104
|
+
const tokens = await refreshGoogleAccessToken(usedRefresh, state.oauthClient);
|
|
2033
2105
|
if (!tokens.access_token)
|
|
2034
2106
|
throw new Error("Google token refresh returned no access_token.");
|
|
2035
2107
|
state.accessToken = tokens.access_token;
|
|
@@ -2040,7 +2112,7 @@ async function refreshGeminiCodeAssistAuthState(state) {
|
|
|
2040
2112
|
if (err.invalidGrant) {
|
|
2041
2113
|
state.accessToken = void 0;
|
|
2042
2114
|
state.accessTokenExpiresAt = 0;
|
|
2043
|
-
geminiCodeAssistAuthStates.delete(geminiAuthStateKey(state.refreshToken, state.accessToken));
|
|
2115
|
+
geminiCodeAssistAuthStates.delete(geminiAuthStateKey(state.refreshToken, state.accessToken, state.oauthClient));
|
|
2044
2116
|
}
|
|
2045
2117
|
throw err;
|
|
2046
2118
|
} finally {
|
|
@@ -2241,6 +2313,7 @@ var DEFAULT_PROVIDER_MODELS = {
|
|
|
2241
2313
|
openai: DEFAULT_OPENAI_MODEL,
|
|
2242
2314
|
azure: void 0,
|
|
2243
2315
|
deepseek: DEEPSEEK_DEFAULT_MODEL,
|
|
2316
|
+
"chatgpt-plan": void 0,
|
|
2244
2317
|
"chatgpt-codex": CODEX_DEFAULT_MODEL,
|
|
2245
2318
|
"z-ai": ZAI_DEFAULT_MODEL,
|
|
2246
2319
|
kimi: KIMI_DEFAULT_MODEL,
|
|
@@ -2628,6 +2701,8 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2628
2701
|
grantedProviderTransport;
|
|
2629
2702
|
workbenchProviderProxy;
|
|
2630
2703
|
geminiAuthState;
|
|
2704
|
+
siwcConnection;
|
|
2705
|
+
siwcModels;
|
|
2631
2706
|
provider;
|
|
2632
2707
|
apiKey;
|
|
2633
2708
|
baseUrl;
|
|
@@ -2654,6 +2729,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2654
2729
|
this.config = {
|
|
2655
2730
|
type: "api",
|
|
2656
2731
|
model,
|
|
2732
|
+
siwcConnection: inherited.siwcConnection,
|
|
2657
2733
|
agentModels: inherited.config.agentModels,
|
|
2658
2734
|
singleModel: inherited.config.singleModel,
|
|
2659
2735
|
timeout: Math.min(timeout, inherited.config.timeout || 12e4)
|
|
@@ -2661,6 +2737,8 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2661
2737
|
this.env = inherited.env;
|
|
2662
2738
|
this.workbenchProviderProxy = inherited.workbenchProviderProxy;
|
|
2663
2739
|
this.grantedProviderTransport = inherited.grantedProviderTransport;
|
|
2740
|
+
this.siwcConnection = inherited.siwcConnection;
|
|
2741
|
+
this.siwcModels = inherited.siwcModels;
|
|
2664
2742
|
this.provider = inherited.provider;
|
|
2665
2743
|
this.apiKey = inherited.apiKey;
|
|
2666
2744
|
this.baseUrl = inherited.baseUrl;
|
|
@@ -2699,6 +2777,32 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2699
2777
|
...config,
|
|
2700
2778
|
...config.agentModels ? { agentModels: Object.freeze({ ...config.agentModels }) } : {}
|
|
2701
2779
|
};
|
|
2780
|
+
this.siwcConnection = void 0;
|
|
2781
|
+
this.siwcModels = void 0;
|
|
2782
|
+
if (config.provider === "chatgpt-plan") {
|
|
2783
|
+
if (!config.siwcConnection || !config.model)
|
|
2784
|
+
throw new Error("ChatGPT plan requires a verified connection and a model selected from its catalog");
|
|
2785
|
+
if (config.providerTransport || config.apiKey)
|
|
2786
|
+
throw new Error("ChatGPT plan cannot use API keys or Codex transport");
|
|
2787
|
+
this.siwcConnection = captureSiwcConnection(config.siwcConnection);
|
|
2788
|
+
this.config = { ...this.config, siwcConnection: this.siwcConnection };
|
|
2789
|
+
this.env = Object.freeze({ ZERO_SKIP_PROVIDER_BANNER: "1" });
|
|
2790
|
+
this.grantedProviderTransport = void 0;
|
|
2791
|
+
this.workbenchProviderProxy = void 0;
|
|
2792
|
+
this.azureConfig = parseCodexAzureConfig({});
|
|
2793
|
+
this.fallbackChain = [];
|
|
2794
|
+
this.fallbackIndex = 0;
|
|
2795
|
+
this.provider = "chatgpt-plan";
|
|
2796
|
+
this.apiKey = "";
|
|
2797
|
+
this.baseUrl = "https://api.openai.com/v1";
|
|
2798
|
+
this.wireApi = "responses";
|
|
2799
|
+
this.model = config.model;
|
|
2800
|
+
this.codexAuthState = void 0;
|
|
2801
|
+
this.geminiAuthState = void 0;
|
|
2802
|
+
this.reasoningEffort = config.env?.["ZERO_REASONING_EFFORT"];
|
|
2803
|
+
this.serverCompactionTokens = void 0;
|
|
2804
|
+
return;
|
|
2805
|
+
}
|
|
2702
2806
|
this.grantedProviderTransport = config.providerTransport;
|
|
2703
2807
|
if (config.providerTransport) {
|
|
2704
2808
|
const grant = config.providerTransport;
|
|
@@ -2766,6 +2870,8 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2766
2870
|
}
|
|
2767
2871
|
if (this.provider === "cline")
|
|
2768
2872
|
this.model = clineModelId(this.model);
|
|
2873
|
+
if (this.provider === "openrouter")
|
|
2874
|
+
this.model = openrouterModelId(this.model);
|
|
2769
2875
|
this.applyModelWireApi();
|
|
2770
2876
|
if (this.apiKey && !this.env["ZERO_SKIP_PROVIDER_BANNER"]) {
|
|
2771
2877
|
void logProviderStartup(this.provider, this.providerLabel, this.baseUrl, this.model, this.wireApi, this.apiKey).catch(() => {
|
|
@@ -2774,6 +2880,8 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2774
2880
|
}
|
|
2775
2881
|
/** Non-secret identity for preferences scoped to the captured connection. */
|
|
2776
2882
|
connectionIdentity() {
|
|
2883
|
+
if (this.siwcConnection)
|
|
2884
|
+
return createHash("sha256").update(JSON.stringify(["chatgpt-plan", this.siwcConnection.accountId, this.siwcConnection.clientId, this.siwcConnection.hostId])).digest("hex");
|
|
2777
2885
|
if (this.grantedProviderTransport)
|
|
2778
2886
|
return this.grantedProviderTransport.identity;
|
|
2779
2887
|
let identity;
|
|
@@ -2793,7 +2901,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2793
2901
|
const credential = this.geminiAuthState?.refreshToken || this.geminiAuthState?.accessToken;
|
|
2794
2902
|
if (!credential)
|
|
2795
2903
|
return void 0;
|
|
2796
|
-
identity = [this.provider, this.baseUrl, credential, firstNonEmptyEnv(this.env, "GOOGLE_CLOUD_PROJECT", "ZERO_GEMINI_PROJECT") ?? ""];
|
|
2904
|
+
identity = [this.provider, this.baseUrl, credential, firstNonEmptyEnv(this.env, "GOOGLE_CLOUD_PROJECT", "ZERO_GEMINI_PROJECT") ?? "", this.geminiAuthState?.oauthClient?.clientId ?? "legacy"];
|
|
2797
2905
|
} else {
|
|
2798
2906
|
if (!this.apiKey)
|
|
2799
2907
|
return void 0;
|
|
@@ -2803,7 +2911,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2803
2911
|
}
|
|
2804
2912
|
/** Documented effort controls only on routes which send Responses reasoning. */
|
|
2805
2913
|
reasoningConfiguration() {
|
|
2806
|
-
if (this.wireApi !== "responses" || !["openai", "azure", "chatgpt-codex"].includes(this.provider))
|
|
2914
|
+
if (this.wireApi !== "responses" || !["openai", "azure", "chatgpt-codex", "chatgpt-plan"].includes(this.provider))
|
|
2807
2915
|
return null;
|
|
2808
2916
|
const model = this.model.replace(/^openai\//, "");
|
|
2809
2917
|
let options;
|
|
@@ -2832,14 +2940,19 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2832
2940
|
const state = this.codexAuthState;
|
|
2833
2941
|
if (this.provider !== "chatgpt-codex" || !state)
|
|
2834
2942
|
throw new Error("No active Codex subscription");
|
|
2835
|
-
const { loadCodexModelCatalog } = await import("./codex-models-
|
|
2943
|
+
const { loadCodexModelCatalog } = await import("./codex-models-CI22KIHY.js");
|
|
2836
2944
|
return loadCodexModelCatalog({ signal, resolveCredentials: () => refreshChatGptCodexAuthState(state) });
|
|
2837
2945
|
}
|
|
2838
2946
|
/** Discover endpoint inventory; Cline explicitly marks its public catalog provenance. */
|
|
2839
2947
|
async availableModelCatalog(signal) {
|
|
2948
|
+
if (this.provider === "chatgpt-plan") {
|
|
2949
|
+
if (!this.siwcConnection)
|
|
2950
|
+
throw new Error("ChatGPT plan connection is unavailable");
|
|
2951
|
+
return (await listSiwcModels(this.siwcConnection, fetch, signal)).map((model) => ({ id: model.slug, source: "catalog" }));
|
|
2952
|
+
}
|
|
2840
2953
|
if (this.provider === "chatgpt-codex")
|
|
2841
2954
|
return this.codexModelCatalog(signal);
|
|
2842
|
-
const { discoverProviderModels } = await import("./provider-model-discovery-
|
|
2955
|
+
const { discoverProviderModels } = await import("./provider-model-discovery-3X6DON3Y.js");
|
|
2843
2956
|
return discoverProviderModels({
|
|
2844
2957
|
provider: this.provider,
|
|
2845
2958
|
baseUrl: this.baseUrl,
|
|
@@ -2869,11 +2982,15 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2869
2982
|
reconfigure(sel) {
|
|
2870
2983
|
if (this.grantedProviderTransport && (sel.provider && sel.provider !== this.grantedProviderTransport.provider || sel.model && !this.grantedProviderTransport.models.includes(sel.model) || Object.values(sel.agentModels ?? {}).some((model) => model !== "auto" && !this.grantedProviderTransport.models.includes(model))))
|
|
2871
2984
|
throw new Error("Selection is outside the explicit provider transport grant");
|
|
2985
|
+
if (this.siwcConnection && sel.siwcConnection && (sel.siwcConnection.accountId !== this.siwcConnection.accountId || sel.siwcConnection.clientId !== this.siwcConnection.clientId || sel.siwcConnection.hostId !== this.siwcConnection.hostId)) {
|
|
2986
|
+
throw new Error("Changing the ChatGPT plan account requires a new chat runtime");
|
|
2987
|
+
}
|
|
2872
2988
|
const providerChanged = sel.provider !== void 0 && sel.provider !== this.provider;
|
|
2873
2989
|
if (providerChanged) {
|
|
2874
2990
|
const merged = {
|
|
2875
2991
|
...this.config,
|
|
2876
2992
|
apiKey: void 0,
|
|
2993
|
+
siwcConnection: sel.provider === "chatgpt-plan" ? sel.siwcConnection : void 0,
|
|
2877
2994
|
provider: sel.provider ?? this.provider,
|
|
2878
2995
|
model: sel.model,
|
|
2879
2996
|
...sel.agentModels !== void 0 ? { agentModels: sel.agentModels } : {},
|
|
@@ -2894,7 +3011,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2894
3011
|
this.config = { ...this.config, autoRoute: sel.autoRoute };
|
|
2895
3012
|
}
|
|
2896
3013
|
if (sel.model !== void 0) {
|
|
2897
|
-
const model = this.provider === "opencode" ? opencodeModelId(sel.model) : this.provider === "copilot" ? copilotModelId(sel.model) : this.provider === "cline" ? clineModelId(sel.model) : sel.model;
|
|
3014
|
+
const model = this.provider === "opencode" ? opencodeModelId(sel.model) : this.provider === "copilot" ? copilotModelId(sel.model) : this.provider === "openrouter" ? openrouterModelId(sel.model) : this.provider === "cline" ? clineModelId(sel.model) : sel.model;
|
|
2898
3015
|
if (model !== this.model) {
|
|
2899
3016
|
this.model = model;
|
|
2900
3017
|
this.config = { ...this.config, model };
|
|
@@ -2936,6 +3053,8 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2936
3053
|
* failover chain uses — including auth-only providers (chatgpt-codex OAuth).
|
|
2937
3054
|
*/
|
|
2938
3055
|
accessibleProviders() {
|
|
3056
|
+
if (this.siwcConnection)
|
|
3057
|
+
return ["chatgpt-plan"];
|
|
2939
3058
|
if (this.grantedProviderTransport)
|
|
2940
3059
|
return [this.grantedProviderTransport.provider];
|
|
2941
3060
|
if (this.workbenchProviderProxy)
|
|
@@ -2996,7 +3115,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
2996
3115
|
if (typeof selectedModel !== "string" || !selectedModel.trim()) {
|
|
2997
3116
|
throw new Error("Subagent model must be a non-empty model ID");
|
|
2998
3117
|
}
|
|
2999
|
-
const stripProviderPrefix = (id) => this.provider === "opencode" ? opencodeModelId(id) : this.provider === "copilot" ? copilotModelId(id) : this.provider === "cline" ? clineModelId(id) : id;
|
|
3118
|
+
const stripProviderPrefix = (id) => this.provider === "opencode" ? opencodeModelId(id) : this.provider === "copilot" ? copilotModelId(id) : this.provider === "openrouter" ? openrouterModelId(id) : this.provider === "cline" ? clineModelId(id) : id;
|
|
3000
3119
|
const model = stripProviderPrefix(selectedModel);
|
|
3001
3120
|
const approvedByAllowlist = model === this.model || Object.values(this.config.agentModels ?? {}).some((id) => id !== AUTO_MODEL_SENTINEL && stripProviderPrefix(id) === model);
|
|
3002
3121
|
const approved = approvedByAllowlist || autoInEffect && this.isModelAccessible(selectedModel);
|
|
@@ -3012,7 +3131,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
3012
3131
|
* contract; callers must fail closed before making a metered comparison call.
|
|
3013
3132
|
*/
|
|
3014
3133
|
get outputTokenLimit() {
|
|
3015
|
-
return this.provider === "chatgpt-codex" ? void 0 : NATIVE_COMPLETION_TOKEN_LIMIT;
|
|
3134
|
+
return this.provider === "chatgpt-codex" || this.provider === "chatgpt-plan" ? void 0 : NATIVE_COMPLETION_TOKEN_LIMIT;
|
|
3016
3135
|
}
|
|
3017
3136
|
/**
|
|
3018
3137
|
* Whether this provider uses OpenAI-compatible chat/completions format.
|
|
@@ -3024,7 +3143,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
3024
3143
|
* inert default — it is intentionally unused for these two providers.
|
|
3025
3144
|
*/
|
|
3026
3145
|
get isOpenAICompat() {
|
|
3027
|
-
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
|
|
3146
|
+
return this.provider === "openrouter" || this.provider === "openai" || this.provider === "chatgpt-plan" || 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
|
|
3028
3147
|
// OpenAI-compat for body-shape branching purposes (the Responses
|
|
3029
3148
|
// wire-API code paths below already key on `wireApi === "responses"`
|
|
3030
3149
|
// and produce a body codex's backend accepts as-is).
|
|
@@ -3105,7 +3224,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
3105
3224
|
if (this.isGeminiCodeAssist) {
|
|
3106
3225
|
return {
|
|
3107
3226
|
"Content-Type": "application/json",
|
|
3108
|
-
"User-Agent": geminiUserAgent(this.model)
|
|
3227
|
+
"User-Agent": this.geminiAuthState?.oauthClient ? `0/${VERSION} (${process.platform}; ${process.arch}) ${this.model}` : geminiUserAgent(this.model)
|
|
3109
3228
|
};
|
|
3110
3229
|
}
|
|
3111
3230
|
if (this.isGoogleWire) {
|
|
@@ -3162,8 +3281,13 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
3162
3281
|
* controller process, add a setter on the runtime; for now this
|
|
3163
3282
|
* matches how the CLI is actually invoked.
|
|
3164
3283
|
*/
|
|
3165
|
-
async ensureFreshHeaders() {
|
|
3284
|
+
async ensureFreshHeaders(signal) {
|
|
3166
3285
|
const base = this.buildHeaders();
|
|
3286
|
+
if (this.provider === "chatgpt-plan") {
|
|
3287
|
+
if (!this.siwcConnection)
|
|
3288
|
+
throw new Error("ChatGPT plan connection is unavailable");
|
|
3289
|
+
return siwcHeaders(this.siwcConnection, signal);
|
|
3290
|
+
}
|
|
3167
3291
|
if (this.provider === "google") {
|
|
3168
3292
|
if (!this.geminiAuthState)
|
|
3169
3293
|
throw new Error("Google Gemini Code Assist auth: no credential captured for this runtime");
|
|
@@ -3347,6 +3471,8 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
3347
3471
|
return "Azure OpenAI";
|
|
3348
3472
|
case "deepseek":
|
|
3349
3473
|
return "DeepSeek";
|
|
3474
|
+
case "chatgpt-plan":
|
|
3475
|
+
return "ChatGPT plan";
|
|
3350
3476
|
case "chatgpt-codex":
|
|
3351
3477
|
return "ChatGPT (Codex backend)";
|
|
3352
3478
|
case "z-ai":
|
|
@@ -3371,7 +3497,7 @@ var LlmApiRuntime = class _LlmApiRuntime {
|
|
|
3371
3497
|
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)";
|
|
3372
3498
|
}
|
|
3373
3499
|
getConfigurationDiagnostics() {
|
|
3374
|
-
if (!this.apiKey && this.provider !== "chatgpt-codex") {
|
|
3500
|
+
if (!this.apiKey && this.provider !== "chatgpt-codex" && this.provider !== "chatgpt-plan") {
|
|
3375
3501
|
return {
|
|
3376
3502
|
valid: false,
|
|
3377
3503
|
provider: this.provider,
|
|
@@ -3492,7 +3618,7 @@ Missing: ${missing.join("; ")}
|
|
|
3492
3618
|
const pending = (async () => {
|
|
3493
3619
|
try {
|
|
3494
3620
|
const response = await fetch(`${baseUrl.replace(/\/+$/, "")}/models`, {
|
|
3495
|
-
headers: await this.ensureFreshHeaders(),
|
|
3621
|
+
headers: await this.ensureFreshHeaders(signal),
|
|
3496
3622
|
signal,
|
|
3497
3623
|
redirect: "error"
|
|
3498
3624
|
});
|
|
@@ -3520,6 +3646,16 @@ Missing: ${missing.join("; ")}
|
|
|
3520
3646
|
let waitedOtherMs = 0;
|
|
3521
3647
|
for (let attempt = 0; ; attempt++) {
|
|
3522
3648
|
abort?.throwIfCancelled();
|
|
3649
|
+
if (this.siwcConnection) {
|
|
3650
|
+
this.siwcModels ??= listSiwcModels(this.siwcConnection, fetch, signal).then((models) => new Set(models.map((model) => model.slug)));
|
|
3651
|
+
try {
|
|
3652
|
+
if (!(await this.siwcModels).has(this.model))
|
|
3653
|
+
throw new Error("Selected model is not in this ChatGPT account's available catalog");
|
|
3654
|
+
} catch (error) {
|
|
3655
|
+
this.siwcModels = void 0;
|
|
3656
|
+
throw error;
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3523
3659
|
const body = bodyFactory();
|
|
3524
3660
|
if (this.env["ZERO_REQUIRE_REQUEST_ADMISSION"] === "1") {
|
|
3525
3661
|
assertRequestAdmission(body, await this.gatewayRequestAdmission(signal));
|
|
@@ -3534,7 +3670,8 @@ Missing: ${missing.join("; ")}
|
|
|
3534
3670
|
signal
|
|
3535
3671
|
}) : await fetch(this.buildUrl(), {
|
|
3536
3672
|
method: "POST",
|
|
3537
|
-
|
|
3673
|
+
redirect: "error",
|
|
3674
|
+
headers: await this.ensureFreshHeaders(signal),
|
|
3538
3675
|
body,
|
|
3539
3676
|
signal
|
|
3540
3677
|
});
|
|
@@ -3667,7 +3804,7 @@ Missing: ${missing.join("; ")}
|
|
|
3667
3804
|
if (context?.signal?.aborted) {
|
|
3668
3805
|
return { output: "", exitCode: null, timedOut: false, durationMs: 0, error: "API execution cancelled." };
|
|
3669
3806
|
}
|
|
3670
|
-
if (this.grantedProviderTransport || this.workbenchProviderProxy) {
|
|
3807
|
+
if (this.siwcConnection || this.grantedProviderTransport || this.workbenchProviderProxy) {
|
|
3671
3808
|
const result = await this.executeNative(context?.systemPrompt ?? "", [
|
|
3672
3809
|
{ role: "user", content: [{ type: "text", text: prompt }] }
|
|
3673
3810
|
], [], void 0, context?.signal);
|
|
@@ -3680,7 +3817,7 @@ Missing: ${missing.join("; ")}
|
|
|
3680
3817
|
error: result.error
|
|
3681
3818
|
};
|
|
3682
3819
|
}
|
|
3683
|
-
if (!this.apiKey && this.provider !== "chatgpt-codex" && this.provider !== "google") {
|
|
3820
|
+
if (!this.apiKey && this.provider !== "chatgpt-codex" && this.provider !== "chatgpt-plan" && this.provider !== "google") {
|
|
3684
3821
|
return {
|
|
3685
3822
|
output: "",
|
|
3686
3823
|
exitCode: 1,
|
|
@@ -3727,7 +3864,8 @@ Missing: ${missing.join("; ")}
|
|
|
3727
3864
|
res = await this.postWithRetry(() => JSON.stringify({
|
|
3728
3865
|
model: this.model,
|
|
3729
3866
|
input,
|
|
3730
|
-
...isCodex ? { store: false } : { max_output_tokens: NATIVE_COMPLETION_TOKEN_LIMIT }
|
|
3867
|
+
...isCodex ? { store: false } : { max_output_tokens: NATIVE_COMPLETION_TOKEN_LIMIT },
|
|
3868
|
+
...this.provider === "chatgpt-plan" ? { store: false, stream: true } : {}
|
|
3731
3869
|
}), abort.signal, abort);
|
|
3732
3870
|
} else if (this.isGeminiCodeAssist) {
|
|
3733
3871
|
const request = {
|
|
@@ -3843,13 +3981,23 @@ Missing: ${missing.join("; ")}
|
|
|
3843
3981
|
const maxAttempts = llmStreamMaxAttempts();
|
|
3844
3982
|
let result;
|
|
3845
3983
|
let attempt = 0;
|
|
3846
|
-
|
|
3984
|
+
let refusedUsage;
|
|
3985
|
+
const withRefusedUsage = (outcome) => refusedUsage ? { ...outcome, usage: mergeRuntimeUsage(outcome.usage, refusedUsage) } : outcome;
|
|
3986
|
+
for (; ; ) {
|
|
3847
3987
|
result = await this.executeNativeAttempt(system, messages, tools, callbacks, signal);
|
|
3848
3988
|
if (isLocalAdmissionFailure(result.error))
|
|
3849
|
-
return result;
|
|
3989
|
+
return withRefusedUsage(result);
|
|
3850
3990
|
if (this.env["ZERO_REQUIRE_RETRY_SAFE_RECEIPT"] === "1" && (result.stopReason === "error" || result.error)) {
|
|
3851
|
-
return { ...result, error: `${result.error ?? "Incomplete gateway response"}. Request outcome may be unknown. Automatic replay is disabled` };
|
|
3991
|
+
return withRefusedUsage({ ...result, error: `${result.error ?? "Incomplete gateway response"}. Request outcome may be unknown. Automatic replay is disabled` });
|
|
3992
|
+
}
|
|
3993
|
+
if (isPolicyRefusalResult(result) && !signal?.aborted) {
|
|
3994
|
+
if (result.usage)
|
|
3995
|
+
refusedUsage = mergeRuntimeUsage(refusedUsage, result.usage);
|
|
3996
|
+
if (this._tryFailover("provider policy refusal"))
|
|
3997
|
+
continue;
|
|
3998
|
+
return refusedUsage ? { ...result, usage: refusedUsage } : result;
|
|
3852
3999
|
}
|
|
4000
|
+
attempt++;
|
|
3853
4001
|
if (attempt >= maxAttempts || !shouldRetryNativeStream(result) || signal?.aborted)
|
|
3854
4002
|
break;
|
|
3855
4003
|
const backoff = streamRetryBackoffMs(attempt);
|
|
@@ -3859,13 +4007,13 @@ Missing: ${missing.join("; ")}
|
|
|
3859
4007
|
break;
|
|
3860
4008
|
}
|
|
3861
4009
|
if (attempt >= maxAttempts && maxAttempts > 1 && shouldRetryNativeStream(result)) {
|
|
3862
|
-
return { ...result, error: `${result.error} (retried ${maxAttempts} times)` };
|
|
4010
|
+
return withRefusedUsage({ ...result, error: `${result.error} (retried ${maxAttempts} times)` });
|
|
3863
4011
|
}
|
|
3864
|
-
return result;
|
|
4012
|
+
return withRefusedUsage(result);
|
|
3865
4013
|
}
|
|
3866
4014
|
async executeNativeAttempt(system, messages, tools, callbacks, signal) {
|
|
3867
4015
|
const start = Date.now();
|
|
3868
|
-
if (!this.apiKey && this.provider !== "chatgpt-codex" && this.provider !== "google") {
|
|
4016
|
+
if (!this.apiKey && this.provider !== "chatgpt-codex" && this.provider !== "chatgpt-plan" && this.provider !== "google") {
|
|
3869
4017
|
return {
|
|
3870
4018
|
content: [{ type: "text", text: "" }],
|
|
3871
4019
|
stopReason: "error",
|
|
@@ -3955,7 +4103,7 @@ Missing: ${missing.join("; ")}
|
|
|
3955
4103
|
}
|
|
3956
4104
|
res = await this.postWithRetry(() => JSON.stringify({ ...body, model: this.model }), call.signal, call);
|
|
3957
4105
|
} else if (this.isOpenAICompat && this.wireApi === "responses") {
|
|
3958
|
-
const isCodexProvider = this.provider === "chatgpt-codex";
|
|
4106
|
+
const isCodexProvider = this.provider === "chatgpt-codex" || this.provider === "chatgpt-plan";
|
|
3959
4107
|
const input = isCodexProvider ? [] : [
|
|
3960
4108
|
{
|
|
3961
4109
|
role: "system",
|
|
@@ -3983,6 +4131,7 @@ Missing: ${missing.join("; ")}
|
|
|
3983
4131
|
input.push({
|
|
3984
4132
|
type: "function_call",
|
|
3985
4133
|
call_id: block.id,
|
|
4134
|
+
...this.provider === "chatgpt-plan" ? { namespace: "zero" } : {},
|
|
3986
4135
|
name: block.name,
|
|
3987
4136
|
arguments: JSON.stringify(block.input)
|
|
3988
4137
|
});
|
|
@@ -4006,8 +4155,9 @@ Missing: ${missing.join("; ")}
|
|
|
4006
4155
|
const isCodex = this.provider === "chatgpt-codex";
|
|
4007
4156
|
const body = {
|
|
4008
4157
|
model: this.model,
|
|
4158
|
+
...this.provider === "chatgpt-plan" ? { store: false, stream: true } : {},
|
|
4009
4159
|
input,
|
|
4010
|
-
...isCodex ? { store: false, instructions: system } : { max_output_tokens: NATIVE_COMPLETION_TOKEN_LIMIT },
|
|
4160
|
+
...isCodex || this.provider === "chatgpt-plan" ? { store: false, instructions: system } : { max_output_tokens: NATIVE_COMPLETION_TOKEN_LIMIT },
|
|
4011
4161
|
...reasoningEffort ? {
|
|
4012
4162
|
reasoning: {
|
|
4013
4163
|
effort: reasoningEffort,
|
|
@@ -4060,6 +4210,8 @@ Missing: ${missing.join("; ")}
|
|
|
4060
4210
|
strict: false,
|
|
4061
4211
|
parameters: t.input_schema
|
|
4062
4212
|
}));
|
|
4213
|
+
if (this.provider === "chatgpt-plan")
|
|
4214
|
+
body.tools = [{ type: "namespace", name: "zero", description: "0 local investigation tools", tools: body.tools }];
|
|
4063
4215
|
if (isCodex) {
|
|
4064
4216
|
body.tool_choice = "auto";
|
|
4065
4217
|
body.parallel_tool_calls = true;
|
|
@@ -4755,6 +4907,8 @@ Missing: ${missing.join("; ")}
|
|
|
4755
4907
|
};
|
|
4756
4908
|
}
|
|
4757
4909
|
async isAvailable() {
|
|
4910
|
+
if (this.provider === "chatgpt-plan")
|
|
4911
|
+
return this.siwcConnection !== void 0;
|
|
4758
4912
|
if (this.grantedProviderTransport || this.workbenchProviderProxy)
|
|
4759
4913
|
return true;
|
|
4760
4914
|
if (this.provider === "chatgpt-codex") {
|
|
@@ -4765,6 +4919,8 @@ Missing: ${missing.join("; ")}
|
|
|
4765
4919
|
};
|
|
4766
4920
|
|
|
4767
4921
|
export {
|
|
4922
|
+
captureSiwcConnection,
|
|
4923
|
+
listSiwcModels,
|
|
4768
4924
|
isLocalAdmissionLimit,
|
|
4769
4925
|
isLocalAdmissionFailure,
|
|
4770
4926
|
FEATURE_PRESETS,
|
|
@@ -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-GYEYTNHK.js";
|
|
7
7
|
|
|
8
8
|
// packages/core/dist/cve/artifact-scraper.js
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
parseRoutingQualificationPlan,
|
|
7
7
|
qualifyTaskRouting,
|
|
8
8
|
taskRoutingFixtureRuntime
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3MWQNNJU.js";
|
|
10
10
|
import {
|
|
11
11
|
LlmApiRuntime
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HS2NQ7K6.js";
|
|
13
13
|
|
|
14
14
|
// packages/cli/src/commands/routing.ts
|
|
15
15
|
import { readFileSync, writeFileSync, statSync } from "node:fs";
|
|
@@ -4,7 +4,7 @@ const require = __0CreateRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
BackendIdSchema,
|
|
6
6
|
requireBackendCapability
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GYEYTNHK.js";
|
|
8
8
|
import {
|
|
9
9
|
external_exports
|
|
10
10
|
} from "./chunk-5XOYTAOK.js";
|
|
@@ -47,7 +47,7 @@ async function createRemoteWorkflowRuntime(options, suppliedRegistry) {
|
|
|
47
47
|
if (options.engineUrl && (options.backendId || options.configPath)) throw new Error("--engine-url cannot be combined with a registered backend.");
|
|
48
48
|
if (Boolean(options.engineUrl) !== Boolean(options.engineTokenEnv)) throw new Error("Direct engine attachment requires both --engine-url and --engine-token-env.");
|
|
49
49
|
const backendId = BackendIdSchema.parse(options.backendId ?? (options.engineUrl ? "attached-engine" : void 0));
|
|
50
|
-
const registry = suppliedRegistry ?? new (await import("./backend-connections-
|
|
50
|
+
const registry = suppliedRegistry ?? new (await import("./backend-connections-64PKYKL7.js")).BackendConnectionRegistry(options.engineUrl ? { connections: [{ id: backendId, name: "Attached engine", url: options.engineUrl, bearerTokenEnv: options.engineTokenEnv }] } : { configPath: options.configPath });
|
|
51
51
|
try {
|
|
52
52
|
const connection = await registry.handshake(backendId);
|
|
53
53
|
if (connection.backend.transport !== "http") throw new Error("Select a registered remote HTTP backend; local execution cannot use this transport.");
|