@ebrindley/build 0.0.0-stage → 1.42.1-rc28
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/.build-project/providers/catalog.json +13951 -0
- package/.build-project/providers/pricing.json +1978 -0
- package/.build-project/providers/registry.json +4103 -0
- package/.github/SECURITY.md +75 -0
- package/.nvmrc +1 -0
- package/CHANGELOG.md +661 -0
- package/CODE_OF_CONDUCT.md +44 -0
- package/CONTRIBUTING.md +24 -0
- package/INSTALL.md +623 -0
- package/LICENSE +21 -0
- package/README.md +118 -2
- package/THIRD_PARTY_NOTICES.txt +26 -0
- package/dist/ai-judge-UE5UOYOO.js +191 -0
- package/dist/allowlist-grounding-KPLN6NC5.js +16 -0
- package/dist/allowlist-utils-MZZKKXRD.js +31 -0
- package/dist/apply-completion-mode-EM37UZHB.js +110 -0
- package/dist/artifact-migrator-WPACNSEP.js +276 -0
- package/dist/ask-2OZ4JFQR.js +176 -0
- package/dist/auth-6UKBTJUQ.js +185 -0
- package/dist/auth-H5KJL6HL.js +165 -0
- package/dist/auth-LVJRJDMU.js +12 -0
- package/dist/auth-NHZOCNRR.js +94 -0
- package/dist/auth-PBXHWXGW.js +95 -0
- package/dist/auth-T7Y5DCAH.js +91 -0
- package/dist/auth-TVVKCHQW.js +13 -0
- package/dist/auth-UHB2UCSS.js +97 -0
- package/dist/auth-VACA3VUL.js +98 -0
- package/dist/auth-VVLC77S3.js +44 -0
- package/dist/auth-liveness-XO4AGDDD.js +53 -0
- package/dist/autoloop-cleanup-SI3VGAAR.js +106 -0
- package/dist/autoloop-evidence-gates-J5GG5YQB.js +39 -0
- package/dist/autoloop-gate-policy-SUNAEP6Q.js +169 -0
- package/dist/autoloop-helpers-VQGQNTT6.js +52 -0
- package/dist/autoloop-ledger-P6TIDP7C.js +96 -0
- package/dist/autoloop-ledger-subscriber-HFAGOZXH.js +161 -0
- package/dist/autoloop-run-defaults-GWGZBNT7.js +27 -0
- package/dist/autoloop-run-lock-GBWRM5A2.js +197 -0
- package/dist/autoloop-success-C32QVWOP.js +93 -0
- package/dist/autoloop-termination-summary-GI6IBQWD.js +58 -0
- package/dist/autoloop-trajectory-AMKSQISD.js +70 -0
- package/dist/autoloop-wall-clock-T7ZVIQOC.js +12 -0
- package/dist/automatic-branch-cleanup-R62X2C5O.js +49 -0
- package/dist/autonomous-loop-controller-2WL363LW.js +4386 -0
- package/dist/backend-YUTFDZXZ.js +30 -0
- package/dist/background-executor-Z3ODTMD7.js +260 -0
- package/dist/backlog-75QPEAMW.js +403 -0
- package/dist/backlog-execution-intent-GWUV5TUK.js +19 -0
- package/dist/backup-active-store-XHWLN34M.js +16 -0
- package/dist/backup-machine-stores-UI4LTJOY.js +251 -0
- package/dist/backup-telemetry-db-Z4ICYCNW.js +26 -0
- package/dist/branch-archive-manager-FMSQ7YJF.js +18 -0
- package/dist/branch-cleanup-manager-ST6FJGND.js +35 -0
- package/dist/build-gate-7NKWPY62.js +68 -0
- package/dist/build-root-S7DINODY.js +18 -0
- package/dist/change-summary-R6CB6VXJ.js +50 -0
- package/dist/chunk-24MNKKOM.js +173 -0
- package/dist/chunk-2H6VZFIO.js +235 -0
- package/dist/chunk-2JIX3EKV.js +39 -0
- package/dist/chunk-2KO7HVZM.js +106 -0
- package/dist/chunk-2L36U25O.js +100 -0
- package/dist/chunk-2NMNFUQA.js +475 -0
- package/dist/chunk-2OUAEH67.js +83 -0
- package/dist/chunk-2VLJUXJU.js +115 -0
- package/dist/chunk-2VUEDIUM.js +77 -0
- package/dist/chunk-2Y2IIHPI.js +430 -0
- package/dist/chunk-2YRG3LHZ.js +220 -0
- package/dist/chunk-2Z5Q3SUY.js +65 -0
- package/dist/chunk-32IYXIE5.js +873 -0
- package/dist/chunk-33IGPPUI.js +292 -0
- package/dist/chunk-352PCJLK.js +283 -0
- package/dist/chunk-35J4NE6S.js +226 -0
- package/dist/chunk-3C7WBIVK.js +1016 -0
- package/dist/chunk-3H3EY6U7.js +1225 -0
- package/dist/chunk-3H4MWYIC.js +198 -0
- package/dist/chunk-3HHWQR3N.js +2479 -0
- package/dist/chunk-3JKNRYEE.js +14 -0
- package/dist/chunk-3LECCYZY.js +128 -0
- package/dist/chunk-3LOY6YZI.js +852 -0
- package/dist/chunk-3M57DADF.js +44 -0
- package/dist/chunk-3NOTLVLG.js +3803 -0
- package/dist/chunk-3OPP2OZB.js +1480 -0
- package/dist/chunk-3P5IN5E7.js +9 -0
- package/dist/chunk-3PL22IYZ.js +20 -0
- package/dist/chunk-3REDAJUJ.js +14 -0
- package/dist/chunk-3S2R4XJI.js +203 -0
- package/dist/chunk-3UBZI5DW.js +61 -0
- package/dist/chunk-3VV5OBGG.js +308 -0
- package/dist/chunk-3WY5TU2O.js +823 -0
- package/dist/chunk-43OKHTW4.js +82 -0
- package/dist/chunk-45KUJBDI.js +112 -0
- package/dist/chunk-47X5LM7B.js +224 -0
- package/dist/chunk-4B6FQJ77.js +268 -0
- package/dist/chunk-4BTDUT2S.js +42 -0
- package/dist/chunk-4DJL2VXA.js +24 -0
- package/dist/chunk-4EBSXZ73.js +48 -0
- package/dist/chunk-4QKP6I4C.js +294 -0
- package/dist/chunk-4U6XK2DG.js +300 -0
- package/dist/chunk-4UMRUFBD.js +132 -0
- package/dist/chunk-4US4SYJ4.js +569 -0
- package/dist/chunk-4ZPLWEZO.js +154 -0
- package/dist/chunk-56WPYDJH.js +624 -0
- package/dist/chunk-57WRCJJW.js +50 -0
- package/dist/chunk-5AW4RMNG.js +24 -0
- package/dist/chunk-5EQN56OZ.js +155 -0
- package/dist/chunk-5F43TUIN.js +38 -0
- package/dist/chunk-5FKHIKTS.js +115 -0
- package/dist/chunk-5HDP7XZG.js +91 -0
- package/dist/chunk-5KQETTNS.js +152 -0
- package/dist/chunk-5PDVN2KO.js +498 -0
- package/dist/chunk-5UBIFVRD.js +509 -0
- package/dist/chunk-5YDE3Q62.js +46 -0
- package/dist/chunk-626AJVMU.js +302 -0
- package/dist/chunk-633XZ7UF.js +3583 -0
- package/dist/chunk-63DHNHGA.js +236 -0
- package/dist/chunk-666656AR.js +568 -0
- package/dist/chunk-67YRJPJO.js +19 -0
- package/dist/chunk-6CAU7VBA.js +20 -0
- package/dist/chunk-6CB3KJRY.js +21 -0
- package/dist/chunk-6DBMALXL.js +29 -0
- package/dist/chunk-6E25C4IA.js +269 -0
- package/dist/chunk-6FIBNIQU.js +73 -0
- package/dist/chunk-6G57FYBV.js +189 -0
- package/dist/chunk-6KZKRTG3.js +4885 -0
- package/dist/chunk-6LAH2UV2.js +525 -0
- package/dist/chunk-6PZY2TTU.js +921 -0
- package/dist/chunk-6T6NHXK4.js +230 -0
- package/dist/chunk-6TBEX4R4.js +432 -0
- package/dist/chunk-6TRD7TEE.js +911 -0
- package/dist/chunk-6XCP2RAI.js +47 -0
- package/dist/chunk-726G6WDL.js +351 -0
- package/dist/chunk-75EMT7BF.js +616 -0
- package/dist/chunk-762ACDZJ.js +4696 -0
- package/dist/chunk-77I6G4CO.js +1 -0
- package/dist/chunk-7DJ6SQH3.js +510 -0
- package/dist/chunk-7HPCIOMA.js +1383 -0
- package/dist/chunk-7HYBSRPZ.js +17503 -0
- package/dist/chunk-7KBEOPVB.js +73 -0
- package/dist/chunk-7LHJDJB3.js +2222 -0
- package/dist/chunk-7NVJMH52.js +306 -0
- package/dist/chunk-7RMARDVH.js +33 -0
- package/dist/chunk-7SEWU4QG.js +36 -0
- package/dist/chunk-7TUTZTI2.js +911 -0
- package/dist/chunk-7VBDFPUM.js +340 -0
- package/dist/chunk-7VRJHTGZ.js +6406 -0
- package/dist/chunk-7YAOUUKK.js +493 -0
- package/dist/chunk-AAAODV76.js +860 -0
- package/dist/chunk-AB4HUJVQ.js +339 -0
- package/dist/chunk-AEQWV746.js +611 -0
- package/dist/chunk-AHU3FKPA.js +11639 -0
- package/dist/chunk-AISTV5XU.js +226 -0
- package/dist/chunk-AJBTKGJZ.js +48 -0
- package/dist/chunk-AJJNW7XT.js +248 -0
- package/dist/chunk-AJN5Y5YZ.js +160 -0
- package/dist/chunk-ALDTFNZ3.js +150 -0
- package/dist/chunk-ARARVIZK.js +281 -0
- package/dist/chunk-ATBM6AW5.js +53 -0
- package/dist/chunk-ATKEKM3E.js +206 -0
- package/dist/chunk-AUJLW6JZ.js +92 -0
- package/dist/chunk-AY3MHEFM.js +24 -0
- package/dist/chunk-B7PYTV72.js +236 -0
- package/dist/chunk-B7YRSULE.js +1423 -0
- package/dist/chunk-BAWJNMWF.js +339 -0
- package/dist/chunk-BBPIILO2.js +88 -0
- package/dist/chunk-BD3PGW6A.js +957 -0
- package/dist/chunk-BDPYFAB4.js +44 -0
- package/dist/chunk-BIUV23HH.js +729 -0
- package/dist/chunk-BQ3VAGXH.js +243 -0
- package/dist/chunk-BQJOGAWT.js +31 -0
- package/dist/chunk-BT7EG7CO.js +68 -0
- package/dist/chunk-BV3XQQLU.js +27 -0
- package/dist/chunk-BY6ODHNZ.js +78 -0
- package/dist/chunk-BZRLSZNV.js +79 -0
- package/dist/chunk-C3DH3NCY.js +2773 -0
- package/dist/chunk-C3KCMAJP.js +756 -0
- package/dist/chunk-C7AGUJ5K.js +267 -0
- package/dist/chunk-CBSWKQCX.js +342 -0
- package/dist/chunk-CE5OZBYY.js +21 -0
- package/dist/chunk-CFCVYHSW.js +373 -0
- package/dist/chunk-CHA2HDE5.js +126 -0
- package/dist/chunk-CIHWPGS5.js +146 -0
- package/dist/chunk-CJBSZX3F.js +127 -0
- package/dist/chunk-CLA6QIJM.js +43 -0
- package/dist/chunk-CPSVQR2I.js +365 -0
- package/dist/chunk-CRPRVNQ4.js +254 -0
- package/dist/chunk-CSIE4Y7C.js +1093 -0
- package/dist/chunk-CSOPSYDY.js +142 -0
- package/dist/chunk-CSXLLEGB.js +205 -0
- package/dist/chunk-CTDLERWU.js +293 -0
- package/dist/chunk-CULBXMSK.js +110 -0
- package/dist/chunk-D2M2Y5ID.js +21 -0
- package/dist/chunk-D37WY7SH.js +1060 -0
- package/dist/chunk-D4VJFCGZ.js +89 -0
- package/dist/chunk-D6WTZMZB.js +48 -0
- package/dist/chunk-DBHOWDUH.js +976 -0
- package/dist/chunk-DCACX7BV.js +19364 -0
- package/dist/chunk-DFHX4XYA.js +128 -0
- package/dist/chunk-DIKBRRKE.js +176 -0
- package/dist/chunk-DJG5RIOR.js +9 -0
- package/dist/chunk-DNIOIISW.js +616 -0
- package/dist/chunk-DOA5G7IA.js +315 -0
- package/dist/chunk-DP7FKP6W.js +855 -0
- package/dist/chunk-DS2JZ677.js +79 -0
- package/dist/chunk-DSRLVYBS.js +82 -0
- package/dist/chunk-EAEVKNJA.js +209 -0
- package/dist/chunk-EEUESN3T.js +575 -0
- package/dist/chunk-EJ4LUU5Y.js +73 -0
- package/dist/chunk-EJIWTPSZ.js +1063 -0
- package/dist/chunk-EJVCDTAN.js +116 -0
- package/dist/chunk-EKLUBDBQ.js +627 -0
- package/dist/chunk-EN62WLFD.js +849 -0
- package/dist/chunk-ENYRCL43.js +26 -0
- package/dist/chunk-EP22ZMFO.js +273 -0
- package/dist/chunk-EP4SVAVI.js +87 -0
- package/dist/chunk-EPAMVGI3.js +1562 -0
- package/dist/chunk-EPRMH6HO.js +24 -0
- package/dist/chunk-ES6NWJ36.js +4057 -0
- package/dist/chunk-ETA2K4KI.js +30 -0
- package/dist/chunk-ETAD4NKD.js +31 -0
- package/dist/chunk-EUWIIDQ7.js +93 -0
- package/dist/chunk-EVE3OD2W.js +141 -0
- package/dist/chunk-EXA26FFC.js +459 -0
- package/dist/chunk-EXSPAA35.js +244 -0
- package/dist/chunk-F55YABKV.js +258 -0
- package/dist/chunk-F5DNGU5W.js +27 -0
- package/dist/chunk-F622MJYV.js +103 -0
- package/dist/chunk-F6NIQD74.js +5111 -0
- package/dist/chunk-FAWJTC34.js +43 -0
- package/dist/chunk-FAZBRHGG.js +47 -0
- package/dist/chunk-FIEUSGNJ.js +39 -0
- package/dist/chunk-FKCG7K6H.js +1146 -0
- package/dist/chunk-FOVVXV45.js +229 -0
- package/dist/chunk-FRBPKBFE.js +30 -0
- package/dist/chunk-FSA5BPFI.js +268 -0
- package/dist/chunk-FSJ5TTZ3.js +29 -0
- package/dist/chunk-FT7SGLXT.js +193 -0
- package/dist/chunk-FUUVZZUB.js +62 -0
- package/dist/chunk-FYMRVUNZ.js +1697 -0
- package/dist/chunk-FYTAA5FG.js +162 -0
- package/dist/chunk-G3VB2UCZ.js +3892 -0
- package/dist/chunk-G6OIMVXH.js +405 -0
- package/dist/chunk-G7PQCXVH.js +228 -0
- package/dist/chunk-GAB6UW52.js +1087 -0
- package/dist/chunk-GAFJEYLK.js +29 -0
- package/dist/chunk-GC4CRMTS.js +642 -0
- package/dist/chunk-GFHSIWHL.js +5297 -0
- package/dist/chunk-GI5M67YA.js +735 -0
- package/dist/chunk-GIJWHUWF.js +191 -0
- package/dist/chunk-GO6DRECI.js +1 -0
- package/dist/chunk-GOFVBTMN.js +314 -0
- package/dist/chunk-GQIP72ZJ.js +13 -0
- package/dist/chunk-GQXLXRFA.js +28 -0
- package/dist/chunk-GT6HFKJB.js +48 -0
- package/dist/chunk-GVJGSSKM.js +174 -0
- package/dist/chunk-GWHGTG37.js +36 -0
- package/dist/chunk-GZAJHLKO.js +18 -0
- package/dist/chunk-GZK62I3N.js +314 -0
- package/dist/chunk-H3HGMISG.js +483 -0
- package/dist/chunk-H3ISZJMJ.js +403 -0
- package/dist/chunk-H4HXVWEC.js +9 -0
- package/dist/chunk-H6MJGKAW.js +120 -0
- package/dist/chunk-HBTTGVR5.js +353 -0
- package/dist/chunk-HBZ322WZ.js +35 -0
- package/dist/chunk-HEP3ILP4.js +34 -0
- package/dist/chunk-HGFXODKO.js +106 -0
- package/dist/chunk-HHWDTB6S.js +59 -0
- package/dist/chunk-HKO45NLZ.js +286 -0
- package/dist/chunk-HLVTEA6A.js +89 -0
- package/dist/chunk-HS3SY6HN.js +160 -0
- package/dist/chunk-HT5OCGKN.js +899 -0
- package/dist/chunk-HXIIEMGF.js +78 -0
- package/dist/chunk-I56TH7VM.js +46 -0
- package/dist/chunk-I6FN3R5D.js +352 -0
- package/dist/chunk-I7SCBHJN.js +655 -0
- package/dist/chunk-IJM4GKAT.js +529 -0
- package/dist/chunk-IMEYU36R.js +344 -0
- package/dist/chunk-INJ3SS6A.js +936 -0
- package/dist/chunk-IUKOPCCE.js +441 -0
- package/dist/chunk-IVEPZQJO.js +33 -0
- package/dist/chunk-IVZEONFC.js +43 -0
- package/dist/chunk-IWBHRSG7.js +936 -0
- package/dist/chunk-IYY3HQAD.js +484 -0
- package/dist/chunk-J2ICMYDA.js +48 -0
- package/dist/chunk-J2QCFLUN.js +505 -0
- package/dist/chunk-J5HM6V5P.js +1039 -0
- package/dist/chunk-J6NZX6QH.js +398 -0
- package/dist/chunk-JBBB2Y47.js +432 -0
- package/dist/chunk-JDCZQZU7.js +42 -0
- package/dist/chunk-JEDNXGSS.js +169 -0
- package/dist/chunk-JHP7OT6K.js +89 -0
- package/dist/chunk-JLS65NUQ.js +14 -0
- package/dist/chunk-JNMWYMC6.js +38 -0
- package/dist/chunk-JNSTWNNW.js +25 -0
- package/dist/chunk-JOSK6GEU.js +9564 -0
- package/dist/chunk-JQUMSIGC.js +100 -0
- package/dist/chunk-JVHGMURQ.js +1106 -0
- package/dist/chunk-JYXS47FQ.js +951 -0
- package/dist/chunk-K2ZMW2Z5.js +2147 -0
- package/dist/chunk-K7FAFORM.js +14 -0
- package/dist/chunk-KBJXX3ON.js +333 -0
- package/dist/chunk-KHFKVQWY.js +486 -0
- package/dist/chunk-KHMEI3DQ.js +173 -0
- package/dist/chunk-KHW3UD7B.js +69 -0
- package/dist/chunk-KKQKWAMF.js +365 -0
- package/dist/chunk-KOKXJV2U.js +455 -0
- package/dist/chunk-KQ4NGOJI.js +14 -0
- package/dist/chunk-KQYQOXMS.js +342 -0
- package/dist/chunk-KTMW65UX.js +14 -0
- package/dist/chunk-KUEWV2JH.js +593 -0
- package/dist/chunk-KXYDV3HP.js +1523 -0
- package/dist/chunk-KZ4JMGZ5.js +96 -0
- package/dist/chunk-KZWGBUIO.js +2659 -0
- package/dist/chunk-L2CBG5IX.js +1892 -0
- package/dist/chunk-L2S235CU.js +314 -0
- package/dist/chunk-L32WD57F.js +98 -0
- package/dist/chunk-LDJCKAJP.js +123 -0
- package/dist/chunk-LDWNBEN7.js +541 -0
- package/dist/chunk-LJVH57G2.js +241 -0
- package/dist/chunk-LPQ7NZEN.js +209 -0
- package/dist/chunk-LRGH3CCV.js +148 -0
- package/dist/chunk-LULOGMMM.js +1133 -0
- package/dist/chunk-LWGKN2GY.js +8284 -0
- package/dist/chunk-LX4F24ZH.js +157 -0
- package/dist/chunk-M4BUEXXF.js +839 -0
- package/dist/chunk-M6UHOC4I.js +553 -0
- package/dist/chunk-MCBNWZNO.js +657 -0
- package/dist/chunk-MEMSY6VY.js +223 -0
- package/dist/chunk-MHLEZQQI.js +145 -0
- package/dist/chunk-MJ6WNSIX.js +192 -0
- package/dist/chunk-MKASIKWZ.js +442 -0
- package/dist/chunk-MNOVBYFU.js +60 -0
- package/dist/chunk-MO2BYAAF.js +2896 -0
- package/dist/chunk-MP6P7Y2A.js +180 -0
- package/dist/chunk-MQ4TFJAG.js +3365 -0
- package/dist/chunk-MT2WAIR3.js +131 -0
- package/dist/chunk-MTU7VTNN.js +1122 -0
- package/dist/chunk-MULMXX4V.js +150 -0
- package/dist/chunk-MW2DWWVA.js +147 -0
- package/dist/chunk-MY3ZPUN4.js +151 -0
- package/dist/chunk-MYLH2S4G.js +64 -0
- package/dist/chunk-MZ5WYKNA.js +28 -0
- package/dist/chunk-N3Q2JNPV.js +249 -0
- package/dist/chunk-N5DX4JAK.js +12 -0
- package/dist/chunk-NAINGKHF.js +35 -0
- package/dist/chunk-NEQUQHOX.js +223 -0
- package/dist/chunk-NHNPEZS4.js +1408 -0
- package/dist/chunk-NHTIXJCR.js +17 -0
- package/dist/chunk-NKLPMBNV.js +1154 -0
- package/dist/chunk-NMVZ5YES.js +199 -0
- package/dist/chunk-NRFRY3GE.js +256 -0
- package/dist/chunk-NTD6CSI6.js +1266 -0
- package/dist/chunk-NUO7B3SH.js +318 -0
- package/dist/chunk-NVOHIJKG.js +1319 -0
- package/dist/chunk-NXH3RX7O.js +523 -0
- package/dist/chunk-NXZ3DURF.js +257 -0
- package/dist/chunk-O26L6F7F.js +209 -0
- package/dist/chunk-O5RRIUEP.js +124 -0
- package/dist/chunk-O5X6BKAO.js +10 -0
- package/dist/chunk-O6ZQUVTR.js +31 -0
- package/dist/chunk-O7FE75QZ.js +306 -0
- package/dist/chunk-OC7Z6AJQ.js +81 -0
- package/dist/chunk-OH7IEZ63.js +307 -0
- package/dist/chunk-OI734GRS.js +115 -0
- package/dist/chunk-OJBH62DK.js +684 -0
- package/dist/chunk-OKJLVSTJ.js +247 -0
- package/dist/chunk-OMX5VL43.js +79 -0
- package/dist/chunk-ONHAMBN6.js +12 -0
- package/dist/chunk-ONYPLIVE.js +753 -0
- package/dist/chunk-OSK7QWPD.js +637 -0
- package/dist/chunk-OTXLMJKP.js +438 -0
- package/dist/chunk-OV5PKQMA.js +213 -0
- package/dist/chunk-OXK5HA4B.js +31 -0
- package/dist/chunk-OYDWFQA4.js +272 -0
- package/dist/chunk-OZAUKWHB.js +22 -0
- package/dist/chunk-P5P2EKGH.js +94 -0
- package/dist/chunk-P6SSWAKY.js +29 -0
- package/dist/chunk-P7CQGPLS.js +30 -0
- package/dist/chunk-P7RVCHQV.js +197 -0
- package/dist/chunk-PEBWDYIW.js +726 -0
- package/dist/chunk-PFCXFO7A.js +9193 -0
- package/dist/chunk-PFLDWMX6.js +168 -0
- package/dist/chunk-PHZGLQSK.js +15883 -0
- package/dist/chunk-PNFTPNSR.js +20 -0
- package/dist/chunk-PPHXX4W7.js +175 -0
- package/dist/chunk-PPZESPJT.js +262 -0
- package/dist/chunk-PRDHI2L5.js +296 -0
- package/dist/chunk-PSTKWHHN.js +32 -0
- package/dist/chunk-PV53ODOT.js +555 -0
- package/dist/chunk-PVJBTI7P.js +24 -0
- package/dist/chunk-PXKERBKX.js +100 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-Q3DHEZA5.js +85 -0
- package/dist/chunk-Q5RZDVQK.js +204 -0
- package/dist/chunk-Q64IR2Z2.js +4933 -0
- package/dist/chunk-Q6Z5UGPL.js +398 -0
- package/dist/chunk-QAMAV4DT.js +627 -0
- package/dist/chunk-QBWF4444.js +112 -0
- package/dist/chunk-QDKYT4CI.js +22805 -0
- package/dist/chunk-QFLBRWCJ.js +126 -0
- package/dist/chunk-QILAQACE.js +107 -0
- package/dist/chunk-QJ6OEH4K.js +3683 -0
- package/dist/chunk-QK3NLYTV.js +320 -0
- package/dist/chunk-QOFLUS24.js +535 -0
- package/dist/chunk-QOIASNEJ.js +98 -0
- package/dist/chunk-QP4UTSOV.js +3587 -0
- package/dist/chunk-QP5ST7RI.js +904 -0
- package/dist/chunk-QS5AGRZN.js +167 -0
- package/dist/chunk-QTAOU53N.js +107 -0
- package/dist/chunk-QTCLJHLZ.js +351 -0
- package/dist/chunk-QTOLTG4L.js +119 -0
- package/dist/chunk-QWDV4OSL.js +142 -0
- package/dist/chunk-QWMQ74KD.js +508 -0
- package/dist/chunk-QX6LOMMH.js +158 -0
- package/dist/chunk-QXBKIHY7.js +238 -0
- package/dist/chunk-QXBKTJT6.js +270 -0
- package/dist/chunk-QYQOVOLR.js +196 -0
- package/dist/chunk-R2CKS6WT.js +73 -0
- package/dist/chunk-R2TIYG7U.js +68 -0
- package/dist/chunk-R2W3LESH.js +465 -0
- package/dist/chunk-R5EXHMUN.js +100 -0
- package/dist/chunk-RBBTBCHX.js +289 -0
- package/dist/chunk-RBKLOUXA.js +121 -0
- package/dist/chunk-RCP2Y6DQ.js +86 -0
- package/dist/chunk-RCYEJSD5.js +260 -0
- package/dist/chunk-RFDVSI4N.js +134 -0
- package/dist/chunk-RGJU63FV.js +1717 -0
- package/dist/chunk-RI4EX2QE.js +18 -0
- package/dist/chunk-RIMARPCF.js +152 -0
- package/dist/chunk-RJ6RSNT6.js +42 -0
- package/dist/chunk-RNI2GUIF.js +131 -0
- package/dist/chunk-RPHUWJ3K.js +264 -0
- package/dist/chunk-RPIMAMV7.js +361 -0
- package/dist/chunk-RQFX6YRN.js +49 -0
- package/dist/chunk-RRC5BL7B.js +285 -0
- package/dist/chunk-RSYTSBOO.js +79 -0
- package/dist/chunk-RWQQIKIC.js +35 -0
- package/dist/chunk-RZUBOZH2.js +373 -0
- package/dist/chunk-S2E632FQ.js +380 -0
- package/dist/chunk-S2VQCZO4.js +22 -0
- package/dist/chunk-S2XIMQJQ.js +681 -0
- package/dist/chunk-S47ISY27.js +183 -0
- package/dist/chunk-S6I4KISU.js +142 -0
- package/dist/chunk-S6TAFQI5.js +2403 -0
- package/dist/chunk-SBBNT5ZJ.js +27 -0
- package/dist/chunk-SDJV2DTQ.js +491 -0
- package/dist/chunk-SDPIFNLD.js +33 -0
- package/dist/chunk-SF6YK3JI.js +835 -0
- package/dist/chunk-SK3ZFONO.js +976 -0
- package/dist/chunk-SKTFRFQ7.js +1775 -0
- package/dist/chunk-SNGM452K.js +2002 -0
- package/dist/chunk-STW7OFOA.js +581 -0
- package/dist/chunk-SU6UFUQY.js +1351 -0
- package/dist/chunk-SVJM3LJA.js +27 -0
- package/dist/chunk-SVUNZOPG.js +129 -0
- package/dist/chunk-T5XLUYV3.js +34 -0
- package/dist/chunk-T7E5JS6N.js +57 -0
- package/dist/chunk-TA3N5MMO.js +450 -0
- package/dist/chunk-TAJPCXSB.js +13 -0
- package/dist/chunk-TDEMDRN2.js +1639 -0
- package/dist/chunk-TDSEX5CF.js +24 -0
- package/dist/chunk-TGCVL74Y.js +28 -0
- package/dist/chunk-TGXXYDL4.js +1012 -0
- package/dist/chunk-TIKTYUJO.js +296 -0
- package/dist/chunk-TIZAJD4M.js +6029 -0
- package/dist/chunk-TLSEZZCG.js +5549 -0
- package/dist/chunk-TMBDRHAX.js +19 -0
- package/dist/chunk-TRURQUBP.js +1217 -0
- package/dist/chunk-TSQ256N5.js +152 -0
- package/dist/chunk-TUQMMFEQ.js +2244 -0
- package/dist/chunk-U424MJLC.js +81 -0
- package/dist/chunk-U4DRS6ZW.js +11 -0
- package/dist/chunk-U5KS22IN.js +204 -0
- package/dist/chunk-UAPHFJPN.js +673 -0
- package/dist/chunk-UB7LQITD.js +1040 -0
- package/dist/chunk-UBVRHGAZ.js +237 -0
- package/dist/chunk-UDNNAQN5.js +98 -0
- package/dist/chunk-UJP3XM54.js +342 -0
- package/dist/chunk-UJYDH2MW.js +305 -0
- package/dist/chunk-UKMPASIC.js +399 -0
- package/dist/chunk-UKUL3EHK.js +763 -0
- package/dist/chunk-UPHU64NB.js +1327 -0
- package/dist/chunk-URMSZXAD.js +43 -0
- package/dist/chunk-US3RT6CY.js +525 -0
- package/dist/chunk-UTDEOPKV.js +30 -0
- package/dist/chunk-UUUDKV7N.js +13 -0
- package/dist/chunk-UVKWU3SM.js +39 -0
- package/dist/chunk-V2TVPO3X.js +521 -0
- package/dist/chunk-V3KLVK7B.js +398 -0
- package/dist/chunk-V3YFFHDR.js +17 -0
- package/dist/chunk-VAG6GUBR.js +1162 -0
- package/dist/chunk-VBENAHDA.js +1814 -0
- package/dist/chunk-VBNCKCCI.js +16 -0
- package/dist/chunk-VCGSWN5M.js +1300 -0
- package/dist/chunk-VE2O2I7M.js +115 -0
- package/dist/chunk-VIFHYTI5.js +31 -0
- package/dist/chunk-VJER3FUS.js +5080 -0
- package/dist/chunk-VLMDM56Q.js +268 -0
- package/dist/chunk-VMFZEVVX.js +99 -0
- package/dist/chunk-VNDPQVUZ.js +1853 -0
- package/dist/chunk-VSPJRLGA.js +4783 -0
- package/dist/chunk-VSWC5ZXI.js +103 -0
- package/dist/chunk-VYI4DSZP.js +2017 -0
- package/dist/chunk-W4BAIQ6L.js +1212 -0
- package/dist/chunk-W7VQAL2K.js +2203 -0
- package/dist/chunk-WEI3ZDZH.js +33 -0
- package/dist/chunk-WEIUS5NT.js +26 -0
- package/dist/chunk-WEW7UFWE.js +546 -0
- package/dist/chunk-WGQAXLNA.js +384 -0
- package/dist/chunk-WJAL4JL3.js +206 -0
- package/dist/chunk-WKFOJ5ZG.js +141 -0
- package/dist/chunk-WMWQEFLN.js +2177 -0
- package/dist/chunk-WNECKKO2.js +154 -0
- package/dist/chunk-WPKLYOAM.js +195 -0
- package/dist/chunk-WSH37YQN.js +243 -0
- package/dist/chunk-WV3KQDPE.js +84 -0
- package/dist/chunk-WZFC4V4U.js +389 -0
- package/dist/chunk-XCOIBNET.js +13 -0
- package/dist/chunk-XDM65LBX.js +53 -0
- package/dist/chunk-XGU6PBO5.js +645 -0
- package/dist/chunk-XHOI4V62.js +43 -0
- package/dist/chunk-XIBVFMLQ.js +6858 -0
- package/dist/chunk-XJ2E7YEJ.js +117 -0
- package/dist/chunk-XON4ZCYX.js +69 -0
- package/dist/chunk-XQPEWJPI.js +127 -0
- package/dist/chunk-XSJTIFUY.js +31 -0
- package/dist/chunk-XT7OVWM3.js +64 -0
- package/dist/chunk-XTXYIISX.js +1104 -0
- package/dist/chunk-XV7NZL4B.js +57 -0
- package/dist/chunk-XWIZ6B5S.js +109 -0
- package/dist/chunk-XWLIKOBX.js +240 -0
- package/dist/chunk-XZOXEIN4.js +156 -0
- package/dist/chunk-XZRS7I7W.js +3673 -0
- package/dist/chunk-Y4ZDDHB6.js +44 -0
- package/dist/chunk-Y733RB7T.js +194 -0
- package/dist/chunk-YBHUB4XR.js +14931 -0
- package/dist/chunk-YKC75XK4.js +147 -0
- package/dist/chunk-YKMXFVK7.js +27 -0
- package/dist/chunk-YO5BAJ55.js +225 -0
- package/dist/chunk-YPDCLXNZ.js +568 -0
- package/dist/chunk-YSQPGVFK.js +116 -0
- package/dist/chunk-YTVVTIWJ.js +716 -0
- package/dist/chunk-YVCMDVBB.js +698 -0
- package/dist/chunk-YYTOA6DP.js +114 -0
- package/dist/chunk-Z5WGNULV.js +88 -0
- package/dist/chunk-Z6NGVVXG.js +66 -0
- package/dist/chunk-Z7CDQNH3.js +20 -0
- package/dist/chunk-ZH4G3FU5.js +187 -0
- package/dist/chunk-ZJB6SQPA.js +257 -0
- package/dist/chunk-ZL6E4HMY.js +42 -0
- package/dist/chunk-ZMLOC3DW.js +62 -0
- package/dist/chunk-ZORW64QH.js +101 -0
- package/dist/chunk-ZVVD2XGV.js +1369 -0
- package/dist/cli-utils-ER33ODC5.js +31 -0
- package/dist/cli-validation-6CHPTANV.js +146 -0
- package/dist/commit-utils-3STAY7C7.js +49 -0
- package/dist/compatibility-notice-IHNXR2JR.js +21 -0
- package/dist/compete-config-resolver-V3GDNJMM.js +125 -0
- package/dist/compete-results-XUM3PJHS.js +318 -0
- package/dist/competition-outcome-tracker-NWSMVUPG.js +62 -0
- package/dist/config-4HHE4OIK.js +238 -0
- package/dist/config-D6YAZASH.js +10 -0
- package/dist/config-MIPRDYYV.js +46 -0
- package/dist/config-audit-GA5DCUAI.js +371 -0
- package/dist/config-explain-4LMO556H.js +71 -0
- package/dist/config-loader-RGP634PC.js +51 -0
- package/dist/config-manager-J2UTO635.js +114 -0
- package/dist/config-merger-TVUJBZTS.js +14 -0
- package/dist/config-validator-H4ZVIE56.js +122 -0
- package/dist/cost-HSIV5U2Y.js +85 -0
- package/dist/data-migration-state-OAUL2WPQ.js +35 -0
- package/dist/db-migrator-NUOW5NKR.js +34 -0
- package/dist/default-paths-UILB62BN.js +49 -0
- package/dist/discovery-V6GYUJUC.js +53 -0
- package/dist/doctor-BBSMCDWE.js +271 -0
- package/dist/doctor-context-blocks-LPY75VZA.js +231 -0
- package/dist/doctor-instructions-import-JXHDDOE5.js +70 -0
- package/dist/doctor-purpose-6YJOXPBE.js +30 -0
- package/dist/domain-analyzer-S35ABUNA.js +48 -0
- package/dist/ensure-initialized-Q6PEU55O.js +78 -0
- package/dist/entry.js +922 -0
- package/dist/error-parser-core-MZFMFANN.js +70 -0
- package/dist/evaluation-context-GQBYDAEV.js +63 -0
- package/dist/evidence-plan-resolver-5FUAP3SA.js +111 -0
- package/dist/execution-data-writer-YCG5UH37.js +72 -0
- package/dist/execution-policy-applier-PWZM5LNA.js +63 -0
- package/dist/execution-preflight-DASJWWQF.js +223 -0
- package/dist/execution-roles-KNSNNB2D.js +112 -0
- package/dist/exit-code-error-QIY5DOKF.js +18 -0
- package/dist/external-temp-cleanup-CAW7LQ6R.js +360 -0
- package/dist/factory-YCYCB7AE.js +209 -0
- package/dist/file-utils-ZQYNBQBW.js +45 -0
- package/dist/flywheel-allowlist-revert-H22HA6JE.js +21 -0
- package/dist/flywheel-autoloop-executor-PDOASJEZ.js +316 -0
- package/dist/flywheel-autoloop-unverified-TOKYFCDC.js +36 -0
- package/dist/flywheel-competition-executor-YJUMMEJO.js +320 -0
- package/dist/flywheel-executor-JWU43KAY.js +437 -0
- package/dist/flywheel-git-isolation-FQ2TRWMB.js +56 -0
- package/dist/flywheel-manifest-HDPNMWWF.js +114 -0
- package/dist/flywheel-model-defaults-UHAKTZT3.js +110 -0
- package/dist/flywheel-preflight-III2C7TH.js +163 -0
- package/dist/flywheel-resume-2O45MS7Y.js +31 -0
- package/dist/flywheel-resume-execution-lease-P2BK257J.js +59 -0
- package/dist/flywheel-safety-AVAVFXIJ.js +19 -0
- package/dist/flywheel-scope-decision-ALJUUNGG.js +14 -0
- package/dist/get-telemetry-logger-MPDVO2JA.js +155 -0
- package/dist/git-message-style-KCXGMTDT.js +104 -0
- package/dist/guidance-profile-config-G3K5YQOO.js +113 -0
- package/dist/guidance-profile-renderer-TX4TNDFL.js +23 -0
- package/dist/identity-XLQJ4YJF.js +25 -0
- package/dist/index-query-6NUY4FKX.js +37 -0
- package/dist/index.js +85588 -0
- package/dist/indexer-DL54CM3K.js +44 -0
- package/dist/init-OUZ72344.js +245 -0
- package/dist/instructions-import-offer-NSYXSITC.js +363 -0
- package/dist/instructions-run-NBII7W36.js +114 -0
- package/dist/interrupted-work-E4TLKJLE.js +43 -0
- package/dist/invoke-provider-auth-NEWEIHCI.js +38 -0
- package/dist/judge-scoring.json +64 -0
- package/dist/lab-mode-YXQ2Y3NG.js +44 -0
- package/dist/lab-utils-5QAMDJR5.js +29 -0
- package/dist/linux-host-class-YDWQX65O.js +31 -0
- package/dist/llm-judge-executor-OJSNCTFJ.js +179 -0
- package/dist/local-ci-config-VZ4WWDT5.js +48 -0
- package/dist/local-executor-DCMDDRX2.js +280 -0
- package/dist/logger-5KNKS3O4.js +154 -0
- package/dist/matrix-prompt-builder-4ZBOGZSB.js +527 -0
- package/dist/matrix-result-parser-EZJM4YXP.js +14 -0
- package/dist/merge-batch-RTEEMVDB.js +313 -0
- package/dist/merge-batch-members-VIWGVRHP.js +24 -0
- package/dist/merge-queue-TIIUSOY6.js +126 -0
- package/dist/merge-queue-trust-DUNZ4J65.js +21 -0
- package/dist/metadata-UKSMWM6J.js +29 -0
- package/dist/model-catalog-readiness-R5KJBP5M.js +202 -0
- package/dist/model-invocations-db-XTUPPQ34.js +70 -0
- package/dist/model-resolver-JFZ2MHOJ.js +39 -0
- package/dist/model-resolver-SCQ57KAQ.js +217 -0
- package/dist/model-roles-D3OR4NAH.js +110 -0
- package/dist/monitor-F4SIU5G2.js +96 -0
- package/dist/nested-worktrees-2WUWQ75N.js +23 -0
- package/dist/next-S3IRLVER.js +96 -0
- package/dist/next-UKPFRXOO.js +148 -0
- package/dist/opportunistic-TL4S26VX.js +86 -0
- package/dist/optimization-config-resolver-NAEIYU6A.js +148 -0
- package/dist/package-HJR4QJT4.js +10 -0
- package/dist/parse-git-status-7PIYFPS2.js +21 -0
- package/dist/path-security-5WJSY56G.js +41 -0
- package/dist/paths-JUI7C4KU.js +45 -0
- package/dist/plan-backlog-list-fast-SSTQL5XP.js +89 -0
- package/dist/plan-backlog-show-fast-PFRAQ3JB.js +114 -0
- package/dist/plan-sprint-list-fast-HD2KBZSY.js +110 -0
- package/dist/plan-sprint-status-fast-YFYH7WQF.js +116 -0
- package/dist/plan-task-status-fast-JU5PNLUU.js +114 -0
- package/dist/plan-to-flywheel-PY5MSY2H.js +529 -0
- package/dist/preflight-PJHGTJNZ.js +12 -0
- package/dist/process-registry-B4ZUCN7T.js +28 -0
- package/dist/process-scanner-TU3QHWVB.js +23 -0
- package/dist/processes-6FHVGT72.js +28 -0
- package/dist/processes-json-fast-YWTMUWXB.js +72 -0
- package/dist/profile-HWTC56SG.js +209 -0
- package/dist/project-runtime-paths-2UQNG5Y4.js +41 -0
- package/dist/protected-branches-N36LDBFY.js +71 -0
- package/dist/provider-aware-resource-manager-YTFAHNGJ.js +40 -0
- package/dist/provider-matrix-2KO2V5OM.js +214 -0
- package/dist/provider-matrix-renderer-MEC3PER7.js +139 -0
- package/dist/provider-output-forwarding-2AHL7YMA.js +26 -0
- package/dist/provider-registry-WCZ65QHC.js +136 -0
- package/dist/provider-temp-cleanup-IUNPJCZF.js +14 -0
- package/dist/prune-engine-EOQVWEP6.js +448 -0
- package/dist/publication-turn-S42RZTQF.js +44 -0
- package/dist/quality-gate-JQMVCKOO.js +72 -0
- package/dist/quickstart-3O6FRCFB.js +105 -0
- package/dist/readiness-GW6ABRHB.js +139 -0
- package/dist/readiness-KFZCXDTT.js +215 -0
- package/dist/registry-7XG376SY.js +217 -0
- package/dist/repair-helpers-TTV5FEF4.js +117 -0
- package/dist/repo-root-YG6MQZDW.js +28 -0
- package/dist/resolution-engine-FFEK7HQ2.js +187 -0
- package/dist/resolve-provider-cli-ZEXVZKET.js +44 -0
- package/dist/restore-telemetry-db-E7BR5PO7.js +459 -0
- package/dist/routing-events-AW6SRZ6G.js +13 -0
- package/dist/routing-history-store-FMDDQL6W.js +39 -0
- package/dist/routing-planner-C6OHO3EY.js +221 -0
- package/dist/runner-KHDNQ5KU.js +1194 -0
- package/dist/runner-PIS2BW7Y.js +1801 -0
- package/dist/safety-E3JJVSFL.js +67 -0
- package/dist/safety-stanza-HE6GXP4G.js +49 -0
- package/dist/sandbox-7LBZC5PE.js +72 -0
- package/dist/sandbox-ASWCDYZL.js +80 -0
- package/dist/schema-extensions.sql +234 -0
- package/dist/security-JI22TBEB.js +17 -0
- package/dist/setup-bb-plugin-FQXLA76Y.js +531 -0
- package/dist/setup-claude-code-NF4ZSHVE.js +197 -0
- package/dist/setup-temp-cleanup-2APZ4HMA.js +29 -0
- package/dist/shared-utils-34HJZ6JX.js +40 -0
- package/dist/simple-artifact-goal-MQLDDMMX.js +29 -0
- package/dist/sprint-N7JFTEGL.js +403 -0
- package/dist/sprint-bridge-KJXIBNRJ.js +117 -0
- package/dist/sprint-completion-dependents-34SR7JVL.js +43 -0
- package/dist/sprint-execution-service-A6JPUBWY.js +376 -0
- package/dist/sprint-manager-MU2ZUWN2.js +140 -0
- package/dist/sqlite-timeout-config-U2CT4LKU.js +13 -0
- package/dist/sqlite-wrapper-FSGJ2QEW.js +19 -0
- package/dist/stale-cleanup-orchestrator-4X6324VF.js +71 -0
- package/dist/storage-access-I3V5LER7.js +31 -0
- package/dist/store-XVG64ZR2.js +25 -0
- package/dist/task-classifier-MN2DYE5R.js +558 -0
- package/dist/task-list-fast-7AT6LTTA.js +112 -0
- package/dist/task-manager-LHPBBRRE.js +136 -0
- package/dist/task-report-OLPAWBTK.js +64 -0
- package/dist/task-type-detector-6RG3YNZF.js +27 -0
- package/dist/task-type-resolver-EQHOUIHT.js +64 -0
- package/dist/telemetry-5VYSK772.js +212 -0
- package/dist/telemetry-health-tracker-4GFW2EMP.js +12 -0
- package/dist/telemetry-path-resolver-H3NFHHQY.js +34 -0
- package/dist/telemetry-reliability-URJDTNPZ.js +76 -0
- package/dist/transports-NREZQTJK.js +106 -0
- package/dist/unified-cost-tracker-5MTBJ2CL.js +59 -0
- package/dist/unified-state-cleanup-GGAXLHXF.js +292 -0
- package/dist/universal-cost-calculator-JTFEJVWK.js +70 -0
- package/dist/user-agents-QLIGPLP2.js +30 -0
- package/dist/variant-execution-I4ZZUAWY.js +319 -0
- package/dist/variant-opt-parser-JHCXKY2K.js +251 -0
- package/dist/variant-request-input-PL37N3AN.js +11 -0
- package/dist/variant-state-cleanup-KHMXRBZN.js +287 -0
- package/dist/variant-worker-COB5YTJX.js +4517 -0
- package/dist/variant-worker.js +26 -0
- package/dist/variants-XGDSXYG3.js +267 -0
- package/dist/verification-command-YSPU4VBH.js +66 -0
- package/dist/verify-command-timeout-DQUYH33Z.js +11 -0
- package/dist/verify-commands-LOHMOFKC.js +65 -0
- package/dist/warning-JSKSFKBT.js +13 -0
- package/dist/work-edge-K65NHVWY.js +50 -0
- package/dist/work-item-writer-KY5ZWZWW.js +30 -0
- package/dist/worker-JNXXEIT6.js +1504 -0
- package/dist/worker.js +21 -0
- package/dist/workspace-tree-identity-JO5PSKTW.js +52 -0
- package/dist/worktree-environment-WTVABAQW.js +64 -0
- package/dist/worktree-metrics-VZRQI26T.js +66 -0
- package/dist/writeback-TQFQBJNU.js +50 -0
- package/docs/CLI_REFERENCE.md +8287 -0
- package/docs/PROVIDER_SETUP.md +1737 -0
- package/docs/README.md +96 -0
- package/docs/TROUBLESHOOTING.md +2209 -0
- package/docs/getting-started/QUICK_START.md +260 -0
- package/docs/getting-started/README.md +198 -0
- package/docs/getting-started/SETUP.md +25 -0
- package/docs/reference/AGENT_CONTEXT.md +84 -0
- package/docs/reference/DELIVERY_ONBOARDING.md +198 -0
- package/docs/reference/PROVIDER_RELEASE_TIERS.md +34 -0
- package/docs/reference/SECURITY.md +291 -0
- package/docs/reference/TELEMETRY_PRIVACY.md +259 -0
- package/integrations/bb-plugin-build/README.md +391 -0
- package/integrations/bb-plugin-build/app.css +431 -0
- package/integrations/bb-plugin-build/app.tsx +6210 -0
- package/integrations/bb-plugin-build/package.json +45 -0
- package/integrations/bb-plugin-build/server.ts +488 -0
- package/integrations/bb-plugin-build/src/adapter.ts +3672 -0
- package/integrations/bb-plugin-build/src/backlog-authoring-model.ts +150 -0
- package/integrations/bb-plugin-build/src/backlog-authoring-schema.ts +458 -0
- package/integrations/bb-plugin-build/src/backlog-authoring-service.ts +467 -0
- package/integrations/bb-plugin-build/src/backlog-authoring-view.ts +1025 -0
- package/integrations/bb-plugin-build/src/command-evidence-schema.ts +13 -0
- package/integrations/bb-plugin-build/src/competition-defaults-schema.ts +122 -0
- package/integrations/bb-plugin-build/src/competition-defaults-service.ts +105 -0
- package/integrations/bb-plugin-build/src/competition-defaults-view.ts +138 -0
- package/integrations/bb-plugin-build/src/contract.ts +718 -0
- package/integrations/bb-plugin-build/src/execution-activity-view.ts +98 -0
- package/integrations/bb-plugin-build/src/finalize-model.ts +205 -0
- package/integrations/bb-plugin-build/src/finalize-schema.ts +150 -0
- package/integrations/bb-plugin-build/src/finalize-service.ts +330 -0
- package/integrations/bb-plugin-build/src/finalize-view.ts +159 -0
- package/integrations/bb-plugin-build/src/judge-operations-readback.ts +303 -0
- package/integrations/bb-plugin-build/src/judge-operations-schema.ts +33 -0
- package/integrations/bb-plugin-build/src/judge-operations-view.ts +459 -0
- package/integrations/bb-plugin-build/src/model.ts +1318 -0
- package/integrations/bb-plugin-build/src/monitor-service.ts +233 -0
- package/integrations/bb-plugin-build/src/panel-read-ux.ts +97 -0
- package/integrations/bb-plugin-build/src/patch-preview-schema.ts +166 -0
- package/integrations/bb-plugin-build/src/patch-preview-service.ts +480 -0
- package/integrations/bb-plugin-build/src/patch-preview-view.ts +109 -0
- package/integrations/bb-plugin-build/src/planning-readback.ts +228 -0
- package/integrations/bb-plugin-build/src/planning-service.ts +647 -0
- package/integrations/bb-plugin-build/src/planning-sync-evidence.ts +37 -0
- package/integrations/bb-plugin-build/src/planning-workspace-readback.ts +33 -0
- package/integrations/bb-plugin-build/src/planning-workspace-schema.ts +131 -0
- package/integrations/bb-plugin-build/src/planning-workspace.ts +333 -0
- package/integrations/bb-plugin-build/src/poll-handoff.ts +136 -0
- package/integrations/bb-plugin-build/src/project-target-server.ts +21 -0
- package/integrations/bb-plugin-build/src/project-target.ts +45 -0
- package/integrations/bb-plugin-build/src/reference-index.ts +218 -0
- package/integrations/bb-plugin-build/src/repository-identity.ts +17 -0
- package/integrations/bb-plugin-build/src/repository-schema.ts +30 -0
- package/integrations/bb-plugin-build/src/result-explorer-view.ts +597 -0
- package/integrations/bb-plugin-build/src/result-readback-model.ts +163 -0
- package/integrations/bb-plugin-build/src/result-readback-schema.ts +319 -0
- package/integrations/bb-plugin-build/src/result-readback-service.ts +333 -0
- package/integrations/bb-plugin-build/src/run-page-view.ts +332 -0
- package/integrations/bb-plugin-build/src/setup-config-schema.ts +293 -0
- package/integrations/bb-plugin-build/src/setup-config-service.ts +620 -0
- package/integrations/bb-plugin-build/src/setup-config-view.ts +388 -0
- package/integrations/bb-plugin-build/src/sprint-close-model.ts +150 -0
- package/integrations/bb-plugin-build/src/sprint-close-schema.ts +128 -0
- package/integrations/bb-plugin-build/src/sprint-close-service.ts +293 -0
- package/integrations/bb-plugin-build/src/sprint-close-view.ts +116 -0
- package/integrations/bb-plugin-build/src/sprint-composition-model.ts +709 -0
- package/integrations/bb-plugin-build/src/sprint-composition-readback.ts +231 -0
- package/integrations/bb-plugin-build/src/sprint-composition-schema.ts +597 -0
- package/integrations/bb-plugin-build/src/sprint-composition-service.ts +773 -0
- package/integrations/bb-plugin-build/src/sprint-composition-view.ts +1221 -0
- package/integrations/bb-plugin-build/src/sprint-execution-schema.ts +188 -0
- package/integrations/bb-plugin-build/src/sprint-execution-service.ts +289 -0
- package/integrations/bb-plugin-build/src/sprint-execution-view.ts +54 -0
- package/integrations/bb-plugin-build/src/task-authoring-model.ts +563 -0
- package/integrations/bb-plugin-build/src/task-authoring-schema.ts +629 -0
- package/integrations/bb-plugin-build/src/task-authoring-service.ts +842 -0
- package/integrations/bb-plugin-build/src/task-authoring-view.ts +1227 -0
- package/integrations/bb-plugin-build/src/task-catalog-schema.ts +46 -0
- package/integrations/bb-plugin-build/src/task-catalog-service.ts +44 -0
- package/integrations/bb-plugin-build/src/task-detail-readback.ts +56 -0
- package/integrations/bb-plugin-build/src/task-detail-schema.ts +171 -0
- package/integrations/bb-plugin-build/src/task-navigation.ts +446 -0
- package/integrations/bb-plugin-build/src/workbench-route.ts +74 -0
- package/package.json +306 -4
- package/schemas/README.md +80 -0
- package/schemas/build.config.schema.json +2110 -0
- package/schemas/config-v1.schema.json +136 -0
- package/schemas/execution-config.schema.json +47 -0
- package/schemas/judge-scoring.schema.json +257 -0
- package/schemas/provider-config.schema.json +179 -0
- package/schemas/telemetry-config.schema.json +79 -0
- package/schemas/user-preferences.schema.json +141 -0
- package/scripts/assert-node-runtime.mjs +146 -0
- package/scripts/preflight-native.mjs +49 -0
- package/scripts/setup-git-hooks.mjs +39 -0
- package/scripts/sync.sh +2871 -0
- package/scripts/write-node-launcher.sh +138 -0
- package/src/resources/gemini/slash-packs/default/plan.toml +15 -0
- package/src/resources/gemini/slash-packs/default/summary.toml +16 -0
- package/src/resources/gemini/slash-packs/default/tests.toml +16 -0
- package/templates/.build-project/README.md +41 -0
- package/templates/.build-project/agents/README.md +50 -0
- package/templates/.build-project/agents/architect.md +10 -0
- package/templates/.build-project/agents/code-reviewer.md +10 -0
- package/templates/.build-project/agents/debugger.md +10 -0
- package/templates/.build-project/agents/documenter.md +10 -0
- package/templates/.build-project/agents/test-automator.md +10 -0
- package/templates/.build-project/config/build.config.jsonc +64 -0
- package/templates/.build-project/config/project-context.template.json +6 -0
- package/templates/.build-project/config/task-type-aliases.presets/kanban.yaml +14 -0
- package/templates/.build-project/config/task-type-aliases.presets/scrum.yaml +17 -0
- package/templates/.build-project/config/task-type-aliases.presets/xp.yaml +12 -0
- package/templates/.build-project/config/task-type-aliases.yaml +29 -0
- package/templates/.build-project/gitignore.template +70 -0
- package/templates/.build-project/task-types/analysis.yaml +38 -0
- package/templates/.build-project/task-types/architecture.yaml +35 -0
- package/templates/.build-project/task-types/doc.yaml +34 -0
- package/templates/.build-project/task-types/feature.yaml +22 -0
- package/templates/.build-project/task-types/general.yaml +4 -0
- package/templates/.build-project/task-types/security.yaml +38 -0
- package/templates/AGENTS.template.md +85 -0
- package/templates/CLAUDE.template.md +1 -0
- package/templates/GEMINI.template.md +1 -0
- package/templates/builtin-workflows/code-review.yaml +73 -0
- package/templates/builtin-workflows/skills/code-review/SKILL.md +61 -0
- package/templates/builtin-workflows/skills/execution-contract-analysis/SKILL.md +24 -0
- package/templates/builtin-workflows/skills/execution-contract-code/SKILL.md +19 -0
- package/templates/builtin-workflows/skills/execution-contract-structured/SKILL.md +17 -0
- package/templates/ci/incident-intake.mjs +787 -0
- package/templates/ci/incidents.yml.template +103 -0
- package/templates/ci/node.yml.template +17 -0
- package/templates/ci/python.yml.template +17 -0
- package/templates/guard-kit/GUARD_SETUP.md.template +258 -0
- package/templates/guard-kit/build-guard.yml.template +189 -0
- package/templates/guard-kit/check.mjs.template +932 -0
- package/templates/guard-kit/config.json.template +7 -0
- package/templates/guard-kit/policy.json.template +1 -0
- package/templates/profiles/README.md +57 -0
- package/templates/profiles/frontier-claude.json +23 -0
- package/templates/profiles/frontier-codex.json +23 -0
|
@@ -0,0 +1,1801 @@
|
|
|
1
|
+
import {
|
|
2
|
+
canonicalizeOpencodeModelId
|
|
3
|
+
} from "./chunk-Q3DHEZA5.js";
|
|
4
|
+
import {
|
|
5
|
+
aggregateCredentialResidueErrors,
|
|
6
|
+
contextualizeCredentialCleanupError,
|
|
7
|
+
markRunOwnedRoot,
|
|
8
|
+
normalizeOpencodeReasoningEffort,
|
|
9
|
+
notifySubmittedPrompt,
|
|
10
|
+
opencodeNativeVariant,
|
|
11
|
+
removeAndVerifyRunOwnedRoot,
|
|
12
|
+
reportOutputDrift,
|
|
13
|
+
resolveCallerOwnedPath,
|
|
14
|
+
resolveOpencodeReasoningEffort
|
|
15
|
+
} from "./chunk-GIJWHUWF.js";
|
|
16
|
+
import {
|
|
17
|
+
assembleSteering,
|
|
18
|
+
detectQuotaExhaustion,
|
|
19
|
+
formatQuotaExhaustedMessage,
|
|
20
|
+
omitsUserInstructions
|
|
21
|
+
} from "./chunk-HKO45NLZ.js";
|
|
22
|
+
import {
|
|
23
|
+
executeOpencodeCommandWithBootstrapRetry,
|
|
24
|
+
extractUnstructuredOpencodeStdout,
|
|
25
|
+
formatCacheAge,
|
|
26
|
+
getCachedOpencodeModelIds,
|
|
27
|
+
getOpencodeModelsCacheInfo,
|
|
28
|
+
parseOpencodeProviderOutput,
|
|
29
|
+
resolveOpencodeModelsCacheDir
|
|
30
|
+
} from "./chunk-3LOY6YZI.js";
|
|
31
|
+
import {
|
|
32
|
+
DEFAULT_PROVIDER_CIRCUIT_BREAKER_OPTIONS,
|
|
33
|
+
RetryBudget,
|
|
34
|
+
assertWorkspaceRetryIsSafe,
|
|
35
|
+
captureGitBaseline,
|
|
36
|
+
captureWorkspaceRetryState,
|
|
37
|
+
detectGitChangedFiles,
|
|
38
|
+
executeWithResilience,
|
|
39
|
+
getGitHead,
|
|
40
|
+
measurePromptRequestBytes,
|
|
41
|
+
recordInvocationTiming,
|
|
42
|
+
rejectUnsafeFullPromptRetry
|
|
43
|
+
} from "./chunk-D37WY7SH.js";
|
|
44
|
+
import "./chunk-Z7CDQNH3.js";
|
|
45
|
+
import "./chunk-PRDHI2L5.js";
|
|
46
|
+
import {
|
|
47
|
+
resolveProviderTimeoutMs
|
|
48
|
+
} from "./chunk-URMSZXAD.js";
|
|
49
|
+
import {
|
|
50
|
+
acquireRateLimitToken
|
|
51
|
+
} from "./chunk-JVHGMURQ.js";
|
|
52
|
+
import "./chunk-JYXS47FQ.js";
|
|
53
|
+
import "./chunk-B7PYTV72.js";
|
|
54
|
+
import "./chunk-4QKP6I4C.js";
|
|
55
|
+
import {
|
|
56
|
+
clampAttemptTimeoutToDeadline
|
|
57
|
+
} from "./chunk-GWHGTG37.js";
|
|
58
|
+
import {
|
|
59
|
+
inferProviderFailurePhase,
|
|
60
|
+
recordProviderRunFailure,
|
|
61
|
+
recordProviderRunSuccess
|
|
62
|
+
} from "./chunk-CRPRVNQ4.js";
|
|
63
|
+
import {
|
|
64
|
+
metadata
|
|
65
|
+
} from "./chunk-WEIUS5NT.js";
|
|
66
|
+
import {
|
|
67
|
+
getOpencodeRunCapabilities,
|
|
68
|
+
isOpencode2Version
|
|
69
|
+
} from "./chunk-S47ISY27.js";
|
|
70
|
+
import {
|
|
71
|
+
isUnknownErrorRetryable
|
|
72
|
+
} from "./chunk-3P5IN5E7.js";
|
|
73
|
+
import "./chunk-WEI3ZDZH.js";
|
|
74
|
+
import "./chunk-H6MJGKAW.js";
|
|
75
|
+
import "./chunk-67YRJPJO.js";
|
|
76
|
+
import {
|
|
77
|
+
prepareVariantCommand
|
|
78
|
+
} from "./chunk-633XZ7UF.js";
|
|
79
|
+
import "./chunk-SF6YK3JI.js";
|
|
80
|
+
import {
|
|
81
|
+
providerOutputTail,
|
|
82
|
+
redactProviderArgv
|
|
83
|
+
} from "./chunk-JBBB2Y47.js";
|
|
84
|
+
import "./chunk-WJAL4JL3.js";
|
|
85
|
+
import {
|
|
86
|
+
PUBLIC_DIAGNOSTICS_STRING_MAX,
|
|
87
|
+
sanitizeDiagnosticOutput
|
|
88
|
+
} from "./chunk-RBKLOUXA.js";
|
|
89
|
+
import "./chunk-4EBSXZ73.js";
|
|
90
|
+
import "./chunk-PFCXFO7A.js";
|
|
91
|
+
import "./chunk-SDPIFNLD.js";
|
|
92
|
+
import "./chunk-GO6DRECI.js";
|
|
93
|
+
import "./chunk-XIBVFMLQ.js";
|
|
94
|
+
import "./chunk-QWMQ74KD.js";
|
|
95
|
+
import "./chunk-GAFJEYLK.js";
|
|
96
|
+
import "./chunk-YKC75XK4.js";
|
|
97
|
+
import "./chunk-T7E5JS6N.js";
|
|
98
|
+
import "./chunk-ZJB6SQPA.js";
|
|
99
|
+
import "./chunk-GZK62I3N.js";
|
|
100
|
+
import "./chunk-GC4CRMTS.js";
|
|
101
|
+
import "./chunk-P7CQGPLS.js";
|
|
102
|
+
import "./chunk-C3DH3NCY.js";
|
|
103
|
+
import "./chunk-IVZEONFC.js";
|
|
104
|
+
import {
|
|
105
|
+
buildProviderExecutionEnv
|
|
106
|
+
} from "./chunk-XTXYIISX.js";
|
|
107
|
+
import "./chunk-MEMSY6VY.js";
|
|
108
|
+
import "./chunk-VBNCKCCI.js";
|
|
109
|
+
import "./chunk-33IGPPUI.js";
|
|
110
|
+
import "./chunk-UPHU64NB.js";
|
|
111
|
+
import "./chunk-JLS65NUQ.js";
|
|
112
|
+
import "./chunk-FRBPKBFE.js";
|
|
113
|
+
import "./chunk-BAWJNMWF.js";
|
|
114
|
+
import "./chunk-LX4F24ZH.js";
|
|
115
|
+
import "./chunk-BBPIILO2.js";
|
|
116
|
+
import "./chunk-2NMNFUQA.js";
|
|
117
|
+
import "./chunk-I7SCBHJN.js";
|
|
118
|
+
import {
|
|
119
|
+
applyWorkspaceMode,
|
|
120
|
+
logReasoningEffortResolution,
|
|
121
|
+
resolveEffectiveMode
|
|
122
|
+
} from "./chunk-TGXXYDL4.js";
|
|
123
|
+
import "./chunk-D2M2Y5ID.js";
|
|
124
|
+
import "./chunk-UJP3XM54.js";
|
|
125
|
+
import "./chunk-MULMXX4V.js";
|
|
126
|
+
import "./chunk-UTDEOPKV.js";
|
|
127
|
+
import "./chunk-RFDVSI4N.js";
|
|
128
|
+
import "./chunk-M4BUEXXF.js";
|
|
129
|
+
import "./chunk-ZH4G3FU5.js";
|
|
130
|
+
import "./chunk-726G6WDL.js";
|
|
131
|
+
import "./chunk-EP22ZMFO.js";
|
|
132
|
+
import "./chunk-5UBIFVRD.js";
|
|
133
|
+
import "./chunk-O7FE75QZ.js";
|
|
134
|
+
import "./chunk-Q64IR2Z2.js";
|
|
135
|
+
import {
|
|
136
|
+
deriveOpencodePrefixes
|
|
137
|
+
} from "./chunk-YVCMDVBB.js";
|
|
138
|
+
import "./chunk-7HPCIOMA.js";
|
|
139
|
+
import "./chunk-P6SSWAKY.js";
|
|
140
|
+
import "./chunk-ETAD4NKD.js";
|
|
141
|
+
import "./chunk-XQPEWJPI.js";
|
|
142
|
+
import "./chunk-7YAOUUKK.js";
|
|
143
|
+
import "./chunk-SKTFRFQ7.js";
|
|
144
|
+
import "./chunk-O5X6BKAO.js";
|
|
145
|
+
import "./chunk-R2CKS6WT.js";
|
|
146
|
+
import "./chunk-3OPP2OZB.js";
|
|
147
|
+
import "./chunk-EPRMH6HO.js";
|
|
148
|
+
import "./chunk-XHOI4V62.js";
|
|
149
|
+
import "./chunk-S2VQCZO4.js";
|
|
150
|
+
import "./chunk-6TBEX4R4.js";
|
|
151
|
+
import "./chunk-PXKERBKX.js";
|
|
152
|
+
import "./chunk-QYQOVOLR.js";
|
|
153
|
+
import "./chunk-QFLBRWCJ.js";
|
|
154
|
+
import "./chunk-AEQWV746.js";
|
|
155
|
+
import "./chunk-SVUNZOPG.js";
|
|
156
|
+
import "./chunk-KUEWV2JH.js";
|
|
157
|
+
import "./chunk-R2TIYG7U.js";
|
|
158
|
+
import "./chunk-5FKHIKTS.js";
|
|
159
|
+
import "./chunk-S2E632FQ.js";
|
|
160
|
+
import "./chunk-XJ2E7YEJ.js";
|
|
161
|
+
import {
|
|
162
|
+
requireActivePolicyBoundary,
|
|
163
|
+
requireActiveSandboxBoundary
|
|
164
|
+
} from "./chunk-B7YRSULE.js";
|
|
165
|
+
import "./chunk-4U6XK2DG.js";
|
|
166
|
+
import "./chunk-BY6ODHNZ.js";
|
|
167
|
+
import "./chunk-3H4MWYIC.js";
|
|
168
|
+
import "./chunk-DP7FKP6W.js";
|
|
169
|
+
import "./chunk-VIFHYTI5.js";
|
|
170
|
+
import "./chunk-XGU6PBO5.js";
|
|
171
|
+
import "./chunk-F55YABKV.js";
|
|
172
|
+
import "./chunk-YO5BAJ55.js";
|
|
173
|
+
import "./chunk-EVE3OD2W.js";
|
|
174
|
+
import {
|
|
175
|
+
mkBuildTempDir
|
|
176
|
+
} from "./chunk-D6WTZMZB.js";
|
|
177
|
+
import "./chunk-5EQN56OZ.js";
|
|
178
|
+
import "./chunk-RBBTBCHX.js";
|
|
179
|
+
import "./chunk-4DJL2VXA.js";
|
|
180
|
+
import "./chunk-AHU3FKPA.js";
|
|
181
|
+
import {
|
|
182
|
+
stripAnsiSequences
|
|
183
|
+
} from "./chunk-TUQMMFEQ.js";
|
|
184
|
+
import "./chunk-EPAMVGI3.js";
|
|
185
|
+
import "./chunk-6CB3KJRY.js";
|
|
186
|
+
import "./chunk-L2S235CU.js";
|
|
187
|
+
import "./chunk-D4VJFCGZ.js";
|
|
188
|
+
import "./chunk-RPIMAMV7.js";
|
|
189
|
+
import {
|
|
190
|
+
safeRmDir
|
|
191
|
+
} from "./chunk-ALDTFNZ3.js";
|
|
192
|
+
import "./chunk-QOIASNEJ.js";
|
|
193
|
+
import "./chunk-2VUEDIUM.js";
|
|
194
|
+
import "./chunk-MJ6WNSIX.js";
|
|
195
|
+
import "./chunk-5KQETTNS.js";
|
|
196
|
+
import "./chunk-J2ICMYDA.js";
|
|
197
|
+
import "./chunk-2VLJUXJU.js";
|
|
198
|
+
import "./chunk-PPZESPJT.js";
|
|
199
|
+
import "./chunk-XCOIBNET.js";
|
|
200
|
+
import {
|
|
201
|
+
getProviderRuntimeQuirks
|
|
202
|
+
} from "./chunk-Y733RB7T.js";
|
|
203
|
+
import "./chunk-H3HGMISG.js";
|
|
204
|
+
import "./chunk-FAZBRHGG.js";
|
|
205
|
+
import "./chunk-CJBSZX3F.js";
|
|
206
|
+
import "./chunk-C3KCMAJP.js";
|
|
207
|
+
import "./chunk-FKCG7K6H.js";
|
|
208
|
+
import "./chunk-AJN5Y5YZ.js";
|
|
209
|
+
import "./chunk-MHLEZQQI.js";
|
|
210
|
+
import "./chunk-HEP3ILP4.js";
|
|
211
|
+
import "./chunk-BQJOGAWT.js";
|
|
212
|
+
import "./chunk-WV3KQDPE.js";
|
|
213
|
+
import "./chunk-VSWC5ZXI.js";
|
|
214
|
+
import "./chunk-XV7NZL4B.js";
|
|
215
|
+
import {
|
|
216
|
+
resolveProviderCliCommand
|
|
217
|
+
} from "./chunk-KKQKWAMF.js";
|
|
218
|
+
import "./chunk-RWQQIKIC.js";
|
|
219
|
+
import "./chunk-GVJGSSKM.js";
|
|
220
|
+
import "./chunk-QJ6OEH4K.js";
|
|
221
|
+
import {
|
|
222
|
+
readFrontMatter,
|
|
223
|
+
readInheritedSet,
|
|
224
|
+
recordAuthCopySeed,
|
|
225
|
+
recordInheritedKind,
|
|
226
|
+
stripFrontMatter,
|
|
227
|
+
writeBackRefreshedAuth
|
|
228
|
+
} from "./chunk-BD3PGW6A.js";
|
|
229
|
+
import {
|
|
230
|
+
INHERITED_AGENTS_DIRNAME,
|
|
231
|
+
INHERITED_INSTRUCTIONS_FILENAME,
|
|
232
|
+
INHERITED_SKILLS_DIRNAME,
|
|
233
|
+
excludesAgentGlobals,
|
|
234
|
+
readLaunchInheritance
|
|
235
|
+
} from "./chunk-43OKHTW4.js";
|
|
236
|
+
import "./chunk-MNOVBYFU.js";
|
|
237
|
+
import "./chunk-QXBKTJT6.js";
|
|
238
|
+
import "./chunk-4BTDUT2S.js";
|
|
239
|
+
import "./chunk-35J4NE6S.js";
|
|
240
|
+
import "./chunk-RIMARPCF.js";
|
|
241
|
+
import "./chunk-HGFXODKO.js";
|
|
242
|
+
import "./chunk-N5DX4JAK.js";
|
|
243
|
+
import "./chunk-V2TVPO3X.js";
|
|
244
|
+
import {
|
|
245
|
+
CredentialResidueError,
|
|
246
|
+
ProviderExecutionError
|
|
247
|
+
} from "./chunk-RRC5BL7B.js";
|
|
248
|
+
import "./chunk-352PCJLK.js";
|
|
249
|
+
import "./chunk-RCP2Y6DQ.js";
|
|
250
|
+
import {
|
|
251
|
+
hostTerminationMetadataFromUnknown,
|
|
252
|
+
isCapacityError,
|
|
253
|
+
isContextOverflowError,
|
|
254
|
+
isRateLimitError,
|
|
255
|
+
parseHostTermination
|
|
256
|
+
} from "./chunk-M6UHOC4I.js";
|
|
257
|
+
import "./chunk-PSTKWHHN.js";
|
|
258
|
+
import "./chunk-KTMW65UX.js";
|
|
259
|
+
import "./chunk-3JKNRYEE.js";
|
|
260
|
+
import "./chunk-MT2WAIR3.js";
|
|
261
|
+
import "./chunk-WGQAXLNA.js";
|
|
262
|
+
import "./chunk-ONHAMBN6.js";
|
|
263
|
+
import "./chunk-XSJTIFUY.js";
|
|
264
|
+
import "./chunk-XWIZ6B5S.js";
|
|
265
|
+
import "./chunk-U4DRS6ZW.js";
|
|
266
|
+
import "./chunk-I56TH7VM.js";
|
|
267
|
+
import "./chunk-Z5WGNULV.js";
|
|
268
|
+
import "./chunk-O26L6F7F.js";
|
|
269
|
+
import "./chunk-RJ6RSNT6.js";
|
|
270
|
+
import "./chunk-ZORW64QH.js";
|
|
271
|
+
import "./chunk-TAJPCXSB.js";
|
|
272
|
+
import "./chunk-56WPYDJH.js";
|
|
273
|
+
import "./chunk-RSYTSBOO.js";
|
|
274
|
+
import "./chunk-STW7OFOA.js";
|
|
275
|
+
import "./chunk-CHA2HDE5.js";
|
|
276
|
+
import "./chunk-JNMWYMC6.js";
|
|
277
|
+
import {
|
|
278
|
+
BUILD_OPENCODE_TRANSIENT_AGENT,
|
|
279
|
+
BUILD_OPENCODE_XDG_CACHE_HOME,
|
|
280
|
+
BUILD_OPENCODE_XDG_CONFIG_HOME,
|
|
281
|
+
BUILD_OPENCODE_XDG_DATA_HOME,
|
|
282
|
+
BUILD_OPENCODE_XDG_STATE_HOME,
|
|
283
|
+
BUILD_TEST_FAST_RETRY,
|
|
284
|
+
debugLog,
|
|
285
|
+
getExecutionContext,
|
|
286
|
+
isDebugMode,
|
|
287
|
+
readEnv,
|
|
288
|
+
readRawEnv
|
|
289
|
+
} from "./chunk-7VRJHTGZ.js";
|
|
290
|
+
import "./chunk-XDM65LBX.js";
|
|
291
|
+
import "./chunk-CPSVQR2I.js";
|
|
292
|
+
import "./chunk-PZ5AY32C.js";
|
|
293
|
+
|
|
294
|
+
// src/core/providers/opencode/execution/runner.ts
|
|
295
|
+
import * as fs3 from "fs/promises";
|
|
296
|
+
import { homedir as homedir2, tmpdir as tmpdir2 } from "os";
|
|
297
|
+
import * as path3 from "path";
|
|
298
|
+
|
|
299
|
+
// src/core/steering/transport/opencode.ts
|
|
300
|
+
import { writeFile } from "fs/promises";
|
|
301
|
+
import { tmpdir } from "os";
|
|
302
|
+
import { join } from "path";
|
|
303
|
+
function buildOpencodeSteering(options) {
|
|
304
|
+
return assembleSteering({
|
|
305
|
+
provider: "opencode",
|
|
306
|
+
guidance: options.guidance,
|
|
307
|
+
omitInstructionSet: options.omitInstructionSet,
|
|
308
|
+
omitUserInstructions: omitsUserInstructions(options.env)
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
function buildOpencodeInstructionsConfig(instructions) {
|
|
312
|
+
return JSON.stringify({ $schema: "https://opencode.ai/config.json", instructions });
|
|
313
|
+
}
|
|
314
|
+
async function stageOpencodeSteeringInstructions(payload) {
|
|
315
|
+
if (!payload.systemChannel) return void 0;
|
|
316
|
+
const dir = await mkBuildTempDir("opencode-steering");
|
|
317
|
+
const cleanup = async () => {
|
|
318
|
+
try {
|
|
319
|
+
await safeRmDir(dir, { protectedPaths: [tmpdir()], managedRoots: [tmpdir()] });
|
|
320
|
+
} catch (error) {
|
|
321
|
+
debugLog(
|
|
322
|
+
`[OpenCode] Failed to clean steering instructions ${dir}: ${error instanceof Error ? error.message : String(error)}`
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
const filePath = join(dir, "build-steering.md");
|
|
327
|
+
try {
|
|
328
|
+
await writeFile(filePath, payload.systemChannel, "utf8");
|
|
329
|
+
} catch (error) {
|
|
330
|
+
await cleanup();
|
|
331
|
+
throw error;
|
|
332
|
+
}
|
|
333
|
+
return { configContent: buildOpencodeInstructionsConfig([filePath]), filePath, cleanup };
|
|
334
|
+
}
|
|
335
|
+
function applyOpencodePreambleFallback(payload, userPrompt) {
|
|
336
|
+
if (!payload.systemChannel) return userPrompt;
|
|
337
|
+
return `${payload.systemChannel}
|
|
338
|
+
|
|
339
|
+
${userPrompt}`;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// src/core/providers/opencode/error-parser.ts
|
|
343
|
+
var OPENCODE_UNKNOWN_ERROR_POLICY = "fail";
|
|
344
|
+
var MODEL_NOT_FOUND_PATTERN = /\bmodel_not_found\b|providermodelnotfound|\bmodel not found\b|\bunknown model\b|no such model|model\s+["'`][^"'`]+["'`]\s+not found|\bmodel unavailable\b/i;
|
|
345
|
+
function extractRequestedModelId(...texts) {
|
|
346
|
+
const combined = texts.filter(Boolean).join("\n");
|
|
347
|
+
const patterns = [
|
|
348
|
+
/model[_\s-]?not[_\s-]?found[:\s]+["'`]?([A-Za-z0-9._/:-]+)/i,
|
|
349
|
+
/unknown model[:\s]+["'`]?([A-Za-z0-9._/:-]+)/i,
|
|
350
|
+
/model ["'`]([^"'`]+)["'`]/i,
|
|
351
|
+
/--model\s+([A-Za-z0-9._/:-]+)/i
|
|
352
|
+
];
|
|
353
|
+
for (const pattern of patterns) {
|
|
354
|
+
const match = combined.match(pattern);
|
|
355
|
+
const id = match?.[1]?.trim();
|
|
356
|
+
if (id) return id;
|
|
357
|
+
}
|
|
358
|
+
return void 0;
|
|
359
|
+
}
|
|
360
|
+
function buildOpencodeModelNotFoundUserMessage(context = {}) {
|
|
361
|
+
const requested = context.requestedModel?.trim() || "unknown";
|
|
362
|
+
const cliVersion = context.cliVersion?.trim() || "unknown";
|
|
363
|
+
const inventoryAge = context.inventoryAgeMs === void 0 ? "unknown" : formatCacheAge(context.inventoryAgeMs);
|
|
364
|
+
const parts = [
|
|
365
|
+
`OpenCode could not resolve model "${requested}".`,
|
|
366
|
+
`CLI version: ${cliVersion}. Inventory age: ${inventoryAge}.`
|
|
367
|
+
];
|
|
368
|
+
const inventory = context.inventoryModelIds;
|
|
369
|
+
if (inventory === void 0) {
|
|
370
|
+
parts.push(
|
|
371
|
+
"The local OpenCode model inventory is unavailable, so Build could not compare the requested model with it."
|
|
372
|
+
);
|
|
373
|
+
} else if (inventory.length === 0) {
|
|
374
|
+
parts.push("The local OpenCode model inventory is available but empty.");
|
|
375
|
+
} else {
|
|
376
|
+
const canonicalRequested = canonicalizeOpencodeModelId(requested, [...inventory]);
|
|
377
|
+
if (canonicalRequested !== requested) {
|
|
378
|
+
parts.push(`Canonical inventory model: "${canonicalRequested}".`);
|
|
379
|
+
}
|
|
380
|
+
if (inventory.includes(canonicalRequested)) {
|
|
381
|
+
parts.push(
|
|
382
|
+
"The local inventory lists that model; the OpenCode execution error remains authoritative."
|
|
383
|
+
);
|
|
384
|
+
} else {
|
|
385
|
+
const [requestedPrefix] = deriveOpencodePrefixes([canonicalRequested]);
|
|
386
|
+
const inventoryPrefixes = deriveOpencodePrefixes(inventory);
|
|
387
|
+
if (requestedPrefix && !inventoryPrefixes.has(requestedPrefix)) {
|
|
388
|
+
parts.push(
|
|
389
|
+
`The local inventory does not list models for provider prefix "${requestedPrefix}".`
|
|
390
|
+
);
|
|
391
|
+
} else if (requestedPrefix) {
|
|
392
|
+
parts.push(
|
|
393
|
+
`The local inventory lists provider prefix "${requestedPrefix}" but does not list model "${canonicalRequested}".`
|
|
394
|
+
);
|
|
395
|
+
} else {
|
|
396
|
+
parts.push(`The local inventory does not list model "${canonicalRequested}".`);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
parts.push(
|
|
401
|
+
isOpencode2Version(context.cliVersion) ? "Check the models OpenCode lists with `opencode models --standalone`." : "Refresh the local inventory with `opencode models --refresh`."
|
|
402
|
+
);
|
|
403
|
+
return parts.join(" ");
|
|
404
|
+
}
|
|
405
|
+
function parseOpencodeError(error, context = {}) {
|
|
406
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
407
|
+
const providerError = error instanceof ProviderExecutionError ? error : void 0;
|
|
408
|
+
const stderr = providerError?.stderr ?? "";
|
|
409
|
+
const stdout = providerError?.stdout ?? "";
|
|
410
|
+
const exitCode = providerError?.exitCode;
|
|
411
|
+
const reason = providerError?.reason;
|
|
412
|
+
const fullStderr = providerError?.rawStderr ?? stderr;
|
|
413
|
+
const fullStdout = providerError?.rawStdout ?? stdout;
|
|
414
|
+
const diagnosticMessage = reason === "non_zero_exit" ? "" : message;
|
|
415
|
+
const diagnosticStdout = [
|
|
416
|
+
...(parseOpencodeProviderOutput(fullStdout, "").errorEvents ?? []).map(
|
|
417
|
+
(event) => event.message
|
|
418
|
+
),
|
|
419
|
+
extractUnstructuredOpencodeStdout(fullStdout)
|
|
420
|
+
].join("\n");
|
|
421
|
+
const diagnostics = `${diagnosticMessage}
|
|
422
|
+
${fullStderr}
|
|
423
|
+
${diagnosticStdout}`;
|
|
424
|
+
const combined = diagnostics.toLowerCase();
|
|
425
|
+
const hostParsed = parseHostTermination(
|
|
426
|
+
hostTerminationMetadataFromUnknown(error),
|
|
427
|
+
diagnostics,
|
|
428
|
+
exitCode
|
|
429
|
+
);
|
|
430
|
+
if (hostParsed) {
|
|
431
|
+
return {
|
|
432
|
+
type: hostParsed.type,
|
|
433
|
+
retryable: hostParsed.retryable,
|
|
434
|
+
userMessage: hostParsed.userMessage,
|
|
435
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
const hasHttpStatusContext = /\b(?:http|status|response|error|code)\s*(?:[:=]|\bis\b)?\s*(401|403|429|500|502|503|504|400)\b/i.test(
|
|
439
|
+
combined
|
|
440
|
+
);
|
|
441
|
+
const hasAuthSignal = /unauthorized|unauthenticated|authentication required|login required|invalid api key|api key has been revoked|(?:api|access|authorization|account).*permission denied|permission denied.*(?:api|key|token|account)|forbidden|not authenticated|session expired|credentials invalid|could not load credentials|load credentials/i.test(
|
|
442
|
+
combined
|
|
443
|
+
);
|
|
444
|
+
const isFilesystemPermissionError = /(?:eacces|eperm|operation not permitted|read-only file system|permission denied)/i.test(
|
|
445
|
+
combined
|
|
446
|
+
) && /(?:file|directory|path|mkdir|open|write|rename|unlink|chmod|stat)\b/i.test(combined);
|
|
447
|
+
if (reason === "command_not_found" || /\bcommand not found\b/i.test(combined) || /spawn .* enoent/i.test(combined)) {
|
|
448
|
+
return {
|
|
449
|
+
type: "command_not_found",
|
|
450
|
+
retryable: false,
|
|
451
|
+
userMessage: "OpenCode CLI not found. Install with `curl -fsSL https://opencode.ai/install | bash` or `npm install -g opencode-ai`, then run `opencode auth login`.",
|
|
452
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
if ((hasAuthSignal || hasHttpStatusContext && /\b401\b|\b403\b/.test(combined)) && !isFilesystemPermissionError) {
|
|
456
|
+
return {
|
|
457
|
+
type: "auth",
|
|
458
|
+
retryable: false,
|
|
459
|
+
userMessage: "OpenCode authentication failed. Run `opencode auth login` to re-authenticate.",
|
|
460
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
const quotaExhaustion = detectQuotaExhaustion(combined);
|
|
464
|
+
if (quotaExhaustion) {
|
|
465
|
+
return {
|
|
466
|
+
type: "rate_limit",
|
|
467
|
+
retryable: false,
|
|
468
|
+
userMessage: formatQuotaExhaustedMessage("OpenCode", quotaExhaustion),
|
|
469
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
if (isRateLimitError(combined) || hasHttpStatusContext && /\b429\b/.test(combined)) {
|
|
473
|
+
return {
|
|
474
|
+
type: "rate_limit",
|
|
475
|
+
retryable: true,
|
|
476
|
+
userMessage: "OpenCode rate limit or quota exceeded. Retrying may succeed after backoff.",
|
|
477
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
if (isCapacityError(combined) || hasHttpStatusContext && /\b503\b|\b502\b|\b500\b|\b504\b/.test(combined)) {
|
|
481
|
+
return {
|
|
482
|
+
type: "capacity",
|
|
483
|
+
retryable: true,
|
|
484
|
+
userMessage: "OpenCode service temporarily unavailable. Retrying may succeed.",
|
|
485
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
if (/performing one time database migration/i.test(combined)) {
|
|
489
|
+
return {
|
|
490
|
+
type: "bootstrap",
|
|
491
|
+
retryable: true,
|
|
492
|
+
userMessage: "OpenCode is performing first-run setup. Retrying may succeed.",
|
|
493
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
if (reason === "timeout" || /execution timed out/i.test(combined)) {
|
|
497
|
+
return {
|
|
498
|
+
type: "timeout",
|
|
499
|
+
retryable: false,
|
|
500
|
+
userMessage: "OpenCode execution timed out. Consider increasing timeout or simplifying the task.",
|
|
501
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
if (/econnreset|econnrefused|enotfound|enetunreach|etimedout|eai_again|socket hang up|fetch failed|network error|getaddrinfo|connection.*timeout/i.test(
|
|
505
|
+
combined
|
|
506
|
+
)) {
|
|
507
|
+
return {
|
|
508
|
+
type: "network",
|
|
509
|
+
retryable: true,
|
|
510
|
+
userMessage: "Network error connecting to OpenCode. Retrying may succeed.",
|
|
511
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
if (MODEL_NOT_FOUND_PATTERN.test(combined)) {
|
|
515
|
+
const requestedModel = context.requestedModel?.trim() || extractRequestedModelId(message, stderr, stdout) || void 0;
|
|
516
|
+
return {
|
|
517
|
+
type: "model_not_found",
|
|
518
|
+
retryable: false,
|
|
519
|
+
userMessage: buildOpencodeModelNotFoundUserMessage({
|
|
520
|
+
requestedModel,
|
|
521
|
+
cliVersion: context.cliVersion,
|
|
522
|
+
inventoryModelIds: context.inventoryModelIds,
|
|
523
|
+
inventoryAgeMs: context.inventoryAgeMs
|
|
524
|
+
}),
|
|
525
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
if (isContextOverflowError(combined)) {
|
|
529
|
+
return {
|
|
530
|
+
type: "validation",
|
|
531
|
+
retryable: false,
|
|
532
|
+
userMessage: "OpenCode request is too large for the model context window.",
|
|
533
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
if (/invalid arguments|unknown option|unrecognized|usage:|bad request/i.test(combined) || hasHttpStatusContext && /\b400\b/.test(combined)) {
|
|
537
|
+
return {
|
|
538
|
+
type: "validation",
|
|
539
|
+
retryable: false,
|
|
540
|
+
userMessage: "Invalid request to OpenCode CLI. This may be a Build configuration bug.",
|
|
541
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
return {
|
|
545
|
+
type: "unknown",
|
|
546
|
+
retryable: isUnknownErrorRetryable(OPENCODE_UNKNOWN_ERROR_POLICY),
|
|
547
|
+
userMessage: "OpenCode execution failed with an unknown error.",
|
|
548
|
+
original: { message, stderr, stdout, exitCode, reason }
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// src/core/providers/opencode/inherited-config.ts
|
|
553
|
+
import { existsSync, readFileSync } from "fs";
|
|
554
|
+
import * as fs from "fs/promises";
|
|
555
|
+
import { homedir } from "os";
|
|
556
|
+
import * as path from "path";
|
|
557
|
+
import { applyEdits, modify, parse as parseJsonc } from "jsonc-parser";
|
|
558
|
+
import { stringify as stringifyYaml } from "yaml";
|
|
559
|
+
var OPENCODE_USER_CONFIG_FILES = ["opencode.json", "opencode.jsonc", "config.json"];
|
|
560
|
+
var OPENCODE_USER_CONFIG_DIRS = ["agent"];
|
|
561
|
+
var OPENCODE_BUILT_IN_AGENTS = /* @__PURE__ */ new Set([
|
|
562
|
+
"build",
|
|
563
|
+
"plan",
|
|
564
|
+
"general",
|
|
565
|
+
"explore",
|
|
566
|
+
"compaction",
|
|
567
|
+
"title",
|
|
568
|
+
"summary"
|
|
569
|
+
]);
|
|
570
|
+
var USER_GLOBAL_SETTINGS = ["instructions", "default_agent"];
|
|
571
|
+
async function dropUserGlobalSettings(file) {
|
|
572
|
+
let text = await fs.readFile(file, "utf8");
|
|
573
|
+
const original = text;
|
|
574
|
+
for (const key of USER_GLOBAL_SETTINGS) {
|
|
575
|
+
let edits;
|
|
576
|
+
try {
|
|
577
|
+
edits = modify(text, [key], void 0, {});
|
|
578
|
+
} catch {
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
text = applyEdits(text, edits);
|
|
582
|
+
}
|
|
583
|
+
if (text !== original) await fs.writeFile(file, text);
|
|
584
|
+
}
|
|
585
|
+
async function seedOpencodeUserConfig(sourceConfigHome, destinationConfigHome, options = {}) {
|
|
586
|
+
if (path.resolve(sourceConfigHome) === path.resolve(destinationConfigHome)) {
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
const sourceDir = path.join(sourceConfigHome, "opencode");
|
|
590
|
+
const destinationDir = path.join(destinationConfigHome, "opencode");
|
|
591
|
+
try {
|
|
592
|
+
await fs.access(sourceDir);
|
|
593
|
+
} catch {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
try {
|
|
597
|
+
await fs.mkdir(destinationDir, { recursive: true });
|
|
598
|
+
} catch (error) {
|
|
599
|
+
throw new Error(
|
|
600
|
+
`Failed to create isolated OpenCode config directory: ${error instanceof Error ? error.message : String(error)}`
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
for (const fileName of OPENCODE_USER_CONFIG_FILES) {
|
|
604
|
+
const src = path.join(sourceDir, fileName);
|
|
605
|
+
const dst = path.join(destinationDir, fileName);
|
|
606
|
+
try {
|
|
607
|
+
await fs.copyFile(src, dst);
|
|
608
|
+
if (options.excludeGlobals) await dropUserGlobalSettings(dst);
|
|
609
|
+
} catch (error) {
|
|
610
|
+
const code = error.code;
|
|
611
|
+
if (code !== "ENOENT") {
|
|
612
|
+
throw new Error(
|
|
613
|
+
`Failed to seed OpenCode ${fileName} into isolated XDG_CONFIG_HOME: ${error instanceof Error ? error.message : String(error)}`
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
for (const dirName of options.excludeGlobals ? [] : OPENCODE_USER_CONFIG_DIRS) {
|
|
619
|
+
const src = path.join(sourceDir, dirName);
|
|
620
|
+
const dst = path.join(destinationDir, dirName);
|
|
621
|
+
try {
|
|
622
|
+
await fs.cp(src, dst, {
|
|
623
|
+
recursive: true,
|
|
624
|
+
errorOnExist: false,
|
|
625
|
+
force: true,
|
|
626
|
+
dereference: true
|
|
627
|
+
});
|
|
628
|
+
} catch (error) {
|
|
629
|
+
const code = error.code;
|
|
630
|
+
if (code !== "ENOENT") {
|
|
631
|
+
throw new Error(
|
|
632
|
+
`Failed to seed OpenCode ${dirName}/ into isolated XDG_CONFIG_HOME: ${error instanceof Error ? error.message : String(error)}`
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
function opencodeAgentText(text) {
|
|
639
|
+
const fields = readFrontMatter(text);
|
|
640
|
+
const frontMatter = {
|
|
641
|
+
...typeof fields.name === "string" ? { name: fields.name } : {},
|
|
642
|
+
...typeof fields.description === "string" ? { description: fields.description } : {},
|
|
643
|
+
mode: "subagent"
|
|
644
|
+
};
|
|
645
|
+
return `---
|
|
646
|
+
${stringifyYaml(frontMatter)}---
|
|
647
|
+
${stripFrontMatter(text).trimStart()}`;
|
|
648
|
+
}
|
|
649
|
+
async function writeOpencodeAgents(configDir, set) {
|
|
650
|
+
const source = path.join(set.dir, INHERITED_AGENTS_DIRNAME);
|
|
651
|
+
const target = path.join(configDir, "agent");
|
|
652
|
+
await fs.mkdir(target, { recursive: true });
|
|
653
|
+
for (const name of await fs.readdir(source)) {
|
|
654
|
+
if (!name.endsWith(".md")) continue;
|
|
655
|
+
const text = await fs.readFile(path.join(source, name), "utf8");
|
|
656
|
+
await fs.writeFile(path.join(target, name), opencodeAgentText(text));
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
function seededConfigDefinesAgents(configDir) {
|
|
660
|
+
return OPENCODE_USER_CONFIG_FILES.some((name) => {
|
|
661
|
+
let agents;
|
|
662
|
+
try {
|
|
663
|
+
agents = parseJsonc(readFileSync(path.join(configDir, name), "utf8"))?.agent;
|
|
664
|
+
} catch {
|
|
665
|
+
return false;
|
|
666
|
+
}
|
|
667
|
+
if (!agents || typeof agents !== "object") return false;
|
|
668
|
+
return Object.entries(agents).some(
|
|
669
|
+
([agent, value]) => !OPENCODE_BUILT_IN_AGENTS.has(agent) && value?.disable !== true
|
|
670
|
+
);
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
function globalsStillLoading(options) {
|
|
674
|
+
const { callerOwned, configDir, home } = options;
|
|
675
|
+
const all = [
|
|
676
|
+
...callerOwned ? ["the caller's config folder"] : [],
|
|
677
|
+
...existsSync(path.join(home, ".opencode")) ? ["~/.opencode"] : []
|
|
678
|
+
];
|
|
679
|
+
const claudeFileLoads = callerOwned && !existsSync(path.join(configDir, "AGENTS.md")) && existsSync(path.join(home, ".claude", "CLAUDE.md"));
|
|
680
|
+
return {
|
|
681
|
+
instructions: claudeFileLoads ? [...all, "~/.claude/CLAUDE.md"] : all,
|
|
682
|
+
skills: existsSync(path.join(home, ".agents", "skills")) ? [...all, "~/.agents/skills"] : all,
|
|
683
|
+
agents: !callerOwned && seededConfigDefinesAgents(configDir) ? [...all, "the agents in the user's config"] : all
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
function coverageBeside(stillLoading) {
|
|
687
|
+
if (!stillLoading?.length) return { coverage: "full" };
|
|
688
|
+
return { coverage: "partial", detail: `OpenCode also loads ${stillLoading.join(" and ")}` };
|
|
689
|
+
}
|
|
690
|
+
function recordOpencodeSet(set, options) {
|
|
691
|
+
const left = options.excludeGlobals ? globalsStillLoading(options) : {};
|
|
692
|
+
recordInheritedKind(set.dir, "instructions", {
|
|
693
|
+
route: "instructions",
|
|
694
|
+
text: set.text,
|
|
695
|
+
...coverageBeside(left.instructions)
|
|
696
|
+
});
|
|
697
|
+
recordInheritedKind(set.dir, "steering", { route: "instructions", coverage: "full" });
|
|
698
|
+
for (const kind of ["skills", "agents"]) {
|
|
699
|
+
recordInheritedKind(
|
|
700
|
+
set.dir,
|
|
701
|
+
kind,
|
|
702
|
+
options.callerOwned ? { route: "config-dir", coverage: "none", detail: "the caller supplied the config folder" } : { route: "config-dir", ...coverageBeside(left[kind]) }
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
async function prepareOpencodeRunConfig(options) {
|
|
707
|
+
const { set, callerOwned } = options;
|
|
708
|
+
const excludeGlobals = excludesAgentGlobals(readLaunchInheritance(options.env));
|
|
709
|
+
const configDir = path.join(options.configHome, "opencode");
|
|
710
|
+
const env = {};
|
|
711
|
+
if (excludeGlobals) env.OPENCODE_DISABLE_CLAUDE_CODE_SKILLS = "1";
|
|
712
|
+
if (!callerOwned && (excludeGlobals || set?.has.skills || set?.has.agents)) {
|
|
713
|
+
await fs.mkdir(configDir, { recursive: true });
|
|
714
|
+
if (excludeGlobals) await fs.writeFile(path.join(configDir, "AGENTS.md"), "");
|
|
715
|
+
if (set?.has.skills) {
|
|
716
|
+
await fs.symlink(
|
|
717
|
+
path.join(set.dir, INHERITED_SKILLS_DIRNAME),
|
|
718
|
+
path.join(configDir, "skills"),
|
|
719
|
+
"dir"
|
|
720
|
+
);
|
|
721
|
+
}
|
|
722
|
+
if (set?.has.agents) await writeOpencodeAgents(configDir, set);
|
|
723
|
+
}
|
|
724
|
+
const instructions = [
|
|
725
|
+
...set ? [path.join(set.dir, INHERITED_INSTRUCTIONS_FILENAME)] : [],
|
|
726
|
+
...options.steeringFile ? [options.steeringFile] : []
|
|
727
|
+
];
|
|
728
|
+
if (instructions.length > 0) {
|
|
729
|
+
env.OPENCODE_CONFIG_CONTENT = buildOpencodeInstructionsConfig(instructions);
|
|
730
|
+
}
|
|
731
|
+
if (set) {
|
|
732
|
+
const home = options.env?.HOME?.trim() || homedir();
|
|
733
|
+
recordOpencodeSet(set, { excludeGlobals, callerOwned, configDir, home });
|
|
734
|
+
}
|
|
735
|
+
return env;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
// src/core/providers/opencode/log-diagnostics.ts
|
|
739
|
+
import * as fs2 from "fs/promises";
|
|
740
|
+
import * as path2 from "path";
|
|
741
|
+
var MAX_OPENCODE_LOG_ERRORS = 5;
|
|
742
|
+
var MAX_OPENCODE_LOG_BYTES = 256 * 1024;
|
|
743
|
+
var LOG_FIELD_PATTERN = /(?:^|\s)(providerID|modelID|message|error(?:\.error)?)=("(?:\\.|[^"])*"|[^\s]+)/g;
|
|
744
|
+
function decodeLogValue(raw) {
|
|
745
|
+
if (!raw.startsWith('"')) return raw;
|
|
746
|
+
try {
|
|
747
|
+
return JSON.parse(raw);
|
|
748
|
+
} catch {
|
|
749
|
+
return raw.slice(1, -1);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
function extractOpencodeLogErrors(logText) {
|
|
753
|
+
const summaries = [];
|
|
754
|
+
const seen = /* @__PURE__ */ new Set();
|
|
755
|
+
for (const line of logText.split(/\r?\n/)) {
|
|
756
|
+
if (!/\blevel=ERROR\b/.test(line)) continue;
|
|
757
|
+
const fields = /* @__PURE__ */ new Map();
|
|
758
|
+
for (const match of line.matchAll(LOG_FIELD_PATTERN)) {
|
|
759
|
+
const key = match[1];
|
|
760
|
+
const value = match[2];
|
|
761
|
+
if (key && value) fields.set(key, decodeLogValue(value));
|
|
762
|
+
}
|
|
763
|
+
const error = fields.get("error.error") ?? fields.get("error");
|
|
764
|
+
const parts = [
|
|
765
|
+
fields.get("providerID") ? `provider=${fields.get("providerID")}` : void 0,
|
|
766
|
+
fields.get("modelID") ? `model=${fields.get("modelID")}` : void 0,
|
|
767
|
+
fields.get("message") ? `message=${fields.get("message")}` : void 0,
|
|
768
|
+
error ? `error=${error}` : void 0
|
|
769
|
+
].filter(Boolean);
|
|
770
|
+
if (parts.length === 0) continue;
|
|
771
|
+
const summary = sanitizeDiagnosticOutput(`OpenCode log error: ${parts.join(" ")}`, 500);
|
|
772
|
+
if (!summary || seen.has(summary)) continue;
|
|
773
|
+
seen.add(summary);
|
|
774
|
+
summaries.push(summary);
|
|
775
|
+
}
|
|
776
|
+
return summaries.slice(-MAX_OPENCODE_LOG_ERRORS);
|
|
777
|
+
}
|
|
778
|
+
async function captureOpencodeLogCheckpoint(dataHome) {
|
|
779
|
+
const logPath = path2.join(dataHome, "opencode", "log", "opencode.log");
|
|
780
|
+
try {
|
|
781
|
+
const stat3 = await fs2.stat(logPath);
|
|
782
|
+
return { path: logPath, offset: stat3.size };
|
|
783
|
+
} catch {
|
|
784
|
+
return { path: logPath, offset: 0 };
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
async function readOpencodeLogErrorsSince(checkpoint) {
|
|
788
|
+
let handle;
|
|
789
|
+
try {
|
|
790
|
+
const stat3 = await fs2.stat(checkpoint.path);
|
|
791
|
+
if (stat3.size <= checkpoint.offset) return [];
|
|
792
|
+
const start = Math.max(checkpoint.offset, stat3.size - MAX_OPENCODE_LOG_BYTES);
|
|
793
|
+
const length = stat3.size - start;
|
|
794
|
+
const buffer = Buffer.alloc(length);
|
|
795
|
+
handle = await fs2.open(checkpoint.path, "r");
|
|
796
|
+
const { bytesRead } = await handle.read(buffer, 0, length, start);
|
|
797
|
+
return extractOpencodeLogErrors(buffer.subarray(0, bytesRead).toString("utf8"));
|
|
798
|
+
} catch {
|
|
799
|
+
return [];
|
|
800
|
+
} finally {
|
|
801
|
+
await handle?.close().catch(() => {
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
// src/core/providers/opencode/prompt-adapter.ts
|
|
807
|
+
function adaptPromptForOpencode(prompt, options = {}) {
|
|
808
|
+
const effectiveMode = resolveEffectiveMode(
|
|
809
|
+
options.promptMode ?? null,
|
|
810
|
+
options.globalWorkspaceMode ?? null,
|
|
811
|
+
"opencode"
|
|
812
|
+
);
|
|
813
|
+
if (effectiveMode === "passthrough") {
|
|
814
|
+
return {
|
|
815
|
+
original: prompt,
|
|
816
|
+
adapted: prompt,
|
|
817
|
+
adaptations: ["Passthrough prompt for native OpenCode CLI parity"],
|
|
818
|
+
promptMode: effectiveMode
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
const composed = applyWorkspaceMode(prompt, {
|
|
822
|
+
mode: effectiveMode,
|
|
823
|
+
provider: "OPENCODE",
|
|
824
|
+
executionIntent: options.executionIntent ?? "mixed",
|
|
825
|
+
targetFiles: options.files,
|
|
826
|
+
projectRoot: options.projectRoot
|
|
827
|
+
});
|
|
828
|
+
return {
|
|
829
|
+
original: prompt,
|
|
830
|
+
adapted: composed.adapted,
|
|
831
|
+
adaptations: composed.operations,
|
|
832
|
+
promptMode: composed.mode,
|
|
833
|
+
completionSignalVariant: composed.completionSignalVariant
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
function formatAdaptations(adaptation) {
|
|
837
|
+
const lines = [];
|
|
838
|
+
lines.push("[PromptAdapter] OpenCode prompt adapted");
|
|
839
|
+
lines.push(` - Mode: ${adaptation.promptMode}`);
|
|
840
|
+
lines.push(` - Original length: ${adaptation.original.length} chars`);
|
|
841
|
+
lines.push(` - Adapted length: ${adaptation.adapted.length} chars`);
|
|
842
|
+
lines.push(` - Transformations applied: ${adaptation.adaptations.length}`);
|
|
843
|
+
if (adaptation.adaptations.length > 0) {
|
|
844
|
+
lines.push(" - Applied:");
|
|
845
|
+
for (const item of adaptation.adaptations) {
|
|
846
|
+
lines.push(` - ${item}`);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
if (isDebugMode()) {
|
|
850
|
+
lines.push(` - Size delta: ${adaptation.adapted.length - adaptation.original.length} chars`);
|
|
851
|
+
}
|
|
852
|
+
return lines.join("\n");
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// src/core/providers/opencode/execution/commands.ts
|
|
856
|
+
function explicitModel(model) {
|
|
857
|
+
return model && model !== "auto" ? model : void 0;
|
|
858
|
+
}
|
|
859
|
+
function usesModelVariantSuffix(model, support) {
|
|
860
|
+
const id = explicitModel(model);
|
|
861
|
+
return !support.supportsVariant && support.supportsModelVariant === true && !!id && !id.includes("#");
|
|
862
|
+
}
|
|
863
|
+
function canEmitOpencodeVariant(model, support) {
|
|
864
|
+
return support.supportsVariant || usesModelVariantSuffix(model, support);
|
|
865
|
+
}
|
|
866
|
+
function appendOpencodeExecutionSettings(args, options) {
|
|
867
|
+
const model = explicitModel(options.model);
|
|
868
|
+
const suffix = usesModelVariantSuffix(model, options);
|
|
869
|
+
const variant = canEmitOpencodeVariant(model, options) ? options.variant : void 0;
|
|
870
|
+
if (model) args.push("--model", suffix && variant ? `${model}#${variant}` : model);
|
|
871
|
+
if (variant && !suffix) args.push("--variant", variant);
|
|
872
|
+
return prepareVariantCommand(args, model, variant);
|
|
873
|
+
}
|
|
874
|
+
function opencodeRunServerArgs(capabilities) {
|
|
875
|
+
if (isOpencode2Version(capabilities.cliVersion) && !capabilities.supportsStandalone) {
|
|
876
|
+
throw new ProviderExecutionError(
|
|
877
|
+
`${capabilities.cliVersion} does not list --standalone in \`opencode run --help\`. Build does not run OpenCode 2 through its shared background service, which runs tools outside Build's sandbox.`,
|
|
878
|
+
{ retryable: false, reason: "unsupported_option", prelaunch: true, providerName: metadata.id }
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
if (!capabilities.supportsStandalone) return [];
|
|
882
|
+
return capabilities.supportsAuto ? ["--standalone", "--auto"] : ["--standalone"];
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// src/core/providers/opencode/execution/error-events.ts
|
|
886
|
+
function summarizeOpencodeErrorEvents(errorEvents) {
|
|
887
|
+
return errorEvents.slice(0, 3).map((event) => {
|
|
888
|
+
const type = event.errorType ? ` (${event.errorType})` : "";
|
|
889
|
+
const retryable = event.retryable === false ? "hard" : "retryable/degraded";
|
|
890
|
+
return `OpenCode error event${type} [${retryable}]: ${event.message}`;
|
|
891
|
+
}).join("\n");
|
|
892
|
+
}
|
|
893
|
+
function leadWithOpencodeErrorEvents(error) {
|
|
894
|
+
if (!(error instanceof Error)) return;
|
|
895
|
+
const carrier = error;
|
|
896
|
+
const stdout = typeof carrier.rawStdout === "string" ? carrier.rawStdout : carrier.stdout;
|
|
897
|
+
if (typeof stdout !== "string") return;
|
|
898
|
+
const errorEvents = parseOpencodeProviderOutput(stdout, "").errorEvents;
|
|
899
|
+
if (!errorEvents?.length) return;
|
|
900
|
+
const summary = sanitizeDiagnosticOutput(
|
|
901
|
+
summarizeOpencodeErrorEvents(errorEvents),
|
|
902
|
+
PUBLIC_DIAGNOSTICS_STRING_MAX
|
|
903
|
+
);
|
|
904
|
+
if (summary) error.message = `${summary}
|
|
905
|
+
${error.message}`;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// src/core/providers/opencode/execution/runner.ts
|
|
909
|
+
var OPENCODE_CIRCUIT_BREAKER_OPTIONS = DEFAULT_PROVIDER_CIRCUIT_BREAKER_OPTIONS;
|
|
910
|
+
function readOpencodeRuntimeEnv(env, spec) {
|
|
911
|
+
const envValue = env?.[spec.name]?.trim();
|
|
912
|
+
if (envValue) {
|
|
913
|
+
return envValue;
|
|
914
|
+
}
|
|
915
|
+
const contextValue = getExecutionContext().envOverrides[spec.name]?.trim();
|
|
916
|
+
if (contextValue) {
|
|
917
|
+
return contextValue;
|
|
918
|
+
}
|
|
919
|
+
return readRawEnv(spec)?.trim();
|
|
920
|
+
}
|
|
921
|
+
function isOpencodeRuntimeEnvEnabled(env, spec) {
|
|
922
|
+
const raw = readOpencodeRuntimeEnv(env, spec);
|
|
923
|
+
if (raw === void 0) {
|
|
924
|
+
return spec.default ?? false;
|
|
925
|
+
}
|
|
926
|
+
const normalized = raw.toLowerCase();
|
|
927
|
+
if (["1", "true", "yes", "on"].includes(normalized)) return true;
|
|
928
|
+
if (["0", "false", "no", "off"].includes(normalized)) return false;
|
|
929
|
+
throw new Error(
|
|
930
|
+
`Invalid boolean value for ${spec.name}: "${raw}". Expected one of: 1, true, yes, on, 0, false, no, off`
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
function resolveOpencodeAttemptTimeoutMs(timeoutMs, deadlineMs) {
|
|
934
|
+
return clampAttemptTimeoutToDeadline(
|
|
935
|
+
timeoutMs,
|
|
936
|
+
deadlineMs,
|
|
937
|
+
() => new ProviderExecutionError("OpenCode deadline exceeded before attempt start.", {
|
|
938
|
+
providerName: metadata.id,
|
|
939
|
+
retryable: false,
|
|
940
|
+
reason: "deadline_exhausted"
|
|
941
|
+
})
|
|
942
|
+
);
|
|
943
|
+
}
|
|
944
|
+
function resolveOpencodeIdleTimeout(requested, providerDefault, allowAboveProviderDefault) {
|
|
945
|
+
if (requested == null) return providerDefault;
|
|
946
|
+
if (providerDefault == null || allowAboveProviderDefault) return requested;
|
|
947
|
+
return Math.min(requested, providerDefault);
|
|
948
|
+
}
|
|
949
|
+
function formatResolvedOpencodeModel(providerId, modelId) {
|
|
950
|
+
if (typeof modelId !== "string" || modelId.trim().length === 0) {
|
|
951
|
+
return void 0;
|
|
952
|
+
}
|
|
953
|
+
const trimmedModel = modelId.trim();
|
|
954
|
+
if (trimmedModel.includes("/")) {
|
|
955
|
+
return trimmedModel;
|
|
956
|
+
}
|
|
957
|
+
return typeof providerId === "string" && providerId.trim().length > 0 ? `${providerId.trim()}/${trimmedModel}` : trimmedModel;
|
|
958
|
+
}
|
|
959
|
+
function extractUsefulOpencodeRawOutput(stdout, stderr) {
|
|
960
|
+
return stripAnsiSequences(`${stdout}
|
|
961
|
+
${stderr}`).split(/\r?\n/).map((line) => line.trim()).filter((line) => {
|
|
962
|
+
if (!line) return false;
|
|
963
|
+
if (line === "Performing one time database migration, may take a few minutes...") {
|
|
964
|
+
return false;
|
|
965
|
+
}
|
|
966
|
+
if (line === "sqlite-migration:done") return false;
|
|
967
|
+
if (line === "Database migration complete.") return false;
|
|
968
|
+
if (/^>\s+build\s+·\s+/i.test(line)) return false;
|
|
969
|
+
return true;
|
|
970
|
+
}).join("\n").trim();
|
|
971
|
+
}
|
|
972
|
+
function hasOpencodeReportedToolFailure(output) {
|
|
973
|
+
return output.split(/\r?\n/).some((line) => /^\u2717\s+.+\s+failed\b/i.test(line.trim()));
|
|
974
|
+
}
|
|
975
|
+
function resolveUserOpencodeDataHome() {
|
|
976
|
+
return process.env.XDG_DATA_HOME?.trim() || path3.join(homedir2(), ".local", "share");
|
|
977
|
+
}
|
|
978
|
+
function resolveUserOpencodeConfigHome() {
|
|
979
|
+
return process.env.XDG_CONFIG_HOME?.trim() || path3.join(homedir2(), ".config");
|
|
980
|
+
}
|
|
981
|
+
async function seedOpencodeCredentials(sourceDataHome, destinationDataHome) {
|
|
982
|
+
if (path3.resolve(sourceDataHome) === path3.resolve(destinationDataHome)) {
|
|
983
|
+
return void 0;
|
|
984
|
+
}
|
|
985
|
+
const sourceAuthPath = path3.join(sourceDataHome, "opencode", "auth.json");
|
|
986
|
+
const destinationDir = path3.join(destinationDataHome, "opencode");
|
|
987
|
+
const destinationAuthPath = path3.join(destinationDir, "auth.json");
|
|
988
|
+
try {
|
|
989
|
+
await fs3.mkdir(destinationDir, { recursive: true });
|
|
990
|
+
await fs3.copyFile(sourceAuthPath, destinationAuthPath);
|
|
991
|
+
return await recordAuthCopySeed(sourceAuthPath, destinationAuthPath);
|
|
992
|
+
} catch (error) {
|
|
993
|
+
const code = error.code;
|
|
994
|
+
if (code !== "ENOENT") {
|
|
995
|
+
debugLog(
|
|
996
|
+
`[OpenCode] Failed to seed auth.json into isolated XDG_DATA_HOME: ${error instanceof Error ? error.message : String(error)}`
|
|
997
|
+
);
|
|
998
|
+
}
|
|
999
|
+
return void 0;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
async function resolveOpencodeDataHome(env) {
|
|
1003
|
+
const caller = resolveCallerOwnedPath(
|
|
1004
|
+
env?.XDG_DATA_HOME,
|
|
1005
|
+
readOpencodeRuntimeEnv(env, BUILD_OPENCODE_XDG_DATA_HOME)
|
|
1006
|
+
);
|
|
1007
|
+
if (caller) return { dataHome: caller.path };
|
|
1008
|
+
const dataHome = await mkBuildTempDir("opencode-xdg");
|
|
1009
|
+
const authSeed = await seedOpencodeCredentials(resolveUserOpencodeDataHome(), dataHome);
|
|
1010
|
+
const owned = markRunOwnedRoot(dataHome);
|
|
1011
|
+
return {
|
|
1012
|
+
dataHome,
|
|
1013
|
+
cleanup: async () => {
|
|
1014
|
+
if (authSeed) await writeBackRefreshedAuth(authSeed);
|
|
1015
|
+
await removeAndVerifyRunOwnedRoot(owned, { role: "opencode-xdg-data" });
|
|
1016
|
+
}
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
async function resolveOpencodeStateHome(env) {
|
|
1020
|
+
const caller = resolveCallerOwnedPath(
|
|
1021
|
+
env?.XDG_STATE_HOME,
|
|
1022
|
+
readOpencodeRuntimeEnv(env, BUILD_OPENCODE_XDG_STATE_HOME)
|
|
1023
|
+
);
|
|
1024
|
+
if (caller) return { stateHome: caller.path };
|
|
1025
|
+
const stateHome = await mkBuildTempDir("opencode-state");
|
|
1026
|
+
const owned = markRunOwnedRoot(stateHome);
|
|
1027
|
+
return {
|
|
1028
|
+
stateHome,
|
|
1029
|
+
cleanup: async () => {
|
|
1030
|
+
await removeAndVerifyRunOwnedRoot(owned, { role: "opencode-xdg-state" });
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
async function resolveOpencodeConfigHome(env) {
|
|
1035
|
+
const caller = resolveCallerOwnedPath(
|
|
1036
|
+
env?.XDG_CONFIG_HOME,
|
|
1037
|
+
readOpencodeRuntimeEnv(env, BUILD_OPENCODE_XDG_CONFIG_HOME)
|
|
1038
|
+
);
|
|
1039
|
+
if (caller) return { configHome: caller.path, callerOwned: true };
|
|
1040
|
+
const configHome = await mkBuildTempDir("opencode-config");
|
|
1041
|
+
const owned = markRunOwnedRoot(configHome);
|
|
1042
|
+
try {
|
|
1043
|
+
await seedOpencodeUserConfig(resolveUserOpencodeConfigHome(), configHome, {
|
|
1044
|
+
excludeGlobals: excludesAgentGlobals(readLaunchInheritance(env))
|
|
1045
|
+
});
|
|
1046
|
+
} catch (error) {
|
|
1047
|
+
try {
|
|
1048
|
+
await removeAndVerifyRunOwnedRoot(owned, { role: "opencode-xdg-config-seed-abort" });
|
|
1049
|
+
} catch (cleanupError) {
|
|
1050
|
+
if (cleanupError instanceof CredentialResidueError) {
|
|
1051
|
+
throw contextualizeCredentialCleanupError(
|
|
1052
|
+
cleanupError,
|
|
1053
|
+
error,
|
|
1054
|
+
"opencode-xdg-config-seed-abort"
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
throw cleanupError;
|
|
1058
|
+
}
|
|
1059
|
+
throw error;
|
|
1060
|
+
}
|
|
1061
|
+
return {
|
|
1062
|
+
configHome,
|
|
1063
|
+
cleanup: async () => {
|
|
1064
|
+
await removeAndVerifyRunOwnedRoot(owned, { role: "opencode-xdg-config" });
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
async function resolveOpencodeCacheHome(env) {
|
|
1069
|
+
const caller = resolveCallerOwnedPath(
|
|
1070
|
+
env?.XDG_CACHE_HOME,
|
|
1071
|
+
readOpencodeRuntimeEnv(env, BUILD_OPENCODE_XDG_CACHE_HOME)
|
|
1072
|
+
);
|
|
1073
|
+
if (caller) return { cacheHome: caller.path };
|
|
1074
|
+
const cacheHome = await mkBuildTempDir("opencode-cache");
|
|
1075
|
+
const owned = markRunOwnedRoot(cacheHome);
|
|
1076
|
+
return {
|
|
1077
|
+
cacheHome,
|
|
1078
|
+
cleanup: async () => {
|
|
1079
|
+
await removeAndVerifyRunOwnedRoot(owned, { role: "opencode-xdg-cache" });
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
async function hasOpenrouterCredential(childEnv, dataHome) {
|
|
1084
|
+
if (childEnv.OPENROUTER_API_KEY?.trim() || childEnv.OPENROUTER_KEY?.trim()) {
|
|
1085
|
+
return true;
|
|
1086
|
+
}
|
|
1087
|
+
try {
|
|
1088
|
+
const authJson = await fs3.readFile(path3.join(dataHome, "opencode", "auth.json"), "utf8");
|
|
1089
|
+
return /"openrouter"\s*:/.test(authJson);
|
|
1090
|
+
} catch {
|
|
1091
|
+
return false;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
async function resolveOpencodeSessionFromDb(workingDir, dataHome) {
|
|
1095
|
+
try {
|
|
1096
|
+
const dbPath = path3.join(dataHome, "opencode", "opencode.db");
|
|
1097
|
+
const { default: Database } = await import("better-sqlite3");
|
|
1098
|
+
const db = new Database(dbPath, { readonly: true, fileMustExist: true });
|
|
1099
|
+
try {
|
|
1100
|
+
const session = db.prepare(
|
|
1101
|
+
`
|
|
1102
|
+
SELECT id
|
|
1103
|
+
FROM session
|
|
1104
|
+
WHERE directory = ?
|
|
1105
|
+
ORDER BY time_updated DESC
|
|
1106
|
+
LIMIT 1
|
|
1107
|
+
`
|
|
1108
|
+
).get(workingDir);
|
|
1109
|
+
if (typeof session?.id !== "string") {
|
|
1110
|
+
return {};
|
|
1111
|
+
}
|
|
1112
|
+
const modelRow = db.prepare(
|
|
1113
|
+
`
|
|
1114
|
+
SELECT
|
|
1115
|
+
json_extract(data, '$.providerID') AS providerID,
|
|
1116
|
+
json_extract(data, '$.modelID') AS modelID,
|
|
1117
|
+
json_extract(data, '$.model') AS model
|
|
1118
|
+
FROM message
|
|
1119
|
+
WHERE session_id = ?
|
|
1120
|
+
AND json_extract(data, '$.role') = 'assistant'
|
|
1121
|
+
AND (
|
|
1122
|
+
json_extract(data, '$.modelID') IS NOT NULL
|
|
1123
|
+
OR json_extract(data, '$.model') IS NOT NULL
|
|
1124
|
+
)
|
|
1125
|
+
ORDER BY time_created DESC
|
|
1126
|
+
LIMIT 1
|
|
1127
|
+
`
|
|
1128
|
+
).get(session.id);
|
|
1129
|
+
const sessionProviderId = typeof modelRow?.providerID === "string" ? modelRow.providerID.trim() : "";
|
|
1130
|
+
return {
|
|
1131
|
+
sessionId: session.id,
|
|
1132
|
+
...sessionProviderId ? { servedRoute: sessionProviderId } : {},
|
|
1133
|
+
resolvedModel: formatResolvedOpencodeModel(modelRow?.providerID, modelRow?.modelID) ?? formatResolvedOpencodeModel(void 0, modelRow?.model)
|
|
1134
|
+
};
|
|
1135
|
+
} finally {
|
|
1136
|
+
db.close();
|
|
1137
|
+
}
|
|
1138
|
+
} catch {
|
|
1139
|
+
return {};
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
async function resolveAttachedFilePaths(workingDir, files, attachments) {
|
|
1143
|
+
const candidates = [...files ?? [], ...attachments ?? []].map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
1144
|
+
const deduped = /* @__PURE__ */ new Set();
|
|
1145
|
+
const root = path3.resolve(workingDir);
|
|
1146
|
+
for (const candidate of candidates) {
|
|
1147
|
+
const resolved = path3.resolve(root, candidate);
|
|
1148
|
+
if (resolved !== root && !resolved.startsWith(root + path3.sep)) {
|
|
1149
|
+
throw new Error(`OpenCode attachment must be within working directory: ${candidate}`);
|
|
1150
|
+
}
|
|
1151
|
+
try {
|
|
1152
|
+
if (!(await fs3.stat(resolved)).isFile()) {
|
|
1153
|
+
debugLog(`[OpenCode] Skipping non-file attachment path: ${candidate}`);
|
|
1154
|
+
continue;
|
|
1155
|
+
}
|
|
1156
|
+
deduped.add(resolved);
|
|
1157
|
+
} catch {
|
|
1158
|
+
debugLog(`[OpenCode] Skipping missing attachment path: ${candidate}`);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
return [...deduped];
|
|
1162
|
+
}
|
|
1163
|
+
async function writePromptAttachment(prompt) {
|
|
1164
|
+
const dir = await mkBuildTempDir("opencode-prompt");
|
|
1165
|
+
const filePath = path3.join(dir, "prompt.md");
|
|
1166
|
+
try {
|
|
1167
|
+
await fs3.writeFile(filePath, prompt, "utf8");
|
|
1168
|
+
} catch (error) {
|
|
1169
|
+
await fs3.rm(dir, { recursive: true, force: true }).catch((cleanupError) => {
|
|
1170
|
+
debugLog(
|
|
1171
|
+
`[OpenCode] Failed to clean prompt attachment ${dir} after write failure: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`
|
|
1172
|
+
);
|
|
1173
|
+
});
|
|
1174
|
+
throw error;
|
|
1175
|
+
}
|
|
1176
|
+
return {
|
|
1177
|
+
filePath,
|
|
1178
|
+
cleanup: async () => {
|
|
1179
|
+
try {
|
|
1180
|
+
await fs3.rm(dir, { recursive: true, force: true });
|
|
1181
|
+
} catch (error) {
|
|
1182
|
+
debugLog(
|
|
1183
|
+
`[OpenCode] Failed to clean prompt attachment ${dir}: ${error instanceof Error ? error.message : String(error)}`
|
|
1184
|
+
);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
async function clearMacProvenanceAttributes(filePaths) {
|
|
1190
|
+
if (process.platform !== "darwin" || filePaths.length === 0) {
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1193
|
+
try {
|
|
1194
|
+
const { execa } = await import("execa");
|
|
1195
|
+
for (const filePath of filePaths) {
|
|
1196
|
+
try {
|
|
1197
|
+
await execa("xattr", ["-d", "com.apple.provenance", filePath], {
|
|
1198
|
+
reject: false,
|
|
1199
|
+
timeout: 5e3
|
|
1200
|
+
});
|
|
1201
|
+
} catch (error) {
|
|
1202
|
+
debugLog(
|
|
1203
|
+
`[OpenCode] Failed to clear com.apple.provenance from ${filePath}: ${error instanceof Error ? error.message : String(error)}`
|
|
1204
|
+
);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
} catch (error) {
|
|
1208
|
+
debugLog(
|
|
1209
|
+
`[OpenCode] Unable to prepare macOS provenance cleanup: ${error instanceof Error ? error.message : String(error)}`
|
|
1210
|
+
);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
function attachOpencodeInvocationDiagnostics(error, diagnostics) {
|
|
1214
|
+
if (!error || typeof error !== "object") {
|
|
1215
|
+
return;
|
|
1216
|
+
}
|
|
1217
|
+
const diagnosticError = error;
|
|
1218
|
+
diagnosticError.commandPath ??= diagnostics.commandPath;
|
|
1219
|
+
diagnosticError.argvRedacted ??= diagnostics.argvRedacted;
|
|
1220
|
+
diagnosticError.stdoutTail ??= providerOutputTail(diagnostics.stdout ?? "");
|
|
1221
|
+
diagnosticError.stderrTail ??= providerOutputTail(diagnostics.stderr ?? "");
|
|
1222
|
+
diagnosticError.providerDiagnostics ??= diagnostics.providerDiagnostics;
|
|
1223
|
+
diagnosticError.filesModified ??= diagnostics.filesModified;
|
|
1224
|
+
}
|
|
1225
|
+
async function runOpencodeNative(options) {
|
|
1226
|
+
const {
|
|
1227
|
+
prompt,
|
|
1228
|
+
workingDir,
|
|
1229
|
+
env,
|
|
1230
|
+
onData,
|
|
1231
|
+
onErrorData,
|
|
1232
|
+
model,
|
|
1233
|
+
modelReasoningEffort,
|
|
1234
|
+
generationSettings,
|
|
1235
|
+
files,
|
|
1236
|
+
attachments,
|
|
1237
|
+
abortSignal,
|
|
1238
|
+
executionIntent
|
|
1239
|
+
} = options;
|
|
1240
|
+
await acquireRateLimitToken(metadata.id, model);
|
|
1241
|
+
const baselineHead = await getGitHead(workingDir);
|
|
1242
|
+
const baselineSnapshot = await captureGitBaseline(workingDir).catch(() => null);
|
|
1243
|
+
const timeout = resolveProviderTimeoutMs(metadata.id, options.timeout);
|
|
1244
|
+
const { command, prefixArgs } = resolveProviderCliCommand(metadata.id);
|
|
1245
|
+
const runtimeQuirks = getProviderRuntimeQuirks(metadata.id);
|
|
1246
|
+
const capabilities = await getOpencodeRunCapabilities(env);
|
|
1247
|
+
const serverArgs = opencodeRunServerArgs(capabilities);
|
|
1248
|
+
const capabilityWarnings = [];
|
|
1249
|
+
const inventoryCacheDir = resolveOpencodeModelsCacheDir({
|
|
1250
|
+
// Refresh and other readers use the canonical execution-context project,
|
|
1251
|
+
// which remains stable when this launch executes in a variant worktree.
|
|
1252
|
+
env: { ...process.env, ...getExecutionContext().envOverrides, ...env }
|
|
1253
|
+
});
|
|
1254
|
+
let effectiveModel = model;
|
|
1255
|
+
if (model && options.modelExecutionPolicy !== "exact") {
|
|
1256
|
+
const cachedModels = getCachedOpencodeModelIds(inventoryCacheDir);
|
|
1257
|
+
const canonicalizedModel = canonicalizeOpencodeModelId(model, cachedModels);
|
|
1258
|
+
effectiveModel = canonicalizedModel;
|
|
1259
|
+
if (cachedModels.length > 0 && !cachedModels.includes(canonicalizedModel)) {
|
|
1260
|
+
const suggestion = `openrouter/${model}`;
|
|
1261
|
+
const suggestionHint = model.split("/").length === 2 && cachedModels.includes(suggestion) ? ` Did you mean "${suggestion}"?` : "";
|
|
1262
|
+
const warning = `[OpenCode] Model "${model}" not found in cached model list.${suggestionHint}`;
|
|
1263
|
+
capabilityWarnings.push(warning);
|
|
1264
|
+
debugLog(warning);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
const requestedWorkspaceMode = options.workspaceMode ?? options.promptMode;
|
|
1268
|
+
const adaptation = adaptPromptForOpencode(prompt, {
|
|
1269
|
+
executionIntent: executionIntent ?? "mixed",
|
|
1270
|
+
files,
|
|
1271
|
+
promptMode: requestedWorkspaceMode,
|
|
1272
|
+
projectRoot: workingDir
|
|
1273
|
+
});
|
|
1274
|
+
let adaptedPrompt = adaptation.adapted;
|
|
1275
|
+
debugLog(formatAdaptations(adaptation));
|
|
1276
|
+
const steeringFileEnabled = isOpencodeRuntimeEnvEnabled(env, BUILD_OPENCODE_TRANSIENT_AGENT);
|
|
1277
|
+
const inheritedSet = readInheritedSet(env);
|
|
1278
|
+
const opencodeSteeringPayload = adaptation.promptMode !== "passthrough" || steeringFileEnabled ? buildOpencodeSteering({
|
|
1279
|
+
guidance: {
|
|
1280
|
+
recentContext: options.recentContext,
|
|
1281
|
+
subagents: Boolean(options.delegatedSubagents)
|
|
1282
|
+
},
|
|
1283
|
+
env,
|
|
1284
|
+
omitInstructionSet: inheritedSet !== void 0
|
|
1285
|
+
}) : void 0;
|
|
1286
|
+
const explicitEffort = normalizeOpencodeReasoningEffort(modelReasoningEffort);
|
|
1287
|
+
const heuristicEffort = explicitEffort ? void 0 : normalizeOpencodeReasoningEffort(generationSettings?.reasoningEffort);
|
|
1288
|
+
const effortResolution = explicitEffort ? resolveOpencodeReasoningEffort(explicitEffort, true, effectiveModel) : heuristicEffort ? resolveOpencodeReasoningEffort(heuristicEffort, false, effectiveModel) : void 0;
|
|
1289
|
+
if (effortResolution) {
|
|
1290
|
+
logReasoningEffortResolution(effortResolution, "opencode");
|
|
1291
|
+
}
|
|
1292
|
+
const nativeVariant = opencodeNativeVariant(options.variantInvocation);
|
|
1293
|
+
const effectiveVariant = nativeVariant ?? effortResolution?.variantMapping;
|
|
1294
|
+
const attachedFiles = await resolveAttachedFilePaths(workingDir, files, attachments);
|
|
1295
|
+
await clearMacProvenanceAttributes(attachedFiles);
|
|
1296
|
+
requireActiveSandboxBoundary(
|
|
1297
|
+
"OpenCode",
|
|
1298
|
+
"OpenCode automation bypass (OPENCODE_PERMISSION allow-all)",
|
|
1299
|
+
"opencode"
|
|
1300
|
+
);
|
|
1301
|
+
let opencodeDataHome;
|
|
1302
|
+
let opencodeStateHome;
|
|
1303
|
+
let opencodeConfigHome;
|
|
1304
|
+
let opencodeCacheHome;
|
|
1305
|
+
let promptAttachmentCleanup;
|
|
1306
|
+
let steeringInstructions;
|
|
1307
|
+
let attachmentInstruction;
|
|
1308
|
+
let runError;
|
|
1309
|
+
try {
|
|
1310
|
+
opencodeDataHome = await resolveOpencodeDataHome(env);
|
|
1311
|
+
opencodeStateHome = await resolveOpencodeStateHome(env);
|
|
1312
|
+
opencodeConfigHome = await resolveOpencodeConfigHome(env);
|
|
1313
|
+
opencodeCacheHome = await resolveOpencodeCacheHome(env);
|
|
1314
|
+
if (opencodeSteeringPayload && steeringFileEnabled) {
|
|
1315
|
+
try {
|
|
1316
|
+
steeringInstructions = await stageOpencodeSteeringInstructions(opencodeSteeringPayload);
|
|
1317
|
+
} catch (error) {
|
|
1318
|
+
debugLog(
|
|
1319
|
+
`[OpenCode] Steering instructions staging failed; preamble fallback is used only outside passthrough mode. Error: ${error instanceof Error ? error.message : String(error)}`
|
|
1320
|
+
);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
const steeringText = steeringInstructions && opencodeSteeringPayload?.systemChannel;
|
|
1324
|
+
if (opencodeSteeringPayload && !steeringText && adaptation.promptMode !== "passthrough") {
|
|
1325
|
+
adaptedPrompt = applyOpencodePreambleFallback(opencodeSteeringPayload, adaptedPrompt);
|
|
1326
|
+
}
|
|
1327
|
+
debugLog(
|
|
1328
|
+
`[OpenCode] Runtime directories: TMPDIR=${env?.TMPDIR ?? process.env.TMPDIR ?? tmpdir2()} XDG_STATE_HOME=${opencodeStateHome.stateHome}`
|
|
1329
|
+
);
|
|
1330
|
+
const headlessEnv = {
|
|
1331
|
+
OPENCODE_PERMISSION: JSON.stringify({ "*": { "*": "allow" } }),
|
|
1332
|
+
XDG_CACHE_HOME: opencodeCacheHome.cacheHome,
|
|
1333
|
+
XDG_CONFIG_HOME: opencodeConfigHome.configHome,
|
|
1334
|
+
XDG_DATA_HOME: opencodeDataHome.dataHome,
|
|
1335
|
+
XDG_STATE_HOME: opencodeStateHome.stateHome,
|
|
1336
|
+
// The instructions list and what the per-run config folder carries (inherited-config.ts).
|
|
1337
|
+
...await prepareOpencodeRunConfig({
|
|
1338
|
+
env,
|
|
1339
|
+
set: inheritedSet,
|
|
1340
|
+
configHome: opencodeConfigHome.configHome,
|
|
1341
|
+
callerOwned: opencodeConfigHome.callerOwned === true,
|
|
1342
|
+
steeringFile: steeringInstructions?.filePath
|
|
1343
|
+
})
|
|
1344
|
+
};
|
|
1345
|
+
const childEnv = buildProviderExecutionEnv("opencode", { ...env ?? {}, ...headlessEnv });
|
|
1346
|
+
const opencodeLogCheckpoint = await captureOpencodeLogCheckpoint(opencodeDataHome.dataHome);
|
|
1347
|
+
const opencodeWorkspaceStateDir = path3.join(workingDir, ".opencode");
|
|
1348
|
+
const opencodeRuntimeWritePaths = [
|
|
1349
|
+
opencodeCacheHome.cacheHome,
|
|
1350
|
+
opencodeConfigHome.configHome,
|
|
1351
|
+
opencodeDataHome.dataHome,
|
|
1352
|
+
opencodeStateHome.stateHome,
|
|
1353
|
+
opencodeWorkspaceStateDir
|
|
1354
|
+
];
|
|
1355
|
+
requireActivePolicyBoundary(
|
|
1356
|
+
"OpenCode",
|
|
1357
|
+
"OpenCode automation bypass (OPENCODE_PERMISSION allow-all)",
|
|
1358
|
+
"opencode",
|
|
1359
|
+
{ env: childEnv }
|
|
1360
|
+
);
|
|
1361
|
+
if (effectiveModel?.toLowerCase().startsWith("openrouter/") && !await hasOpenrouterCredential(childEnv, opencodeDataHome.dataHome)) {
|
|
1362
|
+
const stderr = "OpenCode OpenRouter credentials missing. Set OPENROUTER_API_KEY or run `opencode auth login` before using OpenRouter models.";
|
|
1363
|
+
return {
|
|
1364
|
+
stdout: "",
|
|
1365
|
+
stderr,
|
|
1366
|
+
exitCode: 1,
|
|
1367
|
+
commandPath: command,
|
|
1368
|
+
argvRedacted: redactProviderArgv([...prefixArgs, "run"]),
|
|
1369
|
+
stdoutTail: "",
|
|
1370
|
+
stderrTail: providerOutputTail(stderr),
|
|
1371
|
+
workspaceMode: options.workspaceMode ?? options.promptMode,
|
|
1372
|
+
workspaceModeRequested: options.workspaceMode ?? options.promptMode,
|
|
1373
|
+
promptMode: options.workspaceMode ?? options.promptMode,
|
|
1374
|
+
promptModeRequested: options.workspaceMode ?? options.promptMode
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
const args = [...prefixArgs, "run", ...serverArgs];
|
|
1378
|
+
if (capabilities.supportsPure) {
|
|
1379
|
+
args.push("--pure");
|
|
1380
|
+
}
|
|
1381
|
+
if (capabilities.supportsDir) {
|
|
1382
|
+
args.push("--dir", workingDir);
|
|
1383
|
+
}
|
|
1384
|
+
if (capabilities.supportsFormatJson) {
|
|
1385
|
+
args.push("--format", "json");
|
|
1386
|
+
}
|
|
1387
|
+
if (capabilities.supportsTitle) {
|
|
1388
|
+
args.push("--title", `Build (${metadata.id}) - ${path3.basename(workingDir)}`);
|
|
1389
|
+
}
|
|
1390
|
+
if (capabilities.supportsDangerouslySkipPermissions) {
|
|
1391
|
+
args.push("--dangerously-skip-permissions");
|
|
1392
|
+
}
|
|
1393
|
+
appendOpencodeExecutionSettings(args, {
|
|
1394
|
+
model: effectiveModel,
|
|
1395
|
+
variant: effectiveVariant,
|
|
1396
|
+
supportsVariant: capabilities.supportsVariant,
|
|
1397
|
+
supportsModelVariant: capabilities.supportsModelVariant
|
|
1398
|
+
});
|
|
1399
|
+
if (effectiveVariant && !canEmitOpencodeVariant(effectiveModel, capabilities)) {
|
|
1400
|
+
if ((explicitEffort ?? nativeVariant) && capabilities.helpProbeConfirmed) {
|
|
1401
|
+
throw new ProviderExecutionError(
|
|
1402
|
+
capabilities.supportsModelVariant ? `OpenCode reasoning effort "${explicitEffort ?? nativeVariant}" needs an explicit model to carry it as provider/model#variant.` : `OpenCode reasoning effort "${explicitEffort ?? nativeVariant}" requires --variant, but this OpenCode CLI version does not support --variant.`,
|
|
1403
|
+
{
|
|
1404
|
+
retryable: false,
|
|
1405
|
+
reason: "unsupported_reasoning_effort",
|
|
1406
|
+
providerName: metadata.id
|
|
1407
|
+
}
|
|
1408
|
+
);
|
|
1409
|
+
} else if (isDebugMode()) {
|
|
1410
|
+
const warning = `[OpenCode] Variant "${effectiveVariant}" requested but this CLI version does not support --variant.`;
|
|
1411
|
+
capabilityWarnings.push(warning);
|
|
1412
|
+
debugLog(warning);
|
|
1413
|
+
} else {
|
|
1414
|
+
capabilityWarnings.push(
|
|
1415
|
+
`[OpenCode] Variant "${effectiveVariant}" requested but this CLI version does not support --variant.`
|
|
1416
|
+
);
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
if (attachedFiles.length > 0) {
|
|
1420
|
+
if (capabilities.supportsFile) {
|
|
1421
|
+
for (const filePath of attachedFiles) {
|
|
1422
|
+
args.push("--file", filePath);
|
|
1423
|
+
}
|
|
1424
|
+
} else if (isDebugMode()) {
|
|
1425
|
+
debugLog(
|
|
1426
|
+
`[OpenCode] ${attachedFiles.length} attachment(s) were provided but this CLI version does not support --file.`
|
|
1427
|
+
);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
if (capabilities.supportsFile) {
|
|
1431
|
+
const promptAttachment = await writePromptAttachment(adaptedPrompt);
|
|
1432
|
+
promptAttachmentCleanup = promptAttachment.cleanup;
|
|
1433
|
+
args.push("--file", promptAttachment.filePath);
|
|
1434
|
+
attachmentInstruction = "Read the attached prompt file and complete the task exactly as specified.";
|
|
1435
|
+
args.push("--", attachmentInstruction);
|
|
1436
|
+
} else {
|
|
1437
|
+
args.push("--");
|
|
1438
|
+
args.push(adaptedPrompt);
|
|
1439
|
+
}
|
|
1440
|
+
const fastRetry = process.env.NODE_ENV === "test" || process.env.VITEST === "true" || readEnv(BUILD_TEST_FAST_RETRY).value;
|
|
1441
|
+
const callerRetryBudget = options.retryBudget;
|
|
1442
|
+
const retryBudget = callerRetryBudget ?? new RetryBudget({ maxTotalAttempts: 3 });
|
|
1443
|
+
const callerConstrainedToOneAttempt = callerRetryBudget !== void 0 && callerRetryBudget.remaining <= 1;
|
|
1444
|
+
const maxAttempts = callerConstrainedToOneAttempt ? 1 : 3;
|
|
1445
|
+
const outerRetryBudget = callerConstrainedToOneAttempt ? void 0 : retryBudget;
|
|
1446
|
+
const bootstrapRetryBudget = callerConstrainedToOneAttempt ? callerRetryBudget : void 0;
|
|
1447
|
+
const bootstrapMaxAttempts = callerConstrainedToOneAttempt ? 1 : 3;
|
|
1448
|
+
const invocationTimeRequestSentMs = Date.now();
|
|
1449
|
+
let invocationTimeFirstTokenMs = null;
|
|
1450
|
+
const opencodeLivenessStartedAtMs = invocationTimeRequestSentMs;
|
|
1451
|
+
const opencodeLivenessPhasesMs = {
|
|
1452
|
+
// Anchor phase for downstream relative timings; not a measured launch duration.
|
|
1453
|
+
cliLaunch: 0
|
|
1454
|
+
};
|
|
1455
|
+
const argvRedacted = redactProviderArgv(args, { promptValues: [adaptedPrompt] });
|
|
1456
|
+
let retryResult;
|
|
1457
|
+
notifySubmittedPrompt(options.onSubmittedPrompt, { prompt: adaptedPrompt, role: "user" });
|
|
1458
|
+
try {
|
|
1459
|
+
retryResult = await executeWithResilience(
|
|
1460
|
+
async () => {
|
|
1461
|
+
const attemptStartState = await captureWorkspaceRetryState(workingDir);
|
|
1462
|
+
try {
|
|
1463
|
+
return await executeOpencodeCommandWithBootstrapRetry({
|
|
1464
|
+
command,
|
|
1465
|
+
args,
|
|
1466
|
+
workingDir,
|
|
1467
|
+
// Fall back to a sanitized inherited env when the caller did not
|
|
1468
|
+
// supply one, so PATH/HOME/auth-related vars reach the subprocess.
|
|
1469
|
+
env: childEnv,
|
|
1470
|
+
timeout: resolveOpencodeAttemptTimeoutMs(timeout, options.deadlineMs),
|
|
1471
|
+
deadlineMs: options.deadlineMs,
|
|
1472
|
+
extraWritePaths: opencodeRuntimeWritePaths,
|
|
1473
|
+
readOnlyWorkingDir: options.readOnlyWorkingDir,
|
|
1474
|
+
// OPENCODE_PERMISSION (1.x) and --auto (2.x) disable the provider's
|
|
1475
|
+
// tool-approval layer; the shared argv scan knows neither, so carry
|
|
1476
|
+
// that fact to the final post-wrap proof-pair guard.
|
|
1477
|
+
providerInternalSandboxBypass: serverArgs.includes("--auto") ? "--auto" : "OPENCODE_PERMISSION allow-all",
|
|
1478
|
+
executionIntent: options.executionIntent,
|
|
1479
|
+
executionTransport: options.executionTransport,
|
|
1480
|
+
idleWarnMs: resolveOpencodeIdleTimeout(
|
|
1481
|
+
options.idleWarnMs,
|
|
1482
|
+
runtimeQuirks?.idleDefaults?.idleWarnMs,
|
|
1483
|
+
options.allowIdleTimeoutAboveProviderDefault
|
|
1484
|
+
),
|
|
1485
|
+
idleKillMs: resolveOpencodeIdleTimeout(
|
|
1486
|
+
options.idleKillMs,
|
|
1487
|
+
runtimeQuirks?.idleDefaults?.idleKillMs,
|
|
1488
|
+
options.allowIdleTimeoutAboveProviderDefault
|
|
1489
|
+
),
|
|
1490
|
+
onData,
|
|
1491
|
+
onErrorData,
|
|
1492
|
+
onStdoutChunk: options.onStdoutChunk,
|
|
1493
|
+
onStderrChunk: options.onStderrChunk,
|
|
1494
|
+
onActivity: options.onActivity,
|
|
1495
|
+
onFirstOutput: () => {
|
|
1496
|
+
if (!invocationTimeFirstTokenMs) {
|
|
1497
|
+
invocationTimeFirstTokenMs = Date.now();
|
|
1498
|
+
opencodeLivenessPhasesMs.firstOutput = invocationTimeFirstTokenMs - opencodeLivenessStartedAtMs;
|
|
1499
|
+
}
|
|
1500
|
+
},
|
|
1501
|
+
abortSignal,
|
|
1502
|
+
operation: "run",
|
|
1503
|
+
// Thread caller budgets into bootstrap so BunInstall recovery cannot
|
|
1504
|
+
// outrun the invoke one-attempt contract. Omitted for ordinary runs.
|
|
1505
|
+
...bootstrapRetryBudget ? { retryBudget: bootstrapRetryBudget } : {},
|
|
1506
|
+
maxAttempts: bootstrapMaxAttempts,
|
|
1507
|
+
beforeRetryAttempt: (error) => rejectUnsafeFullPromptRetry({
|
|
1508
|
+
workingDir,
|
|
1509
|
+
attemptStartState,
|
|
1510
|
+
error,
|
|
1511
|
+
providerName: metadata.id,
|
|
1512
|
+
requireCleanState: true
|
|
1513
|
+
}),
|
|
1514
|
+
metadata: {
|
|
1515
|
+
id: metadata.id,
|
|
1516
|
+
name: metadata.name,
|
|
1517
|
+
installCommand: metadata.installCommand,
|
|
1518
|
+
authHint: metadata.authHint,
|
|
1519
|
+
docsPath: metadata.docsPath,
|
|
1520
|
+
docsAnchor: metadata.docsAnchor
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
} catch (error) {
|
|
1524
|
+
await assertWorkspaceRetryIsSafe({
|
|
1525
|
+
providerId: metadata.id,
|
|
1526
|
+
providerName: metadata.name,
|
|
1527
|
+
workingDir,
|
|
1528
|
+
attemptStartState,
|
|
1529
|
+
originalError: error,
|
|
1530
|
+
retryable: parseOpencodeError(error, {
|
|
1531
|
+
requestedModel: effectiveModel ?? model,
|
|
1532
|
+
cliVersion: capabilities.cliVersion,
|
|
1533
|
+
inventoryModelIds: getCachedOpencodeModelIds(inventoryCacheDir),
|
|
1534
|
+
inventoryAgeMs: getOpencodeModelsCacheInfo(inventoryCacheDir).ageMs
|
|
1535
|
+
}).retryable
|
|
1536
|
+
});
|
|
1537
|
+
throw error;
|
|
1538
|
+
}
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
providerName: metadata.id,
|
|
1542
|
+
providerId: metadata.id,
|
|
1543
|
+
operation: "run",
|
|
1544
|
+
maxAttempts,
|
|
1545
|
+
abortSignal,
|
|
1546
|
+
fastRetryMode: fastRetry,
|
|
1547
|
+
retryBudget: outerRetryBudget,
|
|
1548
|
+
errorParser: (error) => parseOpencodeError(error, {
|
|
1549
|
+
requestedModel: effectiveModel ?? model,
|
|
1550
|
+
cliVersion: capabilities.cliVersion,
|
|
1551
|
+
inventoryModelIds: getCachedOpencodeModelIds(inventoryCacheDir),
|
|
1552
|
+
inventoryAgeMs: getOpencodeModelsCacheInfo(inventoryCacheDir).ageMs
|
|
1553
|
+
}),
|
|
1554
|
+
circuitBreakerOptions: OPENCODE_CIRCUIT_BREAKER_OPTIONS,
|
|
1555
|
+
circuitBreakerScope: options.circuitBreakerScope,
|
|
1556
|
+
deadlineMs: options.deadlineMs ?? Date.now() + timeout,
|
|
1557
|
+
minimumAttemptTimeMs: Math.min(timeout, 3e4),
|
|
1558
|
+
retryWorktreeDir: workingDir
|
|
1559
|
+
}
|
|
1560
|
+
);
|
|
1561
|
+
} catch (error) {
|
|
1562
|
+
const exitCode = typeof error?.exitCode === "number" ? error.exitCode ?? null : null;
|
|
1563
|
+
const stdout = typeof error?.stdout === "string" ? error.stdout : void 0;
|
|
1564
|
+
const stderr = typeof error?.stderr === "string" ? error.stderr : void 0;
|
|
1565
|
+
leadWithOpencodeErrorEvents(error);
|
|
1566
|
+
const logErrors = await readOpencodeLogErrorsSince(opencodeLogCheckpoint);
|
|
1567
|
+
const partialFilesModified = await detectGitChangedFiles(workingDir, {
|
|
1568
|
+
baselineHead,
|
|
1569
|
+
baselineSnapshot
|
|
1570
|
+
}).catch(() => void 0);
|
|
1571
|
+
attachOpencodeInvocationDiagnostics(error, {
|
|
1572
|
+
commandPath: command,
|
|
1573
|
+
argvRedacted,
|
|
1574
|
+
stdout,
|
|
1575
|
+
stderr,
|
|
1576
|
+
...logErrors.length > 0 ? {
|
|
1577
|
+
providerDiagnostics: {
|
|
1578
|
+
transportErrors: logErrors,
|
|
1579
|
+
stderrSeverity: "error"
|
|
1580
|
+
}
|
|
1581
|
+
} : {},
|
|
1582
|
+
...partialFilesModified?.length ? { filesModified: partialFilesModified } : {}
|
|
1583
|
+
});
|
|
1584
|
+
await recordInvocationTiming({
|
|
1585
|
+
providerId: metadata.id,
|
|
1586
|
+
// The steering instructions file (when staged) is a second prompt channel.
|
|
1587
|
+
requestSizeBytes: measurePromptRequestBytes(
|
|
1588
|
+
adaptedPrompt,
|
|
1589
|
+
attachmentInstruction,
|
|
1590
|
+
steeringText
|
|
1591
|
+
),
|
|
1592
|
+
modelId: model ?? "auto",
|
|
1593
|
+
timeRequestSentMs: invocationTimeRequestSentMs,
|
|
1594
|
+
timeFirstTokenMs: invocationTimeFirstTokenMs,
|
|
1595
|
+
timeLastTokenMs: Date.now(),
|
|
1596
|
+
status: "error",
|
|
1597
|
+
failure: error,
|
|
1598
|
+
env: childEnv
|
|
1599
|
+
});
|
|
1600
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
1601
|
+
const isHardFailure = errMsg.includes("auth") || errMsg.includes("unauthorized") || errMsg.includes("not_found");
|
|
1602
|
+
recordProviderRunFailure("opencode", {
|
|
1603
|
+
error,
|
|
1604
|
+
severity: isHardFailure ? "hard" : "normal",
|
|
1605
|
+
phase: inferProviderFailurePhase({
|
|
1606
|
+
error,
|
|
1607
|
+
exitCode
|
|
1608
|
+
})
|
|
1609
|
+
});
|
|
1610
|
+
throw error;
|
|
1611
|
+
}
|
|
1612
|
+
const result = retryResult.result;
|
|
1613
|
+
const {
|
|
1614
|
+
text: parsedText,
|
|
1615
|
+
tokenUsage,
|
|
1616
|
+
totalCostUsd,
|
|
1617
|
+
resolvedModel,
|
|
1618
|
+
servedRoute,
|
|
1619
|
+
agentUsed,
|
|
1620
|
+
subAgentInvocations,
|
|
1621
|
+
subAgentTypes,
|
|
1622
|
+
structuredEventCount,
|
|
1623
|
+
errorEvents
|
|
1624
|
+
} = parseOpencodeProviderOutput(result.stdout, result.stderr);
|
|
1625
|
+
const opencodeSession = await resolveOpencodeSessionFromDb(
|
|
1626
|
+
workingDir,
|
|
1627
|
+
opencodeDataHome.dataHome
|
|
1628
|
+
);
|
|
1629
|
+
const effectiveResolvedModel = resolvedModel ?? opencodeSession.resolvedModel;
|
|
1630
|
+
const effectiveServedRoute = servedRoute ?? opencodeSession.servedRoute;
|
|
1631
|
+
const opencodeLogErrors = await readOpencodeLogErrorsSince(opencodeLogCheckpoint);
|
|
1632
|
+
let filesModified;
|
|
1633
|
+
let changeDetectionWarning;
|
|
1634
|
+
try {
|
|
1635
|
+
filesModified = await detectGitChangedFiles(workingDir, {
|
|
1636
|
+
baselineHead,
|
|
1637
|
+
baselineSnapshot
|
|
1638
|
+
});
|
|
1639
|
+
} catch {
|
|
1640
|
+
changeDetectionWarning = "OpenCode Git change detection failed; file changes are unknown.";
|
|
1641
|
+
}
|
|
1642
|
+
const confirmedNoFileChanges = filesModified?.length === 0;
|
|
1643
|
+
const rawStdoutNonEmpty = result.stdout.trim().length > 0;
|
|
1644
|
+
const diagnosticRawOutput = extractUsefulOpencodeRawOutput(result.stdout, result.stderr);
|
|
1645
|
+
const contributableRawOutput = extractUsefulOpencodeRawOutput(
|
|
1646
|
+
extractUnstructuredOpencodeStdout(result.stdout),
|
|
1647
|
+
""
|
|
1648
|
+
);
|
|
1649
|
+
const contributedOutput = parsedText || contributableRawOutput;
|
|
1650
|
+
const reportedToolFailure = hasOpencodeReportedToolFailure(diagnosticRawOutput);
|
|
1651
|
+
const reportedProviderError = (errorEvents?.length ?? 0) > 0;
|
|
1652
|
+
const reportedUnsuccessfulFinish = errorEvents?.some(
|
|
1653
|
+
(event) => event.errorType === "length" || event.errorType === "content-filter"
|
|
1654
|
+
) === true;
|
|
1655
|
+
const hasMeaningfulDelivery = contributedOutput.trim().length > 0 || (filesModified?.length ?? 0) > 0;
|
|
1656
|
+
if (hasMeaningfulDelivery && opencodeLivenessPhasesMs.firstUsefulAction === void 0) {
|
|
1657
|
+
opencodeLivenessPhasesMs.firstUsefulAction = Date.now() - opencodeLivenessStartedAtMs;
|
|
1658
|
+
}
|
|
1659
|
+
const noContentSuccess = result.exitCode === 0 && contributedOutput.trim().length === 0 && confirmedNoFileChanges;
|
|
1660
|
+
const effectiveExitCode = noContentSuccess || reportedToolFailure || reportedUnsuccessfulFinish || reportedProviderError && !hasMeaningfulDelivery ? 1 : result.exitCode;
|
|
1661
|
+
const emptySuccessMessage = "OpenCode exited 0 but produced no assistant output and no file changes.";
|
|
1662
|
+
const reportedToolFailureMessage = "OpenCode exited 0 but reported a failed internal tool operation.";
|
|
1663
|
+
const reportedProviderErrorMessage = reportedProviderError ? summarizeOpencodeErrorEvents(errorEvents ?? []) : void 0;
|
|
1664
|
+
await recordInvocationTiming({
|
|
1665
|
+
providerId: metadata.id,
|
|
1666
|
+
// The steering instructions file (when staged) is a second prompt channel.
|
|
1667
|
+
requestSizeBytes: measurePromptRequestBytes(
|
|
1668
|
+
adaptedPrompt,
|
|
1669
|
+
attachmentInstruction,
|
|
1670
|
+
steeringText
|
|
1671
|
+
),
|
|
1672
|
+
modelId: effectiveResolvedModel ?? model ?? "auto",
|
|
1673
|
+
timeRequestSentMs: invocationTimeRequestSentMs,
|
|
1674
|
+
timeFirstTokenMs: invocationTimeFirstTokenMs,
|
|
1675
|
+
timeLastTokenMs: Date.now(),
|
|
1676
|
+
tokensIn: tokenUsage?.inputTokens,
|
|
1677
|
+
tokensOut: tokenUsage?.outputTokens,
|
|
1678
|
+
tokenUsage,
|
|
1679
|
+
providerReportedCostUsd: totalCostUsd,
|
|
1680
|
+
backend: effectiveServedRoute,
|
|
1681
|
+
status: effectiveExitCode === 0 ? "success" : "error",
|
|
1682
|
+
errorCode: effectiveExitCode !== 0 ? `EXIT_${effectiveExitCode}` : null,
|
|
1683
|
+
// The env OpenCode was spawned with: attribution ids are resolved from it, and
|
|
1684
|
+
// the caller's map can be a partial one that lacks them.
|
|
1685
|
+
env: childEnv
|
|
1686
|
+
});
|
|
1687
|
+
if (effectiveExitCode !== 0 && rawStdoutNonEmpty && structuredEventCount === 0 && confirmedNoFileChanges) {
|
|
1688
|
+
reportOutputDrift({
|
|
1689
|
+
provider: "opencode",
|
|
1690
|
+
severity: "parse_fallback",
|
|
1691
|
+
field: "jsonlParse",
|
|
1692
|
+
detail: "stdout was non-empty but JSONL extraction produced no events and no edits",
|
|
1693
|
+
outputShapeTag: "no-jsonl-events-no-edits"
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1696
|
+
if (structuredEventCount > 0 && parsedText.trim().length === 0 && rawStdoutNonEmpty && contributableRawOutput.length === 0 && confirmedNoFileChanges && !reportedProviderError) {
|
|
1697
|
+
reportOutputDrift({
|
|
1698
|
+
provider: "opencode",
|
|
1699
|
+
severity: "parse_fallback",
|
|
1700
|
+
field: "structuredDelivery",
|
|
1701
|
+
detail: "structured events were present but contained no assistant delivery and no edits",
|
|
1702
|
+
outputShapeTag: "structured-events-no-delivery-no-edits"
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
if (effectiveExitCode === 0) {
|
|
1706
|
+
recordProviderRunSuccess("opencode");
|
|
1707
|
+
} else {
|
|
1708
|
+
recordProviderRunFailure("opencode", {
|
|
1709
|
+
severity: "normal",
|
|
1710
|
+
phase: inferProviderFailurePhase({
|
|
1711
|
+
exitCode: effectiveExitCode,
|
|
1712
|
+
stderr: result.stderr,
|
|
1713
|
+
stdout: result.stdout,
|
|
1714
|
+
filesModifiedCount: filesModified?.length ?? 0,
|
|
1715
|
+
producedOutput: Boolean(contributedOutput.trim().length)
|
|
1716
|
+
})
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1719
|
+
const appliedWorkspaceMode = adaptation.promptMode;
|
|
1720
|
+
opencodeLivenessPhasesMs.finalResponse = Date.now() - opencodeLivenessStartedAtMs;
|
|
1721
|
+
const baseStderr = noContentSuccess || reportedToolFailure || reportedProviderError ? [
|
|
1722
|
+
result.stderr.trim(),
|
|
1723
|
+
noContentSuccess ? emptySuccessMessage : void 0,
|
|
1724
|
+
reportedToolFailure ? reportedToolFailureMessage : void 0,
|
|
1725
|
+
reportedProviderErrorMessage
|
|
1726
|
+
].filter(Boolean).join("\n") : result.stderr;
|
|
1727
|
+
const finalStderr = [capabilityWarnings.join("\n"), baseStderr.trim(), changeDetectionWarning].filter(Boolean).join("\n");
|
|
1728
|
+
const finalResult = {
|
|
1729
|
+
stdout: contributedOutput,
|
|
1730
|
+
stderr: finalStderr,
|
|
1731
|
+
exitCode: effectiveExitCode,
|
|
1732
|
+
commandPath: command,
|
|
1733
|
+
argvRedacted,
|
|
1734
|
+
stdoutTail: providerOutputTail(result.stdout),
|
|
1735
|
+
stderrTail: providerOutputTail(finalStderr),
|
|
1736
|
+
providerDiagnostics: {
|
|
1737
|
+
finalAnswerPresent: Boolean(contributedOutput.trim().length),
|
|
1738
|
+
...reportedToolFailure ? { toolErrors: [reportedToolFailureMessage] } : {},
|
|
1739
|
+
...reportedProviderError && reportedProviderErrorMessage ? { transportErrors: [reportedProviderErrorMessage] } : opencodeLogErrors.length > 0 && effectiveExitCode !== 0 ? { transportErrors: opencodeLogErrors } : {},
|
|
1740
|
+
...opencodeLogErrors.length > 0 && effectiveExitCode === 0 ? { retryErrors: opencodeLogErrors } : {},
|
|
1741
|
+
stderrSeverity: reportedToolFailure || reportedProviderError || noContentSuccess ? "error" : capabilityWarnings.length > 0 || opencodeLogErrors.length > 0 || changeDetectionWarning ? "warning" : "none"
|
|
1742
|
+
},
|
|
1743
|
+
providerLivenessPhasesMs: opencodeLivenessPhasesMs,
|
|
1744
|
+
...capabilities.cliVersion ? { providerCliVersion: capabilities.cliVersion } : {},
|
|
1745
|
+
sessionId: opencodeSession.sessionId,
|
|
1746
|
+
workspaceMode: appliedWorkspaceMode,
|
|
1747
|
+
workspaceModeRequested: requestedWorkspaceMode,
|
|
1748
|
+
// Backwards compatibility
|
|
1749
|
+
promptMode: appliedWorkspaceMode,
|
|
1750
|
+
promptModeRequested: requestedWorkspaceMode,
|
|
1751
|
+
completionSignalVariant: adaptation.completionSignalVariant,
|
|
1752
|
+
tokenUsage,
|
|
1753
|
+
totalCostUsd,
|
|
1754
|
+
providerReportedCostUsd: totalCostUsd,
|
|
1755
|
+
...effectiveServedRoute ? { servedRoute: effectiveServedRoute } : {},
|
|
1756
|
+
filesModified,
|
|
1757
|
+
// Actual model chosen by OpenCode at runtime (only set when extracted from JSONL
|
|
1758
|
+
// output). When model='auto', the CLI selects its own default and this captures
|
|
1759
|
+
// what it actually used, allowing downstream telemetry to record the real model
|
|
1760
|
+
// instead of the placeholder 'auto'.
|
|
1761
|
+
...effectiveResolvedModel ? { resolvedModel: effectiveResolvedModel } : {},
|
|
1762
|
+
agentUsed,
|
|
1763
|
+
subAgentInvocations,
|
|
1764
|
+
subAgentTypes
|
|
1765
|
+
};
|
|
1766
|
+
return finalResult;
|
|
1767
|
+
} catch (error) {
|
|
1768
|
+
runError = error;
|
|
1769
|
+
throw error;
|
|
1770
|
+
} finally {
|
|
1771
|
+
const cleanupResults = await Promise.allSettled([
|
|
1772
|
+
promptAttachmentCleanup?.(),
|
|
1773
|
+
steeringInstructions?.cleanup(),
|
|
1774
|
+
opencodeDataHome?.cleanup?.(),
|
|
1775
|
+
opencodeStateHome?.cleanup?.(),
|
|
1776
|
+
opencodeConfigHome?.cleanup?.(),
|
|
1777
|
+
opencodeCacheHome?.cleanup?.()
|
|
1778
|
+
]);
|
|
1779
|
+
const cleanupErrors = cleanupResults.filter((result) => result.status === "rejected").map((result) => result.reason);
|
|
1780
|
+
const residueErrors = cleanupErrors.filter(
|
|
1781
|
+
(error) => error instanceof CredentialResidueError
|
|
1782
|
+
);
|
|
1783
|
+
if (residueErrors.length > 0) {
|
|
1784
|
+
throw aggregateCredentialResidueErrors(residueErrors, {
|
|
1785
|
+
ownership: "run-owned",
|
|
1786
|
+
role: "opencode-runtime-cleanup",
|
|
1787
|
+
...runError !== void 0 ? { primaryError: runError } : {}
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
if (cleanupErrors.length > 0) {
|
|
1791
|
+
const cleanupError = cleanupErrors[0];
|
|
1792
|
+
throw cleanupError;
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
export {
|
|
1797
|
+
resolveAttachedFilePaths,
|
|
1798
|
+
runOpencodeNative,
|
|
1799
|
+
seedOpencodeCredentials
|
|
1800
|
+
};
|
|
1801
|
+
//# sourceMappingURL=runner-PIS2BW7Y.js.map
|