@tutti-os/agent-gui 0.0.99 → 0.0.101

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 (95) hide show
  1. package/dist/{AgentGUI-Bkk2TRS0.d.ts → AgentGUI-FECh2x1p.d.ts} +19 -37
  2. package/dist/agent-conversation/index.d.ts +4 -4
  3. package/dist/agent-conversation/index.js +8 -9
  4. package/dist/agent-conversation/index.js.map +1 -1
  5. package/dist/agent-gui.d.ts +5 -4
  6. package/dist/agent-gui.js +19 -19
  7. package/dist/agent-message-center/index.d.ts +4 -6
  8. package/dist/agent-message-center/index.js +13 -52
  9. package/dist/agent-message-center/index.js.map +1 -1
  10. package/dist/agent-title-text.js +1 -1
  11. package/dist/{agentConversationVM-C335TR6S.d.ts → agentConversationVM-BzHZhwFP.d.ts} +1 -1
  12. package/dist/{agentGuiNodeTypes-DAsluxjv.d.ts → agentGuiNodeTypes-BH3lz6gn.d.ts} +21 -5
  13. package/dist/app/renderer/agentactivity.css +142 -72
  14. package/dist/chunk-2RQM7PJN.js +16 -0
  15. package/dist/chunk-2RQM7PJN.js.map +1 -0
  16. package/dist/{chunk-FSKGEGGX.js → chunk-4E3QCW6L.js} +17 -3
  17. package/dist/chunk-4E3QCW6L.js.map +1 -0
  18. package/dist/{chunk-63BE6RGM.js → chunk-4YCCATI4.js} +14 -374
  19. package/dist/chunk-4YCCATI4.js.map +1 -0
  20. package/dist/{chunk-IYEXLOUE.js → chunk-4YVKAPKW.js} +5 -8
  21. package/dist/chunk-4YVKAPKW.js.map +1 -0
  22. package/dist/{chunk-MRRICFWA.js → chunk-D7HMQLBO.js} +159 -55
  23. package/dist/chunk-D7HMQLBO.js.map +1 -0
  24. package/dist/{chunk-OTRZBTFQ.js → chunk-DWUVRWXD.js} +2 -2
  25. package/dist/{chunk-RHTZAODZ.js → chunk-E5AD46HP.js} +2 -2
  26. package/dist/{chunk-3NOJFKDV.js → chunk-EUW6VPIK.js} +414 -49
  27. package/dist/chunk-EUW6VPIK.js.map +1 -0
  28. package/dist/{chunk-Y35GDLP2.js → chunk-F5UR6EJG.js} +2 -17
  29. package/dist/chunk-F5UR6EJG.js.map +1 -0
  30. package/dist/{chunk-J7ZYAUPC.js → chunk-FAE7CXZO.js} +8 -6
  31. package/dist/chunk-FAE7CXZO.js.map +1 -0
  32. package/dist/{chunk-CPUEPDF7.js → chunk-GCW57WYQ.js} +646 -595
  33. package/dist/chunk-GCW57WYQ.js.map +1 -0
  34. package/dist/{chunk-4ROALW3K.js → chunk-KAV2WHTG.js} +82 -61
  35. package/dist/chunk-KAV2WHTG.js.map +1 -0
  36. package/dist/chunk-MIJXEELH.js +96 -0
  37. package/dist/chunk-MIJXEELH.js.map +1 -0
  38. package/dist/{chunk-T6PEJFRP.js → chunk-MJOQP2ED.js} +392 -452
  39. package/dist/chunk-MJOQP2ED.js.map +1 -0
  40. package/dist/{chunk-QWGJ5TEG.js → chunk-QY22OBJS.js} +28 -30
  41. package/dist/chunk-QY22OBJS.js.map +1 -0
  42. package/dist/{chunk-SPZJCTBV.js → chunk-TDVYZEUI.js} +348 -322
  43. package/dist/chunk-TDVYZEUI.js.map +1 -0
  44. package/dist/{chunk-MASXZENX.js → chunk-UESYITH6.js} +21 -2
  45. package/dist/chunk-UESYITH6.js.map +1 -0
  46. package/dist/{chunk-PLCHNOXL.js → chunk-VQOPBBBI.js} +1288 -1141
  47. package/dist/chunk-VQOPBBBI.js.map +1 -0
  48. package/dist/{chunk-7M77BK6K.js → chunk-ZPKPIHMZ.js} +196 -156
  49. package/dist/chunk-ZPKPIHMZ.js.map +1 -0
  50. package/dist/context-mention-palette/index.d.ts +5 -1
  51. package/dist/context-mention-palette/index.js +10 -11
  52. package/dist/contribution-CTVBPN0R.d.ts +119 -0
  53. package/dist/i18n/index.d.ts +16 -2
  54. package/dist/i18n/index.js +2 -2
  55. package/dist/index.d.ts +8 -7
  56. package/dist/index.js +21 -20
  57. package/dist/index.js.map +1 -1
  58. package/dist/mention-search.d.ts +18 -6
  59. package/dist/mention-search.js +8 -9
  60. package/dist/workbench/contribution.d.ts +6 -107
  61. package/dist/workbench/contribution.js +7 -3
  62. package/dist/workbench/index.d.ts +6 -4
  63. package/dist/workbench/index.js +27 -21
  64. package/dist/workbench/launch.d.ts +13 -5
  65. package/dist/workbench/launch.js +1 -1
  66. package/dist/workbench/sessionTitle.d.ts +5 -7
  67. package/dist/workbench/sessionTitle.js +3 -4
  68. package/dist/workbench/state.js +3 -1
  69. package/dist/workspace-agent-generated-files.d.ts +8 -13
  70. package/dist/workspace-agent-generated-files.js +6 -21
  71. package/dist/{workspaceAgentActivityListTypes-C7gPWYiA.d.ts → workspaceAgentActivityListTypes-DZfS_HgG.d.ts} +3 -26
  72. package/package.json +14 -14
  73. package/dist/chunk-3NOJFKDV.js.map +0 -1
  74. package/dist/chunk-4ROALW3K.js.map +0 -1
  75. package/dist/chunk-63BE6RGM.js.map +0 -1
  76. package/dist/chunk-7M77BK6K.js.map +0 -1
  77. package/dist/chunk-CPUEPDF7.js.map +0 -1
  78. package/dist/chunk-FSKGEGGX.js.map +0 -1
  79. package/dist/chunk-GAD6Y3BF.js +0 -88
  80. package/dist/chunk-GAD6Y3BF.js.map +0 -1
  81. package/dist/chunk-GCBDIQDX.js +0 -22
  82. package/dist/chunk-GCBDIQDX.js.map +0 -1
  83. package/dist/chunk-IYEXLOUE.js.map +0 -1
  84. package/dist/chunk-J7ZYAUPC.js.map +0 -1
  85. package/dist/chunk-MASXZENX.js.map +0 -1
  86. package/dist/chunk-MRRICFWA.js.map +0 -1
  87. package/dist/chunk-PLCHNOXL.js.map +0 -1
  88. package/dist/chunk-QWGJ5TEG.js.map +0 -1
  89. package/dist/chunk-SPZJCTBV.js.map +0 -1
  90. package/dist/chunk-T6PEJFRP.js.map +0 -1
  91. package/dist/chunk-Y35GDLP2.js.map +0 -1
  92. package/dist/chunk-Y5M6Q6WX.js +0 -25
  93. package/dist/chunk-Y5M6Q6WX.js.map +0 -1
  94. /package/dist/{chunk-OTRZBTFQ.js.map → chunk-DWUVRWXD.js.map} +0 -0
  95. /package/dist/{chunk-RHTZAODZ.js.map → chunk-E5AD46HP.js.map} +0 -0
@@ -13,15 +13,15 @@ import {
13
13
  attrsToMentionItem,
14
14
  createAgentFileMentionExtension,
15
15
  formatAgentMentionMarkdown,
16
+ isWorkspaceAgentSyntheticControlMessage,
16
17
  mentionItemToAttrs,
17
18
  parseAgentMentionMarkdown
18
- } from "./chunk-CPUEPDF7.js";
19
+ } from "./chunk-GCW57WYQ.js";
19
20
  import {
20
21
  fileChangeCountFromChanges,
21
22
  fileChangeEntriesFromChanges,
22
- fileChangeTypeValue,
23
- isWorkspaceAgentSyntheticControlMessage
24
- } from "./chunk-Y35GDLP2.js";
23
+ fileChangeTypeValue
24
+ } from "./chunk-F5UR6EJG.js";
25
25
  import {
26
26
  AgentGUIConversation_styles_default,
27
27
  AgentMessageMarkdown,
@@ -39,21 +39,19 @@ import {
39
39
  resolveWorkspaceFilePathCandidate,
40
40
  resolveWorkspaceLinkAction,
41
41
  useAgentTargetPresentations
42
- } from "./chunk-T6PEJFRP.js";
42
+ } from "./chunk-MJOQP2ED.js";
43
43
  import {
44
44
  useOptionalAgentActivityRuntime,
45
- useOptionalAgentHostApi
46
- } from "./chunk-MASXZENX.js";
47
- import {
45
+ useOptionalAgentHostApi,
48
46
  workspaceAgentProviderLabel
49
- } from "./chunk-Y5M6Q6WX.js";
47
+ } from "./chunk-UESYITH6.js";
50
48
  import {
51
49
  normalizeAgentTitleText
52
- } from "./chunk-GCBDIQDX.js";
50
+ } from "./chunk-MIJXEELH.js";
53
51
  import {
54
52
  getActiveUiLanguage,
55
53
  translate
56
- } from "./chunk-RHTZAODZ.js";
54
+ } from "./chunk-E5AD46HP.js";
57
55
 
58
56
  // shared/imageGenerationTool.ts
59
57
  var KNOWN_IMAGE_GENERATION_TOOL_NAMES = /* @__PURE__ */ new Set([
@@ -1432,6 +1430,17 @@ function stripReviewProcessSummaryTitle(body) {
1432
1430
  function normalizedMessageBody(body) {
1433
1431
  return body.trim().replace(/\s+/g, " ");
1434
1432
  }
1433
+ function userMessageProjectionKey(item, body) {
1434
+ const normalizedBody = normalizedMessageBody(body);
1435
+ if (normalizedBody) {
1436
+ return `text:${normalizedBody}`;
1437
+ }
1438
+ if (!hasRenderableUserPromptContent(item.payload?.content)) {
1439
+ return null;
1440
+ }
1441
+ const clientSubmitId = stringRecordValue4(item.payload, "clientSubmitId");
1442
+ return clientSubmitId ? `client-submit:${clientSubmitId}` : `event:${item.eventId}`;
1443
+ }
1435
1444
  function isRecentDuplicateUserMessage(previous, current) {
1436
1445
  if (!previous) {
1437
1446
  return false;
@@ -1456,6 +1465,21 @@ function isRecentDuplicateUserMessage(previous, current) {
1456
1465
  }
1457
1466
  return false;
1458
1467
  }
1468
+ function hasRenderableUserPromptContent(content) {
1469
+ if (!Array.isArray(content)) {
1470
+ return false;
1471
+ }
1472
+ return content.some((candidate) => {
1473
+ if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) {
1474
+ return false;
1475
+ }
1476
+ const block = candidate;
1477
+ if (block.type === "text") {
1478
+ return typeof block.text === "string" && block.text.trim().length > 0;
1479
+ }
1480
+ return block.type === "image" && typeof block.mimeType === "string" && block.mimeType.trim().length > 0;
1481
+ });
1482
+ }
1459
1483
  function stringRecordValue4(record, key) {
1460
1484
  if (!record || typeof record !== "object") {
1461
1485
  return null;
@@ -2217,11 +2241,12 @@ function buildCanonicalWorkspaceAgentDetailView({
2217
2241
  const explicitTurnId = item.turnId?.trim();
2218
2242
  if (role === "user") {
2219
2243
  const turnId2 = explicitTurnId || `seq:${item.seq || item.id}`;
2220
- if (!body) {
2244
+ const projectionKey = userMessageProjectionKey(item, body);
2245
+ if (!projectionKey) {
2221
2246
  continue;
2222
2247
  }
2223
2248
  if (isRecentDuplicateUserMessage(
2224
- recentUserMessages.get(normalizedMessageBody(body)),
2249
+ recentUserMessages.get(projectionKey),
2225
2250
  item
2226
2251
  )) {
2227
2252
  continue;
@@ -2239,7 +2264,7 @@ function buildCanonicalWorkspaceAgentDetailView({
2239
2264
  );
2240
2265
  turn2.userMessages.push(message);
2241
2266
  turn2.userMessage ??= message;
2242
- recentUserMessages.set(normalizedMessageBody(body), item);
2267
+ recentUserMessages.set(projectionKey, item);
2243
2268
  continue;
2244
2269
  }
2245
2270
  const turnId = explicitTurnId || activeSequenceTurnId || `seq:${item.seq || item.id}`;
@@ -2930,6 +2955,122 @@ function dedupeStrings(values) {
2930
2955
  return [...new Set(values.map((value) => value.trim()).filter(Boolean))];
2931
2956
  }
2932
2957
 
2958
+ // shared/agentConversation/projection/agentToolRendererKind.ts
2959
+ function resolveAgentToolRendererKind(call, approval = null, askUserQuestion = null, planMode = null, task = null) {
2960
+ const normalizedToolName = normalizeToolName3(call.toolName);
2961
+ const normalizedCallType = normalizeCallType(call.callType);
2962
+ if (approval) {
2963
+ return "approval";
2964
+ }
2965
+ if (askUserQuestion) {
2966
+ return "ask-user";
2967
+ }
2968
+ if (normalizedToolName === "askuserquestion") {
2969
+ return "ask-user";
2970
+ }
2971
+ if (planMode?.kind === "enter") {
2972
+ return "plan-enter";
2973
+ }
2974
+ if (normalizedToolName === "enterplanmode") {
2975
+ return "plan-enter";
2976
+ }
2977
+ if (planMode?.kind === "exit") {
2978
+ return "plan-exit";
2979
+ }
2980
+ if (normalizedToolName === "exitplanmode") {
2981
+ return "plan-exit";
2982
+ }
2983
+ if (normalizedCallType === "approval" || normalizedToolName === "approval") {
2984
+ return "approval";
2985
+ }
2986
+ if (task) {
2987
+ return "task";
2988
+ }
2989
+ if (["task", "subagent", "delegatetask", "delegateagent", "agent"].includes(
2990
+ normalizedToolName
2991
+ )) {
2992
+ return "task";
2993
+ }
2994
+ if (isImageGenerationToolCall({
2995
+ toolName: call.toolName,
2996
+ displayName: call.displayName,
2997
+ content: call.content,
2998
+ outputContent: call.output?.content,
2999
+ inputPrompt: call.input?.prompt
3000
+ })) {
3001
+ return "image-generation";
3002
+ }
3003
+ switch (normalizedToolName) {
3004
+ case "read":
3005
+ case "readfile":
3006
+ return "read";
3007
+ case "write":
3008
+ case "writefile":
3009
+ return "write";
3010
+ case "edit":
3011
+ case "editfile":
3012
+ case "multiedit":
3013
+ return "edit";
3014
+ case "bash":
3015
+ case "shell":
3016
+ case "exec":
3017
+ case "execcommand":
3018
+ return "bash";
3019
+ case "grep":
3020
+ case "glob":
3021
+ case "search":
3022
+ case "searchfiles":
3023
+ return "search";
3024
+ case "websearch":
3025
+ return "web-search";
3026
+ case "webfetch":
3027
+ return "web-fetch";
3028
+ case "todowrite":
3029
+ return "todo-write";
3030
+ case "toolsearch":
3031
+ return "tool-search";
3032
+ case "skill":
3033
+ return "skill";
3034
+ default:
3035
+ if (normalizedCallType === "mcp" || normalizedToolName.startsWith("mcp") || hasMcpMetadata(call.metadata)) {
3036
+ return "mcp";
3037
+ }
3038
+ return "default";
3039
+ }
3040
+ }
3041
+ function inferToolCallType(toolName) {
3042
+ const normalizedToolName = normalizeToolName3(toolName);
3043
+ if (normalizedToolName === "approval") {
3044
+ return "approval";
3045
+ }
3046
+ if (["askuserquestion", "enterplanmode", "exitplanmode"].includes(
3047
+ normalizedToolName
3048
+ )) {
3049
+ return "interactive";
3050
+ }
3051
+ if (normalizedToolName.startsWith("mcp")) {
3052
+ return "mcp";
3053
+ }
3054
+ return "tool";
3055
+ }
3056
+ function isApprovalToolCall(call) {
3057
+ return normalizeCallType(call.callType) === "approval" || normalizeToolName3(call.toolName) === "approval";
3058
+ }
3059
+ function normalizeToolName3(value) {
3060
+ return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
3061
+ }
3062
+ function hasMcpMetadata(metadata) {
3063
+ return Boolean(
3064
+ stringValue3(metadata?.server) ?? stringValue3(metadata?.serverName) ?? stringValue3(metadata?.mcpServer)
3065
+ );
3066
+ }
3067
+ function normalizeCallType(value) {
3068
+ return (value ?? "").trim().toLowerCase();
3069
+ }
3070
+ function stringValue3(value) {
3071
+ return typeof value === "string" && value.trim() ? value.trim() : null;
3072
+ }
3073
+
2933
3074
  // shared/agentConversation/projection/agentApprovalProjection.ts
2934
3075
  function projectAgentApprovalItem(call, input, output) {
2935
3076
  const callType = normalizeToken(call.callType);
@@ -2937,7 +3078,7 @@ function projectAgentApprovalItem(call, input, output) {
2937
3078
  if (callType !== "approval" && toolName !== "approval") {
2938
3079
  return null;
2939
3080
  }
2940
- const requestId = stringValue3(input?.requestId) ?? stringValue3(call.payload?.requestId) ?? stringValue3(output?.requestId);
3081
+ const requestId = stringValue4(input?.requestId) ?? stringValue4(call.payload?.requestId) ?? stringValue4(output?.requestId);
2941
3082
  if (!requestId) {
2942
3083
  return null;
2943
3084
  }
@@ -2961,7 +3102,7 @@ function projectAgentApprovalItem(call, input, output) {
2961
3102
  callId: call.id.replace(/^call:/, ""),
2962
3103
  title: mcpTarget?.displayName ?? (call.summary.trim() || call.name),
2963
3104
  toolName: call.toolName,
2964
- status: stringValue3(call.payload?.status) ?? call.status,
3105
+ status: stringValue4(call.payload?.status) ?? call.status,
2965
3106
  input,
2966
3107
  options,
2967
3108
  output,
@@ -2971,17 +3112,17 @@ function projectAgentApprovalItem(call, input, output) {
2971
3112
  function normalizeApprovalOptions(values) {
2972
3113
  return values.flatMap((value) => {
2973
3114
  const option = objectValue(value);
2974
- const id = stringValue3(option?.optionId) ?? stringValue3(option?.id);
3115
+ const id = stringValue4(option?.optionId) ?? stringValue4(option?.id);
2975
3116
  if (!id) {
2976
3117
  return [];
2977
3118
  }
2978
- const label = stringValue3(option?.name) ?? stringValue3(option?.label) ?? stringValue3(option?.title) ?? stringValue3(option?.kind) ?? id;
3119
+ const label = stringValue4(option?.name) ?? stringValue4(option?.label) ?? stringValue4(option?.title) ?? stringValue4(option?.kind) ?? id;
2979
3120
  return [
2980
3121
  {
2981
3122
  id,
2982
3123
  label,
2983
- kind: stringValue3(option?.kind) ?? "",
2984
- ...stringValue3(option?.description) ? { description: stringValue3(option?.description) } : {}
3124
+ kind: stringValue4(option?.kind) ?? "",
3125
+ ...stringValue4(option?.description) ? { description: stringValue4(option?.description) } : {}
2985
3126
  }
2986
3127
  ];
2987
3128
  });
@@ -2989,7 +3130,7 @@ function normalizeApprovalOptions(values) {
2989
3130
  function normalizeToken(value) {
2990
3131
  return (value ?? "").trim().toLowerCase();
2991
3132
  }
2992
- function stringValue3(value) {
3133
+ function stringValue4(value) {
2993
3134
  return typeof value === "string" && value.trim() ? value.trim() : null;
2994
3135
  }
2995
3136
  function objectValue(value) {
@@ -3001,7 +3142,7 @@ function arrayValue(value) {
3001
3142
 
3002
3143
  // shared/agentConversation/projection/agentInteractiveProjection.ts
3003
3144
  function projectAgentAskUserQuestionItem(call, input, output) {
3004
- if (normalizeToolName3(call.toolName) !== "askuserquestion") {
3145
+ if (normalizeToolName4(call.toolName) !== "askuserquestion") {
3005
3146
  return null;
3006
3147
  }
3007
3148
  const questions = normalizeAskUserQuestions(input?.questions);
@@ -3013,7 +3154,7 @@ function projectAgentAskUserQuestionItem(call, input, output) {
3013
3154
  kind: "ask-user",
3014
3155
  id: call.id,
3015
3156
  turnId: call.turnId ?? "turn:unknown",
3016
- requestId: stringValue4(input?.requestId) ?? stringValue4(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
3157
+ requestId: stringValue5(input?.requestId) ?? stringValue5(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
3017
3158
  title: call.name,
3018
3159
  status: call.status,
3019
3160
  questions: questions.map((question) => ({
@@ -3029,18 +3170,18 @@ function projectAgentPlanModeItem(call, input) {
3029
3170
  itemKind: "plan-mode",
3030
3171
  id: call.id,
3031
3172
  turnId: call.turnId ?? "turn:unknown",
3032
- requestId: stringValue4(input?.requestId) ?? stringValue4(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
3173
+ requestId: stringValue5(input?.requestId) ?? stringValue5(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
3033
3174
  kind: "exit",
3034
- title: stringValue4(objectValue2(input?.toolCall)?.title) ?? call.name,
3175
+ title: stringValue5(objectValue2(input?.toolCall)?.title) ?? call.name,
3035
3176
  status: call.status,
3036
- plan: stringValue4(input?.plan) ?? stringValue4(call.payload?.plan) ?? (call.summary.trim() || null),
3037
- filePath: stringValue4(input?.filePath) ?? stringValue4(call.payload?.filePath),
3177
+ plan: stringValue5(input?.plan) ?? stringValue5(call.payload?.plan) ?? (call.summary.trim() || null),
3178
+ filePath: stringValue5(input?.filePath) ?? stringValue5(call.payload?.filePath),
3038
3179
  options: extractExitPlanModeOptions(input),
3039
3180
  ...keepPlanningOption(extractExitPlanKeepPlanningOptionId(input)),
3040
3181
  occurredAtUnixMs: call.occurredAtUnixMs ?? null
3041
3182
  };
3042
3183
  }
3043
- const toolName = normalizeToolName3(call.toolName);
3184
+ const toolName = normalizeToolName4(call.toolName);
3044
3185
  if (toolName === "enterplanmode") {
3045
3186
  return {
3046
3187
  itemKind: "plan-mode",
@@ -3049,8 +3190,8 @@ function projectAgentPlanModeItem(call, input) {
3049
3190
  kind: "enter",
3050
3191
  title: call.name,
3051
3192
  status: call.status,
3052
- plan: stringValue4(input?.content) ?? (call.summary.trim() || null),
3053
- filePath: stringValue4(input?.filePath),
3193
+ plan: stringValue5(input?.content) ?? (call.summary.trim() || null),
3194
+ filePath: stringValue5(input?.filePath),
3054
3195
  occurredAtUnixMs: call.occurredAtUnixMs ?? null
3055
3196
  };
3056
3197
  }
@@ -3061,12 +3202,12 @@ function projectAgentPlanModeItem(call, input) {
3061
3202
  itemKind: "plan-mode",
3062
3203
  id: call.id,
3063
3204
  turnId: call.turnId ?? "turn:unknown",
3064
- requestId: stringValue4(input?.requestId) ?? stringValue4(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
3205
+ requestId: stringValue5(input?.requestId) ?? stringValue5(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
3065
3206
  kind: "exit",
3066
3207
  title: call.name,
3067
3208
  status: call.status,
3068
- plan: stringValue4(input?.plan) ?? stringValue4(call.payload?.plan) ?? (call.summary.trim() || null),
3069
- filePath: stringValue4(input?.filePath) ?? stringValue4(call.payload?.filePath),
3209
+ plan: stringValue5(input?.plan) ?? stringValue5(call.payload?.plan) ?? (call.summary.trim() || null),
3210
+ filePath: stringValue5(input?.filePath) ?? stringValue5(call.payload?.filePath),
3070
3211
  occurredAtUnixMs: call.occurredAtUnixMs ?? null
3071
3212
  };
3072
3213
  }
@@ -3088,10 +3229,10 @@ function answerForQuestion(questionId, answersByQuestionId, output) {
3088
3229
  function keepPlanningOption(optionId) {
3089
3230
  return optionId ? { keepPlanningOptionId: optionId } : {};
3090
3231
  }
3091
- function normalizeToolName3(value) {
3232
+ function normalizeToolName4(value) {
3092
3233
  return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
3093
3234
  }
3094
- function stringValue4(value) {
3235
+ function stringValue5(value) {
3095
3236
  return typeof value === "string" && value.trim() ? value.trim() : null;
3096
3237
  }
3097
3238
  function objectValue2(value) {
@@ -3101,122 +3242,9 @@ function arrayValue2(value) {
3101
3242
  return Array.isArray(value) ? value : null;
3102
3243
  }
3103
3244
 
3104
- // shared/agentConversation/projection/agentToolRendererKind.ts
3105
- function resolveAgentToolRendererKind(call, approval = null, askUserQuestion = null, planMode = null, task = null) {
3106
- const normalizedToolName = normalizeToolName4(call.toolName);
3107
- const normalizedCallType = normalizeCallType(call.callType);
3108
- if (approval) {
3109
- return "approval";
3110
- }
3111
- if (askUserQuestion) {
3112
- return "ask-user";
3113
- }
3114
- if (normalizedToolName === "askuserquestion") {
3115
- return "ask-user";
3116
- }
3117
- if (planMode?.kind === "enter") {
3118
- return "plan-enter";
3119
- }
3120
- if (normalizedToolName === "enterplanmode") {
3121
- return "plan-enter";
3122
- }
3123
- if (planMode?.kind === "exit") {
3124
- return "plan-exit";
3125
- }
3126
- if (normalizedToolName === "exitplanmode") {
3127
- return "plan-exit";
3128
- }
3129
- if (normalizedCallType === "approval" || normalizedToolName === "approval") {
3130
- return "approval";
3131
- }
3132
- if (task) {
3133
- return "task";
3134
- }
3135
- if (["task", "subagent", "delegatetask", "delegateagent", "agent"].includes(
3136
- normalizedToolName
3137
- )) {
3138
- return "task";
3139
- }
3140
- if (isImageGenerationToolCall({
3141
- toolName: call.toolName,
3142
- displayName: call.displayName,
3143
- content: call.content,
3144
- outputContent: call.output?.content,
3145
- inputPrompt: call.input?.prompt
3146
- })) {
3147
- return "image-generation";
3148
- }
3149
- switch (normalizedToolName) {
3150
- case "read":
3151
- case "readfile":
3152
- return "read";
3153
- case "write":
3154
- case "writefile":
3155
- return "write";
3156
- case "edit":
3157
- case "editfile":
3158
- case "multiedit":
3159
- return "edit";
3160
- case "bash":
3161
- case "shell":
3162
- case "exec":
3163
- case "execcommand":
3164
- return "bash";
3165
- case "grep":
3166
- case "glob":
3167
- case "search":
3168
- case "searchfiles":
3169
- return "search";
3170
- case "websearch":
3171
- return "web-search";
3172
- case "webfetch":
3173
- return "web-fetch";
3174
- case "todowrite":
3175
- return "todo-write";
3176
- case "toolsearch":
3177
- return "tool-search";
3178
- case "skill":
3179
- return "skill";
3180
- default:
3181
- if (normalizedCallType === "mcp" || normalizedToolName.startsWith("mcp") || hasMcpMetadata(call.metadata)) {
3182
- return "mcp";
3183
- }
3184
- return "default";
3185
- }
3186
- }
3187
- function inferToolCallType(toolName) {
3188
- const normalizedToolName = normalizeToolName4(toolName);
3189
- if (normalizedToolName === "approval") {
3190
- return "approval";
3191
- }
3192
- if (["askuserquestion", "enterplanmode", "exitplanmode"].includes(
3193
- normalizedToolName
3194
- )) {
3195
- return "interactive";
3196
- }
3197
- if (normalizedToolName.startsWith("mcp")) {
3198
- return "mcp";
3199
- }
3200
- return "tool";
3201
- }
3202
- function normalizeToolName4(value) {
3203
- return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
3204
- }
3205
- function hasMcpMetadata(metadata) {
3206
- return Boolean(
3207
- stringValue5(metadata?.server) ?? stringValue5(metadata?.serverName) ?? stringValue5(metadata?.mcpServer)
3208
- );
3209
- }
3210
- function normalizeCallType(value) {
3211
- return (value ?? "").trim().toLowerCase();
3212
- }
3213
- function stringValue5(value) {
3214
- return typeof value === "string" && value.trim() ? value.trim() : null;
3215
- }
3216
-
3217
3245
  // shared/agentConversation/projection/agentTaskProjection.ts
3218
3246
  function projectAgentTaskItem(call, input, output, metadata) {
3219
- const toolName = normalizeToolName4(call.toolName);
3247
+ const toolName = normalizeToolName3(call.toolName);
3220
3248
  if (!["task", "subagent", "delegatetask", "delegateagent", "agent"].includes(
3221
3249
  toolName
3222
3250
  )) {
@@ -3250,6 +3278,9 @@ function normalizeTaskSteps(values, turnId) {
3250
3278
  }
3251
3279
  const toolName = stringValue6(step.toolName) ?? stringValue6(step.tool_name) ?? stringValue6(step.name);
3252
3280
  const callType = stringValue6(step.callType) ?? stringValue6(step.call_type);
3281
+ if (isApprovalToolCall({ toolName, callType })) {
3282
+ return [];
3283
+ }
3253
3284
  const inputPayload = objectValue3(step.toolInput) ?? objectValue3(step.tool_input);
3254
3285
  const outputPayload = objectValue3(step.toolResult) ?? objectValue3(step.tool_result);
3255
3286
  const errorPayload = objectValue3(step.toolError) ?? objectValue3(step.tool_error);
@@ -4017,7 +4048,7 @@ function projectUserMessageContentParts(message, turnId, workspaceId) {
4017
4048
  body: "",
4018
4049
  contentKind: "image-grid",
4019
4050
  images: imageBlocks.map((image, index) => ({
4020
- id: image.path || image.attachmentId || `${message.id}:image:0:${index}`,
4051
+ id: `${message.id}:image:${index}`,
4021
4052
  workspaceId: image.workspaceId,
4022
4053
  agentSessionId: image.agentSessionId,
4023
4054
  attachmentId: image.attachmentId,
@@ -4136,6 +4167,9 @@ function buildAgentTurnSequenceItems(turn, workspaceId) {
4136
4167
  });
4137
4168
  return;
4138
4169
  }
4170
+ if (isApprovalToolCall(entry.call)) {
4171
+ return;
4172
+ }
4139
4173
  sequence.push({
4140
4174
  kind: "tool-call",
4141
4175
  call: projectAgentToolCall(entry.call)
@@ -6584,7 +6618,10 @@ function AgentRichTextReadonly({
6584
6618
  );
6585
6619
  const isMentionOnly = isMentionOnlyRichTextDoc(contentDoc);
6586
6620
  const editor = useEditor({
6587
- immediatelyRender: false,
6621
+ // AgentGUI is client-only. Deferring editor creation leaves every user
6622
+ // message blank for one commit, then changes each transcript turn's
6623
+ // measured height when TipTap mounts.
6624
+ immediatelyRender: true,
6588
6625
  editable: false,
6589
6626
  extensions: createAgentRichTextReadonlyExtensions({
6590
6627
  skills: availableSkills
@@ -8095,7 +8132,6 @@ function AgentMessageBlock({
8095
8132
  source: "agent-markdown"
8096
8133
  },
8097
8134
  workspaceAppIcons,
8098
- deferLongContentRender: true,
8099
8135
  enableImageZoom: true,
8100
8136
  previewMode,
8101
8137
  streaming: message.statusKind === "working"
@@ -8369,7 +8405,6 @@ function AgentPlanCardMessage({
8369
8405
  source: "agent-markdown"
8370
8406
  },
8371
8407
  workspaceAppIcons,
8372
- deferLongContentRender: true,
8373
8408
  enableImageZoom: true,
8374
8409
  previewMode
8375
8410
  }
@@ -14214,6 +14249,7 @@ var AgentTranscriptItemView = memo3(function AgentTranscriptItemView2({
14214
14249
  var AGENT_TRANSCRIPT_COMPLEXITY_VIRTUALIZATION_SCORE = 40;
14215
14250
  var AGENT_TRANSCRIPT_COMPLEXITY_SINGLE_TURN_SCORE = 24;
14216
14251
  var AGENT_TRANSCRIPT_COMPLEXITY_TURN_COUNT = 30;
14252
+ var AGENT_TRANSCRIPT_COMPLEXITY_MINIMUM_TURN_COUNT = 8;
14217
14253
  function assessAgentTranscriptComplexity(turnGroups) {
14218
14254
  const complexity = calculateAgentTranscriptComplexity(turnGroups);
14219
14255
  return {
@@ -14235,6 +14271,9 @@ function calculateAgentTranscriptComplexity(turnGroups) {
14235
14271
  };
14236
14272
  }
14237
14273
  function shouldVirtualizeAgentTranscript(input) {
14274
+ if (input.turnCount < AGENT_TRANSCRIPT_COMPLEXITY_MINIMUM_TURN_COUNT) {
14275
+ return false;
14276
+ }
14238
14277
  return input.turnCount >= AGENT_TRANSCRIPT_COMPLEXITY_TURN_COUNT || input.complexity.totalScore >= AGENT_TRANSCRIPT_COMPLEXITY_VIRTUALIZATION_SCORE || input.complexity.maxTurnScore >= AGENT_TRANSCRIPT_COMPLEXITY_SINGLE_TURN_SCORE;
14239
14278
  }
14240
14279
  function calculateTurnScore(rows) {
@@ -15032,11 +15071,13 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15032
15071
  [turnGroups]
15033
15072
  );
15034
15073
  const rowVirtualizer = useVirtualizer({
15074
+ anchorTo: "end",
15035
15075
  count: turnGroups.length,
15036
15076
  estimateSize: () => AGENT_TRANSCRIPT_ESTIMATED_TURN_HEIGHT_PX,
15037
15077
  getItemKey: (index) => turnGroups[index]?.key ?? index,
15038
15078
  getScrollElement: () => virtualScrollElement,
15039
- overscan: AGENT_TRANSCRIPT_VIRTUALIZATION_OVERSCAN
15079
+ overscan: AGENT_TRANSCRIPT_VIRTUALIZATION_OVERSCAN,
15080
+ scrollEndThreshold: 24
15040
15081
  });
15041
15082
  const handleLocateUserMessage = useCallback10(
15042
15083
  (item) => {
@@ -15068,7 +15109,6 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15068
15109
  );
15069
15110
  useLayoutEffect4(() => {
15070
15111
  if (!shouldVirtualize) {
15071
- setVirtualScrollElement(null);
15072
15112
  return;
15073
15113
  }
15074
15114
  setVirtualScrollElement(
@@ -15298,4 +15338,4 @@ export {
15298
15338
  AgentConversationFlow,
15299
15339
  useProjectedAgentConversation
15300
15340
  };
15301
- //# sourceMappingURL=chunk-7M77BK6K.js.map
15341
+ //# sourceMappingURL=chunk-ZPKPIHMZ.js.map