nolo-cli 0.16.0-alpha.2 → 0.16.0-alpha.21

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 (136) hide show
  1. package/{_executeModel-QAUS6B7J.js → _executeModel-GRCQXT5R.js} +51 -45
  2. package/{action-GUOZYYGN.js → action-LT7BRFLK.js} +10 -9
  3. package/{addContentAction-QDGHGUBH.js → addContentAction-PL3KKBDH.js} +9 -8
  4. package/{addDialogAgentAction-Z4YCYZIV.js → addDialogAgentAction-FCMSKYAF.js} +8 -7
  5. package/{agentDeleteCommand-365DMKHW.js → agentDeleteCommand-WNL3CNQX.js} +32 -29
  6. package/{agentEmailCommands-TQMXL36I.js → agentEmailCommands-MPEUMRAS.js} +63 -57
  7. package/{agentListCommands-6B5X4RC6.js → agentListCommands-YO4AOQMS.js} +31 -28
  8. package/{agentMachineCommands-LOEARB6V.js → agentMachineCommands-WYM6YRYJ.js} +30 -27
  9. package/{agentPullCommand-6HWUT3SW.js → agentPullCommand-ZZGU5KOY.js} +4 -4
  10. package/agentRecordCommands-BVWSHMIY.js +105 -0
  11. package/{agentRunCommand-SGMH67WT.js → agentRunCommand-E3ZI6RSF.js} +64 -55
  12. package/{agentRunControl-6ADXVYMR.js → agentRunControl-Y5AFH5PQ.js} +24 -1
  13. package/{agentRuntimeLocal-YSYZ33ER.js → agentRuntimeLocal-P4VGX6H6.js} +26 -25
  14. package/{agentSlice-IVE735EV.js → agentSlice-D33GU3JL.js} +9 -8
  15. package/{appDeleteCommands-6QYOO3JB.js → appDeleteCommands-VA4R2SWX.js} +29 -26
  16. package/{appDeployCommands-WTCT6XO6.js → appDeployCommands-JWMWQNG6.js} +29 -26
  17. package/{appDeployStatusCommands-CGWGZJKB.js → appDeployStatusCommands-KYXGLZSQ.js} +29 -26
  18. package/{appGetCommands-O4OCAMRW.js → appGetCommands-ELOO3JG6.js} +29 -26
  19. package/{appListCommands-UENFP4XY.js → appListCommands-SJUW4RLW.js} +29 -26
  20. package/{authCommand-YFTR3347.js → authCommand-WJZPOLSS.js} +16 -9
  21. package/{authCommands-YXGOXNBZ.js → authCommands-XTBV7OFZ.js} +6 -5
  22. package/{chunk-RKM3K52F.js → chunk-34WPV75U.js} +23 -2
  23. package/{chunk-VPTJB4HM.js → chunk-3ND52WIL.js} +2 -5
  24. package/{chunk-SOTZ6RDN.js → chunk-3Q7WHGCB.js} +1 -1
  25. package/{chunk-KKY4B2Q2.js → chunk-4PWB7JRR.js} +4 -1
  26. package/{chunk-U7LEGLEB.js → chunk-4T5F7YZQ.js} +1 -1
  27. package/{chunk-OQMPU2ML.js → chunk-5PGGCJGV.js} +6 -6
  28. package/chunk-7BUYEZ6U.js +671 -0
  29. package/{chunk-AS3ZQ3O2.js → chunk-7OBMZCRD.js} +1 -1
  30. package/{chunk-WA6KZL5V.js → chunk-AAODAAUQ.js} +23 -20
  31. package/{chunk-GRTFNYLR.js → chunk-AKVLLMOU.js} +3 -3
  32. package/{chunk-QLUFR47U.js → chunk-AL2V7U3E.js} +1 -1
  33. package/{chunk-MTU75CZ2.js → chunk-B5TOXZAK.js} +1 -1
  34. package/{chunk-QZVGMD5F.js → chunk-BE2GNT5E.js} +2 -8
  35. package/{chunk-JKWWVF2I.js → chunk-D3HVJJIA.js} +1 -1
  36. package/{chunk-B4KT7RN2.js → chunk-DKZFOK24.js} +18 -89
  37. package/chunk-DL6EPNIK.js +50 -0
  38. package/{chunk-YYIRR6QC.js → chunk-E5KQTMMJ.js} +212 -250
  39. package/{chunk-4QQFLN5C.js → chunk-EGPCU42M.js} +58 -8
  40. package/{chunk-XVP3C2KY.js → chunk-ELT65PZW.js} +2 -2
  41. package/{chunk-EMXI3N3Z.js → chunk-ENP2ELIL.js} +5 -5
  42. package/{chunk-6565R2TI.js → chunk-EXAEHRLI.js} +112 -191
  43. package/chunk-FQZZLA3C.js +223 -0
  44. package/{chunk-WPN6RMDF.js → chunk-GMZZ5EKJ.js} +3 -3
  45. package/{chunk-RSYUDGGZ.js → chunk-HQNPCMWL.js} +3 -3
  46. package/{chunk-OGGHETUE.js → chunk-HQPG2PIV.js} +62 -19
  47. package/{chunk-4NLUNENX.js → chunk-IQZ6TGVW.js} +10 -3
  48. package/{chunk-VE6XMVKG.js → chunk-J67FKTTY.js} +330 -213
  49. package/{chunk-G2MKOQCB.js → chunk-JFE7XW4D.js} +1 -1
  50. package/{setDialogExtraReferencesAction-2VLGWQKG.js → chunk-JLA4FXYC.js} +2 -17
  51. package/{chunk-OOIN7HSO.js → chunk-JP7REMYP.js} +19 -1
  52. package/chunk-KFEVY3ST.js +255 -0
  53. package/{chunk-I66RU7P7.js → chunk-KKWJ5VPZ.js} +1 -1
  54. package/{chunk-WRN5EQT7.js → chunk-L2RRMXNJ.js} +13 -4
  55. package/{chunk-ISYE6GZB.js → chunk-L6NVTGI7.js} +1 -1
  56. package/{chunk-HRQCKQA5.js → chunk-MUCU6ATG.js} +8 -257
  57. package/{chunk-BFRVXJJJ.js → chunk-MUIT5AAM.js} +112 -27
  58. package/{chunk-WNLPAOIT.js → chunk-MVQ4TBSD.js} +1 -1
  59. package/{chunk-O53CP2QR.js → chunk-N2HYIBLH.js} +6 -6
  60. package/{chunk-524BDL33.js → chunk-O6W2O2DA.js} +1 -15
  61. package/{chunk-YC3DJILJ.js → chunk-PUSK7HXJ.js} +64 -22
  62. package/{chunk-OOSFSFMA.js → chunk-R5V5G73M.js} +2 -0
  63. package/{chunk-4IJYA27C.js → chunk-RG2U2MTJ.js} +1 -1
  64. package/{chunk-Z24FGIU2.js → chunk-RIDWN7AP.js} +34 -15
  65. package/{chunk-IKXL2HZ3.js → chunk-RK5NYQEL.js} +1 -1
  66. package/{chunk-QLFCNUVQ.js → chunk-RUTSBLDM.js} +1629 -261
  67. package/{chunk-TTGAVETO.js → chunk-RVOUXDFU.js} +5 -5
  68. package/{chunk-JTINRTBT.js → chunk-SKDNBYZK.js} +2 -2
  69. package/{chunk-KMQPSTMJ.js → chunk-TRT4I4UD.js} +2 -2
  70. package/{chunk-EHLHSX7R.js → chunk-UB4RYYNQ.js} +9 -2
  71. package/{chunk-N5424GSW.js → chunk-UGUW3FHG.js} +4 -4
  72. package/{chunk-YNHQIXX5.js → chunk-UIOYWBU7.js} +395 -326
  73. package/chunk-V5R4NZP2.js +78 -0
  74. package/{chunk-MYMMNKYL.js → chunk-VNAEBGDK.js} +156 -6
  75. package/{chunk-J55UHASN.js → chunk-VST53WEL.js} +1 -1
  76. package/{chunk-6MHDWKOT.js → chunk-VVKQFITN.js} +25 -12
  77. package/{chunk-W4NVOSFF.js → chunk-WFHXMLHZ.js} +1 -1
  78. package/{chunk-H33743XH.js → chunk-WJRJDX2W.js} +1 -1
  79. package/chunk-X4Q4UZEY.js +26 -0
  80. package/{chunk-E237VE6U.js → chunk-XFYDGBXL.js} +4 -4
  81. package/{chunk-JS33TCQ3.js → chunk-XHG22OEX.js} +4 -4
  82. package/{chunk-DVRHHFEA.js → chunk-XMLRJUU5.js} +1 -1
  83. package/{chunk-V2J635L5.js → chunk-XOIF2TNF.js} +2 -2
  84. package/{chunk-SFXYKGK2.js → chunk-XRZJGPFI.js} +7 -7
  85. package/chunk-ZHXJ6M7T.js +27 -0
  86. package/chunk-ZZ2MH7LE.js +84 -0
  87. package/{cliExecutor-K3F7DMRO.js → cliExecutor-DNE7TCC4.js} +2 -2
  88. package/codingSkills-36KN5NQT.js +48 -0
  89. package/{createAgentAutomationAction-TS6NNZ4X.js → createAgentAutomationAction-ONKZ46XE.js} +22 -21
  90. package/{createDialogAction-5HVQ33EX.js → createDialogAction-7QWJEBKU.js} +24 -23
  91. package/{createPageAction-4F3ZGQJD.js → createPageAction-PB3KXZIA.js} +28 -27
  92. package/{dbSlice-OP6UPXKA.js → dbSlice-CGSRFJN3.js} +8 -7
  93. package/{deleteFile-WPWVZE4B.js → deleteFile-WDZ3VM7B.js} +3 -3
  94. package/{dialogCommands-ZL6L24BS.js → dialogCommands-YZFU4Q26.js} +30 -27
  95. package/{dialogSlice-FAWUQDJW.js → dialogSlice-53B5ISGQ.js} +22 -21
  96. package/{docCreateCommands-LYROQTFH.js → docCreateCommands-LOUC5PFB.js} +28 -25
  97. package/{docDeleteCommands-6TWGTZNR.js → docDeleteCommands-HHPGT4BR.js} +29 -26
  98. package/{docReadCommands-PRULNF26.js → docReadCommands-YPSN4HEF.js} +28 -25
  99. package/{docStore-2UHVWLTV.js → docStore-LJXXRB5W.js} +23 -22
  100. package/{docUpdateCommands-NNYYWJBI.js → docUpdateCommands-CJCZO54M.js} +28 -25
  101. package/{fetchMessages-KTNM7QAR.js → fetchMessages-BMGVZVSE.js} +4 -3
  102. package/{getPricing-UGDJHI7M.js → getPricing-RYY6OBA4.js} +4 -4
  103. package/handleSendMessageAction-ICGX4QCM.js +402 -0
  104. package/index.js +68 -68
  105. package/{localDialogRead-2VRI24F4.js → localDialogRead-HQZPVIE3.js} +1 -1
  106. package/{localRuntimeDb-LGDF6FQP.js → localRuntimeDb-THJZGAOJ.js} +1 -1
  107. package/{machineCommands-JQPEQFSE.js → machineCommands-YLDZXK4D.js} +64 -58
  108. package/{machineWsRunDispatch-FFFNWVEW.js → machineWsRunDispatch-LTQL3DRE.js} +56 -50
  109. package/{models-LSCRJJ6P.js → models-5K5G2CZI.js} +2 -2
  110. package/package.json +1 -1
  111. package/queryRunOverlay-O4LOMMPO.js +161 -0
  112. package/{read-HXHAZBKH.js → read-3FMPZPER.js} +3 -3
  113. package/{readDocTool-VPBDTO4G.js → readDocTool-VSYHKK3V.js} +1 -1
  114. package/{readlineWorkspace-QSXHSBHA.js → readlineWorkspace-OSPVWNAT.js} +699 -168
  115. package/{removeDialogAgentAction-HUFVN35S.js → removeDialogAgentAction-OAGA2G3U.js} +11 -10
  116. package/{runAgentClientLoop-A75BUU6D.js → runAgentClientLoop-76SUKKPX.js} +46 -40
  117. package/runOverlayPresentation-ZO4VCWEU.js +11 -0
  118. package/{runtimeDoctorCommands-THIHX2SY.js → runtimeDoctorCommands-E2OUORHK.js} +6 -6
  119. package/setDialogExtraReferencesAction-JZEXA5SL.js +27 -0
  120. package/{setPrimaryDialogAgentAction-VB4UV2CC.js → setPrimaryDialogAgentAction-4ZUQQKDG.js} +27 -18
  121. package/{settingSlice-7JYPQNAC.js → settingSlice-7MNKHZ6R.js} +9 -8
  122. package/{skillDiscovery-6M2BZUFN.js → skillDiscovery-KJWT7JBU.js} +3 -3
  123. package/{spaceCommands-4LE45GB7.js → spaceCommands-GIF7MKVD.js} +31 -28
  124. package/{spaceSlice-444MFUP6.js → spaceSlice-M4PVN5PO.js} +22 -21
  125. package/{streamAgentChatTurn-DJAE7USZ.js → streamAgentChatTurn-GCKTFSHQ.js} +96 -55
  126. package/{tableCommands-3P7MJ3PF.js → tableCommands-BEQAGE4I.js} +1 -1
  127. package/{tools-YB6LXSVN.js → tools-RJVFXOLR.js} +35 -30
  128. package/{tuiSummaryLlmCaller-QQL3JA5I.js → tuiSummaryLlmCaller-VUNVBRX3.js} +7 -6
  129. package/types-ZSTJ7MPR.js +7 -0
  130. package/{updateDialogTitleAction-6HGFBM64.js → updateDialogTitleAction-PSR67DLV.js} +25 -24
  131. package/agentRecordCommands-DCH2WBL2.js +0 -99
  132. package/chunk-BYXBJQAS.js +0 -0
  133. package/handleSendMessageAction-LJPUYNOH.js +0 -215
  134. package/{chunk-O4BU24WZ.js → chunk-6Y7A3OQQ.js} +3 -3
  135. package/{chunk-CMKUBIGW.js → chunk-X7W4TNB4.js} +3 -3
  136. package/{localRuntimeAuthority-TEGCOWX4.js → localRuntimeAuthority-4IXJCHZ7.js} +3 -3
@@ -1,15 +1,12 @@
1
1
  import {
2
2
  getModelConfig
3
- } from "./chunk-OGGHETUE.js";
3
+ } from "./chunk-HQPG2PIV.js";
4
4
  import {
5
5
  asTrimmedLowercaseString
6
6
  } from "./chunk-QSJ3HFEF.js";
7
7
  import {
8
8
  asTrimmedString
9
9
  } from "./chunk-3EUW3WEO.js";
10
- import {
11
- isRecord
12
- } from "./chunk-KUG52IAP.js";
13
10
  import {
14
11
  normalizeServerOrigin
15
12
  } from "./chunk-CF7PE763.js";
@@ -31,10 +28,11 @@ function pickAgentRuntimeInferenceOptions(agentConfig) {
31
28
 
32
29
  // packages/agent-runtime/platformProviderEndpoints.ts
33
30
  var OPENAI_RESPONSES_ENDPOINT = "https://api.openai.com/v1/responses";
34
- var DEEPSEEK_RESPONSES_ENDPOINT = "https://api.deepseek.com/v1/responses";
35
31
  var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
36
32
  deepinfra: "https://api.deepinfra.com/v1/openai/chat/completions",
37
- deepseek: "https://api.deepseek.com/chat/completions",
33
+ // DeepSeek official API endpoint removed — all DeepSeek models now route
34
+ // through the nolo provider (Ollama Cloud). See providerRegistry.ts.
35
+ // deepseek: "https://api.deepseek.com/chat/completions",
38
36
  fireworks: "https://api.fireworks.ai/inference/v1/chat/completions",
39
37
  google: "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions",
40
38
  openai: "https://api.openai.com/v1/chat/completions",
@@ -49,9 +47,6 @@ var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
49
47
  };
50
48
  function isOpenAiResponsesModel(args) {
51
49
  const provider = asTrimmedLowercaseString(args.provider);
52
- if (provider === "deepseek") {
53
- return asTrimmedLowercaseString(args.model) === "deepseek-v4-flash";
54
- }
55
50
  if (provider !== "openai") return false;
56
51
  if (args.endpointKey === "responses") return true;
57
52
  if (!args.model) return false;
@@ -62,17 +57,11 @@ function isOpenAiResponsesModel(args) {
62
57
  }
63
58
  }
64
59
  function resolvePlatformResponsesEndpoint(provider) {
65
- switch (asTrimmedLowercaseString(provider)) {
66
- case "openai":
67
- return OPENAI_RESPONSES_ENDPOINT;
68
- case "deepseek":
69
- return DEEPSEEK_RESPONSES_ENDPOINT;
70
- default:
71
- return void 0;
72
- }
60
+ return asTrimmedLowercaseString(provider) === "openai" ? OPENAI_RESPONSES_ENDPOINT : void 0;
73
61
  }
74
62
  var PLATFORM_PROVIDER_ENDPOINT_ALIASES = {
75
- "ollama-cloud": "nolo"
63
+ "ollama-cloud": "nolo",
64
+ deepseek: "nolo"
76
65
  };
77
66
  function resolvePlatformChatCompletionsEndpoint(provider) {
78
67
  const key = asTrimmedLowercaseString(provider);
@@ -344,235 +333,6 @@ async function buildProviderExecutionPlan(args) {
344
333
  };
345
334
  }
346
335
 
347
- // packages/agent-runtime/openAiCompatibleMessages.ts
348
- function preserveAgentStateFields(source, target, options) {
349
- const mutableTarget = target;
350
- if (source.role === "assistant") {
351
- if (!options?.stripReasoningContent && typeof source.reasoning_content === "string") {
352
- mutableTarget.reasoning_content = source.reasoning_content;
353
- }
354
- if (Array.isArray(source.tool_calls)) {
355
- mutableTarget.tool_calls = source.tool_calls;
356
- }
357
- }
358
- if (source.role === "tool") {
359
- const toolCallId = typeof source.tool_call_id === "string" ? source.tool_call_id.trim() : typeof source.toolCallId === "string" ? source.toolCallId.trim() : "";
360
- if (toolCallId) mutableTarget.tool_call_id = toolCallId;
361
- }
362
- return target;
363
- }
364
- function toOpenAiCompatibleMessages(messages, options) {
365
- return messages.map(
366
- (message) => preserveAgentStateFields(message, {
367
- role: message.role,
368
- content: message.content ?? ""
369
- }, options)
370
- );
371
- }
372
-
373
- // packages/integrations/openai/responsesHelpers.ts
374
- var RESPONSES_TOP_LEVEL_SCHEMA_KEYS = ["anyOf", "oneOf", "allOf", "enum", "not"];
375
- var sanitizeResponsesParameters = (parameters) => {
376
- if (!isRecord(parameters)) {
377
- return parameters;
378
- }
379
- const next = { ...parameters };
380
- for (const key of RESPONSES_TOP_LEVEL_SCHEMA_KEYS) {
381
- delete next[key];
382
- }
383
- return next;
384
- };
385
- var appendTextPart = (parts, text, role) => {
386
- if (!text) return;
387
- const last = parts.at(-1);
388
- const textType = role === "assistant" ? "output_text" : "input_text";
389
- if (last?.type === textType) {
390
- last.text += text;
391
- return;
392
- }
393
- parts.push({ type: textType, text });
394
- };
395
- var normalizeMessageParts = (content, role) => {
396
- if (typeof content === "string") {
397
- if (!content) return [];
398
- return [
399
- {
400
- type: role === "assistant" ? "output_text" : "input_text",
401
- text: content
402
- }
403
- ];
404
- }
405
- const parts = [];
406
- for (const part of content ?? []) {
407
- const typedPart = part;
408
- if (typedPart?.type === "text" && typeof typedPart.text === "string") {
409
- appendTextPart(parts, typedPart.text, role);
410
- continue;
411
- }
412
- if (typedPart?.type === "image_url" && typeof typedPart.image_url?.url === "string" && typedPart.image_url.url) {
413
- if (role === "assistant") continue;
414
- parts.push({
415
- type: "input_image",
416
- image_url: typedPart.image_url.url,
417
- detail: typedPart.image_url.detail
418
- });
419
- }
420
- }
421
- return parts;
422
- };
423
- var normalizeToolOutput = (content) => {
424
- if (typeof content === "string") return content;
425
- return JSON.stringify(content ?? "");
426
- };
427
- var toResponsesTools = (tools) => {
428
- if (!Array.isArray(tools) || tools.length === 0) return void 0;
429
- return tools.map((tool) => {
430
- const fn = tool?.function;
431
- if (!fn?.name) return null;
432
- return {
433
- type: "function",
434
- name: fn.name,
435
- description: fn.description,
436
- parameters: sanitizeResponsesParameters(fn.parameters),
437
- strict: fn.strict
438
- };
439
- }).filter(Boolean);
440
- };
441
- var convertMessagesToResponsesInput = (messages) => {
442
- const input = [];
443
- for (const message of messages) {
444
- if (!message?.role) continue;
445
- if (message.role === "tool") {
446
- if (!message.tool_call_id) continue;
447
- input.push({
448
- type: "function_call_output",
449
- call_id: message.tool_call_id,
450
- output: normalizeToolOutput(message.content)
451
- });
452
- continue;
453
- }
454
- const role = message.role;
455
- if (role === "assistant" && typeof message.reasoning_content === "string" && message.reasoning_content) {
456
- input.push({ type: "reasoning", content: message.reasoning_content });
457
- }
458
- const contentParts = normalizeMessageParts(message.content, role);
459
- if (contentParts.length > 0) {
460
- input.push({
461
- type: "message",
462
- role,
463
- content: contentParts
464
- });
465
- }
466
- if (role === "assistant" && Array.isArray(message.content)) {
467
- const replayImages = message.content.map((part) => part).filter(
468
- (part) => part?.type === "image_url" && typeof part.image_url?.url === "string" && Boolean(part.image_url.url)
469
- ).map((part) => ({
470
- type: "input_image",
471
- image_url: part.image_url.url,
472
- detail: part.image_url.detail
473
- }));
474
- if (replayImages.length > 0) {
475
- input.push({
476
- type: "message",
477
- role: "user",
478
- content: replayImages
479
- });
480
- }
481
- }
482
- if (role === "assistant" && Array.isArray(message.tool_calls)) {
483
- for (const toolCall of message.tool_calls) {
484
- if (!toolCall?.id || !toolCall.function?.name) continue;
485
- input.push({
486
- type: "function_call",
487
- call_id: toolCall.id,
488
- name: toolCall.function.name,
489
- arguments: typeof toolCall.function.arguments === "string" ? toolCall.function.arguments : JSON.stringify(toolCall.function.arguments ?? {})
490
- });
491
- }
492
- }
493
- }
494
- return input;
495
- };
496
- var extractTextFromResponseOutput = (response) => {
497
- const parts = [];
498
- for (const item of response?.output ?? []) {
499
- if (item?.type !== "message") continue;
500
- for (const content of item.content ?? []) {
501
- if (content?.type === "output_text" && typeof content.text === "string") {
502
- parts.push(content.text);
503
- }
504
- }
505
- }
506
- return parts.join("");
507
- };
508
- var toDataUrl = (base64Data, mimeType) => {
509
- const normalizedMimeType = asOptionalTrimmedString(mimeType) ?? "image/png";
510
- return `data:${normalizedMimeType};base64,${base64Data}`;
511
- };
512
- var extractImagePartsFromResponseOutput = (response) => {
513
- const images = [];
514
- for (const item of response?.output ?? []) {
515
- if (item?.type === "image_generation_call") {
516
- const result = asOptionalTrimmedString(item.result);
517
- if (result) {
518
- const outputFormat = asOptionalTrimmedString(item.output_format);
519
- images.push({
520
- type: "image_url",
521
- image_url: {
522
- url: toDataUrl(
523
- result,
524
- outputFormat ? `image/${outputFormat}` : void 0
525
- )
526
- }
527
- });
528
- }
529
- continue;
530
- }
531
- if (item?.type !== "message") continue;
532
- for (const content of item.content ?? []) {
533
- const result = asOptionalTrimmedString(content?.result);
534
- if (content?.type === "output_image" && result) {
535
- images.push({
536
- type: "image_url",
537
- image_url: {
538
- url: toDataUrl(
539
- result,
540
- content.mime_type ?? content.mimeType ?? null
541
- )
542
- }
543
- });
544
- }
545
- }
546
- }
547
- return images;
548
- };
549
- var extractToolCallsFromResponseOutput = (response) => {
550
- const calls = [];
551
- for (const item of response?.output ?? []) {
552
- if (item?.type !== "function_call") continue;
553
- if (!item.call_id || !item.name) continue;
554
- calls.push({
555
- id: item.call_id,
556
- type: "function",
557
- function: {
558
- name: item.name,
559
- arguments: typeof item.arguments === "string" ? item.arguments : JSON.stringify(item.arguments ?? {})
560
- }
561
- });
562
- }
563
- return calls;
564
- };
565
-
566
- // packages/core/chat/imageParts.ts
567
- function isImageUrlPart(part) {
568
- return isRecord(part) && part.type === "image_url";
569
- }
570
- function hasImageParts(messages) {
571
- return messages.some(
572
- (message) => Array.isArray(message.content) && message.content.some(isImageUrlPart)
573
- );
574
- }
575
-
576
336
  export {
577
337
  pickAgentRuntimeInferenceOptions,
578
338
  isOpenAiResponsesModel,
@@ -586,14 +346,5 @@ export {
586
346
  resolveAgentRuntimeLocation,
587
347
  resolveProviderTransportDecision,
588
348
  buildProviderAuthHeaders,
589
- buildProviderExecutionPlan,
590
- isImageUrlPart,
591
- hasImageParts,
592
- preserveAgentStateFields,
593
- toOpenAiCompatibleMessages,
594
- toResponsesTools,
595
- convertMessagesToResponsesInput,
596
- extractTextFromResponseOutput,
597
- extractImagePartsFromResponseOutput,
598
- extractToolCallsFromResponseOutput
349
+ buildProviderExecutionPlan
599
350
  };
@@ -5,10 +5,10 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-WRN5EQT7.js";
8
+ } from "./chunk-L2RRMXNJ.js";
9
9
  import {
10
10
  performFetchRequest
11
- } from "./chunk-6565R2TI.js";
11
+ } from "./chunk-EXAEHRLI.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-VE6XMVKG.js";
22
+ } from "./chunk-J67FKTTY.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-YNHQIXX5.js";
32
+ } from "./chunk-UIOYWBU7.js";
33
33
  import {
34
34
  streamAgentChatTurn
35
- } from "./chunk-OQMPU2ML.js";
35
+ } from "./chunk-5PGGCJGV.js";
36
36
  import {
37
37
  EMPTY_ASSISTANT_REPAIR_PROMPT
38
- } from "./chunk-6MHDWKOT.js";
38
+ } from "./chunk-VVKQFITN.js";
39
39
  import {
40
40
  accumulateToolCallDelta,
41
41
  createThinkParserState,
@@ -47,10 +47,13 @@ import {
47
47
  } from "./chunk-LSFAWXKC.js";
48
48
  import {
49
49
  getModelInfo
50
- } from "./chunk-4QQFLN5C.js";
50
+ } from "./chunk-EGPCU42M.js";
51
51
  import {
52
52
  getApiEndpoint
53
- } from "./chunk-OGGHETUE.js";
53
+ } from "./chunk-HQPG2PIV.js";
54
+ import {
55
+ toErrorMessage
56
+ } from "./chunk-HNMXYYJR.js";
54
57
  import {
55
58
  extractCustomId
56
59
  } from "./chunk-DFFIZ25G.js";
@@ -59,27 +62,24 @@ import {
59
62
  removeActiveController,
60
63
  tokenUsageLiveUpdate
61
64
  } from "./chunk-3ASDTTEI.js";
62
- import {
63
- toErrorMessage
64
- } from "./chunk-HNMXYYJR.js";
65
65
  import {
66
66
  selectCurrentServer
67
- } from "./chunk-TTGAVETO.js";
67
+ } from "./chunk-RVOUXDFU.js";
68
68
  import {
69
69
  write
70
- } from "./chunk-SFXYKGK2.js";
70
+ } from "./chunk-XRZJGPFI.js";
71
71
  import {
72
72
  createDialogMessageKeyAndId,
73
73
  dialogMessageKey,
74
74
  toTrimmedString
75
- } from "./chunk-O4BU24WZ.js";
75
+ } from "./chunk-6Y7A3OQQ.js";
76
76
  import {
77
77
  createAsyncThunk,
78
78
  selectIdentityToken
79
- } from "./chunk-DVRHHFEA.js";
79
+ } from "./chunk-XMLRJUU5.js";
80
80
  import {
81
81
  isAbortError
82
- } from "./chunk-OOSFSFMA.js";
82
+ } from "./chunk-R5V5G73M.js";
83
83
  import {
84
84
  asTrimmedString
85
85
  } from "./chunk-3EUW3WEO.js";
@@ -507,7 +507,7 @@ var processToolData = createAsyncThunk(
507
507
  ...llmContext ? { llmContext } : {},
508
508
  ...activity ? { activity } : {}
509
509
  };
510
- const isUiAskChoice = canonicalName === "ui_ask_choice";
510
+ const isUiAskChoice = canonicalName === "ask_user";
511
511
  const blocking = typeof executionToolArgs?.blocking === "boolean" ? executionToolArgs.blocking : true;
512
512
  const hasPendingInteraction = isUiAskChoice && blocking === true;
513
513
  return {
@@ -1223,6 +1223,7 @@ function applyDelta(state, delta) {
1223
1223
  const reasoningChunk = delta.reasoning_content ?? delta.reasoning ?? "";
1224
1224
  if (reasoningChunk) {
1225
1225
  next.reasoningBuffer = (next.reasoningBuffer || "") + reasoningChunk;
1226
+ hasNewVisibleContent = true;
1226
1227
  }
1227
1228
  if (Array.isArray(delta.tool_calls) && delta.tool_calls.length > 0) {
1228
1229
  const accumulated = accumulateToolCallChunks(
@@ -1268,6 +1269,7 @@ function applyDelta(state, delta) {
1268
1269
  next.thinkState = parsed.state;
1269
1270
  if (parsed.reasoning) {
1270
1271
  next.reasoningBuffer = (next.reasoningBuffer || "") + parsed.reasoning;
1272
+ hasNewVisibleContent = true;
1271
1273
  }
1272
1274
  if (parsed.content) {
1273
1275
  next = {
@@ -1296,6 +1298,58 @@ function emitStreamingUpdate(hasNewVisibleContent, state, ctx) {
1296
1298
  })
1297
1299
  );
1298
1300
  }
1301
+ function createStreamThrottler(emitUpdate, options) {
1302
+ let pendingState = null;
1303
+ let timerId = null;
1304
+ const defaultSchedule = (cb) => {
1305
+ if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
1306
+ return window.requestAnimationFrame(cb);
1307
+ }
1308
+ return setTimeout(cb, 16);
1309
+ };
1310
+ const defaultCancel = (id) => {
1311
+ if (typeof window !== "undefined" && typeof window.cancelAnimationFrame === "function") {
1312
+ window.cancelAnimationFrame(id);
1313
+ return;
1314
+ }
1315
+ clearTimeout(id);
1316
+ };
1317
+ const scheduleFn = options?.schedule ?? defaultSchedule;
1318
+ const cancelFn = options?.cancel ?? defaultCancel;
1319
+ return {
1320
+ push(state) {
1321
+ pendingState = state;
1322
+ if (timerId === null) {
1323
+ timerId = scheduleFn(() => {
1324
+ timerId = null;
1325
+ if (pendingState !== null) {
1326
+ const stateToEmit = pendingState;
1327
+ pendingState = null;
1328
+ emitUpdate(stateToEmit);
1329
+ }
1330
+ });
1331
+ }
1332
+ },
1333
+ flush() {
1334
+ if (timerId !== null) {
1335
+ cancelFn(timerId);
1336
+ timerId = null;
1337
+ }
1338
+ if (pendingState !== null) {
1339
+ const stateToEmit = pendingState;
1340
+ pendingState = null;
1341
+ emitUpdate(stateToEmit);
1342
+ }
1343
+ },
1344
+ cancel() {
1345
+ if (timerId !== null) {
1346
+ cancelFn(timerId);
1347
+ timerId = null;
1348
+ }
1349
+ pendingState = null;
1350
+ }
1351
+ };
1352
+ }
1299
1353
  function validateAndPartitionToolCalls(state) {
1300
1354
  const validCalls = [];
1301
1355
  const invalidCalls = [];
@@ -1510,7 +1564,8 @@ var sendOpenAICompletionsRequest = async ({
1510
1564
  parentMessageId,
1511
1565
  messageMetadata,
1512
1566
  disableToolsForThisRequest = false,
1513
- quickChatPerfStartedAt
1567
+ quickChatPerfStartedAt,
1568
+ streamThrottlerOptions
1514
1569
  }) => {
1515
1570
  const { dispatch, getState, signal: thunkSignal } = thunkApi;
1516
1571
  const dialogId = extractCustomId(dialogKey);
@@ -1557,6 +1612,16 @@ var sendOpenAICompletionsRequest = async ({
1557
1612
  let lastFinishReason = null;
1558
1613
  let activeMessageMetadata = messageMetadata;
1559
1614
  let emptyCompletionRetryUsed = false;
1615
+ const throttler = createStreamThrottler((latestState) => {
1616
+ emitStreamingUpdate(true, latestState, {
1617
+ dispatch,
1618
+ agentConfig,
1619
+ messageId,
1620
+ msgKey,
1621
+ dialogId,
1622
+ messageMetadata: activeMessageMetadata
1623
+ });
1624
+ }, streamThrottlerOptions);
1560
1625
  const buildMeta = () => ({
1561
1626
  hasToolCalls: Array.isArray(streamState.assistantToolCalls) && streamState.assistantToolCalls.length > 0,
1562
1627
  hasPendingInteraction: hasPendingInteractionOverall,
@@ -1595,7 +1660,23 @@ var sendOpenAICompletionsRequest = async ({
1595
1660
  currentServer: selectCurrentServer(getState()),
1596
1661
  signal,
1597
1662
  token,
1598
- dialogId
1663
+ dialogId,
1664
+ onRetry: (info) => {
1665
+ dispatch(
1666
+ messageStreaming({
1667
+ id: messageId,
1668
+ dialogId,
1669
+ dbKey: msgKey,
1670
+ content: "",
1671
+ role: "assistant",
1672
+ agentKey: agentConfig.dbKey,
1673
+ cybotKey: agentConfig.dbKey,
1674
+ ...activeMessageMetadata ?? {},
1675
+ isStreaming: true,
1676
+ retryProgress: info
1677
+ })
1678
+ );
1679
+ }
1599
1680
  });
1600
1681
  logQuickChatPerfStage(quickChatPerfStartedAt, "openai-completions-fetch-response", {
1601
1682
  ok: response.ok,
@@ -1648,6 +1729,7 @@ var sendOpenAICompletionsRequest = async ({
1648
1729
  while (true) {
1649
1730
  const { done, value } = await readStreamChunkWithTimeout(reader, signal);
1650
1731
  if (done) {
1732
+ throttler.flush();
1651
1733
  const producedNothing = streamState.contentBuffer.length === 0 && !streamState.reasoningBuffer.trim() && (streamState.assistantToolCalls?.length ?? 0) === 0;
1652
1734
  if (producedNothing && !emptyCompletionRetryUsed && !streamState.hasHandedOff && !streamState.alreadyFinalized && !signal.aborted) {
1653
1735
  emptyCompletionRetryUsed = true;
@@ -1667,6 +1749,7 @@ var sendOpenAICompletionsRequest = async ({
1667
1749
  dialogId
1668
1750
  });
1669
1751
  if (retryResponse.ok && retryResponse.body) {
1752
+ throttler.cancel();
1670
1753
  streamState = createInitialStreamState();
1671
1754
  parseSSE = createSSEParser();
1672
1755
  decoder = new TextDecoder();
@@ -1716,6 +1799,7 @@ var sendOpenAICompletionsRequest = async ({
1716
1799
  continue;
1717
1800
  }
1718
1801
  if (data.error) {
1802
+ throttler.flush();
1719
1803
  const errorMsg = `Error: ${formatStreamErrorMessage(data)}`;
1720
1804
  streamState = {
1721
1805
  ...streamState,
@@ -1744,19 +1828,18 @@ var sendOpenAICompletionsRequest = async ({
1744
1828
  { dialogKey }
1745
1829
  );
1746
1830
  }
1747
- emitStreamingUpdate(hasNewVisibleContent, streamState, {
1748
- dispatch,
1749
- agentConfig,
1750
- messageId,
1751
- msgKey,
1752
- dialogId,
1753
- messageMetadata: activeMessageMetadata
1754
- });
1831
+ if (hasNewVisibleContent) {
1832
+ throttler.push(streamState);
1833
+ }
1834
+ if (Array.isArray(delta.tool_calls) && delta.tool_calls.length > 0) {
1835
+ throttler.flush();
1836
+ }
1755
1837
  const finishReason = choice.finish_reason;
1756
1838
  if (finishReason) {
1757
1839
  lastFinishReason = finishReason;
1758
1840
  streamState.finishReason = finishReason;
1759
1841
  if (finishReason === "tool_calls") {
1842
+ throttler.flush();
1760
1843
  if (streamState.totalUsage) {
1761
1844
  dispatch(tokenUsageLiveUpdate({
1762
1845
  input_tokens: streamState.totalUsage.prompt_tokens ?? streamState.totalUsage.input_tokens,
@@ -1797,6 +1880,7 @@ var sendOpenAICompletionsRequest = async ({
1797
1880
  }
1798
1881
  }
1799
1882
  } catch (error) {
1883
+ throttler.flush();
1800
1884
  let errorText;
1801
1885
  const isAbort = isAbortError(error);
1802
1886
  if (isAbort) {
@@ -1818,6 +1902,7 @@ var sendOpenAICompletionsRequest = async ({
1818
1902
  }
1819
1903
  streamState = await finalizeStream(streamState, finalizeCtx);
1820
1904
  } finally {
1905
+ throttler.cancel();
1821
1906
  logQuickChatPerfStage(quickChatPerfStartedAt, "openai-completions-stream-finished", {
1822
1907
  dialogKey
1823
1908
  });
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_AGENT_BASE_POLICY,
3
3
  DEFAULT_USER_PREFERENCE_PROFILE
4
- } from "./chunk-TTGAVETO.js";
4
+ } from "./chunk-RVOUXDFU.js";
5
5
 
6
6
  // packages/ai/policy/runtimePolicy.ts
7
7
  var clampLevel = (value, fallback) => {
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  updateContentTitle
3
- } from "./chunk-YNHQIXX5.js";
3
+ } from "./chunk-UIOYWBU7.js";
4
4
  import {
5
5
  require_date_fns
6
6
  } from "./chunk-M76ECQRD.js";
7
- import {
8
- require_react
9
- } from "./chunk-3ASDTTEI.js";
10
7
  import {
11
8
  toErrorMessage
12
9
  } from "./chunk-HNMXYYJR.js";
10
+ import {
11
+ require_react
12
+ } from "./chunk-3ASDTTEI.js";
13
13
  import {
14
14
  patch,
15
15
  readAndWait
16
- } from "./chunk-SFXYKGK2.js";
16
+ } from "./chunk-XRZJGPFI.js";
17
17
  import {
18
18
  asOptionalTrimmedString
19
19
  } from "./chunk-G3SUCT4W.js";
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
367
367
  }
368
368
  }
369
369
  async function createDocState(args, thunkApi) {
370
- const { createPageAction } = await import("./createPageAction-4F3ZGQJD.js");
370
+ const { createPageAction } = await import("./createPageAction-PB3KXZIA.js");
371
371
  return createPageAction(args, thunkApi);
372
372
  }
373
373
  function subscribe(listener) {
@@ -14,7 +14,7 @@ var deepSeekModels = [
14
14
  fnCall: true,
15
15
  supportsTool: true,
16
16
  supportsReasoningEffort: true,
17
- endpointKey: "responses",
17
+ endpointKey: "chat.completions",
18
18
  price: {
19
19
  input: 1,
20
20
  inputCacheHit: 0.02,
@@ -499,7 +499,6 @@ var zaiModels = [];
499
499
  // packages/ai/llm/kimi.ts
500
500
  var PLATFORM_HOSTED_KIMI_K3_MODEL = "kimi-k3";
501
501
  var PLATFORM_HOSTED_KIMI_K26_MODEL = "kimi-k2.6";
502
- var PLATFORM_HOSTED_KIMI_K27_CODE_MODEL = "kimi-k2.7-code";
503
502
  var PLATFORM_HOSTED_KIMI_PROVIDER = "nolo";
504
503
  var LEGACY_OLLAMA_CLOUD_PROVIDER = "ollama-cloud";
505
504
  var isNoloHostedProvider = (provider) => {
@@ -531,10 +530,6 @@ var PLATFORM_HOSTED_KIMI_PRICE = {
531
530
  input: toPlatformCredits(0.6),
532
531
  output: toPlatformCredits(2.4)
533
532
  };
534
- var PLATFORM_HOSTED_KIMI_K27_CODE_PRICE = {
535
- input: toPlatformCredits(1.2),
536
- output: toPlatformCredits(4.8)
537
- };
538
533
  var PLATFORM_HOSTED_KIMI_K3_PRICE = {
539
534
  input: toPlatformCredits(3),
540
535
  output: toPlatformCredits(15)
@@ -572,15 +567,6 @@ var platformHostedModels = [
572
567
  contextWindow: 262144,
573
568
  supportsTool: true
574
569
  },
575
- {
576
- name: PLATFORM_HOSTED_KIMI_K27_CODE_MODEL,
577
- displayName: "Kimi K2.7 Coding",
578
- hasVision: true,
579
- price: { ...PLATFORM_HOSTED_KIMI_K27_CODE_PRICE },
580
- maxOutputTokens: 262144,
581
- contextWindow: 256e3,
582
- supportsTool: true
583
- },
584
570
  {
585
571
  name: PLATFORM_HOSTED_GLM_52_MODEL,
586
572
  displayName: "GLM 5.2",