@proxysoul/soulforge 1.7.2 → 1.7.5

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 +1627 -1045
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -57838,7 +57838,7 @@ var package_default;
57838
57838
  var init_package = __esm(() => {
57839
57839
  package_default = {
57840
57840
  name: "@proxysoul/soulforge",
57841
- version: "1.7.2",
57841
+ version: "1.7.5",
57842
57842
  description: "Graph-powered code intelligence \u2014 multi-agent coding with codebase-aware AI",
57843
57843
  repository: {
57844
57844
  type: "git",
@@ -59984,7 +59984,7 @@ function supportsAnthropicOptions(modelId) {
59984
59984
  }
59985
59985
  function buildContextEdits(config2, contextWindow, thinkingEnabled) {
59986
59986
  const edits = [];
59987
- if (config2.clearThinking && thinkingEnabled) {
59987
+ if (config2?.clearThinking !== false && thinkingEnabled) {
59988
59988
  edits.push({
59989
59989
  type: "clear_thinking_20251015",
59990
59990
  keep: {
@@ -59993,7 +59993,7 @@ function buildContextEdits(config2, contextWindow, thinkingEnabled) {
59993
59993
  }
59994
59994
  });
59995
59995
  }
59996
- if (config2.clearToolUses) {
59996
+ if (config2?.clearToolUses !== false) {
59997
59997
  edits.push({
59998
59998
  type: "clear_tool_uses_20250919",
59999
59999
  trigger: {
@@ -60005,19 +60005,22 @@ function buildContextEdits(config2, contextWindow, thinkingEnabled) {
60005
60005
  value: 6
60006
60006
  },
60007
60007
  clearToolInputs: true,
60008
- clear_at_least: {
60008
+ clearAtLeast: {
60009
60009
  type: "input_tokens",
60010
60010
  value: 5000
60011
60011
  }
60012
60012
  });
60013
60013
  }
60014
- if (config2.compact && contextWindow >= 200000) {
60014
+ if (config2?.compact && contextWindow >= 200000) {
60015
+ const trigger = Math.max(150000, Math.floor(contextWindow * 0.5));
60015
60016
  edits.push({
60016
60017
  type: "compact_20260112",
60017
60018
  trigger: {
60018
60019
  type: "input_tokens",
60019
- value: Math.floor(contextWindow * 0.75)
60020
- }
60020
+ value: trigger
60021
+ },
60022
+ instructions: ["Write a concise summary of the conversation so far.", "Focus on: files modified, key decisions made, current task progress, and next steps.", "Preserve exact file paths, function names, and error messages.", "Do NOT list what you plan to do \u2014 only what has already been done and what remains.", "Do NOT dump internal state or repeat tool outputs.", "Keep the summary under 2000 tokens.", "Wrap in <summary></summary> tags."].join(`
60023
+ `)
60021
60024
  });
60022
60025
  }
60023
60026
  return edits.length > 0 ? edits : null;
@@ -60048,13 +60051,19 @@ function buildAnthropicOptions(modelId, caps, config2) {
60048
60051
  if (caps.effort && config2.performance?.effort && config2.performance.effort !== "off") {
60049
60052
  opts.effort = config2.performance.effort;
60050
60053
  }
60054
+ if (caps.speed && config2.performance?.speed && config2.performance.speed !== "off") {
60055
+ opts.speed = config2.performance.speed;
60056
+ }
60057
+ if (config2.performance?.toolStreaming === false) {
60058
+ opts.toolStreaming = false;
60059
+ }
60051
60060
  if (config2.performance?.disableParallelToolUse) {
60052
60061
  opts.disableParallelToolUse = true;
60053
60062
  }
60054
60063
  if (config2.performance?.sendReasoning === false) {
60055
60064
  opts.sendReasoning = false;
60056
60065
  }
60057
- if (caps.contextManagement && config2.contextManagement) {
60066
+ if (caps.contextManagement) {
60058
60067
  const contextWindow = getModelContextWindow(modelId);
60059
60068
  const edits = buildContextEdits(config2.contextManagement, contextWindow, thinkingEnabled);
60060
60069
  if (edits) {
@@ -331649,12 +331658,21 @@ function truncate(text2, siteLinks) {
331649
331658
  ${siteLinks.map((l) => `- ${l}`).join(`
331650
331659
  `)}` : "";
331651
331660
  const budget = MAX_CONTENT_LENGTH - linksSection.length;
331652
- const body2 = text2.length > budget ? `${text2.slice(0, budget)}
331653
-
331654
- [...]` : text2;
331661
+ if (text2.length <= budget)
331662
+ return text2 + linksSection;
331663
+ const tailBudget = Math.min(Math.floor(budget * 0.25), 20000);
331664
+ const headBudget = budget - tailBudget;
331665
+ const head = text2.slice(0, headBudget);
331666
+ const tail = text2.slice(-tailBudget);
331667
+ const omitted = text2.length - headBudget - tailBudget;
331668
+ const body2 = `${head}
331669
+
331670
+ [... ${String(Math.round(omitted / 1024))}KB omitted \u2014 ${String(Math.round(text2.length / 1024))}KB total. Showing first ${String(Math.round(headBudget / 1024))}KB + last ${String(Math.round(tailBudget / 1024))}KB. For specific sections, try a sub-page URL from the links below.]
331671
+
331672
+ ${tail}`;
331655
331673
  return body2 + linksSection;
331656
331674
  }
331657
- var import_readability, MAX_CONTENT_LENGTH = 16000, pageCache, CACHE_TTL2, MAX_CACHE_SIZE = 100, lastSweep = 0, lastJinaWarning = null, fetchPageTool;
331675
+ var import_readability, MAX_CONTENT_LENGTH = 120000, pageCache, CACHE_TTL2, MAX_CACHE_SIZE = 100, lastSweep = 0, lastJinaWarning = null, fetchPageTool;
331658
331676
  var init_fetch_page = __esm(() => {
331659
331677
  init_esm10();
331660
331678
  init_secrets();
@@ -342323,6 +342341,82 @@ ${crossTabWarning}` : `Shell: ${desc}
342323
342341
  }),
342324
342342
  ...opts?.codeExecution ? {
342325
342343
  code_execution: createAnthropic().tools.codeExecution_20260120()
342344
+ } : {},
342345
+ ...opts?.computerUse ? {
342346
+ computer: createAnthropic().tools.computer_20251124({
342347
+ displayWidthPx: 1920,
342348
+ displayHeightPx: 1080,
342349
+ execute: async ({
342350
+ action,
342351
+ coordinate,
342352
+ text: text2
342353
+ }) => {
342354
+ return `Computer use action: ${action}${coordinate ? ` at (${coordinate.join(",")})` : ""}${text2 ? ` text: ${text2}` : ""}`;
342355
+ }
342356
+ })
342357
+ } : {},
342358
+ ...opts?.anthropicTextEditor ? {
342359
+ str_replace_based_edit_tool: createAnthropic().tools.textEditor_20250728({
342360
+ async execute({
342361
+ command,
342362
+ path,
342363
+ old_str,
342364
+ new_str,
342365
+ insert_text,
342366
+ file_text,
342367
+ view_range
342368
+ }) {
342369
+ const fs2 = await import("fs");
342370
+ const absPath = path.startsWith("/") ? path : resolve30(effectiveCwd, path);
342371
+ switch (command) {
342372
+ case "view": {
342373
+ if (!fs2.existsSync(absPath))
342374
+ return `File not found: ${path}`;
342375
+ const content = fs2.readFileSync(absPath, "utf-8");
342376
+ const lines = content.split(`
342377
+ `);
342378
+ if (view_range && view_range.length >= 2) {
342379
+ const start2 = view_range[0] ?? 1;
342380
+ const end = view_range[1] ?? lines.length;
342381
+ return lines.slice(start2 - 1, end).map((l, i2) => `${start2 + i2} ${l}`).join(`
342382
+ `);
342383
+ }
342384
+ return lines.map((l, i2) => `${i2 + 1} ${l}`).join(`
342385
+ `);
342386
+ }
342387
+ case "create": {
342388
+ fs2.mkdirSync(resolve30(absPath, ".."), {
342389
+ recursive: true
342390
+ });
342391
+ fs2.writeFileSync(absPath, file_text ?? "", "utf-8");
342392
+ return `Created ${path}`;
342393
+ }
342394
+ case "str_replace": {
342395
+ if (!fs2.existsSync(absPath))
342396
+ return `File not found: ${path}`;
342397
+ const src = fs2.readFileSync(absPath, "utf-8");
342398
+ if (!old_str || !src.includes(old_str))
342399
+ return `old_str not found in ${path}`;
342400
+ fs2.writeFileSync(absPath, src.replace(old_str, new_str ?? ""), "utf-8");
342401
+ return `Applied replacement in ${path}`;
342402
+ }
342403
+ case "insert": {
342404
+ if (!fs2.existsSync(absPath))
342405
+ return `File not found: ${path}`;
342406
+ const orig = fs2.readFileSync(absPath, "utf-8");
342407
+ const origLines = orig.split(`
342408
+ `);
342409
+ const insertLine = view_range?.[0] ?? origLines.length;
342410
+ origLines.splice(insertLine, 0, insert_text ?? "");
342411
+ fs2.writeFileSync(absPath, origLines.join(`
342412
+ `), "utf-8");
342413
+ return `Inserted text at line ${insertLine} in ${path}`;
342414
+ }
342415
+ default:
342416
+ return `Unknown command: ${command}`;
342417
+ }
342418
+ }
342419
+ })
342326
342420
  } : {}
342327
342421
  };
342328
342422
  }
@@ -342874,9 +342968,6 @@ function setApiExportEnabled(v) {
342874
342968
  function isApiExportEnabled() {
342875
342969
  return apiExportEnabled;
342876
342970
  }
342877
- function estimateTokens2(text2) {
342878
- return Math.ceil(text2.length / 4);
342879
- }
342880
342971
  function detectRepeatedCalls(steps, window3 = REPEAT_CALL_WINDOW, threshold = REPEAT_CALL_THRESHOLD) {
342881
342972
  const counts = new Map;
342882
342973
  const start2 = Math.max(0, steps.length - window3);
@@ -342984,6 +343075,11 @@ function buildSummary(toolName, text2, ctx) {
342984
343075
  const entryMatch = text2.match(/(\d+) entries/);
342985
343076
  return `${tag} ${entryMatch ? entryMatch[1] : String(lineCount2)} entries`;
342986
343077
  }
343078
+ if (toolName === "fetch_page" || toolName === "web_search") {
343079
+ const truncated = text2.includes("page truncated");
343080
+ const url2 = typeof args2?.url === "string" ? ` ${args2.url.slice(0, 80)}` : "";
343081
+ return `${tag} ${String(lineCount2)} lines${url2}${truncated ? " (truncated \u2014 cached, try a sub-page URL)" : ""}`;
343082
+ }
342987
343083
  if (toolName === "soul_analyze" || toolName === "soul_impact") {
342988
343084
  const action = typeof args2?.action === "string" ? `${args2.action}: ` : "";
342989
343085
  const firstLine = text2.split(`
@@ -343124,68 +343220,6 @@ function compactOldToolResults(messages, symbolLookup, pathMap) {
343124
343220
  }
343125
343221
  return result;
343126
343222
  }
343127
- function pruneByTokenBudget(messages) {
343128
- const targets = [];
343129
- let totalTokens = 0;
343130
- for (let mi = messages.length - 1;mi >= 0; mi--) {
343131
- const msg = messages[mi];
343132
- if (!msg || msg.role !== "tool" || !Array.isArray(msg.content))
343133
- continue;
343134
- for (let pi = msg.content.length - 1;pi >= 0; pi--) {
343135
- const part = msg.content[pi];
343136
- if (!part || part.type !== "tool-result")
343137
- continue;
343138
- if (EDIT_TOOLS.has(part.toolName))
343139
- continue;
343140
- const text2 = extractText(part.output);
343141
- const tokens = estimateTokens2(text2);
343142
- if (tokens <= 50)
343143
- continue;
343144
- totalTokens += tokens;
343145
- targets.push({
343146
- msgIdx: mi,
343147
- partIdx: pi,
343148
- tokens
343149
- });
343150
- }
343151
- }
343152
- const excess = totalTokens - PRUNE_PROTECT_TOKENS;
343153
- if (excess < PRUNE_MINIMUM_TOKENS)
343154
- return messages;
343155
- let freed = 0;
343156
- const pruneSet = new Set;
343157
- for (let i2 = targets.length - 1;i2 >= 0 && freed < excess; i2--) {
343158
- const t = targets[i2];
343159
- if (!t)
343160
- continue;
343161
- pruneSet.add(`${String(t.msgIdx)}:${String(t.partIdx)}`);
343162
- freed += t.tokens;
343163
- }
343164
- if (pruneSet.size === 0)
343165
- return messages;
343166
- return messages.map((msg, mi) => {
343167
- if (msg.role !== "tool" || !Array.isArray(msg.content))
343168
- return msg;
343169
- let changed = false;
343170
- const newContent = msg.content.map((part, pi) => {
343171
- if (pruneSet.has(`${String(mi)}:${String(pi)}`)) {
343172
- changed = true;
343173
- return {
343174
- ...part,
343175
- output: {
343176
- type: "text",
343177
- value: PRUNED_PLACEHOLDER
343178
- }
343179
- };
343180
- }
343181
- return part;
343182
- });
343183
- return changed ? {
343184
- ...msg,
343185
- content: newContent
343186
- } : msg;
343187
- });
343188
- }
343189
343223
  function buildPrepareStep({
343190
343224
  bus,
343191
343225
  agentId,
@@ -343204,6 +343238,7 @@ function buildPrepareStep({
343204
343238
  const isExplore = role === "explore" || role === "investigate";
343205
343239
  const stepNudgeAt = isExplore ? STEP_NUDGE_EXPLORE : STEP_NUDGE_CODE;
343206
343240
  const maxSteps = isExplore ? EXPLORE_MAX_STEPS : CODE_MAX_STEPS;
343241
+ const previousInjects = [];
343207
343242
  const prepareStep = ({
343208
343243
  stepNumber,
343209
343244
  steps,
@@ -343250,10 +343285,9 @@ function buildPrepareStep({
343250
343285
  }
343251
343286
  if (!disablePruning && stepNumber >= 2) {
343252
343287
  const src = result.messages ?? messages;
343253
- const pruned = pruneByTokenBudget(src);
343254
- if (pruned !== src) {
343255
- const compacted = compactOldToolResults(pruned, symbolLookup);
343256
- result.messages = compacted !== pruned ? compacted : pruned;
343288
+ const compacted = compactOldToolResults(src, symbolLookup);
343289
+ if (compacted !== src) {
343290
+ result.messages = compacted;
343257
343291
  }
343258
343292
  }
343259
343293
  const lastStep = steps.length > 0 ? steps[steps.length - 1] : undefined;
@@ -343339,22 +343373,17 @@ function buildPrepareStep({
343339
343373
  });
343340
343374
  }
343341
343375
  const contextSize = lastStep?.usage.inputTokens ?? 0;
343376
+ const hints = [];
343342
343377
  if (bus && agentId) {
343343
343378
  const unseen = bus.drainUnseenFindings(agentId);
343344
343379
  if (unseen) {
343345
- const existing = result.system ?? "";
343346
- result.system = `${existing}
343347
-
343348
- --- Peer findings (new) ---
343349
- ${unseen}`.trim();
343380
+ hints.push(`--- Peer findings (new) ---
343381
+ ${unseen}`);
343350
343382
  }
343351
343383
  }
343352
343384
  const taskBlock = renderTaskList(tabId);
343353
- if (taskBlock) {
343354
- result.system = `${result.system ?? ""}
343355
-
343356
- ${taskBlock}`.trim();
343357
- }
343385
+ if (taskBlock)
343386
+ hints.push(taskBlock);
343358
343387
  if (stepNumber >= CONSECUTIVE_READ_LIMIT && !nudgeFired) {
343359
343388
  let consecutiveReads = 0;
343360
343389
  for (let i2 = steps.length - 1;i2 >= 0; i2--) {
@@ -343369,53 +343398,32 @@ ${taskBlock}`.trim();
343369
343398
  break;
343370
343399
  }
343371
343400
  if (consecutiveReads >= CONSECUTIVE_READ_LIMIT) {
343372
- const existing = result.system ?? "";
343373
343401
  const hint = isExplore ? `[status: ${String(consecutiveReads)} read-only steps \u2014 summarize findings or use a search tool for remaining questions]` : `[status: ${String(consecutiveReads)} read-only steps \u2014 apply edits with multi_edit]`;
343374
- result.system = `${existing}
343375
-
343376
- ${hint}`.trim();
343402
+ hints.push(hint);
343377
343403
  }
343378
343404
  }
343379
343405
  if (stepNumber >= REPEAT_CALL_THRESHOLD) {
343380
343406
  const repeated = detectRepeatedCalls(steps);
343381
343407
  if (repeated) {
343382
- const existing = result.system ?? "";
343383
- result.system = `${existing}
343384
-
343385
- \uD83D\uDD01 ${repeated.toolName} called ${String(repeated.count)}\xD7 with identical arguments \u2014 same result each time. Use the result you already have, or try a different tool/approach.`.trim();
343408
+ hints.push(`\uD83D\uDD01 ${repeated.toolName} called ${String(repeated.count)}\xD7 with identical arguments \u2014 same result each time. Use the result you already have, or try a different tool/approach.`);
343386
343409
  }
343387
343410
  }
343388
343411
  if (stepNumber >= stepNudgeAt) {
343389
343412
  const remaining = maxSteps - stepNumber;
343390
- const existing = result.system ?? "";
343391
343413
  if (remaining <= 1) {
343392
- const hint = isExplore ? "Write your final text summary NOW. Name files, line numbers, exact values found." : "Apply edits with multi_edit NOW, then summarize what you changed.";
343393
- result.system = `${existing}
343394
-
343395
- \uD83D\uDED1 FINAL STEP. ${hint}`.trim();
343414
+ const hint = isExplore ? "\uD83D\uDED1 FINAL STEP. Write your final text summary NOW. Name files, line numbers, exact values found." : "\uD83D\uDED1 FINAL STEP. Apply edits with multi_edit NOW, then summarize what you changed.";
343415
+ hints.push(hint);
343396
343416
  result.toolChoice = "none";
343397
343417
  result.activeTools = [];
343398
- const msgs = result.messages ?? messages;
343399
- result.messages = [...msgs, {
343400
- role: "user",
343401
- content: [{
343402
- type: "text",
343403
- text: `FINAL step \u2014 write your text summary now: what you found or changed, which files, key details.`
343404
- }]
343405
- }];
343406
343418
  } else if (remaining <= 2) {
343407
- const hint = isExplore ? "Write your text summary NOW. Name files, line numbers, exact values." : "Apply edits with multi_edit NOW, then summarize what you changed.";
343408
- result.system = `${existing}
343409
-
343410
- \uD83D\uDED1 ${String(remaining)} steps left. ${hint}`.trim();
343419
+ const hint = isExplore ? `\uD83D\uDED1 ${String(remaining)} steps left. Write your text summary NOW. Name files, line numbers, exact values.` : `\uD83D\uDED1 ${String(remaining)} steps left. Apply edits with multi_edit NOW, then summarize what you changed.`;
343420
+ hints.push(hint);
343411
343421
  if (!isExplore) {
343412
343422
  result.activeTools = ["edit_file", "multi_edit", "done", "report_finding"];
343413
343423
  }
343414
343424
  } else {
343415
- const hint = isExplore ? "Write your text summary soon. Name files, line numbers, exact values found." : "Apply your edits NOW with multi_edit.";
343416
- result.system = `${existing}
343417
-
343418
- \u26A0 Step ${String(stepNumber)}/${String(maxSteps)} \u2014 ${String(remaining)} steps left. ${hint}`.trim();
343425
+ const hint = isExplore ? `\u26A0 Step ${String(stepNumber)}/${String(maxSteps)} \u2014 ${String(remaining)} steps left. Write your text summary soon. Name files, line numbers, exact values found.` : `\u26A0 Step ${String(stepNumber)}/${String(maxSteps)} \u2014 ${String(remaining)} steps left. Apply your edits NOW with multi_edit.`;
343426
+ hints.push(hint);
343419
343427
  }
343420
343428
  }
343421
343429
  if (contextSize > nudgeThreshold) {
@@ -343429,17 +343437,41 @@ ${hint}`.trim();
343429
343437
  agentId
343430
343438
  });
343431
343439
  }
343432
- const msgs = result.messages ?? messages;
343433
- result.messages = [...msgs, {
343434
- role: "user",
343435
- content: [{
343436
- type: "text",
343437
- text: "Stop calling tools. Write a concise text summary now: what you found or changed, which files, key details."
343438
- }]
343439
- }];
343440
+ hints.push("Stop calling tools. Write a concise text summary now: what you found or changed, which files, key details.");
343440
343441
  result.toolChoice = "none";
343441
343442
  result.activeTools = [];
343442
343443
  }
343444
+ if (hints.length > 0 || previousInjects.length > 0) {
343445
+ const msgs = result.messages ?? [...sanitizedMessages ?? messages];
343446
+ const cleanMsgCount = msgs.length;
343447
+ let offset = 0;
343448
+ for (const prev of previousInjects) {
343449
+ const insertAt = prev.cleanInsertAt + offset;
343450
+ if (insertAt <= msgs.length) {
343451
+ msgs.splice(insertAt, 0, prev.message);
343452
+ offset++;
343453
+ }
343454
+ }
343455
+ if (hints.length > 0) {
343456
+ const injectMessage = {
343457
+ role: "user",
343458
+ content: [{
343459
+ type: "text",
343460
+ text: hints.map((h) => `<system-reminder>
343461
+ ${h}
343462
+ </system-reminder>`).join(`
343463
+
343464
+ `)
343465
+ }]
343466
+ };
343467
+ previousInjects.push({
343468
+ cleanInsertAt: cleanMsgCount,
343469
+ message: injectMessage
343470
+ });
343471
+ msgs.push(injectMessage);
343472
+ }
343473
+ result.messages = msgs;
343474
+ }
343443
343475
  return Object.keys(result).length > 0 ? result : undefined;
343444
343476
  };
343445
343477
  const tokenStop = ({
@@ -343474,7 +343506,7 @@ function buildSymbolLookup(repoMap) {
343474
343506
  return repoMap.getFileSymbolsCached(rel);
343475
343507
  };
343476
343508
  }
343477
- var apiExportEnabled = false, OUTPUT_NUDGE_PCT = 0.8, HARD_STOP_PCT = 0.9, DEFAULT_CONTEXT_WINDOW = 200000, MAX_SUBAGENT_CONTEXT = 200000, KEEP_RECENT_MESSAGES = 4, PRUNE_PROTECT_TOKENS = 40000, PRUNE_MINIMUM_TOKENS = 20000, PRUNED_PLACEHOLDER = "[Old tool result content cleared]", EXPLORE_MAX_STEPS = 28, CODE_MAX_STEPS = 18, STEP_NUDGE_EXPLORE = 18, STEP_NUDGE_CODE = 10, CONSECUTIVE_READ_LIMIT = 5, REPEAT_CALL_THRESHOLD = 3, REPEAT_CALL_WINDOW = 8, READ_TOOL_NAMES, SUMMARIZABLE_TOOLS, EDIT_TOOLS;
343509
+ var apiExportEnabled = false, OUTPUT_NUDGE_PCT = 0.8, HARD_STOP_PCT = 0.9, DEFAULT_CONTEXT_WINDOW = 200000, MAX_SUBAGENT_CONTEXT = 200000, KEEP_RECENT_MESSAGES = 4, EXPLORE_MAX_STEPS = 28, CODE_MAX_STEPS = 18, STEP_NUDGE_EXPLORE = 18, STEP_NUDGE_CODE = 10, CONSECUTIVE_READ_LIMIT = 5, REPEAT_CALL_THRESHOLD = 3, REPEAT_CALL_WINDOW = 8, READ_TOOL_NAMES, SUMMARIZABLE_TOOLS, EDIT_TOOLS;
343478
343510
  var init_step_utils = __esm(() => {
343479
343511
  init_dist10();
343480
343512
  init_task_list();
@@ -343513,19 +343545,27 @@ function createCodeAgent(model, options) {
343513
343545
  const agentId = options?.agentId;
343514
343546
  const hasBus = !!(bus && agentId);
343515
343547
  const busTools = hasBus ? buildBusTools(bus, agentId, "code") : {};
343516
- let tools = buildSubagentCodeTools({
343517
- webSearchModel: options?.webSearchModel,
343518
- onApproveWebSearch: options?.onApproveWebSearch,
343519
- onApproveFetchPage: options?.onApproveFetchPage,
343520
- repoMap: options?.repoMap
343521
- });
343522
- if (hasBus) {
343523
- tools = wrapWithBusCache(tools, bus, agentId, options?.repoMap);
343548
+ let allTools;
343549
+ if (options?.forgeTools) {
343550
+ allTools = {
343551
+ ...options.forgeTools,
343552
+ ...busTools
343553
+ };
343554
+ } else {
343555
+ let tools = buildSubagentCodeTools({
343556
+ webSearchModel: options?.webSearchModel,
343557
+ onApproveWebSearch: options?.onApproveWebSearch,
343558
+ onApproveFetchPage: options?.onApproveFetchPage,
343559
+ repoMap: options?.repoMap
343560
+ });
343561
+ if (hasBus) {
343562
+ tools = wrapWithBusCache(tools, bus, agentId, options?.repoMap);
343563
+ }
343564
+ allTools = {
343565
+ ...tools,
343566
+ ...busTools
343567
+ };
343524
343568
  }
343525
- const allTools = {
343526
- ...tools,
343527
- ...busTools
343528
- };
343529
343569
  const {
343530
343570
  prepareStep,
343531
343571
  stopConditions
@@ -343613,19 +343653,27 @@ function createExploreAgent(model, options) {
343613
343653
  const agentId = options?.agentId;
343614
343654
  const hasBus = !!(bus && agentId);
343615
343655
  const busTools = hasBus ? buildBusTools(bus, agentId, "explore") : {};
343616
- let tools = buildSubagentExploreTools({
343617
- webSearchModel: options?.webSearchModel,
343618
- onApproveWebSearch: options?.onApproveWebSearch,
343619
- onApproveFetchPage: options?.onApproveFetchPage,
343620
- repoMap: options?.repoMap
343621
- });
343622
- if (hasBus) {
343623
- tools = wrapWithBusCache(tools, bus, agentId, options?.repoMap);
343656
+ let allTools;
343657
+ if (options?.forgeTools) {
343658
+ allTools = {
343659
+ ...options.forgeTools,
343660
+ ...busTools
343661
+ };
343662
+ } else {
343663
+ let tools = buildSubagentExploreTools({
343664
+ webSearchModel: options?.webSearchModel,
343665
+ onApproveWebSearch: options?.onApproveWebSearch,
343666
+ onApproveFetchPage: options?.onApproveFetchPage,
343667
+ repoMap: options?.repoMap
343668
+ });
343669
+ if (hasBus) {
343670
+ tools = wrapWithBusCache(tools, bus, agentId, options?.repoMap);
343671
+ }
343672
+ allTools = {
343673
+ ...tools,
343674
+ ...busTools
343675
+ };
343624
343676
  }
343625
- const allTools = {
343626
- ...tools,
343627
- ...busTools
343628
- };
343629
343677
  const {
343630
343678
  prepareStep,
343631
343679
  stopConditions
@@ -344809,6 +344857,25 @@ var init_agent_verification = __esm(() => {
344809
344857
  // src/core/agents/subagent-tools.ts
344810
344858
  import { readFile as fsReadFile } from "fs/promises";
344811
344859
  import { isAbsolute as pathIsAbsolute, resolve as pathResolve } from "path";
344860
+ function guardForgeTools(forgeTools, role) {
344861
+ const blocked = role === "code" ? CODE_BLOCKED : EXPLORE_BLOCKED;
344862
+ const guarded = {};
344863
+ const rejectMsg = (name21) => `${name21} is not available in ${role} mode. Use report_finding to suggest changes instead.`;
344864
+ for (const [name21, t] of Object.entries(forgeTools)) {
344865
+ if (blocked.has(name21)) {
344866
+ guarded[name21] = {
344867
+ ...t,
344868
+ execute: async () => ({
344869
+ success: false,
344870
+ error: rejectMsg(name21)
344871
+ })
344872
+ };
344873
+ } else {
344874
+ guarded[name21] = t;
344875
+ }
344876
+ }
344877
+ return guarded;
344878
+ }
344812
344879
  function formatToolArgs(toolCall) {
344813
344880
  const a = toolCall.input ?? {};
344814
344881
  if (toolCall.toolName === "read_file" && a.path)
@@ -344952,6 +345019,8 @@ function createAgent(task, models, bus, parentToolCallId) {
344952
345019
  }
344953
345020
  const contextWindow = getModelContextWindow(modelId);
344954
345021
  const forgeInstructions = useMiniForge ? models.forgeInstructions : undefined;
345022
+ const agentRole = useExplore ? task.role === "investigate" ? "investigate" : "explore" : "code";
345023
+ const forgeToolsGuarded = useMiniForge && models.forgeTools ? guardForgeTools(models.forgeTools, agentRole) : undefined;
344955
345024
  const opts = {
344956
345025
  bus,
344957
345026
  agentId: task.agentId,
@@ -344964,9 +345033,10 @@ function createAgent(task, models, bus, parentToolCallId) {
344964
345033
  repoMap: models.repoMap,
344965
345034
  contextWindow,
344966
345035
  disablePruning: models.disablePruning,
344967
- role: task.role === "investigate" ? "investigate" : "explore",
345036
+ role: agentRole === "code" ? "explore" : agentRole,
344968
345037
  tabId: models.tabId,
344969
- forgeInstructions
345038
+ forgeInstructions,
345039
+ forgeTools: forgeToolsGuarded
344970
345040
  };
344971
345041
  const hasPreloadedFiles = !useExplore && task.task.includes("--- Preloaded file contents");
344972
345042
  const agent = useExplore ? createExploreAgent(model, opts) : createCodeAgent(model, {
@@ -345934,7 +346004,7 @@ ${value}
345934
346004
  })
345935
346005
  };
345936
346006
  }
345937
- var SKILL_TOKEN_RE, SKILL_MATCH_THRESHOLD = 2, SKILL_NAME_WEIGHT = 3, SKILL_PREVIEW_CHARS = 200, SKILL_MAX_INJECT_CHARS = 2000, PRELOAD_FULL_FILE_MAX_LINES = 500, PRELOAD_TOTAL_MAX_CHARS = 80000;
346007
+ var EXPLORE_BLOCKED, CODE_BLOCKED, SKILL_TOKEN_RE, SKILL_MATCH_THRESHOLD = 2, SKILL_NAME_WEIGHT = 3, SKILL_PREVIEW_CHARS = 200, SKILL_MAX_INJECT_CHARS = 2000, PRELOAD_FULL_FILE_MAX_LINES = 500, PRELOAD_TOTAL_MAX_CHARS = 80000;
345938
346008
  var init_subagent_tools = __esm(() => {
345939
346009
  init_dist10();
345940
346010
  init_zod();
@@ -345950,6 +346020,8 @@ var init_subagent_tools = __esm(() => {
345950
346020
  init_code();
345951
346021
  init_explore();
345952
346022
  init_subagent_events();
346023
+ EXPLORE_BLOCKED = new Set(["edit_file", "multi_edit", "write_file", "create_file", "rename_symbol", "move_symbol", "refactor", "dispatch", "shell"]);
346024
+ CODE_BLOCKED = new Set(["dispatch"]);
345953
346025
  SKILL_TOKEN_RE = /[a-z0-9]+/gi;
345954
346026
  });
345955
346027
 
@@ -345981,6 +346053,7 @@ function lastStepHadPlanCall(messages) {
345981
346053
  return false;
345982
346054
  }
345983
346055
  function buildForgePrepareStep(isPlanMode, drainSteering, contextManager, tabId) {
346056
+ const previousInjects = [];
345984
346057
  return ({
345985
346058
  stepNumber,
345986
346059
  messages
@@ -346069,17 +346142,33 @@ Finish any in-progress tool call, then switch entirely to this message in your n
346069
346142
  </steering>`);
346070
346143
  }
346071
346144
  }
346072
- if (tailParts.length > 0) {
346145
+ if (tailParts.length > 0 || previousInjects.length > 0) {
346073
346146
  const msgs = result.messages ?? [...sanitized];
346074
- msgs.push({
346075
- role: "user",
346076
- content: [{
346077
- type: "text",
346078
- text: tailParts.join(`
346147
+ const cleanMsgCount = msgs.length;
346148
+ let offset = 0;
346149
+ for (const prev of previousInjects) {
346150
+ const insertAt = prev.cleanInsertAt + offset;
346151
+ if (insertAt <= msgs.length) {
346152
+ msgs.splice(insertAt, 0, prev.message);
346153
+ offset++;
346154
+ }
346155
+ }
346156
+ if (tailParts.length > 0) {
346157
+ const injectMessage = {
346158
+ role: "user",
346159
+ content: [{
346160
+ type: "text",
346161
+ text: tailParts.join(`
346079
346162
 
346080
346163
  `)
346081
- }]
346082
- });
346164
+ }]
346165
+ };
346166
+ previousInjects.push({
346167
+ cleanInsertAt: cleanMsgCount,
346168
+ message: injectMessage
346169
+ });
346170
+ msgs.push(injectMessage);
346171
+ }
346083
346172
  result.messages = msgs;
346084
346173
  }
346085
346174
  if (process.env.SOULFORGE_DEBUG_API) {
@@ -346208,6 +346297,8 @@ function createForgeAgent({
346208
346297
  providerOptions,
346209
346298
  headers,
346210
346299
  codeExecution: codeExecution3,
346300
+ computerUse,
346301
+ anthropicTextEditor,
346211
346302
  cwd: cwd2,
346212
346303
  sessionId,
346213
346304
  sharedCacheRef,
@@ -346225,11 +346316,14 @@ function createForgeAgent({
346225
346316
  const modelId = typeof model === "object" && model !== null && "modelId" in model ? String(model.modelId) : "";
346226
346317
  if (modelId)
346227
346318
  contextManager.setActiveModel(modelId);
346228
- const canUseCodeExecution = codeExecution3 && isAnthropicNative(modelId);
346319
+ const isAnthropic = isAnthropicNative(modelId);
346320
+ const canUseCodeExecution = codeExecution3 && isAnthropic;
346229
346321
  const onDemandEnabled = !disabledTools?.has("request_tools") && !isRestricted && !planExecution;
346230
346322
  const activeDeferredTools = onDemandEnabled ? new Set : undefined;
346231
346323
  const directTools = buildTools(undefined, editorIntegration, onApproveWebSearch, {
346232
346324
  codeExecution: canUseCodeExecution,
346325
+ computerUse: computerUse && isAnthropic,
346326
+ anthropicTextEditor: anthropicTextEditor && isAnthropic,
346233
346327
  contextManager,
346234
346328
  agentSkills: !disabledTools?.has("skills"),
346235
346329
  webSearchModel,
@@ -346242,6 +346336,7 @@ function createForgeAgent({
346242
346336
  activeDeferredTools
346243
346337
  });
346244
346338
  const forgeInstructions = buildInstructions(contextManager, modelId);
346339
+ const forgeTools = directTools;
346245
346340
  const subagentHeaders = detectModelFamily(modelId) === "openai" && sessionId ? {
346246
346341
  ...headers,
346247
346342
  "x-prompt-cache-key": sessionId
@@ -346262,7 +346357,8 @@ function createForgeAgent({
346262
346357
  skills,
346263
346358
  disablePruning,
346264
346359
  tabId: tabId ?? contextManager.getTabId() ?? undefined,
346265
- forgeInstructions
346360
+ forgeInstructions,
346361
+ forgeTools
346266
346362
  }).dispatch
346267
346363
  } : buildSubagentTools({
346268
346364
  defaultModel: model,
@@ -346282,7 +346378,8 @@ function createForgeAgent({
346282
346378
  skills,
346283
346379
  disablePruning,
346284
346380
  tabId: tabId ?? contextManager.getTabId() ?? undefined,
346285
- forgeInstructions
346381
+ forgeInstructions,
346382
+ forgeTools
346286
346383
  });
346287
346384
  const cachedReadFile = sharedCacheRef && agentFeatures?.dispatchCache !== false ? wrapReadFileWithDispatchCache(directTools.read_file, sharedCacheRef, cwd2) : directTools.read_file;
346288
346385
  const allTools = {
@@ -360473,11 +360570,14 @@ Be concise, direct, and to the point. Match response length to question complexi
360473
360570
  Output text to communicate with the user \u2014 all text outside tool use is displayed.
360474
360571
  Use Github-flavored markdown. Code blocks with language hints.
360475
360572
  Minimize output tokens while maintaining helpfulness, quality, and accuracy.
360476
- Skip narration ("Let me now...", "I have enough context") \u2014 just call the tool or write the code.
360477
- Skip summaries of what you just did \u2014 the user sees tool calls in real-time.
360478
- Go straight to the answer. No transition sentences, no restating the question.
360479
360573
  Answer concisely \u2014 fewer than 4 lines unless the user asks for detail.
360480
360574
 
360575
+ # Silent tool use
360576
+ Stay silent while gathering information. When you need to read files, search, or explore \u2014 just call the tools with zero surrounding text. Emit text only when you have something meaningful to tell the user: an answer, a question, a decision, or a result.
360577
+ Good: [tool call] \u2192 [tool call] \u2192 [tool call] \u2192 "Here's what I found: ..."
360578
+ Bad: "Let me check..." \u2192 [tool call] \u2192 "Now let me look at..." \u2192 [tool call] \u2192 "I see the pattern..."
360579
+ The user sees tool calls in real-time \u2014 your narration between them adds noise, not value. Go straight to the answer once you have it.
360580
+
360481
360581
  # Doing tasks
360482
360582
  When given a software engineering task:
360483
360583
  1. Read the Soul Map first \u2014 it has files, symbols, line numbers, and dependencies
@@ -360502,8 +360602,10 @@ var init_default = __esm(() => {
360502
360602
 
360503
360603
  # Tone and style
360504
360604
  Be concise and direct. Use Github-flavored markdown. Code blocks with language hints.
360505
- Minimize output tokens while maintaining quality. No preamble, no postamble.
360506
- Do not summarize actions you just took. Answer concisely.
360605
+ Minimize output tokens while maintaining quality. Answer concisely.
360606
+
360607
+ # Silent tool use
360608
+ Stay silent while gathering information. When you need to read files, search, or explore \u2014 just call the tools with zero surrounding text. Emit text only when you have something meaningful to tell the user: an answer, a question, a decision, or a result.
360507
360609
 
360508
360610
  # Doing tasks
360509
360611
  1. Use search tools to understand the codebase. Use the Task tool for broad exploration.
@@ -360528,9 +360630,12 @@ var init_google2 = __esm(() => {
360528
360630
 
360529
360631
  # Tone and style
360530
360632
  Use Github-flavored markdown. Code blocks with language hints.
360531
- Minimize output tokens. Do not summarize what you just did.
360633
+ Minimize output tokens.
360532
360634
  Answer concisely \u2014 fewer than 4 lines unless the user asks for detail.
360533
360635
 
360636
+ # Silent tool use
360637
+ Stay silent while gathering information. When you need to read files, search, or explore \u2014 just call the tools with zero surrounding text. Emit text only when you have something meaningful to tell the user: an answer, a question, a decision, or a result. The user sees tool calls in real-time \u2014 narration between them adds noise, not value.
360638
+
360534
360639
  # Primary Workflow
360535
360640
  1. **Understand**: Use search tools and the Task tool for exploration. Use direct tools for targeted lookups.
360536
360641
  2. **Implement**: Make changes using edit tools. Read files once, plan all changes, apply in one call.
@@ -360551,10 +360656,12 @@ If you are not sure about file content or codebase structure, use your tools to
360551
360656
 
360552
360657
  # Tone and style
360553
360658
  Be concise and direct. Use Github-flavored markdown. Code blocks with language hints.
360554
- Minimize output tokens while maintaining quality. Do not add preamble or postamble.
360555
- Do not summarize actions you just took \u2014 the user sees tool calls in real-time.
360659
+ Minimize output tokens while maintaining quality.
360556
360660
  Answer concisely \u2014 fewer than 4 lines unless the user asks for detail.
360557
360661
 
360662
+ # Silent tool use
360663
+ Stay silent while gathering information. When you need to read files, search, or explore \u2014 just call the tools with zero surrounding text. Emit text only when you have something meaningful to tell the user: an answer, a question, a decision, or a result. The user sees tool calls in real-time \u2014 narration between them adds noise, not value.
360664
+
360558
360665
  # Coding guidelines
360559
360666
  - Fix problems at the root cause, not surface-level patches
360560
360667
  - Avoid unneeded complexity. Ignore unrelated bugs \u2014 not your responsibility
@@ -430409,7 +430516,7 @@ var init_navigation = __esm(() => {
430409
430516
  // src/core/commands/proxy.ts
430410
430517
  async function cleanupProxySelections(ctx) {
430411
430518
  if (ctx.chat.activeModel.startsWith("proxy/")) {
430412
- ctx.chat.setActiveModel("none");
430519
+ ctx.syncActiveModel("none");
430413
430520
  ctx.saveToScope({
430414
430521
  defaultModel: "none"
430415
430522
  }, ctx.detectScope("defaultModel"));
@@ -430666,6 +430773,13 @@ async function handleProxyLogin(_input, ctx) {
430666
430773
  label: ok ? "Authentication complete." : "Authentication failed.",
430667
430774
  color: ok ? getThemeTokens().success : getThemeTokens().brandSecondary
430668
430775
  });
430776
+ if (ok && ctx.chat.activeModel === "none") {
430777
+ loginLines.push({
430778
+ type: "text",
430779
+ label: "Press Ctrl+L or type /model to select a proxy model.",
430780
+ color: getThemeTokens().textSecondary
430781
+ });
430782
+ }
430669
430783
  updatePopup([...loginLines]);
430670
430784
  }).catch((err2) => {
430671
430785
  const msg = err2 instanceof Error ? err2.message : String(err2);
@@ -436450,12 +436564,6 @@ var init_Footer = __esm(async () => {
436450
436564
  l: "Tab",
436451
436565
  ls: "Tab",
436452
436566
  tier: 3
436453
- }, {
436454
- k: "^X",
436455
- ic: icon("stop"),
436456
- l: "Stop",
436457
- ls: "Stop",
436458
- tier: 3
436459
436567
  }, {
436460
436568
  k: "^C",
436461
436569
  ic: icon("quit"),
@@ -437652,7 +437760,7 @@ function pruneOldToolResults(msgs) {
437652
437760
  continue;
437653
437761
  const text3 = typeof p2.output === "string" ? p2.output : typeof p2.output?.value === "string" ? p2.output.value : JSON.stringify(p2.output ?? "");
437654
437762
  const tokens = Math.round(text3.length / CHARS_PER_TOKEN2);
437655
- if (protectedTokens < PRUNE_PROTECT_TOKENS2) {
437763
+ if (protectedTokens < PRUNE_PROTECT_TOKENS) {
437656
437764
  protectedTokens += tokens;
437657
437765
  } else {
437658
437766
  prunableTokens += tokens;
@@ -437660,7 +437768,7 @@ function pruneOldToolResults(msgs) {
437660
437768
  }
437661
437769
  }
437662
437770
  }
437663
- if (prunableTokens < PRUNE_MINIMUM_TOKENS2 || toPrune.size === 0)
437771
+ if (prunableTokens < PRUNE_MINIMUM_TOKENS || toPrune.size === 0)
437664
437772
  return msgs;
437665
437773
  return msgs.map((msg, idx) => {
437666
437774
  if (!toPrune.has(idx))
@@ -438833,6 +438941,8 @@ ${description}`,
438833
438941
  providerOptions,
438834
438942
  headers,
438835
438943
  codeExecution: effectiveConfig2.codeExecution,
438944
+ computerUse: effectiveConfig2.computerUse,
438945
+ anthropicTextEditor: effectiveConfig2.anthropicTextEditor,
438836
438946
  cwd: cwd2,
438837
438947
  sessionId: sessionIdRef.current,
438838
438948
  sharedCacheRef: sharedCacheRef.current,
@@ -438874,6 +438984,8 @@ ${description}`,
438874
438984
  providerOptions: degraded.providerOptions,
438875
438985
  headers: degraded.headers,
438876
438986
  codeExecution: effectiveConfig2.codeExecution,
438987
+ computerUse: effectiveConfig2.computerUse,
438988
+ anthropicTextEditor: effectiveConfig2.anthropicTextEditor,
438877
438989
  cwd: cwd2,
438878
438990
  sessionId: sessionIdRef.current,
438879
438991
  sharedCacheRef: sharedCacheRef.current,
@@ -439781,7 +439893,7 @@ ${pContent}`;
439781
439893
  cycleMode: cycleModeFn
439782
439894
  };
439783
439895
  }
439784
- var import_react32, ZERO_USAGE2, CHARS_PER_TOKEN2 = 4, PRUNE_PROTECT_TOKENS2 = 40000, PRUNE_MINIMUM_TOKENS2 = 20000;
439896
+ var import_react32, ZERO_USAGE2, CHARS_PER_TOKEN2 = 4, PRUNE_PROTECT_TOKENS = 40000, PRUNE_MINIMUM_TOKENS = 20000;
439785
439897
  var init_useChat = __esm(() => {
439786
439898
  init_dist10();
439787
439899
  init_agent_bus();
@@ -440189,7 +440301,8 @@ var init_InputBox = __esm(async () => {
440189
440301
  return results;
440190
440302
  }, [showAutocomplete, commandToken]);
440191
440303
  const hasMatches = matches3.length > 0;
440192
- const isCommandPrefix = hasMatches && matches3.some((m_0) => m_0.cmd.startsWith(commandToken.trimEnd()));
440304
+ const trimmedToken = commandToken.trimEnd();
440305
+ const isCommandPrefix = hasMatches && (matches3.some((m_0) => m_0.cmd.startsWith(trimmedToken)) || !trimmedToken.includes(" ", 1));
440193
440306
  const hasMatchesForNav = hasMatches && isCommandPrefix;
440194
440307
  const ghost = hasMatchesForNav && matches3[selectedIdx]?.cmd.startsWith(commandToken) ? matches3[selectedIdx].cmd.slice(value.length) : "";
440195
440308
  const maxVisible = Math.min(8, Math.max(4, Math.floor(termRows * 0.25)));
@@ -440239,7 +440352,8 @@ var init_InputBox = __esm(async () => {
440239
440352
  setVisualLines(1);
440240
440353
  }, []);
440241
440354
  const handleSubmit = import_react34.useCallback((input_0) => {
440242
- if (hasMatchesForNav && matches3[selectedIdx]) {
440355
+ const useAutocomplete = hasMatchesForNav || showAutocomplete && hasMatches && matches3[selectedIdx];
440356
+ if (useAutocomplete && matches3[selectedIdx]) {
440243
440357
  const completed_0 = matches3[selectedIdx].cmd;
440244
440358
  if (completed_0 === "/open" || completed_0 === "/git branch") {
440245
440359
  const withSpace = `${completed_0} `;
@@ -440271,7 +440385,7 @@ var init_InputBox = __esm(async () => {
440271
440385
  pushHistory(finalInput.trim());
440272
440386
  onSubmit(finalInput.trim());
440273
440387
  resetInput();
440274
- }, [matches3, selectedIdx, pushHistory, onSubmit, resetInput, isLoading, isCompacting, onQueue, hasMatchesForNav]);
440388
+ }, [matches3, selectedIdx, pushHistory, onSubmit, resetInput, isLoading, isCompacting, onQueue, hasMatchesForNav, showAutocomplete, hasMatches]);
440275
440389
  const handleContentChange = import_react34.useCallback(() => {
440276
440390
  const text_0 = textareaRef.current?.plainText ?? "";
440277
440391
  if (isNavigatingHistory.current) {
@@ -442106,435 +442220,6 @@ var init_StructuredPlanView = __esm(async () => {
442106
442220
  };
442107
442221
  });
442108
442222
 
442109
- // src/components/chat/ReasoningBlock.tsx
442110
- function ThinkingSpinner() {
442111
- const $5 = import_compiler_runtime14.c(3);
442112
- const t2 = useTheme();
442113
- const frame = useSpinnerFrame();
442114
- const t0 = SPINNER_FRAMES[frame];
442115
- let t1;
442116
- if ($5[0] !== t2.brandDim || $5[1] !== t0) {
442117
- t1 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442118
- fg: t2.brandDim,
442119
- children: t0
442120
- }, undefined, false, undefined, this);
442121
- $5[0] = t2.brandDim;
442122
- $5[1] = t0;
442123
- $5[2] = t1;
442124
- } else {
442125
- t1 = $5[2];
442126
- }
442127
- return t1;
442128
- }
442129
- function ReasoningBlock(t0) {
442130
- const $5 = import_compiler_runtime14.c(90);
442131
- const {
442132
- content,
442133
- expanded,
442134
- isStreaming,
442135
- id
442136
- } = t0;
442137
- const t2 = useTheme();
442138
- let t1;
442139
- if ($5[0] !== content || $5[1] !== expanded || $5[2] !== id || $5[3] !== isStreaming || $5[4] !== t2.success || $5[5] !== t2.textFaint || $5[6] !== t2.textSubtle) {
442140
- t1 = Symbol.for("react.early_return_sentinel");
442141
- bb0: {
442142
- const lines = content.split(`
442143
- `);
442144
- const lineCount2 = lines.length;
442145
- if (!expanded) {
442146
- if (isStreaming) {
442147
- const t24 = `${id}-col`;
442148
- let t33;
442149
- if ($5[8] === Symbol.for("react.memo_cache_sentinel")) {
442150
- t33 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ThinkingSpinner, {}, undefined, false, undefined, this);
442151
- $5[8] = t33;
442152
- } else {
442153
- t33 = $5[8];
442154
- }
442155
- const t43 = t2.textFaint;
442156
- let t53;
442157
- if ($5[9] === Symbol.for("react.memo_cache_sentinel")) {
442158
- t53 = brainIcon();
442159
- $5[9] = t53;
442160
- } else {
442161
- t53 = $5[9];
442162
- }
442163
- let t63;
442164
- if ($5[10] !== t2.textFaint) {
442165
- t63 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442166
- fg: t43,
442167
- children: [
442168
- " ",
442169
- t53,
442170
- " reasoning"
442171
- ]
442172
- }, undefined, true, undefined, this);
442173
- $5[10] = t2.textFaint;
442174
- $5[11] = t63;
442175
- } else {
442176
- t63 = $5[11];
442177
- }
442178
- let t73;
442179
- if ($5[12] !== lineCount2 || $5[13] !== t2.textFaint) {
442180
- t73 = lineCount2 > 1 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442181
- fg: t2.textFaint,
442182
- children: [
442183
- " (",
442184
- String(lineCount2),
442185
- " lines)"
442186
- ]
442187
- }, undefined, true, undefined, this);
442188
- $5[12] = lineCount2;
442189
- $5[13] = t2.textFaint;
442190
- $5[14] = t73;
442191
- } else {
442192
- t73 = $5[14];
442193
- }
442194
- let t83;
442195
- if ($5[15] !== t2.textSubtle) {
442196
- t83 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442197
- fg: t2.textSubtle,
442198
- children: " ^O"
442199
- }, undefined, false, undefined, this);
442200
- $5[15] = t2.textSubtle;
442201
- $5[16] = t83;
442202
- } else {
442203
- t83 = $5[16];
442204
- }
442205
- let t93;
442206
- if ($5[17] !== t24 || $5[18] !== t63 || $5[19] !== t73 || $5[20] !== t83) {
442207
- t93 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
442208
- height: 1,
442209
- flexShrink: 0,
442210
- flexDirection: "row",
442211
- children: [
442212
- t33,
442213
- t63,
442214
- t73,
442215
- t83
442216
- ]
442217
- }, t24, true, undefined, this);
442218
- $5[17] = t24;
442219
- $5[18] = t63;
442220
- $5[19] = t73;
442221
- $5[20] = t83;
442222
- $5[21] = t93;
442223
- } else {
442224
- t93 = $5[21];
442225
- }
442226
- t1 = t93;
442227
- break bb0;
442228
- }
442229
- const firstLine = (lines[0] ?? "").trim().replace(/\*\*/g, "");
442230
- const preview = firstLine.length > 60 ? `${firstLine.slice(0, 57)}...` : firstLine;
442231
- const t23 = `${id}-col`;
442232
- const t32 = t2.textFaint;
442233
- let t42;
442234
- if ($5[22] !== t2.success) {
442235
- t42 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
442236
- fg: t2.success,
442237
- children: "\u2713"
442238
- }, undefined, false, undefined, this);
442239
- $5[22] = t2.success;
442240
- $5[23] = t42;
442241
- } else {
442242
- t42 = $5[23];
442243
- }
442244
- let t52;
442245
- if ($5[24] === Symbol.for("react.memo_cache_sentinel")) {
442246
- t52 = brainIcon();
442247
- $5[24] = t52;
442248
- } else {
442249
- t52 = $5[24];
442250
- }
442251
- const t62 = preview || "Reasoned";
442252
- let t72;
442253
- if ($5[25] !== t2.textFaint || $5[26] !== t62) {
442254
- t72 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
442255
- fg: t2.textFaint,
442256
- children: t62
442257
- }, undefined, false, undefined, this);
442258
- $5[25] = t2.textFaint;
442259
- $5[26] = t62;
442260
- $5[27] = t72;
442261
- } else {
442262
- t72 = $5[27];
442263
- }
442264
- let t82;
442265
- if ($5[28] !== lineCount2 || $5[29] !== t2.textFaint) {
442266
- t82 = lineCount2 > 1 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
442267
- fg: t2.textFaint,
442268
- children: [
442269
- " (",
442270
- String(lineCount2),
442271
- " lines)"
442272
- ]
442273
- }, undefined, true, undefined, this);
442274
- $5[28] = lineCount2;
442275
- $5[29] = t2.textFaint;
442276
- $5[30] = t82;
442277
- } else {
442278
- t82 = $5[30];
442279
- }
442280
- let t92;
442281
- if ($5[31] !== t2.textFaint) {
442282
- t92 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
442283
- fg: t2.textFaint,
442284
- children: " ^O"
442285
- }, undefined, false, undefined, this);
442286
- $5[31] = t2.textFaint;
442287
- $5[32] = t92;
442288
- } else {
442289
- t92 = $5[32];
442290
- }
442291
- let t102;
442292
- if ($5[33] !== t2.textFaint || $5[34] !== t42 || $5[35] !== t72 || $5[36] !== t82 || $5[37] !== t92) {
442293
- t102 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442294
- fg: t32,
442295
- truncate: true,
442296
- children: [
442297
- t42,
442298
- " ",
442299
- t52,
442300
- " ",
442301
- t72,
442302
- t82,
442303
- t92
442304
- ]
442305
- }, undefined, true, undefined, this);
442306
- $5[33] = t2.textFaint;
442307
- $5[34] = t42;
442308
- $5[35] = t72;
442309
- $5[36] = t82;
442310
- $5[37] = t92;
442311
- $5[38] = t102;
442312
- } else {
442313
- t102 = $5[38];
442314
- }
442315
- let t112;
442316
- if ($5[39] !== t102 || $5[40] !== t23) {
442317
- t112 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
442318
- height: 1,
442319
- flexShrink: 0,
442320
- children: t102
442321
- }, t23, false, undefined, this);
442322
- $5[39] = t102;
442323
- $5[40] = t23;
442324
- $5[41] = t112;
442325
- } else {
442326
- t112 = $5[41];
442327
- }
442328
- t1 = t112;
442329
- break bb0;
442330
- }
442331
- }
442332
- $5[0] = content;
442333
- $5[1] = expanded;
442334
- $5[2] = id;
442335
- $5[3] = isStreaming;
442336
- $5[4] = t2.success;
442337
- $5[5] = t2.textFaint;
442338
- $5[6] = t2.textSubtle;
442339
- $5[7] = t1;
442340
- } else {
442341
- t1 = $5[7];
442342
- }
442343
- if (t1 !== Symbol.for("react.early_return_sentinel")) {
442344
- return t1;
442345
- }
442346
- const bc = isStreaming ? t2.brandDim : t2.border;
442347
- const label = isStreaming ? "reasoning\u2026" : "reasoning";
442348
- let t10;
442349
- let t11;
442350
- let t22;
442351
- let t3;
442352
- let t4;
442353
- let t5;
442354
- let t6;
442355
- let t7;
442356
- let t8;
442357
- let t9;
442358
- if ($5[42] !== bc || $5[43] !== content || $5[44] !== id || $5[45] !== label || $5[46] !== t2.bgElevated || $5[47] !== t2.brandDim || $5[48] !== t2.textFaint || $5[49] !== t2.textSecondary) {
442359
- const trimmed = content.trim();
442360
- t5 = `${id}-exp`;
442361
- t6 = "column";
442362
- t7 = 0;
442363
- t8 = true;
442364
- t9 = "rounded";
442365
- t10 = bc;
442366
- const t122 = t2.bgElevated;
442367
- const t132 = t2.brandDim;
442368
- let t14;
442369
- if ($5[60] === Symbol.for("react.memo_cache_sentinel")) {
442370
- t14 = brainIcon();
442371
- $5[60] = t14;
442372
- } else {
442373
- t14 = $5[60];
442374
- }
442375
- let t15;
442376
- if ($5[61] !== t2.brandDim) {
442377
- t15 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
442378
- fg: t132,
442379
- children: t14
442380
- }, undefined, false, undefined, this);
442381
- $5[61] = t2.brandDim;
442382
- $5[62] = t15;
442383
- } else {
442384
- t15 = $5[62];
442385
- }
442386
- let t16;
442387
- if ($5[63] !== label || $5[64] !== t2.brandDim) {
442388
- t16 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
442389
- fg: t2.brandDim,
442390
- children: label
442391
- }, undefined, false, undefined, this);
442392
- $5[63] = label;
442393
- $5[64] = t2.brandDim;
442394
- $5[65] = t16;
442395
- } else {
442396
- t16 = $5[65];
442397
- }
442398
- let t17;
442399
- if ($5[66] !== t2.textFaint) {
442400
- t17 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
442401
- fg: t2.textFaint,
442402
- children: " ^O"
442403
- }, undefined, false, undefined, this);
442404
- $5[66] = t2.textFaint;
442405
- $5[67] = t17;
442406
- } else {
442407
- t17 = $5[67];
442408
- }
442409
- let t18;
442410
- if ($5[68] !== t15 || $5[69] !== t16 || $5[70] !== t17) {
442411
- t18 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442412
- truncate: true,
442413
- children: [
442414
- t15,
442415
- " ",
442416
- t16,
442417
- t17
442418
- ]
442419
- }, undefined, true, undefined, this);
442420
- $5[68] = t15;
442421
- $5[69] = t16;
442422
- $5[70] = t17;
442423
- $5[71] = t18;
442424
- } else {
442425
- t18 = $5[71];
442426
- }
442427
- if ($5[72] !== t2.bgElevated || $5[73] !== t18) {
442428
- t11 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
442429
- height: 1,
442430
- flexShrink: 0,
442431
- paddingX: 1,
442432
- backgroundColor: t122,
442433
- alignSelf: "flex-start",
442434
- marginTop: -1,
442435
- children: t18
442436
- }, undefined, false, undefined, this);
442437
- $5[72] = t2.bgElevated;
442438
- $5[73] = t18;
442439
- $5[74] = t11;
442440
- } else {
442441
- t11 = $5[74];
442442
- }
442443
- t22 = "column";
442444
- t3 = 1;
442445
- let t19;
442446
- if ($5[75] !== t2.textSecondary) {
442447
- t19 = (line2, i4) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442448
- fg: t2.textSecondary,
442449
- children: line2
442450
- }, i4, false, undefined, this);
442451
- $5[75] = t2.textSecondary;
442452
- $5[76] = t19;
442453
- } else {
442454
- t19 = $5[76];
442455
- }
442456
- t4 = trimmed.split(`
442457
- `).map(t19);
442458
- $5[42] = bc;
442459
- $5[43] = content;
442460
- $5[44] = id;
442461
- $5[45] = label;
442462
- $5[46] = t2.bgElevated;
442463
- $5[47] = t2.brandDim;
442464
- $5[48] = t2.textFaint;
442465
- $5[49] = t2.textSecondary;
442466
- $5[50] = t10;
442467
- $5[51] = t11;
442468
- $5[52] = t22;
442469
- $5[53] = t3;
442470
- $5[54] = t4;
442471
- $5[55] = t5;
442472
- $5[56] = t6;
442473
- $5[57] = t7;
442474
- $5[58] = t8;
442475
- $5[59] = t9;
442476
- } else {
442477
- t10 = $5[50];
442478
- t11 = $5[51];
442479
- t22 = $5[52];
442480
- t3 = $5[53];
442481
- t4 = $5[54];
442482
- t5 = $5[55];
442483
- t6 = $5[56];
442484
- t7 = $5[57];
442485
- t8 = $5[58];
442486
- t9 = $5[59];
442487
- }
442488
- let t12;
442489
- if ($5[77] !== t22 || $5[78] !== t3 || $5[79] !== t4) {
442490
- t12 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
442491
- flexDirection: t22,
442492
- paddingX: t3,
442493
- children: t4
442494
- }, undefined, false, undefined, this);
442495
- $5[77] = t22;
442496
- $5[78] = t3;
442497
- $5[79] = t4;
442498
- $5[80] = t12;
442499
- } else {
442500
- t12 = $5[80];
442501
- }
442502
- let t13;
442503
- if ($5[81] !== t10 || $5[82] !== t11 || $5[83] !== t12 || $5[84] !== t5 || $5[85] !== t6 || $5[86] !== t7 || $5[87] !== t8 || $5[88] !== t9) {
442504
- t13 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
442505
- flexDirection: t6,
442506
- flexShrink: t7,
442507
- border: t8,
442508
- borderStyle: t9,
442509
- borderColor: t10,
442510
- children: [
442511
- t11,
442512
- t12
442513
- ]
442514
- }, t5, true, undefined, this);
442515
- $5[81] = t10;
442516
- $5[82] = t11;
442517
- $5[83] = t12;
442518
- $5[84] = t5;
442519
- $5[85] = t6;
442520
- $5[86] = t7;
442521
- $5[87] = t8;
442522
- $5[88] = t9;
442523
- $5[89] = t13;
442524
- } else {
442525
- t13 = $5[89];
442526
- }
442527
- return t13;
442528
- }
442529
- var import_compiler_runtime14, brainIcon = () => icon("brain");
442530
- var init_ReasoningBlock = __esm(() => {
442531
- init_icons();
442532
- init_theme();
442533
- init_shared2();
442534
- init_jsx_dev_runtime();
442535
- import_compiler_runtime14 = __toESM(require_compiler_runtime(), 1);
442536
- });
442537
-
442538
442223
  // src/core/diff.ts
442539
442224
  function lcs(a2, b5) {
442540
442225
  const n = a2.length;
@@ -442756,17 +442441,17 @@ function toUnifiedDiff(filePath, diffLines) {
442756
442441
  `);
442757
442442
  }
442758
442443
  function _temp15() {}
442759
- var import_compiler_runtime15, import_react36, LARGE_DIFF_THRESHOLD = 50, DiffView;
442444
+ var import_compiler_runtime14, import_react36, LARGE_DIFF_THRESHOLD = 50, DiffView;
442760
442445
  var init_DiffView = __esm(async () => {
442761
442446
  init_diff2();
442762
442447
  init_icons();
442763
442448
  init_theme();
442764
442449
  init_jsx_dev_runtime();
442765
442450
  await init_syntax();
442766
- import_compiler_runtime15 = __toESM(require_compiler_runtime(), 1);
442451
+ import_compiler_runtime14 = __toESM(require_compiler_runtime(), 1);
442767
442452
  import_react36 = __toESM(require_react(), 1);
442768
442453
  DiffView = import_react36.memo(function DiffView2(t0) {
442769
- const $5 = import_compiler_runtime15.c(75);
442454
+ const $5 = import_compiler_runtime14.c(75);
442770
442455
  const {
442771
442456
  filePath,
442772
442457
  oldString,
@@ -443150,6 +442835,435 @@ var init_DiffView = __esm(async () => {
443150
442835
  });
443151
442836
  });
443152
442837
 
442838
+ // src/components/chat/ReasoningBlock.tsx
442839
+ function ThinkingSpinner() {
442840
+ const $5 = import_compiler_runtime15.c(3);
442841
+ const t2 = useTheme();
442842
+ const frame = useSpinnerFrame();
442843
+ const t0 = SPINNER_FRAMES[frame];
442844
+ let t1;
442845
+ if ($5[0] !== t2.brandDim || $5[1] !== t0) {
442846
+ t1 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442847
+ fg: t2.brandDim,
442848
+ children: t0
442849
+ }, undefined, false, undefined, this);
442850
+ $5[0] = t2.brandDim;
442851
+ $5[1] = t0;
442852
+ $5[2] = t1;
442853
+ } else {
442854
+ t1 = $5[2];
442855
+ }
442856
+ return t1;
442857
+ }
442858
+ function ReasoningBlock(t0) {
442859
+ const $5 = import_compiler_runtime15.c(90);
442860
+ const {
442861
+ content,
442862
+ expanded,
442863
+ isStreaming,
442864
+ id
442865
+ } = t0;
442866
+ const t2 = useTheme();
442867
+ let t1;
442868
+ if ($5[0] !== content || $5[1] !== expanded || $5[2] !== id || $5[3] !== isStreaming || $5[4] !== t2.success || $5[5] !== t2.textFaint || $5[6] !== t2.textSubtle) {
442869
+ t1 = Symbol.for("react.early_return_sentinel");
442870
+ bb0: {
442871
+ const lines = content.split(`
442872
+ `);
442873
+ const lineCount2 = lines.length;
442874
+ if (!expanded) {
442875
+ if (isStreaming) {
442876
+ const t24 = `${id}-col`;
442877
+ let t33;
442878
+ if ($5[8] === Symbol.for("react.memo_cache_sentinel")) {
442879
+ t33 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ThinkingSpinner, {}, undefined, false, undefined, this);
442880
+ $5[8] = t33;
442881
+ } else {
442882
+ t33 = $5[8];
442883
+ }
442884
+ const t43 = t2.textFaint;
442885
+ let t53;
442886
+ if ($5[9] === Symbol.for("react.memo_cache_sentinel")) {
442887
+ t53 = brainIcon();
442888
+ $5[9] = t53;
442889
+ } else {
442890
+ t53 = $5[9];
442891
+ }
442892
+ let t63;
442893
+ if ($5[10] !== t2.textFaint) {
442894
+ t63 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442895
+ fg: t43,
442896
+ children: [
442897
+ " ",
442898
+ t53,
442899
+ " reasoning"
442900
+ ]
442901
+ }, undefined, true, undefined, this);
442902
+ $5[10] = t2.textFaint;
442903
+ $5[11] = t63;
442904
+ } else {
442905
+ t63 = $5[11];
442906
+ }
442907
+ let t73;
442908
+ if ($5[12] !== lineCount2 || $5[13] !== t2.textFaint) {
442909
+ t73 = lineCount2 > 1 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442910
+ fg: t2.textFaint,
442911
+ children: [
442912
+ " (",
442913
+ String(lineCount2),
442914
+ " lines)"
442915
+ ]
442916
+ }, undefined, true, undefined, this);
442917
+ $5[12] = lineCount2;
442918
+ $5[13] = t2.textFaint;
442919
+ $5[14] = t73;
442920
+ } else {
442921
+ t73 = $5[14];
442922
+ }
442923
+ let t83;
442924
+ if ($5[15] !== t2.textSubtle) {
442925
+ t83 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
442926
+ fg: t2.textSubtle,
442927
+ children: " ^O"
442928
+ }, undefined, false, undefined, this);
442929
+ $5[15] = t2.textSubtle;
442930
+ $5[16] = t83;
442931
+ } else {
442932
+ t83 = $5[16];
442933
+ }
442934
+ let t93;
442935
+ if ($5[17] !== t24 || $5[18] !== t63 || $5[19] !== t73 || $5[20] !== t83) {
442936
+ t93 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
442937
+ height: 1,
442938
+ flexShrink: 0,
442939
+ flexDirection: "row",
442940
+ children: [
442941
+ t33,
442942
+ t63,
442943
+ t73,
442944
+ t83
442945
+ ]
442946
+ }, t24, true, undefined, this);
442947
+ $5[17] = t24;
442948
+ $5[18] = t63;
442949
+ $5[19] = t73;
442950
+ $5[20] = t83;
442951
+ $5[21] = t93;
442952
+ } else {
442953
+ t93 = $5[21];
442954
+ }
442955
+ t1 = t93;
442956
+ break bb0;
442957
+ }
442958
+ const firstLine = (lines[0] ?? "").trim().replace(/\*\*/g, "");
442959
+ const preview = firstLine.length > 60 ? `${firstLine.slice(0, 57)}...` : firstLine;
442960
+ const t23 = `${id}-col`;
442961
+ const t32 = t2.textFaint;
442962
+ let t42;
442963
+ if ($5[22] !== t2.success) {
442964
+ t42 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
442965
+ fg: t2.success,
442966
+ children: "\u2713"
442967
+ }, undefined, false, undefined, this);
442968
+ $5[22] = t2.success;
442969
+ $5[23] = t42;
442970
+ } else {
442971
+ t42 = $5[23];
442972
+ }
442973
+ let t52;
442974
+ if ($5[24] === Symbol.for("react.memo_cache_sentinel")) {
442975
+ t52 = brainIcon();
442976
+ $5[24] = t52;
442977
+ } else {
442978
+ t52 = $5[24];
442979
+ }
442980
+ const t62 = preview || "Reasoned";
442981
+ let t72;
442982
+ if ($5[25] !== t2.textFaint || $5[26] !== t62) {
442983
+ t72 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
442984
+ fg: t2.textFaint,
442985
+ children: t62
442986
+ }, undefined, false, undefined, this);
442987
+ $5[25] = t2.textFaint;
442988
+ $5[26] = t62;
442989
+ $5[27] = t72;
442990
+ } else {
442991
+ t72 = $5[27];
442992
+ }
442993
+ let t82;
442994
+ if ($5[28] !== lineCount2 || $5[29] !== t2.textFaint) {
442995
+ t82 = lineCount2 > 1 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
442996
+ fg: t2.textFaint,
442997
+ children: [
442998
+ " (",
442999
+ String(lineCount2),
443000
+ " lines)"
443001
+ ]
443002
+ }, undefined, true, undefined, this);
443003
+ $5[28] = lineCount2;
443004
+ $5[29] = t2.textFaint;
443005
+ $5[30] = t82;
443006
+ } else {
443007
+ t82 = $5[30];
443008
+ }
443009
+ let t92;
443010
+ if ($5[31] !== t2.textFaint) {
443011
+ t92 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
443012
+ fg: t2.textFaint,
443013
+ children: " ^O"
443014
+ }, undefined, false, undefined, this);
443015
+ $5[31] = t2.textFaint;
443016
+ $5[32] = t92;
443017
+ } else {
443018
+ t92 = $5[32];
443019
+ }
443020
+ let t102;
443021
+ if ($5[33] !== t2.textFaint || $5[34] !== t42 || $5[35] !== t72 || $5[36] !== t82 || $5[37] !== t92) {
443022
+ t102 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
443023
+ fg: t32,
443024
+ truncate: true,
443025
+ children: [
443026
+ t42,
443027
+ " ",
443028
+ t52,
443029
+ " ",
443030
+ t72,
443031
+ t82,
443032
+ t92
443033
+ ]
443034
+ }, undefined, true, undefined, this);
443035
+ $5[33] = t2.textFaint;
443036
+ $5[34] = t42;
443037
+ $5[35] = t72;
443038
+ $5[36] = t82;
443039
+ $5[37] = t92;
443040
+ $5[38] = t102;
443041
+ } else {
443042
+ t102 = $5[38];
443043
+ }
443044
+ let t112;
443045
+ if ($5[39] !== t102 || $5[40] !== t23) {
443046
+ t112 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
443047
+ height: 1,
443048
+ flexShrink: 0,
443049
+ children: t102
443050
+ }, t23, false, undefined, this);
443051
+ $5[39] = t102;
443052
+ $5[40] = t23;
443053
+ $5[41] = t112;
443054
+ } else {
443055
+ t112 = $5[41];
443056
+ }
443057
+ t1 = t112;
443058
+ break bb0;
443059
+ }
443060
+ }
443061
+ $5[0] = content;
443062
+ $5[1] = expanded;
443063
+ $5[2] = id;
443064
+ $5[3] = isStreaming;
443065
+ $5[4] = t2.success;
443066
+ $5[5] = t2.textFaint;
443067
+ $5[6] = t2.textSubtle;
443068
+ $5[7] = t1;
443069
+ } else {
443070
+ t1 = $5[7];
443071
+ }
443072
+ if (t1 !== Symbol.for("react.early_return_sentinel")) {
443073
+ return t1;
443074
+ }
443075
+ const bc = isStreaming ? t2.brandDim : t2.border;
443076
+ const label = isStreaming ? "reasoning\u2026" : "reasoning";
443077
+ let t10;
443078
+ let t11;
443079
+ let t22;
443080
+ let t3;
443081
+ let t4;
443082
+ let t5;
443083
+ let t6;
443084
+ let t7;
443085
+ let t8;
443086
+ let t9;
443087
+ if ($5[42] !== bc || $5[43] !== content || $5[44] !== id || $5[45] !== label || $5[46] !== t2.bgElevated || $5[47] !== t2.brandDim || $5[48] !== t2.textFaint || $5[49] !== t2.textSecondary) {
443088
+ const trimmed = content.trim();
443089
+ t5 = `${id}-exp`;
443090
+ t6 = "column";
443091
+ t7 = 0;
443092
+ t8 = true;
443093
+ t9 = "rounded";
443094
+ t10 = bc;
443095
+ const t122 = t2.bgElevated;
443096
+ const t132 = t2.brandDim;
443097
+ let t14;
443098
+ if ($5[60] === Symbol.for("react.memo_cache_sentinel")) {
443099
+ t14 = brainIcon();
443100
+ $5[60] = t14;
443101
+ } else {
443102
+ t14 = $5[60];
443103
+ }
443104
+ let t15;
443105
+ if ($5[61] !== t2.brandDim) {
443106
+ t15 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
443107
+ fg: t132,
443108
+ children: t14
443109
+ }, undefined, false, undefined, this);
443110
+ $5[61] = t2.brandDim;
443111
+ $5[62] = t15;
443112
+ } else {
443113
+ t15 = $5[62];
443114
+ }
443115
+ let t16;
443116
+ if ($5[63] !== label || $5[64] !== t2.brandDim) {
443117
+ t16 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
443118
+ fg: t2.brandDim,
443119
+ children: label
443120
+ }, undefined, false, undefined, this);
443121
+ $5[63] = label;
443122
+ $5[64] = t2.brandDim;
443123
+ $5[65] = t16;
443124
+ } else {
443125
+ t16 = $5[65];
443126
+ }
443127
+ let t17;
443128
+ if ($5[66] !== t2.textFaint) {
443129
+ t17 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
443130
+ fg: t2.textFaint,
443131
+ children: " ^O"
443132
+ }, undefined, false, undefined, this);
443133
+ $5[66] = t2.textFaint;
443134
+ $5[67] = t17;
443135
+ } else {
443136
+ t17 = $5[67];
443137
+ }
443138
+ let t18;
443139
+ if ($5[68] !== t15 || $5[69] !== t16 || $5[70] !== t17) {
443140
+ t18 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
443141
+ truncate: true,
443142
+ children: [
443143
+ t15,
443144
+ " ",
443145
+ t16,
443146
+ t17
443147
+ ]
443148
+ }, undefined, true, undefined, this);
443149
+ $5[68] = t15;
443150
+ $5[69] = t16;
443151
+ $5[70] = t17;
443152
+ $5[71] = t18;
443153
+ } else {
443154
+ t18 = $5[71];
443155
+ }
443156
+ if ($5[72] !== t2.bgElevated || $5[73] !== t18) {
443157
+ t11 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
443158
+ height: 1,
443159
+ flexShrink: 0,
443160
+ paddingX: 1,
443161
+ backgroundColor: t122,
443162
+ alignSelf: "flex-start",
443163
+ marginTop: -1,
443164
+ children: t18
443165
+ }, undefined, false, undefined, this);
443166
+ $5[72] = t2.bgElevated;
443167
+ $5[73] = t18;
443168
+ $5[74] = t11;
443169
+ } else {
443170
+ t11 = $5[74];
443171
+ }
443172
+ t22 = "column";
443173
+ t3 = 1;
443174
+ let t19;
443175
+ if ($5[75] !== t2.textSecondary) {
443176
+ t19 = (line2, i4) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
443177
+ fg: t2.textSecondary,
443178
+ children: line2
443179
+ }, i4, false, undefined, this);
443180
+ $5[75] = t2.textSecondary;
443181
+ $5[76] = t19;
443182
+ } else {
443183
+ t19 = $5[76];
443184
+ }
443185
+ t4 = trimmed.split(`
443186
+ `).map(t19);
443187
+ $5[42] = bc;
443188
+ $5[43] = content;
443189
+ $5[44] = id;
443190
+ $5[45] = label;
443191
+ $5[46] = t2.bgElevated;
443192
+ $5[47] = t2.brandDim;
443193
+ $5[48] = t2.textFaint;
443194
+ $5[49] = t2.textSecondary;
443195
+ $5[50] = t10;
443196
+ $5[51] = t11;
443197
+ $5[52] = t22;
443198
+ $5[53] = t3;
443199
+ $5[54] = t4;
443200
+ $5[55] = t5;
443201
+ $5[56] = t6;
443202
+ $5[57] = t7;
443203
+ $5[58] = t8;
443204
+ $5[59] = t9;
443205
+ } else {
443206
+ t10 = $5[50];
443207
+ t11 = $5[51];
443208
+ t22 = $5[52];
443209
+ t3 = $5[53];
443210
+ t4 = $5[54];
443211
+ t5 = $5[55];
443212
+ t6 = $5[56];
443213
+ t7 = $5[57];
443214
+ t8 = $5[58];
443215
+ t9 = $5[59];
443216
+ }
443217
+ let t12;
443218
+ if ($5[77] !== t22 || $5[78] !== t3 || $5[79] !== t4) {
443219
+ t12 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
443220
+ flexDirection: t22,
443221
+ paddingX: t3,
443222
+ children: t4
443223
+ }, undefined, false, undefined, this);
443224
+ $5[77] = t22;
443225
+ $5[78] = t3;
443226
+ $5[79] = t4;
443227
+ $5[80] = t12;
443228
+ } else {
443229
+ t12 = $5[80];
443230
+ }
443231
+ let t13;
443232
+ if ($5[81] !== t10 || $5[82] !== t11 || $5[83] !== t12 || $5[84] !== t5 || $5[85] !== t6 || $5[86] !== t7 || $5[87] !== t8 || $5[88] !== t9) {
443233
+ t13 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
443234
+ flexDirection: t6,
443235
+ flexShrink: t7,
443236
+ border: t8,
443237
+ borderStyle: t9,
443238
+ borderColor: t10,
443239
+ children: [
443240
+ t11,
443241
+ t12
443242
+ ]
443243
+ }, t5, true, undefined, this);
443244
+ $5[81] = t10;
443245
+ $5[82] = t11;
443246
+ $5[83] = t12;
443247
+ $5[84] = t5;
443248
+ $5[85] = t6;
443249
+ $5[86] = t7;
443250
+ $5[87] = t8;
443251
+ $5[88] = t9;
443252
+ $5[89] = t13;
443253
+ } else {
443254
+ t13 = $5[89];
443255
+ }
443256
+ return t13;
443257
+ }
443258
+ var import_compiler_runtime15, brainIcon = () => icon("brain");
443259
+ var init_ReasoningBlock = __esm(() => {
443260
+ init_icons();
443261
+ init_theme();
443262
+ init_shared2();
443263
+ init_jsx_dev_runtime();
443264
+ import_compiler_runtime15 = __toESM(require_compiler_runtime(), 1);
443265
+ });
443266
+
443153
443267
  // src/components/chat/multi-agent-display.ts
443154
443268
  function shortModelId(modelId) {
443155
443269
  const parts2 = modelId.split("/");
@@ -443513,8 +443627,7 @@ function renderToolCall2(tc, seconds, diffStyle, t2, connector) {
443513
443627
  try {
443514
443628
  const plan = JSON.parse(tc.args);
443515
443629
  if (plan.title && Array.isArray(plan.steps) && Array.isArray(plan.files)) {
443516
- return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
443517
- flexDirection: "column",
443630
+ const planContent = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
443518
443631
  children: [
443519
443632
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(StructuredPlanView, {
443520
443633
  plan,
@@ -443542,17 +443655,48 @@ function renderToolCall2(tc, seconds, diffStyle, t2, connector) {
443542
443655
  }, undefined, true, undefined, this)
443543
443656
  }, undefined, false, undefined, this)
443544
443657
  ]
443545
- }, tc.id, true, undefined, this);
443658
+ }, undefined, true, undefined, this);
443659
+ if (connector) {
443660
+ const char = connector.isLast ? "\u2514 " : connector.isFirst ? "\u250C " : "\u251C ";
443661
+ return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
443662
+ flexDirection: "column",
443663
+ children: [
443664
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
443665
+ height: 1,
443666
+ flexShrink: 0,
443667
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
443668
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
443669
+ fg: t2.textFaint,
443670
+ children: char
443671
+ }, undefined, false, undefined, this)
443672
+ }, undefined, false, undefined, this)
443673
+ }, undefined, false, undefined, this),
443674
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
443675
+ border: ["left"],
443676
+ customBorderChars: connector.isLast ? TREE_SPACE : TREE_PIPE,
443677
+ borderColor: t2.textFaint,
443678
+ paddingLeft: 1,
443679
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
443680
+ flexDirection: "column",
443681
+ children: planContent
443682
+ }, undefined, false, undefined, this)
443683
+ }, undefined, false, undefined, this)
443684
+ ]
443685
+ }, tc.id, true, undefined, this);
443686
+ }
443687
+ return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
443688
+ flexDirection: "column",
443689
+ children: planContent
443690
+ }, tc.id, false, undefined, this);
443546
443691
  }
443547
443692
  } catch {}
443548
443693
  }
443549
443694
  if (connector) {
443550
- const char = connector.isLast ? "\u2514 " : connector.isFirst ? "\u250C " : "\u251C ";
443551
443695
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToolRow, {
443552
443696
  tc,
443553
443697
  seconds,
443554
443698
  diffStyle,
443555
- connectorChar: char
443699
+ treePosition: connector
443556
443700
  }, tc.id, false, undefined, this);
443557
443701
  }
443558
443702
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToolRow, {
@@ -443570,7 +443714,7 @@ function _temp25(s_0) {
443570
443714
  function _temp35(s_1) {
443571
443715
  return s_1.state !== "running";
443572
443716
  }
443573
- var import_compiler_runtime16, import_react38, SUBAGENT_NAMES, RENDER_DEBOUNCE = 80, Spinner2, ChildStepRow, MultiAgentChildRow, ToolRow, QUIET_TOOLS, EDIT_TOOL_NAMES, ToolCallDisplay;
443717
+ var import_compiler_runtime16, import_react38, SUBAGENT_NAMES, RENDER_DEBOUNCE = 80, Spinner2, ChildStepRow, MultiAgentChildRow, TREE_PIPE, TREE_SPACE, ToolRow, QUIET_TOOLS, EDIT_TOOL_NAMES, ToolCallDisplay;
443574
443718
  var init_ToolCallDisplay = __esm(async () => {
443575
443719
  init_icons();
443576
443720
  init_theme();
@@ -443581,6 +443725,7 @@ var init_ToolCallDisplay = __esm(async () => {
443581
443725
  await __promiseAll([
443582
443726
  init_core4(),
443583
443727
  init_StructuredPlanView(),
443728
+ init_DiffView(),
443584
443729
  init_dispatch_display(),
443585
443730
  init_StaticToolRow()
443586
443731
  ]);
@@ -444417,11 +444562,37 @@ var init_ToolCallDisplay = __esm(async () => {
444417
444562
  const n = next.childSteps[i4];
444418
444563
  return n && s2.toolName === n.toolName && s2.state === n.state && s2.args === n.args && s2.cacheState === n.cacheState;
444419
444564
  }) && prev.liveStats?.toolUses === next.liveStats?.toolUses && prev.liveStats?.tokenUsage?.total === next.liveStats?.tokenUsage?.total && prev.liveStats?.cacheHits === next.liveStats?.cacheHits);
444565
+ TREE_PIPE = {
444566
+ vertical: "\u2502",
444567
+ horizontal: " ",
444568
+ topLeft: " ",
444569
+ topRight: " ",
444570
+ bottomLeft: " ",
444571
+ bottomRight: " ",
444572
+ topT: " ",
444573
+ bottomT: " ",
444574
+ leftT: " ",
444575
+ rightT: " ",
444576
+ cross: " "
444577
+ };
444578
+ TREE_SPACE = {
444579
+ vertical: " ",
444580
+ horizontal: " ",
444581
+ topLeft: " ",
444582
+ topRight: " ",
444583
+ bottomLeft: " ",
444584
+ bottomRight: " ",
444585
+ topT: " ",
444586
+ bottomT: " ",
444587
+ leftT: " ",
444588
+ rightT: " ",
444589
+ cross: " "
444590
+ };
444420
444591
  ToolRow = import_react38.memo(function ToolRow2({
444421
444592
  tc,
444422
444593
  seconds,
444423
444594
  diffStyle = "default",
444424
- connectorChar
444595
+ treePosition
444425
444596
  }) {
444426
444597
  const t2 = useTheme();
444427
444598
  const isSubagent = SUBAGENT_NAMES.has(tc.toolName);
@@ -444531,6 +444702,7 @@ var init_ToolCallDisplay = __esm(async () => {
444531
444702
  children: "\u2713"
444532
444703
  }, undefined, false, undefined, this);
444533
444704
  })();
444705
+ const connectorChar = treePosition ? treePosition.isLast ? "\u2514 " : treePosition.isFirst ? "\u250C " : "\u251C " : undefined;
444534
444706
  const statusContent = connectorChar ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
444535
444707
  children: [
444536
444708
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
@@ -444540,103 +444712,168 @@ var init_ToolCallDisplay = __esm(async () => {
444540
444712
  statusIcon
444541
444713
  ]
444542
444714
  }, undefined, true, undefined, this) : statusIcon;
444715
+ const inTree = !!treePosition;
444716
+ const hasExpanded = inTree && (!!staticProps.diff || staticProps.imageArt && staticProps.imageArt.length > 0 || isMultiAgent && multiProgress !== null && multiProgress.agents.size > 0 && !dispatchRejection || isSubagent && !isMultiAgent && allChildSteps.length > 0);
444717
+ const multiAgentContent = isMultiAgent && multiProgress !== null && multiProgress.agents.size > 0 && !dispatchRejection ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444718
+ flexDirection: "column",
444719
+ marginLeft: 2,
444720
+ children: [...multiProgress.agents.entries()].map(([agentId, info2], idx, arr) => {
444721
+ const agentSteps = allChildSteps.filter((s2) => s2.agentId === agentId);
444722
+ const isLastVisible = idx === arr.length - 1;
444723
+ const allAccountedFor = arr.length >= (multiProgress.totalAgents ?? arr.length);
444724
+ return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(MultiAgentChildRow, {
444725
+ agentId,
444726
+ info: info2,
444727
+ isFirst: idx === 0,
444728
+ isLast: isLastVisible && allAccountedFor,
444729
+ childSteps: agentSteps,
444730
+ liveStats: liveStats.get(agentId)
444731
+ }, agentId, false, undefined, this);
444732
+ })
444733
+ }, undefined, false, undefined, this) : null;
444734
+ const singleAgentContent = isSubagent && !isMultiAgent && allChildSteps.length > 0 ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444735
+ flexDirection: "column",
444736
+ children: (() => {
444737
+ const MAX_SINGLE = 5;
444738
+ const filtered = allChildSteps.filter((s_0) => !QUIET_TOOLS.has(s_0.toolName));
444739
+ const running = filtered.filter((s_1) => s_1.state === "running");
444740
+ const done_0 = filtered.filter((s_2) => s_2.state !== "running");
444741
+ const doneSlots = Math.max(0, MAX_SINGLE - running.length);
444742
+ const visibleDone = done_0.slice(-doneSlots);
444743
+ const hiddenCount = done_0.length - visibleDone.length;
444744
+ const visible = [...visibleDone, ...running];
444745
+ const agentRunning = tc.state === "running";
444746
+ const showThinking = agentRunning && running.length === 0 && done_0.length > 0;
444747
+ return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
444748
+ children: [
444749
+ hiddenCount > 0 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444750
+ height: 1,
444751
+ flexShrink: 0,
444752
+ marginLeft: 3,
444753
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
444754
+ truncate: true,
444755
+ children: [
444756
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
444757
+ fg: t2.textFaint,
444758
+ children: "\u251C "
444759
+ }, undefined, false, undefined, this),
444760
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
444761
+ fg: t2.textDim,
444762
+ children: [
444763
+ "+",
444764
+ String(hiddenCount),
444765
+ " completed"
444766
+ ]
444767
+ }, undefined, true, undefined, this)
444768
+ ]
444769
+ }, undefined, true, undefined, this)
444770
+ }, undefined, false, undefined, this),
444771
+ visible.map((step, si) => {
444772
+ const stableIdx = allChildSteps.indexOf(step);
444773
+ const last = si === visible.length - 1 && !showThinking;
444774
+ return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ChildStepRow, {
444775
+ step,
444776
+ isLast: last
444777
+ }, `${step.toolName}-${String(stableIdx)}`, false, undefined, this);
444778
+ }),
444779
+ showThinking && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444780
+ height: 1,
444781
+ flexShrink: 0,
444782
+ marginLeft: 3,
444783
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
444784
+ truncate: true,
444785
+ children: [
444786
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
444787
+ fg: t2.textFaint,
444788
+ children: "\u2514 "
444789
+ }, undefined, false, undefined, this),
444790
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(Spinner2, {
444791
+ color: t2.textMuted
444792
+ }, undefined, false, undefined, this),
444793
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
444794
+ fg: t2.textMuted,
444795
+ children: " thinking..."
444796
+ }, undefined, false, undefined, this)
444797
+ ]
444798
+ }, undefined, true, undefined, this)
444799
+ }, undefined, false, undefined, this)
444800
+ ]
444801
+ }, undefined, true, undefined, this);
444802
+ })()
444803
+ }, undefined, false, undefined, this) : null;
444804
+ const diffContent = staticProps.diff ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444805
+ marginTop: 1,
444806
+ flexDirection: "column",
444807
+ children: [
444808
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(DiffView, {
444809
+ filePath: staticProps.diff.path,
444810
+ oldString: staticProps.diff.oldString,
444811
+ newString: staticProps.diff.newString,
444812
+ success: staticProps.diff.success,
444813
+ errorMessage: staticProps.diff.errorMessage,
444814
+ mode: diffStyle
444815
+ }, undefined, false, undefined, this),
444816
+ staticProps.diff.impact ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
444817
+ fg: t2.textMuted,
444818
+ children: [
444819
+ " ",
444820
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
444821
+ fg: t2.amber,
444822
+ children: icon("impact")
444823
+ }, undefined, false, undefined, this),
444824
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
444825
+ fg: t2.textSecondary,
444826
+ children: [
444827
+ " ",
444828
+ staticProps.diff.impact
444829
+ ]
444830
+ }, undefined, true, undefined, this)
444831
+ ]
444832
+ }, undefined, true, undefined, this) : null
444833
+ ]
444834
+ }, undefined, true, undefined, this) : null;
444835
+ const imageContent = staticProps.imageArt && staticProps.imageArt.length > 0 ? staticProps.imageArt.map((img) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444836
+ flexDirection: "column",
444837
+ marginTop: 1,
444838
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("ghostty-terminal", {
444839
+ ansi: img.lines.join(`
444840
+ `),
444841
+ cols: 130,
444842
+ rows: img.lines.length,
444843
+ trimEnd: true
444844
+ }, undefined, false, undefined, this)
444845
+ }, img.name, false, undefined, this)) : null;
444543
444846
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444544
444847
  flexDirection: "column",
444545
444848
  children: [
444546
444849
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(StaticToolRow, {
444547
444850
  ...staticProps,
444548
- statusContent
444549
- }, undefined, false, undefined, this),
444550
- isMultiAgent && multiProgress !== null && multiProgress.agents.size > 0 && !dispatchRejection && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444551
- flexDirection: "column",
444552
- marginLeft: 2,
444553
- children: [...multiProgress.agents.entries()].map(([agentId, info2], idx, arr) => {
444554
- const agentSteps = allChildSteps.filter((s2) => s2.agentId === agentId);
444555
- const isLastVisible = idx === arr.length - 1;
444556
- const allAccountedFor = arr.length >= (multiProgress.totalAgents ?? arr.length);
444557
- return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(MultiAgentChildRow, {
444558
- agentId,
444559
- info: info2,
444560
- isFirst: idx === 0,
444561
- isLast: isLastVisible && allAccountedFor,
444562
- childSteps: agentSteps,
444563
- liveStats: liveStats.get(agentId)
444564
- }, agentId, false, undefined, this);
444565
- })
444851
+ statusContent,
444852
+ suppressExpanded: inTree
444566
444853
  }, undefined, false, undefined, this),
444567
- isSubagent && !isMultiAgent && allChildSteps.length > 0 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444568
- flexDirection: "column",
444569
- children: (() => {
444570
- const MAX_SINGLE = 5;
444571
- const filtered = allChildSteps.filter((s_0) => !QUIET_TOOLS.has(s_0.toolName));
444572
- const running = filtered.filter((s_1) => s_1.state === "running");
444573
- const done_0 = filtered.filter((s_2) => s_2.state !== "running");
444574
- const doneSlots = Math.max(0, MAX_SINGLE - running.length);
444575
- const visibleDone = done_0.slice(-doneSlots);
444576
- const hiddenCount = done_0.length - visibleDone.length;
444577
- const visible = [...visibleDone, ...running];
444578
- const agentRunning = tc.state === "running";
444579
- const showThinking = agentRunning && running.length === 0 && done_0.length > 0;
444580
- return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
444581
- children: [
444582
- hiddenCount > 0 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444583
- height: 1,
444584
- flexShrink: 0,
444585
- marginLeft: 3,
444586
- children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
444587
- truncate: true,
444588
- children: [
444589
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
444590
- fg: t2.textFaint,
444591
- children: "\u251C "
444592
- }, undefined, false, undefined, this),
444593
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
444594
- fg: t2.textDim,
444595
- children: [
444596
- "+",
444597
- String(hiddenCount),
444598
- " completed"
444599
- ]
444600
- }, undefined, true, undefined, this)
444601
- ]
444602
- }, undefined, true, undefined, this)
444603
- }, undefined, false, undefined, this),
444604
- visible.map((step, si) => {
444605
- const stableIdx = allChildSteps.indexOf(step);
444606
- const last = si === visible.length - 1 && !showThinking;
444607
- return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ChildStepRow, {
444608
- step,
444609
- isLast: last
444610
- }, `${step.toolName}-${String(stableIdx)}`, false, undefined, this);
444611
- }),
444612
- showThinking && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444613
- height: 1,
444614
- flexShrink: 0,
444615
- marginLeft: 3,
444616
- children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
444617
- truncate: true,
444618
- children: [
444619
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
444620
- fg: t2.textFaint,
444621
- children: "\u2514 "
444622
- }, undefined, false, undefined, this),
444623
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(Spinner2, {
444624
- color: t2.textMuted
444625
- }, undefined, false, undefined, this),
444626
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
444627
- fg: t2.textMuted,
444628
- children: " thinking..."
444629
- }, undefined, false, undefined, this)
444630
- ]
444631
- }, undefined, true, undefined, this)
444632
- }, undefined, false, undefined, this)
444633
- ]
444634
- }, undefined, true, undefined, this);
444635
- })()
444636
- }, undefined, false, undefined, this)
444854
+ hasExpanded ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444855
+ border: ["left"],
444856
+ customBorderChars: treePosition?.isLast ? TREE_SPACE : TREE_PIPE,
444857
+ borderColor: t2.textFaint,
444858
+ paddingLeft: 1,
444859
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
444860
+ flexDirection: "column",
444861
+ children: [
444862
+ diffContent,
444863
+ imageContent,
444864
+ multiAgentContent,
444865
+ singleAgentContent
444866
+ ]
444867
+ }, undefined, true, undefined, this)
444868
+ }, undefined, false, undefined, this) : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
444869
+ children: [
444870
+ multiAgentContent,
444871
+ singleAgentContent
444872
+ ]
444873
+ }, undefined, true, undefined, this)
444637
444874
  ]
444638
444875
  }, undefined, true, undefined, this);
444639
- }, (prev, next) => prev.tc.id === next.tc.id && prev.tc.state === next.tc.state && prev.tc.args === next.tc.args && prev.tc.result === next.tc.result && prev.tc.error === next.tc.error && prev.tc.backend === next.tc.backend && prev.seconds === next.seconds && prev.diffStyle === next.diffStyle);
444876
+ }, (prev, next) => prev.tc.id === next.tc.id && prev.tc.state === next.tc.state && prev.tc.args === next.tc.args && prev.tc.result === next.tc.result && prev.tc.error === next.tc.error && prev.tc.backend === next.tc.backend && prev.seconds === next.seconds && prev.diffStyle === next.diffStyle && prev.treePosition?.isFirst === next.treePosition?.isFirst && prev.treePosition?.isLast === next.treePosition?.isLast);
444640
444877
  QUIET_TOOLS = new Set(["update_plan_step", "ask_user", "task_list"]);
444641
444878
  EDIT_TOOL_NAMES = new Set(["edit_file", "multi_edit"]);
444642
444879
  ToolCallDisplay = import_react38.memo(function ToolCallDisplay2(t0) {
@@ -445225,7 +445462,7 @@ var init_tool_formatters = __esm(async () => {
445225
445462
 
445226
445463
  // src/components/chat/StaticToolRow.tsx
445227
445464
  function StaticToolRow(t0) {
445228
- const $5 = import_compiler_runtime17.c(56);
445465
+ const $5 = import_compiler_runtime17.c(58);
445229
445466
  const {
445230
445467
  statusContent,
445231
445468
  isDone,
@@ -445243,34 +445480,36 @@ function StaticToolRow(t0) {
445243
445480
  suffixColor,
445244
445481
  diff,
445245
445482
  diffStyle: t1,
445246
- imageArt
445483
+ imageArt,
445484
+ suppressExpanded: t2
445247
445485
  } = t0;
445248
445486
  const diffStyle = t1 === undefined ? "default" : t1;
445249
- const t2 = useTheme();
445250
- let t22;
445251
- if ($5[0] !== t2.brand || $5[1] !== t2.error || $5[2] !== t2.success || $5[3] !== t2.textMuted || $5[4] !== t2.textSecondary) {
445252
- t22 = {
445253
- textDone: t2.textMuted,
445254
- toolNameActive: t2.brand,
445255
- argsActive: t2.textSecondary,
445256
- checkDone: t2.success,
445257
- error: t2.error
445258
- };
445259
- $5[0] = t2.brand;
445260
- $5[1] = t2.error;
445261
- $5[2] = t2.success;
445262
- $5[3] = t2.textMuted;
445263
- $5[4] = t2.textSecondary;
445264
- $5[5] = t22;
445487
+ const suppressExpanded = t2 === undefined ? false : t2;
445488
+ const t3 = useTheme();
445489
+ let t32;
445490
+ if ($5[0] !== t3.brand || $5[1] !== t3.error || $5[2] !== t3.success || $5[3] !== t3.textMuted || $5[4] !== t3.textSecondary) {
445491
+ t32 = {
445492
+ textDone: t3.textMuted,
445493
+ toolNameActive: t3.brand,
445494
+ argsActive: t3.textSecondary,
445495
+ checkDone: t3.success,
445496
+ error: t3.error
445497
+ };
445498
+ $5[0] = t3.brand;
445499
+ $5[1] = t3.error;
445500
+ $5[2] = t3.success;
445501
+ $5[3] = t3.textMuted;
445502
+ $5[4] = t3.textSecondary;
445503
+ $5[5] = t32;
445265
445504
  } else {
445266
- t22 = $5[5];
445505
+ t32 = $5[5];
445267
445506
  }
445268
- const rc = t22;
445269
- const t3 = isDone ? rc.textDone : iconColor;
445270
- let t4;
445271
- if ($5[6] !== icon2 || $5[7] !== t3) {
445272
- t4 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445273
- fg: t3,
445507
+ const rc = t32;
445508
+ const t4 = isDone ? rc.textDone : iconColor;
445509
+ let t5;
445510
+ if ($5[6] !== icon2 || $5[7] !== t4) {
445511
+ t5 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445512
+ fg: t4,
445274
445513
  children: [
445275
445514
  " ",
445276
445515
  icon2,
@@ -445278,15 +445517,15 @@ function StaticToolRow(t0) {
445278
445517
  ]
445279
445518
  }, undefined, true, undefined, this);
445280
445519
  $5[6] = icon2;
445281
- $5[7] = t3;
445282
- $5[8] = t4;
445520
+ $5[7] = t4;
445521
+ $5[8] = t5;
445283
445522
  } else {
445284
- t4 = $5[8];
445523
+ t5 = $5[8];
445285
445524
  }
445286
- let t5;
445287
- if ($5[9] !== category || $5[10] !== categoryColor || $5[11] !== isDone || $5[12] !== t2.textDim) {
445288
- t5 = category ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445289
- fg: isDone ? t2.textDim : categoryColor,
445525
+ let t6;
445526
+ if ($5[9] !== category || $5[10] !== categoryColor || $5[11] !== isDone || $5[12] !== t3.textDim) {
445527
+ t6 = category ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445528
+ fg: isDone ? t3.textDim : categoryColor,
445290
445529
  children: [
445291
445530
  "[",
445292
445531
  category,
@@ -445296,15 +445535,15 @@ function StaticToolRow(t0) {
445296
445535
  $5[9] = category;
445297
445536
  $5[10] = categoryColor;
445298
445537
  $5[11] = isDone;
445299
- $5[12] = t2.textDim;
445300
- $5[13] = t5;
445538
+ $5[12] = t3.textDim;
445539
+ $5[13] = t6;
445301
445540
  } else {
445302
- t5 = $5[13];
445541
+ t6 = $5[13];
445303
445542
  }
445304
- let t6;
445305
- if ($5[14] !== backendColor || $5[15] !== backendTag || $5[16] !== category || $5[17] !== isDone || $5[18] !== t2.textDim) {
445306
- t6 = backendTag ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445307
- fg: isDone ? t2.textDim : backendColor,
445543
+ let t7;
445544
+ if ($5[14] !== backendColor || $5[15] !== backendTag || $5[16] !== category || $5[17] !== isDone || $5[18] !== t3.textDim) {
445545
+ t7 = backendTag ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445546
+ fg: isDone ? t3.textDim : backendColor,
445308
445547
  children: [
445309
445548
  "[",
445310
445549
  getBackendLabel(backendTag),
@@ -445317,15 +445556,15 @@ function StaticToolRow(t0) {
445317
445556
  $5[15] = backendTag;
445318
445557
  $5[16] = category;
445319
445558
  $5[17] = isDone;
445320
- $5[18] = t2.textDim;
445321
- $5[19] = t6;
445559
+ $5[18] = t3.textDim;
445560
+ $5[19] = t7;
445322
445561
  } else {
445323
- t6 = $5[19];
445562
+ t7 = $5[19];
445324
445563
  }
445325
- let t7;
445326
- if ($5[20] !== isDone || $5[21] !== outsideBadge || $5[22] !== t2.textDim) {
445327
- t7 = outsideBadge ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445328
- fg: isDone ? t2.textDim : outsideBadge.color,
445564
+ let t8;
445565
+ if ($5[20] !== isDone || $5[21] !== outsideBadge || $5[22] !== t3.textDim) {
445566
+ t8 = outsideBadge ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445567
+ fg: isDone ? t3.textDim : outsideBadge.color,
445329
445568
  children: [
445330
445569
  "[",
445331
445570
  outsideBadge.label,
@@ -445334,14 +445573,14 @@ function StaticToolRow(t0) {
445334
445573
  }, undefined, true, undefined, this) : null;
445335
445574
  $5[20] = isDone;
445336
445575
  $5[21] = outsideBadge;
445337
- $5[22] = t2.textDim;
445338
- $5[23] = t7;
445576
+ $5[22] = t3.textDim;
445577
+ $5[23] = t8;
445339
445578
  } else {
445340
- t7 = $5[23];
445579
+ t8 = $5[23];
445341
445580
  }
445342
- let t8;
445581
+ let t9;
445343
445582
  if ($5[24] !== argStr || $5[25] !== editResultText || $5[26] !== isDone || $5[27] !== label || $5[28] !== rc.argsActive || $5[29] !== rc.textDone || $5[30] !== rc.toolNameActive) {
445344
- t8 = editResultText ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445583
+ t9 = editResultText ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445345
445584
  fg: rc.textDone,
445346
445585
  children: editResultText
445347
445586
  }, undefined, false, undefined, this) : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
@@ -445367,55 +445606,55 @@ function StaticToolRow(t0) {
445367
445606
  $5[28] = rc.argsActive;
445368
445607
  $5[29] = rc.textDone;
445369
445608
  $5[30] = rc.toolNameActive;
445370
- $5[31] = t8;
445609
+ $5[31] = t9;
445371
445610
  } else {
445372
- t8 = $5[31];
445611
+ t9 = $5[31];
445373
445612
  }
445374
- let t9;
445613
+ let t10;
445375
445614
  if ($5[32] !== rc.textDone || $5[33] !== suffix || $5[34] !== suffixColor) {
445376
- t9 = suffix ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445615
+ t10 = suffix ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445377
445616
  fg: suffixColor ?? rc.textDone,
445378
445617
  children: suffix
445379
445618
  }, undefined, false, undefined, this) : null;
445380
445619
  $5[32] = rc.textDone;
445381
445620
  $5[33] = suffix;
445382
445621
  $5[34] = suffixColor;
445383
- $5[35] = t9;
445622
+ $5[35] = t10;
445384
445623
  } else {
445385
- t9 = $5[35];
445624
+ t10 = $5[35];
445386
445625
  }
445387
- let t10;
445388
- if ($5[36] !== statusContent || $5[37] !== t4 || $5[38] !== t5 || $5[39] !== t6 || $5[40] !== t7 || $5[41] !== t8 || $5[42] !== t9) {
445389
- t10 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
445626
+ let t11;
445627
+ if ($5[36] !== statusContent || $5[37] !== t10 || $5[38] !== t5 || $5[39] !== t6 || $5[40] !== t7 || $5[41] !== t8 || $5[42] !== t9) {
445628
+ t11 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
445390
445629
  height: 1,
445391
445630
  flexShrink: 0,
445392
445631
  children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
445393
445632
  truncate: true,
445394
445633
  children: [
445395
445634
  statusContent,
445396
- t4,
445397
445635
  t5,
445398
445636
  t6,
445399
445637
  t7,
445400
445638
  t8,
445401
- t9
445639
+ t9,
445640
+ t10
445402
445641
  ]
445403
445642
  }, undefined, true, undefined, this)
445404
445643
  }, undefined, false, undefined, this);
445405
445644
  $5[36] = statusContent;
445406
- $5[37] = t4;
445645
+ $5[37] = t10;
445407
445646
  $5[38] = t5;
445408
445647
  $5[39] = t6;
445409
445648
  $5[40] = t7;
445410
445649
  $5[41] = t8;
445411
445650
  $5[42] = t9;
445412
- $5[43] = t10;
445651
+ $5[43] = t11;
445413
445652
  } else {
445414
- t10 = $5[43];
445653
+ t11 = $5[43];
445415
445654
  }
445416
- let t11;
445417
- if ($5[44] !== diff || $5[45] !== diffStyle || $5[46] !== t2.amber || $5[47] !== t2.textMuted || $5[48] !== t2.textSecondary) {
445418
- t11 = diff ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
445655
+ let t12;
445656
+ if ($5[44] !== diff || $5[45] !== diffStyle || $5[46] !== suppressExpanded || $5[47] !== t3.amber || $5[48] !== t3.textMuted || $5[49] !== t3.textSecondary) {
445657
+ t12 = !suppressExpanded && diff ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
445419
445658
  marginTop: 1,
445420
445659
  flexDirection: "column",
445421
445660
  children: [
@@ -445428,15 +445667,15 @@ function StaticToolRow(t0) {
445428
445667
  mode: diffStyle
445429
445668
  }, undefined, false, undefined, this),
445430
445669
  diff.impact ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
445431
- fg: t2.textMuted,
445670
+ fg: t3.textMuted,
445432
445671
  children: [
445433
445672
  " ",
445434
445673
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445435
- fg: t2.amber,
445674
+ fg: t3.amber,
445436
445675
  children: icon("impact")
445437
445676
  }, undefined, false, undefined, this),
445438
445677
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
445439
- fg: t2.textSecondary,
445678
+ fg: t3.textSecondary,
445440
445679
  children: [
445441
445680
  " ",
445442
445681
  diff.impact
@@ -445448,39 +445687,41 @@ function StaticToolRow(t0) {
445448
445687
  }, undefined, true, undefined, this) : null;
445449
445688
  $5[44] = diff;
445450
445689
  $5[45] = diffStyle;
445451
- $5[46] = t2.amber;
445452
- $5[47] = t2.textMuted;
445453
- $5[48] = t2.textSecondary;
445454
- $5[49] = t11;
445690
+ $5[46] = suppressExpanded;
445691
+ $5[47] = t3.amber;
445692
+ $5[48] = t3.textMuted;
445693
+ $5[49] = t3.textSecondary;
445694
+ $5[50] = t12;
445455
445695
  } else {
445456
- t11 = $5[49];
445696
+ t12 = $5[50];
445457
445697
  }
445458
- let t12;
445459
- if ($5[50] !== imageArt) {
445460
- t12 = imageArt && imageArt.length > 0 ? imageArt.map(_temp17) : null;
445461
- $5[50] = imageArt;
445462
- $5[51] = t12;
445698
+ let t13;
445699
+ if ($5[51] !== imageArt || $5[52] !== suppressExpanded) {
445700
+ t13 = !suppressExpanded && imageArt && imageArt.length > 0 ? imageArt.map(_temp17) : null;
445701
+ $5[51] = imageArt;
445702
+ $5[52] = suppressExpanded;
445703
+ $5[53] = t13;
445463
445704
  } else {
445464
- t12 = $5[51];
445705
+ t13 = $5[53];
445465
445706
  }
445466
- let t13;
445467
- if ($5[52] !== t10 || $5[53] !== t11 || $5[54] !== t12) {
445468
- t13 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
445707
+ let t14;
445708
+ if ($5[54] !== t11 || $5[55] !== t12 || $5[56] !== t13) {
445709
+ t14 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
445469
445710
  flexDirection: "column",
445470
445711
  children: [
445471
- t10,
445472
445712
  t11,
445473
- t12
445713
+ t12,
445714
+ t13
445474
445715
  ]
445475
445716
  }, undefined, true, undefined, this);
445476
- $5[52] = t10;
445477
- $5[53] = t11;
445478
- $5[54] = t12;
445479
- $5[55] = t13;
445717
+ $5[54] = t11;
445718
+ $5[55] = t12;
445719
+ $5[56] = t13;
445720
+ $5[57] = t14;
445480
445721
  } else {
445481
- t13 = $5[55];
445722
+ t14 = $5[57];
445482
445723
  }
445483
- return t13;
445724
+ return t14;
445484
445725
  }
445485
445726
  function _temp17(img) {
445486
445727
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
@@ -446081,199 +446322,372 @@ function isDenied(error48) {
446081
446322
  return !!error48 && /denied|rejected|cancelled/i.test(error48);
446082
446323
  }
446083
446324
  function ToolCallRow(t0) {
446084
- const $5 = import_compiler_runtime18.c(21);
446325
+ const $5 = import_compiler_runtime18.c(44);
446085
446326
  const {
446086
446327
  tc,
446087
446328
  diffStyle,
446088
- autoCompactDiffs: t1
446329
+ autoCompactDiffs: t1,
446330
+ connectorChar,
446331
+ treePosition
446089
446332
  } = t0;
446090
446333
  const autoCompactDiffs = t1 === undefined ? false : t1;
446091
446334
  const t2 = useTheme();
446092
446335
  const expanded = useCodeExpanded();
446093
446336
  const errorsExpanded = useReasoningExpanded();
446337
+ let diffContent;
446338
+ let errorContent;
446339
+ let inTree;
446094
446340
  let props;
446095
- if ($5[0] !== autoCompactDiffs || $5[1] !== diffStyle || $5[2] !== expanded || $5[3] !== tc) {
446341
+ let showErrorDetail;
446342
+ let t22;
446343
+ if ($5[0] !== autoCompactDiffs || $5[1] !== connectorChar || $5[2] !== diffStyle || $5[3] !== errorsExpanded || $5[4] !== expanded || $5[5] !== t2 || $5[6] !== tc || $5[7] !== treePosition) {
446096
446344
  props = buildFinalToolRowProps(tc);
446345
+ const effectiveDiffStyle = props.diff ? expanded || !autoCompactDiffs ? diffStyle : "compact" : diffStyle;
446097
446346
  if (props.diff) {
446098
- props.diffStyle = expanded || !autoCompactDiffs ? diffStyle : "compact";
446347
+ props.diffStyle = effectiveDiffStyle;
446099
446348
  }
446100
- $5[0] = autoCompactDiffs;
446101
- $5[1] = diffStyle;
446102
- $5[2] = expanded;
446103
- $5[3] = tc;
446104
- $5[4] = props;
446105
- } else {
446106
- props = $5[4];
446107
- }
446108
- const fullError = tc.result?.error ?? "";
446109
- const isError = !!tc.result && !tc.result.success && !isDenied(tc.result?.error);
446110
- if (isError && errorsExpanded && fullError.length > 0) {
446111
- let t23;
446112
- if ($5[5] !== fullError) {
446113
- t23 = fullError.length > 120 ? `${fullError.slice(0, 117)}\u2026` : fullError;
446114
- $5[5] = fullError;
446115
- $5[6] = t23;
446116
- } else {
446117
- t23 = $5[6];
446349
+ if (connectorChar) {
446350
+ const origStatus = props.statusContent;
446351
+ let t33;
446352
+ if ($5[14] !== connectorChar || $5[15] !== t2.textFaint) {
446353
+ t33 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446354
+ fg: t2.textFaint,
446355
+ children: connectorChar
446356
+ }, undefined, false, undefined, this);
446357
+ $5[14] = connectorChar;
446358
+ $5[15] = t2.textFaint;
446359
+ $5[16] = t33;
446360
+ } else {
446361
+ t33 = $5[16];
446362
+ }
446363
+ props.statusContent = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
446364
+ children: [
446365
+ t33,
446366
+ origStatus
446367
+ ]
446368
+ }, undefined, true, undefined, this);
446118
446369
  }
446119
- const errorPreview = t23;
446120
- const hasMore = fullError.length > 120;
446121
- let t3;
446122
- if ($5[7] !== props) {
446123
- t3 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(StaticToolRow, {
446124
- ...props
446125
- }, undefined, false, undefined, this);
446126
- $5[7] = props;
446127
- $5[8] = t3;
446370
+ inTree = !!treePosition;
446371
+ const hasExpandedContent = inTree && (!!props.diff || props.imageArt && props.imageArt.length > 0);
446372
+ const fullError = tc.result?.error ?? "";
446373
+ let t32;
446374
+ if ($5[17] !== tc.result) {
446375
+ t32 = !!tc.result && !tc.result.success && !isDenied(tc.result?.error);
446376
+ $5[17] = tc.result;
446377
+ $5[18] = t32;
446128
446378
  } else {
446129
- t3 = $5[8];
446379
+ t32 = $5[18];
446130
446380
  }
446381
+ const isError = t32;
446382
+ showErrorDetail = isError && errorsExpanded && fullError.length > 0;
446131
446383
  let t4;
446132
- if ($5[9] !== hasMore || $5[10] !== t2.textMuted) {
446133
- t4 = hasMore ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446134
- fg: t2.textMuted,
446135
- children: " /errors for full"
446136
- }, undefined, false, undefined, this) : null;
446137
- $5[9] = hasMore;
446138
- $5[10] = t2.textMuted;
446139
- $5[11] = t4;
446384
+ if ($5[19] !== fullError || $5[20] !== showErrorDetail || $5[21] !== t2) {
446385
+ t4 = showErrorDetail ? (() => {
446386
+ const errorPreview = fullError.length > 120 ? `${fullError.slice(0, 117)}\u2026` : fullError;
446387
+ const hasMore = fullError.length > 120;
446388
+ return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446389
+ paddingLeft: 3,
446390
+ height: 1,
446391
+ flexShrink: 0,
446392
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
446393
+ truncate: true,
446394
+ fg: t2.error,
446395
+ children: [
446396
+ errorPreview,
446397
+ hasMore ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446398
+ fg: t2.textMuted,
446399
+ children: " /errors for full"
446400
+ }, undefined, false, undefined, this) : null
446401
+ ]
446402
+ }, undefined, true, undefined, this)
446403
+ }, undefined, false, undefined, this);
446404
+ })() : null;
446405
+ $5[19] = fullError;
446406
+ $5[20] = showErrorDetail;
446407
+ $5[21] = t2;
446408
+ $5[22] = t4;
446140
446409
  } else {
446141
- t4 = $5[11];
446410
+ t4 = $5[22];
446142
446411
  }
446143
- let t5;
446144
- if ($5[12] !== errorPreview || $5[13] !== t2.error || $5[14] !== t4) {
446145
- t5 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446146
- paddingLeft: 3,
446147
- height: 1,
446148
- flexShrink: 0,
446149
- children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
446150
- truncate: true,
446151
- fg: t2.error,
446412
+ errorContent = t4;
446413
+ diffContent = hasExpandedContent && props.diff ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446414
+ marginTop: 1,
446415
+ flexDirection: "column",
446416
+ children: [
446417
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(DiffView, {
446418
+ filePath: props.diff.path,
446419
+ oldString: props.diff.oldString,
446420
+ newString: props.diff.newString,
446421
+ success: props.diff.success,
446422
+ errorMessage: props.diff.errorMessage,
446423
+ mode: effectiveDiffStyle
446424
+ }, undefined, false, undefined, this),
446425
+ props.diff.impact ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
446426
+ fg: t2.textMuted,
446152
446427
  children: [
446153
- errorPreview,
446154
- t4
446428
+ " ",
446429
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446430
+ fg: t2.amber,
446431
+ children: icon("impact")
446432
+ }, undefined, false, undefined, this),
446433
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446434
+ fg: t2.textSecondary,
446435
+ children: [
446436
+ " ",
446437
+ props.diff.impact
446438
+ ]
446439
+ }, undefined, true, undefined, this)
446155
446440
  ]
446156
- }, undefined, true, undefined, this)
446441
+ }, undefined, true, undefined, this) : null
446442
+ ]
446443
+ }, undefined, true, undefined, this) : null;
446444
+ t22 = hasExpandedContent && props.imageArt && props.imageArt.length > 0 ? props.imageArt.map(_temp26) : null;
446445
+ $5[0] = autoCompactDiffs;
446446
+ $5[1] = connectorChar;
446447
+ $5[2] = diffStyle;
446448
+ $5[3] = errorsExpanded;
446449
+ $5[4] = expanded;
446450
+ $5[5] = t2;
446451
+ $5[6] = tc;
446452
+ $5[7] = treePosition;
446453
+ $5[8] = diffContent;
446454
+ $5[9] = errorContent;
446455
+ $5[10] = inTree;
446456
+ $5[11] = props;
446457
+ $5[12] = showErrorDetail;
446458
+ $5[13] = t22;
446459
+ } else {
446460
+ diffContent = $5[8];
446461
+ errorContent = $5[9];
446462
+ inTree = $5[10];
446463
+ props = $5[11];
446464
+ showErrorDetail = $5[12];
446465
+ t22 = $5[13];
446466
+ }
446467
+ const imageContent = t22;
446468
+ const needsContinuation = diffContent || imageContent || inTree && errorContent;
446469
+ if (needsContinuation) {
446470
+ let t32;
446471
+ if ($5[23] !== props) {
446472
+ t32 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(StaticToolRow, {
446473
+ ...props,
446474
+ suppressExpanded: true
446157
446475
  }, undefined, false, undefined, this);
446158
- $5[12] = errorPreview;
446159
- $5[13] = t2.error;
446160
- $5[14] = t4;
446161
- $5[15] = t5;
446476
+ $5[23] = props;
446477
+ $5[24] = t32;
446478
+ } else {
446479
+ t32 = $5[24];
446480
+ }
446481
+ let t4;
446482
+ if ($5[25] === Symbol.for("react.memo_cache_sentinel")) {
446483
+ t4 = ["left"];
446484
+ $5[25] = t4;
446162
446485
  } else {
446163
- t5 = $5[15];
446486
+ t4 = $5[25];
446164
446487
  }
446488
+ const t5 = treePosition?.isLast ? TREE_SPACE : TREE_PIPE;
446165
446489
  let t6;
446166
- if ($5[16] !== t3 || $5[17] !== t5) {
446490
+ if ($5[26] !== diffContent || $5[27] !== errorContent || $5[28] !== imageContent) {
446167
446491
  t6 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446492
+ flexDirection: "column",
446493
+ children: [
446494
+ diffContent,
446495
+ imageContent,
446496
+ errorContent
446497
+ ]
446498
+ }, undefined, true, undefined, this);
446499
+ $5[26] = diffContent;
446500
+ $5[27] = errorContent;
446501
+ $5[28] = imageContent;
446502
+ $5[29] = t6;
446503
+ } else {
446504
+ t6 = $5[29];
446505
+ }
446506
+ let t7;
446507
+ if ($5[30] !== t2.textFaint || $5[31] !== t5 || $5[32] !== t6) {
446508
+ t7 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446509
+ border: t4,
446510
+ customBorderChars: t5,
446511
+ borderColor: t2.textFaint,
446512
+ paddingLeft: 1,
446513
+ children: t6
446514
+ }, undefined, false, undefined, this);
446515
+ $5[30] = t2.textFaint;
446516
+ $5[31] = t5;
446517
+ $5[32] = t6;
446518
+ $5[33] = t7;
446519
+ } else {
446520
+ t7 = $5[33];
446521
+ }
446522
+ let t8;
446523
+ if ($5[34] !== t32 || $5[35] !== t7) {
446524
+ t8 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446168
446525
  flexDirection: "column",
446169
446526
  flexShrink: 0,
446170
446527
  children: [
446171
- t3,
446172
- t5
446528
+ t32,
446529
+ t7
446173
446530
  ]
446174
446531
  }, undefined, true, undefined, this);
446175
- $5[16] = t3;
446176
- $5[17] = t5;
446177
- $5[18] = t6;
446532
+ $5[34] = t32;
446533
+ $5[35] = t7;
446534
+ $5[36] = t8;
446178
446535
  } else {
446179
- t6 = $5[18];
446536
+ t8 = $5[36];
446180
446537
  }
446181
- return t6;
446538
+ return t8;
446182
446539
  }
446183
- let t22;
446184
- if ($5[19] !== props) {
446185
- t22 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(StaticToolRow, {
446540
+ if (showErrorDetail) {
446541
+ let t32;
446542
+ if ($5[37] !== props) {
446543
+ t32 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(StaticToolRow, {
446544
+ ...props
446545
+ }, undefined, false, undefined, this);
446546
+ $5[37] = props;
446547
+ $5[38] = t32;
446548
+ } else {
446549
+ t32 = $5[38];
446550
+ }
446551
+ let t4;
446552
+ if ($5[39] !== errorContent || $5[40] !== t32) {
446553
+ t4 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446554
+ flexDirection: "column",
446555
+ flexShrink: 0,
446556
+ children: [
446557
+ t32,
446558
+ errorContent
446559
+ ]
446560
+ }, undefined, true, undefined, this);
446561
+ $5[39] = errorContent;
446562
+ $5[40] = t32;
446563
+ $5[41] = t4;
446564
+ } else {
446565
+ t4 = $5[41];
446566
+ }
446567
+ return t4;
446568
+ }
446569
+ let t3;
446570
+ if ($5[42] !== props) {
446571
+ t3 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(StaticToolRow, {
446186
446572
  ...props
446187
446573
  }, undefined, false, undefined, this);
446188
- $5[19] = props;
446189
- $5[20] = t22;
446574
+ $5[42] = props;
446575
+ $5[43] = t3;
446190
446576
  } else {
446191
- t22 = $5[20];
446577
+ t3 = $5[43];
446192
446578
  }
446193
- return t22;
446579
+ return t3;
446580
+ }
446581
+ function _temp26(img) {
446582
+ return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446583
+ flexDirection: "column",
446584
+ marginTop: 1,
446585
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("ghostty-terminal", {
446586
+ ansi: img.lines.join(`
446587
+ `),
446588
+ cols: 130,
446589
+ rows: img.lines.length,
446590
+ trimEnd: true
446591
+ }, undefined, false, undefined, this)
446592
+ }, img.name, false, undefined, this);
446194
446593
  }
446195
446594
  function CollapsedToolGroup(t0) {
446196
- const $5 = import_compiler_runtime18.c(13);
446595
+ const $5 = import_compiler_runtime18.c(17);
446197
446596
  const {
446198
- calls
446597
+ calls,
446598
+ connectorChar
446199
446599
  } = t0;
446200
446600
  const t2 = useTheme();
446201
446601
  const count = calls.length;
446202
- const allOk = calls.every(_temp26);
446203
- const t1 = allOk ? t2.success : t2.error;
446204
- const t22 = allOk ? "\u2713" : "\u2717";
446205
- let t3;
446206
- if ($5[0] !== t1 || $5[1] !== t22) {
446207
- t3 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446208
- fg: t1,
446602
+ const allOk = calls.every(_temp36);
446603
+ let t1;
446604
+ if ($5[0] !== connectorChar || $5[1] !== t2.textFaint) {
446605
+ t1 = connectorChar ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446606
+ fg: t2.textFaint,
446607
+ children: connectorChar
446608
+ }, undefined, false, undefined, this) : null;
446609
+ $5[0] = connectorChar;
446610
+ $5[1] = t2.textFaint;
446611
+ $5[2] = t1;
446612
+ } else {
446613
+ t1 = $5[2];
446614
+ }
446615
+ const t22 = allOk ? t2.success : t2.error;
446616
+ const t3 = allOk ? "\u2713" : "\u2717";
446617
+ let t4;
446618
+ if ($5[3] !== t22 || $5[4] !== t3) {
446619
+ t4 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446620
+ fg: t22,
446209
446621
  children: [
446210
- t22,
446622
+ t3,
446211
446623
  " "
446212
446624
  ]
446213
446625
  }, undefined, true, undefined, this);
446214
- $5[0] = t1;
446215
- $5[1] = t22;
446216
- $5[2] = t3;
446626
+ $5[3] = t22;
446627
+ $5[4] = t3;
446628
+ $5[5] = t4;
446217
446629
  } else {
446218
- t3 = $5[2];
446630
+ t4 = $5[5];
446219
446631
  }
446220
- const t4 = t2.textSecondary;
446221
- const t5 = String(count);
446222
- const t6 = count > 1 ? "s" : "";
446223
- let t7;
446224
- if ($5[3] !== calls) {
446225
- t7 = calls.map(_temp36).join(", ");
446226
- $5[3] = calls;
446227
- $5[4] = t7;
446632
+ const t5 = t2.textSecondary;
446633
+ const t6 = String(count);
446634
+ const t7 = count > 1 ? "s" : "";
446635
+ let t8;
446636
+ if ($5[6] !== calls) {
446637
+ t8 = calls.map(_temp44).join(", ");
446638
+ $5[6] = calls;
446639
+ $5[7] = t8;
446228
446640
  } else {
446229
- t7 = $5[4];
446641
+ t8 = $5[7];
446230
446642
  }
446231
- let t8;
446232
- if ($5[5] !== t2.textSecondary || $5[6] !== t5 || $5[7] !== t6 || $5[8] !== t7) {
446233
- t8 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446234
- fg: t4,
446643
+ let t9;
446644
+ if ($5[8] !== t2.textSecondary || $5[9] !== t6 || $5[10] !== t7 || $5[11] !== t8) {
446645
+ t9 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446646
+ fg: t5,
446235
446647
  children: [
446236
- t5,
446237
- " tool call",
446238
446648
  t6,
446239
- " (",
446649
+ " tool call",
446240
446650
  t7,
446651
+ " (",
446652
+ t8,
446241
446653
  ")"
446242
446654
  ]
446243
446655
  }, undefined, true, undefined, this);
446244
- $5[5] = t2.textSecondary;
446245
- $5[6] = t5;
446246
- $5[7] = t6;
446247
- $5[8] = t7;
446248
- $5[9] = t8;
446656
+ $5[8] = t2.textSecondary;
446657
+ $5[9] = t6;
446658
+ $5[10] = t7;
446659
+ $5[11] = t8;
446660
+ $5[12] = t9;
446249
446661
  } else {
446250
- t8 = $5[9];
446662
+ t9 = $5[12];
446251
446663
  }
446252
- let t9;
446253
- if ($5[10] !== t3 || $5[11] !== t8) {
446254
- t9 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446664
+ let t10;
446665
+ if ($5[13] !== t1 || $5[14] !== t4 || $5[15] !== t9) {
446666
+ t10 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446255
446667
  height: 1,
446256
446668
  flexShrink: 0,
446257
446669
  children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
446258
446670
  truncate: true,
446259
446671
  children: [
446260
- t3,
446261
- t8
446672
+ t1,
446673
+ t4,
446674
+ t9
446262
446675
  ]
446263
446676
  }, undefined, true, undefined, this)
446264
446677
  }, undefined, false, undefined, this);
446265
- $5[10] = t3;
446266
- $5[11] = t8;
446267
- $5[12] = t9;
446678
+ $5[13] = t1;
446679
+ $5[14] = t4;
446680
+ $5[15] = t9;
446681
+ $5[16] = t10;
446268
446682
  } else {
446269
- t9 = $5[12];
446683
+ t10 = $5[16];
446270
446684
  }
446271
- return t9;
446685
+ return t10;
446272
446686
  }
446273
- function _temp36(tc_0) {
446687
+ function _temp44(tc_0) {
446274
446688
  return TOOL_LABELS[tc_0.name] ?? tc_0.name;
446275
446689
  }
446276
- function _temp26(tc) {
446690
+ function _temp36(tc) {
446277
446691
  return tc.result?.success;
446278
446692
  }
446279
446693
  function parsePlanFromArgs(tc) {
@@ -446301,9 +446715,11 @@ function parsePlanResult(tc) {
446301
446715
  }
446302
446716
  }
446303
446717
  function WritePlanCall(t0) {
446304
- const $5 = import_compiler_runtime18.c(22);
446718
+ const $5 = import_compiler_runtime18.c(37);
446305
446719
  const {
446306
- tc
446720
+ tc,
446721
+ connectorChar,
446722
+ treePosition
446307
446723
  } = t0;
446308
446724
  const t2 = useTheme();
446309
446725
  let t1;
@@ -446349,37 +446765,41 @@ function WritePlanCall(t0) {
446349
446765
  import_react39.useEffect(t3, t4);
446350
446766
  if (!plan) {
446351
446767
  let t52;
446352
- if ($5[7] !== tc) {
446768
+ if ($5[7] !== connectorChar || $5[8] !== tc || $5[9] !== treePosition) {
446353
446769
  t52 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToolCallRow, {
446354
- tc
446770
+ tc,
446771
+ connectorChar,
446772
+ treePosition
446355
446773
  }, undefined, false, undefined, this);
446356
- $5[7] = tc;
446357
- $5[8] = t52;
446774
+ $5[7] = connectorChar;
446775
+ $5[8] = tc;
446776
+ $5[9] = treePosition;
446777
+ $5[10] = t52;
446358
446778
  } else {
446359
- t52 = $5[8];
446779
+ t52 = $5[10];
446360
446780
  }
446361
446781
  return t52;
446362
446782
  }
446363
446783
  const hasResult = !!resultStr;
446364
446784
  const collapsed = hasResult && !expanded;
446365
446785
  let t5;
446366
- if ($5[9] !== collapsed || $5[10] !== plan || $5[11] !== planFile || $5[12] !== resultStr) {
446786
+ if ($5[11] !== collapsed || $5[12] !== plan || $5[13] !== planFile || $5[14] !== resultStr) {
446367
446787
  t5 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(StructuredPlanView, {
446368
446788
  plan,
446369
446789
  result: resultStr,
446370
446790
  planFile,
446371
446791
  collapsed
446372
446792
  }, undefined, false, undefined, this);
446373
- $5[9] = collapsed;
446374
- $5[10] = plan;
446375
- $5[11] = planFile;
446376
- $5[12] = resultStr;
446377
- $5[13] = t5;
446793
+ $5[11] = collapsed;
446794
+ $5[12] = plan;
446795
+ $5[13] = planFile;
446796
+ $5[14] = resultStr;
446797
+ $5[15] = t5;
446378
446798
  } else {
446379
- t5 = $5[13];
446799
+ t5 = $5[15];
446380
446800
  }
446381
446801
  let t6;
446382
- if ($5[14] !== collapsed || $5[15] !== markdown || $5[16] !== resultStr || $5[17] !== t2) {
446802
+ if ($5[16] !== collapsed || $5[17] !== markdown || $5[18] !== resultStr || $5[19] !== t2) {
446383
446803
  t6 = !collapsed && markdown && !resultStr?.includes("cancelled") && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446384
446804
  flexDirection: "column",
446385
446805
  flexShrink: 0,
@@ -446392,29 +446812,101 @@ function WritePlanCall(t0) {
446392
446812
  text: markdown
446393
446813
  }, undefined, false, undefined, this)
446394
446814
  }, undefined, false, undefined, this);
446395
- $5[14] = collapsed;
446396
- $5[15] = markdown;
446397
- $5[16] = resultStr;
446398
- $5[17] = t2;
446399
- $5[18] = t6;
446815
+ $5[16] = collapsed;
446816
+ $5[17] = markdown;
446817
+ $5[18] = resultStr;
446818
+ $5[19] = t2;
446819
+ $5[20] = t6;
446400
446820
  } else {
446401
- t6 = $5[18];
446821
+ t6 = $5[20];
446402
446822
  }
446403
446823
  let t7;
446404
- if ($5[19] !== t5 || $5[20] !== t6) {
446824
+ if ($5[21] !== t5 || $5[22] !== t6) {
446405
446825
  t7 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
446406
446826
  children: [
446407
446827
  t5,
446408
446828
  t6
446409
446829
  ]
446410
446830
  }, undefined, true, undefined, this);
446411
- $5[19] = t5;
446412
- $5[20] = t6;
446413
- $5[21] = t7;
446831
+ $5[21] = t5;
446832
+ $5[22] = t6;
446833
+ $5[23] = t7;
446414
446834
  } else {
446415
- t7 = $5[21];
446835
+ t7 = $5[23];
446416
446836
  }
446417
- return t7;
446837
+ const planContent = t7;
446838
+ if (connectorChar && treePosition) {
446839
+ let t8;
446840
+ if ($5[24] !== connectorChar || $5[25] !== t2.textFaint) {
446841
+ t8 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446842
+ height: 1,
446843
+ flexShrink: 0,
446844
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
446845
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446846
+ fg: t2.textFaint,
446847
+ children: connectorChar
446848
+ }, undefined, false, undefined, this)
446849
+ }, undefined, false, undefined, this)
446850
+ }, undefined, false, undefined, this);
446851
+ $5[24] = connectorChar;
446852
+ $5[25] = t2.textFaint;
446853
+ $5[26] = t8;
446854
+ } else {
446855
+ t8 = $5[26];
446856
+ }
446857
+ let t9;
446858
+ if ($5[27] === Symbol.for("react.memo_cache_sentinel")) {
446859
+ t9 = ["left"];
446860
+ $5[27] = t9;
446861
+ } else {
446862
+ t9 = $5[27];
446863
+ }
446864
+ const t10 = treePosition.isLast ? TREE_SPACE : TREE_PIPE;
446865
+ let t11;
446866
+ if ($5[28] !== planContent) {
446867
+ t11 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446868
+ flexDirection: "column",
446869
+ children: planContent
446870
+ }, undefined, false, undefined, this);
446871
+ $5[28] = planContent;
446872
+ $5[29] = t11;
446873
+ } else {
446874
+ t11 = $5[29];
446875
+ }
446876
+ let t12;
446877
+ if ($5[30] !== t2.textFaint || $5[31] !== t10 || $5[32] !== t11) {
446878
+ t12 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446879
+ border: t9,
446880
+ customBorderChars: t10,
446881
+ borderColor: t2.textFaint,
446882
+ paddingLeft: 1,
446883
+ children: t11
446884
+ }, undefined, false, undefined, this);
446885
+ $5[30] = t2.textFaint;
446886
+ $5[31] = t10;
446887
+ $5[32] = t11;
446888
+ $5[33] = t12;
446889
+ } else {
446890
+ t12 = $5[33];
446891
+ }
446892
+ let t13;
446893
+ if ($5[34] !== t12 || $5[35] !== t8) {
446894
+ t13 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446895
+ flexDirection: "column",
446896
+ children: [
446897
+ t8,
446898
+ t12
446899
+ ]
446900
+ }, undefined, true, undefined, this);
446901
+ $5[34] = t12;
446902
+ $5[35] = t8;
446903
+ $5[36] = t13;
446904
+ } else {
446905
+ t13 = $5[36];
446906
+ }
446907
+ return t13;
446908
+ }
446909
+ return planContent;
446418
446910
  }
446419
446911
  function truncateUserContent(content, expanded, t2) {
446420
446912
  const lines = content.split(`
@@ -446457,21 +446949,35 @@ function parsePlanTitle(content) {
446457
446949
  return match2?.[1] ?? "Plan";
446458
446950
  }
446459
446951
  function renderSegments(segments, toolCallMap, diffStyle = "default", autoCompactDiffs = false, showReasoning = true, reasoningExpanded = false, t2 = getThemeTokens()) {
446952
+ const merged = [];
446953
+ for (const seg of segments) {
446954
+ if (seg.type === "text" && seg.content.trim() === "")
446955
+ continue;
446956
+ const prev = merged[merged.length - 1];
446957
+ if (seg.type === "tools" && prev?.type === "tools") {
446958
+ prev.toolCallIds.push(...seg.toolCallIds);
446959
+ } else {
446960
+ merged.push(seg.type === "tools" ? {
446961
+ ...seg,
446962
+ toolCallIds: [...seg.toolCallIds]
446963
+ } : seg);
446964
+ }
446965
+ }
446460
446966
  let firstToolsIdx = -1;
446461
- for (let k5 = 0;k5 < segments.length; k5++) {
446462
- if (segments[k5]?.type === "tools") {
446967
+ for (let k5 = 0;k5 < merged.length; k5++) {
446968
+ if (merged[k5]?.type === "tools") {
446463
446969
  firstToolsIdx = k5;
446464
446970
  break;
446465
446971
  }
446466
446972
  }
446467
446973
  let lastVisibleType = null;
446468
- return segments.map((seg, i4) => {
446974
+ return merged.map((seg, i4) => {
446469
446975
  if (seg.type === "reasoning" && !showReasoning)
446470
446976
  return null;
446471
446977
  const needsGap = lastVisibleType !== null && lastVisibleType !== seg.type;
446472
446978
  lastVisibleType = seg.type;
446473
446979
  if (seg.type === "text") {
446474
- const isLastSegment = i4 === segments.length - 1;
446980
+ const isLastSegment = i4 === merged.length - 1;
446475
446981
  const hasToolsBefore = firstToolsIdx >= 0 && firstToolsIdx < i4;
446476
446982
  const isFinalAnswer = isLastSegment && hasToolsBefore && seg.content.trim().length > 20;
446477
446983
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
@@ -446605,14 +447111,22 @@ function renderSegments(segments, toolCallMap, diffStyle = "default", autoCompac
446605
447111
  if (calls.length === 0)
446606
447112
  return null;
446607
447113
  const groups = groupToolCalls(calls);
447114
+ const totalItems = groups.length;
447115
+ const useTree = totalItems >= 2;
446608
447116
  const toolsKey = `tools-${seg.toolCallIds[0] ?? String(i4)}`;
446609
447117
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446610
447118
  flexDirection: "column",
446611
447119
  marginTop: needsGap ? 1 : 0,
446612
447120
  children: groups.map((g3, gi) => {
447121
+ const treePos = useTree ? {
447122
+ isFirst: gi === 0,
447123
+ isLast: gi === totalItems - 1
447124
+ } : undefined;
447125
+ const connChar = treePos ? treePos.isLast ? "\u2514 " : treePos.isFirst ? "\u250C " : "\u251C " : undefined;
446613
447126
  if (g3.type === "meta") {
446614
447127
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(CollapsedToolGroup, {
446615
- calls: g3.calls
447128
+ calls: g3.calls,
447129
+ connectorChar: connChar
446616
447130
  }, `meta-${String(gi)}`, false, undefined, this);
446617
447131
  }
446618
447132
  if (g3.type === "batch") {
@@ -446650,6 +447164,10 @@ function renderSegments(segments, toolCallMap, diffStyle = "default", autoCompac
446650
447164
  children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
446651
447165
  truncate: true,
446652
447166
  children: [
447167
+ connChar ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
447168
+ fg: t2.textFaint,
447169
+ children: connChar
447170
+ }, undefined, false, undefined, this) : null,
446653
447171
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
446654
447172
  fg: statusColor,
446655
447173
  children: [
@@ -446688,18 +447206,22 @@ function renderSegments(segments, toolCallMap, diffStyle = "default", autoCompac
446688
447206
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
446689
447207
  flexDirection: "column",
446690
447208
  children: g3.tc.name === "write_plan" || g3.tc.name === "plan" ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(WritePlanCall, {
446691
- tc: g3.tc
447209
+ tc: g3.tc,
447210
+ connectorChar: connChar,
447211
+ treePosition: treePos
446692
447212
  }, undefined, false, undefined, this) : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToolCallRow, {
446693
447213
  tc: g3.tc,
446694
447214
  diffStyle,
446695
- autoCompactDiffs
447215
+ autoCompactDiffs,
447216
+ connectorChar: connChar,
447217
+ treePosition: treePos
446696
447218
  }, undefined, false, undefined, this)
446697
447219
  }, g3.tc.id, false, undefined, this);
446698
447220
  })
446699
447221
  }, toolsKey, false, undefined, this);
446700
447222
  });
446701
447223
  }
446702
- function _temp44(tc_0) {
447224
+ function _temp53(tc_0) {
446703
447225
  return tc_0.name !== "task_list" && tc_0.name !== "update_plan_step";
446704
447226
  }
446705
447227
  var import_compiler_runtime18, import_react39, ReasoningExpandedContext, ReasoningExpandedProvider, REVEAL_INTERVAL = 30, MAX_REVEAL_STEPS = 15, CURSOR_CHAR = "\u2588", RAIL_BORDER, TRUNCATE_THRESHOLD = 10, TRUNCATE_HEAD = 4, TRUNCATE_TAIL = 4, UserMessageAccent, UserMessageBubble, AssistantMessage, StaticMessage, MessageList;
@@ -446714,8 +447236,10 @@ var init_MessageList = __esm(async () => {
446714
447236
  await __promiseAll([
446715
447237
  init_core4(),
446716
447238
  init_StructuredPlanView(),
447239
+ init_DiffView(),
446717
447240
  init_Markdown(),
446718
- init_StaticToolRow()
447241
+ init_StaticToolRow(),
447242
+ init_ToolCallDisplay()
446719
447243
  ]);
446720
447244
  import_compiler_runtime18 = __toESM(require_compiler_runtime(), 1);
446721
447245
  import_react39 = __toESM(require_react(), 1);
@@ -447230,7 +447754,7 @@ var init_MessageList = __esm(async () => {
447230
447754
  }, undefined, false, undefined, this),
447231
447755
  hasTools && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
447232
447756
  flexDirection: "column",
447233
- children: msg.toolCalls?.filter(_temp44).map((tc_1) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
447757
+ children: msg.toolCalls?.filter(_temp53).map((tc_1) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
447234
447758
  flexDirection: "column",
447235
447759
  children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToolCallRow, {
447236
447760
  tc: tc_1,
@@ -450396,7 +450920,7 @@ function StatusLine(t0) {
450396
450920
  let t3;
450397
450921
  let t4;
450398
450922
  if ($5[0] !== providers || $5[1] !== tk.textMuted || $5[2] !== tk.warning) {
450399
- const names = providers.slice(0, 4).map(_temp53);
450923
+ const names = providers.slice(0, 4).map(_temp54);
450400
450924
  const overflow = providers.length > 4 ? providers.length - 4 : 0;
450401
450925
  t1 = "row";
450402
450926
  t2 = 0;
@@ -450467,7 +450991,7 @@ function StatusLine(t0) {
450467
450991
  }
450468
450992
  return t6;
450469
450993
  }
450470
- function _temp53(p2) {
450994
+ function _temp54(p2) {
450471
450995
  return p2.name.toLowerCase();
450472
450996
  }
450473
450997
  function IndexingStatus() {
@@ -450764,14 +451288,30 @@ function LoadingStatus({
450764
451288
  flexDirection: "column",
450765
451289
  flexShrink: 0,
450766
451290
  children: [
450767
- showBusy && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
450768
- height: 1,
450769
- paddingX: 1,
450770
- children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
450771
- ref: scanRef,
450772
- content: buildScanContent(scanPosRef.current, scanWidth)
450773
- }, undefined, false, undefined, this)
450774
- }, undefined, false, undefined, this),
451291
+ showBusy && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
451292
+ children: [
451293
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
451294
+ height: 1,
451295
+ paddingX: 1,
451296
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
451297
+ fg: getThemeTokens().error,
451298
+ attributes: TextAttributes.BOLD,
451299
+ children: [
451300
+ icon("stop"),
451301
+ " ^X to stop"
451302
+ ]
451303
+ }, undefined, true, undefined, this)
451304
+ }, undefined, false, undefined, this),
451305
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
451306
+ height: 1,
451307
+ paddingX: 1,
451308
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
451309
+ ref: scanRef,
451310
+ content: buildScanContent(scanPosRef.current, scanWidth)
451311
+ }, undefined, false, undefined, this)
451312
+ }, undefined, false, undefined, this)
451313
+ ]
451314
+ }, undefined, true, undefined, this),
450775
451315
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
450776
451316
  height: 1,
450777
451317
  flexDirection: "row",
@@ -451700,7 +452240,7 @@ function _temp313(s2) {
451700
452240
  function _temp48(m_1) {
451701
452241
  return m_1.role !== "system" || m_1.showInChat;
451702
452242
  }
451703
- function _temp54() {}
452243
+ function _temp55() {}
451704
452244
  var import_compiler_runtime30, import_react55, MAX_RENDERED = 60, SCROLLBOX_STYLE, SCROLLBAR_HIDDEN, TabInstance;
451705
452245
  var init_TabInstance = __esm(async () => {
451706
452246
  init_shallow2();
@@ -452331,7 +452871,7 @@ var init_TabInstance = __esm(async () => {
452331
452871
  if ($5[119] !== chat.sessionId || $5[120] !== cwd2) {
452332
452872
  t43 = () => {
452333
452873
  const p_0 = join44(cwd2, ".soulforge", "plans", planFileName(chat.sessionId));
452334
- unlink3(p_0).catch(_temp54);
452874
+ unlink3(p_0).catch(_temp55);
452335
452875
  };
452336
452876
  $5[119] = chat.sessionId;
452337
452877
  $5[120] = cwd2;
@@ -453706,7 +454246,7 @@ function CompactionLog(t0) {
453706
454246
  onClose
453707
454247
  } = t0;
453708
454248
  useTheme();
453709
- const storeEntries = useCompactionLogStore(_temp55);
454249
+ const storeEntries = useCompactionLogStore(_temp56);
453710
454250
  let t1;
453711
454251
  if ($5[0] !== storeEntries) {
453712
454252
  t1 = [...storeEntries].sort(_temp216).map(_temp315);
@@ -453741,7 +454281,7 @@ function _temp315(e) {
453741
454281
  function _temp216(a2, b5) {
453742
454282
  return b5.timestamp - a2.timestamp;
453743
454283
  }
453744
- function _temp55(s2) {
454284
+ function _temp56(s2) {
453745
454285
  return s2.entries;
453746
454286
  }
453747
454287
  var import_compiler_runtime33, COMPACTION_CONFIG;
@@ -453945,7 +454485,7 @@ function ErrorLog(t0) {
453945
454485
  onClose
453946
454486
  } = t0;
453947
454487
  useTheme();
453948
- const bgErrors = useErrorStore(_temp57);
454488
+ const bgErrors = useErrorStore(_temp58);
453949
454489
  let t1;
453950
454490
  if ($5[0] !== bgErrors || $5[1] !== messages) {
453951
454491
  const chatEntries = extractLogEntries(messages);
@@ -453999,7 +454539,7 @@ function _temp217(e) {
453999
454539
  detail: e.message
454000
454540
  };
454001
454541
  }
454002
- function _temp57(s2) {
454542
+ function _temp58(s2) {
454003
454543
  return s2.errors;
454004
454544
  }
454005
454545
  var import_compiler_runtime34;
@@ -454195,7 +454735,7 @@ function HelpPopup(t0) {
454195
454735
  return;
454196
454736
  }
454197
454737
  if (evt.name === "up") {
454198
- setScrollOffset(_temp58);
454738
+ setScrollOffset(_temp59);
454199
454739
  return;
454200
454740
  }
454201
454741
  if (evt.name === "down") {
@@ -454526,7 +455066,7 @@ function HelpPopup(t0) {
454526
455066
  }
454527
455067
  return t29;
454528
455068
  }
454529
- function _temp58(prev) {
455069
+ function _temp59(prev) {
454530
455070
  return Math.max(0, prev - 1);
454531
455071
  }
454532
455072
  var import_compiler_runtime35, import_react61, MAX_POPUP_WIDTH = 88, CHROME_ROWS2 = 6;
@@ -454617,7 +455157,7 @@ function ApiKeySettings(t0) {
454617
455157
  const innerW = popupWidth - 2;
454618
455158
  const maxVisible = Math.max(4, Math.floor((termRows - 2) * 0.8) - CHROME_ROWS3);
454619
455159
  const t2 = useTheme();
454620
- const keys2 = useApiKeyStore(_temp59);
455160
+ const keys2 = useApiKeyStore(_temp60);
454621
455161
  const priority = useApiKeyStore(_temp218);
454622
455162
  const refresh = useApiKeyStore(_temp317);
454623
455163
  const [cursor, setCursor] = import_react63.useState(0);
@@ -455522,7 +456062,7 @@ function _temp317(s_1) {
455522
456062
  function _temp218(s_0) {
455523
456063
  return s_0.priority;
455524
456064
  }
455525
- function _temp59(s2) {
456065
+ function _temp60(s2) {
455526
456066
  return s2.keys;
455527
456067
  }
455528
456068
  var import_compiler_runtime36, import_react63, MAX_POPUP_WIDTH2 = 68, CHROME_ROWS3 = 12, PROVIDER_KEYS, useApiKeyStore, KEY_ITEMS;
@@ -455673,7 +456213,7 @@ function LspStatusPopup(t0) {
455673
456213
  }
455674
456214
  const popupHeight = Math.max(12, t3);
455675
456215
  const maxListVisible = Math.max(4, popupHeight - CHROME_ROWS4);
455676
- const bgErrors = useErrorStore(_temp60);
456216
+ const bgErrors = useErrorStore(_temp61);
455677
456217
  let t4;
455678
456218
  if ($5[5] !== bgErrors) {
455679
456219
  t4 = bgErrors.filter(_temp219);
@@ -455813,7 +456353,7 @@ function LspStatusPopup(t0) {
455813
456353
  return;
455814
456354
  }
455815
456355
  if (evt.name === "up") {
455816
- setDetailScroll(_temp56);
456356
+ setDetailScroll(_temp57);
455817
456357
  return;
455818
456358
  }
455819
456359
  if (evt.name === "down") {
@@ -456472,7 +457012,7 @@ function LspStatusPopup(t0) {
456472
457012
  }
456473
457013
  return t30;
456474
457014
  }
456475
- function _temp56(p2) {
457015
+ function _temp57(p2) {
456476
457016
  return Math.max(0, p2 - 1);
456477
457017
  }
456478
457018
  function _temp412() {}
@@ -456485,7 +457025,7 @@ function _temp318(s_0) {
456485
457025
  function _temp219(e) {
456486
457026
  return e.source.startsWith("LSP:");
456487
457027
  }
456488
- function _temp60(s2) {
457028
+ function _temp61(s2) {
456489
457029
  return s2.errors;
456490
457030
  }
456491
457031
  var import_compiler_runtime37, import_react65, CHROME_ROWS4 = 7, POLL_MS = 2000;
@@ -456522,7 +457062,7 @@ function SetupGuide(t0) {
456522
457062
  const innerW = popupWidth - 2;
456523
457063
  const maxVisible = Math.max(4, Math.floor(containerRows * 0.8) - CHROME_ROWS5);
456524
457064
  const t2 = useTheme();
456525
- const [statuses, setStatuses] = import_react67.useState(_temp61);
457065
+ const [statuses, setStatuses] = import_react67.useState(_temp64);
456526
457066
  const [cursor, setCursor] = import_react67.useState(0);
456527
457067
  const [scrollOffset, setScrollOffset] = import_react67.useState(0);
456528
457068
  const [installing, setInstalling] = import_react67.useState(null);
@@ -457295,7 +457835,7 @@ function _temp319(c) {
457295
457835
  function _temp220() {
457296
457836
  return detectInstalledFonts();
457297
457837
  }
457298
- function _temp61() {
457838
+ function _temp64() {
457299
457839
  return checkPrerequisites();
457300
457840
  }
457301
457841
  var import_compiler_runtime38, import_react67, MAX_POPUP_WIDTH3 = 74, CHROME_ROWS5 = 10;
@@ -457330,7 +457870,7 @@ function WebSearchSettings(t0) {
457330
457870
  const innerW = popupWidth - 2;
457331
457871
  const maxVisible = Math.max(4, Math.floor((termRows - 2) * 0.8) - CHROME_ROWS6);
457332
457872
  const t2 = useTheme();
457333
- const keys2 = useWebSearchStore(_temp64);
457873
+ const keys2 = useWebSearchStore(_temp66);
457334
457874
  const refresh = useWebSearchStore(_temp221);
457335
457875
  const [cursor, setCursor] = import_react69.useState(0);
457336
457876
  const [mode, setMode] = import_react69.useState("menu");
@@ -458331,7 +458871,7 @@ function _temp320(v_0) {
458331
458871
  function _temp221(s_0) {
458332
458872
  return s_0.refresh;
458333
458873
  }
458334
- function _temp64(s2) {
458874
+ function _temp66(s2) {
458335
458875
  return s2.keys;
458336
458876
  }
458337
458877
  var import_compiler_runtime39, import_react69, MAX_POPUP_WIDTH4 = 72, CHROME_ROWS6 = 10, useWebSearchStore, KEY_ITEMS2;
@@ -458380,7 +458920,7 @@ function SimpleModalLayer(t0) {
458380
458920
  messages,
458381
458921
  onSystemMessage
458382
458922
  } = t0;
458383
- const modalHelpPopup = useUIStore(_temp66);
458923
+ const modalHelpPopup = useUIStore(_temp67);
458384
458924
  const modalWebSearchSettings = useUIStore(_temp222);
458385
458925
  const modalApiKeySettings = useUIStore(_temp321);
458386
458926
  const modalSetup = useUIStore(_temp414);
@@ -458561,7 +459101,7 @@ function _temp321(s_1) {
458561
459101
  function _temp222(s_0) {
458562
459102
  return s_0.modals.webSearchSettings;
458563
459103
  }
458564
- function _temp66(s2) {
459104
+ function _temp67(s2) {
458565
459105
  return s2.modals.helpPopup;
458566
459106
  }
458567
459107
  var import_compiler_runtime40, closerCache, getCloser = (name21) => closerCache[name21] ??= () => useUIStore.getState().closeModal(name21);
@@ -458716,7 +459256,7 @@ function CommandPalette(t0) {
458716
459256
  } = usePopupScroll(maxVisible);
458717
459257
  let t22;
458718
459258
  if ($5[8] === Symbol.for("react.memo_cache_sentinel")) {
458719
- t22 = getCommandDefs().filter(_temp67);
459259
+ t22 = getCommandDefs().filter(_temp68);
458720
459260
  $5[8] = t22;
458721
459261
  } else {
458722
459262
  t22 = $5[8];
@@ -459279,7 +459819,7 @@ function _temp322(q_0) {
459279
459819
  function _temp223(q4) {
459280
459820
  return q4.slice(0, -1);
459281
459821
  }
459282
- function _temp67(d3) {
459822
+ function _temp68(d3) {
459283
459823
  return !d3.hidden;
459284
459824
  }
459285
459825
  function renderHighlightedCmd(cmd, indices, baseFg, hlFg, bg2, bold2) {
@@ -460228,7 +460768,7 @@ function DiagnosePopup(t0) {
460228
460768
  return;
460229
460769
  }
460230
460770
  if (evt.name === "up") {
460231
- setScrollOffset(_temp68);
460771
+ setScrollOffset(_temp69);
460232
460772
  return;
460233
460773
  }
460234
460774
  if (evt.name === "down") {
@@ -460566,7 +461106,7 @@ function DiagnosePopup(t0) {
460566
461106
  }
460567
461107
  return t30;
460568
461108
  }
460569
- function _temp68(prev) {
461109
+ function _temp69(prev) {
460570
461110
  return Math.max(0, prev - 1);
460571
461111
  }
460572
461112
  var import_compiler_runtime42, import_react75, CHROME_ROWS9 = 6, SPINNER;
@@ -461765,7 +462305,7 @@ function SetupStep(t0) {
461765
462305
  } = t0;
461766
462306
  let t1;
461767
462307
  if ($5[0] === Symbol.for("react.memo_cache_sentinel")) {
461768
- t1 = PROVIDERS.some(_temp69);
462308
+ t1 = PROVIDERS.some(_temp70);
461769
462309
  $5[0] = t1;
461770
462310
  } else {
461771
462311
  t1 = $5[0];
@@ -462574,7 +463114,7 @@ function _temp323(v_0) {
462574
463114
  function _temp224(n) {
462575
463115
  return n + 1;
462576
463116
  }
462577
- function _temp69(p2) {
463117
+ function _temp70(p2) {
462578
463118
  return hasKey(p2.id);
462579
463119
  }
462580
463120
  var import_compiler_runtime48, import_react82, PROVIDERS;
@@ -462837,7 +463377,7 @@ function ThemeStep(t0) {
462837
463377
  t1 = $5[0];
462838
463378
  }
462839
463379
  const themes = t1;
462840
- const currentName = useThemeStore(_temp70);
463380
+ const currentName = useThemeStore(_temp71);
462841
463381
  const isTransparent = useThemeStore(_temp225);
462842
463382
  let t22;
462843
463383
  if ($5[1] === Symbol.for("react.memo_cache_sentinel")) {
@@ -463376,7 +463916,7 @@ function _temp324(name21, tp, mOp, dOp, bdr) {
463376
463916
  function _temp225(s_0) {
463377
463917
  return s_0.tokens.bgApp === "transparent";
463378
463918
  }
463379
- function _temp70(s2) {
463919
+ function _temp71(s2) {
463380
463920
  return s2.name;
463381
463921
  }
463382
463922
  function OptionRow(t0) {
@@ -464045,7 +464585,7 @@ var init_WorkflowStep = __esm(async () => {
464045
464585
  });
464046
464586
 
464047
464587
  // src/components/modals/wizard/index.tsx
464048
- function _temp71(i4) {
464588
+ function _temp74(i4) {
464049
464589
  return i4 + 1;
464050
464590
  }
464051
464591
  function _temp226(i_0) {
@@ -464117,7 +464657,7 @@ var init_wizard = __esm(async () => {
464117
464657
  if ($5[3] !== onClose || $5[4] !== stepIdx) {
464118
464658
  t3 = () => {
464119
464659
  if (stepIdx < STEPS.length - 1) {
464120
- setStepIdx(_temp71);
464660
+ setStepIdx(_temp74);
464121
464661
  } else {
464122
464662
  onClose();
464123
464663
  }
@@ -464461,7 +465001,7 @@ function GitCommitModal(t0) {
464461
465001
  const lines = diff.split(`
464462
465002
  `).length;
464463
465003
  setDiffSummary(lines > 1 ? `${String(lines)} lines changed` : "no staged changes");
464464
- }).catch(_temp74);
465004
+ }).catch(_temp76);
464465
465005
  };
464466
465006
  t5 = [visible, cwd2];
464467
465007
  $5[3] = cwd2;
@@ -464941,7 +465481,7 @@ Co-Authored-By: SoulForge <noreply@soulforge.com>` : message.trim();
464941
465481
  function _temp227(prev) {
464942
465482
  return !prev;
464943
465483
  }
464944
- function _temp74() {}
465484
+ function _temp76() {}
464945
465485
  var import_compiler_runtime54, import_react91, MAX_POPUP_WIDTH7 = 64;
464946
465486
  var init_GitCommitModal = __esm(async () => {
464947
465487
  init_status();
@@ -465043,7 +465583,7 @@ function GitMenu(t0) {
465043
465583
  if (entries2.length === 0) {
465044
465584
  onSystemMessage("No commits found.");
465045
465585
  } else {
465046
- const logText = entries2.map(_temp76).join(`
465586
+ const logText = entries2.map(_temp77).join(`
465047
465587
  `);
465048
465588
  onSystemMessage(logText);
465049
465589
  }
@@ -465410,7 +465950,7 @@ function GitMenu(t0) {
465410
465950
  }
465411
465951
  return t23;
465412
465952
  }
465413
- function _temp76(e) {
465953
+ function _temp77(e) {
465414
465954
  return `${e.hash} ${e.subject} (${e.date})`;
465415
465955
  }
465416
465956
  var import_compiler_runtime55, import_react93, MAX_POPUP_WIDTH8 = 54, CHROME_ROWS11 = 7, MENU_ITEMS;
@@ -465506,7 +466046,7 @@ function InfoPopup(t0) {
465506
466046
  return;
465507
466047
  }
465508
466048
  if (evt.name === "up" || evt.name === "k") {
465509
- setScrollOffset(_temp77);
466049
+ setScrollOffset(_temp78);
465510
466050
  return;
465511
466051
  }
465512
466052
  if (evt.name === "down" || evt.name === "j") {
@@ -465890,7 +466430,7 @@ function InfoPopup(t0) {
465890
466430
  function _temp228(text3, max) {
465891
466431
  return text3.length > max ? `${text3.slice(0, max - 1)}\u2026` : text3;
465892
466432
  }
465893
- function _temp77(prev) {
466433
+ function _temp78(prev) {
465894
466434
  return Math.max(0, prev - 1);
465895
466435
  }
465896
466436
  var import_compiler_runtime56, import_react95, CHROME_ROWS12 = 6;
@@ -465924,7 +466464,7 @@ function useAllProviderModels(active) {
465924
466464
  t0 = $5[0];
465925
466465
  }
465926
466466
  const [providerData, setProviderData] = import_react96.useState(t0);
465927
- const [availability, setAvailability] = import_react96.useState(_temp78);
466467
+ const [availability, setAvailability] = import_react96.useState(_temp79);
465928
466468
  let t1;
465929
466469
  let t2;
465930
466470
  if ($5[1] !== active) {
@@ -466023,7 +466563,7 @@ function _temp325(p_0) {
466023
466563
  return p_0.loading;
466024
466564
  }
466025
466565
  function _temp229() {}
466026
- function _temp78() {
466566
+ function _temp79() {
466027
466567
  const cached2 = getCachedProviderStatuses();
466028
466568
  const map2 = new Map;
466029
466569
  if (cached2) {
@@ -466809,7 +467349,7 @@ function SessionPicker(t0) {
466809
467349
  return;
466810
467350
  }
466811
467351
  if (evt.name === "backspace" || evt.name === "delete") {
466812
- setQuery(_temp79);
467352
+ setQuery(_temp80);
466813
467353
  resetScroll();
466814
467354
  return;
466815
467355
  }
@@ -467412,7 +467952,7 @@ function _temp326(s_0, x4) {
467412
467952
  function _temp230(prev_3) {
467413
467953
  return `${prev_3} `;
467414
467954
  }
467415
- function _temp79(prev_1) {
467955
+ function _temp80(prev_1) {
467416
467956
  return prev_1.slice(0, -1);
467417
467957
  }
467418
467958
  var import_compiler_runtime58, import_react100, POPUP_CHROME = 8, COL_MSGS = 7, COL_SIZE = 7, COL_TIME = 11, COL_FIXED;
@@ -468542,7 +469082,7 @@ function UpdateModal(t0) {
468542
469082
  if (!visible || tick >= 12) {
468543
469083
  return;
468544
469084
  }
468545
- const timer = setInterval(() => setTick(_temp80), 60);
469085
+ const timer = setInterval(() => setTick(_temp81), 60);
468546
469086
  return () => clearInterval(timer);
468547
469087
  };
468548
469088
  t5 = [visible, tick];
@@ -471089,7 +471629,7 @@ function _temp327(i_0) {
471089
471629
  function _temp231(i4) {
471090
471630
  return i4 + 1;
471091
471631
  }
471092
- function _temp80(prev) {
471632
+ function _temp81(prev) {
471093
471633
  return prev + 1;
471094
471634
  }
471095
471635
  var import_compiler_runtime60, import_react104, UPGRADE_QUIPS, LATEST_QUIPS, SPINNER2, GHOST_FADE2, WISP, MAX_LOG = 50, BOLD5, ITALIC4, DIM4;
@@ -472987,6 +473527,8 @@ function readValuesFromLayer(layer) {
472987
473527
  v4.speed = layer.performance.speed;
472988
473528
  if (layer.performance?.sendReasoning !== undefined)
472989
473529
  v4.sendReasoning = layer.performance.sendReasoning;
473530
+ if (layer.performance?.toolStreaming !== undefined)
473531
+ v4.toolStreaming = layer.performance.toolStreaming;
472990
473532
  if (layer.performance?.disableParallelToolUse !== undefined)
472991
473533
  v4.disableParallelToolUse = layer.performance.disableParallelToolUse;
472992
473534
  if (layer.performance?.openaiReasoningEffort !== undefined)
@@ -472995,6 +473537,10 @@ function readValuesFromLayer(layer) {
472995
473537
  v4.serviceTier = layer.performance.serviceTier;
472996
473538
  if (layer.codeExecution !== undefined)
472997
473539
  v4.codeExecution = layer.codeExecution;
473540
+ if (layer.computerUse !== undefined)
473541
+ v4.computerUse = layer.computerUse;
473542
+ if (layer.anthropicTextEditor !== undefined)
473543
+ v4.anthropicTextEditor = layer.anthropicTextEditor;
472998
473544
  if (layer.webSearch !== undefined)
472999
473545
  v4.webSearch = layer.webSearch;
473000
473546
  if (layer.contextManagement?.compact !== undefined)
@@ -473053,6 +473599,12 @@ function buildPatch(key3, value) {
473053
473599
  sendReasoning: value
473054
473600
  }
473055
473601
  };
473602
+ case "toolStreaming":
473603
+ return {
473604
+ performance: {
473605
+ toolStreaming: value
473606
+ }
473607
+ };
473056
473608
  case "disableParallelToolUse":
473057
473609
  return {
473058
473610
  performance: {
@@ -473075,6 +473627,14 @@ function buildPatch(key3, value) {
473075
473627
  return {
473076
473628
  codeExecution: value
473077
473629
  };
473630
+ case "computerUse":
473631
+ return {
473632
+ computerUse: value
473633
+ };
473634
+ case "anthropicTextEditor":
473635
+ return {
473636
+ anthropicTextEditor: value
473637
+ };
473078
473638
  case "webSearch":
473079
473639
  return {
473080
473640
  webSearch: value
@@ -473135,7 +473695,7 @@ function ProviderSettings(t0) {
473135
473695
  const containerRows = termRows - 2;
473136
473696
  const popupWidth = Math.min(MAX_POPUP_WIDTH11, Math.floor(termCols * 0.85));
473137
473697
  const innerW = popupWidth - 2;
473138
- const maxVisible = Math.max(4, Math.floor(containerRows * 0.8) - CHROME_ROWS16);
473698
+ const maxVisible = Math.max(4, Math.floor(containerRows * 0.85) - CHROME_ROWS16);
473139
473699
  const t2 = useTheme();
473140
473700
  const [tab, setTab] = import_react110.useState("claude");
473141
473701
  const {
@@ -473738,7 +474298,7 @@ function ProviderSettings(t0) {
473738
474298
  }
473739
474299
  return t33;
473740
474300
  }
473741
- var import_compiler_runtime62, import_react110, MAX_POPUP_WIDTH11 = 78, CHROME_ROWS16 = 7, TABS3, TAB_LABELS2, TAB_ICONS, CLAUDE_ITEMS, OPENAI_ITEMS, GENERAL_ITEMS, TAB_ITEMS, DEFAULTS;
474301
+ var import_compiler_runtime62, import_react110, MAX_POPUP_WIDTH11 = 88, CHROME_ROWS16 = 7, TABS3, TAB_LABELS2, TAB_ICONS, CLAUDE_ITEMS, OPENAI_ITEMS, GENERAL_ITEMS, TAB_ITEMS, DEFAULTS;
473742
474302
  var init_ProviderSettings = __esm(async () => {
473743
474303
  init_icons();
473744
474304
  init_theme();
@@ -473783,9 +474343,29 @@ var init_ProviderSettings = __esm(async () => {
473783
474343
  }, {
473784
474344
  key: "speed",
473785
474345
  label: "Speed",
473786
- desc: "Opus only \u2014 2.5x faster output (requires SDK update)",
474346
+ desc: "Opus 4.6 \u2014 2.5x faster output (standard | fast)",
473787
474347
  type: "cycle",
473788
474348
  options: ["off", "standard", "fast"]
474349
+ }, {
474350
+ key: "codeExecution",
474351
+ label: "Code Execution",
474352
+ desc: "Sandboxed code evaluation (Python/Bash)",
474353
+ type: "toggle"
474354
+ }, {
474355
+ key: "computerUse",
474356
+ label: "Computer Use",
474357
+ desc: "Keyboard/mouse/screenshot control",
474358
+ type: "toggle"
474359
+ }, {
474360
+ key: "anthropicTextEditor",
474361
+ label: "Anthropic Text Editor",
474362
+ desc: "Anthropic's str_replace editor tool",
474363
+ type: "toggle"
474364
+ }, {
474365
+ key: "toolStreaming",
474366
+ label: "Tool Streaming",
474367
+ desc: "Stream tool call args incrementally (disable to debug)",
474368
+ type: "toggle"
473789
474369
  }, {
473790
474370
  key: "sendReasoning",
473791
474371
  label: "Send Reasoning",
@@ -473794,24 +474374,18 @@ var init_ProviderSettings = __esm(async () => {
473794
474374
  }, {
473795
474375
  key: "compact",
473796
474376
  label: "Server Compaction",
473797
- desc: "API-level context compaction (200K+ models)",
474377
+ desc: "Anthropic server-side context compaction (200K+ models)",
473798
474378
  type: "toggle"
473799
474379
  }, {
473800
474380
  key: "clearToolUses",
473801
474381
  label: "Clear Tool Uses",
473802
- desc: "Auto-clear old tool results, keep last 10",
474382
+ desc: "Server-side \u2014 auto-clear old tool results, keep last 6",
473803
474383
  type: "toggle"
473804
474384
  }, {
473805
474385
  key: "clearThinking",
473806
474386
  label: "Clear Thinking",
473807
- desc: "Auto-clear old thinking blocks, keep last 5",
474387
+ desc: "Server-side \u2014 auto-clear old thinking blocks, keep last 2",
473808
474388
  type: "toggle"
473809
- }, {
473810
- key: "pruning",
473811
- label: "Tool Result Pruning",
473812
- desc: "Compact old tool results \u2014 main | subagents | both | none",
473813
- type: "cycle",
473814
- options: ["none", "main", "subagents", "both"]
473815
474389
  }];
473816
474390
  OPENAI_ITEMS = [{
473817
474391
  key: "openaiReasoningEffort",
@@ -473831,16 +474405,17 @@ var init_ProviderSettings = __esm(async () => {
473831
474405
  label: "Sequential Tools",
473832
474406
  desc: "One tool at a time instead of parallel (all providers)",
473833
474407
  type: "toggle"
473834
- }, {
473835
- key: "codeExecution",
473836
- label: "Code Execution",
473837
- desc: "Sandboxed code evaluation",
473838
- type: "toggle"
473839
474408
  }, {
473840
474409
  key: "webSearch",
473841
474410
  label: "Web Search",
473842
474411
  desc: "Allow web search tool",
473843
474412
  type: "toggle"
474413
+ }, {
474414
+ key: "pruning",
474415
+ label: "Tool Result Pruning",
474416
+ desc: "Client-side \u2014 compact old tool results: main | subagents | both | none",
474417
+ type: "cycle",
474418
+ options: ["none", "main", "subagents", "both"]
473844
474419
  }];
473845
474420
  TAB_ITEMS = {
473846
474421
  claude: CLAUDE_ITEMS,
@@ -473853,10 +474428,13 @@ var init_ProviderSettings = __esm(async () => {
473853
474428
  effort: "off",
473854
474429
  speed: "off",
473855
474430
  sendReasoning: false,
474431
+ toolStreaming: true,
473856
474432
  disableParallelToolUse: false,
473857
474433
  openaiReasoningEffort: "off",
473858
474434
  serviceTier: "off",
473859
474435
  codeExecution: false,
474436
+ computerUse: false,
474437
+ anthropicTextEditor: false,
473860
474438
  webSearch: true,
473861
474439
  compact: false,
473862
474440
  clearToolUses: false,
@@ -476457,7 +477035,7 @@ function ShutdownSplash(t0) {
476457
477035
  let t3;
476458
477036
  if ($5[2] === Symbol.for("react.memo_cache_sentinel")) {
476459
477037
  t2 = () => {
476460
- const timer = setInterval(() => setTick(_temp81), 80);
477038
+ const timer = setInterval(() => setTick(_temp83), 80);
476461
477039
  return () => clearInterval(timer);
476462
477040
  };
476463
477041
  t3 = [];
@@ -476654,7 +477232,7 @@ function ShutdownSplash(t0) {
476654
477232
  }
476655
477233
  return t14;
476656
477234
  }
476657
- function _temp81(t2) {
477235
+ function _temp83(t2) {
476658
477236
  return t2 + 1;
476659
477237
  }
476660
477238
  function nativeCopy(text3) {
@@ -477219,7 +477797,11 @@ function App({
477219
477797
  saveToScope,
477220
477798
  detectScope,
477221
477799
  agentFeatures: effectiveConfig.agentFeatures,
477222
- instructionFiles: effectiveConfig.instructionFiles
477800
+ instructionFiles: effectiveConfig.instructionFiles,
477801
+ syncActiveModel: (modelId) => {
477802
+ chat_0.setActiveModel(modelId);
477803
+ setActiveModelForHeader(modelId);
477804
+ }
477223
477805
  });
477224
477806
  }, [tabMgr, toggleEditor, nvimOpen, handleExit, cwd2, git, contextManager, handleSuspend, openEditorWithFile, effectiveConfig.nvimConfig, effectiveConfig.vimHints, effectiveConfig.verbose, effectiveConfig.diffStyle, effectiveConfig.autoCompactDiffs, effectiveConfig.compaction?.strategy, saveToScope, detectScope, effectiveConfig.agentFeatures, effectiveConfig.instructionFiles]);
477225
477807
  const closeLlmSelector = import_react120.useCallback(() => {
@@ -477537,13 +478119,13 @@ function App({
477537
478119
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(LlmSelector, {
477538
478120
  visible: modalLlmSelector,
477539
478121
  activeModel: activeModelForHeader,
477540
- onSelect: (modelId) => {
478122
+ onSelect: (modelId_0) => {
477541
478123
  const slot = useUIStore.getState().routerSlotPicking;
477542
478124
  if (slot) {
477543
478125
  const current = effectiveConfig.taskRouter ?? DEFAULT_TASK_ROUTER;
477544
478126
  const updated = {
477545
478127
  ...current,
477546
- [slot]: modelId
478128
+ [slot]: modelId_0
477547
478129
  };
477548
478130
  saveToScope({
477549
478131
  taskRouter: updated
@@ -477552,11 +478134,11 @@ function App({
477552
478134
  useUIStore.getState().closeModal("llmSelector");
477553
478135
  useUIStore.getState().openModal("routerSettings");
477554
478136
  } else {
477555
- activeChatRef.current?.setActiveModel(modelId);
477556
- notifyProviderSwitch(modelId);
477557
- setActiveModelForHeader(modelId);
478137
+ activeChatRef.current?.setActiveModel(modelId_0);
478138
+ notifyProviderSwitch(modelId_0);
478139
+ setActiveModelForHeader(modelId_0);
477558
478140
  saveToScope({
477559
- defaultModel: modelId
478141
+ defaultModel: modelId_0
477560
478142
  }, modelScope);
477561
478143
  const wasFromWizard_0 = wizardOpenedLlm.current;
477562
478144
  wizardOpenedLlm.current = false;