nolo-cli 0.28.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/{_executeModel-SUMILI7E.js → _executeModel-YQ57CFSN.js} +20 -20
  2. package/{action-5MNAXR5B.js → action-6BM26ZYM.js} +4 -4
  3. package/{addContentAction-UNSYTVTB.js → addContentAction-HLTFX56O.js} +3 -3
  4. package/{addDialogAgentAction-LJGNP2AO.js → addDialogAgentAction-Q2TYWDO6.js} +2 -2
  5. package/{agentDeleteCommand-GEHAXWM6.js → agentDeleteCommand-VP4VLCMG.js} +10 -10
  6. package/{agentEmailCommands-PQXAKGK2.js → agentEmailCommands-PSLJLQRR.js} +23 -23
  7. package/{agentListCommands-V2IIWNTX.js → agentListCommands-MJJJG3OW.js} +11 -11
  8. package/{agentMachineCommands-Y47CABE2.js → agentMachineCommands-IP2A26V7.js} +10 -10
  9. package/{agentRecordCommands-UYUJUT4K.js → agentRecordCommands-3HK3AR3H.js} +23 -23
  10. package/{agentRunCommand-3P6CCJQK.js → agentRunCommand-2IX2ELJQ.js} +23 -23
  11. package/{agentRuntimeLocal-ZALQDCZ3.js → agentRuntimeLocal-VI3NHLDU.js} +7 -7
  12. package/{agentSlice-LH2YKWE7.js → agentSlice-RR6OT2BW.js} +3 -3
  13. package/{appDeleteCommands-XELAKISE.js → appDeleteCommands-SF2V6QYZ.js} +11 -11
  14. package/{appDeployCommands-PFHVHXJ3.js → appDeployCommands-3EPVR545.js} +11 -11
  15. package/{appDeployStatusCommands-RULB3DGE.js → appDeployStatusCommands-O65Y747J.js} +11 -11
  16. package/{appGetCommands-A3NLQ2U5.js → appGetCommands-AHDOF4SS.js} +11 -11
  17. package/{appListCommands-NQLJ7RHY.js → appListCommands-Y7YCXODU.js} +11 -11
  18. package/{chunk-7OYY7W4W.js → chunk-2IN43Q72.js} +3 -3
  19. package/{chunk-7IX2Z2IF.js → chunk-33K2M3AU.js} +2 -2
  20. package/{chunk-54VHTARN.js → chunk-3LJ4RSSF.js} +1 -1
  21. package/{chunk-HTLBU4ZY.js → chunk-4S7B6YC5.js} +7 -7
  22. package/{chunk-I6RJGORZ.js → chunk-BOPFLKHA.js} +1 -1
  23. package/{chunk-D36OKPFG.js → chunk-BYHN2CP5.js} +1 -1
  24. package/{chunk-OXLLFZNF.js → chunk-DBUNOYLF.js} +1 -1
  25. package/{chunk-S6KVFOUG.js → chunk-ENUJPSZN.js} +2 -2
  26. package/{chunk-MSXDPLDQ.js → chunk-FVY6KI5A.js} +1 -1
  27. package/{chunk-7ZKK4F22.js → chunk-I5TJCJQP.js} +1 -1
  28. package/{chunk-ROJI6DRT.js → chunk-INWBJPQC.js} +2 -2
  29. package/{chunk-FON47ACC.js → chunk-JYSXE6LE.js} +3 -3
  30. package/{chunk-PASYOZYI.js → chunk-KJJ6EWVW.js} +13 -11
  31. package/{chunk-ATGTWONB.js → chunk-MHHYH3JA.js} +1 -1
  32. package/{chunk-MY54LNPC.js → chunk-NV2VP27U.js} +2 -2
  33. package/{chunk-A6WDXLAG.js → chunk-P6TB7JIA.js} +158 -12
  34. package/{chunk-WCP5FDTF.js → chunk-PFTK5SEB.js} +21 -5
  35. package/{chunk-BTA2CW6H.js → chunk-PJI44RVC.js} +9 -9
  36. package/{chunk-JQ3LNEMS.js → chunk-PMSG3OGF.js} +51 -4
  37. package/{chunk-4O2L6YR5.js → chunk-POANOUUC.js} +3 -3
  38. package/{chunk-E4XWECLB.js → chunk-RLQXGHUQ.js} +2 -2
  39. package/{chunk-SFFG3HJH.js → chunk-SIZWJA7H.js} +4 -4
  40. package/{chunk-OMN2LILO.js → chunk-SRFEVECQ.js} +1 -1
  41. package/{chunk-UP7UFQOH.js → chunk-STOUEEBU.js} +1 -1
  42. package/{chunk-QUXMWSCQ.js → chunk-VEHCU5XV.js} +22 -66
  43. package/{chunk-XMAELUQW.js → chunk-VNMOLPVO.js} +20 -20
  44. package/{chunk-MALVZUYL.js → chunk-WPRSBZYN.js} +1 -1
  45. package/{chunk-RRWRVIQU.js → chunk-XISENOC2.js} +1 -1
  46. package/{chunk-4UYKPT74.js → chunk-YRMUYZ5H.js} +2 -2
  47. package/{chunk-JMSCXQUG.js → chunk-Z3LLUGD5.js} +1 -1
  48. package/{chunk-IVMPWUAR.js → chunk-ZXXAMM3K.js} +2 -2
  49. package/{chunk-D5D3XTWF.js → chunk-ZZYNGFTB.js} +58 -20
  50. package/{createAgentAutomationAction-FAYQK5ME.js → createAgentAutomationAction-PIKVVL2R.js} +8 -8
  51. package/{createDialogAction-NDBK6IQG.js → createDialogAction-DQCM7HHO.js} +9 -9
  52. package/{createPageAction-CQTLV7FP.js → createPageAction-W2DRG2J7.js} +8 -8
  53. package/{dbSlice-5BKDURDL.js → dbSlice-GOKRGQ47.js} +2 -2
  54. package/{dialogCommands-ZR42K2M5.js → dialogCommands-N4XKI6ZU.js} +11 -11
  55. package/{dialogSlice-ZLGEYKLO.js → dialogSlice-DZUQZISK.js} +8 -8
  56. package/{docCreateCommands-2WXA3BCQ.js → docCreateCommands-DTDKANXX.js} +10 -10
  57. package/{docDeleteCommands-HSL7CD32.js → docDeleteCommands-U4NB6OHK.js} +11 -11
  58. package/{docReadCommands-YSPUU2DP.js → docReadCommands-SDVQM3BH.js} +10 -10
  59. package/{docStore-LJQIY2ZU.js → docStore-NXDBQRDQ.js} +9 -9
  60. package/{docUpdateCommands-EFYOIVM7.js → docUpdateCommands-O2O644FV.js} +10 -10
  61. package/{handleSendMessageAction-JL6GGVNW.js → handleSendMessageAction-3MMYF664.js} +8 -8
  62. package/index.js +40 -40
  63. package/{machineCommands-VAANUFNC.js → machineCommands-QFDT6G2Q.js} +22 -22
  64. package/{machineWsRunDispatch-ABWV2WZO.js → machineWsRunDispatch-J6IBIDYG.js} +22 -22
  65. package/package.json +1 -1
  66. package/{read-F3L3T2WJ.js → read-A23NKT3O.js} +1 -1
  67. package/{readDocTool-FOHWVA4R.js → readDocTool-JAM5BI5Q.js} +1 -1
  68. package/{readlineWorkspace-GQI3XP5E.js → readlineWorkspace-FU7PWLJU.js} +26 -26
  69. package/{removeDialogAgentAction-QCFGIUIH.js → removeDialogAgentAction-K4HOWFHO.js} +4 -4
  70. package/{runAgentClientLoop-U632N2KO.js → runAgentClientLoop-P6J4YSE4.js} +17 -17
  71. package/{setDialogExtraReferencesAction-DK4CKERU.js → setDialogExtraReferencesAction-JD7J7JM4.js} +3 -3
  72. package/{setPrimaryDialogAgentAction-SJSO6N27.js → setPrimaryDialogAgentAction-YWSA5XEU.js} +4 -4
  73. package/{settingSlice-XNM5AFPU.js → settingSlice-22GTX6CA.js} +3 -3
  74. package/{spaceCommands-DE6KNJIV.js → spaceCommands-WM6W3WMQ.js} +10 -10
  75. package/{spaceSlice-QTMWWQHQ.js → spaceSlice-SVEWO5JX.js} +8 -8
  76. package/{streamAgentChatTurn-VU7BM3K3.js → streamAgentChatTurn-XJRY424B.js} +76 -32
  77. package/{switchDialogAgentAction-4OAC6QRN.js → switchDialogAgentAction-6JKFBJVR.js} +2 -2
  78. package/{tools-LSIS6NY6.js → tools-ZN6GWGYP.js} +15 -15
  79. package/{updateDialogTitleAction-T77A54DE.js → updateDialogTitleAction-ZJ2HF5AQ.js} +8 -8
  80. package/{chunk-ATWUOTJP.js → chunk-NWT2WUCY.js} +1 -1
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  listUserRecordsFromServers,
3
3
  readLiveDbRecordAfterTombstoneMerge
4
- } from "./chunk-ATGTWONB.js";
4
+ } from "./chunk-MHHYH3JA.js";
5
5
  import {
6
6
  agentRecordHasConfiguredCredential
7
- } from "./chunk-7ZKK4F22.js";
7
+ } from "./chunk-I5TJCJQP.js";
8
8
  import {
9
9
  toSafeAgentSummary
10
10
  } from "./chunk-H7N2NOJF.js";
@@ -9,8 +9,9 @@ import {
9
9
  getModelContextWindow,
10
10
  planCompression,
11
11
  planContextUsage,
12
+ resolveBuiltinPlatformAgentConfig,
12
13
  serializeMessageContent
13
- } from "./chunk-JQ3LNEMS.js";
14
+ } from "./chunk-PMSG3OGF.js";
14
15
  import {
15
16
  clipCompactText
16
17
  } from "./chunk-5MMAK75Q.js";
@@ -28,12 +29,18 @@ import {
28
29
  import {
29
30
  toErrorMessage
30
31
  } from "./chunk-HNMXYYJR.js";
32
+ import {
33
+ PLATFORM_HOSTED_KIMI_K26_MODEL
34
+ } from "./chunk-YTA2QOEE.js";
31
35
  import {
32
36
  asRecordOrEmpty
33
37
  } from "./chunk-KX6YBIHG.js";
34
38
  import {
35
39
  asTrimmedLowercaseString
36
40
  } from "./chunk-QSJ3HFEF.js";
41
+ import {
42
+ PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
43
+ } from "./chunk-NWT2WUCY.js";
37
44
  import {
38
45
  isRecord
39
46
  } from "./chunk-KUG52IAP.js";
@@ -160,6 +167,118 @@ var resolveAgentImageInputSupport = (agent) => {
160
167
  return true;
161
168
  };
162
169
 
170
+ // packages/ai/agent/imagePreprocessing.ts
171
+ var DEFAULT_IMAGE_PREPROCESSOR_AGENT_KEY = PUBLIC_KIMI_K26_IMAGE_AGENT_KEY;
172
+ var DESCRIBE_IMAGE_PROMPT = "\u8BF7\u8BE6\u7EC6\u63CF\u8FF0\u8FD9\u5F20\u56FE\u7247\u7684\u5185\u5BB9\uFF0C\u5305\u62EC\u573A\u666F\u3001\u7269\u4F53\u3001\u6587\u5B57\u3001\u989C\u8272\u548C\u5E03\u5C40\u7B49\u5173\u952E\u4FE1\u606F\u3002";
173
+ function extractImageUrlsFromMessages(messages) {
174
+ const urls = [];
175
+ for (const msg of messages) {
176
+ if (!Array.isArray(msg.content)) continue;
177
+ for (const part of msg.content) {
178
+ if (part && typeof part === "object" && part.type === "image_url" && part.image_url && typeof part.image_url.url === "string" && part.image_url.url.trim()) {
179
+ urls.push(part.image_url.url);
180
+ }
181
+ }
182
+ }
183
+ return urls;
184
+ }
185
+ function hasImageInRuntimeMessages(messages) {
186
+ return extractImageUrlsFromMessages(messages).length > 0;
187
+ }
188
+ async function preprocessImagesForTextOnlyAgent(messages, describeImage) {
189
+ const imageUrls = extractImageUrlsFromMessages(messages);
190
+ if (imageUrls.length === 0) return messages;
191
+ const description = await describeImage(imageUrls);
192
+ if (description === null || !description.trim()) return messages;
193
+ const descriptionText = `[\u56FE\u7247\u63CF\u8FF0] ${description.trim()}`;
194
+ return messages.map((msg) => {
195
+ if (!Array.isArray(msg.content)) return msg;
196
+ const hasImage = msg.content.some((p) => p?.type === "image_url");
197
+ if (!hasImage) return msg;
198
+ const newContent = msg.content.map((part) => {
199
+ if (part && typeof part === "object" && part.type === "image_url") {
200
+ return { type: "text", text: descriptionText };
201
+ }
202
+ return part;
203
+ }).filter((p) => p !== null && p !== void 0);
204
+ return { ...msg, content: newContent };
205
+ });
206
+ }
207
+ async function describeImageWithLocalProvider(adapter, imageUrls, visionAgentConfig) {
208
+ if (imageUrls.length === 0) return null;
209
+ try {
210
+ const config = visionAgentConfig ?? resolveBuiltinPlatformAgentConfig(DEFAULT_IMAGE_PREPROCESSOR_AGENT_KEY);
211
+ if (!config) {
212
+ console.warn("[imagePreprocessing] vision agent config not found, skipping");
213
+ return null;
214
+ }
215
+ const visionProvider = await adapter.resolveProvider(config);
216
+ const contentParts = [
217
+ { type: "text", text: DESCRIBE_IMAGE_PROMPT }
218
+ ];
219
+ for (const url of imageUrls) {
220
+ contentParts.push({ type: "image_url", image_url: { url } });
221
+ }
222
+ const result = await visionProvider.complete(
223
+ [{ role: "user", content: contentParts }],
224
+ { timeoutMs: 3e4 }
225
+ );
226
+ const text = result.content?.trim();
227
+ if (!text) return null;
228
+ return text;
229
+ } catch (error) {
230
+ console.warn("[imagePreprocessing] vision describe failed, will fallback:", error);
231
+ return null;
232
+ }
233
+ }
234
+ async function describeImageViaServerProxy(serverUrl, authToken, imageUrls, visionAgentKey) {
235
+ if (imageUrls.length === 0) return null;
236
+ const agentKey = visionAgentKey ?? DEFAULT_IMAGE_PREPROCESSOR_AGENT_KEY;
237
+ const visionConfig = resolveBuiltinPlatformAgentConfig(agentKey);
238
+ const visionModel = visionConfig?.model ?? PLATFORM_HOSTED_KIMI_K26_MODEL;
239
+ const visionProvider = visionConfig?.provider ?? "nolo";
240
+ try {
241
+ const contentParts = [
242
+ { type: "text", text: DESCRIBE_IMAGE_PROMPT }
243
+ ];
244
+ for (const url of imageUrls) {
245
+ contentParts.push({ type: "image_url", image_url: { url } });
246
+ }
247
+ const payload = {
248
+ model: visionModel,
249
+ messages: [{ role: "user", content: contentParts }],
250
+ stream: false,
251
+ provider: visionProvider,
252
+ agentKey,
253
+ // server proxy 需要 url 字段,但 nolo 平台 agent 的上游由 server 端路由,
254
+ // 这里放一个占位 url,server 端会根据 provider/model 覆盖。
255
+ url: "https://api.ollama.com/v1/chat/completions"
256
+ };
257
+ const response = await fetch(`${serverUrl}/api/chat`, {
258
+ method: "POST",
259
+ headers: {
260
+ "Content-Type": "application/json",
261
+ Authorization: `Bearer ${authToken}`
262
+ },
263
+ body: JSON.stringify(payload),
264
+ signal: AbortSignal.timeout(3e4)
265
+ });
266
+ if (!response.ok) {
267
+ console.warn(`[imagePreprocessing] server proxy vision call failed: ${response.status}`);
268
+ return null;
269
+ }
270
+ const data = await response.json();
271
+ const text = data?.choices?.[0]?.message?.content;
272
+ if (typeof text === "string" && text.trim()) {
273
+ return text.trim();
274
+ }
275
+ return null;
276
+ } catch (error) {
277
+ console.warn("[imagePreprocessing] server proxy vision describe failed:", error);
278
+ return null;
279
+ }
280
+ }
281
+
163
282
  // packages/agent-runtime/toolCallPairing.ts
164
283
  function readToolCallId(message) {
165
284
  if (typeof message.tool_call_id === "string" && message.tool_call_id) {
@@ -1348,17 +1467,42 @@ async function runLocalAgentTurn(input) {
1348
1467
  partialContent = "";
1349
1468
  throwIfAborted(input);
1350
1469
  const preparedMessages = prepareMessagesForProviderCall(messages);
1351
- const baseRequestMessages = filterImagePartsFromMessages(
1352
- preparedMessages.messages,
1353
- supportsImages
1354
- );
1355
- if (!supportsImages && !imageDowngradeNotified && messages.some((m) => Array.isArray(m.content) && m.content.some((p) => p?.type === "image_url"))) {
1356
- imageDowngradeNotified = true;
1357
- emitLoopEvent(input, {
1358
- kind: "image-downgraded",
1359
- reason: "no-vision",
1360
- atMs: Date.now()
1361
- });
1470
+ let baseRequestMessages;
1471
+ if (!supportsImages && hasImageInRuntimeMessages(preparedMessages.messages)) {
1472
+ const imageUrls = extractImageUrlsFromMessages(preparedMessages.messages);
1473
+ const preprocessed = await preprocessImagesForTextOnlyAgent(
1474
+ preparedMessages.messages,
1475
+ (urls) => describeImageWithLocalProvider(input.adapter, urls)
1476
+ );
1477
+ if (preprocessed !== preparedMessages.messages) {
1478
+ baseRequestMessages = preprocessed;
1479
+ if (!imageDowngradeNotified) {
1480
+ imageDowngradeNotified = true;
1481
+ emitLoopEvent(input, {
1482
+ kind: "image-preprocessed",
1483
+ atMs: Date.now(),
1484
+ imageCount: imageUrls.length
1485
+ });
1486
+ }
1487
+ } else {
1488
+ baseRequestMessages = filterImagePartsFromMessages(
1489
+ preparedMessages.messages,
1490
+ supportsImages
1491
+ );
1492
+ if (!imageDowngradeNotified) {
1493
+ imageDowngradeNotified = true;
1494
+ emitLoopEvent(input, {
1495
+ kind: "image-downgraded",
1496
+ reason: "no-vision",
1497
+ atMs: Date.now()
1498
+ });
1499
+ }
1500
+ }
1501
+ } else {
1502
+ baseRequestMessages = filterImagePartsFromMessages(
1503
+ preparedMessages.messages,
1504
+ supportsImages
1505
+ );
1362
1506
  }
1363
1507
  const requestMessages = emptyAssistantRepairPending ? [...baseRequestMessages, { role: "user", content: EMPTY_ASSISTANT_REPAIR_PROMPT }] : baseRequestMessages;
1364
1508
  const contextMetrics = {
@@ -1636,6 +1780,8 @@ export {
1636
1780
  parseToolArgumentsJson,
1637
1781
  summarizeToolArguments,
1638
1782
  resolveAgentImageInputSupport,
1783
+ preprocessImagesForTextOnlyAgent,
1784
+ describeImageViaServerProxy,
1639
1785
  resolveHistoricalToolContentCap,
1640
1786
  projectToolMessageContent,
1641
1787
  LOCAL_AGENT_CONFIG_MISSING_CODE,
@@ -173,9 +173,16 @@ function buildNoloWorkspaceOpenAiTools(args) {
173
173
  limit: { type: "integer", description: "Maximum dialogs to return." },
174
174
  space: stringToolParam("Optional space id or URL.")
175
175
  });
176
- add("readDialog", "Read one persisted dialog in the Nolo workspace by full dbKey (dialog-<userId>-<id>) or URL. Use listDialogs first if target is unclear; bare id works for current user only.", {
177
- dialog: stringToolParam("Dialog dbKey (dialog-<userId>-<id>), dialog URL, or bare id (current user only)."),
178
- limit: { type: "integer", description: "Optional message limit." }
176
+ add("readDialog", `Read one persisted dialog (metadata + messages) by full dbKey (dialog-<userId>-<id>) or URL. Use listDialogs first if target is unclear; a bare id resolves against the current user, pass user for someone else's dialog. Reading an agent run's dialog is fine at any time, but do not poll a still-running one through the full transcript: if controlAgentRun is available prefer it for live runs, otherwise use mode="status" for a compact snapshot, and pull the full transcript once the run is done/failed/cancelled.`, {
177
+ dialog: stringToolParam("Dialog dbKey (dialog-<userId>-<id>), dialog URL, or bare id (resolved against user/current account)."),
178
+ mode: {
179
+ type: "string",
180
+ enum: ["full", "status"],
181
+ description: "full (default) returns meta + messages; status returns a compact run snapshot (status/checkpoint/tools/files/error) without the transcript \u2014 prefer it when you only need to know whether an agent run is still active or how it ended."
182
+ },
183
+ limit: { type: "integer", description: "Max messages to return in mode=full, newest first. Omit for the complete transcript; a small limit can hide earlier tool calls. Ignored in mode=status." },
184
+ user: stringToolParam("Owner userId for a bare dialog id (e.g. a child run started by another account). Ignored when dialog is a dbKey or URL."),
185
+ server: stringToolParam("Optional server base URL to read from, e.g. when the dialog lives on another machine's nolo server.")
179
186
  }, ["dialog"]);
180
187
  add("queryDialogsBySubjectRef", "Query persisted dialog evidence by a generic dialog.subjectRefs target.", {
181
188
  rowDbKey: stringToolParam("Optional alias for subjectKind=table-row, subjectId=<rowDbKey>, subjectRole=task."),
@@ -491,9 +498,18 @@ function buildNoloWorkspaceCommandArgs(call) {
491
498
  case "readDialog": {
492
499
  const dialog = noloStringArg(args.dialog ?? args.dialogId ?? args.id);
493
500
  if (!dialog) throw new Error("readDialog requires dialog.");
494
- const cliArgs = ["dialog", "read", dialog];
495
- const limit = noloPositiveIntegerString(args.limit);
501
+ const mode = noloStringArg(args.mode);
502
+ if (mode && mode !== "full" && mode !== "status") {
503
+ throw new Error(`readDialog mode must be "full" or "status", got "${mode}".`);
504
+ }
505
+ const statusMode = mode === "status";
506
+ const cliArgs = ["dialog", statusMode ? "status" : "read", dialog];
507
+ const limit = statusMode ? null : noloPositiveIntegerString(args.limit);
496
508
  if (limit) cliArgs.push(limit);
509
+ const user = noloStringArg(args.user ?? args.userId ?? args.owner);
510
+ if (user) cliArgs.push("--user", user);
511
+ const server = noloStringArg(args.server ?? args.serverBase ?? args.serverUrl);
512
+ if (server) cliArgs.push("--server", server);
497
513
  return cliArgs;
498
514
  }
499
515
  case "queryDialogsBySubjectRef": {
@@ -5,10 +5,10 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-D36OKPFG.js";
8
+ } from "./chunk-BYHN2CP5.js";
9
9
  import {
10
10
  performFetchRequest
11
- } from "./chunk-HTLBU4ZY.js";
11
+ } from "./chunk-4S7B6YC5.js";
12
12
  import {
13
13
  createSSEParser,
14
14
  createToolRunId,
@@ -19,7 +19,7 @@ import {
19
19
  toolRunSetPending,
20
20
  toolRunStarted,
21
21
  toolRunSucceeded
22
- } from "./chunk-XMAELUQW.js";
22
+ } from "./chunk-VNMOLPVO.js";
23
23
  import {
24
24
  getPublicImageAgentMode
25
25
  } from "./chunk-VIDPVFP3.js";
@@ -29,13 +29,13 @@ import {
29
29
  messageStreaming,
30
30
  selectCurrentSpaceId,
31
31
  updateToolMessage
32
- } from "./chunk-QUXMWSCQ.js";
32
+ } from "./chunk-VEHCU5XV.js";
33
33
  import {
34
34
  streamAgentChatTurn
35
- } from "./chunk-SFFG3HJH.js";
35
+ } from "./chunk-SIZWJA7H.js";
36
36
  import {
37
37
  EMPTY_ASSISTANT_REPAIR_PROMPT
38
- } from "./chunk-A6WDXLAG.js";
38
+ } from "./chunk-P6TB7JIA.js";
39
39
  import {
40
40
  accumulateToolCallDelta,
41
41
  createThinkParserState,
@@ -47,7 +47,7 @@ import {
47
47
  } from "./chunk-N7J63Q6C.js";
48
48
  import {
49
49
  getModelInfo
50
- } from "./chunk-JQ3LNEMS.js";
50
+ } from "./chunk-PMSG3OGF.js";
51
51
  import {
52
52
  getApiEndpoint
53
53
  } from "./chunk-GT3GG2H7.js";
@@ -61,10 +61,10 @@ import {
61
61
  } from "./chunk-HNMXYYJR.js";
62
62
  import {
63
63
  selectCurrentServer
64
- } from "./chunk-S6KVFOUG.js";
64
+ } from "./chunk-ENUJPSZN.js";
65
65
  import {
66
66
  write
67
- } from "./chunk-FON47ACC.js";
67
+ } from "./chunk-JYSXE6LE.js";
68
68
  import {
69
69
  createDialogMessageKeyAndId,
70
70
  dialogMessageKey,
@@ -6,17 +6,21 @@ import {
6
6
  } from "./chunk-L3QFIBZG.js";
7
7
  import {
8
8
  addContentAction
9
- } from "./chunk-OXLLFZNF.js";
9
+ } from "./chunk-DBUNOYLF.js";
10
10
  import {
11
11
  upload
12
- } from "./chunk-FON47ACC.js";
12
+ } from "./chunk-JYSXE6LE.js";
13
13
  import {
14
14
  PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
15
- PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
16
- } from "./chunk-ATWUOTJP.js";
15
+ PUBLIC_KIMI_K26_IMAGE_AGENT_KEY,
16
+ builtinRuntimeFallbackEntries
17
+ } from "./chunk-NWT2WUCY.js";
17
18
  import {
18
19
  getRuntimeServerContext
19
20
  } from "./chunk-XMLRJUU5.js";
21
+ import {
22
+ publicAgentKey
23
+ } from "./chunk-SLOGKB7M.js";
20
24
  import {
21
25
  API_ENDPOINTS
22
26
  } from "./chunk-LCBAMY2M.js";
@@ -24,6 +28,47 @@ import {
24
28
  normalizeServerOrigin
25
29
  } from "./chunk-CF7PE763.js";
26
30
 
31
+ // packages/agent-runtime/builtinPlatformAgentConfigs.ts
32
+ function buildConfig(e) {
33
+ const key = publicAgentKey(e.id);
34
+ const rawRecord = {
35
+ dbKey: key,
36
+ isPublic: true,
37
+ provider: e.provider,
38
+ model: e.model,
39
+ apiSource: e.apiSource ?? "platform",
40
+ useServerProxy: e.useServerProxy ?? true
41
+ };
42
+ if (e.hasImageOutput) rawRecord.hasImageOutput = true;
43
+ if (e.imageModel) rawRecord.imageModel = e.imageModel;
44
+ if (e.imageWorkflow) rawRecord.imageWorkflow = e.imageWorkflow;
45
+ if (e.imageConfig) rawRecord.imageConfig = e.imageConfig;
46
+ return {
47
+ key,
48
+ name: e.name,
49
+ provider: e.provider,
50
+ model: e.model,
51
+ apiSource: e.apiSource ?? "platform",
52
+ useServerProxy: e.useServerProxy ?? true,
53
+ rawRecord
54
+ };
55
+ }
56
+ var BUILTIN_PLATFORM_AGENT_CONFIGS = Object.fromEntries(
57
+ builtinRuntimeFallbackEntries().map((e) => [publicAgentKey(e.id), buildConfig(e)])
58
+ );
59
+ function resolveBuiltinPlatformAgentConfig(agentRef) {
60
+ return BUILTIN_PLATFORM_AGENT_CONFIGS[agentRef] ?? null;
61
+ }
62
+ function resolveBuiltinPlatformAgentRecord(agentRef) {
63
+ const config = resolveBuiltinPlatformAgentConfig(agentRef);
64
+ if (!config) return null;
65
+ return {
66
+ ...config.rawRecord,
67
+ dbKey: agentRef,
68
+ ...config.name ? { name: config.name } : {}
69
+ };
70
+ }
71
+
27
72
  // packages/ai/context/tokenUtils.ts
28
73
  var estimateTokenCount = (text) => {
29
74
  if (!text) return 0;
@@ -608,6 +653,8 @@ var DEFAULT_AUTO_EXECUTION_PROFILE = AUTO_EXECUTION_PROFILES[DEFAULT_AUTO_EXECUT
608
653
  var resolveAutoExecutionProfile = (tier) => AUTO_EXECUTION_PROFILES[tier ?? DEFAULT_AUTO_EXECUTION_TIER] ?? DEFAULT_AUTO_EXECUTION_PROFILE;
609
654
 
610
655
  export {
656
+ resolveBuiltinPlatformAgentConfig,
657
+ resolveBuiltinPlatformAgentRecord,
611
658
  planContextUsage,
612
659
  estimateTokenCount,
613
660
  DEFAULT_CONTEXT_WINDOW,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-PASYOZYI.js";
4
+ } from "./chunk-KJJ6EWVW.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-XMAELUQW.js";
7
+ } from "./chunk-VNMOLPVO.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-A6WDXLAG.js";
10
+ } from "./chunk-P6TB7JIA.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
13
  } from "./chunk-5CS33IBL.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-PASYOZYI.js";
3
+ } from "./chunk-KJJ6EWVW.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-WFHXMLHZ.js";
@@ -12,7 +12,7 @@ import {
12
12
  resolveAgentRecordFromHybridStore,
13
13
  sanitizeAgentRecordForCliOutput,
14
14
  writeAgentRecord
15
- } from "./chunk-7ZKK4F22.js";
15
+ } from "./chunk-I5TJCJQP.js";
16
16
  import {
17
17
  resolveCliAgentKeyInput
18
18
  } from "./chunk-VHBWHNVT.js";
@@ -11,7 +11,7 @@ import {
11
11
  patch,
12
12
  remove,
13
13
  write
14
- } from "./chunk-FON47ACC.js";
14
+ } from "./chunk-JYSXE6LE.js";
15
15
  import {
16
16
  createAgentKey,
17
17
  toTrimmedString
@@ -300,7 +300,7 @@ var slice = createSliceWithThunks({
300
300
  const overrides = {};
301
301
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
302
302
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
303
- const { _executeModel } = await import("./_executeModel-SUMILI7E.js");
303
+ const { _executeModel } = await import("./_executeModel-YQ57CFSN.js");
304
304
  return _executeModel(
305
305
  {
306
306
  isStreaming: args.isStreaming ?? false,
@@ -321,7 +321,7 @@ var slice = createSliceWithThunks({
321
321
  * - 循环直到无工具调用或触发其他运行时停止条件
322
322
  */
323
323
  runAgent: create.asyncThunk(async (args, thunkApi) => {
324
- const { runAgentClientLoop } = await import("./runAgentClientLoop-U632N2KO.js");
324
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-P6J4YSE4.js");
325
325
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
326
326
  {
327
327
  agentKey: args.agentKey,
@@ -337,7 +337,7 @@ var slice = createSliceWithThunks({
337
337
  * 聊天轮次流式 Agent 调用
338
338
  */
339
339
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
340
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-VU7BM3K3.js");
340
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-XJRY424B.js");
341
341
  return streamAgentChatTurnHandler(args, thunkApi);
342
342
  }),
343
343
  /**
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-HTLBU4ZY.js";
4
+ } from "./chunk-4S7B6YC5.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildAgentRuntimeAgentLookupKeys,
3
3
  shouldFetchAgentRuntimeRecordRemotely
4
- } from "./chunk-7IX2Z2IF.js";
4
+ } from "./chunk-33K2M3AU.js";
5
5
 
6
6
  // packages/cli/client/localAgentRecords.ts
7
7
  var buildLocalAgentLookupKeys = buildAgentRuntimeAgentLookupKeys;