@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,2773 @@
|
|
|
1
|
+
import {
|
|
2
|
+
retiredJudgeSelectionError
|
|
3
|
+
} from "./chunk-IVZEONFC.js";
|
|
4
|
+
import {
|
|
5
|
+
assertProviderReady
|
|
6
|
+
} from "./chunk-XTXYIISX.js";
|
|
7
|
+
import {
|
|
8
|
+
ENABLED_PROVIDER_IDS
|
|
9
|
+
} from "./chunk-I7SCBHJN.js";
|
|
10
|
+
import {
|
|
11
|
+
closestOfferedModelId,
|
|
12
|
+
isUnknownRegistryModel,
|
|
13
|
+
parseEffortToken
|
|
14
|
+
} from "./chunk-TGXXYDL4.js";
|
|
15
|
+
import {
|
|
16
|
+
getActiveProfilePath,
|
|
17
|
+
isAutoCreatedProfile,
|
|
18
|
+
loadActiveProfileStrict,
|
|
19
|
+
profileToBuildConfig,
|
|
20
|
+
warnIfShadowedConfigCandidate
|
|
21
|
+
} from "./chunk-M4BUEXXF.js";
|
|
22
|
+
import {
|
|
23
|
+
normalizeLegacyIntoCanonical,
|
|
24
|
+
readProviderModelFromEnv,
|
|
25
|
+
warnRetiredConfigKeysOnce
|
|
26
|
+
} from "./chunk-726G6WDL.js";
|
|
27
|
+
import {
|
|
28
|
+
JUDGE_SCORING_CONFIG
|
|
29
|
+
} from "./chunk-SVUNZOPG.js";
|
|
30
|
+
import {
|
|
31
|
+
familyFlagshipModel,
|
|
32
|
+
isFamilyAlias,
|
|
33
|
+
modelFamilies
|
|
34
|
+
} from "./chunk-FAZBRHGG.js";
|
|
35
|
+
import {
|
|
36
|
+
BuildConfigReadError,
|
|
37
|
+
buildConfigCandidates,
|
|
38
|
+
readCanonicalBuildConfig,
|
|
39
|
+
selectedBuildConfigCandidate
|
|
40
|
+
} from "./chunk-FKCG7K6H.js";
|
|
41
|
+
import {
|
|
42
|
+
firstInstalledEnabledProvider,
|
|
43
|
+
isProviderCliResolvable
|
|
44
|
+
} from "./chunk-KKQKWAMF.js";
|
|
45
|
+
import {
|
|
46
|
+
InvalidExplicitConfigError,
|
|
47
|
+
ProviderRegistry,
|
|
48
|
+
combineCacheFingerprints,
|
|
49
|
+
fingerprintEnvironment,
|
|
50
|
+
fingerprintFile,
|
|
51
|
+
fingerprintFiles,
|
|
52
|
+
isOfferedModel,
|
|
53
|
+
normalizeModelSelectorForComparison,
|
|
54
|
+
providerDisableSwitch,
|
|
55
|
+
warnIfModelUnobserved
|
|
56
|
+
} from "./chunk-QJ6OEH4K.js";
|
|
57
|
+
import {
|
|
58
|
+
listModelRouteIds
|
|
59
|
+
} from "./chunk-QXBKTJT6.js";
|
|
60
|
+
import {
|
|
61
|
+
normalizeReasoningEffortInput
|
|
62
|
+
} from "./chunk-4BTDUT2S.js";
|
|
63
|
+
import {
|
|
64
|
+
getConfigPaths,
|
|
65
|
+
projectConfigAliasesUserConfig,
|
|
66
|
+
resolveProvidersConfigPath
|
|
67
|
+
} from "./chunk-35J4NE6S.js";
|
|
68
|
+
import {
|
|
69
|
+
quotePosixShellArg
|
|
70
|
+
} from "./chunk-N5DX4JAK.js";
|
|
71
|
+
import {
|
|
72
|
+
getUserConfigDir,
|
|
73
|
+
getUserPreferencesPath
|
|
74
|
+
} from "./chunk-56WPYDJH.js";
|
|
75
|
+
import {
|
|
76
|
+
getPackageRoot
|
|
77
|
+
} from "./chunk-STW7OFOA.js";
|
|
78
|
+
import {
|
|
79
|
+
BUILD_TELEMETRY_EPHEMERAL_REPLICATION,
|
|
80
|
+
emitWarning,
|
|
81
|
+
readEnv
|
|
82
|
+
} from "./chunk-7VRJHTGZ.js";
|
|
83
|
+
|
|
84
|
+
// src/core/config/resolution-engine.ts
|
|
85
|
+
import { existsSync } from "fs";
|
|
86
|
+
import { join as join4 } from "path";
|
|
87
|
+
|
|
88
|
+
// src/core/config/explicit-model-warning.ts
|
|
89
|
+
function warnIfExplicitModelUnobserved(providerId, model) {
|
|
90
|
+
try {
|
|
91
|
+
const { models } = ProviderRegistry.getProviderConfig(providerId);
|
|
92
|
+
warnIfModelUnobserved(providerId, models, ProviderRegistry.resolveModel(providerId, model));
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function assertExplicitModelNotMistyped(providerId, model) {
|
|
97
|
+
let suggestion;
|
|
98
|
+
let resolved;
|
|
99
|
+
try {
|
|
100
|
+
const { models } = ProviderRegistry.getProviderConfig(providerId);
|
|
101
|
+
resolved = ProviderRegistry.resolveModel(providerId, model);
|
|
102
|
+
if (isOfferedModel(models, resolved) || !isUnknownRegistryModel(providerId, resolved)) return;
|
|
103
|
+
suggestion = closestOfferedModelId(providerId, resolved);
|
|
104
|
+
} catch {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (!suggestion) return;
|
|
108
|
+
throw new Error(
|
|
109
|
+
`Unknown ${providerId} model "${model}". Did you mean "${suggestion}"? Check the model id, or run the provider CLI to list the models it offers.`
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// src/core/config/resolution-warnings.ts
|
|
114
|
+
var RESOLUTION_WARNING_CODE = "CFG-008";
|
|
115
|
+
var emittedKeys = /* @__PURE__ */ new Set();
|
|
116
|
+
function emitResolutionWarningOnce(warning) {
|
|
117
|
+
const value = warning.model ?? warning.source ?? "";
|
|
118
|
+
const key = `${warning.operation}|${warning.provider}|${value}`;
|
|
119
|
+
if (emittedKeys.has(key)) return;
|
|
120
|
+
emittedKeys.add(key);
|
|
121
|
+
emitWarning(
|
|
122
|
+
RESOLUTION_WARNING_CODE,
|
|
123
|
+
{
|
|
124
|
+
taskId: "resolution-engine",
|
|
125
|
+
subsystem: "config",
|
|
126
|
+
executionPhase: "setup"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
severity: "WARN" /* WARN */,
|
|
130
|
+
message: warning.message,
|
|
131
|
+
metadata: { ...warning }
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// src/core/config/active-profile.ts
|
|
137
|
+
var activeProfileCache = null;
|
|
138
|
+
function getActiveProfile() {
|
|
139
|
+
const profilePath = getActiveProfilePath();
|
|
140
|
+
const fingerprint = combineCacheFingerprints(
|
|
141
|
+
fingerprintEnvironment(
|
|
142
|
+
process.env,
|
|
143
|
+
(name) => ["BUILD_ACTIVE_PROFILE", "BUILD_CONFIG_DIR", "BUILD_PROFILES_DIR"].includes(name)
|
|
144
|
+
),
|
|
145
|
+
fingerprintFiles([getUserPreferencesPath(), ...profilePath ? [profilePath] : []])
|
|
146
|
+
);
|
|
147
|
+
if (activeProfileCache === null || activeProfileCache.fingerprint !== fingerprint) {
|
|
148
|
+
let profile;
|
|
149
|
+
try {
|
|
150
|
+
profile = loadActiveProfileStrict();
|
|
151
|
+
} catch (error) {
|
|
152
|
+
throw new BuildConfigReadError(
|
|
153
|
+
profilePath ?? "active profile",
|
|
154
|
+
"unreadable",
|
|
155
|
+
[{ message: error instanceof Error ? error.message : String(error) }],
|
|
156
|
+
error
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
if (profile && profilePath) warnRetiredConfigKeysOnce(profilePath, profile);
|
|
160
|
+
const value = profile ? { ...profile, ...profileToBuildConfig(profile) } : null;
|
|
161
|
+
activeProfileCache = { value, fingerprint };
|
|
162
|
+
}
|
|
163
|
+
return activeProfileCache.value ?? null;
|
|
164
|
+
}
|
|
165
|
+
function resetActiveProfileCache() {
|
|
166
|
+
activeProfileCache = null;
|
|
167
|
+
}
|
|
168
|
+
function warnSetupProviderPin(profile, pinned, loadLayers) {
|
|
169
|
+
warnSetupPin(
|
|
170
|
+
profile,
|
|
171
|
+
"defaults.provider",
|
|
172
|
+
pinned,
|
|
173
|
+
pinned,
|
|
174
|
+
loadLayers,
|
|
175
|
+
(layer) => layer?.defaults?.provider?.toLowerCase().trim()
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
function warnSetupModelPin(profile, provider, pinned, loadLayers) {
|
|
179
|
+
const key = `defaults.providers.${provider}.model`;
|
|
180
|
+
warnSetupPin(
|
|
181
|
+
profile,
|
|
182
|
+
key,
|
|
183
|
+
pinned,
|
|
184
|
+
provider,
|
|
185
|
+
loadLayers,
|
|
186
|
+
(layer) => layer?.defaults?.providers?.[provider]?.model?.trim()
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
function warnSetupPin(profile, key, pinned, provider, loadLayers, read) {
|
|
190
|
+
if (!isAutoCreatedProfile(profile)) return;
|
|
191
|
+
let layers;
|
|
192
|
+
try {
|
|
193
|
+
layers = loadLayers();
|
|
194
|
+
} catch {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const projectValue = read(layers.project);
|
|
198
|
+
const [value, path3] = projectValue ? [projectValue, layers.paths.projectConfigFile] : [read(layers.user), layers.paths.userConfigFile];
|
|
199
|
+
if (!value || value === pinned) return;
|
|
200
|
+
emitResolutionWarningOnce({
|
|
201
|
+
operation: "autoCreatedProfilePin",
|
|
202
|
+
provider,
|
|
203
|
+
source: `${key}=${value}`,
|
|
204
|
+
message: `profile '${profile.name}' sets ${key}=${pinned}, written by first-run setup; it overrides ${key}=${value} in ${path3}. Run 'build provider setup --first-run --reset-defaults' to remove it.`
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// src/core/config/provider-order.ts
|
|
209
|
+
import { AsyncLocalStorage } from "async_hooks";
|
|
210
|
+
var CONFIG_LAYER_PRECEDENCE = [
|
|
211
|
+
"user-config",
|
|
212
|
+
"project",
|
|
213
|
+
"profile",
|
|
214
|
+
"env",
|
|
215
|
+
"cli"
|
|
216
|
+
];
|
|
217
|
+
var PROVIDER_ID_PATTERN = /^[a-z0-9][a-z0-9_-]{0,63}$/;
|
|
218
|
+
var RETIRED_PURPOSE_ORDER_KEYS = {
|
|
219
|
+
synthesis: "defaults.synthesis.providerOrder",
|
|
220
|
+
decomposition: "defaults.intent.decomposition.providerOrder"
|
|
221
|
+
};
|
|
222
|
+
function retiredPurposeOrder(defaults, purpose) {
|
|
223
|
+
return purpose === "synthesis" ? defaults?.synthesis?.providerOrder : defaults?.intent?.decomposition?.providerOrder;
|
|
224
|
+
}
|
|
225
|
+
function resolveDeclaredDefaultProvider(cli, cwd) {
|
|
226
|
+
if (cli?.provider) {
|
|
227
|
+
return assertDefaultProviderEnabled({ value: cli.provider, source: "cli" }, cwd);
|
|
228
|
+
}
|
|
229
|
+
const envProvider = process.env.BUILD_DEFAULT_PROVIDER;
|
|
230
|
+
if (envProvider) {
|
|
231
|
+
const normalized = envProvider.toLowerCase().trim();
|
|
232
|
+
if (PROVIDER_ID_PATTERN.test(normalized)) {
|
|
233
|
+
return assertDefaultProviderEnabled(
|
|
234
|
+
{ value: normalized, source: "env", sourcePath: "env:BUILD_DEFAULT_PROVIDER" },
|
|
235
|
+
cwd
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
throw new InvalidExplicitConfigError(
|
|
239
|
+
"Invalid BUILD_DEFAULT_PROVIDER: expected a provider id containing only letters, digits, underscores, or hyphens"
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
const activeProfile = getActiveProfile();
|
|
243
|
+
if (activeProfile?.defaults?.provider) {
|
|
244
|
+
const normalized = activeProfile.defaults.provider.toLowerCase().trim();
|
|
245
|
+
if (PROVIDER_ID_PATTERN.test(normalized)) {
|
|
246
|
+
warnSetupProviderPin(activeProfile, normalized, () => loadConfigLayers(cwd));
|
|
247
|
+
return assertDefaultProviderEnabled(
|
|
248
|
+
{
|
|
249
|
+
value: normalized,
|
|
250
|
+
source: "profile",
|
|
251
|
+
sourcePath: `profile:${activeProfile.name}#defaults.provider`
|
|
252
|
+
},
|
|
253
|
+
cwd
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
throw new InvalidExplicitConfigError(
|
|
257
|
+
`Invalid default provider '${activeProfile.defaults.provider}' in active profile '${activeProfile.name}'`
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
const { paths, project, user } = loadConfigLayers(cwd);
|
|
261
|
+
if (project?.defaults?.provider) {
|
|
262
|
+
return assertDefaultProviderEnabled(
|
|
263
|
+
{
|
|
264
|
+
value: project.defaults.provider,
|
|
265
|
+
source: "project",
|
|
266
|
+
sourcePath: `${paths.projectConfigFile}#defaults.provider`
|
|
267
|
+
},
|
|
268
|
+
cwd
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
if (user?.defaults?.provider) {
|
|
272
|
+
return assertDefaultProviderEnabled(
|
|
273
|
+
{
|
|
274
|
+
value: user.defaults.provider,
|
|
275
|
+
source: "user-config",
|
|
276
|
+
sourcePath: `${paths.userConfigFile}#defaults.provider`
|
|
277
|
+
},
|
|
278
|
+
cwd
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
return void 0;
|
|
282
|
+
}
|
|
283
|
+
function declaredDefaultOverridingOwner(modelOwner, layerSource, cli, cwd) {
|
|
284
|
+
const declared = modelOwner ? resolveDeclaredDefaultProvider(cli, cwd) : void 0;
|
|
285
|
+
if (!declared) return void 0;
|
|
286
|
+
const provider = normalizeProviderId(declared.value);
|
|
287
|
+
const outranks = CONFIG_LAYER_PRECEDENCE.indexOf(declared.source) >= CONFIG_LAYER_PRECEDENCE.indexOf(layerSource);
|
|
288
|
+
return provider !== modelOwner && outranks ? { ...declared, value: provider } : void 0;
|
|
289
|
+
}
|
|
290
|
+
function filterRunnableProviderOrder(providerOrder, sourceLabel, cwd) {
|
|
291
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
292
|
+
const filtered = [];
|
|
293
|
+
const seen = /* @__PURE__ */ new Set();
|
|
294
|
+
for (const rawProvider of providerOrder) {
|
|
295
|
+
const normalized = normalizeProviderId(rawProvider.trim());
|
|
296
|
+
if (!normalized) continue;
|
|
297
|
+
const providerConfig = registry.providers[normalized] ?? registry.providers[rawProvider.trim()] ?? registry.providers[rawProvider];
|
|
298
|
+
if (!providerConfig) {
|
|
299
|
+
emitResolutionWarningOnce({
|
|
300
|
+
operation: "resolveCandidates",
|
|
301
|
+
provider: rawProvider,
|
|
302
|
+
source: sourceLabel,
|
|
303
|
+
message: `Skipping unknown provider '${rawProvider}' from ${sourceLabel}`
|
|
304
|
+
});
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
if (!providerConfig.enabled) {
|
|
308
|
+
emitResolutionWarningOnce({
|
|
309
|
+
operation: "resolveCandidates",
|
|
310
|
+
provider: providerConfig.id,
|
|
311
|
+
source: sourceLabel,
|
|
312
|
+
message: `Skipping disabled provider '${providerConfig.id}' from ${sourceLabel}`
|
|
313
|
+
});
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
if (!seen.has(providerConfig.id)) {
|
|
317
|
+
seen.add(providerConfig.id);
|
|
318
|
+
filtered.push(providerConfig.id);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return filtered;
|
|
322
|
+
}
|
|
323
|
+
function resolveConfiguredProviderOrder(options) {
|
|
324
|
+
const { cwd, purpose } = options;
|
|
325
|
+
const profile = getActiveProfile();
|
|
326
|
+
const { paths, project, user } = loadConfigLayers(cwd);
|
|
327
|
+
const layers = [
|
|
328
|
+
...profile ? [
|
|
329
|
+
{
|
|
330
|
+
defaults: profile.defaults,
|
|
331
|
+
source: "profile",
|
|
332
|
+
path: `profile:${profile.name}`
|
|
333
|
+
}
|
|
334
|
+
] : [],
|
|
335
|
+
{ defaults: project?.defaults, source: "project", path: paths.projectConfigFile },
|
|
336
|
+
{ defaults: user?.defaults, source: "user-config", path: paths.userConfigFile }
|
|
337
|
+
];
|
|
338
|
+
for (const layer of layers) {
|
|
339
|
+
const lists = [{ key: "defaults.providerOrder", order: layer.defaults?.providerOrder }];
|
|
340
|
+
if (purpose) {
|
|
341
|
+
const key = RETIRED_PURPOSE_ORDER_KEYS[purpose];
|
|
342
|
+
lists.unshift({ key, order: retiredPurposeOrder(layer.defaults, purpose) });
|
|
343
|
+
}
|
|
344
|
+
const found = lists.find((list) => list.order && list.order.length > 0);
|
|
345
|
+
if (!found?.order) continue;
|
|
346
|
+
const sourcePath = `${layer.path}#${found.key}`;
|
|
347
|
+
const providers = filterRunnableProviderOrder(
|
|
348
|
+
found.order,
|
|
349
|
+
`${layer.source}:${sourcePath}`,
|
|
350
|
+
cwd
|
|
351
|
+
);
|
|
352
|
+
const unusable = providers.length > 0 ? void 0 : `${sourcePath} lists no known, enabled provider (${found.order.join(", ")}). Enable one of the listed providers in providers.yaml, or change the list.`;
|
|
353
|
+
return { providers, source: layer.source, sourcePath, ...unusable ? { unusable } : {} };
|
|
354
|
+
}
|
|
355
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
356
|
+
const registryPath = ProviderRegistry.getLoadedConfigPath() ?? resolveProvidersConfigPath({ cwd });
|
|
357
|
+
return {
|
|
358
|
+
providers: ProviderRegistry.getEnabledProviders(registry).map((provider) => provider.id),
|
|
359
|
+
source: "registry",
|
|
360
|
+
sourcePath: `${registryPath}#providers.*.order`
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
var orderScope = new AsyncLocalStorage();
|
|
364
|
+
function withReadOnlyProviderOrder(fn) {
|
|
365
|
+
return orderScope.run({ ...orderScope.getStore(), readOnly: true }, fn);
|
|
366
|
+
}
|
|
367
|
+
function enterReadOnlyProviderOrderView() {
|
|
368
|
+
orderScope.enterWith({ ...orderScope.getStore(), readOnly: true });
|
|
369
|
+
}
|
|
370
|
+
function withPurposeProviderOrder(cwd, purpose, fn) {
|
|
371
|
+
let governing;
|
|
372
|
+
const resolveGoverning = () => {
|
|
373
|
+
governing ??= resolveConfiguredProviderOrder({ cwd, purpose });
|
|
374
|
+
return governing;
|
|
375
|
+
};
|
|
376
|
+
return orderScope.run({ ...orderScope.getStore(), governing: resolveGoverning }, fn);
|
|
377
|
+
}
|
|
378
|
+
function assertUsableProviderOrder(order, selected) {
|
|
379
|
+
if (order.unusable && selected.length === 0 && !orderScope.getStore()?.readOnly) {
|
|
380
|
+
throw new InvalidExplicitConfigError(order.unusable);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
function resolveFallbackProviderOrder(cwd) {
|
|
384
|
+
const globalOrder = resolveConfiguredProviderOrder({ cwd });
|
|
385
|
+
const order = globalOrder.unusable && orderScope.getStore()?.governing?.() || globalOrder;
|
|
386
|
+
assertUsableProviderOrder(order, order.providers);
|
|
387
|
+
return order;
|
|
388
|
+
}
|
|
389
|
+
function keepInstalledProviders(providers, registry) {
|
|
390
|
+
const installed = providers.filter((provider) => isProviderCliResolvable(provider, registry));
|
|
391
|
+
return installed.length > 0 ? { providers: installed, installedFilterApplied: true } : { providers, installedFilterApplied: false };
|
|
392
|
+
}
|
|
393
|
+
function firstInstalledProvider(providers, registry) {
|
|
394
|
+
return providers.find((provider) => isProviderCliResolvable(provider, registry)) ?? providers[0];
|
|
395
|
+
}
|
|
396
|
+
function resolveProviderOrder(options = {}) {
|
|
397
|
+
const cwd = options.cwd ?? process.cwd();
|
|
398
|
+
const configured = resolveConfiguredProviderOrder({ cwd });
|
|
399
|
+
const preferred = resolveDeclaredDefaultProvider(options.cli, cwd);
|
|
400
|
+
const ordered = preferred ? [preferred.value, ...configured.providers.filter((id) => id !== preferred.value)] : configured.providers;
|
|
401
|
+
const installed = keepInstalledProviders(ordered, loadProviderRegistryForCwd(cwd));
|
|
402
|
+
return {
|
|
403
|
+
...configured,
|
|
404
|
+
...installed,
|
|
405
|
+
ordered,
|
|
406
|
+
configured: configured.providers,
|
|
407
|
+
...preferred ? { preferred } : {}
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// src/core/config/default-judge-provider.ts
|
|
412
|
+
var REGISTRY_DEFAULT_JUDGE_SOURCE_PATH = "registry:default-judge";
|
|
413
|
+
var NoEligibleArbiterError = class extends Error {
|
|
414
|
+
constructor() {
|
|
415
|
+
super("No registered provider can fill arbiter-capable judge roles.");
|
|
416
|
+
this.name = "NoEligibleArbiterError";
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
function canJudgeAndArbitrate(providerId) {
|
|
420
|
+
const caps = ProviderRegistry.getJudgeCapabilities(providerId);
|
|
421
|
+
return caps.canJudge && caps.canArbitrate;
|
|
422
|
+
}
|
|
423
|
+
function selectFromConfiguredOrder(cwd, registry) {
|
|
424
|
+
const order = resolveConfiguredProviderOrder({ cwd });
|
|
425
|
+
if (order.source === "registry") return void 0;
|
|
426
|
+
const capable = order.providers.filter(canJudgeAndArbitrate);
|
|
427
|
+
const value = capable.find((provider) => isProviderCliResolvable(provider, registry)) ?? capable[0];
|
|
428
|
+
return value ? { value, source: "registry", sourcePath: order.sourcePath } : void 0;
|
|
429
|
+
}
|
|
430
|
+
function selectDefaultJudgeProvider(registry, cwd = process.cwd()) {
|
|
431
|
+
const fromOrder = selectFromConfiguredOrder(cwd, registry);
|
|
432
|
+
if (fromOrder) return fromOrder;
|
|
433
|
+
const installed = firstInstalledEnabledProvider(
|
|
434
|
+
registry,
|
|
435
|
+
(provider) => canJudgeAndArbitrate(provider.id)
|
|
436
|
+
);
|
|
437
|
+
if (installed) {
|
|
438
|
+
return {
|
|
439
|
+
value: installed,
|
|
440
|
+
source: "registry",
|
|
441
|
+
sourcePath: REGISTRY_DEFAULT_JUDGE_SOURCE_PATH
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
const capable = ProviderRegistry.getEnabledProviders(registry).find(
|
|
445
|
+
(provider) => canJudgeAndArbitrate(provider.id)
|
|
446
|
+
);
|
|
447
|
+
if (capable) {
|
|
448
|
+
return {
|
|
449
|
+
value: capable.id,
|
|
450
|
+
source: "fallback",
|
|
451
|
+
sourcePath: "judge-default:capable-provider"
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
throw new NoEligibleArbiterError();
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// src/core/config/git-attribution.ts
|
|
458
|
+
import { dirname, join as join3 } from "path";
|
|
459
|
+
|
|
460
|
+
// src/core/guard-kit/attribution-policy.ts
|
|
461
|
+
import * as fs from "fs";
|
|
462
|
+
import * as path2 from "path";
|
|
463
|
+
|
|
464
|
+
// src/core/guard-kit/paths.ts
|
|
465
|
+
import * as path from "path";
|
|
466
|
+
var GUARD_DIR_REL = path.join(".build-project", "guard");
|
|
467
|
+
var CHECK_SCRIPT_REL = "check.mjs";
|
|
468
|
+
var CONFIG_FILE_REL = "config.json";
|
|
469
|
+
var POLICY_FILE_REL = "policy.json";
|
|
470
|
+
var LOCK_FILE_REL = "checks.lock";
|
|
471
|
+
var SETUP_PLAYBOOK_REL = "GUARD_SETUP.md";
|
|
472
|
+
var CI_WORKFLOW_TEMPLATE_FILE = "build-guard.yml.template";
|
|
473
|
+
var GENERATED_HASHED_FILES = [CHECK_SCRIPT_REL, POLICY_FILE_REL];
|
|
474
|
+
function getGuardKitTemplatesDir() {
|
|
475
|
+
return path.join(getPackageRoot(), "templates", "guard-kit");
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// src/core/guard-kit/attribution-policy.ts
|
|
479
|
+
var HUMAN_ONLY_BOT_ALLOWLIST = [
|
|
480
|
+
"dependabot[bot]",
|
|
481
|
+
"github-actions[bot]",
|
|
482
|
+
"renovate[bot]"
|
|
483
|
+
];
|
|
484
|
+
function buildAttributionPolicy(input) {
|
|
485
|
+
return {
|
|
486
|
+
attribution: input.mode,
|
|
487
|
+
botAllow: [...HUMAN_ONLY_BOT_ALLOWLIST],
|
|
488
|
+
catalog: {
|
|
489
|
+
identities: [...input.catalog.identities],
|
|
490
|
+
trailerKeys: [...input.catalog.trailerKeys],
|
|
491
|
+
bylines: [...input.catalog.bylines],
|
|
492
|
+
bylineRegexSources: [...input.catalog.bylineRegexSources]
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
function readAttributionPolicy(repoRoot) {
|
|
497
|
+
const policyPath = path2.join(repoRoot, GUARD_DIR_REL, POLICY_FILE_REL);
|
|
498
|
+
let raw;
|
|
499
|
+
try {
|
|
500
|
+
if (!fs.lstatSync(policyPath).isFile()) {
|
|
501
|
+
return {
|
|
502
|
+
status: "invalid",
|
|
503
|
+
reason: "policy must be a regular file, not a symlink or directory"
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
raw = fs.readFileSync(policyPath, "utf8");
|
|
507
|
+
} catch (error) {
|
|
508
|
+
if (error.code === "ENOENT") return { status: "missing" };
|
|
509
|
+
return { status: "invalid", reason: error instanceof Error ? error.message : String(error) };
|
|
510
|
+
}
|
|
511
|
+
let parsed;
|
|
512
|
+
try {
|
|
513
|
+
parsed = JSON.parse(raw);
|
|
514
|
+
} catch (error) {
|
|
515
|
+
return { status: "invalid", reason: error instanceof Error ? error.message : String(error) };
|
|
516
|
+
}
|
|
517
|
+
if (!parsed || typeof parsed !== "object") {
|
|
518
|
+
return { status: "invalid", reason: "policy is not a JSON object" };
|
|
519
|
+
}
|
|
520
|
+
if (Array.isArray(parsed)) {
|
|
521
|
+
return { status: "invalid", reason: "policy is not a JSON object" };
|
|
522
|
+
}
|
|
523
|
+
const candidate = parsed;
|
|
524
|
+
if (candidate.attribution !== "allow" && candidate.attribution !== "human-only") {
|
|
525
|
+
return { status: "invalid", reason: 'attribution must be "allow" or "human-only"' };
|
|
526
|
+
}
|
|
527
|
+
if (candidate.botAllow !== void 0 && !isStringList(candidate.botAllow)) {
|
|
528
|
+
return { status: "invalid", reason: "botAllow must be an array of non-empty strings" };
|
|
529
|
+
}
|
|
530
|
+
const catalog = candidate.catalog;
|
|
531
|
+
if (!catalog || typeof catalog !== "object" || Array.isArray(catalog)) {
|
|
532
|
+
return { status: "invalid", reason: "catalog must be an object" };
|
|
533
|
+
}
|
|
534
|
+
for (const key of ["identities", "trailerKeys", "bylines", "bylineRegexSources"]) {
|
|
535
|
+
const value = catalog[key];
|
|
536
|
+
if (value !== void 0 && !isStringList(value)) {
|
|
537
|
+
return { status: "invalid", reason: `catalog.${key} must be an array of non-empty strings` };
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return { status: "ok", policy: candidate };
|
|
541
|
+
}
|
|
542
|
+
function isStringList(value) {
|
|
543
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "string" && entry.length > 0);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// src/core/config/git-attribution.ts
|
|
547
|
+
function resolveGitAttributionFromLayers(options) {
|
|
548
|
+
if (options.project?.git?.attribution) {
|
|
549
|
+
return {
|
|
550
|
+
value: options.project.git.attribution,
|
|
551
|
+
source: "project",
|
|
552
|
+
sourcePath: `${options.projectConfigFile}#git.attribution`
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
const repoRoot = dirname(dirname(dirname(options.projectConfigFile)));
|
|
556
|
+
const policyPath = join3(repoRoot, ".build-project", "guard", "policy.json");
|
|
557
|
+
const policy = readAttributionPolicy(repoRoot);
|
|
558
|
+
if (policy.status === "invalid" && !options.ignoreInvalidGuardPolicy) {
|
|
559
|
+
throw new InvalidExplicitConfigError(
|
|
560
|
+
`Invalid Guard attribution policy ${policyPath}: ${policy.reason}`
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
if (policy.status === "ok") {
|
|
564
|
+
return {
|
|
565
|
+
value: policy.policy.attribution,
|
|
566
|
+
source: "project",
|
|
567
|
+
sourcePath: `${policyPath}#attribution`
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
const user = options.readUser();
|
|
571
|
+
if (user?.git?.attribution) {
|
|
572
|
+
return {
|
|
573
|
+
value: user.git.attribution,
|
|
574
|
+
source: "user-config",
|
|
575
|
+
sourcePath: `${options.userConfigFile}#git.attribution`
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
return { value: "allow", source: "fallback" };
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// src/core/config/fast-model.ts
|
|
582
|
+
function resolveFastModel(provider, { cwd = process.cwd(), registry } = {}) {
|
|
583
|
+
const profile = getActiveProfile();
|
|
584
|
+
const { paths, project, user } = loadConfigLayers(cwd);
|
|
585
|
+
const keyPath = `defaults.providers.${provider}.fastModel`;
|
|
586
|
+
const configured = [
|
|
587
|
+
[profile?.defaults?.providers?.[provider]?.fastModel, "profile", `profile:${profile?.name}`],
|
|
588
|
+
[project?.defaults?.providers?.[provider]?.fastModel, "project", paths.projectConfigFile],
|
|
589
|
+
[user?.defaults?.providers?.[provider]?.fastModel, "user-config", paths.userConfigFile]
|
|
590
|
+
];
|
|
591
|
+
for (const [value, source, file] of configured) {
|
|
592
|
+
if (!value) continue;
|
|
593
|
+
const sourcePath = `${file}#${keyPath}`;
|
|
594
|
+
validateModelForProvider(provider, value, sourcePath, cwd);
|
|
595
|
+
return { value, source, sourcePath, slot: "user" };
|
|
596
|
+
}
|
|
597
|
+
const slotModel = ProviderRegistry.getModelForRole(provider, "fast", registry);
|
|
598
|
+
if (slotModel) {
|
|
599
|
+
return {
|
|
600
|
+
value: slotModel,
|
|
601
|
+
source: "registry",
|
|
602
|
+
sourcePath: `providers.yaml#providers.${provider}.models.roles.fast`,
|
|
603
|
+
slot: "registry"
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
const defaultModel = resolveProviderModel(provider, void 0, cwd);
|
|
607
|
+
return {
|
|
608
|
+
value: defaultModel.value,
|
|
609
|
+
source: defaultModel.source,
|
|
610
|
+
sourcePath: `fast-model:${provider} has no fast model configured; falls back to the default model`,
|
|
611
|
+
slot: "default"
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
function hasDistinctFastModel(provider, model, options = {}) {
|
|
615
|
+
const fast = resolveFastModel(provider, options);
|
|
616
|
+
if (fast.slot === "default") return false;
|
|
617
|
+
const { registry } = options;
|
|
618
|
+
const selected = normalizeModelSelectorForComparison(ProviderRegistry.resolveModel(provider, model, registry));
|
|
619
|
+
const fastId = normalizeModelSelectorForComparison(ProviderRegistry.resolveModel(provider, fast.value, registry));
|
|
620
|
+
if (selected === fastId) return true;
|
|
621
|
+
const config = ProviderRegistry.getProviderConfig(provider, registry);
|
|
622
|
+
const selectedEntry = config.models.available.find(
|
|
623
|
+
(entry) => modelSelectors(entry).some((selector) => normalizeModelSelectorForComparison(selector) === selected)
|
|
624
|
+
);
|
|
625
|
+
const fastEntry = config.models.available.find(
|
|
626
|
+
(entry) => modelSelectors(entry).some((selector) => normalizeModelSelectorForComparison(selector) === fastId)
|
|
627
|
+
);
|
|
628
|
+
if (selectedEntry && selectedEntry === fastEntry) return true;
|
|
629
|
+
const role = config.models.roles?.fast;
|
|
630
|
+
if (!role || !isFamilyAlias(provider, role, registry)) return false;
|
|
631
|
+
const flagship = familyFlagshipModel(provider, role, registry);
|
|
632
|
+
return Boolean(
|
|
633
|
+
selectedEntry && (modelFamilies(selectedEntry).some(
|
|
634
|
+
(family) => normalizeModelSelectorForComparison(family) === normalizeModelSelectorForComparison(role)
|
|
635
|
+
) || flagship?.lineage && selectedEntry.lineage === flagship.lineage)
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
function modelSelectors(entry) {
|
|
639
|
+
return [entry.id, ...entry.full_name ? [entry.full_name] : [], ...listModelRouteIds(entry)];
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// src/core/config/judge-coherence.ts
|
|
643
|
+
var DEPRECATED_JUDGE_MODELS_ALIASES = ["claude", "codex"];
|
|
644
|
+
var JUDGE_SPECIFICITY = {
|
|
645
|
+
cli: 100,
|
|
646
|
+
env: 90,
|
|
647
|
+
/** Per-judge config block: `judge.<tier>.{provider,model}` */
|
|
648
|
+
perJudge: 80,
|
|
649
|
+
/** All-judge config: root `judge.{provider,model}` */
|
|
650
|
+
allJudge: 70,
|
|
651
|
+
/** Legacy `defaults.judge.{provider,model}` */
|
|
652
|
+
legacyDefaults: 60,
|
|
653
|
+
profile: 55,
|
|
654
|
+
/** Compete shorthand plan / `--judge-models` role spec (provider-coherent by construction) */
|
|
655
|
+
plan: 30,
|
|
656
|
+
/** Derived registry/role/default values */
|
|
657
|
+
derived: 0
|
|
658
|
+
};
|
|
659
|
+
function coherentJudgeModelForProvider(provider, registryOverride) {
|
|
660
|
+
try {
|
|
661
|
+
const roleModel = ProviderRegistry.getModelForRole(provider, "judge_primary", registryOverride);
|
|
662
|
+
if (roleModel) return roleModel;
|
|
663
|
+
const defaultModel = ProviderRegistry.getProviderConfig(provider, registryOverride).models.default;
|
|
664
|
+
if (defaultModel) {
|
|
665
|
+
return ProviderRegistry.resolveModel(provider, defaultModel, registryOverride);
|
|
666
|
+
}
|
|
667
|
+
return void 0;
|
|
668
|
+
} catch {
|
|
669
|
+
return void 0;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
function judgeModelMatchesProvider(provider, model, registryOverride) {
|
|
673
|
+
try {
|
|
674
|
+
ProviderRegistry.resolveModel(provider, model, registryOverride);
|
|
675
|
+
return true;
|
|
676
|
+
} catch {
|
|
677
|
+
return false;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
function inferProviderFromRegistryOwnership(model, registryOverride) {
|
|
681
|
+
const trimmed = model.trim();
|
|
682
|
+
if (!trimmed) return void 0;
|
|
683
|
+
const owners = [];
|
|
684
|
+
for (const provider of ProviderRegistry.getEnabledProviders(registryOverride)) {
|
|
685
|
+
let config;
|
|
686
|
+
try {
|
|
687
|
+
config = ProviderRegistry.getProviderConfig(provider.id, registryOverride);
|
|
688
|
+
} catch {
|
|
689
|
+
continue;
|
|
690
|
+
}
|
|
691
|
+
const availableIds = config.models.available?.map((info) => info.id) ?? [];
|
|
692
|
+
const mappingKeys = Object.keys(config.models.mappings ?? {});
|
|
693
|
+
if (availableIds.includes(trimmed) || mappingKeys.includes(trimmed) || isFamilyAlias(provider.id, trimmed, registryOverride)) {
|
|
694
|
+
owners.push(provider.id);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
return owners.length === 1 ? owners[0] : void 0;
|
|
698
|
+
}
|
|
699
|
+
function reconcileJudgePair(provider, model, registryOverride) {
|
|
700
|
+
if (!model || !model.value || model.value === "auto") {
|
|
701
|
+
return { provider: provider.value, model: model?.value, changed: "none" };
|
|
702
|
+
}
|
|
703
|
+
if (model.specificity > provider.specificity) {
|
|
704
|
+
const owner = inferProviderFromRegistryOwnership(model.value, registryOverride);
|
|
705
|
+
if (owner && owner !== provider.value) {
|
|
706
|
+
return { provider: owner, model: model.value, changed: "provider" };
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
if (judgeModelMatchesProvider(provider.value, model.value, registryOverride)) {
|
|
710
|
+
return { provider: provider.value, model: model.value, changed: "none" };
|
|
711
|
+
}
|
|
712
|
+
if (model.specificity > provider.specificity) {
|
|
713
|
+
const owner = inferProviderFromRegistryOwnership(model.value, registryOverride);
|
|
714
|
+
if (owner) {
|
|
715
|
+
return { provider: owner, model: model.value, changed: "provider" };
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
const coherent = coherentJudgeModelForProvider(provider.value, registryOverride);
|
|
719
|
+
if (coherent) {
|
|
720
|
+
return { provider: provider.value, model: coherent, changed: "model" };
|
|
721
|
+
}
|
|
722
|
+
return { provider: provider.value, model: "auto", changed: "model-cleared" };
|
|
723
|
+
}
|
|
724
|
+
var JUDGE_TYPE_TO_ROLE = {
|
|
725
|
+
ai: "ai-primary",
|
|
726
|
+
"multi-lens": "multi-lens-technical"
|
|
727
|
+
};
|
|
728
|
+
var ALL_JUDGE_ROLES = ["ai-primary", "multi-lens-technical"];
|
|
729
|
+
function rolesForActiveJudgeTypes(activeJudgeTypes) {
|
|
730
|
+
if (!activeJudgeTypes) {
|
|
731
|
+
return ALL_JUDGE_ROLES;
|
|
732
|
+
}
|
|
733
|
+
const activeRoles = /* @__PURE__ */ new Set();
|
|
734
|
+
for (const judgeType of activeJudgeTypes) {
|
|
735
|
+
if (judgeType === "ai") {
|
|
736
|
+
activeRoles.add("ai-primary");
|
|
737
|
+
} else {
|
|
738
|
+
activeRoles.add("multi-lens-technical");
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
return ALL_JUDGE_ROLES.filter((role) => activeRoles.has(role));
|
|
742
|
+
}
|
|
743
|
+
var ROLE_TO_JUDGE_TYPE = {
|
|
744
|
+
"ai-primary": "ai",
|
|
745
|
+
"multi-lens-technical": "multi-lens"
|
|
746
|
+
};
|
|
747
|
+
var OVERRIDE_ROLE_TO_JUDGE_ROLE = {
|
|
748
|
+
ai: "ai-primary",
|
|
749
|
+
"multi-lens": "multi-lens-technical"
|
|
750
|
+
};
|
|
751
|
+
var ARBITER_ROLES = /* @__PURE__ */ new Set(["ai-primary", "multi-lens-technical"]);
|
|
752
|
+
var OVERRIDE_ROLE_EFFORT_SETTING = {
|
|
753
|
+
ai: "judge.ai.reasoningEffort (or judge.reasoningEffort)",
|
|
754
|
+
"multi-lens": "judge.multiLens.reasoningEffort (or judge.reasoningEffort)"
|
|
755
|
+
};
|
|
756
|
+
function parseJudgeModelOverride(value) {
|
|
757
|
+
const [rawRole, rawTarget] = value.split("=", 2);
|
|
758
|
+
const role = rawRole?.trim();
|
|
759
|
+
if (!role || !(role in OVERRIDE_ROLE_TO_JUDGE_ROLE) || !rawTarget?.trim()) {
|
|
760
|
+
throw new Error(
|
|
761
|
+
`Invalid --judge-model value "${value}". Expected <role>=<provider>:<model> where role is ai or multi-lens.`
|
|
762
|
+
);
|
|
763
|
+
}
|
|
764
|
+
const separator = rawTarget.indexOf(":");
|
|
765
|
+
if (separator <= 0 || separator === rawTarget.length - 1) {
|
|
766
|
+
throw new Error(`Invalid --judge-model value "${value}". Expected <role>=<provider>:<model>.`);
|
|
767
|
+
}
|
|
768
|
+
const provider = rawTarget.slice(0, separator).trim();
|
|
769
|
+
const model = rawTarget.slice(separator + 1).trim();
|
|
770
|
+
const lastSegment = model.slice(model.lastIndexOf(":") + 1);
|
|
771
|
+
if (model.includes(":") && (lastSegment.startsWith("effort-") || parseEffortToken(lastSegment, true))) {
|
|
772
|
+
throw new Error(
|
|
773
|
+
`Invalid --judge-model value "${value}". Inline effort "${lastSegment}" is not supported here; the grammar is ${role}=<provider>:<model> (effort levels: low, medium, high, extra-high, max). Set the ${role} judge effort with ${OVERRIDE_ROLE_EFFORT_SETTING[role]} in config.`
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
return { role, provider, model };
|
|
777
|
+
}
|
|
778
|
+
function resolveRoleModel(provider, modelRole, registryOverride) {
|
|
779
|
+
if (modelRole === "fast") {
|
|
780
|
+
const fastModel = resolveFastModel(provider, { registry: registryOverride }).value;
|
|
781
|
+
return ProviderRegistry.resolveModel(provider, fastModel, registryOverride);
|
|
782
|
+
}
|
|
783
|
+
const roleModel = ProviderRegistry.getModelForRole(provider, modelRole, registryOverride);
|
|
784
|
+
if (roleModel) {
|
|
785
|
+
return roleModel;
|
|
786
|
+
}
|
|
787
|
+
const defaultModel = ProviderRegistry.getDefaultModel(provider, registryOverride);
|
|
788
|
+
if (defaultModel) {
|
|
789
|
+
return ProviderRegistry.resolveModel(provider, defaultModel, registryOverride);
|
|
790
|
+
}
|
|
791
|
+
throw new Error(
|
|
792
|
+
`Judge model resolution references provider "${provider}" role "${modelRole}", but that role is not configured.`
|
|
793
|
+
);
|
|
794
|
+
}
|
|
795
|
+
function isProviderFastModel(provider, model, registryOverride) {
|
|
796
|
+
try {
|
|
797
|
+
return hasDistinctFastModel(provider, model, { registry: registryOverride });
|
|
798
|
+
} catch (error) {
|
|
799
|
+
if (error instanceof InvalidProviderModelError) throw error;
|
|
800
|
+
return false;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
function formatFastJudgeModelError(roles, registryOverride) {
|
|
804
|
+
const lines = ["Deciding judges are configured to use fast models:"];
|
|
805
|
+
const replacements = [];
|
|
806
|
+
for (const role of roles) {
|
|
807
|
+
const alias = role.judgeType;
|
|
808
|
+
lines.push(` ${alias}: ${role.provider}:${role.model} (${role.source})`);
|
|
809
|
+
const quality = ProviderRegistry.getModelForRole(
|
|
810
|
+
role.provider,
|
|
811
|
+
"judge_primary",
|
|
812
|
+
registryOverride
|
|
813
|
+
);
|
|
814
|
+
if (quality && !isProviderFastModel(role.provider, quality, registryOverride)) {
|
|
815
|
+
replacements.push(
|
|
816
|
+
`--judge-model ${quotePosixShellArg(`${alias}=${role.provider}:${quality}`)}`
|
|
817
|
+
);
|
|
818
|
+
} else {
|
|
819
|
+
lines.push(` ${role.provider} has no non-fast judge_primary model configured.`);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
lines.push(
|
|
823
|
+
"Judges that decide the winner should use a quality model; fast models may gather evidence."
|
|
824
|
+
);
|
|
825
|
+
if (replacements.length > 0) lines.push(`Recommended: ${replacements.join(" ")}`);
|
|
826
|
+
lines.push("To deliberately use the selected models, add --judge-force-model.");
|
|
827
|
+
lines.push(
|
|
828
|
+
"Their verdicts will be used, but judge calibration will be marked invalid for this run."
|
|
829
|
+
);
|
|
830
|
+
return lines.join("\n");
|
|
831
|
+
}
|
|
832
|
+
function mergeCalibrationReasons(...reasons) {
|
|
833
|
+
const merged = /* @__PURE__ */ new Set();
|
|
834
|
+
for (const reason of reasons) {
|
|
835
|
+
for (const part of reason?.split(",") ?? []) {
|
|
836
|
+
const trimmed = part.trim();
|
|
837
|
+
if (trimmed) merged.add(trimmed);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
return merged.size > 0 ? Array.from(merged).join(",") : void 0;
|
|
841
|
+
}
|
|
842
|
+
function getResolvedRole(resolution, role) {
|
|
843
|
+
return resolution?.resolvedRoles.find((entry) => entry.role === role);
|
|
844
|
+
}
|
|
845
|
+
function assertJudgeRoleCapabilities(role, provider) {
|
|
846
|
+
const caps = ProviderRegistry.getJudgeCapabilities(provider);
|
|
847
|
+
if (ARBITER_ROLES.has(role) && !caps.canArbitrate) {
|
|
848
|
+
throw new Error(
|
|
849
|
+
`Judge role "${role}" resolved to provider "${provider}", but that provider cannot arbitrate (registry canArbitrate=false).`
|
|
850
|
+
);
|
|
851
|
+
}
|
|
852
|
+
if (!caps.canJudge) {
|
|
853
|
+
throw new Error(
|
|
854
|
+
`Judge role "${role}" resolved to provider "${provider}", but that provider cannot fill generic judge roles (registry canJudge=false).`
|
|
855
|
+
);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
function assertArbiterFamilyDisjointness(resolvedRoles, registryOverride) {
|
|
859
|
+
const familyToProviders = /* @__PURE__ */ new Map();
|
|
860
|
+
for (const entry of resolvedRoles) {
|
|
861
|
+
if (!ARBITER_ROLES.has(entry.role)) continue;
|
|
862
|
+
const provider = entry.provider.trim().toLowerCase();
|
|
863
|
+
const patternOwner = ProviderRegistry.resolveProviderByModel(entry.model, registryOverride);
|
|
864
|
+
const uniqueOwner = inferProviderFromRegistryOwnership(entry.model, registryOverride);
|
|
865
|
+
const family = ProviderRegistry.getProviderFamily(
|
|
866
|
+
patternOwner ?? uniqueOwner ?? provider,
|
|
867
|
+
registryOverride
|
|
868
|
+
);
|
|
869
|
+
const members = familyToProviders.get(family) ?? /* @__PURE__ */ new Set();
|
|
870
|
+
members.add(provider);
|
|
871
|
+
familyToProviders.set(family, members);
|
|
872
|
+
}
|
|
873
|
+
const collisions = [...familyToProviders.entries()].filter(([, members]) => members.size > 1);
|
|
874
|
+
if (collisions.length === 0) return;
|
|
875
|
+
const detail = collisions.map(([family, members]) => `family "${family}" used by ${[...members].sort().join(", ")}`).join("; ");
|
|
876
|
+
throw new Error(
|
|
877
|
+
`Same-family arbiter panel is not independent: ${detail}. Arbiter-capable roles must use disjoint model families when independence is required.`
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
function resolveCanonicalJudgeRoles(options) {
|
|
881
|
+
const overrideByRole = /* @__PURE__ */ new Map();
|
|
882
|
+
for (const override of options.scopedModelOverrides ?? []) {
|
|
883
|
+
overrideByRole.set(OVERRIDE_ROLE_TO_JUDGE_ROLE[override.role], override);
|
|
884
|
+
}
|
|
885
|
+
const resolvedRoles = [];
|
|
886
|
+
const fastArbiters = [];
|
|
887
|
+
let calibrationValid = true;
|
|
888
|
+
const calibrationReasons = /* @__PURE__ */ new Set();
|
|
889
|
+
const orderedRoles = rolesForActiveJudgeTypes(options.activeJudgeTypes);
|
|
890
|
+
for (const role of orderedRoles) {
|
|
891
|
+
const roleSpec = options.plan[role];
|
|
892
|
+
const bound = roleSpec.model !== void 0;
|
|
893
|
+
const override = bound ? void 0 : overrideByRole.get(role);
|
|
894
|
+
const legacyAiModel = role === "ai-primary" && !override && !bound ? options.normalizeExplicitModel ? options.normalizeExplicitModel(options.explicitModel) : options.explicitModel : void 0;
|
|
895
|
+
let provider = override?.provider ?? roleSpec.provider;
|
|
896
|
+
let requestedModel = roleSpec.model ?? (legacyAiModel ? legacyAiModel : override ? ProviderRegistry.resolveModel(provider, override.model, options.registryOverride) : resolveRoleModel(provider, roleSpec.modelRole, options.registryOverride));
|
|
897
|
+
if (legacyAiModel) {
|
|
898
|
+
const reconciled = reconcileJudgePair(
|
|
899
|
+
{ value: provider, specificity: JUDGE_SPECIFICITY.plan },
|
|
900
|
+
{ value: requestedModel, specificity: JUDGE_SPECIFICITY.cli },
|
|
901
|
+
options.registryOverride
|
|
902
|
+
);
|
|
903
|
+
provider = reconciled.provider;
|
|
904
|
+
if (reconciled.model) {
|
|
905
|
+
requestedModel = reconciled.model;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
const source = legacyAiModel ? "legacy_ai_judge_model" : override ? "scoped_override" : roleSpec.source ?? options.planSource;
|
|
909
|
+
const model = requestedModel;
|
|
910
|
+
const modelRole = legacyAiModel || override || roleSpec.explicit ? "explicit" : roleSpec.modelRole;
|
|
911
|
+
assertJudgeRoleCapabilities(role, provider);
|
|
912
|
+
options.validateBackendSupport?.(role, provider);
|
|
913
|
+
const fastArbiter = ARBITER_ROLES.has(role) && isProviderFastModel(provider, model, options.registryOverride);
|
|
914
|
+
if (fastArbiter && options.allowUnsafeModel) {
|
|
915
|
+
calibrationValid = false;
|
|
916
|
+
calibrationReasons.add("unsafe_model_override");
|
|
917
|
+
}
|
|
918
|
+
const resolvedRole = {
|
|
919
|
+
role,
|
|
920
|
+
judgeType: ROLE_TO_JUDGE_TYPE[role],
|
|
921
|
+
provider,
|
|
922
|
+
modelRole,
|
|
923
|
+
model,
|
|
924
|
+
source,
|
|
925
|
+
...fastArbiter && options.allowUnsafeModel ? { qualityFloorOverride: true } : {}
|
|
926
|
+
};
|
|
927
|
+
resolvedRoles.push(resolvedRole);
|
|
928
|
+
if (fastArbiter) fastArbiters.push(resolvedRole);
|
|
929
|
+
}
|
|
930
|
+
if (fastArbiters.length > 0 && !options.allowUnsafeModel) {
|
|
931
|
+
throw new Error(formatFastJudgeModelError(fastArbiters, options.registryOverride));
|
|
932
|
+
}
|
|
933
|
+
const panelProviders = new Set(
|
|
934
|
+
resolvedRoles.filter((role) => role.role === "ai-primary" || role.role === "multi-lens-technical").map((role) => role.provider)
|
|
935
|
+
);
|
|
936
|
+
calibrationReasons.add(`panel_providers=${Array.from(panelProviders).sort().join("+")}`);
|
|
937
|
+
if (new Set(resolvedRoles.map((role) => role.provider)).size > 1) {
|
|
938
|
+
calibrationReasons.add("mixed_providers");
|
|
939
|
+
}
|
|
940
|
+
if (overrideByRole.size > 0) {
|
|
941
|
+
calibrationReasons.add("scoped_override");
|
|
942
|
+
}
|
|
943
|
+
if (options.explicitModel && !overrideByRole.has("ai-primary")) {
|
|
944
|
+
calibrationReasons.add("legacy_ai_judge_model");
|
|
945
|
+
}
|
|
946
|
+
const activeArbiterCount = resolvedRoles.filter((entry) => ARBITER_ROLES.has(entry.role)).length;
|
|
947
|
+
if (activeArbiterCount >= 2) {
|
|
948
|
+
assertArbiterFamilyDisjointness(resolvedRoles, options.registryOverride);
|
|
949
|
+
}
|
|
950
|
+
return {
|
|
951
|
+
judgeModels: options.planId,
|
|
952
|
+
source: options.planSource,
|
|
953
|
+
resolvedRoles,
|
|
954
|
+
overrides: Array.from(new Set((options.scopedModelOverrides ?? []).map((o) => o.role))),
|
|
955
|
+
calibrationValid,
|
|
956
|
+
calibrationReason: Array.from(calibrationReasons).join(",")
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
function resolveCanonicalJudgeTier(options) {
|
|
960
|
+
const { judgeType, judgeConfig } = options;
|
|
961
|
+
const judgeModelResolution = resolveCanonicalJudgeRoles({
|
|
962
|
+
...options,
|
|
963
|
+
activeJudgeTypes: [judgeType]
|
|
964
|
+
});
|
|
965
|
+
const scoringTier = (() => {
|
|
966
|
+
const tiers = JUDGE_SCORING_CONFIG.tiers;
|
|
967
|
+
if (judgeType === "ai") return tiers.ai;
|
|
968
|
+
return tiers.multiLens;
|
|
969
|
+
})();
|
|
970
|
+
const role = JUDGE_TYPE_TO_ROLE[judgeType];
|
|
971
|
+
const planRole = getResolvedRole(judgeModelResolution, role);
|
|
972
|
+
const scoringDefaults = {
|
|
973
|
+
...planRole ? { provider: planRole.provider } : {},
|
|
974
|
+
...planRole?.model ? { model: planRole.model } : {},
|
|
975
|
+
...scoringTier.thinkingBudgetTokens !== void 0 ? { thinkingBudgetTokens: scoringTier.thinkingBudgetTokens } : void 0,
|
|
976
|
+
...scoringTier.requireThinking !== void 0 ? { requireThinking: scoringTier.requireThinking } : void 0
|
|
977
|
+
};
|
|
978
|
+
const tierOverride = (() => {
|
|
979
|
+
if (!judgeConfig) return void 0;
|
|
980
|
+
if (judgeType === "ai") return judgeConfig.ai;
|
|
981
|
+
return judgeConfig.multiLens;
|
|
982
|
+
})();
|
|
983
|
+
const {
|
|
984
|
+
provider: _tierProvider,
|
|
985
|
+
model: _tierModel,
|
|
986
|
+
reasoningEffort: _tierEffort,
|
|
987
|
+
...tierExtras
|
|
988
|
+
} = tierOverride ?? {};
|
|
989
|
+
const allJudgeExtras = Object.fromEntries(
|
|
990
|
+
Object.entries({
|
|
991
|
+
prompt: judgeType === "ai" ? judgeConfig?.prompt : void 0,
|
|
992
|
+
thinkingBudgetTokens: judgeType === "ai" ? judgeConfig?.thinkingBudgetTokens : void 0,
|
|
993
|
+
requireThinking: judgeType === "ai" ? judgeConfig?.requireThinking : void 0
|
|
994
|
+
}).filter(([, v]) => v !== void 0)
|
|
995
|
+
);
|
|
996
|
+
const resolved = {
|
|
997
|
+
...scoringDefaults,
|
|
998
|
+
...allJudgeExtras,
|
|
999
|
+
...tierExtras,
|
|
1000
|
+
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {}
|
|
1001
|
+
};
|
|
1002
|
+
resolved.judgeModels = judgeModelResolution.judgeModels;
|
|
1003
|
+
resolved.judgeModelResolvedRoles = judgeModelResolution.resolvedRoles;
|
|
1004
|
+
resolved.judgeModelOverrides = judgeModelResolution.overrides;
|
|
1005
|
+
resolved.calibrationValid = (resolved.calibrationValid ?? true) && judgeModelResolution.calibrationValid;
|
|
1006
|
+
resolved.calibrationReason = mergeCalibrationReasons(
|
|
1007
|
+
judgeModelResolution.calibrationReason,
|
|
1008
|
+
resolved.calibrationReason
|
|
1009
|
+
);
|
|
1010
|
+
return resolved;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
// src/core/config/judge-binding.ts
|
|
1014
|
+
var JUDGE_TYPE_TO_CONFIG_KEY = {
|
|
1015
|
+
ai: "ai",
|
|
1016
|
+
"multi-lens": "multiLens"
|
|
1017
|
+
};
|
|
1018
|
+
function judgeLayerBlocks(config, pathPrefix, judgeType) {
|
|
1019
|
+
if (!config) return [];
|
|
1020
|
+
const blocks = [];
|
|
1021
|
+
const add = (fields, keyPath) => {
|
|
1022
|
+
if (!fields) return;
|
|
1023
|
+
blocks.push({
|
|
1024
|
+
provider: fields.provider,
|
|
1025
|
+
model: fields.model,
|
|
1026
|
+
reasoningEffort: fields.reasoningEffort,
|
|
1027
|
+
sourcePath: (field) => `${pathPrefix}${keyPath}.${field}`
|
|
1028
|
+
});
|
|
1029
|
+
};
|
|
1030
|
+
if (judgeType) {
|
|
1031
|
+
const tierKey = JUDGE_TYPE_TO_CONFIG_KEY[judgeType];
|
|
1032
|
+
add(config.judge?.[tierKey], `judge.${tierKey}`);
|
|
1033
|
+
}
|
|
1034
|
+
add(config.judge, "judge");
|
|
1035
|
+
add(config.defaults?.judge, "defaults.judge");
|
|
1036
|
+
return blocks;
|
|
1037
|
+
}
|
|
1038
|
+
function pickField(blocks, field) {
|
|
1039
|
+
for (const [index, block] of blocks.entries()) {
|
|
1040
|
+
const value = block[field];
|
|
1041
|
+
if (value) {
|
|
1042
|
+
const sourcePath = block.sourcePath(field);
|
|
1043
|
+
return { value: String(value), block: index, ...sourcePath ? { sourcePath } : {} };
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
return void 0;
|
|
1047
|
+
}
|
|
1048
|
+
function modelFitsProvider(provider, model) {
|
|
1049
|
+
if (model === "auto") return true;
|
|
1050
|
+
try {
|
|
1051
|
+
ProviderRegistry.resolveModel(provider, model);
|
|
1052
|
+
return true;
|
|
1053
|
+
} catch {
|
|
1054
|
+
return false;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
function collapseLayer(layer) {
|
|
1058
|
+
const provider = pickField(layer.blocks, "provider");
|
|
1059
|
+
const model = pickField(layer.blocks, "model");
|
|
1060
|
+
const effortBlock = layer.blocks.find((block) => block.reasoningEffort);
|
|
1061
|
+
const resolved = (field) => ({
|
|
1062
|
+
value: field.value,
|
|
1063
|
+
source: layer.source,
|
|
1064
|
+
...field.sourcePath ? { sourcePath: field.sourcePath } : {}
|
|
1065
|
+
});
|
|
1066
|
+
const effortPath = effortBlock?.sourcePath("reasoningEffort");
|
|
1067
|
+
const collapsed = {
|
|
1068
|
+
...provider ? { provider: resolved(provider) } : {},
|
|
1069
|
+
...model ? { model: resolved(model) } : {},
|
|
1070
|
+
...effortBlock ? {
|
|
1071
|
+
effort: {
|
|
1072
|
+
value: effortBlock.reasoningEffort,
|
|
1073
|
+
source: layer.source,
|
|
1074
|
+
...effortPath ? { sourcePath: effortPath } : {}
|
|
1075
|
+
}
|
|
1076
|
+
} : {}
|
|
1077
|
+
};
|
|
1078
|
+
if (!model || model.value === "auto") return collapsed;
|
|
1079
|
+
if (!provider || model.block < provider.block) {
|
|
1080
|
+
const owner = inferProviderFromRegistryOwnership(model.value);
|
|
1081
|
+
if (owner && owner !== provider?.value) {
|
|
1082
|
+
collapsed.provider = {
|
|
1083
|
+
value: owner,
|
|
1084
|
+
source: layer.source,
|
|
1085
|
+
sourcePath: `${model.sourcePath ?? "judge.model"} (provider inferred from model)`
|
|
1086
|
+
};
|
|
1087
|
+
return collapsed;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
if (provider && !modelFitsProvider(provider.value, model.value)) {
|
|
1091
|
+
delete collapsed.model;
|
|
1092
|
+
collapsed.droppedModel = resolved(model);
|
|
1093
|
+
collapsed.droppedModelPairedWithProvider = model.block <= provider.block;
|
|
1094
|
+
}
|
|
1095
|
+
return collapsed;
|
|
1096
|
+
}
|
|
1097
|
+
function parseEffort(effort) {
|
|
1098
|
+
const normalized = normalizeReasoningEffortInput(effort.value);
|
|
1099
|
+
if (!normalized) {
|
|
1100
|
+
throw new InvalidExplicitConfigError(
|
|
1101
|
+
`Invalid judge reasoning effort at ${effort.sourcePath}: ${String(effort.value)}`
|
|
1102
|
+
);
|
|
1103
|
+
}
|
|
1104
|
+
return {
|
|
1105
|
+
value: normalized,
|
|
1106
|
+
source: effort.source,
|
|
1107
|
+
...effort.sourcePath ? { sourcePath: effort.sourcePath } : {}
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
function isRegisteredProvider(provider) {
|
|
1111
|
+
try {
|
|
1112
|
+
ProviderRegistry.getProviderConfig(provider);
|
|
1113
|
+
return true;
|
|
1114
|
+
} catch {
|
|
1115
|
+
return false;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
function mustFailUnusable(model, provider) {
|
|
1119
|
+
if (model.value.trim().toLowerCase() === "default") return false;
|
|
1120
|
+
const owner = inferProviderFromRegistryOwnership(model.value);
|
|
1121
|
+
return owner !== void 0 && owner !== provider.value && isRegisteredProvider(provider.value);
|
|
1122
|
+
}
|
|
1123
|
+
function unusableJudgeModelError(model, provider) {
|
|
1124
|
+
const modelAt = model.sourcePath ?? model.source;
|
|
1125
|
+
const providerAt = provider.sourcePath ?? provider.source;
|
|
1126
|
+
return new InvalidExplicitConfigError(
|
|
1127
|
+
`Judge model "${model.value}" (${modelAt}) cannot run on judge provider "${provider.value}" (${providerAt}). Set a model that provider hosts, or set the judge provider that hosts it.`
|
|
1128
|
+
);
|
|
1129
|
+
}
|
|
1130
|
+
function resolveJudgeBinding(input) {
|
|
1131
|
+
const layers = input.layers.map(collapseLayer);
|
|
1132
|
+
const provider = layers.find((layer) => layer.provider)?.provider ?? input.defaultProvider();
|
|
1133
|
+
const pairsWithWinner = (layer) => !layer.provider || layer.provider.value === provider.value;
|
|
1134
|
+
const providerLayer = layers.findIndex((layer) => layer.provider);
|
|
1135
|
+
const outranking = providerLayer === -1 ? layers.length : providerLayer;
|
|
1136
|
+
let model;
|
|
1137
|
+
let reconciled = false;
|
|
1138
|
+
for (const [index, layer] of layers.entries()) {
|
|
1139
|
+
if (layer.droppedModel) {
|
|
1140
|
+
if (layer.droppedModelPairedWithProvider && pairsWithWinner(layer) && mustFailUnusable(layer.droppedModel, provider)) {
|
|
1141
|
+
throw unusableJudgeModelError(layer.droppedModel, provider);
|
|
1142
|
+
}
|
|
1143
|
+
reconciled = true;
|
|
1144
|
+
}
|
|
1145
|
+
if (!layer.model) continue;
|
|
1146
|
+
const fits = layer.provider || modelFitsProvider(provider.value, layer.model.value);
|
|
1147
|
+
if (pairsWithWinner(layer) && fits) {
|
|
1148
|
+
model = layer.model;
|
|
1149
|
+
break;
|
|
1150
|
+
}
|
|
1151
|
+
if (pairsWithWinner(layer) && index < outranking && mustFailUnusable(layer.model, provider)) {
|
|
1152
|
+
throw unusableJudgeModelError(layer.model, provider);
|
|
1153
|
+
}
|
|
1154
|
+
reconciled = true;
|
|
1155
|
+
}
|
|
1156
|
+
if (!model) {
|
|
1157
|
+
const derived = coherentJudgeModelForProvider(provider.value);
|
|
1158
|
+
if (reconciled) {
|
|
1159
|
+
model = {
|
|
1160
|
+
value: derived ?? "auto",
|
|
1161
|
+
source: "registry",
|
|
1162
|
+
sourcePath: `providers.yaml#providers.${provider.value}.models (judge role, reconciled)`
|
|
1163
|
+
};
|
|
1164
|
+
} else if (derived) {
|
|
1165
|
+
model = {
|
|
1166
|
+
value: derived,
|
|
1167
|
+
source: "registry",
|
|
1168
|
+
sourcePath: `providers.yaml#providers.${provider.value}.models (judge role)`
|
|
1169
|
+
};
|
|
1170
|
+
} else {
|
|
1171
|
+
model = { value: "auto", source: "fallback" };
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
const effortLayer = layers.find((layer) => layer.effort && pairsWithWinner(layer));
|
|
1175
|
+
const reasoningEffort = effortLayer?.effort ? parseEffort(effortLayer.effort) : input.defaultEffort(provider);
|
|
1176
|
+
return { provider, model, ...reasoningEffort ? { reasoningEffort } : {} };
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
// src/core/config/resolution-engine.ts
|
|
1180
|
+
function getConfigPaths2(cwd) {
|
|
1181
|
+
const paths = getConfigPaths(cwd);
|
|
1182
|
+
return {
|
|
1183
|
+
...paths,
|
|
1184
|
+
projectConfigFile: selectedBuildConfigCandidate(paths.projectConfigFile),
|
|
1185
|
+
userConfigFile: selectedBuildConfigCandidate(paths.userConfigFile)
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
var InvalidProviderModelError = class extends Error {
|
|
1189
|
+
constructor(message, model, sourcePath) {
|
|
1190
|
+
super(message);
|
|
1191
|
+
this.model = model;
|
|
1192
|
+
this.sourcePath = sourcePath;
|
|
1193
|
+
this.name = "InvalidProviderModelError";
|
|
1194
|
+
}
|
|
1195
|
+
model;
|
|
1196
|
+
sourcePath;
|
|
1197
|
+
};
|
|
1198
|
+
var EXECUTION_TRANSPORT_MODES = /* @__PURE__ */ new Set(["auto", "headless", "tmux-exec", "interactive"]);
|
|
1199
|
+
var CONFIGURABLE_EXECUTION_TRANSPORT_PROVIDERS = new Set(ENABLED_PROVIDER_IDS);
|
|
1200
|
+
function normalizeProviderId(provider) {
|
|
1201
|
+
if (typeof provider !== "string" || provider.length === 0) {
|
|
1202
|
+
return "";
|
|
1203
|
+
}
|
|
1204
|
+
const normalized = provider.toLowerCase();
|
|
1205
|
+
if (normalized === "cursor-cli") return "cursor";
|
|
1206
|
+
if (normalized === "copilot-cli") return "copilot";
|
|
1207
|
+
if (normalized === "anti-gravity" || normalized === "antigravity-cli" || normalized === "agy") {
|
|
1208
|
+
return "antigravity";
|
|
1209
|
+
}
|
|
1210
|
+
if (normalized === "openai" || normalized === "gpt") {
|
|
1211
|
+
return "codex";
|
|
1212
|
+
}
|
|
1213
|
+
return normalized;
|
|
1214
|
+
}
|
|
1215
|
+
function normalizePlanExecuteBlockerMode(value) {
|
|
1216
|
+
if (typeof value !== "string") {
|
|
1217
|
+
return void 0;
|
|
1218
|
+
}
|
|
1219
|
+
const normalized = value.trim().toLowerCase();
|
|
1220
|
+
if (normalized === "non-interactive" || normalized === "interactive") {
|
|
1221
|
+
return normalized;
|
|
1222
|
+
}
|
|
1223
|
+
return void 0;
|
|
1224
|
+
}
|
|
1225
|
+
function normalizeExecutionTransportMode(value) {
|
|
1226
|
+
if (typeof value !== "string") {
|
|
1227
|
+
return void 0;
|
|
1228
|
+
}
|
|
1229
|
+
const normalized = value.trim().toLowerCase();
|
|
1230
|
+
if (normalized === "interactive") {
|
|
1231
|
+
return "tmux-exec";
|
|
1232
|
+
}
|
|
1233
|
+
if (EXECUTION_TRANSPORT_MODES.has(normalized)) {
|
|
1234
|
+
return normalized;
|
|
1235
|
+
}
|
|
1236
|
+
return void 0;
|
|
1237
|
+
}
|
|
1238
|
+
function resolveDurablePlanExecuteBlockerMode(value, sourcePath) {
|
|
1239
|
+
if (value === void 0) {
|
|
1240
|
+
return void 0;
|
|
1241
|
+
}
|
|
1242
|
+
const normalized = normalizePlanExecuteBlockerMode(value);
|
|
1243
|
+
if (normalized) {
|
|
1244
|
+
return normalized;
|
|
1245
|
+
}
|
|
1246
|
+
throw new Error(
|
|
1247
|
+
`Invalid planExecute.blockerMode at ${sourcePath}: ${String(value)}. Expected non-interactive or interactive. questions-only is only valid as a CLI flag.`
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1250
|
+
function resolveDurableExecutionTransportMode(value, sourcePath) {
|
|
1251
|
+
if (value === void 0) {
|
|
1252
|
+
return void 0;
|
|
1253
|
+
}
|
|
1254
|
+
const normalized = normalizeExecutionTransportMode(value);
|
|
1255
|
+
if (normalized) {
|
|
1256
|
+
return normalized;
|
|
1257
|
+
}
|
|
1258
|
+
throw new Error(
|
|
1259
|
+
`Invalid execution.transport value at ${sourcePath}: ${String(value)}. Expected auto, headless, or tmux-exec (interactive is a deprecated alias).`
|
|
1260
|
+
);
|
|
1261
|
+
}
|
|
1262
|
+
function validateExecutionTransportProviderMap(providers, sourcePath) {
|
|
1263
|
+
if (!providers) return;
|
|
1264
|
+
for (const provider of Object.keys(providers)) {
|
|
1265
|
+
if (!CONFIGURABLE_EXECUTION_TRANSPORT_PROVIDERS.has(provider)) {
|
|
1266
|
+
throw new Error(
|
|
1267
|
+
`Invalid execution.transport.providers key at ${sourcePath}: ${provider}. Known providers: ${[...CONFIGURABLE_EXECUTION_TRANSPORT_PROVIDERS].sort().join(", ")}.`
|
|
1268
|
+
);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
function inferProviderFromModel(model, cwd) {
|
|
1273
|
+
if (!model || model.trim().length === 0) {
|
|
1274
|
+
return void 0;
|
|
1275
|
+
}
|
|
1276
|
+
const trimmed = model.trim();
|
|
1277
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
1278
|
+
const colonIdx = trimmed.indexOf(":");
|
|
1279
|
+
if (colonIdx > 0) {
|
|
1280
|
+
const provider = normalizeProviderId(trimmed.slice(0, colonIdx));
|
|
1281
|
+
if (Object.hasOwn(registry.providers, provider)) {
|
|
1282
|
+
return provider;
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
return inferProviderFromRegistryOwnership(trimmed, registry) ?? inferProviderFromRouteOwnership(trimmed, registry);
|
|
1286
|
+
}
|
|
1287
|
+
function inferProviderFromRouteOwnership(model, registry) {
|
|
1288
|
+
const owners = ProviderRegistry.getEnabledProviders(registry).filter((provider) => {
|
|
1289
|
+
try {
|
|
1290
|
+
const rows = ProviderRegistry.getProviderConfig(provider.id, registry).models.available;
|
|
1291
|
+
return rows?.some((row) => listModelRouteIds(row).includes(model)) ?? false;
|
|
1292
|
+
} catch {
|
|
1293
|
+
return false;
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
return owners.length === 1 ? owners[0]?.id : void 0;
|
|
1297
|
+
}
|
|
1298
|
+
function validateModelForProvider(provider, model, sourcePath, cwd) {
|
|
1299
|
+
try {
|
|
1300
|
+
ProviderRegistry.resolveModel(provider, model, loadProviderRegistryForCwd(cwd));
|
|
1301
|
+
} catch (error) {
|
|
1302
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
1303
|
+
throw new InvalidProviderModelError(
|
|
1304
|
+
`Invalid model '${model}' for provider '${provider}' at ${sourcePath}. Configure a matching provider explicitly or use a model supported by '${provider}'. ${detail}`,
|
|
1305
|
+
model,
|
|
1306
|
+
sourcePath
|
|
1307
|
+
);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
function resolveJudgeType(cli, cwd = process.cwd()) {
|
|
1311
|
+
const paths = getConfigPaths2(cwd);
|
|
1312
|
+
const normalizeJudgeType = (value) => {
|
|
1313
|
+
if (!value) return void 0;
|
|
1314
|
+
const retired = retiredJudgeSelectionError(value);
|
|
1315
|
+
if (retired) throw retired;
|
|
1316
|
+
const normalized = value.trim().toLowerCase();
|
|
1317
|
+
return normalized === "ai" || normalized === "multi-lens" ? normalized : void 0;
|
|
1318
|
+
};
|
|
1319
|
+
const cliJudgeType = normalizeJudgeType(cli?.judgeType);
|
|
1320
|
+
if (cliJudgeType) {
|
|
1321
|
+
return { value: cliJudgeType, source: "cli", sourcePath: "cli:--judge-type" };
|
|
1322
|
+
}
|
|
1323
|
+
const envType = normalizeJudgeType(process.env.BUILD_JUDGE_TYPE);
|
|
1324
|
+
if (envType) {
|
|
1325
|
+
return {
|
|
1326
|
+
value: envType,
|
|
1327
|
+
source: "env",
|
|
1328
|
+
sourcePath: "env:BUILD_JUDGE_TYPE"
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
const activeProfile = getActiveProfile();
|
|
1332
|
+
if (activeProfile?.defaults?.judge?.type) {
|
|
1333
|
+
const profileType = normalizeJudgeType(activeProfile.defaults.judge.type);
|
|
1334
|
+
if (profileType) {
|
|
1335
|
+
return {
|
|
1336
|
+
value: profileType,
|
|
1337
|
+
source: "profile",
|
|
1338
|
+
sourcePath: `profile:${activeProfile.name}#defaults.judge.type`
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
const projectConfig = loadProjectConfig(cwd);
|
|
1343
|
+
if (projectConfig?.defaults?.judge?.type) {
|
|
1344
|
+
return {
|
|
1345
|
+
value: projectConfig.defaults.judge.type,
|
|
1346
|
+
source: "project",
|
|
1347
|
+
sourcePath: `${paths.projectConfigFile}#defaults.judge.type`
|
|
1348
|
+
};
|
|
1349
|
+
}
|
|
1350
|
+
const userConfig = loadUserConfig(cwd);
|
|
1351
|
+
if (userConfig?.defaults?.judge?.type) {
|
|
1352
|
+
return {
|
|
1353
|
+
value: userConfig.defaults.judge.type,
|
|
1354
|
+
source: "user-config",
|
|
1355
|
+
sourcePath: `${paths.userConfigFile}#defaults.judge.type`
|
|
1356
|
+
};
|
|
1357
|
+
}
|
|
1358
|
+
warnIfLegacyConfigExists(cwd);
|
|
1359
|
+
return { value: "ai", source: "fallback" };
|
|
1360
|
+
}
|
|
1361
|
+
function resolveConfigExecutionTransport(config, provider, source, configPath) {
|
|
1362
|
+
const transport = config?.execution?.transport;
|
|
1363
|
+
if (!transport) return void 0;
|
|
1364
|
+
validateExecutionTransportProviderMap(
|
|
1365
|
+
transport.providers,
|
|
1366
|
+
`${configPath}#execution.transport.providers`
|
|
1367
|
+
);
|
|
1368
|
+
if (!CONFIGURABLE_EXECUTION_TRANSPORT_PROVIDERS.has(provider)) {
|
|
1369
|
+
return void 0;
|
|
1370
|
+
}
|
|
1371
|
+
const providerValue = resolveDurableExecutionTransportMode(
|
|
1372
|
+
transport.providers?.[provider],
|
|
1373
|
+
`${configPath}#execution.transport.providers.${provider}`
|
|
1374
|
+
);
|
|
1375
|
+
if (providerValue) {
|
|
1376
|
+
return {
|
|
1377
|
+
value: providerValue,
|
|
1378
|
+
source,
|
|
1379
|
+
sourcePath: `${configPath}#execution.transport.providers.${provider}`
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
const defaultValue = resolveDurableExecutionTransportMode(
|
|
1383
|
+
transport.default,
|
|
1384
|
+
`${configPath}#execution.transport.default`
|
|
1385
|
+
);
|
|
1386
|
+
if (defaultValue) {
|
|
1387
|
+
return {
|
|
1388
|
+
value: defaultValue,
|
|
1389
|
+
source,
|
|
1390
|
+
sourcePath: `${configPath}#execution.transport.default`
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
return void 0;
|
|
1394
|
+
}
|
|
1395
|
+
var unifiedConfigCache = /* @__PURE__ */ new Map();
|
|
1396
|
+
var warnedKeys = /* @__PURE__ */ new Set();
|
|
1397
|
+
var legacyWarningShown = false;
|
|
1398
|
+
function warnIfLegacyConfigExists(cwd = process.cwd()) {
|
|
1399
|
+
if (legacyWarningShown) return;
|
|
1400
|
+
legacyWarningShown = true;
|
|
1401
|
+
const legacyPaths = /* @__PURE__ */ new Set([join4(cwd, ".build-project", "config", "build.json")]);
|
|
1402
|
+
legacyPaths.add(join4(getUserConfigDir(), "defaults.yaml"));
|
|
1403
|
+
if (process.env.BUILD_DEFAULTS_PATH?.trim()) {
|
|
1404
|
+
legacyPaths.add(process.env.BUILD_DEFAULTS_PATH.trim());
|
|
1405
|
+
}
|
|
1406
|
+
for (const p of legacyPaths) {
|
|
1407
|
+
if (existsSync(p)) {
|
|
1408
|
+
emitWarning(
|
|
1409
|
+
"CFG-LEGACY",
|
|
1410
|
+
{
|
|
1411
|
+
taskId: "resolution-engine",
|
|
1412
|
+
subsystem: "config",
|
|
1413
|
+
executionPhase: "setup"
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
severity: "WARN" /* WARN */,
|
|
1417
|
+
metadata: {
|
|
1418
|
+
message: `Found deprecated config file: ${p}. This file is no longer read. Move settings to the appropriate build.config.jsonc file.`,
|
|
1419
|
+
path: p,
|
|
1420
|
+
operation: "warnIfLegacyConfigExists"
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
);
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
function clearConfigCaches() {
|
|
1428
|
+
unifiedConfigCache.clear();
|
|
1429
|
+
warnedKeys.clear();
|
|
1430
|
+
legacyWarningShown = false;
|
|
1431
|
+
resetActiveProfileCache();
|
|
1432
|
+
ProviderRegistry.reload();
|
|
1433
|
+
}
|
|
1434
|
+
function normalizeLoadedBuildConfig(configData, sourceFile) {
|
|
1435
|
+
return normalizeLegacyIntoCanonical(configData, { sourceFile });
|
|
1436
|
+
}
|
|
1437
|
+
function loadBuildConfigFile(configPath) {
|
|
1438
|
+
const fingerprint = fingerprintFile(configPath);
|
|
1439
|
+
const cached = unifiedConfigCache.get(configPath);
|
|
1440
|
+
if (cached && cached.fingerprint === fingerprint) {
|
|
1441
|
+
if (cached.error) throw cached.error;
|
|
1442
|
+
return cached.value ?? null;
|
|
1443
|
+
}
|
|
1444
|
+
const result = readCanonicalBuildConfig(configPath);
|
|
1445
|
+
if (result.status === "missing") {
|
|
1446
|
+
unifiedConfigCache.set(configPath, {
|
|
1447
|
+
value: null,
|
|
1448
|
+
error: null,
|
|
1449
|
+
fingerprint
|
|
1450
|
+
});
|
|
1451
|
+
return null;
|
|
1452
|
+
}
|
|
1453
|
+
if (result.status === "invalid") {
|
|
1454
|
+
unifiedConfigCache.set(configPath, {
|
|
1455
|
+
value: null,
|
|
1456
|
+
error: result.error,
|
|
1457
|
+
fingerprint
|
|
1458
|
+
});
|
|
1459
|
+
throw result.error;
|
|
1460
|
+
}
|
|
1461
|
+
const normalizedConfig = normalizeLoadedBuildConfig(
|
|
1462
|
+
result.config,
|
|
1463
|
+
configPath
|
|
1464
|
+
);
|
|
1465
|
+
unifiedConfigCache.set(configPath, {
|
|
1466
|
+
value: normalizedConfig,
|
|
1467
|
+
error: null,
|
|
1468
|
+
fingerprint
|
|
1469
|
+
});
|
|
1470
|
+
return normalizedConfig;
|
|
1471
|
+
}
|
|
1472
|
+
function loadBuildConfigFromCandidates(configPath) {
|
|
1473
|
+
const candidates = buildConfigCandidates(configPath);
|
|
1474
|
+
warnIfShadowedConfigCandidate(candidates);
|
|
1475
|
+
for (const candidate of candidates) {
|
|
1476
|
+
const config = loadBuildConfigFile(candidate);
|
|
1477
|
+
if (config) return config;
|
|
1478
|
+
}
|
|
1479
|
+
return null;
|
|
1480
|
+
}
|
|
1481
|
+
function loadUserConfig(cwd = process.cwd()) {
|
|
1482
|
+
const { userConfigFile } = getConfigPaths2(cwd);
|
|
1483
|
+
return loadBuildConfigFromCandidates(userConfigFile);
|
|
1484
|
+
}
|
|
1485
|
+
function loadProjectConfig(cwd = process.cwd()) {
|
|
1486
|
+
if (projectConfigAliasesUserConfig(cwd)) return null;
|
|
1487
|
+
const { projectConfigFile } = getConfigPaths2(cwd);
|
|
1488
|
+
return loadBuildConfigFromCandidates(projectConfigFile);
|
|
1489
|
+
}
|
|
1490
|
+
function loadConfigLayers(cwd = process.cwd()) {
|
|
1491
|
+
const paths = getConfigPaths2(cwd);
|
|
1492
|
+
return { paths, project: loadProjectConfig(cwd), user: loadUserConfig(cwd) };
|
|
1493
|
+
}
|
|
1494
|
+
function pickAskBudgetKeys(ask) {
|
|
1495
|
+
if (!ask) return void 0;
|
|
1496
|
+
return {
|
|
1497
|
+
timeoutSeconds: ask.timeoutSeconds,
|
|
1498
|
+
idleWarnSeconds: ask.idleWarnSeconds,
|
|
1499
|
+
idleKillSeconds: ask.idleKillSeconds,
|
|
1500
|
+
stdinDeadlineSeconds: ask.stdinDeadlineSeconds
|
|
1501
|
+
};
|
|
1502
|
+
}
|
|
1503
|
+
function resolveAskConfig(cwd = process.cwd()) {
|
|
1504
|
+
const userAsk = loadUserConfig(cwd)?.ask;
|
|
1505
|
+
const projectAsk = loadProjectConfig(cwd)?.ask;
|
|
1506
|
+
if (!userAsk && !projectAsk) return void 0;
|
|
1507
|
+
return {
|
|
1508
|
+
userPresets: userAsk?.presets,
|
|
1509
|
+
projectPresets: projectAsk?.presets,
|
|
1510
|
+
userBudget: pickAskBudgetKeys(userAsk),
|
|
1511
|
+
projectBudget: pickAskBudgetKeys(projectAsk)
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
function resolveProgressNarrationConfig(cwd = process.cwd()) {
|
|
1515
|
+
const paths = getConfigPaths2(cwd);
|
|
1516
|
+
const projectNarration = loadProjectConfig(cwd)?.progressNarration;
|
|
1517
|
+
if (projectNarration) {
|
|
1518
|
+
return {
|
|
1519
|
+
value: projectNarration,
|
|
1520
|
+
source: "project",
|
|
1521
|
+
sourcePath: `${paths.projectConfigFile}#progressNarration`
|
|
1522
|
+
};
|
|
1523
|
+
}
|
|
1524
|
+
const userNarration = loadUserConfig(cwd)?.progressNarration;
|
|
1525
|
+
if (userNarration) {
|
|
1526
|
+
return {
|
|
1527
|
+
value: userNarration,
|
|
1528
|
+
source: "user-config",
|
|
1529
|
+
sourcePath: `${paths.userConfigFile}#progressNarration`
|
|
1530
|
+
};
|
|
1531
|
+
}
|
|
1532
|
+
return void 0;
|
|
1533
|
+
}
|
|
1534
|
+
function resolveEphemeralTelemetryReplication(cwd = process.cwd()) {
|
|
1535
|
+
const env = readEnv(BUILD_TELEMETRY_EPHEMERAL_REPLICATION);
|
|
1536
|
+
if (env.source === "env") {
|
|
1537
|
+
return {
|
|
1538
|
+
value: env.value ?? true,
|
|
1539
|
+
source: "env",
|
|
1540
|
+
sourcePath: BUILD_TELEMETRY_EPHEMERAL_REPLICATION.name
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
const paths = getConfigPaths2(cwd);
|
|
1544
|
+
const projectValue = loadProjectConfig(cwd)?.telemetry?.ephemeralReplication;
|
|
1545
|
+
if (typeof projectValue === "boolean") {
|
|
1546
|
+
return {
|
|
1547
|
+
value: projectValue,
|
|
1548
|
+
source: "project",
|
|
1549
|
+
sourcePath: `${paths.projectConfigFile}#telemetry.ephemeralReplication`
|
|
1550
|
+
};
|
|
1551
|
+
}
|
|
1552
|
+
const userValue = loadUserConfig(cwd)?.telemetry?.ephemeralReplication;
|
|
1553
|
+
if (typeof userValue === "boolean") {
|
|
1554
|
+
return {
|
|
1555
|
+
value: userValue,
|
|
1556
|
+
source: "user-config",
|
|
1557
|
+
sourcePath: `${paths.userConfigFile}#telemetry.ephemeralReplication`
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
return {
|
|
1561
|
+
value: true,
|
|
1562
|
+
source: "fallback",
|
|
1563
|
+
sourcePath: "built-in:telemetry.ephemeralReplication"
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
function warnOnce(key, message) {
|
|
1567
|
+
if (warnedKeys.has(key)) return;
|
|
1568
|
+
warnedKeys.add(key);
|
|
1569
|
+
emitWarning(
|
|
1570
|
+
"CFG-004",
|
|
1571
|
+
{
|
|
1572
|
+
taskId: "resolution-engine",
|
|
1573
|
+
subsystem: "config",
|
|
1574
|
+
executionPhase: "setup"
|
|
1575
|
+
},
|
|
1576
|
+
{
|
|
1577
|
+
severity: "WARN" /* WARN */,
|
|
1578
|
+
metadata: {
|
|
1579
|
+
message
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
);
|
|
1583
|
+
}
|
|
1584
|
+
function getProviderEnvModel(provider) {
|
|
1585
|
+
const envModel = readProviderModelFromEnv(provider);
|
|
1586
|
+
if (!envModel) return null;
|
|
1587
|
+
if (envModel.kind === "standardized") {
|
|
1588
|
+
return { value: envModel.value, source: "env", sourcePath: `env:${envModel.key}` };
|
|
1589
|
+
}
|
|
1590
|
+
const standardizedKey = `BUILD_${provider.toUpperCase()}_DEFAULT_MODEL`;
|
|
1591
|
+
warnOnce(envModel.key, `${envModel.key} is deprecated. Use ${standardizedKey} instead.`);
|
|
1592
|
+
return { value: envModel.value, source: "env-legacy", sourcePath: `env-legacy:${envModel.key}` };
|
|
1593
|
+
}
|
|
1594
|
+
function loadProviderRegistryForCwd(cwd) {
|
|
1595
|
+
return ProviderRegistry.load(void 0, cwd);
|
|
1596
|
+
}
|
|
1597
|
+
function checkDefaultProviderEnablement(providerValue, cwd = process.cwd()) {
|
|
1598
|
+
const providerId = normalizeProviderId(providerValue.trim());
|
|
1599
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
1600
|
+
const registryPath = ProviderRegistry.getLoadedConfigPath() ?? resolveProvidersConfigPath({ cwd });
|
|
1601
|
+
const providerConfig = registry.providers[providerId];
|
|
1602
|
+
const enabledProviders = Object.values(registry.providers).filter((provider) => provider.enabled).sort((a, b) => a.order - b.order).map((provider) => provider.id);
|
|
1603
|
+
return {
|
|
1604
|
+
providerId,
|
|
1605
|
+
providerKnown: Boolean(providerConfig),
|
|
1606
|
+
providerEnabled: Boolean(providerConfig?.enabled),
|
|
1607
|
+
knownProviders: Object.keys(registry.providers).sort(),
|
|
1608
|
+
enabledProviders,
|
|
1609
|
+
registryPath,
|
|
1610
|
+
disabledBy: providerDisableSwitch(registry, providerId)
|
|
1611
|
+
};
|
|
1612
|
+
}
|
|
1613
|
+
var DefaultProviderUnusableError = class extends Error {
|
|
1614
|
+
code = "DEFAULT_PROVIDER_UNUSABLE";
|
|
1615
|
+
reason;
|
|
1616
|
+
constructor(message, reason) {
|
|
1617
|
+
super(message);
|
|
1618
|
+
this.name = "DefaultProviderUnusableError";
|
|
1619
|
+
this.reason = reason;
|
|
1620
|
+
}
|
|
1621
|
+
};
|
|
1622
|
+
function assertDefaultProviderEnabled(resolved, cwd) {
|
|
1623
|
+
const check = checkDefaultProviderEnablement(resolved.value, cwd);
|
|
1624
|
+
if (!check.providerKnown) {
|
|
1625
|
+
throw new DefaultProviderUnusableError(
|
|
1626
|
+
`Invalid default provider '${check.providerId}' from ${resolved.sourcePath ?? resolved.source}: provider is not available in providers.yaml. Available enabled providers: ${check.enabledProviders.join(", ") || "(none)"}.`,
|
|
1627
|
+
"unknown"
|
|
1628
|
+
);
|
|
1629
|
+
}
|
|
1630
|
+
if (!check.providerEnabled) {
|
|
1631
|
+
const source = resolved.sourcePath ?? resolved.source;
|
|
1632
|
+
throw new DefaultProviderUnusableError(
|
|
1633
|
+
`Invalid default provider '${check.providerId}' from ${source}: provider is disabled ${check.disabledBy ? `by ${check.disabledBy}. Remove that setting` : `in ${check.registryPath}. Enable providers.${check.providerId}.enabled`} or choose an enabled provider.`,
|
|
1634
|
+
"disabled"
|
|
1635
|
+
);
|
|
1636
|
+
}
|
|
1637
|
+
return { ...resolved, value: check.providerId };
|
|
1638
|
+
}
|
|
1639
|
+
function resolveDefaultProvider(cli, cwd = process.cwd()) {
|
|
1640
|
+
const declared = resolveDeclaredDefaultProvider(cli, cwd);
|
|
1641
|
+
if (declared) return declared;
|
|
1642
|
+
warnIfLegacyConfigExists(cwd);
|
|
1643
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
1644
|
+
const order = resolveFallbackProviderOrder(cwd);
|
|
1645
|
+
const fromOrder = firstInstalledProvider(order.providers, registry);
|
|
1646
|
+
if (fromOrder) {
|
|
1647
|
+
return { value: fromOrder, source: "registry", sourcePath: order.sourcePath };
|
|
1648
|
+
}
|
|
1649
|
+
const registryPath = ProviderRegistry.getLoadedConfigPath() ?? resolveProvidersConfigPath({ cwd });
|
|
1650
|
+
const enabled = ProviderRegistry.getEnabledProviders(registry).map((provider) => provider.id);
|
|
1651
|
+
const first = firstInstalledProvider(enabled, registry);
|
|
1652
|
+
if (first) {
|
|
1653
|
+
return { value: first, source: "registry", sourcePath: `${registryPath}#providers.*.order` };
|
|
1654
|
+
}
|
|
1655
|
+
throw new Error(
|
|
1656
|
+
`Invalid provider registry at ${registryPath}: no providers are enabled. Enable at least one providers.<id>.enabled entry.`
|
|
1657
|
+
);
|
|
1658
|
+
}
|
|
1659
|
+
function resolveDefaultJudgeProvider(_cli, cwd = process.cwd()) {
|
|
1660
|
+
return selectDefaultJudgeProvider(loadProviderRegistryForCwd(cwd), cwd);
|
|
1661
|
+
}
|
|
1662
|
+
async function resolveReadyDefaultProvider(cli, cwd = process.cwd()) {
|
|
1663
|
+
const provider = resolveDefaultProvider(cli, cwd);
|
|
1664
|
+
const readiness = await assertProviderReady(provider.value);
|
|
1665
|
+
return { provider, readiness };
|
|
1666
|
+
}
|
|
1667
|
+
function resolveGitAttribution(cwd = process.cwd(), options = {}) {
|
|
1668
|
+
const paths = getConfigPaths2(cwd);
|
|
1669
|
+
return resolveGitAttributionFromLayers({
|
|
1670
|
+
project: loadProjectConfig(cwd),
|
|
1671
|
+
readUser: () => loadUserConfig(cwd),
|
|
1672
|
+
projectConfigFile: paths.projectConfigFile,
|
|
1673
|
+
userConfigFile: paths.userConfigFile,
|
|
1674
|
+
...options
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
function resolveProviderModel(providerInput, cli, cwd = process.cwd()) {
|
|
1678
|
+
const provider = normalizeProviderId(providerInput);
|
|
1679
|
+
const paths = getConfigPaths2(cwd);
|
|
1680
|
+
const configuredModel = (value, source, sourcePath) => {
|
|
1681
|
+
validateModelForProvider(provider, value, sourcePath, cwd);
|
|
1682
|
+
if (source === "cli") warnIfExplicitModelUnobserved(provider, value);
|
|
1683
|
+
return { value, source, sourcePath };
|
|
1684
|
+
};
|
|
1685
|
+
let defaultProviderCache;
|
|
1686
|
+
const ownsUnscopedModel = (layerProvider) => {
|
|
1687
|
+
if (layerProvider && normalizeProviderId(layerProvider) !== provider) return false;
|
|
1688
|
+
if (defaultProviderCache === void 0) {
|
|
1689
|
+
defaultProviderCache = resolveDefaultProvider(cli, cwd).value;
|
|
1690
|
+
}
|
|
1691
|
+
return defaultProviderCache === provider;
|
|
1692
|
+
};
|
|
1693
|
+
if (cli?.model) {
|
|
1694
|
+
if (cli.provider && normalizeProviderId(cli.provider) === provider) {
|
|
1695
|
+
return configuredModel(cli.model, "cli", "cli:--model");
|
|
1696
|
+
}
|
|
1697
|
+
if (!cli.provider && ownsUnscopedModel()) {
|
|
1698
|
+
return configuredModel(cli.model, "cli", "cli:--model");
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
const envModel = getProviderEnvModel(provider);
|
|
1702
|
+
if (envModel) {
|
|
1703
|
+
return configuredModel(envModel.value, envModel.source, envModel.sourcePath);
|
|
1704
|
+
}
|
|
1705
|
+
const activeProfile = getActiveProfile();
|
|
1706
|
+
const profileProviderModel = activeProfile?.defaults?.providers?.[provider]?.model;
|
|
1707
|
+
if (activeProfile && profileProviderModel) {
|
|
1708
|
+
warnSetupModelPin(activeProfile, provider, profileProviderModel, () => loadConfigLayers(cwd));
|
|
1709
|
+
return configuredModel(
|
|
1710
|
+
profileProviderModel,
|
|
1711
|
+
"profile",
|
|
1712
|
+
`profile:${activeProfile.name}#defaults.providers.${provider}.model`
|
|
1713
|
+
);
|
|
1714
|
+
}
|
|
1715
|
+
if (activeProfile?.defaults?.model && ownsUnscopedModel(activeProfile.defaults.provider)) {
|
|
1716
|
+
return configuredModel(
|
|
1717
|
+
activeProfile.defaults.model,
|
|
1718
|
+
"profile",
|
|
1719
|
+
`profile:${activeProfile.name}#defaults.model`
|
|
1720
|
+
);
|
|
1721
|
+
}
|
|
1722
|
+
const projectConfig = loadProjectConfig(cwd);
|
|
1723
|
+
const projectConfigProviderModel = projectConfig?.defaults?.providers?.[provider]?.model;
|
|
1724
|
+
if (projectConfigProviderModel) {
|
|
1725
|
+
return configuredModel(
|
|
1726
|
+
projectConfigProviderModel,
|
|
1727
|
+
"project",
|
|
1728
|
+
`${paths.projectConfigFile}#defaults.providers.${provider}.model`
|
|
1729
|
+
);
|
|
1730
|
+
}
|
|
1731
|
+
if (projectConfig?.defaults?.model && ownsUnscopedModel(projectConfig.defaults.provider)) {
|
|
1732
|
+
return configuredModel(
|
|
1733
|
+
projectConfig.defaults.model,
|
|
1734
|
+
"project",
|
|
1735
|
+
`${paths.projectConfigFile}#defaults.model`
|
|
1736
|
+
);
|
|
1737
|
+
}
|
|
1738
|
+
const userConfig = loadUserConfig(cwd);
|
|
1739
|
+
const userConfigProviderModel = userConfig?.defaults?.providers?.[provider]?.model;
|
|
1740
|
+
if (userConfigProviderModel) {
|
|
1741
|
+
return configuredModel(
|
|
1742
|
+
userConfigProviderModel,
|
|
1743
|
+
"user-config",
|
|
1744
|
+
`${paths.userConfigFile}#defaults.providers.${provider}.model`
|
|
1745
|
+
);
|
|
1746
|
+
}
|
|
1747
|
+
if (userConfig?.defaults?.model && ownsUnscopedModel(userConfig.defaults.provider)) {
|
|
1748
|
+
return configuredModel(
|
|
1749
|
+
userConfig.defaults.model,
|
|
1750
|
+
"user-config",
|
|
1751
|
+
`${paths.userConfigFile}#defaults.model`
|
|
1752
|
+
);
|
|
1753
|
+
}
|
|
1754
|
+
warnIfLegacyConfigExists(cwd);
|
|
1755
|
+
try {
|
|
1756
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
1757
|
+
const registryModel = ProviderRegistry.getProviderConfig(provider, registry).models.default;
|
|
1758
|
+
const validatedModel = ProviderRegistry.resolveModel(provider, registryModel, registry);
|
|
1759
|
+
return {
|
|
1760
|
+
value: validatedModel,
|
|
1761
|
+
source: "registry",
|
|
1762
|
+
sourcePath: `providers.yaml#providers.${provider}.models.default`
|
|
1763
|
+
};
|
|
1764
|
+
} catch (error) {
|
|
1765
|
+
emitResolutionWarningOnce({
|
|
1766
|
+
operation: "resolveProviderModel",
|
|
1767
|
+
provider,
|
|
1768
|
+
message: `Provider '${provider}' has no usable providers.yaml default model; falling back to model 'auto'`,
|
|
1769
|
+
error: error instanceof Error ? error.message : String(error)
|
|
1770
|
+
});
|
|
1771
|
+
return { value: "auto", source: "fallback" };
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
function resolveProviderReasoningEffort(provider, cli, cwd = process.cwd()) {
|
|
1775
|
+
const paths = getConfigPaths2(cwd);
|
|
1776
|
+
const configured = (value, source, sourcePath) => {
|
|
1777
|
+
const normalized = normalizeReasoningEffortInput(value);
|
|
1778
|
+
if (!normalized) {
|
|
1779
|
+
throw new InvalidExplicitConfigError(
|
|
1780
|
+
`Invalid reasoning effort at ${sourcePath}: ${String(value)}`
|
|
1781
|
+
);
|
|
1782
|
+
}
|
|
1783
|
+
return { value: normalized, source, sourcePath };
|
|
1784
|
+
};
|
|
1785
|
+
if (cli?.reasoningEffort) {
|
|
1786
|
+
return configured(cli.reasoningEffort, "cli", "cli:--reasoning-effort");
|
|
1787
|
+
}
|
|
1788
|
+
const activeProfile = getActiveProfile();
|
|
1789
|
+
const profileEffort = activeProfile?.defaults?.providers?.[provider]?.reasoningEffort;
|
|
1790
|
+
if (activeProfile && profileEffort) {
|
|
1791
|
+
return configured(
|
|
1792
|
+
profileEffort,
|
|
1793
|
+
"profile",
|
|
1794
|
+
`profile:${activeProfile.name}#defaults.providers.${provider}.reasoningEffort`
|
|
1795
|
+
);
|
|
1796
|
+
}
|
|
1797
|
+
const projectConfig = loadProjectConfig(cwd);
|
|
1798
|
+
const projectEffort = projectConfig?.defaults?.providers?.[provider]?.reasoningEffort;
|
|
1799
|
+
if (projectEffort) {
|
|
1800
|
+
return configured(
|
|
1801
|
+
projectEffort,
|
|
1802
|
+
"project",
|
|
1803
|
+
`${paths.projectConfigFile}#defaults.providers.${provider}.reasoningEffort`
|
|
1804
|
+
);
|
|
1805
|
+
}
|
|
1806
|
+
const userConfig = loadUserConfig(cwd);
|
|
1807
|
+
const userEffort = userConfig?.defaults?.providers?.[provider]?.reasoningEffort;
|
|
1808
|
+
if (userEffort) {
|
|
1809
|
+
return configured(
|
|
1810
|
+
userEffort,
|
|
1811
|
+
"user-config",
|
|
1812
|
+
`${paths.userConfigFile}#defaults.providers.${provider}.reasoningEffort`
|
|
1813
|
+
);
|
|
1814
|
+
}
|
|
1815
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
1816
|
+
if (!ProviderRegistry.getEnabledProviders(registry).some((entry) => entry.id === provider)) {
|
|
1817
|
+
return void 0;
|
|
1818
|
+
}
|
|
1819
|
+
const registryEffort = ProviderRegistry.getProviderConfig(provider, registry).models.default_reasoning_effort;
|
|
1820
|
+
if (registryEffort) {
|
|
1821
|
+
return configured(
|
|
1822
|
+
registryEffort,
|
|
1823
|
+
"registry",
|
|
1824
|
+
`providers.yaml#providers.${provider}.models.default_reasoning_effort`
|
|
1825
|
+
);
|
|
1826
|
+
}
|
|
1827
|
+
return void 0;
|
|
1828
|
+
}
|
|
1829
|
+
var CLI_JUDGE_SOURCE_PATHS = {
|
|
1830
|
+
provider: void 0,
|
|
1831
|
+
model: "cli:--judge-model",
|
|
1832
|
+
// No CLI flag sets judge effort; only a caller's judge options do.
|
|
1833
|
+
reasoningEffort: "caller:judge reasoningEffort option"
|
|
1834
|
+
};
|
|
1835
|
+
function resolveJudgeSettings(cli, cwd, judgeType, env = process.env) {
|
|
1836
|
+
const paths = getConfigPaths2(cwd);
|
|
1837
|
+
const activeProfile = getActiveProfile();
|
|
1838
|
+
const providerId = (provider) => provider?.trim() ? normalizeProviderId(provider.trim()) : void 0;
|
|
1839
|
+
const configLayer = (source, config, pathPrefix) => ({
|
|
1840
|
+
source,
|
|
1841
|
+
blocks: judgeLayerBlocks(config, pathPrefix, judgeType).map((block) => ({
|
|
1842
|
+
...block,
|
|
1843
|
+
provider: providerId(block.provider)
|
|
1844
|
+
}))
|
|
1845
|
+
});
|
|
1846
|
+
const layers = [
|
|
1847
|
+
{
|
|
1848
|
+
source: "cli",
|
|
1849
|
+
blocks: [
|
|
1850
|
+
{
|
|
1851
|
+
provider: providerId(cli?.judgeProvider),
|
|
1852
|
+
model: cli?.judgeModel,
|
|
1853
|
+
reasoningEffort: cli?.judgeReasoningEffort,
|
|
1854
|
+
sourcePath: (field) => CLI_JUDGE_SOURCE_PATHS[field]
|
|
1855
|
+
}
|
|
1856
|
+
]
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
source: "env",
|
|
1860
|
+
blocks: [
|
|
1861
|
+
{
|
|
1862
|
+
provider: providerId(env.BUILD_JUDGE_PROVIDER),
|
|
1863
|
+
model: env.BUILD_JUDGE_MODEL?.trim() || void 0,
|
|
1864
|
+
sourcePath: (field) => field === "provider" ? "env:BUILD_JUDGE_PROVIDER" : "env:BUILD_JUDGE_MODEL"
|
|
1865
|
+
}
|
|
1866
|
+
]
|
|
1867
|
+
},
|
|
1868
|
+
...activeProfile ? [
|
|
1869
|
+
configLayer(
|
|
1870
|
+
"profile",
|
|
1871
|
+
activeProfile,
|
|
1872
|
+
`profile:${activeProfile.name}#`
|
|
1873
|
+
)
|
|
1874
|
+
] : [],
|
|
1875
|
+
configLayer("project", loadProjectConfig(cwd), `${paths.projectConfigFile}#`),
|
|
1876
|
+
configLayer("user-config", loadUserConfig(cwd), `${paths.userConfigFile}#`)
|
|
1877
|
+
];
|
|
1878
|
+
const binding = resolveJudgeBinding({
|
|
1879
|
+
layers,
|
|
1880
|
+
// With no judge provider set, the first installed judge- and arbiter-capable
|
|
1881
|
+
// provider in the priority list judges.
|
|
1882
|
+
defaultProvider: () => {
|
|
1883
|
+
warnIfLegacyConfigExists(cwd);
|
|
1884
|
+
const defaultProvider = resolveDefaultJudgeProvider(cli, cwd);
|
|
1885
|
+
return {
|
|
1886
|
+
value: defaultProvider.value,
|
|
1887
|
+
source: defaultProvider.source,
|
|
1888
|
+
sourcePath: defaultProvider.sourcePath ? `judge-default:${defaultProvider.sourcePath}` : "judge-default:execution-provider"
|
|
1889
|
+
};
|
|
1890
|
+
},
|
|
1891
|
+
// With no judge effort set, the final provider's registry judge entry supplies it,
|
|
1892
|
+
// whatever chose that provider. Without an entry Build sends no effort; coding
|
|
1893
|
+
// effort never applies.
|
|
1894
|
+
defaultEffort: (provider) => {
|
|
1895
|
+
const registryEffort = ProviderRegistry.getJudgeReasoningEffort(
|
|
1896
|
+
provider.value,
|
|
1897
|
+
loadProviderRegistryForCwd(cwd)
|
|
1898
|
+
);
|
|
1899
|
+
return registryEffort ? {
|
|
1900
|
+
value: registryEffort,
|
|
1901
|
+
source: "registry",
|
|
1902
|
+
sourcePath: `providers.yaml#providers.${provider.value}.models.judge_reasoning_effort`
|
|
1903
|
+
} : void 0;
|
|
1904
|
+
}
|
|
1905
|
+
});
|
|
1906
|
+
if (binding.model.source === "registry" || binding.model.source === "fallback") {
|
|
1907
|
+
warnIfLegacyConfigExists(cwd);
|
|
1908
|
+
}
|
|
1909
|
+
return binding;
|
|
1910
|
+
}
|
|
1911
|
+
function resolveJudgeProvider(cli, cwd = process.cwd(), judgeType) {
|
|
1912
|
+
return resolveJudgeSettings(cli, cwd, judgeType).provider;
|
|
1913
|
+
}
|
|
1914
|
+
function resolveJudgeModel(cli, cwd = process.cwd(), judgeType) {
|
|
1915
|
+
return resolveJudgeSettings(cli, cwd, judgeType).model;
|
|
1916
|
+
}
|
|
1917
|
+
function resolveJudgeReasoningEffort(cli, cwd = process.cwd(), judgeType) {
|
|
1918
|
+
return resolveJudgeSettings(cli, cwd, judgeType).reasoningEffort;
|
|
1919
|
+
}
|
|
1920
|
+
function defaultsLayers(cwd) {
|
|
1921
|
+
const paths = getConfigPaths2(cwd);
|
|
1922
|
+
const profile = getActiveProfile();
|
|
1923
|
+
const layer = (source, defaults, prefix) => ({ source, defaults, path: (key) => `${prefix}#defaults.${key}` });
|
|
1924
|
+
return [
|
|
1925
|
+
...profile ? [layer("profile", profile.defaults, `profile:${profile.name}`)] : [],
|
|
1926
|
+
layer("project", loadProjectConfig(cwd)?.defaults, paths.projectConfigFile),
|
|
1927
|
+
layer("user-config", loadUserConfig(cwd)?.defaults, paths.userConfigFile)
|
|
1928
|
+
];
|
|
1929
|
+
}
|
|
1930
|
+
function layerFitsProvider(block, provider, cwd) {
|
|
1931
|
+
const owner = block?.provider ? normalizeProviderId(block.provider) : inferProviderFromModel(block?.model, cwd);
|
|
1932
|
+
return owner === void 0 || owner === provider;
|
|
1933
|
+
}
|
|
1934
|
+
function configuredReasoningEffort(value, source, sourcePath) {
|
|
1935
|
+
const normalized = normalizeReasoningEffortInput(value);
|
|
1936
|
+
if (!normalized) {
|
|
1937
|
+
throw new InvalidExplicitConfigError(
|
|
1938
|
+
`Invalid reasoning effort at ${sourcePath}: ${String(value)}`
|
|
1939
|
+
);
|
|
1940
|
+
}
|
|
1941
|
+
return { value: normalized, source, sourcePath };
|
|
1942
|
+
}
|
|
1943
|
+
function resolvePurposeReasoningEffort(purpose, provider, cwd) {
|
|
1944
|
+
for (const { source, defaults, path: path3 } of defaultsLayers(cwd)) {
|
|
1945
|
+
const block = defaults?.[purpose];
|
|
1946
|
+
if (block?.reasoningEffort && layerFitsProvider(block, provider, cwd)) {
|
|
1947
|
+
return configuredReasoningEffort(
|
|
1948
|
+
block.reasoningEffort,
|
|
1949
|
+
source,
|
|
1950
|
+
path3(`${purpose}.reasoningEffort`)
|
|
1951
|
+
);
|
|
1952
|
+
}
|
|
1953
|
+
const providerEffort = defaults?.providers?.[provider]?.reasoningEffort;
|
|
1954
|
+
if (providerEffort) {
|
|
1955
|
+
return configuredReasoningEffort(
|
|
1956
|
+
providerEffort,
|
|
1957
|
+
source,
|
|
1958
|
+
path3(`providers.${provider}.reasoningEffort`)
|
|
1959
|
+
);
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
return resolveProviderReasoningEffort(provider, void 0, cwd);
|
|
1963
|
+
}
|
|
1964
|
+
function resolveSynthesisModel(cli, cwd = process.cwd()) {
|
|
1965
|
+
const provider = resolveSynthesisProvider(cli, cwd).value;
|
|
1966
|
+
const configuredModel = (value, source, sourcePath) => {
|
|
1967
|
+
validateModelForProvider(provider, value, sourcePath, cwd);
|
|
1968
|
+
return { value, source, sourcePath };
|
|
1969
|
+
};
|
|
1970
|
+
if (cli?.synthesisModel) {
|
|
1971
|
+
return configuredModel(cli.synthesisModel, "cli", "cli:--synthesis-model");
|
|
1972
|
+
}
|
|
1973
|
+
const envSynthesisModel = process.env.BUILD_SYNTHESIS_MODEL;
|
|
1974
|
+
if (envSynthesisModel) {
|
|
1975
|
+
return configuredModel(envSynthesisModel, "env", "env:BUILD_SYNTHESIS_MODEL");
|
|
1976
|
+
}
|
|
1977
|
+
for (const { source, defaults, path: path3 } of defaultsLayers(cwd)) {
|
|
1978
|
+
const synthesis = defaults?.synthesis;
|
|
1979
|
+
if (synthesis?.model && layerFitsProvider(synthesis, provider, cwd)) {
|
|
1980
|
+
return configuredModel(synthesis.model, source, path3("synthesis.model"));
|
|
1981
|
+
}
|
|
1982
|
+
const providerModel = defaults?.providers?.[provider]?.model;
|
|
1983
|
+
if (providerModel) {
|
|
1984
|
+
return configuredModel(providerModel, source, path3(`providers.${provider}.model`));
|
|
1985
|
+
}
|
|
1986
|
+
if (defaults?.model && layerFitsProvider(defaults, provider, cwd)) {
|
|
1987
|
+
return configuredModel(defaults.model, source, path3("model"));
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
warnIfLegacyConfigExists(cwd);
|
|
1991
|
+
try {
|
|
1992
|
+
const model = ProviderRegistry.getProviderConfig(provider, loadProviderRegistryForCwd(cwd)).models.default;
|
|
1993
|
+
return {
|
|
1994
|
+
value: model,
|
|
1995
|
+
source: "registry",
|
|
1996
|
+
sourcePath: `providers.yaml#providers.${provider}.models.default`
|
|
1997
|
+
};
|
|
1998
|
+
} catch {
|
|
1999
|
+
return { value: "auto", source: "fallback" };
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
function resolveForConfig(resolve, options, onInvalid) {
|
|
2003
|
+
if (options?.strictSynthesisModel !== false) {
|
|
2004
|
+
return resolve();
|
|
2005
|
+
}
|
|
2006
|
+
try {
|
|
2007
|
+
return resolve();
|
|
2008
|
+
} catch (error) {
|
|
2009
|
+
if (!(error instanceof InvalidProviderModelError)) {
|
|
2010
|
+
throw error;
|
|
2011
|
+
}
|
|
2012
|
+
return onInvalid({
|
|
2013
|
+
value: "invalid",
|
|
2014
|
+
source: "fallback",
|
|
2015
|
+
sourcePath: `resolution-error:${error.message}`
|
|
2016
|
+
});
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
function resolveSynthesisProvider(cli, cwd = process.cwd()) {
|
|
2020
|
+
if (cli?.synthesisProvider) {
|
|
2021
|
+
return {
|
|
2022
|
+
value: normalizeProviderId(cli.synthesisProvider),
|
|
2023
|
+
source: "cli",
|
|
2024
|
+
sourcePath: "cli:--synthesis-provider"
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
const cliInferredProvider = inferProviderFromModel(cli?.synthesisModel, cwd);
|
|
2028
|
+
if (cliInferredProvider) {
|
|
2029
|
+
return {
|
|
2030
|
+
value: cliInferredProvider,
|
|
2031
|
+
source: "cli",
|
|
2032
|
+
sourcePath: "cli:--synthesis-model"
|
|
2033
|
+
};
|
|
2034
|
+
}
|
|
2035
|
+
const envProvider = process.env.BUILD_SYNTHESIS_PROVIDER;
|
|
2036
|
+
if (envProvider) {
|
|
2037
|
+
return {
|
|
2038
|
+
value: normalizeProviderId(envProvider),
|
|
2039
|
+
source: "env",
|
|
2040
|
+
sourcePath: "env:BUILD_SYNTHESIS_PROVIDER"
|
|
2041
|
+
};
|
|
2042
|
+
}
|
|
2043
|
+
const envModelProvider = inferProviderFromModel(process.env.BUILD_SYNTHESIS_MODEL, cwd);
|
|
2044
|
+
if (envModelProvider) {
|
|
2045
|
+
return {
|
|
2046
|
+
value: envModelProvider,
|
|
2047
|
+
source: "env",
|
|
2048
|
+
sourcePath: "env:BUILD_SYNTHESIS_MODEL"
|
|
2049
|
+
};
|
|
2050
|
+
}
|
|
2051
|
+
for (const { source, defaults, path: path3 } of defaultsLayers(cwd)) {
|
|
2052
|
+
if (defaults?.synthesis?.provider) {
|
|
2053
|
+
return {
|
|
2054
|
+
value: normalizeProviderId(defaults.synthesis.provider),
|
|
2055
|
+
source,
|
|
2056
|
+
sourcePath: path3("synthesis.provider")
|
|
2057
|
+
};
|
|
2058
|
+
}
|
|
2059
|
+
const synthesisOwner = inferProviderFromModel(defaults?.synthesis?.model, cwd);
|
|
2060
|
+
if (synthesisOwner) {
|
|
2061
|
+
return { value: synthesisOwner, source, sourcePath: path3("synthesis.model") };
|
|
2062
|
+
}
|
|
2063
|
+
const defaultOwner = inferProviderFromModel(defaults?.model, cwd);
|
|
2064
|
+
const override = declaredDefaultOverridingOwner(defaultOwner, source, cli, cwd);
|
|
2065
|
+
if (override) return override;
|
|
2066
|
+
if (defaultOwner) return { value: defaultOwner, source, sourcePath: path3("model") };
|
|
2067
|
+
}
|
|
2068
|
+
warnIfLegacyConfigExists(cwd);
|
|
2069
|
+
const defaultProvider = resolveDefaultProvider(cli, cwd);
|
|
2070
|
+
return defaultProvider.source === "fallback" || defaultProvider.source === "registry" ? { ...defaultProvider, source: "fallback", sourcePath: "synthesis-provider:default-fallback" } : defaultProvider;
|
|
2071
|
+
}
|
|
2072
|
+
function resolveSynthesisReasoningEffort(cli, cwd = process.cwd(), provider) {
|
|
2073
|
+
if (cli?.reasoningEffort) {
|
|
2074
|
+
return configuredReasoningEffort(cli.reasoningEffort, "cli", "cli:--reasoning-effort");
|
|
2075
|
+
}
|
|
2076
|
+
const synthesisProvider = provider ? normalizeProviderId(provider) : resolveSynthesisProvider(cli, cwd).value;
|
|
2077
|
+
return resolvePurposeReasoningEffort("synthesis", synthesisProvider, cwd);
|
|
2078
|
+
}
|
|
2079
|
+
function resolveSplitterExecution(cli, cwd = process.cwd()) {
|
|
2080
|
+
const layers = defaultsLayers(cwd);
|
|
2081
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
2082
|
+
const envModel = process.env.BUILD_SPLITTER_MODEL;
|
|
2083
|
+
const modelOwner = (model2, source, sourcePath) => {
|
|
2084
|
+
const value = inferProviderFromModel(model2, cwd);
|
|
2085
|
+
return value ? { value, source, sourcePath } : void 0;
|
|
2086
|
+
};
|
|
2087
|
+
const layerProvider = () => {
|
|
2088
|
+
for (const { source, defaults, path: path3 } of layers) {
|
|
2089
|
+
const splitter = defaults?.splitter;
|
|
2090
|
+
const named = splitter?.provider ? {
|
|
2091
|
+
value: normalizeProviderId(splitter.provider),
|
|
2092
|
+
source,
|
|
2093
|
+
sourcePath: path3("splitter.provider")
|
|
2094
|
+
} : modelOwner(splitter?.model, source, path3("splitter.model"));
|
|
2095
|
+
if (named) return named;
|
|
2096
|
+
}
|
|
2097
|
+
return void 0;
|
|
2098
|
+
};
|
|
2099
|
+
const provider = (cli?.splitterProvider ? {
|
|
2100
|
+
value: normalizeProviderId(cli.splitterProvider),
|
|
2101
|
+
source: "cli",
|
|
2102
|
+
sourcePath: "cli:--splitter-provider"
|
|
2103
|
+
} : void 0) ?? modelOwner(cli?.splitterModel, "cli", "cli:--splitter-model") ?? modelOwner(envModel, "env", "env:BUILD_SPLITTER_MODEL") ?? layerProvider() ?? resolveDefaultProvider(cli, cwd);
|
|
2104
|
+
const fitting = layers.filter(
|
|
2105
|
+
({ defaults }) => layerFitsProvider(defaults?.splitter, provider.value, cwd)
|
|
2106
|
+
);
|
|
2107
|
+
const modelLayer = fitting.find(({ defaults }) => defaults?.splitter?.model);
|
|
2108
|
+
const configuredModel = cli?.splitterModel ? { value: cli.splitterModel, source: "cli", sourcePath: "cli:--splitter-model" } : envModel ? { value: envModel, source: "env", sourcePath: "env:BUILD_SPLITTER_MODEL" } : modelLayer?.defaults?.splitter?.model ? {
|
|
2109
|
+
value: modelLayer.defaults.splitter.model,
|
|
2110
|
+
source: modelLayer.source,
|
|
2111
|
+
sourcePath: modelLayer.path("splitter.model")
|
|
2112
|
+
} : void 0;
|
|
2113
|
+
if (configuredModel) {
|
|
2114
|
+
validateModelForProvider(
|
|
2115
|
+
provider.value,
|
|
2116
|
+
configuredModel.value,
|
|
2117
|
+
configuredModel.sourcePath,
|
|
2118
|
+
cwd
|
|
2119
|
+
);
|
|
2120
|
+
}
|
|
2121
|
+
const selectedModel = configuredModel ?? {
|
|
2122
|
+
value: ProviderRegistry.getProviderConfig(provider.value, registry).models.default,
|
|
2123
|
+
source: "registry",
|
|
2124
|
+
sourcePath: `providers.yaml#providers.${provider.value}.models.default`
|
|
2125
|
+
};
|
|
2126
|
+
const model = {
|
|
2127
|
+
...selectedModel,
|
|
2128
|
+
value: ProviderRegistry.resolveModel(provider.value, selectedModel.value, registry)
|
|
2129
|
+
};
|
|
2130
|
+
const reasoningEffort = cli?.reasoningEffort ? configuredReasoningEffort(cli.reasoningEffort, "cli", "cli:--reasoning-effort") : resolvePurposeReasoningEffort("splitter", provider.value, cwd);
|
|
2131
|
+
return { provider, model, ...reasoningEffort ? { reasoningEffort } : {} };
|
|
2132
|
+
}
|
|
2133
|
+
function resolveSplitterModel(cli, cwd = process.cwd()) {
|
|
2134
|
+
return resolveSplitterExecution(cli, cwd).model;
|
|
2135
|
+
}
|
|
2136
|
+
function resolveSplitterReasoningEffort(cli, cwd = process.cwd()) {
|
|
2137
|
+
return resolveSplitterExecution(cli, cwd).reasoningEffort;
|
|
2138
|
+
}
|
|
2139
|
+
function resolveIntentDecompositionHints(cwd = process.cwd()) {
|
|
2140
|
+
const paths = getConfigPaths2(cwd);
|
|
2141
|
+
const projectConfig = loadProjectConfig(cwd);
|
|
2142
|
+
const projectHints = projectConfig?.defaults?.intent?.decompositionHints;
|
|
2143
|
+
if (Array.isArray(projectHints) && projectHints.length > 0) {
|
|
2144
|
+
return {
|
|
2145
|
+
value: projectHints.filter((v) => typeof v === "string" && v.length > 0),
|
|
2146
|
+
source: "project",
|
|
2147
|
+
sourcePath: `${paths.projectConfigFile}#defaults.intent.decompositionHints`
|
|
2148
|
+
};
|
|
2149
|
+
}
|
|
2150
|
+
const userConfig = loadUserConfig(cwd);
|
|
2151
|
+
const userHints = userConfig?.defaults?.intent?.decompositionHints;
|
|
2152
|
+
if (Array.isArray(userHints) && userHints.length > 0) {
|
|
2153
|
+
return {
|
|
2154
|
+
value: userHints.filter((v) => typeof v === "string" && v.length > 0),
|
|
2155
|
+
source: "user-config",
|
|
2156
|
+
sourcePath: `${paths.userConfigFile}#defaults.intent.decompositionHints`
|
|
2157
|
+
};
|
|
2158
|
+
}
|
|
2159
|
+
return { value: [], source: "fallback" };
|
|
2160
|
+
}
|
|
2161
|
+
function resolveIntentNonGoals(cwd = process.cwd()) {
|
|
2162
|
+
const paths = getConfigPaths2(cwd);
|
|
2163
|
+
const projectConfig = loadProjectConfig(cwd);
|
|
2164
|
+
const projectNonGoals = projectConfig?.defaults?.intent?.nonGoals;
|
|
2165
|
+
if (Array.isArray(projectNonGoals) && projectNonGoals.length > 0) {
|
|
2166
|
+
return {
|
|
2167
|
+
value: projectNonGoals.filter((v) => typeof v === "string" && v.length > 0),
|
|
2168
|
+
source: "project",
|
|
2169
|
+
sourcePath: `${paths.projectConfigFile}#defaults.intent.nonGoals`
|
|
2170
|
+
};
|
|
2171
|
+
}
|
|
2172
|
+
const userConfig = loadUserConfig(cwd);
|
|
2173
|
+
const userNonGoals = userConfig?.defaults?.intent?.nonGoals;
|
|
2174
|
+
if (Array.isArray(userNonGoals) && userNonGoals.length > 0) {
|
|
2175
|
+
return {
|
|
2176
|
+
value: userNonGoals.filter((v) => typeof v === "string" && v.length > 0),
|
|
2177
|
+
source: "user-config",
|
|
2178
|
+
sourcePath: `${paths.userConfigFile}#defaults.intent.nonGoals`
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
return { value: [], source: "fallback" };
|
|
2182
|
+
}
|
|
2183
|
+
function resolveIntentDisableRepoContext(cwd = process.cwd()) {
|
|
2184
|
+
const paths = getConfigPaths2(cwd);
|
|
2185
|
+
const projectConfig = loadProjectConfig(cwd);
|
|
2186
|
+
const projectDisable = projectConfig?.defaults?.intent?.disableRepoContext;
|
|
2187
|
+
if (typeof projectDisable === "boolean") {
|
|
2188
|
+
return {
|
|
2189
|
+
value: projectDisable,
|
|
2190
|
+
source: "project",
|
|
2191
|
+
sourcePath: `${paths.projectConfigFile}#defaults.intent.disableRepoContext`
|
|
2192
|
+
};
|
|
2193
|
+
}
|
|
2194
|
+
const userConfig = loadUserConfig(cwd);
|
|
2195
|
+
const userDisable = userConfig?.defaults?.intent?.disableRepoContext;
|
|
2196
|
+
if (typeof userDisable === "boolean") {
|
|
2197
|
+
return {
|
|
2198
|
+
value: userDisable,
|
|
2199
|
+
source: "user-config",
|
|
2200
|
+
sourcePath: `${paths.userConfigFile}#defaults.intent.disableRepoContext`
|
|
2201
|
+
};
|
|
2202
|
+
}
|
|
2203
|
+
return { value: false, source: "fallback" };
|
|
2204
|
+
}
|
|
2205
|
+
function resolveJudgeConfig(cli, cwd = process.cwd(), judgeType, env = process.env) {
|
|
2206
|
+
const type = resolveJudgeType(cli, cwd);
|
|
2207
|
+
const { provider, model, reasoningEffort } = resolveJudgeSettings(cli, cwd, judgeType, env);
|
|
2208
|
+
return { type, provider, model, ...reasoningEffort ? { reasoningEffort } : {} };
|
|
2209
|
+
}
|
|
2210
|
+
function resolveConfig(cli, cwd = process.cwd(), options) {
|
|
2211
|
+
if (options?.strictSynthesisModel === false) {
|
|
2212
|
+
return withReadOnlyProviderOrder(() => resolveConfigStrict(cli, cwd, options));
|
|
2213
|
+
}
|
|
2214
|
+
return resolveConfigStrict(cli, cwd, options);
|
|
2215
|
+
}
|
|
2216
|
+
function resolveConfigStrict(cli, cwd, options) {
|
|
2217
|
+
const defaultProvider = resolveDefaultProvider(cli, cwd);
|
|
2218
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
2219
|
+
const providers = ProviderRegistry.getEnabledProviders(registry).map((provider) => provider.id);
|
|
2220
|
+
const providerModels = {};
|
|
2221
|
+
const providerReasoningEfforts = {};
|
|
2222
|
+
for (const provider of providers) {
|
|
2223
|
+
providerModels[provider] = resolveProviderModel(provider, cli, cwd);
|
|
2224
|
+
providerReasoningEfforts[provider] = resolveProviderReasoningEffort(provider, cli, cwd);
|
|
2225
|
+
}
|
|
2226
|
+
const splitter = resolveForConfig(
|
|
2227
|
+
() => resolveSplitterExecution(cli, cwd),
|
|
2228
|
+
options,
|
|
2229
|
+
(model) => ({ model })
|
|
2230
|
+
);
|
|
2231
|
+
const judgeType = resolveJudgeType(cli, cwd);
|
|
2232
|
+
let judge;
|
|
2233
|
+
try {
|
|
2234
|
+
judge = resolveJudgeConfig(cli, cwd, judgeType.value);
|
|
2235
|
+
} catch (error) {
|
|
2236
|
+
if (options?.strictSynthesisModel !== false || !(error instanceof NoEligibleArbiterError)) {
|
|
2237
|
+
throw error;
|
|
2238
|
+
}
|
|
2239
|
+
const invalid = {
|
|
2240
|
+
value: "invalid",
|
|
2241
|
+
source: "fallback",
|
|
2242
|
+
sourcePath: `resolution-error:${error.message}`
|
|
2243
|
+
};
|
|
2244
|
+
judge = { type: judgeType, provider: invalid, model: invalid };
|
|
2245
|
+
}
|
|
2246
|
+
return {
|
|
2247
|
+
defaultProvider,
|
|
2248
|
+
defaultModel: resolveProviderModel(defaultProvider.value, cli, cwd),
|
|
2249
|
+
planExecute: resolvePlanExecuteConfig(cli, cwd),
|
|
2250
|
+
providerExecutionTransport: resolveProviderExecutionTransportConfig(cli, cwd),
|
|
2251
|
+
judge,
|
|
2252
|
+
synthesisModel: resolveForConfig(
|
|
2253
|
+
() => resolveSynthesisModel(cli, cwd),
|
|
2254
|
+
options,
|
|
2255
|
+
(model) => model
|
|
2256
|
+
),
|
|
2257
|
+
synthesisReasoningEffort: resolveSynthesisReasoningEffort(cli, cwd),
|
|
2258
|
+
splitterModel: splitter.model,
|
|
2259
|
+
splitterReasoningEffort: splitter.reasoningEffort,
|
|
2260
|
+
providerModels,
|
|
2261
|
+
providerReasoningEfforts,
|
|
2262
|
+
gitAttribution: resolveGitAttribution(cwd)
|
|
2263
|
+
};
|
|
2264
|
+
}
|
|
2265
|
+
function resolvePlanExecuteConfig(cli, cwd = process.cwd()) {
|
|
2266
|
+
return {
|
|
2267
|
+
blockerMode: resolvePlanExecuteBlockerMode(cli, cwd)
|
|
2268
|
+
};
|
|
2269
|
+
}
|
|
2270
|
+
function resolvePlanExecuteBlockerMode(cli, cwd = process.cwd()) {
|
|
2271
|
+
const paths = getConfigPaths2(cwd);
|
|
2272
|
+
if (cli?.planExecuteBlockerMode) {
|
|
2273
|
+
return {
|
|
2274
|
+
value: cli.planExecuteBlockerMode,
|
|
2275
|
+
source: "cli",
|
|
2276
|
+
sourcePath: "cli:--blocker-mode"
|
|
2277
|
+
};
|
|
2278
|
+
}
|
|
2279
|
+
const projectConfig = loadProjectConfig(cwd);
|
|
2280
|
+
const projectBlockerMode = resolveDurablePlanExecuteBlockerMode(
|
|
2281
|
+
projectConfig?.planExecute?.blockerMode,
|
|
2282
|
+
`${paths.projectConfigFile}#planExecute.blockerMode`
|
|
2283
|
+
);
|
|
2284
|
+
if (projectBlockerMode) {
|
|
2285
|
+
return {
|
|
2286
|
+
value: projectBlockerMode,
|
|
2287
|
+
source: "project",
|
|
2288
|
+
sourcePath: `${paths.projectConfigFile}#planExecute.blockerMode`
|
|
2289
|
+
};
|
|
2290
|
+
}
|
|
2291
|
+
const userConfig = loadUserConfig(cwd);
|
|
2292
|
+
const userBlockerMode = resolveDurablePlanExecuteBlockerMode(
|
|
2293
|
+
userConfig?.planExecute?.blockerMode,
|
|
2294
|
+
`${paths.userConfigFile}#planExecute.blockerMode`
|
|
2295
|
+
);
|
|
2296
|
+
if (userBlockerMode) {
|
|
2297
|
+
return {
|
|
2298
|
+
value: userBlockerMode,
|
|
2299
|
+
source: "user-config",
|
|
2300
|
+
sourcePath: `${paths.userConfigFile}#planExecute.blockerMode`
|
|
2301
|
+
};
|
|
2302
|
+
}
|
|
2303
|
+
return { value: "non-interactive", source: "fallback" };
|
|
2304
|
+
}
|
|
2305
|
+
function providerExecutionTransportEnvKey(provider) {
|
|
2306
|
+
return `BUILD_${provider.trim().toUpperCase().replace(/[^A-Z0-9_]/g, "_")}_EXECUTION_TRANSPORT`;
|
|
2307
|
+
}
|
|
2308
|
+
function resolveEnvProviderExecutionTransport(provider, env = process.env) {
|
|
2309
|
+
const providerKey = providerExecutionTransportEnvKey(provider);
|
|
2310
|
+
const providerRaw = env[providerKey];
|
|
2311
|
+
const providerValue = normalizeExecutionTransportMode(providerRaw);
|
|
2312
|
+
if (providerValue) {
|
|
2313
|
+
return {
|
|
2314
|
+
value: providerValue,
|
|
2315
|
+
source: "env",
|
|
2316
|
+
sourcePath: `env:${providerKey}`
|
|
2317
|
+
};
|
|
2318
|
+
}
|
|
2319
|
+
if (providerRaw?.trim()) {
|
|
2320
|
+
throw new InvalidExplicitConfigError(
|
|
2321
|
+
`Invalid ${providerKey}: expected auto, headless, tmux-exec, or interactive`
|
|
2322
|
+
);
|
|
2323
|
+
}
|
|
2324
|
+
const legacyRaw = env.BUILD_PROVIDER_EXECUTION_TRANSPORT;
|
|
2325
|
+
const canonicalRaw = env.BUILD_EXECUTION_TRANSPORT;
|
|
2326
|
+
const legacyValue = normalizeExecutionTransportMode(legacyRaw);
|
|
2327
|
+
const canonicalValue = normalizeExecutionTransportMode(canonicalRaw);
|
|
2328
|
+
if (legacyRaw?.trim() && !legacyValue) {
|
|
2329
|
+
throw new InvalidExplicitConfigError(
|
|
2330
|
+
"Invalid BUILD_PROVIDER_EXECUTION_TRANSPORT: expected auto, headless, tmux-exec, or interactive"
|
|
2331
|
+
);
|
|
2332
|
+
}
|
|
2333
|
+
if (canonicalRaw?.trim() && !canonicalValue) {
|
|
2334
|
+
throw new InvalidExplicitConfigError(
|
|
2335
|
+
"Invalid BUILD_EXECUTION_TRANSPORT: expected auto, headless, tmux-exec, or interactive"
|
|
2336
|
+
);
|
|
2337
|
+
}
|
|
2338
|
+
const genericValue = legacyValue ?? canonicalValue;
|
|
2339
|
+
if (genericValue) {
|
|
2340
|
+
return {
|
|
2341
|
+
value: genericValue,
|
|
2342
|
+
source: "env",
|
|
2343
|
+
sourcePath: env.BUILD_PROVIDER_EXECUTION_TRANSPORT ? "env:BUILD_PROVIDER_EXECUTION_TRANSPORT" : "env:BUILD_EXECUTION_TRANSPORT"
|
|
2344
|
+
};
|
|
2345
|
+
}
|
|
2346
|
+
return void 0;
|
|
2347
|
+
}
|
|
2348
|
+
function resolveConfiguredProviderExecutionTransport(provider, cwd = process.cwd()) {
|
|
2349
|
+
const normalizedProvider = normalizeProviderId(provider);
|
|
2350
|
+
const paths = getConfigPaths2(cwd);
|
|
2351
|
+
if (!CONFIGURABLE_EXECUTION_TRANSPORT_PROVIDERS.has(normalizedProvider)) {
|
|
2352
|
+
return { value: "headless", source: "fallback" };
|
|
2353
|
+
}
|
|
2354
|
+
const activeProfile = getActiveProfile();
|
|
2355
|
+
const profileResolved = resolveConfigExecutionTransport(
|
|
2356
|
+
activeProfile,
|
|
2357
|
+
normalizedProvider,
|
|
2358
|
+
"profile",
|
|
2359
|
+
`profile:${activeProfile?.name ?? "active"}`
|
|
2360
|
+
);
|
|
2361
|
+
if (profileResolved && activeProfile) {
|
|
2362
|
+
return profileResolved;
|
|
2363
|
+
}
|
|
2364
|
+
const projectConfig = loadProjectConfig(cwd);
|
|
2365
|
+
const projectResolved = resolveConfigExecutionTransport(
|
|
2366
|
+
projectConfig,
|
|
2367
|
+
normalizedProvider,
|
|
2368
|
+
"project",
|
|
2369
|
+
paths.projectConfigFile
|
|
2370
|
+
);
|
|
2371
|
+
if (projectResolved) return projectResolved;
|
|
2372
|
+
const userConfig = loadUserConfig(cwd);
|
|
2373
|
+
const userResolved = resolveConfigExecutionTransport(
|
|
2374
|
+
userConfig,
|
|
2375
|
+
normalizedProvider,
|
|
2376
|
+
"user-config",
|
|
2377
|
+
paths.userConfigFile
|
|
2378
|
+
);
|
|
2379
|
+
if (userResolved) return userResolved;
|
|
2380
|
+
return { value: "headless", source: "fallback" };
|
|
2381
|
+
}
|
|
2382
|
+
function resolveProviderExecutionTransport(provider, cli, cwd = process.cwd()) {
|
|
2383
|
+
const normalizedProvider = normalizeProviderId(provider);
|
|
2384
|
+
const cliValue = cli?.providerExecutionTransport ?? cli?.executionTransport;
|
|
2385
|
+
const normalizedCliValue = normalizeExecutionTransportMode(cliValue);
|
|
2386
|
+
if (normalizedCliValue) {
|
|
2387
|
+
return {
|
|
2388
|
+
value: normalizedCliValue,
|
|
2389
|
+
source: "cli",
|
|
2390
|
+
sourcePath: "cli:--provider-execution-transport"
|
|
2391
|
+
};
|
|
2392
|
+
}
|
|
2393
|
+
const envResolved = resolveEnvProviderExecutionTransport(normalizedProvider);
|
|
2394
|
+
if (envResolved) return envResolved;
|
|
2395
|
+
return resolveConfiguredProviderExecutionTransport(normalizedProvider, cwd);
|
|
2396
|
+
}
|
|
2397
|
+
function resolveProviderExecutionTransportConfig(cli, cwd = process.cwd()) {
|
|
2398
|
+
const defaultProvider = resolveDefaultProvider(cli, cwd).value;
|
|
2399
|
+
const providers = {};
|
|
2400
|
+
for (const provider of CONFIGURABLE_EXECUTION_TRANSPORT_PROVIDERS) {
|
|
2401
|
+
providers[provider] = resolveProviderExecutionTransport(provider, cli, cwd);
|
|
2402
|
+
}
|
|
2403
|
+
return {
|
|
2404
|
+
current: resolveProviderExecutionTransport(defaultProvider, cli, cwd),
|
|
2405
|
+
providers
|
|
2406
|
+
};
|
|
2407
|
+
}
|
|
2408
|
+
function isRunnableModel(provider, model, registry) {
|
|
2409
|
+
try {
|
|
2410
|
+
ProviderRegistry.resolveModel(provider, model.value, registry);
|
|
2411
|
+
return true;
|
|
2412
|
+
} catch {
|
|
2413
|
+
const source = `${model.source}:${model.sourcePath}`;
|
|
2414
|
+
emitResolutionWarningOnce({
|
|
2415
|
+
operation: "resolveCandidates",
|
|
2416
|
+
provider,
|
|
2417
|
+
model: model.value,
|
|
2418
|
+
source,
|
|
2419
|
+
message: `Skipping invalid model '${model.value}' for provider '${provider}' from ${source}`
|
|
2420
|
+
});
|
|
2421
|
+
return false;
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
function inRegistry(provider, registry) {
|
|
2425
|
+
try {
|
|
2426
|
+
ProviderRegistry.getProviderConfig(provider, registry);
|
|
2427
|
+
return true;
|
|
2428
|
+
} catch {
|
|
2429
|
+
return false;
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
function registryDefaultModel(provider, registry) {
|
|
2433
|
+
try {
|
|
2434
|
+
const model = ProviderRegistry.getProviderConfig(provider, registry).models.default;
|
|
2435
|
+
return {
|
|
2436
|
+
value: ProviderRegistry.resolveModel(provider, model, registry),
|
|
2437
|
+
source: "registry",
|
|
2438
|
+
sourcePath: `providers.yaml#providers.${provider}.models.default`
|
|
2439
|
+
};
|
|
2440
|
+
} catch {
|
|
2441
|
+
return void 0;
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
function retiredModelOrder(provider, layers) {
|
|
2445
|
+
const key = `defaults.providers.${provider}.modelOrder`;
|
|
2446
|
+
const { profile, project, user, paths } = layers;
|
|
2447
|
+
const layer = [
|
|
2448
|
+
{
|
|
2449
|
+
source: "profile",
|
|
2450
|
+
sourcePath: `profile:${profile?.name}#${key}`,
|
|
2451
|
+
models: profile?.defaults?.providers?.[provider]?.modelOrder
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
source: "project",
|
|
2455
|
+
sourcePath: `${paths.projectConfigFile}#${key}`,
|
|
2456
|
+
models: project?.defaults?.providers?.[provider]?.modelOrder
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
source: "user-config",
|
|
2460
|
+
sourcePath: `${paths.userConfigFile}#${key}`,
|
|
2461
|
+
models: user?.defaults?.providers?.[provider]?.modelOrder
|
|
2462
|
+
}
|
|
2463
|
+
].find(({ models }) => models !== void 0);
|
|
2464
|
+
if (!layer?.models) return [];
|
|
2465
|
+
const { source, sourcePath } = layer;
|
|
2466
|
+
return layer.models.filter((model) => model.trim().length > 0).map((value) => ({ value, source, sourcePath }));
|
|
2467
|
+
}
|
|
2468
|
+
function chainProviderModel(provider, cli, cwd, registry) {
|
|
2469
|
+
try {
|
|
2470
|
+
const shown = resolveProviderModel(provider, cli, cwd);
|
|
2471
|
+
return shown.source === "fallback" ? void 0 : shown;
|
|
2472
|
+
} catch (error) {
|
|
2473
|
+
if (!(error instanceof InvalidProviderModelError)) throw error;
|
|
2474
|
+
emitResolutionWarningOnce({
|
|
2475
|
+
operation: "resolveCandidates",
|
|
2476
|
+
provider,
|
|
2477
|
+
model: error.model,
|
|
2478
|
+
source: error.sourcePath,
|
|
2479
|
+
message: `Skipping invalid model '${error.model}' for provider '${provider}' from ${error.sourcePath}`
|
|
2480
|
+
});
|
|
2481
|
+
return registryDefaultModel(provider, registry);
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
function toLegacyCliOptions(cli) {
|
|
2485
|
+
if (!cli) return void 0;
|
|
2486
|
+
return {
|
|
2487
|
+
provider: cli.provider,
|
|
2488
|
+
model: cli.model,
|
|
2489
|
+
judgeProvider: cli.judgeProvider,
|
|
2490
|
+
judgeModel: cli.judgeModel,
|
|
2491
|
+
synthesisProvider: cli.synthesisProvider,
|
|
2492
|
+
synthesisModel: cli.synthesisModel,
|
|
2493
|
+
splitterModel: cli.splitterModel
|
|
2494
|
+
};
|
|
2495
|
+
}
|
|
2496
|
+
function resolvePurposeProviderScalar(purpose, cli, cwd) {
|
|
2497
|
+
switch (purpose) {
|
|
2498
|
+
case "judge":
|
|
2499
|
+
return resolveJudgeProvider(cli, cwd);
|
|
2500
|
+
case "synthesis":
|
|
2501
|
+
return resolveSynthesisProvider(cli, cwd);
|
|
2502
|
+
case "splitter":
|
|
2503
|
+
return resolveDefaultProvider(cli, cwd);
|
|
2504
|
+
case "decomposition":
|
|
2505
|
+
case "flywheel":
|
|
2506
|
+
case "orchestration":
|
|
2507
|
+
case "global":
|
|
2508
|
+
return resolveDefaultProvider(cli, cwd);
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
function resolvePurposeModelScalar(purpose, provider, cli, cwd) {
|
|
2512
|
+
switch (purpose) {
|
|
2513
|
+
case "judge":
|
|
2514
|
+
return resolveJudgeModel(cli, cwd);
|
|
2515
|
+
case "synthesis":
|
|
2516
|
+
return resolveSynthesisModel(cli, cwd);
|
|
2517
|
+
case "splitter":
|
|
2518
|
+
return resolveSplitterModel(cli, cwd);
|
|
2519
|
+
case "decomposition":
|
|
2520
|
+
case "flywheel":
|
|
2521
|
+
case "orchestration":
|
|
2522
|
+
case "global":
|
|
2523
|
+
return resolveProviderModel(provider, cli, cwd);
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
function shouldUseScalarCandidate(providerResolved, modelResolved) {
|
|
2527
|
+
const isConfigured = (source) => source !== "registry" && source !== "fallback";
|
|
2528
|
+
return isConfigured(providerResolved.source) || isConfigured(modelResolved.source);
|
|
2529
|
+
}
|
|
2530
|
+
function buildCandidate(params) {
|
|
2531
|
+
return {
|
|
2532
|
+
provider: params.provider,
|
|
2533
|
+
model: params.model,
|
|
2534
|
+
source: params.providerSource,
|
|
2535
|
+
sourcePath: params.providerSourcePath,
|
|
2536
|
+
providerSource: params.providerSource,
|
|
2537
|
+
providerSourcePath: params.providerSourcePath,
|
|
2538
|
+
modelSource: params.modelSource,
|
|
2539
|
+
modelSourcePath: params.modelSourcePath,
|
|
2540
|
+
purpose: params.purpose,
|
|
2541
|
+
index: params.index
|
|
2542
|
+
};
|
|
2543
|
+
}
|
|
2544
|
+
function resolveCandidates(purpose, options) {
|
|
2545
|
+
return purpose === "synthesis" || purpose === "decomposition" ? withPurposeProviderOrder(
|
|
2546
|
+
options?.cwd ?? process.cwd(),
|
|
2547
|
+
purpose,
|
|
2548
|
+
() => resolveCandidatesInScope(purpose, options)
|
|
2549
|
+
) : resolveCandidatesInScope(purpose, options);
|
|
2550
|
+
}
|
|
2551
|
+
function resolveCandidatesInScope(purpose, options) {
|
|
2552
|
+
const cwd = options?.cwd ?? process.cwd();
|
|
2553
|
+
const cli = toLegacyCliOptions(options?.cli);
|
|
2554
|
+
const paths = getConfigPaths2(cwd);
|
|
2555
|
+
warnIfLegacyConfigExists(cwd);
|
|
2556
|
+
const preserveFallbackChain = options?.preserveFallbackChain === true;
|
|
2557
|
+
const scalarProvider = resolvePurposeProviderScalar(purpose, cli, cwd);
|
|
2558
|
+
let scalarModel;
|
|
2559
|
+
try {
|
|
2560
|
+
scalarModel = resolvePurposeModelScalar(purpose, scalarProvider.value, cli, cwd);
|
|
2561
|
+
} catch (error) {
|
|
2562
|
+
if (!preserveFallbackChain || !(error instanceof InvalidProviderModelError)) {
|
|
2563
|
+
throw error;
|
|
2564
|
+
}
|
|
2565
|
+
scalarModel = {
|
|
2566
|
+
value: "invalid",
|
|
2567
|
+
source: "fallback",
|
|
2568
|
+
sourcePath: `resolution-error:${error.message}`
|
|
2569
|
+
};
|
|
2570
|
+
}
|
|
2571
|
+
const scalarConfigured = shouldUseScalarCandidate(scalarProvider, scalarModel);
|
|
2572
|
+
if (scalarConfigured && !preserveFallbackChain) {
|
|
2573
|
+
return [
|
|
2574
|
+
buildCandidate({
|
|
2575
|
+
provider: scalarProvider.value,
|
|
2576
|
+
model: scalarModel.value,
|
|
2577
|
+
purpose,
|
|
2578
|
+
index: 0,
|
|
2579
|
+
providerSource: scalarProvider.source,
|
|
2580
|
+
providerSourcePath: scalarProvider.sourcePath ?? "resolution-engine:provider",
|
|
2581
|
+
modelSource: scalarModel.source,
|
|
2582
|
+
modelSourcePath: scalarModel.sourcePath ?? "resolution-engine:model"
|
|
2583
|
+
})
|
|
2584
|
+
];
|
|
2585
|
+
}
|
|
2586
|
+
const projectConfig = loadProjectConfig(cwd);
|
|
2587
|
+
const userConfig = loadUserConfig(cwd);
|
|
2588
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
2589
|
+
const candidateActiveProfile = getActiveProfile();
|
|
2590
|
+
const configuredOrder = resolveConfiguredProviderOrder({
|
|
2591
|
+
cwd,
|
|
2592
|
+
...purpose === "synthesis" || purpose === "decomposition" ? { purpose } : {}
|
|
2593
|
+
});
|
|
2594
|
+
const providerOrderSource = configuredOrder.source;
|
|
2595
|
+
const providerOrderSourcePath = configuredOrder.sourcePath;
|
|
2596
|
+
let providerOrder = keepInstalledProviders(configuredOrder.providers, registry).providers;
|
|
2597
|
+
if (scalarConfigured && preserveFallbackChain) {
|
|
2598
|
+
providerOrder = [
|
|
2599
|
+
scalarProvider.value,
|
|
2600
|
+
...providerOrder.filter((provider) => provider !== scalarProvider.value)
|
|
2601
|
+
];
|
|
2602
|
+
}
|
|
2603
|
+
assertUsableProviderOrder(configuredOrder, providerOrder);
|
|
2604
|
+
const scalarModelConfigured = scalarModel.source !== "registry" && scalarModel.source !== "fallback";
|
|
2605
|
+
const purposeModel = (purpose === "judge" || purpose === "synthesis") && scalarModel.source !== "fallback" ? scalarModel : void 0;
|
|
2606
|
+
const layers = {
|
|
2607
|
+
profile: candidateActiveProfile,
|
|
2608
|
+
project: projectConfig,
|
|
2609
|
+
user: userConfig,
|
|
2610
|
+
paths
|
|
2611
|
+
};
|
|
2612
|
+
const candidates = [];
|
|
2613
|
+
for (const provider of providerOrder) {
|
|
2614
|
+
const preferredProviderSelected = scalarConfigured && preserveFallbackChain && provider === scalarProvider.value;
|
|
2615
|
+
const providerSource = preferredProviderSelected ? scalarProvider.source : providerOrderSource;
|
|
2616
|
+
const providerSourcePath = preferredProviderSelected ? scalarProvider.sourcePath ?? "resolution-engine:preferred-provider" : providerOrderSourcePath;
|
|
2617
|
+
if (!inRegistry(provider, registry)) {
|
|
2618
|
+
emitResolutionWarningOnce({
|
|
2619
|
+
operation: "resolveCandidates",
|
|
2620
|
+
provider,
|
|
2621
|
+
message: `Provider '${provider}' from ${providerSource}:${providerSourcePath} is not in the registry; skipping`
|
|
2622
|
+
});
|
|
2623
|
+
continue;
|
|
2624
|
+
}
|
|
2625
|
+
const head = (preferredProviderSelected && scalarModelConfigured ? [scalarModel] : [getProviderEnvModel(provider), provider === scalarProvider.value ? purposeModel : null]).find((model) => model && isRunnableModel(provider, model, registry));
|
|
2626
|
+
const models = [...head ? [head] : [], ...retiredModelOrder(provider, layers)].filter(
|
|
2627
|
+
(model, at, all) => all.findIndex((other) => other.value === model.value) === at && isRunnableModel(provider, model, registry)
|
|
2628
|
+
);
|
|
2629
|
+
const shown = models.length === 0 ? chainProviderModel(provider, cli, cwd, registry) : null;
|
|
2630
|
+
if (shown) models.push(shown);
|
|
2631
|
+
if (models.length === 0) {
|
|
2632
|
+
const source = `providers.yaml#providers.${provider}.models.default`;
|
|
2633
|
+
emitResolutionWarningOnce({
|
|
2634
|
+
operation: "resolveCandidates",
|
|
2635
|
+
provider,
|
|
2636
|
+
source,
|
|
2637
|
+
message: `Provider '${provider}' has no runnable model (no valid pin, and ${source} does not resolve); skipping`
|
|
2638
|
+
});
|
|
2639
|
+
continue;
|
|
2640
|
+
}
|
|
2641
|
+
for (const model of models) {
|
|
2642
|
+
candidates.push(
|
|
2643
|
+
buildCandidate({
|
|
2644
|
+
provider,
|
|
2645
|
+
model: model.value,
|
|
2646
|
+
purpose,
|
|
2647
|
+
index: candidates.length,
|
|
2648
|
+
providerSource,
|
|
2649
|
+
providerSourcePath,
|
|
2650
|
+
modelSource: model.source,
|
|
2651
|
+
modelSourcePath: model.sourcePath ?? "resolution-engine:model"
|
|
2652
|
+
})
|
|
2653
|
+
);
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
return candidates;
|
|
2657
|
+
}
|
|
2658
|
+
function resolvePreferred(purpose, options) {
|
|
2659
|
+
const candidates = resolveCandidates(purpose, options);
|
|
2660
|
+
const first = candidates[0];
|
|
2661
|
+
if (first) {
|
|
2662
|
+
return first;
|
|
2663
|
+
}
|
|
2664
|
+
const cwd = options?.cwd ?? process.cwd();
|
|
2665
|
+
const registry = loadProviderRegistryForCwd(cwd);
|
|
2666
|
+
const registryPath = ProviderRegistry.getLoadedConfigPath() ?? resolveProvidersConfigPath({ cwd });
|
|
2667
|
+
const fallbackProvider = Object.values(registry.providers).filter((p) => p.enabled).sort((a, b) => a.order - b.order)[0]?.id;
|
|
2668
|
+
if (!fallbackProvider) {
|
|
2669
|
+
throw new Error(
|
|
2670
|
+
`Invalid provider registry at ${registryPath}: no providers are enabled. Enable at least one providers.<id>.enabled entry.`
|
|
2671
|
+
);
|
|
2672
|
+
}
|
|
2673
|
+
return {
|
|
2674
|
+
provider: fallbackProvider,
|
|
2675
|
+
model: "auto",
|
|
2676
|
+
source: "registry",
|
|
2677
|
+
sourcePath: `${registryPath}#providers.*.order`,
|
|
2678
|
+
providerSource: "registry",
|
|
2679
|
+
providerSourcePath: `${registryPath}#providers.*.order`,
|
|
2680
|
+
modelSource: "fallback",
|
|
2681
|
+
modelSourcePath: "resolution-engine:fallback-model",
|
|
2682
|
+
purpose,
|
|
2683
|
+
index: 0
|
|
2684
|
+
};
|
|
2685
|
+
}
|
|
2686
|
+
function formatResolvedValue(resolved) {
|
|
2687
|
+
let result = String(resolved.value);
|
|
2688
|
+
result += ` (from: ${resolved.source}`;
|
|
2689
|
+
if (resolved.sourcePath) {
|
|
2690
|
+
result += `, path: ${resolved.sourcePath}`;
|
|
2691
|
+
}
|
|
2692
|
+
result += ")";
|
|
2693
|
+
return result;
|
|
2694
|
+
}
|
|
2695
|
+
|
|
2696
|
+
export {
|
|
2697
|
+
resolveFastModel,
|
|
2698
|
+
DEPRECATED_JUDGE_MODELS_ALIASES,
|
|
2699
|
+
JUDGE_SPECIFICITY,
|
|
2700
|
+
coherentJudgeModelForProvider,
|
|
2701
|
+
inferProviderFromRegistryOwnership,
|
|
2702
|
+
reconcileJudgePair,
|
|
2703
|
+
parseJudgeModelOverride,
|
|
2704
|
+
assertJudgeRoleCapabilities,
|
|
2705
|
+
resolveCanonicalJudgeRoles,
|
|
2706
|
+
resolveCanonicalJudgeTier,
|
|
2707
|
+
warnIfExplicitModelUnobserved,
|
|
2708
|
+
assertExplicitModelNotMistyped,
|
|
2709
|
+
emitResolutionWarningOnce,
|
|
2710
|
+
getActiveProfile,
|
|
2711
|
+
resolveConfiguredProviderOrder,
|
|
2712
|
+
enterReadOnlyProviderOrderView,
|
|
2713
|
+
assertUsableProviderOrder,
|
|
2714
|
+
keepInstalledProviders,
|
|
2715
|
+
resolveProviderOrder,
|
|
2716
|
+
GUARD_DIR_REL,
|
|
2717
|
+
CHECK_SCRIPT_REL,
|
|
2718
|
+
CONFIG_FILE_REL,
|
|
2719
|
+
POLICY_FILE_REL,
|
|
2720
|
+
LOCK_FILE_REL,
|
|
2721
|
+
SETUP_PLAYBOOK_REL,
|
|
2722
|
+
CI_WORKFLOW_TEMPLATE_FILE,
|
|
2723
|
+
GENERATED_HASHED_FILES,
|
|
2724
|
+
getGuardKitTemplatesDir,
|
|
2725
|
+
buildAttributionPolicy,
|
|
2726
|
+
readAttributionPolicy,
|
|
2727
|
+
JUDGE_TYPE_TO_CONFIG_KEY,
|
|
2728
|
+
judgeLayerBlocks,
|
|
2729
|
+
resolveJudgeBinding,
|
|
2730
|
+
InvalidProviderModelError,
|
|
2731
|
+
normalizeProviderId,
|
|
2732
|
+
validateModelForProvider,
|
|
2733
|
+
resolveJudgeType,
|
|
2734
|
+
clearConfigCaches,
|
|
2735
|
+
loadBuildConfigFile,
|
|
2736
|
+
loadConfigLayers,
|
|
2737
|
+
resolveAskConfig,
|
|
2738
|
+
resolveProgressNarrationConfig,
|
|
2739
|
+
resolveEphemeralTelemetryReplication,
|
|
2740
|
+
loadProviderRegistryForCwd,
|
|
2741
|
+
checkDefaultProviderEnablement,
|
|
2742
|
+
DefaultProviderUnusableError,
|
|
2743
|
+
assertDefaultProviderEnabled,
|
|
2744
|
+
resolveDefaultProvider,
|
|
2745
|
+
resolveDefaultJudgeProvider,
|
|
2746
|
+
resolveReadyDefaultProvider,
|
|
2747
|
+
resolveGitAttribution,
|
|
2748
|
+
resolveProviderModel,
|
|
2749
|
+
resolveProviderReasoningEffort,
|
|
2750
|
+
resolveJudgeProvider,
|
|
2751
|
+
resolveJudgeModel,
|
|
2752
|
+
resolveJudgeReasoningEffort,
|
|
2753
|
+
resolveSynthesisModel,
|
|
2754
|
+
resolveSynthesisProvider,
|
|
2755
|
+
resolveSynthesisReasoningEffort,
|
|
2756
|
+
resolveSplitterExecution,
|
|
2757
|
+
resolveSplitterModel,
|
|
2758
|
+
resolveSplitterReasoningEffort,
|
|
2759
|
+
resolveIntentDecompositionHints,
|
|
2760
|
+
resolveIntentNonGoals,
|
|
2761
|
+
resolveIntentDisableRepoContext,
|
|
2762
|
+
resolveJudgeConfig,
|
|
2763
|
+
resolveConfig,
|
|
2764
|
+
resolvePlanExecuteConfig,
|
|
2765
|
+
resolvePlanExecuteBlockerMode,
|
|
2766
|
+
resolveConfiguredProviderExecutionTransport,
|
|
2767
|
+
resolveProviderExecutionTransport,
|
|
2768
|
+
resolveProviderExecutionTransportConfig,
|
|
2769
|
+
resolveCandidates,
|
|
2770
|
+
resolvePreferred,
|
|
2771
|
+
formatResolvedValue
|
|
2772
|
+
};
|
|
2773
|
+
//# sourceMappingURL=chunk-C3DH3NCY.js.map
|