nolo-cli 0.255.0-alpha.1 → 0.256.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/{_executeModel-XD2EAFVG.js → _executeModel-E2LL7FPO.js} +12 -12
  2. package/{agentDeleteCommand-AI2AAFA4.js → agentDeleteCommand-ORNRRKJO.js} +11 -11
  3. package/{agentEmailCommands-I544I2MU.js → agentEmailCommands-2ALVFOD5.js} +13 -13
  4. package/{agentListCommands-3NB4FDIJ.js → agentListCommands-6I4NQPR4.js} +1 -1
  5. package/{agentMachineCommands-RZEHM6NS.js → agentMachineCommands-PNHTIJ6A.js} +1 -1
  6. package/{agentRecordCommands-X2AVD6Y2.js → agentRecordCommands-BEZPBYBM.js} +12 -12
  7. package/{agentRunCommand-XU5TL3WO.js → agentRunCommand-2T72V5KY.js} +12 -12
  8. package/{agentSlice-ZFY3PT3D.js → agentSlice-KOQXUPKT.js} +1 -1
  9. package/{appDeleteCommands-J5BTYVPC.js → appDeleteCommands-IIOP3CZU.js} +2 -2
  10. package/{appDeployCommands-I3JIN7TN.js → appDeployCommands-S5ZNB7MA.js} +2 -2
  11. package/{appDeployStatusCommands-BKJVLIOV.js → appDeployStatusCommands-MQIGLK3T.js} +2 -2
  12. package/{appGetCommands-67JTU36H.js → appGetCommands-XFX4E3KR.js} +2 -2
  13. package/{appListCommands-HF4GFCN4.js → appListCommands-QR7LT4AK.js} +2 -2
  14. package/{authCommand-Y3CXNAYM.js → authCommand-HKSXJT3J.js} +4 -4
  15. package/{chromeOpsCommands-W5I2AEOV.js → chromeOpsCommands-4UIKH26F.js} +1 -1
  16. package/{chunk-YKCFDOO4.js → chunk-2RZBFJEG.js} +256 -21
  17. package/{chunk-Q66O5LN3.js → chunk-3GGVFHWI.js} +2 -2
  18. package/{chunk-24Z44WHO.js → chunk-7B55IVLF.js} +88 -8
  19. package/{chunk-QJKDHR4Y.js → chunk-7JMBQ7YU.js} +1 -1
  20. package/{chunk-6FONTXR7.js → chunk-ADUCBH4M.js} +6 -6
  21. package/{chunk-E47JZP2R.js → chunk-APQBEIOQ.js} +1 -1
  22. package/{chunk-PVHY7Y6T.js → chunk-APXC3SQO.js} +2 -2
  23. package/{chunk-MDHI2LWF.js → chunk-BB76X6O4.js} +1 -1
  24. package/{chunk-LQ4CQKTS.js → chunk-BD5YJJLJ.js} +2 -2
  25. package/{chunk-JPZKKSGT.js → chunk-C63KMRJE.js} +1 -1
  26. package/{chunk-2BHHT2TR.js → chunk-CVDJUPBN.js} +3 -3
  27. package/{chunk-D53SPVAC.js → chunk-DCTQJDDQ.js} +3 -3
  28. package/{chunk-JAAYO52G.js → chunk-IZHENZQ5.js} +1 -1
  29. package/{chunk-KF7M2UEK.js → chunk-JAGD4PSH.js} +2 -2
  30. package/{chunk-AAYDROBM.js → chunk-JGVWHUYK.js} +2 -2
  31. package/{chunk-V5NK6KMF.js → chunk-JOJH3KWV.js} +18 -2
  32. package/{chunk-K5X4D2TS.js → chunk-KO5PFS74.js} +8 -8
  33. package/{chunk-HZQGCFPJ.js → chunk-LJ6WIQZO.js} +1 -1
  34. package/{chunk-QNZRR3NT.js → chunk-MD7O2NN2.js} +3 -3
  35. package/{chunk-CAPHUP3M.js → chunk-MUDMYJCM.js} +2 -2
  36. package/{chunk-H6EKTB6X.js → chunk-NRUYSNSZ.js} +1 -1
  37. package/{chunk-NAW2SN54.js → chunk-RQKTCHQM.js} +1 -1
  38. package/{chunk-3W2J3LFB.js → chunk-SIHOY5YI.js} +5 -5
  39. package/{chunk-H3KLIPAL.js → chunk-TF427WGH.js} +2 -2
  40. package/{chunk-QEVT4LQ3.js → chunk-V6S5OZSP.js} +7 -7
  41. package/{chunk-KRDG2XCI.js → chunk-WFEWP352.js} +3 -3
  42. package/{chunk-TCAAHWCY.js → chunk-Z3JZ2R5F.js} +2 -2
  43. package/{commandRegistry-YCKR4SWB.js → commandRegistry-RNYUOKUE.js} +58 -58
  44. package/{contentThunks-R2ZLM2Z3.js → contentThunks-ZDBDDZP3.js} +3 -3
  45. package/{cooldownCommands-TVZBWUN3.js → cooldownCommands-Y4ZQQ35D.js} +1 -1
  46. package/{createAgentAutomationAction-Q665HFZS.js → createAgentAutomationAction-HEZ3G5L4.js} +3 -3
  47. package/{createDialogAction-VOGA6VXH.js → createDialogAction-DK62W5VA.js} +4 -4
  48. package/{createPageAction-FICG35GF.js → createPageAction-W6NXHVKO.js} +4 -4
  49. package/{dialogCommands-TCIB4AMT.js → dialogCommands-Z24IDINY.js} +2 -2
  50. package/{dialogSlice-SCZJH2Q3.js → dialogSlice-62GISS77.js} +2 -2
  51. package/{dialogTraceCommand-E3BYXL3D.js → dialogTraceCommand-FDINAIZ6.js} +2 -2
  52. package/{docCreateCommands-UHY2QSEL.js → docCreateCommands-SXA4TMGJ.js} +1 -1
  53. package/{docDeleteCommands-JX53B6VB.js → docDeleteCommands-ELXSZK3F.js} +1 -1
  54. package/{docReadCommands-H5XZBEYD.js → docReadCommands-DFLAQPI4.js} +1 -1
  55. package/{docStore-KTTOVQLL.js → docStore-UWF2PMCB.js} +1 -1
  56. package/{docUpdateCommands-YYYU6CHT.js → docUpdateCommands-KB6M5HUH.js} +1 -1
  57. package/{handleSendMessageAction-FRGNSG6B.js → handleSendMessageAction-ZV6OQPQG.js} +8 -8
  58. package/{hostCredentialCreate-V5EDFPAV.js → hostCredentialCreate-3IA5IJFG.js} +12 -12
  59. package/index.js +6 -6
  60. package/{localRuntimeAdapter-VMGFXQOJ.js → localRuntimeAdapter-SSG5ORLZ.js} +11 -11
  61. package/{machineCommands-AUPY2QB6.js → machineCommands-ECFQMLHA.js} +12 -12
  62. package/{machineWsRunDispatch-KNOARY66.js → machineWsRunDispatch-7PROH7E7.js} +12 -12
  63. package/package.json +1 -1
  64. package/{projectArchive-KON534LA.js → projectArchive-JN43WW4E.js} +4 -4
  65. package/{readlineWorkspace-MHYNJR5O.js → readlineWorkspace-D6EUSB2Q.js} +106 -55
  66. package/{runAgentClientLoop-YRGQCRC4.js → runAgentClientLoop-FEZTSUSJ.js} +10 -10
  67. package/{secretCommands-POD67M6Y.js → secretCommands-53NZFD4T.js} +2 -2
  68. package/{spaceCommands-USN52WYJ.js → spaceCommands-4ACQQNZL.js} +48 -4
  69. package/{streamAgentChatTurn-EQO3ULUB.js → streamAgentChatTurn-I425SVYJ.js} +12 -12
  70. package/{tools-UME4HYSH.js → tools-WBPFTSMK.js} +7 -7
  71. package/{updateCommands-L32TVOI7.js → updateCommands-VQEBBIGO.js} +3 -3
  72. package/{updateDialogTitleAction-NZIGJL5Q.js → updateDialogTitleAction-VB5DTVXV.js} +3 -3
  73. package/{windowsSelfUpdate-AGVLDVQS.js → windowsSelfUpdate-ZEZKGX4M.js} +2 -2
@@ -8,7 +8,7 @@ import {
8
8
  runXaiOAuthDeviceCode,
9
9
  runXaiOAuthLogin,
10
10
  syncCredentialToServer
11
- } from "./chunk-D53SPVAC.js";
11
+ } from "./chunk-DCTQJDDQ.js";
12
12
  import {
13
13
  createAccountSessionCore,
14
14
  createDeviceAuthorizationProtocol,
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-HQUGB2HM.js";
20
20
  import {
21
21
  runCloudflareOAuthLogin
22
- } from "./chunk-E47JZP2R.js";
22
+ } from "./chunk-APQBEIOQ.js";
23
23
  import {
24
24
  COLLAPSED_PASTE_PLACEHOLDER_RE,
25
25
  DEFAULT_TUI_AGENT_KEY,
@@ -110,7 +110,7 @@ import {
110
110
  toolRowDetailLine,
111
111
  tuiRenderThemeFingerprint,
112
112
  userBubbleSurfaceBackgroundSequence
113
- } from "./chunk-YKCFDOO4.js";
113
+ } from "./chunk-2RZBFJEG.js";
114
114
  import "./chunk-6QDYSCPW.js";
115
115
  import "./chunk-GAHJLSDO.js";
116
116
  import "./chunk-BD22OFDQ.js";
@@ -134,7 +134,7 @@ import {
134
134
  resolveCliRequestedToolNames,
135
135
  resolveNoticeTitle,
136
136
  setTurnNoticeMeta
137
- } from "./chunk-QEVT4LQ3.js";
137
+ } from "./chunk-V6S5OZSP.js";
138
138
  import {
139
139
  createHostApprovalCardQueue,
140
140
  formatApprovalRemaining,
@@ -166,7 +166,7 @@ import {
166
166
  wrapTextToLines,
167
167
  wrapTranscriptLine,
168
168
  wrapTranscriptLineWithLayout
169
- } from "./chunk-JPZKKSGT.js";
169
+ } from "./chunk-C63KMRJE.js";
170
170
  import "./chunk-GIXWVN2W.js";
171
171
  import "./chunk-PENRYZ4D.js";
172
172
  import "./chunk-U6RD332P.js";
@@ -198,7 +198,7 @@ import {
198
198
  import {
199
199
  defaultPromptReader,
200
200
  setSecret
201
- } from "./chunk-MDHI2LWF.js";
201
+ } from "./chunk-BB76X6O4.js";
202
202
  import {
203
203
  createTuiSummaryLlmCaller
204
204
  } from "./chunk-OB4FBZXJ.js";
@@ -216,24 +216,24 @@ import "./chunk-BMQ2MJUK.js";
216
216
  import "./chunk-ATNTHIZI.js";
217
217
  import "./chunk-ZMJMHXYX.js";
218
218
  import "./chunk-JEXVIMYZ.js";
219
- import "./chunk-AAYDROBM.js";
219
+ import "./chunk-JGVWHUYK.js";
220
220
  import "./chunk-KZ4A7EIV.js";
221
- import "./chunk-K5X4D2TS.js";
221
+ import "./chunk-KO5PFS74.js";
222
222
  import "./chunk-EXD7S7QW.js";
223
223
  import "./chunk-MVOZ22RZ.js";
224
224
  import "./chunk-KG27JIG4.js";
225
- import "./chunk-KRDG2XCI.js";
225
+ import "./chunk-WFEWP352.js";
226
226
  import "./chunk-NF64D32W.js";
227
227
  import "./chunk-R3FZHW4Q.js";
228
228
  import "./chunk-WDWZPASX.js";
229
- import "./chunk-LQ4CQKTS.js";
229
+ import "./chunk-BD5YJJLJ.js";
230
230
  import "./chunk-WSLL7VV4.js";
231
231
  import "./chunk-VF4K2QE6.js";
232
232
  import "./chunk-LLUBUHNT.js";
233
233
  import "./chunk-U6QNVOR5.js";
234
234
  import "./chunk-MNFUKRRU.js";
235
- import "./chunk-H3KLIPAL.js";
236
- import "./chunk-HZQGCFPJ.js";
235
+ import "./chunk-TF427WGH.js";
236
+ import "./chunk-LJ6WIQZO.js";
237
237
  import {
238
238
  createChatQueueRuntime,
239
239
  createTurnRequest,
@@ -241,14 +241,14 @@ import {
241
241
  historyTokensBeforeLatestAssistant,
242
242
  initialChatQueueState,
243
243
  normalizeRunCompletionShape
244
- } from "./chunk-24Z44WHO.js";
244
+ } from "./chunk-7B55IVLF.js";
245
245
  import "./chunk-BUDVRYES.js";
246
246
  import "./chunk-TZXPT53C.js";
247
247
  import {
248
248
  BUILTIN_DIALOG_LLM_FALLBACK_MODEL,
249
249
  BUILTIN_SUMMARY_LLM_CONFIG
250
250
  } from "./chunk-523DITKR.js";
251
- import "./chunk-QNZRR3NT.js";
251
+ import "./chunk-MD7O2NN2.js";
252
252
  import "./chunk-YN23INFZ.js";
253
253
  import "./chunk-BYXBJQAS.js";
254
254
  import "./chunk-6VEO7Z3Y.js";
@@ -272,7 +272,7 @@ import {
272
272
  normalizeDialogRecord,
273
273
  readDialogSnapshot,
274
274
  sortDialogs
275
- } from "./chunk-JAAYO52G.js";
275
+ } from "./chunk-IZHENZQ5.js";
276
276
  import "./chunk-ID4G2MAR.js";
277
277
  import "./chunk-Y5GCAMGP.js";
278
278
  import {
@@ -515,7 +515,7 @@ import {
515
515
  getCliInstallChannel,
516
516
  probeCliUpdate,
517
517
  runSelfUpdateDetailed
518
- } from "./chunk-TCAAHWCY.js";
518
+ } from "./chunk-Z3JZ2R5F.js";
519
519
  import {
520
520
  parseUserIdFromAuthToken,
521
521
  resolveAuthToken,
@@ -544,7 +544,7 @@ import {
544
544
  resolveDefaultSpawn,
545
545
  spawnProcess
546
546
  } from "./chunk-4O22PGNQ.js";
547
- import "./chunk-NAW2SN54.js";
547
+ import "./chunk-RQKTCHQM.js";
548
548
  import {
549
549
  dailyWelcomeTip,
550
550
  getCliLocale,
@@ -554,7 +554,7 @@ import {
554
554
  t,
555
555
  toolFamilyOf,
556
556
  toolLabelVariants
557
- } from "./chunk-V5NK6KMF.js";
557
+ } from "./chunk-JOJH3KWV.js";
558
558
  import "./chunk-EJQE5HB7.js";
559
559
  import "./chunk-6SOWMEAY.js";
560
560
  import {
@@ -1976,10 +1976,16 @@ function createTurnHistory() {
1976
1976
  followBottom: true
1977
1977
  };
1978
1978
  }
1979
- function startTurn(history, role) {
1979
+ function formatToolDetails(history, last) {
1980
+ return (last ? history.toolDetails?.slice(history.lastTurnToolDetailStart ?? 0) : history.toolDetails)?.join("") ?? "";
1981
+ }
1982
+ function startTurn(history, role, options) {
1980
1983
  if (history.currentRole !== null && history.currentContent) {
1981
1984
  finalizeCurrentTurn(history);
1982
1985
  }
1986
+ if (role === "assistant" && !options?.continueAssistantTurn) {
1987
+ history.lastTurnToolDetailStart = history.toolDetails?.length ?? 0;
1988
+ }
1983
1989
  history.currentRole = role;
1984
1990
  history.currentContent = "";
1985
1991
  history.currentBlocks = [];
@@ -1992,7 +1998,7 @@ function appendToCurrentTurn(history, chunk) {
1992
1998
  function appendCurrentBlock(history, kind, chunk) {
1993
1999
  if (!chunk) return;
1994
2000
  const last = history.currentBlocks.at(-1);
1995
- if (last?.kind === kind) {
2001
+ if (last?.kind === kind && !last.runWindow) {
1996
2002
  last.content = applyTerminalOutputToText(last.content, chunk);
1997
2003
  } else {
1998
2004
  history.currentBlocks.push({
@@ -2003,11 +2009,27 @@ function appendCurrentBlock(history, kind, chunk) {
2003
2009
  }
2004
2010
  function finalizeCurrentTurn(history) {
2005
2011
  if (history.currentRole !== null) {
2012
+ let content = history.currentContent;
2013
+ const blocks = [];
2014
+ for (let index = history.currentBlocks.length - 1; index >= 0; index--) {
2015
+ const block = history.currentBlocks[index];
2016
+ const window = block.runWindow;
2017
+ const end = window ? window.start + block.content.length : 0;
2018
+ if (window && content.slice(window.start, end) === block.content) {
2019
+ const summary = `${window.finalizedSummary}
2020
+ `;
2021
+ content = content.slice(0, window.start) + summary + content.slice(end);
2022
+ blocks.push({ kind: block.kind, content: summary });
2023
+ } else {
2024
+ blocks.push({ kind: block.kind, content: block.content });
2025
+ }
2026
+ }
2027
+ blocks.reverse();
2006
2028
  history.turns.push({
2007
2029
  role: history.currentRole,
2008
- content: compactTurnContent(history.currentContent),
2030
+ content: compactTurnContent(content),
2009
2031
  ...history.currentRole === "assistant" && history.currentBlocks.length > 0 ? {
2010
- blocks: history.currentBlocks.map((block) => ({
2032
+ blocks: blocks.map((block) => ({
2011
2033
  ...block,
2012
2034
  content: compactTurnContent(block.content)
2013
2035
  })).filter((block) => block.content.length > 0)
@@ -2033,9 +2055,18 @@ function appendLocalTurn(history, command, output) {
2033
2055
  function readTreePayload(chunk) {
2034
2056
  return JSON.parse(chunk.slice(TUI_TREE_MARKER.length).replace(/\u0002\n?$/, ""));
2035
2057
  }
2036
- function applyTreeRewrite(text, chunk) {
2037
- if (!chunk.startsWith(TUI_TREE_MARKER)) return null;
2038
- const payload = readTreePayload(chunk);
2058
+ function applyTreeRewrite(text, payload) {
2059
+ if (payload.previousLines && payload.lines) {
2060
+ let end = text.length - Number(text.endsWith("\n"));
2061
+ for (let i = payload.previousLines.length - 1; i >= 0; i--) {
2062
+ if (end < 0) return null;
2063
+ const start = end === 0 ? 0 : text.lastIndexOf("\n", end - 1) + 1;
2064
+ if (stripAnsi(text.slice(start, end)) !== stripAnsi(payload.previousLines[i])) return null;
2065
+ end = start - 1;
2066
+ }
2067
+ return `${text.slice(0, end + 1)}${payload.lines.join("\n")}
2068
+ `;
2069
+ }
2039
2070
  const tree = `\u25B8 ${payload.summary}`;
2040
2071
  const hadTrailingNewline = text.endsWith("\n");
2041
2072
  const body = hadTrailingNewline ? text.slice(0, -1) : text;
@@ -2058,36 +2089,52 @@ function applyTreeRewrite(text, chunk) {
2058
2089
  }
2059
2090
  function applyOutputChunkToCurrentTurn(history, chunk, kind = "assistant") {
2060
2091
  if (kind === "tool") {
2092
+ const payload = chunk.startsWith(TUI_TREE_MARKER) ? readTreePayload(chunk) : null;
2061
2093
  const details = history.toolDetails ??= [];
2062
- details.push(
2063
- chunk.startsWith(TUI_TREE_MARKER) ? readTreePayload(chunk).details ?? readTreePayload(chunk).fallback : (
2064
- // 详情里把行首图标还原成双语族名(Read/读取…):/tools 永远读得懂。
2065
- toolRowDetailLine(chunk)
2066
- )
2067
- );
2068
- while (details.length > MAX_TUI_HISTORY_TURNS * 10) details.shift();
2069
- if (chunk.startsWith(TUI_TREE_MARKER)) {
2070
- const payload = readTreePayload(chunk);
2071
- if (payload.appendOnly) {
2094
+ details.push(payload ? payload.details ?? payload.fallback : toolRowDetailLine(chunk));
2095
+ while (details.length > MAX_TUI_HISTORY_TURNS * 10) {
2096
+ details.shift();
2097
+ history.lastTurnToolDetailStart = Math.max(0, (history.lastTurnToolDetailStart ?? 0) - 1);
2098
+ }
2099
+ if (payload) {
2100
+ const appendFallback = () => {
2072
2101
  history.currentContent = applyTerminalOutputToText(history.currentContent, payload.fallback);
2073
2102
  appendCurrentBlock(history, kind, payload.fallback);
2103
+ };
2104
+ if (payload.appendOnly) {
2105
+ appendFallback();
2074
2106
  return true;
2075
2107
  }
2076
- const rewrittenTree = applyTreeRewrite(history.currentContent, chunk);
2077
- if (rewrittenTree === null) {
2078
- const safe = readTreePayload(chunk).fallback;
2079
- history.currentContent = applyTerminalOutputToText(history.currentContent, safe);
2080
- appendCurrentBlock(history, kind, safe);
2081
- return false;
2082
- }
2083
- const treeContent = rewrittenTree;
2084
- history.currentContent = treeContent;
2085
2108
  const lastBlock = history.currentBlocks.at(-1);
2086
- const treeBlock = `\u25B8 ${readTreePayload(chunk).summary}
2109
+ const rewrittenTree = applyTreeRewrite(history.currentContent, payload);
2110
+ if (payload.previousLines && payload.lines) {
2111
+ const rewrittenBlock = lastBlock?.kind === "tool" ? applyTreeRewrite(lastBlock.content, payload) : null;
2112
+ if (rewrittenTree !== null && rewrittenBlock !== null && lastBlock) {
2113
+ const window = `${payload.lines.join("\n")}
2087
2114
  `;
2088
- if (lastBlock?.kind === "tool") lastBlock.content = applyTreeRewrite(lastBlock.content, chunk) ?? `${lastBlock.content}${treeBlock}`;
2089
- else history.currentBlocks.push({ kind: "tool", content: treeBlock });
2090
- return true;
2115
+ const prefix = rewrittenBlock.slice(0, -window.length);
2116
+ history.currentBlocks.pop();
2117
+ if (prefix) history.currentBlocks.push({ kind: "tool", content: prefix });
2118
+ history.currentBlocks.push({
2119
+ kind: "tool",
2120
+ content: window,
2121
+ ...payload.finalizedSummary !== void 0 && {
2122
+ runWindow: { start: rewrittenTree.length - window.length, finalizedSummary: payload.finalizedSummary }
2123
+ }
2124
+ });
2125
+ history.currentContent = rewrittenTree;
2126
+ return true;
2127
+ }
2128
+ } else if (rewrittenTree !== null) {
2129
+ history.currentContent = rewrittenTree;
2130
+ const treeBlock = `\u25B8 ${payload.summary}
2131
+ `;
2132
+ if (lastBlock?.kind === "tool") lastBlock.content = applyTreeRewrite(lastBlock.content, payload) ?? `${lastBlock.content}${treeBlock}`;
2133
+ else history.currentBlocks.push({ kind: "tool", content: treeBlock });
2134
+ return true;
2135
+ }
2136
+ appendFallback();
2137
+ return false;
2091
2138
  }
2092
2139
  }
2093
2140
  const next = applyTerminalOutputToText(history.currentContent, chunk);
@@ -11435,7 +11482,7 @@ function appendStreamSafeNotice(history, text, deps) {
11435
11482
  history.currentBlocks = [];
11436
11483
  }
11437
11484
  deps.appendLocalTurn(history, "", text);
11438
- if (wasStreamingAssistant) deps.startTurn(history, "assistant");
11485
+ if (wasStreamingAssistant) deps.startTurn(history, "assistant", { continueAssistantTurn: true });
11439
11486
  }
11440
11487
  function createTurnInjectionInbox() {
11441
11488
  let pending = [];
@@ -15319,7 +15366,7 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
15319
15366
  if (!approved) return false;
15320
15367
  const commandText = typeof request.command === "string" ? request.command : "";
15321
15368
  if (commandText) {
15322
- const { runApprovedCredentialCommand } = await import("./hostCredentialCreate-V5EDFPAV.js");
15369
+ const { runApprovedCredentialCommand } = await import("./hostCredentialCreate-3IA5IJFG.js");
15323
15370
  const hostResult = await runApprovedCredentialCommand({
15324
15371
  commandText,
15325
15372
  approvalEventId: request.id,
@@ -17470,7 +17517,7 @@ async function compactDialog(options) {
17470
17517
  fetchImpl,
17471
17518
  agentRef: getActiveDialogAgentId(current) ?? void 0,
17472
17519
  loadAdapter: async () => {
17473
- const { createCliLocalRuntimeAdapter: createCliLocalRuntimeAdapter2 } = await import("./localRuntimeAdapter-VMGFXQOJ.js");
17520
+ const { createCliLocalRuntimeAdapter: createCliLocalRuntimeAdapter2 } = await import("./localRuntimeAdapter-SSG5ORLZ.js");
17474
17521
  return createCliLocalRuntimeAdapter2({ env: { ...options.env ?? {}, AUTH_TOKEN: options.authToken, NOLO_SERVER: options.serverUrl }, fetchImpl });
17475
17522
  }
17476
17523
  }) : void 0);
@@ -18375,6 +18422,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
18375
18422
  };
18376
18423
  history.turns.length = 0;
18377
18424
  history.toolDetails = [];
18425
+ history.lastTurnToolDetailStart = 0;
18378
18426
  history.currentRole = null;
18379
18427
  history.currentContent = "";
18380
18428
  history.scrollTop = 0;
@@ -18716,6 +18764,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
18716
18764
  const restored = loadedTurns.slice(-MAX_TUI_HISTORY_TURNS);
18717
18765
  history.turns.length = 0;
18718
18766
  history.toolDetails = [];
18767
+ history.lastTurnToolDetailStart = 0;
18719
18768
  history.turns.push(...restored);
18720
18769
  history.currentRole = null;
18721
18770
  history.currentContent = "";
@@ -20241,9 +20290,10 @@ ${lines}` : lines;
20241
20290
  }
20242
20291
  };
20243
20292
  const runSubmittedLine = async (line, actionGateHandler, confirmDestructiveAction, directUserSubmission = false) => {
20244
- if (line.trim() === "/tools") {
20293
+ const toolsCommand = line.trim().match(/^\/tools(?:\s+(last))?$/i);
20294
+ if (toolsCommand) {
20245
20295
  emitCommandOutput(
20246
- history.toolDetails?.join("") || themeText(t("noToolDetails"), "muted", resolveCliColorEnabled())
20296
+ formatToolDetails(history, Boolean(toolsCommand[1])) || themeText(t("noToolDetails"), "muted", resolveCliColorEnabled())
20247
20297
  );
20248
20298
  return false;
20249
20299
  }
@@ -20604,7 +20654,7 @@ ${lines}` : lines;
20604
20654
  onApprove: createSnapshotGuardedApproval("local", () => state.permissionGrants, approveLocalConfirms),
20605
20655
  onApproved: async (approvedGate) => {
20606
20656
  if (approvedGate.kind !== "confirm") return null;
20607
- const { executeApprovedCredentialCreate } = await import("./hostCredentialCreate-V5EDFPAV.js");
20657
+ const { executeApprovedCredentialCreate } = await import("./hostCredentialCreate-3IA5IJFG.js");
20608
20658
  const hostResult = await executeApprovedCredentialCreate({
20609
20659
  gate: approvedGate,
20610
20660
  approvalGateId: approvedGate.id,
@@ -21500,7 +21550,8 @@ ${hint}` : hint;
21500
21550
  const busySlashCommand = trimmedText.split(/\s+/)[0]?.toLowerCase();
21501
21551
  if (busySlashCommand === "/tools") {
21502
21552
  recordWorkspaceInputHistory(expandedSubmitForHistory);
21503
- printStreamSafeNotice(history.toolDetails?.join("") || t("noToolDetails"));
21553
+ const last = trimmedText.split(/\s+/)[1]?.toLowerCase() === "last";
21554
+ printStreamSafeNotice(formatToolDetails(history, last) || t("noToolDetails"));
21504
21555
  bumpDraftEpoch();
21505
21556
  buffer = "";
21506
21557
  cursorPos = 0;
@@ -2,44 +2,44 @@ import {
2
2
  fetchAgentContexts,
3
3
  responsesJsonToChatCompletions,
4
4
  updateAgentTokens
5
- } from "./chunk-CAPHUP3M.js";
5
+ } from "./chunk-MUDMYJCM.js";
6
6
  import {
7
7
  generateRequestBody,
8
8
  performFetchRequest,
9
9
  reportToolExecutionErrorInBackground,
10
10
  sanitizeOutboundBody,
11
11
  stripModelToolArgs
12
- } from "./chunk-KF7M2UEK.js";
12
+ } from "./chunk-JAGD4PSH.js";
13
13
  import "./chunk-KZ4A7EIV.js";
14
14
  import {
15
15
  findToolExecutor
16
- } from "./chunk-K5X4D2TS.js";
16
+ } from "./chunk-KO5PFS74.js";
17
17
  import "./chunk-EXD7S7QW.js";
18
18
  import "./chunk-MVOZ22RZ.js";
19
19
  import "./chunk-KG27JIG4.js";
20
20
  import {
21
21
  mergeReferences
22
- } from "./chunk-PVHY7Y6T.js";
22
+ } from "./chunk-APXC3SQO.js";
23
23
  import {
24
24
  getToolResultErrorData
25
- } from "./chunk-KRDG2XCI.js";
25
+ } from "./chunk-WFEWP352.js";
26
26
  import "./chunk-NF64D32W.js";
27
27
  import "./chunk-R3FZHW4Q.js";
28
28
  import "./chunk-WDWZPASX.js";
29
- import "./chunk-LQ4CQKTS.js";
29
+ import "./chunk-BD5YJJLJ.js";
30
30
  import "./chunk-WSLL7VV4.js";
31
31
  import "./chunk-VF4K2QE6.js";
32
32
  import "./chunk-LLUBUHNT.js";
33
33
  import "./chunk-U6QNVOR5.js";
34
34
  import "./chunk-AGIM7IMJ.js";
35
35
  import "./chunk-MNFUKRRU.js";
36
- import "./chunk-H3KLIPAL.js";
37
- import "./chunk-HZQGCFPJ.js";
38
- import "./chunk-24Z44WHO.js";
36
+ import "./chunk-TF427WGH.js";
37
+ import "./chunk-LJ6WIQZO.js";
38
+ import "./chunk-7B55IVLF.js";
39
39
  import "./chunk-BUDVRYES.js";
40
40
  import "./chunk-TZXPT53C.js";
41
41
  import "./chunk-523DITKR.js";
42
- import "./chunk-QNZRR3NT.js";
42
+ import "./chunk-MD7O2NN2.js";
43
43
  import "./chunk-YN23INFZ.js";
44
44
  import "./chunk-BYXBJQAS.js";
45
45
  import "./chunk-6VEO7Z3Y.js";
@@ -6,11 +6,11 @@ import {
6
6
  defaultSecretPromptReader,
7
7
  formatRedactedSecretValue,
8
8
  runSecretCommand
9
- } from "./chunk-MDHI2LWF.js";
9
+ } from "./chunk-BB76X6O4.js";
10
10
  import "./chunk-E6A5NHDH.js";
11
11
  import "./chunk-G7Y4GXTY.js";
12
12
  import "./chunk-6UBGXX2W.js";
13
- import "./chunk-V5NK6KMF.js";
13
+ import "./chunk-JOJH3KWV.js";
14
14
  import "./chunk-3EUW3WEO.js";
15
15
  import "./chunk-U67V476Y.js";
16
16
  export {
@@ -124,6 +124,44 @@ var VALID_INVITE_ROLES = /* @__PURE__ */ new Set([
124
124
  "member" /* MEMBER */,
125
125
  "guest" /* GUEST */
126
126
  ]);
127
+ var UPLOAD_MIME_BY_EXTENSION = {
128
+ ".yaml": "application/yaml",
129
+ ".yml": "application/yaml",
130
+ ".json": "application/json",
131
+ ".csv": "text/csv",
132
+ ".tsv": "text/tab-separated-values",
133
+ ".txt": "text/plain",
134
+ ".md": "text/markdown",
135
+ ".pdf": "application/pdf",
136
+ ".epub": "application/epub+zip",
137
+ ".mobi": "application/x-mobipocket-ebook",
138
+ ".azw3": "application/vnd.amazon.ebook",
139
+ ".doc": "application/msword",
140
+ ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
141
+ ".xls": "application/vnd.ms-excel",
142
+ ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
143
+ ".ppt": "application/vnd.ms-powerpoint",
144
+ ".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
145
+ ".odt": "application/vnd.oasis.opendocument.text",
146
+ ".rtf": "application/rtf",
147
+ ".zip": "application/zip",
148
+ ".png": "image/png",
149
+ ".jpg": "image/jpeg",
150
+ ".jpeg": "image/jpeg",
151
+ ".webp": "image/webp",
152
+ ".gif": "image/gif"
153
+ // Deliberately NOT mapped: active content (.html/.htm/.svg/.xhtml). The server
154
+ // stores this mime and replays it as Content-Type on file reads; public/space
155
+ // reads are served inline (no Content-Disposition) from the app origin
156
+ // (packages/database/server/routes/fileRead.ts buildFileContentHeaders), so a
157
+ // mapped text/html would make the CLI a stored-XSS uploader. Those extensions
158
+ // fall back to application/octet-stream and download instead of rendering.
159
+ };
160
+ function resolveUploadMimeType(extension) {
161
+ const normalized = extension.trim().toLowerCase();
162
+ const key = normalized.startsWith(".") ? normalized : `.${normalized}`;
163
+ return UPLOAD_MIME_BY_EXTENSION[key] ?? "application/octet-stream";
164
+ }
127
165
  function hasHelpArg(args) {
128
166
  return args.includes("--help") || args.includes("-h");
129
167
  }
@@ -192,7 +230,10 @@ Options:
192
230
  --json Print machine-readable JSON.
193
231
 
194
232
  Note:
195
- Currently only YAML files (.yaml, .yml) are supported.
233
+ Any file type is accepted as long as the file name has a non-empty extension
234
+ (book.epub); the stored MIME type is inferred from that extension. .yaml/.yml
235
+ map to application/yaml, unknown and active-content extensions (.html, .svg)
236
+ fall back to application/octet-stream.
196
237
  `);
197
238
  }
198
239
  async function writeDbRecord(args) {
@@ -411,9 +452,12 @@ async function runSpaceUploadCommand(args, deps) {
411
452
  if (!spaceIdRaw?.trim()) throw new Error("space upload requires --space <spaceId>.");
412
453
  if (!filePath?.trim()) throw new Error("space upload requires --file <path>.");
413
454
  const ext = extname(filePath).toLowerCase();
414
- if (ext !== ".yaml" && ext !== ".yml") {
415
- throw new Error("Only YAML files (.yaml, .yml) are supported for space upload.");
455
+ if (!ext || ext === ".") {
456
+ throw new Error(
457
+ "space upload requires a file name with a non-empty extension (the extension decides the stored MIME type), e.g. book.epub"
458
+ );
416
459
  }
460
+ const mimeType = resolveUploadMimeType(ext);
417
461
  const { authToken, userId } = requireTokenUser(args, deps.env);
418
462
  const serverUrl = resolveServerUrl(args, deps.env);
419
463
  const fetchImpl = deps.fetchImpl ?? fetch;
@@ -421,7 +465,6 @@ async function runSpaceUploadCommand(args, deps) {
421
465
  const fileContent = readFileSync(filePath);
422
466
  const spaceKey = createSpaceKey.space(spaceId);
423
467
  const uploadName = basename(filePath);
424
- const mimeType = "application/yaml";
425
468
  const now = Date.now();
426
469
  const nowIso = new Date(now).toISOString();
427
470
  const { record: spaceRecord } = await readLiveDbRecordAfterTombstoneMerge({
@@ -500,6 +543,7 @@ async function runSpaceUploadCommand(args, deps) {
500
543
  return 0;
501
544
  }
502
545
  export {
546
+ resolveUploadMimeType,
503
547
  runSpaceAcceptInviteCommand,
504
548
  runSpaceCreateCommand,
505
549
  runSpaceInviteCommand,
@@ -19,7 +19,7 @@ import {
19
19
  targetForRunKind,
20
20
  validateAccessAndBalance,
21
21
  withRequestContextBlocks
22
- } from "./chunk-3W2J3LFB.js";
22
+ } from "./chunk-SIHOY5YI.js";
23
23
  import {
24
24
  resolveUserSkillRuntime
25
25
  } from "./chunk-ZMJMHXYX.js";
@@ -34,13 +34,13 @@ import {
34
34
  sendOpenAICompletionsRequest,
35
35
  serializeAgentRunMessages,
36
36
  updateTotalUsage
37
- } from "./chunk-6FONTXR7.js";
37
+ } from "./chunk-ADUCBH4M.js";
38
38
  import "./chunk-JEXVIMYZ.js";
39
39
  import {
40
40
  inlineImageUrlsForCustomProvider,
41
41
  prepareTools,
42
42
  shouldInlineImageUrlsForAgent
43
- } from "./chunk-AAYDROBM.js";
43
+ } from "./chunk-JGVWHUYK.js";
44
44
  import {
45
45
  DirectApiKeyResolutionError,
46
46
  INVALID_TOOL_ARGS_REPLACEMENT,
@@ -52,33 +52,33 @@ import {
52
52
  sanitizeOutboundResponsesInput,
53
53
  selectResponsesConversationState,
54
54
  updateResponsesConversationState
55
- } from "./chunk-KF7M2UEK.js";
55
+ } from "./chunk-JAGD4PSH.js";
56
56
  import "./chunk-KZ4A7EIV.js";
57
57
  import {
58
58
  selectMaxExecutionTime
59
- } from "./chunk-K5X4D2TS.js";
59
+ } from "./chunk-KO5PFS74.js";
60
60
  import "./chunk-EXD7S7QW.js";
61
61
  import "./chunk-MVOZ22RZ.js";
62
62
  import "./chunk-KG27JIG4.js";
63
63
  import {
64
64
  performServerProxyFetchWithRetry
65
- } from "./chunk-PVHY7Y6T.js";
65
+ } from "./chunk-APXC3SQO.js";
66
66
  import {
67
67
  createSSEParser,
68
68
  waitForAbortableDelay
69
- } from "./chunk-KRDG2XCI.js";
69
+ } from "./chunk-WFEWP352.js";
70
70
  import "./chunk-NF64D32W.js";
71
71
  import "./chunk-R3FZHW4Q.js";
72
72
  import "./chunk-WDWZPASX.js";
73
- import "./chunk-LQ4CQKTS.js";
73
+ import "./chunk-BD5YJJLJ.js";
74
74
  import "./chunk-WSLL7VV4.js";
75
75
  import "./chunk-VF4K2QE6.js";
76
76
  import "./chunk-LLUBUHNT.js";
77
77
  import "./chunk-U6QNVOR5.js";
78
78
  import "./chunk-AGIM7IMJ.js";
79
79
  import "./chunk-MNFUKRRU.js";
80
- import "./chunk-H3KLIPAL.js";
81
- import "./chunk-HZQGCFPJ.js";
80
+ import "./chunk-TF427WGH.js";
81
+ import "./chunk-LJ6WIQZO.js";
82
82
  import {
83
83
  addToolMessage,
84
84
  addUserMessage,
@@ -100,11 +100,11 @@ import {
100
100
  updateDialogSummaryAction,
101
101
  updateTokens,
102
102
  updateToolMessage
103
- } from "./chunk-24Z44WHO.js";
103
+ } from "./chunk-7B55IVLF.js";
104
104
  import "./chunk-BUDVRYES.js";
105
105
  import "./chunk-TZXPT53C.js";
106
106
  import "./chunk-523DITKR.js";
107
- import "./chunk-QNZRR3NT.js";
107
+ import "./chunk-MD7O2NN2.js";
108
108
  import {
109
109
  getCurrentSpaceId
110
110
  } from "./chunk-YN23INFZ.js";
@@ -8,27 +8,27 @@ import {
8
8
  toolQueryFunc,
9
9
  toolQueryFunctionSchema,
10
10
  toolRegistry
11
- } from "./chunk-K5X4D2TS.js";
11
+ } from "./chunk-KO5PFS74.js";
12
12
  import "./chunk-EXD7S7QW.js";
13
13
  import "./chunk-MVOZ22RZ.js";
14
14
  import "./chunk-KG27JIG4.js";
15
- import "./chunk-KRDG2XCI.js";
15
+ import "./chunk-WFEWP352.js";
16
16
  import "./chunk-NF64D32W.js";
17
17
  import "./chunk-R3FZHW4Q.js";
18
18
  import "./chunk-WDWZPASX.js";
19
- import "./chunk-LQ4CQKTS.js";
19
+ import "./chunk-BD5YJJLJ.js";
20
20
  import "./chunk-WSLL7VV4.js";
21
21
  import "./chunk-VF4K2QE6.js";
22
22
  import "./chunk-LLUBUHNT.js";
23
23
  import "./chunk-U6QNVOR5.js";
24
24
  import "./chunk-MNFUKRRU.js";
25
- import "./chunk-H3KLIPAL.js";
26
- import "./chunk-HZQGCFPJ.js";
27
- import "./chunk-24Z44WHO.js";
25
+ import "./chunk-TF427WGH.js";
26
+ import "./chunk-LJ6WIQZO.js";
27
+ import "./chunk-7B55IVLF.js";
28
28
  import "./chunk-BUDVRYES.js";
29
29
  import "./chunk-TZXPT53C.js";
30
30
  import "./chunk-523DITKR.js";
31
- import "./chunk-QNZRR3NT.js";
31
+ import "./chunk-MD7O2NN2.js";
32
32
  import "./chunk-YN23INFZ.js";
33
33
  import "./chunk-BYXBJQAS.js";
34
34
  import "./chunk-6VEO7Z3Y.js";
@@ -20,14 +20,14 @@ import {
20
20
  runSelfUpdate,
21
21
  runSelfUpdateDetailed,
22
22
  runStandaloneBundleUpdate
23
- } from "./chunk-TCAAHWCY.js";
23
+ } from "./chunk-Z3JZ2R5F.js";
24
24
  import "./chunk-BIDSIRTS.js";
25
25
  import "./chunk-OLZBQWZU.js";
26
26
  import "./chunk-LCBAMY2M.js";
27
27
  import "./chunk-R5GO3YZP.js";
28
28
  import "./chunk-4O22PGNQ.js";
29
- import "./chunk-NAW2SN54.js";
30
- import "./chunk-V5NK6KMF.js";
29
+ import "./chunk-RQKTCHQM.js";
30
+ import "./chunk-JOJH3KWV.js";
31
31
  import "./chunk-G3SUCT4W.js";
32
32
  import "./chunk-4SN6J65J.js";
33
33
  import "./chunk-CF7PE763.js";