@organizaone/o1-code 0.11.3 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/design/SKILL.md +3 -1
- package/bundled/qc-helper/docs/features/commands.md +1 -0
- package/bundled/write-plan/SKILL.md +7 -0
- package/chunks/{MaxSizedBox-4YD6N3PU.js → MaxSizedBox-XCZ2MGOJ.js} +68 -67
- package/chunks/{StandaloneSessionPicker-I5FMAIU2.js → StandaloneSessionPicker-CYMNKKAN.js} +91 -90
- package/chunks/{acp-subagent-executor-PRFEPDLD.js → acp-subagent-executor-RPJ7DSMI.js} +72 -71
- package/chunks/{acpAgent-2SVJNE5B.js → acpAgent-CEVBI47D.js} +232 -229
- package/chunks/{agent-QONNC6CU.js → agent-PV7EUY5X.js} +44 -43
- package/chunks/{agent-headless-5HHGBH6Z.js → agent-headless-KVY3WI56.js} +44 -43
- package/chunks/all-providers-ZGNZ7JW6.js +73 -0
- package/chunks/{anthropicContentGenerator-2VK5J36U.js → anthropicContentGenerator-4K7EQGUO.js} +120 -73
- package/chunks/{askUserQuestion-LD66OM5J.js → askUserQuestion-SVDY6XLX.js} +1 -1
- package/chunks/{bridge-376JROPC.js → bridge-MOZHALOO.js} +73 -72
- package/chunks/{bwrap-execution-UZAMPG6F.js → bwrap-execution-FIGUBZCN.js} +6 -6
- package/chunks/{caption-audio-HGDJVVJZ.js → caption-audio-EK6K45W3.js} +8 -8
- package/chunks/{caption-image-ATZSXV7W.js → caption-image-WDXLQK6T.js} +6 -6
- package/chunks/{chunk-OAGT2TNR.js → chunk-2H65MHOR.js} +9 -9
- package/chunks/{chunk-VYRPAY75.js → chunk-3D2STYD6.js} +11072 -228
- package/chunks/{chunk-EFN3RELD.js → chunk-3O65A7ID.js} +3 -3
- package/chunks/{chunk-AIQC2WHG.js → chunk-4AH63DZR.js} +4 -4
- package/chunks/{chunk-QCONHGJR.js → chunk-4OUIZHHJ.js} +4 -4
- package/chunks/{chunk-QYUMJTBP.js → chunk-4SJO2I35.js} +1 -1
- package/chunks/{chunk-EB5V6K5E.js → chunk-4X3MIKOZ.js} +5 -5
- package/chunks/{chunk-U7C4TQUX.js → chunk-4YN5RZ7J.js} +1 -1
- package/chunks/{chunk-HCE5HUQG.js → chunk-55BVGW3L.js} +4 -4
- package/chunks/{chunk-ADBRWAV5.js → chunk-5NNMFA5J.js} +1 -1
- package/chunks/{chunk-VBJH6XAM.js → chunk-5NRAUOM6.js} +1 -1
- package/chunks/{chunk-UWV7KBPN.js → chunk-5OGI74MG.js} +2 -2
- package/chunks/{chunk-VKBMJSAR.js → chunk-5V4DLJBR.js} +322 -110
- package/chunks/{chunk-REDO4D2W.js → chunk-62RTFDNE.js} +11 -11
- package/chunks/{chunk-3KUQCZUE.js → chunk-65JWVPGE.js} +1 -1
- package/chunks/{chunk-Z5UCVPGO.js → chunk-6EMYIJOA.js} +13 -13
- package/chunks/{chunk-FYQO4Y3N.js → chunk-6NUJPR63.js} +19 -19
- package/chunks/{chunk-YPWPIBDR.js → chunk-6VCEIIBB.js} +5 -5
- package/chunks/chunk-6Z3USRSR.js +484 -0
- package/chunks/{chunk-H2U6QRJX.js → chunk-72EBG4FJ.js} +3 -471
- package/chunks/{chunk-4OI2JVHJ.js → chunk-776VI66O.js} +2 -2
- package/chunks/{chunk-COABCWBY.js → chunk-7S2AYA27.js} +15 -0
- package/chunks/chunk-7TK6OY2J.js +53 -0
- package/chunks/{chunk-DMVMQMWZ.js → chunk-AAMTFFQ5.js} +88 -87
- package/chunks/{chunk-WQ6CX6N3.js → chunk-AS3K355D.js} +16 -15
- package/chunks/{chunk-OJP3SONV.js → chunk-BSS7VVI4.js} +5 -5
- package/chunks/{chunk-ZUQTYSNU.js → chunk-BZBEG24K.js} +4 -4
- package/chunks/{chunk-QE2GKG2B.js → chunk-C7UP7BSO.js} +5 -5
- package/chunks/{chunk-HVOUAFTO.js → chunk-CE7ZTS4E.js} +20 -7
- package/chunks/{chunk-QHENJTME.js → chunk-CVHHFIYU.js} +36 -36
- package/chunks/{chunk-OD2XVV6S.js → chunk-D2MWMDUV.js} +6 -6
- package/chunks/{chunk-QIRU74SA.js → chunk-DISVDIQ3.js} +1 -1
- package/chunks/{chunk-WS7DJM5N.js → chunk-DSO5I2IQ.js} +19 -19
- package/chunks/{chunk-VJFA7HHP.js → chunk-DXCM7CG5.js} +1 -1
- package/chunks/{chunk-J4QU4MC5.js → chunk-E3C27ZFX.js} +9 -9
- package/chunks/{chunk-6IAGZKHT.js → chunk-EJYRRHA3.js} +3 -3
- package/chunks/{chunk-OKDNVNDE.js → chunk-EPZB6WRV.js} +5 -5
- package/chunks/{chunk-RS2LNQEC.js → chunk-EVC2HZ5T.js} +3 -39
- package/chunks/{chunk-NWG5SKCQ.js → chunk-F2JWIRJY.js} +3 -3
- package/chunks/{chunk-V75J4GJ2.js → chunk-FJAZPBX2.js} +1 -1
- package/chunks/{chunk-W6TGDESU.js → chunk-FMNDCS3S.js} +2 -2
- package/chunks/{chunk-GCAERMSL.js → chunk-FMPKGYLN.js} +6 -6
- package/chunks/{chunk-MLHBCLEP.js → chunk-FRPZNRSG.js} +17 -12
- package/chunks/{chunk-JQPMOOCH.js → chunk-FXR7OHQM.js} +1 -1
- package/chunks/{chunk-4RA6DVZM.js → chunk-G6RHO6DM.js} +4 -4
- package/chunks/{chunk-EXG47R4V.js → chunk-GFASVZ6K.js} +2 -2
- package/chunks/{chunk-W4SBUUTI.js → chunk-GMUKOUIL.js} +3 -3
- package/chunks/{chunk-DVRWYOU6.js → chunk-GQ2KSD3A.js} +1 -1
- package/chunks/{chunk-SAGRWAPN.js → chunk-H4D66Y2Y.js} +12 -10
- package/chunks/{chunk-PQZRAMZG.js → chunk-H7ZOC3LZ.js} +19 -19
- package/chunks/{chunk-6LLJK4YT.js → chunk-IRIOCF6B.js} +2 -2
- package/chunks/{chunk-GXHNABHV.js → chunk-ISEOJGEK.js} +8 -8
- package/chunks/{chunk-EIJNDD2V.js → chunk-JM5VEUJJ.js} +1 -1
- package/chunks/{chunk-7M4NSLWM.js → chunk-JOBZWTVK.js} +1 -1
- package/chunks/{chunk-IYLIZY56.js → chunk-JTKTS6DH.js} +4 -4
- package/chunks/{chunk-653CF7X7.js → chunk-KEAGCJ5Y.js} +3 -3
- package/chunks/{chunk-ZG7HDQQN.js → chunk-KG3KYBZQ.js} +13 -13
- package/chunks/{chunk-O5F6BGMF.js → chunk-KRA5KYTC.js} +7 -7
- package/chunks/{chunk-UDWKKKF3.js → chunk-LBLYCZ66.js} +16 -12
- package/chunks/{chunk-WDCHA7NA.js → chunk-LCGH4FFO.js} +5 -5
- package/chunks/{chunk-BIP774WW.js → chunk-LO6MBHLQ.js} +1 -1
- package/chunks/{chunk-TK7HNIQM.js → chunk-LOGUVITI.js} +1 -1
- package/chunks/{chunk-A4JNI44O.js → chunk-M3AA7FQ3.js} +65 -38
- package/chunks/{chunk-YR3UI5PL.js → chunk-M4IY4XQZ.js} +10 -10
- package/chunks/{chunk-FVO4TXS5.js → chunk-MIYMCZND.js} +6 -6
- package/chunks/{chunk-OKR7R26W.js → chunk-MK4WS35J.js} +4 -4
- package/chunks/{chunk-LEBY6RZT.js → chunk-MN5POTR7.js} +5 -5
- package/chunks/{chunk-3YG4OBGV.js → chunk-N44JMQZ2.js} +1 -1
- package/chunks/{chunk-4O37MUA4.js → chunk-NIOE4OJE.js} +1 -1
- package/chunks/{chunk-AJSSTPJK.js → chunk-NLDWAN5E.js} +1 -1
- package/chunks/{chunk-OJSW65PQ.js → chunk-NOL6NAWN.js} +1 -1
- package/chunks/{chunk-W4COM34L.js → chunk-NQG6WHD4.js} +3 -3
- package/chunks/{chunk-XHYWPHWN.js → chunk-NQTVSCZM.js} +1 -1
- package/chunks/{chunk-HK7AV2JH.js → chunk-NRL7UTKJ.js} +1 -1
- package/chunks/{chunk-5MX4BYWK.js → chunk-O2HEL6MQ.js} +3 -3
- package/chunks/{chunk-AQFTTYP6.js → chunk-O3J2T6B5.js} +4 -4
- package/chunks/{chunk-BLFBP3N2.js → chunk-O5L5JB3Y.js} +1 -1
- package/chunks/{chunk-7I52LFBI.js → chunk-O5RL477F.js} +8 -6
- package/chunks/{chunk-7LFCBMVX.js → chunk-P4F73WS7.js} +1 -1
- package/chunks/{chunk-QKTYOXBW.js → chunk-P56ZVOTQ.js} +1 -1
- package/chunks/{chunk-DG6LRVVN.js → chunk-PD4HVHCC.js} +1 -1
- package/chunks/{chunk-4AJNXOC5.js → chunk-PUHBOSQG.js} +2 -2
- package/chunks/{chunk-MIWMCUU5.js → chunk-Q3275KQT.js} +18 -9
- package/chunks/{chunk-JZ4ZEW3K.js → chunk-Q5CQXESD.js} +1 -1
- package/chunks/{chunk-3DUYZD3L.js → chunk-Q5GMC3AS.js} +3 -3
- package/chunks/{chunk-L6MGGTHA.js → chunk-QCYLPRBN.js} +1 -1
- package/chunks/{chunk-SIZ4LTNU.js → chunk-QN427UTL.js} +28 -28
- package/chunks/{chunk-7LLX5ROK.js → chunk-R2PA2MUE.js} +3 -3
- package/chunks/{chunk-KRZBFGAT.js → chunk-R2U5MANG.js} +2492 -4295
- package/chunks/{chunk-5V3EOW36.js → chunk-SGPBAZXG.js} +28 -28
- package/chunks/{chunk-ER3EHNTV.js → chunk-SPTU3FVH.js} +4 -4
- package/chunks/chunk-SYFWO6RZ.js +372 -0
- package/chunks/{chunk-ZBV6TO3P.js → chunk-T44PDHSJ.js} +1 -1
- package/chunks/chunk-TC2TJAOF.js +1365 -0
- package/chunks/{chunk-HUMRTP2R.js → chunk-TFFOK3SJ.js} +1 -1
- package/chunks/{chunk-QMCDBQRJ.js → chunk-TP3M5WJ2.js} +1 -1
- package/chunks/{chunk-JHZM32LS.js → chunk-TZSB5TBL.js} +388 -620
- package/chunks/{chunk-L7JLMUG3.js → chunk-UCTNQFXT.js} +2 -2
- package/chunks/{chunk-N7NBYHMJ.js → chunk-UNY7AZRV.js} +1 -1
- package/chunks/{chunk-PLGVOOCJ.js → chunk-USIBFFLB.js} +1 -1
- package/chunks/{chunk-IKXBBMRT.js → chunk-V4TVYM45.js} +1 -1
- package/chunks/{chunk-XOVXSDNN.js → chunk-VPFTCMMK.js} +1 -1
- package/chunks/{chunk-FQO3QDB5.js → chunk-VT3TJFQR.js} +1 -1
- package/chunks/chunk-WBPIFM2X.js +2008 -0
- package/chunks/{chunk-6D6Z2RPR.js → chunk-WEWX4WWV.js} +2 -2
- package/chunks/{chunk-LBM7FFM5.js → chunk-WFKKFDJQ.js} +1 -1
- package/chunks/{chunk-M2EBVYXC.js → chunk-WK44MSGW.js} +1 -1
- package/chunks/{chunk-FJHDFJVI.js → chunk-WSHOWMUB.js} +1 -1
- package/chunks/{chunk-VPGICF4V.js → chunk-WW4B6W4M.js} +3 -3
- package/chunks/{chunk-RZGFYBL5.js → chunk-X65OQCDM.js} +4 -4
- package/chunks/{chunk-ALRR6EQ5.js → chunk-XFFYARLO.js} +2 -2
- package/chunks/{chunk-4FUKWWA7.js → chunk-XXJRYCQP.js} +2 -2
- package/chunks/{chunk-C4WTDBKV.js → chunk-XYJDRU7X.js} +8 -8
- package/chunks/{chunk-AAXKDAOY.js → chunk-Y2S3KNR5.js} +1 -1
- package/chunks/{chunk-R3QYIDIU.js → chunk-Y7FYHWEZ.js} +2 -2
- package/chunks/{chunk-7H7YR3TX.js → chunk-YM522RO3.js} +1 -1
- package/chunks/chunk-Z5PCLAUL.js +327 -0
- package/chunks/{chunk-BSLKB37V.js → chunk-ZGPPP7FC.js} +30 -30
- package/chunks/{chunk-W7NTX5RO.js → chunk-ZKCUQO6N.js} +7 -7
- package/chunks/{chunk-LK74HWZ4.js → chunk-ZNYTOOK6.js} +1431 -1120
- package/chunks/{chunk-ZQBNP2ZQ.js → chunk-ZRO2FPEP.js} +4 -4
- package/chunks/{codex-subagent-executor-BDV2OYSK.js → codex-subagent-executor-PV26MDIV.js} +72 -71
- package/chunks/{contextCommand-4XBRYOBZ.js → contextCommand-63B2HLAC.js} +71 -70
- package/chunks/{core-runtime-IYMVEYKI.js → core-runtime-47EMQJUH.js} +80 -79
- package/chunks/{create-sub-session-EAHSPBXY.js → create-sub-session-LEVD5YL4.js} +74 -73
- package/chunks/{daemon-git-worktree-guard-JPOH2ZV5.js → daemon-git-worktree-guard-ZOUTES2L.js} +70 -69
- package/chunks/{daemon-status-provider-GOJGNJ2Y.js → daemon-status-provider-HECREQKB.js} +78 -77
- package/chunks/{daemon-trust-policy-X5QLCVP2.js → daemon-trust-policy-TLDOAPNK.js} +76 -75
- package/chunks/{daemon-trust-policy-monitor-GOMIMXAS.js → daemon-trust-policy-monitor-EVORKLSC.js} +76 -75
- package/chunks/{deferred-core-runtime-MFMRVOPT.js → deferred-core-runtime-XHOZAMOD.js} +68 -67
- package/chunks/{display-image-U6HZKF3G.js → display-image-ETU7QIAC.js} +2 -2
- package/chunks/{edit-N5WDGSAZ.js → edit-YJQGE2UV.js} +46 -45
- package/chunks/{en-C4TIYTOH.js → en-XS2TOI7O.js} +70 -3
- package/chunks/{enter-worktree-A2WD27HQ.js → enter-worktree-OZOIH6KH.js} +4 -4
- package/chunks/{enterPlanMode-52GAH43E.js → enterPlanMode-RRAE4IQN.js} +44 -43
- package/chunks/{environment-RXHNLDLZ.js → environment-7WY7Y6VS.js} +71 -70
- package/chunks/{errors-D65OPVWO.js → errors-LK4KDMIG.js} +71 -70
- package/chunks/{execution-sandbox-config-YE2XOT56.js → execution-sandbox-config-EYZYM2IC.js} +7 -7
- package/chunks/{execution-tool-RK3OB5IY.js → execution-tool-5Z2YSFEP.js} +47 -46
- package/chunks/{execution-worker-R7E5B7CA.js → execution-worker-WHOZLJRT.js} +52 -51
- package/chunks/{exit-worktree-S7KUQ4HO.js → exit-worktree-W5TC4B4C.js} +4 -4
- package/chunks/{exitPlanMode-SRLMLRK5.js → exitPlanMode-7RG7ECTO.js} +44 -43
- package/chunks/{fast-path-KOMJMO2I.js → fast-path-GVJ4DBR2.js} +2 -2
- package/chunks/{glob-MD6DOICU.js → glob-PB6WN76C.js} +44 -43
- package/chunks/{goal-tools-FLJYRSX6.js → goal-tools-PXS3S5XC.js} +44 -43
- package/chunks/{handleAutoUpdate-LX4OGPKI.js → handleAutoUpdate-VHMFGYHU.js} +72 -71
- package/chunks/{i18n-CSJNAMVB.js → i18n-WCJ655MY.js} +70 -69
- package/chunks/{image-gen-GRJ73O3N.js → image-gen-Q4E7L7EV.js} +3 -6
- package/chunks/{initializer-UN73MGL2.js → initializer-BIPJZUNR.js} +76 -75
- package/chunks/{installationInfo-DOO2EVLV.js → installationInfo-N7GQ6GNX.js} +68 -67
- package/chunks/{keychain-token-storage-NDVFNJI5.js → keychain-token-storage-SJOKJDWV.js} +2 -1
- package/chunks/{list-UMP3UXDE.js → list-LO3EXRTY.js} +79 -78
- package/chunks/{llm-4AHGUE2C.js → llm-TQ7QWLQE.js} +145 -144
- package/chunks/{llm-content-generator-I62R6Q4I.js → llm-content-generator-7L62PNT2.js} +9 -8
- package/chunks/{loadedSettingsAdapter-KHAGVCPO.js → loadedSettingsAdapter-UU42Y22U.js} +76 -75
- package/chunks/{local-execution-environment-DOKSKTNZ.js → local-execution-environment-A4Y3D3ZV.js} +52 -51
- package/chunks/{loggingContentGenerator-53CAIYCN.js → loggingContentGenerator-ZY3AEK2S.js} +71 -72
- package/chunks/{managed-npm-update-KTATRLFZ.js → managed-npm-update-LNKFVE5Q.js} +68 -67
- package/chunks/{mcp-7GPEHQCC.js → mcp-OR7MZGDY.js} +76 -75
- package/chunks/{memory-side-query-EHR7FGIB.js → memory-side-query-BSVTSKCB.js} +7 -7
- package/chunks/{model-call-collection-J33XHZPS.js → model-call-collection-M2HSPDMR.js} +7 -7
- package/chunks/{model-configuration-BK2FWMLQ.js → model-configuration-FZ7M5PJD.js} +77 -76
- package/chunks/{modelConfigUtils-RHOU5ENH.js → modelConfigUtils-H56P2GGJ.js} +70 -69
- package/chunks/{monitor-WXQOHZKP.js → monitor-QCSMCJV7.js} +44 -43
- package/chunks/{node-5A2VFKYD.js → node-BMQ3WD34.js} +1 -2
- package/chunks/{nonInteractiveCli-332KOMYW.js → nonInteractiveCli-VGW2YQGN.js} +115 -114
- package/chunks/{nonInteractiveToolExecutor-ULCR2RA7.js → nonInteractiveToolExecutor-JNLRO4ZA.js} +45 -44
- package/chunks/{notebook-edit-HOKY5D6F.js → notebook-edit-672257RC.js} +45 -44
- package/chunks/{ocr-image-ZJCSAMSQ.js → ocr-image-O6ECQNUE.js} +6 -6
- package/chunks/{omni-O37J5JI3.js → omni-QCYXILWJ.js} +40 -42
- package/chunks/{openaiContentGenerator-62C5JSNE.js → openaiContentGenerator-54R7P33Y.js} +63 -61
- package/chunks/{openaiResponsesContentGenerator-JSS3U575.js → openaiResponsesContentGenerator-5TBBBXGD.js} +39 -24
- package/chunks/{processUtils-Y66KDZSB.js → processUtils-RH3ZJW76.js} +2 -2
- package/chunks/{prompt-terminal-ledger-MXYMD7UN.js → prompt-terminal-ledger-FCCYD5XB.js} +69 -68
- package/chunks/{pt-TCLIZMUA.js → pt-4SWM347K.js} +70 -3
- package/chunks/{reactive-degrade-X2JSVX5V.js → reactive-degrade-TYUV36MI.js} +25 -23
- package/chunks/{read-file-UDFSKNBI.js → read-file-EX7W2NE2.js} +12 -11
- package/chunks/{recall-media-memory-tool-GAR6JWON.js → recall-media-memory-tool-WIFEB2OG.js} +5 -5
- package/chunks/{record-artifact-PL2T5AJY.js → record-artifact-IVE6QT4D.js} +3 -3
- package/chunks/{record-source-ANENC5K7.js → record-source-U53PRXYX.js} +5 -5
- package/chunks/{report-findings-RFO53756.js → report-findings-W75NCFXY.js} +4 -4
- package/chunks/{request-shutdown-LRWCJOEG.js → request-shutdown-E5QAHOAD.js} +4 -4
- package/chunks/{resumeHistoryUtils-ABWHIQME.js → resumeHistoryUtils-B4SY2SEU.js} +74 -73
- package/chunks/{ripGrep-RMGB52RM.js → ripGrep-ECY5TTFL.js} +14 -13
- package/chunks/{run-o1-code-serve-KVOUMETW.js → run-o1-code-serve-NXMW2E5M.js} +59 -59
- package/chunks/{runtime-shell-policy-Y3TGAQLT.js → runtime-shell-policy-Z53GWNM7.js} +1 -1
- package/chunks/{sandboxConfig-6UNSTBMJ.js → sandboxConfig-TBSQ54IT.js} +68 -67
- package/chunks/{scheduled-tasks-SHFPXK6P.js → scheduled-tasks-UHJTWXCD.js} +77 -76
- package/chunks/{scheduler-N5K2SUQE.js → scheduler-3JYFHVVB.js} +70 -69
- package/chunks/{sdk-exporters-grpc-J2ILXEUS.js → sdk-exporters-grpc-FZO3Y43M.js} +2 -2
- package/chunks/{sdk-exporters-http-HGBOA62S.js → sdk-exporters-http-WYXH2KE4.js} +14 -14
- package/chunks/{sdk-impl-G2NWB5MF.js → sdk-impl-5PWLMFPQ.js} +20 -20
- package/chunks/{send-message-QOWWQKZJ.js → send-message-OSS7K7GE.js} +4 -4
- package/chunks/{serve-RQIMY7MC.js → serve-LYALSSC5.js} +76 -75
- package/chunks/{server-AA4LTEQ2.js → server-YW2DKRAT.js} +263 -262
- package/chunks/{session-4627GZ4S.js → session-GSTJQ27V.js} +125 -124
- package/chunks/session-YZBL75AL.js +34 -0
- package/chunks/{session-attachments-root-Y4BXBBHX.js → session-attachments-root-VZ7KZ6N4.js} +68 -67
- package/chunks/{session-pr-refresh-XXIT42IO.js → session-pr-refresh-42IL6M3O.js} +77 -76
- package/chunks/{settings-CHJS242C.js → settings-H5Q3CLHZ.js} +76 -75
- package/chunks/{shell-PDZIKVVS.js → shell-6MN3L324.js} +44 -43
- package/chunks/{skill-QOPISSJO.js → skill-7IYKGXUW.js} +14 -13
- package/chunks/{skill-settings-SSXT3JNN.js → skill-settings-33HY5DDP.js} +76 -75
- package/chunks/{spawnChannel-MPL2AUYX.js → spawnChannel-GYJJNWZ7.js} +71 -70
- package/chunks/{standalone-update-ACWQFW36.js → standalone-update-TSHH3DWA.js} +71 -70
- package/chunks/{startInteractiveUI-PKMNIOMH.js → startInteractiveUI-PPEGHGPU.js} +4777 -4399
- package/chunks/{task-create-2BHPJUF3.js → task-create-WLFSUWNH.js} +5 -5
- package/chunks/{task-update-NGKKBFU5.js → task-update-STSLD6C5.js} +5 -5
- package/chunks/{team-create-PDT7MW4F.js → team-create-CSOWNJLF.js} +44 -43
- package/chunks/{team-plan-approval-4CFTZI2I.js → team-plan-approval-LTUBZHSC.js} +44 -43
- package/chunks/{terminal-image-renderer-C65IVJHI.js → terminal-image-renderer-EUMAETSP.js} +68 -67
- package/chunks/{theme-manager-5FF3ROXZ.js → theme-manager-5TCLD3WW.js} +68 -67
- package/chunks/{tool-call-GVZHLCX6.js → tool-call-2R6GT3ZZ.js} +5 -5
- package/chunks/{tool-result-media-YFEIOZDR.js → tool-result-media-PPZAFNQ3.js} +21 -23
- package/chunks/{tool-search-WNOVTFBP.js → tool-search-OU6ZHDIV.js} +19 -18
- package/chunks/{total-session-admission-Q6NUZVLI.js → total-session-admission-7MG63XH6.js} +73 -72
- package/chunks/{transcribe-audio-J3OVKT5D.js → transcribe-audio-R6YC24KU.js} +3 -3
- package/chunks/{trustedFolders-SFZUU4GO.js → trustedFolders-OFYE5GKD.js} +70 -69
- package/chunks/{understand-video-segments-OMAJP6Q7.js → understand-video-segments-2WK4T6PO.js} +8 -8
- package/chunks/{update-relaunch-ICPN37DV.js → update-relaunch-AJ466EO3.js} +5 -5
- package/chunks/{updateCheck-PRCH4Y2X.js → updateCheck-SUPCJRZ5.js} +71 -70
- package/chunks/{upload-config-JG34DU4J.js → upload-config-FLQKSPO4.js} +10 -8
- package/chunks/{useAutoAcceptIndicator-FZVG3NNO.js → useAutoAcceptIndicator-5MF6HAIZ.js} +79 -78
- package/chunks/{validateNonInterActiveAuth-XRY2O6CQ.js → validateNonInterActiveAuth-N46PJGJS.js} +113 -112
- package/chunks/{version-IU45BCJE.js → version-ANBWTPRO.js} +1 -1
- package/chunks/{web-fetch-WO3GHRIO.js → web-fetch-Z2OA65BV.js} +14 -16
- package/chunks/{web-search-4GJLGZQM.js → web-search-SJQG2GX3.js} +12 -13
- package/chunks/web-shell-static-OOIIII74.js +1 -1
- package/chunks/{workflow-UG4V5VWR.js → workflow-FHCFTKRA.js} +47 -46
- package/chunks/{workspace-providers-status-IM5IUQXM.js → workspace-providers-status-5DXK5EPJ.js} +82 -81
- package/chunks/{workspace-registration-store-O36O7FTL.js → workspace-registration-store-53NGEDB2.js} +1 -1
- package/chunks/{workspace-registry-TOE2NYGH.js → workspace-registry-3G7IBILS.js} +73 -72
- package/chunks/{workspace-runtime-coordinator-LS7MYSDY.js → workspace-runtime-coordinator-PM3IIKWK.js} +74 -73
- package/chunks/{workspace-service-FL63YNEM.js → workspace-service-MHVN7SZD.js} +82 -81
- package/chunks/{workspace-skills-status-IXHCVUXS.js → workspace-skills-status-VMCBOJBR.js} +79 -78
- package/chunks/{workspace-trust-reconciler-WTJ52TKZ.js → workspace-trust-reconciler-2OXEFTNA.js} +82 -81
- package/chunks/{write-file-VTHULBGP.js → write-file-CKZFK2OO.js} +47 -46
- package/chunks/{zh-KRQU675V.js → zh-GBDJHFG4.js} +1 -0
- package/chunks/{zh-TW-K657U7LC.js → zh-TW-WWN26WO4.js} +1 -0
- package/chunks/{zoom-image-TJNJJATC.js → zoom-image-S763FYBO.js} +12 -11
- package/cli.js +14 -14
- package/execution-worker.js +1 -1
- package/export-transcript-document.js +1 -1
- package/locales/en.js +95 -2
- package/locales/pt.js +95 -2
- package/locales/zh-TW.js +2 -0
- package/locales/zh.js +2 -0
- package/package.json +2 -2
- package/release-notes.json +20 -0
- package/vendor/tree-sitter/tree-sitter-bash.wasm +0 -0
- package/vendor/tree-sitter/tree-sitter.wasm +0 -0
- package/web-shell/assets/{abnfDiagram-VCTEODGH-anMh0rnI.js → abnfDiagram-VCTEODGH-Dd5GshXZ.js} +1 -1
- package/web-shell/assets/{arc-sPYpPSws.js → arc-BzmxNcPV.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-BKh0KCFR.js → architectureDiagram-5GKGNRK7-Cl-ccT8a.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-CUfywffW.js → blockDiagram-NRAW4CY4-B35pxtm3.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-CM2pLl5w.js → c4Diagram-UCG6FXSJ-B5qoJcBm.js} +1 -1
- package/web-shell/assets/channel-Cu64z9HZ.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-n9OTAsCE.js → chunk-2Q5K7J3B-CNMhmKb4.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-CC3dLmo9.js → chunk-5VM5RSS4-CzuX-MER.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-pIte4woe.js → chunk-F27PBJKO-DT37LCqQ.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-Bd4q9Va0.js → chunk-G27WJ6UU-Bq7N69gu.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-C1ornOGN.js → chunk-JWPE2WC7-B7XNzXZi.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-w09p9W09.js → chunk-LCL6LL3I-ev2gqrXp.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-CHY7aAx4.js → chunk-POPQ4Y6H-DZiIq2t9.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-DKqS6ObW.js → chunk-SVP7TREG-BDUL6ZGf.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-DWqNHE5T.js → chunk-XXDRQBXY-sMlMtGuS.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-BGgegV4f.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-BGgegV4f.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-CTuORHW-.js → cose-bilkent-JH36ORCC-o-qhY8ZO.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-D38bIRGV.js → cynefin-OW5HDTMX-D_0MbdlL.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-zojG5SHE.js → cynefinDiagram-5FMLGOSQ-CQKn510t.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-B_mgdgxG.js → dagre-3AP2YEHR-DfrDEKoD.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-Boe4tqaP.js → diagram-S7CK7UJ4-C7c3Mlbe.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-DEFdgAk5.js → diagram-UQ7AKVKN-DwNnlZ89.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-lg-aIy2H.js → diagram-VSXAHHWV-DOg1kmwI.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-B8GfIB8O.js → diagram-VX7I27RA-3hGgj-7o.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-B9d7kR6t.js → diagram-Z3DM3KII-ZfVqlAN6.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-BbKPC4Lq.js → ebnfDiagram-PWID7BFC-BWplgnNz.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-CRAgoOe5.js → erDiagram-SSCWMZ5O-DwYYQH-_.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-Ur3ln_JM.js → flowDiagram-A5DVABFB-BWw-iXkD.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-C9BN2b5E.js → ganttDiagram-EL5Y4UJY-C71Eo8TM.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-CRfkh-0v.js → gitGraphDiagram-WWUBYQGX-BUlmyPh9.js} +1 -1
- package/web-shell/assets/{index-CeQlCdwD.js → index-Cov5zq9G.js} +3 -3
- package/web-shell/assets/{index-DiA0wMqK.js → index-YpUe3L92.js} +1 -1
- package/web-shell/assets/{infoDiagram-RXCK75RN-DK1-ESA4.js → infoDiagram-RXCK75RN-BOvXDm7l.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-kxpIDlCX.js → ishikawaDiagram-5VMMS53U-zA04wTLO.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-DQ9EbXpv.js → journeyDiagram-EYS64GPL-B9u2zTa4.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-UYveUTce.js → kanban-definition-3QL26DDD-CcZcxOR7.js} +1 -1
- package/web-shell/assets/{layout-BPonaHzT.js → layout-CXIk6jWz.js} +1 -1
- package/web-shell/assets/{linear-C-eJXPTS.js → linear-Dlkedwd1.js} +1 -1
- package/web-shell/assets/{mermaid.core-BX1Kz_A0.js → mermaid.core-BjB3MvuB.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-B6QyHOu0.js → mindmap-definition-FBJOCRG2-DCpRJqAA.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-Caflqhs8.js → pegDiagram-XKGWAZYB-DbX7p38q.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-6zzkWzNt.js → pieDiagram-E7YTZNPT-4iblIg8S.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-BVL3cBz2.js → quadrantDiagram-AXDQQJYC-qLrQysOt.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-DqBEO3-Z.js → railroadDiagram-O6MQD6OU-BhUMCp8M.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-CBFGB-6Q.js → requirementDiagram-EFPCY7ZU-CI_uT2ta.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-DOpW98KL.js → sankeyDiagram-P5KCCOFB-DnVXzAke.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-CVtDqArI.js → sequenceDiagram-WJ2MYXX4-VXU581VP.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-DQjMKuHP.js → sizeCapture-X5ZJPWSS-DgdBXSuW.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-D4n_VP2j.js → stateDiagram-HBIQ2CUA-CoE_MmRT.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-CpuBms53.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-Dvr4Gk5J.js → swimlanes-XN3QIQJK-CypA76o8.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-DpUS1aIh.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-DXsPhzEF.js → timeline-definition-24CTP7MA-D0l1ujUh.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-aA8X42UU.js → vennDiagram-4TSXK5OY-DnMCYIem.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-CuOx8tlj.js → wardleyDiagram-VM6X3IG4-DZUWBuNt.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-DIc2TzVm.js → xychartDiagram-S5SC5T6Z-CG2OOMIf.js} +1 -1
- package/web-shell/index.html +1 -1
- package/web-shell/sw.js +1 -1
- package/chunks/chunk-7USF7X6U.js +0 -584
- package/chunks/chunk-ALIO4STD.js +0 -340
- package/chunks/chunk-KTOCX7IM.js +0 -27
- package/chunks/chunk-MWFHMYVA.js +0 -93
- package/chunks/chunk-PFRCGQAE.js +0 -48
- package/chunks/chunk-RC67CA5Z.js +0 -10861
- package/chunks/chunk-VIAJ74X3.js +0 -410
- package/vendor/o1-connect/.lintstagedrc.mjs +0 -7
- package/web-shell/assets/channel-DRltBDks.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-Bs6uTgrQ.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-Bs6uTgrQ.js +0 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-Cy-H3uc5.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-BmzgGPpR.js +0 -8
- package/chunks/{chunk-BWRP5ZMP.js → chunk-DQZYZDIL.js} +3 -3
- package/chunks/{chunk-KV5QCRFB.js → chunk-IC57EPC7.js} +3 -3
- package/chunks/{chunk-YJLJUKJ7.js → chunk-IZSIFV6S.js} +3 -3
- package/chunks/{chunk-H5L5E5NI.js → chunk-ROO6F2BT.js} +3 -3
- package/chunks/{chunk-MDU4BZLN.js → chunk-YSZCVSC3.js} +0 -0
- package/chunks/{clip-audio-G2SG55MB.js → clip-audio-BJ42NS5B.js} +4 -4
- package/chunks/{clip-image-I3IFRW4Z.js → clip-image-FDBAIKGB.js} +3 -3
- package/chunks/{clip-video-XISLKGWO.js → clip-video-6KVC2IFL.js} +4 -4
- package/chunks/{convert-image-TXAOAPLS.js → convert-image-AYXBZ3TH.js} +3 -3
- package/chunks/{downsample-audio-SBMOSASE.js → downsample-audio-HSPMS25U.js} +4 -4
- package/chunks/{downsample-image-S5ZKCZEM.js → downsample-image-BFBX343I.js} +3 -3
- package/chunks/{downscale-video-LFLD2MYN.js → downscale-video-GQ5ZMJRX.js} +4 -4
- package/chunks/{extract-audio-TY277NLN.js → extract-audio-3LB2Q736.js} +4 -4
- package/chunks/{extract-keyframes-CXPABWEU.js → extract-keyframes-6ZP65BJF.js} +4 -4
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
|
-
AuthType,
|
|
5
|
-
MODEL_GENERATION_CONFIG_FIELDS,
|
|
6
|
-
PROVIDER_SOURCED_FIELDS,
|
|
7
|
-
REASONING_EFFORT_TIERS,
|
|
8
|
-
clampReasoningEffort,
|
|
9
4
|
defaultModalities,
|
|
10
|
-
getGptReasoningCapabilities,
|
|
11
|
-
normalize,
|
|
12
|
-
parseModelReasoningCapabilities,
|
|
13
5
|
tokenLimit
|
|
14
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-72EBG4FJ.js";
|
|
7
|
+
import {
|
|
8
|
+
AuthType,
|
|
9
|
+
MODEL_GENERATION_CONFIG_FIELDS,
|
|
10
|
+
PROVIDER_SOURCED_FIELDS
|
|
11
|
+
} from "./chunk-6Z3USRSR.js";
|
|
15
12
|
import {
|
|
16
13
|
DEFAULT_O1CODE_MODEL
|
|
17
14
|
} from "./chunk-LEXKU5FI.js";
|
|
@@ -28,6 +25,16 @@ import {
|
|
|
28
25
|
__name
|
|
29
26
|
} from "./chunk-J2S4EL5Y.js";
|
|
30
27
|
|
|
28
|
+
// packages/core/src/providers/all-providers.ts
|
|
29
|
+
init_esbuild_shims();
|
|
30
|
+
|
|
31
|
+
// packages/core/src/providers/provider-config.ts
|
|
32
|
+
init_esbuild_shims();
|
|
33
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
34
|
+
|
|
35
|
+
// packages/core/src/models/modelRegistry.ts
|
|
36
|
+
init_esbuild_shims();
|
|
37
|
+
|
|
31
38
|
// packages/core/src/core/openaiContentGenerator/constants.ts
|
|
32
39
|
init_esbuild_shims();
|
|
33
40
|
var DEFAULT_TIMEOUT = 12e4;
|
|
@@ -53,213 +60,11 @@ function normalizeOpenAiWireBaseUrl(baseUrl) {
|
|
|
53
60
|
}
|
|
54
61
|
__name(normalizeOpenAiWireBaseUrl, "normalizeOpenAiWireBaseUrl");
|
|
55
62
|
|
|
56
|
-
// packages/core/src/models/image-generation-capability.ts
|
|
57
|
-
init_esbuild_shims();
|
|
58
|
-
function isImageGenerationCapable(model) {
|
|
59
|
-
return model.supportsImageGeneration === true || model.imageOnly === true;
|
|
60
|
-
}
|
|
61
|
-
__name(isImageGenerationCapable, "isImageGenerationCapable");
|
|
62
|
-
|
|
63
|
-
// packages/core/src/utils/runtimeModelPrefix.ts
|
|
64
|
-
init_esbuild_shims();
|
|
65
|
-
var RUNTIME_SNAPSHOT_PREFIX = "$runtime|";
|
|
66
|
-
function buildRuntimeSnapshotId(authType, modelId) {
|
|
67
|
-
return `${RUNTIME_SNAPSHOT_PREFIX}${authType}|${modelId}`;
|
|
68
|
-
}
|
|
69
|
-
__name(buildRuntimeSnapshotId, "buildRuntimeSnapshotId");
|
|
70
|
-
function stripRuntimeSnapshotPrefix(modelId) {
|
|
71
|
-
let id = modelId;
|
|
72
|
-
while (id.startsWith(RUNTIME_SNAPSHOT_PREFIX)) {
|
|
73
|
-
const stripped = id.split("|").slice(2).join("|");
|
|
74
|
-
if (!stripped) break;
|
|
75
|
-
id = stripped;
|
|
76
|
-
}
|
|
77
|
-
return id;
|
|
78
|
-
}
|
|
79
|
-
__name(stripRuntimeSnapshotPrefix, "stripRuntimeSnapshotPrefix");
|
|
80
|
-
|
|
81
|
-
// packages/core/src/providers/credential-store.ts
|
|
82
|
-
init_esbuild_shims();
|
|
83
|
-
import * as fs from "node:fs";
|
|
84
|
-
import * as path from "node:path";
|
|
85
|
-
import { randomBytes } from "node:crypto";
|
|
86
|
-
var debugLogger = createDebugLogger("CREDENTIAL_STORE");
|
|
87
|
-
var CREDENTIAL_ID = /^[a-z0-9][a-z0-9-]*$/;
|
|
88
|
-
var DIR_MODE = 448;
|
|
89
|
-
var FILE_MODE = 384;
|
|
90
|
-
function isValidCredentialId(id) {
|
|
91
|
-
return CREDENTIAL_ID.test(id);
|
|
92
|
-
}
|
|
93
|
-
__name(isValidCredentialId, "isValidCredentialId");
|
|
94
|
-
function assertCredentialId(id) {
|
|
95
|
-
if (!isValidCredentialId(id)) {
|
|
96
|
-
throw new Error(
|
|
97
|
-
`Invalid credential id "${id}": use lowercase letters, digits and dashes.`
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
__name(assertCredentialId, "assertCredentialId");
|
|
102
|
-
function credentialPath(id) {
|
|
103
|
-
assertCredentialId(id);
|
|
104
|
-
return path.join(Storage.getCredentialsDir(), `${id}.json`);
|
|
105
|
-
}
|
|
106
|
-
__name(credentialPath, "credentialPath");
|
|
107
|
-
function credentialIdForProvider(providerId) {
|
|
108
|
-
return providerId.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().replace(/[^a-z0-9-]/g, "-");
|
|
109
|
-
}
|
|
110
|
-
__name(credentialIdForProvider, "credentialIdForProvider");
|
|
111
|
-
function chmodQuietly(target, mode) {
|
|
112
|
-
try {
|
|
113
|
-
fs.chmodSync(target, mode);
|
|
114
|
-
} catch (error) {
|
|
115
|
-
if (error.code !== "EPERM") throw error;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
__name(chmodQuietly, "chmodQuietly");
|
|
119
|
-
function readCredential(id) {
|
|
120
|
-
const file = credentialPath(id);
|
|
121
|
-
let raw;
|
|
122
|
-
try {
|
|
123
|
-
raw = fs.readFileSync(file, "utf8");
|
|
124
|
-
} catch {
|
|
125
|
-
return void 0;
|
|
126
|
-
}
|
|
127
|
-
try {
|
|
128
|
-
const parsed = JSON.parse(raw);
|
|
129
|
-
const apiKey = parsed && typeof parsed === "object" ? parsed.apiKey : void 0;
|
|
130
|
-
if (typeof apiKey !== "string" || !apiKey.trim()) {
|
|
131
|
-
throw new Error("no apiKey");
|
|
132
|
-
}
|
|
133
|
-
const { savedAt, expiresAt, deviceName } = parsed;
|
|
134
|
-
return {
|
|
135
|
-
apiKey,
|
|
136
|
-
savedAt: typeof savedAt === "string" ? savedAt : "",
|
|
137
|
-
...expiresAt === null || typeof expiresAt === "string" ? { expiresAt } : {},
|
|
138
|
-
...typeof deviceName === "string" && deviceName ? { deviceName } : {}
|
|
139
|
-
};
|
|
140
|
-
} catch {
|
|
141
|
-
debugLogger.debug(`Ignoring unreadable credential file for "${id}".`);
|
|
142
|
-
return void 0;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
__name(readCredential, "readCredential");
|
|
146
|
-
function writeCredential(id, { apiKey, expiresAt, deviceName }) {
|
|
147
|
-
const file = credentialPath(id);
|
|
148
|
-
if (!apiKey.trim()) {
|
|
149
|
-
throw new Error(`Refusing to save an empty API key for "${id}".`);
|
|
150
|
-
}
|
|
151
|
-
const dir = path.dirname(file);
|
|
152
|
-
fs.mkdirSync(dir, { recursive: true, mode: DIR_MODE });
|
|
153
|
-
chmodQuietly(dir, DIR_MODE);
|
|
154
|
-
const credential = {
|
|
155
|
-
apiKey,
|
|
156
|
-
savedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
157
|
-
...expiresAt !== void 0 ? { expiresAt } : {},
|
|
158
|
-
...deviceName ? { deviceName } : {}
|
|
159
|
-
};
|
|
160
|
-
const temp = path.join(
|
|
161
|
-
dir,
|
|
162
|
-
`.${id}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`
|
|
163
|
-
);
|
|
164
|
-
try {
|
|
165
|
-
fs.writeFileSync(temp, `${JSON.stringify(credential, null, 2)}
|
|
166
|
-
`, {
|
|
167
|
-
mode: FILE_MODE
|
|
168
|
-
});
|
|
169
|
-
chmodQuietly(temp, FILE_MODE);
|
|
170
|
-
fs.renameSync(temp, file);
|
|
171
|
-
} catch (error) {
|
|
172
|
-
fs.rmSync(temp, { force: true });
|
|
173
|
-
throw error;
|
|
174
|
-
}
|
|
175
|
-
return credential;
|
|
176
|
-
}
|
|
177
|
-
__name(writeCredential, "writeCredential");
|
|
178
|
-
function removeCredential(id) {
|
|
179
|
-
const file = credentialPath(id);
|
|
180
|
-
try {
|
|
181
|
-
fs.unlinkSync(file);
|
|
182
|
-
return true;
|
|
183
|
-
} catch (error) {
|
|
184
|
-
if (error.code === "ENOENT") return false;
|
|
185
|
-
throw error;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
__name(removeCredential, "removeCredential");
|
|
189
|
-
function readSavedApiKey(id) {
|
|
190
|
-
if (!id || !isValidCredentialId(id)) return void 0;
|
|
191
|
-
return readCredential(id)?.apiKey;
|
|
192
|
-
}
|
|
193
|
-
__name(readSavedApiKey, "readSavedApiKey");
|
|
194
|
-
var DENY_ENV_KEYS = /* @__PURE__ */ new Set([
|
|
195
|
-
"NODE_OPTIONS",
|
|
196
|
-
"NODE_PATH",
|
|
197
|
-
"LD_PRELOAD",
|
|
198
|
-
"LD_LIBRARY_PATH",
|
|
199
|
-
"DYLD_INSERT_LIBRARIES",
|
|
200
|
-
"DYLD_LIBRARY_PATH",
|
|
201
|
-
"PATH",
|
|
202
|
-
"HOME",
|
|
203
|
-
"USERPROFILE",
|
|
204
|
-
"TMPDIR",
|
|
205
|
-
"TMP",
|
|
206
|
-
"TEMP"
|
|
207
|
-
]);
|
|
208
|
-
var ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
209
|
-
var exported = /* @__PURE__ */ new Map();
|
|
210
|
-
function exportCredentialToEnv(envKey, apiKey) {
|
|
211
|
-
if (!ENV_NAME.test(envKey) || DENY_ENV_KEYS.has(envKey.toUpperCase())) {
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
const current = process.env[envKey];
|
|
215
|
-
const ours = exported.has(envKey) && exported.get(envKey) === current;
|
|
216
|
-
if (current !== void 0 && current !== "" && !ours) return false;
|
|
217
|
-
process.env[envKey] = apiKey;
|
|
218
|
-
exported.set(envKey, apiKey);
|
|
219
|
-
return true;
|
|
220
|
-
}
|
|
221
|
-
__name(exportCredentialToEnv, "exportCredentialToEnv");
|
|
222
|
-
function isExportedCredentialEnv(envKey) {
|
|
223
|
-
return exported.has(envKey) && exported.get(envKey) === process.env[envKey];
|
|
224
|
-
}
|
|
225
|
-
__name(isExportedCredentialEnv, "isExportedCredentialEnv");
|
|
226
|
-
function withdrawExportedCredential(envKey) {
|
|
227
|
-
if (isExportedCredentialEnv(envKey)) delete process.env[envKey];
|
|
228
|
-
exported.delete(envKey);
|
|
229
|
-
}
|
|
230
|
-
__name(withdrawExportedCredential, "withdrawExportedCredential");
|
|
231
|
-
function exportedCredentialEnvKeys() {
|
|
232
|
-
return [...exported.keys()].filter(isExportedCredentialEnv);
|
|
233
|
-
}
|
|
234
|
-
__name(exportedCredentialEnvKeys, "exportedCredentialEnvKeys");
|
|
235
|
-
function adoptExportedCredentialEnvKeys(keys) {
|
|
236
|
-
for (const key of keys) {
|
|
237
|
-
const value = process.env[key];
|
|
238
|
-
if (!ENV_NAME.test(key) || DENY_ENV_KEYS.has(key.toUpperCase())) continue;
|
|
239
|
-
if (value === void 0 || value === "") continue;
|
|
240
|
-
exported.set(key, value);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
__name(adoptExportedCredentialEnvKeys, "adoptExportedCredentialEnvKeys");
|
|
244
|
-
|
|
245
|
-
// packages/core/src/providers/model-api-key.ts
|
|
246
|
-
init_esbuild_shims();
|
|
247
|
-
|
|
248
|
-
// packages/core/src/providers/all-providers.ts
|
|
249
|
-
init_esbuild_shims();
|
|
250
|
-
|
|
251
|
-
// packages/core/src/providers/provider-config.ts
|
|
252
|
-
init_esbuild_shims();
|
|
253
|
-
import { createHash as createHash2 } from "node:crypto";
|
|
254
|
-
|
|
255
|
-
// packages/core/src/models/modelRegistry.ts
|
|
256
|
-
init_esbuild_shims();
|
|
257
|
-
|
|
258
63
|
// packages/core/src/models/types.ts
|
|
259
64
|
init_esbuild_shims();
|
|
260
65
|
|
|
261
66
|
// packages/core/src/models/modelRegistry.ts
|
|
262
|
-
var
|
|
67
|
+
var debugLogger = createDebugLogger("MODEL_REGISTRY");
|
|
263
68
|
function validateAuthTypeKey(key) {
|
|
264
69
|
if (Object.values(AuthType).includes(key)) {
|
|
265
70
|
return key;
|
|
@@ -389,7 +194,7 @@ var ModelRegistry = class _ModelRegistry {
|
|
|
389
194
|
const knownProtocols = Object.values(AuthType).filter((value) => value !== "openai-responses" /* USE_OPENAI_RESPONSES */).join(", ");
|
|
390
195
|
const mapped = Object.hasOwn(this.providerProtocolConfig, providerId) ? this.providerProtocolConfig[providerId] : void 0;
|
|
391
196
|
const message = mapped !== void 0 ? `Provider "${providerId}" maps to "${mapped}" via providerProtocol, which is not a known protocol (${knownProtocols}); skipping.` : `Provider "${providerId}" in modelProviders is not a built-in protocol (${knownProtocols}) and has no providerProtocol mapping; skipping. Add providerProtocol["${providerId}"] to route it to an SDK protocol.`;
|
|
392
|
-
|
|
197
|
+
debugLogger.warn(message);
|
|
393
198
|
continue;
|
|
394
199
|
}
|
|
395
200
|
this.registerAuthTypeModels(protocol, models, providerId);
|
|
@@ -403,7 +208,7 @@ var ModelRegistry = class _ModelRegistry {
|
|
|
403
208
|
*/
|
|
404
209
|
registerAuthTypeModels(authType, models, providerId) {
|
|
405
210
|
if (!Array.isArray(models)) {
|
|
406
|
-
|
|
211
|
+
debugLogger.warn(
|
|
407
212
|
`modelProviders for provider "${providerId ?? authType}" is not an array; skipping. Expected ModelConfig[]; legacy { protocol, models } entries are normally rewritten by the v5->v4 settings migration.`
|
|
408
213
|
);
|
|
409
214
|
return;
|
|
@@ -418,7 +223,7 @@ var ModelRegistry = class _ModelRegistry {
|
|
|
418
223
|
const modelMap = this.modelsByAuthType.get(modelAuthType) ?? /* @__PURE__ */ new Map();
|
|
419
224
|
const key = modelRegistryKey(config.id, config.baseUrl);
|
|
420
225
|
if (modelMap.has(key)) {
|
|
421
|
-
|
|
226
|
+
debugLogger.warn(
|
|
422
227
|
`Duplicate model id "${config.id}"${config.baseUrl ? ` with baseUrl "${config.baseUrl}"` : ""} for protocol "${modelAuthType}"${providerLabel}. Using the first registered config.`
|
|
423
228
|
);
|
|
424
229
|
continue;
|
|
@@ -536,7 +341,7 @@ var ModelRegistry = class _ModelRegistry {
|
|
|
536
341
|
config.realtimeOnly
|
|
537
342
|
].filter(Boolean).length;
|
|
538
343
|
if (selectorOnlyCount > 1) {
|
|
539
|
-
|
|
344
|
+
debugLogger.warn(
|
|
540
345
|
`Model "${config.id}" in authType "${authType}" has multiple selector-only flags. It will be unreachable in at least one model selector.`
|
|
541
346
|
);
|
|
542
347
|
}
|
|
@@ -564,18 +369,253 @@ var ModelRegistry = class _ModelRegistry {
|
|
|
564
369
|
getModelProvidersConfig() {
|
|
565
370
|
return this.modelProvidersConfig;
|
|
566
371
|
}
|
|
567
|
-
getProviderProtocolConfig() {
|
|
568
|
-
return this.providerProtocolConfig;
|
|
372
|
+
getProviderProtocolConfig() {
|
|
373
|
+
return this.providerProtocolConfig;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
// packages/core/src/providers/install.ts
|
|
378
|
+
init_esbuild_shims();
|
|
379
|
+
import { isDeepStrictEqual } from "node:util";
|
|
380
|
+
|
|
381
|
+
// packages/core/src/models/image-generation-capability.ts
|
|
382
|
+
init_esbuild_shims();
|
|
383
|
+
function isImageGenerationCapable(model) {
|
|
384
|
+
return model.supportsImageGeneration === true || model.imageOnly === true;
|
|
385
|
+
}
|
|
386
|
+
__name(isImageGenerationCapable, "isImageGenerationCapable");
|
|
387
|
+
|
|
388
|
+
// packages/core/src/models/modelsConfig.ts
|
|
389
|
+
init_esbuild_shims();
|
|
390
|
+
import process2 from "node:process";
|
|
391
|
+
|
|
392
|
+
// packages/core/src/utils/runtimeModelPrefix.ts
|
|
393
|
+
init_esbuild_shims();
|
|
394
|
+
var RUNTIME_SNAPSHOT_PREFIX = "$runtime|";
|
|
395
|
+
function buildRuntimeSnapshotId(authType, modelId) {
|
|
396
|
+
return `${RUNTIME_SNAPSHOT_PREFIX}${authType}|${modelId}`;
|
|
397
|
+
}
|
|
398
|
+
__name(buildRuntimeSnapshotId, "buildRuntimeSnapshotId");
|
|
399
|
+
function stripRuntimeSnapshotPrefix(modelId) {
|
|
400
|
+
let id = modelId;
|
|
401
|
+
while (id.startsWith(RUNTIME_SNAPSHOT_PREFIX)) {
|
|
402
|
+
const stripped = id.split("|").slice(2).join("|");
|
|
403
|
+
if (!stripped) break;
|
|
404
|
+
id = stripped;
|
|
405
|
+
}
|
|
406
|
+
return id;
|
|
407
|
+
}
|
|
408
|
+
__name(stripRuntimeSnapshotPrefix, "stripRuntimeSnapshotPrefix");
|
|
409
|
+
|
|
410
|
+
// packages/core/src/providers/model-api-key.ts
|
|
411
|
+
init_esbuild_shims();
|
|
412
|
+
|
|
413
|
+
// packages/core/src/providers/credential-store.ts
|
|
414
|
+
init_esbuild_shims();
|
|
415
|
+
import * as fs from "node:fs";
|
|
416
|
+
import * as path from "node:path";
|
|
417
|
+
import { randomBytes } from "node:crypto";
|
|
418
|
+
var debugLogger2 = createDebugLogger("CREDENTIAL_STORE");
|
|
419
|
+
var CREDENTIAL_ID = /^[a-z0-9][a-z0-9-]*$/;
|
|
420
|
+
var DIR_MODE = 448;
|
|
421
|
+
var FILE_MODE = 384;
|
|
422
|
+
function isValidCredentialId(id) {
|
|
423
|
+
return CREDENTIAL_ID.test(id);
|
|
424
|
+
}
|
|
425
|
+
__name(isValidCredentialId, "isValidCredentialId");
|
|
426
|
+
function assertCredentialId(id) {
|
|
427
|
+
if (!isValidCredentialId(id)) {
|
|
428
|
+
throw new Error(
|
|
429
|
+
`Invalid credential id "${id}": use lowercase letters, digits and dashes.`
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
__name(assertCredentialId, "assertCredentialId");
|
|
434
|
+
function credentialPath(id) {
|
|
435
|
+
assertCredentialId(id);
|
|
436
|
+
return path.join(Storage.getCredentialsDir(), `${id}.json`);
|
|
437
|
+
}
|
|
438
|
+
__name(credentialPath, "credentialPath");
|
|
439
|
+
function credentialIdForProvider(providerId) {
|
|
440
|
+
return providerId.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().replace(/[^a-z0-9-]/g, "-");
|
|
441
|
+
}
|
|
442
|
+
__name(credentialIdForProvider, "credentialIdForProvider");
|
|
443
|
+
function chmodQuietly(target, mode) {
|
|
444
|
+
try {
|
|
445
|
+
fs.chmodSync(target, mode);
|
|
446
|
+
} catch (error) {
|
|
447
|
+
if (error.code !== "EPERM") throw error;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
__name(chmodQuietly, "chmodQuietly");
|
|
451
|
+
function readCredential(id) {
|
|
452
|
+
const file = credentialPath(id);
|
|
453
|
+
let raw;
|
|
454
|
+
try {
|
|
455
|
+
raw = fs.readFileSync(file, "utf8");
|
|
456
|
+
} catch {
|
|
457
|
+
return void 0;
|
|
458
|
+
}
|
|
459
|
+
try {
|
|
460
|
+
const parsed = JSON.parse(raw);
|
|
461
|
+
const apiKey = parsed && typeof parsed === "object" ? parsed.apiKey : void 0;
|
|
462
|
+
if (typeof apiKey !== "string" || !apiKey.trim()) {
|
|
463
|
+
throw new Error("no apiKey");
|
|
464
|
+
}
|
|
465
|
+
const { savedAt, expiresAt, deviceName } = parsed;
|
|
466
|
+
return {
|
|
467
|
+
apiKey,
|
|
468
|
+
savedAt: typeof savedAt === "string" ? savedAt : "",
|
|
469
|
+
...expiresAt === null || typeof expiresAt === "string" ? { expiresAt } : {},
|
|
470
|
+
...typeof deviceName === "string" && deviceName ? { deviceName } : {}
|
|
471
|
+
};
|
|
472
|
+
} catch {
|
|
473
|
+
debugLogger2.debug(`Ignoring unreadable credential file for "${id}".`);
|
|
474
|
+
return void 0;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
__name(readCredential, "readCredential");
|
|
478
|
+
function writeCredential(id, { apiKey, expiresAt, deviceName }) {
|
|
479
|
+
const file = credentialPath(id);
|
|
480
|
+
if (!apiKey.trim()) {
|
|
481
|
+
throw new Error(`Refusing to save an empty API key for "${id}".`);
|
|
482
|
+
}
|
|
483
|
+
const dir = path.dirname(file);
|
|
484
|
+
fs.mkdirSync(dir, { recursive: true, mode: DIR_MODE });
|
|
485
|
+
chmodQuietly(dir, DIR_MODE);
|
|
486
|
+
const credential = {
|
|
487
|
+
apiKey,
|
|
488
|
+
savedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
489
|
+
...expiresAt !== void 0 ? { expiresAt } : {},
|
|
490
|
+
...deviceName ? { deviceName } : {}
|
|
491
|
+
};
|
|
492
|
+
const temp = path.join(
|
|
493
|
+
dir,
|
|
494
|
+
`.${id}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`
|
|
495
|
+
);
|
|
496
|
+
try {
|
|
497
|
+
fs.writeFileSync(temp, `${JSON.stringify(credential, null, 2)}
|
|
498
|
+
`, {
|
|
499
|
+
mode: FILE_MODE
|
|
500
|
+
});
|
|
501
|
+
chmodQuietly(temp, FILE_MODE);
|
|
502
|
+
fs.renameSync(temp, file);
|
|
503
|
+
} catch (error) {
|
|
504
|
+
fs.rmSync(temp, { force: true });
|
|
505
|
+
throw error;
|
|
506
|
+
}
|
|
507
|
+
return credential;
|
|
508
|
+
}
|
|
509
|
+
__name(writeCredential, "writeCredential");
|
|
510
|
+
function removeCredential(id) {
|
|
511
|
+
const file = credentialPath(id);
|
|
512
|
+
try {
|
|
513
|
+
fs.unlinkSync(file);
|
|
514
|
+
return true;
|
|
515
|
+
} catch (error) {
|
|
516
|
+
if (error.code === "ENOENT") return false;
|
|
517
|
+
throw error;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
__name(removeCredential, "removeCredential");
|
|
521
|
+
function readSavedApiKey(id) {
|
|
522
|
+
if (!id || !isValidCredentialId(id)) return void 0;
|
|
523
|
+
return readCredential(id)?.apiKey;
|
|
524
|
+
}
|
|
525
|
+
__name(readSavedApiKey, "readSavedApiKey");
|
|
526
|
+
var DENY_ENV_KEYS = /* @__PURE__ */ new Set([
|
|
527
|
+
"NODE_OPTIONS",
|
|
528
|
+
"NODE_PATH",
|
|
529
|
+
"LD_PRELOAD",
|
|
530
|
+
"LD_LIBRARY_PATH",
|
|
531
|
+
"DYLD_INSERT_LIBRARIES",
|
|
532
|
+
"DYLD_LIBRARY_PATH",
|
|
533
|
+
"PATH",
|
|
534
|
+
"HOME",
|
|
535
|
+
"USERPROFILE",
|
|
536
|
+
"TMPDIR",
|
|
537
|
+
"TMP",
|
|
538
|
+
"TEMP"
|
|
539
|
+
]);
|
|
540
|
+
var ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
541
|
+
var exported = /* @__PURE__ */ new Map();
|
|
542
|
+
function exportCredentialToEnv(envKey, apiKey) {
|
|
543
|
+
if (!ENV_NAME.test(envKey) || DENY_ENV_KEYS.has(envKey.toUpperCase())) {
|
|
544
|
+
return false;
|
|
545
|
+
}
|
|
546
|
+
const current = process.env[envKey];
|
|
547
|
+
const ours = exported.has(envKey) && exported.get(envKey) === current;
|
|
548
|
+
if (current !== void 0 && current !== "" && !ours) return false;
|
|
549
|
+
process.env[envKey] = apiKey;
|
|
550
|
+
exported.set(envKey, apiKey);
|
|
551
|
+
return true;
|
|
552
|
+
}
|
|
553
|
+
__name(exportCredentialToEnv, "exportCredentialToEnv");
|
|
554
|
+
function isExportedCredentialEnv(envKey) {
|
|
555
|
+
return exported.has(envKey) && exported.get(envKey) === process.env[envKey];
|
|
556
|
+
}
|
|
557
|
+
__name(isExportedCredentialEnv, "isExportedCredentialEnv");
|
|
558
|
+
function withdrawExportedCredential(envKey) {
|
|
559
|
+
if (isExportedCredentialEnv(envKey)) delete process.env[envKey];
|
|
560
|
+
exported.delete(envKey);
|
|
561
|
+
}
|
|
562
|
+
__name(withdrawExportedCredential, "withdrawExportedCredential");
|
|
563
|
+
function exportedCredentialEnvKeys() {
|
|
564
|
+
return [...exported.keys()].filter(isExportedCredentialEnv);
|
|
565
|
+
}
|
|
566
|
+
__name(exportedCredentialEnvKeys, "exportedCredentialEnvKeys");
|
|
567
|
+
function adoptExportedCredentialEnvKeys(keys) {
|
|
568
|
+
for (const key of keys) {
|
|
569
|
+
const value = process.env[key];
|
|
570
|
+
if (!ENV_NAME.test(key) || DENY_ENV_KEYS.has(key.toUpperCase())) continue;
|
|
571
|
+
if (value === void 0 || value === "") continue;
|
|
572
|
+
exported.set(key, value);
|
|
569
573
|
}
|
|
570
|
-
}
|
|
574
|
+
}
|
|
575
|
+
__name(adoptExportedCredentialEnvKeys, "adoptExportedCredentialEnvKeys");
|
|
571
576
|
|
|
572
|
-
// packages/core/src/providers/
|
|
573
|
-
|
|
574
|
-
|
|
577
|
+
// packages/core/src/providers/model-api-key.ts
|
|
578
|
+
function readStoredKey(model) {
|
|
579
|
+
const saved = readSavedApiKey(model.credential);
|
|
580
|
+
if (saved) return saved;
|
|
581
|
+
const provider = findProviderByCredentials(model.baseUrl, model.envKey);
|
|
582
|
+
return provider ? readSavedApiKey(credentialIdForProvider(provider.id)) : void 0;
|
|
583
|
+
}
|
|
584
|
+
__name(readStoredKey, "readStoredKey");
|
|
585
|
+
function resolveSavedModelApiKey(model) {
|
|
586
|
+
const saved = readStoredKey(model);
|
|
587
|
+
if (saved && model.envKey) exportCredentialToEnv(model.envKey, saved);
|
|
588
|
+
return saved;
|
|
589
|
+
}
|
|
590
|
+
__name(resolveSavedModelApiKey, "resolveSavedModelApiKey");
|
|
591
|
+
function resolveModelApiKey(model) {
|
|
592
|
+
const fromEnv = model.envKey ? process.env[model.envKey] : void 0;
|
|
593
|
+
return fromEnv || resolveSavedModelApiKey(model);
|
|
594
|
+
}
|
|
595
|
+
__name(resolveModelApiKey, "resolveModelApiKey");
|
|
596
|
+
function exportSavedCredentials(modelProviders) {
|
|
597
|
+
const names = [];
|
|
598
|
+
for (const models of Object.values(modelProviders ?? {})) {
|
|
599
|
+
if (!Array.isArray(models)) continue;
|
|
600
|
+
for (const model of models) {
|
|
601
|
+
if (!model || typeof model !== "object") continue;
|
|
602
|
+
const { envKey, credential, baseUrl } = model;
|
|
603
|
+
if (typeof envKey !== "string" || !envKey || process.env[envKey]) {
|
|
604
|
+
continue;
|
|
605
|
+
}
|
|
606
|
+
const saved = readStoredKey({
|
|
607
|
+
envKey,
|
|
608
|
+
credential: typeof credential === "string" ? credential : void 0,
|
|
609
|
+
baseUrl: typeof baseUrl === "string" ? baseUrl : void 0
|
|
610
|
+
});
|
|
611
|
+
if (saved && exportCredentialToEnv(envKey, saved)) names.push(envKey);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return names;
|
|
615
|
+
}
|
|
616
|
+
__name(exportSavedCredentials, "exportSavedCredentials");
|
|
575
617
|
|
|
576
618
|
// packages/core/src/models/modelsConfig.ts
|
|
577
|
-
init_esbuild_shims();
|
|
578
|
-
import process2 from "node:process";
|
|
579
619
|
var debugLogger3 = createDebugLogger("ModelsConfig");
|
|
580
620
|
var ModelsConfig = class _ModelsConfig {
|
|
581
621
|
static {
|
|
@@ -1509,6 +1549,54 @@ var fileCredentialStore = {
|
|
|
1509
1549
|
write: writeCredential,
|
|
1510
1550
|
remove: removeCredential
|
|
1511
1551
|
};
|
|
1552
|
+
var debugLogger4 = createDebugLogger("PROVIDER_INSTALL");
|
|
1553
|
+
function modelsOf(providers) {
|
|
1554
|
+
return Object.values(providers).flatMap(
|
|
1555
|
+
(models) => Array.isArray(models) ? models : []
|
|
1556
|
+
);
|
|
1557
|
+
}
|
|
1558
|
+
__name(modelsOf, "modelsOf");
|
|
1559
|
+
async function retireReplacedLogins(before, after, keptCredentialId, credentials, forgetO1Connect) {
|
|
1560
|
+
try {
|
|
1561
|
+
const { findProviderByCredentials: findProviderByCredentials2 } = await import("./all-providers-ZGNZ7JW6.js");
|
|
1562
|
+
const credentialIds = /* @__PURE__ */ __name((model) => {
|
|
1563
|
+
const preset = findProviderByCredentials2(model.baseUrl, model.envKey);
|
|
1564
|
+
return [
|
|
1565
|
+
...model.credential ? [model.credential] : [],
|
|
1566
|
+
...preset ? [credentialIdForProvider(preset.id)] : []
|
|
1567
|
+
];
|
|
1568
|
+
}, "credentialIds");
|
|
1569
|
+
const previous = modelsOf(before);
|
|
1570
|
+
const remaining = modelsOf(after);
|
|
1571
|
+
const usedIds = new Set(remaining.flatMap(credentialIds));
|
|
1572
|
+
if (keptCredentialId) usedIds.add(keptCredentialId);
|
|
1573
|
+
const usedEnvKeys = new Set(remaining.map((model) => model.envKey));
|
|
1574
|
+
for (const id of new Set(previous.flatMap(credentialIds))) {
|
|
1575
|
+
if (usedIds.has(id) || !isValidCredentialId(id)) continue;
|
|
1576
|
+
try {
|
|
1577
|
+
credentials.remove(id);
|
|
1578
|
+
} catch (error) {
|
|
1579
|
+
debugLogger4.warn(`Could not remove the replaced key "${id}": ${error}`);
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
for (const model of previous) {
|
|
1583
|
+
if (model.envKey && !usedEnvKeys.has(model.envKey)) {
|
|
1584
|
+
withdrawExportedCredential(model.envKey);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
if (previous.some((model) => model.connection === "o1-connect") && !remaining.some((model) => model.connection === "o1-connect")) {
|
|
1588
|
+
await forgetO1Connect();
|
|
1589
|
+
}
|
|
1590
|
+
} catch (error) {
|
|
1591
|
+
debugLogger4.warn(`Could not forget the replaced login: ${error}`);
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
__name(retireReplacedLogins, "retireReplacedLogins");
|
|
1595
|
+
async function forgetSavedO1Connect() {
|
|
1596
|
+
const { forgetO1Connect } = await import("./session-YZBL75AL.js");
|
|
1597
|
+
await forgetO1Connect();
|
|
1598
|
+
}
|
|
1599
|
+
__name(forgetSavedO1Connect, "forgetSavedO1Connect");
|
|
1512
1600
|
function isConversationModel(model) {
|
|
1513
1601
|
return !model.imageOnly && !model.voiceOnly && !model.realtimeOnly;
|
|
1514
1602
|
}
|
|
@@ -1570,7 +1658,8 @@ async function applyProviderInstallPlan(plan, options) {
|
|
|
1570
1658
|
reloadModelProviders,
|
|
1571
1659
|
syncAuthState,
|
|
1572
1660
|
refreshAuth,
|
|
1573
|
-
doRefreshAuth = true
|
|
1661
|
+
doRefreshAuth = true,
|
|
1662
|
+
forgetO1Connect = forgetSavedO1Connect
|
|
1574
1663
|
} = options;
|
|
1575
1664
|
const selectedAuthType = settings.getValue("security.auth.selectedType");
|
|
1576
1665
|
const mapping = settings.getValue("providerProtocol");
|
|
@@ -1753,7 +1842,7 @@ async function applyProviderInstallPlan(plan, options) {
|
|
|
1753
1842
|
);
|
|
1754
1843
|
if (!preserveSelection && installedModels.some(isConversationModel)) {
|
|
1755
1844
|
const keeps = /* @__PURE__ */ __name((model) => !isConversationModel(model) || installedModels.some(
|
|
1756
|
-
(installed) => isSameModelIdentity(model, installed)
|
|
1845
|
+
(installed) => isSameModelIdentity(model, installed) && model.connection === installed.connection
|
|
1757
1846
|
), "keeps");
|
|
1758
1847
|
const ownProviders = settings.getModelProvidersForWrite?.().modelProviders ?? settings.getModelProviders();
|
|
1759
1848
|
for (const [providerId, models] of Object.entries(ownProviders)) {
|
|
@@ -1885,6 +1974,15 @@ async function applyProviderInstallPlan(plan, options) {
|
|
|
1885
1974
|
}
|
|
1886
1975
|
currentStep = "cleanupBackup";
|
|
1887
1976
|
settings.cleanupBackup?.();
|
|
1977
|
+
if (!preserveSelection && installedModels.some(isConversationModel)) {
|
|
1978
|
+
await retireReplacedLogins(
|
|
1979
|
+
previousRuntimeProviders,
|
|
1980
|
+
updatedModelProviders,
|
|
1981
|
+
plan.credential?.id,
|
|
1982
|
+
credentials,
|
|
1983
|
+
forgetO1Connect
|
|
1984
|
+
);
|
|
1985
|
+
}
|
|
1888
1986
|
return { updatedModelProviders };
|
|
1889
1987
|
} catch (error) {
|
|
1890
1988
|
try {
|
|
@@ -2110,6 +2208,24 @@ function buildAdvancedGenerationConfig(advCfg, protocol) {
|
|
|
2110
2208
|
return hasAny ? cfg : void 0;
|
|
2111
2209
|
}
|
|
2112
2210
|
__name(buildAdvancedGenerationConfig, "buildAdvancedGenerationConfig");
|
|
2211
|
+
function withDiscoveredLimits(generationConfig, spec) {
|
|
2212
|
+
if (!spec?.contextWindowSize && !spec?.modalities && !spec?.maxOutputTokens) {
|
|
2213
|
+
return generationConfig;
|
|
2214
|
+
}
|
|
2215
|
+
const merged = {
|
|
2216
|
+
...generationConfig
|
|
2217
|
+
};
|
|
2218
|
+
if (spec.contextWindowSize) merged.contextWindowSize = spec.contextWindowSize;
|
|
2219
|
+
if (spec.modalities) merged.modalities = spec.modalities;
|
|
2220
|
+
if (spec.maxOutputTokens) {
|
|
2221
|
+
merged.samplingParams = {
|
|
2222
|
+
...merged.samplingParams,
|
|
2223
|
+
max_tokens: spec.maxOutputTokens
|
|
2224
|
+
};
|
|
2225
|
+
}
|
|
2226
|
+
return merged;
|
|
2227
|
+
}
|
|
2228
|
+
__name(withDiscoveredLimits, "withDiscoveredLimits");
|
|
2113
2229
|
function specToModelConfig(spec, prefix, baseUrl, envKey, credential, protocol) {
|
|
2114
2230
|
const genConfig = buildGenerationConfig(spec, protocol);
|
|
2115
2231
|
return {
|
|
@@ -2197,8 +2313,12 @@ function buildModelConfigs(config, inputs) {
|
|
|
2197
2313
|
(inputs.discoveredModels ?? []).map((spec) => [spec.id, spec])
|
|
2198
2314
|
);
|
|
2199
2315
|
models = inputs.modelIds.map((id) => {
|
|
2200
|
-
const
|
|
2201
|
-
const
|
|
2316
|
+
const spec = discovered.get(id);
|
|
2317
|
+
const genConfig = withDiscoveredLimits(
|
|
2318
|
+
buildAdvancedGenerationConfig(advCfg, protocol),
|
|
2319
|
+
spec
|
|
2320
|
+
);
|
|
2321
|
+
const capabilities = spec?.capabilities;
|
|
2202
2322
|
return {
|
|
2203
2323
|
id,
|
|
2204
2324
|
name: displayName(id),
|
|
@@ -2359,7 +2479,10 @@ function buildInstallPlan(config, inputs, existingModels = [], selection) {
|
|
|
2359
2479
|
...model.generationConfig?.extra_body
|
|
2360
2480
|
}
|
|
2361
2481
|
} : {},
|
|
2362
|
-
...preservedGeneration.contextWindowSize !== void 0 && inputs.advancedConfig?.contextWindowSize === void 0
|
|
2482
|
+
...preservedGeneration.contextWindowSize !== void 0 && inputs.advancedConfig?.contextWindowSize === void 0 && // A window the provider's list states now replaces the saved one.
|
|
2483
|
+
!inputs.discoveredModels?.some(
|
|
2484
|
+
(spec) => spec.id === model.id && spec.contextWindowSize
|
|
2485
|
+
) ? {
|
|
2363
2486
|
contextWindowSize: preservedGeneration.contextWindowSize
|
|
2364
2487
|
} : {},
|
|
2365
2488
|
...preservedGeneration.samplingParams || model.generationConfig?.samplingParams ? {
|
|
@@ -3540,6 +3663,10 @@ function isOrganizaOneBaseUrl(baseUrl) {
|
|
|
3540
3663
|
}
|
|
3541
3664
|
}
|
|
3542
3665
|
__name(isOrganizaOneBaseUrl, "isOrganizaOneBaseUrl");
|
|
3666
|
+
function reachesOrganizaOne(config) {
|
|
3667
|
+
return config.connection === "o1-connect" || isOrganizaOneBaseUrl(config.baseUrl);
|
|
3668
|
+
}
|
|
3669
|
+
__name(reachesOrganizaOne, "reachesOrganizaOne");
|
|
3543
3670
|
var ORGANIZAONE_CLIENT_HEADERS = {
|
|
3544
3671
|
"X-Title": BRAND.productName
|
|
3545
3672
|
};
|
|
@@ -3780,373 +3907,6 @@ function getAllProviderBaseUrls() {
|
|
|
3780
3907
|
}
|
|
3781
3908
|
__name(getAllProviderBaseUrls, "getAllProviderBaseUrls");
|
|
3782
3909
|
|
|
3783
|
-
// packages/core/src/providers/model-api-key.ts
|
|
3784
|
-
function readStoredKey(model) {
|
|
3785
|
-
const saved = readSavedApiKey(model.credential);
|
|
3786
|
-
if (saved) return saved;
|
|
3787
|
-
const provider = findProviderByCredentials(model.baseUrl, model.envKey);
|
|
3788
|
-
return provider ? readSavedApiKey(credentialIdForProvider(provider.id)) : void 0;
|
|
3789
|
-
}
|
|
3790
|
-
__name(readStoredKey, "readStoredKey");
|
|
3791
|
-
function resolveSavedModelApiKey(model) {
|
|
3792
|
-
const saved = readStoredKey(model);
|
|
3793
|
-
if (saved && model.envKey) exportCredentialToEnv(model.envKey, saved);
|
|
3794
|
-
return saved;
|
|
3795
|
-
}
|
|
3796
|
-
__name(resolveSavedModelApiKey, "resolveSavedModelApiKey");
|
|
3797
|
-
function resolveModelApiKey(model) {
|
|
3798
|
-
const fromEnv = model.envKey ? process.env[model.envKey] : void 0;
|
|
3799
|
-
return fromEnv || resolveSavedModelApiKey(model);
|
|
3800
|
-
}
|
|
3801
|
-
__name(resolveModelApiKey, "resolveModelApiKey");
|
|
3802
|
-
function exportSavedCredentials(modelProviders) {
|
|
3803
|
-
const names = [];
|
|
3804
|
-
for (const models of Object.values(modelProviders ?? {})) {
|
|
3805
|
-
if (!Array.isArray(models)) continue;
|
|
3806
|
-
for (const model of models) {
|
|
3807
|
-
if (!model || typeof model !== "object") continue;
|
|
3808
|
-
const { envKey, credential, baseUrl } = model;
|
|
3809
|
-
if (typeof envKey !== "string" || !envKey || process.env[envKey]) {
|
|
3810
|
-
continue;
|
|
3811
|
-
}
|
|
3812
|
-
const saved = readStoredKey({
|
|
3813
|
-
envKey,
|
|
3814
|
-
credential: typeof credential === "string" ? credential : void 0,
|
|
3815
|
-
baseUrl: typeof baseUrl === "string" ? baseUrl : void 0
|
|
3816
|
-
});
|
|
3817
|
-
if (saved && exportCredentialToEnv(envKey, saved)) names.push(envKey);
|
|
3818
|
-
}
|
|
3819
|
-
}
|
|
3820
|
-
return names;
|
|
3821
|
-
}
|
|
3822
|
-
__name(exportSavedCredentials, "exportSavedCredentials");
|
|
3823
|
-
|
|
3824
|
-
// packages/core/src/core/reasoning-overrides.ts
|
|
3825
|
-
init_esbuild_shims();
|
|
3826
|
-
|
|
3827
|
-
// packages/core/src/core/openaiContentGenerator/provider/openrouter.ts
|
|
3828
|
-
init_esbuild_shims();
|
|
3829
|
-
function isOpenRouterHostname(contentGeneratorConfig) {
|
|
3830
|
-
const baseUrl = contentGeneratorConfig.baseUrl ?? "";
|
|
3831
|
-
if (!baseUrl) return false;
|
|
3832
|
-
try {
|
|
3833
|
-
const hostname = new URL(baseUrl).hostname.toLowerCase();
|
|
3834
|
-
return hostname === "openrouter.ai" || hostname.endsWith(".openrouter.ai");
|
|
3835
|
-
} catch {
|
|
3836
|
-
return false;
|
|
3837
|
-
}
|
|
3838
|
-
}
|
|
3839
|
-
__name(isOpenRouterHostname, "isOpenRouterHostname");
|
|
3840
|
-
|
|
3841
|
-
// packages/core/src/core/anthropic-reasoning.ts
|
|
3842
|
-
init_esbuild_shims();
|
|
3843
|
-
var CLAUDE_MODEL_FAMILIES = [
|
|
3844
|
-
"opus",
|
|
3845
|
-
"sonnet",
|
|
3846
|
-
"haiku",
|
|
3847
|
-
"fable",
|
|
3848
|
-
"mythos"
|
|
3849
|
-
];
|
|
3850
|
-
function parseClaudeModelVersion(model) {
|
|
3851
|
-
const match = model.toLowerCase().match(
|
|
3852
|
-
new RegExp(
|
|
3853
|
-
`claude-(${CLAUDE_MODEL_FAMILIES.join(
|
|
3854
|
-
"|"
|
|
3855
|
-
)})-(\\d+)(?:[-.](\\d{1,2})(?!\\d))?`
|
|
3856
|
-
)
|
|
3857
|
-
);
|
|
3858
|
-
if (!match) {
|
|
3859
|
-
return null;
|
|
3860
|
-
}
|
|
3861
|
-
return {
|
|
3862
|
-
family: match[1],
|
|
3863
|
-
major: Number.parseInt(match[2], 10),
|
|
3864
|
-
minor: match[3] ? Number.parseInt(match[3], 10) : 0
|
|
3865
|
-
};
|
|
3866
|
-
}
|
|
3867
|
-
__name(parseClaudeModelVersion, "parseClaudeModelVersion");
|
|
3868
|
-
function anthropicSupportedEffortTiers(model) {
|
|
3869
|
-
const tiers = ["low", "medium", "high"];
|
|
3870
|
-
const parsed = parseClaudeModelVersion(model);
|
|
3871
|
-
if (!parsed) {
|
|
3872
|
-
return tiers;
|
|
3873
|
-
}
|
|
3874
|
-
const { family, major, minor } = parsed;
|
|
3875
|
-
const atLeast = /* @__PURE__ */ __name((maj, min) => major > maj || major === maj && minor >= min, "atLeast");
|
|
3876
|
-
if (major >= 5 || family === "opus" && atLeast(4, 7)) {
|
|
3877
|
-
tiers.push("xhigh");
|
|
3878
|
-
}
|
|
3879
|
-
if (major >= 5 || (family === "opus" || family === "sonnet") && atLeast(4, 6)) {
|
|
3880
|
-
tiers.push("max");
|
|
3881
|
-
}
|
|
3882
|
-
return tiers;
|
|
3883
|
-
}
|
|
3884
|
-
__name(anthropicSupportedEffortTiers, "anthropicSupportedEffortTiers");
|
|
3885
|
-
|
|
3886
|
-
// packages/core/src/core/reasoning-overrides.ts
|
|
3887
|
-
var REASONING_PROFILES = [
|
|
3888
|
-
"openai-effort",
|
|
3889
|
-
"openai-reasoning",
|
|
3890
|
-
"deepseek-openai",
|
|
3891
|
-
"dashscope-effort",
|
|
3892
|
-
"dashscope-thinking",
|
|
3893
|
-
"chat-template-thinking",
|
|
3894
|
-
"anthropic-manual",
|
|
3895
|
-
"anthropic-adaptive",
|
|
3896
|
-
"deepseek-anthropic",
|
|
3897
|
-
"gemini"
|
|
3898
|
-
];
|
|
3899
|
-
function invalidReasoning(route) {
|
|
3900
|
-
throw new Error(
|
|
3901
|
-
`Model "${route.model}" capabilities.reasoning: invalid profile, efforts or defaultEffort`
|
|
3902
|
-
);
|
|
3903
|
-
}
|
|
3904
|
-
__name(invalidReasoning, "invalidReasoning");
|
|
3905
|
-
function validateReasoningDeclaration(route, declaration) {
|
|
3906
|
-
if (declaration === void 0) return void 0;
|
|
3907
|
-
if (!declaration || typeof declaration !== "object" || Array.isArray(declaration))
|
|
3908
|
-
return invalidReasoning(route);
|
|
3909
|
-
const input = declaration;
|
|
3910
|
-
if (input.profile === void 0 && ("thinking" in input || "disableField" in input))
|
|
3911
|
-
return parseModelReasoningCapabilities(input);
|
|
3912
|
-
if (!Object.keys(input).length || Object.keys(input).some(
|
|
3913
|
-
(key) => ![
|
|
3914
|
-
"profile",
|
|
3915
|
-
"efforts",
|
|
3916
|
-
"defaultEffort",
|
|
3917
|
-
"thinking",
|
|
3918
|
-
"toggleOnly",
|
|
3919
|
-
"canDisable",
|
|
3920
|
-
"disableField"
|
|
3921
|
-
].includes(key)
|
|
3922
|
-
))
|
|
3923
|
-
return invalidReasoning(route);
|
|
3924
|
-
if (input.profile !== void 0 && !REASONING_PROFILES.includes(input.profile) || input.thinking !== void 0 && input.thinking !== true || input.toggleOnly !== void 0 && typeof input.toggleOnly !== "boolean" || input.canDisable !== void 0 && input.canDisable !== false)
|
|
3925
|
-
return invalidReasoning(route);
|
|
3926
|
-
if (input.efforts !== void 0 && (!Array.isArray(input.efforts) || !input.efforts.length || input.efforts.some((tier) => !REASONING_EFFORT_TIERS.includes(tier)) || new Set(input.efforts).size !== input.efforts.length))
|
|
3927
|
-
return invalidReasoning(route);
|
|
3928
|
-
if (input.defaultEffort !== void 0 && (!REASONING_EFFORT_TIERS.includes(input.defaultEffort) || input.efforts && !input.efforts.includes(input.defaultEffort)))
|
|
3929
|
-
return invalidReasoning(route);
|
|
3930
|
-
return input;
|
|
3931
|
-
}
|
|
3932
|
-
__name(validateReasoningDeclaration, "validateReasoningDeclaration");
|
|
3933
|
-
function resolveReasoningCapabilities(route, declaration) {
|
|
3934
|
-
try {
|
|
3935
|
-
return validateReasoningCapabilities(route, declaration);
|
|
3936
|
-
} catch {
|
|
3937
|
-
return void 0;
|
|
3938
|
-
}
|
|
3939
|
-
}
|
|
3940
|
-
__name(resolveReasoningCapabilities, "resolveReasoningCapabilities");
|
|
3941
|
-
function validateReasoningCapabilities(route, declaration) {
|
|
3942
|
-
const input = validateReasoningDeclaration(route, declaration);
|
|
3943
|
-
if (!input) return void 0;
|
|
3944
|
-
if (input.profile === void 0 && "thinking" in input)
|
|
3945
|
-
return parseModelReasoningCapabilities(input);
|
|
3946
|
-
const model = normalize(route.model);
|
|
3947
|
-
const provider = ALL_PROVIDERS.find(
|
|
3948
|
-
(candidate) => typeof candidate.baseUrl === "string" ? candidate.baseUrl === route.baseUrl : candidate.baseUrl?.some((option) => option.url === route.baseUrl)
|
|
3949
|
-
);
|
|
3950
|
-
const known = (provider?.models?.find((candidate) => candidate.id === route.model) ?? provider?.models?.find((candidate) => candidate.id === model))?.capabilities?.reasoning;
|
|
3951
|
-
const inherited = parseModelReasoningCapabilities(known);
|
|
3952
|
-
if (!input.profile && inherited?.toggleOnly) {
|
|
3953
|
-
if (input.efforts || input.defaultEffort) return invalidReasoning(route);
|
|
3954
|
-
return parseModelReasoningCapabilities({ ...inherited, ...input });
|
|
3955
|
-
}
|
|
3956
|
-
const gpt = getGptReasoningCapabilities(route.model);
|
|
3957
|
-
const claude = route.authType === "anthropic" ? parseClaudeModelVersion(route.model) : void 0;
|
|
3958
|
-
if (!inherited && !gpt && !claude && !input.profile)
|
|
3959
|
-
return invalidReasoning(route);
|
|
3960
|
-
const auth = route.authType;
|
|
3961
|
-
let host = "";
|
|
3962
|
-
try {
|
|
3963
|
-
host = new URL(route.baseUrl ?? "").hostname.toLowerCase();
|
|
3964
|
-
} catch {
|
|
3965
|
-
host = "";
|
|
3966
|
-
}
|
|
3967
|
-
const dashscope = /(^|\.)(dashscope(?:-intl|-us)?\.aliyuncs\.com|alicloudapi\.com)$/.test(
|
|
3968
|
-
host
|
|
3969
|
-
) || /^token-plan\..+\.maas\.aliyuncs\.com$/.test(host);
|
|
3970
|
-
const profile = input.profile ?? (auth === "gemini" || auth === "vertex-ai" ? "gemini" : auth === "openai-responses" ? "openai-reasoning" : auth === "openai" && isOpenRouterHostname(route) ? "openai-reasoning" : auth === "anthropic" ? model.includes("deepseek") ? "deepseek-anthropic" : claude && (claude.major > 4 || claude.major === 4 && claude.minor >= 6) ? "anthropic-adaptive" : "anthropic-manual" : model.startsWith("qwen") ? dashscope ? inherited?.disableField === "reasoning_effort" ? "dashscope-effort" : "dashscope-thinking" : "chat-template-thinking" : inherited?.disableField === "thinking" ? "deepseek-openai" : "openai-effort");
|
|
3971
|
-
const protocol = profile === "gemini" ? "gemini" : profile.startsWith("anthropic-") || profile === "deepseek-anthropic" ? "anthropic" : "openai";
|
|
3972
|
-
if (auth === "openai-responses" && profile !== "openai-reasoning" || auth && protocol !== (auth === "vertex-ai" ? "gemini" : auth === "openai-responses" ? "openai" : auth))
|
|
3973
|
-
return invalidReasoning(route);
|
|
3974
|
-
const toggleOnly = profile === "dashscope-thinking" || profile === "chat-template-thinking";
|
|
3975
|
-
const disableField = !input.profile && inherited?.disableField || (toggleOnly ? "enable_thinking" : profile === "openai-effort" || profile === "dashscope-effort" ? "reasoning_effort" : "thinking");
|
|
3976
|
-
const inheritedEfforts = inherited && !inherited.toggleOnly ? inherited.efforts : gpt?.efforts ?? (claude ? anthropicSupportedEffortTiers(route.model) : void 0);
|
|
3977
|
-
const efforts = input.efforts ?? inheritedEfforts;
|
|
3978
|
-
const inheritedDefault = inherited && !inherited.toggleOnly ? inherited.defaultEffort : gpt?.defaultEffort;
|
|
3979
|
-
const defaultEffort = input.defaultEffort ?? (inheritedDefault && efforts ? clampReasoningEffort(inheritedDefault, efforts) : void 0);
|
|
3980
|
-
if (toggleOnly && (input.efforts !== void 0 || input.defaultEffort !== void 0) || !toggleOnly && (!efforts || !defaultEffort) || profile === "gemini" && efforts?.some((tier) => tier === "xhigh" || tier === "max"))
|
|
3981
|
-
return invalidReasoning(route);
|
|
3982
|
-
const result = {
|
|
3983
|
-
...input,
|
|
3984
|
-
thinking: true,
|
|
3985
|
-
profile,
|
|
3986
|
-
toggleOnly,
|
|
3987
|
-
disableField,
|
|
3988
|
-
...toggleOnly ? {} : { efforts, defaultEffort },
|
|
3989
|
-
...route.thinkingMandatory || inherited?.canDisable === false || gpt?.thinkingMandatory ? { canDisable: false } : {}
|
|
3990
|
-
};
|
|
3991
|
-
const parsed = parseModelReasoningCapabilities(result);
|
|
3992
|
-
if (!parsed) return invalidReasoning(route);
|
|
3993
|
-
return {
|
|
3994
|
-
...parsed,
|
|
3995
|
-
profile,
|
|
3996
|
-
...gpt && input.defaultEffort === void 0 ? { defaultEnabled: gpt.defaultEnabled } : {}
|
|
3997
|
-
};
|
|
3998
|
-
}
|
|
3999
|
-
__name(validateReasoningCapabilities, "validateReasoningCapabilities");
|
|
4000
|
-
function captureReasoningSnapshot(models) {
|
|
4001
|
-
return Object.freeze(
|
|
4002
|
-
models.map(
|
|
4003
|
-
(model) => Object.freeze({
|
|
4004
|
-
id: model.id,
|
|
4005
|
-
authType: model.authType,
|
|
4006
|
-
baseUrl: model.baseUrl,
|
|
4007
|
-
registryBaseUrl: model.registryBaseUrl,
|
|
4008
|
-
reasoning: model.capabilities?.reasoning && typeof model.capabilities.reasoning === "object" ? Object.freeze({
|
|
4009
|
-
...structuredClone(model.capabilities.reasoning),
|
|
4010
|
-
..."efforts" in model.capabilities.reasoning && Array.isArray(model.capabilities.reasoning.efforts) ? {
|
|
4011
|
-
efforts: Object.freeze([
|
|
4012
|
-
...model.capabilities.reasoning.efforts
|
|
4013
|
-
])
|
|
4014
|
-
} : {}
|
|
4015
|
-
}) : model.capabilities?.reasoning
|
|
4016
|
-
})
|
|
4017
|
-
)
|
|
4018
|
-
);
|
|
4019
|
-
}
|
|
4020
|
-
__name(captureReasoningSnapshot, "captureReasoningSnapshot");
|
|
4021
|
-
function resolveReasoningForModel(config, generation, model = generation.model, strict = false) {
|
|
4022
|
-
let declaration;
|
|
4023
|
-
if (generation.reasoningSnapshot) {
|
|
4024
|
-
const rows = generation.reasoningSnapshot.filter(
|
|
4025
|
-
(row2) => row2.authType === generation.authType && row2.id === model
|
|
4026
|
-
);
|
|
4027
|
-
const row = generation.reasoningRouteBaseUrl === null && model === generation.model ? rows.find((row2) => row2.registryBaseUrl === void 0) : typeof generation.reasoningRouteBaseUrl === "string" && model === generation.model ? rows.find(
|
|
4028
|
-
(row2) => row2.registryBaseUrl === generation.reasoningRouteBaseUrl
|
|
4029
|
-
) : rows.find((row2) => row2.registryBaseUrl === generation.baseUrl) ?? rows.find(
|
|
4030
|
-
(row2) => row2.registryBaseUrl === void 0 && row2.baseUrl === generation.baseUrl
|
|
4031
|
-
);
|
|
4032
|
-
declaration = row?.reasoning;
|
|
4033
|
-
} else {
|
|
4034
|
-
declaration = generation.authType ? config?.getResolvedModelConfig?.(
|
|
4035
|
-
generation.authType,
|
|
4036
|
-
model,
|
|
4037
|
-
generation.baseUrl
|
|
4038
|
-
)?.capabilities?.reasoning : void 0;
|
|
4039
|
-
}
|
|
4040
|
-
return (strict ? validateReasoningCapabilities : resolveReasoningCapabilities)(
|
|
4041
|
-
{
|
|
4042
|
-
...generation,
|
|
4043
|
-
model,
|
|
4044
|
-
thinkingMandatory: model === generation.model ? generation.thinkingMandatory : void 0
|
|
4045
|
-
},
|
|
4046
|
-
declaration
|
|
4047
|
-
);
|
|
4048
|
-
}
|
|
4049
|
-
__name(resolveReasoningForModel, "resolveReasoningForModel");
|
|
4050
|
-
function getEffectiveReasoning(generation, resolved) {
|
|
4051
|
-
if (!resolved) return generation.reasoning;
|
|
4052
|
-
if (generation.reasoning === false && resolved.canDisable !== false)
|
|
4053
|
-
return false;
|
|
4054
|
-
const selected = generation.reasoning || void 0;
|
|
4055
|
-
if (!selected && resolved.defaultEnabled === false && resolved.canDisable !== false)
|
|
4056
|
-
return false;
|
|
4057
|
-
if (resolved.toggleOnly)
|
|
4058
|
-
return selected ?? (resolved.profile ? {} : void 0);
|
|
4059
|
-
const effort = selected?.effort ?? resolved.defaultEffort;
|
|
4060
|
-
return effort ? {
|
|
4061
|
-
...selected,
|
|
4062
|
-
effort: resolved.profile && REASONING_EFFORT_TIERS.includes(effort) ? clampReasoningEffort(effort, resolved.efforts) : effort
|
|
4063
|
-
} : selected;
|
|
4064
|
-
}
|
|
4065
|
-
__name(getEffectiveReasoning, "getEffectiveReasoning");
|
|
4066
|
-
|
|
4067
|
-
// packages/core/src/core/outbound-dynamic-headers.ts
|
|
4068
|
-
init_esbuild_shims();
|
|
4069
|
-
var debugLogger4 = createDebugLogger("OUTBOUND_CORRELATION");
|
|
4070
|
-
var PLACEHOLDERS = [{ token: "${session_id}", resolve: /* @__PURE__ */ __name((config) => config.getSessionId(), "resolve") }];
|
|
4071
|
-
var SESSION_ID_PLACEHOLDER_PATTERN = /\$(?:session_id|O1CODE_SESSION_ID)(?!\w)|\$\{(?:session_id|O1CODE_SESSION_ID)\}/gi;
|
|
4072
|
-
var warnedGateOff = /* @__PURE__ */ new Set();
|
|
4073
|
-
function warnIfDynamicHeadersDisabled(customHeaders, config) {
|
|
4074
|
-
try {
|
|
4075
|
-
const names = Object.entries(customHeaders ?? {}).filter(
|
|
4076
|
-
([, value]) => typeof value === "string" && hasDynamicPlaceholder(value)
|
|
4077
|
-
).map(([name]) => name);
|
|
4078
|
-
if (names.length === 0) return;
|
|
4079
|
-
if (config.getOutboundAllowDynamicHeaderValues()) return;
|
|
4080
|
-
const key = names.slice().sort().join(",");
|
|
4081
|
-
if (warnedGateOff.has(key)) return;
|
|
4082
|
-
warnedGateOff.add(key);
|
|
4083
|
-
console.warn(
|
|
4084
|
-
`customHeaders ${names.join(", ")} contain a runtime placeholder, but outboundCorrelation.allowDynamicHeaderValues is not enabled \u2014 the header(s) will not be sent. Set it to true in settings.json to allow the value to be filled in per request.`
|
|
4085
|
-
);
|
|
4086
|
-
} catch {
|
|
4087
|
-
}
|
|
4088
|
-
}
|
|
4089
|
-
__name(warnIfDynamicHeadersDisabled, "warnIfDynamicHeadersDisabled");
|
|
4090
|
-
function hasDynamicPlaceholder(value) {
|
|
4091
|
-
return value.search(SESSION_ID_PLACEHOLDER_PATTERN) !== -1;
|
|
4092
|
-
}
|
|
4093
|
-
__name(hasDynamicPlaceholder, "hasDynamicPlaceholder");
|
|
4094
|
-
function resolveDynamicHeaderValue(value, config) {
|
|
4095
|
-
if (typeof value !== "string") return void 0;
|
|
4096
|
-
if (!hasDynamicPlaceholder(value)) return value;
|
|
4097
|
-
try {
|
|
4098
|
-
if (!config.getOutboundAllowDynamicHeaderValues()) {
|
|
4099
|
-
debugLogger4.warn(
|
|
4100
|
-
`Dropping a customHeaders value containing a runtime placeholder: outboundCorrelation.allowDynamicHeaderValues is not enabled.`
|
|
4101
|
-
);
|
|
4102
|
-
return void 0;
|
|
4103
|
-
}
|
|
4104
|
-
let expanded = value.replace(
|
|
4105
|
-
SESSION_ID_PLACEHOLDER_PATTERN,
|
|
4106
|
-
"${session_id}"
|
|
4107
|
-
);
|
|
4108
|
-
for (const { token, resolve } of PLACEHOLDERS) {
|
|
4109
|
-
if (!expanded.includes(token)) continue;
|
|
4110
|
-
const resolved = resolve(config);
|
|
4111
|
-
if (!resolved) return void 0;
|
|
4112
|
-
expanded = expanded.split(token).join(resolved);
|
|
4113
|
-
}
|
|
4114
|
-
return expanded;
|
|
4115
|
-
} catch (error) {
|
|
4116
|
-
debugLogger4.warn(
|
|
4117
|
-
`Unable to expand a customHeaders placeholder: ${error instanceof Error ? error.message : String(error)}`
|
|
4118
|
-
);
|
|
4119
|
-
return void 0;
|
|
4120
|
-
}
|
|
4121
|
-
}
|
|
4122
|
-
__name(resolveDynamicHeaderValue, "resolveDynamicHeaderValue");
|
|
4123
|
-
function applyDynamicHeaderValues(headers, config) {
|
|
4124
|
-
const pending = [];
|
|
4125
|
-
headers.forEach((value, key) => {
|
|
4126
|
-
if (hasDynamicPlaceholder(value)) pending.push([key, value]);
|
|
4127
|
-
});
|
|
4128
|
-
for (const [key, value] of pending) {
|
|
4129
|
-
const resolved = resolveDynamicHeaderValue(value, config);
|
|
4130
|
-
if (resolved === void 0) {
|
|
4131
|
-
headers.delete(key);
|
|
4132
|
-
} else {
|
|
4133
|
-
headers.set(key, resolved);
|
|
4134
|
-
}
|
|
4135
|
-
}
|
|
4136
|
-
}
|
|
4137
|
-
__name(applyDynamicHeaderValues, "applyDynamicHeaderValues");
|
|
4138
|
-
function expandDynamicHeaders(customHeaders, config) {
|
|
4139
|
-
if (!customHeaders) return {};
|
|
4140
|
-
const expanded = {};
|
|
4141
|
-
for (const [key, value] of Object.entries(customHeaders)) {
|
|
4142
|
-
if (typeof value !== "string" || !hasDynamicPlaceholder(value)) continue;
|
|
4143
|
-
const resolved = resolveDynamicHeaderValue(value, config);
|
|
4144
|
-
if (resolved !== void 0) expanded[key] = resolved;
|
|
4145
|
-
}
|
|
4146
|
-
return expanded;
|
|
4147
|
-
}
|
|
4148
|
-
__name(expandDynamicHeaders, "expandDynamicHeaders");
|
|
4149
|
-
|
|
4150
3910
|
export {
|
|
4151
3911
|
DISABLED_REQUEST_TIMEOUT_MS,
|
|
4152
3912
|
resolveRequestTimeout,
|
|
@@ -4159,7 +3919,6 @@ export {
|
|
|
4159
3919
|
DEFAULT_DASHSCOPE_BASE_URL,
|
|
4160
3920
|
DASHSCOPE_PROXY_BASE_URL,
|
|
4161
3921
|
normalizeOpenAiWireBaseUrl,
|
|
4162
|
-
isOpenRouterHostname,
|
|
4163
3922
|
isImageGenerationCapable,
|
|
4164
3923
|
RUNTIME_SNAPSHOT_PREFIX,
|
|
4165
3924
|
buildRuntimeSnapshotId,
|
|
@@ -4178,8 +3937,12 @@ export {
|
|
|
4178
3937
|
ModelsConfig,
|
|
4179
3938
|
ProviderInstallError,
|
|
4180
3939
|
applyProviderInstallPlan,
|
|
3940
|
+
CUSTOM_API_KEY_ENV_PREFIX,
|
|
3941
|
+
generateCustomEnvKey,
|
|
3942
|
+
generateCustomCredentialId,
|
|
4181
3943
|
customProvider,
|
|
4182
3944
|
LOCAL_API_KEY_PLACEHOLDER,
|
|
3945
|
+
localOpenAiProvider,
|
|
4183
3946
|
resolveOwnsModel,
|
|
4184
3947
|
resolveMetadataKey,
|
|
4185
3948
|
PROVIDER_METADATA_NS,
|
|
@@ -4194,37 +3957,47 @@ export {
|
|
|
4194
3957
|
shouldShowStep,
|
|
4195
3958
|
providerMatchesCredentials,
|
|
4196
3959
|
buildProviderTemplate,
|
|
3960
|
+
codingPlanProvider,
|
|
3961
|
+
tokenPlanProvider,
|
|
3962
|
+
alibabaStandardProvider,
|
|
3963
|
+
anthropicProvider,
|
|
3964
|
+
deepseekProvider,
|
|
3965
|
+
geminiProvider,
|
|
3966
|
+
grokProvider,
|
|
3967
|
+
minimaxProvider,
|
|
3968
|
+
zaiProvider,
|
|
3969
|
+
moonshotProvider,
|
|
3970
|
+
modelscopeProvider,
|
|
3971
|
+
openaiProvider,
|
|
4197
3972
|
BRAND,
|
|
4198
3973
|
ORGANIZAONE_ANTHROPIC_BASE_URL,
|
|
4199
3974
|
ORGANIZAONE_ENV_KEY,
|
|
4200
3975
|
isOrganizaOneBaseUrl,
|
|
3976
|
+
reachesOrganizaOne,
|
|
4201
3977
|
ORGANIZAONE_CLIENT_HEADERS,
|
|
4202
3978
|
organizaoneProvider,
|
|
4203
3979
|
organizaoneLoginProvider,
|
|
3980
|
+
organizaoneO1gwProvider,
|
|
4204
3981
|
probeLocalServers,
|
|
3982
|
+
ollamaProvider,
|
|
3983
|
+
lmstudioProvider,
|
|
4205
3984
|
ALL_PROVIDERS,
|
|
4206
3985
|
PROVIDERS_BY_GROUP,
|
|
4207
3986
|
getMenuRows,
|
|
4208
3987
|
findProviderById,
|
|
4209
3988
|
findProviderByCredentials,
|
|
4210
3989
|
getAllProviderBaseUrls,
|
|
4211
|
-
parseClaudeModelVersion,
|
|
4212
|
-
anthropicSupportedEffortTiers,
|
|
4213
|
-
resolveReasoningCapabilities,
|
|
4214
|
-
validateReasoningCapabilities,
|
|
4215
|
-
captureReasoningSnapshot,
|
|
4216
|
-
resolveReasoningForModel,
|
|
4217
|
-
getEffectiveReasoning,
|
|
4218
|
-
warnIfDynamicHeadersDisabled,
|
|
4219
|
-
hasDynamicPlaceholder,
|
|
4220
|
-
applyDynamicHeaderValues,
|
|
4221
|
-
expandDynamicHeaders,
|
|
4222
3990
|
resolveProviderProtocol,
|
|
4223
3991
|
resolveModelProtocol,
|
|
4224
3992
|
tryResolveModelProtocol,
|
|
4225
3993
|
validateModelProvidersConfig,
|
|
4226
3994
|
resolveModelSelectionAuthType
|
|
4227
3995
|
};
|
|
3996
|
+
/**
|
|
3997
|
+
* @license
|
|
3998
|
+
* Copyright 2025 Qwen Team
|
|
3999
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4000
|
+
*/
|
|
4228
4001
|
/**
|
|
4229
4002
|
* @license
|
|
4230
4003
|
* Copyright 2026 Qwen Team
|
|
@@ -4249,8 +4022,14 @@ export {
|
|
|
4249
4022
|
*/
|
|
4250
4023
|
/**
|
|
4251
4024
|
* @license
|
|
4252
|
-
* Copyright
|
|
4025
|
+
* Copyright 2026 o1-code contributors
|
|
4253
4026
|
* SPDX-License-Identifier: Apache-2.0
|
|
4027
|
+
*
|
|
4028
|
+
* The API key of a `modelProviders` entry: `process.env[envKey]` first, then
|
|
4029
|
+
* the saved credential the entry names, then the credential saved under the
|
|
4030
|
+
* id of the preset the entry belongs to (matched by base URL and env key).
|
|
4031
|
+
* A key read from the store is exported into `process.env[envKey]` for this
|
|
4032
|
+
* process when the variable is unset, so `${VAR}` placeholders keep resolving.
|
|
4254
4033
|
*/
|
|
4255
4034
|
/**
|
|
4256
4035
|
* @license
|
|
@@ -4276,14 +4055,3 @@ export {
|
|
|
4276
4055
|
* Provider registry — imports all provider definitions and assembles the
|
|
4277
4056
|
* lookup tables used by the UI and CLI commands.
|
|
4278
4057
|
*/
|
|
4279
|
-
/**
|
|
4280
|
-
* @license
|
|
4281
|
-
* Copyright 2026 o1-code contributors
|
|
4282
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4283
|
-
*
|
|
4284
|
-
* The API key of a `modelProviders` entry: `process.env[envKey]` first, then
|
|
4285
|
-
* the saved credential the entry names, then the credential saved under the
|
|
4286
|
-
* id of the preset the entry belongs to (matched by base URL and env key).
|
|
4287
|
-
* A key read from the store is exported into `process.env[envKey]` for this
|
|
4288
|
-
* process when the variable is unset, so `${VAR}` placeholders keep resolving.
|
|
4289
|
-
*/
|