@organizaone/o1-code 0.26.0 → 0.28.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/qc-helper/docs/configuration/auth.md +13 -1
- package/bundled/qc-helper/docs/configuration/settings.md +3 -2
- package/bundled/qc-helper/docs/features/auto-mode.md +10 -0
- package/bundled/qc-helper/docs/features/commands.md +2 -0
- package/chunks/{MaxSizedBox-BT4NRHBZ.js → MaxSizedBox-UGM4WNJZ.js} +25 -25
- package/chunks/{StandaloneSessionPicker-AB5L4OIP.js → StandaloneSessionPicker-LNBEBZCV.js} +41 -41
- package/chunks/{acp-subagent-executor-J6YQDFIY.js → acp-subagent-executor-6SLQGZBW.js} +28 -28
- package/chunks/{acpAgent-UNNKQA2R.js → acpAgent-AZRWMHQS.js} +138 -80
- package/chunks/{agent-4JVSTPOZ.js → agent-SW6B5GXR.js} +13 -13
- package/chunks/{agent-headless-SQ3YMNWD.js → agent-headless-4T56G4HD.js} +13 -13
- package/chunks/{all-providers-A35HOOOY.js → all-providers-7XOONDDH.js} +2 -2
- package/chunks/{anthropicContentGenerator-X6IMIHOI.js → anthropicContentGenerator-PCGLXAN2.js} +4 -4
- package/chunks/{artifact-tool-6QDGNGTO.js → artifact-tool-2YUI7TMU.js} +2 -1
- package/chunks/{askUserQuestion-YPA2ZZLO.js → askUserQuestion-CJCXE4MK.js} +1 -1
- package/chunks/{bridge-RP3BQEM7.js → bridge-MMSBIFUO.js} +28 -28
- package/chunks/{chunk-LU2TTE5Y.js → chunk-2RXC7SUB.js} +3 -3
- package/chunks/{chunk-SU4W42KU.js → chunk-34DGARAI.js} +2 -2
- package/chunks/{chunk-KRE356Z5.js → chunk-4RJLQH7V.js} +2 -2
- package/chunks/{chunk-UA6BRUXW.js → chunk-4S3RAGV6.js} +2 -2
- package/chunks/{chunk-USSMX7ZA.js → chunk-5BFVYOZU.js} +7 -7
- package/chunks/{chunk-M5BPWICM.js → chunk-5GPXFBUV.js} +933 -445
- package/chunks/{chunk-O6GD6SFV.js → chunk-5ONKDCZM.js} +4 -0
- package/chunks/{chunk-UDUKUEW5.js → chunk-5T7HH4QY.js} +4 -4
- package/chunks/{chunk-A2MUOMJH.js → chunk-65WJP4PQ.js} +2 -2
- package/chunks/{chunk-GOPTB5FL.js → chunk-6OYKQCEN.js} +5 -5
- package/chunks/{chunk-MEPWN6XC.js → chunk-6P2HD4R3.js} +1 -1
- package/chunks/{chunk-3UZT6L3M.js → chunk-6RBLQ2FL.js} +3 -3
- package/chunks/{chunk-T4X6ZODK.js → chunk-7OTIZIFD.js} +2 -2
- package/chunks/{chunk-B6U27UHQ.js → chunk-A2IU6TBE.js} +3 -3
- package/chunks/{chunk-UW4ZP77X.js → chunk-AEVV2DGL.js} +8 -3
- package/chunks/{chunk-DFRZXARB.js → chunk-ALTTOY55.js} +2 -2
- package/chunks/{chunk-HNHCMHHY.js → chunk-APDBWTCU.js} +3 -3
- package/chunks/{chunk-SF7RCEDN.js → chunk-AXXXWTIX.js} +1 -1
- package/chunks/{chunk-FGV2OPGK.js → chunk-CFDP4DA7.js} +1 -1
- package/chunks/{chunk-SQZJGTAP.js → chunk-CGQA3YUE.js} +15 -15
- package/chunks/{chunk-B7QLJKM6.js → chunk-CPGFB67A.js} +8 -5
- package/chunks/{chunk-ZME3GEAN.js → chunk-DN5T6AO6.js} +12 -3
- package/chunks/{chunk-AOJFG2LZ.js → chunk-DOYXO67V.js} +10 -10
- package/chunks/{chunk-WIQEF7ON.js → chunk-DV2KGLEW.js} +1 -1
- package/chunks/{chunk-6VXX63QU.js → chunk-DVF2XU6V.js} +3 -3
- package/chunks/{chunk-Y24XITI5.js → chunk-E7IFCC56.js} +24 -11
- package/chunks/{chunk-6TAZUYYH.js → chunk-ECVYOBZB.js} +1 -1
- package/chunks/{chunk-QIGHINXO.js → chunk-ESGMIMHJ.js} +1 -1
- package/chunks/{chunk-3GZRVIU2.js → chunk-G4WEER2E.js} +2 -2
- package/chunks/{chunk-ZQ7TCAOB.js → chunk-GGY4LV75.js} +6 -6
- package/chunks/{chunk-3NWXBIE2.js → chunk-GTEXKLUX.js} +1 -1
- package/chunks/{chunk-5UTAX2O6.js → chunk-HFVFJKSG.js} +3 -3
- package/chunks/{chunk-NUUQWXXC.js → chunk-HHXRZCTN.js} +1 -1
- package/chunks/{chunk-FVH27ARU.js → chunk-IKTZAG3N.js} +8 -8
- package/chunks/{chunk-MSBLDE7B.js → chunk-INL5DBBY.js} +6 -6
- package/chunks/{chunk-BBBU4UJL.js → chunk-IX3QKVUR.js} +1 -1
- package/chunks/{chunk-U7EB32Z2.js → chunk-J6C5LOZU.js} +2 -2
- package/chunks/{chunk-HKWXDV5S.js → chunk-JNDU22G5.js} +1 -1
- package/chunks/{chunk-INUPQ3V2.js → chunk-KBQIWWPG.js} +3 -3
- package/chunks/{chunk-3GPZEENL.js → chunk-KE2WGNUQ.js} +3 -3
- package/chunks/{chunk-CQPBRNKG.js → chunk-KFN7QGTC.js} +1 -1
- package/chunks/{chunk-OWWR2OAO.js → chunk-L7HW4A3Y.js} +1 -1
- package/chunks/{chunk-2B5MRPGZ.js → chunk-LFNFDXBQ.js} +9 -9
- package/chunks/{chunk-B5DA6HBM.js → chunk-LMZTL6BD.js} +1 -1
- package/chunks/{chunk-A3XVGA3W.js → chunk-LPAIZXYK.js} +1 -1
- package/chunks/{chunk-GR257V6A.js → chunk-LTDEWYQR.js} +1 -1
- package/chunks/{chunk-3H6ZRETK.js → chunk-LXGCQKEU.js} +2 -2
- package/chunks/{chunk-LDKVV42E.js → chunk-M57Y7TXE.js} +2 -2
- package/chunks/{chunk-IDOFNXOM.js → chunk-MNLPYHDS.js} +59 -11
- package/chunks/{chunk-ASR3UKPL.js → chunk-MRH3SYVM.js} +5 -5
- package/chunks/{chunk-6XC7AQHT.js → chunk-MWYTSG52.js} +83 -3
- package/chunks/{chunk-G6PZ7ZRF.js → chunk-O6IXKCOG.js} +1 -1
- package/chunks/{chunk-73UYQDL3.js → chunk-P2S3W72W.js} +4 -4
- package/chunks/{chunk-4UZHVDN6.js → chunk-PB7WGTEV.js} +1 -1
- package/chunks/{chunk-JVRNE7NT.js → chunk-PJOCOZLX.js} +262 -73
- package/chunks/{chunk-ITHF4F4L.js → chunk-PMYMZZOL.js} +4 -4
- package/chunks/{chunk-RLV563CG.js → chunk-POWVKJJ5.js} +1 -1
- package/chunks/{chunk-44NOS72H.js → chunk-PPK5GYKF.js} +4 -4
- package/chunks/{chunk-O7BIOEV2.js → chunk-PQJUGWAL.js} +1 -1
- package/chunks/{chunk-LGFB7Z2H.js → chunk-PVV4PS73.js} +4 -4
- package/chunks/{chunk-6HLOPCFZ.js → chunk-PYQSQFGU.js} +1 -1
- package/chunks/{chunk-ULLCJNT5.js → chunk-QER5OBZQ.js} +1 -1
- package/chunks/{chunk-QRDZ4FN6.js → chunk-QGSX4KMO.js} +3 -3
- package/chunks/{chunk-F3762QZG.js → chunk-QIFODGLE.js} +1 -1
- package/chunks/{chunk-SJSBSQJI.js → chunk-QNXMP5ZZ.js} +1 -1
- package/chunks/{chunk-7TZUSRNH.js → chunk-QPIQLU5S.js} +1 -1
- package/chunks/{chunk-BNX26EYK.js → chunk-QYXH4QO6.js} +1 -1
- package/chunks/{chunk-O53S3WDY.js → chunk-R2EUGEY3.js} +1 -1
- package/chunks/{chunk-3UIMC3MD.js → chunk-R4MYRZBH.js} +4 -4
- package/chunks/{chunk-UXFP67XM.js → chunk-R6KPCIC7.js} +4 -4
- package/chunks/{chunk-VMWSMIAG.js → chunk-RP5IWKTY.js} +1 -1
- package/chunks/{chunk-YRW7SOH4.js → chunk-S2J5OVPG.js} +43 -12
- package/chunks/{chunk-ITXHD6QG.js → chunk-SNF3LRCO.js} +5 -5
- package/chunks/{chunk-YXIMD7AK.js → chunk-T7AVLAAZ.js} +4 -4
- package/chunks/{chunk-HASGT63Y.js → chunk-TNDQQXZG.js} +5 -5
- package/chunks/{chunk-P5EIXSKJ.js → chunk-TQREMT4H.js} +1 -1
- package/chunks/{chunk-QJLOQHNR.js → chunk-TRRPP67K.js} +1 -1
- package/chunks/{chunk-K5Y3DMKT.js → chunk-U33LK6H3.js} +23 -7
- package/chunks/{chunk-2SKOHXQM.js → chunk-U3ALLY3C.js} +3 -3
- package/chunks/{chunk-PUBPS6I4.js → chunk-URV7VB5I.js} +134171 -132876
- package/chunks/{chunk-JYZMO5E7.js → chunk-UU6DJDI6.js} +7 -7
- package/chunks/{chunk-6CW53FOJ.js → chunk-VBDYNBGQ.js} +33 -0
- package/chunks/{chunk-ON5CGP6B.js → chunk-VGL4QINZ.js} +1 -1
- package/chunks/{chunk-BNJ3IJB7.js → chunk-VLTW32Z7.js} +5 -1
- package/chunks/{chunk-S2HJR2FT.js → chunk-VQURYS66.js} +1 -1
- package/chunks/{chunk-76FPHNLE.js → chunk-WEGKPUVT.js} +19 -18
- package/chunks/{chunk-JMMAXVTG.js → chunk-WIU4UVDX.js} +2 -2
- package/chunks/{chunk-EJHVUZDO.js → chunk-WKC6U3JJ.js} +1 -1
- package/chunks/{chunk-BWF5HABA.js → chunk-WLOIRIGM.js} +2 -2
- package/chunks/{chunk-GLXNABTW.js → chunk-WNPJDCZG.js} +1 -1
- package/chunks/{chunk-KPRGWI4Y.js → chunk-X2C52LE7.js} +1 -1
- package/chunks/{chunk-IDL5E3SK.js → chunk-X5MCTTTU.js} +1 -1
- package/chunks/{chunk-SJGCHKHG.js → chunk-XFHJCR6Q.js} +8 -8
- package/chunks/{chunk-JKBN3WM5.js → chunk-XGQNWLJE.js} +1 -1
- package/chunks/{chunk-WIDNRAGK.js → chunk-XPR26FUE.js} +2 -2
- package/chunks/{chunk-BQKZFSFW.js → chunk-XYWNIKCP.js} +3 -3
- package/chunks/{chunk-YMESB5YT.js → chunk-YO56DYD6.js} +3 -3
- package/chunks/{chunk-QU2DEIX4.js → chunk-YRZLD3UC.js} +1 -1
- package/chunks/{chunk-JDMI736Y.js → chunk-YSIQBGKE.js} +2 -2
- package/chunks/{chunk-UOG4OHEQ.js → chunk-Z2FVI2QE.js} +50 -33
- package/chunks/{chunk-UKUBYF44.js → chunk-ZFFEGZQP.js} +9 -9
- package/chunks/{chunk-ZZYIXQMV.js → chunk-ZXEMQEIR.js} +6 -6
- package/chunks/{codex-subagent-executor-ME2J5ZAK.js → codex-subagent-executor-IG3FMD7C.js} +28 -28
- package/chunks/{contextCommand-G3DP2V3O.js → contextCommand-V52TZ7WC.js} +27 -27
- package/chunks/{core-runtime-GHUSNSJC.js → core-runtime-2W7PZ32G.js} +25 -25
- package/chunks/{create-sub-session-ZVGBSQEO.js → create-sub-session-7F6RQ63I.js} +26 -26
- package/chunks/{create-sub-session-UEQ23VBD.js → create-sub-session-7RBPOM63.js} +1 -1
- package/chunks/{daemon-git-worktree-guard-JSMTW3IM.js → daemon-git-worktree-guard-XEYAHZKE.js} +25 -25
- package/chunks/{daemon-status-provider-C5NDII62.js → daemon-status-provider-3PGG4SFQ.js} +33 -33
- package/chunks/{daemon-trust-policy-22D6WDDX.js → daemon-trust-policy-4GR6OQIW.js} +31 -31
- package/chunks/{daemon-trust-policy-monitor-RLYT7BZS.js → daemon-trust-policy-monitor-ZYBKKGWV.js} +31 -31
- package/chunks/{deferred-core-runtime-KWFERRTL.js → deferred-core-runtime-EFVOFPFW.js} +25 -25
- package/chunks/{edit-XYXDIK5B.js → edit-ERIYX7VL.js} +15 -15
- package/chunks/{en-ZRJL6ZFP.js → en-AHX4A3X4.js} +19 -0
- package/chunks/{enterPlanMode-VQQZ2UW6.js → enterPlanMode-ESSALZKU.js} +13 -13
- package/chunks/{environment-EBFJ4TH2.js → environment-GJ4BXV6M.js} +27 -27
- package/chunks/{errors-3B4RPL2I.js → errors-TIRL2U2V.js} +27 -27
- package/chunks/{execution-tool-JVQOMMTE.js → execution-tool-S776S6AA.js} +15 -15
- package/chunks/{execution-worker-JMNHLRNL.js → execution-worker-EORKZE7B.js} +18 -18
- package/chunks/{exitPlanMode-7MZNYWO4.js → exitPlanMode-O5IF7SIB.js} +13 -13
- package/chunks/{fast-path-NJVM56IM.js → fast-path-IUBXHYB5.js} +2 -2
- package/chunks/{foreground-runner-LQEPDOLD.js → foreground-runner-5PAXAU7Q.js} +27 -27
- package/chunks/{gateway-models-2M6TFLX3.js → gateway-models-NK4WGZPX.js} +3 -3
- package/chunks/{glob-LPOYT76M.js → glob-PTGLSNFV.js} +13 -13
- package/chunks/{goal-tools-RUTV37TK.js → goal-tools-7XAPEACG.js} +13 -13
- package/chunks/{handleAutoUpdate-FYNNYADV.js → handleAutoUpdate-LB3EXOSL.js} +28 -28
- package/chunks/{i18n-QOCTCT72.js → i18n-2HPFDRCM.js} +26 -26
- package/chunks/{initializer-VMXV3BW6.js → initializer-YIPVTBD4.js} +31 -31
- package/chunks/{installationInfo-ZMTB5KY4.js → installationInfo-JEVGNV5S.js} +25 -25
- package/chunks/{list-HWTHYFDH.js → list-Q43RN5XQ.js} +33 -33
- package/chunks/{list-agents-QNCQCPBU.js → list-agents-YJZPHUQG.js} +12 -2
- package/chunks/{llm-BSHLCKRC.js → llm-ACGE4OPC.js} +58 -58
- package/chunks/{llm-content-generator-FOOFF7NM.js → llm-content-generator-N67V7IMO.js} +4 -4
- package/chunks/{loadedSettingsAdapter-DVQC5LYU.js → loadedSettingsAdapter-PCSL2RHU.js} +31 -31
- package/chunks/{local-execution-environment-NIQC5LCT.js → local-execution-environment-QPSZFUKG.js} +18 -18
- package/chunks/{loggingContentGenerator-KMXV7FXR.js → loggingContentGenerator-XIBC3H5T.js} +15 -15
- package/chunks/{managed-npm-update-6NXTMHIC.js → managed-npm-update-3C5UV3UA.js} +25 -25
- package/chunks/{mcp-B6BEFRFC.js → mcp-WJH2PRLP.js} +31 -31
- package/chunks/{model-call-collection-JGJ4TLCJ.js → model-call-collection-FCU2E3DK.js} +1 -1
- package/chunks/{model-configuration-HSAVOFVS.js → model-configuration-LWZ6AN7O.js} +32 -32
- package/chunks/{modelConfigUtils-E7WNOMPL.js → modelConfigUtils-NF2XXNHK.js} +27 -27
- package/chunks/{monitor-X5SXPGKJ.js → monitor-AUGWTFPN.js} +15 -14
- package/chunks/{nonInteractiveCli-ALN7VTV2.js → nonInteractiveCli-ICHDPCXZ.js} +63 -61
- package/chunks/{nonInteractiveToolExecutor-EP57MOQU.js → nonInteractiveToolExecutor-MEFA3XG6.js} +14 -14
- package/chunks/{notebook-edit-6AJJRXJE.js → notebook-edit-3FTHMUPG.js} +14 -14
- package/chunks/{omni-X2QDE2SC.js → omni-OB2XIDP6.js} +8 -8
- package/chunks/{openaiContentGenerator-DGFUUNP4.js → openaiContentGenerator-OVNPJ45X.js} +125 -13
- package/chunks/{openaiResponsesContentGenerator-QBWIVIZ3.js → openaiResponsesContentGenerator-LDEWDIIO.js} +483 -381
- package/chunks/{processUtils-RAKPTGL4.js → processUtils-ACE5MNN5.js} +2 -2
- package/chunks/{prompt-terminal-ledger-LNMBMLKZ.js → prompt-terminal-ledger-7AQNYK6B.js} +26 -26
- package/chunks/{pt-2EWDZAFN.js → pt-K4HAS53U.js} +19 -0
- package/chunks/{reactive-degrade-2R225XZN.js → reactive-degrade-FLQPZB4E.js} +7 -7
- package/chunks/{read-file-PVJ2UFNR.js → read-file-UAKMF6YY.js} +2 -2
- package/chunks/{record-source-ZEVZHGGT.js → record-source-6XCNP6XF.js} +2 -2
- package/chunks/{request-shutdown-WWNRWY6N.js → request-shutdown-6M76E2KV.js} +1 -1
- package/chunks/{resumeHistoryUtils-7JVBU7F6.js → resumeHistoryUtils-SFAPPPBU.js} +29 -29
- package/chunks/{ripGrep-SGVDEPUA.js → ripGrep-2V6G4VY4.js} +3 -3
- package/chunks/{run-o1-code-serve-6YBADDNM.js → run-o1-code-serve-Y6CZ4WSK.js} +32 -32
- package/chunks/{sandboxConfig-XSRSA444.js → sandboxConfig-5OYKJA5H.js} +25 -25
- package/chunks/{scheduled-tasks-I2ERGMGX.js → scheduled-tasks-YDANC666.js} +31 -31
- package/chunks/{scheduler-DOUZC3BT.js → scheduler-3RSBLGO5.js} +27 -27
- package/chunks/{send-message-ZCE2ZSEV.js → send-message-B2HM2LKH.js} +1 -1
- package/chunks/{serve-TWF224E6.js → serve-GPPUJF7A.js} +31 -31
- package/chunks/{server-QM5WDSMX.js → server-QSYUPWC4.js} +64 -69
- package/chunks/{session-UAA3BUYD.js → session-RYM42HON.js} +64 -62
- package/chunks/{session-YILUXNUN.js → session-YX6EADY3.js} +1 -1
- package/chunks/{session-attachments-root-7SV6ROO3.js → session-attachments-root-ONU4OCIH.js} +25 -25
- package/chunks/{session-pr-refresh-ZQEMZUOC.js → session-pr-refresh-PJMHSQS3.js} +30 -30
- package/chunks/{settings-I5BT5XJA.js → settings-QUPXDEE4.js} +30 -30
- package/chunks/{shell-CXFG4D26.js → shell-CBB5CVAS.js} +13 -13
- package/chunks/{skill-XAI4BN7B.js → skill-6GBBXV3Y.js} +3 -3
- package/chunks/{skill-settings-I6V36IWY.js → skill-settings-4KLNZO7M.js} +31 -31
- package/chunks/{spawnChannel-A3JN3SKE.js → spawnChannel-77A66ZTS.js} +27 -27
- package/chunks/{standalone-update-665KNR5K.js → standalone-update-Y6CLALFV.js} +27 -27
- package/chunks/{startInteractiveUI-3SDDBRSS.js → startInteractiveUI-LDCEYD4E.js} +2235 -2291
- package/chunks/{supervisor-runner-GJZ5FZ2L.js → supervisor-runner-UNQRYYHF.js} +2 -2
- package/chunks/{task-create-7KKOP2J2.js → task-create-AJSUW4SS.js} +2 -2
- package/chunks/{task-update-RDNOVBEQ.js → task-update-X65AWLX3.js} +2 -2
- package/chunks/{team-create-B3GZHAVJ.js → team-create-FETEWNIH.js} +13 -13
- package/chunks/{team-plan-approval-AA23AXBX.js → team-plan-approval-NGV34RBG.js} +13 -13
- package/chunks/{terminal-image-renderer-645UO3CY.js → terminal-image-renderer-QMHATNDT.js} +25 -25
- package/chunks/{theme-manager-Z724NWSU.js → theme-manager-LNPRQP4D.js} +25 -25
- package/chunks/{tool-call-BUCHKNUE.js → tool-call-BERI4DIZ.js} +2 -2
- package/chunks/{tool-result-media-F3GNEFYA.js → tool-result-media-BV3MLBOV.js} +8 -8
- package/chunks/{tool-search-ORCJKBH7.js → tool-search-WXUEK4Y4.js} +7 -4
- package/chunks/{total-session-admission-FVSADUS4.js → total-session-admission-GUPN7ETO.js} +28 -28
- package/chunks/{trustedFolders-53SWJNQM.js → trustedFolders-7N5EEZQZ.js} +26 -26
- package/chunks/{update-relaunch-TO7RIC2Z.js → update-relaunch-XEXPWCS3.js} +5 -5
- package/chunks/{updateCheck-ZO65M4E7.js → updateCheck-24QAZMCF.js} +27 -27
- package/chunks/{upload-config-GPGQJLHV.js → upload-config-R7KD3TYE.js} +5 -5
- package/chunks/{useAutoAcceptIndicator-XSYAN4MD.js → useAutoAcceptIndicator-5JIRDUHE.js} +33 -33
- package/chunks/{validateNonInterActiveAuth-KYRPPB7L.js → validateNonInterActiveAuth-NCIZ27CP.js} +60 -58
- package/chunks/{version-QWEY3XDL.js → version-ON5MXG2T.js} +1 -1
- package/chunks/{web-fetch-QKY4VT64.js → web-fetch-MXP24DZ5.js} +34 -18
- package/chunks/{web-search-AMRNCSP6.js → web-search-VHBFC7UE.js} +5 -5
- package/chunks/{workflow-QBLEKR24.js → workflow-W53REJII.js} +16 -15
- package/chunks/{workspace-providers-status-CH7DJDKT.js → workspace-providers-status-MQ4ORT4E.js} +37 -37
- package/chunks/{workspace-registration-store-HU2UBVSE.js → workspace-registration-store-AMXMOPWO.js} +1 -1
- package/chunks/{workspace-registry-PKZFC4K6.js → workspace-registry-RCQ4IEK3.js} +28 -28
- package/chunks/{workspace-runtime-coordinator-HLMOBHFQ.js → workspace-runtime-coordinator-6OTMUMU3.js} +29 -29
- package/chunks/{workspace-service-CD6JZZGR.js → workspace-service-ZIE2JRN3.js} +36 -36
- package/chunks/{workspace-skills-status-ECZGFEYZ.js → workspace-skills-status-FQPWMSLR.js} +34 -34
- package/chunks/{workspace-trust-reconciler-NADYMCWA.js → workspace-trust-reconciler-TLAP6FPV.js} +34 -34
- package/chunks/{write-file-4QSLWQJN.js → write-file-6ALKQRAE.js} +15 -15
- package/chunks/{zh-JJGCFWTL.js → zh-RF4IW7H6.js} +18 -0
- package/chunks/{zh-TW-7LWX7CCJ.js → zh-TW-65FIGD7M.js} +18 -0
- package/chunks/{zoom-image-FGAGFWD3.js → zoom-image-S5EHXDCZ.js} +2 -2
- package/cli.js +16 -16
- package/execution-worker.js +1 -1
- package/export-transcript-document.js +1 -1
- package/locales/en.js +27 -0
- package/locales/pt.js +28 -0
- package/locales/zh-TW.js +24 -0
- package/locales/zh.js +24 -0
- package/package.json +2 -2
- package/release-notes.json +31 -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-CXGkTYKR.js → abnfDiagram-VCTEODGH-DUjEqeft.js} +1 -1
- package/web-shell/assets/{arc-Bgtf2wGs.js → arc-W0jfDngQ.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-CdAnFxID.js → architectureDiagram-5GKGNRK7-DyF3Ulps.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-BetLLPQA.js → blockDiagram-NRAW4CY4-_rS4wVsL.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-BVEDlbNL.js → c4Diagram-UCG6FXSJ-Ba_maCcq.js} +1 -1
- package/web-shell/assets/channel-MNzhF6WL.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-Bu_XLqIX.js → chunk-2Q5K7J3B-Dp-kK_66.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-CuIm-L87.js → chunk-5VM5RSS4-BReLjFMB.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-zdnqrtCA.js → chunk-F27PBJKO-CyfDw0xH.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-DA0j2ueI.js → chunk-G27WJ6UU-BD-E3vyG.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-BYP9xsTl.js → chunk-JWPE2WC7-BNg2LZ1b.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-CqZfx1I5.js → chunk-LCL6LL3I-CD6sIbXP.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-BEYiYIxG.js → chunk-POPQ4Y6H-biiydq96.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-Df7kB2kI.js → chunk-SVP7TREG-DSAy-8IK.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-DSVwWamu.js → chunk-XXDRQBXY-CQsQoyx5.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DK4qave1.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DK4qave1.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-3y3UQaAQ.js → cose-bilkent-JH36ORCC-cY73mmYw.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-D5boSC-y.js → cynefin-OW5HDTMX-BTO6WVz1.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-D06h0zad.js → cynefinDiagram-5FMLGOSQ-VDQcZUqd.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-B5PC4pJb.js → dagre-3AP2YEHR-Bv2vVLCG.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-CQkjaeF5.js → diagram-S7CK7UJ4-BqJUJmzm.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-Dp4B8BsM.js → diagram-UQ7AKVKN-BnLr2eEw.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-1WUz-IlV.js → diagram-VSXAHHWV-D6XN-3Ym.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-CVOE8dqI.js → diagram-VX7I27RA-Ci66ZVMg.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-3gYRwIVB.js → diagram-Z3DM3KII-CdKapkP8.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-tVjIWybZ.js → ebnfDiagram-PWID7BFC-BMaAVNO9.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-DKQv6Y6l.js → erDiagram-SSCWMZ5O-tJDW3Qos.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-C1aZT9uy.js → flowDiagram-A5DVABFB-CkeFnWh8.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-BKVpaHRR.js → ganttDiagram-EL5Y4UJY-BhdRaGW7.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-BZOhM9h_.js → gitGraphDiagram-WWUBYQGX-_3xhVP9s.js} +1 -1
- package/web-shell/assets/{index-CB3Jrunr.js → index-CL6noNpm.js} +1 -1
- package/web-shell/assets/{index-Do4y2b4t.js → index-JJUratVS.js} +3 -3
- package/web-shell/assets/{infoDiagram-RXCK75RN-D1uBMMVt.js → infoDiagram-RXCK75RN-Ct5KstKl.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CEucsPqw.js → ishikawaDiagram-5VMMS53U-CaWQH0FX.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-DZzzYLoO.js → journeyDiagram-EYS64GPL-wL4IPDN7.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-C9BYwkVP.js → kanban-definition-3QL26DDD-zF6R7MCX.js} +1 -1
- package/web-shell/assets/{layout-CsgRL45r.js → layout-BHURDNhy.js} +1 -1
- package/web-shell/assets/{linear-BUq0-ZDw.js → linear-BSG9T8Eq.js} +1 -1
- package/web-shell/assets/{mermaid.core-D3JSOWCq.js → mermaid.core-CN3wMJE1.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-BLHYT_f0.js → mindmap-definition-FBJOCRG2-C0-g1D9W.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-B2QHW9UX.js → pegDiagram-XKGWAZYB-1cBE4q6f.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-4QDrwUVJ.js → pieDiagram-E7YTZNPT-BsHzVeMb.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-CHkz8icI.js → quadrantDiagram-AXDQQJYC-CeW8aBeN.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-Y1UZxdd7.js → railroadDiagram-O6MQD6OU-BOCp1FXY.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-B2STIEs-.js → requirementDiagram-EFPCY7ZU-Xq9keBxz.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-QX0whSnt.js → sankeyDiagram-P5KCCOFB-Ce8E1MlF.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-JSPBV6Z9.js → sequenceDiagram-WJ2MYXX4-Cf1g7Rf3.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-BHR85hzV.js → sizeCapture-X5ZJPWSS-S2-ACap9.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-5yqdcEJk.js → stateDiagram-HBIQ2CUA-DAqItqGd.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-BAK1hNnl.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-DtaoSfgY.js → swimlanes-XN3QIQJK-DhvAaL9i.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-3m_PeoO-.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-Di2q68WC.js → timeline-definition-24CTP7MA-CxSAzpJr.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-BiIN5IkG.js → vennDiagram-4TSXK5OY-BsZKmoYt.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-Cjx_SM3A.js → wardleyDiagram-VM6X3IG4-B8cw7lrk.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-VAFMpQ3K.js → xychartDiagram-S5SC5T6Z-DwM0RAy-.js} +1 -1
- package/web-shell/index.html +1 -1
- package/web-shell/sw.js +1 -1
- package/vendor/o1-connect/.lintstagedrc.mjs +0 -7
- package/web-shell/assets/channel-qApIjhnO.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DEyyr5tF.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DEyyr5tF.js +0 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-BHsx9uG6.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-AVscCGHh.js +0 -8
|
@@ -20,7 +20,7 @@ import "./chunk-WDBSTICZ.js";
|
|
|
20
20
|
import {
|
|
21
21
|
getEffectiveReasoning,
|
|
22
22
|
resolveReasoningForModel
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LMZTL6BD.js";
|
|
24
24
|
import "./chunk-WQU5EWE3.js";
|
|
25
25
|
import "./chunk-EYKEQPKF.js";
|
|
26
26
|
import {
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
O1CODE_STREAM_MAX_LIFETIME_MS_ENV,
|
|
41
41
|
normalizeOpenAiWireBaseUrl,
|
|
42
42
|
resolveRequestTimeout
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-DN5T6AO6.js";
|
|
44
44
|
import {
|
|
45
45
|
reconcileMaxTokens
|
|
46
46
|
} from "./chunk-XFIAS7A6.js";
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
} from "./chunk-VYRPAY75.js";
|
|
53
53
|
import "./chunk-S7GOFMLU.js";
|
|
54
54
|
import "./chunk-RC67CA5Z.js";
|
|
55
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-5BFVYOZU.js";
|
|
56
56
|
import "./chunk-LEXKU5FI.js";
|
|
57
57
|
import {
|
|
58
58
|
reachesOrganizaOne
|
|
@@ -84,7 +84,379 @@ init_esbuild_shims();
|
|
|
84
84
|
|
|
85
85
|
// packages/core/src/core/openaiResponsesContentGenerator/responses-converter.ts
|
|
86
86
|
init_esbuild_shims();
|
|
87
|
-
|
|
87
|
+
|
|
88
|
+
// packages/core/src/core/openaiResponsesContentGenerator/responses-reasoning-rejection.ts
|
|
89
|
+
init_esbuild_shims();
|
|
90
|
+
var debugLogger = createDebugLogger("RESPONSES_REASONING_REJECTION");
|
|
91
|
+
var TOOL_MEDIA_CAPTION = "(attached media from previous tool call)";
|
|
92
|
+
function isToolMediaFollowUp(item) {
|
|
93
|
+
if (typeof item !== "object" || item === null || item.type !== "message" || item.role !== "user") {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
const content = item.content;
|
|
97
|
+
if (!Array.isArray(content) || content.length === 0) return false;
|
|
98
|
+
const first = content[0];
|
|
99
|
+
return isPlainObject(first) && first["type"] === "input_text" && first["text"] === TOOL_MEDIA_CAPTION;
|
|
100
|
+
}
|
|
101
|
+
__name(isToolMediaFollowUp, "isToolMediaFollowUp");
|
|
102
|
+
function followingCallGroup(items, index) {
|
|
103
|
+
const callIds = [];
|
|
104
|
+
for (let i = index + 1; i < items.length; i++) {
|
|
105
|
+
const item = items[i];
|
|
106
|
+
if (typeof item !== "object" || item === null || item.type !== "function_call") {
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
callIds.push(item.call_id);
|
|
110
|
+
}
|
|
111
|
+
return callIds;
|
|
112
|
+
}
|
|
113
|
+
__name(followingCallGroup, "followingCallGroup");
|
|
114
|
+
var REJECTION_CODE = "string_above_max_length";
|
|
115
|
+
var PARAM_PATTERN = /^input\[(\d+)\]\.id$/;
|
|
116
|
+
var PARAM_REFERENCE_PATTERN = /input\[\d+\]\.id/g;
|
|
117
|
+
var MAXIMUM_LENGTH_PATTERN = /maximum length \d+/gi;
|
|
118
|
+
var SIMPLE_ESCAPES = {
|
|
119
|
+
'"': '"',
|
|
120
|
+
"\\": "\\",
|
|
121
|
+
"/": "/",
|
|
122
|
+
b: "\b",
|
|
123
|
+
f: "\f",
|
|
124
|
+
n: "\n",
|
|
125
|
+
r: "\r",
|
|
126
|
+
t: " "
|
|
127
|
+
};
|
|
128
|
+
var REPAIRABLE_CONTROLS = /* @__PURE__ */ new Set(["\n", " ", "\r"]);
|
|
129
|
+
var MAX_BODY_CHARS = 64e3;
|
|
130
|
+
var MAX_OBJECT_CANDIDATES = 32;
|
|
131
|
+
function parseReasoningIdRejection(status, responseBody) {
|
|
132
|
+
if (status !== 400) return void 0;
|
|
133
|
+
try {
|
|
134
|
+
return classify(responseBody);
|
|
135
|
+
} catch {
|
|
136
|
+
return void 0;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
__name(parseReasoningIdRejection, "parseReasoningIdRejection");
|
|
140
|
+
function classify(responseBody) {
|
|
141
|
+
const text = toEnvelopeText(responseBody);
|
|
142
|
+
if (text === void 0) return void 0;
|
|
143
|
+
const envelope = readEnvelope(text, MAX_OBJECT_CANDIDATES, true);
|
|
144
|
+
if (!envelope) return void 0;
|
|
145
|
+
const error = readErrorMember(envelope.value);
|
|
146
|
+
if (!error) return void 0;
|
|
147
|
+
return matchRejection(error) ?? matchQuotedRejection(error, MAX_OBJECT_CANDIDATES - envelope.objects);
|
|
148
|
+
}
|
|
149
|
+
__name(classify, "classify");
|
|
150
|
+
function matchRejection(error) {
|
|
151
|
+
if (error["code"] !== REJECTION_CODE) return void 0;
|
|
152
|
+
const param = error["param"];
|
|
153
|
+
if (typeof param !== "string") return void 0;
|
|
154
|
+
const named = PARAM_PATTERN.exec(param);
|
|
155
|
+
if (!named) return void 0;
|
|
156
|
+
const index = Number(named[1]);
|
|
157
|
+
if (!Number.isSafeInteger(index) || index < 0) return void 0;
|
|
158
|
+
const message = error["message"];
|
|
159
|
+
return {
|
|
160
|
+
namedIndex: index,
|
|
161
|
+
maxLength: extractMaxLength(
|
|
162
|
+
typeof message === "string" ? message : void 0,
|
|
163
|
+
param
|
|
164
|
+
)
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
__name(matchRejection, "matchRejection");
|
|
168
|
+
function matchQuotedRejection(error, budget) {
|
|
169
|
+
const message = error["message"];
|
|
170
|
+
if (typeof message !== "string") return void 0;
|
|
171
|
+
const start = message.indexOf("{");
|
|
172
|
+
if (start < 0) return void 0;
|
|
173
|
+
const quoted = readEnvelope(message.slice(start), budget, false);
|
|
174
|
+
if (!quoted) return void 0;
|
|
175
|
+
const inner = readErrorMember(quoted.value);
|
|
176
|
+
return inner ? matchRejection(inner) : void 0;
|
|
177
|
+
}
|
|
178
|
+
__name(matchQuotedRejection, "matchQuotedRejection");
|
|
179
|
+
function readErrorMember(value) {
|
|
180
|
+
if (!isPlainObject(value)) return void 0;
|
|
181
|
+
const error = value["error"];
|
|
182
|
+
return isPlainObject(error) ? error : void 0;
|
|
183
|
+
}
|
|
184
|
+
__name(readErrorMember, "readErrorMember");
|
|
185
|
+
function isPlainObject(value) {
|
|
186
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
187
|
+
}
|
|
188
|
+
__name(isPlainObject, "isPlainObject");
|
|
189
|
+
function downgradeRejectedReasoningItems(items, rejection) {
|
|
190
|
+
const named = items[rejection.namedIndex];
|
|
191
|
+
if (!isReasoningItem(named)) return items;
|
|
192
|
+
const { maxLength } = rejection;
|
|
193
|
+
if (maxLength !== null && named.id.length <= maxLength) return items;
|
|
194
|
+
const rewritten = [];
|
|
195
|
+
let changed = false;
|
|
196
|
+
const droppedCallIds = /* @__PURE__ */ new Set();
|
|
197
|
+
const unitDroppedOriginals = /* @__PURE__ */ new Set();
|
|
198
|
+
let droppedUnits = 0;
|
|
199
|
+
let justDroppedUnit = false;
|
|
200
|
+
for (let i = 0; i < items.length; i++) {
|
|
201
|
+
const item = items[i];
|
|
202
|
+
if (typeof item === "object" && item !== null && item.type === "function_call_output" && droppedCallIds.has(item.call_id)) {
|
|
203
|
+
changed = true;
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
if (justDroppedUnit && isToolMediaFollowUp(item)) {
|
|
207
|
+
changed = true;
|
|
208
|
+
justDroppedUnit = false;
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
justDroppedUnit = false;
|
|
212
|
+
if (!isReasoningItem(item) || !exceedsMax(item, maxLength)) {
|
|
213
|
+
rewritten.push(item);
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
changed = true;
|
|
217
|
+
const summary = readSummaryTexts(item);
|
|
218
|
+
const unitCallIds = followingCallGroup(items, i);
|
|
219
|
+
if (unitCallIds.length > 0) {
|
|
220
|
+
for (let k = 1; k <= unitCallIds.length; k++) {
|
|
221
|
+
droppedCallIds.add(unitCallIds[k - 1]);
|
|
222
|
+
unitDroppedOriginals.add(items[i + k]);
|
|
223
|
+
}
|
|
224
|
+
i += unitCallIds.length;
|
|
225
|
+
droppedUnits++;
|
|
226
|
+
justDroppedUnit = true;
|
|
227
|
+
}
|
|
228
|
+
if (summary.length === 0) {
|
|
229
|
+
if (unitCallIds.length > 0) unitDroppedOriginals.add(item);
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
rewritten.push({
|
|
233
|
+
type: "message",
|
|
234
|
+
role: "assistant",
|
|
235
|
+
content: summary.join("\n")
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
const finalized = [];
|
|
239
|
+
for (let j = rewritten.length - 1; j >= 0; j--) {
|
|
240
|
+
const item = rewritten[j];
|
|
241
|
+
if (!isReasoningItem(item)) {
|
|
242
|
+
finalized.push(item);
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
const successor = items[items.indexOf(item) + 1];
|
|
246
|
+
if (successor === void 0 || !unitDroppedOriginals.has(successor)) {
|
|
247
|
+
finalized.push(item);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
changed = true;
|
|
251
|
+
const summary = readSummaryTexts(item);
|
|
252
|
+
if (summary.length > 0) {
|
|
253
|
+
finalized.push({
|
|
254
|
+
type: "message",
|
|
255
|
+
role: "assistant",
|
|
256
|
+
content: summary.join("\n")
|
|
257
|
+
});
|
|
258
|
+
} else {
|
|
259
|
+
unitDroppedOriginals.add(item);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
finalized.reverse();
|
|
263
|
+
if (droppedUnits > 0) {
|
|
264
|
+
debugLogger.debug(
|
|
265
|
+
`Downgrade removed ${droppedUnits} reasoning/call unit(s); their tool calls and results are not part of the retry.`
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
return changed ? finalized : items;
|
|
269
|
+
}
|
|
270
|
+
__name(downgradeRejectedReasoningItems, "downgradeRejectedReasoningItems");
|
|
271
|
+
function exceedsMax(item, maxLength) {
|
|
272
|
+
return maxLength === null || item.id.length > maxLength;
|
|
273
|
+
}
|
|
274
|
+
__name(exceedsMax, "exceedsMax");
|
|
275
|
+
function isReasoningItem(item) {
|
|
276
|
+
return typeof item === "object" && item !== null && item.type === "reasoning" && typeof item.id === "string";
|
|
277
|
+
}
|
|
278
|
+
__name(isReasoningItem, "isReasoningItem");
|
|
279
|
+
function readSummaryTexts(item) {
|
|
280
|
+
if (!Array.isArray(item.summary)) return [];
|
|
281
|
+
const texts = [];
|
|
282
|
+
for (const entry of item.summary) {
|
|
283
|
+
if (typeof entry === "object" && entry !== null && entry.type === "summary_text" && typeof entry.text === "string" && entry.text.length > 0) {
|
|
284
|
+
texts.push(entry.text);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return texts;
|
|
288
|
+
}
|
|
289
|
+
__name(readSummaryTexts, "readSummaryTexts");
|
|
290
|
+
function extractMaxLength(message, param) {
|
|
291
|
+
if (!message) return null;
|
|
292
|
+
const references = message.match(PARAM_REFERENCE_PATTERN);
|
|
293
|
+
if (!references || references.length !== 1 || references[0] !== param) {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
const maxima = message.match(MAXIMUM_LENGTH_PATTERN);
|
|
297
|
+
if (!maxima || maxima.length !== 1) return null;
|
|
298
|
+
const digits = /\d+/.exec(maxima[0]);
|
|
299
|
+
if (!digits) return null;
|
|
300
|
+
const value = Number(digits[0]);
|
|
301
|
+
if (!Number.isSafeInteger(value) || value <= 0) return null;
|
|
302
|
+
return value;
|
|
303
|
+
}
|
|
304
|
+
__name(extractMaxLength, "extractMaxLength");
|
|
305
|
+
function toEnvelopeText(responseBody) {
|
|
306
|
+
let text;
|
|
307
|
+
if (typeof responseBody === "string") {
|
|
308
|
+
text = responseBody;
|
|
309
|
+
} else if (typeof responseBody === "object" && responseBody !== null && !Array.isArray(responseBody)) {
|
|
310
|
+
try {
|
|
311
|
+
text = JSON.stringify(responseBody);
|
|
312
|
+
} catch {
|
|
313
|
+
return void 0;
|
|
314
|
+
}
|
|
315
|
+
if (typeof text !== "string") return void 0;
|
|
316
|
+
} else {
|
|
317
|
+
return void 0;
|
|
318
|
+
}
|
|
319
|
+
if (text.length > MAX_BODY_CHARS) return void 0;
|
|
320
|
+
let start = 0;
|
|
321
|
+
while (start < text.length && isJsonWhitespace(text[start])) start++;
|
|
322
|
+
return text[start] === "{" ? text.slice(start) : void 0;
|
|
323
|
+
}
|
|
324
|
+
__name(toEnvelopeText, "toEnvelopeText");
|
|
325
|
+
function readEnvelope(text, budget, repairErrorMessage) {
|
|
326
|
+
const normalized = normalizeEnvelope(text, budget, repairErrorMessage);
|
|
327
|
+
if (!normalized) return void 0;
|
|
328
|
+
try {
|
|
329
|
+
return { value: JSON.parse(normalized.json), objects: normalized.objects };
|
|
330
|
+
} catch {
|
|
331
|
+
return void 0;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
__name(readEnvelope, "readEnvelope");
|
|
335
|
+
function normalizeEnvelope(text, budget, repairErrorMessage) {
|
|
336
|
+
const out = [];
|
|
337
|
+
const stack = [];
|
|
338
|
+
let objects = 0;
|
|
339
|
+
let closed = false;
|
|
340
|
+
let i = 0;
|
|
341
|
+
while (i < text.length) {
|
|
342
|
+
const ch = text[i];
|
|
343
|
+
if (closed) {
|
|
344
|
+
if (!isJsonWhitespace(ch)) return void 0;
|
|
345
|
+
i++;
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
if (ch === '"') {
|
|
349
|
+
const top = stack[stack.length - 1];
|
|
350
|
+
const atKey = top?.object === true && top.atKey;
|
|
351
|
+
const repairable = repairErrorMessage && top?.object === true && !atKey && top.recognizedError && top.key === "message";
|
|
352
|
+
const literal = readStringLiteral(text, i, repairable);
|
|
353
|
+
if (!literal) return void 0;
|
|
354
|
+
if (top?.object && top.atKey) {
|
|
355
|
+
if (top.keys.has(literal.value)) return void 0;
|
|
356
|
+
top.keys.add(literal.value);
|
|
357
|
+
top.atKey = false;
|
|
358
|
+
top.key = literal.value;
|
|
359
|
+
}
|
|
360
|
+
out.push(literal.json);
|
|
361
|
+
i = literal.next;
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
if (ch === "{" || ch === "[") {
|
|
365
|
+
const object = ch === "{";
|
|
366
|
+
if (object && ++objects > budget) return void 0;
|
|
367
|
+
const parent = stack[stack.length - 1];
|
|
368
|
+
stack.push({
|
|
369
|
+
object,
|
|
370
|
+
keys: /* @__PURE__ */ new Set(),
|
|
371
|
+
recognizedError: object && stack.length === 1 && parent?.object === true && parent.key === "error",
|
|
372
|
+
atKey: object,
|
|
373
|
+
key: void 0
|
|
374
|
+
});
|
|
375
|
+
} else if (ch === "}" || ch === "]") {
|
|
376
|
+
const top = stack.pop();
|
|
377
|
+
if (!top || top.object !== (ch === "}")) return void 0;
|
|
378
|
+
if (stack.length === 0) closed = true;
|
|
379
|
+
} else if (ch === ",") {
|
|
380
|
+
const top = stack[stack.length - 1];
|
|
381
|
+
if (top?.object) {
|
|
382
|
+
top.atKey = true;
|
|
383
|
+
top.key = void 0;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
out.push(ch);
|
|
387
|
+
i++;
|
|
388
|
+
}
|
|
389
|
+
if (!closed || stack.length > 0) return void 0;
|
|
390
|
+
return { json: out.join(""), objects };
|
|
391
|
+
}
|
|
392
|
+
__name(normalizeEnvelope, "normalizeEnvelope");
|
|
393
|
+
function isJsonWhitespace(ch) {
|
|
394
|
+
return ch === " " || ch === " " || ch === "\n" || ch === "\r";
|
|
395
|
+
}
|
|
396
|
+
__name(isJsonWhitespace, "isJsonWhitespace");
|
|
397
|
+
function readStringLiteral(text, start, repairable) {
|
|
398
|
+
let value = "";
|
|
399
|
+
let json = '"';
|
|
400
|
+
let i = start + 1;
|
|
401
|
+
while (i < text.length) {
|
|
402
|
+
const ch = text[i];
|
|
403
|
+
if (ch === '"') return { value, json: `${json}"`, next: i + 1 };
|
|
404
|
+
if (ch === "\\") {
|
|
405
|
+
const escape = text[i + 1];
|
|
406
|
+
if (escape === "u") {
|
|
407
|
+
const hex = text.slice(i + 2, i + 6);
|
|
408
|
+
if (!/^[0-9a-fA-F]{4}$/.test(hex)) return void 0;
|
|
409
|
+
value += String.fromCharCode(parseInt(hex, 16));
|
|
410
|
+
json += text.slice(i, i + 6);
|
|
411
|
+
i += 6;
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
const simple = escape === void 0 ? void 0 : SIMPLE_ESCAPES[escape];
|
|
415
|
+
if (simple === void 0) return void 0;
|
|
416
|
+
value += simple;
|
|
417
|
+
json += `\\${escape}`;
|
|
418
|
+
i += 2;
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
const code = ch.charCodeAt(0);
|
|
422
|
+
if (code < 32) {
|
|
423
|
+
if (!repairable || !REPAIRABLE_CONTROLS.has(ch)) return void 0;
|
|
424
|
+
value += ch;
|
|
425
|
+
json += `\\u${code.toString(16).padStart(4, "0")}`;
|
|
426
|
+
i++;
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
429
|
+
value += ch;
|
|
430
|
+
json += ch;
|
|
431
|
+
i++;
|
|
432
|
+
}
|
|
433
|
+
return void 0;
|
|
434
|
+
}
|
|
435
|
+
__name(readStringLiteral, "readStringLiteral");
|
|
436
|
+
function countReasoningItems(items) {
|
|
437
|
+
return items.filter(isReasoningItem).length;
|
|
438
|
+
}
|
|
439
|
+
__name(countReasoningItems, "countReasoningItems");
|
|
440
|
+
function isEncryptedReasoningRejection(status, responseBody) {
|
|
441
|
+
if (status !== 400 || responseBody.length > MAX_BODY_CHARS) return false;
|
|
442
|
+
const text = toEnvelopeText(responseBody.replace(/^data: ?/, ""));
|
|
443
|
+
if (!text) return false;
|
|
444
|
+
const envelope = readEnvelope(text, MAX_OBJECT_CANDIDATES, false);
|
|
445
|
+
if (!envelope || !isPlainObject(envelope.value)) return false;
|
|
446
|
+
const direct = readErrorMember(envelope.value);
|
|
447
|
+
return direct?.["code"] === "invalid_encrypted_content";
|
|
448
|
+
}
|
|
449
|
+
__name(isEncryptedReasoningRejection, "isEncryptedReasoningRejection");
|
|
450
|
+
function downgradeEncryptedReasoningItems(items) {
|
|
451
|
+
return downgradeRejectedReasoningItems(items, {
|
|
452
|
+
namedIndex: items.findIndex(isReasoningItem),
|
|
453
|
+
maxLength: null
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
__name(downgradeEncryptedReasoningItems, "downgradeEncryptedReasoningItems");
|
|
457
|
+
|
|
458
|
+
// packages/core/src/core/openaiResponsesContentGenerator/responses-converter.ts
|
|
459
|
+
var debugLogger2 = createDebugLogger("RESPONSES_CONVERTER");
|
|
88
460
|
var SUPPORTED_RESPONSE_IMAGE_MIME_TYPES = /* @__PURE__ */ new Set([
|
|
89
461
|
"image/jpeg",
|
|
90
462
|
"image/png",
|
|
@@ -417,7 +789,7 @@ function convertGeminiContentsToResponsesInput(request, options = {}) {
|
|
|
417
789
|
summary: part.text ? [{ type: "summary_text", text: part.text }] : []
|
|
418
790
|
});
|
|
419
791
|
} else if (part.text) {
|
|
420
|
-
|
|
792
|
+
debugLogger2.warn(
|
|
421
793
|
"Dropping unreplayable reasoning signature; preserving summary text as a plain message"
|
|
422
794
|
);
|
|
423
795
|
items.push({
|
|
@@ -474,7 +846,7 @@ function convertGeminiContentsToResponsesInput(request, options = {}) {
|
|
|
474
846
|
});
|
|
475
847
|
} else {
|
|
476
848
|
const placeholderMime = placeholderMimeType(mimeType);
|
|
477
|
-
|
|
849
|
+
debugLogger2.warn(
|
|
478
850
|
`Dropping unsupported tool-result inline media type: ${placeholderMime}`
|
|
479
851
|
);
|
|
480
852
|
pendingToolMediaParts.push({
|
|
@@ -486,7 +858,7 @@ function convertGeminiContentsToResponsesInput(request, options = {}) {
|
|
|
486
858
|
const placeholderMime = placeholderMimeType(
|
|
487
859
|
frPart.fileData.mimeType
|
|
488
860
|
);
|
|
489
|
-
|
|
861
|
+
debugLogger2.warn(
|
|
490
862
|
`Dropping unsupported tool-result file reference: ${placeholderMime}`
|
|
491
863
|
);
|
|
492
864
|
pendingToolMediaParts.push({
|
|
@@ -536,400 +908,130 @@ function convertGeminiContentsToResponsesInput(request, options = {}) {
|
|
|
536
908
|
content: [
|
|
537
909
|
{
|
|
538
910
|
type: "input_text",
|
|
539
|
-
text:
|
|
911
|
+
text: TOOL_MEDIA_CAPTION
|
|
540
912
|
},
|
|
541
913
|
...pendingToolMediaParts
|
|
542
914
|
]
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
return { instructions, input: items };
|
|
547
|
-
}
|
|
548
|
-
__name(convertGeminiContentsToResponsesInput, "convertGeminiContentsToResponsesInput");
|
|
549
|
-
function cleanOrphanedFunctionCalls(items) {
|
|
550
|
-
const callIds = /* @__PURE__ */ new Set();
|
|
551
|
-
const outputCallIds = /* @__PURE__ */ new Set();
|
|
552
|
-
for (const item of items) {
|
|
553
|
-
if (typeof item !== "object" || item === null || !("type" in item)) {
|
|
554
|
-
continue;
|
|
555
|
-
}
|
|
556
|
-
if (item.type === "function_call" && "call_id" in item) {
|
|
557
|
-
callIds.add(item.call_id);
|
|
558
|
-
} else if (item.type === "function_call_output" && "call_id" in item) {
|
|
559
|
-
outputCallIds.add(item.call_id);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
return items.filter((item) => {
|
|
563
|
-
if (typeof item !== "object" || item === null || !("type" in item)) {
|
|
564
|
-
return true;
|
|
565
|
-
}
|
|
566
|
-
if (item.type === "function_call" && "call_id" in item) {
|
|
567
|
-
return outputCallIds.has(item.call_id);
|
|
568
|
-
}
|
|
569
|
-
if (item.type === "function_call_output" && "call_id" in item) {
|
|
570
|
-
return callIds.has(item.call_id);
|
|
571
|
-
}
|
|
572
|
-
return true;
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
__name(cleanOrphanedFunctionCalls, "cleanOrphanedFunctionCalls");
|
|
576
|
-
function convertGeminiToolsToResponsesTools(request) {
|
|
577
|
-
const tools = request.config?.tools;
|
|
578
|
-
if (!tools || !Array.isArray(tools)) return void 0;
|
|
579
|
-
const result = [];
|
|
580
|
-
for (const tool of tools) {
|
|
581
|
-
if (typeof tool !== "object" || tool === null) continue;
|
|
582
|
-
const funcDecls = "functionDeclarations" in tool ? tool.functionDeclarations : void 0;
|
|
583
|
-
if (!Array.isArray(funcDecls)) continue;
|
|
584
|
-
for (const func of funcDecls) {
|
|
585
|
-
if (!func.name) continue;
|
|
586
|
-
result.push({
|
|
587
|
-
type: "function",
|
|
588
|
-
name: func.name,
|
|
589
|
-
description: func.description,
|
|
590
|
-
parameters: normalizeResponsesParameters(
|
|
591
|
-
// Prefer parametersJsonSchema (raw JSON Schema, e.g. MCP/extension
|
|
592
|
-
// tools) and fall back to parameters, matching the Chat and
|
|
593
|
-
// Anthropic sibling wires — @google/genai allows both fields at
|
|
594
|
-
// once, and preferring `parameters` here would send a different,
|
|
595
|
-
// potentially lossier schema than the siblings for identical config.
|
|
596
|
-
func.parametersJsonSchema ?? func.parameters
|
|
597
|
-
)
|
|
598
|
-
});
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
return result.length > 0 ? result : void 0;
|
|
602
|
-
}
|
|
603
|
-
__name(convertGeminiToolsToResponsesTools, "convertGeminiToolsToResponsesTools");
|
|
604
|
-
function normalizeResponsesParameters(schema) {
|
|
605
|
-
if (schema === void 0) return void 0;
|
|
606
|
-
if (schema === null || typeof schema !== "object") return schema;
|
|
607
|
-
return normalizeResponsesSchemaNode(schema);
|
|
608
|
-
}
|
|
609
|
-
__name(normalizeResponsesParameters, "normalizeResponsesParameters");
|
|
610
|
-
function normalizeResponsesSchemaNode(node) {
|
|
611
|
-
if (Array.isArray(node)) {
|
|
612
|
-
return node.map((item) => normalizeResponsesSchemaNode(item));
|
|
613
|
-
}
|
|
614
|
-
if (!node || typeof node !== "object") return node;
|
|
615
|
-
const out = {
|
|
616
|
-
...node
|
|
617
|
-
};
|
|
618
|
-
if (out["properties"] && typeof out["properties"] === "object") {
|
|
619
|
-
const props = out["properties"];
|
|
620
|
-
const nextProps = {};
|
|
621
|
-
for (const [k, v] of Object.entries(props)) {
|
|
622
|
-
nextProps[k] = normalizeResponsesSchemaNode(v);
|
|
623
|
-
}
|
|
624
|
-
out["properties"] = nextProps;
|
|
625
|
-
}
|
|
626
|
-
if (out["items"]) {
|
|
627
|
-
out["items"] = normalizeResponsesSchemaNode(out["items"]);
|
|
628
|
-
}
|
|
629
|
-
for (const key of ["anyOf", "oneOf", "allOf"]) {
|
|
630
|
-
const v = out[key];
|
|
631
|
-
if (Array.isArray(v)) {
|
|
632
|
-
out[key] = v.map((item) => normalizeResponsesSchemaNode(item));
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
if (out["type"] === "object" && out["properties"] === void 0) {
|
|
636
|
-
out["properties"] = {};
|
|
637
|
-
}
|
|
638
|
-
return out;
|
|
639
|
-
}
|
|
640
|
-
__name(normalizeResponsesSchemaNode, "normalizeResponsesSchemaNode");
|
|
641
|
-
|
|
642
|
-
// packages/core/src/core/openaiResponsesContentGenerator/responses-reasoning-rejection.ts
|
|
643
|
-
init_esbuild_shims();
|
|
644
|
-
var REJECTION_CODE = "string_above_max_length";
|
|
645
|
-
var PARAM_PATTERN = /^input\[(\d+)\]\.id$/;
|
|
646
|
-
var PARAM_REFERENCE_PATTERN = /input\[\d+\]\.id/g;
|
|
647
|
-
var MAXIMUM_LENGTH_PATTERN = /maximum length \d+/gi;
|
|
648
|
-
var SIMPLE_ESCAPES = {
|
|
649
|
-
'"': '"',
|
|
650
|
-
"\\": "\\",
|
|
651
|
-
"/": "/",
|
|
652
|
-
b: "\b",
|
|
653
|
-
f: "\f",
|
|
654
|
-
n: "\n",
|
|
655
|
-
r: "\r",
|
|
656
|
-
t: " "
|
|
657
|
-
};
|
|
658
|
-
var REPAIRABLE_CONTROLS = /* @__PURE__ */ new Set(["\n", " ", "\r"]);
|
|
659
|
-
var MAX_BODY_CHARS = 64e3;
|
|
660
|
-
var MAX_OBJECT_CANDIDATES = 32;
|
|
661
|
-
function parseReasoningIdRejection(status, responseBody) {
|
|
662
|
-
if (status !== 400) return void 0;
|
|
663
|
-
try {
|
|
664
|
-
return classify(responseBody);
|
|
665
|
-
} catch {
|
|
666
|
-
return void 0;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
__name(parseReasoningIdRejection, "parseReasoningIdRejection");
|
|
670
|
-
function classify(responseBody) {
|
|
671
|
-
const text = toEnvelopeText(responseBody);
|
|
672
|
-
if (text === void 0) return void 0;
|
|
673
|
-
const envelope = readEnvelope(text, MAX_OBJECT_CANDIDATES, true);
|
|
674
|
-
if (!envelope) return void 0;
|
|
675
|
-
const error = readErrorMember(envelope.value);
|
|
676
|
-
if (!error) return void 0;
|
|
677
|
-
return matchRejection(error) ?? matchQuotedRejection(error, MAX_OBJECT_CANDIDATES - envelope.objects);
|
|
678
|
-
}
|
|
679
|
-
__name(classify, "classify");
|
|
680
|
-
function matchRejection(error) {
|
|
681
|
-
if (error["code"] !== REJECTION_CODE) return void 0;
|
|
682
|
-
const param = error["param"];
|
|
683
|
-
if (typeof param !== "string") return void 0;
|
|
684
|
-
const named = PARAM_PATTERN.exec(param);
|
|
685
|
-
if (!named) return void 0;
|
|
686
|
-
const index = Number(named[1]);
|
|
687
|
-
if (!Number.isSafeInteger(index) || index < 0) return void 0;
|
|
688
|
-
const message = error["message"];
|
|
689
|
-
return {
|
|
690
|
-
namedIndex: index,
|
|
691
|
-
maxLength: extractMaxLength(
|
|
692
|
-
typeof message === "string" ? message : void 0,
|
|
693
|
-
param
|
|
694
|
-
)
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
__name(matchRejection, "matchRejection");
|
|
698
|
-
function matchQuotedRejection(error, budget) {
|
|
699
|
-
const message = error["message"];
|
|
700
|
-
if (typeof message !== "string") return void 0;
|
|
701
|
-
const start = message.indexOf("{");
|
|
702
|
-
if (start < 0) return void 0;
|
|
703
|
-
const quoted = readEnvelope(message.slice(start), budget, false);
|
|
704
|
-
if (!quoted) return void 0;
|
|
705
|
-
const inner = readErrorMember(quoted.value);
|
|
706
|
-
return inner ? matchRejection(inner) : void 0;
|
|
707
|
-
}
|
|
708
|
-
__name(matchQuotedRejection, "matchQuotedRejection");
|
|
709
|
-
function readErrorMember(value) {
|
|
710
|
-
if (!isPlainObject(value)) return void 0;
|
|
711
|
-
const error = value["error"];
|
|
712
|
-
return isPlainObject(error) ? error : void 0;
|
|
713
|
-
}
|
|
714
|
-
__name(readErrorMember, "readErrorMember");
|
|
715
|
-
function isPlainObject(value) {
|
|
716
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
717
|
-
}
|
|
718
|
-
__name(isPlainObject, "isPlainObject");
|
|
719
|
-
function downgradeRejectedReasoningItems(items, rejection) {
|
|
720
|
-
const named = items[rejection.namedIndex];
|
|
721
|
-
if (!isReasoningItem(named)) return items;
|
|
722
|
-
const { maxLength } = rejection;
|
|
723
|
-
if (maxLength !== null && named.id.length <= maxLength) return items;
|
|
724
|
-
const rewritten = [];
|
|
725
|
-
let changed = false;
|
|
726
|
-
for (const item of items) {
|
|
727
|
-
if (!isReasoningItem(item) || !exceedsMax(item, maxLength)) {
|
|
728
|
-
rewritten.push(item);
|
|
729
|
-
continue;
|
|
915
|
+
});
|
|
730
916
|
}
|
|
731
|
-
changed = true;
|
|
732
|
-
const summary = readSummaryTexts(item);
|
|
733
|
-
if (summary.length === 0) continue;
|
|
734
|
-
rewritten.push({
|
|
735
|
-
type: "message",
|
|
736
|
-
role: "assistant",
|
|
737
|
-
content: summary.join("\n")
|
|
738
|
-
});
|
|
739
917
|
}
|
|
740
|
-
return
|
|
741
|
-
}
|
|
742
|
-
__name(downgradeRejectedReasoningItems, "downgradeRejectedReasoningItems");
|
|
743
|
-
function exceedsMax(item, maxLength) {
|
|
744
|
-
return maxLength === null || item.id.length > maxLength;
|
|
745
|
-
}
|
|
746
|
-
__name(exceedsMax, "exceedsMax");
|
|
747
|
-
function isReasoningItem(item) {
|
|
748
|
-
return typeof item === "object" && item !== null && item.type === "reasoning" && typeof item.id === "string";
|
|
918
|
+
return { instructions, input: items };
|
|
749
919
|
}
|
|
750
|
-
__name(
|
|
751
|
-
function
|
|
752
|
-
|
|
753
|
-
const
|
|
754
|
-
for (const
|
|
755
|
-
if (typeof
|
|
756
|
-
|
|
920
|
+
__name(convertGeminiContentsToResponsesInput, "convertGeminiContentsToResponsesInput");
|
|
921
|
+
function cleanOrphanedFunctionCalls(items) {
|
|
922
|
+
const callIds = /* @__PURE__ */ new Set();
|
|
923
|
+
const outputCallIds = /* @__PURE__ */ new Set();
|
|
924
|
+
for (const item of items) {
|
|
925
|
+
if (typeof item !== "object" || item === null || !("type" in item)) {
|
|
926
|
+
continue;
|
|
757
927
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
function extractMaxLength(message, param) {
|
|
763
|
-
if (!message) return null;
|
|
764
|
-
const references = message.match(PARAM_REFERENCE_PATTERN);
|
|
765
|
-
if (!references || references.length !== 1 || references[0] !== param) {
|
|
766
|
-
return null;
|
|
767
|
-
}
|
|
768
|
-
const maxima = message.match(MAXIMUM_LENGTH_PATTERN);
|
|
769
|
-
if (!maxima || maxima.length !== 1) return null;
|
|
770
|
-
const digits = /\d+/.exec(maxima[0]);
|
|
771
|
-
if (!digits) return null;
|
|
772
|
-
const value = Number(digits[0]);
|
|
773
|
-
if (!Number.isSafeInteger(value) || value <= 0) return null;
|
|
774
|
-
return value;
|
|
775
|
-
}
|
|
776
|
-
__name(extractMaxLength, "extractMaxLength");
|
|
777
|
-
function toEnvelopeText(responseBody) {
|
|
778
|
-
let text;
|
|
779
|
-
if (typeof responseBody === "string") {
|
|
780
|
-
text = responseBody;
|
|
781
|
-
} else if (typeof responseBody === "object" && responseBody !== null && !Array.isArray(responseBody)) {
|
|
782
|
-
try {
|
|
783
|
-
text = JSON.stringify(responseBody);
|
|
784
|
-
} catch {
|
|
785
|
-
return void 0;
|
|
928
|
+
if (item.type === "function_call" && "call_id" in item) {
|
|
929
|
+
callIds.add(item.call_id);
|
|
930
|
+
} else if (item.type === "function_call_output" && "call_id" in item) {
|
|
931
|
+
outputCallIds.add(item.call_id);
|
|
786
932
|
}
|
|
787
|
-
if (typeof text !== "string") return void 0;
|
|
788
|
-
} else {
|
|
789
|
-
return void 0;
|
|
790
|
-
}
|
|
791
|
-
if (text.length > MAX_BODY_CHARS) return void 0;
|
|
792
|
-
let start = 0;
|
|
793
|
-
while (start < text.length && isJsonWhitespace(text[start])) start++;
|
|
794
|
-
return text[start] === "{" ? text.slice(start) : void 0;
|
|
795
|
-
}
|
|
796
|
-
__name(toEnvelopeText, "toEnvelopeText");
|
|
797
|
-
function readEnvelope(text, budget, repairErrorMessage) {
|
|
798
|
-
const normalized = normalizeEnvelope(text, budget, repairErrorMessage);
|
|
799
|
-
if (!normalized) return void 0;
|
|
800
|
-
try {
|
|
801
|
-
return { value: JSON.parse(normalized.json), objects: normalized.objects };
|
|
802
|
-
} catch {
|
|
803
|
-
return void 0;
|
|
804
933
|
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
let closed = false;
|
|
812
|
-
let i = 0;
|
|
813
|
-
while (i < text.length) {
|
|
814
|
-
const ch = text[i];
|
|
815
|
-
if (closed) {
|
|
816
|
-
if (!isJsonWhitespace(ch)) return void 0;
|
|
817
|
-
i++;
|
|
934
|
+
const isReasoning = /* @__PURE__ */ __name((item) => typeof item === "object" && item !== null && "type" in item && item.type === "reasoning", "isReasoning");
|
|
935
|
+
const kept = [];
|
|
936
|
+
for (let i = 0; i < items.length; i++) {
|
|
937
|
+
const item = items[i];
|
|
938
|
+
if (typeof item !== "object" || item === null || !("type" in item)) {
|
|
939
|
+
kept.push(item);
|
|
818
940
|
continue;
|
|
819
941
|
}
|
|
820
|
-
if (
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
const repairable = repairErrorMessage && top?.object === true && !atKey && top.recognizedError && top.key === "message";
|
|
824
|
-
const literal = readStringLiteral(text, i, repairable);
|
|
825
|
-
if (!literal) return void 0;
|
|
826
|
-
if (top?.object && top.atKey) {
|
|
827
|
-
if (top.keys.has(literal.value)) return void 0;
|
|
828
|
-
top.keys.add(literal.value);
|
|
829
|
-
top.atKey = false;
|
|
830
|
-
top.key = literal.value;
|
|
942
|
+
if (item.type === "function_call" && "call_id" in item) {
|
|
943
|
+
if (outputCallIds.has(item.call_id)) {
|
|
944
|
+
kept.push(item);
|
|
831
945
|
}
|
|
832
|
-
out.push(literal.json);
|
|
833
|
-
i = literal.next;
|
|
834
946
|
continue;
|
|
835
947
|
}
|
|
836
|
-
if (
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
const parent = stack[stack.length - 1];
|
|
840
|
-
stack.push({
|
|
841
|
-
object,
|
|
842
|
-
keys: /* @__PURE__ */ new Set(),
|
|
843
|
-
recognizedError: object && stack.length === 1 && parent?.object === true && parent.key === "error",
|
|
844
|
-
atKey: object,
|
|
845
|
-
key: void 0
|
|
846
|
-
});
|
|
847
|
-
} else if (ch === "}" || ch === "]") {
|
|
848
|
-
const top = stack.pop();
|
|
849
|
-
if (!top || top.object !== (ch === "}")) return void 0;
|
|
850
|
-
if (stack.length === 0) closed = true;
|
|
851
|
-
} else if (ch === ",") {
|
|
852
|
-
const top = stack[stack.length - 1];
|
|
853
|
-
if (top?.object) {
|
|
854
|
-
top.atKey = true;
|
|
855
|
-
top.key = void 0;
|
|
948
|
+
if (item.type === "function_call_output" && "call_id" in item) {
|
|
949
|
+
if (callIds.has(item.call_id)) {
|
|
950
|
+
kept.push(item);
|
|
856
951
|
}
|
|
952
|
+
continue;
|
|
857
953
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
return { json: out.join(""), objects };
|
|
863
|
-
}
|
|
864
|
-
__name(normalizeEnvelope, "normalizeEnvelope");
|
|
865
|
-
function isJsonWhitespace(ch) {
|
|
866
|
-
return ch === " " || ch === " " || ch === "\n" || ch === "\r";
|
|
867
|
-
}
|
|
868
|
-
__name(isJsonWhitespace, "isJsonWhitespace");
|
|
869
|
-
function readStringLiteral(text, start, repairable) {
|
|
870
|
-
let value = "";
|
|
871
|
-
let json = '"';
|
|
872
|
-
let i = start + 1;
|
|
873
|
-
while (i < text.length) {
|
|
874
|
-
const ch = text[i];
|
|
875
|
-
if (ch === '"') return { value, json: `${json}"`, next: i + 1 };
|
|
876
|
-
if (ch === "\\") {
|
|
877
|
-
const escape = text[i + 1];
|
|
878
|
-
if (escape === "u") {
|
|
879
|
-
const hex = text.slice(i + 2, i + 6);
|
|
880
|
-
if (!/^[0-9a-fA-F]{4}$/.test(hex)) return void 0;
|
|
881
|
-
value += String.fromCharCode(parseInt(hex, 16));
|
|
882
|
-
json += text.slice(i, i + 6);
|
|
883
|
-
i += 6;
|
|
954
|
+
if (item.type === "reasoning") {
|
|
955
|
+
const unitCallIds = followingCallGroup(items, i);
|
|
956
|
+
if (unitCallIds.length > 0 && !unitCallIds.some((callId) => outputCallIds.has(callId))) {
|
|
957
|
+
while (isReasoning(kept[kept.length - 1])) kept.pop();
|
|
884
958
|
continue;
|
|
885
959
|
}
|
|
886
|
-
const simple = escape === void 0 ? void 0 : SIMPLE_ESCAPES[escape];
|
|
887
|
-
if (simple === void 0) return void 0;
|
|
888
|
-
value += simple;
|
|
889
|
-
json += `\\${escape}`;
|
|
890
|
-
i += 2;
|
|
891
|
-
continue;
|
|
892
|
-
}
|
|
893
|
-
const code = ch.charCodeAt(0);
|
|
894
|
-
if (code < 32) {
|
|
895
|
-
if (!repairable || !REPAIRABLE_CONTROLS.has(ch)) return void 0;
|
|
896
|
-
value += ch;
|
|
897
|
-
json += `\\u${code.toString(16).padStart(4, "0")}`;
|
|
898
|
-
i++;
|
|
899
|
-
continue;
|
|
900
960
|
}
|
|
901
|
-
|
|
902
|
-
json += ch;
|
|
903
|
-
i++;
|
|
961
|
+
kept.push(item);
|
|
904
962
|
}
|
|
905
|
-
return
|
|
963
|
+
return kept;
|
|
906
964
|
}
|
|
907
|
-
__name(
|
|
908
|
-
function
|
|
909
|
-
|
|
965
|
+
__name(cleanOrphanedFunctionCalls, "cleanOrphanedFunctionCalls");
|
|
966
|
+
function convertGeminiToolsToResponsesTools(request) {
|
|
967
|
+
const tools = request.config?.tools;
|
|
968
|
+
if (!tools || !Array.isArray(tools)) return void 0;
|
|
969
|
+
const result = [];
|
|
970
|
+
for (const tool of tools) {
|
|
971
|
+
if (typeof tool !== "object" || tool === null) continue;
|
|
972
|
+
const funcDecls = "functionDeclarations" in tool ? tool.functionDeclarations : void 0;
|
|
973
|
+
if (!Array.isArray(funcDecls)) continue;
|
|
974
|
+
for (const func of funcDecls) {
|
|
975
|
+
if (!func.name) continue;
|
|
976
|
+
result.push({
|
|
977
|
+
type: "function",
|
|
978
|
+
name: func.name,
|
|
979
|
+
description: func.description,
|
|
980
|
+
parameters: normalizeResponsesParameters(
|
|
981
|
+
// Prefer parametersJsonSchema (raw JSON Schema, e.g. MCP/extension
|
|
982
|
+
// tools) and fall back to parameters, matching the Chat and
|
|
983
|
+
// Anthropic sibling wires — @google/genai allows both fields at
|
|
984
|
+
// once, and preferring `parameters` here would send a different,
|
|
985
|
+
// potentially lossier schema than the siblings for identical config.
|
|
986
|
+
func.parametersJsonSchema ?? func.parameters
|
|
987
|
+
)
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
return result.length > 0 ? result : void 0;
|
|
910
992
|
}
|
|
911
|
-
__name(
|
|
912
|
-
function
|
|
913
|
-
if (
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
const envelope = readEnvelope(text, MAX_OBJECT_CANDIDATES, false);
|
|
917
|
-
if (!envelope || !isPlainObject(envelope.value)) return false;
|
|
918
|
-
const direct = readErrorMember(envelope.value);
|
|
919
|
-
return direct?.["code"] === "invalid_encrypted_content";
|
|
993
|
+
__name(convertGeminiToolsToResponsesTools, "convertGeminiToolsToResponsesTools");
|
|
994
|
+
function normalizeResponsesParameters(schema) {
|
|
995
|
+
if (schema === void 0) return void 0;
|
|
996
|
+
if (schema === null || typeof schema !== "object") return schema;
|
|
997
|
+
return normalizeResponsesSchemaNode(schema);
|
|
920
998
|
}
|
|
921
|
-
__name(
|
|
922
|
-
function
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
999
|
+
__name(normalizeResponsesParameters, "normalizeResponsesParameters");
|
|
1000
|
+
function normalizeResponsesSchemaNode(node) {
|
|
1001
|
+
if (Array.isArray(node)) {
|
|
1002
|
+
return node.map((item) => normalizeResponsesSchemaNode(item));
|
|
1003
|
+
}
|
|
1004
|
+
if (!node || typeof node !== "object") return node;
|
|
1005
|
+
const out = {
|
|
1006
|
+
...node
|
|
1007
|
+
};
|
|
1008
|
+
if (out["properties"] && typeof out["properties"] === "object") {
|
|
1009
|
+
const props = out["properties"];
|
|
1010
|
+
const nextProps = {};
|
|
1011
|
+
for (const [k, v] of Object.entries(props)) {
|
|
1012
|
+
nextProps[k] = normalizeResponsesSchemaNode(v);
|
|
1013
|
+
}
|
|
1014
|
+
out["properties"] = nextProps;
|
|
1015
|
+
}
|
|
1016
|
+
if (out["items"]) {
|
|
1017
|
+
out["items"] = normalizeResponsesSchemaNode(out["items"]);
|
|
1018
|
+
}
|
|
1019
|
+
for (const key of ["anyOf", "oneOf", "allOf"]) {
|
|
1020
|
+
const v = out[key];
|
|
1021
|
+
if (Array.isArray(v)) {
|
|
1022
|
+
out[key] = v.map((item) => normalizeResponsesSchemaNode(item));
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
if (out["type"] === "object" && out["properties"] === void 0) {
|
|
1026
|
+
out["properties"] = {};
|
|
1027
|
+
}
|
|
1028
|
+
return out;
|
|
927
1029
|
}
|
|
928
|
-
__name(
|
|
1030
|
+
__name(normalizeResponsesSchemaNode, "normalizeResponsesSchemaNode");
|
|
929
1031
|
|
|
930
1032
|
// packages/core/src/core/openaiResponsesContentGenerator/responses-pipeline.ts
|
|
931
1033
|
import { createHash } from "node:crypto";
|
|
932
|
-
var
|
|
1034
|
+
var debugLogger3 = createDebugLogger("RESPONSES_PIPELINE");
|
|
933
1035
|
var StreamInactivityTimeoutError = class extends Error {
|
|
934
1036
|
constructor(idleMs, chunksReceived) {
|
|
935
1037
|
super(
|
|
@@ -1114,7 +1216,7 @@ var ResponsesPipeline = class {
|
|
|
1114
1216
|
const input = rejection ? downgradeRejectedReasoningItems(apiRequest.input, rejection) : encryptedRejected ? downgradeEncryptedReasoningItems(apiRequest.input) : apiRequest.input;
|
|
1115
1217
|
if (input === apiRequest.input) return void 0;
|
|
1116
1218
|
const reasoningItems = countReasoningItems(apiRequest.input);
|
|
1117
|
-
|
|
1219
|
+
debugLogger3.debug(
|
|
1118
1220
|
"Retrying once with downgraded reasoning replay",
|
|
1119
1221
|
`namedIndex=${rejection?.namedIndex ?? "all"}`,
|
|
1120
1222
|
`maxLengthReported=${rejection?.maxLength != null}`,
|
|
@@ -1281,7 +1383,7 @@ var ResponsesPipeline = class {
|
|
|
1281
1383
|
}
|
|
1282
1384
|
}
|
|
1283
1385
|
const body = JSON.stringify(apiRequest);
|
|
1284
|
-
|
|
1386
|
+
debugLogger3.debug(
|
|
1285
1387
|
`POST ${redactProxyCredentials(url)}`,
|
|
1286
1388
|
`bodyBytes=${body.length}`,
|
|
1287
1389
|
`inputItems=${summarizeInputItemTypes(apiRequest.input)}`
|
|
@@ -1557,7 +1659,7 @@ var ResponsesPipeline = class {
|
|
|
1557
1659
|
return convertParsedFrame(eventType, data);
|
|
1558
1660
|
} catch (err) {
|
|
1559
1661
|
if (err instanceof SyntaxError) {
|
|
1560
|
-
|
|
1662
|
+
debugLogger3.debug(
|
|
1561
1663
|
`Failed to parse SSE data: ${dataStr.substring(0, 200)}`
|
|
1562
1664
|
);
|
|
1563
1665
|
return null;
|
|
@@ -1600,7 +1702,7 @@ var ResponsesPipeline = class {
|
|
|
1600
1702
|
}
|
|
1601
1703
|
} catch (err) {
|
|
1602
1704
|
if (err instanceof SyntaxError) {
|
|
1603
|
-
|
|
1705
|
+
debugLogger3.debug(
|
|
1604
1706
|
`Failed to parse SSE data: ${dataContent.substring(0, 200)}`
|
|
1605
1707
|
);
|
|
1606
1708
|
} else {
|
|
@@ -1640,7 +1742,7 @@ var ResponsesPipeline = class {
|
|
|
1640
1742
|
}
|
|
1641
1743
|
} catch (err) {
|
|
1642
1744
|
if (err instanceof SyntaxError) {
|
|
1643
|
-
|
|
1745
|
+
debugLogger3.debug(
|
|
1644
1746
|
`Failed to parse SSE data: ${dataContent.substring(0, 200)}`
|
|
1645
1747
|
);
|
|
1646
1748
|
} else {
|
|
@@ -1710,7 +1812,7 @@ function mergeStreamResponses(chunks) {
|
|
|
1710
1812
|
__name(mergeStreamResponses, "mergeStreamResponses");
|
|
1711
1813
|
|
|
1712
1814
|
// packages/core/src/core/openaiResponsesContentGenerator/index.ts
|
|
1713
|
-
var
|
|
1815
|
+
var debugLogger4 = createDebugLogger("RESPONSES");
|
|
1714
1816
|
var OpenAIResponsesContentGenerator = class {
|
|
1715
1817
|
static {
|
|
1716
1818
|
__name(this, "OpenAIResponsesContentGenerator");
|
|
@@ -1784,7 +1886,7 @@ var OpenAIResponsesContentGenerator = class {
|
|
|
1784
1886
|
};
|
|
1785
1887
|
} catch (error) {
|
|
1786
1888
|
const redactedError = redactProxyError(error);
|
|
1787
|
-
|
|
1889
|
+
debugLogger4.error("Embedding error:", redactedError);
|
|
1788
1890
|
throw new Error(
|
|
1789
1891
|
`Embedding error: ${redactedError instanceof Error ? redactedError.message : String(redactedError)}`
|
|
1790
1892
|
);
|