nolo-cli 0.11.0 → 0.12.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 (123) hide show
  1. package/{_executeModel-ZEDPX6OF.js → _executeModel-MWAY74HA.js} +51 -50
  2. package/{action-AA4IJ5K2.js → action-RAXNQQKC.js} +8 -9
  3. package/{addContentAction-QYVO4SYP.js → addContentAction-ZHI7TVV3.js} +7 -9
  4. package/{addDialogAgentAction-WVVKT5WQ.js → addDialogAgentAction-JWXPKXNC.js} +9 -10
  5. package/{agentDeleteCommand-RDPGYIWF.js → agentDeleteCommand-LXR5A5FV.js} +38 -28
  6. package/{agentEmailCommands-2HJJKS5F.js → agentEmailCommands-DXRAP7BB.js} +64 -62
  7. package/{agentListCommands-HFEVV3ZW.js → agentListCommands-ZFMS5ZLY.js} +127 -31
  8. package/{agentMachineCommands-25ZOENJU.js → agentMachineCommands-ZJLYVV52.js} +37 -26
  9. package/{agentPullCommand-GOL2S4W2.js → agentPullCommand-KRBRIFIY.js} +7 -7
  10. package/{agentRecordCommands-GTCOAM3L.js → agentRecordCommands-DFS626TB.js} +56 -54
  11. package/{agentRunCommand-YBS3JDLD.js → agentRunCommand-GWBIE2TS.js} +59 -59
  12. package/{agentRunControl-K4VKNEHF.js → agentRunControl-IX4F5W2C.js} +3 -3
  13. package/{agentRuntimeLocal-UQBMQI2M.js → agentRuntimeLocal-YNZSHMZC.js} +30 -15
  14. package/{agentSlice-6EKOBCCS.js → agentSlice-T2PXOEPQ.js} +8 -9
  15. package/{authCommand-O2OWACN4.js → authCommand-DMW336GT.js} +15 -15
  16. package/{authCommands-H7365TZP.js → authCommands-GH5T6RYV.js} +6 -6
  17. package/{chunk-7D3JY6C2.js → chunk-3HHTVM6G.js} +64 -5
  18. package/{chunk-AFON4QUU.js → chunk-3QKO4EHV.js} +3 -3
  19. package/{chunk-4SOKXIW4.js → chunk-43UD5ZP7.js} +8 -11
  20. package/{chunk-S3GS2PRL.js → chunk-4BTHUYMY.js} +597 -68
  21. package/{chunk-SV5MWASH.js → chunk-4EH7AR52.js} +12 -12
  22. package/{chunk-FXXSGWAJ.js → chunk-4GBNEA5B.js} +1 -1
  23. package/{chunk-PXZAAB4L.js → chunk-4LG74DRG.js} +4 -4
  24. package/{chunk-2FTTDCD4.js → chunk-4ON5AV72.js} +2 -1
  25. package/{chunk-IWX4UW2E.js → chunk-524BDL33.js} +89 -8
  26. package/{chunk-X2S7JTIG.js → chunk-5ITRDSHY.js} +1240 -136
  27. package/{chunk-ISNCLGUZ.js → chunk-5NBHQD4D.js} +4 -3
  28. package/{chunk-GBDSZATH.js → chunk-6LMFFG3K.js} +3 -3
  29. package/{chunk-OUI3ZHYD.js → chunk-6OVCRC72.js} +1 -1
  30. package/{chunk-CKOJQDKR.js → chunk-7JJCGV7N.js} +146 -3
  31. package/{chunk-MQI77IRB.js → chunk-7MYHLZ3F.js} +2 -2
  32. package/{chunk-5MOUAAMK.js → chunk-AM53Q2SD.js} +194 -2564
  33. package/chunk-BYXBJQAS.js +0 -0
  34. package/{chunk-LAX2JSTX.js → chunk-DE5BA4O6.js} +20 -2
  35. package/{chunk-BX6U3ETE.js → chunk-DRMGJFGQ.js} +293 -89
  36. package/{chunk-KJR5KAUQ.js → chunk-EBH7G34M.js} +20 -7
  37. package/{chunk-E4HNJSHC.js → chunk-G3B356GF.js} +16 -18
  38. package/{chunk-KQQVGRA3.js → chunk-GDBCUWQ3.js} +35 -29
  39. package/{chunk-Q3UKJVU4.js → chunk-GPZM7QH6.js} +10 -10
  40. package/chunk-IKXL2HZ3.js +70 -0
  41. package/{chunk-QNMFBBZK.js → chunk-IVAOVLM7.js} +1 -1
  42. package/{chunk-EVZKZF32.js → chunk-JUN3HFMN.js} +182 -75
  43. package/{chunk-NEM67FX7.js → chunk-JZDIW766.js} +1 -1
  44. package/{chunk-TACHTH5D.js → chunk-LHSJMY5V.js} +18 -18
  45. package/{chunk-XYZA7S7V.js → chunk-MEVCDATU.js} +6 -6
  46. package/{chunk-YOCHZD7D.js → chunk-NCGFB7NN.js} +5 -3
  47. package/{chunk-O26GI2JP.js → chunk-NITP2JDG.js} +39 -8
  48. package/{chunk-YPRZSPF3.js → chunk-OCDEWRE2.js} +1 -1
  49. package/{chunk-PNEW2Z3T.js → chunk-OHEKYYJF.js} +7 -7
  50. package/chunk-OOIN7HSO.js +146 -0
  51. package/{chunk-DWGAEFJL.js → chunk-OPKKB25T.js} +1 -1
  52. package/{chunk-AEZAORLG.js → chunk-QCA3EPYK.js} +5 -5
  53. package/{chunk-C4FTUXVF.js → chunk-QLUFR47U.js} +11 -1
  54. package/{chunk-C2MDQQ4O.js → chunk-RNQ5BLR2.js} +1 -1
  55. package/{chunk-L53FGHA4.js → chunk-RSEUHW6T.js} +1 -1
  56. package/{chunk-2W2VYVI5.js → chunk-RZ735TLX.js} +527 -176
  57. package/chunk-S3UTETIC.js +4885 -0
  58. package/chunk-S73OEOHH.js +2286 -0
  59. package/{chunk-YTBMA7NO.js → chunk-TSKWE74T.js} +58 -8
  60. package/{chunk-5OIFWVX7.js → chunk-UG3WOFU6.js} +1 -1
  61. package/{chunk-4ZDM73SD.js → chunk-V2J635L5.js} +1 -1
  62. package/{chunk-IPYUUY4E.js → chunk-WPHL6ALY.js} +1 -1
  63. package/{chunk-3NSIQZZ6.js → chunk-WTYKCU4W.js} +9 -9
  64. package/{chunk-LP65VRCI.js → chunk-WWU275LU.js} +6 -6
  65. package/{chunk-XFOLQLDN.js → chunk-XHQWJUW4.js} +2 -2
  66. package/{chunk-D6OQHXVG.js → chunk-YDCZVUFP.js} +7 -7
  67. package/{chunk-PXQN7IBQ.js → chunk-YTQLJYLB.js} +2 -2
  68. package/{chunk-ZEYDOXHF.js → chunk-ZPFRLGIZ.js} +1467 -869
  69. package/{chunk-ZPRK73XY.js → chunk-ZR4VHQ5D.js} +14 -13
  70. package/cliEnvHelpers-VYC2OPTB.js +30 -0
  71. package/{createAgentAutomationAction-LTI5QU35.js → createAgentAutomationAction-G32GKDGV.js} +25 -26
  72. package/{createDialogAction-OJJ7L3L3.js → createDialogAction-TISANRZK.js} +26 -27
  73. package/{createPageAction-5MXWVRGY.js → createPageAction-O7KOYNV4.js} +26 -27
  74. package/{dbSlice-RQFQQVHT.js → dbSlice-WDP2ZZHK.js} +6 -7
  75. package/{deleteFile-7XP5BGC7.js → deleteFile-M7UNIUOO.js} +4 -4
  76. package/{dialogCommands-JTJ3RPPW.js → dialogCommands-6JPB3YQY.js} +33 -23
  77. package/{dialogSlice-OWROKURJ.js → dialogSlice-PRHHYSP5.js} +26 -27
  78. package/{docCreateCommands-WJBEW2V7.js → docCreateCommands-75E6TZNN.js} +33 -23
  79. package/{docDeleteCommands-BVEHJOY5.js → docDeleteCommands-EJHLN7LW.js} +34 -25
  80. package/{docReadCommands-NEWOZIJV.js → docReadCommands-RJYBC4FS.js} +33 -23
  81. package/{docStore-3DXRYBMD.js → docStore-H5VWKT5D.js} +25 -26
  82. package/{docUpdateCommands-C7WHT7UU.js → docUpdateCommands-MG4CNISV.js} +33 -23
  83. package/fetchMessages-KTNM7QAR.js +1 -1
  84. package/{getPricing-3E6UNPKL.js → getPricing-6TOZXPAU.js} +7 -3
  85. package/{handleSendMessageAction-B5PRR7BE.js → handleSendMessageAction-QTUGICSZ.js} +29 -30
  86. package/index.js +77 -76
  87. package/{localDialogRead-YSKFFRTT.js → localDialogRead-2VRI24F4.js} +1 -1
  88. package/{machineCommands-IIIREAEK.js → machineCommands-MAV7M3TK.js} +63 -61
  89. package/{machineWsRunDispatch-3SIU6ILW.js → machineWsRunDispatch-ZOEGTKHC.js} +55 -53
  90. package/{memoryCommands-O4MIPIWQ.js → memoryCommands-AFMES3LN.js} +5 -5
  91. package/{models-4OPOOLFS.js → models-LSCRJJ6P.js} +2 -2
  92. package/package.json +1 -1
  93. package/{read-QJNKRROM.js → read-2MIMRBZ2.js} +4 -4
  94. package/{readDocTool-H6X6KO6X.js → readDocTool-QHVGQHUJ.js} +1 -1
  95. package/{readlineWorkspace-HGP3I3OC.js → readlineWorkspace-SWQKC7ZS.js} +1113 -678
  96. package/{removeDialogAgentAction-TCT35SOF.js → removeDialogAgentAction-GTX5AN54.js} +13 -13
  97. package/{runAgentClientLoop-EFM4PTVI.js → runAgentClientLoop-P25HACXX.js} +47 -47
  98. package/{runtimeDoctorCommands-ID43Z7VX.js → runtimeDoctorCommands-QNF3J3UV.js} +6 -6
  99. package/{setDialogExtraReferencesAction-CGYLZMFH.js → setDialogExtraReferencesAction-WFQ63KYO.js} +9 -10
  100. package/{setPrimaryDialogAgentAction-F6BFQDJU.js → setPrimaryDialogAgentAction-P57FXTSU.js} +13 -13
  101. package/{settingSlice-2I5HMG47.js → settingSlice-CK5YZGNI.js} +7 -8
  102. package/{skillDiscovery-UGSQGX2U.js → skillDiscovery-ZYHSX7VD.js} +3 -3
  103. package/{spaceCommands-MT7BWCIL.js → spaceCommands-6O5EFEM5.js} +37 -29
  104. package/{spaceSlice-BS5TSW3W.js → spaceSlice-4EXTYXS4.js} +28 -27
  105. package/{streamAgentChatTurn-I3VBFNR3.js → streamAgentChatTurn-Q3FJAHG2.js} +222 -128
  106. package/{toolApiClient-C7P7YSE4.js → toolApiClient-QI3YBNWB.js} +2 -2
  107. package/{tools-XSD2BOEN.js → tools-AHNQE4GP.js} +34 -34
  108. package/{tuiSummaryLlmCaller-32NRHTT2.js → tuiSummaryLlmCaller-TXLF4MEI.js} +8 -6
  109. package/{updateCommands-VOSPKXFF.js → updateCommands-XZDOOYFH.js} +13 -5
  110. package/{updateDialogTitleAction-7FYNJOGP.js → updateDialogTitleAction-XZDVLKVX.js} +29 -29
  111. package/chunk-5MMAK75Q.js +0 -15
  112. package/chunk-AZPCASRE.js +0 -36
  113. package/chunk-BBYVOSU2.js +0 -792
  114. package/chunk-DCOA4QSN.js +0 -105
  115. package/chunk-UAD2WT54.js +0 -64
  116. package/{chunk-JK7VW2FN.js → chunk-5MIDPSSK.js} +3 -3
  117. package/{chunk-5CS33IBL.js → chunk-PDL2AV3E.js} +3 -3
  118. package/{chunk-5MMZUWSG.js → chunk-TOILAPLH.js} +5 -5
  119. package/{chunk-OOM6SJNR.js → chunk-TSUJOM6N.js} +6 -6
  120. package/{db-6QED3ZVO.js → db-HCJ5PRB5.js} +3 -3
  121. package/{offlineMarxistsAgentCommand-BCPJITJL.js → offlineMarxistsAgentCommand-5OOWZLJI.js} +3 -3
  122. package/{tableCommands-M3DJUETS.js → tableCommands-E4SQWDOX.js} +6 -6
  123. package/{understanding-ZOESBLF3.js → understanding-3CUQQ6SV.js} +3 -3
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  buildStaticUserPolicyContext,
6
6
  resolveSpaceContextPreloadPlan
7
- } from "./chunk-5OIFWVX7.js";
7
+ } from "./chunk-UG3WOFU6.js";
8
8
  import {
9
9
  buildCliPrompt
10
10
  } from "./chunk-ATNTHIZI.js";
@@ -20,45 +20,51 @@ import {
20
20
  sanitizeOutboundResponsesInput,
21
21
  sendOpenAICompletionsRequest,
22
22
  updateTotalUsage
23
- } from "./chunk-KQQVGRA3.js";
23
+ } from "./chunk-GDBCUWQ3.js";
24
24
  import "./chunk-JEXVIMYZ.js";
25
25
  import {
26
26
  prepareTools
27
- } from "./chunk-PXQN7IBQ.js";
27
+ } from "./chunk-YTQLJYLB.js";
28
28
  import {
29
29
  fetchReferenceContents,
30
30
  generateRequestBody,
31
+ isResponsesConversationStateRejection,
31
32
  mergeReferences,
32
33
  performFetchRequest,
33
34
  performServerProxyFetchWithRetry,
34
35
  resolveAgentCallPlan,
35
36
  resolveClientWire,
36
37
  resolveReferenceAssets,
37
- resolveToolsFromKeys
38
- } from "./chunk-EVZKZF32.js";
39
- import "./chunk-FXXSGWAJ.js";
38
+ resolveToolsFromKeys,
39
+ selectResponsesConversationState,
40
+ updateResponsesConversationState
41
+ } from "./chunk-JUN3HFMN.js";
42
+ import "./chunk-4GBNEA5B.js";
43
+ import {
44
+ TOOL_PACKS,
45
+ applyDefaultWebToolPacks,
46
+ applyDisabledTools,
47
+ createSSEParser,
48
+ expandEnabledPackPromptPatches,
49
+ expandEnabledPacks,
50
+ getAllToolRuns,
51
+ shouldBlockForGptPro,
52
+ waitForAbortableDelay
53
+ } from "./chunk-RZ735TLX.js";
54
+ import "./chunk-YDCZVUFP.js";
55
+ import "./chunk-OOIN7HSO.js";
56
+ import "./chunk-KQHGZWSV.js";
40
57
  import {
41
58
  getFinalPrice,
42
59
  getModelPricing,
43
60
  getPrices,
44
61
  hasExplicitAgentPricing
45
- } from "./chunk-YPRZSPF3.js";
62
+ } from "./chunk-OCDEWRE2.js";
46
63
  import {
47
64
  getPublicImageAgentDefaultProfile,
48
65
  getPublicImageAgentMode
49
66
  } from "./chunk-VIDPVFP3.js";
50
- import {
51
- TOOL_PACKS,
52
- applyDefaultWebToolPacks,
53
- applyDisabledTools,
54
- createSSEParser,
55
- expandEnabledPacks,
56
- getAllToolRuns,
57
- shouldBlockForGptPro
58
- } from "./chunk-2W2VYVI5.js";
59
- import "./chunk-D6OQHXVG.js";
60
- import "./chunk-KQHGZWSV.js";
61
- import "./chunk-QNMFBBZK.js";
67
+ import "./chunk-IVAOVLM7.js";
62
68
  import "./chunk-3LY4F7SV.js";
63
69
  import {
64
70
  extractCategorizedMentions
@@ -67,8 +73,8 @@ import "./chunk-63W5N6P3.js";
67
73
  import "./chunk-VF4K2QE6.js";
68
74
  import {
69
75
  getDocState
70
- } from "./chunk-XYZA7S7V.js";
71
- import "./chunk-E4HNJSHC.js";
76
+ } from "./chunk-MEVCDATU.js";
77
+ import "./chunk-G3B356GF.js";
72
78
  import "./chunk-VC6OZXO5.js";
73
79
  import {
74
80
  PERSONALIZATION_DIALOG_CATEGORY,
@@ -76,14 +82,10 @@ import {
76
82
  addUserMessage,
77
83
  buildPersonalizationDialogPolicyContext,
78
84
  estimateMissingUsage,
79
- estimateTokenCount,
80
85
  extractReferenceKeysFromMessage,
81
86
  finalizeTransientMessageOnError,
82
- getModelContextWindow,
83
- getModelInfo,
84
87
  messageStreamEnd,
85
88
  messageStreaming,
86
- planContextUsage,
87
89
  prepareAndPersistUserMessage,
88
90
  removeTransientMessage,
89
91
  selectAllMsgs,
@@ -95,94 +97,63 @@ import {
95
97
  selectTableRows,
96
98
  selectViewMode,
97
99
  updateTokens
98
- } from "./chunk-5MOUAAMK.js";
99
- import "./chunk-4ZDM73SD.js";
100
+ } from "./chunk-AM53Q2SD.js";
101
+ import "./chunk-V2J635L5.js";
100
102
  import "./chunk-MRC4Q34M.js";
101
103
  import "./chunk-MTU75CZ2.js";
102
104
  import "./chunk-CWMSB67P.js";
103
- import "./chunk-Q3UKJVU4.js";
105
+ import "./chunk-GPZM7QH6.js";
104
106
  import {
105
107
  createCliChatTurnStream,
106
108
  getCliChatSession,
107
109
  startCliChatSession
108
- } from "./chunk-GBDSZATH.js";
110
+ } from "./chunk-6LMFFG3K.js";
109
111
  import "./chunk-Z4NR32XR.js";
110
112
  import "./chunk-M76ECQRD.js";
111
- import "./chunk-MQI77IRB.js";
112
- import {
113
- selectAiRecentContentLimit,
114
- selectCurrentServer,
115
- selectGlobalPrompt,
116
- selectKnowledgeCaptureLevel,
117
- selectMaxExecutionTime,
118
- selectSpaceContextLevel,
119
- selectUserTonePreset
120
- } from "./chunk-3NSIQZZ6.js";
121
- import "./chunk-Y5GCAMGP.js";
122
- import "./chunk-SOTZ6RDN.js";
123
- import "./chunk-7D3JY6C2.js";
124
- import "./chunk-UAD2WT54.js";
125
- import {
126
- patch,
127
- read,
128
- selectById,
129
- write
130
- } from "./chunk-O26GI2JP.js";
131
- import "./chunk-AZPCASRE.js";
132
- import "./chunk-DCOA4QSN.js";
133
- import "./chunk-XENYHRUE.js";
134
- import "./chunk-IPYUUY4E.js";
135
- import {
136
- buildLinkedSpacesSection,
137
- buildSpaceContextLayer
138
- } from "./chunk-C4FTUXVF.js";
139
- import "./chunk-KKY4B2Q2.js";
140
113
  import "./chunk-WZSRQNQG.js";
141
114
  import {
142
115
  assertDesktopAgentRuntimeTurnBodyHasNoRawSecrets,
143
116
  buildDesktopAgentRuntimeAgentConfigSnapshot,
144
117
  buildDesktopAgentRuntimeDialogHistorySnapshot
145
- } from "./chunk-YOCHZD7D.js";
118
+ } from "./chunk-NCGFB7NN.js";
146
119
  import {
120
+ projectToolMessageContent,
147
121
  resolveAgentImageInputSupport
148
- } from "./chunk-S3GS2PRL.js";
122
+ } from "./chunk-4BTHUYMY.js";
149
123
  import "./chunk-OPZYGHUC.js";
150
- import "./chunk-OUI3ZHYD.js";
124
+ import "./chunk-6OVCRC72.js";
151
125
  import {
152
126
  extractImagePartsFromResponseOutput,
153
127
  extractTextFromResponseOutput,
154
128
  toResponsesTools
155
- } from "./chunk-YTBMA7NO.js";
129
+ } from "./chunk-TSKWE74T.js";
156
130
  import {
157
131
  canonicalizeToolNames,
158
132
  prioritizeToolNames,
159
133
  resolveRuntimeToolSurfaceForAgent
160
- } from "./chunk-4SOKXIW4.js";
161
- import "./chunk-5MMAK75Q.js";
134
+ } from "./chunk-43UD5ZP7.js";
135
+ import {
136
+ estimateTokenCount,
137
+ getModelContextWindow,
138
+ getModelInfo,
139
+ planContextUsage
140
+ } from "./chunk-S73OEOHH.js";
162
141
  import {
163
142
  getApiEndpoint,
164
143
  getModelConfig,
165
144
  getProviderByModelName
166
- } from "./chunk-BBYVOSU2.js";
167
- import "./chunk-5CS33IBL.js";
145
+ } from "./chunk-S3UTETIC.js";
146
+ import "./chunk-PDL2AV3E.js";
168
147
  import "./chunk-JZPBVBIY.js";
148
+ import "./chunk-BYXBJQAS.js";
169
149
  import {
170
- asRecordOrEmpty
171
- } from "./chunk-KX6YBIHG.js";
172
- import "./chunk-IWX4UW2E.js";
173
- import {
174
- createDialogMessageKeyAndId,
175
- dialogMessageKey
176
- } from "./chunk-O4BU24WZ.js";
177
- import {
178
- asNonEmptyStringArray
179
- } from "./chunk-I42VC5KR.js";
180
- import {
181
- asOptionalFiniteNumber
182
- } from "./chunk-WWC7I6TA.js";
150
+ buildLinkedSpacesSection,
151
+ buildSpaceContextLayer
152
+ } from "./chunk-QLUFR47U.js";
153
+ import "./chunk-KKY4B2Q2.js";
183
154
  import {
184
155
  resolveToolBaseUrl
185
- } from "./chunk-JK7VW2FN.js";
156
+ } from "./chunk-5MIDPSSK.js";
186
157
  import {
187
158
  extractCustomId
188
159
  } from "./chunk-DFFIZ25G.js";
@@ -196,32 +167,68 @@ import {
196
167
  selectPendingUserInputQueue,
197
168
  tokenUsageLiveUpdate
198
169
  } from "./chunk-3ASDTTEI.js";
199
- import "./chunk-QSJ3HFEF.js";
200
- import "./chunk-DWLEOOGR.js";
201
170
  import {
202
171
  toErrorMessage
203
172
  } from "./chunk-HNMXYYJR.js";
204
- import "./chunk-XFOLQLDN.js";
173
+ import "./chunk-SOTZ6RDN.js";
174
+ import "./chunk-XENYHRUE.js";
175
+ import "./chunk-DWLEOOGR.js";
176
+ import "./chunk-IKXL2HZ3.js";
177
+ import "./chunk-524BDL33.js";
178
+ import "./chunk-7MYHLZ3F.js";
179
+ import {
180
+ selectAiRecentContentLimit,
181
+ selectCurrentServer,
182
+ selectGlobalPrompt,
183
+ selectKnowledgeCaptureLevel,
184
+ selectMaxExecutionTime,
185
+ selectSpaceContextLevel,
186
+ selectUserTonePreset
187
+ } from "./chunk-WTYKCU4W.js";
188
+ import "./chunk-Y5GCAMGP.js";
189
+ import {
190
+ asRecordOrEmpty
191
+ } from "./chunk-KX6YBIHG.js";
192
+ import "./chunk-3HHTVM6G.js";
193
+ import {
194
+ patch,
195
+ read,
196
+ selectById,
197
+ write
198
+ } from "./chunk-NITP2JDG.js";
199
+ import "./chunk-WPHL6ALY.js";
200
+ import {
201
+ createDialogMessageKeyAndId,
202
+ dialogMessageKey
203
+ } from "./chunk-O4BU24WZ.js";
204
+ import {
205
+ asNonEmptyStringArray
206
+ } from "./chunk-I42VC5KR.js";
207
+ import {
208
+ asOptionalFiniteNumber
209
+ } from "./chunk-WWC7I6TA.js";
210
+ import "./chunk-QSJ3HFEF.js";
211
+ import "./chunk-XHQWJUW4.js";
205
212
  import {
206
213
  selectIdentityToken,
207
214
  selectIdentityUser,
208
215
  selectIdentityUserId,
209
216
  selectRuntimeCurrentServer
210
- } from "./chunk-OOM6SJNR.js";
217
+ } from "./chunk-TSUJOM6N.js";
211
218
  import {
212
219
  getIsDesktopApp,
213
220
  isAbortError
214
221
  } from "./chunk-OOSFSFMA.js";
215
222
  import "./chunk-GBRG75BQ.js";
223
+ import {
224
+ isRecord
225
+ } from "./chunk-KUG52IAP.js";
216
226
  import {
217
227
  asTrimmedString
218
228
  } from "./chunk-3EUW3WEO.js";
219
229
  import "./chunk-U6VC4MU4.js";
220
- import {
221
- isRecord
222
- } from "./chunk-KUG52IAP.js";
223
- import "./chunk-4SN6J65J.js";
224
230
  import "./chunk-LCBAMY2M.js";
231
+ import "./chunk-4SN6J65J.js";
225
232
  import "./chunk-CF7PE763.js";
226
233
  import {
227
234
  asOptionalTrimmedString
@@ -518,25 +525,10 @@ var isRetryableInitialStreamError = (error) => {
518
525
  );
519
526
  };
520
527
  var waitForInitialStreamRetry = async (retryAfterMs, signal) => {
521
- if (signal?.aborted) {
522
- const abortError = new Error("Aborted");
523
- abortError.name = "AbortError";
524
- throw abortError;
525
- }
526
- await new Promise((resolve, reject) => {
527
- const onAbort = () => {
528
- clearTimeout(timeoutId);
529
- signal?.removeEventListener("abort", onAbort);
530
- const abortError = new Error("Aborted");
531
- abortError.name = "AbortError";
532
- reject(abortError);
533
- };
534
- const timeoutId = setTimeout(() => {
535
- signal?.removeEventListener("abort", onAbort);
536
- resolve();
537
- }, normalizeInitialStreamRetryAfterMs(retryAfterMs));
538
- signal?.addEventListener("abort", onAbort, { once: true });
539
- });
528
+ await waitForAbortableDelay(
529
+ normalizeInitialStreamRetryAfterMs(retryAfterMs),
530
+ signal
531
+ );
540
532
  };
541
533
 
542
534
  // packages/ai/chat/sendOpenAIResponseRequest.ts
@@ -618,7 +610,8 @@ var sendOpenAIResponseRequest = async ({
618
610
  dialogKey,
619
611
  parentMessageId,
620
612
  messageMetadata,
621
- quickChatPerfStartedAt
613
+ quickChatPerfStartedAt,
614
+ fallbackBodyData
622
615
  }) => {
623
616
  const { dispatch, getState, signal: thunkSignal } = thunkApi;
624
617
  const dialogId = extractCustomId(dialogKey);
@@ -652,7 +645,9 @@ var sendOpenAIResponseRequest = async ({
652
645
  hasHandedOff,
653
646
  finishReason,
654
647
  messageId,
655
- usage: state.usage ?? void 0
648
+ usage: state.usage ?? void 0,
649
+ responseId: typeof state.completedResponse?.id === "string" ? state.completedResponse.id : void 0,
650
+ ...state.responsesStateFallback ? { responsesStateFallback: true } : {}
656
651
  });
657
652
  const resetStateForRetry = () => {
658
653
  state.content = "";
@@ -846,6 +841,7 @@ var sendOpenAIResponseRequest = async ({
846
841
  return buildMeta(result.hasPendingInteraction, result.hasHandedOff, null);
847
842
  };
848
843
  let reader;
844
+ let responsesStateFallbackUsed = false;
849
845
  try {
850
846
  if (!parentMessageId) {
851
847
  dispatch(
@@ -878,13 +874,17 @@ var sendOpenAIResponseRequest = async ({
878
874
  }
879
875
  ] : []
880
876
  ];
881
- const sanitizedInput = Array.isArray(bodyData?.input) ? sanitizeOutboundResponsesInput(bodyData.input) : bodyData?.input;
882
- const baseBodyData = sanitizedInput !== bodyData?.input ? { ...bodyData, input: sanitizedInput } : bodyData;
883
- const requestBody = {
884
- ...baseBodyData,
885
- ...tools.length ? { tools, tool_choice: baseBodyData.tool_choice ?? "auto" } : {},
886
- stream: true
877
+ const buildRequestBody = (sourceBodyData) => {
878
+ const sanitizedInput = Array.isArray(sourceBodyData?.input) ? sanitizeOutboundResponsesInput(sourceBodyData.input) : sourceBodyData?.input;
879
+ const baseBodyData = sanitizedInput !== sourceBodyData?.input ? { ...sourceBodyData, input: sanitizedInput } : sourceBodyData;
880
+ return {
881
+ ...baseBodyData,
882
+ ...tools.length ? { tools, tool_choice: baseBodyData.tool_choice ?? "auto" } : {},
883
+ stream: true
884
+ };
887
885
  };
886
+ let requestBody = buildRequestBody(bodyData);
887
+ const fallbackRequestBody = fallbackBodyData ? buildRequestBody(fallbackBodyData) : null;
888
888
  const api = getApiEndpoint(agentConfig);
889
889
  const token = selectIdentityToken(getState());
890
890
  logQuickChatPerfStage(quickChatPerfStartedAt, "openai-response-fetch-starting", {
@@ -928,6 +928,17 @@ var sendOpenAIResponseRequest = async ({
928
928
  );
929
929
  }
930
930
  if (!response.ok) {
931
+ const rejectedStoredState = !!requestBody.previous_response_id && !!fallbackRequestBody && isResponsesConversationStateRejection(
932
+ response.status,
933
+ await response.clone().text().catch(() => "")
934
+ );
935
+ if (!responsesStateFallbackUsed && rejectedStoredState) {
936
+ responsesStateFallbackUsed = true;
937
+ state.responsesStateFallback = true;
938
+ requestBody = fallbackRequestBody;
939
+ resetStateForRetry();
940
+ continue attemptLoop;
941
+ }
931
942
  const errorMessage = await parseApiError(response);
932
943
  state.content = `[\u9519\u8BEF: ${errorMessage}]`;
933
944
  await finalize();
@@ -1025,6 +1036,12 @@ var sendOpenAIResponseRequest = async ({
1025
1036
  flush();
1026
1037
  }
1027
1038
  break;
1039
+ case "response.reasoning_text.delta":
1040
+ if (typeof event.delta === "string" && event.delta) {
1041
+ state.reasoning += event.delta;
1042
+ flush();
1043
+ }
1044
+ break;
1028
1045
  case "response.reasoning.done":
1029
1046
  if (event.text) {
1030
1047
  state.reasoning += event.text;
@@ -1083,6 +1100,9 @@ var sendOpenAIResponseRequest = async ({
1083
1100
  }
1084
1101
  case "response.completed":
1085
1102
  state.completedResponse = event.response ?? null;
1103
+ if (responsesStateFallbackUsed) {
1104
+ state.responsesStateFallback = true;
1105
+ }
1086
1106
  finishReason = event.response?.status === "completed" ? "stop" : event.response?.status ?? null;
1087
1107
  if (event.response?.usage) {
1088
1108
  state.usage = updateTotalUsage(state.usage, event.response.usage);
@@ -1666,14 +1686,15 @@ var compressOldToolResults = (messages, maxChars = 800) => {
1666
1686
  }
1667
1687
  return messages.map((msg, idx) => {
1668
1688
  if (msg.role !== "tool") return msg;
1669
- if (idx > lastToolCallAssistantIdx) return msg;
1670
1689
  const content = typeof msg.content === "string" ? msg.content : JSON.stringify(msg.content);
1671
- if (content.length <= maxChars) return msg;
1672
- return {
1673
- ...msg,
1674
- content: content.slice(0, maxChars) + `
1675
- \u2026[\u622A\u65AD\uFF0C\u539F\u59CB\u957F\u5EA6 ${content.length} \u5B57\u7B26]`
1676
- };
1690
+ const projected = projectToolMessageContent({
1691
+ content,
1692
+ isFresh: idx > lastToolCallAssistantIdx,
1693
+ toolName: msg.name,
1694
+ historicalMaxChars: maxChars
1695
+ });
1696
+ if (projected === content) return msg;
1697
+ return { ...msg, content: projected };
1677
1698
  });
1678
1699
  };
1679
1700
  var trimMessagesWithSummary = (messages, contextWindow, summaryTokenCount) => {
@@ -1710,8 +1731,8 @@ var trimMessagesWithSummary = (messages, contextWindow, summaryTokenCount) => {
1710
1731
  }
1711
1732
  let cutIndex = messages.length - keepCount;
1712
1733
  if (cutIndex < 0) cutIndex = 0;
1713
- while (cutIndex < messages.length && messages[cutIndex].role === "tool") {
1714
- cutIndex++;
1734
+ while (cutIndex > 0 && messages[cutIndex]?.role === "tool") {
1735
+ cutIndex--;
1715
1736
  }
1716
1737
  return messages.slice(cutIndex);
1717
1738
  };
@@ -2034,7 +2055,13 @@ var mergeAgentToolsWithRuntime = (agentConfig, referencedTools, mentionedTools,
2034
2055
  ...new Set(asNonEmptyStringArray(agentConfig.recommendedSkillHints))
2035
2056
  ];
2036
2057
  const skillPromptPatches = [
2037
- ...new Set(asNonEmptyStringArray(agentConfig.skillPromptPatches))
2058
+ .../* @__PURE__ */ new Set([
2059
+ ...asNonEmptyStringArray(agentConfig.skillPromptPatches),
2060
+ // 能力包的 promptPatch(方法论文档)与 skill reference 的 patch 走同一条
2061
+ // 注入链(buildSkillGuidanceBlock → buildSkillGuidancePromptBlock),
2062
+ // 让「工具 + 配套纪律」作为一个能力包整体注入 system prompt。
2063
+ ...expandEnabledPackPromptPatches(effectiveEnabledPacks)
2064
+ ])
2038
2065
  ];
2039
2066
  const webPadded = applyDefaultWebToolPacks({
2040
2067
  toolNames: baseTools,
@@ -2619,7 +2646,11 @@ async function consumeAgentRunStream(handlers) {
2619
2646
 
2620
2647
  // packages/ai/llm/isResponseAPIModel.ts
2621
2648
  var isResponseAPIModel = (agentConfig) => {
2622
- if (agentConfig.provider !== "openai") return false;
2649
+ const provider = agentConfig.provider?.trim().toLowerCase();
2650
+ if (provider === "deepseek") {
2651
+ return agentConfig.model?.trim().toLowerCase() === "deepseek-v4-flash";
2652
+ }
2653
+ if (provider !== "openai") return false;
2623
2654
  if (agentConfig.endpointKey === "responses") return true;
2624
2655
  if (!agentConfig.model) return false;
2625
2656
  try {
@@ -2920,6 +2951,12 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
2920
2951
  runtimeOptions.quickChatModelOverride
2921
2952
  );
2922
2953
  }
2954
+ if (runtimeOptions?.quickChatReasoningEffort && rawAgentConfig.model === "deepseek-v4-flash") {
2955
+ rawAgentConfig = {
2956
+ ...rawAgentConfig,
2957
+ reasoning_effort: runtimeOptions.quickChatReasoningEffort
2958
+ };
2959
+ }
2923
2960
  if (isLiveAudioOnlyAgent(rawAgentConfig)) {
2924
2961
  return rejectWithValue(
2925
2962
  "\u6B64 Agent \u4EC5\u652F\u6301\u5B9E\u65F6\u8BED\u97F3\u6A21\u5F0F\uFF0C\u8BF7\u4F7F\u7528\u8BED\u97F3\u9762\u677F\u8FDB\u884C\u5BF9\u8BDD\u3002"
@@ -3798,6 +3835,11 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3798
3835
  entrypoint: "chat-dialog",
3799
3836
  capabilities: ["streaming", "dialog-ui", "tool-cards"]
3800
3837
  },
3838
+ ...runtimeOptions?.quickChatReasoningEffort ? {
3839
+ runtimeOptions: {
3840
+ quickChatReasoningEffort: runtimeOptions.quickChatReasoningEffort
3841
+ }
3842
+ } : {},
3801
3843
  ...currentDialog?.spaceId ? { spaceId: currentDialog.spaceId } : {}
3802
3844
  });
3803
3845
  const remoteRunUrl = `${explicitServerBase.replace(/\/+$/, "")}/api/agent/run`;
@@ -4019,6 +4061,19 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4019
4061
  });
4020
4062
  let appendTempUserInput2 = true;
4021
4063
  let currentParentMessageId2 = parentMessageId ?? void 0;
4064
+ const storedResponsesState = currentDialog?.responsesState;
4065
+ let responsesState = selectResponsesConversationState(
4066
+ storedResponsesState,
4067
+ agentConfigForCall
4068
+ );
4069
+ if (storedResponsesState != null && !responsesState) {
4070
+ dispatch(
4071
+ patch({
4072
+ dbKey: dialogKey,
4073
+ changes: { responsesState: null }
4074
+ })
4075
+ );
4076
+ }
4022
4077
  const w2 = typeof globalThis !== "undefined" && globalThis.window ? globalThis.window : null;
4023
4078
  if (w2) w2.__LOOP_STOP_REASON__ = null;
4024
4079
  loopKey = `loop:${dialogId}`;
@@ -4163,8 +4218,17 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4163
4218
  messages: dynamicMessages,
4164
4219
  stableMessages,
4165
4220
  userInput: userInputText,
4166
- contexts
4221
+ contexts,
4222
+ responsesState
4167
4223
  });
4224
+ const fallbackBodyData = responsesState ? generateRequestBody({
4225
+ agentConfig: effectiveAgentConfig,
4226
+ messages: dynamicMessages,
4227
+ stableMessages,
4228
+ userInput: userInputText,
4229
+ contexts,
4230
+ responsesState: null
4231
+ }) : void 0;
4168
4232
  logQuickChatPerfStage2(quickChatPerfStartedAt, "stream-agent-model-request-starting", {
4169
4233
  responseApi: true,
4170
4234
  dynamicMessageCount: dynamicMessages.length,
@@ -4178,7 +4242,8 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4178
4242
  dialogKey,
4179
4243
  parentMessageId: currentParentMessageId2,
4180
4244
  messageMetadata: streamingMessageMetadata,
4181
- quickChatPerfStartedAt
4245
+ quickChatPerfStartedAt,
4246
+ fallbackBodyData
4182
4247
  });
4183
4248
  logQuickChatPerfStage2(quickChatPerfStartedAt, "stream-agent-model-request-finished", {
4184
4249
  responseApi: true,
@@ -4188,6 +4253,35 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4188
4253
  });
4189
4254
  appendTempUserInput2 = false;
4190
4255
  currentParentMessageId2 = void 0;
4256
+ if (meta.responseId) {
4257
+ responsesState = updateResponsesConversationState(
4258
+ agentConfigForCall,
4259
+ meta.responseId
4260
+ );
4261
+ if (responsesState) {
4262
+ dispatch(
4263
+ patch({
4264
+ dbKey: dialogKey,
4265
+ changes: { responsesState }
4266
+ })
4267
+ );
4268
+ } else if (meta.responsesStateFallback) {
4269
+ dispatch(
4270
+ patch({
4271
+ dbKey: dialogKey,
4272
+ changes: { responsesState: null }
4273
+ })
4274
+ );
4275
+ }
4276
+ } else if (meta.responsesStateFallback) {
4277
+ responsesState = null;
4278
+ dispatch(
4279
+ patch({
4280
+ dbKey: dialogKey,
4281
+ changes: { responsesState: null }
4282
+ })
4283
+ );
4284
+ }
4191
4285
  totalTurnUsage = updateTotalUsage(totalTurnUsage, meta.usage);
4192
4286
  if (meta.hasHandedOff) {
4193
4287
  if (!requestParentMessageId && meta.messageId) {
@@ -7,11 +7,11 @@ import {
7
7
  getToolRequestContext,
8
8
  resolveToolApiBaseUrl,
9
9
  resolveToolBaseUrl
10
- } from "./chunk-JK7VW2FN.js";
10
+ } from "./chunk-5MIDPSSK.js";
11
11
  import "./chunk-DFFIZ25G.js";
12
12
  import "./chunk-3ASDTTEI.js";
13
- import "./chunk-QSJ3HFEF.js";
14
13
  import "./chunk-DWLEOOGR.js";
14
+ import "./chunk-QSJ3HFEF.js";
15
15
  import "./chunk-KUG52IAP.js";
16
16
  import "./chunk-4VNS5WPM.js";
17
17
  export {