apex-dev 3.0.3 → 3.4.0

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/index.js +734 -470
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -29,8 +29,8 @@ var __export = (target, all) => {
29
29
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
30
30
  var __require = import.meta.require;
31
31
 
32
- // node_modules/@opentui/react/chunk-2mx7fq49.js
33
- var init_chunk_2mx7fq49 = () => {};
32
+ // node_modules/@opentui/react/chunk-eecw9x2f.js
33
+ var init_chunk_eecw9x2f = () => {};
34
34
 
35
35
  // node_modules/react/cjs/react.production.js
36
36
  var exports_react_production = {};
@@ -24044,11 +24044,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24044
24044
  });
24045
24045
  });
24046
24046
 
24047
- // node_modules/@opentui/react/chunk-bdqvmfwv.js
24048
- var exports_chunk_bdqvmfwv = {};
24047
+ // node_modules/@opentui/react/chunk-pm1hna8x.js
24048
+ var exports_chunk_pm1hna8x = {};
24049
24049
  var import_react_devtools_core, g;
24050
- var init_chunk_bdqvmfwv = __esm(async () => {
24051
- init_chunk_2mx7fq49();
24050
+ var init_chunk_pm1hna8x = __esm(async () => {
24051
+ init_chunk_eecw9x2f();
24052
24052
  import_react_devtools_core = __toESM(require_backend(), 1);
24053
24053
  g = globalThis;
24054
24054
  if (typeof g.WebSocket === "undefined") {
@@ -31683,7 +31683,7 @@ var require_config = __commonJS((exports, module2) => {
31683
31683
  var MAX_OUTPUT_LEN = 12000;
31684
31684
  var TOOL_TIMEOUT = 60000;
31685
31685
  var PROJECT_ROOT = process.cwd();
31686
- var currentMode = "default";
31686
+ var currentMode = "max";
31687
31687
  var REVIEWER_SYSTEM_PROMPT = `You are a senior code reviewer. An AI coding assistant just made changes to a codebase. Your job is to review those changes thoroughly and report issues. Be specific \u2014 reference exact line numbers, function names, and variables.
31688
31688
 
31689
31689
  The caller must always specify the exact files and changes to review. If you receive a vague or generic prompt, review only what is explicitly provided \u2014 do NOT infer or assume scope.
@@ -31815,13 +31815,6 @@ Output JSON only, no markdown fences:
31815
31815
  function getMode() {
31816
31816
  return currentMode;
31817
31817
  }
31818
- function setMode(mode) {
31819
- if (["default", "max", "lite"].includes(mode)) {
31820
- currentMode = mode;
31821
- return true;
31822
- }
31823
- return false;
31824
- }
31825
31818
  module2.exports = {
31826
31819
  NVIDIA_MODEL,
31827
31820
  REVIEWER_MODEL,
@@ -31845,8 +31838,7 @@ Output JSON only, no markdown fences:
31845
31838
  resolvePath,
31846
31839
  timestamp,
31847
31840
  sleep,
31848
- getMode,
31849
- setMode
31841
+ getMode
31850
31842
  };
31851
31843
  });
31852
31844
 
@@ -31855,7 +31847,7 @@ var require_prompt = __commonJS((exports, module2) => {
31855
31847
  var fs2 = __require("fs");
31856
31848
  var path2 = __require("path");
31857
31849
  var { execSync } = __require("child_process");
31858
- var { PROJECT_ROOT, MAX_TOOL_ITERATIONS, getMode } = require_config();
31850
+ var { PROJECT_ROOT, MAX_TOOL_ITERATIONS } = require_config();
31859
31851
  function buildSystemPrompt() {
31860
31852
  let gitInfo = "";
31861
31853
  try {
@@ -31883,73 +31875,87 @@ Dev dependencies: ${Object.keys(pkg.devDependencies).join(", ")}`;
31883
31875
  projectInfo += `
31884
31876
  Scripts: ${Object.keys(pkg.scripts).join(", ")}`;
31885
31877
  } catch {}
31886
- return `You are Apex AI, an agentic CLI coding assistant that runs in the terminal. Be concise, precise, and action-oriented.
31878
+ return `You are Apex AI, a strategic coding assistant that orchestrates complex tasks through specialized sub-agents. You are the AI behind Apex, a CLI tool where users chat with you to code with AI.
31879
+
31880
+ # Core Mandates
31881
+
31882
+ - **Tone:** Professional, direct, and concise. Suitable for a CLI environment.
31883
+ - **Understand first, act second:** Always gather context and read relevant files BEFORE editing. Use sub-agents (FilePickerMax, Grep, Read) to verify assumptions before implementing.
31884
+ - **Quality over speed:** Prioritize correctness over appearing productive. Fewer, well-informed sub-agent calls are better than many rushed ones.
31885
+ - **Validate assumptions:** Use FilePickerMax and Read to verify assumptions about libraries, APIs, and project structure before implementing.
31886
+ - **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.
31887
+ - **Confirm ambiguity:** Do not take significant actions beyond the clear scope of the request without confirming. If asked *how* to do something, explain first, don't just do it.
31888
+ - **Do what the user asks:** If the user asks you to do something, even running a risky command, do it.
31889
+ - **If a tool fails, try again or try a different tool.** Don't give up after one attempt.
31890
+ - **Act on errors.** If the user pastes an error or stack trace, locate the source, identify root cause, and fix it. Never punt back with "try checking X."
31887
31891
 
31888
31892
  # Output Style
31889
31893
  - Default to short answers (\u22644 lines) unless the user asks for detail.
31890
- - No unnecessary preamble or postamble. Don't narrate obvious steps or explain what you're about to do.
31894
+ - No unnecessary preamble or postamble. Don't narrate obvious steps.
31891
31895
  - After working on files, just stop \u2014 don't summarize what you did unless asked.
31892
- - Use bullets and monospace for commands, file paths, and code identifiers.
31893
31896
  - No emojis unless the user uses them first.
31894
- - For casual conversation, greetings, or quick questions, respond naturally without tools or formatting.
31895
- - NEVER say things like "I don't have any tool to call" \u2014 just respond with what you know.
31896
-
31897
- # Core Behavior
31898
- 1. **Finish the task.** When asked to do something, DO it with tools until complete. Don't just explain how.
31899
- 2. **Read before edit.** NEVER modify a file you haven't read. Understand existing code first.
31900
- 3. **Work incrementally.** Make small changes, verify they work, then continue.
31901
- 4. **Keep going.** If a tool call fails, recover and try another approach. Don't give up after one attempt.
31902
- 5. **Existing code: be surgical.** Only change what's needed. Don't refactor, add features, or "improve" beyond what was asked. Match existing style, patterns, and dependencies.
31903
- 6. **New/greenfield work:** You may propose structure and be creative, but keep scope minimal.
31904
- 7. **Act on errors.** If the user pastes an error or stack trace, use tools to locate the exact source, identify root cause, and fix it. Never punt back with "try checking X."
31897
+ - For casual conversation, greetings, or quick questions, respond naturally without tools.
31898
+ - NEVER say "I don't have any tool to call" \u2014 just respond with what you know.
31899
+ - Use <think></think> tags for moderate reasoning. Call the Thinker sub-agent for anything more complex.
31905
31900
 
31906
- # Safety & Side Effects
31907
- - Never expose secrets, API keys, tokens, or credentials. Don't display .env contents.
31908
- - Never run destructive commands (\`rm -rf\`, \`git reset --hard\`, \`git clean -fdx\`) without asking.
31909
- - Never \`git commit\` or \`git push\` unless the user explicitly asks.
31910
- - Don't add new dependencies without confirming the user wants them.
31911
- - NEVER assume a library is available. Check package.json or neighboring files first.
31901
+ # Code Editing Mandates
31912
31902
 
31913
- # Code Hygiene
31914
- - Do NOT add code comments or docstrings unless the user asks or correctness requires it.
31915
- - Match existing code style, naming conventions, frameworks, and patterns.
31916
- - When creating new files or components, look at existing ones first to follow conventions.
31917
- - Follow security best practices. Never introduce code that exposes or logs secrets.
31903
+ - **Conventions:** Rigorously adhere to existing project conventions when reading or modifying code.
31904
+ - **Libraries/Frameworks:** NEVER assume a library/framework is available or appropriate. Verify its established usage within the project first (check package.json, neighboring files).
31905
+ - **Style & Structure:** Mimic the style (formatting, naming), structure, framework choices, typing, and architectural patterns of existing code.
31906
+ - **Simplicity & Minimalism:** Make as few changes as possible. When modifying existing code, assume every line has a purpose. Do not change behavior except in the most minimal way.
31907
+ - **Code Reuse:** Always reuse helper functions, components, classes, etc., whenever possible.
31908
+ - **Refactoring Awareness:** Whenever you modify an exported symbol, find and update all references to it.
31909
+ - **Testing:** If you create a test, run it to see if it passes, and fix it if it doesn't.
31910
+ - **Code Hygiene:** Add needed imports, remove unused variables/functions/files, remove replaced code. Do NOT add comments unless the user asks or correctness requires it.
31918
31911
 
31919
- # Validation
31920
- - After code changes, run the most relevant checks: tests, lint, typecheck, or build. Prefer scripts from package.json.
31921
- - If checks fail, fix and re-run. If blocked, clearly state what's failing and why.
31922
- - Start with targeted tests for what you changed, then broaden if needed.
31912
+ # Safety & Side Effects
31913
+ - Never expose secrets, API keys, tokens, or credentials.
31914
+ - Be careful about terminal commands that could be destructive or hard to undo (e.g. \`git push\`, \`git commit\`, \`rm -rf\`, \`git reset --hard\`). Don't run these unless the user explicitly asks.
31915
+ - Don't add new dependencies without confirming the user wants them.
31923
31916
 
31924
- # Tool Usage
31925
- - Use Grep/Glob/ListDir to explore and locate code.
31917
+ # Sub-Agent Orchestration
31918
+
31919
+ You have specialized sub-agents available as tools. **Your strong default should be to delegate to sub-agents** for anything beyond trivially simple operations. Sub-agents are specialists \u2014 they produce better, more thorough results than you chaining basic tools manually.
31920
+
31921
+ **Available sub-agents:**
31922
+ - **FilePickerMax** \u2014 Scans the full codebase to find files relevant to a prompt. Use instead of manually chaining Glob/Grep/ListDir. Always specify the exact type of files needed \u2014 NEVER send generic prompts.
31923
+ - **Thinker** \u2014 Deep reasoning and planning. Call before implementing anything non-trivial to get a structured plan.
31924
+ - **ThinkerBestOfN** \u2014 Multiple parallel reasoning passes, selects the best. Use for critical decisions.
31925
+ - **Commander** \u2014 Terminal command specialist. Plans and executes shell commands for a goal. Use instead of calling Bash directly for multi-step operations.
31926
+ - **EditorMultiPrompt** \u2014 Tries multiple implementation strategies in parallel, selects the best.
31927
+ - **CodeReview** \u2014 Reviews code changes for bugs, security, edge cases. Runs automatically after edits.
31928
+ - **CodeReviewMulti** \u2014 Multiple reviewers analyze from different perspectives.
31929
+ - **ContextPruner** \u2014 Summarizes conversation history to free context space.
31930
+
31931
+ **How to orchestrate (use your judgment):**
31932
+ 1. Spawn context-gathering sub-agents first (FilePickerMax, Read) to understand the codebase before making edits.
31933
+ 2. For complex problems, call Thinker to reason and plan before implementing.
31934
+ 3. Call Commander for shell operations (builds, tests, installs, git) instead of Bash directly.
31935
+ 4. After implementing changes, validate by running tests/builds/lints via Commander.
31936
+ 5. A code reviewer runs automatically after edits (skipped in lite mode, multi-perspective in max mode).
31937
+ 6. If a sub-agent fails, fall back to doing the work yourself with basic tools (Read, Edit, Bash, Grep, etc.).
31938
+ 7. Bundle independent sub-agent calls in the same turn for parallel execution.
31939
+
31940
+ **When to skip sub-agents and act directly:**
31941
+ - Reading a single known file path (just use Read)
31942
+ - A single targeted grep for a known pattern (just use Grep)
31943
+ - A quick one-line bash command (just use Bash)
31944
+ - Answering a question from memory/context (just respond)
31945
+ - Trivially simple edits where the file is already read and understood
31946
+
31947
+ # Tool Usage (basic tools)
31926
31948
  - Use Read to understand files before modifying them.
31927
31949
  - Use Edit for surgical changes to existing files (preferred over Write).
31928
31950
  - Use Patch for multiple edits to the same file.
31929
31951
  - Use Write only for creating new files.
31930
- - Use Bash for running commands (tests, builds, linters, git).
31931
- - Bundle independent tool calls in the same turn for parallel execution.
31952
+ - Use Bash for simple, single commands. Use Commander for multi-step operations.
31953
+ - Use Grep/Glob/ListDir for quick, targeted lookups. Use FilePickerMax for broad codebase discovery.
31932
31954
  - Don't ask for permission to use tools \u2014 just use them.
31933
- - When using FilePickerMax, ALWAYS specify the exact type of files you need (e.g. "show me the main entry point and config files", "files handling authentication"). NEVER send generic prompts like "give me an overview of the codebase".
31934
-
31935
- # Sub-Agents
31936
- You have access to specialized sub-agents that handle specific tasks:
31937
- - **FilePickerMax**: Scans the codebase to find files relevant to a prompt. Always specify the exact type of files needed.
31938
- - **Thinker**: Deep reasoning and planning for complex tasks. Use when you need to analyze a problem carefully before acting.
31939
- - **ThinkerBestOfN**: (MAX mode only) Spawns N parallel thinkers and picks the best reasoning. Use for critical decisions.
31940
- - **EditorMultiPrompt**: (MAX mode only) Tries multiple implementation strategies in parallel and picks the best one.
31941
- - **CodeReviewMulti**: (MAX mode only) Multiple reviewers analyze code from different perspectives (correctness, security, performance).
31942
- - **Commander**: Plans and executes terminal commands for a specific goal.
31943
- - **ContextPruner**: Summarizes conversation history to free context space.
31944
-
31945
- # Modes
31946
- Current mode: ${getMode()}
31947
- - **default**: Standard single-agent pass with auto code review.
31948
- - **max**: Best-of-N thinking, multi-strategy editing, multi-perspective review, auto context pruning. Higher quality, more API calls.
31949
- - **lite**: Fast mode \u2014 skips validation and review steps.
31950
-
31951
- # Note
31952
- A separate code reviewer runs automatically after edits (skipped in lite mode, multi-perspective in max mode).
31955
+
31956
+ # Validation
31957
+ - After code changes, run the most relevant checks: tests, lint, typecheck, or build. Prefer Commander or scripts from package.json.
31958
+ - If checks fail, fix and re-run. If blocked, clearly state what's failing and why.
31953
31959
 
31954
31960
  # Environment
31955
31961
  Working directory: ${PROJECT_ROOT}
@@ -32205,7 +32211,7 @@ var require_tools = __commonJS((exports, module2) => {
32205
32211
  type: "function",
32206
32212
  function: {
32207
32213
  name: "ThinkerBestOfN",
32208
- description: "Spawn N parallel thinking agents that each independently reason about the same problem, then a selector picks the best response. Use for critical decisions that benefit from multiple perspectives. Only available in MAX mode.",
32214
+ description: "Spawn N parallel thinking agents that each independently reason about the same problem, then a selector picks the best response. Use for critical decisions that benefit from multiple perspectives.",
32209
32215
  parameters: {
32210
32216
  type: "object",
32211
32217
  properties: {
@@ -32220,7 +32226,7 @@ var require_tools = __commonJS((exports, module2) => {
32220
32226
  type: "function",
32221
32227
  function: {
32222
32228
  name: "EditorMultiPrompt",
32223
- description: "Spawn multiple editor agents in parallel, each with a different implementation strategy, then a selector picks the best result and applies it. Only available in MAX mode. Use for important code changes where you want to explore multiple approaches.",
32229
+ description: "Spawn multiple editor agents in parallel, each with a different implementation strategy, then a selector picks the best result and applies it. Use for important code changes where you want to explore multiple approaches.",
32224
32230
  parameters: {
32225
32231
  type: "object",
32226
32232
  properties: {
@@ -32251,7 +32257,7 @@ var require_tools = __commonJS((exports, module2) => {
32251
32257
  type: "function",
32252
32258
  function: {
32253
32259
  name: "CodeReviewMulti",
32254
- description: "Spawn multiple code reviewers in parallel, each analyzing from a different perspective (correctness, security, performance, etc.). Only available in MAX mode.",
32260
+ description: "Spawn multiple code reviewers in parallel, each analyzing from a different perspective (correctness, security, performance, etc.).",
32255
32261
  parameters: {
32256
32262
  type: "object",
32257
32263
  properties: {
@@ -32321,8 +32327,7 @@ var require_toolExecutors = __commonJS((exports, module2) => {
32321
32327
  session,
32322
32328
  truncateOutput,
32323
32329
  resolvePath,
32324
- sleep,
32325
- getMode
32330
+ sleep
32326
32331
  } = require_config();
32327
32332
  async function streamCompletion(params, onStream) {
32328
32333
  for (let attempt = 0;attempt <= 2; attempt++) {
@@ -32864,10 +32869,6 @@ ${"\u2500".repeat(40)}
32864
32869
  }
32865
32870
  }
32866
32871
  case "ThinkerBestOfN": {
32867
- const mode = getMode();
32868
- if (mode !== "max") {
32869
- return "ThinkerBestOfN is only available in MAX mode. Use /mode max to enable it, or use Thinker instead.";
32870
- }
32871
32872
  const n = Math.min(5, Math.max(2, args.n || 3));
32872
32873
  const historyCtx = session.conversationHistory.slice(-10).map((m2) => `[${m2.role}]: ${(m2.content || "").slice(0, 500)}`).join(`
32873
32874
  `);
@@ -32949,10 +32950,6 @@ ${thoughts[0].result}`;
32949
32950
  }
32950
32951
  }
32951
32952
  case "EditorMultiPrompt": {
32952
- const mode = getMode();
32953
- if (mode !== "max") {
32954
- return "EditorMultiPrompt is only available in MAX mode. Use /mode max to enable it.";
32955
- }
32956
32953
  const strategies = args.strategies || ["straightforward implementation", "alternative approach"];
32957
32954
  const filesCtx = (args.files || []).map((f) => `--- ${f.path} ---
32958
32955
  ${f.content}`).join(`
@@ -33066,10 +33063,6 @@ ${implementations[0].result}`;
33066
33063
  }
33067
33064
  }
33068
33065
  case "CodeReviewMulti": {
33069
- const mode = getMode();
33070
- if (mode !== "max") {
33071
- return "CodeReviewMulti is only available in MAX mode. Use /mode max to enable it, or use CodeReview for a single review.";
33072
- }
33073
33066
  const perspectives = args.perspectives || [
33074
33067
  "correctness, logic errors, and edge cases",
33075
33068
  "security vulnerabilities and data safety",
@@ -33386,8 +33379,7 @@ var require_agent = __commonJS((exports, module2) => {
33386
33379
  MAX_TOOL_ITERATIONS,
33387
33380
  nvidiaClient,
33388
33381
  session,
33389
- sleep,
33390
- getMode
33382
+ sleep
33391
33383
  } = require_config();
33392
33384
  var { buildSystemPrompt } = require_prompt();
33393
33385
  var { toolDefs } = require_tools();
@@ -33404,115 +33396,12 @@ var require_agent = __commonJS((exports, module2) => {
33404
33396
  function getIsProcessing() {
33405
33397
  return isProcessing;
33406
33398
  }
33407
- var EXPLORATION_KEYWORDS = [
33408
- "explore",
33409
- "find files",
33410
- "where is",
33411
- "search for",
33412
- "locate",
33413
- "what files",
33414
- "which files",
33415
- "show me all",
33416
- "list all",
33417
- "find code",
33418
- "search code",
33419
- "find function",
33420
- "find class",
33421
- "find module",
33422
- "find component",
33423
- "find endpoint",
33424
- "find route",
33425
- "find api",
33426
- "find service",
33427
- "find model",
33428
- "find controller",
33429
- "where can i find",
33430
- "how do i find",
33431
- "look for",
33432
- "codebase structure",
33433
- "project structure",
33434
- "directory structure"
33435
- ];
33436
- function isExplorationTask(text) {
33437
- const lower = text.toLowerCase();
33438
- return EXPLORATION_KEYWORDS.some((keyword) => lower.includes(keyword));
33439
- }
33440
- var COMPLEX_TASK_KEYWORDS = [
33441
- "refactor",
33442
- "redesign",
33443
- "architect",
33444
- "migrate",
33445
- "overhaul",
33446
- "implement",
33447
- "build",
33448
- "create a system",
33449
- "design pattern",
33450
- "add feature",
33451
- "new feature",
33452
- "integrate",
33453
- "convert",
33454
- "multiple files",
33455
- "across files",
33456
- "full stack",
33457
- "database schema",
33458
- "api endpoint",
33459
- "authentication",
33460
- "complex",
33461
- "tricky",
33462
- "challenging",
33463
- "difficult"
33464
- ];
33465
- function isComplexTask(text) {
33466
- const lower = text.toLowerCase();
33467
- const wordCount = text.split(/\s+/).length;
33468
- const keywordMatch = COMPLEX_TASK_KEYWORDS.some((kw) => lower.includes(kw));
33469
- return keywordMatch || wordCount > 40;
33470
- }
33471
33399
  async function handleUserInput(userInput) {
33472
33400
  isProcessing = true;
33473
33401
  store.setState({ isProcessing: true });
33474
33402
  session.turnCount++;
33475
33403
  store.addMessage({ role: "user", content: userInput });
33476
33404
  session.conversationHistory.push({ role: "user", content: userInput });
33477
- if (isExplorationTask(userInput)) {
33478
- const exploreId = store.addMessage({ role: "system", content: "Exploring codebase...", label: "\uD83D\uDD0D Exploring" });
33479
- try {
33480
- const pickerResult = await executeTool("FilePickerMax", { prompt: userInput }, (partial) => {
33481
- store.updateMessage(exploreId, { content: partial, label: "\uD83D\uDD0D Exploring" });
33482
- });
33483
- store.updateMessage(exploreId, { content: pickerResult, label: "\uD83D\uDD0D Codebase Exploration Results" });
33484
- session.conversationHistory.push({
33485
- role: "assistant",
33486
- content: `I've explored the codebase and found the following relevant files:
33487
-
33488
- ${pickerResult}`
33489
- });
33490
- } catch (err) {
33491
- store.updateMessage(exploreId, { content: `Exploration failed: ${err.message}` });
33492
- }
33493
- }
33494
- const mode = getMode();
33495
- if (mode === "max" && isComplexTask(userInput)) {
33496
- const thinkId = store.addMessage({ role: "system", content: "Deep thinking...", label: "\uD83E\uDDE0 Thinker" });
33497
- try {
33498
- const thinkerResult = await executeTool("Thinker", { prompt: userInput }, (partial) => {
33499
- store.updateMessage(thinkId, { content: partial, label: "\uD83E\uDDE0 Thinker" });
33500
- });
33501
- store.updateMessage(thinkId, { content: thinkerResult, label: "\uD83E\uDDE0 Thinker" });
33502
- session.conversationHistory.push({
33503
- role: "assistant",
33504
- content: `[Thinker analysis]
33505
- ${thinkerResult}`
33506
- });
33507
- } catch (err) {
33508
- store.updateMessage(thinkId, { content: `Thinker failed: ${err.message}` });
33509
- }
33510
- }
33511
- if (mode === "max" && session.conversationHistory.length > 20) {
33512
- try {
33513
- await executeTool("ContextPruner", {}, null);
33514
- } catch {}
33515
- }
33516
33405
  const startTime2 = Date.now();
33517
33406
  let turnTokens = 0;
33518
33407
  let turnToolCalls = 0;
@@ -33832,40 +33721,21 @@ ${thinkerResult}`
33832
33721
  const reviewPrompt = `User request: ${userInput}
33833
33722
 
33834
33723
  ${turnTokens > 0 ? `Processed with ${turnTokens} tokens and ${turnToolCalls} tool calls.` : ""}`;
33835
- if (mode === "max") {
33836
- const reviewId = store.addMessage({ role: "system", content: "Multi-perspective code review...", label: "\uD83D\uDCCB Code Review (MAX)" });
33837
- try {
33838
- const reviewResult = await executeTool("CodeReviewMulti", { prompt: reviewPrompt }, (partial) => {
33839
- store.updateMessage(reviewId, { content: partial, label: "\uD83D\uDCCB Code Review (MAX)" });
33840
- });
33841
- store.updateMessage(reviewId, { content: reviewResult, label: "\uD83D\uDCCB Code Review (MAX)" });
33842
- session.conversationHistory.push({
33843
- role: "assistant",
33844
- content: `
33845
-
33846
- --- Multi-Perspective Code Review ---
33847
- ${reviewResult}`
33848
- });
33849
- } catch (err) {
33850
- store.updateMessage(reviewId, { content: `Multi-review failed: ${err.message}` });
33851
- }
33852
- } else if (mode !== "lite") {
33853
- const reviewId = store.addMessage({ role: "system", content: "Reviewing code changes...", label: "\uD83D\uDCCB Code Review" });
33854
- try {
33855
- const reviewResult = await executeTool("CodeReview", { prompt: reviewPrompt }, (partial) => {
33856
- store.updateMessage(reviewId, { content: partial, label: "\uD83D\uDCCB Code Review" });
33857
- });
33858
- store.updateMessage(reviewId, { content: reviewResult, label: "\uD83D\uDCCB Code Review" });
33859
- session.conversationHistory.push({
33860
- role: "assistant",
33861
- content: `
33724
+ const reviewId = store.addMessage({ role: "system", content: "Multi-perspective code review...", label: "\uD83D\uDCCB Code Review" });
33725
+ try {
33726
+ const reviewResult = await executeTool("CodeReviewMulti", { prompt: reviewPrompt }, (partial) => {
33727
+ store.updateMessage(reviewId, { content: partial, label: "\uD83D\uDCCB Code Review" });
33728
+ });
33729
+ store.updateMessage(reviewId, { content: reviewResult, label: "\uD83D\uDCCB Code Review" });
33730
+ session.conversationHistory.push({
33731
+ role: "assistant",
33732
+ content: `
33862
33733
 
33863
33734
  --- Code Review ---
33864
33735
  ${reviewResult}`
33865
- });
33866
- } catch (err) {
33867
- store.updateMessage(reviewId, { content: `Code review failed: ${err.message}` });
33868
- }
33736
+ });
33737
+ } catch (err) {
33738
+ store.updateMessage(reviewId, { content: `Code review failed: ${err.message}` });
33869
33739
  }
33870
33740
  }
33871
33741
  } catch (err) {
@@ -33896,7 +33766,7 @@ var require_commands = __commonJS((exports, module2) => {
33896
33766
  var fs2 = __require("fs");
33897
33767
  var path2 = __require("path");
33898
33768
  var { execSync } = __require("child_process");
33899
- var { PROJECT_ROOT, session, resolvePath, getMode, setMode } = require_config();
33769
+ var { PROJECT_ROOT, session, resolvePath } = require_config();
33900
33770
  var { executeTool } = require_toolExecutors();
33901
33771
  var store = require_store();
33902
33772
  async function handleSlashCommand(input) {
@@ -33970,30 +33840,6 @@ var require_commands = __commonJS((exports, module2) => {
33970
33840
  }
33971
33841
  break;
33972
33842
  }
33973
- case "/mode": {
33974
- if (!arg) {
33975
- const current = getMode();
33976
- const modes = ["default", "max", "lite"];
33977
- const modeDescriptions = {
33978
- default: "Single agent pass with auto code review",
33979
- max: "Multi-strategy editing, best-of-N thinking, multi-perspective review, auto context pruning",
33980
- lite: "Fast mode \u2014 skips validation and review steps"
33981
- };
33982
- const lines = modes.map((m2) => `${m2 === current ? "\u2192 " : " "}${m2.padEnd(10)} ${modeDescriptions[m2]}`);
33983
- store.addMessage({ role: "system", content: `Current mode: ${current}
33984
-
33985
- ${lines.join(`
33986
- `)}`, label: "Mode" });
33987
- } else {
33988
- const success = setMode(arg.trim());
33989
- if (success) {
33990
- store.addMessage({ role: "system", content: `Mode set to: ${arg.trim()}`, label: "Mode" });
33991
- } else {
33992
- store.addMessage({ role: "system", content: `Invalid mode: ${arg}. Use default, max, or lite.` });
33993
- }
33994
- }
33995
- break;
33996
- }
33997
33843
  case "/compact": {
33998
33844
  const pruneId = store.addMessage({ role: "system", content: "Compacting conversation...", label: "Context Pruner" });
33999
33845
  try {
@@ -34079,7 +33925,7 @@ var require_jsx_runtime = __commonJS((exports, module2) => {
34079
33925
  } else {}
34080
33926
  });
34081
33927
 
34082
- // node_modules/@opentui/core/index-qr7b6cvh.js
33928
+ // node_modules/@opentui/core/index-a215gqtt.js
34083
33929
  import { Buffer as Buffer2 } from "buffer";
34084
33930
  import { EventEmitter } from "events";
34085
33931
  import { EventEmitter as EventEmitter2 } from "events";
@@ -34120,7 +33966,7 @@ var highlights_default5 = "./highlights-hk7bwhj4.scm";
34120
33966
  // node_modules/@opentui/core/assets/zig/tree-sitter-zig.wasm
34121
33967
  var tree_sitter_zig_default = "./tree-sitter-zig-e78zbjpm.wasm";
34122
33968
 
34123
- // node_modules/@opentui/core/index-qr7b6cvh.js
33969
+ // node_modules/@opentui/core/index-a215gqtt.js
34124
33970
  import { resolve as resolve2, isAbsolute, parse } from "path";
34125
33971
  import { existsSync } from "fs";
34126
33972
  import { basename, join } from "path";
@@ -34144,17 +33990,13 @@ import { Writable } from "stream";
34144
33990
  import { EventEmitter as EventEmitter7 } from "events";
34145
33991
  import { EventEmitter as EventEmitter9 } from "events";
34146
33992
  var __defProp2 = Object.defineProperty;
34147
- var __returnValue = (v) => v;
34148
- function __exportSetter(name, newValue) {
34149
- this[name] = __returnValue.bind(null, newValue);
34150
- }
34151
33993
  var __export2 = (target, all) => {
34152
33994
  for (var name in all)
34153
33995
  __defProp2(target, name, {
34154
33996
  get: all[name],
34155
33997
  enumerable: true,
34156
33998
  configurable: true,
34157
- set: __exportSetter.bind(all, name)
33999
+ set: (newValue) => all[name] = () => newValue
34158
34000
  });
34159
34001
  };
34160
34002
  var exports_src = {};
@@ -53563,6 +53405,604 @@ class LineNumberRenderable extends Renderable {
53563
53405
  }
53564
53406
  }
53565
53407
  }
53408
+
53409
+ class Diff {
53410
+ diff(oldStr, newStr, options = {}) {
53411
+ let callback;
53412
+ if (typeof options === "function") {
53413
+ callback = options;
53414
+ options = {};
53415
+ } else if ("callback" in options) {
53416
+ callback = options.callback;
53417
+ }
53418
+ const oldString = this.castInput(oldStr, options);
53419
+ const newString = this.castInput(newStr, options);
53420
+ const oldTokens = this.removeEmpty(this.tokenize(oldString, options));
53421
+ const newTokens = this.removeEmpty(this.tokenize(newString, options));
53422
+ return this.diffWithOptionsObj(oldTokens, newTokens, options, callback);
53423
+ }
53424
+ diffWithOptionsObj(oldTokens, newTokens, options, callback) {
53425
+ var _a;
53426
+ const done = (value) => {
53427
+ value = this.postProcess(value, options);
53428
+ if (callback) {
53429
+ setTimeout(function() {
53430
+ callback(value);
53431
+ }, 0);
53432
+ return;
53433
+ } else {
53434
+ return value;
53435
+ }
53436
+ };
53437
+ const newLen = newTokens.length, oldLen = oldTokens.length;
53438
+ let editLength = 1;
53439
+ let maxEditLength = newLen + oldLen;
53440
+ if (options.maxEditLength != null) {
53441
+ maxEditLength = Math.min(maxEditLength, options.maxEditLength);
53442
+ }
53443
+ const maxExecutionTime = (_a = options.timeout) !== null && _a !== undefined ? _a : Infinity;
53444
+ const abortAfterTimestamp = Date.now() + maxExecutionTime;
53445
+ const bestPath = [{ oldPos: -1, lastComponent: undefined }];
53446
+ let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options);
53447
+ if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
53448
+ return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));
53449
+ }
53450
+ let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
53451
+ const execEditLength = () => {
53452
+ for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength);diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
53453
+ let basePath;
53454
+ const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
53455
+ if (removePath) {
53456
+ bestPath[diagonalPath - 1] = undefined;
53457
+ }
53458
+ let canAdd = false;
53459
+ if (addPath) {
53460
+ const addPathNewPos = addPath.oldPos - diagonalPath;
53461
+ canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
53462
+ }
53463
+ const canRemove = removePath && removePath.oldPos + 1 < oldLen;
53464
+ if (!canAdd && !canRemove) {
53465
+ bestPath[diagonalPath] = undefined;
53466
+ continue;
53467
+ }
53468
+ if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) {
53469
+ basePath = this.addToPath(addPath, true, false, 0, options);
53470
+ } else {
53471
+ basePath = this.addToPath(removePath, false, true, 1, options);
53472
+ }
53473
+ newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options);
53474
+ if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
53475
+ return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;
53476
+ } else {
53477
+ bestPath[diagonalPath] = basePath;
53478
+ if (basePath.oldPos + 1 >= oldLen) {
53479
+ maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
53480
+ }
53481
+ if (newPos + 1 >= newLen) {
53482
+ minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
53483
+ }
53484
+ }
53485
+ }
53486
+ editLength++;
53487
+ };
53488
+ if (callback) {
53489
+ (function exec() {
53490
+ setTimeout(function() {
53491
+ if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
53492
+ return callback(undefined);
53493
+ }
53494
+ if (!execEditLength()) {
53495
+ exec();
53496
+ }
53497
+ }, 0);
53498
+ })();
53499
+ } else {
53500
+ while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
53501
+ const ret = execEditLength();
53502
+ if (ret) {
53503
+ return ret;
53504
+ }
53505
+ }
53506
+ }
53507
+ }
53508
+ addToPath(path2, added, removed, oldPosInc, options) {
53509
+ const last = path2.lastComponent;
53510
+ if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
53511
+ return {
53512
+ oldPos: path2.oldPos + oldPosInc,
53513
+ lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
53514
+ };
53515
+ } else {
53516
+ return {
53517
+ oldPos: path2.oldPos + oldPosInc,
53518
+ lastComponent: { count: 1, added, removed, previousComponent: last }
53519
+ };
53520
+ }
53521
+ }
53522
+ extractCommon(basePath, newTokens, oldTokens, diagonalPath, options) {
53523
+ const newLen = newTokens.length, oldLen = oldTokens.length;
53524
+ let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
53525
+ while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) {
53526
+ newPos++;
53527
+ oldPos++;
53528
+ commonCount++;
53529
+ if (options.oneChangePerToken) {
53530
+ basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false };
53531
+ }
53532
+ }
53533
+ if (commonCount && !options.oneChangePerToken) {
53534
+ basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false };
53535
+ }
53536
+ basePath.oldPos = oldPos;
53537
+ return newPos;
53538
+ }
53539
+ equals(left, right, options) {
53540
+ if (options.comparator) {
53541
+ return options.comparator(left, right);
53542
+ } else {
53543
+ return left === right || !!options.ignoreCase && left.toLowerCase() === right.toLowerCase();
53544
+ }
53545
+ }
53546
+ removeEmpty(array) {
53547
+ const ret = [];
53548
+ for (let i = 0;i < array.length; i++) {
53549
+ if (array[i]) {
53550
+ ret.push(array[i]);
53551
+ }
53552
+ }
53553
+ return ret;
53554
+ }
53555
+ castInput(value, options) {
53556
+ return value;
53557
+ }
53558
+ tokenize(value, options) {
53559
+ return Array.from(value);
53560
+ }
53561
+ join(chars) {
53562
+ return chars.join("");
53563
+ }
53564
+ postProcess(changeObjects, options) {
53565
+ return changeObjects;
53566
+ }
53567
+ get useLongestToken() {
53568
+ return false;
53569
+ }
53570
+ buildValues(lastComponent, newTokens, oldTokens) {
53571
+ const components = [];
53572
+ let nextComponent;
53573
+ while (lastComponent) {
53574
+ components.push(lastComponent);
53575
+ nextComponent = lastComponent.previousComponent;
53576
+ delete lastComponent.previousComponent;
53577
+ lastComponent = nextComponent;
53578
+ }
53579
+ components.reverse();
53580
+ const componentLen = components.length;
53581
+ let componentPos = 0, newPos = 0, oldPos = 0;
53582
+ for (;componentPos < componentLen; componentPos++) {
53583
+ const component = components[componentPos];
53584
+ if (!component.removed) {
53585
+ if (!component.added && this.useLongestToken) {
53586
+ let value = newTokens.slice(newPos, newPos + component.count);
53587
+ value = value.map(function(value2, i) {
53588
+ const oldValue = oldTokens[oldPos + i];
53589
+ return oldValue.length > value2.length ? oldValue : value2;
53590
+ });
53591
+ component.value = this.join(value);
53592
+ } else {
53593
+ component.value = this.join(newTokens.slice(newPos, newPos + component.count));
53594
+ }
53595
+ newPos += component.count;
53596
+ if (!component.added) {
53597
+ oldPos += component.count;
53598
+ }
53599
+ } else {
53600
+ component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count));
53601
+ oldPos += component.count;
53602
+ }
53603
+ }
53604
+ return components;
53605
+ }
53606
+ }
53607
+
53608
+ class CharacterDiff extends Diff {
53609
+ }
53610
+ var characterDiff = new CharacterDiff;
53611
+ function longestCommonPrefix(str1, str2) {
53612
+ let i;
53613
+ for (i = 0;i < str1.length && i < str2.length; i++) {
53614
+ if (str1[i] != str2[i]) {
53615
+ return str1.slice(0, i);
53616
+ }
53617
+ }
53618
+ return str1.slice(0, i);
53619
+ }
53620
+ function longestCommonSuffix(str1, str2) {
53621
+ let i;
53622
+ if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) {
53623
+ return "";
53624
+ }
53625
+ for (i = 0;i < str1.length && i < str2.length; i++) {
53626
+ if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) {
53627
+ return str1.slice(-i);
53628
+ }
53629
+ }
53630
+ return str1.slice(-i);
53631
+ }
53632
+ function replacePrefix(string, oldPrefix, newPrefix) {
53633
+ if (string.slice(0, oldPrefix.length) != oldPrefix) {
53634
+ throw Error(`string ${JSON.stringify(string)} doesn't start with prefix ${JSON.stringify(oldPrefix)}; this is a bug`);
53635
+ }
53636
+ return newPrefix + string.slice(oldPrefix.length);
53637
+ }
53638
+ function replaceSuffix(string, oldSuffix, newSuffix) {
53639
+ if (!oldSuffix) {
53640
+ return string + newSuffix;
53641
+ }
53642
+ if (string.slice(-oldSuffix.length) != oldSuffix) {
53643
+ throw Error(`string ${JSON.stringify(string)} doesn't end with suffix ${JSON.stringify(oldSuffix)}; this is a bug`);
53644
+ }
53645
+ return string.slice(0, -oldSuffix.length) + newSuffix;
53646
+ }
53647
+ function removePrefix(string, oldPrefix) {
53648
+ return replacePrefix(string, oldPrefix, "");
53649
+ }
53650
+ function removeSuffix(string, oldSuffix) {
53651
+ return replaceSuffix(string, oldSuffix, "");
53652
+ }
53653
+ function maximumOverlap(string1, string2) {
53654
+ return string2.slice(0, overlapCount(string1, string2));
53655
+ }
53656
+ function overlapCount(a, b) {
53657
+ let startA = 0;
53658
+ if (a.length > b.length) {
53659
+ startA = a.length - b.length;
53660
+ }
53661
+ let endB = b.length;
53662
+ if (a.length < b.length) {
53663
+ endB = a.length;
53664
+ }
53665
+ const map = Array(endB);
53666
+ let k = 0;
53667
+ map[0] = 0;
53668
+ for (let j = 1;j < endB; j++) {
53669
+ if (b[j] == b[k]) {
53670
+ map[j] = map[k];
53671
+ } else {
53672
+ map[j] = k;
53673
+ }
53674
+ while (k > 0 && b[j] != b[k]) {
53675
+ k = map[k];
53676
+ }
53677
+ if (b[j] == b[k]) {
53678
+ k++;
53679
+ }
53680
+ }
53681
+ k = 0;
53682
+ for (let i = startA;i < a.length; i++) {
53683
+ while (k > 0 && a[i] != b[k]) {
53684
+ k = map[k];
53685
+ }
53686
+ if (a[i] == b[k]) {
53687
+ k++;
53688
+ }
53689
+ }
53690
+ return k;
53691
+ }
53692
+ function trailingWs(string) {
53693
+ let i;
53694
+ for (i = string.length - 1;i >= 0; i--) {
53695
+ if (!string[i].match(/\s/)) {
53696
+ break;
53697
+ }
53698
+ }
53699
+ return string.substring(i + 1);
53700
+ }
53701
+ function leadingWs(string) {
53702
+ const match = string.match(/^\s*/);
53703
+ return match ? match[0] : "";
53704
+ }
53705
+ var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
53706
+ var tokenizeIncludingWhitespace = new RegExp(`[${extendedWordChars}]+|\\s+|[^${extendedWordChars}]`, "ug");
53707
+
53708
+ class WordDiff extends Diff {
53709
+ equals(left, right, options) {
53710
+ if (options.ignoreCase) {
53711
+ left = left.toLowerCase();
53712
+ right = right.toLowerCase();
53713
+ }
53714
+ return left.trim() === right.trim();
53715
+ }
53716
+ tokenize(value, options = {}) {
53717
+ let parts;
53718
+ if (options.intlSegmenter) {
53719
+ const segmenter = options.intlSegmenter;
53720
+ if (segmenter.resolvedOptions().granularity != "word") {
53721
+ throw new Error('The segmenter passed must have a granularity of "word"');
53722
+ }
53723
+ parts = Array.from(segmenter.segment(value), (segment) => segment.segment);
53724
+ } else {
53725
+ parts = value.match(tokenizeIncludingWhitespace) || [];
53726
+ }
53727
+ const tokens = [];
53728
+ let prevPart = null;
53729
+ parts.forEach((part) => {
53730
+ if (/\s/.test(part)) {
53731
+ if (prevPart == null) {
53732
+ tokens.push(part);
53733
+ } else {
53734
+ tokens.push(tokens.pop() + part);
53735
+ }
53736
+ } else if (prevPart != null && /\s/.test(prevPart)) {
53737
+ if (tokens[tokens.length - 1] == prevPart) {
53738
+ tokens.push(tokens.pop() + part);
53739
+ } else {
53740
+ tokens.push(prevPart + part);
53741
+ }
53742
+ } else {
53743
+ tokens.push(part);
53744
+ }
53745
+ prevPart = part;
53746
+ });
53747
+ return tokens;
53748
+ }
53749
+ join(tokens) {
53750
+ return tokens.map((token, i) => {
53751
+ if (i == 0) {
53752
+ return token;
53753
+ } else {
53754
+ return token.replace(/^\s+/, "");
53755
+ }
53756
+ }).join("");
53757
+ }
53758
+ postProcess(changes, options) {
53759
+ if (!changes || options.oneChangePerToken) {
53760
+ return changes;
53761
+ }
53762
+ let lastKeep = null;
53763
+ let insertion = null;
53764
+ let deletion = null;
53765
+ changes.forEach((change) => {
53766
+ if (change.added) {
53767
+ insertion = change;
53768
+ } else if (change.removed) {
53769
+ deletion = change;
53770
+ } else {
53771
+ if (insertion || deletion) {
53772
+ dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
53773
+ }
53774
+ lastKeep = change;
53775
+ insertion = null;
53776
+ deletion = null;
53777
+ }
53778
+ });
53779
+ if (insertion || deletion) {
53780
+ dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
53781
+ }
53782
+ return changes;
53783
+ }
53784
+ }
53785
+ var wordDiff = new WordDiff;
53786
+ function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
53787
+ if (deletion && insertion) {
53788
+ const oldWsPrefix = leadingWs(deletion.value);
53789
+ const oldWsSuffix = trailingWs(deletion.value);
53790
+ const newWsPrefix = leadingWs(insertion.value);
53791
+ const newWsSuffix = trailingWs(insertion.value);
53792
+ if (startKeep) {
53793
+ const commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix);
53794
+ startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix);
53795
+ deletion.value = removePrefix(deletion.value, commonWsPrefix);
53796
+ insertion.value = removePrefix(insertion.value, commonWsPrefix);
53797
+ }
53798
+ if (endKeep) {
53799
+ const commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix);
53800
+ endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix);
53801
+ deletion.value = removeSuffix(deletion.value, commonWsSuffix);
53802
+ insertion.value = removeSuffix(insertion.value, commonWsSuffix);
53803
+ }
53804
+ } else if (insertion) {
53805
+ if (startKeep) {
53806
+ const ws = leadingWs(insertion.value);
53807
+ insertion.value = insertion.value.substring(ws.length);
53808
+ }
53809
+ if (endKeep) {
53810
+ const ws = leadingWs(endKeep.value);
53811
+ endKeep.value = endKeep.value.substring(ws.length);
53812
+ }
53813
+ } else if (startKeep && endKeep) {
53814
+ const newWsFull = leadingWs(endKeep.value), delWsStart = leadingWs(deletion.value), delWsEnd = trailingWs(deletion.value);
53815
+ const newWsStart = longestCommonPrefix(newWsFull, delWsStart);
53816
+ deletion.value = removePrefix(deletion.value, newWsStart);
53817
+ const newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd);
53818
+ deletion.value = removeSuffix(deletion.value, newWsEnd);
53819
+ endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd);
53820
+ startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
53821
+ } else if (endKeep) {
53822
+ const endKeepWsPrefix = leadingWs(endKeep.value);
53823
+ const deletionWsSuffix = trailingWs(deletion.value);
53824
+ const overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix);
53825
+ deletion.value = removeSuffix(deletion.value, overlap);
53826
+ } else if (startKeep) {
53827
+ const startKeepWsSuffix = trailingWs(startKeep.value);
53828
+ const deletionWsPrefix = leadingWs(deletion.value);
53829
+ const overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix);
53830
+ deletion.value = removePrefix(deletion.value, overlap);
53831
+ }
53832
+ }
53833
+
53834
+ class WordsWithSpaceDiff extends Diff {
53835
+ tokenize(value) {
53836
+ const regex = new RegExp(`(\\r?\\n)|[${extendedWordChars}]+|[^\\S\\n\\r]+|[^${extendedWordChars}]`, "ug");
53837
+ return value.match(regex) || [];
53838
+ }
53839
+ }
53840
+ var wordsWithSpaceDiff = new WordsWithSpaceDiff;
53841
+
53842
+ class LineDiff extends Diff {
53843
+ constructor() {
53844
+ super(...arguments);
53845
+ this.tokenize = tokenize;
53846
+ }
53847
+ equals(left, right, options) {
53848
+ if (options.ignoreWhitespace) {
53849
+ if (!options.newlineIsToken || !left.includes(`
53850
+ `)) {
53851
+ left = left.trim();
53852
+ }
53853
+ if (!options.newlineIsToken || !right.includes(`
53854
+ `)) {
53855
+ right = right.trim();
53856
+ }
53857
+ } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {
53858
+ if (left.endsWith(`
53859
+ `)) {
53860
+ left = left.slice(0, -1);
53861
+ }
53862
+ if (right.endsWith(`
53863
+ `)) {
53864
+ right = right.slice(0, -1);
53865
+ }
53866
+ }
53867
+ return super.equals(left, right, options);
53868
+ }
53869
+ }
53870
+ var lineDiff = new LineDiff;
53871
+ function tokenize(value, options) {
53872
+ if (options.stripTrailingCr) {
53873
+ value = value.replace(/\r\n/g, `
53874
+ `);
53875
+ }
53876
+ const retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
53877
+ if (!linesAndNewlines[linesAndNewlines.length - 1]) {
53878
+ linesAndNewlines.pop();
53879
+ }
53880
+ for (let i = 0;i < linesAndNewlines.length; i++) {
53881
+ const line = linesAndNewlines[i];
53882
+ if (i % 2 && !options.newlineIsToken) {
53883
+ retLines[retLines.length - 1] += line;
53884
+ } else {
53885
+ retLines.push(line);
53886
+ }
53887
+ }
53888
+ return retLines;
53889
+ }
53890
+ function isSentenceEndPunct(char) {
53891
+ return char == "." || char == "!" || char == "?";
53892
+ }
53893
+
53894
+ class SentenceDiff extends Diff {
53895
+ tokenize(value) {
53896
+ var _a;
53897
+ const result = [];
53898
+ let tokenStartI = 0;
53899
+ for (let i = 0;i < value.length; i++) {
53900
+ if (i == value.length - 1) {
53901
+ result.push(value.slice(tokenStartI));
53902
+ break;
53903
+ }
53904
+ if (isSentenceEndPunct(value[i]) && value[i + 1].match(/\s/)) {
53905
+ result.push(value.slice(tokenStartI, i + 1));
53906
+ i = tokenStartI = i + 1;
53907
+ while ((_a = value[i + 1]) === null || _a === undefined ? undefined : _a.match(/\s/)) {
53908
+ i++;
53909
+ }
53910
+ result.push(value.slice(tokenStartI, i + 1));
53911
+ tokenStartI = i + 1;
53912
+ }
53913
+ }
53914
+ return result;
53915
+ }
53916
+ }
53917
+ var sentenceDiff = new SentenceDiff;
53918
+
53919
+ class CssDiff extends Diff {
53920
+ tokenize(value) {
53921
+ return value.split(/([{}:;,]|\s+)/);
53922
+ }
53923
+ }
53924
+ var cssDiff = new CssDiff;
53925
+
53926
+ class JsonDiff extends Diff {
53927
+ constructor() {
53928
+ super(...arguments);
53929
+ this.tokenize = tokenize;
53930
+ }
53931
+ get useLongestToken() {
53932
+ return true;
53933
+ }
53934
+ castInput(value, options) {
53935
+ const { undefinedReplacement, stringifyReplacer = (k, v) => typeof v === "undefined" ? undefinedReplacement : v } = options;
53936
+ return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), null, " ");
53937
+ }
53938
+ equals(left, right, options) {
53939
+ return super.equals(left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1"), options);
53940
+ }
53941
+ }
53942
+ var jsonDiff = new JsonDiff;
53943
+ function canonicalize(obj, stack, replacementStack, replacer, key) {
53944
+ stack = stack || [];
53945
+ replacementStack = replacementStack || [];
53946
+ if (replacer) {
53947
+ obj = replacer(key === undefined ? "" : key, obj);
53948
+ }
53949
+ let i;
53950
+ for (i = 0;i < stack.length; i += 1) {
53951
+ if (stack[i] === obj) {
53952
+ return replacementStack[i];
53953
+ }
53954
+ }
53955
+ let canonicalizedObj;
53956
+ if (Object.prototype.toString.call(obj) === "[object Array]") {
53957
+ stack.push(obj);
53958
+ canonicalizedObj = new Array(obj.length);
53959
+ replacementStack.push(canonicalizedObj);
53960
+ for (i = 0;i < obj.length; i += 1) {
53961
+ canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, String(i));
53962
+ }
53963
+ stack.pop();
53964
+ replacementStack.pop();
53965
+ return canonicalizedObj;
53966
+ }
53967
+ if (obj && obj.toJSON) {
53968
+ obj = obj.toJSON();
53969
+ }
53970
+ if (typeof obj === "object" && obj !== null) {
53971
+ stack.push(obj);
53972
+ canonicalizedObj = {};
53973
+ replacementStack.push(canonicalizedObj);
53974
+ const sortedKeys = [];
53975
+ let key2;
53976
+ for (key2 in obj) {
53977
+ if (Object.prototype.hasOwnProperty.call(obj, key2)) {
53978
+ sortedKeys.push(key2);
53979
+ }
53980
+ }
53981
+ sortedKeys.sort();
53982
+ for (i = 0;i < sortedKeys.length; i += 1) {
53983
+ key2 = sortedKeys[i];
53984
+ canonicalizedObj[key2] = canonicalize(obj[key2], stack, replacementStack, replacer, key2);
53985
+ }
53986
+ stack.pop();
53987
+ replacementStack.pop();
53988
+ } else {
53989
+ canonicalizedObj = obj;
53990
+ }
53991
+ return canonicalizedObj;
53992
+ }
53993
+
53994
+ class ArrayDiff extends Diff {
53995
+ tokenize(value) {
53996
+ return value.slice();
53997
+ }
53998
+ join(value) {
53999
+ return value;
54000
+ }
54001
+ removeEmpty(value) {
54002
+ return value;
54003
+ }
54004
+ }
54005
+ var arrayDiff = new ArrayDiff;
53566
54006
  function parsePatch(uniDiff) {
53567
54007
  const diffstr = uniDiff.split(/\n/), list = [];
53568
54008
  let i = 0;
@@ -55975,7 +56415,6 @@ class TextTableRenderable extends Renderable {
55975
56415
  _content;
55976
56416
  _wrapMode;
55977
56417
  _columnWidthMode;
55978
- _columnFitter;
55979
56418
  _cellPadding;
55980
56419
  _showBorders;
55981
56420
  _border;
@@ -56003,9 +56442,8 @@ class TextTableRenderable extends Renderable {
56003
56442
  _cachedMeasureWidth = undefined;
56004
56443
  _defaultOptions = {
56005
56444
  content: [],
56006
- wrapMode: "word",
56007
- columnWidthMode: "full",
56008
- columnFitter: "proportional",
56445
+ wrapMode: "none",
56446
+ columnWidthMode: "content",
56009
56447
  cellPadding: 0,
56010
56448
  showBorders: true,
56011
56449
  border: true,
@@ -56022,11 +56460,10 @@ class TextTableRenderable extends Renderable {
56022
56460
  attributes: 0
56023
56461
  };
56024
56462
  constructor(ctx, options = {}) {
56025
- super(ctx, { ...options, flexShrink: options.flexShrink ?? 0, buffered: true });
56463
+ super(ctx, { ...options, buffered: true });
56026
56464
  this._content = options.content ?? this._defaultOptions.content;
56027
56465
  this._wrapMode = options.wrapMode ?? this._defaultOptions.wrapMode;
56028
56466
  this._columnWidthMode = options.columnWidthMode ?? this._defaultOptions.columnWidthMode;
56029
- this._columnFitter = this.resolveColumnFitter(options.columnFitter);
56030
56467
  this._cellPadding = this.resolveCellPadding(options.cellPadding);
56031
56468
  this._showBorders = options.showBorders ?? this._defaultOptions.showBorders;
56032
56469
  this._border = options.border ?? this._defaultOptions.border;
@@ -56075,16 +56512,6 @@ class TextTableRenderable extends Renderable {
56075
56512
  this._columnWidthMode = value;
56076
56513
  this.invalidateLayoutAndRaster();
56077
56514
  }
56078
- get columnFitter() {
56079
- return this._columnFitter;
56080
- }
56081
- set columnFitter(value) {
56082
- const next = this.resolveColumnFitter(value);
56083
- if (this._columnFitter === next)
56084
- return;
56085
- this._columnFitter = next;
56086
- this.invalidateLayoutAndRaster();
56087
- }
56088
56515
  get cellPadding() {
56089
56516
  return this._cellPadding;
56090
56517
  }
@@ -56238,7 +56665,7 @@ class TextTableRenderable extends Renderable {
56238
56665
  super.destroySelf();
56239
56666
  }
56240
56667
  setupMeasureFunc() {
56241
- const measureFunc = (width, widthMode, _height, _heightMode) => {
56668
+ const measureFunc = (width, widthMode, height, heightMode) => {
56242
56669
  const hasWidthConstraint = widthMode !== MeasureMode.Undefined && Number.isFinite(width);
56243
56670
  const rawWidthConstraint = hasWidthConstraint ? Math.max(1, Math.floor(width)) : undefined;
56244
56671
  const widthConstraint = this.resolveLayoutWidthConstraint(rawWidthConstraint);
@@ -56250,6 +56677,9 @@ class TextTableRenderable extends Renderable {
56250
56677
  if (widthMode === MeasureMode.AtMost && rawWidthConstraint !== undefined && this._positionType !== "absolute") {
56251
56678
  measuredWidth = Math.min(rawWidthConstraint, measuredWidth);
56252
56679
  }
56680
+ if (heightMode === MeasureMode.AtMost && Number.isFinite(height) && this._positionType !== "absolute") {
56681
+ measuredHeight = Math.min(Math.max(1, Math.floor(height)), measuredHeight);
56682
+ }
56253
56683
  return {
56254
56684
  width: measuredWidth,
56255
56685
  height: measuredHeight
@@ -56421,9 +56851,6 @@ class TextTableRenderable extends Renderable {
56421
56851
  tableHeight: (rowOffsets[rowOffsets.length - 1] ?? 0) + 1
56422
56852
  };
56423
56853
  }
56424
- isFullWidthMode() {
56425
- return this._columnWidthMode === "full";
56426
- }
56427
56854
  computeColumnWidths(maxTableWidth, borderLayout) {
56428
56855
  const horizontalPadding = this.getHorizontalCellPadding();
56429
56856
  const intrinsicWidths = new Array(this._columnCount).fill(1 + horizontalPadding);
@@ -56446,7 +56873,7 @@ class TextTableRenderable extends Renderable {
56446
56873
  return intrinsicWidths;
56447
56874
  }
56448
56875
  if (currentWidth < maxContentWidth) {
56449
- if (this.isFullWidthMode()) {
56876
+ if (this._columnWidthMode === "fill") {
56450
56877
  return this.expandColumnWidths(intrinsicWidths, maxContentWidth);
56451
56878
  }
56452
56879
  return intrinsicWidths;
@@ -56476,12 +56903,6 @@ class TextTableRenderable extends Renderable {
56476
56903
  return expanded;
56477
56904
  }
56478
56905
  fitColumnWidths(widths, targetContentWidth) {
56479
- if (this._columnFitter === "balanced") {
56480
- return this.fitColumnWidthsBalanced(widths, targetContentWidth);
56481
- }
56482
- return this.fitColumnWidthsProportional(widths, targetContentWidth);
56483
- }
56484
- fitColumnWidthsProportional(widths, targetContentWidth) {
56485
56906
  const minWidth = 1 + this.getHorizontalCellPadding();
56486
56907
  const hardMinWidths = new Array(widths.length).fill(minWidth);
56487
56908
  const baseWidths = widths.map((width) => Math.max(1, Math.floor(width)));
@@ -56532,80 +56953,6 @@ class TextTableRenderable extends Renderable {
56532
56953
  }
56533
56954
  return baseWidths.map((width, idx) => Math.max(floorWidths[idx], width - integerShrink[idx]));
56534
56955
  }
56535
- fitColumnWidthsBalanced(widths, targetContentWidth) {
56536
- const minWidth = 1 + this.getHorizontalCellPadding();
56537
- const hardMinWidths = new Array(widths.length).fill(minWidth);
56538
- const baseWidths = widths.map((width) => Math.max(1, Math.floor(width)));
56539
- const totalBaseWidth = baseWidths.reduce((sum, width) => sum + width, 0);
56540
- const columns = baseWidths.length;
56541
- if (columns === 0 || totalBaseWidth <= targetContentWidth) {
56542
- return baseWidths;
56543
- }
56544
- const evenShare = Math.max(minWidth, Math.floor(targetContentWidth / columns));
56545
- const preferredMinWidths = baseWidths.map((width) => Math.min(width, evenShare));
56546
- const preferredMinTotal = preferredMinWidths.reduce((sum, width) => sum + width, 0);
56547
- const floorWidths = preferredMinTotal <= targetContentWidth ? preferredMinWidths : hardMinWidths;
56548
- const floorTotal = floorWidths.reduce((sum, width) => sum + width, 0);
56549
- const clampedTarget = Math.max(floorTotal, targetContentWidth);
56550
- if (totalBaseWidth <= clampedTarget) {
56551
- return baseWidths;
56552
- }
56553
- const shrinkable = baseWidths.map((width, idx) => width - floorWidths[idx]);
56554
- const totalShrinkable = shrinkable.reduce((sum, value) => sum + value, 0);
56555
- if (totalShrinkable <= 0) {
56556
- return [...floorWidths];
56557
- }
56558
- const targetShrink = totalBaseWidth - clampedTarget;
56559
- const shrink = this.allocateShrinkByWeight(shrinkable, targetShrink, "sqrt");
56560
- return baseWidths.map((width, idx) => Math.max(floorWidths[idx], width - shrink[idx]));
56561
- }
56562
- allocateShrinkByWeight(shrinkable, targetShrink, mode) {
56563
- const shrink = new Array(shrinkable.length).fill(0);
56564
- if (targetShrink <= 0) {
56565
- return shrink;
56566
- }
56567
- const weights = shrinkable.map((value) => {
56568
- if (value <= 0) {
56569
- return 0;
56570
- }
56571
- return mode === "sqrt" ? Math.sqrt(value) : value;
56572
- });
56573
- const totalWeight = weights.reduce((sum, value) => sum + value, 0);
56574
- if (totalWeight <= 0) {
56575
- return shrink;
56576
- }
56577
- const fractions = new Array(shrinkable.length).fill(0);
56578
- let usedShrink = 0;
56579
- for (let idx = 0;idx < shrinkable.length; idx++) {
56580
- if (shrinkable[idx] <= 0 || weights[idx] <= 0)
56581
- continue;
56582
- const exact = weights[idx] / totalWeight * targetShrink;
56583
- const whole = Math.min(shrinkable[idx], Math.floor(exact));
56584
- shrink[idx] = whole;
56585
- fractions[idx] = exact - whole;
56586
- usedShrink += whole;
56587
- }
56588
- let remainingShrink = targetShrink - usedShrink;
56589
- while (remainingShrink > 0) {
56590
- let bestIdx = -1;
56591
- let bestFraction = -1;
56592
- for (let idx = 0;idx < shrinkable.length; idx++) {
56593
- if (shrinkable[idx] - shrink[idx] <= 0)
56594
- continue;
56595
- if (bestIdx === -1 || fractions[idx] > bestFraction || fractions[idx] === bestFraction && shrinkable[idx] > shrinkable[bestIdx]) {
56596
- bestIdx = idx;
56597
- bestFraction = fractions[idx];
56598
- }
56599
- }
56600
- if (bestIdx === -1) {
56601
- break;
56602
- }
56603
- shrink[bestIdx] += 1;
56604
- fractions[bestIdx] = 0;
56605
- remainingShrink -= 1;
56606
- }
56607
- return shrink;
56608
- }
56609
56956
  computeRowHeights(columnWidths) {
56610
56957
  const horizontalPadding = this.getHorizontalCellPadding();
56611
56958
  const verticalPadding = this.getVerticalCellPadding();
@@ -56929,7 +57276,7 @@ class TextTableRenderable extends Renderable {
56929
57276
  if (width === undefined || !Number.isFinite(width) || width <= 0) {
56930
57277
  return;
56931
57278
  }
56932
- if (this._wrapMode !== "none" || this.isFullWidthMode()) {
57279
+ if (this._wrapMode !== "none" || this._columnWidthMode === "fill") {
56933
57280
  return Math.max(1, Math.floor(width));
56934
57281
  }
56935
57282
  return;
@@ -56940,12 +57287,6 @@ class TextTableRenderable extends Renderable {
56940
57287
  getVerticalCellPadding() {
56941
57288
  return this._cellPadding * 2;
56942
57289
  }
56943
- resolveColumnFitter(value) {
56944
- if (value === undefined) {
56945
- return this._defaultOptions.columnFitter;
56946
- }
56947
- return value === "balanced" ? "balanced" : "proportional";
56948
- }
56949
57290
  resolveCellPadding(value) {
56950
57291
  if (value === undefined || !Number.isFinite(value)) {
56951
57292
  return this._defaultOptions.cellPadding;
@@ -58721,9 +59062,8 @@ class MarkdownRenderable extends Renderable {
58721
59062
  resolveTableRenderableOptions() {
58722
59063
  const borders = this._tableOptions?.borders ?? true;
58723
59064
  return {
58724
- columnWidthMode: this._tableOptions?.widthMode ?? "full",
58725
- columnFitter: this._tableOptions?.columnFitter ?? "proportional",
58726
- wrapMode: this._tableOptions?.wrapMode ?? "word",
59065
+ columnWidthMode: this._tableOptions?.widthMode ?? "content",
59066
+ wrapMode: this._tableOptions?.wrapMode ?? "none",
58727
59067
  cellPadding: this._tableOptions?.cellPadding ?? 0,
58728
59068
  border: borders,
58729
59069
  outerBorder: this._tableOptions?.outerBorder ?? borders,
@@ -58735,7 +59075,6 @@ class MarkdownRenderable extends Renderable {
58735
59075
  }
58736
59076
  applyTableRenderableOptions(tableRenderable, options) {
58737
59077
  tableRenderable.columnWidthMode = options.columnWidthMode;
58738
- tableRenderable.columnFitter = options.columnFitter;
58739
59078
  tableRenderable.wrapMode = options.wrapMode;
58740
59079
  tableRenderable.cellPadding = options.cellPadding;
58741
59080
  tableRenderable.border = options.border;
@@ -58766,7 +59105,6 @@ class MarkdownRenderable extends Renderable {
58766
59105
  width: "100%",
58767
59106
  marginBottom,
58768
59107
  columnWidthMode: options.columnWidthMode,
58769
- columnFitter: options.columnFitter,
58770
59108
  wrapMode: options.wrapMode,
58771
59109
  cellPadding: options.cellPadding,
58772
59110
  border: options.border,
@@ -59626,34 +59964,6 @@ class ContentRenderable extends BoxRenderable {
59626
59964
  return this.getChildrenSortedByPrimaryAxis().map((child) => child.num);
59627
59965
  }
59628
59966
  }
59629
- var SCROLLBOX_PADDING_KEYS = [
59630
- "padding",
59631
- "paddingX",
59632
- "paddingY",
59633
- "paddingTop",
59634
- "paddingRight",
59635
- "paddingBottom",
59636
- "paddingLeft"
59637
- ];
59638
- function pickScrollBoxPadding(options) {
59639
- if (!options)
59640
- return {};
59641
- const picked = {};
59642
- for (const key of SCROLLBOX_PADDING_KEYS) {
59643
- const value = options[key];
59644
- if (value !== undefined) {
59645
- picked[key] = value;
59646
- }
59647
- }
59648
- return picked;
59649
- }
59650
- function stripScrollBoxPadding(options) {
59651
- const sanitized = { ...options };
59652
- for (const key of SCROLLBOX_PADDING_KEYS) {
59653
- delete sanitized[key];
59654
- }
59655
- return sanitized;
59656
- }
59657
59967
 
59658
59968
  class ScrollBoxRenderable extends BoxRenderable {
59659
59969
  static idCounter = 0;
@@ -59801,38 +60111,27 @@ class ScrollBoxRenderable extends BoxRenderable {
59801
60111
  this._isApplyingStickyScroll = wasApplyingStickyScroll;
59802
60112
  }
59803
60113
  }
59804
- constructor(ctx, options) {
59805
- const {
59806
- wrapperOptions,
59807
- viewportOptions,
59808
- contentOptions,
59809
- rootOptions,
59810
- scrollbarOptions,
59811
- verticalScrollbarOptions,
59812
- horizontalScrollbarOptions,
59813
- stickyScroll = false,
59814
- stickyStart,
59815
- scrollX = false,
59816
- scrollY = true,
59817
- scrollAcceleration,
59818
- viewportCulling = true,
59819
- ...rootBoxOptions
59820
- } = options;
59821
- const forwardedContentPadding = {
59822
- ...pickScrollBoxPadding(rootBoxOptions),
59823
- ...pickScrollBoxPadding(rootOptions)
59824
- };
59825
- const sanitizedRootBoxOptions = stripScrollBoxPadding(rootBoxOptions);
59826
- const sanitizedRootOptions = rootOptions ? stripScrollBoxPadding(rootOptions) : undefined;
59827
- const mergedContentOptions = {
59828
- ...forwardedContentPadding,
59829
- ...contentOptions
59830
- };
60114
+ constructor(ctx, {
60115
+ wrapperOptions,
60116
+ viewportOptions,
60117
+ contentOptions,
60118
+ rootOptions,
60119
+ scrollbarOptions,
60120
+ verticalScrollbarOptions,
60121
+ horizontalScrollbarOptions,
60122
+ stickyScroll = false,
60123
+ stickyStart,
60124
+ scrollX = false,
60125
+ scrollY = true,
60126
+ scrollAcceleration,
60127
+ viewportCulling = true,
60128
+ ...options
60129
+ }) {
59831
60130
  super(ctx, {
59832
60131
  flexDirection: "row",
59833
60132
  alignItems: "stretch",
59834
- ...sanitizedRootBoxOptions,
59835
- ...sanitizedRootOptions
60133
+ ...options,
60134
+ ...rootOptions
59836
60135
  });
59837
60136
  this.internalId = ScrollBoxRenderable.idCounter++;
59838
60137
  this._stickyScroll = stickyScroll;
@@ -59864,7 +60163,7 @@ class ScrollBoxRenderable extends BoxRenderable {
59864
60163
  onSizeChange: () => {
59865
60164
  this.recalculateBarProps();
59866
60165
  },
59867
- ...mergedContentOptions,
60166
+ ...contentOptions,
59868
60167
  id: `scroll-box-content-${this.internalId}`
59869
60168
  });
59870
60169
  this.viewport.add(this.content);
@@ -60180,34 +60479,6 @@ class ScrollBoxRenderable extends BoxRenderable {
60180
60479
  this.requestRender();
60181
60480
  });
60182
60481
  }
60183
- set padding(value) {
60184
- this.content.padding = value;
60185
- this.requestRender();
60186
- }
60187
- set paddingX(value) {
60188
- this.content.paddingX = value;
60189
- this.requestRender();
60190
- }
60191
- set paddingY(value) {
60192
- this.content.paddingY = value;
60193
- this.requestRender();
60194
- }
60195
- set paddingTop(value) {
60196
- this.content.paddingTop = value;
60197
- this.requestRender();
60198
- }
60199
- set paddingRight(value) {
60200
- this.content.paddingRight = value;
60201
- this.requestRender();
60202
- }
60203
- set paddingBottom(value) {
60204
- this.content.paddingBottom = value;
60205
- this.requestRender();
60206
- }
60207
- set paddingLeft(value) {
60208
- this.content.paddingLeft = value;
60209
- this.requestRender();
60210
- }
60211
60482
  set rootOptions(options) {
60212
60483
  Object.assign(this, options);
60213
60484
  this.requestRender();
@@ -60969,8 +61240,8 @@ class TabSelectRenderable extends Renderable {
60969
61240
  }
60970
61241
  }
60971
61242
 
60972
- // node_modules/@opentui/react/chunk-7v2hbtna.js
60973
- init_chunk_2mx7fq49();
61243
+ // node_modules/@opentui/react/chunk-9gg102mq.js
61244
+ init_chunk_eecw9x2f();
60974
61245
  var import_react = __toESM(require_react(), 1);
60975
61246
  var import_react2 = __toESM(require_react(), 1);
60976
61247
  var import_react3 = __toESM(require_react(), 1);
@@ -61097,7 +61368,7 @@ class ErrorBoundary extends import_react3.default.Component {
61097
61368
  }
61098
61369
  var package_default = {
61099
61370
  name: "@opentui/react",
61100
- version: "0.1.84",
61371
+ version: "0.1.83",
61101
61372
  description: "React renderer for building terminal user interfaces using OpenTUI core",
61102
61373
  license: "MIT",
61103
61374
  repository: {
@@ -61432,7 +61703,7 @@ var hostConfig = {
61432
61703
  var reconciler = import_react_reconciler.default(hostConfig);
61433
61704
  if (process.env["DEV"] === "true") {
61434
61705
  try {
61435
- await init_chunk_bdqvmfwv().then(() => exports_chunk_bdqvmfwv);
61706
+ await init_chunk_pm1hna8x().then(() => exports_chunk_pm1hna8x);
61436
61707
  } catch (error) {
61437
61708
  if (error.code === "ERR_MODULE_NOT_FOUND") {
61438
61709
  console.warn(`
@@ -61477,7 +61748,7 @@ function createRoot(renderer) {
61477
61748
  }
61478
61749
 
61479
61750
  // node_modules/@opentui/react/index.js
61480
- init_chunk_2mx7fq49();
61751
+ init_chunk_eecw9x2f();
61481
61752
  var import_react5 = __toESM(require_react(), 1);
61482
61753
  var import_react6 = __toESM(require_react(), 1);
61483
61754
  var import_react7 = __toESM(require_react(), 1);
@@ -61587,8 +61858,6 @@ function Header() {
61587
61858
  const [branch, setBranch] = import_react13.useState("");
61588
61859
  const { isNarrow } = useLayout();
61589
61860
  const cwd = path2.basename(import_config.PROJECT_ROOT);
61590
- const mode = import_config.getMode();
61591
- const modeColors = { default: import_theme.colors.dim, max: import_theme.colors.accent, lite: import_theme.colors.muted };
61592
61861
  import_react13.useEffect(() => {
61593
61862
  try {
61594
61863
  const b2 = execSync("git rev-parse --abbrev-ref HEAD 2>/dev/null", {
@@ -61611,13 +61880,9 @@ function Header() {
61611
61880
  fg: import_theme.colors.dim,
61612
61881
  children: " "
61613
61882
  }),
61614
- /* @__PURE__ */ jsx_runtime.jsxs("span", {
61615
- fg: modeColors[mode] || import_theme.colors.dim,
61616
- children: [
61617
- "[",
61618
- mode,
61619
- "]"
61620
- ]
61883
+ /* @__PURE__ */ jsx_runtime.jsx("span", {
61884
+ fg: import_theme.colors.accent,
61885
+ children: "[max]"
61621
61886
  }),
61622
61887
  /* @__PURE__ */ jsx_runtime.jsx("span", {
61623
61888
  fg: import_theme.colors.dim,
@@ -62267,8 +62532,7 @@ var import_theme14 = __toESM(require_theme(), 1);
62267
62532
  var jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
62268
62533
  var COMMANDS = [
62269
62534
  { cmd: "/help", desc: "Show this menu" },
62270
- { cmd: "/mode", desc: "Show/set mode (default, max, lite)" },
62271
- { cmd: "/compact", desc: "Compact conversation context" },
62535
+ { cmd: "/compact", desc: "Compact/summarize conversation context" },
62272
62536
  { cmd: "/files", desc: "Show project file tree" },
62273
62537
  { cmd: "/clear", desc: "Clear conversation" },
62274
62538
  { cmd: "/cost", desc: "Show session stats" },