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
@@ -43,7 +43,7 @@ import {
43
43
  resolveServerUrl as resolveServerUrl2,
44
44
  validateInstaboxWorkspaceSelection,
45
45
  writeUsage
46
- } from "./chunk-QEVT4LQ3.js";
46
+ } from "./chunk-V6S5OZSP.js";
47
47
  import {
48
48
  boxGlyphs,
49
49
  displayWidth,
@@ -53,7 +53,7 @@ import {
53
53
  stripAnsi,
54
54
  tokenizeAnsiLine,
55
55
  visibleWidth
56
- } from "./chunk-JPZKKSGT.js";
56
+ } from "./chunk-C63KMRJE.js";
57
57
  import {
58
58
  clearCredentialAvailability,
59
59
  readEffectiveCredentialEntry
@@ -99,14 +99,14 @@ import {
99
99
  } from "./chunk-BMQ2MJUK.js";
100
100
  import {
101
101
  resolveCliLocalRuntimeKeyCapability
102
- } from "./chunk-K5X4D2TS.js";
102
+ } from "./chunk-KO5PFS74.js";
103
103
  import {
104
104
  isCallerAtFreePoolTop
105
105
  } from "./chunk-EXD7S7QW.js";
106
106
  import {
107
107
  parseUiCard,
108
108
  uiCardFallback
109
- } from "./chunk-KRDG2XCI.js";
109
+ } from "./chunk-WFEWP352.js";
110
110
  import {
111
111
  isGatewayHttpStatus
112
112
  } from "./chunk-NF64D32W.js";
@@ -117,7 +117,7 @@ import {
117
117
  loadOwnerItemsFromDb,
118
118
  parseUiAskChoiceContent,
119
119
  resolveAgentMemoryPolicy
120
- } from "./chunk-H3KLIPAL.js";
120
+ } from "./chunk-TF427WGH.js";
121
121
  import {
122
122
  API_REPORTED_COST_MULTIPLIER,
123
123
  estimateMessagesTokens,
@@ -126,7 +126,7 @@ import {
126
126
  resolveAgentContextWindow,
127
127
  resolveOccupancy,
128
128
  resolveOccupancyWindow
129
- } from "./chunk-24Z44WHO.js";
129
+ } from "./chunk-7B55IVLF.js";
130
130
  import {
131
131
  getDefaultCliLocalRuntimeDb
132
132
  } from "./chunk-J55F3IEZ.js";
@@ -323,7 +323,7 @@ import {
323
323
  toolIcon,
324
324
  toolLabel,
325
325
  toolLabelVariants
326
- } from "./chunk-V5NK6KMF.js";
326
+ } from "./chunk-JOJH3KWV.js";
327
327
  import {
328
328
  isAntigravityOAuthAgent
329
329
  } from "./chunk-6SOWMEAY.js";
@@ -8929,6 +8929,7 @@ function polishBreathInsertsBlankBetween(cur, next) {
8929
8929
  if (isPolishIntroLine(cur) && isPolishListLikeLine(next)) return false;
8930
8930
  if (isPolishHeadingLine(cur) || isPolishHeadingLine(next)) return false;
8931
8931
  if (isCodeFenceLine(cur) !== isCodeFenceLine(next)) return true;
8932
+ if (plainToolLine(cur).startsWith("\u25B8 ") && plainToolLine(next).startsWith(" \u2026")) return false;
8932
8933
  const toolBoundary = toolRowBoundary(cur, next);
8933
8934
  if (toolBoundary !== null) return toolBoundary;
8934
8935
  return isPolishListLikeLine(cur) !== isPolishListLikeLine(next);
@@ -9632,6 +9633,7 @@ function parseGit(rest) {
9632
9633
  const tokens2 = shellWords(rest.split(/\s+\|\s+/)[0]);
9633
9634
  if (!tokens2) return null;
9634
9635
  let i = 0, context;
9636
+ if (tokens2.length === 1 && tokens2[0] === "--version") return { action: "\u67E5\u7248\u672C", readOnly: true };
9635
9637
  while (tokens2[i]?.startsWith("-")) {
9636
9638
  const option = tokens2[i++];
9637
9639
  if (["-C", "-c", "--git-dir", "--work-tree"].includes(option)) {
@@ -9665,20 +9667,35 @@ function parseGit(rest) {
9665
9667
  return null;
9666
9668
  }
9667
9669
  if (sub === "branch") {
9668
- let mode = "create", end = false;
9670
+ let mode = "create", end = false, explicitList = false, listFilter = false;
9669
9671
  const operands = [];
9670
- for (const token of args) {
9672
+ const BRANCH_FILTER_FLAGS = ["--merged", "--no-merged", "--contains", "--no-contains", "--points-at"];
9673
+ for (let j = 0; j < args.length; j++) {
9674
+ const token = args[j];
9671
9675
  if (!end && token === "--") {
9672
9676
  end = true;
9673
9677
  continue;
9674
9678
  }
9675
9679
  if (!end && token.startsWith("-")) {
9676
9680
  if (["-d", "-D", "--delete"].includes(token) && mode === "create") mode = "delete";
9677
- else if (["--list", "-a", "--all", "-r", "--remotes", "-v", "-vv", "--show-current"].includes(token) && mode === "create") mode = "list";
9681
+ else if (token === "--list" && mode === "create") {
9682
+ mode = "list";
9683
+ explicitList = true;
9684
+ } else if (["-a", "--all", "-r", "--remotes", "-v", "-vv", "--verbose", "--show-current"].includes(token) && mode === "create") mode = "list";
9685
+ else if (mode === "create" && (BRANCH_FILTER_FLAGS.includes(token) || BRANCH_FILTER_FLAGS.some((f) => token.startsWith(`${f}=`)))) {
9686
+ mode = "list";
9687
+ listFilter = true;
9688
+ if (BRANCH_FILTER_FLAGS.includes(token)) {
9689
+ const value = args[j + 1];
9690
+ if (!value || value.startsWith("-")) return null;
9691
+ j++;
9692
+ }
9693
+ } else if (mode === "list" && ["-i", "--ignore-case", "-v", "-vv", "--verbose", "--no-color", "--color", "--column", "--no-column"].includes(token)) continue;
9678
9694
  else return null;
9679
9695
  } else operands.push(token);
9680
9696
  }
9681
9697
  if (mode === "delete" && operands.length === 1) return result("\u5220\u9664\u5206\u652F", operands[0], false);
9698
+ if (mode === "list" && operands.length && !explicitList && !listFilter) return null;
9682
9699
  if (mode === "list" || !args.length) return result("\u5217\u51FA\u5206\u652F", void 0, true);
9683
9700
  if (mode === "create" && operands.length >= 1 && operands.length <= 2) return result("\u521B\u5EFA\u5206\u652F", operands[0], false);
9684
9701
  return null;
@@ -9693,7 +9710,7 @@ function parseGit(rest) {
9693
9710
  break;
9694
9711
  }
9695
9712
  if (tok.startsWith("-")) {
9696
- if (["-m", "-F", "-b", "-B", "-n", "--max-count", "--format", "--pretty", "--since", "--until", "--author", "-U"].includes(tok)) j++;
9713
+ if (["-m", "-F", "-b", "-B", "-n", "--max-count", "--format", "--pretty", "--since", "--until", "--author", "-U", "-L", "-S", "-G"].includes(tok)) j++;
9697
9714
  continue;
9698
9715
  }
9699
9716
  out.push(tok);
@@ -9711,6 +9728,60 @@ function parseGit(rest) {
9711
9728
  return result("\u67E5\u5171\u540C\u7956\u5148", void 0, true);
9712
9729
  case "rev-parse":
9713
9730
  return result("\u67E5\u4ED3\u5E93\u4FE1\u606F", void 0, true);
9731
+ // 以下子命令在 git 里没有写/执行形态(例外一律单独把关),可安全折进探索树。
9732
+ case "version":
9733
+ return result("\u67E5\u7248\u672C", void 0, true);
9734
+ case "ls-files":
9735
+ return result("\u5217\u8DDF\u8E2A\u6587\u4EF6", void 0, true);
9736
+ case "ls-tree": {
9737
+ const target = nonFlagArgs(args).find(isSafeGitTarget);
9738
+ return result("\u770B\u6811", target ? clipShortText(target, 20) : void 0, true);
9739
+ }
9740
+ case "cat-file": {
9741
+ const target = nonFlagArgs(args).find(isSafeGitTarget);
9742
+ return result("\u770B\u5BF9\u8C61", target ? clipShortText(target, 20) : void 0, true);
9743
+ }
9744
+ case "show-ref":
9745
+ case "for-each-ref":
9746
+ return result("\u67E5\u5F15\u7528", void 0, true);
9747
+ case "grep": {
9748
+ if (args.some(
9749
+ (t2) => t2.startsWith("-") && !t2.startsWith("--") && t2.slice(1).includes("O") || t2 === "--open-files-in-pager" || t2.startsWith("--open-files-in-pager=")
9750
+ )) return null;
9751
+ return result("\u641C\u4EE3\u7801", extractSafeSearchTarget(args.join(" ")), true);
9752
+ }
9753
+ case "blame": {
9754
+ const files = nonFlagArgs(args).filter(isSafeGitTarget);
9755
+ const file = files[files.length - 1];
9756
+ return result("\u67E5\u884C\u4F5C\u8005", file ? baseName(file) ?? clipShortText(file, 20) : void 0, true);
9757
+ }
9758
+ case "describe":
9759
+ return result("\u67E5\u7248\u672C\u63CF\u8FF0", void 0, true);
9760
+ case "count-objects":
9761
+ return result("\u7EDF\u8BA1\u5BF9\u8C61", void 0, true);
9762
+ case "shortlog":
9763
+ return result("\u6C47\u603B\u63D0\u4EA4", void 0, true);
9764
+ case "check-ignore": {
9765
+ const file = nonFlagArgs(args).find(isSafeGitTarget);
9766
+ return result("\u67E5\u5FFD\u7565\u89C4\u5219", file ? baseName(file) : void 0, true);
9767
+ }
9768
+ case "reflog": {
9769
+ const op = nonFlagArgs(args)[0];
9770
+ if (op === "expire" || op === "delete" || op === "drop") return null;
9771
+ return result("\u67E5\u5F15\u7528\u65E5\u5FD7", void 0, true);
9772
+ }
9773
+ case "remote": {
9774
+ if (nonFlagArgs(args).length) return null;
9775
+ if (args.some((t2) => !["-v", "--verbose"].includes(t2))) return null;
9776
+ return result("\u67E5\u8FDC\u7AEF", void 0, true);
9777
+ }
9778
+ case "config": {
9779
+ const isReadForm = args.some((t2) => ["--get", "--get-all", "--get-regexp", "--list", "-l", "--show-origin"].includes(t2) || /^--(?:get|get-all|get-regexp|list|show-origin)(?:=|$)/.test(t2));
9780
+ if (!isReadForm) return null;
9781
+ if (args.some((t2) => ["--unset", "--unset-all", "--add", "--replace-all", "--rename-section", "--remove-section", "-e", "--edit"].includes(t2) || /^--(?:unset|unset-all|add|replace-all|rename-section|remove-section|edit)(?:=|$)/.test(t2))) return null;
9782
+ const key = nonFlagArgs(args)[0];
9783
+ return result("\u67E5\u914D\u7F6E", key && isSafeGitTarget(key) ? clipShortText(key, 24) : void 0, true);
9784
+ }
9714
9785
  case "show": {
9715
9786
  const target = nonFlagArgs(args)[0];
9716
9787
  return result("\u770B\u63D0\u4EA4", isSafeGitTarget(target) ? clipShortText(target, 20) : void 0, true);
@@ -9774,6 +9845,23 @@ function baseName(path2) {
9774
9845
  const base = parts.pop();
9775
9846
  return base || void 0;
9776
9847
  }
9848
+ function lastFileOperand(tokens2, valueFlags) {
9849
+ let file;
9850
+ for (let i = 0; i < tokens2.length; i++) {
9851
+ const tok = tokens2[i];
9852
+ if (tok === "--") {
9853
+ const rest = tokens2.slice(i + 1);
9854
+ if (rest.length) file = rest[rest.length - 1];
9855
+ break;
9856
+ }
9857
+ if (tok.startsWith("-")) {
9858
+ if (!tok.includes("=") && valueFlags.has(tok)) i++;
9859
+ continue;
9860
+ }
9861
+ file = tok;
9862
+ }
9863
+ return file;
9864
+ }
9777
9865
  function splitSegments(command) {
9778
9866
  const segments = [];
9779
9867
  let current = "";
@@ -10288,11 +10376,79 @@ function classifySegment(segment) {
10288
10376
  }
10289
10377
  case "ps":
10290
10378
  return { verb: "\u67E5\u8FDB\u7A0B", readOnly: true };
10291
- case "sha256sum": {
10379
+ case "sha256sum":
10380
+ case "sha1sum":
10381
+ case "md5sum":
10382
+ case "sha512sum":
10383
+ case "b2sum":
10384
+ case "cksum": {
10292
10385
  const tokens2 = shellWords(rest.split(/\s+\|\s+/)[0]);
10293
10386
  const file = tokens2?.find((t2) => !t2.startsWith("-"));
10294
10387
  return { verb: "\u7B97\u6821\u9A8C\u548C", target: file ? baseName(file) : void 0, readOnly: true };
10295
10388
  }
10389
+ case "du": {
10390
+ const tokens2 = shellWords(stripTrailingPipe(rest));
10391
+ if (!tokens2) return null;
10392
+ const path2 = lastFileOperand(tokens2, /* @__PURE__ */ new Set(["-d", "--max-depth", "-B", "--block-size", "--files0-from", "--exclude", "-t", "--threshold", "--time-style"]));
10393
+ return { verb: "\u67E5\u78C1\u76D8\u5360\u7528", target: path2 ? baseName(path2) : void 0, readOnly: true };
10394
+ }
10395
+ case "df":
10396
+ return { verb: "\u67E5\u78C1\u76D8\u7A7A\u95F4", readOnly: true };
10397
+ case "free":
10398
+ return { verb: "\u67E5\u5185\u5B58", readOnly: true };
10399
+ case "nproc":
10400
+ return { verb: "\u67E5 CPU \u6570", readOnly: true };
10401
+ case "uptime":
10402
+ return { verb: "\u67E5\u8D1F\u8F7D", readOnly: true };
10403
+ case "id": {
10404
+ const tokens2 = shellWords(stripTrailingPipe(rest));
10405
+ if (!tokens2) return null;
10406
+ const user = tokens2.find((t2) => !t2.startsWith("-"));
10407
+ return { verb: "\u67E5\u8EAB\u4EFD", target: user ? clipShortText(user, 24) : void 0, readOnly: true };
10408
+ }
10409
+ case "hostname": {
10410
+ const tokens2 = shellWords(stripTrailingPipe(rest));
10411
+ if (!tokens2) return null;
10412
+ if (tokens2.some((t2) => ["-F", "--file", "-b", "--boot"].includes(t2))) return null;
10413
+ if (tokens2.some((t2) => !t2.startsWith("-"))) return null;
10414
+ return { verb: "\u67E5\u4E3B\u673A\u540D", readOnly: true };
10415
+ }
10416
+ case "date": {
10417
+ const tokens2 = shellWords(stripTrailingPipe(rest));
10418
+ if (!tokens2) return null;
10419
+ if (tokens2.some((t2) => ["-s", "--set", "-f", "--file"].includes(t2) || t2.startsWith("--set="))) return null;
10420
+ const valueFlags = /* @__PURE__ */ new Set(["-d", "--date", "-r", "--reference"]);
10421
+ const positionals = [];
10422
+ for (let i = 0; i < tokens2.length; i++) {
10423
+ const tok = tokens2[i];
10424
+ if (tok.startsWith("-")) {
10425
+ if (!tok.includes("=") && valueFlags.has(tok)) i++;
10426
+ continue;
10427
+ }
10428
+ positionals.push(tok);
10429
+ }
10430
+ if (positionals.some((t2) => !t2.startsWith("+"))) return null;
10431
+ return { verb: "\u67E5\u65F6\u95F4", readOnly: true };
10432
+ }
10433
+ case "basename": {
10434
+ const tokens2 = shellWords(stripTrailingPipe(rest));
10435
+ if (!tokens2) return null;
10436
+ const path2 = tokens2.find((t2) => !t2.startsWith("-"));
10437
+ return { verb: "\u53D6\u6587\u4EF6\u540D", target: path2 ? baseName(path2) : void 0, readOnly: true };
10438
+ }
10439
+ case "dirname": {
10440
+ const tokens2 = shellWords(stripTrailingPipe(rest));
10441
+ if (!tokens2) return null;
10442
+ const path2 = tokens2.find((t2) => !t2.startsWith("-"));
10443
+ return { verb: "\u53D6\u6240\u5728\u76EE\u5F55", target: path2 ? clipShortText(path2, 24) : void 0, readOnly: true };
10444
+ }
10445
+ case "diff":
10446
+ case "cmp": {
10447
+ const tokens2 = shellWords(stripTrailingPipe(rest));
10448
+ if (!tokens2) return null;
10449
+ const file = lastFileOperand(tokens2, /* @__PURE__ */ new Set(["-x", "--exclude", "-I", "--ignore-matching-lines", "-U", "--unified", "-C", "--context", "--label", "-L", "--to-file", "--from-file", "-S", "--starting-file", "--horizon-lines", "--tabsize", "-t"]));
10450
+ return { verb: "\u5BF9\u6BD4\u6587\u4EF6", target: file ? baseName(file) : void 0, readOnly: true };
10451
+ }
10296
10452
  case "dnf":
10297
10453
  case "yum": {
10298
10454
  const sub = rest.split(/\s+/)[0] ?? "";
@@ -10333,7 +10489,7 @@ function classifySegment(segment) {
10333
10489
  case "awk":
10334
10490
  return { verb: "\u5904\u7406\u6587\u672C", readOnly: true };
10335
10491
  case "find": {
10336
- if (/(?:^|\s)(?:-delete|-exec|-execdir|-ok|-okdir)(?:\s|$)/.test(rest)) return null;
10492
+ if (/(?:^|\s)(?:-delete|-exec|-execdir|-ok|-okdir|-fprint|-fprint0|-fprintf|-fls)(?:\s|$)/.test(rest)) return null;
10337
10493
  return { verb: "\u67E5\u627E\u6587\u4EF6", readOnly: true };
10338
10494
  }
10339
10495
  case "curl":
@@ -10345,6 +10501,7 @@ function classifySegment(segment) {
10345
10501
  case "yarn": {
10346
10502
  const tokens2 = shellWords(rest.split(/\s+\|\s+/)[0]) ?? rest.split(/\s+/).filter(Boolean);
10347
10503
  const sub = tokens2[0] ?? "";
10504
+ if (tokens2.length === 1 && ["-v", "-V", "--version"].includes(sub)) return { verb: "\u67E5\u7248\u672C", readOnly: true };
10348
10505
  if (sub === "test") {
10349
10506
  const target = tokens2.slice(1).find((t2) => !t2.startsWith("-"));
10350
10507
  return { verb: "\u8DD1\u6D4B\u8BD5", target: target ? baseName(target) : void 0, readOnly: false };
@@ -10370,6 +10527,7 @@ function classifySegment(segment) {
10370
10527
  case "python":
10371
10528
  case "python3": {
10372
10529
  const tokens2 = shellWords(rest.split(/\s+\|\s+/)[0]) ?? [];
10530
+ if (tokens2.length === 1 && ["-V", "-v", "--version"].includes(tokens2[0])) return { verb: "\u67E5\u7248\u672C", readOnly: true };
10373
10531
  if (tokens2.includes("--inline-heredoc") || /(?:^|\s)-[A-Za-z]*c(?:\s|$)/.test(rest)) {
10374
10532
  return { verb: "\u6267\u884C\u5185\u8054\u811A\u672C (Python)", readOnly: false };
10375
10533
  }
@@ -10378,6 +10536,8 @@ function classifySegment(segment) {
10378
10536
  }
10379
10537
  case "node": {
10380
10538
  if (/(?:^|\s)-[A-Za-z]*e(?:\s|$)/.test(rest)) return null;
10539
+ const nodeTokens = shellWords(stripTrailingPipe(rest));
10540
+ if (nodeTokens?.length === 1 && ["-v", "-V", "--version"].includes(nodeTokens[0])) return { verb: "\u67E5\u7248\u672C", readOnly: true };
10381
10541
  const script = rest.split(/\s+/).find((t2) => t2 && !t2.startsWith("-"));
10382
10542
  return { verb: "\u6267\u884C\u811A\u672C", target: baseName(script ?? ""), readOnly: false };
10383
10543
  }
@@ -10536,6 +10696,8 @@ var PIPELINE_FILTER_COMMANDS = /* @__PURE__ */ new Set([
10536
10696
  "nl",
10537
10697
  "column",
10538
10698
  "grep",
10699
+ "egrep",
10700
+ "fgrep",
10539
10701
  "rg",
10540
10702
  "ag",
10541
10703
  "ack",
@@ -10544,7 +10706,28 @@ var PIPELINE_FILTER_COMMANDS = /* @__PURE__ */ new Set([
10544
10706
  "more",
10545
10707
  "bat",
10546
10708
  "awk",
10547
- "sed"
10709
+ "sed",
10710
+ // 纯 stdout 文本/校验和工具:只读 stdin/文件,没有输出文件参数
10711
+ // (写文件的 tee/xargs/split/xxd 之类**不在此列**)。
10712
+ "diff",
10713
+ "cmp",
10714
+ "comm",
10715
+ "paste",
10716
+ "join",
10717
+ "fold",
10718
+ "expand",
10719
+ "unexpand",
10720
+ "tac",
10721
+ "rev",
10722
+ "strings",
10723
+ "od",
10724
+ "base64",
10725
+ "md5sum",
10726
+ "sha1sum",
10727
+ "sha256sum",
10728
+ "sha512sum",
10729
+ "b2sum",
10730
+ "cksum"
10548
10731
  ]);
10549
10732
  function hasNonFilterPipeline(command) {
10550
10733
  let quote = null;
@@ -11751,7 +11934,7 @@ function normalToolGistRaw(event) {
11751
11934
  if (query2 || path3) return formatSearchItemQuery(query2, path3);
11752
11935
  }
11753
11936
  if (isRunToolName(toolName)) {
11754
- const command2 = typeof metadata.command === "string" ? metadata.command : "";
11937
+ const command2 = typeof metadata.command === "string" ? metadata.command : typeof metadata.cmd === "string" ? metadata.cmd : "";
11755
11938
  if (command2) {
11756
11939
  const gist = summarizeShellCommand(command2);
11757
11940
  if (gist) return truncateByDisplayWidth(redactSecrets(gist.summary), normalRunGistMaxWidth());
@@ -11775,8 +11958,8 @@ function normalToolGistRaw(event) {
11775
11958
  function normalToolGist(event) {
11776
11959
  return withholdIfSecretLike(normalToolGistRaw(event));
11777
11960
  }
11778
- function formatNormalToolDuration(elapsedMs) {
11779
- if (typeof elapsedMs !== "number" || !Number.isFinite(elapsedMs) || elapsedMs <= 500) return "";
11961
+ function formatNormalToolDuration(elapsedMs, includeThreshold = false) {
11962
+ if (typeof elapsedMs !== "number" || !Number.isFinite(elapsedMs) || elapsedMs < 500 || elapsedMs === 500 && !includeThreshold) return "";
11780
11963
  if (elapsedMs < 1e3) return `${Math.round(elapsedMs)}ms`;
11781
11964
  return `${(elapsedMs / 1e3).toFixed(1)}s`;
11782
11965
  }
@@ -11939,8 +12122,9 @@ var TUI_TREE_TOOLS = {
11939
12122
  Search: ["exa_search", "globFiles", "searchFiles", "codeSearch"],
11940
12123
  Fetch: ["fetchWebpage"]
11941
12124
  };
12125
+ var RUN_WINDOW_SIZE = 3;
11942
12126
  function toolDetails(event, line) {
11943
- const command = event.metadata?.command;
12127
+ const command = event.metadata?.command ?? event.metadata?.cmd;
11944
12128
  return isRunToolName(event.toolName) && typeof command === "string" ? `${toolRowDetailLine(line)}${safeApprovalMultilineText(command)}
11945
12129
  ` : toolRowDetailLine(line);
11946
12130
  }
@@ -11961,6 +12145,43 @@ function createToolEventFormatter(colorEnabled = resolveCliColorEnabled(), opts
11961
12145
  let scope = 0;
11962
12146
  let lastFamilyId;
11963
12147
  let tree = null;
12148
+ let runGroup;
12149
+ const formatRunGroup = (event, line) => {
12150
+ const group = runGroup ??= { count: 0, elapsedMs: 0, recent: [], rows: [] };
12151
+ const elapsed = event.elapsedMs;
12152
+ group.count++;
12153
+ if (typeof elapsed === "number" && Number.isFinite(elapsed) && elapsed > 0) group.elapsedMs += elapsed;
12154
+ const gist = safeAskText(normalToolGist(event)) || toolLabel(event.toolName);
12155
+ group.recent.push({ gist, duration: formatNormalToolDuration(elapsed) });
12156
+ if (group.recent.length > RUN_WINDOW_SIZE) group.recent.shift();
12157
+ const payload = { kind: "Run", summary: "", fallback: line, details: toolDetails(event, line) };
12158
+ if (group.count <= RUN_WINDOW_SIZE) {
12159
+ group.rows.push(line.replace(/\n$/, ""));
12160
+ payload.appendOnly = true;
12161
+ } else {
12162
+ const budget = Math.max(1, resolveHistoryLayoutGeometry(process.stdout.columns).contentWidth - displayWidth("\u25C8 "));
12163
+ const fit = (text) => themeText(truncateByDisplayWidth(text, budget), "muted", colorEnabled);
12164
+ const total = formatNormalToolDuration(group.elapsedMs, true);
12165
+ const timing = total ? t("runGroupTiming", total) : "";
12166
+ const count = String(group.count);
12167
+ const prefix = `\u25B8 ${toolIcon("execShell")} \xB7 `;
12168
+ payload.previousLines = group.rows;
12169
+ payload.lines = [
12170
+ fit(prefix + t("runGroupHeader", count, timing)),
12171
+ fit(` \u2026 ${t("runGroupCollapsed", String(group.count - RUN_WINDOW_SIZE))}`),
12172
+ ...group.recent.map(({ gist: gist2, duration }) => {
12173
+ const leafPrefix = " \u2713 ";
12174
+ const leafTail = duration ? ` \xB7 ${duration}` : "";
12175
+ const gistBudget = Math.max(0, budget - displayWidth(leafPrefix + leafTail));
12176
+ return fit(`${leafPrefix}${truncateByDisplayWidth(gist2, gistBudget)}${leafTail}`);
12177
+ })
12178
+ ];
12179
+ payload.finalizedSummary = fit(prefix + t("runGroupFinal", count, timing));
12180
+ group.rows = payload.lines;
12181
+ }
12182
+ return `${TUI_TREE_MARKER}${JSON.stringify(payload)}${TUI_TREE_END}
12183
+ `;
12184
+ };
11964
12185
  const treeKind = (name) => Object.keys(TUI_TREE_TOOLS).find((kind) => TUI_TREE_TOOLS[kind].includes(name)) ?? null;
11965
12186
  const treeLine = (kind, counts, items, fallback, details) => {
11966
12187
  const activeKinds = Object.keys(counts).filter((k) => counts[k] > 0);
@@ -12004,16 +12225,21 @@ function createToolEventFormatter(colorEnabled = resolveCliColorEnabled(), opts
12004
12225
  `;
12005
12226
  };
12006
12227
  const formatTreeEvent = (event, call) => {
12007
- if (event.type === "tool-error") tree = null;
12228
+ if (event.type === "tool-error") {
12229
+ tree = null;
12230
+ runGroup = void 0;
12231
+ }
12008
12232
  if (!opts.tuiTrees || event.type !== "tool-result") return null;
12009
12233
  if (isFailedToolResult(event) || event.metadata?.failed || event.metadata?.timedOut || readActionGate(event.metadata?.actionGate) || event.metadata?.permissionRequest) {
12010
12234
  tree = null;
12235
+ runGroup = void 0;
12011
12236
  return null;
12012
12237
  }
12013
12238
  const name = event.toolName || call?.toolName || "tool";
12014
12239
  const kind = treeKind(name);
12015
12240
  if (!kind) {
12016
12241
  tree = null;
12242
+ runGroup = void 0;
12017
12243
  return null;
12018
12244
  }
12019
12245
  const activity = projectToolActivity({
@@ -12033,8 +12259,14 @@ function createToolEventFormatter(colorEnabled = resolveCliColorEnabled(), opts
12033
12259
  const isReadOnlyExploration = kind === "Read" || kind === "Search" || kind === "Fetch" || kind === "Run" && activity.readOnly === true;
12034
12260
  if (!isReadOnlyExploration) {
12035
12261
  tree = null;
12036
- return null;
12262
+ if (event.metadata?.actionGate) {
12263
+ runGroup = void 0;
12264
+ return null;
12265
+ }
12266
+ const runEvent = name === event.toolName ? event : { ...event, toolName: name };
12267
+ return formatRunGroup(runEvent, formatNormalToolLine(runEvent, call, colorEnabled, opts));
12037
12268
  }
12269
+ runGroup = void 0;
12038
12270
  let item = "";
12039
12271
  const m = event.metadata ?? {};
12040
12272
  if (kind === "Run") {
@@ -12066,6 +12298,7 @@ function createToolEventFormatter(colorEnabled = resolveCliColorEnabled(), opts
12066
12298
  };
12067
12299
  const format = (event) => {
12068
12300
  if (event.type === "tool-call") {
12301
+ if (!isRunToolName(event.toolName)) runGroup = void 0;
12069
12302
  pending.set(event.toolCallId, {
12070
12303
  toolName: event.toolName,
12071
12304
  argumentsPreview: event.argumentsPreview
@@ -12090,10 +12323,12 @@ function createToolEventFormatter(colorEnabled = resolveCliColorEnabled(), opts
12090
12323
  };
12091
12324
  format.reset = () => {
12092
12325
  tree = null;
12326
+ runGroup = void 0;
12093
12327
  lastFamilyId = void 0;
12094
12328
  scope++;
12095
12329
  };
12096
12330
  format.consume = (event) => {
12331
+ runGroup = void 0;
12097
12332
  if (event.type === "tool-call") {
12098
12333
  pending.set(event.toolCallId, {
12099
12334
  toolName: event.toolName,
@@ -12420,7 +12655,7 @@ function createCliTurnOutput(params) {
12420
12655
  };
12421
12656
  const writeVisibleAssistantChunk = (chunk) => {
12422
12657
  if (!chunk) return;
12423
- if (!assistantLabelManaged) formatToolEvent.reset?.();
12658
+ if (!assistantLabelManaged || tuiNarrationPromoted) formatToolEvent.reset?.();
12424
12659
  const parsed = processThinkChunk(chunk, thinkState);
12425
12660
  thinkState = parsed.state;
12426
12661
  if (!parsed.content && !parsed.reasoning) return;
@@ -14,10 +14,10 @@ import {
14
14
  import {
15
15
  addContentToSpace,
16
16
  resolveCreationSpaceId
17
- } from "./chunk-HZQGCFPJ.js";
17
+ } from "./chunk-LJ6WIQZO.js";
18
18
  import {
19
19
  runtime_default
20
- } from "./chunk-24Z44WHO.js";
20
+ } from "./chunk-7B55IVLF.js";
21
21
  import {
22
22
  getCurrentSpaceId
23
23
  } from "./chunk-YN23INFZ.js";