@tutti-os/agent-gui 0.0.107 → 0.0.109

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 (126) hide show
  1. package/dist/{AgentGUI-Do6py-T_.d.ts → AgentGUI-BSr3cWcJ.d.ts} +6 -3
  2. package/dist/AgentRichTextReadonly-42TUVYX5.js +18 -0
  3. package/dist/agent-conversation/index.d.ts +4 -4
  4. package/dist/agent-conversation/index.js +13 -12
  5. package/dist/agent-conversation/index.js.map +1 -1
  6. package/dist/agent-env/index.js +1 -1
  7. package/dist/agent-gui.d.ts +5 -4
  8. package/dist/agent-gui.js +27 -25
  9. package/dist/agent-message-center/index.d.ts +12 -3
  10. package/dist/agent-message-center/index.js +75 -31
  11. package/dist/agent-message-center/index.js.map +1 -1
  12. package/dist/{agentConversationVM-Bf3Zv3iI.d.ts → agentConversationVM-D3Dn2LqN.d.ts} +18 -2
  13. package/dist/{agentGuiNodeTypes-DbgQBiYz.d.ts → agentGuiNodeTypes-CR_l4HhU.d.ts} +6 -3
  14. package/dist/agents.d.ts +1 -1
  15. package/dist/agents.js +1 -1
  16. package/dist/app/renderer/agentactivity.css +65 -3
  17. package/dist/app/renderer/assets/icons/agent-vinyl-beta-tag.svg +5 -0
  18. package/dist/{chunk-OWW7CU4U.js → chunk-25BPR75P.js} +2 -2
  19. package/dist/{chunk-N4WVVCNI.js → chunk-2QHKXI5N.js} +2 -2
  20. package/dist/{chunk-ZWY32ZKZ.js → chunk-34JD75OB.js} +1296 -737
  21. package/dist/chunk-34JD75OB.js.map +1 -0
  22. package/dist/{chunk-KJQERFKX.js → chunk-6CUELYIF.js} +3 -3
  23. package/dist/chunk-6CUELYIF.js.map +1 -0
  24. package/dist/{chunk-TKBEVCHG.js → chunk-7BN2WQ2M.js} +32 -2
  25. package/dist/chunk-7BN2WQ2M.js.map +1 -0
  26. package/dist/chunk-7KVZPJ3O.js +25 -0
  27. package/dist/chunk-7KVZPJ3O.js.map +1 -0
  28. package/dist/{chunk-C35SNDVZ.js → chunk-7OYHDOGG.js} +2 -1
  29. package/dist/chunk-7OYHDOGG.js.map +1 -0
  30. package/dist/{chunk-P3CVAWGJ.js → chunk-A5UXTAYJ.js} +5 -5
  31. package/dist/{chunk-4ZWV57MF.js → chunk-AIZJHA4Q.js} +14 -9
  32. package/dist/chunk-AIZJHA4Q.js.map +1 -0
  33. package/dist/{chunk-QY22OBJS.js → chunk-AY5AFMT2.js} +8 -84
  34. package/dist/chunk-AY5AFMT2.js.map +1 -0
  35. package/dist/{chunk-V5ROOS2O.js → chunk-BM3CSFWU.js} +22 -6
  36. package/dist/chunk-BM3CSFWU.js.map +1 -0
  37. package/dist/{chunk-F7Q7QK42.js → chunk-BRLKORQI.js} +1432 -1902
  38. package/dist/chunk-BRLKORQI.js.map +1 -0
  39. package/dist/{chunk-LDZ6C3YV.js → chunk-E74BMFHI.js} +3 -3
  40. package/dist/chunk-E74BMFHI.js.map +1 -0
  41. package/dist/{chunk-ZSJBCZUH.js → chunk-EBXOSQ5G.js} +102 -73
  42. package/dist/chunk-EBXOSQ5G.js.map +1 -0
  43. package/dist/chunk-J4K7KIFZ.js +75 -0
  44. package/dist/chunk-J4K7KIFZ.js.map +1 -0
  45. package/dist/{chunk-UFIEUC3Y.js → chunk-JBX3JPTC.js} +9 -8
  46. package/dist/chunk-JBX3JPTC.js.map +1 -0
  47. package/dist/{chunk-4YVKAPKW.js → chunk-JLRPIEIE.js} +2 -17
  48. package/dist/chunk-JLRPIEIE.js.map +1 -0
  49. package/dist/{chunk-BXOKBZH4.js → chunk-K7WFXVSD.js} +81 -45
  50. package/dist/chunk-K7WFXVSD.js.map +1 -0
  51. package/dist/{chunk-4YG7YK7S.js → chunk-L2GENUG3.js} +3 -3
  52. package/dist/{chunk-J2HG7UCP.js → chunk-OEYXSD3O.js} +3 -3
  53. package/dist/{chunk-L3GMMGRS.js → chunk-R2ZADXRB.js} +2 -2
  54. package/dist/chunk-R7AXDQCA.js +146 -0
  55. package/dist/chunk-R7AXDQCA.js.map +1 -0
  56. package/dist/{chunk-7MPN2JGL.js → chunk-U4CVBCHD.js} +37 -119
  57. package/dist/chunk-U4CVBCHD.js.map +1 -0
  58. package/dist/{chunk-4YCCATI4.js → chunk-USIFGHT3.js} +17 -4
  59. package/dist/chunk-USIFGHT3.js.map +1 -0
  60. package/dist/{chunk-7BXWPI4F.js → chunk-VMQNG2KI.js} +13 -1
  61. package/dist/{chunk-7BXWPI4F.js.map → chunk-VMQNG2KI.js.map} +1 -1
  62. package/dist/{chunk-SN6UYX54.js → chunk-W6TO6K2X.js} +4 -4
  63. package/dist/{chunk-UGVI47X6.js → chunk-YNSXUEIR.js} +6 -6
  64. package/dist/context-mention-palette/index.js +13 -12
  65. package/dist/{contribution-C6K5YfJ7.d.ts → contribution-C2LDwLA7.d.ts} +3 -2
  66. package/dist/dock-icons.js +3 -3
  67. package/dist/i18n/index.d.ts +31 -1
  68. package/dist/i18n/index.js +2 -2
  69. package/dist/index.d.ts +8 -7
  70. package/dist/index.js +27 -25
  71. package/dist/index.js.map +1 -1
  72. package/dist/mention-search.js +11 -10
  73. package/dist/provider-icons.js +1 -1
  74. package/dist/provider-identity.js +1 -1
  75. package/dist/{types-CnT8rNUI.d.ts → types-yF_0mrNS.d.ts} +1 -0
  76. package/dist/workbench/contribution.d.ts +2 -2
  77. package/dist/workbench/contribution.js +11 -11
  78. package/dist/workbench/index.d.ts +4 -4
  79. package/dist/workbench/index.js +22 -28
  80. package/dist/workbench/launch.d.ts +11 -14
  81. package/dist/workbench/launch.js +5 -11
  82. package/dist/workbench/providerCatalog.js +2 -2
  83. package/dist/workbench/sessionTitle.js +3 -3
  84. package/dist/workbench/state.d.ts +2 -12
  85. package/dist/workbench/state.js +3 -9
  86. package/dist/workspace-agent-generated-files.js +2 -1
  87. package/dist/workspace-query-cache.d.ts +19 -0
  88. package/dist/workspace-query-cache.js +7 -0
  89. package/dist/workspace-query-cache.js.map +1 -0
  90. package/package.json +21 -14
  91. package/dist/@-bold-lined-BLLFKBFI.svg +0 -10
  92. package/dist/AgentRichTextReadonly-F6PHC5SX.js +0 -18
  93. package/dist/add-lined-bold-5QPUDZCU.svg +0 -3
  94. package/dist/chunk-4YCCATI4.js.map +0 -1
  95. package/dist/chunk-4YVKAPKW.js.map +0 -1
  96. package/dist/chunk-4ZWV57MF.js.map +0 -1
  97. package/dist/chunk-7MPN2JGL.js.map +0 -1
  98. package/dist/chunk-BXOKBZH4.js.map +0 -1
  99. package/dist/chunk-C35SNDVZ.js.map +0 -1
  100. package/dist/chunk-F7Q7QK42.js.map +0 -1
  101. package/dist/chunk-H6IQ63DQ.js +0 -14
  102. package/dist/chunk-H6IQ63DQ.js.map +0 -1
  103. package/dist/chunk-KJQERFKX.js.map +0 -1
  104. package/dist/chunk-LDZ6C3YV.js.map +0 -1
  105. package/dist/chunk-QY22OBJS.js.map +0 -1
  106. package/dist/chunk-TKBEVCHG.js.map +0 -1
  107. package/dist/chunk-UFIEUC3Y.js.map +0 -1
  108. package/dist/chunk-V5ROOS2O.js.map +0 -1
  109. package/dist/chunk-ZSJBCZUH.js.map +0 -1
  110. package/dist/chunk-ZWY32ZKZ.js.map +0 -1
  111. package/dist/claudecode-flat-filled-NHO4JCVK.svg +0 -10
  112. package/dist/codex-flat-filled-WYHCF5VR.svg +0 -10
  113. package/dist/cursor-flat-filled-CL7N3BTZ.svg +0 -3
  114. package/dist/handoff-lined-4WQUBVG3.svg +0 -11
  115. package/dist/open-link-lined-JWEKUKME.svg +0 -4
  116. package/dist/opencode-flat-filled-CYAJPX45.svg +0 -4
  117. package/dist/tutti-flat-filled-K32QBTZE.svg +0 -12
  118. /package/dist/{AgentRichTextReadonly-F6PHC5SX.js.map → AgentRichTextReadonly-42TUVYX5.js.map} +0 -0
  119. /package/dist/{chunk-OWW7CU4U.js.map → chunk-25BPR75P.js.map} +0 -0
  120. /package/dist/{chunk-N4WVVCNI.js.map → chunk-2QHKXI5N.js.map} +0 -0
  121. /package/dist/{chunk-P3CVAWGJ.js.map → chunk-A5UXTAYJ.js.map} +0 -0
  122. /package/dist/{chunk-4YG7YK7S.js.map → chunk-L2GENUG3.js.map} +0 -0
  123. /package/dist/{chunk-J2HG7UCP.js.map → chunk-OEYXSD3O.js.map} +0 -0
  124. /package/dist/{chunk-L3GMMGRS.js.map → chunk-R2ZADXRB.js.map} +0 -0
  125. /package/dist/{chunk-SN6UYX54.js.map → chunk-W6TO6K2X.js.map} +0 -0
  126. /package/dist/{chunk-UGVI47X6.js.map → chunk-YNSXUEIR.js.map} +0 -0
@@ -0,0 +1,146 @@
1
+ // shared/imageGenerationTool.ts
2
+ var KNOWN_IMAGE_GENERATION_TOOL_NAMES = /* @__PURE__ */ new Set([
3
+ "imagegeneration",
4
+ "imagegen",
5
+ "generateimage",
6
+ "generatingimage",
7
+ "imagegenerate",
8
+ "imagegenerator"
9
+ ]);
10
+ function resolveImageGenerationCanonicalToolName(probe) {
11
+ return isImageGenerationToolCall(probe) ? "ImageGeneration" : null;
12
+ }
13
+ function isImageGenerationToolCall(probe) {
14
+ const normalizedToolName = normalizeToolNameToken(probe.toolName);
15
+ const normalizedDisplayName = normalizeToolNameToken(probe.displayName);
16
+ const preview = extractImageGenerationPreview(probe);
17
+ const hasKnownName = KNOWN_IMAGE_GENERATION_TOOL_NAMES.has(normalizedToolName) || KNOWN_IMAGE_GENERATION_TOOL_NAMES.has(normalizedDisplayName);
18
+ const hasOpaqueAlias = looksLikeOpaqueImageGenerationAlias(probe.toolName) || looksLikeOpaqueImageGenerationAlias(probe.displayName);
19
+ const hasPromptSignal = Boolean(
20
+ preview.prompt && (preview.prompt.toLowerCase().startsWith("revised prompt:") || stringValue(probe.inputPrompt) || stringValue(probe.payloadInputPrompt))
21
+ );
22
+ return hasKnownName || hasOpaqueAlias && preview.imageUri !== null || hasPromptSignal && preview.imageUri !== null;
23
+ }
24
+ function extractImageGenerationPreview(probe) {
25
+ const entries = [
26
+ ...contentEntries(probe.content),
27
+ ...contentEntries(probe.outputContent)
28
+ ];
29
+ const prompt = firstString(
30
+ stringValue(probe.inputPrompt),
31
+ stringValue(probe.payloadInputPrompt),
32
+ promptFromEntries(entries)
33
+ ) ?? null;
34
+ const imageEntry = entries.find((entry) => isImageEntry(entry));
35
+ return {
36
+ prompt,
37
+ imageUri: firstString(imageEntry?.uri, stringValue(probe.outputSavedPath)) ?? null,
38
+ mimeType: imageEntry?.mimeType ?? null
39
+ };
40
+ }
41
+ function stripImagePayloadData(value) {
42
+ if (Array.isArray(value)) {
43
+ return value.map((item) => stripImagePayloadData(item));
44
+ }
45
+ const record = recordValue(value);
46
+ if (!record) {
47
+ return value;
48
+ }
49
+ const imageLike = looksLikeImageRecord(record);
50
+ const sanitized = {};
51
+ for (const [key, entry] of Object.entries(record)) {
52
+ const normalizedKey = key.trim().toLowerCase();
53
+ if (imageLike && normalizedKey === "data") {
54
+ continue;
55
+ }
56
+ if (imageLike && (normalizedKey === "uri" || normalizedKey === "path") && typeof entry === "string" && entry.trim().toLowerCase().startsWith("data:image/")) {
57
+ continue;
58
+ }
59
+ sanitized[key] = stripImagePayloadData(entry);
60
+ }
61
+ return sanitized;
62
+ }
63
+ function resolveImageGenerationPreviewSrc(uri) {
64
+ const trimmed = uri?.trim();
65
+ if (!trimmed) {
66
+ return null;
67
+ }
68
+ if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(trimmed)) {
69
+ return trimmed;
70
+ }
71
+ if (trimmed.startsWith("/")) {
72
+ return new URL(trimmed, "file://").toString();
73
+ }
74
+ if (/^[a-zA-Z]:[\\/]/.test(trimmed)) {
75
+ return `file:///${trimmed.replace(/\\/g, "/")}`;
76
+ }
77
+ return trimmed;
78
+ }
79
+ function contentEntries(value) {
80
+ if (!Array.isArray(value)) {
81
+ return [];
82
+ }
83
+ return value.flatMap((item) => {
84
+ const record = recordValue(item);
85
+ if (!record) {
86
+ return [];
87
+ }
88
+ const nestedContent = recordValue(record.content);
89
+ return [toContentEntry(nestedContent ?? record)];
90
+ });
91
+ }
92
+ function promptFromEntries(entries) {
93
+ const revisedPrompt = entries.find(
94
+ (entry) => entry.text && entry.text.toLowerCase().startsWith("revised prompt:")
95
+ );
96
+ return firstString(
97
+ revisedPrompt?.text,
98
+ entries.find((entry) => entry.text)?.text
99
+ ) ?? null;
100
+ }
101
+ function toContentEntry(value) {
102
+ return {
103
+ type: stringValue(value.type),
104
+ text: firstString(stringValue(value.text), stringValue(value.content)) ?? null,
105
+ uri: firstString(stringValue(value.uri), stringValue(value.path)) ?? null,
106
+ mimeType: stringValue(value.mimeType)
107
+ };
108
+ }
109
+ function isImageEntry(entry) {
110
+ return entry.type?.toLowerCase() === "image" || (entry.mimeType?.toLowerCase().startsWith("image/") ?? false) || entry.uri !== null;
111
+ }
112
+ function looksLikeImageRecord(value) {
113
+ const type = stringValue(value.type)?.toLowerCase();
114
+ const mimeType = stringValue(value.mimeType)?.toLowerCase();
115
+ const uri = firstString(stringValue(value.uri), stringValue(value.path));
116
+ return type === "image" || Boolean(mimeType?.startsWith("image/")) || Boolean(uri && value.data);
117
+ }
118
+ function looksLikeOpaqueImageGenerationAlias(value) {
119
+ return /^ig_[a-z0-9]+$/i.test((value ?? "").trim());
120
+ }
121
+ function recordValue(value) {
122
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
123
+ }
124
+ function stringValue(value) {
125
+ return typeof value === "string" && value.trim() ? value.trim() : null;
126
+ }
127
+ function firstString(...values) {
128
+ for (const value of values) {
129
+ if (value?.trim()) {
130
+ return value.trim();
131
+ }
132
+ }
133
+ return null;
134
+ }
135
+ function normalizeToolNameToken(value) {
136
+ return (value ?? "").trim().toLowerCase().replace(/[_\s-]+/gu, "");
137
+ }
138
+
139
+ export {
140
+ resolveImageGenerationCanonicalToolName,
141
+ isImageGenerationToolCall,
142
+ extractImageGenerationPreview,
143
+ stripImagePayloadData,
144
+ resolveImageGenerationPreviewSrc
145
+ };
146
+ //# sourceMappingURL=chunk-R7AXDQCA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../shared/imageGenerationTool.ts"],"sourcesContent":["interface ImageGenerationProbe {\n toolName?: string | null;\n displayName?: string | null;\n content?: unknown;\n outputContent?: unknown;\n outputSavedPath?: unknown;\n inputPrompt?: unknown;\n payloadInputPrompt?: unknown;\n}\n\ninterface ImageGenerationContentEntry {\n type: string | null;\n text: string | null;\n uri: string | null;\n mimeType: string | null;\n}\n\nexport interface ImageGenerationPreview {\n prompt: string | null;\n imageUri: string | null;\n mimeType: string | null;\n}\n\nconst KNOWN_IMAGE_GENERATION_TOOL_NAMES = new Set([\n \"imagegeneration\",\n \"imagegen\",\n \"generateimage\",\n \"generatingimage\",\n \"imagegenerate\",\n \"imagegenerator\"\n]);\n\nexport function resolveImageGenerationCanonicalToolName(\n probe: ImageGenerationProbe\n): \"ImageGeneration\" | null {\n return isImageGenerationToolCall(probe) ? \"ImageGeneration\" : null;\n}\n\nexport function isImageGenerationToolCall(\n probe: ImageGenerationProbe\n): boolean {\n const normalizedToolName = normalizeToolNameToken(probe.toolName);\n const normalizedDisplayName = normalizeToolNameToken(probe.displayName);\n const preview = extractImageGenerationPreview(probe);\n const hasKnownName =\n KNOWN_IMAGE_GENERATION_TOOL_NAMES.has(normalizedToolName) ||\n KNOWN_IMAGE_GENERATION_TOOL_NAMES.has(normalizedDisplayName);\n const hasOpaqueAlias =\n looksLikeOpaqueImageGenerationAlias(probe.toolName) ||\n looksLikeOpaqueImageGenerationAlias(probe.displayName);\n const hasPromptSignal = Boolean(\n preview.prompt &&\n (preview.prompt.toLowerCase().startsWith(\"revised prompt:\") ||\n stringValue(probe.inputPrompt) ||\n stringValue(probe.payloadInputPrompt))\n );\n\n return (\n hasKnownName ||\n (hasOpaqueAlias && preview.imageUri !== null) ||\n (hasPromptSignal && preview.imageUri !== null)\n );\n}\n\nexport function extractImageGenerationPreview(\n probe: ImageGenerationProbe\n): ImageGenerationPreview {\n const entries = [\n ...contentEntries(probe.content),\n ...contentEntries(probe.outputContent)\n ];\n const prompt =\n firstString(\n stringValue(probe.inputPrompt),\n stringValue(probe.payloadInputPrompt),\n promptFromEntries(entries)\n ) ?? null;\n const imageEntry = entries.find((entry) => isImageEntry(entry));\n\n return {\n prompt,\n imageUri:\n firstString(imageEntry?.uri, stringValue(probe.outputSavedPath)) ?? null,\n mimeType: imageEntry?.mimeType ?? null\n };\n}\n\nexport function stripImagePayloadData(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map((item) => stripImagePayloadData(item));\n }\n const record = recordValue(value);\n if (!record) {\n return value;\n }\n const imageLike = looksLikeImageRecord(record);\n const sanitized: Record<string, unknown> = {};\n for (const [key, entry] of Object.entries(record)) {\n const normalizedKey = key.trim().toLowerCase();\n if (imageLike && normalizedKey === \"data\") {\n continue;\n }\n if (\n imageLike &&\n (normalizedKey === \"uri\" || normalizedKey === \"path\") &&\n typeof entry === \"string\" &&\n entry.trim().toLowerCase().startsWith(\"data:image/\")\n ) {\n continue;\n }\n sanitized[key] = stripImagePayloadData(entry);\n }\n return sanitized;\n}\n\nexport function resolveImageGenerationPreviewSrc(\n uri: string | null\n): string | null {\n const trimmed = uri?.trim();\n if (!trimmed) {\n return null;\n }\n if (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(trimmed)) {\n return trimmed;\n }\n if (trimmed.startsWith(\"/\")) {\n return new URL(trimmed, \"file://\").toString();\n }\n if (/^[a-zA-Z]:[\\\\/]/.test(trimmed)) {\n return `file:///${trimmed.replace(/\\\\/g, \"/\")}`;\n }\n return trimmed;\n}\n\nfunction contentEntries(value: unknown): ImageGenerationContentEntry[] {\n if (!Array.isArray(value)) {\n return [];\n }\n return value.flatMap((item) => {\n const record = recordValue(item);\n if (!record) {\n return [];\n }\n const nestedContent = recordValue(record.content);\n return [toContentEntry(nestedContent ?? record)];\n });\n}\n\nfunction promptFromEntries(\n entries: ImageGenerationContentEntry[]\n): string | null {\n const revisedPrompt = entries.find(\n (entry) =>\n entry.text && entry.text.toLowerCase().startsWith(\"revised prompt:\")\n );\n return (\n firstString(\n revisedPrompt?.text,\n entries.find((entry) => entry.text)?.text\n ) ?? null\n );\n}\n\nfunction toContentEntry(\n value: Record<string, unknown>\n): ImageGenerationContentEntry {\n return {\n type: stringValue(value.type),\n text:\n firstString(stringValue(value.text), stringValue(value.content)) ?? null,\n uri: firstString(stringValue(value.uri), stringValue(value.path)) ?? null,\n mimeType: stringValue(value.mimeType)\n };\n}\n\nfunction isImageEntry(entry: ImageGenerationContentEntry): boolean {\n return (\n entry.type?.toLowerCase() === \"image\" ||\n (entry.mimeType?.toLowerCase().startsWith(\"image/\") ?? false) ||\n entry.uri !== null\n );\n}\n\nfunction looksLikeImageRecord(value: Record<string, unknown>): boolean {\n const type = stringValue(value.type)?.toLowerCase();\n const mimeType = stringValue(value.mimeType)?.toLowerCase();\n const uri = firstString(stringValue(value.uri), stringValue(value.path));\n return (\n type === \"image\" ||\n Boolean(mimeType?.startsWith(\"image/\")) ||\n Boolean(uri && value.data)\n );\n}\n\nfunction looksLikeOpaqueImageGenerationAlias(\n value: string | null | undefined\n): boolean {\n return /^ig_[a-z0-9]+$/i.test((value ?? \"\").trim());\n}\n\nfunction recordValue(value: unknown): Record<string, unknown> | null {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\nfunction stringValue(value: unknown): string | null {\n return typeof value === \"string\" && value.trim() ? value.trim() : null;\n}\n\nfunction firstString(\n ...values: Array<string | null | undefined>\n): string | null {\n for (const value of values) {\n if (value?.trim()) {\n return value.trim();\n }\n }\n return null;\n}\n\nfunction normalizeToolNameToken(value: string | null | undefined): string {\n return (value ?? \"\")\n .trim()\n .toLowerCase()\n .replace(/[_\\s-]+/gu, \"\");\n}\n"],"mappings":";AAuBA,IAAM,oCAAoC,oBAAI,IAAI;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAAS,wCACd,OAC0B;AAC1B,SAAO,0BAA0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UAAQ,SAAS,IACd,KAAK,EACL,YAAY,EACZ,QAAQ,aAAa,EAAE;AAC5B;","names":[]}
@@ -6,17 +6,17 @@ import {
6
6
  import {
7
7
  getOptionalAgentHostApi,
8
8
  useOptionalAgentHostApi
9
- } from "./chunk-LDZ6C3YV.js";
9
+ } from "./chunk-E74BMFHI.js";
10
10
  import {
11
11
  managedAgentRoundedIconUrl
12
- } from "./chunk-SN6UYX54.js";
12
+ } from "./chunk-W6TO6K2X.js";
13
13
  import {
14
14
  resolveAgentWorkspaceFileVisualKind
15
15
  } from "./chunk-PJP5BUU6.js";
16
16
  import {
17
17
  translate,
18
18
  useTranslation
19
- } from "./chunk-OWW7CU4U.js";
19
+ } from "./chunk-25BPR75P.js";
20
20
  import {
21
21
  getAgentCustomMentionKind
22
22
  } from "./chunk-D2JUDUYY.js";
@@ -155,6 +155,11 @@ function objectValue(value) {
155
155
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
156
156
  }
157
157
 
158
+ // shared/agentConversation/agentApprovalPurpose.ts
159
+ function normalizeAgentApprovalPurpose(value) {
160
+ return value === "edit-files" ? value : null;
161
+ }
162
+
158
163
  // shared/agentConversation/exitPlanOptions.ts
159
164
  var EXIT_PLAN_KEEP_PLANNING_OPTION_ID = "plan";
160
165
  function isExitPlanSwitchModeInput(input) {
@@ -1243,50 +1248,6 @@ function releaseCachedMarkdownMedia(path, objectUrl) {
1243
1248
  URL.revokeObjectURL(objectUrl);
1244
1249
  }, CACHED_MARKDOWN_MEDIA_REVOKE_DELAY_MS);
1245
1250
  }
1246
- function isHttpUrl(value) {
1247
- const candidate = value.trim();
1248
- if (!candidate || /\s/.test(candidate)) {
1249
- return false;
1250
- }
1251
- try {
1252
- const url = new URL(candidate);
1253
- return url.protocol === "http:" || url.protocol === "https:";
1254
- } catch {
1255
- return false;
1256
- }
1257
- }
1258
- function linkBareLocalAbsolutePaths(content) {
1259
- let out = "";
1260
- for (let index = 0; index < content.length; ) {
1261
- const markdownLinkEnd = markdownLinkEndIndex(content, index);
1262
- if (markdownLinkEnd > index) {
1263
- out += content.slice(index, markdownLinkEnd);
1264
- index = markdownLinkEnd;
1265
- continue;
1266
- }
1267
- const codeSpanEnd = codeSpanEndIndex(content, index);
1268
- if (codeSpanEnd > index) {
1269
- out += content.slice(index, codeSpanEnd);
1270
- index = codeSpanEnd;
1271
- continue;
1272
- }
1273
- if (isLocalPathStart(content, index)) {
1274
- const end = bareLocalPathEndIndex(content, index);
1275
- const rawPath = trimTrailingPathPunctuation(content.slice(index, end));
1276
- const trailing = content.slice(index + rawPath.length, end);
1277
- if (isLocalAbsolutePath(rawPath)) {
1278
- out += `[${escapeMarkdownLinkLabel(rawPath)}](${rawPath})${trailing}`;
1279
- } else {
1280
- out += content.slice(index, end);
1281
- }
1282
- index = end;
1283
- continue;
1284
- }
1285
- out += content[index];
1286
- index += 1;
1287
- }
1288
- return out;
1289
- }
1290
1251
  function normalizeLocalPathMarkdownLinks(content) {
1291
1252
  let out = "";
1292
1253
  for (let index = 0; index < content.length; ) {
@@ -1437,6 +1398,21 @@ function parseMentionLink(href, rawLabel, workspaceAppIcons = [], agentTargets =
1437
1398
  iconUrl: target?.iconUrl?.trim() || managedAgentRoundedIconUrl(agentProviderId)
1438
1399
  };
1439
1400
  }
1401
+ if (kind === "session") {
1402
+ const workspaceId = mention.scope?.workspaceId?.trim() || "";
1403
+ const agentTargetId = mention.scope?.agentTargetId?.trim() || "";
1404
+ const target = resolveAgentTargetPresentation({
1405
+ agentTargetId,
1406
+ agentTargets,
1407
+ workspaceId
1408
+ });
1409
+ const localProvider = agentTargetId.startsWith("local:") ? agentTargetId.slice("local:".length).trim() : "";
1410
+ return {
1411
+ kind,
1412
+ label,
1413
+ iconUrl: target?.iconUrl?.trim() || (localProvider ? managedAgentRoundedIconUrl(localProvider) : void 0)
1414
+ };
1415
+ }
1440
1416
  if (kind === "workspace-reference") {
1441
1417
  const source = mention.scope?.source?.trim() ?? "";
1442
1418
  const workspaceId = mention.scope?.workspaceId?.trim() || "";
@@ -1508,30 +1484,6 @@ function codeSpanEndIndex(content, index) {
1508
1484
  const end = content.indexOf(fence, index + tickCount);
1509
1485
  return end < 0 ? -1 : end + tickCount;
1510
1486
  }
1511
- function isLocalPathStart(content, index) {
1512
- if (content[index] !== "/" || content[index + 1] === "/") {
1513
- return false;
1514
- }
1515
- const previous = content[index - 1];
1516
- return previous === void 0 || /\s/.test(previous) || previous === "(" || previous === "[";
1517
- }
1518
- function bareLocalPathEndIndex(content, index) {
1519
- let end = index;
1520
- while (end < content.length) {
1521
- const char = content[end];
1522
- if (!char || /[\s<>[\](){}"'`]/.test(char)) {
1523
- break;
1524
- }
1525
- end += 1;
1526
- }
1527
- return end;
1528
- }
1529
- function trimTrailingPathPunctuation(path) {
1530
- return path.replace(/[.,;:!?,。;:!?]+$/g, "");
1531
- }
1532
- function escapeMarkdownLinkLabel(label) {
1533
- return label.replace(/([\\[\]])/g, "\\$1");
1534
- }
1535
1487
 
1536
1488
  // shared/agentMessageMarkdownContext.ts
1537
1489
  import { createContext } from "react";
@@ -1540,7 +1492,6 @@ var MarkdownLinkContext = createContext(false);
1540
1492
  // shared/AgentMessageMarkdownRenderers.tsx
1541
1493
  import {
1542
1494
  useCallback,
1543
- useContext,
1544
1495
  useRef as useRef2,
1545
1496
  useState as useState2
1546
1497
  } from "react";
@@ -1550,16 +1501,9 @@ function MarkdownCode({
1550
1501
  node: _node,
1551
1502
  children,
1552
1503
  className,
1553
- onLinkClick,
1554
1504
  ...props
1555
1505
  }) {
1556
1506
  "use memo";
1557
- const isInsideLink = useContext(MarkdownLinkContext);
1558
- const text = textFromReactNode(children).trim();
1559
- const isLinkablePath = !isInsideLink && onLinkClick && !className && (isExplicitWorkspaceFilePath(text) || isHttpUrl(text));
1560
- if (isLinkablePath) {
1561
- return /* @__PURE__ */ jsx(PathLink, { href: text, onLinkClick, children });
1562
- }
1563
1507
  return /* @__PURE__ */ jsx("code", { ...props, className, children });
1564
1508
  }
1565
1509
  var MARKDOWN_ORDERED_LIST_STYLE = {
@@ -1631,32 +1575,6 @@ function MarkdownParagraph({
1631
1575
  }
1632
1576
  return /* @__PURE__ */ jsx("p", { ...props });
1633
1577
  }
1634
- function PathLink({
1635
- href,
1636
- children,
1637
- onLinkClick
1638
- }) {
1639
- "use memo";
1640
- return /* @__PURE__ */ jsx(
1641
- "a",
1642
- {
1643
- className: "cursor-pointer",
1644
- "data-agent-link-href": href,
1645
- role: "link",
1646
- tabIndex: 0,
1647
- onClick: (event) => {
1648
- activateMarkdownLink(event, href, onLinkClick);
1649
- },
1650
- onPointerDown: (event) => {
1651
- activateMarkdownLinkFromPointer(event, href, onLinkClick);
1652
- },
1653
- onKeyDown: (event) => {
1654
- activateMarkdownLinkFromKey(event, href, onLinkClick);
1655
- },
1656
- children
1657
- }
1658
- );
1659
- }
1660
1578
  function textFromReactNode(node) {
1661
1579
  if (typeof node === "string" || typeof node === "number") {
1662
1580
  return String(node);
@@ -1705,7 +1623,7 @@ function MarkdownPre({
1705
1623
  }
1706
1624
 
1707
1625
  // shared/AgentMessageMarkdownMedia.tsx
1708
- import { useContext as useContext2, useEffect as useEffect3, useState as useState5 } from "react";
1626
+ import { useContext, useEffect as useEffect3, useState as useState5 } from "react";
1709
1627
 
1710
1628
  // app/renderer/components/ZoomableImage.tsx
1711
1629
  import {
@@ -2561,7 +2479,7 @@ function MarkdownMedia({
2561
2479
  }) {
2562
2480
  "use memo";
2563
2481
  const { t } = useTranslation();
2564
- const isInsideLink = useContext2(MarkdownLinkContext);
2482
+ const isInsideLink = useContext(MarkdownLinkContext);
2565
2483
  const agentHostApi = useOptionalAgentHostApi() ?? getOptionalAgentHostApi();
2566
2484
  const workspacePath = typeof src === "string" && isLocalAbsolutePath(src) ? src.trim() : null;
2567
2485
  const readWorkspaceImage = workspacePath ? agentHostApi?.workspace?.readFile : void 0;
@@ -2819,13 +2737,11 @@ function AgentMessageMarkdown({
2819
2737
  const isCollapsed = shouldCollapse && !isExpanded;
2820
2738
  const ContainerTag = inline ? "span" : "div";
2821
2739
  const normalizedContent = useMemo(
2822
- () => linkBareLocalAbsolutePaths(
2823
- normalizeLocalPathMarkdownLinks(
2824
- normalizeMentionMarkdownLinks(
2825
- normalizePlainIssueMentionTitle ? normalizePlainIssueMentionTitleContent(
2826
- normalizePlainSessionMentionTitle(stabilizedContent)
2827
- ) : normalizePlainSessionMentionTitle(stabilizedContent)
2828
- )
2740
+ () => normalizeLocalPathMarkdownLinks(
2741
+ normalizeMentionMarkdownLinks(
2742
+ normalizePlainIssueMentionTitle ? normalizePlainIssueMentionTitleContent(
2743
+ normalizePlainSessionMentionTitle(stabilizedContent)
2744
+ ) : normalizePlainSessionMentionTitle(stabilizedContent)
2829
2745
  )
2830
2746
  ),
2831
2747
  [normalizePlainIssueMentionTitle, stabilizedContent]
@@ -2873,7 +2789,7 @@ function AgentMessageMarkdown({
2873
2789
  previewMode
2874
2790
  }
2875
2791
  ),
2876
- code: (props) => /* @__PURE__ */ jsx5(MarkdownCode, { ...props, onLinkClick: handleLinkClick }),
2792
+ code: (props) => /* @__PURE__ */ jsx5(MarkdownCode, { ...props }),
2877
2793
  img: (props) => /* @__PURE__ */ jsx5(MarkdownMedia, { ...props, enableZoom: enableImageZoom }),
2878
2794
  p: (props) => /* @__PURE__ */ jsx5(MarkdownParagraph, { ...props, inline }),
2879
2795
  ul: MarkdownUnorderedList,
@@ -3202,13 +3118,14 @@ function MentionLink({
3202
3118
  "aria-hidden": "true",
3203
3119
  children: /* @__PURE__ */ jsx5(FileText, { size: 14, strokeWidth: 2 })
3204
3120
  }
3205
- ) : mention.kind === "workspace-app" || mention.kind === "workspace-reference" || mention.kind === "agent-target" ? /* @__PURE__ */ jsx5(
3121
+ ) : mention.kind === "workspace-app" || mention.kind === "workspace-reference" || mention.kind === "agent-target" || mention.kind === "session" && mention.iconUrl ? /* @__PURE__ */ jsx5(
3206
3122
  "span",
3207
3123
  {
3208
3124
  className: "grid h-4 w-4 shrink-0 place-items-center overflow-hidden rounded-[4px] bg-block",
3209
3125
  "aria-hidden": "true",
3210
- "data-agent-mention-app-icon": "true",
3211
- "data-workspace-app-icon": "true",
3126
+ "data-agent-mention-app-icon": mention.kind === "session" ? void 0 : "true",
3127
+ "data-agent-mention-session-icon": mention.kind === "session" ? "true" : void 0,
3128
+ "data-workspace-app-icon": mention.kind === "session" ? void 0 : "true",
3212
3129
  children: mention.iconUrl ? /* @__PURE__ */ jsx5(
3213
3130
  "img",
3214
3131
  {
@@ -3695,6 +3612,7 @@ var AgentGUIConversation_styles_default = styles;
3695
3612
 
3696
3613
  export {
3697
3614
  extractAgentMcpToolTarget,
3615
+ normalizeAgentApprovalPurpose,
3698
3616
  isExitPlanSwitchModeInput,
3699
3617
  extractExitPlanModeOptions,
3700
3618
  extractExitPlanKeepPlanningOptionId,
@@ -3708,4 +3626,4 @@ export {
3708
3626
  AgentMessageMarkdown,
3709
3627
  CustomScrollArea
3710
3628
  };
3711
- //# sourceMappingURL=chunk-7MPN2JGL.js.map
3629
+ //# sourceMappingURL=chunk-U4CVBCHD.js.map