nolo-cli 0.33.0-alpha.13 → 0.33.0-alpha.15

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 (93) hide show
  1. package/{_executeModel-S346WSM5.js → _executeModel-N7UZ7MFF.js} +28 -28
  2. package/{action-OQWPNKAH.js → action-Q4KO7DDW.js} +4 -4
  3. package/{addContentAction-YVINZQTF.js → addContentAction-FRXDZKSI.js} +3 -3
  4. package/{addDialogAgentAction-6IOCIEPI.js → addDialogAgentAction-XL5G3LPR.js} +2 -2
  5. package/{agentDeleteCommand-6TTPXGS3.js → agentDeleteCommand-DNLUNGHG.js} +13 -13
  6. package/{agentEmailCommands-JIXFG6AM.js → agentEmailCommands-EMQB3J4A.js} +32 -32
  7. package/{agentListCommands-ZTT3KU35.js → agentListCommands-CBAILFEV.js} +15 -15
  8. package/{agentMachineCommands-25DROOMX.js → agentMachineCommands-2BW7345K.js} +14 -14
  9. package/{agentRecordCommands-N4L55KRX.js → agentRecordCommands-YFND6UBV.js} +31 -31
  10. package/{agentRunCommand-4CKVVQ4P.js → agentRunCommand-KUFIMMXB.js} +31 -31
  11. package/{agentRuntimeLocal-O4IDDLPA.js → agentRuntimeLocal-WPHIGITW.js} +13 -13
  12. package/{agentSlice-47VUR2ZD.js → agentSlice-DL5WYNE7.js} +3 -3
  13. package/{appDeleteCommands-SWXRVOE4.js → appDeleteCommands-QCKSZMHC.js} +15 -15
  14. package/{appDeployCommands-WQ3ZXXQH.js → appDeployCommands-X3RPEPOZ.js} +15 -15
  15. package/{appDeployStatusCommands-BM5CVBFC.js → appDeployStatusCommands-2DEUCBPH.js} +15 -15
  16. package/{appGetCommands-SHI5HG4U.js → appGetCommands-XD67TWUX.js} +15 -15
  17. package/{appListCommands-5IKTBNWH.js → appListCommands-5YWXIUEE.js} +15 -15
  18. package/{authCommand-VIHTCZDN.js → authCommand-EX5G5PF4.js} +7 -7
  19. package/{chatQueueReduxAdapter-GBGNFB7U.js → chatQueueReduxAdapter-YCAKX5VE.js} +13 -13
  20. package/{chunk-GJXRIOLS.js → chunk-2CNX3CJE.js} +4 -84
  21. package/{chunk-PIDDBIHR.js → chunk-2ORF5DS4.js} +18 -215
  22. package/{chunk-SHOLLFRN.js → chunk-5LWAL7BM.js} +12 -12
  23. package/{chunk-3WXRAHCG.js → chunk-6MSSX7FI.js} +1 -1
  24. package/{chunk-7XSIRXOO.js → chunk-6XYCMONZ.js} +8 -8
  25. package/{chunk-UM4H3URE.js → chunk-6YH4UR3E.js} +3 -3
  26. package/{chunk-OR2HNLVO.js → chunk-7EPNNOL4.js} +6 -6
  27. package/{chunk-RPRRIFXV.js → chunk-7OGIWPNK.js} +1 -1
  28. package/{chunk-SNFD447J.js → chunk-7RUIWGT2.js} +24 -24
  29. package/{chunk-DFUPZE6V.js → chunk-7SLMYTSF.js} +1 -1
  30. package/{chunk-CSNOI72O.js → chunk-7XR4OGXP.js} +4 -4
  31. package/{chunk-3GZXL6FM.js → chunk-AOWETAXX.js} +1 -1
  32. package/{chunk-PWI34D3P.js → chunk-BFCPDCYR.js} +3 -3
  33. package/{chunk-ZZV52MOO.js → chunk-BG7P4GQ3.js} +1 -1
  34. package/{chunk-2IVEXF7P.js → chunk-BHILFABL.js} +1 -1
  35. package/{chunk-DF22DYA4.js → chunk-CIHJW5VX.js} +3 -3
  36. package/{chunk-5WEQKEFO.js → chunk-CXGYEBNT.js} +2 -2
  37. package/{chunk-3RUW3ONU.js → chunk-DDET6246.js} +1 -1
  38. package/{chunk-RJKIB55Y.js → chunk-EQ6HOWEJ.js} +2 -2
  39. package/{chunk-6YXDOOSH.js → chunk-FH7VUJN5.js} +2 -2
  40. package/{chunk-6KOS7ZBZ.js → chunk-FV63ICZC.js} +1 -1
  41. package/{chunk-3UG2IIZ3.js → chunk-GTEHJWXU.js} +1 -1
  42. package/{chunk-AVO73UMB.js → chunk-H442K6U4.js} +102 -23
  43. package/{chunk-DKMOY3QI.js → chunk-HCOIKLSH.js} +2 -2
  44. package/{chunk-VBUQYOX7.js → chunk-IEHZHWN7.js} +1 -1
  45. package/{chunk-2QTEYCR7.js → chunk-JFUW3UTO.js} +1 -1
  46. package/{chunk-75U775RZ.js → chunk-KIL7V27H.js} +1 -1
  47. package/{chunk-4F5M2MW5.js → chunk-KMMQFY5O.js} +1 -1
  48. package/{chunk-IR6W62Q6.js → chunk-KZB5SNYH.js} +1 -14
  49. package/{chunk-ASDXPOJH.js → chunk-L5XKDBSH.js} +1 -1
  50. package/{chunk-SCUETSRP.js → chunk-LAZTMWIU.js} +1 -1
  51. package/{chunk-IXTC74NZ.js → chunk-LWVOFTNC.js} +4 -4
  52. package/{chunk-4EKYN24Q.js → chunk-N3ER5S5E.js} +1 -1
  53. package/{chunk-7YYHKBJP.js → chunk-OQVRTSZ5.js} +1 -1
  54. package/{chunk-UNOTBWZZ.js → chunk-QKCMP3LU.js} +2 -2
  55. package/{chunk-TIX6O4IC.js → chunk-TVUO5GM6.js} +11 -11
  56. package/{chunk-IKWTTKWG.js → chunk-V4MT7AEN.js} +1 -1
  57. package/{chunk-PQQXQV6V.js → chunk-V5EN447C.js} +3 -3
  58. package/{chunk-CPYYM4RJ.js → chunk-VIRTYWWE.js} +4 -5
  59. package/{chunk-MIRUCHZP.js → chunk-X52KQTFN.js} +16 -17
  60. package/{chunk-GUC65EFO.js → chunk-ZDUEQ6HC.js} +87 -33
  61. package/{createAgentAutomationAction-7DWATWIT.js → createAgentAutomationAction-DXG33NH6.js} +14 -14
  62. package/{createDialogAction-3CPIR267.js → createDialogAction-NSYFGB3J.js} +15 -15
  63. package/{createPageAction-5GUFQTAW.js → createPageAction-2L3BQD2N.js} +14 -14
  64. package/{dbSlice-UI2VCBLG.js → dbSlice-2YD2PZER.js} +2 -2
  65. package/{dialogCommands-XKC5TIAA.js → dialogCommands-7Q2C7ODY.js} +13 -13
  66. package/{dialogSlice-YFWNV3JJ.js → dialogSlice-LW6C3M6A.js} +13 -13
  67. package/{docCreateCommands-MRH4H6DW.js → docCreateCommands-6YHGFV54.js} +14 -14
  68. package/{docDeleteCommands-KJJU6NLM.js → docDeleteCommands-QN3VJSRH.js} +14 -14
  69. package/{docReadCommands-JXOSUS5I.js → docReadCommands-NYKOOFFB.js} +14 -14
  70. package/{docStore-SGQ6EE5P.js → docStore-EJUEJZQE.js} +15 -15
  71. package/{docUpdateCommands-AGUFF52W.js → docUpdateCommands-MBFOJPVJ.js} +14 -14
  72. package/{getPricing-L2ENXWHV.js → getPricing-J4VXWR5B.js} +3 -3
  73. package/{handleSendMessageAction-RGCSLENY.js → handleSendMessageAction-LB4EPR3X.js} +13 -13
  74. package/index.js +47 -47
  75. package/{machineCommands-P5DVPETV.js → machineCommands-RJZZCTN7.js} +31 -31
  76. package/{machineWsRunDispatch-66ZCBLIC.js → machineWsRunDispatch-PBRWNUXC.js} +31 -31
  77. package/{models-OX2S5C6Q.js → models-SQFOI4FI.js} +2 -2
  78. package/package.json +1 -1
  79. package/{read-2VHEHCAN.js → read-526GJR3R.js} +1 -1
  80. package/{readDocTool-CSWD6NPC.js → readDocTool-JNEZUOSM.js} +1 -1
  81. package/{readlineWorkspace-U2LVP43X.js → readlineWorkspace-I2LS4HKQ.js} +32 -32
  82. package/{removeDialogAgentAction-2T7BPM3T.js → removeDialogAgentAction-NPMEFEJW.js} +4 -4
  83. package/{runAgentClientLoop-WVL2KOS5.js → runAgentClientLoop-UDNCP7YC.js} +25 -25
  84. package/{setDialogExtraReferencesAction-GPT37HTW.js → setDialogExtraReferencesAction-ZZ6QWAG2.js} +3 -3
  85. package/{setPrimaryDialogAgentAction-3746P7IW.js → setPrimaryDialogAgentAction-BG72QA6S.js} +4 -4
  86. package/{settingSlice-FIFOQ6OR.js → settingSlice-JCCLCXZB.js} +3 -3
  87. package/{spaceCommands-O33WUJEV.js → spaceCommands-LU2YYNE4.js} +13 -13
  88. package/{spaceSlice-R5X62SG3.js → spaceSlice-KHPDJFFP.js} +14 -14
  89. package/{streamAgentChatTurn-CLC5VQYO.js → streamAgentChatTurn-7VYQ3GP7.js} +36 -46
  90. package/{switchDialogAgentAction-MQTUTQHL.js → switchDialogAgentAction-YPGPM2LL.js} +2 -2
  91. package/{tools-4QHXZBRQ.js → tools-ZDXFZEEW.js} +21 -21
  92. package/{tuiSummaryLlmCaller-EAWQ3IZX.js → tuiSummaryLlmCaller-WUVAOIYU.js} +9 -9
  93. package/{updateDialogTitleAction-IOSJSJ5S.js → updateDialogTitleAction-WREH6JRU.js} +14 -14
@@ -1,89 +1,12 @@
1
1
  import {
2
2
  MODEL_LOOKUP_MAP
3
- } from "./chunk-DFUPZE6V.js";
3
+ } from "./chunk-7SLMYTSF.js";
4
4
  import {
5
5
  ALL_MODELS
6
- } from "./chunk-2QTEYCR7.js";
6
+ } from "./chunk-JFUW3UTO.js";
7
7
  import {
8
- PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
9
- builtinAgentCatalogEntryById,
10
- builtinRuntimeFallbackEntries,
11
- isBuiltinPlatformAgentKey
12
- } from "./chunk-IR6W62Q6.js";
13
- import {
14
- parsePublicAgentId,
15
- publicAgentKey
16
- } from "./chunk-BJIRLHJR.js";
17
-
18
- // packages/agent-runtime/builtinPlatformAgentRoute.ts
19
- function resolveBuiltinAgentRuntimeFields(agentKey) {
20
- if (!isBuiltinPlatformAgentKey(agentKey)) return null;
21
- const entry = builtinAgentCatalogEntryById(parsePublicAgentId(agentKey));
22
- if (!entry) return null;
23
- return { provider: entry.provider, model: entry.model };
24
- }
25
-
26
- // packages/agent-runtime/builtinPlatformAgentConfigs.ts
27
- function buildConfig(e) {
28
- const key = publicAgentKey(e.id);
29
- const rawRecord = {
30
- dbKey: key,
31
- isPublic: true,
32
- provider: e.provider,
33
- model: e.model,
34
- apiSource: e.apiSource ?? "platform",
35
- useServerProxy: e.useServerProxy ?? true
36
- };
37
- if (e.hasImageOutput) rawRecord.hasImageOutput = true;
38
- if (e.imageModel) rawRecord.imageModel = e.imageModel;
39
- if (e.imageWorkflow) rawRecord.imageWorkflow = e.imageWorkflow;
40
- if (e.imageConfig) rawRecord.imageConfig = e.imageConfig;
41
- return {
42
- key,
43
- name: e.name,
44
- provider: e.provider,
45
- model: e.model,
46
- apiSource: e.apiSource ?? "platform",
47
- useServerProxy: e.useServerProxy ?? true,
48
- rawRecord
49
- };
50
- }
51
- var BUILTIN_PLATFORM_AGENT_CONFIGS = Object.fromEntries(
52
- builtinRuntimeFallbackEntries().map((e) => [publicAgentKey(e.id), buildConfig(e)])
53
- );
54
- function resolveBuiltinPlatformAgentConfig(agentRef) {
55
- return BUILTIN_PLATFORM_AGENT_CONFIGS[agentRef] ?? null;
56
- }
57
- function resolveBuiltinPlatformAgentRecord(agentRef) {
58
- const config = resolveBuiltinPlatformAgentConfig(agentRef);
59
- if (!config) return null;
60
- return {
61
- ...config.rawRecord,
62
- dbKey: agentRef,
63
- ...config.name ? { name: config.name } : {}
64
- };
65
- }
66
- function applyBuiltinAgentRuntimeOverride(agentKey, record) {
67
- const fields = resolveBuiltinAgentRuntimeFields(agentKey);
68
- if (!fields) return record;
69
- const current = record;
70
- const rawNeedsOverride = current.rawRecord != null && (current.rawRecord.provider !== fields.provider || current.rawRecord.model !== fields.model);
71
- if (current.provider === fields.provider && current.model === fields.model && !rawNeedsOverride) {
72
- return record;
73
- }
74
- return {
75
- ...record,
76
- provider: fields.provider,
77
- model: fields.model,
78
- ...current.rawRecord ? {
79
- rawRecord: {
80
- ...current.rawRecord,
81
- provider: fields.provider,
82
- model: fields.model
83
- }
84
- } : {}
85
- };
86
- }
8
+ PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY
9
+ } from "./chunk-KZB5SNYH.js";
87
10
 
88
11
  // packages/ai/llm/getModelContextWindow.ts
89
12
  var DEFAULT_CONTEXT_WINDOW = 256e3;
@@ -230,9 +153,6 @@ var DEFAULT_AUTO_EXECUTION_PROFILE = AUTO_EXECUTION_PROFILES[DEFAULT_AUTO_EXECUT
230
153
  var resolveAutoExecutionProfile = (tier) => AUTO_EXECUTION_PROFILES[tier ?? DEFAULT_AUTO_EXECUTION_TIER] ?? DEFAULT_AUTO_EXECUTION_PROFILE;
231
154
 
232
155
  export {
233
- resolveBuiltinPlatformAgentConfig,
234
- resolveBuiltinPlatformAgentRecord,
235
- applyBuiltinAgentRuntimeOverride,
236
156
  DEFAULT_CONTEXT_WINDOW,
237
157
  getModelContextWindow,
238
158
  getModelInfo,
@@ -5,9 +5,8 @@ import {
5
5
  resolveToolGuidedSections
6
6
  } from "./chunk-ZKUATCEY.js";
7
7
  import {
8
- getModelContextWindow,
9
- resolveBuiltinPlatformAgentConfig
10
- } from "./chunk-GJXRIOLS.js";
8
+ getModelContextWindow
9
+ } from "./chunk-2CNX3CJE.js";
11
10
  import {
12
11
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
13
12
  buildCompactionMetricsFromPlan,
@@ -19,11 +18,11 @@ import {
19
18
  formatMessagesForSummaryWithTruncation,
20
19
  planCompression,
21
20
  planContextUsage
22
- } from "./chunk-DKMOY3QI.js";
21
+ } from "./chunk-HCOIKLSH.js";
23
22
  import {
24
23
  findModelConfig,
25
24
  getProviderByModelName
26
- } from "./chunk-DFUPZE6V.js";
25
+ } from "./chunk-7SLMYTSF.js";
27
26
  import {
28
27
  buildDialogSummaryLayer
29
28
  } from "./chunk-3AOLVADY.js";
@@ -37,18 +36,12 @@ import {
37
36
  import {
38
37
  toErrorMessage
39
38
  } from "./chunk-HNMXYYJR.js";
40
- import {
41
- PLATFORM_HOSTED_QWEN_37_FLASH_MODEL
42
- } from "./chunk-OR2HNLVO.js";
43
39
  import {
44
40
  asRecordOrEmpty
45
41
  } from "./chunk-KX6YBIHG.js";
46
42
  import {
47
43
  asTrimmedLowercaseString
48
44
  } from "./chunk-QSJ3HFEF.js";
49
- import {
50
- PUBLIC_QWEN_37_FLASH_AGENT_KEY
51
- } from "./chunk-IR6W62Q6.js";
52
45
  import {
53
46
  isRecord
54
47
  } from "./chunk-KUG52IAP.js";
@@ -166,36 +159,6 @@ var resolveAgentImageInputSupport = (agent) => {
166
159
  };
167
160
 
168
161
  // packages/ai/agent/imagePreprocessing.ts
169
- var DEFAULT_IMAGE_PREPROCESSOR_AGENT_KEY = PUBLIC_QWEN_37_FLASH_AGENT_KEY;
170
- var DESCRIBE_IMAGE_PROMPT = `\u4F60\u662F\u4E00\u4E2A\u4E13\u4E1A\u7684\u56FE\u7247\u63CF\u8FF0\u52A9\u624B\u3002\u8BF7\u6781\u5176\u8BE6\u7EC6\u5730\u63CF\u8FF0\u8FD9\u5F20\u56FE\u7247\uFF0C\u76EE\u6807\u662F\u8BA9\u4E00\u4E2A\u770B\u4E0D\u5230\u56FE\u7247\u7684 AI \u52A9\u624B\u80FD\u5B8C\u5168\u7406\u89E3\u56FE\u7247\u5185\u5BB9\u3002
171
-
172
- \u8BF7\u6309\u4EE5\u4E0B\u7ED3\u6784\u63CF\u8FF0\uFF1A
173
-
174
- 1. **\u56FE\u7247\u7C7B\u578B**\uFF1A\u8FD9\u662F\u754C\u9762\u622A\u56FE\u3001\u7167\u7247\u3001\u56FE\u8868\u3001\u6587\u6863\u3001\u8FD8\u662F\u5176\u4ED6\u7C7B\u578B\uFF1F
175
-
176
- 2. **\u5982\u679C\u662F\u754C\u9762\u622A\u56FE**\uFF1A
177
- - \u5217\u51FA\u6240\u6709\u53EF\u89C1\u7684 UI \u5143\u7D20\uFF1A\u6807\u9898\u680F\u3001\u5BFC\u822A\u83DC\u5355\u3001\u6309\u94AE\u3001\u8F93\u5165\u6846\u3001\u5217\u8868\u9879\u7B49
178
- - \u9010\u4E2A\u63CF\u8FF0\u6BCF\u4E2A\u5143\u7D20\u7684\u6587\u5B57\u5185\u5BB9\u548C\u4F4D\u7F6E\uFF08\u5982"\u5DE6\u4E0A\u89D2"\u3001"\u53F3\u4FA7\u680F"\uFF09
179
- - \u63CF\u8FF0\u989C\u8272\u4E3B\u9898\u3001\u5E03\u5C40\u7ED3\u6784\u3001\u5F53\u524D\u72B6\u6001\uFF08\u5982\u9009\u4E2D\u3001hover\u3001loading\uFF09
180
- - \u5982\u679C\u6709\u5F39\u7A97/\u5BF9\u8BDD\u6846/\u901A\u77E5\uFF0C\u5B8C\u6574\u8BB0\u5F55\u5176\u6587\u5B57\u5185\u5BB9
181
-
182
- 3. **\u5982\u679C\u662F\u751F\u6D3B\u7167\u7247**\uFF1A
183
- - \u573A\u666F/\u73AF\u5883\uFF1A\u5BA4\u5185/\u5BA4\u5916\u3001\u5730\u70B9\u7C7B\u578B\u3001\u65F6\u95F4\u611F\uFF08\u767D\u5929/\u591C\u665A\uFF09
184
- - \u4EBA\u7269\uFF1A\u4EBA\u6570\u3001\u59FF\u52BF\u3001\u8868\u60C5\u3001\u7A7F\u7740\u3001\u52A8\u4F5C
185
- - \u7269\u4F53\uFF1A\u524D\u666F/\u80CC\u666F\u4E2D\u7684\u6240\u6709\u663E\u8457\u7269\u4F53
186
- - \u5149\u7EBF\u3001\u5929\u6C14\u3001\u6C1B\u56F4
187
-
188
- 4. **\u5982\u679C\u662F\u56FE\u8868/\u6570\u636E\u56FE**\uFF1A
189
- - \u56FE\u8868\u7C7B\u578B\uFF08\u67F1\u72B6\u56FE/\u6298\u7EBF\u56FE/\u997C\u56FE\u7B49\uFF09
190
- - \u5750\u6807\u8F74\u6807\u7B7E\u3001\u6570\u503C\u8303\u56F4\u3001\u5355\u4F4D
191
- - \u5173\u952E\u6570\u636E\u70B9\u548C\u8D8B\u52BF
192
- - \u56FE\u4F8B\u3001\u6807\u9898
193
-
194
- 5. **\u6240\u6709\u53EF\u89C1\u6587\u5B57**\uFF1A\u9010\u5B57\u8BB0\u5F55\u56FE\u7247\u4E2D\u51FA\u73B0\u7684\u6240\u6709\u6587\u5B57\uFF08UI \u6587\u5B57\u3001\u8DEF\u724C\u3001\u6807\u7B7E\u3001\u6C34\u5370\u7B49\uFF09\uFF0C\u4FDD\u7559\u539F\u6587\u3002
195
-
196
- 6. **\u989C\u8272\u548C\u5E03\u5C40**\uFF1A\u4E3B\u8272\u8C03\u3001\u5E03\u5C40\u7ED3\u6784\u3001\u7A7A\u95F4\u5173\u7CFB\u3002
197
-
198
- \u8BF7\u5C3D\u53EF\u80FD\u8BE6\u7EC6\uFF0C\u4E0D\u8981\u9057\u6F0F\u4EFB\u4F55\u53EF\u89C1\u4FE1\u606F\u3002`;
199
162
  function extractImageUrlsFromMessages(messages) {
200
163
  const urls = [];
201
164
  for (const msg of messages) {
@@ -211,111 +174,6 @@ function extractImageUrlsFromMessages(messages) {
211
174
  function hasImageInRuntimeMessages(messages) {
212
175
  return extractImageUrlsFromMessages(messages).length > 0;
213
176
  }
214
- var IMAGE_DESCRIPTION_CACHE = /* @__PURE__ */ new Map();
215
- function cacheKeyForUrls(urls) {
216
- return urls.slice().sort().join("||");
217
- }
218
- async function preprocessImagesForTextOnlyAgent(messages, describeImage) {
219
- const imageUrls = extractImageUrlsFromMessages(messages);
220
- if (imageUrls.length === 0) return messages;
221
- const key = cacheKeyForUrls(imageUrls);
222
- let description = IMAGE_DESCRIPTION_CACHE.get(key);
223
- if (!description) {
224
- const rawDesc = await describeImage(imageUrls);
225
- if (rawDesc === null || !rawDesc.trim()) return messages;
226
- description = rawDesc.trim();
227
- IMAGE_DESCRIPTION_CACHE.set(key, description);
228
- }
229
- const descriptionText = `[\u56FE\u7247\u63CF\u8FF0] ${description}`;
230
- return messages.map((msg) => {
231
- if (!Array.isArray(msg.content)) return msg;
232
- const hasImage = msg.content.some((p) => p?.type === "image_url");
233
- if (!hasImage) return msg;
234
- const newContent = msg.content.map((part) => {
235
- if (part && typeof part === "object" && part.type === "image_url") {
236
- return { type: "text", text: descriptionText };
237
- }
238
- return part;
239
- }).filter((p) => p !== null && p !== void 0);
240
- return { ...msg, content: newContent };
241
- });
242
- }
243
- async function describeImageWithLocalProvider(adapter, imageUrls, visionAgentConfig) {
244
- if (imageUrls.length === 0) return null;
245
- try {
246
- const config = visionAgentConfig ?? resolveBuiltinPlatformAgentConfig(DEFAULT_IMAGE_PREPROCESSOR_AGENT_KEY);
247
- if (!config) {
248
- console.warn("[imagePreprocessing] vision agent config not found, skipping");
249
- return null;
250
- }
251
- const visionProvider = await adapter.resolveProvider(config);
252
- const result = await visionProvider.complete(
253
- [{ role: "user", content: buildDescribeContentParts(imageUrls) }],
254
- { timeoutMs: 3e4 }
255
- );
256
- const text = result.content?.trim();
257
- if (!text) return null;
258
- return text;
259
- } catch (error) {
260
- console.warn("[imagePreprocessing] vision describe failed, will fallback:", error);
261
- return null;
262
- }
263
- }
264
- async function describeImageViaServerProxy(serverUrl, authToken, imageUrls, visionAgentKey) {
265
- if (imageUrls.length === 0) return null;
266
- const agentKey = visionAgentKey ?? DEFAULT_IMAGE_PREPROCESSOR_AGENT_KEY;
267
- const { model: visionModel, provider: visionProvider } = resolveDefaultVisionModelConfig(agentKey);
268
- try {
269
- const payload = {
270
- model: visionModel,
271
- messages: [{ role: "user", content: buildDescribeContentParts(imageUrls) }],
272
- stream: false,
273
- provider: visionProvider,
274
- agentKey,
275
- // server proxy 需要 url 字段,但 nolo 平台 agent 的上游由 server 端路由,
276
- // 这里放一个占位 url,server 端会根据 provider/model 覆盖。
277
- url: "https://api.ollama.com/v1/chat/completions"
278
- };
279
- const response = await fetch(`${serverUrl}/api/chat`, {
280
- method: "POST",
281
- headers: {
282
- "Content-Type": "application/json",
283
- Authorization: `Bearer ${authToken}`
284
- },
285
- body: JSON.stringify(payload),
286
- signal: AbortSignal.timeout(3e4)
287
- });
288
- if (!response.ok) {
289
- console.warn(`[imagePreprocessing] server proxy vision call failed: ${response.status}`);
290
- return null;
291
- }
292
- const data = await response.json();
293
- const text = data?.choices?.[0]?.message?.content;
294
- if (typeof text === "string" && text.trim()) {
295
- return text.trim();
296
- }
297
- return null;
298
- } catch (error) {
299
- console.warn("[imagePreprocessing] server proxy vision describe failed:", error);
300
- return null;
301
- }
302
- }
303
- function buildDescribeContentParts(imageUrls) {
304
- const parts = [{ type: "text", text: DESCRIBE_IMAGE_PROMPT }];
305
- for (const url of imageUrls) {
306
- parts.push({ type: "image_url", image_url: { url } });
307
- }
308
- return parts;
309
- }
310
- function resolveDefaultVisionModelConfig(agentKey) {
311
- const key = agentKey ?? DEFAULT_IMAGE_PREPROCESSOR_AGENT_KEY;
312
- const config = resolveBuiltinPlatformAgentConfig(key);
313
- return {
314
- model: config?.model ?? PLATFORM_HOSTED_QWEN_37_FLASH_MODEL,
315
- provider: config?.provider ?? "nolo",
316
- config
317
- };
318
- }
319
177
  var IMAGE_OMITTED_PLACEHOLDER = "[Image content omitted: model does not support image input]";
320
178
  function stripImagePartsFromContent(content) {
321
179
  if (!Array.isArray(content)) return content;
@@ -329,45 +187,10 @@ function stripImagePartsFromMessages(messages) {
329
187
  content: stripImagePartsFromContent(msg.content)
330
188
  }));
331
189
  }
332
- async function tryPreprocessWebImageOrReject(messages, agentConfig, initialHistoryIds, serverUrl, authToken) {
190
+ async function stripImagePartsForTextOnlyAgent(messages, agentConfig) {
333
191
  const supportsVision = resolveAgentImageInputSupport(agentConfig);
334
192
  const hasImages = hasImageInRuntimeMessages(messages);
335
- const needsPreprocessing = !supportsVision && hasImages;
336
- if (!needsPreprocessing) {
337
- const firstDynamicIdx = messages.findIndex((m) => m.id && !initialHistoryIds.has(m.id));
338
- const splitIdx2 = firstDynamicIdx === -1 ? messages.length : firstDynamicIdx;
339
- return {
340
- kind: "ok",
341
- messages,
342
- stableMessages: messages.slice(0, splitIdx2),
343
- dynamicMessages: messages.slice(splitIdx2)
344
- };
345
- }
346
- let finalMessages = messages;
347
- if (serverUrl && authToken) {
348
- try {
349
- const preprocessed = await preprocessImagesForTextOnlyAgent(
350
- messages,
351
- (urls) => describeImageViaServerProxy(serverUrl, authToken, urls)
352
- );
353
- if (preprocessed !== messages) {
354
- finalMessages = preprocessed;
355
- }
356
- } catch (e) {
357
- console.warn("[imagePreprocessing] web vision describe error:", e);
358
- }
359
- }
360
- if (finalMessages === messages) {
361
- finalMessages = stripImagePartsFromMessages(messages);
362
- }
363
- const newFirstDynamicIdx = finalMessages.findIndex((m) => m.id && !initialHistoryIds.has(m.id));
364
- const splitIdx = newFirstDynamicIdx === -1 ? finalMessages.length : newFirstDynamicIdx;
365
- return {
366
- kind: "ok",
367
- messages: finalMessages,
368
- stableMessages: finalMessages.slice(0, splitIdx),
369
- dynamicMessages: finalMessages.slice(splitIdx)
370
- };
193
+ return { messages: !supportsVision && hasImages ? stripImagePartsFromMessages(messages) : messages };
371
194
  }
372
195
 
373
196
  // packages/agent-runtime/toolCallPairing.ts
@@ -1213,19 +1036,9 @@ function prepareHistoryForNextTurn(history, contextReferenceResolver) {
1213
1036
  };
1214
1037
  });
1215
1038
  }
1216
- var IMAGE_OMITTED_PLACEHOLDER2 = "[Image content omitted: model does not support image input]";
1217
- function stripImagePartsFromContent2(content) {
1218
- if (!Array.isArray(content)) return content;
1219
- const filtered = content.filter((part) => part?.type !== "image_url");
1220
- if (filtered.length === 0) return IMAGE_OMITTED_PLACEHOLDER2;
1221
- return filtered;
1222
- }
1223
1039
  function filterImagePartsFromMessages(messages, supportsImages) {
1224
1040
  if (supportsImages) return messages;
1225
- return messages.map((msg) => ({
1226
- ...msg,
1227
- content: stripImagePartsFromContent2(msg.content)
1228
- }));
1041
+ return stripImagePartsFromMessages(messages);
1229
1042
  }
1230
1043
  function buildMessages(args) {
1231
1044
  if (args.contextBlockScopes?.length) {
@@ -1468,26 +1281,12 @@ async function runLocalAgentTurn(input) {
1468
1281
  hasVision: agentConfig.hasVision
1469
1282
  });
1470
1283
  if (!supportsImages && hasImageInRuntimeMessages(messages)) {
1471
- const imageUrls = extractImageUrlsFromMessages(messages);
1472
- const preprocessed = await preprocessImagesForTextOnlyAgent(
1473
- messages,
1474
- (urls) => describeImageWithLocalProvider(input.adapter, urls)
1475
- );
1476
- if (preprocessed !== messages) {
1477
- messages = preprocessed;
1478
- emitLoopEvent(input, {
1479
- kind: "image-preprocessed",
1480
- atMs: Date.now(),
1481
- imageCount: imageUrls.length
1482
- });
1483
- } else {
1484
- messages = filterImagePartsFromMessages(messages, false);
1485
- emitLoopEvent(input, {
1486
- kind: "image-downgraded",
1487
- reason: "no-vision",
1488
- atMs: Date.now()
1489
- });
1490
- }
1284
+ messages = filterImagePartsFromMessages(messages, false);
1285
+ emitLoopEvent(input, {
1286
+ kind: "image-downgraded",
1287
+ reason: "no-vision",
1288
+ atMs: Date.now()
1289
+ });
1491
1290
  }
1492
1291
  const userInputText = extractUserInputText(input.input);
1493
1292
  let toolCallCount = 0;
@@ -1528,6 +1327,10 @@ async function runLocalAgentTurn(input) {
1528
1327
  messages: requestMessages,
1529
1328
  options: {
1530
1329
  ...typeof input.timeoutMs === "number" ? { timeoutMs: input.timeoutMs } : {},
1330
+ // 用户取消信号穿进 provider options:providerStreamRetry 据此在
1331
+ // 取消后跳过重试,provider 分支(如 antigravity/openai-compatible)
1332
+ // 也可把 fetch 绑定到同一信号,实现真正的传输层取消。
1333
+ ...input.abortSignal ? { signal: input.abortSignal } : {},
1531
1334
  // 计费归因:续聊轮次带上 dialogId,platform proxy 才能把 token 记录
1532
1335
  // 归到具体对话而不是 chat-proxy 兜底桶。新对话首轮 id 尚未分配。
1533
1336
  ...input.continueDialogId ? { dialogId: input.continueDialogId } : {},
@@ -1789,7 +1592,7 @@ export {
1789
1592
  readCommandActionGatePayload,
1790
1593
  readActionGate,
1791
1594
  summarizeToolArguments,
1792
- tryPreprocessWebImageOrReject,
1595
+ stripImagePartsForTextOnlyAgent,
1793
1596
  resolveHistoricalToolContentCap,
1794
1597
  projectToolMessageContent,
1795
1598
  LOCAL_AGENT_CONFIG_MISSING_CODE,
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  ANTIGRAVITY_CLOUD_CODE_BASE_URL,
6
6
  isAntigravityOAuthAgent
7
- } from "./chunk-SCUETSRP.js";
7
+ } from "./chunk-LAZTMWIU.js";
8
8
  import {
9
9
  clipMultilineText,
10
10
  fetchAndSerializeTable,
11
11
  resolveBuiltinSkillPage,
12
12
  waitForAbortableDelay
13
- } from "./chunk-SNFD447J.js";
13
+ } from "./chunk-7RUIWGT2.js";
14
14
  import {
15
15
  createDrainExhaustedResponse,
16
16
  isCoreDrainingBody,
@@ -20,19 +20,19 @@ import {
20
20
  } from "./chunk-RQSOAMPJ.js";
21
21
  import {
22
22
  slateToSimplifiedMarkdown
23
- } from "./chunk-75U775RZ.js";
23
+ } from "./chunk-KIL7V27H.js";
24
24
  import {
25
25
  extractCategorizedMentions
26
26
  } from "./chunk-GM6PU7B6.js";
27
27
  import {
28
28
  fetchAndCacheMessages
29
- } from "./chunk-AVO73UMB.js";
29
+ } from "./chunk-H442K6U4.js";
30
30
  import {
31
31
  shouldUseServerProxy
32
32
  } from "./chunk-YYLHWIW6.js";
33
33
  import {
34
34
  fetchServerSyncedCredential
35
- } from "./chunk-IXTC74NZ.js";
35
+ } from "./chunk-LWVOFTNC.js";
36
36
  import {
37
37
  buildCurrentTimeBlock,
38
38
  buildIdentityBlock,
@@ -48,20 +48,20 @@ import {
48
48
  } from "./chunk-NNWHHCVP.js";
49
49
  import {
50
50
  buildProviderAuthHeaders
51
- } from "./chunk-7YYHKBJP.js";
51
+ } from "./chunk-OQVRTSZ5.js";
52
52
  import {
53
53
  estimateTokenCount
54
- } from "./chunk-DKMOY3QI.js";
54
+ } from "./chunk-HCOIKLSH.js";
55
55
  import {
56
56
  isOpenAiResponsesModel,
57
57
  resolvePlatformChatCompletionsEndpoint,
58
58
  resolvePlatformResponsesEndpoint
59
- } from "./chunk-CPYYM4RJ.js";
59
+ } from "./chunk-VIRTYWWE.js";
60
60
  import {
61
61
  clampReasoningEffort,
62
62
  getModelConfig,
63
63
  isModelSupportReasoningEffort
64
- } from "./chunk-DFUPZE6V.js";
64
+ } from "./chunk-7SLMYTSF.js";
65
65
  import {
66
66
  createFileCredentialBroker
67
67
  } from "./chunk-RQFO3CAF.js";
@@ -85,13 +85,13 @@ import {
85
85
  isDeepInfraKimiModel,
86
86
  isFireworksKimiModel,
87
87
  resolveFireworksKimiModel
88
- } from "./chunk-OR2HNLVO.js";
88
+ } from "./chunk-7EPNNOL4.js";
89
89
  import {
90
90
  createSpaceKey
91
- } from "./chunk-4F5M2MW5.js";
91
+ } from "./chunk-KMMQFY5O.js";
92
92
  import {
93
93
  read
94
- } from "./chunk-UM4H3URE.js";
94
+ } from "./chunk-6YH4UR3E.js";
95
95
  import {
96
96
  asTrimmedLowercaseString
97
97
  } from "./chunk-QSJ3HFEF.js";
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-YDTYDA5W.js";
8
8
  import {
9
9
  toSafeAgentSummary
10
- } from "./chunk-2IVEXF7P.js";
10
+ } from "./chunk-BHILFABL.js";
11
11
  import {
12
12
  PUBLIC_AGENT_KEY_PREFIX,
13
13
  isOwnedAgentKey,
@@ -11,10 +11,10 @@ import {
11
11
  deleteDialog,
12
12
  resetMsgs,
13
13
  toast
14
- } from "./chunk-AVO73UMB.js";
14
+ } from "./chunk-H442K6U4.js";
15
15
  import {
16
16
  deleteServerSyncedCredential
17
- } from "./chunk-IXTC74NZ.js";
17
+ } from "./chunk-LWVOFTNC.js";
18
18
  import {
19
19
  require_date_fns
20
20
  } from "./chunk-M76ECQRD.js";
@@ -33,7 +33,7 @@ import {
33
33
  isSystemAdmin,
34
34
  selectRemoteServer,
35
35
  selectRemoteSyncServers
36
- } from "./chunk-UNOTBWZZ.js";
36
+ } from "./chunk-QKCMP3LU.js";
37
37
  import {
38
38
  asRecordOrEmpty
39
39
  } from "./chunk-KX6YBIHG.js";
@@ -44,7 +44,7 @@ import {
44
44
  createSpaceKey,
45
45
  localSpaceAuthorityPatchStamp,
46
46
  normalizeSpaceId
47
- } from "./chunk-4F5M2MW5.js";
47
+ } from "./chunk-KMMQFY5O.js";
48
48
  import {
49
49
  patch,
50
50
  read,
@@ -57,7 +57,7 @@ import {
57
57
  uploadFileAction,
58
58
  upsertSSREntity,
59
59
  write
60
- } from "./chunk-UM4H3URE.js";
60
+ } from "./chunk-6YH4UR3E.js";
61
61
  import {
62
62
  DB_PREFIX,
63
63
  SEPARATOR,
@@ -86,7 +86,7 @@ import {
86
86
  } from "./chunk-I42VC5KR.js";
87
87
  import {
88
88
  readAction
89
- } from "./chunk-IR6W62Q6.js";
89
+ } from "./chunk-KZB5SNYH.js";
90
90
  import {
91
91
  DEVICE_LOCAL_OWNER_ID,
92
92
  asyncThunkCreator,
@@ -9686,7 +9686,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
9686
9686
  const spaceKey = createSpaceKey.space(spaceId);
9687
9687
  const readSpace = async (dbKey) => {
9688
9688
  try {
9689
- const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-UI2VCBLG.js");
9689
+ const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-2YD2PZER.js");
9690
9690
  if (fresh) {
9691
9691
  return await dispatch(readAndWait2(dbKey)).unwrap();
9692
9692
  }
@@ -10100,7 +10100,7 @@ var spaceSlice = createSliceWithThunks3({
10100
10100
  markDialogRead: create.asyncThunk(
10101
10101
  async (payload, thunkAPI) => {
10102
10102
  if (payload.dialogKey) {
10103
- const { patch: patch2 } = await import("./dbSlice-UI2VCBLG.js");
10103
+ const { patch: patch2 } = await import("./dbSlice-2YD2PZER.js");
10104
10104
  try {
10105
10105
  await thunkAPI.dispatch(
10106
10106
  patch2({ dbKey: payload.dialogKey, changes: { unreadAt: null } })
@@ -13,7 +13,7 @@ import {
13
13
  readAction,
14
14
  readRequestManager,
15
15
  resolveAgentReadServers
16
- } from "./chunk-IR6W62Q6.js";
16
+ } from "./chunk-KZB5SNYH.js";
17
17
  import {
18
18
  asyncThunkCreator,
19
19
  buildCreateSlice,
@@ -707,7 +707,7 @@ var dbSlice = createSliceWithThunks({
707
707
  // 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
708
708
  read: create.asyncThunk(
709
709
  async (payload, thunkApi) => {
710
- const { readAction: readAction2 } = await import("./read-2VHEHCAN.js");
710
+ const { readAction: readAction2 } = await import("./read-526GJR3R.js");
711
711
  return readAction2(payload, thunkApi);
712
712
  },
713
713
  {
@@ -781,7 +781,7 @@ var dbSlice = createSliceWithThunks({
781
781
  // 这里改成动态 import,运行期才解析,彻底断开这条边。
782
782
  share: create.asyncThunk(
783
783
  async (config, thunkApi) => {
784
- const { shareResourceAction } = await import("./action-OQWPNKAH.js");
784
+ const { shareResourceAction } = await import("./action-Q4KO7DDW.js");
785
785
  return shareResourceAction(config, thunkApi);
786
786
  }
787
787
  ),
@@ -567,8 +567,6 @@ var PLATFORM_HOSTED_GEMINI_37_FLASH_PRICE = {
567
567
  // 0.6 credits
568
568
  };
569
569
  var isPlatformHostedGeminiModel = (model) => asTrimmedLowercaseString(model) === PLATFORM_HOSTED_GEMINI_37_FLASH_MODEL;
570
- var PLATFORM_HOSTED_QWEN_37_FLASH_MODEL = "qwen3.7-flash";
571
- var isPlatformHostedQwen37FlashModel = (model) => asTrimmedLowercaseString(model) === PLATFORM_HOSTED_QWEN_37_FLASH_MODEL;
572
570
  var PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL = "deepseek-v4-flash";
573
571
  var PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL = "deepseek-v4-flash-vision-exp";
574
572
  var PLATFORM_HOSTED_DEEPSEEK_PRO_MODEL = "deepseek-v4-pro";
@@ -593,8 +591,12 @@ var PLATFORM_HOSTED_DEEPSEEK_PRO_OFF_PEAK_PRICE = {
593
591
  output: 13.5
594
592
  };
595
593
  var isDeepSeekOffPeakBeijingTime = (nowMs = Date.now()) => {
596
- const beijingHour = (new Date(nowMs).getUTCHours() + 8 + 24) % 24;
597
- return beijingHour >= 0 && beijingHour < 8;
594
+ const beijing = new Date(nowMs + 8 * 60 * 60 * 1e3);
595
+ const beijingDay = beijing.getUTCDay();
596
+ const beijingHour = beijing.getUTCHours();
597
+ if (beijingDay === 0 || beijingDay === 6) return true;
598
+ const isPeakWindow = beijingHour >= 9 && beijingHour < 12 || beijingHour >= 14 && beijingHour < 18;
599
+ return !isPeakWindow;
598
600
  };
599
601
  var getPlatformHostedDeepSeekV4Price = (model, nowMs = Date.now()) => {
600
602
  const isOffPeak = isDeepSeekOffPeakBeijingTime(nowMs);
@@ -755,8 +757,6 @@ export {
755
757
  isPlatformHostedKimiK26Model,
756
758
  isPlatformHostedGlmModel,
757
759
  isPlatformHostedGeminiModel,
758
- PLATFORM_HOSTED_QWEN_37_FLASH_MODEL,
759
- isPlatformHostedQwen37FlashModel,
760
760
  PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
761
761
  PLATFORM_HOSTED_DEEPSEEK_FLASH_VISION_EXP_MODEL,
762
762
  PLATFORM_HOSTED_DEEPSEEK_FLASH_PEAK_PRICE,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_AGENT_BASE_POLICY,
3
3
  DEFAULT_USER_PREFERENCE_PROFILE
4
- } from "./chunk-UNOTBWZZ.js";
4
+ } from "./chunk-QKCMP3LU.js";
5
5
 
6
6
  // packages/ai/policy/runtimePolicy.ts
7
7
  var clampLevel = (value, fallback) => {