@tutti-os/agent-gui 0.0.46 → 0.0.48

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 (66) hide show
  1. package/dist/{AgentMentionSearchController-D5ks45fN.d.ts → AgentMentionSearchController-CExFPobz.d.ts} +1 -1
  2. package/dist/AgentMessageMarkdown-DeYPURtF.d.ts +7 -0
  3. package/dist/agent-conversation/index.d.ts +5 -4
  4. package/dist/agent-conversation/index.js +8 -8
  5. package/dist/agent-message-center/index.d.ts +2 -2
  6. package/dist/agent-message-center/index.js +36 -14
  7. package/dist/agent-message-center/index.js.map +1 -1
  8. package/dist/{agentConversationVM-1QgRwvwZ.d.ts → agentConversationVM-DSXrFL9v.d.ts} +19 -1
  9. package/dist/{AgentMessageMarkdown-Cts0dAIm.d.ts → agentGuiNodeTypes-Bp1G8pOj.d.ts} +45 -11
  10. package/dist/app/renderer/agentactivity.css +145 -12
  11. package/dist/{chunk-AMNXH4DJ.js → chunk-2RYZ4EBF.js} +2 -2
  12. package/dist/{chunk-QT45WUPQ.js → chunk-6YN7HQL5.js} +366 -52
  13. package/dist/chunk-6YN7HQL5.js.map +1 -0
  14. package/dist/{chunk-D6IYEVDT.js → chunk-7W3VWU5R.js} +10 -6
  15. package/dist/chunk-7W3VWU5R.js.map +1 -0
  16. package/dist/{chunk-NZ2BGOJU.js → chunk-EUOGIKT7.js} +2 -2
  17. package/dist/{chunk-BAQTM6VS.js → chunk-LWMC2YA3.js} +1260 -442
  18. package/dist/chunk-LWMC2YA3.js.map +1 -0
  19. package/dist/{chunk-EIC7XS3C.js → chunk-N6HRVMIS.js} +2 -2
  20. package/dist/{chunk-VFQR7AZI.js → chunk-NETHPCSA.js} +35 -5
  21. package/dist/chunk-NETHPCSA.js.map +1 -0
  22. package/dist/{chunk-OL54R6OL.js → chunk-OB43QOMC.js} +2 -2
  23. package/dist/{chunk-FRG36S6N.js → chunk-OYQZRLJQ.js} +5 -5
  24. package/dist/chunk-OYQZRLJQ.js.map +1 -0
  25. package/dist/{chunk-EU7RWKHE.js → chunk-R6GOICRO.js} +5 -5
  26. package/dist/{chunk-ZJ7OSY4T.js → chunk-RNIY43TA.js} +9 -9
  27. package/dist/{chunk-ZJ7OSY4T.js.map → chunk-RNIY43TA.js.map} +1 -1
  28. package/dist/chunk-SD56WDSC.js +359 -0
  29. package/dist/chunk-SD56WDSC.js.map +1 -0
  30. package/dist/{chunk-TXXWUG2J.js → chunk-U6JWW45G.js} +2 -1
  31. package/dist/chunk-U6JWW45G.js.map +1 -0
  32. package/dist/{chunk-62QOR3TC.js → chunk-VGDPBC6W.js} +37 -7
  33. package/dist/chunk-VGDPBC6W.js.map +1 -0
  34. package/dist/{chunk-FJG2EH4V.js → chunk-ZVKRNEOF.js} +2 -2
  35. package/dist/context-mention-palette/index.d.ts +3 -3
  36. package/dist/context-mention-palette/index.js +9 -9
  37. package/dist/i18n/index.d.ts +34 -4
  38. package/dist/i18n/index.js +2 -2
  39. package/dist/index.d.ts +308 -10
  40. package/dist/index.js +1023 -843
  41. package/dist/index.js.map +1 -1
  42. package/dist/plan-decision-ops.d.ts +2 -2
  43. package/dist/queued-prompt-runtime.d.ts +97 -0
  44. package/dist/queued-prompt-runtime.js +9 -0
  45. package/dist/queued-prompt-runtime.js.map +1 -0
  46. package/dist/workbench/contribution.js +3 -3
  47. package/dist/workbench/index.js +9 -9
  48. package/dist/workbench/launch.js +2 -2
  49. package/dist/workbench/sessionTitle.js +3 -3
  50. package/dist/workspace-agent-generated-files.d.ts +1 -1
  51. package/dist/workspace-agent-generated-files.js +3 -3
  52. package/dist/{workspaceAgentActivityListViewModel-DLnMBMoh.d.ts → workspaceAgentActivityListViewModel-B5viw5Da.d.ts} +1 -1
  53. package/package.json +21 -14
  54. package/dist/chunk-62QOR3TC.js.map +0 -1
  55. package/dist/chunk-BAQTM6VS.js.map +0 -1
  56. package/dist/chunk-D6IYEVDT.js.map +0 -1
  57. package/dist/chunk-FRG36S6N.js.map +0 -1
  58. package/dist/chunk-QT45WUPQ.js.map +0 -1
  59. package/dist/chunk-TXXWUG2J.js.map +0 -1
  60. package/dist/chunk-VFQR7AZI.js.map +0 -1
  61. /package/dist/{chunk-AMNXH4DJ.js.map → chunk-2RYZ4EBF.js.map} +0 -0
  62. /package/dist/{chunk-NZ2BGOJU.js.map → chunk-EUOGIKT7.js.map} +0 -0
  63. /package/dist/{chunk-EIC7XS3C.js.map → chunk-N6HRVMIS.js.map} +0 -0
  64. /package/dist/{chunk-OL54R6OL.js.map → chunk-OB43QOMC.js.map} +0 -0
  65. /package/dist/{chunk-EU7RWKHE.js.map → chunk-R6GOICRO.js.map} +0 -0
  66. /package/dist/{chunk-FJG2EH4V.js.map → chunk-ZVKRNEOF.js.map} +0 -0
@@ -6,11 +6,14 @@ import {
6
6
  ZoomableImage,
7
7
  cn,
8
8
  extractAgentMcpToolTarget,
9
+ extractExitPlanKeepPlanningOptionId,
10
+ extractExitPlanModeOptions,
11
+ isExitPlanSwitchModeInput,
9
12
  normalizeAskUserQuestions,
10
13
  resolveWorkspaceFileLinkAction,
11
14
  resolveWorkspaceFilePathCandidate,
12
15
  resolveWorkspaceLinkAction
13
- } from "./chunk-QT45WUPQ.js";
16
+ } from "./chunk-6YN7HQL5.js";
14
17
  import {
15
18
  AGENT_RICH_TEXT_CARET_ANCHOR,
16
19
  attrsToMentionItem,
@@ -18,7 +21,7 @@ import {
18
21
  formatAgentMentionMarkdown,
19
22
  mentionItemToAttrs,
20
23
  parseAgentMentionMarkdown
21
- } from "./chunk-FRG36S6N.js";
24
+ } from "./chunk-OYQZRLJQ.js";
22
25
  import {
23
26
  fileChangeCountFromChanges,
24
27
  fileChangeEntriesFromChanges,
@@ -28,13 +31,14 @@ import {
28
31
  import {
29
32
  getOptionalAgentActivityRuntime,
30
33
  useOptionalAgentHostApi
31
- } from "./chunk-TXXWUG2J.js";
34
+ } from "./chunk-U6JWW45G.js";
32
35
  import {
33
36
  workspaceAgentProviderLabel
34
37
  } from "./chunk-TYGL25EL.js";
35
38
  import {
39
+ getActiveUiLanguage,
36
40
  translate
37
- } from "./chunk-EIC7XS3C.js";
41
+ } from "./chunk-N6HRVMIS.js";
38
42
 
39
43
  // shared/imageGenerationTool.ts
40
44
  var KNOWN_IMAGE_GENERATION_TOOL_NAMES = /* @__PURE__ */ new Set([
@@ -2286,7 +2290,7 @@ function projectAgentApprovalItem(call, input, output) {
2286
2290
  const options = normalizeApprovalOptions(
2287
2291
  arrayValue(input?.options) ?? arrayValue(call.payload?.options) ?? []
2288
2292
  );
2289
- if (isExitPlanApprovalInput(input, options)) {
2293
+ if (isExitPlanSwitchModeInput(input)) {
2290
2294
  return null;
2291
2295
  }
2292
2296
  const mcpTarget = extractAgentMcpToolTarget({
@@ -2310,14 +2314,6 @@ function projectAgentApprovalItem(call, input, output) {
2310
2314
  occurredAtUnixMs: call.occurredAtUnixMs ?? null
2311
2315
  };
2312
2316
  }
2313
- function isExitPlanApprovalInput(input, options) {
2314
- const toolCall = objectValue(input?.toolCall);
2315
- const kind = normalizeToken(stringValue2(toolCall?.kind));
2316
- if (kind !== "switch_mode") {
2317
- return false;
2318
- }
2319
- return options.some((option) => option.id === "plan");
2320
- }
2321
2317
  function normalizeApprovalOptions(values) {
2322
2318
  return values.flatMap((value) => {
2323
2319
  const option = objectValue(value);
@@ -2374,7 +2370,7 @@ function projectAgentAskUserQuestionItem(call, input, output) {
2374
2370
  };
2375
2371
  }
2376
2372
  function projectAgentPlanModeItem(call, input) {
2377
- if (isExitPlanApprovalInput2(input)) {
2373
+ if (isExitPlanSwitchModeInput(input)) {
2378
2374
  return {
2379
2375
  itemKind: "plan-mode",
2380
2376
  id: call.id,
@@ -2385,6 +2381,8 @@ function projectAgentPlanModeItem(call, input) {
2385
2381
  status: call.status,
2386
2382
  plan: stringValue3(input?.plan) ?? stringValue3(call.payload?.plan) ?? (call.summary.trim() || null),
2387
2383
  filePath: stringValue3(input?.filePath) ?? stringValue3(call.payload?.filePath),
2384
+ options: extractExitPlanModeOptions(input),
2385
+ ...keepPlanningOption(extractExitPlanKeepPlanningOptionId(input)),
2388
2386
  occurredAtUnixMs: call.occurredAtUnixMs ?? null
2389
2387
  };
2390
2388
  }
@@ -2418,17 +2416,6 @@ function projectAgentPlanModeItem(call, input) {
2418
2416
  occurredAtUnixMs: call.occurredAtUnixMs ?? null
2419
2417
  };
2420
2418
  }
2421
- function isExitPlanApprovalInput2(input) {
2422
- const toolCall = objectValue2(input?.toolCall);
2423
- const kind = normalizeToolName2(stringValue3(toolCall?.kind));
2424
- if (kind !== "switchmode") {
2425
- return false;
2426
- }
2427
- return (arrayValue2(input?.options) ?? []).some((value) => {
2428
- const option = objectValue2(value);
2429
- return stringValue3(option?.optionId) === "plan" || stringValue3(option?.id) === "plan";
2430
- });
2431
- }
2432
2419
  function answerForQuestion(questionId, answersByQuestionId, output) {
2433
2420
  const value = answersByQuestionId[questionId];
2434
2421
  if (Array.isArray(value)) {
@@ -2444,6 +2431,9 @@ function answerForQuestion(questionId, answersByQuestionId, output) {
2444
2431
  (item) => typeof item === "string" && item.trim().length > 0
2445
2432
  ) : null;
2446
2433
  }
2434
+ function keepPlanningOption(optionId) {
2435
+ return optionId ? { keepPlanningOptionId: optionId } : {};
2436
+ }
2447
2437
  function normalizeToolName2(value) {
2448
2438
  return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
2449
2439
  }
@@ -3350,7 +3340,10 @@ function tryExtractContentField(text) {
3350
3340
 
3351
3341
  // shared/agentConversation/projection/agentTurnSummaryProjection.ts
3352
3342
  function projectAgentTurnSummaryRows(detail) {
3353
- const options = { workspaceRoot: detail.workspaceRoot };
3343
+ const options = {
3344
+ defaultCwd: detail.cwd,
3345
+ workspaceRoot: detail.workspaceRoot
3346
+ };
3354
3347
  const rows = detail.turns.flatMap(
3355
3348
  (turn) => projectAgentTurnSummaryRowForTurn(turn, options)
3356
3349
  );
@@ -3402,16 +3395,14 @@ function normalizedActivityFilePath(value, options) {
3402
3395
  }) ? path : null;
3403
3396
  }
3404
3397
  function projectAgentTurnSummaryRowForTurn(turn, options = {}) {
3398
+ const summaryCalls = turnToolCallsForSummary(turn);
3405
3399
  const files = applyShortestUniqueFileLabels(
3406
- dedupeFiles(
3407
- turnToolCallsForSummary(turn).flatMap(
3408
- (call) => filesFromCall(call, options)
3409
- )
3410
- )
3400
+ dedupeFiles(summaryCalls.flatMap((call) => filesFromCall(call, options)))
3411
3401
  );
3412
3402
  if (files.length === 0) {
3413
3403
  return [];
3414
3404
  }
3405
+ const patchBatches = patchBatchesFromCalls(summaryCalls, options);
3415
3406
  const fileCount = files.length;
3416
3407
  const createdCount = files.filter(
3417
3408
  (file) => file.changeType === "created"
@@ -3424,6 +3415,7 @@ function projectAgentTurnSummaryRowForTurn(turn, options = {}) {
3424
3415
  id: `turn-summary:${turn.id}`,
3425
3416
  turnId: turn.id,
3426
3417
  files,
3418
+ ...patchBatches.length > 0 ? { patchBatches } : {},
3427
3419
  fileCount,
3428
3420
  modifiedCount,
3429
3421
  createdCount,
@@ -3453,11 +3445,10 @@ function turnToolCallsForSummary(turn) {
3453
3445
  }
3454
3446
  function filesFromCall(call, options) {
3455
3447
  const toolState = objectValue5(call.payload?.tool_state);
3456
- const metadata = objectValue5(call.payload?.metadata);
3457
3448
  const input = objectValue5(call.payload?.input) ?? objectValue5(toolState?.input) ?? summaryPathInput(call.summary, options);
3458
3449
  const output = objectValue5(call.payload?.output) ?? objectValue5(toolState?.output);
3459
3450
  const error = objectValue5(call.payload?.error) ?? objectValue5(toolState?.error);
3460
- const nestedTaskSteps = arrayValue5(metadata?.steps) ?? arrayValue5(output?.steps) ?? arrayValue5(call.payload?.steps) ?? [];
3451
+ const nestedTaskSteps = nestedTaskStepsFromPayload(call.payload, output);
3461
3452
  const directChanges = extractFileChanges({
3462
3453
  id: call.id,
3463
3454
  toolName: call.toolName,
@@ -3477,11 +3468,7 @@ function filesFromCall(call, options) {
3477
3468
  return extractFileChanges({
3478
3469
  id: stringValue6(step.toolUseId) ?? stringValue6(step.id) ?? `${call.id}:step:${index + 1}`,
3479
3470
  toolName: stringValue6(step.toolName) ?? stringValue6(step.tool_name) ?? stringValue6(step.name) ?? null,
3480
- statusKind: firstNonEmptyString(
3481
- stringValue6(step.statusKind),
3482
- stringValue6(step.status),
3483
- stringValue6(step.toolStatus)
3484
- ) ?? call.statusKind ?? null,
3471
+ statusKind: nestedTaskStepStatusKind(step, call.statusKind ?? null),
3485
3472
  occurredAtUnixMs: numberValue2(step.occurredAtUnixMs) ?? numberValue2(step.occurred_at_unix_ms) ?? call.occurredAtUnixMs ?? null,
3486
3473
  payload: objectValue5(step.payload),
3487
3474
  input: objectValue5(step.toolInput) ?? objectValue5(step.tool_input),
@@ -3492,6 +3479,125 @@ function filesFromCall(call, options) {
3492
3479
  });
3493
3480
  return [...directChanges, ...nestedChanges];
3494
3481
  }
3482
+ function patchBatchesFromCalls(calls, options) {
3483
+ return calls.flatMap((call) => patchBatchesFromCall(call, options));
3484
+ }
3485
+ function patchBatchesFromCall(call, options) {
3486
+ const directBatch = isFailedToolStatus(call.statusKind ?? null) ? [] : patchBatchFromPayload({
3487
+ id: call.id,
3488
+ payload: call.payload ?? null,
3489
+ toolInput: null,
3490
+ toolOutput: null,
3491
+ toolError: null,
3492
+ options
3493
+ });
3494
+ const output = objectValue5(call.payload?.output);
3495
+ const nestedTaskSteps = nestedTaskStepsFromPayload(call.payload, output);
3496
+ const nestedBatches = nestedTaskSteps.flatMap((value, index) => {
3497
+ const step = objectValue5(value);
3498
+ if (!step) {
3499
+ return [];
3500
+ }
3501
+ if (isFailedToolStatus(
3502
+ nestedTaskStepStatusKind(step, call.statusKind ?? null)
3503
+ )) {
3504
+ return [];
3505
+ }
3506
+ return patchBatchFromPayload({
3507
+ id: stringValue6(step.toolUseId) ?? stringValue6(step.id) ?? `${call.id}:step:${index + 1}`,
3508
+ payload: objectValue5(step.payload),
3509
+ toolInput: objectValue5(step.toolInput) ?? objectValue5(step.tool_input),
3510
+ toolOutput: objectValue5(step.toolResult) ?? objectValue5(step.tool_result),
3511
+ toolError: objectValue5(step.toolError) ?? objectValue5(step.tool_error),
3512
+ options
3513
+ });
3514
+ });
3515
+ return [...directBatch, ...nestedBatches];
3516
+ }
3517
+ function patchBatchFromPayload(input) {
3518
+ const toolState = objectValue5(input.payload?.tool_state);
3519
+ const metadata = objectValue5(input.payload?.metadata);
3520
+ const payloadInput = input.toolInput ?? objectValue5(input.payload?.input) ?? objectValue5(toolState?.input);
3521
+ const payloadOutput = input.toolOutput ?? objectValue5(input.payload?.output) ?? objectValue5(toolState?.output);
3522
+ const rawInput = objectValue5(payloadInput?.rawInput);
3523
+ const changes = firstFileChangeValue(
3524
+ payloadOutput?.changes,
3525
+ input.payload?.changes,
3526
+ payloadInput?.changes,
3527
+ rawInput?.changes
3528
+ );
3529
+ const patchChanges = patchChangesFromChangeMap(changes);
3530
+ if (patchChanges.length === 0) {
3531
+ return [];
3532
+ }
3533
+ return [
3534
+ {
3535
+ cwd: firstNonEmptyString(
3536
+ stringValue6(input.payload?.cwd),
3537
+ stringValue6(payloadInput?.cwd),
3538
+ stringValue6(rawInput?.cwd),
3539
+ stringValue6(payloadOutput?.cwd),
3540
+ stringValue6(metadata?.cwd),
3541
+ input.options.defaultCwd ?? null
3542
+ ) ?? null,
3543
+ toolCallId: input.id,
3544
+ changes: patchChanges
3545
+ }
3546
+ ];
3547
+ }
3548
+ function patchChangesFromChangeMap(changes) {
3549
+ return fileChangeEntriesFromChanges(changes).flatMap((entry) => {
3550
+ const change = entry.change;
3551
+ const normalizedPath = entry.path.trim();
3552
+ if (!normalizedPath) {
3553
+ return [];
3554
+ }
3555
+ const normalizedType = normalizeChangeType(fileChangeTypeValue(change));
3556
+ const unifiedDiff = firstNonEmptyString(
3557
+ stringValue6(change.unified_diff),
3558
+ stringValue6(change.unifiedDiff),
3559
+ stringValue6(change.diff),
3560
+ stringValue6(change.patch)
3561
+ ) ?? null;
3562
+ let oldString = firstPresentString6(
3563
+ literalStringValue(change.old_string),
3564
+ literalStringValue(change.oldString)
3565
+ );
3566
+ const explicitContent = literalStringValue(change.content);
3567
+ let newString = firstPresentString6(
3568
+ literalStringValue(change.new_string),
3569
+ literalStringValue(change.newString),
3570
+ explicitContent
3571
+ );
3572
+ if (normalizedType === "created" && oldString === null && newString !== null) {
3573
+ oldString = "";
3574
+ }
3575
+ if (normalizedType === "deleted" && oldString === null && newString !== null) {
3576
+ oldString = newString;
3577
+ newString = "";
3578
+ }
3579
+ if (normalizedType === "deleted" && newString === null && oldString !== null) {
3580
+ newString = "";
3581
+ }
3582
+ const content = firstPresentString6(
3583
+ normalizedType === "deleted" ? null : explicitContent,
3584
+ normalizedType === "created" ? newString : null
3585
+ );
3586
+ if (!unifiedDiff && oldString === null && newString === null && content === null) {
3587
+ return [];
3588
+ }
3589
+ return [
3590
+ {
3591
+ path: normalizedPath,
3592
+ changeType: normalizedType ?? inferAgentPatchChangeType(unifiedDiff),
3593
+ unifiedDiff,
3594
+ oldString,
3595
+ newString,
3596
+ content
3597
+ }
3598
+ ];
3599
+ });
3600
+ }
3495
3601
  function summaryPathInput(summary, options) {
3496
3602
  const path = normalizedFilePath(summary, options);
3497
3603
  return path ? { path, summaryPathFallback: true } : null;
@@ -3532,21 +3638,21 @@ function extractFileChanges(input) {
3532
3638
  stringValue6(payload?.patch),
3533
3639
  stringValue6(metadata?.patch)
3534
3640
  ),
3535
- firstNonEmptyString(
3536
- stringValue6(input.output?.oldString),
3537
- stringValue6(input.output?.old_string),
3538
- stringValue6(input.input?.oldString),
3539
- stringValue6(input.input?.old_string)
3641
+ firstPresentString6(
3642
+ literalStringValue(input.output?.oldString),
3643
+ literalStringValue(input.output?.old_string),
3644
+ literalStringValue(input.input?.oldString),
3645
+ literalStringValue(input.input?.old_string)
3540
3646
  ),
3541
- firstNonEmptyString(
3542
- stringValue6(input.output?.newString),
3543
- stringValue6(input.output?.new_string),
3544
- stringValue6(input.input?.newString),
3545
- stringValue6(input.input?.new_string)
3647
+ firstPresentString6(
3648
+ literalStringValue(input.output?.newString),
3649
+ literalStringValue(input.output?.new_string),
3650
+ literalStringValue(input.input?.newString),
3651
+ literalStringValue(input.input?.new_string)
3546
3652
  ),
3547
- firstNonEmptyString(
3548
- stringValue6(input.output?.content),
3549
- stringValue6(input.input?.content)
3653
+ firstPresentString6(
3654
+ literalStringValue(input.output?.content),
3655
+ literalStringValue(input.input?.content)
3550
3656
  ),
3551
3657
  input.options
3552
3658
  );
@@ -3605,25 +3711,25 @@ function extractFileChanges(input) {
3605
3711
  stringValue6(metadata?.patch),
3606
3712
  stringValue6(input.output?.content)
3607
3713
  ) ?? null;
3608
- const oldString = firstNonEmptyString(
3609
- stringValue6(input.output?.oldString),
3610
- stringValue6(input.output?.old_string),
3611
- stringValue6(input.input?.oldString),
3612
- stringValue6(input.input?.old_string)
3613
- ) ?? null;
3614
- const newString = firstNonEmptyString(
3615
- stringValue6(input.output?.newString),
3616
- stringValue6(input.output?.new_string),
3617
- stringValue6(input.input?.newString),
3618
- stringValue6(input.input?.new_string)
3619
- ) ?? null;
3620
- const content = firstNonEmptyString(
3621
- stringValue6(input.input?.content),
3622
- stringValue6(rawInput?.content),
3623
- stringValue6(input.input?.new_source),
3624
- stringValue6(input.output?.content),
3625
- stringValue6(input.output?.new_source)
3626
- ) ?? null;
3714
+ const oldString = firstPresentString6(
3715
+ literalStringValue(input.output?.oldString),
3716
+ literalStringValue(input.output?.old_string),
3717
+ literalStringValue(input.input?.oldString),
3718
+ literalStringValue(input.input?.old_string)
3719
+ );
3720
+ const newString = firstPresentString6(
3721
+ literalStringValue(input.output?.newString),
3722
+ literalStringValue(input.output?.new_string),
3723
+ literalStringValue(input.input?.newString),
3724
+ literalStringValue(input.input?.new_string)
3725
+ );
3726
+ const content = firstPresentString6(
3727
+ literalStringValue(input.input?.content),
3728
+ literalStringValue(rawInput?.content),
3729
+ literalStringValue(input.input?.new_source),
3730
+ literalStringValue(input.output?.content),
3731
+ literalStringValue(input.output?.new_source)
3732
+ );
3627
3733
  const explicitChangeType = normalizeChangeType(
3628
3734
  firstNonEmptyString(
3629
3735
  stringValue6(payload?.fileChangeKind),
@@ -3722,16 +3828,16 @@ function collectChangeMapFiles(messageId, toolName, occurredAtUnixMs, changes, o
3722
3828
  stringValue6(change.diff),
3723
3829
  stringValue6(change.patch)
3724
3830
  );
3725
- let oldString = firstNonEmptyString(
3726
- stringValue6(change.old_string),
3727
- stringValue6(change.oldString)
3728
- ) ?? null;
3729
- const explicitContent = stringValue6(change.content);
3730
- let newString = firstNonEmptyString(
3731
- stringValue6(change.new_string),
3732
- stringValue6(change.newString),
3831
+ let oldString = firstPresentString6(
3832
+ literalStringValue(change.old_string),
3833
+ literalStringValue(change.oldString)
3834
+ );
3835
+ const explicitContent = literalStringValue(change.content);
3836
+ let newString = firstPresentString6(
3837
+ literalStringValue(change.new_string),
3838
+ literalStringValue(change.newString),
3733
3839
  explicitContent
3734
- ) ?? null;
3840
+ );
3735
3841
  if (normalizedType === "created" && oldString === null && newString !== null) {
3736
3842
  oldString = "";
3737
3843
  }
@@ -3742,10 +3848,10 @@ function collectChangeMapFiles(messageId, toolName, occurredAtUnixMs, changes, o
3742
3848
  if (normalizedType === "deleted" && newString === null && oldString !== null) {
3743
3849
  newString = "";
3744
3850
  }
3745
- const content = firstNonEmptyString(
3851
+ const content = firstPresentString6(
3746
3852
  normalizedType === "deleted" ? null : explicitContent,
3747
3853
  normalizedType === "created" ? newString : null
3748
- ) ?? null;
3854
+ );
3749
3855
  if (!unifiedDiff && oldString === null && newString === null && content === null) {
3750
3856
  return [];
3751
3857
  }
@@ -3797,20 +3903,20 @@ function collectContentDiffFiles(messageId, toolName, occurredAtUnixMs, contentI
3797
3903
  stringValue6(relatedChange?.unified_diff),
3798
3904
  stringValue6(relatedChange?.unifiedDiff)
3799
3905
  );
3800
- let oldString = firstNonEmptyString(
3801
- stringValue6(item.oldText),
3802
- stringValue6(item.oldString),
3803
- stringValue6(relatedChange?.old_string),
3804
- stringValue6(relatedChange?.oldString)
3805
- ) ?? null;
3806
- const relatedContent = stringValue6(relatedChange?.content);
3807
- let newString = firstNonEmptyString(
3808
- stringValue6(item.newText),
3809
- stringValue6(item.newString),
3810
- stringValue6(relatedChange?.new_string),
3811
- stringValue6(relatedChange?.newString),
3906
+ let oldString = firstPresentString6(
3907
+ literalStringValue(item.oldText),
3908
+ literalStringValue(item.oldString),
3909
+ literalStringValue(relatedChange?.old_string),
3910
+ literalStringValue(relatedChange?.oldString)
3911
+ );
3912
+ const relatedContent = literalStringValue(relatedChange?.content);
3913
+ let newString = firstPresentString6(
3914
+ literalStringValue(item.newText),
3915
+ literalStringValue(item.newString),
3916
+ literalStringValue(relatedChange?.new_string),
3917
+ literalStringValue(relatedChange?.newString),
3812
3918
  relatedContent
3813
- ) ?? null;
3919
+ );
3814
3920
  if (normalizedType === "created" && oldString === null && newString !== null) {
3815
3921
  oldString = "";
3816
3922
  }
@@ -3821,7 +3927,10 @@ function collectContentDiffFiles(messageId, toolName, occurredAtUnixMs, contentI
3821
3927
  if (normalizedType === "deleted" && newString === null && oldString !== null) {
3822
3928
  newString = "";
3823
3929
  }
3824
- const explicitContent = firstNonEmptyString(stringValue6(item.content), relatedContent) ?? null;
3930
+ const explicitContent = firstPresentString6(
3931
+ literalStringValue(item.content),
3932
+ relatedContent
3933
+ );
3825
3934
  const inferredType = normalizedType ?? inferChangeTypeFromToolContent(
3826
3935
  toolName,
3827
3936
  normalizedType === "deleted" ? null : explicitContent,
@@ -3831,10 +3940,10 @@ function collectContentDiffFiles(messageId, toolName, occurredAtUnixMs, contentI
3831
3940
  if (inferredType === "created" && oldString === null && newString !== null) {
3832
3941
  oldString = "";
3833
3942
  }
3834
- const content = firstNonEmptyString(
3943
+ const content = firstPresentString6(
3835
3944
  inferredType === "deleted" ? null : explicitContent,
3836
3945
  inferredType === "created" ? newString : null
3837
- ) ?? null;
3946
+ );
3838
3947
  if (!unifiedDiff && oldString === null && newString === null && content === null) {
3839
3948
  return [];
3840
3949
  }
@@ -4037,7 +4146,7 @@ function normalizeChangeType(value) {
4037
4146
  function inferChangeTypeFromToolContent(toolName, content, oldString, newString) {
4038
4147
  const normalizedToolName = normalizeToolName4(toolName);
4039
4148
  if (normalizedToolName === "write" || normalizedToolName === "writefile") {
4040
- return content || newString ? "created" : null;
4149
+ return content !== null || newString !== null ? "created" : null;
4041
4150
  }
4042
4151
  if (oldString !== null || newString !== null) {
4043
4152
  return "modified";
@@ -4072,6 +4181,17 @@ function firstFileChangeValue(...values) {
4072
4181
  function arrayValue5(value) {
4073
4182
  return Array.isArray(value) ? value : null;
4074
4183
  }
4184
+ function nestedTaskStepsFromPayload(payload, output) {
4185
+ const metadata = objectValue5(payload?.metadata);
4186
+ return arrayValue5(metadata?.steps) ?? arrayValue5(output?.steps) ?? arrayValue5(payload?.steps) ?? [];
4187
+ }
4188
+ function nestedTaskStepStatusKind(step, fallback) {
4189
+ return firstNonEmptyString(
4190
+ stringValue6(step.statusKind),
4191
+ stringValue6(step.status),
4192
+ stringValue6(step.toolStatus)
4193
+ ) ?? fallback ?? null;
4194
+ }
4075
4195
  function firstLocationPath(value) {
4076
4196
  if (!value) {
4077
4197
  return null;
@@ -4100,6 +4220,9 @@ function firstPathValue(value) {
4100
4220
  function stringValue6(value) {
4101
4221
  return typeof value === "string" && value.trim() ? value.trim() : null;
4102
4222
  }
4223
+ function literalStringValue(value) {
4224
+ return typeof value === "string" ? value : null;
4225
+ }
4103
4226
  function numberValue2(value) {
4104
4227
  return typeof value === "number" && Number.isFinite(value) ? value : null;
4105
4228
  }
@@ -4111,6 +4234,14 @@ function firstNonEmptyString(...values) {
4111
4234
  }
4112
4235
  return null;
4113
4236
  }
4237
+ function firstPresentString6(...values) {
4238
+ for (const value of values) {
4239
+ if (typeof value === "string") {
4240
+ return value;
4241
+ }
4242
+ }
4243
+ return null;
4244
+ }
4114
4245
 
4115
4246
  // shared/agentConversation/projection/agentConversationProjection.ts
4116
4247
  var RENDER_IRRELEVANT_TRANSCRIPT_ROW_FIELDS = /* @__PURE__ */ new Set(["occurredAtUnixMs"]);
@@ -4701,7 +4832,9 @@ function selectPendingInteractivePrompt(rows) {
4701
4832
  return {
4702
4833
  kind: "exit-plan",
4703
4834
  requestId: call.planMode.requestId ?? call.id.replace(/^call:/, ""),
4704
- title: call.planMode.title
4835
+ title: call.planMode.title,
4836
+ options: call.planMode.options ?? [],
4837
+ ...call.planMode.keepPlanningOptionId ? { keepPlanningOptionId: call.planMode.keepPlanningOptionId } : {}
4705
4838
  };
4706
4839
  }
4707
4840
  }
@@ -4887,6 +5020,186 @@ var Button = React.forwardRef(
4887
5020
  );
4888
5021
  Button.displayName = "Button";
4889
5022
 
5023
+ // shared/errors/appError.ts
5024
+ function createMessageMap() {
5025
+ return {
5026
+ "common.invalid_input": "The request was invalid.",
5027
+ "common.approved_path_required": "The selected path is outside approved workspaces.",
5028
+ "common.unavailable": "This feature is unavailable.",
5029
+ "common.unexpected": "Something went wrong. Please try again.",
5030
+ "session.not_found": "Session not found.",
5031
+ "control_surface.unauthorized": "Unauthorized request.",
5032
+ "workspace.select_directory_failed": "Unable to open the directory picker.",
5033
+ "workspace.select_files_failed": "Unable to open the file picker.",
5034
+ "workspace.ensure_directory_failed": "Unable to create the directory.",
5035
+ "workspace.import_files_failed": "Unable to import the selected files.",
5036
+ "workspace.read_file_failed": "Unable to load the selected file.",
5037
+ "workspace.write_file_failed": "Unable to save the selected file.",
5038
+ "workspace.export_file_failed": "Unable to export the selected file.",
5039
+ "workspace.copy_path_failed": "Unable to copy the path.",
5040
+ "workspace.host_unsupported": "This Mac cannot run the workspace environment required by tsh. Please use macOS 13 or later on Apple Silicon (or an Intel Mac that supports Apple Virtualization), and ensure virtualization is not blocked by MDM.",
5041
+ "workspace.runtime_artifact_unavailable": "Unable to prepare the workspace environment required by tsh. Check your network connection and try again.",
5042
+ "runtime.guest_agent_lane_unavailable": "The workspace environment connection is unavailable. Refresh and try again.",
5043
+ "workspace.room_full": "Room is full.",
5044
+ "workspace.room_delete_forbidden": "Only the space owner can delete this space.",
5045
+ "workspace.room_delete_not_found": "This space no longer exists.",
5046
+ "filesystem.create_directory_failed": "Unable to create the directory.",
5047
+ "filesystem.read_file_bytes_failed": "Unable to read the file.",
5048
+ "filesystem.read_file_text_failed": "Unable to read the file.",
5049
+ "filesystem.write_file_text_failed": "Unable to save the file.",
5050
+ "filesystem.copy_entry_failed": "Unable to copy the file or folder.",
5051
+ "filesystem.move_entry_failed": "Unable to move the file or folder.",
5052
+ "filesystem.rename_entry_failed": "Unable to rename the file or folder.",
5053
+ "filesystem.delete_entry_failed": "Unable to delete the file or folder.",
5054
+ "filesystem.read_directory_failed": "Unable to load the directory.",
5055
+ "filesystem.stat_failed": "Unable to read file details.",
5056
+ "terminal.spawn_failed": "Unable to start the terminal.",
5057
+ "terminal.write_failed": "Unable to write to the terminal.",
5058
+ "terminal.resize_failed": "Unable to resize the terminal.",
5059
+ "terminal.close_failed": "Unable to close the terminal.",
5060
+ "terminal.attach_failed": "Unable to attach the terminal session.",
5061
+ "terminal.detach_failed": "Unable to detach the terminal session.",
5062
+ "terminal.snapshot_failed": "Unable to read terminal output.",
5063
+ "agent.list_models_failed": "Unable to load models for this provider.",
5064
+ "agent.launch_failed": "Unable to start the agent.",
5065
+ "agent.read_last_message_failed": "Unable to read the last agent message.",
5066
+ "agent.provider_session_not_found": "The previous agent session can no longer be restored.",
5067
+ "agent.resume_session_not_local": "The previous agent session is not available on this machine.",
5068
+ "agent.resume_session_resolve_failed": "Unable to resolve the previous agent session.",
5069
+ "agent.settings_require_new_session": "This model can only be used in a new session to preserve context.",
5070
+ "task.suggest_title_failed": "Unable to generate task details.",
5071
+ "persistence.unavailable": "Storage is unavailable; changes will not be saved.",
5072
+ "persistence.quota_exceeded": "Storage quota was exceeded.",
5073
+ "persistence.payload_too_large": "Workspace state is too large to save.",
5074
+ "persistence.io_failed": "Unable to save data to storage.",
5075
+ "persistence.invalid_state": "The workspace state could not be saved.",
5076
+ "persistence.invalid_node_id": "The terminal history could not be saved.",
5077
+ "update.get_state_failed": "Unable to read the update status.",
5078
+ "update.configure_failed": "Unable to apply update settings.",
5079
+ "update.check_failed": "Unable to check for updates.",
5080
+ "update.download_failed": "Unable to download the update.",
5081
+ "update.install_failed": "Unable to install the update.",
5082
+ PACKAGE_DOWNLOAD_INTERRUPTED: "The agent package download was interrupted. Check your network connection and retry.",
5083
+ PACKAGE_DOWNLOAD_HTTP_STATUS: "The agent package server rejected the download. Retry later or contact support.",
5084
+ PACKAGE_DOWNLOAD_INVALID: "The downloaded agent package failed integrity checks. Retry the download.",
5085
+ PACKAGE_DOWNLOAD_DISK_ERROR: "Unable to write the agent package cache. Check disk permissions and free space."
5086
+ };
5087
+ }
5088
+ var APP_ERROR_MESSAGES = createMessageMap();
5089
+ function createAppErrorDescriptor(code, options = {}) {
5090
+ return {
5091
+ code,
5092
+ ...options.params ? { params: options.params } : {},
5093
+ ...options.debugMessage ? { debugMessage: options.debugMessage } : {}
5094
+ };
5095
+ }
5096
+ function isAppErrorDescriptor(value) {
5097
+ if (!value || typeof value !== "object") {
5098
+ return false;
5099
+ }
5100
+ const record = value;
5101
+ return typeof record.code === "string" && record.code in APP_ERROR_MESSAGES;
5102
+ }
5103
+ function getAppErrorCode(error) {
5104
+ if (error instanceof TshAppError) {
5105
+ return error.code;
5106
+ }
5107
+ if (isAppErrorDescriptor(error)) {
5108
+ return error.code;
5109
+ }
5110
+ if (error && typeof error === "object") {
5111
+ const code = error.code;
5112
+ if (typeof code === "string" && code in APP_ERROR_MESSAGES) {
5113
+ return code;
5114
+ }
5115
+ }
5116
+ return null;
5117
+ }
5118
+ var TshAppError = class extends Error {
5119
+ code;
5120
+ params;
5121
+ debugMessage;
5122
+ constructor(descriptor) {
5123
+ super(formatAppErrorMessage(descriptor));
5124
+ this.name = "TshAppError";
5125
+ this.code = descriptor.code;
5126
+ this.params = descriptor.params;
5127
+ this.debugMessage = descriptor.debugMessage;
5128
+ }
5129
+ toDescriptor() {
5130
+ return createAppErrorDescriptor(this.code, {
5131
+ params: this.params,
5132
+ debugMessage: this.debugMessage
5133
+ });
5134
+ }
5135
+ };
5136
+ function formatAppErrorMessage(error) {
5137
+ const descriptor = error instanceof TshAppError ? error.toDescriptor() : error;
5138
+ return APP_ERROR_MESSAGES[descriptor.code] ?? APP_ERROR_MESSAGES["common.unexpected"];
5139
+ }
5140
+
5141
+ // app/renderer/shell/utils/format.ts
5142
+ var shortDateTimeFormatterByLanguage = /* @__PURE__ */ new Map();
5143
+ var weekdayTimeFormatterByLanguage = /* @__PURE__ */ new Map();
5144
+ function getShortDateTimeFormatter(language) {
5145
+ const cached = shortDateTimeFormatterByLanguage.get(language);
5146
+ if (cached) {
5147
+ return cached;
5148
+ }
5149
+ const formatter = new Intl.DateTimeFormat(language, {
5150
+ month: language === "en" ? "short" : "numeric",
5151
+ day: "numeric",
5152
+ hour: "2-digit",
5153
+ minute: "2-digit",
5154
+ hourCycle: "h23"
5155
+ });
5156
+ shortDateTimeFormatterByLanguage.set(language, formatter);
5157
+ return formatter;
5158
+ }
5159
+ function getWeekdayTimeFormatter(language) {
5160
+ const cached = weekdayTimeFormatterByLanguage.get(language);
5161
+ if (cached) {
5162
+ return cached;
5163
+ }
5164
+ const formatter = new Intl.DateTimeFormat(language, {
5165
+ weekday: "long",
5166
+ hour: "2-digit",
5167
+ minute: "2-digit",
5168
+ hourCycle: "h23"
5169
+ });
5170
+ weekdayTimeFormatterByLanguage.set(language, formatter);
5171
+ return formatter;
5172
+ }
5173
+ function toLocalWeekdayTime(value, language = getActiveUiLanguage()) {
5174
+ const formatter = getWeekdayTimeFormatter(language);
5175
+ const parts = formatter.formatToParts(value);
5176
+ const weekday = parts.find((part) => part.type === "weekday")?.value;
5177
+ const hour = parts.find((part) => part.type === "hour")?.value;
5178
+ const minute = parts.find((part) => part.type === "minute")?.value;
5179
+ if (weekday && hour && minute) {
5180
+ return `${weekday} ${hour}:${minute}`;
5181
+ }
5182
+ return formatter.format(value);
5183
+ }
5184
+ function toLocalShortDateTime(value, language = getActiveUiLanguage()) {
5185
+ return getShortDateTimeFormatter(language).format(value);
5186
+ }
5187
+ function formatAgentMessageTimestamp(unix, language = getActiveUiLanguage(), now = /* @__PURE__ */ new Date()) {
5188
+ if (unix == null || !Number.isFinite(unix)) {
5189
+ return null;
5190
+ }
5191
+ const value = unix > 1e12 ? unix : unix * 1e3;
5192
+ const messageDate = new Date(value);
5193
+ const startOfWeek = new Date(now);
5194
+ const daysSinceMonday = (startOfWeek.getDay() + 6) % 7;
5195
+ startOfWeek.setHours(0, 0, 0, 0);
5196
+ startOfWeek.setDate(startOfWeek.getDate() - daysSinceMonday);
5197
+ if (messageDate.getTime() >= startOfWeek.getTime()) {
5198
+ return toLocalWeekdayTime(value, language);
5199
+ }
5200
+ return toLocalShortDateTime(value, language);
5201
+ }
5202
+
4890
5203
  // shared/agentConversation/components/AgentPlanCard.tsx
4891
5204
  import { useCallback, useRef, useState } from "react";
4892
5205
  import { Check, ChevronDown, ChevronUp, Copy, ListChecks } from "lucide-react";
@@ -6808,6 +7121,7 @@ function AgentMessageBlock({
6808
7121
  AgentCopyableMessageGroup,
6809
7122
  {
6810
7123
  copyText: message.copyText ?? null,
7124
+ occurredAtUnixMs: message.occurredAtUnixMs,
6811
7125
  speaker: row.speaker,
6812
7126
  onCopyMessageText: handleCopyMessageText,
6813
7127
  children: [
@@ -6824,6 +7138,7 @@ function AgentMessageBlock({
6824
7138
  AgentCopyableMessageGroup,
6825
7139
  {
6826
7140
  copyText,
7141
+ occurredAtUnixMs: message.occurredAtUnixMs,
6827
7142
  speaker: row.speaker,
6828
7143
  onCopyMessageText: handleCopyMessageText,
6829
7144
  children: content
@@ -6840,19 +7155,24 @@ function AgentMessageBlock({
6840
7155
  function AgentCopyableMessageGroup({
6841
7156
  children,
6842
7157
  copyText,
7158
+ occurredAtUnixMs,
6843
7159
  onCopyMessageText,
6844
7160
  speaker
6845
7161
  }) {
6846
7162
  "use memo";
7163
+ const timestamp = formatAgentMessageTimestamp(occurredAtUnixMs);
6847
7164
  return /* @__PURE__ */ jsxs7("div", { className: AgentGUIConversation_styles_default.messageGroup, "data-agent-message-speaker": speaker, children: [
6848
7165
  children,
6849
- copyText ? /* @__PURE__ */ jsx12(
6850
- AgentMessageCopyButton,
6851
- {
6852
- copyText,
6853
- onCopyMessageText
6854
- }
6855
- ) : null
7166
+ timestamp || copyText ? /* @__PURE__ */ jsxs7("div", { className: AgentGUIConversation_styles_default.messageFooter, children: [
7167
+ timestamp ? /* @__PURE__ */ jsx12("span", { className: AgentGUIConversation_styles_default.messageTimestamp, children: timestamp }) : null,
7168
+ copyText ? /* @__PURE__ */ jsx12(
7169
+ AgentMessageCopyButton,
7170
+ {
7171
+ copyText,
7172
+ onCopyMessageText
7173
+ }
7174
+ ) : null
7175
+ ] }) : null
6856
7176
  ] });
6857
7177
  }
6858
7178
  function AgentMessageCopyButton({
@@ -9244,7 +9564,54 @@ function normalizeToolName7(value) {
9244
9564
 
9245
9565
  // shared/agentConversation/components/tool-renderers/code/AgentCodeBlock.tsx
9246
9566
  import { useMemo as useMemo2, useState as useState6 } from "react";
9247
- import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
9567
+
9568
+ // shared/agentConversation/components/tool-renderers/AgentPathTailLabel.tsx
9569
+ import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
9570
+ function AgentPathTailLabel({
9571
+ path,
9572
+ fallback,
9573
+ className
9574
+ }) {
9575
+ "use memo";
9576
+ const label = path?.trim() || fallback;
9577
+ const parts = splitPathTail(label);
9578
+ if (!parts) {
9579
+ return /* @__PURE__ */ jsx20(
9580
+ "span",
9581
+ {
9582
+ className: `agent-path-tail-label ${className ?? ""}`,
9583
+ title: path ?? void 0,
9584
+ children: /* @__PURE__ */ jsx20("span", { className: "agent-path-tail-label__file", children: label })
9585
+ }
9586
+ );
9587
+ }
9588
+ return /* @__PURE__ */ jsxs13(
9589
+ "span",
9590
+ {
9591
+ className: `agent-path-tail-label ${className ?? ""}`,
9592
+ title: path ?? void 0,
9593
+ children: [
9594
+ /* @__PURE__ */ jsx20("span", { className: "agent-path-tail-label__directory", children: parts.directory }),
9595
+ /* @__PURE__ */ jsx20("span", { className: "agent-path-tail-label__file", children: parts.fileName })
9596
+ ]
9597
+ }
9598
+ );
9599
+ }
9600
+ function splitPathTail(value) {
9601
+ const lastForwardSlash = value.lastIndexOf("/");
9602
+ const lastBackwardSlash = value.lastIndexOf("\\");
9603
+ const lastSeparator = Math.max(lastForwardSlash, lastBackwardSlash);
9604
+ if (lastSeparator <= 0 || lastSeparator === value.length - 1) {
9605
+ return null;
9606
+ }
9607
+ return {
9608
+ directory: value.slice(0, lastSeparator + 1),
9609
+ fileName: value.slice(lastSeparator + 1)
9610
+ };
9611
+ }
9612
+
9613
+ // shared/agentConversation/components/tool-renderers/code/AgentCodeBlock.tsx
9614
+ import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
9248
9615
  var MAX_VISIBLE_LINES = 120;
9249
9616
  function AgentCodeBlock({
9250
9617
  path,
@@ -9279,7 +9646,7 @@ function AgentCodeBlock({
9279
9646
  if (!normalized) {
9280
9647
  return null;
9281
9648
  }
9282
- const disclosureButton = collapsible && lineCount > MAX_VISIBLE_LINES ? /* @__PURE__ */ jsx20(
9649
+ const disclosureButton = collapsible && lineCount > MAX_VISIBLE_LINES ? /* @__PURE__ */ jsx21(
9283
9650
  "button",
9284
9651
  {
9285
9652
  type: "button",
@@ -9290,13 +9657,13 @@ function AgentCodeBlock({
9290
9657
  })
9291
9658
  }
9292
9659
  ) : null;
9293
- return /* @__PURE__ */ jsx20(
9660
+ return /* @__PURE__ */ jsx21(
9294
9661
  "div",
9295
9662
  {
9296
9663
  className: `workspace-agents-status-panel__detail-tool-code overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--background-panel)] ${flat ? "workspace-agents-status-panel__detail-tool-code--flat" : ""}`,
9297
- children: flat ? /* @__PURE__ */ jsxs13(Fragment3, { children: [
9298
- showHeader ? /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between gap-3 border-b border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-1.5 text-[11px]", children: [
9299
- /* @__PURE__ */ jsx20(
9664
+ children: flat ? /* @__PURE__ */ jsxs14(Fragment3, { children: [
9665
+ showHeader ? /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-3 border-b border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-1.5 text-[11px]", children: [
9666
+ /* @__PURE__ */ jsx21(
9300
9667
  "span",
9301
9668
  {
9302
9669
  className: "truncate font-[var(--tsh-font-mono)] text-[var(--text-secondary)]",
@@ -9304,35 +9671,42 @@ function AgentCodeBlock({
9304
9671
  children: fileLabel
9305
9672
  }
9306
9673
  ),
9307
- /* @__PURE__ */ jsxs13("span", { className: "shrink-0 font-semibold text-[var(--state-success)]", children: [
9674
+ /* @__PURE__ */ jsxs14("span", { className: "shrink-0 font-semibold text-[var(--state-success)]", children: [
9308
9675
  "+",
9309
9676
  addedCount
9310
9677
  ] })
9311
9678
  ] }) : null,
9312
- /* @__PURE__ */ jsxs13("div", { className: "workspace-agents-status-panel__detail-scroll-region max-h-[240px] overflow-auto bg-[var(--background-panel)]", children: [
9313
- visibleLines.map((line) => /* @__PURE__ */ jsxs13(
9679
+ /* @__PURE__ */ jsxs14("div", { className: "workspace-agents-status-panel__detail-scroll-region max-h-[240px] overflow-auto bg-[var(--background-panel)]", children: [
9680
+ visibleLines.map((line) => /* @__PURE__ */ jsxs14(
9314
9681
  "div",
9315
9682
  {
9316
9683
  className: "grid grid-cols-[56px_minmax(0,1fr)] border-l-[3px] border-l-[var(--state-success)] font-[var(--tsh-font-mono)] text-[11px] leading-6",
9317
9684
  children: [
9318
- /* @__PURE__ */ jsx20("div", { className: "select-none px-2.5 text-right text-[color:color-mix(in_srgb,var(--state-success)_90%,transparent)]", children: line.lineNumber }),
9319
- /* @__PURE__ */ jsx20("pre", { className: "m-0 overflow-x-auto px-3 py-0 text-[var(--text-primary)]", children: /* @__PURE__ */ jsx20("code", { children: line.line || " " }) })
9685
+ /* @__PURE__ */ jsx21("div", { className: "select-none px-2.5 text-right text-[color:color-mix(in_srgb,var(--state-success)_90%,transparent)]", children: line.lineNumber }),
9686
+ /* @__PURE__ */ jsx21("pre", { className: "m-0 overflow-x-auto px-3 py-0 text-[var(--text-primary)]", children: /* @__PURE__ */ jsx21("code", { children: line.line || " " }) })
9320
9687
  ]
9321
9688
  },
9322
9689
  line.key
9323
9690
  )),
9324
9691
  disclosureButton
9325
9692
  ] })
9326
- ] }) : /* @__PURE__ */ jsxs13(Fragment3, { children: [
9327
- showHeader ? /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between gap-3 border-b border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-1.5 text-[11px] text-[var(--text-secondary)]", children: [
9328
- /* @__PURE__ */ jsx20("span", { className: "truncate font-[var(--tsh-font-mono)]", children: path || "Code" }),
9329
- /* @__PURE__ */ jsxs13("span", { className: "shrink-0", children: [
9693
+ ] }) : /* @__PURE__ */ jsxs14(Fragment3, { children: [
9694
+ showHeader ? /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-3 border-b border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-1.5 text-[11px] text-[var(--text-secondary)]", children: [
9695
+ /* @__PURE__ */ jsx21(
9696
+ AgentPathTailLabel,
9697
+ {
9698
+ path,
9699
+ fallback: "Code",
9700
+ className: "font-[var(--tsh-font-mono)]"
9701
+ }
9702
+ ),
9703
+ /* @__PURE__ */ jsxs14("span", { className: "shrink-0", children: [
9330
9704
  language ? `${language} \xB7 ` : "",
9331
9705
  lineCount,
9332
9706
  " lines"
9333
9707
  ] })
9334
9708
  ] }) : null,
9335
- /* @__PURE__ */ jsx20("pre", { className: "workspace-agents-status-panel__detail-scroll-region max-h-[200px] overflow-auto px-3 py-2 text-[11px] leading-5 text-[var(--text-primary)]", children: /* @__PURE__ */ jsx20("code", { children: visibleContent }) }),
9709
+ /* @__PURE__ */ jsx21("pre", { className: "workspace-agents-status-panel__detail-scroll-region max-h-[200px] overflow-auto px-3 py-2 text-[11px] leading-5 text-[var(--text-primary)]", children: /* @__PURE__ */ jsx21("code", { children: visibleContent }) }),
9336
9710
  disclosureButton
9337
9711
  ] })
9338
9712
  }
@@ -9366,7 +9740,7 @@ import {
9366
9740
  useAnimation as useAnimation5,
9367
9741
  useReducedMotion as useReducedMotion5
9368
9742
  } from "framer-motion";
9369
- import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
9743
+ import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
9370
9744
  var ATOM_ICON_ANIMATION_DURATION = 0.75;
9371
9745
  var ATOM_ICON_REPEAT_DELAY = 1.5;
9372
9746
  var PATH_VARIANTS = {
@@ -9458,14 +9832,14 @@ var AtomIcon = forwardRef7(
9458
9832
  },
9459
9833
  [onMouseLeave, stopAnimation]
9460
9834
  );
9461
- return /* @__PURE__ */ jsx21(
9835
+ return /* @__PURE__ */ jsx22(
9462
9836
  "div",
9463
9837
  {
9464
9838
  className: cn("inline-flex items-center justify-center", className),
9465
9839
  onMouseEnter: handleMouseEnter,
9466
9840
  onMouseLeave: handleMouseLeave,
9467
9841
  ...props,
9468
- children: /* @__PURE__ */ jsxs14(
9842
+ children: /* @__PURE__ */ jsxs15(
9469
9843
  "svg",
9470
9844
  {
9471
9845
  fill: "none",
@@ -9478,7 +9852,7 @@ var AtomIcon = forwardRef7(
9478
9852
  width: size,
9479
9853
  xmlns: "http://www.w3.org/2000/svg",
9480
9854
  children: [
9481
- /* @__PURE__ */ jsx21(
9855
+ /* @__PURE__ */ jsx22(
9482
9856
  motion5.circle,
9483
9857
  {
9484
9858
  animate: controls,
@@ -9489,7 +9863,7 @@ var AtomIcon = forwardRef7(
9489
9863
  variants: PATH_VARIANTS
9490
9864
  }
9491
9865
  ),
9492
- /* @__PURE__ */ jsx21(
9866
+ /* @__PURE__ */ jsx22(
9493
9867
  motion5.path,
9494
9868
  {
9495
9869
  animate: controls,
@@ -9498,7 +9872,7 @@ var AtomIcon = forwardRef7(
9498
9872
  variants: PATH_VARIANTS
9499
9873
  }
9500
9874
  ),
9501
- /* @__PURE__ */ jsx21(
9875
+ /* @__PURE__ */ jsx22(
9502
9876
  motion5.path,
9503
9877
  {
9504
9878
  animate: controls,
@@ -9517,7 +9891,7 @@ var AtomIcon = forwardRef7(
9517
9891
  AtomIcon.displayName = "AtomIcon";
9518
9892
 
9519
9893
  // shared/agentConversation/components/tool-renderers/file-diff/AgentMonacoDiffViewer.tsx
9520
- import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
9894
+ import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
9521
9895
  var MonacoDiffEditor = lazy(async () => {
9522
9896
  const module = await import("@monaco-editor/react");
9523
9897
  return { default: module.DiffEditor };
@@ -9530,24 +9904,31 @@ function AgentMonacoDiffViewer({
9530
9904
  showHeader = true
9531
9905
  }) {
9532
9906
  "use memo";
9533
- return /* @__PURE__ */ jsxs15(
9907
+ return /* @__PURE__ */ jsxs16(
9534
9908
  "div",
9535
9909
  {
9536
9910
  className: `overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--background-panel)] ${flat ? "workspace-agents-status-panel__detail-tool-monaco--flat" : ""}`,
9537
9911
  children: [
9538
- showHeader ? /* @__PURE__ */ jsx22(
9912
+ showHeader ? /* @__PURE__ */ jsx23(
9539
9913
  "div",
9540
9914
  {
9541
9915
  className: "border-b border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-1.5 text-[11px] text-[var(--text-secondary)]",
9542
9916
  "data-agent-diff-header": "true",
9543
- children: path || "Diff"
9917
+ children: /* @__PURE__ */ jsx23(
9918
+ AgentPathTailLabel,
9919
+ {
9920
+ path,
9921
+ fallback: "Diff",
9922
+ className: "font-[var(--tsh-font-mono)]"
9923
+ }
9924
+ )
9544
9925
  }
9545
9926
  ) : null,
9546
- /* @__PURE__ */ jsx22("div", { className: "h-[220px] bg-[var(--background-panel)]", children: /* @__PURE__ */ jsx22(
9927
+ /* @__PURE__ */ jsx23("div", { className: "h-[220px] bg-[var(--background-panel)]", children: /* @__PURE__ */ jsx23(
9547
9928
  Suspense,
9548
9929
  {
9549
- fallback: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1.5 px-3 py-2.5 text-[11px] text-[var(--text-secondary)]", children: [
9550
- /* @__PURE__ */ jsx22(
9930
+ fallback: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5 px-3 py-2.5 text-[11px] text-[var(--text-secondary)]", children: [
9931
+ /* @__PURE__ */ jsx23(
9551
9932
  AtomIcon,
9552
9933
  {
9553
9934
  size: 14,
@@ -9556,9 +9937,9 @@ function AgentMonacoDiffViewer({
9556
9937
  className: "shrink-0"
9557
9938
  }
9558
9939
  ),
9559
- /* @__PURE__ */ jsx22("span", { children: translate("agentHost.agentTool.details.loadingDiff") })
9940
+ /* @__PURE__ */ jsx23("span", { children: translate("agentHost.agentTool.details.loadingDiff") })
9560
9941
  ] }),
9561
- children: /* @__PURE__ */ jsx22(
9942
+ children: /* @__PURE__ */ jsx23(
9562
9943
  MonacoDiffEditor,
9563
9944
  {
9564
9945
  original: oldValue,
@@ -9604,7 +9985,7 @@ function languageForPath2(path) {
9604
9985
  import { useMemo as useMemo3, useState as useState7 } from "react";
9605
9986
 
9606
9987
  // shared/agentConversation/components/tool-renderers/AgentToolScrollArea.tsx
9607
- import { jsx as jsx23 } from "react/jsx-runtime";
9988
+ import { jsx as jsx24 } from "react/jsx-runtime";
9608
9989
  function AgentToolScrollArea({
9609
9990
  children,
9610
9991
  className,
@@ -9613,7 +9994,7 @@ function AgentToolScrollArea({
9613
9994
  ...props
9614
9995
  }) {
9615
9996
  "use memo";
9616
- return /* @__PURE__ */ jsx23(
9997
+ return /* @__PURE__ */ jsx24(
9617
9998
  CustomScrollArea,
9618
9999
  {
9619
10000
  className: cn(
@@ -9717,7 +10098,7 @@ function parseAgentUnifiedDiffStats(diffText) {
9717
10098
  }
9718
10099
 
9719
10100
  // shared/agentConversation/components/tool-renderers/file-diff/AgentUnifiedPatchViewer.tsx
9720
- import { Fragment as Fragment4, jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
10101
+ import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
9721
10102
  var MAX_VISIBLE_LINES2 = 120;
9722
10103
  function AgentUnifiedPatchViewer({
9723
10104
  path,
@@ -9763,7 +10144,7 @@ function AgentUnifiedPatchViewer({
9763
10144
  if (!normalized) {
9764
10145
  return null;
9765
10146
  }
9766
- const disclosureButton = collapsible && lines.length > MAX_VISIBLE_LINES2 ? /* @__PURE__ */ jsx24(
10147
+ const disclosureButton = collapsible && lines.length > MAX_VISIBLE_LINES2 ? /* @__PURE__ */ jsx25(
9767
10148
  "button",
9768
10149
  {
9769
10150
  type: "button",
@@ -9774,18 +10155,18 @@ function AgentUnifiedPatchViewer({
9774
10155
  })
9775
10156
  }
9776
10157
  ) : null;
9777
- return /* @__PURE__ */ jsx24(
10158
+ return /* @__PURE__ */ jsx25(
9778
10159
  "div",
9779
10160
  {
9780
10161
  className: `workspace-agents-status-panel__detail-tool-diff overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--background-panel)] ${flat ? "workspace-agents-status-panel__detail-tool-diff--flat" : ""}`,
9781
- children: flat ? /* @__PURE__ */ jsxs16(Fragment4, { children: [
9782
- showHeader ? /* @__PURE__ */ jsxs16(
10162
+ children: flat ? /* @__PURE__ */ jsxs17(Fragment4, { children: [
10163
+ showHeader ? /* @__PURE__ */ jsxs17(
9783
10164
  "div",
9784
10165
  {
9785
10166
  className: "flex items-center justify-between gap-3 border-b border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-1.5 text-[11px]",
9786
10167
  "data-agent-diff-header": "true",
9787
10168
  children: [
9788
- /* @__PURE__ */ jsx24(
10169
+ /* @__PURE__ */ jsx25(
9789
10170
  "span",
9790
10171
  {
9791
10172
  className: "truncate font-[var(--tsh-font-mono)] text-[var(--text-secondary)]",
@@ -9793,12 +10174,12 @@ function AgentUnifiedPatchViewer({
9793
10174
  children: fileLabel
9794
10175
  }
9795
10176
  ),
9796
- /* @__PURE__ */ jsxs16("span", { className: "inline-flex items-center gap-2 text-[11px] font-semibold", children: [
9797
- /* @__PURE__ */ jsxs16("span", { className: "text-[var(--state-success)]", children: [
10177
+ /* @__PURE__ */ jsxs17("span", { className: "inline-flex items-center gap-2 text-[11px] font-semibold", children: [
10178
+ /* @__PURE__ */ jsxs17("span", { className: "text-[var(--state-success)]", children: [
9798
10179
  "+",
9799
10180
  stats.added
9800
10181
  ] }),
9801
- /* @__PURE__ */ jsxs16("span", { className: "text-[var(--state-danger)]", children: [
10182
+ /* @__PURE__ */ jsxs17("span", { className: "text-[var(--state-danger)]", children: [
9802
10183
  "-",
9803
10184
  stats.removed
9804
10185
  ] })
@@ -9806,23 +10187,30 @@ function AgentUnifiedPatchViewer({
9806
10187
  ]
9807
10188
  }
9808
10189
  ) : null,
9809
- /* @__PURE__ */ jsxs16(AgentToolScrollArea, { viewportClassName: "agent-tool-diff__viewport", children: [
9810
- visibleDiffLines.map(({ key, line }) => /* @__PURE__ */ jsxs16("div", { className: flatLineClassName(line.kind), children: [
9811
- /* @__PURE__ */ jsx24("div", { className: "select-none px-2.5 text-right text-[var(--text-tertiary)]", children: line.newLineNumber ?? line.oldLineNumber ?? "" }),
9812
- /* @__PURE__ */ jsx24("pre", { className: "m-0 overflow-x-auto px-3 py-0 text-[var(--text-primary)]", children: /* @__PURE__ */ jsx24("code", { children: line.text || " " }) })
10190
+ /* @__PURE__ */ jsxs17(AgentToolScrollArea, { viewportClassName: "agent-tool-diff__viewport", children: [
10191
+ visibleDiffLines.map(({ key, line }) => /* @__PURE__ */ jsxs17("div", { className: flatLineClassName(line.kind), children: [
10192
+ /* @__PURE__ */ jsx25("div", { className: "select-none px-2.5 text-right text-[var(--text-tertiary)]", children: line.newLineNumber ?? line.oldLineNumber ?? "" }),
10193
+ /* @__PURE__ */ jsx25("pre", { className: "m-0 overflow-x-auto px-3 py-0 text-[var(--text-primary)]", children: /* @__PURE__ */ jsx25("code", { children: line.text || " " }) })
9813
10194
  ] }, key)),
9814
10195
  disclosureButton
9815
10196
  ] })
9816
- ] }) : /* @__PURE__ */ jsxs16(Fragment4, { children: [
9817
- showHeader ? /* @__PURE__ */ jsx24(
10197
+ ] }) : /* @__PURE__ */ jsxs17(Fragment4, { children: [
10198
+ showHeader ? /* @__PURE__ */ jsx25(
9818
10199
  "div",
9819
10200
  {
9820
10201
  className: "border-b border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-1.5 text-[11px] text-[var(--text-secondary)]",
9821
10202
  "data-agent-diff-header": "true",
9822
- children: path || "Patch"
10203
+ children: /* @__PURE__ */ jsx25(
10204
+ AgentPathTailLabel,
10205
+ {
10206
+ path,
10207
+ fallback: "Patch",
10208
+ className: "font-[var(--tsh-font-mono)]"
10209
+ }
10210
+ )
9823
10211
  }
9824
10212
  ) : null,
9825
- /* @__PURE__ */ jsx24(AgentToolScrollArea, { viewportClassName: "agent-tool-diff__viewport px-4 py-3 text-[11px] leading-5", children: visibleLines.map(({ key, line }) => /* @__PURE__ */ jsx24("div", { className: lineClassName(line), children: line || " " }, key)) }),
10213
+ /* @__PURE__ */ jsx25(AgentToolScrollArea, { viewportClassName: "agent-tool-diff__viewport px-4 py-3 text-[11px] leading-5", children: visibleLines.map(({ key, line }) => /* @__PURE__ */ jsx25("div", { className: lineClassName(line), children: line || " " }, key)) }),
9826
10214
  disclosureButton
9827
10215
  ] })
9828
10216
  }
@@ -9884,7 +10272,7 @@ import {
9884
10272
  import { ChevronDown as ChevronDown5, ChevronRight as ChevronRight5 } from "lucide-react";
9885
10273
 
9886
10274
  // shared/agentConversation/components/tool-renderers/AgentReadContent.tsx
9887
- import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
10275
+ import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
9888
10276
  function AgentReadContent({
9889
10277
  call
9890
10278
  }) {
@@ -9894,16 +10282,23 @@ function AgentReadContent({
9894
10282
  const outputText = stringValue9(call.output?.text) ?? stringValue9(call.output?.output) ?? contentText2(call.output?.content) ?? stringValue9(call.output?.aggregated_output) ?? stringValue9(call.output?.formatted_output) ?? stringValue9(call.output?.stdout) ?? (!file ? call.summary.trim() || null : null);
9895
10283
  const fileLineRange = fileRange(file);
9896
10284
  const fileTotalLines = numericValue(file?.totalLines);
9897
- return /* @__PURE__ */ jsx25("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--plain", children: outputText ? /* @__PURE__ */ jsx25(
10285
+ return /* @__PURE__ */ jsx26("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--plain", children: outputText ? /* @__PURE__ */ jsx26(
9898
10286
  AgentCodeBlock,
9899
10287
  {
9900
10288
  path,
9901
10289
  content: outputText,
9902
10290
  language: languageForPath3(path)
9903
10291
  }
9904
- ) : path || fileLineRange || fileTotalLines !== null ? /* @__PURE__ */ jsxs17("div", { className: "rounded-[8px] border border-[var(--line-2)] bg-[var(--background-panel)] px-3 py-2", children: [
9905
- path ? /* @__PURE__ */ jsx25("div", { className: "font-[var(--tsh-font-mono)] text-[11px] text-[var(--text-secondary)]", children: path }) : null,
9906
- fileLineRange || fileTotalLines !== null ? /* @__PURE__ */ jsx25("div", { className: "mt-1 text-[11px] text-[var(--text-secondary)]", children: [
10292
+ ) : path || fileLineRange || fileTotalLines !== null ? /* @__PURE__ */ jsxs18("div", { className: "rounded-[8px] border border-[var(--line-2)] bg-[var(--background-panel)] px-3 py-2", children: [
10293
+ path ? /* @__PURE__ */ jsx26(
10294
+ AgentPathTailLabel,
10295
+ {
10296
+ path,
10297
+ fallback: "File",
10298
+ className: "font-[var(--tsh-font-mono)] text-[11px] text-[var(--text-secondary)]"
10299
+ }
10300
+ ) : null,
10301
+ fileLineRange || fileTotalLines !== null ? /* @__PURE__ */ jsx26("div", { className: "mt-1 text-[11px] text-[var(--text-secondary)]", children: [
9907
10302
  fileLineRange,
9908
10303
  fileTotalLines !== null ? `${fileTotalLines} lines` : null
9909
10304
  ].filter((value) => Boolean(value)).join(" \xB7 ") }) : null
@@ -9967,14 +10362,14 @@ function languageForPath3(path) {
9967
10362
  }
9968
10363
 
9969
10364
  // shared/agentConversation/components/tool-renderers/agentToolContentShared.tsx
9970
- import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
10365
+ import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
9971
10366
  var AgentToolPreviewModeContext = createContext(false);
9972
10367
  function AgentToolPreviewModeProvider({
9973
10368
  children,
9974
10369
  previewMode
9975
10370
  }) {
9976
10371
  "use memo";
9977
- return /* @__PURE__ */ jsx26(AgentToolPreviewModeContext.Provider, { value: previewMode, children });
10372
+ return /* @__PURE__ */ jsx27(AgentToolPreviewModeContext.Provider, { value: previewMode, children });
9978
10373
  }
9979
10374
  function ToolSection({
9980
10375
  title,
@@ -9984,8 +10379,8 @@ function ToolSection({
9984
10379
  if (!children) {
9985
10380
  return null;
9986
10381
  }
9987
- return /* @__PURE__ */ jsxs18("section", { className: "workspace-agents-status-panel__detail-tool-section-block", children: [
9988
- /* @__PURE__ */ jsx26("div", { className: "workspace-agents-status-panel__detail-tool-section-title", children: title }),
10382
+ return /* @__PURE__ */ jsxs19("section", { className: "workspace-agents-status-panel__detail-tool-section-block", children: [
10383
+ /* @__PURE__ */ jsx27("div", { className: "workspace-agents-status-panel__detail-tool-section-title", children: title }),
9989
10384
  children
9990
10385
  ] });
9991
10386
  }
@@ -10002,7 +10397,7 @@ function ToolMarkdownBlock({
10002
10397
  if (!normalized) {
10003
10398
  return null;
10004
10399
  }
10005
- return /* @__PURE__ */ jsx26(
10400
+ return /* @__PURE__ */ jsx27(
10006
10401
  AgentMessageMarkdown,
10007
10402
  {
10008
10403
  content: normalized,
@@ -10065,8 +10460,8 @@ function AgentDefaultToolContent({
10065
10460
  if (sections.length === 0 && !rawPayload) {
10066
10461
  return null;
10067
10462
  }
10068
- return /* @__PURE__ */ jsxs18("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
10069
- sections.map((section) => /* @__PURE__ */ jsx26(ToolSection, { title: section.title, children: /* @__PURE__ */ jsx26(
10463
+ return /* @__PURE__ */ jsxs19("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
10464
+ sections.map((section) => /* @__PURE__ */ jsx27(ToolSection, { title: section.title, children: /* @__PURE__ */ jsx27(
10070
10465
  ToolMarkdownBlock,
10071
10466
  {
10072
10467
  content: section.content,
@@ -10074,7 +10469,7 @@ function AgentDefaultToolContent({
10074
10469
  collapsible: section.collapsible
10075
10470
  }
10076
10471
  ) }, section.key)),
10077
- /* @__PURE__ */ jsx26(RawPayloadSection, { payload: rawPayload })
10472
+ /* @__PURE__ */ jsx27(RawPayloadSection, { payload: rawPayload })
10078
10473
  ] });
10079
10474
  }
10080
10475
  function hasAgentToolContent(call) {
@@ -10201,8 +10596,8 @@ function RawPayloadSection({
10201
10596
  if (!rawJson) {
10202
10597
  return null;
10203
10598
  }
10204
- return /* @__PURE__ */ jsxs18("div", { className: "workspace-agents-status-panel__detail-tool-raw", children: [
10205
- /* @__PURE__ */ jsxs18(
10599
+ return /* @__PURE__ */ jsxs19("div", { className: "workspace-agents-status-panel__detail-tool-raw", children: [
10600
+ /* @__PURE__ */ jsxs19(
10206
10601
  "button",
10207
10602
  {
10208
10603
  type: "button",
@@ -10210,8 +10605,8 @@ function RawPayloadSection({
10210
10605
  "aria-expanded": expanded,
10211
10606
  onClick: () => setExpanded((value) => !value),
10212
10607
  children: [
10213
- /* @__PURE__ */ jsx26("span", { children: translate("agentHost.agentTool.details.rawPayload") }),
10214
- expanded ? /* @__PURE__ */ jsx26(
10608
+ /* @__PURE__ */ jsx27("span", { children: translate("agentHost.agentTool.details.rawPayload") }),
10609
+ expanded ? /* @__PURE__ */ jsx27(
10215
10610
  ChevronDown5,
10216
10611
  {
10217
10612
  size: 12,
@@ -10219,7 +10614,7 @@ function RawPayloadSection({
10219
10614
  "aria-hidden": "true",
10220
10615
  className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover/raw-payload:opacity-100 group-focus-visible/raw-payload:opacity-100"
10221
10616
  }
10222
- ) : /* @__PURE__ */ jsx26(
10617
+ ) : /* @__PURE__ */ jsx27(
10223
10618
  ChevronRight5,
10224
10619
  {
10225
10620
  size: 12,
@@ -10231,7 +10626,7 @@ function RawPayloadSection({
10231
10626
  ]
10232
10627
  }
10233
10628
  ),
10234
- /* @__PURE__ */ jsx26(CollapsibleReveal, { expanded, preMountOnIdle: true, children: /* @__PURE__ */ jsx26("pre", { className: "workspace-agents-status-panel__detail-scroll-region mt-2 max-h-[320px] overflow-auto rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-2 text-[11px] leading-[1.45] text-[var(--text-secondary)]", children: /* @__PURE__ */ jsx26("code", { children: rawJson }) }) })
10629
+ /* @__PURE__ */ jsx27(CollapsibleReveal, { expanded, preMountOnIdle: true, children: /* @__PURE__ */ jsx27("pre", { className: "workspace-agents-status-panel__detail-scroll-region mt-2 max-h-[320px] overflow-auto rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-2 text-[11px] leading-[1.45] text-[var(--text-secondary)]", children: /* @__PURE__ */ jsx27("code", { children: rawJson }) }) })
10235
10630
  ] });
10236
10631
  }
10237
10632
  function rawPayloadFromCall(call) {
@@ -10279,7 +10674,7 @@ function normalizeToolSectionContent(value) {
10279
10674
  }
10280
10675
 
10281
10676
  // shared/agentConversation/components/tool-renderers/AgentEditContent.tsx
10282
- import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
10677
+ import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
10283
10678
  function AgentEditContent({
10284
10679
  call,
10285
10680
  onLinkClick
@@ -10299,9 +10694,9 @@ function AgentEditContent({
10299
10694
  if (!hasRenderableContent) {
10300
10695
  return null;
10301
10696
  }
10302
- return /* @__PURE__ */ jsxs19("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--flat", children: [
10303
- path && files.length === 0 ? /* @__PURE__ */ jsx27(ToolMarkdownBlock, { content: path, onLinkClick }) : null,
10304
- patchFiles.map((candidate) => /* @__PURE__ */ jsx27(
10697
+ return /* @__PURE__ */ jsxs20("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--flat", children: [
10698
+ path && files.length === 0 ? /* @__PURE__ */ jsx28(ToolMarkdownBlock, { content: path, onLinkClick }) : null,
10699
+ patchFiles.map((candidate) => /* @__PURE__ */ jsx28(
10305
10700
  AgentUnifiedPatchViewer,
10306
10701
  {
10307
10702
  path: candidate.path,
@@ -10311,7 +10706,7 @@ function AgentEditContent({
10311
10706
  },
10312
10707
  `patch:${candidate.path}`
10313
10708
  )),
10314
- diffFiles.map((candidate) => /* @__PURE__ */ jsx27(
10709
+ diffFiles.map((candidate) => /* @__PURE__ */ jsx28(
10315
10710
  AgentMonacoDiffViewer,
10316
10711
  {
10317
10712
  path: candidate.path,
@@ -10321,7 +10716,7 @@ function AgentEditContent({
10321
10716
  },
10322
10717
  `diff:${candidate.path}`
10323
10718
  )),
10324
- contentFiles.map((candidate) => /* @__PURE__ */ jsx27(
10719
+ contentFiles.map((candidate) => /* @__PURE__ */ jsx28(
10325
10720
  AgentCodeBlock,
10326
10721
  {
10327
10722
  path: candidate.path,
@@ -10336,7 +10731,7 @@ function AgentEditContent({
10336
10731
  }
10337
10732
 
10338
10733
  // shared/agentConversation/components/tool-renderers/AgentApprovalContent.tsx
10339
- import { jsx as jsx28 } from "react/jsx-runtime";
10734
+ import { jsx as jsx29 } from "react/jsx-runtime";
10340
10735
  function AgentApprovalContent({
10341
10736
  call,
10342
10737
  onLinkClick
@@ -10347,9 +10742,9 @@ function AgentApprovalContent({
10347
10742
  return null;
10348
10743
  }
10349
10744
  if (previewCall) {
10350
- return /* @__PURE__ */ jsx28(AgentEditContent, { call: previewCall, onLinkClick });
10745
+ return /* @__PURE__ */ jsx29(AgentEditContent, { call: previewCall, onLinkClick });
10351
10746
  }
10352
- return /* @__PURE__ */ jsx28("div", { className: "workspace-agents-status-panel__detail-tool-body", children: /* @__PURE__ */ jsx28(ToolMarkdownBlock, { content: call.summary }) });
10747
+ return /* @__PURE__ */ jsx29("div", { className: "workspace-agents-status-panel__detail-tool-body", children: /* @__PURE__ */ jsx29(ToolMarkdownBlock, { content: call.summary }) });
10353
10748
  }
10354
10749
  function approvalPreviewCall(call) {
10355
10750
  const toolCall = objectValue6(call.input?.toolCall);
@@ -10401,7 +10796,7 @@ function normalizeToolKind(value) {
10401
10796
  }
10402
10797
 
10403
10798
  // shared/agentConversation/components/tool-renderers/AgentAskUserQuestionContent.tsx
10404
- import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
10799
+ import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
10405
10800
  function AgentAskUserQuestionContent({
10406
10801
  call
10407
10802
  }) {
@@ -10410,31 +10805,31 @@ function AgentAskUserQuestionContent({
10410
10805
  if (questions.length === 0) {
10411
10806
  return null;
10412
10807
  }
10413
- return /* @__PURE__ */ jsx29("div", { className: "workspace-agents-status-panel__detail-tool-body", children: /* @__PURE__ */ jsx29(ToolSection, { title: translate("agentHost.agentTool.details.questions"), children: /* @__PURE__ */ jsx29("div", { className: "workspace-agents-status-panel__detail-tool-stack", children: questions.map((question) => {
10808
+ return /* @__PURE__ */ jsx30("div", { className: "workspace-agents-status-panel__detail-tool-body", children: /* @__PURE__ */ jsx30(ToolSection, { title: translate("agentHost.agentTool.details.questions"), children: /* @__PURE__ */ jsx30("div", { className: "workspace-agents-status-panel__detail-tool-stack", children: questions.map((question) => {
10414
10809
  const body = question.question || question.header || translate("agentHost.agentTool.details.questionFallback");
10415
10810
  const answer = formatAnswer(question.answer);
10416
10811
  const questionKey = question.id.trim() || `${question.header}:${question.question}:${question.options.map((option) => option.label).join("|")}`;
10417
- return /* @__PURE__ */ jsxs20(
10812
+ return /* @__PURE__ */ jsxs21(
10418
10813
  "div",
10419
10814
  {
10420
10815
  className: "workspace-agents-status-panel__detail-tool-stack-item",
10421
10816
  children: [
10422
- /* @__PURE__ */ jsx29("div", { className: "workspace-agents-status-panel__detail-tool-question", children: body }),
10423
- question.options.length > 0 ? /* @__PURE__ */ jsx29("div", { className: "workspace-agents-status-panel__detail-tool-stack", children: question.options.map((option) => /* @__PURE__ */ jsxs20(
10817
+ /* @__PURE__ */ jsx30("div", { className: "workspace-agents-status-panel__detail-tool-question", children: body }),
10818
+ question.options.length > 0 ? /* @__PURE__ */ jsx30("div", { className: "workspace-agents-status-panel__detail-tool-stack", children: question.options.map((option) => /* @__PURE__ */ jsxs21(
10424
10819
  "div",
10425
10820
  {
10426
10821
  className: "workspace-agents-status-panel__detail-tool-stack-item",
10427
10822
  children: [
10428
- /* @__PURE__ */ jsx29("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: option.label }),
10429
- option.description ? /* @__PURE__ */ jsx29("div", { className: "workspace-agents-status-panel__detail-tool-answer workspace-agents-status-panel__detail-tool-answer--muted", children: option.description }) : null
10823
+ /* @__PURE__ */ jsx30("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: option.label }),
10824
+ option.description ? /* @__PURE__ */ jsx30("div", { className: "workspace-agents-status-panel__detail-tool-answer workspace-agents-status-panel__detail-tool-answer--muted", children: option.description }) : null
10430
10825
  ]
10431
10826
  },
10432
10827
  `${questionKey}-option-${option.label}:${option.description}`
10433
10828
  )) }) : null,
10434
- answer ? /* @__PURE__ */ jsx29("div", { className: "workspace-agents-status-panel__detail-tool-answer", children: translate("agentHost.agentTool.details.answerPrefix", {
10829
+ answer ? /* @__PURE__ */ jsx30("div", { className: "workspace-agents-status-panel__detail-tool-answer", children: translate("agentHost.agentTool.details.answerPrefix", {
10435
10830
  answer
10436
- }) }) : /* @__PURE__ */ jsxs20("div", { className: "workspace-agents-status-panel__detail-tool-answer workspace-agents-status-panel__detail-tool-answer--muted inline-flex items-center gap-1.5", children: [
10437
- /* @__PURE__ */ jsx29(
10831
+ }) }) : /* @__PURE__ */ jsxs21("div", { className: "workspace-agents-status-panel__detail-tool-answer workspace-agents-status-panel__detail-tool-answer--muted inline-flex items-center gap-1.5", children: [
10832
+ /* @__PURE__ */ jsx30(
10438
10833
  MessageSquareMoreIcon,
10439
10834
  {
10440
10835
  size: 14,
@@ -10460,7 +10855,7 @@ function formatAnswer(answer) {
10460
10855
 
10461
10856
  // shared/agentConversation/components/tool-renderers/terminal/AgentTerminalBlock.tsx
10462
10857
  import { useMemo as useMemo4, useState as useState9 } from "react";
10463
- import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
10858
+ import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
10464
10859
  var MAX_OUTPUT_LINES = 200;
10465
10860
  function AgentTerminalBlock({
10466
10861
  command,
@@ -10482,7 +10877,7 @@ function AgentTerminalBlock({
10482
10877
  const visibleOutput = truncated ? outputLines.slice(0, MAX_OUTPUT_LINES).join("\n") : outputText;
10483
10878
  const failed = status === "failed";
10484
10879
  const hasOutput = Boolean(visibleOutput);
10485
- const disclosureButton = outputLines.length > MAX_OUTPUT_LINES ? /* @__PURE__ */ jsx30(
10880
+ const disclosureButton = outputLines.length > MAX_OUTPUT_LINES ? /* @__PURE__ */ jsx31(
10486
10881
  "button",
10487
10882
  {
10488
10883
  type: "button",
@@ -10491,15 +10886,15 @@ function AgentTerminalBlock({
10491
10886
  children: expanded ? "Collapse output" : `Show full output (${outputLines.length} lines)`
10492
10887
  }
10493
10888
  ) : null;
10494
- return /* @__PURE__ */ jsxs21("div", { className: "workspace-agents-status-panel__detail-tool-terminal overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--background-panel)]", children: [
10495
- command ? /* @__PURE__ */ jsxs21(
10889
+ return /* @__PURE__ */ jsxs22("div", { className: "workspace-agents-status-panel__detail-tool-terminal overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--background-panel)]", children: [
10890
+ command ? /* @__PURE__ */ jsxs22(
10496
10891
  "div",
10497
10892
  {
10498
10893
  className: `flex min-w-0 items-center gap-3 px-3 text-[11px] text-[var(--text-secondary)] ${hasOutput ? "border-b border-[var(--line-2)] bg-[var(--transparency-block)] py-1.5" : "bg-[var(--transparency-block)] py-2"}`,
10499
10894
  "data-agent-terminal-command-row": "true",
10500
10895
  children: [
10501
- /* @__PURE__ */ jsx30("span", { className: "shrink-0 font-semibold text-[var(--tutti-purple)]", children: "$" }),
10502
- /* @__PURE__ */ jsx30(
10896
+ /* @__PURE__ */ jsx31("span", { className: "shrink-0 font-semibold text-[var(--tutti-purple)]", children: "$" }),
10897
+ /* @__PURE__ */ jsx31(
10503
10898
  "span",
10504
10899
  {
10505
10900
  className: "min-w-0 flex-1 whitespace-pre-wrap [overflow-wrap:anywhere]",
@@ -10510,13 +10905,13 @@ function AgentTerminalBlock({
10510
10905
  ]
10511
10906
  }
10512
10907
  ) : null,
10513
- hasOutput ? /* @__PURE__ */ jsxs21(
10908
+ hasOutput ? /* @__PURE__ */ jsxs22(
10514
10909
  AgentToolScrollArea,
10515
10910
  {
10516
10911
  maxHeightClassName: "max-h-[160px]",
10517
10912
  viewportClassName: `px-3 py-2 text-[11px] leading-5 ${failed ? "text-[var(--state-danger)]" : "text-[var(--text-primary)]"}`,
10518
10913
  children: [
10519
- /* @__PURE__ */ jsx30("pre", { className: "m-0 min-w-0 max-w-full whitespace-pre-wrap [overflow-wrap:anywhere]", children: /* @__PURE__ */ jsx30("code", { children: visibleOutput }) }),
10914
+ /* @__PURE__ */ jsx31("pre", { className: "m-0 min-w-0 max-w-full whitespace-pre-wrap [overflow-wrap:anywhere]", children: /* @__PURE__ */ jsx31("code", { children: visibleOutput }) }),
10520
10915
  disclosureButton
10521
10916
  ]
10522
10917
  }
@@ -10525,14 +10920,14 @@ function AgentTerminalBlock({
10525
10920
  }
10526
10921
 
10527
10922
  // shared/agentConversation/components/tool-renderers/AgentBashContent.tsx
10528
- import { jsx as jsx31 } from "react/jsx-runtime";
10923
+ import { jsx as jsx32 } from "react/jsx-runtime";
10529
10924
  function AgentBashContent({
10530
10925
  call
10531
10926
  }) {
10532
10927
  "use memo";
10533
10928
  const commandData = getCommandRenderData(call);
10534
10929
  const fallbackErrorText = commandData.status === "failed" && !commandData.stdout && !commandData.stderr ? stringValue9(call.error?.message) : null;
10535
- return /* @__PURE__ */ jsx31("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--plain", children: /* @__PURE__ */ jsx31(
10930
+ return /* @__PURE__ */ jsx32("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--plain", children: /* @__PURE__ */ jsx32(
10536
10931
  AgentTerminalBlock,
10537
10932
  {
10538
10933
  command: commandData.command,
@@ -10548,7 +10943,7 @@ function AgentBashContent({
10548
10943
  // shared/agentConversation/components/tool-renderers/AgentImageGenerationContent.tsx
10549
10944
  import { useEffect as useEffect9, useState as useState10 } from "react";
10550
10945
  import { resolveWorkspaceImageMimeType } from "@tutti-os/workspace-file-manager/services";
10551
- import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
10946
+ import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
10552
10947
  function AgentImageGenerationContent({
10553
10948
  call,
10554
10949
  onLinkClick
@@ -10558,8 +10953,8 @@ function AgentImageGenerationContent({
10558
10953
  if (!image.prompt && !image.imageUri) {
10559
10954
  return null;
10560
10955
  }
10561
- return /* @__PURE__ */ jsxs22("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
10562
- image.prompt ? /* @__PURE__ */ jsx32(ToolSection, { title: translate("agentHost.agentTool.details.input"), children: /* @__PURE__ */ jsx32(
10956
+ return /* @__PURE__ */ jsxs23("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
10957
+ image.prompt ? /* @__PURE__ */ jsx33(ToolSection, { title: translate("agentHost.agentTool.details.input"), children: /* @__PURE__ */ jsx33(
10563
10958
  ToolMarkdownBlock,
10564
10959
  {
10565
10960
  content: image.prompt,
@@ -10567,7 +10962,7 @@ function AgentImageGenerationContent({
10567
10962
  collapsible: true
10568
10963
  }
10569
10964
  ) }) : null,
10570
- image.imageUri ? /* @__PURE__ */ jsx32(
10965
+ image.imageUri ? /* @__PURE__ */ jsx33(
10571
10966
  ImageGenerationPreview,
10572
10967
  {
10573
10968
  uri: image.imageUri,
@@ -10632,7 +11027,7 @@ function ImageGenerationPreview({
10632
11027
  if (!src) {
10633
11028
  return null;
10634
11029
  }
10635
- return /* @__PURE__ */ jsx32(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx32(
11030
+ return /* @__PURE__ */ jsx33(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx33(
10636
11031
  ZoomableImage,
10637
11032
  {
10638
11033
  alt: translate("agentHost.agentTool.details.imagePreviewAlt"),
@@ -10785,43 +11180,43 @@ function firstString5(...values) {
10785
11180
  }
10786
11181
 
10787
11182
  // shared/agentConversation/components/tool-renderers/mcp-renderers/agentAtlassianRenderers.tsx
10788
- import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
11183
+ import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
10789
11184
  function renderAtlassianMcp(payload) {
10790
11185
  const items = parsedItems(payload.structured);
10791
11186
  if (items.length > 0) {
10792
- return /* @__PURE__ */ jsx33("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: items.map((item, index) => /* @__PURE__ */ jsxs23(
11187
+ return /* @__PURE__ */ jsx34("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: items.map((item, index) => /* @__PURE__ */ jsxs24(
10793
11188
  "div",
10794
11189
  {
10795
11190
  className: `px-3 py-2 ${index > 0 ? "border-t border-[var(--line-2)]" : ""}`,
10796
11191
  children: [
10797
- /* @__PURE__ */ jsx33("div", { className: "text-[11px] font-semibold text-[var(--text-primary)]", children: itemPrimaryText(item) ?? `Item ${index + 1}` }),
10798
- itemSecondaryText(item) ? /* @__PURE__ */ jsx33("div", { className: "text-[11px] text-[var(--text-tertiary)]", children: itemSecondaryText(item) }) : null
11192
+ /* @__PURE__ */ jsx34("div", { className: "text-[11px] font-semibold text-[var(--text-primary)]", children: itemPrimaryText(item) ?? `Item ${index + 1}` }),
11193
+ itemSecondaryText(item) ? /* @__PURE__ */ jsx34("div", { className: "text-[11px] text-[var(--text-tertiary)]", children: itemSecondaryText(item) }) : null
10799
11194
  ]
10800
11195
  },
10801
11196
  `${itemPrimaryText(item) ?? "item"}::${itemSecondaryText(item) ?? ""}`
10802
11197
  )) });
10803
11198
  }
10804
- return payload.text ? /* @__PURE__ */ jsx33(ToolMarkdownBlock, { content: payload.text, collapsible: true }) : null;
11199
+ return payload.text ? /* @__PURE__ */ jsx34(ToolMarkdownBlock, { content: payload.text, collapsible: true }) : null;
10805
11200
  }
10806
11201
 
10807
11202
  // shared/agentConversation/components/tool-renderers/mcp-renderers/agentContext7Renderers.tsx
10808
- import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
11203
+ import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
10809
11204
  function renderContext7Mcp(payload) {
10810
11205
  const items = parsedItems(payload.structured);
10811
11206
  if (items.length > 0) {
10812
- return /* @__PURE__ */ jsx34("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: items.map((item, index) => /* @__PURE__ */ jsxs24(
11207
+ return /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: items.map((item, index) => /* @__PURE__ */ jsxs25(
10813
11208
  "div",
10814
11209
  {
10815
11210
  className: `px-3 py-2 ${index > 0 ? "border-t border-[var(--line-2)]" : ""}`,
10816
11211
  children: [
10817
- /* @__PURE__ */ jsx34("div", { className: "text-[11px] font-semibold text-[var(--text-primary)]", children: itemPrimaryText(item) ?? `Doc ${index + 1}` }),
10818
- itemSecondaryText(item) ? /* @__PURE__ */ jsx34("div", { className: "text-[11px] text-[var(--text-tertiary)]", children: itemSecondaryText(item) }) : null
11212
+ /* @__PURE__ */ jsx35("div", { className: "text-[11px] font-semibold text-[var(--text-primary)]", children: itemPrimaryText(item) ?? `Doc ${index + 1}` }),
11213
+ itemSecondaryText(item) ? /* @__PURE__ */ jsx35("div", { className: "text-[11px] text-[var(--text-tertiary)]", children: itemSecondaryText(item) }) : null
10819
11214
  ]
10820
11215
  },
10821
11216
  `${itemPrimaryText(item) ?? "doc"}::${itemSecondaryText(item) ?? ""}`
10822
11217
  )) });
10823
11218
  }
10824
- return payload.text ? /* @__PURE__ */ jsx34(ToolMarkdownBlock, { content: payload.text, collapsible: true }) : null;
11219
+ return payload.text ? /* @__PURE__ */ jsx35(ToolMarkdownBlock, { content: payload.text, collapsible: true }) : null;
10825
11220
  }
10826
11221
 
10827
11222
  // shared/agentConversation/components/tool-renderers/mcp-renderers/agentMcpRendererRegistry.tsx
@@ -10837,7 +11232,7 @@ function renderRegisteredMcp(payload) {
10837
11232
  }
10838
11233
 
10839
11234
  // shared/agentConversation/components/tool-renderers/AgentMcpToolContent.tsx
10840
- import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
11235
+ import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
10841
11236
  function AgentMcpToolContent({
10842
11237
  call,
10843
11238
  onLinkClick
@@ -10849,8 +11244,8 @@ function AgentMcpToolContent({
10849
11244
  payload.text,
10850
11245
  payload.inputSummary
10851
11246
  );
10852
- return /* @__PURE__ */ jsxs25("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
10853
- payload.server || payload.tool ? /* @__PURE__ */ jsx35(ToolSection, { title: translate("agentHost.agentTool.details.mcp"), children: /* @__PURE__ */ jsx35(
11247
+ return /* @__PURE__ */ jsxs26("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11248
+ payload.server || payload.tool ? /* @__PURE__ */ jsx36(ToolSection, { title: translate("agentHost.agentTool.details.mcp"), children: /* @__PURE__ */ jsx36(
10854
11249
  ToolMarkdownBlock,
10855
11250
  {
10856
11251
  content: [
@@ -10860,14 +11255,14 @@ function AgentMcpToolContent({
10860
11255
  onLinkClick
10861
11256
  }
10862
11257
  ) }) : null,
10863
- payload.inputSummary ? /* @__PURE__ */ jsx35(ToolSection, { title: translate("agentHost.agentTool.details.input"), children: /* @__PURE__ */ jsx35(
11258
+ payload.inputSummary ? /* @__PURE__ */ jsx36(ToolSection, { title: translate("agentHost.agentTool.details.input"), children: /* @__PURE__ */ jsx36(
10864
11259
  ToolMarkdownBlock,
10865
11260
  {
10866
11261
  content: payload.inputSummary,
10867
11262
  onLinkClick
10868
11263
  }
10869
11264
  ) }) : null,
10870
- specialized ? /* @__PURE__ */ jsx35(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: specialized }) : visibleText ? /* @__PURE__ */ jsx35(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx35(
11265
+ specialized ? /* @__PURE__ */ jsx36(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: specialized }) : visibleText ? /* @__PURE__ */ jsx36(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx36(
10871
11266
  ToolMarkdownBlock,
10872
11267
  {
10873
11268
  content: visibleText,
@@ -10875,12 +11270,12 @@ function AgentMcpToolContent({
10875
11270
  collapsible: true
10876
11271
  }
10877
11272
  ) }) : null,
10878
- /* @__PURE__ */ jsx35(RawPayloadSection, { payload: call.payload ?? payload.structured })
11273
+ /* @__PURE__ */ jsx36(RawPayloadSection, { payload: call.payload ?? payload.structured })
10879
11274
  ] });
10880
11275
  }
10881
11276
 
10882
11277
  // shared/agentConversation/components/tool-renderers/AgentPlanModeContent.tsx
10883
- import { jsx as jsx36 } from "react/jsx-runtime";
11278
+ import { jsx as jsx37 } from "react/jsx-runtime";
10884
11279
  function AgentPlanModeContent({
10885
11280
  call,
10886
11281
  onLinkClick
@@ -10891,7 +11286,7 @@ function AgentPlanModeContent({
10891
11286
  if (!planMode.enterText) {
10892
11287
  return null;
10893
11288
  }
10894
- return /* @__PURE__ */ jsx36("div", { className: "rounded-[8px] bg-[var(--transparency-block)] px-3 py-2 text-[11px] text-[var(--text-secondary)]", children: /* @__PURE__ */ jsx36(
11289
+ return /* @__PURE__ */ jsx37("div", { className: "rounded-[8px] bg-[var(--transparency-block)] px-3 py-2 text-[11px] text-[var(--text-secondary)]", children: /* @__PURE__ */ jsx37(
10895
11290
  ToolMarkdownBlock,
10896
11291
  {
10897
11292
  content: planMode.enterText,
@@ -10902,18 +11297,18 @@ function AgentPlanModeContent({
10902
11297
  if (!planMode.plan) {
10903
11298
  return null;
10904
11299
  }
10905
- return /* @__PURE__ */ jsx36(
11300
+ return /* @__PURE__ */ jsx37(
10906
11301
  AgentPlanCard,
10907
11302
  {
10908
11303
  title: planMode.fileName ?? void 0,
10909
11304
  copyText: planMode.plan,
10910
- children: /* @__PURE__ */ jsx36(ToolMarkdownBlock, { content: planMode.plan, onLinkClick })
11305
+ children: /* @__PURE__ */ jsx37(ToolMarkdownBlock, { content: planMode.plan, onLinkClick })
10911
11306
  }
10912
11307
  );
10913
11308
  }
10914
11309
 
10915
11310
  // shared/agentConversation/components/tool-renderers/AgentSearchContent.tsx
10916
- import { jsx as jsx37, jsxs as jsxs26 } from "react/jsx-runtime";
11311
+ import { jsx as jsx38, jsxs as jsxs27 } from "react/jsx-runtime";
10917
11312
  function AgentSearchContent({
10918
11313
  call,
10919
11314
  onLinkClick
@@ -10929,9 +11324,9 @@ ${translate("agentHost.agentTool.details.scope")}: ${search.scope}`.trim() : sea
10929
11324
  visibleOutput.split("\n").filter(Boolean),
10930
11325
  "line"
10931
11326
  );
10932
- return /* @__PURE__ */ jsxs26("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
10933
- queryText ? /* @__PURE__ */ jsx37(ToolSection, { title: translate("agentHost.agentTool.details.query"), children: /* @__PURE__ */ jsx37(ToolMarkdownBlock, { content: queryText, onLinkClick }) }) : null,
10934
- (search.mode === "files_with_matches" || search.mode === "list_files") && search.files.length > 0 ? /* @__PURE__ */ jsx37(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx37("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: resultFiles.map(({ key, value: file, isFirst }) => /* @__PURE__ */ jsx37(
11327
+ return /* @__PURE__ */ jsxs27("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11328
+ queryText ? /* @__PURE__ */ jsx38(ToolSection, { title: translate("agentHost.agentTool.details.query"), children: /* @__PURE__ */ jsx38(ToolMarkdownBlock, { content: queryText, onLinkClick }) }) : null,
11329
+ (search.mode === "files_with_matches" || search.mode === "list_files") && search.files.length > 0 ? /* @__PURE__ */ jsx38(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx38("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: resultFiles.map(({ key, value: file, isFirst }) => /* @__PURE__ */ jsx38(
10935
11330
  "div",
10936
11331
  {
10937
11332
  className: `px-3 py-2 font-[var(--tsh-font-mono)] text-[11px] text-[var(--text-primary)] ${isFirst ? "" : "border-t border-[var(--line-2)]"}`,
@@ -10939,7 +11334,7 @@ ${translate("agentHost.agentTool.details.scope")}: ${search.scope}`.trim() : sea
10939
11334
  },
10940
11335
  key
10941
11336
  )) }) }) : null,
10942
- search.mode === "content" && visibleOutput ? /* @__PURE__ */ jsx37(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx37("pre", { className: "max-h-[320px] overflow-auto rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-2 text-[11px] leading-5 text-[var(--text-primary)]", children: outputLines.map(({ key, value: line }) => /* @__PURE__ */ jsx37(
11337
+ search.mode === "content" && visibleOutput ? /* @__PURE__ */ jsx38(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx38("pre", { className: "max-h-[320px] overflow-auto rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)] px-3 py-2 text-[11px] leading-5 text-[var(--text-primary)]", children: outputLines.map(({ key, value: line }) => /* @__PURE__ */ jsx38(
10943
11338
  "div",
10944
11339
  {
10945
11340
  className: line.includes(":") ? "text-[var(--text-primary)]" : "text-[var(--text-tertiary)]",
@@ -10947,9 +11342,9 @@ ${translate("agentHost.agentTool.details.scope")}: ${search.scope}`.trim() : sea
10947
11342
  },
10948
11343
  key
10949
11344
  )) }) }) : null,
10950
- search.mode === "count" ? /* @__PURE__ */ jsx37(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx37("div", { className: "inline-flex rounded-full border border-[var(--line-2)] bg-[var(--transparency-block)] px-2.5 py-1 text-[11px] text-[var(--text-tertiary)]", children: search.output || "0" }) }) : null,
10951
- (search.mode === "files_with_matches" || search.mode === "list_files" || search.mode === "count") && search.files.length === 0 && !visibleOutput && !search.error ? /* @__PURE__ */ jsx37(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx37("div", { className: "text-[11px] italic text-[var(--text-tertiary)]", children: translate("agentHost.agentTool.details.noMatches") }) }) : null,
10952
- search.mode === "unknown" && visibleOutput ? /* @__PURE__ */ jsx37(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx37(
11345
+ search.mode === "count" ? /* @__PURE__ */ jsx38(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx38("div", { className: "inline-flex rounded-full border border-[var(--line-2)] bg-[var(--transparency-block)] px-2.5 py-1 text-[11px] text-[var(--text-tertiary)]", children: search.output || "0" }) }) : null,
11346
+ (search.mode === "files_with_matches" || search.mode === "list_files" || search.mode === "count") && search.files.length === 0 && !visibleOutput && !search.error ? /* @__PURE__ */ jsx38(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx38("div", { className: "text-[11px] italic text-[var(--text-tertiary)]", children: translate("agentHost.agentTool.details.noMatches") }) }) : null,
11347
+ search.mode === "unknown" && visibleOutput ? /* @__PURE__ */ jsx38(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx38(
10953
11348
  ToolMarkdownBlock,
10954
11349
  {
10955
11350
  content: visibleOutput,
@@ -10957,7 +11352,7 @@ ${translate("agentHost.agentTool.details.scope")}: ${search.scope}`.trim() : sea
10957
11352
  collapsible: true
10958
11353
  }
10959
11354
  ) }) : null,
10960
- search.error ? /* @__PURE__ */ jsx37(ToolSection, { title: translate("agentHost.agentTool.details.error"), children: /* @__PURE__ */ jsx37(
11355
+ search.error ? /* @__PURE__ */ jsx38(ToolSection, { title: translate("agentHost.agentTool.details.error"), children: /* @__PURE__ */ jsx38(
10961
11356
  ToolMarkdownBlock,
10962
11357
  {
10963
11358
  content: search.error,
@@ -10985,7 +11380,7 @@ function withStableOccurrenceKeys(values, prefix) {
10985
11380
  }
10986
11381
 
10987
11382
  // shared/agentConversation/components/tool-renderers/AgentSkillContent.tsx
10988
- import { jsx as jsx38, jsxs as jsxs27 } from "react/jsx-runtime";
11383
+ import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
10989
11384
  function AgentSkillContent({
10990
11385
  call,
10991
11386
  onLinkClick
@@ -10995,8 +11390,8 @@ function AgentSkillContent({
10995
11390
  if (!skill.skill && !skill.statusText) {
10996
11391
  return null;
10997
11392
  }
10998
- return /* @__PURE__ */ jsxs27("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
10999
- skill.skill ? /* @__PURE__ */ jsx38(ToolSection, { title: translate("agentHost.agentTool.details.skill"), children: /* @__PURE__ */ jsx38(
11393
+ return /* @__PURE__ */ jsxs28("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11394
+ skill.skill ? /* @__PURE__ */ jsx39(ToolSection, { title: translate("agentHost.agentTool.details.skill"), children: /* @__PURE__ */ jsx39(
11000
11395
  ToolMarkdownBlock,
11001
11396
  {
11002
11397
  content: skill.args ? `${skill.skill}
@@ -11005,19 +11400,19 @@ ${skill.args}` : skill.skill,
11005
11400
  onLinkClick
11006
11401
  }
11007
11402
  ) }) : null,
11008
- skill.statusText ? /* @__PURE__ */ jsx38("div", { className: "text-[10px] text-[var(--text-tertiary)]", children: skill.statusText }) : null
11403
+ skill.statusText ? /* @__PURE__ */ jsx39("div", { className: "text-[10px] text-[var(--text-tertiary)]", children: skill.statusText }) : null
11009
11404
  ] });
11010
11405
  }
11011
11406
 
11012
11407
  // shared/agentConversation/components/AgentTaskStepList.tsx
11013
11408
  import { useState as useState11 } from "react";
11014
- import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
11409
+ import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
11015
11410
  function AgentTaskStepList({
11016
11411
  steps,
11017
11412
  onLinkClick
11018
11413
  }) {
11019
11414
  "use memo";
11020
- return /* @__PURE__ */ jsx39("div", { className: "workspace-agents-status-panel__detail-tool-stack", children: steps.map((step) => /* @__PURE__ */ jsx39(AgentTaskStepRow, { step, onLinkClick }, step.id)) });
11415
+ return /* @__PURE__ */ jsx40("div", { className: "workspace-agents-status-panel__detail-tool-stack", children: steps.map((step) => /* @__PURE__ */ jsx40(AgentTaskStepRow, { step, onLinkClick }, step.id)) });
11021
11416
  }
11022
11417
  function AgentTaskStepRow({
11023
11418
  step,
@@ -11028,8 +11423,8 @@ function AgentTaskStepRow({
11028
11423
  const call = step.tool ?? projectTaskStepCall(step);
11029
11424
  const hasDetail = hasAgentToolContent(call);
11030
11425
  const ariaLabel = taskStepAriaLabel(call);
11031
- return /* @__PURE__ */ jsxs28("div", { className: "workspace-agents-status-panel__detail-tool-row", children: [
11032
- hasDetail ? /* @__PURE__ */ jsx39(
11426
+ return /* @__PURE__ */ jsxs29("div", { className: "workspace-agents-status-panel__detail-tool-row", children: [
11427
+ hasDetail ? /* @__PURE__ */ jsx40(
11033
11428
  "button",
11034
11429
  {
11035
11430
  type: "button",
@@ -11037,11 +11432,11 @@ function AgentTaskStepRow({
11037
11432
  "aria-expanded": expanded,
11038
11433
  "aria-label": ariaLabel,
11039
11434
  onClick: () => setExpanded((value) => !value),
11040
- children: /* @__PURE__ */ jsx39(AgentToolCallHeader, { call, expanded, hasDetail: true })
11435
+ children: /* @__PURE__ */ jsx40(AgentToolCallHeader, { call, expanded, hasDetail: true })
11041
11436
  }
11042
- ) : /* @__PURE__ */ jsx39("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx39(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
11043
- !hasDetail && step.summary ? /* @__PURE__ */ jsx39("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: step.summary }) : null,
11044
- hasDetail && expanded ? /* @__PURE__ */ jsx39(AgentExpandedToolContent, { call, onLinkClick }) : null
11437
+ ) : /* @__PURE__ */ jsx40("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx40(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
11438
+ !hasDetail && step.summary ? /* @__PURE__ */ jsx40("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: step.summary }) : null,
11439
+ hasDetail && expanded ? /* @__PURE__ */ jsx40(AgentExpandedToolContent, { call, onLinkClick }) : null
11045
11440
  ] });
11046
11441
  }
11047
11442
  function taskStepAriaLabel(call) {
@@ -11072,36 +11467,36 @@ function projectTaskStepCall(step) {
11072
11467
  }
11073
11468
 
11074
11469
  // shared/agentConversation/components/tool-renderers/AgentTaskContent.tsx
11075
- import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
11470
+ import { jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
11076
11471
  function AgentTaskContent({
11077
11472
  call,
11078
11473
  onLinkClick
11079
11474
  }) {
11080
11475
  "use memo";
11081
11476
  const task = getTaskRenderData(call);
11082
- return /* @__PURE__ */ jsxs29("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11083
- /* @__PURE__ */ jsxs29("div", { className: "workspace-agents-status-panel__detail-tool-answer", children: [
11084
- /* @__PURE__ */ jsx40("strong", { children: task.title }),
11085
- task.status ? /* @__PURE__ */ jsxs29("span", { className: "workspace-agents-status-panel__detail-tool-answer--muted", children: [
11477
+ return /* @__PURE__ */ jsxs30("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11478
+ /* @__PURE__ */ jsxs30("div", { className: "workspace-agents-status-panel__detail-tool-answer", children: [
11479
+ /* @__PURE__ */ jsx41("strong", { children: task.title }),
11480
+ task.status ? /* @__PURE__ */ jsxs30("span", { className: "workspace-agents-status-panel__detail-tool-answer--muted", children: [
11086
11481
  " \xB7 ",
11087
11482
  task.status
11088
11483
  ] }) : null,
11089
- task.durationText ? /* @__PURE__ */ jsxs29("span", { className: "workspace-agents-status-panel__detail-tool-answer--muted", children: [
11484
+ task.durationText ? /* @__PURE__ */ jsxs30("span", { className: "workspace-agents-status-panel__detail-tool-answer--muted", children: [
11090
11485
  " \xB7 ",
11091
11486
  task.durationText
11092
11487
  ] }) : null
11093
11488
  ] }),
11094
- task.status === "running" && task.latestStepSummary ? /* @__PURE__ */ jsx40(ToolSection, { title: translate("agentHost.agentTool.details.summary"), children: /* @__PURE__ */ jsx40("div", { className: "workspace-agents-status-panel__detail-tool-answer workspace-agents-status-panel__detail-tool-answer--muted", children: task.latestStepSummary }) }) : null,
11095
- task.prompt ? /* @__PURE__ */ jsx40(ToolSection, { title: translate("agentHost.agentTool.details.prompt"), children: /* @__PURE__ */ jsx40(ToolMarkdownBlock, { content: task.prompt, onLinkClick }) }) : null,
11096
- task.childSessionId ? /* @__PURE__ */ jsx40(
11489
+ task.status === "running" && task.latestStepSummary ? /* @__PURE__ */ jsx41(ToolSection, { title: translate("agentHost.agentTool.details.summary"), children: /* @__PURE__ */ jsx41("div", { className: "workspace-agents-status-panel__detail-tool-answer workspace-agents-status-panel__detail-tool-answer--muted", children: task.latestStepSummary }) }) : null,
11490
+ task.prompt ? /* @__PURE__ */ jsx41(ToolSection, { title: translate("agentHost.agentTool.details.prompt"), children: /* @__PURE__ */ jsx41(ToolMarkdownBlock, { content: task.prompt, onLinkClick }) }) : null,
11491
+ task.childSessionId ? /* @__PURE__ */ jsx41(
11097
11492
  ToolSection,
11098
11493
  {
11099
11494
  title: translate("agentHost.agentTool.details.delegateSession"),
11100
- children: /* @__PURE__ */ jsx40("div", { className: "workspace-agents-status-panel__detail-tool-answer", children: task.childSessionId })
11495
+ children: /* @__PURE__ */ jsx41("div", { className: "workspace-agents-status-panel__detail-tool-answer", children: task.childSessionId })
11101
11496
  }
11102
11497
  ) : null,
11103
- task.steps.length > 0 ? /* @__PURE__ */ jsx40(ToolSection, { title: translate("agentHost.agentTool.details.steps"), children: /* @__PURE__ */ jsx40(AgentTaskStepList, { steps: task.steps, onLinkClick }) }) : null,
11104
- task.resultMarkdown ? /* @__PURE__ */ jsx40(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx40(
11498
+ task.steps.length > 0 ? /* @__PURE__ */ jsx41(ToolSection, { title: translate("agentHost.agentTool.details.steps"), children: /* @__PURE__ */ jsx41(AgentTaskStepList, { steps: task.steps, onLinkClick }) }) : null,
11499
+ task.resultMarkdown ? /* @__PURE__ */ jsx41(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx41(
11105
11500
  ToolMarkdownBlock,
11106
11501
  {
11107
11502
  content: task.resultMarkdown,
@@ -11114,7 +11509,7 @@ function AgentTaskContent({
11114
11509
 
11115
11510
  // shared/agentConversation/components/tool-renderers/AgentTodoWriteContent.tsx
11116
11511
  import { CheckCircle2, Circle } from "lucide-react";
11117
- import { jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
11512
+ import { jsx as jsx42, jsxs as jsxs31 } from "react/jsx-runtime";
11118
11513
  function AgentTodoWriteContent({
11119
11514
  call
11120
11515
  }) {
@@ -11123,13 +11518,13 @@ function AgentTodoWriteContent({
11123
11518
  if (todos.length === 0) {
11124
11519
  return null;
11125
11520
  }
11126
- return /* @__PURE__ */ jsx41("div", { className: "workspace-agents-status-panel__detail-tool-body", children: /* @__PURE__ */ jsx41(ToolSection, { title: translate("agentHost.agentTool.details.todos"), children: /* @__PURE__ */ jsx41("div", { className: "space-y-1", children: todos.map((todo) => /* @__PURE__ */ jsxs30(
11521
+ return /* @__PURE__ */ jsx42("div", { className: "workspace-agents-status-panel__detail-tool-body", children: /* @__PURE__ */ jsx42(ToolSection, { title: translate("agentHost.agentTool.details.todos"), children: /* @__PURE__ */ jsx42("div", { className: "space-y-1", children: todos.map((todo) => /* @__PURE__ */ jsxs31(
11127
11522
  "div",
11128
11523
  {
11129
11524
  className: "flex items-start gap-2 rounded-[8px] px-1 py-0.5 text-[11px]",
11130
11525
  children: [
11131
- /* @__PURE__ */ jsx41("div", { className: "mt-[1px] shrink-0", children: iconForStatus(todo.status) }),
11132
- /* @__PURE__ */ jsx41("span", { className: contentClassName(todo.status), children: todo.content })
11526
+ /* @__PURE__ */ jsx42("div", { className: "mt-[1px] shrink-0", children: iconForStatus(todo.status) }),
11527
+ /* @__PURE__ */ jsx42("span", { className: contentClassName(todo.status), children: todo.content })
11133
11528
  ]
11134
11529
  },
11135
11530
  `${todo.content}:${todo.status ?? "pending"}`
@@ -11138,7 +11533,7 @@ function AgentTodoWriteContent({
11138
11533
  function iconForStatus(status) {
11139
11534
  switch (status) {
11140
11535
  case "completed":
11141
- return /* @__PURE__ */ jsx41(
11536
+ return /* @__PURE__ */ jsx42(
11142
11537
  CheckCircle2,
11143
11538
  {
11144
11539
  size: 14,
@@ -11147,7 +11542,7 @@ function iconForStatus(status) {
11147
11542
  }
11148
11543
  );
11149
11544
  case "in_progress":
11150
- return /* @__PURE__ */ jsx41(
11545
+ return /* @__PURE__ */ jsx42(
11151
11546
  AtomIcon,
11152
11547
  {
11153
11548
  size: 14,
@@ -11157,7 +11552,7 @@ function iconForStatus(status) {
11157
11552
  }
11158
11553
  );
11159
11554
  default:
11160
- return /* @__PURE__ */ jsx41(
11555
+ return /* @__PURE__ */ jsx42(
11161
11556
  Circle,
11162
11557
  {
11163
11558
  size: 14,
@@ -11179,7 +11574,7 @@ function contentClassName(status) {
11179
11574
  }
11180
11575
 
11181
11576
  // shared/agentConversation/components/tool-renderers/AgentToolSearchContent.tsx
11182
- import { jsx as jsx42, jsxs as jsxs31 } from "react/jsx-runtime";
11577
+ import { jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
11183
11578
  function AgentToolSearchContent({
11184
11579
  call
11185
11580
  }) {
@@ -11188,8 +11583,8 @@ function AgentToolSearchContent({
11188
11583
  if (!toolSearch.query && toolSearch.matches.length === 0) {
11189
11584
  return null;
11190
11585
  }
11191
- return /* @__PURE__ */ jsxs31("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11192
- toolSearch.displayQuery ? /* @__PURE__ */ jsx42(ToolSection, { title: translate("agentHost.agentTool.details.query"), children: /* @__PURE__ */ jsx42(
11586
+ return /* @__PURE__ */ jsxs32("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11587
+ toolSearch.displayQuery ? /* @__PURE__ */ jsx43(ToolSection, { title: translate("agentHost.agentTool.details.query"), children: /* @__PURE__ */ jsx43(
11193
11588
  ToolMarkdownBlock,
11194
11589
  {
11195
11590
  content: `${toolSearch.displayQuery}
@@ -11197,7 +11592,7 @@ function AgentToolSearchContent({
11197
11592
  ${toolSearch.mode}`
11198
11593
  }
11199
11594
  ) }) : null,
11200
- toolSearch.matches.length > 0 ? /* @__PURE__ */ jsx42(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx42("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: toolSearch.matches.map((match, index) => /* @__PURE__ */ jsx42(
11595
+ toolSearch.matches.length > 0 ? /* @__PURE__ */ jsx43(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx43("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: toolSearch.matches.map((match, index) => /* @__PURE__ */ jsx43(
11201
11596
  "div",
11202
11597
  {
11203
11598
  className: `px-3 py-2 font-[var(--tsh-font-mono)] text-[11px] text-[var(--text-primary)] ${index > 0 ? "border-t border-[var(--line-2)]" : ""}`,
@@ -11205,8 +11600,8 @@ ${toolSearch.mode}`
11205
11600
  },
11206
11601
  match
11207
11602
  )) }) }) : null,
11208
- toolSearch.matches.length === 0 ? /* @__PURE__ */ jsx42("div", { className: "text-[11px] italic text-[var(--text-tertiary)]", children: translate("agentHost.agentTool.details.noMatchingTools") }) : null,
11209
- typeof toolSearch.totalDeferredTools === "number" ? /* @__PURE__ */ jsx42("div", { className: "text-[10px] text-[var(--text-tertiary)]", children: translate("agentHost.agentTool.details.loadedAvailable", {
11603
+ toolSearch.matches.length === 0 ? /* @__PURE__ */ jsx43("div", { className: "text-[11px] italic text-[var(--text-tertiary)]", children: translate("agentHost.agentTool.details.noMatchingTools") }) : null,
11604
+ typeof toolSearch.totalDeferredTools === "number" ? /* @__PURE__ */ jsx43("div", { className: "text-[10px] text-[var(--text-tertiary)]", children: translate("agentHost.agentTool.details.loadedAvailable", {
11210
11605
  loaded: toolSearch.matches.length,
11211
11606
  available: toolSearch.totalDeferredTools
11212
11607
  }) }) : null
@@ -11214,7 +11609,7 @@ ${toolSearch.mode}`
11214
11609
  }
11215
11610
 
11216
11611
  // shared/agentConversation/components/tool-renderers/AgentWebFetchContent.tsx
11217
- import { jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
11612
+ import { jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
11218
11613
  function AgentWebFetchContent({
11219
11614
  call,
11220
11615
  onLinkClick
@@ -11239,15 +11634,15 @@ ${web.url}` : web.url;
11239
11634
  if (!web.url && !visibleContent && !errorText) {
11240
11635
  return null;
11241
11636
  }
11242
- return /* @__PURE__ */ jsxs32("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11243
- web.url ? /* @__PURE__ */ jsx43(ToolSection, { title: translate("agentHost.agentTool.details.url"), children: /* @__PURE__ */ jsx43(
11637
+ return /* @__PURE__ */ jsxs33("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11638
+ web.url ? /* @__PURE__ */ jsx44(ToolSection, { title: translate("agentHost.agentTool.details.url"), children: /* @__PURE__ */ jsx44(
11244
11639
  ToolMarkdownBlock,
11245
11640
  {
11246
11641
  content: urlText ?? "",
11247
11642
  onLinkClick
11248
11643
  }
11249
11644
  ) }) : null,
11250
- visibleContent ? /* @__PURE__ */ jsx43(ToolSection, { title: translate("agentHost.agentTool.details.content"), children: /* @__PURE__ */ jsx43(
11645
+ visibleContent ? /* @__PURE__ */ jsx44(ToolSection, { title: translate("agentHost.agentTool.details.content"), children: /* @__PURE__ */ jsx44(
11251
11646
  ToolMarkdownBlock,
11252
11647
  {
11253
11648
  content: visibleContent,
@@ -11255,8 +11650,8 @@ ${web.url}` : web.url;
11255
11650
  collapsible: true
11256
11651
  }
11257
11652
  ) }) : null,
11258
- web.isTruncated ? /* @__PURE__ */ jsx43("div", { className: "text-[10px] italic text-[var(--text-tertiary)]", children: translate("agentHost.agentTool.details.contentTruncated") }) : null,
11259
- errorText ? /* @__PURE__ */ jsx43(ToolSection, { title: translate("agentHost.agentTool.details.error"), children: /* @__PURE__ */ jsx43(
11653
+ web.isTruncated ? /* @__PURE__ */ jsx44("div", { className: "text-[10px] italic text-[var(--text-tertiary)]", children: translate("agentHost.agentTool.details.contentTruncated") }) : null,
11654
+ errorText ? /* @__PURE__ */ jsx44(ToolSection, { title: translate("agentHost.agentTool.details.error"), children: /* @__PURE__ */ jsx44(
11260
11655
  ToolMarkdownBlock,
11261
11656
  {
11262
11657
  content: errorText,
@@ -11268,7 +11663,7 @@ ${web.url}` : web.url;
11268
11663
  }
11269
11664
 
11270
11665
  // shared/agentConversation/components/tool-renderers/AgentWebSearchContent.tsx
11271
- import { jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
11666
+ import { jsx as jsx45, jsxs as jsxs34 } from "react/jsx-runtime";
11272
11667
  var MAX_SUMMARY_LENGTH = 3e3;
11273
11668
  function AgentWebSearchContent({
11274
11669
  call,
@@ -11292,9 +11687,9 @@ function AgentWebSearchContent({
11292
11687
  if (!hasRenderableContent) {
11293
11688
  return null;
11294
11689
  }
11295
- return /* @__PURE__ */ jsxs33("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11296
- queryText ? /* @__PURE__ */ jsx44(ToolSection, { title: translate("agentHost.agentTool.details.query"), children: /* @__PURE__ */ jsx44(ToolMarkdownBlock, { content: queryText, onLinkClick }) }) : null,
11297
- links.length > 0 ? /* @__PURE__ */ jsx44(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx44("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: links.map((link, index) => /* @__PURE__ */ jsxs33(
11690
+ return /* @__PURE__ */ jsxs34("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11691
+ queryText ? /* @__PURE__ */ jsx45(ToolSection, { title: translate("agentHost.agentTool.details.query"), children: /* @__PURE__ */ jsx45(ToolMarkdownBlock, { content: queryText, onLinkClick }) }) : null,
11692
+ links.length > 0 ? /* @__PURE__ */ jsx45(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx45("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: links.map((link, index) => /* @__PURE__ */ jsxs34(
11298
11693
  "a",
11299
11694
  {
11300
11695
  href: link.url,
@@ -11302,13 +11697,13 @@ function AgentWebSearchContent({
11302
11697
  rel: "noreferrer",
11303
11698
  className: `flex items-center gap-3 px-3 py-2 text-[11px] ${index > 0 ? "border-t border-[var(--line-2)]" : ""}`,
11304
11699
  children: [
11305
- /* @__PURE__ */ jsx44("span", { className: "w-[120px] shrink-0 truncate text-[11px] text-[var(--text-tertiary)]", children: link.domain }),
11306
- /* @__PURE__ */ jsx44("span", { className: "truncate text-[var(--text-primary)]", children: link.title })
11700
+ /* @__PURE__ */ jsx45("span", { className: "w-[120px] shrink-0 truncate text-[11px] text-[var(--text-tertiary)]", children: link.domain }),
11701
+ /* @__PURE__ */ jsx45("span", { className: "truncate text-[var(--text-primary)]", children: link.title })
11307
11702
  ]
11308
11703
  },
11309
11704
  `${link.url}:${link.title}`
11310
11705
  )) }) }) : null,
11311
- visibleSummary ? /* @__PURE__ */ jsx44(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx44(
11706
+ visibleSummary ? /* @__PURE__ */ jsx45(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx45(
11312
11707
  ToolMarkdownBlock,
11313
11708
  {
11314
11709
  content: visibleSummary,
@@ -11316,8 +11711,8 @@ function AgentWebSearchContent({
11316
11711
  collapsible: true
11317
11712
  }
11318
11713
  ) }) : null,
11319
- summary && summary.length > MAX_SUMMARY_LENGTH ? /* @__PURE__ */ jsx44("div", { className: "text-[10px] italic text-[var(--text-tertiary)]", children: translate("agentHost.agentTool.details.summaryTruncated") }) : null,
11320
- web.error ? /* @__PURE__ */ jsx44(ToolSection, { title: translate("agentHost.agentTool.details.error"), children: /* @__PURE__ */ jsx44(
11714
+ summary && summary.length > MAX_SUMMARY_LENGTH ? /* @__PURE__ */ jsx45("div", { className: "text-[10px] italic text-[var(--text-tertiary)]", children: translate("agentHost.agentTool.details.summaryTruncated") }) : null,
11715
+ web.error ? /* @__PURE__ */ jsx45(ToolSection, { title: translate("agentHost.agentTool.details.error"), children: /* @__PURE__ */ jsx45(
11321
11716
  ToolMarkdownBlock,
11322
11717
  {
11323
11718
  content: web.error,
@@ -11410,7 +11805,7 @@ function domainForUrl2(url) {
11410
11805
  }
11411
11806
 
11412
11807
  // shared/agentConversation/components/tool-renderers/AgentWriteContent.tsx
11413
- import { jsx as jsx45, jsxs as jsxs34 } from "react/jsx-runtime";
11808
+ import { jsx as jsx46, jsxs as jsxs35 } from "react/jsx-runtime";
11414
11809
  function AgentWriteContent({
11415
11810
  call,
11416
11811
  onLinkClick
@@ -11430,9 +11825,9 @@ function AgentWriteContent({
11430
11825
  if (!hasRenderableContent) {
11431
11826
  return null;
11432
11827
  }
11433
- return /* @__PURE__ */ jsxs34("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--flat", children: [
11434
- path && files.length === 0 ? /* @__PURE__ */ jsx45(ToolMarkdownBlock, { content: path, onLinkClick }) : null,
11435
- patchFiles.map((candidate) => /* @__PURE__ */ jsx45(
11828
+ return /* @__PURE__ */ jsxs35("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--flat", children: [
11829
+ path && files.length === 0 ? /* @__PURE__ */ jsx46(ToolMarkdownBlock, { content: path, onLinkClick }) : null,
11830
+ patchFiles.map((candidate) => /* @__PURE__ */ jsx46(
11436
11831
  AgentUnifiedPatchViewer,
11437
11832
  {
11438
11833
  path: candidate.path,
@@ -11443,7 +11838,7 @@ function AgentWriteContent({
11443
11838
  },
11444
11839
  `patch:${candidate.path}`
11445
11840
  )),
11446
- contentFiles.map((candidate) => /* @__PURE__ */ jsx45(
11841
+ contentFiles.map((candidate) => /* @__PURE__ */ jsx46(
11447
11842
  AgentCodeBlock,
11448
11843
  {
11449
11844
  path: candidate.path,
@@ -11454,7 +11849,7 @@ function AgentWriteContent({
11454
11849
  },
11455
11850
  `content:${candidate.path}`
11456
11851
  )),
11457
- fallbackContent ? /* @__PURE__ */ jsx45(
11852
+ fallbackContent ? /* @__PURE__ */ jsx46(
11458
11853
  AgentCodeBlock,
11459
11854
  {
11460
11855
  path,
@@ -11468,7 +11863,7 @@ function AgentWriteContent({
11468
11863
  }
11469
11864
 
11470
11865
  // shared/agentConversation/components/tool-renderers/AgentExpandedToolContent.tsx
11471
- import { jsx as jsx46 } from "react/jsx-runtime";
11866
+ import { jsx as jsx47 } from "react/jsx-runtime";
11472
11867
  function AgentExpandedToolContent({
11473
11868
  call,
11474
11869
  onLinkClick,
@@ -11479,65 +11874,65 @@ function AgentExpandedToolContent({
11479
11874
  let content;
11480
11875
  switch (call.rendererKind) {
11481
11876
  case "approval":
11482
- content = /* @__PURE__ */ jsx46(AgentApprovalContent, { ...props });
11877
+ content = /* @__PURE__ */ jsx47(AgentApprovalContent, { ...props });
11483
11878
  break;
11484
11879
  case "plan-enter":
11485
11880
  case "plan-exit":
11486
- content = /* @__PURE__ */ jsx46(AgentPlanModeContent, { ...props });
11881
+ content = /* @__PURE__ */ jsx47(AgentPlanModeContent, { ...props });
11487
11882
  break;
11488
11883
  case "ask-user":
11489
- content = /* @__PURE__ */ jsx46(AgentAskUserQuestionContent, { ...props });
11884
+ content = /* @__PURE__ */ jsx47(AgentAskUserQuestionContent, { ...props });
11490
11885
  break;
11491
11886
  case "task":
11492
- content = /* @__PURE__ */ jsx46(AgentTaskContent, { ...props });
11887
+ content = /* @__PURE__ */ jsx47(AgentTaskContent, { ...props });
11493
11888
  break;
11494
11889
  case "read":
11495
- content = /* @__PURE__ */ jsx46(AgentReadContent, { ...props });
11890
+ content = /* @__PURE__ */ jsx47(AgentReadContent, { ...props });
11496
11891
  break;
11497
11892
  case "write":
11498
- content = /* @__PURE__ */ jsx46(AgentWriteContent, { ...props });
11893
+ content = /* @__PURE__ */ jsx47(AgentWriteContent, { ...props });
11499
11894
  break;
11500
11895
  case "edit":
11501
- content = /* @__PURE__ */ jsx46(AgentEditContent, { ...props });
11896
+ content = /* @__PURE__ */ jsx47(AgentEditContent, { ...props });
11502
11897
  break;
11503
11898
  case "bash":
11504
- content = /* @__PURE__ */ jsx46(AgentBashContent, { ...props });
11899
+ content = /* @__PURE__ */ jsx47(AgentBashContent, { ...props });
11505
11900
  break;
11506
11901
  case "search":
11507
- content = /* @__PURE__ */ jsx46(AgentSearchContent, { ...props });
11902
+ content = /* @__PURE__ */ jsx47(AgentSearchContent, { ...props });
11508
11903
  break;
11509
11904
  case "web-search":
11510
- content = /* @__PURE__ */ jsx46(AgentWebSearchContent, { ...props });
11905
+ content = /* @__PURE__ */ jsx47(AgentWebSearchContent, { ...props });
11511
11906
  break;
11512
11907
  case "web-fetch":
11513
- content = /* @__PURE__ */ jsx46(AgentWebFetchContent, { ...props });
11908
+ content = /* @__PURE__ */ jsx47(AgentWebFetchContent, { ...props });
11514
11909
  break;
11515
11910
  case "image-generation":
11516
- content = /* @__PURE__ */ jsx46(AgentImageGenerationContent, { ...props });
11911
+ content = /* @__PURE__ */ jsx47(AgentImageGenerationContent, { ...props });
11517
11912
  break;
11518
11913
  case "todo-write":
11519
- content = /* @__PURE__ */ jsx46(AgentTodoWriteContent, { ...props });
11914
+ content = /* @__PURE__ */ jsx47(AgentTodoWriteContent, { ...props });
11520
11915
  break;
11521
11916
  case "tool-search":
11522
- content = /* @__PURE__ */ jsx46(AgentToolSearchContent, { ...props });
11917
+ content = /* @__PURE__ */ jsx47(AgentToolSearchContent, { ...props });
11523
11918
  break;
11524
11919
  case "skill":
11525
- content = /* @__PURE__ */ jsx46(AgentSkillContent, { ...props });
11920
+ content = /* @__PURE__ */ jsx47(AgentSkillContent, { ...props });
11526
11921
  break;
11527
11922
  case "mcp":
11528
- content = /* @__PURE__ */ jsx46(AgentMcpToolContent, { ...props });
11923
+ content = /* @__PURE__ */ jsx47(AgentMcpToolContent, { ...props });
11529
11924
  break;
11530
11925
  default:
11531
- content = /* @__PURE__ */ jsx46(AgentDefaultToolContent, { ...props });
11926
+ content = /* @__PURE__ */ jsx47(AgentDefaultToolContent, { ...props });
11532
11927
  }
11533
11928
  if (!content) {
11534
11929
  return null;
11535
11930
  }
11536
- return /* @__PURE__ */ jsx46(AgentToolPreviewModeProvider, { previewMode, children: content });
11931
+ return /* @__PURE__ */ jsx47(AgentToolPreviewModeProvider, { previewMode, children: content });
11537
11932
  }
11538
11933
 
11539
11934
  // shared/agentConversation/components/AgentAskUserQuestionCard.tsx
11540
- import { jsx as jsx47, jsxs as jsxs35 } from "react/jsx-runtime";
11935
+ import { jsx as jsx48, jsxs as jsxs36 } from "react/jsx-runtime";
11541
11936
  function AgentAskUserQuestionCard({
11542
11937
  call,
11543
11938
  onLinkClick,
@@ -11550,19 +11945,19 @@ function AgentAskUserQuestionCard({
11550
11945
  const hasDetail = hasAgentToolContent(call);
11551
11946
  const pinned = nonCollapsible ?? waitingInput;
11552
11947
  const [expanded, setExpanded] = useState12(defaultExpanded ?? waitingInput);
11553
- return /* @__PURE__ */ jsxs35("div", { className: "workspace-agents-status-panel__detail-tool-row workspace-agents-status-panel__detail-tool-row--ask-user", children: [
11554
- hasDetail && !pinned ? /* @__PURE__ */ jsx47(
11948
+ return /* @__PURE__ */ jsxs36("div", { className: "workspace-agents-status-panel__detail-tool-row workspace-agents-status-panel__detail-tool-row--ask-user", children: [
11949
+ hasDetail && !pinned ? /* @__PURE__ */ jsx48(
11555
11950
  "button",
11556
11951
  {
11557
11952
  type: "button",
11558
11953
  className: "workspace-agents-status-panel__detail-tool-row-head workspace-agents-status-panel__detail-tool-row-head--button",
11559
11954
  "aria-expanded": expanded,
11560
11955
  onClick: () => setExpanded((value) => !value),
11561
- children: /* @__PURE__ */ jsx47(AgentToolCallHeader, { call, expanded, hasDetail: true })
11956
+ children: /* @__PURE__ */ jsx48(AgentToolCallHeader, { call, expanded, hasDetail: true })
11562
11957
  }
11563
- ) : /* @__PURE__ */ jsx47("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx47(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
11564
- !hasDetail && call.summary ? /* @__PURE__ */ jsx47("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: call.summary }) : null,
11565
- hasDetail && pinned ? /* @__PURE__ */ jsx47(
11958
+ ) : /* @__PURE__ */ jsx48("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx48(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
11959
+ !hasDetail && call.summary ? /* @__PURE__ */ jsx48("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: call.summary }) : null,
11960
+ hasDetail && pinned ? /* @__PURE__ */ jsx48(
11566
11961
  AgentExpandedToolContent,
11567
11962
  {
11568
11963
  call,
@@ -11570,7 +11965,7 @@ function AgentAskUserQuestionCard({
11570
11965
  previewMode
11571
11966
  }
11572
11967
  ) : null,
11573
- hasDetail && !pinned ? /* @__PURE__ */ jsx47(CollapsibleReveal, { expanded, children: /* @__PURE__ */ jsx47(
11968
+ hasDetail && !pinned ? /* @__PURE__ */ jsx48(CollapsibleReveal, { expanded, children: /* @__PURE__ */ jsx48(
11574
11969
  AgentExpandedToolContent,
11575
11970
  {
11576
11971
  call,
@@ -11582,7 +11977,7 @@ function AgentAskUserQuestionCard({
11582
11977
  }
11583
11978
 
11584
11979
  // shared/agentConversation/components/AgentEnterPlanModeCard.tsx
11585
- import { jsx as jsx48, jsxs as jsxs36 } from "react/jsx-runtime";
11980
+ import { jsx as jsx49, jsxs as jsxs37 } from "react/jsx-runtime";
11586
11981
  function AgentEnterPlanModeCard({
11587
11982
  call,
11588
11983
  onLinkClick,
@@ -11590,10 +11985,10 @@ function AgentEnterPlanModeCard({
11590
11985
  }) {
11591
11986
  "use memo";
11592
11987
  const hasDetail = hasAgentToolContent(call);
11593
- return /* @__PURE__ */ jsxs36("div", { className: "workspace-agents-status-panel__detail-tool-row workspace-agents-status-panel__detail-tool-row--plan-enter", children: [
11594
- /* @__PURE__ */ jsx48("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx48(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
11595
- !hasDetail && call.summary ? /* @__PURE__ */ jsx48("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: call.summary }) : null,
11596
- hasDetail ? /* @__PURE__ */ jsx48(
11988
+ return /* @__PURE__ */ jsxs37("div", { className: "workspace-agents-status-panel__detail-tool-row workspace-agents-status-panel__detail-tool-row--plan-enter", children: [
11989
+ /* @__PURE__ */ jsx49("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx49(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
11990
+ !hasDetail && call.summary ? /* @__PURE__ */ jsx49("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: call.summary }) : null,
11991
+ hasDetail ? /* @__PURE__ */ jsx49(
11597
11992
  AgentExpandedToolContent,
11598
11993
  {
11599
11994
  call,
@@ -11605,7 +12000,7 @@ function AgentEnterPlanModeCard({
11605
12000
  }
11606
12001
 
11607
12002
  // shared/agentConversation/components/AgentExitPlanModeCard.tsx
11608
- import { jsx as jsx49, jsxs as jsxs37 } from "react/jsx-runtime";
12003
+ import { jsx as jsx50, jsxs as jsxs38 } from "react/jsx-runtime";
11609
12004
  function AgentExitPlanModeCard({
11610
12005
  call,
11611
12006
  onLinkClick,
@@ -11613,10 +12008,10 @@ function AgentExitPlanModeCard({
11613
12008
  }) {
11614
12009
  "use memo";
11615
12010
  const hasDetail = hasAgentToolContent(call);
11616
- return /* @__PURE__ */ jsxs37("div", { className: "workspace-agents-status-panel__detail-tool-row workspace-agents-status-panel__detail-tool-row--plan-exit", children: [
11617
- /* @__PURE__ */ jsx49("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx49(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
11618
- !hasDetail && call.summary ? /* @__PURE__ */ jsx49("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: call.summary }) : null,
11619
- hasDetail ? /* @__PURE__ */ jsx49(
12011
+ return /* @__PURE__ */ jsxs38("div", { className: "workspace-agents-status-panel__detail-tool-row workspace-agents-status-panel__detail-tool-row--plan-exit", children: [
12012
+ /* @__PURE__ */ jsx50("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx50(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
12013
+ !hasDetail && call.summary ? /* @__PURE__ */ jsx50("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: call.summary }) : null,
12014
+ hasDetail ? /* @__PURE__ */ jsx50(
11620
12015
  AgentExpandedToolContent,
11621
12016
  {
11622
12017
  call,
@@ -11629,7 +12024,7 @@ function AgentExitPlanModeCard({
11629
12024
 
11630
12025
  // shared/agentConversation/components/AgentTaskCallCard.tsx
11631
12026
  import { useState as useState13 } from "react";
11632
- import { jsx as jsx50, jsxs as jsxs38 } from "react/jsx-runtime";
12027
+ import { jsx as jsx51, jsxs as jsxs39 } from "react/jsx-runtime";
11633
12028
  function AgentTaskCallCard({
11634
12029
  call,
11635
12030
  onLinkClick,
@@ -11643,8 +12038,8 @@ function AgentTaskCallCard({
11643
12038
  const pinned = nonCollapsible ?? running;
11644
12039
  const [expanded, setExpanded] = useState13(defaultExpanded ?? running);
11645
12040
  const ariaLabel = taskCallAriaLabel(call);
11646
- return /* @__PURE__ */ jsxs38("div", { className: "workspace-agents-status-panel__detail-tool-row workspace-agents-status-panel__detail-tool-row--task", children: [
11647
- hasDetail && !pinned ? /* @__PURE__ */ jsx50(
12041
+ return /* @__PURE__ */ jsxs39("div", { className: "workspace-agents-status-panel__detail-tool-row workspace-agents-status-panel__detail-tool-row--task", children: [
12042
+ hasDetail && !pinned ? /* @__PURE__ */ jsx51(
11648
12043
  "button",
11649
12044
  {
11650
12045
  type: "button",
@@ -11652,11 +12047,11 @@ function AgentTaskCallCard({
11652
12047
  "aria-expanded": expanded,
11653
12048
  "aria-label": ariaLabel,
11654
12049
  onClick: () => setExpanded((value) => !value),
11655
- children: /* @__PURE__ */ jsx50(AgentToolCallHeader, { call, expanded, hasDetail: true })
12050
+ children: /* @__PURE__ */ jsx51(AgentToolCallHeader, { call, expanded, hasDetail: true })
11656
12051
  }
11657
- ) : /* @__PURE__ */ jsx50("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx50(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
11658
- !hasDetail && call.summary ? /* @__PURE__ */ jsx50("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: call.summary }) : null,
11659
- hasDetail && pinned ? /* @__PURE__ */ jsx50(
12052
+ ) : /* @__PURE__ */ jsx51("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx51(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
12053
+ !hasDetail && call.summary ? /* @__PURE__ */ jsx51("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: call.summary }) : null,
12054
+ hasDetail && pinned ? /* @__PURE__ */ jsx51(
11660
12055
  AgentExpandedToolContent,
11661
12056
  {
11662
12057
  call,
@@ -11664,7 +12059,7 @@ function AgentTaskCallCard({
11664
12059
  previewMode
11665
12060
  }
11666
12061
  ) : null,
11667
- hasDetail && !pinned ? /* @__PURE__ */ jsx50(CollapsibleReveal, { expanded, children: /* @__PURE__ */ jsx50(
12062
+ hasDetail && !pinned ? /* @__PURE__ */ jsx51(CollapsibleReveal, { expanded, children: /* @__PURE__ */ jsx51(
11668
12063
  AgentExpandedToolContent,
11669
12064
  {
11670
12065
  call,
@@ -11684,7 +12079,7 @@ function taskCallAriaLabel(call) {
11684
12079
 
11685
12080
  // shared/agentConversation/components/AgentToolCallCard.tsx
11686
12081
  import { useState as useState14 } from "react";
11687
- import { jsx as jsx51, jsxs as jsxs39 } from "react/jsx-runtime";
12082
+ import { jsx as jsx52, jsxs as jsxs40 } from "react/jsx-runtime";
11688
12083
  function AgentToolCallCard({
11689
12084
  call,
11690
12085
  onLinkClick,
@@ -11698,7 +12093,7 @@ function AgentToolCallCard({
11698
12093
  const hasDetail = hasAgentToolContent(call);
11699
12094
  const canCollapse = hasDetail && !nonCollapsible;
11700
12095
  const ariaLabel = toolCallAriaLabel(call);
11701
- return /* @__PURE__ */ jsxs39(
12096
+ return /* @__PURE__ */ jsxs40(
11702
12097
  "div",
11703
12098
  {
11704
12099
  className: [
@@ -11706,7 +12101,7 @@ function AgentToolCallCard({
11706
12101
  variantClassName ?? ""
11707
12102
  ].filter(Boolean).join(" "),
11708
12103
  children: [
11709
- canCollapse ? /* @__PURE__ */ jsx51(
12104
+ canCollapse ? /* @__PURE__ */ jsx52(
11710
12105
  "button",
11711
12106
  {
11712
12107
  type: "button",
@@ -11714,10 +12109,10 @@ function AgentToolCallCard({
11714
12109
  "aria-expanded": expanded,
11715
12110
  "aria-label": ariaLabel,
11716
12111
  onClick: () => setExpanded((value) => !value),
11717
- children: /* @__PURE__ */ jsx51(AgentToolCallHeader, { call, expanded, hasDetail: true })
12112
+ children: /* @__PURE__ */ jsx52(AgentToolCallHeader, { call, expanded, hasDetail: true })
11718
12113
  }
11719
- ) : /* @__PURE__ */ jsx51("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx51(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
11720
- hasDetail && nonCollapsible ? /* @__PURE__ */ jsx51(
12114
+ ) : /* @__PURE__ */ jsx52("div", { className: "workspace-agents-status-panel__detail-tool-row-head", children: /* @__PURE__ */ jsx52(AgentToolCallHeader, { call, expanded: false, hasDetail: false }) }),
12115
+ hasDetail && nonCollapsible ? /* @__PURE__ */ jsx52(
11721
12116
  AgentExpandedToolContent,
11722
12117
  {
11723
12118
  call,
@@ -11725,7 +12120,7 @@ function AgentToolCallCard({
11725
12120
  previewMode
11726
12121
  }
11727
12122
  ) : null,
11728
- hasDetail && !nonCollapsible ? /* @__PURE__ */ jsx51(CollapsibleReveal, { expanded, children: /* @__PURE__ */ jsx51(
12123
+ hasDetail && !nonCollapsible ? /* @__PURE__ */ jsx52(CollapsibleReveal, { expanded, children: /* @__PURE__ */ jsx52(
11729
12124
  AgentExpandedToolContent,
11730
12125
  {
11731
12126
  call,
@@ -11746,7 +12141,7 @@ function toolCallAriaLabel(call) {
11746
12141
  }
11747
12142
 
11748
12143
  // shared/agentConversation/components/AgentToolGroupRow.tsx
11749
- import { Fragment as Fragment5, jsx as jsx52, jsxs as jsxs40 } from "react/jsx-runtime";
12144
+ import { Fragment as Fragment5, jsx as jsx53, jsxs as jsxs41 } from "react/jsx-runtime";
11750
12145
  var AgentToolGroupRow = memo(function AgentToolGroupRow2({
11751
12146
  row,
11752
12147
  label,
@@ -11782,13 +12177,13 @@ var AgentToolGroupRow = memo(function AgentToolGroupRow2({
11782
12177
  rawTimelineJsonLabel
11783
12178
  );
11784
12179
  }
11785
- return /* @__PURE__ */ jsxs40(
12180
+ return /* @__PURE__ */ jsxs41(
11786
12181
  "div",
11787
12182
  {
11788
12183
  className: "workspace-agents-status-panel__detail-tool-section",
11789
12184
  "data-tool-group-expanded": isExpanded ? "true" : void 0,
11790
12185
  children: [
11791
- hasDetail ? /* @__PURE__ */ jsxs40(
12186
+ hasDetail ? /* @__PURE__ */ jsxs41(
11792
12187
  "button",
11793
12188
  {
11794
12189
  type: "button",
@@ -11797,8 +12192,8 @@ var AgentToolGroupRow = memo(function AgentToolGroupRow2({
11797
12192
  "aria-label": groupLabel,
11798
12193
  onClick: () => setNextExpanded(!isExpanded),
11799
12194
  children: [
11800
- /* @__PURE__ */ jsx52(ToolGroupLabel, { label: groupLabel }),
11801
- isExpanded ? /* @__PURE__ */ jsx52(
12195
+ /* @__PURE__ */ jsx53(ToolGroupLabel, { label: groupLabel }),
12196
+ isExpanded ? /* @__PURE__ */ jsx53(
11802
12197
  ChevronDown6,
11803
12198
  {
11804
12199
  size: 12,
@@ -11806,7 +12201,7 @@ var AgentToolGroupRow = memo(function AgentToolGroupRow2({
11806
12201
  "aria-hidden": "true",
11807
12202
  className: "workspace-agents-status-panel__detail-tool-count-chevron"
11808
12203
  }
11809
- ) : /* @__PURE__ */ jsx52(
12204
+ ) : /* @__PURE__ */ jsx53(
11810
12205
  ChevronRight6,
11811
12206
  {
11812
12207
  size: 12,
@@ -11817,13 +12212,13 @@ var AgentToolGroupRow = memo(function AgentToolGroupRow2({
11817
12212
  )
11818
12213
  ]
11819
12214
  }
11820
- ) : /* @__PURE__ */ jsx52("div", { className: "workspace-agents-status-panel__detail-tool-count", children: /* @__PURE__ */ jsx52(ToolGroupLabel, { label: groupLabel }) }),
11821
- hasDetail ? /* @__PURE__ */ jsx52(CollapsibleReveal, { expanded: isExpanded, children: /* @__PURE__ */ jsx52("div", { className: "workspace-agents-status-panel__detail-tool-list", children: row.entries.map(
11822
- (entry) => entry.kind === "thinking" ? /* @__PURE__ */ jsx52(
12215
+ ) : /* @__PURE__ */ jsx53("div", { className: "workspace-agents-status-panel__detail-tool-count", children: /* @__PURE__ */ jsx53(ToolGroupLabel, { label: groupLabel }) }),
12216
+ hasDetail ? /* @__PURE__ */ jsx53(CollapsibleReveal, { expanded: isExpanded, children: /* @__PURE__ */ jsx53("div", { className: "workspace-agents-status-panel__detail-tool-list", children: row.entries.map(
12217
+ (entry) => entry.kind === "thinking" ? /* @__PURE__ */ jsx53(
11823
12218
  "div",
11824
12219
  {
11825
12220
  className: "workspace-agents-status-panel__detail-tool-list-item workspace-agents-status-panel__detail-tool-row",
11826
- children: /* @__PURE__ */ jsx52(
12221
+ children: /* @__PURE__ */ jsx53(
11827
12222
  AgentThinkingDisclosure,
11828
12223
  {
11829
12224
  thinking: entry.thinking,
@@ -11836,7 +12231,7 @@ var AgentToolGroupRow = memo(function AgentToolGroupRow2({
11836
12231
  )
11837
12232
  },
11838
12233
  entry.thinking.id
11839
- ) : /* @__PURE__ */ jsx52(
12234
+ ) : /* @__PURE__ */ jsx53(
11840
12235
  "div",
11841
12236
  {
11842
12237
  className: "workspace-agents-status-panel__detail-tool-list-item",
@@ -11857,8 +12252,8 @@ var AgentToolGroupRow = memo(function AgentToolGroupRow2({
11857
12252
  });
11858
12253
  function ToolGroupLabel({ label }) {
11859
12254
  "use memo";
11860
- return /* @__PURE__ */ jsxs40(Fragment5, { children: [
11861
- /* @__PURE__ */ jsx52(
12255
+ return /* @__PURE__ */ jsxs41(Fragment5, { children: [
12256
+ /* @__PURE__ */ jsx53(
11862
12257
  ToolActivityKindIcon,
11863
12258
  {
11864
12259
  kind: "update_todos",
@@ -11867,7 +12262,7 @@ function ToolGroupLabel({ label }) {
11867
12262
  className: "workspace-agents-status-panel__detail-tool-count-icon"
11868
12263
  }
11869
12264
  ),
11870
- /* @__PURE__ */ jsx52("span", { className: "workspace-agents-status-panel__detail-tool-count-label", children: renderToolCountLabel(label) })
12265
+ /* @__PURE__ */ jsx53("span", { className: "workspace-agents-status-panel__detail-tool-count-label", children: renderToolCountLabel(label) })
11871
12266
  ] });
11872
12267
  }
11873
12268
  function hasGroupDetail(row) {
@@ -11880,11 +12275,11 @@ function renderToolCountLabel(label) {
11880
12275
  const primary = statusMatch?.[1];
11881
12276
  const status = statusMatch?.[2];
11882
12277
  if (!primary || !status) {
11883
- return /* @__PURE__ */ jsx52("span", { className: "workspace-agents-status-panel__detail-tool-count-primary", children: label });
12278
+ return /* @__PURE__ */ jsx53("span", { className: "workspace-agents-status-panel__detail-tool-count-primary", children: label });
11884
12279
  }
11885
- return /* @__PURE__ */ jsxs40(Fragment5, { children: [
11886
- /* @__PURE__ */ jsx52("span", { className: "workspace-agents-status-panel__detail-tool-count-primary", children: primary }),
11887
- /* @__PURE__ */ jsx52("span", { className: "workspace-agents-status-panel__detail-tool-count-status", children: formatInlineStatusLabel3(status) })
12280
+ return /* @__PURE__ */ jsxs41(Fragment5, { children: [
12281
+ /* @__PURE__ */ jsx53("span", { className: "workspace-agents-status-panel__detail-tool-count-primary", children: primary }),
12282
+ /* @__PURE__ */ jsx53("span", { className: "workspace-agents-status-panel__detail-tool-count-status", children: formatInlineStatusLabel3(status) })
11888
12283
  ] });
11889
12284
  }
11890
12285
  function formatInlineStatusLabel3(label) {
@@ -11895,23 +12290,23 @@ function renderToolCard(call, onLinkClick, previewMode = false, showRawTimelineJ
11895
12290
  let card;
11896
12291
  switch (call.rendererKind) {
11897
12292
  case "plan-enter":
11898
- card = /* @__PURE__ */ jsx52(AgentEnterPlanModeCard, { ...props });
12293
+ card = /* @__PURE__ */ jsx53(AgentEnterPlanModeCard, { ...props });
11899
12294
  break;
11900
12295
  case "plan-exit":
11901
- card = /* @__PURE__ */ jsx52(AgentExitPlanModeCard, { ...props });
12296
+ card = /* @__PURE__ */ jsx53(AgentExitPlanModeCard, { ...props });
11902
12297
  break;
11903
12298
  case "ask-user":
11904
- card = /* @__PURE__ */ jsx52(AgentAskUserQuestionCard, { ...props });
12299
+ card = /* @__PURE__ */ jsx53(AgentAskUserQuestionCard, { ...props });
11905
12300
  break;
11906
12301
  case "task":
11907
- card = /* @__PURE__ */ jsx52(AgentTaskCallCard, { ...props });
12302
+ card = /* @__PURE__ */ jsx53(AgentTaskCallCard, { ...props });
11908
12303
  break;
11909
12304
  default:
11910
- card = /* @__PURE__ */ jsx52(AgentToolCallCard, { ...props });
12305
+ card = /* @__PURE__ */ jsx53(AgentToolCallCard, { ...props });
11911
12306
  }
11912
- return /* @__PURE__ */ jsxs40(Fragment5, { children: [
12307
+ return /* @__PURE__ */ jsxs41(Fragment5, { children: [
11913
12308
  card,
11914
- showRawTimelineJson && rawTimelineJsonLabel ? /* @__PURE__ */ jsx52(
12309
+ showRawTimelineJson && rawTimelineJsonLabel ? /* @__PURE__ */ jsx53(
11915
12310
  RawTimelineJsonDisclosure,
11916
12311
  {
11917
12312
  items: call.sourceTimelineItems,
@@ -11922,14 +12317,27 @@ function renderToolCard(call, onLinkClick, previewMode = false, showRawTimelineJ
11922
12317
  }
11923
12318
 
11924
12319
  // shared/agentConversation/components/AgentTurnSummaryRow.tsx
11925
- import { useMemo as useMemo5, useState as useState16 } from "react";
11926
- import { ChevronDown as ChevronDown7, ChevronRight as ChevronRight7 } from "lucide-react";
12320
+ import { useEffect as useEffect10, useMemo as useMemo5, useState as useState16 } from "react";
12321
+ import {
12322
+ ChevronDown as ChevronDown7,
12323
+ ChevronRight as ChevronRight7,
12324
+ LoaderCircle as LoaderCircle2,
12325
+ Redo2,
12326
+ Undo2
12327
+ } from "lucide-react";
12328
+ import {
12329
+ Tooltip,
12330
+ TooltipContent,
12331
+ TooltipProvider,
12332
+ TooltipTrigger,
12333
+ toast
12334
+ } from "@tutti-os/ui-system";
11927
12335
 
11928
12336
  // app/renderer/components/icons/DirectLinedIcon.tsx
11929
- import { jsx as jsx53 } from "react/jsx-runtime";
12337
+ import { jsx as jsx54 } from "react/jsx-runtime";
11930
12338
  function DirectLinedIcon(props) {
11931
12339
  "use memo";
11932
- return /* @__PURE__ */ jsx53(
12340
+ return /* @__PURE__ */ jsx54(
11933
12341
  "svg",
11934
12342
  {
11935
12343
  xmlns: "http://www.w3.org/2000/svg",
@@ -11939,7 +12347,7 @@ function DirectLinedIcon(props) {
11939
12347
  "data-nexight-chrome-glyph": "fill",
11940
12348
  "data-tutti-chrome-glyph": "fill",
11941
12349
  ...props,
11942
- children: /* @__PURE__ */ jsx53(
12350
+ children: /* @__PURE__ */ jsx54(
11943
12351
  "path",
11944
12352
  {
11945
12353
  fill: "currentColor",
@@ -11950,8 +12358,197 @@ function DirectLinedIcon(props) {
11950
12358
  );
11951
12359
  }
11952
12360
 
12361
+ // shared/agentConversation/rules/agentTurnSummaryPatchDiff.ts
12362
+ function buildAgentTurnSummaryPatchDiff(batch) {
12363
+ return batch.changes.map((change) => patchChangeToUnifiedDiff(change, batch.cwd)).filter((diff) => diff.trim().length > 0).join("\n");
12364
+ }
12365
+ function patchChangeToUnifiedDiff(change, cwd) {
12366
+ const path = patchPathRelativeToCwd(change.path, cwd);
12367
+ const rawDiff = normalizeAgentPatchText(change.unifiedDiff ?? "").trim();
12368
+ if (rawDiff && looksLikeUnifiedDiff(rawDiff)) {
12369
+ return ensureTrailingNewline(
12370
+ wrapUnifiedDiff(path, change.changeType, rawDiff)
12371
+ );
12372
+ }
12373
+ if (change.changeType === "created") {
12374
+ return fileContentPatch(
12375
+ path,
12376
+ "created",
12377
+ change.content ?? change.newString ?? rawDiff
12378
+ );
12379
+ }
12380
+ if (change.changeType === "deleted") {
12381
+ return fileContentPatch(
12382
+ path,
12383
+ "deleted",
12384
+ change.oldString ?? change.content ?? rawDiff
12385
+ );
12386
+ }
12387
+ if (change.oldString != null || change.newString != null) {
12388
+ return modifiedFilePatch(
12389
+ path,
12390
+ change.oldString ?? "",
12391
+ change.newString ?? ""
12392
+ );
12393
+ }
12394
+ return "";
12395
+ }
12396
+ function wrapUnifiedDiff(path, changeType, diff) {
12397
+ if (diff.startsWith("diff --git ")) {
12398
+ return diff;
12399
+ }
12400
+ const headers = [`diff --git a/${path} b/${path}`];
12401
+ if (changeType === "created") {
12402
+ headers.push("new file mode 100644", "--- /dev/null", `+++ b/${path}`);
12403
+ } else if (changeType === "deleted") {
12404
+ headers.push("deleted file mode 100644", `--- a/${path}`, "+++ /dev/null");
12405
+ } else if (!diff.startsWith("--- ") && !diff.includes("\n--- ")) {
12406
+ headers.push(`--- a/${path}`, `+++ b/${path}`);
12407
+ }
12408
+ return [...headers, diff].join("\n");
12409
+ }
12410
+ function fileContentPatch(path, changeType, content) {
12411
+ const lines = splitPatchContentLines(content);
12412
+ const count = Math.max(lines.length, 1);
12413
+ const prefix = changeType === "created" ? "+" : "-";
12414
+ const body = lines.length > 0 ? lines.map((line) => `${prefix}${line}`) : [`${prefix}`];
12415
+ const header = changeType === "created" ? [
12416
+ `diff --git a/${path} b/${path}`,
12417
+ "new file mode 100644",
12418
+ "--- /dev/null",
12419
+ `+++ b/${path}`,
12420
+ `@@ -0,0 +1,${count} @@`
12421
+ ] : [
12422
+ `diff --git a/${path} b/${path}`,
12423
+ "deleted file mode 100644",
12424
+ `--- a/${path}`,
12425
+ "+++ /dev/null",
12426
+ `@@ -1,${count} +0,0 @@`
12427
+ ];
12428
+ return ensureTrailingNewline([...header, ...body].join("\n"));
12429
+ }
12430
+ function modifiedFilePatch(path, oldContent, newContent) {
12431
+ const oldLines = splitPatchContentLines(oldContent);
12432
+ const newLines = splitPatchContentLines(newContent);
12433
+ const oldCount = Math.max(oldLines.length, 1);
12434
+ const newCount = Math.max(newLines.length, 1);
12435
+ return ensureTrailingNewline(
12436
+ [
12437
+ `diff --git a/${path} b/${path}`,
12438
+ `--- a/${path}`,
12439
+ `+++ b/${path}`,
12440
+ `@@ -1,${oldCount} +1,${newCount} @@`,
12441
+ ...oldLines.map((line) => `-${line}`),
12442
+ ...newLines.map((line) => `+${line}`)
12443
+ ].join("\n")
12444
+ );
12445
+ }
12446
+ function patchPathRelativeToCwd(path, cwd) {
12447
+ const normalizedPath = normalizePathForPatch(path);
12448
+ const normalizedCwd = normalizePathForPatch(cwd ?? "");
12449
+ if (normalizedPath.startsWith("/") && normalizedCwd && normalizedPath.startsWith(`${normalizedCwd}/`)) {
12450
+ return normalizedPath.slice(normalizedCwd.length + 1);
12451
+ }
12452
+ return normalizedPath.replace(/^\/+/, "");
12453
+ }
12454
+ function normalizePathForPatch(path) {
12455
+ return path.trim().replaceAll("\\", "/").replace(/\/+$/, "");
12456
+ }
12457
+ function looksLikeUnifiedDiff(value) {
12458
+ return value.startsWith("diff --git ") || value.startsWith("@@ ") || value.startsWith("--- ") || value.includes("\n@@ ");
12459
+ }
12460
+ function splitPatchContentLines(content) {
12461
+ if (!content) {
12462
+ return [];
12463
+ }
12464
+ return content.replace(/\r\n/g, "\n").replace(/\n$/, "").split("\n");
12465
+ }
12466
+ function ensureTrailingNewline(value) {
12467
+ return value.endsWith("\n") ? value : `${value}
12468
+ `;
12469
+ }
12470
+
12471
+ // shared/agentConversation/rules/agentTurnSummaryPatchRuntime.ts
12472
+ function fileCanBuildPatch(file) {
12473
+ return file.unifiedDiff != null || file.content != null || file.oldString != null || file.newString != null;
12474
+ }
12475
+ function patchBatchDirectoryCwd(cwd, changes) {
12476
+ const normalizedCwd = normalizePatchHostPath(cwd ?? "");
12477
+ if (!normalizedCwd) {
12478
+ return null;
12479
+ }
12480
+ const cwdIsChangedFilePath = changes.some(
12481
+ (change) => normalizePatchHostPath(change.path) === normalizedCwd
12482
+ );
12483
+ return cwdIsChangedFilePath ? dirnameForPatchHostPath(normalizedCwd) : cwd;
12484
+ }
12485
+ function resolvePatchExecutionCwd(cwd, workspaceRoot) {
12486
+ const normalizedCwd = normalizePatchHostPath(cwd ?? "");
12487
+ const normalizedRoot = normalizePatchHostPath(workspaceRoot ?? "");
12488
+ if (!normalizedCwd) {
12489
+ return normalizedRoot || null;
12490
+ }
12491
+ if (!normalizedRoot) {
12492
+ return normalizedCwd;
12493
+ }
12494
+ if (isSyntheticWorkspacePath(normalizedRoot)) {
12495
+ return normalizedCwd;
12496
+ }
12497
+ if (normalizedCwd === "/workspace") {
12498
+ return normalizedRoot;
12499
+ }
12500
+ if (normalizedCwd.startsWith("/workspace/")) {
12501
+ return `${normalizedRoot}/${normalizedCwd.slice("/workspace/".length)}`;
12502
+ }
12503
+ return normalizedCwd;
12504
+ }
12505
+ function resolvePatchDiffCwd({
12506
+ sourceCwd,
12507
+ executionCwd,
12508
+ changes
12509
+ }) {
12510
+ const normalizedSourceCwd = normalizePatchHostPath(sourceCwd ?? "");
12511
+ const normalizedExecutionCwd = normalizePatchHostPath(executionCwd ?? "");
12512
+ if (!isSyntheticWorkspacePath(normalizedSourceCwd) || !normalizedExecutionCwd) {
12513
+ return sourceCwd;
12514
+ }
12515
+ const hasSyntheticChangePath = changes.some(
12516
+ (change) => isInsideOrEqualPatchPath(
12517
+ normalizePatchHostPath(change.path),
12518
+ normalizedSourceCwd
12519
+ )
12520
+ );
12521
+ const hasHostChangePath = changes.some(
12522
+ (change) => isInsideOrEqualPatchPath(
12523
+ normalizePatchHostPath(change.path),
12524
+ normalizedExecutionCwd
12525
+ )
12526
+ );
12527
+ return hasHostChangePath && !hasSyntheticChangePath ? normalizedExecutionCwd : sourceCwd;
12528
+ }
12529
+ function normalizePatchHostPath(path) {
12530
+ return path.trim().replaceAll("\\", "/").replace(/\/+$/, "");
12531
+ }
12532
+ function dirnameForPatchHostPath(path) {
12533
+ const normalized = normalizePatchHostPath(path);
12534
+ const index = normalized.lastIndexOf("/");
12535
+ if (index < 0) {
12536
+ return "";
12537
+ }
12538
+ if (index === 0) {
12539
+ return "/";
12540
+ }
12541
+ return normalized.slice(0, index);
12542
+ }
12543
+ function isSyntheticWorkspacePath(path) {
12544
+ return path === "/workspace" || path.startsWith("/workspace/");
12545
+ }
12546
+ function isInsideOrEqualPatchPath(path, root) {
12547
+ return path === root || path.startsWith(`${root}/`);
12548
+ }
12549
+
11953
12550
  // shared/agentConversation/components/AgentTurnSummaryRow.tsx
11954
- import { jsx as jsx54, jsxs as jsxs41 } from "react/jsx-runtime";
12551
+ import { jsx as jsx55, jsxs as jsxs42 } from "react/jsx-runtime";
11955
12552
  function AgentTurnSummaryRow({
11956
12553
  row,
11957
12554
  workspaceRoot,
@@ -11962,33 +12559,205 @@ function AgentTurnSummaryRow({
11962
12559
  {}
11963
12560
  );
11964
12561
  const [showAllFiles, setShowAllFiles] = useState16(false);
12562
+ const [patchAction, setPatchAction] = useState16("undo");
12563
+ const [patchPending, setPatchPending] = useState16(false);
12564
+ const [patchSupportState, setPatchSupportState] = useState16(null);
12565
+ const agentHostApi = useOptionalAgentHostApi();
11965
12566
  const aggregateStats = useMemo5(
11966
12567
  () => summarizeRowDiff(row.files),
11967
12568
  [row.files]
11968
12569
  );
12570
+ const patchBatches = useMemo5(() => {
12571
+ const fileFallbackBatches = row.files.flatMap(
12572
+ (file) => fileCanBuildPatch(file) ? [
12573
+ {
12574
+ changes: [
12575
+ {
12576
+ path: file.path,
12577
+ changeType: file.changeType,
12578
+ unifiedDiff: file.unifiedDiff,
12579
+ oldString: file.oldString ?? null,
12580
+ newString: file.newString ?? null,
12581
+ content: file.content ?? null
12582
+ }
12583
+ ],
12584
+ cwd: fallbackPatchFileCwd(file.path, workspaceRoot),
12585
+ toolCallId: `${row.id}:${file.messageId}:unified-diff`
12586
+ }
12587
+ ] : []
12588
+ );
12589
+ const sourceBatches = row.patchBatches && row.patchBatches.length > 0 ? row.patchBatches : fileFallbackBatches;
12590
+ const batches = buildExecutablePatchBatches(sourceBatches, workspaceRoot);
12591
+ if (batches.length > 0 || sourceBatches === fileFallbackBatches) {
12592
+ return batches;
12593
+ }
12594
+ return buildExecutablePatchBatches(fileFallbackBatches, workspaceRoot);
12595
+ }, [row.files, row.id, row.patchBatches, workspaceRoot]);
12596
+ const canRenderPatchButton = Boolean(
12597
+ agentHostApi?.workspace.applyGitPatch && row.files.length > 0
12598
+ );
12599
+ const canApplyPatch = Boolean(
12600
+ agentHostApi?.workspace.applyGitPatch && patchBatches.length > 0
12601
+ );
12602
+ const patchSupportCwds = useMemo5(
12603
+ () => Array.from(new Set(patchBatches.map((batch) => batch.cwd))).sort(),
12604
+ [patchBatches]
12605
+ );
12606
+ const patchSupportKey = patchSupportCwds.join("\n");
12607
+ const resolveGitPatchSupport = agentHostApi?.workspace.resolveGitPatchSupport;
12608
+ useEffect10(() => {
12609
+ if (!resolveGitPatchSupport || patchSupportCwds.length === 0) {
12610
+ setPatchSupportState(null);
12611
+ return;
12612
+ }
12613
+ let disposed = false;
12614
+ setPatchSupportState({ key: patchSupportKey, status: "checking" });
12615
+ void (async () => {
12616
+ try {
12617
+ for (const cwd of patchSupportCwds) {
12618
+ const result = await resolveGitPatchSupport({ cwd });
12619
+ if (!result.supported) {
12620
+ if (!disposed) {
12621
+ setPatchSupportState({
12622
+ key: patchSupportKey,
12623
+ status: "unsupported"
12624
+ });
12625
+ }
12626
+ return;
12627
+ }
12628
+ }
12629
+ if (!disposed) {
12630
+ setPatchSupportState({ key: patchSupportKey, status: "supported" });
12631
+ }
12632
+ } catch {
12633
+ if (!disposed) {
12634
+ setPatchSupportState({ key: patchSupportKey, status: "supported" });
12635
+ }
12636
+ }
12637
+ })();
12638
+ return () => {
12639
+ disposed = true;
12640
+ };
12641
+ }, [patchSupportCwds, patchSupportKey, resolveGitPatchSupport]);
11969
12642
  const visibleFiles = row.files.slice(0, 3);
11970
12643
  const hiddenFiles = row.files.slice(3);
11971
12644
  const hiddenFileCount = hiddenFiles.length;
11972
- return /* @__PURE__ */ jsx54("section", { className: "workspace-agents-status-panel__detail-turn-summary", children: /* @__PURE__ */ jsxs41("div", { className: "agent-turn-summary-card w-full overflow-hidden rounded-[8px] text-[var(--text-primary)]", children: [
11973
- /* @__PURE__ */ jsx54("div", { className: "flex items-start gap-3 px-4 py-3", children: /* @__PURE__ */ jsx54("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs41("div", { className: "flex min-w-0 items-center gap-3", children: [
11974
- /* @__PURE__ */ jsx54("div", { className: "min-w-0 text-[15px] font-semibold leading-5 tracking-[0] text-[var(--text-primary)]", children: translate("agentHost.agentGui.turnSummaryFilesChanged", {
11975
- count: row.fileCount
11976
- }) }),
11977
- /* @__PURE__ */ jsxs41("div", { className: "inline-flex shrink-0 items-center gap-2.5 text-[11px] font-semibold", children: [
11978
- aggregateStats.added > 0 ? /* @__PURE__ */ jsxs41("span", { className: "workspace-agents-status-panel__detail-tool-diff-added", children: [
11979
- "+",
11980
- aggregateStats.added
11981
- ] }) : null,
11982
- aggregateStats.removed > 0 ? /* @__PURE__ */ jsxs41("span", { className: "workspace-agents-status-panel__detail-tool-diff-removed", children: [
11983
- "-",
11984
- aggregateStats.removed
11985
- ] }) : null
11986
- ] })
11987
- ] }) }) }),
11988
- /* @__PURE__ */ jsxs41("div", { className: "agent-turn-summary-card__list", children: [
12645
+ const patchActionLabel = patchAction === "undo" ? translate("agentHost.agentGui.turnSummaryUndo") : translate("agentHost.agentGui.turnSummaryReapply");
12646
+ const isPatchSupportChecking = Boolean(
12647
+ resolveGitPatchSupport && patchSupportCwds.length > 0 && (patchSupportState?.key !== patchSupportKey || patchSupportState.status === "checking")
12648
+ );
12649
+ const isPatchUnsupported = Boolean(
12650
+ patchSupportState?.key === patchSupportKey && patchSupportState.status === "unsupported"
12651
+ );
12652
+ const patchDisabledReason = isPatchUnsupported ? translate("agentHost.agentGui.turnSummaryGitRequired") : isPatchSupportChecking ? translate("agentHost.agentGui.turnSummaryCheckingGit") : !canApplyPatch ? translate("agentHost.agentGui.turnSummaryPatchUnavailable") : null;
12653
+ const isPatchActionDisabled = Boolean(
12654
+ patchPending || isPatchSupportChecking || isPatchUnsupported || !canApplyPatch
12655
+ );
12656
+ const handlePatchAction = async (event) => {
12657
+ event.stopPropagation();
12658
+ if (!agentHostApi?.workspace.applyGitPatch || isPatchActionDisabled) {
12659
+ return;
12660
+ }
12661
+ const orderedBatches = patchAction === "undo" ? [...patchBatches].reverse() : patchBatches;
12662
+ if (orderedBatches.length === 0) {
12663
+ return;
12664
+ }
12665
+ setPatchPending(true);
12666
+ let changed = false;
12667
+ const failureMessage = patchAction === "undo" ? translate("agentHost.agentGui.turnSummaryUndoFailed") : translate("agentHost.agentGui.turnSummaryReapplyFailed");
12668
+ try {
12669
+ for (const batch of orderedBatches) {
12670
+ const result = await agentHostApi.workspace.applyGitPatch({
12671
+ cwd: batch.cwd,
12672
+ diff: batch.diff,
12673
+ revert: patchAction === "undo"
12674
+ });
12675
+ if (result.status === "success" || result.appliedPaths.length > 0 || result.conflictedPaths.length > 0) {
12676
+ changed = true;
12677
+ }
12678
+ if (result.status !== "success") {
12679
+ showPatchFailureToast(agentHostApi, failureMessage);
12680
+ return;
12681
+ }
12682
+ }
12683
+ setPatchAction((current) => current === "undo" ? "reapply" : "undo");
12684
+ } catch {
12685
+ showPatchFailureToast(agentHostApi, failureMessage);
12686
+ } finally {
12687
+ setPatchPending(false);
12688
+ if (changed) {
12689
+ window.dispatchEvent(new CustomEvent("tutti-agent-git-patch-applied"));
12690
+ }
12691
+ }
12692
+ };
12693
+ return /* @__PURE__ */ jsx55("section", { className: "workspace-agents-status-panel__detail-turn-summary", children: /* @__PURE__ */ jsxs42("div", { className: "agent-turn-summary-card w-full overflow-hidden rounded-[8px] text-[var(--text-primary)]", children: [
12694
+ /* @__PURE__ */ jsxs42("div", { className: "flex items-start gap-3 px-4 py-3", children: [
12695
+ /* @__PURE__ */ jsx55("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs42("div", { className: "flex min-w-0 items-center gap-3", children: [
12696
+ /* @__PURE__ */ jsx55("div", { className: "min-w-0 text-[15px] font-semibold leading-5 tracking-[0] text-[var(--text-primary)]", children: translate("agentHost.agentGui.turnSummaryFilesChanged", {
12697
+ count: row.fileCount
12698
+ }) }),
12699
+ /* @__PURE__ */ jsxs42("div", { className: "inline-flex shrink-0 items-center gap-2.5 text-[11px] font-semibold", children: [
12700
+ aggregateStats.added > 0 ? /* @__PURE__ */ jsxs42("span", { className: "workspace-agents-status-panel__detail-tool-diff-added", children: [
12701
+ "+",
12702
+ aggregateStats.added
12703
+ ] }) : null,
12704
+ aggregateStats.removed > 0 ? /* @__PURE__ */ jsxs42("span", { className: "workspace-agents-status-panel__detail-tool-diff-removed", children: [
12705
+ "-",
12706
+ aggregateStats.removed
12707
+ ] }) : null
12708
+ ] })
12709
+ ] }) }),
12710
+ canRenderPatchButton ? /* @__PURE__ */ jsx55(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs42(Tooltip, { children: [
12711
+ /* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
12712
+ "span",
12713
+ {
12714
+ className: `inline-flex shrink-0 ${isPatchActionDisabled ? "cursor-not-allowed" : ""}`,
12715
+ children: /* @__PURE__ */ jsxs42(
12716
+ CanvasNodeGhostIconButton,
12717
+ {
12718
+ "aria-label": patchActionLabel,
12719
+ className: "w-auto min-w-0 gap-1.5 px-2 text-[12px] font-medium leading-4 disabled:pointer-events-none",
12720
+ disabled: isPatchActionDisabled,
12721
+ onClick: handlePatchAction,
12722
+ children: [
12723
+ patchPending || isPatchSupportChecking ? /* @__PURE__ */ jsx55(
12724
+ LoaderCircle2,
12725
+ {
12726
+ width: 14,
12727
+ height: 14,
12728
+ "aria-hidden": "true",
12729
+ className: "animate-spin text-[var(--text-secondary)]"
12730
+ }
12731
+ ) : patchAction === "undo" ? /* @__PURE__ */ jsx55(
12732
+ Undo2,
12733
+ {
12734
+ width: 14,
12735
+ height: 14,
12736
+ "aria-hidden": "true",
12737
+ className: "text-[var(--text-secondary)]"
12738
+ }
12739
+ ) : /* @__PURE__ */ jsx55(
12740
+ Redo2,
12741
+ {
12742
+ width: 14,
12743
+ height: 14,
12744
+ "aria-hidden": "true",
12745
+ className: "text-[var(--text-secondary)]"
12746
+ }
12747
+ ),
12748
+ /* @__PURE__ */ jsx55("span", { children: patchActionLabel })
12749
+ ]
12750
+ }
12751
+ )
12752
+ }
12753
+ ) }),
12754
+ patchDisabledReason ? /* @__PURE__ */ jsx55(TooltipContent, { className: "max-w-[260px] whitespace-normal text-left", children: patchDisabledReason }) : null
12755
+ ] }) }) : null
12756
+ ] }),
12757
+ /* @__PURE__ */ jsxs42("div", { className: "agent-turn-summary-card__list", children: [
11989
12758
  visibleFiles.map((file) => {
11990
12759
  const key = `${file.path}:${file.messageId}`;
11991
- return /* @__PURE__ */ jsx54(
12760
+ return /* @__PURE__ */ jsx55(
11992
12761
  TurnSummaryFileCard,
11993
12762
  {
11994
12763
  file,
@@ -12003,9 +12772,9 @@ function AgentTurnSummaryRow({
12003
12772
  key
12004
12773
  );
12005
12774
  }),
12006
- hiddenFileCount > 0 ? /* @__PURE__ */ jsx54(CollapsibleReveal, { expanded: showAllFiles, preMountOnIdle: true, children: /* @__PURE__ */ jsx54("div", { className: "agent-turn-summary-card__overflow-list", children: hiddenFiles.map((file) => {
12775
+ hiddenFileCount > 0 ? /* @__PURE__ */ jsx55(CollapsibleReveal, { expanded: showAllFiles, preMountOnIdle: true, children: /* @__PURE__ */ jsx55("div", { className: "agent-turn-summary-card__overflow-list", children: hiddenFiles.map((file) => {
12007
12776
  const key = `${file.path}:${file.messageId}`;
12008
- return /* @__PURE__ */ jsx54(
12777
+ return /* @__PURE__ */ jsx55(
12009
12778
  TurnSummaryFileCard,
12010
12779
  {
12011
12780
  file,
@@ -12020,28 +12789,28 @@ function AgentTurnSummaryRow({
12020
12789
  key
12021
12790
  );
12022
12791
  }) }) }) : null,
12023
- hiddenFileCount > 0 && !showAllFiles ? /* @__PURE__ */ jsxs41(
12792
+ hiddenFileCount > 0 && !showAllFiles ? /* @__PURE__ */ jsxs42(
12024
12793
  "button",
12025
12794
  {
12026
12795
  type: "button",
12027
12796
  className: "agent-turn-summary-card__toggle-more flex w-full items-center gap-2 px-4 py-2.5 text-left text-[11px] font-semibold transition-colors",
12028
12797
  onClick: () => setShowAllFiles(true),
12029
12798
  children: [
12030
- /* @__PURE__ */ jsx54("span", { children: translate("agentHost.agentGui.turnSummaryShowMoreFiles", {
12799
+ /* @__PURE__ */ jsx55("span", { children: translate("agentHost.agentGui.turnSummaryShowMoreFiles", {
12031
12800
  count: hiddenFileCount
12032
12801
  }) }),
12033
- /* @__PURE__ */ jsx54(ChevronDown7, { size: 16, strokeWidth: 2.2, "aria-hidden": "true" })
12802
+ /* @__PURE__ */ jsx55(ChevronDown7, { size: 16, strokeWidth: 2.2, "aria-hidden": "true" })
12034
12803
  ]
12035
12804
  }
12036
- ) : hiddenFileCount > 0 ? /* @__PURE__ */ jsxs41(
12805
+ ) : hiddenFileCount > 0 ? /* @__PURE__ */ jsxs42(
12037
12806
  "button",
12038
12807
  {
12039
12808
  type: "button",
12040
12809
  className: "agent-turn-summary-card__toggle-more flex w-full items-center gap-2 px-4 py-2.5 text-left text-[11px] font-semibold transition-colors",
12041
12810
  onClick: () => setShowAllFiles(false),
12042
12811
  children: [
12043
- /* @__PURE__ */ jsx54("span", { children: translate("agentHost.agentGui.turnSummaryShowFewerFiles") }),
12044
- /* @__PURE__ */ jsx54(
12812
+ /* @__PURE__ */ jsx55("span", { children: translate("agentHost.agentGui.turnSummaryShowFewerFiles") }),
12813
+ /* @__PURE__ */ jsx55(
12045
12814
  ChevronRight7,
12046
12815
  {
12047
12816
  size: 16,
@@ -12072,10 +12841,10 @@ function TurnSummaryFileCard({
12072
12841
  const canOpen = Boolean(action && onLinkAction);
12073
12842
  const stats = summarizeFileDiff(file);
12074
12843
  const preview = filePreview(file);
12075
- return /* @__PURE__ */ jsxs41("div", { className: "agent-turn-summary-card__file", children: [
12076
- /* @__PURE__ */ jsxs41("div", { className: "agent-turn-summary-card__file-row flex min-w-0 items-center gap-2.5 overflow-hidden px-4 py-2.5", children: [
12077
- /* @__PURE__ */ jsxs41("div", { className: "flex min-w-0 flex-1 items-center gap-2.5", children: [
12078
- /* @__PURE__ */ jsxs41(
12844
+ return /* @__PURE__ */ jsxs42("div", { className: "agent-turn-summary-card__file", children: [
12845
+ /* @__PURE__ */ jsxs42("div", { className: "agent-turn-summary-card__file-row flex min-w-0 items-center gap-2.5 overflow-hidden px-4 py-2.5", children: [
12846
+ /* @__PURE__ */ jsxs42("div", { className: "flex min-w-0 flex-1 items-center gap-2.5", children: [
12847
+ /* @__PURE__ */ jsxs42(
12079
12848
  "button",
12080
12849
  {
12081
12850
  type: "button",
@@ -12083,15 +12852,21 @@ function TurnSummaryFileCard({
12083
12852
  "aria-expanded": expanded,
12084
12853
  onClick: onToggle,
12085
12854
  children: [
12086
- /* @__PURE__ */ jsx54("div", { className: "min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ jsx54(
12855
+ /* @__PURE__ */ jsx55("div", { className: "min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ jsxs42(
12087
12856
  "span",
12088
12857
  {
12089
- className: `agent-turn-summary-card__path block min-w-0 truncate text-[13px] font-medium leading-5 text-[var(--text-secondary)] ${file.changeType === "deleted" ? "line-through" : ""}`,
12858
+ className: `agent-turn-summary-card__path flex min-w-0 max-w-full overflow-hidden whitespace-nowrap text-[13px] font-medium leading-5 text-[var(--text-secondary)] ${file.changeType === "deleted" ? "line-through" : ""}`,
12090
12859
  title: file.path,
12091
- children: file.path
12860
+ children: [
12861
+ file.directory ? /* @__PURE__ */ jsxs42("span", { className: "agent-turn-summary-card__path-directory", children: [
12862
+ file.directory,
12863
+ "/"
12864
+ ] }) : null,
12865
+ /* @__PURE__ */ jsx55("span", { className: "agent-turn-summary-card__path-file", children: file.fileName })
12866
+ ]
12092
12867
  }
12093
12868
  ) }),
12094
- /* @__PURE__ */ jsx54("span", { className: "shrink-0 text-[var(--text-tertiary)] opacity-0 transition-opacity group-hover/file-toggle:opacity-100 group-focus-visible/file-toggle:opacity-100", children: /* @__PURE__ */ jsx54(
12869
+ /* @__PURE__ */ jsx55("span", { className: "shrink-0 text-[var(--text-tertiary)] opacity-0 transition-opacity group-hover/file-toggle:opacity-100 group-focus-visible/file-toggle:opacity-100", children: /* @__PURE__ */ jsx55(
12095
12870
  ChevronRight7,
12096
12871
  {
12097
12872
  size: 14,
@@ -12103,18 +12878,18 @@ function TurnSummaryFileCard({
12103
12878
  ]
12104
12879
  }
12105
12880
  ),
12106
- /* @__PURE__ */ jsxs41("span", { className: "ml-auto inline-flex shrink-0 items-center gap-2 text-[11px] font-semibold", children: [
12107
- stats.added > 0 ? /* @__PURE__ */ jsxs41("span", { className: "workspace-agents-status-panel__detail-tool-diff-added", children: [
12881
+ /* @__PURE__ */ jsxs42("span", { className: "ml-auto inline-flex shrink-0 items-center gap-2 text-[11px] font-semibold", children: [
12882
+ stats.added > 0 ? /* @__PURE__ */ jsxs42("span", { className: "workspace-agents-status-panel__detail-tool-diff-added", children: [
12108
12883
  "+",
12109
12884
  stats.added
12110
12885
  ] }) : null,
12111
- stats.removed > 0 ? /* @__PURE__ */ jsxs41("span", { className: "workspace-agents-status-panel__detail-tool-diff-removed", children: [
12886
+ stats.removed > 0 ? /* @__PURE__ */ jsxs42("span", { className: "workspace-agents-status-panel__detail-tool-diff-removed", children: [
12112
12887
  "-",
12113
12888
  stats.removed
12114
12889
  ] }) : null
12115
12890
  ] })
12116
12891
  ] }),
12117
- canOpen ? /* @__PURE__ */ jsx54(
12892
+ canOpen ? /* @__PURE__ */ jsx55(
12118
12893
  CanvasNodeGhostIconButton,
12119
12894
  {
12120
12895
  "aria-label": translate(
@@ -12126,7 +12901,7 @@ function TurnSummaryFileCard({
12126
12901
  onClick: () => {
12127
12902
  onLinkAction?.(action);
12128
12903
  },
12129
- children: /* @__PURE__ */ jsx54(
12904
+ children: /* @__PURE__ */ jsx55(
12130
12905
  DirectLinedIcon,
12131
12906
  {
12132
12907
  width: 14,
@@ -12138,12 +12913,12 @@ function TurnSummaryFileCard({
12138
12913
  }
12139
12914
  ) : null
12140
12915
  ] }),
12141
- preview ? /* @__PURE__ */ jsx54(CollapsibleReveal, { expanded, preMountOnIdle: true, children: /* @__PURE__ */ jsx54("div", { className: "agent-turn-summary-card__preview rounded-none px-4 pb-3 pt-2", children: preview }) }) : null
12916
+ preview ? /* @__PURE__ */ jsx55(CollapsibleReveal, { expanded, preMountOnIdle: true, children: /* @__PURE__ */ jsx55("div", { className: "agent-turn-summary-card__preview rounded-none px-4 pb-3 pt-2", children: preview }) }) : null
12142
12917
  ] });
12143
12918
  }
12144
12919
  function filePreview(file) {
12145
12920
  if (file.changeType === "created" && file.content?.trim()) {
12146
- return /* @__PURE__ */ jsx54(
12921
+ return /* @__PURE__ */ jsx55(
12147
12922
  AgentCodeBlock,
12148
12923
  {
12149
12924
  path: file.path,
@@ -12155,7 +12930,7 @@ function filePreview(file) {
12155
12930
  );
12156
12931
  }
12157
12932
  if (file.unifiedDiff?.trim()) {
12158
- return /* @__PURE__ */ jsx54(
12933
+ return /* @__PURE__ */ jsx55(
12159
12934
  AgentUnifiedPatchViewer,
12160
12935
  {
12161
12936
  path: file.path,
@@ -12166,7 +12941,7 @@ function filePreview(file) {
12166
12941
  );
12167
12942
  }
12168
12943
  if (file.changeType === "created" && file.newString?.trim()) {
12169
- return /* @__PURE__ */ jsx54(
12944
+ return /* @__PURE__ */ jsx55(
12170
12945
  AgentCodeBlock,
12171
12946
  {
12172
12947
  path: file.path,
@@ -12178,7 +12953,7 @@ function filePreview(file) {
12178
12953
  );
12179
12954
  }
12180
12955
  if (file.oldString?.trim() || file.newString?.trim()) {
12181
- return /* @__PURE__ */ jsx54(
12956
+ return /* @__PURE__ */ jsx55(
12182
12957
  AgentMonacoDiffViewer,
12183
12958
  {
12184
12959
  path: file.path,
@@ -12190,7 +12965,7 @@ function filePreview(file) {
12190
12965
  );
12191
12966
  }
12192
12967
  if (file.content?.trim()) {
12193
- return /* @__PURE__ */ jsx54(
12968
+ return /* @__PURE__ */ jsx55(
12194
12969
  AgentCodeBlock,
12195
12970
  {
12196
12971
  path: file.path,
@@ -12215,6 +12990,47 @@ function summarizeRowDiff(files) {
12215
12990
  { added: 0, removed: 0 }
12216
12991
  );
12217
12992
  }
12993
+ function showPatchFailureToast(agentHostApi, message) {
12994
+ if (agentHostApi?.toast?.error) {
12995
+ agentHostApi.toast.error(message);
12996
+ return;
12997
+ }
12998
+ toast.error(message);
12999
+ }
13000
+ function buildExecutablePatchBatches(sourceBatches, workspaceRoot) {
13001
+ return sourceBatches.flatMap((batch) => {
13002
+ const sourceCwd = patchBatchDirectoryCwd(
13003
+ batch.cwd ?? workspaceRoot ?? null,
13004
+ batch.changes
13005
+ );
13006
+ const executionCwd = resolvePatchExecutionCwd(sourceCwd, workspaceRoot);
13007
+ const diffCwd = resolvePatchDiffCwd({
13008
+ executionCwd,
13009
+ sourceCwd,
13010
+ changes: batch.changes
13011
+ });
13012
+ const diff = buildAgentTurnSummaryPatchDiff({
13013
+ ...batch,
13014
+ cwd: diffCwd
13015
+ });
13016
+ return executionCwd && diff.trim() ? [{ cwd: executionCwd, diff }] : [];
13017
+ });
13018
+ }
13019
+ function fallbackPatchFileCwd(path, workspaceRoot) {
13020
+ const root = workspaceRoot?.trim() ?? "";
13021
+ if (root && root !== "/") {
13022
+ return root;
13023
+ }
13024
+ const normalizedPath = path.trim().replaceAll("\\", "/").replace(/\/+$/, "");
13025
+ if (!normalizedPath.startsWith("/")) {
13026
+ return root || null;
13027
+ }
13028
+ const index = normalizedPath.lastIndexOf("/");
13029
+ if (index <= 0) {
13030
+ return "/";
13031
+ }
13032
+ return normalizedPath.slice(0, index);
13033
+ }
12218
13034
  function summarizeFileDiff(file) {
12219
13035
  if (file.unifiedDiff?.trim()) {
12220
13036
  return parseAgentUnifiedDiffStats(file.unifiedDiff);
@@ -12241,7 +13057,7 @@ function summarizeFileDiff(file) {
12241
13057
  }
12242
13058
 
12243
13059
  // shared/agentConversation/components/AgentTranscriptItemView.tsx
12244
- import { jsx as jsx55 } from "react/jsx-runtime";
13060
+ import { jsx as jsx56 } from "react/jsx-runtime";
12245
13061
  var AgentTranscriptItemView = memo2(function AgentTranscriptItemView2({
12246
13062
  workspaceRoot,
12247
13063
  basePath,
@@ -12275,7 +13091,7 @@ var AgentTranscriptItemView = memo2(function AgentTranscriptItemView2({
12275
13091
  );
12276
13092
  switch (row.kind) {
12277
13093
  case "message":
12278
- return /* @__PURE__ */ jsx55(
13094
+ return /* @__PURE__ */ jsx56(
12279
13095
  AgentMessageBlock,
12280
13096
  {
12281
13097
  workspaceRoot,
@@ -12293,7 +13109,7 @@ var AgentTranscriptItemView = memo2(function AgentTranscriptItemView2({
12293
13109
  }
12294
13110
  );
12295
13111
  case "tool-group":
12296
- return /* @__PURE__ */ jsx55(
13112
+ return /* @__PURE__ */ jsx56(
12297
13113
  AgentToolGroupRow,
12298
13114
  {
12299
13115
  row,
@@ -12309,7 +13125,7 @@ var AgentTranscriptItemView = memo2(function AgentTranscriptItemView2({
12309
13125
  }
12310
13126
  );
12311
13127
  case "turn-summary":
12312
- return /* @__PURE__ */ jsx55(
13128
+ return /* @__PURE__ */ jsx56(
12313
13129
  AgentTurnSummaryRow,
12314
13130
  {
12315
13131
  row,
@@ -12320,7 +13136,7 @@ var AgentTranscriptItemView = memo2(function AgentTranscriptItemView2({
12320
13136
  }
12321
13137
  );
12322
13138
  case "processing":
12323
- return /* @__PURE__ */ jsx55(AgentProcessingRow, { row, label: labels.processing });
13139
+ return /* @__PURE__ */ jsx56(AgentProcessingRow, { row, label: labels.processing });
12324
13140
  }
12325
13141
  });
12326
13142
 
@@ -12441,7 +13257,7 @@ function looksLikeTableSeparator(line) {
12441
13257
  }
12442
13258
 
12443
13259
  // shared/agentConversation/components/AgentTranscriptView.tsx
12444
- import { Fragment as Fragment7, jsx as jsx56, jsxs as jsxs42 } from "react/jsx-runtime";
13260
+ import { Fragment as Fragment7, jsx as jsx57, jsxs as jsxs43 } from "react/jsx-runtime";
12445
13261
  var AGENT_TRANSCRIPT_VIRTUALIZATION_OVERSCAN = 6;
12446
13262
  var AGENT_TRANSCRIPT_ESTIMATED_TURN_HEIGHT_PX = 280;
12447
13263
  var AGENT_TRANSCRIPT_TURN_GAP_PX = 12;
@@ -12536,8 +13352,8 @@ var AgentTranscriptView = memo3(function AgentTranscriptView2({
12536
13352
  const rowKey = rowKeys[rowIndex] ?? transcriptRowKey(row);
12537
13353
  const showTurnDivider = dividerRowIndexes.has(rowIndex);
12538
13354
  const shouldAnimateEnter = row.kind !== "processing" && enteringRowKeys.has(rowKey);
12539
- return /* @__PURE__ */ jsxs42(Fragment6, { children: [
12540
- showTurnDivider ? /* @__PURE__ */ jsx56(
13355
+ return /* @__PURE__ */ jsxs43(Fragment6, { children: [
13356
+ showTurnDivider ? /* @__PURE__ */ jsx57(
12541
13357
  "div",
12542
13358
  {
12543
13359
  className: "h-px w-full flex-none bg-[var(--line-2,var(--tutti-line-2))]",
@@ -12545,14 +13361,14 @@ var AgentTranscriptView = memo3(function AgentTranscriptView2({
12545
13361
  "aria-hidden": "true"
12546
13362
  }
12547
13363
  ) : null,
12548
- /* @__PURE__ */ jsx56(
13364
+ /* @__PURE__ */ jsx57(
12549
13365
  "div",
12550
13366
  {
12551
13367
  className: "agent-gui-transcript-row",
12552
13368
  "data-agent-transcript-row": rowKey,
12553
13369
  "data-agent-transcript-row-kind": row.kind,
12554
13370
  "data-agent-transcript-row-enter": shouldAnimateEnter ? "true" : void 0,
12555
- children: /* @__PURE__ */ jsx56(
13371
+ children: /* @__PURE__ */ jsx57(
12556
13372
  AgentTranscriptItemView,
12557
13373
  {
12558
13374
  workspaceRoot,
@@ -12587,7 +13403,7 @@ var AgentTranscriptView = memo3(function AgentTranscriptView2({
12587
13403
  AGENT_TRANSCRIPT_FALLBACK_TURN_COUNT
12588
13404
  ) + fallbackIndex) * AGENT_TRANSCRIPT_ESTIMATED_TURN_HEIGHT_PX
12589
13405
  })) : rowVirtualizer.getVirtualItems();
12590
- return /* @__PURE__ */ jsx56(
13406
+ return /* @__PURE__ */ jsx57(
12591
13407
  "div",
12592
13408
  {
12593
13409
  ref: virtualizerHostRef,
@@ -12599,7 +13415,7 @@ var AgentTranscriptView = memo3(function AgentTranscriptView2({
12599
13415
  if (!group) {
12600
13416
  return null;
12601
13417
  }
12602
- return /* @__PURE__ */ jsx56(
13418
+ return /* @__PURE__ */ jsx57(
12603
13419
  "div",
12604
13420
  {
12605
13421
  ref: rowVirtualizer.measureElement,
@@ -12618,7 +13434,7 @@ var AgentTranscriptView = memo3(function AgentTranscriptView2({
12618
13434
  }
12619
13435
  );
12620
13436
  }
12621
- return /* @__PURE__ */ jsx56(Fragment7, { children: conversation.rows.map(renderRow) });
13437
+ return /* @__PURE__ */ jsx57(Fragment7, { children: conversation.rows.map(renderRow) });
12622
13438
  }, areAgentTranscriptViewPropsEqual);
12623
13439
  function useEnteringTranscriptRows(rowKeys) {
12624
13440
  const previousKeysRef = useRef8(null);
@@ -12679,7 +13495,7 @@ function findTurnDividerRowIndexes(turnIndexById, rows) {
12679
13495
 
12680
13496
  // shared/agentConversation/components/AgentConversationFlow.tsx
12681
13497
  import { memo as memo4 } from "react";
12682
- import { Fragment as Fragment8, jsx as jsx57 } from "react/jsx-runtime";
13498
+ import { Fragment as Fragment8, jsx as jsx58 } from "react/jsx-runtime";
12683
13499
  var AgentConversationFlow = memo4(function AgentConversationFlow2({
12684
13500
  conversation,
12685
13501
  isLoading,
@@ -12696,12 +13512,12 @@ var AgentConversationFlow = memo4(function AgentConversationFlow2({
12696
13512
  }) {
12697
13513
  "use memo";
12698
13514
  if (isLoading) {
12699
- return /* @__PURE__ */ jsx57(AgentTranscriptSkeleton, { label: loadingLabel, testId: loadingTestId });
13515
+ return /* @__PURE__ */ jsx58(AgentTranscriptSkeleton, { label: loadingLabel, testId: loadingTestId });
12700
13516
  }
12701
13517
  if (!conversation || conversation.rows.length === 0) {
12702
- return /* @__PURE__ */ jsx57(Fragment8, { children: empty });
13518
+ return /* @__PURE__ */ jsx58(Fragment8, { children: empty });
12703
13519
  }
12704
- return /* @__PURE__ */ jsx57(
13520
+ return /* @__PURE__ */ jsx58(
12705
13521
  AgentTranscriptView,
12706
13522
  {
12707
13523
  conversation,
@@ -12745,6 +13561,8 @@ function useProjectedAgentConversation({
12745
13561
  }
12746
13562
 
12747
13563
  export {
13564
+ getAppErrorCode,
13565
+ toLocalShortDateTime,
12748
13566
  Button,
12749
13567
  buildWorkspaceAgentSessionDetailViewModel,
12750
13568
  projectAgentConversationVM,
@@ -12764,4 +13582,4 @@ export {
12764
13582
  AgentConversationFlow,
12765
13583
  useProjectedAgentConversation
12766
13584
  };
12767
- //# sourceMappingURL=chunk-BAQTM6VS.js.map
13585
+ //# sourceMappingURL=chunk-LWMC2YA3.js.map