nolo-cli 0.33.0-alpha.2 → 0.33.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 (118) hide show
  1. package/{_executeModel-RWPVI3YV.js → _executeModel-XKWVTZAY.js} +35 -34
  2. package/{action-SMLG6OTB.js → action-Q4KO7DDW.js} +4 -4
  3. package/{addContentAction-SFO244QN.js → addContentAction-FRXDZKSI.js} +3 -3
  4. package/{addDialogAgentAction-W44ZCEHB.js → addDialogAgentAction-XL5G3LPR.js} +2 -2
  5. package/{agentDeleteCommand-KU2RXQPP.js → agentDeleteCommand-ZU4H6F6M.js} +19 -18
  6. package/{agentEmailCommands-MPCMDENS.js → agentEmailCommands-6ULFXW4A.js} +41 -40
  7. package/{agentListCommands-EPD4N6FX.js → agentListCommands-VN7WCW7Z.js} +21 -20
  8. package/{agentMachineCommands-AF7C3YRT.js → agentMachineCommands-5PALVQBD.js} +21 -20
  9. package/{agentPullCommand-YH5GEBK4.js → agentPullCommand-TSWAJPS2.js} +1 -1
  10. package/{agentRecordCommands-EYE6MZZG.js → agentRecordCommands-XEB66KRX.js} +40 -39
  11. package/{agentRunCommand-LL22SGTN.js → agentRunCommand-OJX27NII.js} +42 -41
  12. package/{agentRuntimeLocal-JX34G47Z.js → agentRuntimeLocal-UWDOE55A.js} +20 -19
  13. package/{agentSlice-TNMFQQOV.js → agentSlice-SZRRJ3ZX.js} +5 -5
  14. package/{appDeleteCommands-43K5VXQB.js → appDeleteCommands-R63PZAY7.js} +20 -19
  15. package/{appDeployCommands-FEEJSVDZ.js → appDeployCommands-VNRT54YO.js} +20 -19
  16. package/{appDeployStatusCommands-H76CG45R.js → appDeployStatusCommands-6IPTKLEM.js} +20 -19
  17. package/{appGetCommands-MDZYFTYZ.js → appGetCommands-JPFVMVAI.js} +20 -19
  18. package/{appListCommands-TUJJXPWG.js → appListCommands-B3SLTPII.js} +20 -19
  19. package/{authCommand-T7UK4CWS.js → authCommand-EX5G5PF4.js} +12 -11
  20. package/{authCommands-EAPFGNHN.js → authCommands-VR6Q6GU2.js} +4 -4
  21. package/{chatQueueReduxAdapter-LVQXC4ZY.js → chatQueueReduxAdapter-IEX32ZVP.js} +15 -14
  22. package/{chunk-2H3XIBY4.js → chunk-2CNX3CJE.js} +4 -82
  23. package/{chunk-MPZJVZDC.js → chunk-2UDMTJOM.js} +9 -9
  24. package/{chunk-WHD6BG7M.js → chunk-37LDAHQN.js} +20 -18
  25. package/{chunk-2UECQ7RE.js → chunk-3AOLVADY.js} +1 -1
  26. package/{chunk-HUCT7HID.js → chunk-42IF53CR.js} +1 -1
  27. package/{chunk-AAGCMVFT.js → chunk-46JSKTPF.js} +189 -38
  28. package/{chunk-3WXRAHCG.js → chunk-6MSSX7FI.js} +1 -1
  29. package/{chunk-57QJXIB6.js → chunk-6YH4UR3E.js} +3 -3
  30. package/{chunk-HDKRSRYU.js → chunk-7BNPRRDS.js} +150 -29
  31. package/{chunk-FMEVI5TG.js → chunk-7CH6U3FL.js} +1 -1
  32. package/{chunk-OR2HNLVO.js → chunk-7EPNNOL4.js} +6 -6
  33. package/{chunk-PREQU5QV.js → chunk-7OGIWPNK.js} +1 -1
  34. package/{chunk-DFUPZE6V.js → chunk-7SLMYTSF.js} +1 -1
  35. package/{chunk-3GZXL6FM.js → chunk-AOWETAXX.js} +1 -1
  36. package/{chunk-2IVEXF7P.js → chunk-BHILFABL.js} +1 -1
  37. package/{chunk-TFPUAELY.js → chunk-DDET6246.js} +1 -1
  38. package/{chunk-ZURFOV5J.js → chunk-DMT4NJXR.js} +1 -1
  39. package/{chunk-RAZOLMJR.js → chunk-EQ6HOWEJ.js} +2 -2
  40. package/{chunk-6HYVJV7B.js → chunk-ESHYE7WU.js} +2 -1
  41. package/{chunk-JZ5AMMXU.js → chunk-FH7VUJN5.js} +2 -2
  42. package/{chunk-I6N2UVVY.js → chunk-FV63ICZC.js} +1 -1
  43. package/{chunk-U4TRT5V4.js → chunk-GEPHJJW4.js} +1 -1
  44. package/{chunk-VH2F7ZB6.js → chunk-GTEHJWXU.js} +1 -1
  45. package/{chunk-AOXVOC6D.js → chunk-HCOIKLSH.js} +2 -2
  46. package/{chunk-GTYM4HKV.js → chunk-IEHZHWN7.js} +2 -2
  47. package/{chunk-2QTEYCR7.js → chunk-JFUW3UTO.js} +1 -1
  48. package/{chunk-73GINUCW.js → chunk-JL2PUYVS.js} +102 -23
  49. package/{chunk-37V5LNEQ.js → chunk-KIL7V27H.js} +1 -1
  50. package/{chunk-JTSGWTYZ.js → chunk-KMMQFY5O.js} +1 -1
  51. package/{chunk-UK5JGQVU.js → chunk-KZB5SNYH.js} +9 -14
  52. package/{chunk-XCCGU6QB.js → chunk-L5XKDBSH.js} +1 -1
  53. package/{chunk-DPMBNHOJ.js → chunk-LAZTMWIU.js} +1 -1
  54. package/{chunk-M4NC7NF6.js → chunk-LJGEEYGC.js} +2 -2
  55. package/{chunk-B2BSG6QQ.js → chunk-LLKHGZME.js} +4 -4
  56. package/{chunk-7E72JMBB.js → chunk-N2WDGMD5.js} +45 -4
  57. package/{chunk-Q5ITEGIN.js → chunk-N4XRDM26.js} +1 -1
  58. package/{chunk-AFV4FOT2.js → chunk-OQVRTSZ5.js} +4 -91
  59. package/{chunk-3VAQHAXT.js → chunk-PU47HKTF.js} +11 -11
  60. package/{chunk-CLP2K7U4.js → chunk-QKCMP3LU.js} +2 -2
  61. package/{chunk-JZPBVBIY.js → chunk-QTZD6HBK.js} +18 -8
  62. package/{chunk-LOD75GOS.js → chunk-REOW4YJX.js} +80 -1099
  63. package/{chunk-6SXC35F4.js → chunk-RO3AEN3L.js} +5 -5
  64. package/{chunk-5CS33IBL.js → chunk-RQFO3CAF.js} +8 -9
  65. package/{chunk-GMXWYXAF.js → chunk-SBPGB6TF.js} +3 -3
  66. package/{chunk-FSSX3XRY.js → chunk-U2FRXKC7.js} +1 -1
  67. package/{chunk-NUO3QFWD.js → chunk-UNHKVD2N.js} +1 -1
  68. package/{chunk-GE6IWA5N.js → chunk-UNZDCI3O.js} +126 -1
  69. package/{chunk-JMPYDFHY.js → chunk-V44VE7R4.js} +2 -2
  70. package/{chunk-IL545V3E.js → chunk-V4MT7AEN.js} +1 -1
  71. package/{chunk-FXFGNOT2.js → chunk-VFVCYIRQ.js} +1 -1
  72. package/chunk-VIRTYWWE.js +97 -0
  73. package/{chunk-ZJMME4DS.js → chunk-XS543SNR.js} +5 -5
  74. package/{chunk-O6GEBMIY.js → chunk-XTSVOICC.js} +195 -47
  75. package/{chunk-6PO2SYCS.js → chunk-YH3FPBG6.js} +1569 -204
  76. package/{chunk-WLH5BAKX.js → chunk-YYTTDOWA.js} +2 -2
  77. package/{chunk-5SBK2MTI.js → chunk-ZKUATCEY.js} +20 -69
  78. package/{codingSkills-DY5MINPG.js → codingSkills-5VOV3JVB.js} +2 -2
  79. package/{createAgentAutomationAction-INQT23LX.js → createAgentAutomationAction-72NNXELT.js} +16 -15
  80. package/{createDialogAction-LDCPDI73.js → createDialogAction-3CJ2GXNO.js} +18 -17
  81. package/{createPageAction-5YXOG2M4.js → createPageAction-HZHQGQO6.js} +16 -15
  82. package/{dbSlice-3SD5L5H2.js → dbSlice-2YD2PZER.js} +2 -2
  83. package/{dialogCommands-CHJO47AX.js → dialogCommands-2BF4ZSWH.js} +18 -17
  84. package/{dialogSlice-DOWKOILN.js → dialogSlice-5R4O4377.js} +15 -14
  85. package/{docCreateCommands-OVZARUFX.js → docCreateCommands-HMZUBFGL.js} +19 -18
  86. package/{docDeleteCommands-E2XJ62LD.js → docDeleteCommands-DFR7GCOR.js} +19 -18
  87. package/{docReadCommands-I7OSREPJ.js → docReadCommands-YM7RDUAZ.js} +19 -18
  88. package/{docStore-UAWSKZ2Y.js → docStore-A4SRW2DJ.js} +17 -16
  89. package/{docUpdateCommands-X4Z26VJM.js → docUpdateCommands-TTQBD7IU.js} +19 -18
  90. package/{getPricing-L2ENXWHV.js → getPricing-J4VXWR5B.js} +3 -3
  91. package/{handleSendMessageAction-C3TSDWKH.js → handleSendMessageAction-CIFBZCI2.js} +15 -14
  92. package/index.js +70 -70
  93. package/{localRuntimeAuthority-E3R24J4T.js → localRuntimeAuthority-S77B5QVB.js} +6 -2
  94. package/{localRuntimeDb-DDZCJFQZ.js → localRuntimeDb-N3H3HQ7G.js} +1 -1
  95. package/{machineCommands-BUOIYJAD.js → machineCommands-QSW4JKR2.js} +40 -39
  96. package/{machineInfo-M6KB6HZN.js → machineInfo-66ZFUMLE.js} +1 -1
  97. package/{machineWsRunDispatch-7CRWAA6O.js → machineWsRunDispatch-X3ZC7DZJ.js} +39 -38
  98. package/{models-OX2S5C6Q.js → models-SQFOI4FI.js} +2 -2
  99. package/package.json +1 -1
  100. package/{read-6G73BMEY.js → read-526GJR3R.js} +1 -1
  101. package/{readDocTool-DK4EI2GA.js → readDocTool-JNEZUOSM.js} +1 -1
  102. package/{readlineWorkspace-ZDWEASJV.js → readlineWorkspace-J2ARMEUC.js} +2701 -2083
  103. package/{removeDialogAgentAction-E7H557UO.js → removeDialogAgentAction-NPMEFEJW.js} +4 -4
  104. package/{runAgentClientLoop-U7HYA3O5.js → runAgentClientLoop-5I2R74NR.js} +31 -30
  105. package/{runtimeDoctorCommands-KIKM6BIO.js → runtimeDoctorCommands-KHGQKT3B.js} +3 -3
  106. package/{setDialogExtraReferencesAction-RMMGBR5F.js → setDialogExtraReferencesAction-ZZ6QWAG2.js} +3 -3
  107. package/{setPrimaryDialogAgentAction-FWBKKLVA.js → setPrimaryDialogAgentAction-BG72QA6S.js} +4 -4
  108. package/{settingSlice-73PV4KG4.js → settingSlice-JCCLCXZB.js} +3 -3
  109. package/{skillDiscovery-KLLKXPUO.js → skillDiscovery-AYBKAG6X.js} +3 -3
  110. package/{spaceCommands-GEWZXGHM.js → spaceCommands-EZYMMJJH.js} +18 -17
  111. package/{spaceSlice-B6MOVY4N.js → spaceSlice-TL2FR4AF.js} +16 -15
  112. package/{streamAgentChatTurn-T527EQTT.js → streamAgentChatTurn-UDYSE2ES.js} +45 -54
  113. package/{switchDialogAgentAction-US6QNL3N.js → switchDialogAgentAction-YPGPM2LL.js} +2 -2
  114. package/{tableCommands-QE47K72R.js → tableCommands-64FZBAI3.js} +1 -1
  115. package/{tools-XMWCVMPM.js → tools-KWYWDJ77.js} +25 -24
  116. package/{tuiSummaryLlmCaller-NCAJSVSD.js → tuiSummaryLlmCaller-WUVAOIYU.js} +9 -8
  117. package/{updateCommands-AK2RDOFR.js → updateCommands-MNDUIKN7.js} +2 -2
  118. package/{updateDialogTitleAction-XPJZRJEL.js → updateDialogTitleAction-NQCOEOLF.js} +16 -15
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-ZHYK3N56.js";
10
10
  import {
11
11
  getReadableCliDb
12
- } from "./chunk-NUO3QFWD.js";
12
+ } from "./chunk-UNHKVD2N.js";
13
13
  import {
14
14
  normalizeAgentHandle,
15
15
  readDbRecord,
@@ -21,10 +21,11 @@ import {
21
21
  getCliLocale,
22
22
  isBuiltinNoloAgentRef,
23
23
  isSubtaskRun,
24
+ isTransientFetchError,
24
25
  parseAgentRunEvent,
25
26
  t,
26
27
  toolLabel
27
- } from "./chunk-O6GEBMIY.js";
28
+ } from "./chunk-XTSVOICC.js";
28
29
  import {
29
30
  NOLO_PROJECT_MANAGER_AGENT_KEY,
30
31
  isLocalCliAgentKey
@@ -35,27 +36,27 @@ import {
35
36
  } from "./chunk-LTRXGFMS.js";
36
37
  import {
37
38
  resolveMachineId
38
- } from "./chunk-6HYVJV7B.js";
39
+ } from "./chunk-ESHYE7WU.js";
39
40
  import {
40
41
  formatAgentListCard
41
- } from "./chunk-HDKRSRYU.js";
42
+ } from "./chunk-7BNPRRDS.js";
42
43
  import {
43
44
  isGatewayHttpStatus
44
45
  } from "./chunk-RQSOAMPJ.js";
45
46
  import {
46
47
  getDefaultCliLocalRuntimeDb
47
- } from "./chunk-Q5ITEGIN.js";
48
+ } from "./chunk-N4XRDM26.js";
48
49
  import {
49
50
  buildMemorySubjectsForAgent,
50
51
  chooseMemoryOwners,
51
52
  loadMemoryCandidatesFromDb,
52
53
  resolveAgentMemoryPolicy
53
- } from "./chunk-6SXC35F4.js";
54
+ } from "./chunk-RO3AEN3L.js";
54
55
  import {
55
56
  API_REPORTED_COST_MULTIPLIER,
56
57
  normalizeUsage,
57
58
  parseUiAskChoiceContent
58
- } from "./chunk-73GINUCW.js";
59
+ } from "./chunk-JL2PUYVS.js";
59
60
  import {
60
61
  resolveAgentRuntimeConfigFromRecord
61
62
  } from "./chunk-OIQPORYI.js";
@@ -64,7 +65,7 @@ import {
64
65
  LOCAL_TURN_ABORTED_CODE,
65
66
  readActionGate,
66
67
  readCommandActionGatePayload
67
- } from "./chunk-6PO2SYCS.js";
68
+ } from "./chunk-YH3FPBG6.js";
68
69
  import {
69
70
  createThinkParserState,
70
71
  flushThinkParser,
@@ -72,27 +73,27 @@ import {
72
73
  } from "./chunk-N7J63Q6C.js";
73
74
  import {
74
75
  resolvePlatformAuthToken
75
- } from "./chunk-AFV4FOT2.js";
76
+ } from "./chunk-OQVRTSZ5.js";
76
77
  import {
77
78
  DEFAULT_CONTEXT_WINDOW,
78
79
  getModelContextWindow
79
- } from "./chunk-2H3XIBY4.js";
80
+ } from "./chunk-2CNX3CJE.js";
80
81
  import {
81
82
  clipCompactText
82
- } from "./chunk-AOXVOC6D.js";
83
+ } from "./chunk-HCOIKLSH.js";
83
84
  import {
84
85
  findModelConfig
85
- } from "./chunk-DFUPZE6V.js";
86
+ } from "./chunk-7SLMYTSF.js";
86
87
  import {
87
88
  buildSkillDiscoveryContextLayer
88
- } from "./chunk-ZURFOV5J.js";
89
+ } from "./chunk-DMT4NJXR.js";
89
90
  import {
90
91
  buildAgentsMdLayer,
91
92
  buildMemoryOverlayLayer,
92
93
  buildMemoryUseGuidanceLayer,
93
94
  partitionScopedBlocks,
94
95
  renderTurnContextBlocksWithScope
95
- } from "./chunk-2UECQ7RE.js";
96
+ } from "./chunk-3AOLVADY.js";
96
97
  import {
97
98
  parseExternalSkillMarkdown,
98
99
  parseSkillDocProtocol
@@ -141,7 +142,7 @@ import {
141
142
  BUILTIN_NOLO_AGENT_KEY,
142
143
  BUILTIN_NOLO_AGENT_NAME,
143
144
  builtinAgentCatalogEntryById
144
- } from "./chunk-UK5JGQVU.js";
145
+ } from "./chunk-KZB5SNYH.js";
145
146
  import {
146
147
  asTrimmedString
147
148
  } from "./chunk-3EUW3WEO.js";
@@ -387,6 +388,9 @@ function displayWidth(str) {
387
388
  for (const char of str) {
388
389
  const code = char.codePointAt(0) ?? 0;
389
390
  if (code < 32 || code === 127) continue;
391
+ if (code >= 768 && code <= 879 || code >= 6832 && code <= 6911 || code >= 7616 && code <= 7679 || code >= 8203 && code <= 8207 || code >= 8234 && code <= 8238 || code >= 8288 && code <= 8303 || code >= 8400 && code <= 8447 || code >= 65024 && code <= 65039 || code >= 65056 && code <= 65071 || code >= 917760 && code <= 917999) {
392
+ continue;
393
+ }
390
394
  if (code >= 4352 && code <= 4447 || // 0x2768-0x2775 (ornamental brackets, incl. the ❯ prompt at U+276F)
391
395
  // render narrow in terminals; counting them wide drifts the cursor.
392
396
  code >= 9728 && code <= 10175 && !(code >= 10088 && code <= 10101) || // 0x2B00-0x2BFF (Misc Symbols and Arrows, incl. ⬢ U+2B22 used as the
@@ -473,6 +477,7 @@ function padOrTruncateToWidth(text, width) {
473
477
  return `${text}${" ".repeat(width - textWidth)}`;
474
478
  }
475
479
  var SGR_RESET_REGEX = /^\x1b\[0?m$/;
480
+ var graphemeSegmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
476
481
  function tokenizeAnsiLine(line) {
477
482
  const tokens = [];
478
483
  let index = 0;
@@ -480,28 +485,119 @@ function tokenizeAnsiLine(line) {
480
485
  if (line[index] === "\x1B") {
481
486
  const osc = line.slice(index).match(/^\x1b\]8;;[^\x07\x1b]*(?:\x07|\x1b\\)/);
482
487
  if (osc) {
483
- tokens.push({ kind: "sgr", value: osc[0], width: 0 });
488
+ tokens.push({ kind: "sgr", value: osc[0], width: 0, charIndex: index });
484
489
  index += osc[0].length;
485
490
  continue;
486
491
  }
487
492
  const sgr = SGR_SEQUENCE_REGEX.exec(line.slice(index));
488
493
  if (sgr) {
489
- tokens.push({ kind: "sgr", value: sgr[0], width: 0 });
494
+ tokens.push({ kind: "sgr", value: sgr[0], width: 0, charIndex: index });
490
495
  index += sgr[0].length;
491
496
  continue;
492
497
  }
498
+ const csi = line.slice(index).match(/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/);
499
+ if (csi) {
500
+ tokens.push({ kind: "sgr", value: csi[0], width: 0, charIndex: index });
501
+ index += csi[0].length;
502
+ continue;
503
+ }
493
504
  }
494
- const codePoint = line.codePointAt(index) ?? 0;
495
- const value = String.fromCodePoint(codePoint);
496
- tokens.push({ kind: "char", value, width: displayWidth(value) });
497
- index += value.length;
505
+ let nextEsc = line.indexOf("\x1B", index);
506
+ if (nextEsc === -1) nextEsc = line.length;
507
+ const chunk = line.slice(index, nextEsc);
508
+ for (const item of graphemeSegmenter.segment(chunk)) {
509
+ tokens.push({
510
+ kind: "char",
511
+ value: item.segment,
512
+ width: displayWidth(item.segment),
513
+ charIndex: index + item.index
514
+ });
515
+ }
516
+ index = nextEsc;
498
517
  }
499
518
  return tokens;
500
519
  }
501
- function wrapTranscriptLine(line, columns, hangingIndent = "") {
502
- if (line === "") return [""];
520
+ function buildSourceMapping(rawLine, styledLine, prefixCharCount) {
521
+ let contentStart = 0;
522
+ const headingMatch = rawLine.match(/^(#{1,3})\s+(.+)$/);
523
+ let lineToParse = rawLine;
524
+ if (headingMatch) {
525
+ contentStart = headingMatch[1].length + 1;
526
+ while (contentStart < rawLine.length && rawLine[contentStart] === " ") contentStart++;
527
+ lineToParse = rawLine.slice(contentStart);
528
+ }
529
+ const INLINE_RE = /(\[([^\]]+)\]\(([^)\s]+)\)|`([^`]+)`|\*\*(.+?)\*\*|(?<!\*)\*([^*]+?)\*(?!\*)|~~([^~]+?)~~)/g;
530
+ const mapping = [];
531
+ let lastIdx = 0;
532
+ let match;
533
+ while ((match = INLINE_RE.exec(lineToParse)) !== null) {
534
+ const plainBefore = lineToParse.slice(lastIdx, match.index);
535
+ for (let c = 0; c < plainBefore.length; c++) {
536
+ mapping.push(contentStart + lastIdx + c);
537
+ }
538
+ const fullMatch = match[0];
539
+ if (match[2] !== void 0 && match[3] !== void 0) {
540
+ const linkText = match[2];
541
+ const linkUrl = match[3];
542
+ const textOffset = contentStart + match.index + 1;
543
+ for (let c = 0; c < linkText.length; c++) {
544
+ mapping.push(textOffset + c);
545
+ }
546
+ const parenOffset = textOffset + linkText.length;
547
+ mapping.push(parenOffset);
548
+ mapping.push(parenOffset + 1);
549
+ const urlOffset = parenOffset + 2;
550
+ for (let c = 0; c < linkUrl.length; c++) {
551
+ mapping.push(urlOffset + c);
552
+ }
553
+ mapping.push(urlOffset + linkUrl.length);
554
+ } else if (match[4] !== void 0) {
555
+ const codeText = match[4];
556
+ const codeOffset = contentStart + match.index + 1;
557
+ for (let c = 0; c < codeText.length; c++) {
558
+ mapping.push(codeOffset + c);
559
+ }
560
+ } else if (match[5] !== void 0) {
561
+ const boldText = match[5];
562
+ const boldOffset = contentStart + match.index + 2;
563
+ for (let c = 0; c < boldText.length; c++) {
564
+ mapping.push(boldOffset + c);
565
+ }
566
+ } else if (match[6] !== void 0) {
567
+ const italicText = match[6];
568
+ const italicOffset = contentStart + match.index + 1;
569
+ for (let c = 0; c < italicText.length; c++) {
570
+ mapping.push(italicOffset + c);
571
+ }
572
+ } else if (match[7] !== void 0) {
573
+ const strikeText = match[7];
574
+ const strikeOffset = contentStart + match.index + 2;
575
+ for (let c = 0; c < strikeText.length; c++) {
576
+ mapping.push(strikeOffset + c);
577
+ }
578
+ }
579
+ lastIdx = match.index + fullMatch.length;
580
+ }
581
+ const plainRest = lineToParse.slice(lastIdx);
582
+ for (let c = 0; c < plainRest.length; c++) {
583
+ mapping.push(contentStart + lastIdx + c);
584
+ }
585
+ return mapping;
586
+ }
587
+ function wrapTranscriptLineWithLayout(line, columns, hangingIndent = "", lineSourceStart = 0, prefixWidth = 0, prefixCharCount = 0, sourceMapping, rawLineLength) {
588
+ if (line === "") {
589
+ const rawLen = rawLineLength ?? 0;
590
+ return [
591
+ {
592
+ rendered: "",
593
+ sourceStart: lineSourceStart,
594
+ sourceEnd: lineSourceStart + rawLen,
595
+ prefixWidth
596
+ }
597
+ ];
598
+ }
503
599
  const tokens = tokenizeAnsiLine(line);
504
- const result = [];
600
+ const rows = [];
505
601
  let activeStyles = [];
506
602
  const applyStyleToken = (value) => {
507
603
  if (SGR_RESET_REGEX.test(value)) {
@@ -513,10 +609,11 @@ function wrapTranscriptLine(line, columns, hangingIndent = "") {
513
609
  let start = 0;
514
610
  while (start < tokens.length) {
515
611
  if (tokens.slice(start).every((token) => token.kind === "sgr")) {
516
- if (result.length > 0) break;
612
+ if (rows.length > 0) break;
517
613
  }
518
614
  const openingStyles = [...activeStyles];
519
- const isContinuation = result.length > 0 && hangingIndent.length > 0;
615
+ const isContinuation = rows.length > 0;
616
+ const currentPrefixWidth = isContinuation ? visibleWidth(hangingIndent) : prefixWidth;
520
617
  const indentWidth = isContinuation ? visibleWidth(hangingIndent) : 0;
521
618
  const maxSegmentWidth = Math.max(1, columns - indentWidth);
522
619
  let width = 0;
@@ -531,7 +628,7 @@ function wrapTranscriptLine(line, columns, hangingIndent = "") {
531
628
  if (width + token.width > maxSegmentWidth && width > 0) break;
532
629
  width += token.width;
533
630
  end += 1;
534
- if (token.value === " " || token.value === " ") {
631
+ if ((token.value === " " || token.value === " ") && token.charIndex >= prefixCharCount) {
535
632
  lastBreak = end;
536
633
  }
537
634
  }
@@ -556,18 +653,71 @@ function wrapTranscriptLine(line, columns, hangingIndent = "") {
556
653
  const prefix = openingStyles.join("");
557
654
  const needsReset = (sawStyle || activeStyles.length > 0) && !segment.endsWith("\x1B[0m");
558
655
  const lineContent = `${prefix}${segment}${needsReset ? "\x1B[0m" : ""}`;
559
- result.push(isContinuation ? `${hangingIndent}${lineContent}` : lineContent);
656
+ const rowRendered = isContinuation && hangingIndent.length > 0 ? `${hangingIndent}${lineContent}` : lineContent;
657
+ let segSourceStart = lineSourceStart;
658
+ let segSourceEnd = lineSourceStart;
659
+ let foundFirst = false;
660
+ const rowMapping = [];
661
+ let plainCharIndex = 0;
662
+ for (let i = 0; i < start; i++) {
663
+ const tok = tokens[i];
664
+ if (tok.kind === "char" && tok.charIndex >= prefixCharCount) {
665
+ plainCharIndex += tok.value.length;
666
+ }
667
+ }
668
+ for (let i = start; i < segmentEnd; i++) {
669
+ const tok = tokens[i];
670
+ if (tok.kind === "char" && tok.charIndex >= prefixCharCount) {
671
+ const mappedOffset = sourceMapping && sourceMapping[plainCharIndex] !== void 0 ? sourceMapping[plainCharIndex] : plainCharIndex;
672
+ if (!foundFirst) {
673
+ segSourceStart = lineSourceStart + mappedOffset;
674
+ foundFirst = true;
675
+ }
676
+ for (let c = 0; c < tok.value.length; c++) {
677
+ const idx = plainCharIndex + c;
678
+ const mapped = sourceMapping && sourceMapping[idx] !== void 0 ? sourceMapping[idx] : idx;
679
+ rowMapping.push(lineSourceStart + mapped);
680
+ }
681
+ const lastCharIdx = plainCharIndex + tok.value.length - 1;
682
+ const mappedEndOffset = sourceMapping && sourceMapping[lastCharIdx] !== void 0 ? sourceMapping[lastCharIdx] + 1 : plainCharIndex + tok.value.length;
683
+ segSourceEnd = lineSourceStart + mappedEndOffset;
684
+ plainCharIndex += tok.value.length;
685
+ }
686
+ }
560
687
  start = segmentEnd;
561
688
  while (start < tokens.length) {
562
689
  const token = tokens[start];
563
- if (token.kind === "char" && token.value === " ") {
690
+ if (token.kind === "char" && token.value === " " && token.charIndex >= prefixCharCount) {
691
+ const mappedOffset = sourceMapping && sourceMapping[plainCharIndex] !== void 0 ? sourceMapping[plainCharIndex] + 1 : plainCharIndex + 1;
692
+ segSourceEnd = lineSourceStart + mappedOffset;
693
+ plainCharIndex += token.value.length;
564
694
  start += 1;
565
695
  continue;
566
696
  }
567
697
  break;
568
698
  }
699
+ if (start >= tokens.length && rawLineLength !== void 0) {
700
+ segSourceEnd = lineSourceStart + rawLineLength;
701
+ }
702
+ rows.push({
703
+ rendered: rowRendered,
704
+ sourceStart: segSourceStart,
705
+ sourceEnd: segSourceEnd,
706
+ prefixWidth: currentPrefixWidth,
707
+ sourceMapping: rowMapping.length > 0 ? rowMapping : void 0
708
+ });
569
709
  }
570
- return result.length > 0 ? result : [""];
710
+ return rows.length > 0 ? rows : [
711
+ {
712
+ rendered: "",
713
+ sourceStart: lineSourceStart,
714
+ sourceEnd: lineSourceStart + (rawLineLength ?? 0),
715
+ prefixWidth
716
+ }
717
+ ];
718
+ }
719
+ function wrapTranscriptLine(line, columns, hangingIndent = "") {
720
+ return wrapTranscriptLineWithLayout(line, columns, hangingIndent).map((r) => r.rendered);
571
721
  }
572
722
  function buildWindowTitle(title) {
573
723
  const plain = stripAnsi(title).replace(/[\x00-\x1f\x7f]+/g, " ");
@@ -3304,7 +3454,7 @@ async function detectCurrentMachineId(env) {
3304
3454
  const fromEnv = (env.NOLO_CURRENT_MACHINE_ID || env.NOLO_MACHINE_ID || "").trim();
3305
3455
  if (fromEnv) return fromEnv;
3306
3456
  try {
3307
- const { detectMachineInfo } = await import("./machineInfo-M6KB6HZN.js");
3457
+ const { detectMachineInfo } = await import("./machineInfo-66ZFUMLE.js");
3308
3458
  const machine = await detectMachineInfo({ probeLaunchable: true });
3309
3459
  return asOptionalTrimmedString(machine?.machineId);
3310
3460
  } catch {
@@ -3521,7 +3671,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
3521
3671
  // packages/cli/client/agentRun.ts
3522
3672
  import { ulid } from "ulid";
3523
3673
  async function loadRunLocalAgentTurn() {
3524
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-JX34G47Z.js");
3674
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-UWDOE55A.js");
3525
3675
  return runLocalAgentTurn;
3526
3676
  }
3527
3677
  async function resolveCurrentMachineId(options) {
@@ -3753,6 +3903,10 @@ function describeLocalRunFailure(message) {
3753
3903
  }
3754
3904
  const cls = classifyLocalRunError(message);
3755
3905
  if (cls.kind === "generic") {
3906
+ if (isTransientFetchError(message)) {
3907
+ return `${RUN_UNAVAILABLE_PREFIX} (${message}). ${NO_FALLBACK} The upstream connection dropped mid-request (transient network/gateway issue \u2014 not a local credential or config problem). Send again (or say "continue") to retry in the same conversation.
3908
+ `;
3909
+ }
3756
3910
  return `${RUN_UNAVAILABLE_PREFIX} (${message}). ${NO_FALLBACK} Fix the local credential/config and retry, ${SERVER_FALLBACK_HINT}.
3757
3911
  `;
3758
3912
  }
@@ -4054,12 +4208,6 @@ async function runLocalAgentTurnForCli(options, settings) {
4054
4208
  "[nolo] \u5F53\u524D agent \u4E0D\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C\u5DF2\u7528\u5360\u4F4D\u6587\u672C\u66FF\u4EE3\u3002\u8981\u5B8C\u6574\u56FE\u7247\u7406\u89E3\u53EF /switch \u5230 Kimi K2.6\u3002\n"
4055
4209
  );
4056
4210
  }
4057
- if (event.kind === "image-preprocessed") {
4058
- options.output.write(
4059
- `[nolo] \u5DF2\u7528\u89C6\u89C9\u6A21\u578B\u89E3\u6790 ${event.imageCount} \u5F20\u56FE\u7247\u4E3A\u6587\u5B57\u63CF\u8FF0\uFF0C\u4F9B\u5F53\u524D agent \u4F7F\u7528\u3002
4060
- `
4061
- );
4062
- }
4063
4211
  options.onLoopEvent?.(event);
4064
4212
  },
4065
4213
  ...options.abortSignal ? { abortSignal: options.abortSignal } : {},
@@ -5372,6 +5520,9 @@ export {
5372
5520
  countPhysicalLines,
5373
5521
  takeDisplayWidth,
5374
5522
  padOrTruncateToWidth,
5523
+ tokenizeAnsiLine,
5524
+ buildSourceMapping,
5525
+ wrapTranscriptLineWithLayout,
5375
5526
  wrapTranscriptLine,
5376
5527
  buildWindowTitle,
5377
5528
  wrapTextToLines,
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-YDTYDA5W.js";
8
8
  import {
9
9
  toSafeAgentSummary
10
- } from "./chunk-2IVEXF7P.js";
10
+ } from "./chunk-BHILFABL.js";
11
11
  import {
12
12
  PUBLIC_AGENT_KEY_PREFIX,
13
13
  isOwnedAgentKey,
@@ -13,7 +13,7 @@ import {
13
13
  readAction,
14
14
  readRequestManager,
15
15
  resolveAgentReadServers
16
- } from "./chunk-UK5JGQVU.js";
16
+ } from "./chunk-KZB5SNYH.js";
17
17
  import {
18
18
  asyncThunkCreator,
19
19
  buildCreateSlice,
@@ -707,7 +707,7 @@ var dbSlice = createSliceWithThunks({
707
707
  // 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
708
708
  read: create.asyncThunk(
709
709
  async (payload, thunkApi) => {
710
- const { readAction: readAction2 } = await import("./read-6G73BMEY.js");
710
+ const { readAction: readAction2 } = await import("./read-526GJR3R.js");
711
711
  return readAction2(payload, thunkApi);
712
712
  },
713
713
  {
@@ -781,7 +781,7 @@ var dbSlice = createSliceWithThunks({
781
781
  // 这里改成动态 import,运行期才解析,彻底断开这条边。
782
782
  share: create.asyncThunk(
783
783
  async (config, thunkApi) => {
784
- const { shareResourceAction } = await import("./action-SMLG6OTB.js");
784
+ const { shareResourceAction } = await import("./action-Q4KO7DDW.js");
785
785
  return shareResourceAction(config, thunkApi);
786
786
  }
787
787
  ),