@cnwenf/occ 2.1.294 → 2.1.296

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 (2) hide show
  1. package/dist/cli.js +356 -174
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- globalThis.MACRO={"VERSION":"2.1.294","BINARY_NAME":"occ","BUILD_TIME":"2026-08-06T04:37:11.915Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
2
+ globalThis.MACRO={"VERSION":"2.1.296","BINARY_NAME":"occ","BUILD_TIME":"2026-08-07T09:27:10.873Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
3
3
  // @bun
4
4
  var __create = Object.create;
5
5
  var __getProtoOf = Object.getPrototypeOf;
@@ -59437,6 +59437,7 @@ var init_types2 = __esm(() => {
59437
59437
  }).optional().describe("Custom file suggestion configuration for @ mentions"),
59438
59438
  respectGitignore: exports_external.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). " + "Note: .ignore files are always respected."),
59439
59439
  cleanupPeriodDays: exports_external.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),
59440
+ autoCompactWindow: exports_external.number().int().min(1e5).max(1e6).optional().catch(undefined).describe("Auto-compact window size"),
59440
59441
  env: EnvironmentVariablesSchema().optional().describe("Environment variables to set for Claude Code sessions"),
59441
59442
  attribution: exports_external.object({
59442
59443
  commit: exports_external.string().optional().describe("Attribution text for git commits, including any trailers. " + "Empty string hides attribution."),
@@ -241517,6 +241518,56 @@ var init_microCompact = __esm(() => {
241517
241518
  ]);
241518
241519
  });
241519
241520
 
241521
+ // src/utils/autoCompactWindow.ts
241522
+ function parseBareNumber(raw) {
241523
+ if (EXPONENT_NOTATION_RE.test(raw)) {
241524
+ const value = Number(raw);
241525
+ return Number.isInteger(value) ? value : NaN;
241526
+ }
241527
+ if (COMMA_SEPARATED_RE.test(raw)) {
241528
+ return parseInt(raw.replace(/,/g, ""), 10);
241529
+ }
241530
+ return parseInt(raw, 10);
241531
+ }
241532
+ function parseAutoCompactWindowInput(raw) {
241533
+ const normalized = raw.trim().toLowerCase();
241534
+ if (normalized === "auto") {
241535
+ return "auto";
241536
+ }
241537
+ let tokens;
241538
+ if (normalized.endsWith("m")) {
241539
+ tokens = parseFloat(normalized) * 1e6;
241540
+ } else if (normalized.endsWith("k")) {
241541
+ tokens = parseFloat(normalized) * 1000;
241542
+ } else {
241543
+ const parsed = parseBareNumber(normalized);
241544
+ tokens = parsed >= 100 && parsed <= 1000 ? parsed * 1000 : parsed;
241545
+ }
241546
+ if (!Number.isFinite(tokens) || tokens < AUTO_COMPACT_WINDOW_MIN || tokens > AUTO_COMPACT_WINDOW_MAX) {
241547
+ return;
241548
+ }
241549
+ return Math.round(tokens);
241550
+ }
241551
+ function resolveAutoCompactWindowOverride(cliValue) {
241552
+ if (cliValue === undefined) {
241553
+ const fromSettings = getInitialSettings().autoCompactWindow;
241554
+ return typeof fromSettings === "number" ? fromSettings : undefined;
241555
+ }
241556
+ return cliValue === "auto" ? undefined : cliValue;
241557
+ }
241558
+ function setSessionAutoCompactWindow(window2) {
241559
+ sessionAutoCompactWindow = window2;
241560
+ }
241561
+ function getSessionAutoCompactWindow() {
241562
+ return sessionAutoCompactWindow;
241563
+ }
241564
+ var AUTO_COMPACT_WINDOW_MIN = 1e5, AUTO_COMPACT_WINDOW_MAX = 1e6, EXPONENT_NOTATION_RE, COMMA_SEPARATED_RE, sessionAutoCompactWindow;
241565
+ var init_autoCompactWindow = __esm(() => {
241566
+ init_settings2();
241567
+ EXPONENT_NOTATION_RE = /^[+-]?(\d+(\.\d*)?|\.\d+)[eE][+-]?\d+$/;
241568
+ COMMA_SEPARATED_RE = /^[+-]?\d{1,3}(,\d{3})+$/;
241569
+ });
241570
+
241520
241571
  // src/utils/tokens.ts
241521
241572
  function getTokenUsage(message) {
241522
241573
  if (message?.type === "assistant" && message.message && "usage" in message.message && !(Array.isArray(message.message.content) && message.message.content[0]?.type === "text" && SYNTHETIC_MESSAGES.has(message.message.content[0].text)) && message.message.model !== SYNTHETIC_MODEL) {
@@ -604548,6 +604599,11 @@ function getEffectiveContextWindowSize(model) {
604548
604599
  if (!isNaN(parsed) && parsed > 0) {
604549
604600
  contextWindow = Math.min(contextWindow, parsed);
604550
604601
  }
604602
+ } else {
604603
+ const sessionWindow = getSessionAutoCompactWindow();
604604
+ if (sessionWindow !== undefined) {
604605
+ contextWindow = Math.min(contextWindow, sessionWindow);
604606
+ }
604551
604607
  }
604552
604608
  return contextWindow - reservedTokensForSummary;
604553
604609
  }
@@ -604692,6 +604748,7 @@ var init_autoCompact = __esm(() => {
604692
604748
  init_featureFlags();
604693
604749
  init_state();
604694
604750
  init_state();
604751
+ init_autoCompactWindow();
604695
604752
  init_config4();
604696
604753
  init_context();
604697
604754
  init_debug();
@@ -684547,51 +684604,57 @@ var init_logoV2Utils = __esm(() => {
684547
684604
  });
684548
684605
 
684549
684606
  // src/components/LogoV2/OccMark.tsx
684607
+ function chevronBeamX(spec, y4) {
684608
+ const centerY = (spec.gridHeight - 1) / 2;
684609
+ return (spec.gridWidth - 2) * (1 - Math.abs(y4 - centerY) / centerY);
684610
+ }
684611
+ function isChevronDotLit(spec, x6, y4) {
684612
+ if (x6 < 0 || x6 >= spec.gridWidth || y4 < 0 || y4 >= spec.gridHeight) {
684613
+ return false;
684614
+ }
684615
+ return Math.abs(x6 - chevronBeamX(spec, y4)) <= spec.beamRadius;
684616
+ }
684550
684617
  function normalizeMark(lines2) {
684551
684618
  const width = Math.max(...lines2.map(stringWidth));
684552
684619
  return lines2.map((line) => line + " ".repeat(width - stringWidth(line)));
684553
684620
  }
684621
+ function generateSignalChevron(spec) {
684622
+ const columns = Math.ceil(spec.gridWidth / 2);
684623
+ const rows = Math.ceil(spec.gridHeight / 4);
684624
+ const lines2 = [];
684625
+ for (let row = 0;row < rows; row++) {
684626
+ let line = "";
684627
+ for (let column = 0;column < columns; column++) {
684628
+ let bits2 = 0;
684629
+ for (let dotRow = 0;dotRow < 4; dotRow++) {
684630
+ const y4 = row * 4 + dotRow;
684631
+ if (isChevronDotLit(spec, column * 2, y4)) {
684632
+ bits2 |= BRAILLE_LEFT_BITS[dotRow];
684633
+ }
684634
+ if (isChevronDotLit(spec, column * 2 + 1, y4)) {
684635
+ bits2 |= BRAILLE_RIGHT_BITS[dotRow];
684636
+ }
684637
+ }
684638
+ line += bits2 === 0 ? " " : String.fromCodePoint(BRAILLE_BASE_CODE + bits2);
684639
+ }
684640
+ lines2.push(line.trimEnd());
684641
+ }
684642
+ return normalizeMark(lines2);
684643
+ }
684554
684644
  function getOccMark(mode) {
684555
684645
  return OCC_MARKS[mode];
684556
684646
  }
684557
684647
  function getOccMarkWidth(art) {
684558
684648
  return Math.max(...art.map(stringWidth));
684559
684649
  }
684560
- function gradientThemeFamily(themeName) {
684650
+ function chevronThemeFamily(themeName) {
684561
684651
  return themeName.startsWith("light") ? "light" : "dark";
684562
684652
  }
684563
- function sampleGradient(stops, t4) {
684564
- if (stops.length === 0)
684565
- return [0, 0, 0];
684566
- if (stops.length === 1)
684567
- return stops[0];
684568
- const clamped = Math.min(Math.max(t4, 0), 1);
684569
- const scaled = clamped * (stops.length - 1);
684570
- const index2 = Math.min(Math.floor(scaled), stops.length - 2);
684571
- const local = scaled - index2;
684572
- const from2 = stops[index2];
684573
- const to = stops[index2 + 1];
684574
- return [
684575
- Math.round(from2[0] + (to[0] - from2[0]) * local),
684576
- Math.round(from2[1] + (to[1] - from2[1]) * local),
684577
- Math.round(from2[2] + (to[2] - from2[2]) * local)
684578
- ];
684579
- }
684580
- function markCellT(art, row, column) {
684581
- const width = getOccMarkWidth(art);
684582
- const horizontal = width > 1 ? column / (width - 1) : 0;
684583
- const vertical = art.length > 1 ? row / (art.length - 1) : 0;
684584
- return horizontal * 0.72 + vertical * 0.28;
684585
- }
684586
684653
  function rgbColor(rgb3) {
684587
684654
  return `rgb(${rgb3[0]},${rgb3[1]},${rgb3[2]})`;
684588
684655
  }
684589
- function highlightColor(rgb3, amount = 0.62) {
684590
- return [
684591
- Math.round(rgb3[0] + (255 - rgb3[0]) * amount),
684592
- Math.round(rgb3[1] + (255 - rgb3[1]) * amount),
684593
- Math.round(rgb3[2] + (255 - rgb3[2]) * amount)
684594
- ];
684656
+ function getMarkColorMode() {
684657
+ return source_default.level >= 2 ? "color" : "silhouette";
684595
684658
  }
684596
684659
  function isShimmerCell(art, row, column, progress) {
684597
684660
  if (progress === null)
@@ -684604,7 +684667,8 @@ function isShimmerCell(art, row, column, progress) {
684604
684667
  function MarkRow({
684605
684668
  art,
684606
684669
  row,
684607
- stops,
684670
+ colorMode,
684671
+ tone,
684608
684672
  progress
684609
684673
  }) {
684610
684674
  const line = art[row];
@@ -684626,10 +684690,16 @@ function MarkRow({
684626
684690
  continue;
684627
684691
  }
684628
684692
  flushSpaces(`${row}-sp-${column}`);
684629
- const base2 = sampleGradient(stops, markCellT(art, row, column));
684693
+ if (colorMode === "silhouette") {
684694
+ nodes.push(/* @__PURE__ */ jsx_runtime258.jsx(ThemedText, {
684695
+ bold: true,
684696
+ children: char
684697
+ }, `${row}-${column}`));
684698
+ continue;
684699
+ }
684630
684700
  const shimmering = isShimmerCell(art, row, column, progress);
684631
684701
  nodes.push(/* @__PURE__ */ jsx_runtime258.jsx(ThemedText, {
684632
- color: rgbColor(shimmering ? highlightColor(base2) : base2),
684702
+ color: rgbColor(shimmering ? tone.peak : tone.base),
684633
684703
  bold: true,
684634
684704
  children: char
684635
684705
  }, `${row}-${column}`));
@@ -684643,8 +684713,9 @@ function OccMark(props) {
684643
684713
  const mode = props.mode ?? "compact";
684644
684714
  const art = getOccMark(mode);
684645
684715
  const [themeName] = useTheme();
684646
- const stops = GRADIENT_STOPS[gradientThemeFamily(themeName)];
684647
- const animate = props.animate ?? !(getInitialSettings().prefersReducedMotion ?? false);
684716
+ const tone = CHEVRON_TONES[chevronThemeFamily(themeName)];
684717
+ const colorMode = getMarkColorMode();
684718
+ const animate = colorMode === "color" && (props.animate ?? !(getInitialSettings().prefersReducedMotion ?? false));
684648
684719
  const [done, setDone] = import_react146.useState(!animate);
684649
684720
  const startTimeRef = import_react146.useRef(null);
684650
684721
  const [ref, time3] = useAnimationFrame(done ? null : SHIMMER_FRAME_MS);
@@ -684666,51 +684737,42 @@ function OccMark(props) {
684666
684737
  children: art.map((_4, row) => /* @__PURE__ */ jsx_runtime258.jsx(MarkRow, {
684667
684738
  art,
684668
684739
  row,
684669
- stops,
684740
+ colorMode,
684741
+ tone,
684670
684742
  progress
684671
684743
  }, row))
684672
684744
  });
684673
684745
  }
684674
- var import_react146, jsx_runtime258, OCC_MARKS, GRADIENT_STOPS, SHIMMER_FRAME_MS = 84, SHIMMER_DURATION_MS = 1850, SHIMMER_BAND_WIDTH = 0.24;
684746
+ var import_react146, jsx_runtime258, CHEVRON_SPECS, BRAILLE_BASE_CODE = 10240, BRAILLE_LEFT_BITS, BRAILLE_RIGHT_BITS, OCC_MARKS, CHEVRON_TONES, SHIMMER_FRAME_MS = 84, SHIMMER_DURATION_MS = 1800, SHIMMER_BAND_WIDTH = 0.24;
684675
684747
  var init_OccMark = __esm(() => {
684748
+ init_source();
684676
684749
  init_ink2();
684677
684750
  init_stringWidth();
684678
684751
  init_settings2();
684679
684752
  init_ThemeProvider();
684680
684753
  import_react146 = __toESM(require_react(), 1);
684681
684754
  jsx_runtime258 = __toESM(require_jsx_runtime(), 1);
684755
+ CHEVRON_SPECS = {
684756
+ wide: { gridWidth: 30, gridHeight: 32, beamRadius: 2.1 },
684757
+ compact: { gridWidth: 26, gridHeight: 28, beamRadius: 1.1 },
684758
+ plain: { gridWidth: 20, gridHeight: 20, beamRadius: 3.1 }
684759
+ };
684760
+ BRAILLE_LEFT_BITS = [1, 2, 4, 64];
684761
+ BRAILLE_RIGHT_BITS = [8, 16, 32, 128];
684682
684762
  OCC_MARKS = {
684683
- wide: normalizeMark([
684684
- "\u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2599",
684685
- "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B",
684686
- "\u2588\u2588",
684687
- "\u2588\u2588",
684688
- "\u2588\u2588",
684689
- "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259C",
684690
- "\u259C\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B"
684691
- ]),
684692
- compact: normalizeMark([
684693
- "\u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2599",
684694
- "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B",
684695
- "\u2588\u2588",
684696
- "\u2588\u2588",
684697
- "\u2588\u2588",
684698
- "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259C",
684699
- "\u259C\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B"
684700
- ]),
684701
- plain: normalizeMark(["\u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2599", "\u2588\u2588", "\u2588\u2588", "\u2588\u2588", "\u259C\u2588\u2588\u2588\u2588\u2588\u2588\u259B"])
684763
+ wide: generateSignalChevron(CHEVRON_SPECS.wide),
684764
+ compact: generateSignalChevron(CHEVRON_SPECS.compact),
684765
+ plain: generateSignalChevron(CHEVRON_SPECS.plain)
684702
684766
  };
684703
- GRADIENT_STOPS = {
684704
- dark: [
684705
- [255, 199, 110],
684706
- [255, 116, 64],
684707
- [233, 60, 136]
684708
- ],
684709
- light: [
684710
- [181, 110, 0],
684711
- [194, 62, 24],
684712
- [162, 22, 82]
684713
- ]
684767
+ CHEVRON_TONES = {
684768
+ dark: {
684769
+ base: [90, 90, 90],
684770
+ peak: [225, 225, 225]
684771
+ },
684772
+ light: {
684773
+ base: [64, 64, 64],
684774
+ peak: [117, 117, 117]
684775
+ }
684714
684776
  };
684715
684777
  });
684716
684778
 
@@ -685605,7 +685667,8 @@ function CondensedLogo() {
685605
685667
  incrementOverageCreditUpsellSeenCount();
685606
685668
  }
685607
685669
  }, [showGuestPassesUpsell, showOverageCreditUpsell]);
685608
- const plain = isScreenReaderEnabled() || process.env.TERM?.toLowerCase() === "dumb";
685670
+ const plain = isScreenReaderEnabled();
685671
+ const dumbTerminal = process.env.TERM?.toLowerCase() === "dumb";
685609
685672
  const upsell = showGuestPassesUpsell ? /* @__PURE__ */ jsx_runtime264.jsx(GuestPassesUpsell, {}) : showOverageCreditUpsell ? /* @__PURE__ */ jsx_runtime264.jsx(OverageCreditUpsell, {
685610
685673
  maxWidth: Math.max(columns - 6, 20),
685611
685674
  twoLine: true
@@ -685620,7 +685683,7 @@ function CondensedLogo() {
685620
685683
  branch,
685621
685684
  agentName,
685622
685685
  tip,
685623
- reducedMotion: reducedMotion || plain,
685686
+ reducedMotion: reducedMotion || plain || dumbTerminal,
685624
685687
  plain,
685625
685688
  children: upsell
685626
685689
  })
@@ -690883,8 +690946,8 @@ function formatSnippet({
690883
690946
  before,
690884
690947
  match,
690885
690948
  after
690886
- }, highlightColor2) {
690887
- return source_default.dim(before) + highlightColor2(match) + source_default.dim(after);
690949
+ }, highlightColor) {
690950
+ return source_default.dim(before) + highlightColor(match) + source_default.dim(after);
690888
690951
  }
690889
690952
  function extractSnippet(text2, query2, contextChars) {
690890
690953
  const matchIndex = text2.toLowerCase().indexOf(query2.toLowerCase());
@@ -690973,7 +691036,7 @@ function LogSelector(t0) {
690973
691036
  } else {
690974
691037
  t5 = $4[4];
690975
691038
  }
690976
- const highlightColor2 = t5;
691039
+ const highlightColor = t5;
690977
691040
  const isAgenticSearchEnabled = false;
690978
691041
  const [currentBranch, setCurrentBranch] = import_react163.default.useState(null);
690979
691042
  const [branchFilterEnabled, setBranchFilterEnabled] = import_react163.default.useState(false);
@@ -691338,14 +691401,14 @@ function LogSelector(t0) {
691338
691401
  break bb2;
691339
691402
  }
691340
691403
  let t302;
691341
- if ($4[66] !== displayedLogs || $4[67] !== highlightColor2 || $4[68] !== maxLabelWidth || $4[69] !== showAllProjects || $4[70] !== snippets) {
691404
+ if ($4[66] !== displayedLogs || $4[67] !== highlightColor || $4[68] !== maxLabelWidth || $4[69] !== showAllProjects || $4[70] !== snippets) {
691342
691405
  const sessionGroups = groupLogsBySessionId(displayedLogs);
691343
691406
  t302 = Array.from(sessionGroups.entries()).map((t312) => {
691344
691407
  const [sessionId, groupLogs] = t312;
691345
691408
  const latestLog = groupLogs[0];
691346
691409
  const indexInFiltered = displayedLogs.indexOf(latestLog);
691347
691410
  const snippet_0 = snippets.get(latestLog);
691348
- const snippetStr = snippet_0 ? formatSnippet(snippet_0, highlightColor2) : null;
691411
+ const snippetStr = snippet_0 ? formatSnippet(snippet_0, highlightColor) : null;
691349
691412
  if (groupLogs.length === 1) {
691350
691413
  const metadata = buildLogMetadata(latestLog, {
691351
691414
  showProjectPath: showAllProjects
@@ -691366,7 +691429,7 @@ function LogSelector(t0) {
691366
691429
  const children3 = groupLogs.slice(1).map((log_8, index2) => {
691367
691430
  const childIndexInFiltered = displayedLogs.indexOf(log_8);
691368
691431
  const childSnippet = snippets.get(log_8);
691369
- const childSnippetStr = childSnippet ? formatSnippet(childSnippet, highlightColor2) : null;
691432
+ const childSnippetStr = childSnippet ? formatSnippet(childSnippet, highlightColor) : null;
691370
691433
  const childMetadata = buildLogMetadata(log_8, {
691371
691434
  isChild: true,
691372
691435
  showProjectPath: showAllProjects
@@ -691405,7 +691468,7 @@ function LogSelector(t0) {
691405
691468
  };
691406
691469
  });
691407
691470
  $4[66] = displayedLogs;
691408
- $4[67] = highlightColor2;
691471
+ $4[67] = highlightColor;
691409
691472
  $4[68] = maxLabelWidth;
691410
691473
  $4[69] = showAllProjects;
691411
691474
  $4[70] = snippets;
@@ -691430,9 +691493,9 @@ function LogSelector(t0) {
691430
691493
  break bb3;
691431
691494
  }
691432
691495
  let t312;
691433
- if ($4[73] !== displayedLogs || $4[74] !== highlightColor2 || $4[75] !== maxLabelWidth || $4[76] !== showAllProjects || $4[77] !== snippets) {
691496
+ if ($4[73] !== displayedLogs || $4[74] !== highlightColor || $4[75] !== maxLabelWidth || $4[76] !== showAllProjects || $4[77] !== snippets) {
691434
691497
  let t323;
691435
- if ($4[79] !== highlightColor2 || $4[80] !== maxLabelWidth || $4[81] !== showAllProjects || $4[82] !== snippets) {
691498
+ if ($4[79] !== highlightColor || $4[80] !== maxLabelWidth || $4[81] !== showAllProjects || $4[82] !== snippets) {
691436
691499
  t323 = (log_9, index_0) => {
691437
691500
  const rawSummary = getLogDisplayTitle(log_9);
691438
691501
  const summaryWithSidechain = rawSummary + (log_9.isSidechain ? " (sidechain)" : "");
@@ -691440,7 +691503,7 @@ function LogSelector(t0) {
691440
691503
  const baseDescription = formatLogMetadata(log_9);
691441
691504
  const projectSuffix = showAllProjects && log_9.projectPath ? ` \xB7 ${log_9.projectPath}` : "";
691442
691505
  const snippet_1 = snippets.get(log_9);
691443
- const snippetStr_0 = snippet_1 ? formatSnippet(snippet_1, highlightColor2) : null;
691506
+ const snippetStr_0 = snippet_1 ? formatSnippet(snippet_1, highlightColor) : null;
691444
691507
  return {
691445
691508
  label: summary,
691446
691509
  description: snippetStr_0 ? `${baseDescription}${projectSuffix}
@@ -691449,7 +691512,7 @@ function LogSelector(t0) {
691449
691512
  value: index_0.toString()
691450
691513
  };
691451
691514
  };
691452
- $4[79] = highlightColor2;
691515
+ $4[79] = highlightColor;
691453
691516
  $4[80] = maxLabelWidth;
691454
691517
  $4[81] = showAllProjects;
691455
691518
  $4[82] = snippets;
@@ -691459,7 +691522,7 @@ function LogSelector(t0) {
691459
691522
  }
691460
691523
  t312 = displayedLogs.map(t323);
691461
691524
  $4[73] = displayedLogs;
691462
- $4[74] = highlightColor2;
691525
+ $4[74] = highlightColor;
691463
691526
  $4[75] = maxLabelWidth;
691464
691527
  $4[76] = showAllProjects;
691465
691528
  $4[77] = snippets;
@@ -700288,6 +700351,114 @@ var init_autocompact2 = __esm(() => {
700288
700351
  autocompact_default = autocompact;
700289
700352
  });
700290
700353
 
700354
+ // src/commands/autocompact/autocompact-noninteractive.ts
700355
+ var exports_autocompact_noninteractive = {};
700356
+ __export(exports_autocompact_noninteractive, {
700357
+ call: () => call44,
700358
+ autocompactNonInteractive: () => autocompactNonInteractive
700359
+ });
700360
+ function resolveWindow(model) {
700361
+ const modelWindow = getContextWindowForModel(model, getSdkBetas());
700362
+ const envRaw = process.env[ENV_WINDOW_KEY];
700363
+ if (envRaw) {
700364
+ const parsed = parseInt(envRaw, 10);
700365
+ if (!isNaN(parsed) && parsed > 0) {
700366
+ return {
700367
+ window: Math.min(modelWindow, parsed),
700368
+ configured: parsed,
700369
+ source: "env"
700370
+ };
700371
+ }
700372
+ }
700373
+ const fromSettings = getInitialSettings().autoCompactWindow;
700374
+ if (typeof fromSettings === "number") {
700375
+ return {
700376
+ window: Math.min(modelWindow, fromSettings),
700377
+ configured: fromSettings,
700378
+ source: "settings"
700379
+ };
700380
+ }
700381
+ return { window: modelWindow, configured: undefined, source: "auto" };
700382
+ }
700383
+ function describeCurrentWindow(model) {
700384
+ const { window: window2, configured, source: source2 } = resolveWindow(model);
700385
+ const cappedSuffix = configured !== undefined && configured > window2 ? ` \xB7 capped to ${formatTokens(window2)} by model` : "";
700386
+ const sourceLine = source2 === "auto" ? "auto" : source2 === "env" ? `${formatTokens(configured)} tokens (from ${ENV_WINDOW_KEY})${cappedSuffix}` : `${formatTokens(configured)} tokens (from settings)${cappedSuffix}`;
700387
+ const lines2 = [`Auto-compact window: ${sourceLine}`];
700388
+ if (!getGlobalConfig().autoCompactEnabled) {
700389
+ lines2.push("Auto-compact is currently disabled (see /config)");
700390
+ }
700391
+ lines2.push("Auto-compact summarizes the conversation when context usage approaches this limit. The actual threshold is the minimum of this setting and your model's maximum context window.");
700392
+ return lines2.join(`
700393
+ `);
700394
+ }
700395
+ async function setWindow(raw, model) {
700396
+ if (process.env[ENV_WINDOW_KEY]) {
700397
+ return `${ENV_WINDOW_KEY} is set and takes precedence. Unset it to change this setting.`;
700398
+ }
700399
+ const normalized = raw.trim().toLowerCase();
700400
+ const parsed = normalized === "reset" || normalized === "unset" || normalized === "default" ? "auto" : parseAutoCompactWindowInput(normalized);
700401
+ if (parsed === undefined) {
700402
+ return `Couldn't parse '${raw}'. Expected 'auto' or 100k\u20131M tokens (e.g. 500k, 200000, or 200 as shorthand)`;
700403
+ }
700404
+ const valueToSave = parsed === "auto" ? undefined : parsed;
700405
+ const { error: error52 } = updateSettingsForSource("userSettings", {
700406
+ autoCompactWindow: valueToSave
700407
+ });
700408
+ if (error52) {
700409
+ return `Couldn't save setting: ${error52.message}`;
700410
+ }
700411
+ const reloaded = getInitialSettings().autoCompactWindow;
700412
+ const { window: window2, source: source2 } = resolveWindow(model);
700413
+ const overrideActive = source2 === "env" || reloaded !== valueToSave;
700414
+ logEvent2("tengu_autocompact_command", {
700415
+ action: parsed === "auto" ? "auto" : "set",
700416
+ ...valueToSave !== undefined && { tokens: valueToSave }
700417
+ });
700418
+ if (parsed === "auto") {
700419
+ return overrideActive ? `Auto-compact window set to auto in settings, but a higher-priority override is active (${formatTokens(window2)} tokens)` : "Auto-compact window set to auto";
700420
+ }
700421
+ let suffix2 = "";
700422
+ if (overrideActive) {
700423
+ suffix2 = `, but a higher-priority override is active (${formatTokens(window2)} tokens)`;
700424
+ } else if (window2 < parsed) {
700425
+ suffix2 = ` (capped to model limit of ${formatTokens(window2)})`;
700426
+ }
700427
+ return `Auto-compact window set to ${formatTokens(parsed)} tokens${suffix2}`;
700428
+ }
700429
+ async function call44(args, context8) {
700430
+ const raw = (args ?? "").trim();
700431
+ const model = context8.options.mainLoopModel;
700432
+ if (!raw) {
700433
+ return { type: "text", value: describeCurrentWindow(model) };
700434
+ }
700435
+ return { type: "text", value: await setWindow(raw, model) };
700436
+ }
700437
+ var ENV_WINDOW_KEY = "CLAUDE_CODE_AUTO_COMPACT_WINDOW", autocompactNonInteractive;
700438
+ var init_autocompact_noninteractive = __esm(() => {
700439
+ init_state();
700440
+ init_analytics();
700441
+ init_autoCompactWindow();
700442
+ init_config4();
700443
+ init_context();
700444
+ init_format();
700445
+ init_settings2();
700446
+ autocompactNonInteractive = {
700447
+ type: "local",
700448
+ name: "autocompact",
700449
+ supportsNonInteractive: true,
700450
+ description: "Configure the auto-compact window size",
700451
+ get isHidden() {
700452
+ return !getIsNonInteractiveSession();
700453
+ },
700454
+ isEnabled() {
700455
+ return getIsNonInteractiveSession();
700456
+ },
700457
+ argumentHint: "[auto|<tokens>]",
700458
+ load: () => Promise.resolve().then(() => (init_autocompact_noninteractive(), exports_autocompact_noninteractive))
700459
+ };
700460
+ });
700461
+
700291
700462
  // src/commands/cd/cdLogic.ts
700292
700463
  import { realpathSync as realpathSync8, statSync as statSync19 } from "fs";
700293
700464
  import { resolve as resolve57 } from "path";
@@ -700488,9 +700659,9 @@ var init_CdDirectoryPicker = __esm(() => {
700488
700659
  // src/commands/cd/cd.tsx
700489
700660
  var exports_cd = {};
700490
700661
  __export(exports_cd, {
700491
- call: () => call44
700662
+ call: () => call45
700492
700663
  });
700493
- var jsx_runtime306, call44 = async (onDone, _context, args) => {
700664
+ var jsx_runtime306, call45 = async (onDone, _context, args) => {
700494
700665
  const trimmed = (args ?? "").trim();
700495
700666
  if (!trimmed) {
700496
700667
  return /* @__PURE__ */ jsx_runtime306.jsx(CdDirectoryPicker, {
@@ -700529,7 +700700,7 @@ var exports_focus = {};
700529
700700
  __export(exports_focus, {
700530
700701
  setFocusViewEnabled: () => setFocusViewEnabled,
700531
700702
  isFocusViewEnabled: () => isFocusViewEnabled,
700532
- call: () => call45
700703
+ call: () => call46
700533
700704
  });
700534
700705
  function isFocusViewEnabled() {
700535
700706
  return focusViewEnabled;
@@ -700545,7 +700716,7 @@ function isFullscreenActive2() {
700545
700716
  return false;
700546
700717
  return isFullscreenEnvEnabled();
700547
700718
  }
700548
- var focusViewEnabled = false, NEEDS_FULLSCREEN, call45 = async (onDone, _context, _args) => {
700719
+ var focusViewEnabled = false, NEEDS_FULLSCREEN, call46 = async (onDone, _context, _args) => {
700549
700720
  if (!isFullscreenActive2()) {
700550
700721
  onDone(NEEDS_FULLSCREEN, { display: "system" });
700551
700722
  return null;
@@ -700581,9 +700752,9 @@ var init_focus3 = __esm(() => {
700581
700752
  // src/commands/powerup/powerup.ts
700582
700753
  var exports_powerup = {};
700583
700754
  __export(exports_powerup, {
700584
- call: () => call46
700755
+ call: () => call47
700585
700756
  });
700586
- var LESSONS, call46 = async (onDone, _context, _args) => {
700757
+ var LESSONS, call47 = async (onDone, _context, _args) => {
700587
700758
  logEvent2("powerup_discovery_shown");
700588
700759
  const unlocked = new Set;
700589
700760
  let lines2 = `Powerup \u2014 discover Claude Code in 5 minutes
@@ -700706,9 +700877,9 @@ var init_awaySummary = __esm(() => {
700706
700877
  // src/commands/recap/recap.ts
700707
700878
  var exports_recap = {};
700708
700879
  __export(exports_recap, {
700709
- call: () => call47
700880
+ call: () => call48
700710
700881
  });
700711
- var NOTHING_TO_RECAP = "Nothing to recap yet \u2014 send a message first.", call47 = async (_args, context8) => {
700882
+ var NOTHING_TO_RECAP = "Nothing to recap yet \u2014 send a message first.", call48 = async (_args, context8) => {
700712
700883
  const messages = context8.messages ?? [];
700713
700884
  if (messages.length === 0) {
700714
700885
  return { type: "text", value: NOTHING_TO_RECAP };
@@ -700740,9 +700911,9 @@ var init_recap2 = __esm(() => {
700740
700911
  // src/commands/reload-skills/reload-skills.ts
700741
700912
  var exports_reload_skills = {};
700742
700913
  __export(exports_reload_skills, {
700743
- call: () => call48
700914
+ call: () => call49
700744
700915
  });
700745
- var call48 = async () => {
700916
+ var call49 = async () => {
700746
700917
  const cwd2 = getProjectRoot();
700747
700918
  clearCommandsCache();
700748
700919
  const commands7 = await getCommands(cwd2);
@@ -700771,9 +700942,9 @@ var init_reload_skills2 = __esm(() => {
700771
700942
  // src/commands/scroll-speed/scroll-speed.tsx
700772
700943
  var exports_scroll_speed = {};
700773
700944
  __export(exports_scroll_speed, {
700774
- call: () => call49
700945
+ call: () => call50
700775
700946
  });
700776
- var jsx_runtime307, call49 = async (onDone, context8) => {
700947
+ var jsx_runtime307, call50 = async (onDone, context8) => {
700777
700948
  return /* @__PURE__ */ jsx_runtime307.jsx(Settings, {
700778
700949
  onClose: onDone,
700779
700950
  context: context8,
@@ -700802,7 +700973,7 @@ var init_scroll_speed2 = __esm(() => {
700802
700973
  // src/commands/tui/tui.ts
700803
700974
  var exports_tui = {};
700804
700975
  __export(exports_tui, {
700805
- call: () => call50
700976
+ call: () => call51
700806
700977
  });
700807
700978
  function getCurrentRenderer() {
700808
700979
  const setting = getSettings_DEPRECATED().tui;
@@ -700812,7 +700983,7 @@ function getCurrentRenderer() {
700812
700983
  return "default";
700813
700984
  return isFullscreenEnvEnabled() ? "fullscreen" : "default";
700814
700985
  }
700815
- var RENDERERS, call50 = async (onDone, _context, args) => {
700986
+ var RENDERERS, call51 = async (onDone, _context, args) => {
700816
700987
  if (isScreenReaderEnabled()) {
700817
700988
  onDone("Screen-reader mode always uses the classic renderer, so the tui setting has no effect while it is active.", { display: "system" });
700818
700989
  return null;
@@ -701127,9 +701298,9 @@ var init_terminalSetup2 = __esm(() => {
701127
701298
  // src/commands/usage/usage.tsx
701128
701299
  var exports_usage = {};
701129
701300
  __export(exports_usage, {
701130
- call: () => call51
701301
+ call: () => call52
701131
701302
  });
701132
- var jsx_runtime308, call51 = async (onDone, context8) => {
701303
+ var jsx_runtime308, call52 = async (onDone, context8) => {
701133
701304
  return /* @__PURE__ */ jsx_runtime308.jsx(Settings, {
701134
701305
  onClose: onDone,
701135
701306
  context: context8,
@@ -701144,9 +701315,9 @@ var init_usage3 = __esm(() => {
701144
701315
  // src/commands/usage/usage-noninteractive.ts
701145
701316
  var exports_usage_noninteractive = {};
701146
701317
  __export(exports_usage_noninteractive, {
701147
- call: () => call52
701318
+ call: () => call53
701148
701319
  });
701149
- var call52 = async () => {
701320
+ var call53 = async () => {
701150
701321
  const parts = [];
701151
701322
  parts.push(formatTotalCost());
701152
701323
  if (isClaudeAISubscriber()) {
@@ -701198,7 +701369,7 @@ var init_usage4 = __esm(() => {
701198
701369
  // src/commands/theme/theme.tsx
701199
701370
  var exports_theme = {};
701200
701371
  __export(exports_theme, {
701201
- call: () => call53
701372
+ call: () => call54
701202
701373
  });
701203
701374
  function ThemePickerCommand(t0) {
701204
701375
  const $4 = import_compiler_runtime224.c(8);
@@ -701249,7 +701420,7 @@ function ThemePickerCommand(t0) {
701249
701420
  }
701250
701421
  return t32;
701251
701422
  }
701252
- var import_compiler_runtime224, jsx_runtime309, call53 = async (onDone, _context) => {
701423
+ var import_compiler_runtime224, jsx_runtime309, call54 = async (onDone, _context) => {
701253
701424
  return /* @__PURE__ */ jsx_runtime309.jsx(ThemePickerCommand, {
701254
701425
  onDone
701255
701426
  });
@@ -701279,7 +701450,7 @@ var init_theme4 = __esm(() => {
701279
701450
  var exports_thinkback = {};
701280
701451
  __export(exports_thinkback, {
701281
701452
  playAnimation: () => playAnimation,
701282
- call: () => call54
701453
+ call: () => call55
701283
701454
  });
701284
701455
  import { readFile as readFile56 } from "fs/promises";
701285
701456
  import { join as join153 } from "path";
@@ -701816,7 +701987,7 @@ function ThinkbackFlow(t0) {
701816
701987
  }
701817
701988
  return t8;
701818
701989
  }
701819
- async function call54(onDone) {
701990
+ async function call55(onDone) {
701820
701991
  return /* @__PURE__ */ jsx_runtime310.jsx(ThinkbackFlow, {
701821
701992
  onDone
701822
701993
  });
@@ -701864,14 +702035,14 @@ var init_thinkback2 = __esm(() => {
701864
702035
  // src/commands/thinkback-play/thinkback-play.ts
701865
702036
  var exports_thinkback_play = {};
701866
702037
  __export(exports_thinkback_play, {
701867
- call: () => call55
702038
+ call: () => call56
701868
702039
  });
701869
702040
  import { join as join154 } from "path";
701870
702041
  function getPluginId2() {
701871
702042
  const marketplaceName = process.env.USER_TYPE === "ant" ? INTERNAL_MARKETPLACE_NAME : OFFICIAL_MARKETPLACE_NAME;
701872
702043
  return `thinkback@${marketplaceName}`;
701873
702044
  }
701874
- async function call55() {
702045
+ async function call56() {
701875
702046
  const v2Data = loadInstalledPluginsV2();
701876
702047
  const pluginId = getPluginId2();
701877
702048
  const installations = v2Data.plugins[pluginId];
@@ -704358,9 +704529,9 @@ var init_PermissionRuleList = __esm(() => {
704358
704529
  // src/commands/permissions/permissions.tsx
704359
704530
  var exports_permissions2 = {};
704360
704531
  __export(exports_permissions2, {
704361
- call: () => call56
704532
+ call: () => call57
704362
704533
  });
704363
- var jsx_runtime318, call56 = async (onDone, context8) => {
704534
+ var jsx_runtime318, call57 = async (onDone, context8) => {
704364
704535
  return /* @__PURE__ */ jsx_runtime318.jsx(PermissionRuleList, {
704365
704536
  onExit: onDone,
704366
704537
  onRetryDenials: (commands7) => {
@@ -704390,7 +704561,7 @@ var init_permissions4 = __esm(() => {
704390
704561
  // src/commands/plan/plan.tsx
704391
704562
  var exports_plan = {};
704392
704563
  __export(exports_plan, {
704393
- call: () => call57
704564
+ call: () => call58
704394
704565
  });
704395
704566
  function PlanDisplay(t0) {
704396
704567
  const $4 = import_compiler_runtime233.c(11);
@@ -704478,7 +704649,7 @@ function PlanDisplay(t0) {
704478
704649
  }
704479
704650
  return t5;
704480
704651
  }
704481
- async function call57(onDone, context8, args) {
704652
+ async function call58(onDone, context8, args) {
704482
704653
  const {
704483
704654
  getAppState,
704484
704655
  setAppState
@@ -704624,7 +704795,7 @@ var init_FastIcon = __esm(() => {
704624
704795
  // src/commands/fast/fast.tsx
704625
704796
  var exports_fast = {};
704626
704797
  __export(exports_fast, {
704627
- call: () => call58,
704798
+ call: () => call59,
704628
704799
  FastModePicker: () => FastModePicker
704629
704800
  });
704630
704801
  function applyFastMode(enable2, setAppState) {
@@ -704945,7 +705116,7 @@ async function handleFastModeShortcut(enable2, getAppState, setAppState) {
704945
705116
  return `Fast mode OFF`;
704946
705117
  }
704947
705118
  }
704948
- async function call58(onDone, context8, args) {
705119
+ async function call59(onDone, context8, args) {
704949
705120
  if (!isFastModeEnabled()) {
704950
705121
  return null;
704951
705122
  }
@@ -705264,9 +705435,9 @@ var init_Passes = __esm(() => {
705264
705435
  // src/commands/passes/passes.tsx
705265
705436
  var exports_passes = {};
705266
705437
  __export(exports_passes, {
705267
- call: () => call59
705438
+ call: () => call60
705268
705439
  });
705269
- async function call59(onDone) {
705440
+ async function call60(onDone) {
705270
705441
  const config8 = getGlobalConfig();
705271
705442
  const isFirstVisit = !config8.hasVisitedPasses;
705272
705443
  if (isFirstVisit) {
@@ -706038,9 +706209,9 @@ var init_Grove = __esm(() => {
706038
706209
  // src/commands/privacy-settings/privacy-settings.tsx
706039
706210
  var exports_privacy_settings = {};
706040
706211
  __export(exports_privacy_settings, {
706041
- call: () => call60
706212
+ call: () => call61
706042
706213
  });
706043
- async function call60(onDone) {
706214
+ async function call61(onDone) {
706044
706215
  const qualified = await isQualifiedForGrove();
706045
706216
  if (!qualified) {
706046
706217
  onDone(FALLBACK_MESSAGE);
@@ -707926,9 +708097,9 @@ var init_HooksConfigMenu = __esm(() => {
707926
708097
  // src/commands/hooks/hooks.tsx
707927
708098
  var exports_hooks = {};
707928
708099
  __export(exports_hooks, {
707929
- call: () => call61
708100
+ call: () => call62
707930
708101
  });
707931
- var jsx_runtime331, call61 = async (onDone, context8) => {
708102
+ var jsx_runtime331, call62 = async (onDone, context8) => {
707932
708103
  logEvent2("tengu_hooks_command", {});
707933
708104
  const appState = context8.getAppState();
707934
708105
  const permissionContext = appState.toolPermissionContext;
@@ -707961,10 +708132,10 @@ var init_hooks3 = __esm(() => {
707961
708132
  // src/commands/files/files.ts
707962
708133
  var exports_files2 = {};
707963
708134
  __export(exports_files2, {
707964
- call: () => call62
708135
+ call: () => call63
707965
708136
  });
707966
708137
  import { relative as relative30 } from "path";
707967
- async function call62(_args, context8) {
708138
+ async function call63(_args, context8) {
707968
708139
  const files2 = context8.readFileState ? cacheKeys(context8.readFileState) : [];
707969
708140
  if (files2.length === 0) {
707970
708141
  return { type: "text", value: "No files in context" };
@@ -707997,7 +708168,7 @@ var init_files5 = __esm(() => {
707997
708168
  var exports_branch = {};
707998
708169
  __export(exports_branch, {
707999
708170
  deriveFirstPrompt: () => deriveFirstPrompt,
708000
- call: () => call63
708171
+ call: () => call64
708001
708172
  });
708002
708173
  import { randomUUID as randomUUID37 } from "crypto";
708003
708174
  import { mkdir as mkdir46, readFile as readFile57, writeFile as writeFile50 } from "fs/promises";
@@ -708117,7 +708288,7 @@ async function getUniqueForkName(baseName) {
708117
708288
  }
708118
708289
  return `${baseName} (Branch ${nextNumber})`;
708119
708290
  }
708120
- async function call63(onDone, context8, args) {
708291
+ async function call64(onDone, context8, args) {
708121
708292
  const customTitle = args?.trim() || undefined;
708122
708293
  const originalSessionId = getSessionId();
708123
708294
  try {
@@ -708196,9 +708367,9 @@ var init_branch2 = __esm(() => {
708196
708367
  // src/commands/agents/agents.ts
708197
708368
  var exports_agents = {};
708198
708369
  __export(exports_agents, {
708199
- call: () => call64
708370
+ call: () => call65
708200
708371
  });
708201
- var call64 = async () => ({
708372
+ var call65 = async () => ({
708202
708373
  type: "text",
708203
708374
  value: `The /agents wizard has been removed.
708204
708375
  Ask Claude to create or update subagents for you (e.g. "create a code-reviewer subagent that ..."),
@@ -708224,9 +708395,9 @@ var init_agents = __esm(() => {
708224
708395
  // src/commands/plugin/plugin.tsx
708225
708396
  var exports_plugin = {};
708226
708397
  __export(exports_plugin, {
708227
- call: () => call65
708398
+ call: () => call66
708228
708399
  });
708229
- async function call65(onDone, _context, args) {
708400
+ async function call66(onDone, _context, args) {
708230
708401
  return /* @__PURE__ */ jsx_runtime332.jsx(PluginSettings, {
708231
708402
  onComplete: onDone,
708232
708403
  args
@@ -708773,12 +708944,12 @@ var init_refresh = __esm(() => {
708773
708944
  // src/commands/reload-plugins/reload-plugins.ts
708774
708945
  var exports_reload_plugins = {};
708775
708946
  __export(exports_reload_plugins, {
708776
- call: () => call66
708947
+ call: () => call67
708777
708948
  });
708778
708949
  function n5(count4, noun) {
708779
708950
  return `${count4} ${plural(count4, noun)}`;
708780
708951
  }
708781
- var call66 = async (_args, context8) => {
708952
+ var call67 = async (_args, context8) => {
708782
708953
  if (feature("DOWNLOAD_USER_SETTINGS") && (isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) || getIsRemoteMode())) {
708783
708954
  const applied = await redownloadUserSettings();
708784
708955
  if (applied) {
@@ -708836,9 +709007,9 @@ var init_resumeBeforeClear = __esm(() => {
708836
709007
  // src/commands/rewind/rewind.ts
708837
709008
  var exports_rewind = {};
708838
709009
  __export(exports_rewind, {
708839
- call: () => call67
709010
+ call: () => call68
708840
709011
  });
708841
- async function call67(_args, context8) {
709012
+ async function call68(_args, context8) {
708842
709013
  if (context8.openMessageSelector) {
708843
709014
  context8.openMessageSelector();
708844
709015
  }
@@ -709026,9 +709197,9 @@ var init_heapDumpService = __esm(() => {
709026
709197
  // src/commands/heapdump/heapdump.ts
709027
709198
  var exports_heapdump = {};
709028
709199
  __export(exports_heapdump, {
709029
- call: () => call68
709200
+ call: () => call69
709030
709201
  });
709031
- async function call68() {
709202
+ async function call69() {
709032
709203
  const result = await performHeapDump();
709033
709204
  if (!result.success) {
709034
709205
  return {
@@ -709399,7 +709570,7 @@ var USAGE = `/bridge-kick <subcommand>
709399
709570
  reconnect-session fail next POST /bridge/reconnect fails
709400
709571
  heartbeat <status> next heartbeat throws BridgeFatalError(status)
709401
709572
  reconnect call reconnectEnvironmentWithSession directly
709402
- status print bridge state`, call69 = async (args) => {
709573
+ status print bridge state`, call70 = async (args) => {
709403
709574
  const h5 = getBridgeDebugHandle();
709404
709575
  if (!h5) {
709405
709576
  return {
@@ -709532,13 +709703,13 @@ var init_bridge_kick = __esm(() => {
709532
709703
  description: "Inject bridge failure states for manual recovery testing",
709533
709704
  isEnabled: () => process.env.USER_TYPE === "ant",
709534
709705
  supportsNonInteractive: false,
709535
- load: () => Promise.resolve({ call: call69 })
709706
+ load: () => Promise.resolve({ call: call70 })
709536
709707
  };
709537
709708
  bridge_kick_default = bridgeKick;
709538
709709
  });
709539
709710
 
709540
709711
  // src/commands/version.ts
709541
- var call70 = async () => {
709712
+ var call71 = async () => {
709542
709713
  return {
709543
709714
  type: "text",
709544
709715
  value: MACRO.BUILD_TIME ? `${MACRO.VERSION} (built ${MACRO.BUILD_TIME})` : MACRO.VERSION
@@ -709551,7 +709722,7 @@ var init_version = __esm(() => {
709551
709722
  description: "Print the version this session is running (not what autoupdate downloaded)",
709552
709723
  isEnabled: () => process.env.USER_TYPE === "ant",
709553
709724
  supportsNonInteractive: true,
709554
- load: () => Promise.resolve({ call: call70 })
709725
+ load: () => Promise.resolve({ call: call71 })
709555
709726
  };
709556
709727
  version_default = version5;
709557
709728
  });
@@ -710711,10 +710882,10 @@ var init_SandboxSettings = __esm(() => {
710711
710882
  // src/commands/sandbox-toggle/sandbox-toggle.tsx
710712
710883
  var exports_sandbox_toggle = {};
710713
710884
  __export(exports_sandbox_toggle, {
710714
- call: () => call71
710885
+ call: () => call72
710715
710886
  });
710716
710887
  import { relative as relative31 } from "path";
710717
- async function call71(onDone, _context, args) {
710888
+ async function call72(onDone, _context, args) {
710718
710889
  const settings = getSettings_DEPRECATED();
710719
710890
  const themeName = settings.theme || "light";
710720
710891
  const platform6 = getPlatform();
@@ -711096,7 +711267,7 @@ var init_setup2 = __esm(() => {
711096
711267
  // src/commands/chrome/chrome.tsx
711097
711268
  var exports_chrome2 = {};
711098
711269
  __export(exports_chrome2, {
711099
- call: () => call72
711270
+ call: () => call73
711100
711271
  });
711101
711272
  function ClaudeInChromeMenu(t0) {
711102
711273
  const $4 = import_compiler_runtime246.c(41);
@@ -711463,7 +711634,7 @@ function _temp266(c9) {
711463
711634
  function _temp158(s4) {
711464
711635
  return s4.mcp.clients;
711465
711636
  }
711466
- var import_compiler_runtime246, import_react181, jsx_runtime338, CHROME_EXTENSION_URL = "https://claude.ai/chrome", CHROME_PERMISSIONS_URL = "https://clau.de/chrome/permissions", CHROME_RECONNECT_URL = "https://clau.de/chrome/reconnect", call72 = async function(onDone) {
711637
+ var import_compiler_runtime246, import_react181, jsx_runtime338, CHROME_EXTENSION_URL = "https://claude.ai/chrome", CHROME_PERMISSIONS_URL = "https://clau.de/chrome/permissions", CHROME_RECONNECT_URL = "https://clau.de/chrome/reconnect", call73 = async function(onDone) {
711467
711638
  const isExtensionInstalled = await isChromeExtensionInstalled();
711468
711639
  const config8 = getGlobalConfig();
711469
711640
  const isSubscriber2 = isClaudeAISubscriber();
@@ -711511,9 +711682,9 @@ var init_chrome3 = __esm(() => {
711511
711682
  // src/commands/stickers/stickers.ts
711512
711683
  var exports_stickers = {};
711513
711684
  __export(exports_stickers, {
711514
- call: () => call73
711685
+ call: () => call74
711515
711686
  });
711516
- async function call73() {
711687
+ async function call74() {
711517
711688
  const url3 = "https://www.stickermule.com/claudecode";
711518
711689
  const success2 = await openBrowser(url3);
711519
711690
  if (success2) {
@@ -711543,7 +711714,7 @@ var init_stickers2 = __esm(() => {
711543
711714
  });
711544
711715
 
711545
711716
  // src/commands/advisor.ts
711546
- var call74 = async (args, context8) => {
711717
+ var call75 = async (args, context8) => {
711547
711718
  const arg = args.trim().toLowerCase();
711548
711719
  const baseModel = parseUserSpecifiedModel(context8.getAppState().mainLoopModel ?? getDefaultMainLoopModelSetting());
711549
711720
  if (!arg) {
@@ -711636,7 +711807,7 @@ var init_advisor2 = __esm(() => {
711636
711807
  return !canUserConfigureAdvisor();
711637
711808
  },
711638
711809
  supportsNonInteractive: true,
711639
- load: () => Promise.resolve({ call: call74 })
711810
+ load: () => Promise.resolve({ call: call75 })
711640
711811
  };
711641
711812
  advisor_default = advisor;
711642
711813
  });
@@ -712052,13 +712223,13 @@ var init_ExitFlow = __esm(() => {
712052
712223
  // src/commands/exit/exit.tsx
712053
712224
  var exports_exit = {};
712054
712225
  __export(exports_exit, {
712055
- call: () => call75
712226
+ call: () => call76
712056
712227
  });
712057
712228
  import { spawnSync as spawnSync11 } from "child_process";
712058
712229
  function getRandomGoodbyeMessage2() {
712059
712230
  return sample_default(GOODBYE_MESSAGES2) ?? "Goodbye!";
712060
712231
  }
712061
- async function call75(onDone) {
712232
+ async function call76(onDone) {
712062
712233
  if (feature("BG_SESSIONS") && isBgSession()) {
712063
712234
  onDone();
712064
712235
  spawnSync11("tmux", ["detach-client"], {
@@ -712361,7 +712532,7 @@ __export(exports_export, {
712361
712532
  sanitizeFilename: () => sanitizeFilename,
712362
712533
  resolveExportFilepath: () => resolveExportFilepath,
712363
712534
  extractFirstPrompt: () => extractFirstPrompt,
712364
- call: () => call76
712535
+ call: () => call77
712365
712536
  });
712366
712537
  import { dirname as dirname70 } from "path";
712367
712538
  import { mkdirSync as mkdirSync12 } from "fs";
@@ -712408,7 +712579,7 @@ async function exportWithReactRenderer(context8) {
712408
712579
  const tools = context8.options.tools || [];
712409
712580
  return renderMessagesToPlainText(context8.messages, tools);
712410
712581
  }
712411
- async function call76(onDone, context8, args) {
712582
+ async function call77(onDone, context8, args) {
712412
712583
  const content = await exportWithReactRenderer(context8);
712413
712584
  const filename = args.trim();
712414
712585
  if (filename) {
@@ -712468,7 +712639,7 @@ var init_export2 = __esm(() => {
712468
712639
  // src/commands/model/model.tsx
712469
712640
  var exports_model2 = {};
712470
712641
  __export(exports_model2, {
712471
- call: () => call77
712642
+ call: () => call78
712472
712643
  });
712473
712644
  function ModelPickerWrapper({ onDone }) {
712474
712645
  const mainLoopModel = useAppState((s4) => s4.mainLoopModel);
@@ -712702,7 +712873,7 @@ function renderModelLabel(model) {
712702
712873
  const rendered = renderDefaultModelSetting(model ?? getDefaultMainLoopModelSetting());
712703
712874
  return model === null ? `${rendered} (default)` : rendered;
712704
712875
  }
712705
- var React106, jsx_runtime345, MODEL_PICKER_PIN_HEADER = "Switch between Claude models. Your pick becomes the default for new sessions. For other/previous model names, specify with --model.", call77 = async (onDone, _context, args) => {
712876
+ var React106, jsx_runtime345, MODEL_PICKER_PIN_HEADER = "Switch between Claude models. Your pick becomes the default for new sessions. For other/previous model names, specify with --model.", call78 = async (onDone, _context, args) => {
712706
712877
  args = args?.trim() || "";
712707
712878
  if (COMMON_INFO_ARGS.includes(args)) {
712708
712879
  logEvent2("tengu_model_command_inline_help", {
@@ -713268,9 +713439,9 @@ var init_RemoteEnvironmentDialog = __esm(() => {
713268
713439
  // src/commands/remote-env/remote-env.tsx
713269
713440
  var exports_remote_env = {};
713270
713441
  __export(exports_remote_env, {
713271
- call: () => call78
713442
+ call: () => call79
713272
713443
  });
713273
- async function call78(onDone) {
713444
+ async function call79(onDone) {
713274
713445
  return /* @__PURE__ */ jsx_runtime347.jsx(RemoteEnvironmentDialog, {
713275
713446
  onDone
713276
713447
  });
@@ -713301,9 +713472,9 @@ var init_remote_env2 = __esm(() => {
713301
713472
  // src/commands/upgrade/upgrade.tsx
713302
713473
  var exports_upgrade = {};
713303
713474
  __export(exports_upgrade, {
713304
- call: () => call79
713475
+ call: () => call80
713305
713476
  });
713306
- async function call79(onDone, context8) {
713477
+ async function call80(onDone, context8) {
713307
713478
  try {
713308
713479
  if (isClaudeAISubscriber()) {
713309
713480
  const tokens = getClaudeAIOAuthTokens();
@@ -713396,7 +713567,7 @@ var init_usage_credits2 = __esm(() => {
713396
713567
  // src/commands/rate-limit-options/rate-limit-options.tsx
713397
713568
  var exports_rate_limit_options = {};
713398
713569
  __export(exports_rate_limit_options, {
713399
- call: () => call80
713570
+ call: () => call81
713400
713571
  });
713401
713572
  function RateLimitOptionsMenu(t0) {
713402
713573
  const $4 = import_compiler_runtime249.c(25);
@@ -713530,7 +713701,7 @@ function RateLimitOptionsMenu(t0) {
713530
713701
  t5 = function handleSelect2(value) {
713531
713702
  if (value === "upgrade") {
713532
713703
  logEvent2("tengu_rate_limit_options_menu_select_upgrade", {});
713533
- call79(onDone, context8).then((jsx346) => {
713704
+ call80(onDone, context8).then((jsx346) => {
713534
713705
  if (jsx346) {
713535
713706
  setSubCommandJSX(jsx346);
713536
713707
  }
@@ -713590,7 +713761,7 @@ function RateLimitOptionsMenu(t0) {
713590
713761
  }
713591
713762
  return t7;
713592
713763
  }
713593
- async function call80(onDone, context8) {
713764
+ async function call81(onDone, context8) {
713594
713765
  return /* @__PURE__ */ jsx_runtime349.jsx(RateLimitOptionsMenu, {
713595
713766
  onDone,
713596
713767
  context: context8
@@ -713664,7 +713835,7 @@ var exports_effort = {};
713664
713835
  __export(exports_effort, {
713665
713836
  showCurrentEffort: () => showCurrentEffort,
713666
713837
  executeEffort: () => executeEffort,
713667
- call: () => call81
713838
+ call: () => call82
713668
713839
  });
713669
713840
  function setEffortValue(effortValue) {
713670
713841
  const persistable = toPersistableEffort(effortValue);
@@ -713836,7 +714007,7 @@ function ApplyEffortAndClose(t0) {
713836
714007
  React108.useEffect(t1, t22);
713837
714008
  return null;
713838
714009
  }
713839
- async function call81(onDone, _context, args) {
714010
+ async function call82(onDone, _context, args) {
713840
714011
  args = args?.trim() || "";
713841
714012
  if (COMMON_HELP_ARGS2.includes(args)) {
713842
714013
  onDone(`Usage: /effort [low|medium|high|max|ultracode|auto]
@@ -713949,7 +714120,7 @@ var init_team_onboarding = __esm(() => {
713949
714120
  });
713950
714121
 
713951
714122
  // src/commands/setup-bedrock.ts
713952
- var DEFAULT_REGION = "us-east-1", call82 = async (args) => {
714123
+ var DEFAULT_REGION = "us-east-1", call83 = async (args) => {
713953
714124
  const parts = args.trim().split(/\s+/).filter(Boolean);
713954
714125
  const region = parts[0] || DEFAULT_REGION;
713955
714126
  const model = parts[1];
@@ -713988,13 +714159,13 @@ var init_setup_bedrock = __esm(() => {
713988
714159
  description: "Configure AWS Bedrock as the API provider",
713989
714160
  argumentHint: "[aws-region] [model]",
713990
714161
  supportsNonInteractive: true,
713991
- load: () => Promise.resolve({ call: call82 })
714162
+ load: () => Promise.resolve({ call: call83 })
713992
714163
  };
713993
714164
  setup_bedrock_default = setupBedrock;
713994
714165
  });
713995
714166
 
713996
714167
  // src/commands/setup-vertex.ts
713997
- var DEFAULT_REGION2 = "us-east5", call83 = async (args) => {
714168
+ var DEFAULT_REGION2 = "us-east5", call84 = async (args) => {
713998
714169
  const parts = args.trim().split(/\s+/).filter(Boolean);
713999
714170
  const projectId = parts[0];
714000
714171
  const region = parts[1] || DEFAULT_REGION2;
@@ -714042,7 +714213,7 @@ var init_setup_vertex = __esm(() => {
714042
714213
  description: "Configure Google Vertex AI as the API provider",
714043
714214
  argumentHint: "[gcp-project-id] [region] [model]",
714044
714215
  supportsNonInteractive: true,
714045
- load: () => Promise.resolve({ call: call83 })
714216
+ load: () => Promise.resolve({ call: call84 })
714046
714217
  };
714047
714218
  setup_vertex_default = setupVertex;
714048
714219
  });
@@ -714636,7 +714807,7 @@ var init_assistant2 = () => {};
714636
714807
  // src/commands/bridge/bridge.tsx
714637
714808
  var exports_bridge = {};
714638
714809
  __export(exports_bridge, {
714639
- call: () => call84
714810
+ call: () => call85
714640
714811
  });
714641
714812
  function BridgeToggle(t0) {
714642
714813
  const $4 = import_compiler_runtime253.c(10);
@@ -715140,7 +715311,7 @@ async function checkBridgePrerequisites() {
715140
715311
  logForDebugging("[bridge] Prerequisites passed, enabling bridge");
715141
715312
  return null;
715142
715313
  }
715143
- async function call84(onDone, _context, args) {
715314
+ async function call85(onDone, _context, args) {
715144
715315
  const name3 = args.trim() || undefined;
715145
715316
  return /* @__PURE__ */ jsx_runtime354.jsx(BridgeToggle, {
715146
715317
  onDone,
@@ -715948,9 +716119,9 @@ var init_useVoice = __esm(() => {
715948
716119
  // src/commands/voice/voice.ts
715949
716120
  var exports_voice3 = {};
715950
716121
  __export(exports_voice3, {
715951
- call: () => call85
716122
+ call: () => call86
715952
716123
  });
715953
- var LANG_HINT_MAX_SHOWS = 2, call85 = async () => {
716124
+ var LANG_HINT_MAX_SHOWS = 2, call86 = async () => {
715954
716125
  if (!isVoiceModeEnabled()) {
715955
716126
  if (!isAnthropicAuthEnabled()) {
715956
716127
  return {
@@ -716675,9 +716846,9 @@ var init_WorkflowDetailDialog2 = __esm(() => {
716675
716846
  // src/commands/workflows/workflows.tsx
716676
716847
  var exports_workflows = {};
716677
716848
  __export(exports_workflows, {
716678
- call: () => call86
716849
+ call: () => call87
716679
716850
  });
716680
- var jsx_runtime356, call86 = (onDone, _context, _args) => {
716851
+ var jsx_runtime356, call87 = (onDone, _context, _args) => {
716681
716852
  logEvent2("workflow_history_dialog", {});
716682
716853
  return Promise.resolve(/* @__PURE__ */ jsx_runtime356.jsx(WorkflowDetailDialog3, {
716683
716854
  onDone
@@ -716856,7 +717027,7 @@ var init_api5 = __esm(() => {
716856
717027
  // src/commands/remote-setup/remote-setup.tsx
716857
717028
  var exports_remote_setup = {};
716858
717029
  __export(exports_remote_setup, {
716859
- call: () => call87
717030
+ call: () => call88
716860
717031
  });
716861
717032
  async function checkLoginState() {
716862
717033
  if (!await isSignedIn()) {
@@ -717016,7 +717187,7 @@ function Web({
717016
717187
  ]
717017
717188
  });
717018
717189
  }
717019
- async function call87(onDone) {
717190
+ async function call88(onDone) {
717020
717191
  return /* @__PURE__ */ jsx_runtime357.jsx(Web, {
717021
717192
  onDone
717022
717193
  });
@@ -717194,10 +717365,10 @@ var init_confirmation = __esm(() => {
717194
717365
  // src/commands/fork/fork.ts
717195
717366
  var exports_fork = {};
717196
717367
  __export(exports_fork, {
717197
- call: () => call88
717368
+ call: () => call89
717198
717369
  });
717199
717370
  import { randomUUID as randomUUID38 } from "crypto";
717200
- var call88 = async (onDone, context8, args) => {
717371
+ var call89 = async (onDone, context8, args) => {
717201
717372
  const directive = (args ?? "").trim();
717202
717373
  if (!directive) {
717203
717374
  onDone("Usage: /fork <directive>", { display: "system" });
@@ -719691,6 +719862,7 @@ var init_commands5 = __esm(() => {
719691
719862
  init_tasks4();
719692
719863
  init_teleport2();
719693
719864
  init_autocompact2();
719865
+ init_autocompact_noninteractive();
719694
719866
  init_cd2();
719695
719867
  init_focus3();
719696
719868
  init_powerup2();
@@ -719824,6 +719996,7 @@ var init_commands5 = __esm(() => {
719824
719996
  advisor_default,
719825
719997
  agents_default,
719826
719998
  autocompact_default,
719999
+ autocompactNonInteractive,
719827
720000
  autofix_pr_default,
719828
720001
  background_default,
719829
720002
  branch_default,
@@ -725529,7 +725702,7 @@ Your response must be a JSON object matching one of the following schemas:
725529
725702
  blockingError: `Prompt hook condition was not met: ${parsed.data.reason}`,
725530
725703
  command: hook.prompt
725531
725704
  },
725532
- preventContinuation: hook.continueOnBlock !== true,
725705
+ preventContinuation: hookEvent !== "Stop" && hookEvent !== "SubagentStop" && hook.continueOnBlock !== true,
725533
725706
  stopReason: parsed.data.reason
725534
725707
  };
725535
725708
  }
@@ -823850,6 +824023,7 @@ async function run() {
823850
824023
  return !["false", "0", "no", "off"].includes(raw);
823851
824024
  })).addOption(new Option("--exclude-dynamic-system-prompt-sections", "Move per-machine sections (cwd, env info, memory paths, git status) from the system prompt into the first user message. Improves cross-user prompt-cache reuse. Only applies with the default system prompt (ignored with --system-prompt).").default(false)).option("--plugin-url <url>", "Fetch a plugin .zip from a URL for this session only (repeatable: --plugin-url A --plugin-url B)", (val, prev) => [...prev, val], []).option("--bg, --background", "Start the session as a background agent. OCC note: background sessions are managed via the `daemon` and `agents` subcommands (e.g. `occ daemon start`, `occ agents`, `occ attach <id>`) \u2014 see `occ daemon --help`. This flag is accepted for CLI compatibility but does not start a foreground REPL.").option("--plugin-dir <path>", "Load plugins from a directory for this session only (repeatable: --plugin-dir A --plugin-dir B)", (val, prev) => [...prev, val], []).option("--disable-slash-commands", "Disable all skills", () => true).option("--chrome", "Enable Claude in Chrome integration").option("--no-chrome", "Disable Claude in Chrome integration").option("--file <specs...>", "File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)").action(async (prompt, options) => {
823852
824025
  profileCheckpoint("action_handler_start");
824026
+ setSessionAutoCompactWindow(resolveAutoCompactWindowOverride(options.autocompact));
823853
824027
  const bgFlag = options.bg || options.background;
823854
824028
  if (bgFlag) {
823855
824029
  console.error("Error: OCC manages background sessions via the `daemon` and `agents` subcommands, not the `--bg` flag.\n Start a background daemon: `occ daemon start`\n View background sessions: `occ agents`\n Resume a background session: `occ attach <id>`\n See `occ daemon --help` and `occ agents --help`.");
@@ -825925,6 +826099,13 @@ Usage: occ --remote "your task description"`, () => gracefulShutdown(1));
825925
826099
  if (canUserConfigureAdvisor()) {
825926
826100
  program3.addOption(new Option("--advisor <model>", "Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp());
825927
826101
  }
826102
+ program3.addOption(new Option("--autocompact <auto|tokens>", "Auto-compact window size (auto, or 100k\u20131M tokens)").argParser((value) => {
826103
+ const parsed = parseAutoCompactWindowInput(value);
826104
+ if (parsed === undefined) {
826105
+ throw new InvalidArgumentError("It must be 'auto', or between 100k and 1M (e.g. 500k, 200000, or 200 as shorthand)");
826106
+ }
826107
+ return parsed;
826108
+ }));
825928
826109
  if (false) {}
825929
826110
  if (feature("TRANSCRIPT_CLASSIFIER")) {
825930
826111
  program3.addOption(new Option("--enable-auto-mode", "Opt in to auto mode").hideHelp());
@@ -826594,6 +826775,7 @@ var init_main7 = __esm(() => {
826594
826775
  init_asciicast();
826595
826776
  init_auth6();
826596
826777
  init_config4();
826778
+ init_autoCompactWindow();
826597
826779
  init_earlyInput();
826598
826780
  init_effort();
826599
826781
  init_fastMode();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnwenf/occ",
3
- "version": "2.1.294",
3
+ "version": "2.1.296",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {