nolo-cli 0.251.0-alpha.1 → 0.252.0-alpha.1

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.
Files changed (165) hide show
  1. package/{_executeModel-55PHWQWB.js → _executeModel-D6G3B45S.js} +44 -44
  2. package/{action-WZTKEF5H.js → action-QQOQ2LP3.js} +3 -3
  3. package/{addContentAction-LBVAQUF7.js → addContentAction-MB22YIDV.js} +6 -6
  4. package/{addDialogAgentAction-6WAUSUSZ.js → addDialogAgentAction-KNTBVVGY.js} +5 -5
  5. package/{agentDeleteCommand-KEO3KDK3.js → agentDeleteCommand-YCWDGJSF.js} +66 -65
  6. package/{agentEmailCommands-RWJQQRNT.js → agentEmailCommands-DTWD5FWC.js} +66 -65
  7. package/{agentListCommands-L3TLPLNH.js → agentListCommands-JTOONLYL.js} +224 -37
  8. package/{agentMachineCommands-EZWWXWDH.js → agentMachineCommands-25X7OTLQ.js} +29 -27
  9. package/{agentProviderCommands-C5T7C5KZ.js → agentProviderCommands-QLTABYR7.js} +2 -2
  10. package/{agentRecordCommands-7W2CGHJJ.js → agentRecordCommands-SXE3WV2X.js} +65 -64
  11. package/{agentRunCommand-POL6B6BO.js → agentRunCommand-QSIED54S.js} +65 -64
  12. package/{agentRunControl-FKSXBUAF.js → agentRunControl-KNNDEEDI.js} +8 -6
  13. package/{agentRuntimeLocal-WSHWNIMF.js → agentRuntimeLocal-HVJJMB4W.js} +24 -23
  14. package/{agentSlice-3G2YLTA4.js → agentSlice-NBUJJVRI.js} +6 -6
  15. package/{appDeleteCommands-DZZQCVYH.js → appDeleteCommands-YU6TT6VN.js} +31 -29
  16. package/{appDeployCommands-NJJBVNH5.js → appDeployCommands-4DEIX7YP.js} +31 -29
  17. package/{appDeployStatusCommands-GBOAFEYG.js → appDeployStatusCommands-3VKS6GBQ.js} +31 -29
  18. package/{appGetCommands-GOOKYMKO.js → appGetCommands-22FNNROT.js} +31 -29
  19. package/{appListCommands-OBCGUG3S.js → appListCommands-FVGMLHVU.js} +31 -29
  20. package/{authCommand-77CRN332.js → authCommand-5DC3ES4Q.js} +12 -12
  21. package/{chromeOpsCommands-6RLEBBJJ.js → chromeOpsCommands-AA555ANS.js} +1 -1
  22. package/{chunk-MAA42MMV.js → chunk-2FZVXOFX.js} +4 -4
  23. package/chunk-2GAUJDA5.js +594 -0
  24. package/{chunk-ESN4WNWU.js → chunk-2JHGUL5K.js} +2 -2
  25. package/{chunk-222CJNC2.js → chunk-2LANL4B5.js} +3 -3
  26. package/{chunk-PKMDYRAM.js → chunk-2PB653F5.js} +171 -237
  27. package/{chunk-GMWZRXRM.js → chunk-3272HU62.js} +1 -1
  28. package/{chunk-3ZWJVKFB.js → chunk-3N3JPQBQ.js} +82 -38
  29. package/{chunk-LXKK7QFI.js → chunk-4HAOOY6G.js} +53 -23
  30. package/{chunk-ZQ6K57FJ.js → chunk-4YPH5KRA.js} +1 -1
  31. package/{chunk-T4V6C3J3.js → chunk-52M4RYVP.js} +1 -1
  32. package/{chunk-6UNJ6JGR.js → chunk-5IN2NBDX.js} +4 -4
  33. package/{chunk-OQCAHPDQ.js → chunk-5QEOTC35.js} +4 -4
  34. package/{chunk-R7D5SRAZ.js → chunk-5UYDG6HP.js} +17 -0
  35. package/{chunk-Z7A2ZQ5X.js → chunk-64ACTEAE.js} +1 -1
  36. package/{chunk-CTWCZKNS.js → chunk-6SOWMEAY.js} +4 -4
  37. package/{chunk-UCMUXZJV.js → chunk-7XO73H5X.js} +111 -1
  38. package/{chunk-N3SEV3CG.js → chunk-7ZOVFB2H.js} +79 -30
  39. package/{chunk-UR4ZMRV3.js → chunk-A5F6DYP2.js} +1 -1
  40. package/{chunk-FAFDIQJG.js → chunk-A6VIMCWI.js} +3 -3
  41. package/{chunk-SX6AWTNK.js → chunk-BZLGPM5B.js} +3 -3
  42. package/{chunk-LTVEOOZL.js → chunk-CIAV4WK2.js} +14 -1
  43. package/{chunk-IFJ6OTI6.js → chunk-CO2NXG2J.js} +32 -10
  44. package/{chunk-D3E5MYXO.js → chunk-CYGFNMCH.js} +1 -1
  45. package/{chunk-MZVCFV3T.js → chunk-D3WOFN6N.js} +3 -3
  46. package/{chunk-VUHKG4KS.js → chunk-DNNPARJK.js} +9 -5
  47. package/{chunk-PLS2MJVW.js → chunk-DU3DJYVA.js} +4 -4
  48. package/{chunk-MTS5DCL2.js → chunk-EG3JTV7H.js} +2 -2
  49. package/{chunk-6ASGEP5D.js → chunk-EJQE5HB7.js} +1 -1
  50. package/{chunk-CD64YXRB.js → chunk-F6Q64KRV.js} +1 -1
  51. package/{chunk-L5HV76QT.js → chunk-FRC2DNTN.js} +1 -1
  52. package/{chunk-W3HSD32M.js → chunk-FXEPZKNJ.js} +2 -2
  53. package/{chunk-D35TOEMM.js → chunk-FZI2P64R.js} +137 -53
  54. package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
  55. package/{chunk-CUYFRVJF.js → chunk-GO7UC5VH.js} +5 -5
  56. package/{chunk-KZVRPCOR.js → chunk-GVH2IP2M.js} +4 -4
  57. package/{chunk-KGOBJAWC.js → chunk-GWS2X7TX.js} +206 -93
  58. package/{chunk-KHVTT4WW.js → chunk-HF4C5WIU.js} +81 -542
  59. package/{chunk-Q5KZ6F55.js → chunk-HMREADP6.js} +19 -17
  60. package/{chunk-X337N4D6.js → chunk-ITCOQAHS.js} +3 -3
  61. package/{chunk-BQ4CZEVZ.js → chunk-ITMBFT35.js} +1 -1
  62. package/chunk-IVK2KT3H.js +209 -0
  63. package/{chunk-IXAGRTAR.js → chunk-JAYPSNGR.js} +1 -1
  64. package/{chunk-LOXR4TQN.js → chunk-JF5QT3YY.js} +2 -2
  65. package/{chunk-QLGL43SI.js → chunk-JKALGWDL.js} +2 -2
  66. package/{chunk-PQ63BDV3.js → chunk-JPXACKSW.js} +9 -1
  67. package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
  68. package/{chunk-3KWJPTVP.js → chunk-LAQC5FAP.js} +4 -4
  69. package/{chunk-NTNX77FI.js → chunk-LNIA5JVX.js} +6 -6
  70. package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
  71. package/{chunk-K26XPZRB.js → chunk-LVZVSLKO.js} +29 -9
  72. package/{chunk-ZSRR6HCH.js → chunk-N2ZAY2DK.js} +1 -1
  73. package/{chunk-MTM4LRVG.js → chunk-NNUIVAC2.js} +1 -1
  74. package/{chunk-HD5EKSLF.js → chunk-NPUHKEOB.js} +2 -2
  75. package/{chunk-OARYOLF3.js → chunk-O6LPLIRS.js} +11 -11
  76. package/{chunk-HQLCYPL4.js → chunk-OB4FBZXJ.js} +4 -4
  77. package/{chunk-CD2DK5JA.js → chunk-OKH74FML.js} +2 -1
  78. package/{chunk-IZWGO2ZS.js → chunk-OMIXG25B.js} +1 -1
  79. package/{chunk-CJ2BP6V7.js → chunk-OOV5JN25.js} +2 -2
  80. package/{chunk-AS6L5KSD.js → chunk-P4R5KXU7.js} +2 -2
  81. package/{chunk-K5CIMK3R.js → chunk-P6HMEKLL.js} +114 -56
  82. package/{chunk-VTHWBTRE.js → chunk-PENRYZ4D.js} +1 -1
  83. package/{chunk-WZPG63Q4.js → chunk-PIVTQRX6.js} +43 -13
  84. package/{chunk-KJDN2YRH.js → chunk-QMKWSKWA.js} +4 -4
  85. package/{chunk-XC5RPSXK.js → chunk-QV32GSVO.js} +2 -2
  86. package/{chunk-XJSEST7D.js → chunk-SMCKJJXI.js} +2 -2
  87. package/{chunk-KRAPKTAS.js → chunk-SMZFWEMX.js} +1 -1
  88. package/{chunk-43VT5PLM.js → chunk-T4VVQHSE.js} +1 -1
  89. package/{chunk-W2N4OAKM.js → chunk-TDI7ARZO.js} +3 -3
  90. package/{chunk-TGKAUEV3.js → chunk-TDLZA6LJ.js} +13 -10
  91. package/{chunk-LMMRWGGJ.js → chunk-TTUIM3PJ.js} +2 -2
  92. package/{chunk-5IKKSJYX.js → chunk-TTWNTFTO.js} +35 -2
  93. package/{chunk-ZM5AZTQG.js → chunk-U7BP25PE.js} +18 -6
  94. package/{chunk-X3OZ655T.js → chunk-UI3Z3HDK.js} +1 -1
  95. package/{chunk-GX6DITLQ.js → chunk-UUCYUN6Y.js} +1 -1
  96. package/{chunk-U2OWDHDE.js → chunk-VH7AQEEF.js} +2 -2
  97. package/{chunk-ZKKJZBNO.js → chunk-WAOHK3NJ.js} +9 -9
  98. package/{chunk-2FK2KZSL.js → chunk-WLHUANWZ.js} +1 -1
  99. package/{chunk-JUYI2D7J.js → chunk-WNIBQBOR.js} +1 -1
  100. package/{chunk-SLUZ6FBJ.js → chunk-XBCADGK2.js} +1 -1
  101. package/{chunk-6XVPMGXK.js → chunk-YB5D2GK4.js} +9 -3
  102. package/{chunk-QJ5YDTEF.js → chunk-YQYYYATY.js} +42 -24
  103. package/{chunk-WQDTSK5U.js → chunk-ZMFA2TLE.js} +1 -1
  104. package/{chunk-CFDOIIOZ.js → chunk-ZMXO5G3E.js} +29 -23
  105. package/{chunk-A55E2OCP.js → chunk-ZNOXY73P.js} +632 -124
  106. package/{cliAgentConfigHelpers-N6LTB7UY.js → cliAgentConfigHelpers-FKBPFPKR.js} +6 -6
  107. package/{cliLocalAgentRecordReader-NFNGYOOW.js → cliLocalAgentRecordReader-DWU3LBO2.js} +28 -27
  108. package/{commandRegistry-OM5DU4DS.js → commandRegistry-7FVATZS2.js} +70 -70
  109. package/{contentThunks-7URM43ET.js → contentThunks-25XCB7VY.js} +18 -18
  110. package/{cooldownCommands-JEEV75B7.js → cooldownCommands-PT5L4LNB.js} +3 -3
  111. package/{createAgentAutomationAction-GGEXIKMC.js → createAgentAutomationAction-FC5RI2LW.js} +18 -18
  112. package/{createDialogAction-IXXEMFRQ.js → createDialogAction-IL3ISSQQ.js} +19 -19
  113. package/{createPageAction-IXIVLIOO.js → createPageAction-RVYBEYZV.js} +19 -19
  114. package/{db-J5KE7XRI.js → db-JMGVD4TB.js} +2 -1
  115. package/{dbSlice-IE4ADINL.js → dbSlice-WG3ZG6PZ.js} +5 -5
  116. package/{deleteFile-ZCQESEEQ.js → deleteFile-4TIG54YN.js} +3 -3
  117. package/{dialogCommands-RPBHOZB6.js → dialogCommands-VUJISJZF.js} +33 -31
  118. package/{dialogNotifyCommand-ECKI5MMA.js → dialogNotifyCommand-JKYVSR6K.js} +7 -7
  119. package/{dialogSlice-5FQB2TNN.js → dialogSlice-UMP55UAW.js} +16 -16
  120. package/{docCreateCommands-XJ2X57DW.js → docCreateCommands-S46F6GKP.js} +30 -28
  121. package/{docDeleteCommands-45WGFFEB.js → docDeleteCommands-LJG4NK6J.js} +31 -29
  122. package/{docReadCommands-LRRVDS46.js → docReadCommands-YPAYGHNM.js} +30 -28
  123. package/{docStore-SUAVM24F.js → docStore-VK3MVJ5Q.js} +6 -6
  124. package/{docUpdateCommands-QUYX6BVR.js → docUpdateCommands-MPTM6267.js} +30 -28
  125. package/{getPricing-FCHYVRJU.js → getPricing-5BLZRPTM.js} +3 -3
  126. package/{handleSendMessageAction-FDIWBQUB.js → handleSendMessageAction-VPKVNKBU.js} +33 -33
  127. package/{hostCredentialCreate-CEXQHYT4.js → hostCredentialCreate-K56HWPNY.js} +65 -64
  128. package/index.js +8 -8
  129. package/{localDialogRead-USDZXKIL.js → localDialogRead-NXILOV3T.js} +1 -1
  130. package/{localRuntimeAdapter-O3JBRK6S.js → localRuntimeAdapter-KVU72FWT.js} +64 -63
  131. package/{machineCommands-I3YA7TNC.js → machineCommands-C3O5RKNJ.js} +65 -64
  132. package/{machineWsRunDispatch-E5CIE2OJ.js → machineWsRunDispatch-ZLART7ZA.js} +65 -64
  133. package/{mcpLocalAuthorizeCommand-K5J2VMG6.js → mcpLocalAuthorizeCommand-LO7E4VQ5.js} +6 -6
  134. package/{memberThunks-T7EAZE6A.js → memberThunks-7DNR6DRD.js} +7 -7
  135. package/{models-EP7VG6N2.js → models-ZX2BYIMB.js} +2 -2
  136. package/package.json +1 -1
  137. package/{projectArchive-A7E65AZO.js → projectArchive-UBJFYRL7.js} +19 -19
  138. package/{providerPresetApply-4H7YP5D7.js → providerPresetApply-NTJUINI6.js} +35 -16
  139. package/{providerRegistry-F3UPOTIY.js → providerRegistry-W45SLUV6.js} +5 -5
  140. package/{read-BRZHXUJ6.js → read-Z2JOK6F6.js} +3 -3
  141. package/{readDocTool-N7RVFQEE.js → readDocTool-3QYSVWBT.js} +1 -1
  142. package/{readlineWorkspace-2O65NBFG.js → readlineWorkspace-TSIYF7C6.js} +610 -206
  143. package/{removeDialogAgentAction-GRT72HLK.js → removeDialogAgentAction-LRKDU4RI.js} +7 -7
  144. package/{runAgentClientLoop-NWCZIXCG.js → runAgentClientLoop-YAHGOWXN.js} +41 -41
  145. package/{runtimeDoctorCommands-26HYHFTK.js → runtimeDoctorCommands-QGZSKNSE.js} +5 -5
  146. package/{secretCommands-XR72SHLK.js → secretCommands-BXAQEOES.js} +2 -2
  147. package/{setDialogExtraReferencesAction-CBG3X46B.js → setDialogExtraReferencesAction-KIITOCFP.js} +6 -6
  148. package/{setPrimaryDialogAgentAction-EWTDZOAX.js → setPrimaryDialogAgentAction-Y36PKFFB.js} +7 -7
  149. package/{settingThunks-X4PT66J2.js → settingThunks-YQNG5L6K.js} +5 -5
  150. package/{spaceCommands-EVSNTGRS.js → spaceCommands-P644AAZZ.js} +29 -27
  151. package/{streamAgentChatTurn-SYP3OEM5.js → streamAgentChatTurn-5CSYAUAY.js} +54 -50
  152. package/{switchDialogAgentAction-YHPZ7K6E.js → switchDialogAgentAction-U2VLPPVO.js} +5 -5
  153. package/{tools-2AO2SK4L.js → tools-UZ3CDIR2.js} +34 -34
  154. package/{tuiRestart-HBQDF4AE.js → tuiRestart-GF4DGAAN.js} +7 -7
  155. package/{tuiSummaryLlmCaller-Q2PNR63K.js → tuiSummaryLlmCaller-HROLGN4F.js} +12 -12
  156. package/{updateCommands-6SI7NWVC.js → updateCommands-BZ4YDHNM.js} +3 -3
  157. package/{updateDialogTitleAction-MWVMBIPZ.js → updateDialogTitleAction-53XCCDK2.js} +18 -18
  158. package/{usageCommand-D44AOTMH.js → usageCommand-XVJ7ZUTM.js} +1 -1
  159. package/{usageRebuildCommand-IRIMKDI5.js → usageRebuildCommand-NK6S3D4J.js} +2 -2
  160. package/{windowsSelfUpdate-BJIJKKIS.js → windowsSelfUpdate-4BAXX7C3.js} +2 -2
  161. package/{workloadLifecycle-ZCSQCHG3.js → workloadLifecycle-DYX5ZMAT.js} +2 -2
  162. package/chunk-FGHEF6WI.js +0 -34
  163. package/{chunk-ANUP75N2.js → chunk-2E4BYAUE.js} +0 -0
  164. package/{chunk-CDIRKCPD.js → chunk-6HL6E7ZD.js} +152 -152
  165. package/{dialogUsageCommand-TBIA2QAF.js → dialogUsageCommand-IHAXS7DW.js} +3 -3
@@ -3,29 +3,29 @@ import {
3
3
  mergeReferences,
4
4
  resolveReferenceAssets,
5
5
  resolveToolsFromKeys
6
- } from "./chunk-CUYFRVJF.js";
6
+ } from "./chunk-GO7UC5VH.js";
7
7
  import {
8
8
  UI_CARD_ENVELOPE_MAX_BYTES,
9
9
  getAllToolRuns,
10
10
  parseUiCard,
11
11
  uiCardFallback
12
- } from "./chunk-ZKKJZBNO.js";
12
+ } from "./chunk-WAOHK3NJ.js";
13
13
  import {
14
14
  getDocState
15
- } from "./chunk-FAFDIQJG.js";
15
+ } from "./chunk-A6VIMCWI.js";
16
16
  import {
17
17
  getTableState
18
- } from "./chunk-TGKAUEV3.js";
18
+ } from "./chunk-TDLZA6LJ.js";
19
19
  import {
20
20
  selectAllMsgs
21
- } from "./chunk-A55E2OCP.js";
21
+ } from "./chunk-ZNOXY73P.js";
22
22
  import {
23
23
  getCurrentSpaceIdRaw,
24
24
  getViewMode
25
- } from "./chunk-IXAGRTAR.js";
25
+ } from "./chunk-JAYPSNGR.js";
26
26
  import {
27
27
  selectById
28
- } from "./chunk-IFJ6OTI6.js";
28
+ } from "./chunk-CO2NXG2J.js";
29
29
  import {
30
30
  resolveToolBaseUrl
31
31
  } from "./chunk-KQHEGELM.js";
@@ -41,12 +41,12 @@ import {
41
41
  projectToolMessageContent,
42
42
  resolveAgentRecommendedSkillNames,
43
43
  resolveAgentRequiredPackIds
44
- } from "./chunk-CDIRKCPD.js";
44
+ } from "./chunk-6HL6E7ZD.js";
45
45
  import {
46
46
  attachmentKind,
47
47
  extractReferenceKeysFromMessage,
48
48
  normalizeAttachmentPart
49
- } from "./chunk-LTVEOOZL.js";
49
+ } from "./chunk-CIAV4WK2.js";
50
50
  import {
51
51
  asRecordOrEmpty
52
52
  } from "./chunk-KX6YBIHG.js";
@@ -82,7 +82,7 @@ import {
82
82
  getModelPricing,
83
83
  getPrices,
84
84
  hasExplicitAgentPricing
85
- } from "./chunk-AS6L5KSD.js";
85
+ } from "./chunk-P4R5KXU7.js";
86
86
  import {
87
87
  asTrimmedString
88
88
  } from "./chunk-3EUW3WEO.js";
@@ -92,7 +92,7 @@ import {
92
92
  import {
93
93
  getModelConfig,
94
94
  getProviderByModelName
95
- } from "./chunk-CD2DK5JA.js";
95
+ } from "./chunk-OKH74FML.js";
96
96
  import {
97
97
  isRecord
98
98
  } from "./chunk-KUG52IAP.js";
@@ -10,7 +10,7 @@ import {
10
10
  canUsePlatformChatProvider,
11
11
  parsePlatformChatCompletionResponse,
12
12
  resolvePlatformChatProviderConfig
13
- } from "./chunk-WZPG63Q4.js";
13
+ } from "./chunk-PIVTQRX6.js";
14
14
  import {
15
15
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
16
16
  classifySummaryError,
@@ -18,7 +18,7 @@ import {
18
18
  isTruncatedCompletion,
19
19
  selectSummaryRoute,
20
20
  summaryCompletionTokens
21
- } from "./chunk-MAA42MMV.js";
21
+ } from "./chunk-2FZVXOFX.js";
22
22
  import {
23
23
  isAbortError
24
24
  } from "./chunk-7DPNBQSV.js";
@@ -28,10 +28,10 @@ import {
28
28
  import {
29
29
  resolvePlatformAuthToken,
30
30
  resolvePlatformServerUrl
31
- } from "./chunk-K26XPZRB.js";
31
+ } from "./chunk-LVZVSLKO.js";
32
32
  import {
33
33
  PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL
34
- } from "./chunk-PQ63BDV3.js";
34
+ } from "./chunk-JPXACKSW.js";
35
35
 
36
36
  // packages/core/accountSession/fetchAccountProfile.ts
37
37
  async function fetchAccountProfile(input) {
@@ -12,7 +12,7 @@ import {
12
12
  resolvePlatformEffectiveModel,
13
13
  toCnyCredits,
14
14
  zaiModels
15
- } from "./chunk-PQ63BDV3.js";
15
+ } from "./chunk-JPXACKSW.js";
16
16
 
17
17
  // packages/integrations/qwen/models.ts
18
18
  var qwenModels = [
@@ -3732,6 +3732,7 @@ export {
3732
3732
  commandCodeModels,
3733
3733
  opencodeGoModels,
3734
3734
  DEFAULT_REASONING_EFFORT,
3735
+ REASONING_EFFORT_OPTIONS,
3735
3736
  resolveModelReasoningCapability,
3736
3737
  resolveModelReasoningCapabilityWithCache,
3737
3738
  isModelSupportReasoningEffort,
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-JCQ3WCQ3.js";
8
8
  import {
9
9
  resolveRuntimeAuthToken
10
- } from "./chunk-GX6DITLQ.js";
10
+ } from "./chunk-UUCYUN6Y.js";
11
11
  import {
12
12
  isSystemBuiltinTrustedAgentKey
13
13
  } from "./chunk-KZAT2M2V.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-HNUWUO75.js";
4
4
  import {
5
5
  resolveToolImagePolicy
6
- } from "./chunk-SX6AWTNK.js";
6
+ } from "./chunk-BZLGPM5B.js";
7
7
  import {
8
8
  projectOpenAiToolImages
9
9
  } from "./chunk-X4O7FJF5.js";
@@ -11,7 +11,7 @@ import {
11
11
  getAntigravityUserAgent,
12
12
  readAntigravityProjectId,
13
13
  resolveAntigravityCloudCodeBaseUrl
14
- } from "./chunk-CTWCZKNS.js";
14
+ } from "./chunk-6SOWMEAY.js";
15
15
  import {
16
16
  asOptionalTrimmedString
17
17
  } from "./chunk-G3SUCT4W.js";
@@ -12,12 +12,12 @@ import {
12
12
  } from "./chunk-WWC7I6TA.js";
13
13
  import {
14
14
  getModelConfig
15
- } from "./chunk-CD2DK5JA.js";
15
+ } from "./chunk-OKH74FML.js";
16
16
  import {
17
17
  isPlatformHostedImageModel,
18
18
  isPlatformManagedProvider,
19
19
  resolvePlatformEffectiveModel
20
- } from "./chunk-PQ63BDV3.js";
20
+ } from "./chunk-JPXACKSW.js";
21
21
 
22
22
  // packages/ai/llm/getPricing.ts
23
23
  var MAX_OUTPUT_TOKENS = 8192;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getLocalProviderSecret
3
- } from "./chunk-HS7MLR74.js";
3
+ } from "./chunk-KZ4A7EIV.js";
4
4
  import {
5
5
  performServerProxyFetchWithRetry
6
- } from "./chunk-CUYFRVJF.js";
6
+ } from "./chunk-GO7UC5VH.js";
7
7
  import {
8
8
  fetchServerSyncedCredential
9
- } from "./chunk-QJ5YDTEF.js";
9
+ } from "./chunk-YQYYYATY.js";
10
10
  import {
11
11
  buildIdentityBlock,
12
12
  buildPlatformStaticContextLayers,
@@ -15,7 +15,7 @@ import {
15
15
  compileContextLayers,
16
16
  detectDispatchIntentFromMessages,
17
17
  resolveToolGuidedSections
18
- } from "./chunk-LXKK7QFI.js";
18
+ } from "./chunk-4HAOOY6G.js";
19
19
  import {
20
20
  convertMessagesToResponsesInput,
21
21
  getUsageRequestOptions,
@@ -24,11 +24,15 @@ import {
24
24
  resolveReasoningReplayOptions,
25
25
  shouldStripReasoningContentForOutbound,
26
26
  stablePromptCacheKey
27
- } from "./chunk-W3HSD32M.js";
27
+ } from "./chunk-FXEPZKNJ.js";
28
28
  import {
29
29
  resolveAgentCallPlan,
30
30
  resolveClientWire
31
- } from "./chunk-VUHKG4KS.js";
31
+ } from "./chunk-DNNPARJK.js";
32
+ import {
33
+ isGpt62DeveloperPrefixModel,
34
+ usesCodexDeveloperPrefix
35
+ } from "./chunk-CIAV4WK2.js";
32
36
  import {
33
37
  createFileCredentialBroker
34
38
  } from "./chunk-E6A5NHDH.js";
@@ -52,11 +56,13 @@ import {
52
56
  toErrorMessage
53
57
  } from "./chunk-HNMXYYJR.js";
54
58
  import {
55
- buildProviderAuthHeaders
56
- } from "./chunk-K26XPZRB.js";
59
+ buildProviderAuthHeaders,
60
+ isAgentCredentialShared,
61
+ resolveOutboundProxyApiKey
62
+ } from "./chunk-LVZVSLKO.js";
57
63
  import {
58
64
  OPENAI_RESPONSES_ENDPOINT
59
- } from "./chunk-ESN4WNWU.js";
65
+ } from "./chunk-2JHGUL5K.js";
60
66
  import {
61
67
  asTrimmedString
62
68
  } from "./chunk-3EUW3WEO.js";
@@ -64,7 +70,7 @@ import {
64
70
  clampReasoningEffort,
65
71
  getModelConfig,
66
72
  isModelSupportReasoningEffort
67
- } from "./chunk-CD2DK5JA.js";
73
+ } from "./chunk-OKH74FML.js";
68
74
  import {
69
75
  isRecord
70
76
  } from "./chunk-KUG52IAP.js";
@@ -77,10 +83,10 @@ import {
77
83
  import {
78
84
  isDeepInfraKimiModel,
79
85
  isFireworksKimiModel,
80
- isPlatformMimoProviderModel,
81
86
  resolveFireworksKimiModel,
82
- resolvePlatformHostedRouting
83
- } from "./chunk-PQ63BDV3.js";
87
+ resolvePlatformHostedRouting,
88
+ usesMimoThinkingWire
89
+ } from "./chunk-JPXACKSW.js";
84
90
  import {
85
91
  asTrimmedLowercaseString
86
92
  } from "./chunk-QSJ3HFEF.js";
@@ -240,7 +246,11 @@ ${mainPrompt}` : "";
240
246
  const agentTools = canonicalizeToolNames(agentConfig.tools ?? []);
241
247
  const hasAskTool = agentTools.includes("ask_user");
242
248
  const toolSections = resolveToolGuidedSections(agentTools, {
243
- dispatchIntent: options.dispatchIntent === true
249
+ dispatchIntent: options.dispatchIntent === true,
250
+ // 安全透传:两者缺省均为 undefined,resolveToolGuidedSections 不追加任何文本,
251
+ // 因此未接线调用方拿到的 prompt 与既往逐字相同。
252
+ callerModel: options.callerModel,
253
+ externalAgentCount: options.externalAgentCount
244
254
  });
245
255
  const {
246
256
  startupProtocol,
@@ -327,7 +337,7 @@ var applyClaudeCache = (stableContent, dynamicContent) => {
327
337
  }
328
338
  return parts.length > 0 ? parts : stableContent;
329
339
  };
330
- var prependPromptMessage = (messages, agentConfig, resolvedModel, language, contexts, prependSystemPrompt = true) => {
340
+ var prependPromptMessage = (messages, agentConfig, resolvedModel, language, contexts, prependSystemPrompt = true, preservePromptBoundary = false, preservePromptProvenance = preservePromptBoundary) => {
331
341
  if (!prependSystemPrompt) return messages;
332
342
  if (!contexts && !agentConfig.prompt) return messages;
333
343
  const dispatchIntent = detectDispatchIntentFromMessages(messages);
@@ -341,25 +351,29 @@ var prependPromptMessage = (messages, agentConfig, resolvedModel, language, cont
341
351
  const systemMessage2 = { role: "system", content };
342
352
  return [systemMessage2, ...messages];
343
353
  }
354
+ const promptProvenance = preservePromptProvenance && agentConfig.prompt?.trim() ? { agent_prompt_in_messages: true } : {};
355
+ if (preservePromptBoundary) {
356
+ const compiled = buildSystemPromptContext({ agentConfig, language, contexts, dispatchIntent });
357
+ if (!compiled.content.trim()) return messages;
358
+ return [{
359
+ role: "system",
360
+ content: compiled.content,
361
+ stable_prefix_chars: compiled.stablePrefixContent.length,
362
+ ...promptProvenance
363
+ }, ...messages];
364
+ }
344
365
  const promptContent = buildSystemPrompt({ agentConfig, language, contexts, dispatchIntent });
345
366
  if (!promptContent.trim()) return messages;
346
- const systemMessage = { role: "system", content: promptContent };
367
+ const systemMessage = { role: "system", content: promptContent, ...promptProvenance };
347
368
  return [systemMessage, ...messages];
348
369
  };
349
- var shouldInjectLlamaCppThinkingToggle = (agentConfig) => {
350
- if (typeof agentConfig.enableThinking !== "boolean") return false;
351
- if (!isLoopbackUrl(agentConfig.customProviderUrl)) return false;
352
- return /qwen/i.test(agentConfig.model ?? "");
353
- };
354
- var shouldDisableMiMoThinking = (agentConfig, resolvedModel) => {
355
- if (agentConfig.enableThinking === true) return false;
356
- if (/xiaomimimo\.com/i.test(agentConfig.customProviderUrl ?? "") || (agentConfig.provider ?? "").toLowerCase() === "mimo") {
357
- return true;
358
- }
359
- return isPlatformMimoProviderModel(agentConfig.provider, resolvedModel);
370
+ var resolveLlamaCppThinkingToggle = (agentConfig) => {
371
+ if (!isLoopbackUrl(agentConfig.customProviderUrl) || !/qwen/i.test(agentConfig.model ?? "")) return void 0;
372
+ const effort = agentConfig.reasoning_effort?.toLowerCase();
373
+ return effort ? effort !== "none" && effort !== "off" : agentConfig.enableThinking ?? void 0;
360
374
  };
361
375
  var shouldDisableKimiThinking = (agentConfig, providerName, resolvedModel) => {
362
- if (agentConfig.enableThinking !== false) return false;
376
+ if (agentConfig.reasoning_effort || agentConfig.enableThinking !== false) return false;
363
377
  if (providerName === "deepinfra") return isDeepInfraKimiModel(resolvedModel);
364
378
  if (providerName === "fireworks") return isFireworksKimiModel(resolvedModel);
365
379
  return false;
@@ -396,6 +410,8 @@ var buildRequestBody = (options) => {
396
410
  const {
397
411
  model,
398
412
  messages,
413
+ preservePromptBoundary,
414
+ preservePromptProvenance,
399
415
  providerName,
400
416
  customProviderUrl,
401
417
  temperature,
@@ -406,13 +422,22 @@ var buildRequestBody = (options) => {
406
422
  reasoning_effort,
407
423
  shapingCounts
408
424
  } = options;
409
- const cleanedMessages = messages.map(
410
- (message) => sanitizeChatCompletionsMessage(message, {
425
+ const cleanedMessages = messages.map((message) => {
426
+ const sanitized = sanitizeChatCompletionsMessage(message, {
411
427
  provider: providerName,
412
428
  model,
413
429
  ...shapingCounts ? { shapingCounts } : {}
414
- })
415
- );
430
+ });
431
+ if (message.role === "system") {
432
+ if (preservePromptBoundary && message.stable_prefix_chars !== void 0) {
433
+ sanitized.stable_prefix_chars = message.stable_prefix_chars;
434
+ }
435
+ if (preservePromptProvenance && message.agent_prompt_in_messages === true) {
436
+ sanitized.agent_prompt_in_messages = true;
437
+ }
438
+ }
439
+ return sanitized;
440
+ });
416
441
  const bodyData = {
417
442
  model,
418
443
  messages: cleanedMessages,
@@ -443,7 +468,7 @@ var buildRequestBody = (options) => {
443
468
  if (typeof max_tokens === "number") bodyData.max_tokens = max_tokens;
444
469
  return bodyData;
445
470
  };
446
- var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts, stableMessages = [], prependSystemPrompt = true, shapingCounts) => {
471
+ var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts, stableMessages = [], prependSystemPrompt = true, shapingCounts, preservePromptBoundary = false, preservePromptProvenance = preservePromptBoundary) => {
447
472
  const resolvedModel = providerName === "fireworks" ? resolveFireworksKimiModel(agentConfig.model) : agentConfig.model ?? "";
448
473
  let processedStable = [...stableMessages];
449
474
  if (isClaudeModel(resolvedModel) && processedStable.length > 0) {
@@ -475,11 +500,15 @@ var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts,
475
500
  resolvedModel,
476
501
  typeof navigator !== "undefined" ? navigator.language : "en",
477
502
  contexts,
478
- prependSystemPrompt
503
+ prependSystemPrompt,
504
+ preservePromptBoundary,
505
+ preservePromptProvenance
479
506
  );
480
507
  const requestBody = buildRequestBody({
481
508
  model: resolvedModel,
482
509
  messages: messagesWithPrompt,
510
+ preservePromptBoundary,
511
+ preservePromptProvenance,
483
512
  providerName,
484
513
  customProviderUrl: agentConfig.customProviderUrl,
485
514
  temperature: agentConfig.temperature,
@@ -490,18 +519,28 @@ var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts,
490
519
  reasoning_effort: agentConfig.reasoning_effort,
491
520
  ...shapingCounts ? { shapingCounts } : {}
492
521
  });
493
- if (shouldInjectLlamaCppThinkingToggle(agentConfig)) {
522
+ const llamaCppThinking = resolveLlamaCppThinkingToggle(agentConfig);
523
+ if (llamaCppThinking !== void 0) {
524
+ delete requestBody.reasoning_effort;
494
525
  requestBody.chat_template_kwargs = {
495
526
  ...requestBody.chat_template_kwargs ?? {},
496
- enable_thinking: agentConfig.enableThinking
527
+ enable_thinking: llamaCppThinking
497
528
  };
498
529
  }
499
- if (shouldDisableMiMoThinking(agentConfig, resolvedModel)) {
500
- requestBody.thinking = { type: "disabled" };
530
+ if (usesMimoThinkingWire(agentConfig.provider, resolvedModel, agentConfig.customProviderUrl)) {
531
+ const effort = agentConfig.reasoning_effort;
532
+ if (effort === "none" || effort === "off") {
533
+ requestBody.thinking = { type: "disabled" };
534
+ } else if (effort) {
535
+ const depth = clampReasoningEffort(effort, "mimo", resolvedModel);
536
+ if (depth) requestBody.reasoning_effort = depth;
537
+ } else if (agentConfig.enableThinking !== true) {
538
+ requestBody.thinking = { type: "disabled" };
539
+ }
501
540
  }
502
541
  if (shouldDisableKimiThinking(agentConfig, providerName, resolvedModel)) {
503
542
  requestBody.thinking = { type: "disabled" };
504
- requestBody.reasoning_effort = "none";
543
+ if (providerName !== "deepinfra") requestBody.reasoning_effort = "none";
505
544
  requestBody.reasoning = { enabled: false };
506
545
  }
507
546
  return normalizeChatCompletionsBodyForProvider({
@@ -527,7 +566,7 @@ function usesGpt62DeveloperPrefix(agentConfig) {
527
566
  } else if (provider !== "openai") {
528
567
  return false;
529
568
  }
530
- return /^gpt-6\.2-(astra|sol)$/.test(model);
569
+ return isGpt62DeveloperPrefixModel(model);
531
570
  }
532
571
  function resolveResponsesCompactionThreshold(agentConfig) {
533
572
  const configured = Number(
@@ -752,9 +791,8 @@ var generateRequestBody = ({
752
791
  agentConfig,
753
792
  imageSettings.shouldEnableImage
754
793
  );
755
- const clientWire = resolveClientWire(
756
- resolveAgentCallPlan(agentConfigForRequest, {})
757
- );
794
+ const plan = resolveAgentCallPlan(agentConfigForRequest, {});
795
+ const clientWire = resolveClientWire(plan);
758
796
  if (clientWire === "responses") {
759
797
  const body = generateResponseRequestBody(
760
798
  agentConfigForRequest,
@@ -775,13 +813,17 @@ var generateRequestBody = ({
775
813
  );
776
814
  return body;
777
815
  }
816
+ const codexOAuth = plan.authMethod.kind === "oauth" && plan.authMethod.ref === "chatgpt";
778
817
  const baseBody = generateOpenAIRequestBody(
779
818
  agentConfigForRequest,
780
819
  provider,
781
820
  messages,
782
821
  contexts,
783
822
  stableMessages,
784
- prependSystemPrompt
823
+ prependSystemPrompt,
824
+ void 0,
825
+ codexOAuth && usesCodexDeveloperPrefix(agentConfigForRequest, agentConfigForRequest.model),
826
+ codexOAuth
785
827
  );
786
828
  return applyImageConfigIfNeeded(baseBody, agentConfigForRequest, provider);
787
829
  };
@@ -821,11 +863,11 @@ async function resolveDirectRequestApiKey(agentConfig, options) {
821
863
  const broker = factory();
822
864
  const local = await safeBrokerGet(broker, credentialRef);
823
865
  if (local) return local;
824
- if (credentialRef.startsWith("provider-key:") && options?.providerSecretFetcher) {
866
+ if (isAgentCredentialShared(agentConfig) && credentialRef.startsWith("provider-key:") && options?.providerSecretFetcher) {
825
867
  const providerSecret = await options.providerSecretFetcher(credentialRef);
826
868
  if (providerSecret) return providerSecret;
827
869
  }
828
- if (agentConfig.credentialSynced && options?.syncFetcher) {
870
+ if (isAgentCredentialShared(agentConfig) && options?.syncFetcher) {
829
871
  const synced = await options.syncFetcher(credentialRef);
830
872
  const trimmed = asTrimmedString(synced);
831
873
  if (trimmed) {
@@ -846,11 +888,11 @@ async function safeBrokerGet(broker, ref) {
846
888
  }
847
889
  }
848
890
 
849
- // packages/ai/chat/fetchUtils.ts
891
+ // packages/ai/chat/buildProxyPayload.ts
850
892
  var buildProxyPayload = (bodyData, api, agentConfig, dialogId) => {
851
893
  const apiSource = agentConfig.apiSource === "custom" || agentConfig.apiSource === "cli" ? agentConfig.apiSource : void 0;
852
894
  const provider = bodyData.provider || agentConfig.provider || (apiSource === "custom" ? "custom" : void 0);
853
- const apiKey = asOptionalTrimmedString(agentConfig.apiKey);
895
+ const apiKey = resolveOutboundProxyApiKey(agentConfig);
854
896
  return {
855
897
  ...bodyData,
856
898
  url: api,
@@ -862,12 +904,14 @@ var buildProxyPayload = (bodyData, api, agentConfig, dialogId) => {
862
904
  KEY: apiKey
863
905
  };
864
906
  };
907
+
908
+ // packages/ai/chat/fetchUtils.ts
865
909
  var fetchDirectly = async (params) => {
866
910
  const { api, agentConfig, bodyData, signal, currentServer, token, dialogId } = params;
867
911
  try {
868
912
  const apiKey = await resolveDirectRequestApiKey(agentConfig, {
869
913
  syncFetcher: currentServer && token ? (ref) => fetchServerSyncedCredential({ currentServer, authToken: token }, ref) : void 0,
870
- providerSecretFetcher: currentServer && token ? async (ref) => {
914
+ providerSecretFetcher: isAgentCredentialShared(agentConfig) && currentServer && token ? async (ref) => {
871
915
  const presetId = ref.startsWith("provider-key:") ? ref.slice("provider-key:".length) : ref;
872
916
  const local = getLocalProviderSecret(presetId);
873
917
  if (local) return local;
@@ -951,19 +995,33 @@ var formatFriendlyNetworkErrorMessage = (error) => {
951
995
  return rawMessage;
952
996
  };
953
997
  var performFetchRequest = async (params) => {
998
+ let direct = false;
954
999
  try {
955
- const planConfig = {
956
- ...params.agentConfig,
957
- provider: params.bodyData.provider || params.agentConfig.provider
958
- };
959
- return resolveAgentCallPlan(planConfig, {}).transport === "server-proxy" ? await fetchWithServerProxy(params) : await fetchDirectly(params);
1000
+ const { agentConfig, bodyData } = params;
1001
+ const credentialRef = "credentialRef" in agentConfig && typeof agentConfig.credentialRef === "string" ? agentConfig.credentialRef : void 0;
1002
+ const plan = resolveAgentCallPlan({
1003
+ key: "",
1004
+ provider: bodyData.provider || agentConfig.provider,
1005
+ model: agentConfig.model,
1006
+ apiSource: agentConfig.apiSource,
1007
+ cliProvider: agentConfig.cliProvider ?? void 0,
1008
+ customProviderUrl: agentConfig.customProviderUrl,
1009
+ apiKey: agentConfig.apiKey ?? void 0,
1010
+ apiKeyRef: agentConfig.apiKeyRef,
1011
+ credentialRef,
1012
+ credentialSynced: agentConfig.credentialSynced,
1013
+ useServerProxy: agentConfig.useServerProxy
1014
+ }, void 0, { canResolveLocalCredential: true });
1015
+ direct = plan.transport === "direct";
1016
+ return direct ? await fetchDirectly(params) : await fetchWithServerProxy(params);
960
1017
  } catch (error) {
961
1018
  if (error instanceof DirectApiKeyResolutionError || error?.kind === "credential_missing") {
962
1019
  throw error;
963
1020
  }
964
1021
  console.error("[performFetchRequest] \u8BF7\u6C42\u8FC7\u7A0B\u4E2D\u53D1\u751F\u9519\u8BEF:", error);
965
- if (params.preserveStructuredError) throw error;
966
- const friendlyMsg = formatFriendlyNetworkErrorMessage(error);
1022
+ if (params.preserveStructuredError || params.signal?.aborted || error?.name === "AbortError") throw error;
1023
+ const rawMessage = toErrorMessage(error);
1024
+ const friendlyMsg = direct && /failed to fetch|networkerror|network error|load failed/i.test(rawMessage) && !(typeof navigator !== "undefined" && navigator.onLine === false) ? "\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25\uFF1A\u6D4F\u89C8\u5668\u76F4\u8FDE\u670D\u52A1\u5546\u65F6\uFF0C\u53EF\u80FD\u88AB\u670D\u52A1\u5546\u7684\u8DE8\u57DF\u9650\u5236\uFF08CORS\uFF09\u62E6\u622A\u3002" : formatFriendlyNetworkErrorMessage(error);
967
1025
  throw new Error(
968
1026
  friendlyMsg.startsWith("\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25") ? friendlyMsg : `\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25: ${friendlyMsg}`
969
1027
  );
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ALWAYS_EXCLUDED_GLOBS,
3
3
  buildExecutionTicket
4
- } from "./chunk-ANUP75N2.js";
4
+ } from "./chunk-2E4BYAUE.js";
5
5
 
6
6
  // packages/agent-runtime/docker/executionTicket.ts
7
7
  function buildPrimaryExecutionTicket(runGrant, executionClass = "session") {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-HNUWUO75.js";
4
4
  import {
5
5
  resolveToolImagePolicy
6
- } from "./chunk-SX6AWTNK.js";
6
+ } from "./chunk-BZLGPM5B.js";
7
7
  import {
8
8
  accumulateToolCallDelta,
9
9
  createThinkParserState,
@@ -31,7 +31,7 @@ import {
31
31
  stablePromptCacheKey,
32
32
  toOpenAiCompatibleMessages,
33
33
  toResponsesTools
34
- } from "./chunk-W3HSD32M.js";
34
+ } from "./chunk-FXEPZKNJ.js";
35
35
  import {
36
36
  isMeaningfulChatCompletionOutput,
37
37
  isMeaningfulResponsesOutput
@@ -46,19 +46,28 @@ import {
46
46
  buildProviderExecutionPlan,
47
47
  canUsePlatformChatProvider,
48
48
  hasDirectOpenAiCompatibleProvider,
49
+ isAgentCredentialShared,
49
50
  resolveAgentRuntimeLocation,
50
51
  resolveClientVersion,
52
+ resolveOutboundProxyApiKey,
51
53
  resolvePlatformAuthToken,
52
54
  resolvePlatformServerUrl,
53
55
  resolveProviderTransportDecision
54
- } from "./chunk-K26XPZRB.js";
56
+ } from "./chunk-LVZVSLKO.js";
57
+ import {
58
+ clampReasoningEffort
59
+ } from "./chunk-OKH74FML.js";
55
60
  import {
56
61
  isRecord
57
62
  } from "./chunk-KUG52IAP.js";
58
63
  import {
59
64
  NOLO_CLIENT_VERSION_HEADER,
60
- isPlatformMimoProviderModel
61
- } from "./chunk-PQ63BDV3.js";
65
+ PLATFORM_HOSTED_KIMI_PROVIDER,
66
+ hostedKimiLegacyThinkingOverride,
67
+ isPlatformKimiProviderModel,
68
+ resolvePlatformEffectiveModel,
69
+ usesMimoThinkingWire
70
+ } from "./chunk-JPXACKSW.js";
62
71
 
63
72
  // packages/ai/token/sseUsageExtract.ts
64
73
  var TOKEN_FIELDS = [
@@ -443,11 +452,9 @@ function isAbortOrTimeoutError(error) {
443
452
  }
444
453
  var CHAT_PROXY_PATH = "/api/v1/chat";
445
454
  function shouldDisableThinking(providerConfig) {
446
- return providerConfig.provider.toLowerCase() === "mimo" || /xiaomimimo\.com/i.test(providerConfig.endpoint) || // 平台托管 MiMo(provider=nolo + mimo-v2.6-*):endpoint 通常已解析成
447
- // api.xiaomimimo.com/...(上面的正则已命中),但 transport=direct 时
448
- // endpoint 是 nolo 服务器地址——模型 id 判据保证两跳都关掉 thinking
449
- // (上游 thinking 默认 enabled)。
450
- isPlatformMimoProviderModel(providerConfig.provider, providerConfig.model);
455
+ if (!usesMimoThinkingWire(providerConfig.provider, providerConfig.model, providerConfig.endpoint)) return false;
456
+ const effort = providerConfig.requestOptions.reasoning_effort;
457
+ return effort === "none" || effort === "off" || !effort && providerConfig.enableThinking !== true;
451
458
  }
452
459
  function isResponsesEndpoint(endpoint) {
453
460
  return /\/responses$/i.test(endpoint.trim());
@@ -490,7 +497,9 @@ async function resolvePlatformChatProviderConfig(args) {
490
497
  provider: plan.provider,
491
498
  endpoint: plan.endpoint,
492
499
  requestOptions: plan.requestOptions,
500
+ enableThinking: args.agentConfig.enableThinking,
493
501
  ...plan.apiKey ? { apiKey: plan.apiKey } : {},
502
+ ...isAgentCredentialShared(args.agentConfig) ? { credentialSynced: true } : {},
494
503
  ...plan.apiKeyHeader ? { apiKeyHeader: plan.apiKeyHeader } : {},
495
504
  ...args.agentConfig.apiSource ? { apiSource: args.agentConfig.apiSource } : {},
496
505
  ...plan.usageProvider ? { usageProvider: plan.usageProvider } : {},
@@ -506,7 +515,9 @@ async function resolvePlatformChatProviderConfig(args) {
506
515
  provider: plan.provider,
507
516
  endpoint: plan.endpoint,
508
517
  requestOptions: plan.requestOptions,
518
+ enableThinking: args.agentConfig.enableThinking,
509
519
  ...plan.apiKey ? { apiKey: plan.apiKey } : {},
520
+ ...plan.credentialSynced === true ? { credentialSynced: true } : {},
510
521
  ...plan.apiKeyHeader ? { apiKeyHeader: plan.apiKeyHeader } : {},
511
522
  ...plan.apiSource ? { apiSource: plan.apiSource } : {},
512
523
  ...plan.usageProvider ? { usageProvider: plan.usageProvider } : {},
@@ -521,7 +532,18 @@ function buildPlatformChatCompletionRequest(args) {
521
532
  );
522
533
  }
523
534
  const usesResponsesApi = isResponsesEndpoint(args.providerConfig.endpoint);
524
- const requestOptions = usesResponsesApi ? toResponsesRequestOptions(args.providerConfig.requestOptions) : args.providerConfig.requestOptions;
535
+ const requestOptions = usesResponsesApi ? toResponsesRequestOptions(args.providerConfig.requestOptions) : { ...args.providerConfig.requestOptions };
536
+ const { provider, model, usageProvider } = args.providerConfig;
537
+ const effort = requestOptions.reasoning_effort;
538
+ if (!usesResponsesApi && typeof effort === "string" && effort && provider === PLATFORM_HOSTED_KIMI_PROVIDER && usageProvider === "baseten" && isPlatformKimiProviderModel(provider, resolvePlatformEffectiveModel(model))) {
539
+ const clamped = clampReasoningEffort(effort, provider, model);
540
+ if (clamped) requestOptions.reasoning_effort = clamped;
541
+ else delete requestOptions.reasoning_effort;
542
+ }
543
+ const disableThinking = !usesResponsesApi && shouldDisableThinking(args.providerConfig);
544
+ if (disableThinking && ["none", "off"].includes(String(requestOptions.reasoning_effort))) {
545
+ delete requestOptions.reasoning_effort;
546
+ }
525
547
  const shouldStripReasoning = !usesResponsesApi && shouldStripReasoningContentForOutbound(
526
548
  args.providerConfig.provider,
527
549
  args.providerConfig.model
@@ -532,6 +554,7 @@ function buildPlatformChatCompletionRequest(args) {
532
554
  shouldStripReasoning
533
555
  );
534
556
  const sanitizedMessages = sanitizeForOutbound(args.messages, args.tools);
557
+ const proxyApiKey = resolveOutboundProxyApiKey(args.providerConfig);
535
558
  const body = {
536
559
  model: args.providerConfig.model,
537
560
  ...usesResponsesApi ? {
@@ -578,7 +601,13 @@ function buildPlatformChatCompletionRequest(args) {
578
601
  tools: usesResponsesApi ? toResponsesTools(args.tools) : args.tools,
579
602
  ...usesResponsesApi ? {} : { tool_choice: "auto" }
580
603
  } : {},
581
- ...shouldDisableThinking(args.providerConfig) ? { thinking: { type: "disabled" } } : {},
604
+ ...disableThinking ? { thinking: { type: "disabled" } } : {},
605
+ ...!usesResponsesApi ? hostedKimiLegacyThinkingOverride(
606
+ args.providerConfig.provider,
607
+ args.providerConfig.model,
608
+ args.providerConfig.enableThinking,
609
+ args.providerConfig.requestOptions.reasoning_effort
610
+ ) : void 0,
582
611
  // 缓存路由亲和提示:托管上游是多副本共享池,前缀缓存是节点本地的,
583
612
  // 请求落到另一副本就整条 miss(实测占该线全部 miss token 的 52%,
584
613
  // 依据见 promptCacheKey.ts)。键只取跨轮稳定的部分(model + system 稳定
@@ -601,7 +630,8 @@ function buildPlatformChatCompletionRequest(args) {
601
630
  agentKey: args.providerConfig.agentKey,
602
631
  ...args.dialogId?.trim() ? { dialogId: args.dialogId.trim() } : {},
603
632
  ...args.providerConfig.apiSource ? { apiSource: args.providerConfig.apiSource } : {},
604
- ...args.providerConfig.apiKey ? { KEY: args.providerConfig.apiKey } : {},
633
+ // Overwrite any same-named request option; undefined is omitted on the wire.
634
+ KEY: proxyApiKey,
605
635
  ...args.providerConfig.apiKeyHeader ? { apiKeyHeader: args.providerConfig.apiKeyHeader } : {}
606
636
  };
607
637
  const outboundBody = usesResponsesApi ? body : applyFunctionToolReasoningCompatibility(body, args.providerConfig.model);