@parhelia/core 0.1.12368 → 0.1.12393

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 (258) hide show
  1. package/dist/agents-view/AgentsView.js +1 -1
  2. package/dist/agents-view/AgentsView.js.map +1 -1
  3. package/dist/components/ui/LanguageSelector.js +1 -3
  4. package/dist/components/ui/LanguageSelector.js.map +1 -1
  5. package/dist/components/ui/dialog.js +1 -1
  6. package/dist/components/ui/dialog.js.map +1 -1
  7. package/dist/config/config.js +53 -16
  8. package/dist/config/config.js.map +1 -1
  9. package/dist/config/notificationRoutes.js +10 -0
  10. package/dist/config/notificationRoutes.js.map +1 -1
  11. package/dist/config/types/workspace.d.ts +6 -0
  12. package/dist/config/types.d.ts +2 -5
  13. package/dist/editor/Editor.js +37 -15
  14. package/dist/editor/Editor.js.map +1 -1
  15. package/dist/editor/SetupWizard.js +20 -2
  16. package/dist/editor/SetupWizard.js.map +1 -1
  17. package/dist/editor/ai/AgentCostDisplay.d.ts +1 -0
  18. package/dist/editor/ai/AgentCostDisplay.js +1 -1
  19. package/dist/editor/ai/AgentCostDisplay.js.map +1 -1
  20. package/dist/editor/ai/AgentTerminal.js +158 -39
  21. package/dist/editor/ai/AgentTerminal.js.map +1 -1
  22. package/dist/editor/ai/AgentTerminalStatusBar.d.ts +2 -0
  23. package/dist/editor/ai/AgentTerminalStatusBar.js +22 -37
  24. package/dist/editor/ai/AgentTerminalStatusBar.js.map +1 -1
  25. package/dist/editor/ai/AiResponseMessage.js +0 -1
  26. package/dist/editor/ai/AiResponseMessage.js.map +1 -1
  27. package/dist/editor/ai/ContentInspectorPopover.d.ts +17 -0
  28. package/dist/editor/ai/ContentInspectorPopover.js +136 -0
  29. package/dist/editor/ai/ContentInspectorPopover.js.map +1 -0
  30. package/dist/editor/ai/ContextInfoBar.js +55 -2
  31. package/dist/editor/ai/ContextInfoBar.js.map +1 -1
  32. package/dist/editor/ai/InlineAiDialog.js +1 -7
  33. package/dist/editor/ai/InlineAiDialog.js.map +1 -1
  34. package/dist/editor/ai/ToolCallDisplay.d.ts +4 -0
  35. package/dist/editor/ai/ToolCallDisplay.js +43 -8
  36. package/dist/editor/ai/ToolCallDisplay.js.map +1 -1
  37. package/dist/editor/ai/dialogs/AgentDialogHandler.js +46 -22
  38. package/dist/editor/ai/dialogs/AgentDialogHandler.js.map +1 -1
  39. package/dist/editor/client/EditorShell.js +69 -26
  40. package/dist/editor/client/EditorShell.js.map +1 -1
  41. package/dist/editor/client/editContext.d.ts +3 -2
  42. package/dist/editor/client/hooks/useQuota.d.ts +2 -1
  43. package/dist/editor/client/hooks/useQuota.js.map +1 -1
  44. package/dist/editor/client/hooks/useSocketMessageHandler.js +28 -0
  45. package/dist/editor/client/hooks/useSocketMessageHandler.js.map +1 -1
  46. package/dist/editor/client/operations.d.ts +1 -0
  47. package/dist/editor/client/operations.js +67 -15
  48. package/dist/editor/client/operations.js.map +1 -1
  49. package/dist/editor/client/waitForEditOperationTerminal.d.ts +11 -0
  50. package/dist/editor/client/waitForEditOperationTerminal.js +40 -0
  51. package/dist/editor/client/waitForEditOperationTerminal.js.map +1 -0
  52. package/dist/editor/commands/commands.d.ts +11 -1
  53. package/dist/editor/commands/commands.js +12 -1
  54. package/dist/editor/commands/commands.js.map +1 -1
  55. package/dist/editor/commands/customCommandConverter.d.ts +8 -1
  56. package/dist/editor/commands/customCommandConverter.js +33 -4
  57. package/dist/editor/commands/customCommandConverter.js.map +1 -1
  58. package/dist/editor/commands/handlers/uiActionHandlers.d.ts +6 -0
  59. package/dist/editor/commands/handlers/uiActionHandlers.js +84 -0
  60. package/dist/editor/commands/handlers/uiActionHandlers.js.map +1 -0
  61. package/dist/editor/commands/itemCommands.js +6 -2
  62. package/dist/editor/commands/itemCommands.js.map +1 -1
  63. package/dist/editor/commands/keyboardCommands.d.ts +10 -0
  64. package/dist/editor/commands/keyboardCommands.js +142 -0
  65. package/dist/editor/commands/keyboardCommands.js.map +1 -0
  66. package/dist/editor/commands/undo.d.ts +9 -15
  67. package/dist/editor/commands/undo.js +24 -0
  68. package/dist/editor/commands/undo.js.map +1 -1
  69. package/dist/editor/menubar/PageSelector.js +1 -3
  70. package/dist/editor/menubar/PageSelector.js.map +1 -1
  71. package/dist/editor/menubar/VersionSelector.js +1 -3
  72. package/dist/editor/menubar/VersionSelector.js.map +1 -1
  73. package/dist/editor/menubar/toolbar-sections/CustomCommandsToolbar.js +7 -36
  74. package/dist/editor/menubar/toolbar-sections/CustomCommandsToolbar.js.map +1 -1
  75. package/dist/editor/notifications/notificationRoutes.js +1 -0
  76. package/dist/editor/notifications/notificationRoutes.js.map +1 -1
  77. package/dist/editor/page-editor-chrome/InlineEditor.js +53 -36
  78. package/dist/editor/page-editor-chrome/InlineEditor.js.map +1 -1
  79. package/dist/editor/page-editor-chrome/useInlineAICompletion.js +283 -298
  80. package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -1
  81. package/dist/editor/page-viewer/PageViewer.js +60 -6
  82. package/dist/editor/page-viewer/PageViewer.js.map +1 -1
  83. package/dist/editor/reviews/Comment.js +12 -10
  84. package/dist/editor/reviews/Comment.js.map +1 -1
  85. package/dist/editor/reviews/CommentDisplayPopover.js +1 -3
  86. package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -1
  87. package/dist/editor/reviews/PreviewInfo.js +1 -4
  88. package/dist/editor/reviews/PreviewInfo.js.map +1 -1
  89. package/dist/editor/reviews/reviewCommands.js +4 -1
  90. package/dist/editor/reviews/reviewCommands.js.map +1 -1
  91. package/dist/editor/reviews/useReviews.d.ts +2 -2
  92. package/dist/editor/reviews/useReviews.js +12 -30
  93. package/dist/editor/reviews/useReviews.js.map +1 -1
  94. package/dist/editor/services/agentService.d.ts +26 -0
  95. package/dist/editor/services/agentService.js +41 -0
  96. package/dist/editor/services/agentService.js.map +1 -1
  97. package/dist/editor/services/aiService.d.ts +7 -1
  98. package/dist/editor/services/aiService.js +13 -1
  99. package/dist/editor/services/aiService.js.map +1 -1
  100. package/dist/editor/services/notificationService.d.ts +1 -0
  101. package/dist/editor/services/notificationService.js +1 -0
  102. package/dist/editor/services/notificationService.js.map +1 -1
  103. package/dist/editor/services/reviewsService.d.ts +2 -5
  104. package/dist/editor/services/reviewsService.js +0 -10
  105. package/dist/editor/services/reviewsService.js.map +1 -1
  106. package/dist/editor/services/systemService.d.ts +2 -1
  107. package/dist/editor/services/systemService.js +3 -0
  108. package/dist/editor/services/systemService.js.map +1 -1
  109. package/dist/editor/services/templateBuilderService.d.ts +7 -0
  110. package/dist/editor/services/templateBuilderService.js +7 -1
  111. package/dist/editor/services/templateBuilderService.js.map +1 -1
  112. package/dist/editor/settings/About.js +25 -19
  113. package/dist/editor/settings/About.js.map +1 -1
  114. package/dist/editor/settings/QuotaInfo.js +15 -7
  115. package/dist/editor/settings/QuotaInfo.js.map +1 -1
  116. package/dist/editor/settings/index/useIndexStatus.js +1 -1
  117. package/dist/editor/settings/index/useIndexStatus.js.map +1 -1
  118. package/dist/editor/settings/panels/AgentProfileConfigPanel.d.ts +10 -0
  119. package/dist/editor/settings/panels/AgentProfileConfigPanel.js +61 -0
  120. package/dist/editor/settings/panels/AgentProfileConfigPanel.js.map +1 -0
  121. package/dist/editor/settings/panels/AgentsPanel.d.ts +0 -4
  122. package/dist/editor/settings/panels/AgentsPanel.js +101 -109
  123. package/dist/editor/settings/panels/AgentsPanel.js.map +1 -1
  124. package/dist/editor/settings/panels/CreateAgentProfileDialog.d.ts +7 -0
  125. package/dist/editor/settings/panels/CreateAgentProfileDialog.js +48 -0
  126. package/dist/editor/settings/panels/CreateAgentProfileDialog.js.map +1 -0
  127. package/dist/editor/settings/panels/GroupedFieldConfigPanel.d.ts +33 -0
  128. package/dist/editor/settings/panels/GroupedFieldConfigPanel.js +91 -0
  129. package/dist/editor/settings/panels/GroupedFieldConfigPanel.js.map +1 -0
  130. package/dist/editor/settings/panels/ModelConfigPanel.d.ts +10 -0
  131. package/dist/editor/settings/panels/ModelConfigPanel.js +51 -0
  132. package/dist/editor/settings/panels/ModelConfigPanel.js.map +1 -0
  133. package/dist/editor/settings/panels/ModelsPanel.js +201 -70
  134. package/dist/editor/settings/panels/ModelsPanel.js.map +1 -1
  135. package/dist/editor/settings/panels/ProjectTemplateAgentPanel.d.ts +10 -0
  136. package/dist/editor/settings/panels/ProjectTemplateAgentPanel.js +46 -0
  137. package/dist/editor/settings/panels/ProjectTemplateAgentPanel.js.map +1 -0
  138. package/dist/editor/settings/panels/ProjectTemplatesPanel.d.ts +2 -0
  139. package/dist/editor/settings/panels/ProjectTemplatesPanel.js +1340 -0
  140. package/dist/editor/settings/panels/ProjectTemplatesPanel.js.map +1 -0
  141. package/dist/editor/settings/panels/ProviderConfigPanel.d.ts +10 -0
  142. package/dist/editor/settings/panels/ProviderConfigPanel.js +32 -0
  143. package/dist/editor/settings/panels/ProviderConfigPanel.js.map +1 -0
  144. package/dist/editor/settings/panels/ProvidersPanel.js +46 -4
  145. package/dist/editor/settings/panels/ProvidersPanel.js.map +1 -1
  146. package/dist/editor/settings/panels/SearchConfigPanel.js +3 -3
  147. package/dist/editor/settings/panels/SearchConfigPanel.js.map +1 -1
  148. package/dist/editor/settings/panels/index.d.ts +1 -2
  149. package/dist/editor/settings/panels/index.js +1 -2
  150. package/dist/editor/settings/panels/index.js.map +1 -1
  151. package/dist/editor/setup-wizard/steps/CompleteStep.d.ts +2 -1
  152. package/dist/editor/setup-wizard/steps/CompleteStep.js +2 -1
  153. package/dist/editor/setup-wizard/steps/CompleteStep.js.map +1 -1
  154. package/dist/editor/setup-wizard/steps/LicenseActivationStep.d.ts +9 -0
  155. package/dist/editor/setup-wizard/steps/LicenseActivationStep.js +160 -0
  156. package/dist/editor/setup-wizard/steps/LicenseActivationStep.js.map +1 -0
  157. package/dist/editor/setup-wizard/steps/LicenseEmailStep.d.ts +10 -0
  158. package/dist/editor/setup-wizard/steps/LicenseEmailStep.js +101 -0
  159. package/dist/editor/setup-wizard/steps/LicenseEmailStep.js.map +1 -0
  160. package/dist/editor/template-wizard/TemplateStructureInlineEditor.js +422 -65
  161. package/dist/editor/template-wizard/TemplateStructureInlineEditor.js.map +1 -1
  162. package/dist/editor/ui/ItemNameDialogNew.js +15 -9
  163. package/dist/editor/ui/ItemNameDialogNew.js.map +1 -1
  164. package/dist/editor/utils/keyboardNavigation.d.ts +6 -20
  165. package/dist/editor/utils/keyboardNavigation.js +48 -139
  166. package/dist/editor/utils/keyboardNavigation.js.map +1 -1
  167. package/dist/licensing/EmailEntry.js +1 -1
  168. package/dist/licensing/EmailEntry.js.map +1 -1
  169. package/dist/licensing/LicenseActivationForm.js +1 -1
  170. package/dist/licensing/LicenseActivationForm.js.map +1 -1
  171. package/dist/licensing/LicenseCodeEntry.js +2 -2
  172. package/dist/licensing/LicenseCodeEntry.js.map +1 -1
  173. package/dist/licensing/LicenseContext.js +18 -9
  174. package/dist/licensing/LicenseContext.js.map +1 -1
  175. package/dist/licensing/LicenseOverlay.js +2 -1
  176. package/dist/licensing/LicenseOverlay.js.map +1 -1
  177. package/dist/licensing/licenseService.d.ts +10 -0
  178. package/dist/licensing/licenseService.js +28 -0
  179. package/dist/licensing/licenseService.js.map +1 -1
  180. package/dist/revision.d.ts +2 -2
  181. package/dist/revision.js +2 -2
  182. package/dist/setup/services/setupWizardService.d.ts +8 -10
  183. package/dist/setup/services/setupWizardService.js +4 -17
  184. package/dist/setup/services/setupWizardService.js.map +1 -1
  185. package/dist/splash-screen/ModernSplashScreen.js +100 -18
  186. package/dist/splash-screen/ModernSplashScreen.js.map +1 -1
  187. package/dist/splash-screen/ParheliaAssistantChat.js +3 -22
  188. package/dist/splash-screen/ParheliaAssistantChat.js.map +1 -1
  189. package/dist/task-board/TaskBoardWorkspace.js +70 -3
  190. package/dist/task-board/TaskBoardWorkspace.js.map +1 -1
  191. package/dist/task-board/components/AssignAgentDialog.js +9 -4
  192. package/dist/task-board/components/AssignAgentDialog.js.map +1 -1
  193. package/dist/task-board/components/CreateProjectDialog.js +32 -34
  194. package/dist/task-board/components/CreateProjectDialog.js.map +1 -1
  195. package/dist/task-board/components/CreateTaskDialog.d.ts +2 -0
  196. package/dist/task-board/components/CreateTaskDialog.js +35 -11
  197. package/dist/task-board/components/CreateTaskDialog.js.map +1 -1
  198. package/dist/task-board/components/ProjectPropertiesPanel.js +4 -1
  199. package/dist/task-board/components/ProjectPropertiesPanel.js.map +1 -1
  200. package/dist/task-board/components/TaskAgentPanel.js +13 -4
  201. package/dist/task-board/components/TaskAgentPanel.js.map +1 -1
  202. package/dist/task-board/components/TaskAssigneePicker.d.ts +2 -2
  203. package/dist/task-board/components/TaskAssigneePicker.js +12 -4
  204. package/dist/task-board/components/TaskAssigneePicker.js.map +1 -1
  205. package/dist/task-board/components/TaskBoardProjectListSidebar.js.map +1 -1
  206. package/dist/task-board/components/TaskCard.js +2 -2
  207. package/dist/task-board/components/TaskCard.js.map +1 -1
  208. package/dist/task-board/components/TaskDetailPanel.js +2 -2
  209. package/dist/task-board/components/TaskDetailPanel.js.map +1 -1
  210. package/dist/task-board/components/TaskRow.js +2 -2
  211. package/dist/task-board/components/TaskRow.js.map +1 -1
  212. package/dist/task-board/components/WizardCommunicationCenter.js +10 -4
  213. package/dist/task-board/components/WizardCommunicationCenter.js.map +1 -1
  214. package/dist/task-board/services/taskService.d.ts +11 -2
  215. package/dist/task-board/services/taskService.js +20 -2
  216. package/dist/task-board/services/taskService.js.map +1 -1
  217. package/dist/task-board/types.d.ts +52 -7
  218. package/dist/task-board/views/DependencyGraphView.d.ts +31 -4
  219. package/dist/task-board/views/DependencyGraphView.js +383 -64
  220. package/dist/task-board/views/DependencyGraphView.js.map +1 -1
  221. package/dist/types.d.ts +23 -15
  222. package/package.json +7 -7
  223. package/dist/editor/settings/Setup.d.ts +0 -1
  224. package/dist/editor/settings/Setup.js +0 -211
  225. package/dist/editor/settings/Setup.js.map +0 -1
  226. package/dist/editor/settings/panels/DatabasePanel.d.ts +0 -6
  227. package/dist/editor/settings/panels/DatabasePanel.js +0 -50
  228. package/dist/editor/settings/panels/DatabasePanel.js.map +0 -1
  229. package/dist/editor/settings/setup-steps/AiSetupStep/EmbeddingsModelSection.d.ts +0 -2
  230. package/dist/editor/settings/setup-steps/AiSetupStep/EmbeddingsModelSection.js +0 -195
  231. package/dist/editor/settings/setup-steps/AiSetupStep/EmbeddingsModelSection.js.map +0 -1
  232. package/dist/editor/settings/setup-steps/AiSetupStep/index.d.ts +0 -2
  233. package/dist/editor/settings/setup-steps/AiSetupStep/index.js +0 -21
  234. package/dist/editor/settings/setup-steps/AiSetupStep/index.js.map +0 -1
  235. package/dist/editor/settings/setup-steps/AiSetupStep/provider/ProviderSection.d.ts +0 -1
  236. package/dist/editor/settings/setup-steps/AiSetupStep/provider/ProviderSection.js +0 -233
  237. package/dist/editor/settings/setup-steps/AiSetupStep/provider/ProviderSection.js.map +0 -1
  238. package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersList.d.ts +0 -15
  239. package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersList.js +0 -14
  240. package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersList.js.map +0 -1
  241. package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.d.ts +0 -1
  242. package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.js +0 -94
  243. package/dist/editor/settings/setup-steps/AiSetupStep/required-containers/RequiredContainersSection.js.map +0 -1
  244. package/dist/editor/settings/setup-steps/AiSetupStep/types.d.ts +0 -1
  245. package/dist/editor/settings/setup-steps/AiSetupStep/types.js +0 -2
  246. package/dist/editor/settings/setup-steps/AiSetupStep/types.js.map +0 -1
  247. package/dist/editor/settings/setup-steps/AiSetupStep/utils.d.ts +0 -5
  248. package/dist/editor/settings/setup-steps/AiSetupStep/utils.js +0 -44
  249. package/dist/editor/settings/setup-steps/AiSetupStep/utils.js.map +0 -1
  250. package/dist/editor/settings/setup-steps/IndexSetupStep.d.ts +0 -2
  251. package/dist/editor/settings/setup-steps/IndexSetupStep.js +0 -36
  252. package/dist/editor/settings/setup-steps/IndexSetupStep.js.map +0 -1
  253. package/dist/editor/settings/setup-steps/SettingsSetupStep.d.ts +0 -2
  254. package/dist/editor/settings/setup-steps/SettingsSetupStep.js +0 -111
  255. package/dist/editor/settings/setup-steps/SettingsSetupStep.js.map +0 -1
  256. package/dist/editor/settings/setup-steps/SetupOverview.d.ts +0 -14
  257. package/dist/editor/settings/setup-steps/SetupOverview.js +0 -38
  258. package/dist/editor/settings/setup-steps/SetupOverview.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React, { useEffect, useState, useRef, useCallback, useLayoutEffect, useMemo, } from "react";
3
3
  import { Send, AlertCircle, Loader2, User, Wand2, Square, Mic, MicOff, ChevronDown, ChevronUp, ListTodo, ArrowLeft, DollarSign, ExternalLink, Settings2, Target, X, Plus, } from "lucide-react";
4
- import { getAgent, startAgent, updateAgentSettings, updateAgentCostLimit, updateAgentContext, getAgentSkillCatalog, getAgentTriggerSubscriptions, cancelAgent, canonicalizeAgentMetadata, getPendingPrompts, } from "../services/agentService";
4
+ import { getAgent, startAgent, updateAgentSettings, updateAgentCostLimit, updateAgentContext, getAgentSkillCatalog, getAgentOperationAllowances, getAgentTriggerSubscriptions, cancelAgent, canonicalizeAgentMetadata, getPendingPrompts, } from "../services/agentService";
5
5
  import { useEditContext, useFieldsEditContext } from "../client/editContext";
6
6
  import { localStorageService } from "../services/localStorageService";
7
7
  import { Textarea } from "../../components/ui/textarea";
@@ -22,7 +22,6 @@ import { formatTime, formatDateTime } from "../utils";
22
22
  import { cn } from "../../lib/utils";
23
23
  import { Select } from "../../components/ui/select";
24
24
  import { AgentTerminalStatusBar } from "./AgentTerminalStatusBar";
25
- import { useMediaQuery } from "../client/hooks/useMediaQuery";
26
25
  import { SimpleTabs } from "../ui/SimpleTabs";
27
26
  import { Splitter } from "../ui/Splitter";
28
27
  import { ScrollingContentTree } from "../ScrollingContentTree";
@@ -46,6 +45,7 @@ function buildPlaceholderAgentDetails(agentStub) {
46
45
  totalInputTokenCost: 0,
47
46
  totalOutputTokenCost: 0,
48
47
  totalCachedInputTokenCost: 0,
48
+ totalImageCost: 0,
49
49
  totalCost: 0,
50
50
  currency: agentStub.currency || "USD",
51
51
  messageCount: agentStub.messageCount || 0,
@@ -54,6 +54,27 @@ function buildPlaceholderAgentDetails(agentStub) {
54
54
  function normalizeDialogAgentId(value) {
55
55
  return value?.trim().toLowerCase() || "";
56
56
  }
57
+ function formatAllowanceSource(source) {
58
+ const normalized = source?.trim();
59
+ if (!normalized)
60
+ return null;
61
+ if (normalized === "user")
62
+ return "User granted";
63
+ if (normalized.startsWith("preconfigured:profile:"))
64
+ return "Profile";
65
+ if (normalized.startsWith("preconfigured:skill:"))
66
+ return "Skill";
67
+ if (normalized.startsWith("system:")) {
68
+ return normalized
69
+ .slice("system:".length)
70
+ .replace(/[-_]+/g, " ")
71
+ .trim();
72
+ }
73
+ return normalized;
74
+ }
75
+ function formatAllowanceLabel(allowance) {
76
+ return `${allowance.operationType || "*"}${"itemPath" in allowance ? ` ${allowance.itemPath}` : ` ${allowance.normalizedPath}`}`;
77
+ }
57
78
  function getVisibleDialogRegistry() {
58
79
  const registry = globalThis.__agentDialogVisibleCallbacks;
59
80
  return registry && typeof registry === "object" ? registry : {};
@@ -538,6 +559,7 @@ const calculateTotalTokens = (messages) => {
538
559
  outputCost: acc.outputCost + (message.outputTokenCost || 0),
539
560
  cachedCost: acc.cachedCost + (message.cachedInputTokenCost || 0),
540
561
  cacheWriteCost: acc.cacheWriteCost,
562
+ imageCost: acc.imageCost,
541
563
  totalCost: acc.totalCost + (message.totalCost || 0),
542
564
  };
543
565
  }, {
@@ -549,6 +571,7 @@ const calculateTotalTokens = (messages) => {
549
571
  outputCost: 0,
550
572
  cachedCost: 0,
551
573
  cacheWriteCost: 0,
574
+ imageCost: 0,
552
575
  totalCost: 0,
553
576
  });
554
577
  return totals;
@@ -635,28 +658,36 @@ const convertAgentMessagesToAiFormat = (agentMessages) => {
635
658
  role: agentMessage.role,
636
659
  createdDate: agentMessage.createdDate,
637
660
  tool_calls: agentMessage.toolCalls
638
- ? agentMessage.toolCalls.map((toolCall) => ({
639
- id: toolCall.toolCallId,
640
- displayName: toolCall.functionName,
641
- function: {
642
- name: toolCall.functionName,
643
- arguments: toolCall.functionArguments,
644
- result: toolCall.functionResult,
645
- error: toolCall.functionError,
646
- },
647
- // Pass through approval info if present on the tool call
648
- requiresApproval: toolCall.requiresApproval,
649
- // Pass through isCompleted so ToolCallDisplay knows when to hide spinner
650
- isCompleted: toolCall.isCompleted,
651
- // Tool call is streaming if message is not completed and tool call has no result yet
652
- isStreaming: !agentMessage.isCompleted &&
653
- !toolCall.isCompleted &&
654
- !toolCall.functionResult &&
655
- !toolCall.functionError,
656
- // Pass through message IDs for approval/rejection events
657
- messageId: toolCall.messageId,
658
- dbMessageId: toolCall.dbMessageId,
659
- }))
661
+ ? agentMessage.toolCalls.map((toolCall) => {
662
+ const isPruned = !!toolCall.isPruned ||
663
+ /^PRUNED$/i.test(toolCall.functionError || "");
664
+ return {
665
+ id: toolCall.toolCallId,
666
+ displayName: toolCall.functionName,
667
+ function: {
668
+ name: toolCall.functionName,
669
+ arguments: toolCall.functionArguments,
670
+ result: toolCall.functionResult,
671
+ error: toolCall.functionError,
672
+ },
673
+ // Pass through approval info if present on the tool call
674
+ requiresApproval: toolCall.requiresApproval,
675
+ // Pass through prune metadata so the terminal can render a neutral state
676
+ isPruned,
677
+ prunedAt: toolCall.prunedAt,
678
+ // Pass through isCompleted so ToolCallDisplay knows when to hide spinner
679
+ isCompleted: toolCall.isCompleted,
680
+ // Tool call is streaming if message is not completed and tool call has no result yet
681
+ isStreaming: !agentMessage.isCompleted &&
682
+ !toolCall.isCompleted &&
683
+ !toolCall.functionResult &&
684
+ !toolCall.functionError &&
685
+ !isPruned,
686
+ // Pass through message IDs for approval/rejection events
687
+ messageId: toolCall.messageId,
688
+ dbMessageId: toolCall.dbMessageId,
689
+ };
690
+ })
660
691
  : [],
661
692
  };
662
693
  if (agentMessage.toolCallId) {
@@ -881,7 +912,6 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
881
912
  const [mode, setMode] = useState("supervised");
882
913
  const [queuedPrompts, setQueuedPrompts] = useState([]);
883
914
  const [expandedQueuedTriggerIds, setExpandedQueuedTriggerIds] = useState({});
884
- const isMobile = useMediaQuery("(max-width: 768px)");
885
915
  const [contextPanelsActiveTab, setContextPanelsActiveTab] = useState(0);
886
916
  const [hiddenContextPanelTabIds, setHiddenContextPanelTabIds] = useState(new Set());
887
917
  const [showCostAndAgent, setShowCostAndAgent] = useState(false);
@@ -893,8 +923,14 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
893
923
  const [skillsLoading, setSkillsLoading] = useState(false);
894
924
  const [skillsError, setSkillsError] = useState(null);
895
925
  const [triggerSubscriptions, setTriggerSubscriptions] = useState([]);
926
+ const [operationAllowances, setOperationAllowances] = useState({
927
+ sitecore: [],
928
+ filesystem: [],
929
+ });
896
930
  const [triggerSubscriptionsLoading, setTriggerSubscriptionsLoading] = useState(false);
931
+ const [operationAllowancesLoading, setOperationAllowancesLoading] = useState(false);
897
932
  const [triggerSubscriptionsError, setTriggerSubscriptionsError] = useState(null);
933
+ const [operationAllowancesError, setOperationAllowancesError] = useState(null);
898
934
  const hasSpawnedAgents = useMemo(() => {
899
935
  if (!agentMetadata)
900
936
  return false;
@@ -1030,7 +1066,11 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1030
1066
  }
1031
1067
  if (!agent?.id || agent.status === "new") {
1032
1068
  setTriggerSubscriptions([]);
1069
+ setTriggerSubscriptionsLoading(false);
1033
1070
  setTriggerSubscriptionsError(null);
1071
+ setOperationAllowances({ sitecore: [], filesystem: [] });
1072
+ setOperationAllowancesLoading(false);
1073
+ setOperationAllowancesError(null);
1034
1074
  return () => {
1035
1075
  active = false;
1036
1076
  };
@@ -1055,7 +1095,28 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1055
1095
  }
1056
1096
  }
1057
1097
  };
1098
+ const loadOperationAllowances = async () => {
1099
+ try {
1100
+ setOperationAllowancesLoading(true);
1101
+ setOperationAllowancesError(null);
1102
+ const allowances = await getAgentOperationAllowances(agent.id);
1103
+ if (active) {
1104
+ setOperationAllowances(allowances);
1105
+ }
1106
+ }
1107
+ catch (e) {
1108
+ if (active) {
1109
+ setOperationAllowancesError(e?.message || "Failed to load allowances");
1110
+ }
1111
+ }
1112
+ finally {
1113
+ if (active) {
1114
+ setOperationAllowancesLoading(false);
1115
+ }
1116
+ }
1117
+ };
1058
1118
  void loadTriggerSubscriptions();
1119
+ void loadOperationAllowances();
1059
1120
  return () => {
1060
1121
  active = false;
1061
1122
  };
@@ -1132,6 +1193,20 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1132
1193
  return unique;
1133
1194
  }, [backendAssignedSkillIds, metadataSelectedSkillIds]);
1134
1195
  const activeTriggerSubscriptions = useMemo(() => triggerSubscriptions.filter((sub) => sub.isActive), [triggerSubscriptions]);
1196
+ const allowanceGroups = useMemo(() => [
1197
+ {
1198
+ key: "sitecore",
1199
+ label: "Sitecore",
1200
+ rows: operationAllowances.sitecore,
1201
+ },
1202
+ {
1203
+ key: "filesystem",
1204
+ label: "Filesystem",
1205
+ rows: operationAllowances.filesystem,
1206
+ },
1207
+ ], [operationAllowances]);
1208
+ const hasAnyAllowances = useMemo(() => operationAllowances.sitecore.length > 0 ||
1209
+ operationAllowances.filesystem.length > 0, [operationAllowances]);
1135
1210
  const allowedProfileSkillIdSet = useMemo(() => {
1136
1211
  const ids = activeProfile?.allowedSkills
1137
1212
  ?.map((skill) => String(skill?.id || "").toLowerCase())
@@ -1301,7 +1376,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1301
1376
  const seenMessageIdsRef = useRef(new Set());
1302
1377
  const lastSeqRef = useRef(0);
1303
1378
  const subscribedAgentIdRef = useRef(null);
1304
- // Cache mode/model changes made while the agent is still "new" (not yet persisted)
1379
+ // Cache mode/model/profile changes made while the agent is still "new" (not yet persisted)
1305
1380
  const pendingSettingsRef = useRef(null);
1306
1381
  // Track whether textarea should maintain focus during re-renders
1307
1382
  const shouldMaintainFocusRef = useRef(false);
@@ -1652,6 +1727,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1652
1727
  outputCost: Number(cost.output) || 0,
1653
1728
  cachedCost: Number(cost.cached) || 0,
1654
1729
  cacheWriteCost: Number(cost.cacheWrite) || 0,
1730
+ imageCost: Number(cost.imageCost ?? cost.totalImageCost) || 0,
1655
1731
  totalCost: Number(cost.total) || 0,
1656
1732
  currency: "USD",
1657
1733
  };
@@ -1795,6 +1871,8 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1795
1871
  }
1796
1872
  // Add tool call to the message in the array
1797
1873
  if (toolCallMessageId && message.data && toolCallId) {
1874
+ const toolCallError = message.data.functionError || message.data.error || "";
1875
+ const isPruned = !!message.data?.isPruned || /^PRUNED$/i.test(String(toolCallError));
1798
1876
  const toolCall = {
1799
1877
  id: toolCallId,
1800
1878
  messageId: toolCallMessageId,
@@ -1803,7 +1881,8 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1803
1881
  functionName: extractedToolCall.functionName,
1804
1882
  functionArguments: extractedToolCall.functionArguments,
1805
1883
  functionResult: message.data.functionResult || message.data.result || "",
1806
- functionError: message.data.functionError || message.data.error || "",
1884
+ functionError: toolCallError,
1885
+ isPruned,
1807
1886
  isCompleted: false,
1808
1887
  responseTimeMs: message.data.responseTimeMs,
1809
1888
  createdDate: new Date().toISOString(),
@@ -1936,6 +2015,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1936
2015
  outputCost: Number(cost.output) || 0,
1937
2016
  cachedCost: Number(cost.cached) || 0,
1938
2017
  cacheWriteCost: Number(cost.cacheWrite) || 0,
2018
+ imageCost: Number(cost.imageCost) || 0,
1939
2019
  totalCost: Number(cost.total) || 0,
1940
2020
  currency: "USD",
1941
2021
  };
@@ -1984,6 +2064,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1984
2064
  outputCost: Number(data.totalOutputTokenCost) || 0,
1985
2065
  cachedCost: Number(data.totalCachedTokenCost) || 0,
1986
2066
  cacheWriteCost: Number(data.totalCacheWriteTokenCost) || 0,
2067
+ imageCost: Number(data.totalImageCost) || 0,
1987
2068
  totalCost: Number(data.totalCost) || 0,
1988
2069
  currency: data.currency || "USD",
1989
2070
  };
@@ -2180,6 +2261,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
2180
2261
  totalInputTokenCost: 0,
2181
2262
  totalOutputTokenCost: 0,
2182
2263
  totalCachedInputTokenCost: 0,
2264
+ totalImageCost: 0,
2183
2265
  totalCost: 0,
2184
2266
  messageCount: 0,
2185
2267
  });
@@ -2918,6 +3000,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
2918
3000
  outputCost: Number(totals.totalOutputTokenCost) || 0,
2919
3001
  cachedCost: Number(totals.totalCachedInputTokenCost) || 0,
2920
3002
  cacheWriteCost: Number(totals.totalCacheWriteTokenCost) || 0,
3003
+ imageCost: Number(totals.totalImageCost) || 0,
2921
3004
  totalCost: totalCost,
2922
3005
  currency: totals.currency,
2923
3006
  };
@@ -3446,9 +3529,20 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
3446
3529
  ? (profiles.find((p) => p.id?.toLowerCase() === normalizedProfileId) ??
3447
3530
  profiles[0])
3448
3531
  : profiles[0];
3449
- if (candidate && (!activeProfile || activeProfile.id !== candidate.id)) {
3450
- setActiveProfile(candidate);
3451
- }
3532
+ if (!candidate)
3533
+ return;
3534
+ // Keep active profile in sync whenever the matching entry in `profiles` changes —
3535
+ // not only when the profile id changes. Otherwise allowedSkills (and similar fields)
3536
+ // that are merged in the parent after async loads never update (e.g. Template Builder
3537
+ // settings skills merged into the profile).
3538
+ setActiveProfile((prev) => {
3539
+ if (!prev || prev.id !== candidate.id)
3540
+ return candidate;
3541
+ const skillKey = (p) => JSON.stringify((p.allowedSkills ?? []).map((s) => [String(s?.id ?? ""), String(s?.name ?? "")]));
3542
+ if (skillKey(prev) === skillKey(candidate))
3543
+ return prev;
3544
+ return candidate;
3545
+ });
3452
3546
  }, [profiles, agent?.profileId, agentStub.profileId]);
3453
3547
  // Clear queued prompts when agent changes or is new;
3454
3548
  // initial fetch is handled by loadAgent() for better performance and reliability
@@ -3514,7 +3608,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
3514
3608
  textareaRef.current.focus();
3515
3609
  }
3516
3610
  }, [messages, activePlaceholderInput]);
3517
- // Persist any pending settings (mode/model) once an agent exists server-side
3611
+ // Persist any pending settings (mode/model/profile) once an agent exists server-side
3518
3612
  const persistPendingSettingsIfNeeded = useCallback(async () => {
3519
3613
  try {
3520
3614
  if (!agent?.id)
@@ -3527,6 +3621,10 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
3527
3621
  payload.model = pending.modelName;
3528
3622
  if (pending.mode)
3529
3623
  payload.mode = pending.mode;
3624
+ if (pending.profileId)
3625
+ payload.profileId = pending.profileId;
3626
+ if (pending.profileName != null)
3627
+ payload.profileName = pending.profileName;
3530
3628
  if (Object.keys(payload).length === 0)
3531
3629
  return;
3532
3630
  await updateAgentSettings(agent.id, payload);
@@ -4431,8 +4529,16 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
4431
4529
  if (effectiveCostLimit === undefined) {
4432
4530
  effectiveCostLimit = undefined;
4433
4531
  }
4434
- // Calculate total token usage for cost display
4435
- const totalTokens = calculateTotalTokens(messages);
4532
+ // Calculate total token usage for cost display.
4533
+ // Message rows do not currently persist imageCost, so on refresh we fall back
4534
+ // to the persisted agent aggregate for that single field.
4535
+ const totalTokens = (() => {
4536
+ const totals = calculateTotalTokens(messages);
4537
+ return {
4538
+ ...totals,
4539
+ imageCost: totals.imageCost || Number(agent?.totalImageCost) || 0,
4540
+ };
4541
+ })();
4436
4542
  // Determine if the agent is actively executing (submitting, connecting, waiting, or streaming)
4437
4543
  const isExecuting = isSubmitting ||
4438
4544
  isConnecting ||
@@ -4809,7 +4915,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
4809
4915
  activeProfile?.name ||
4810
4916
  "Agent" }), _jsx("span", { className: "text-xs text-gray-400", children: formatTime(new Date()) })] }), _jsxs("div", { className: "flex items-center gap-1 pt-2", children: [_jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.3s]" }), _jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.15s]" }), _jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400" })] })] })] }))] }), !simpleMode && renderCostLimitBanner(), _jsx("div", { ref: messagesEndRef })] }), !hideContext &&
4811
4917
  !simpleMode &&
4812
- (isMobile ? (_jsx("div", { className: "border-t border-gray-200 bg-gray-50", "data-testid": "agent-context-panel-tabs", children: _jsx(SimpleTabs, { tabs: [
4918
+ (editContext?.isMobile ? (_jsx("div", { className: "border-t border-gray-200 bg-gray-50", "data-testid": "agent-context-panel-tabs", children: _jsx(SimpleTabs, { tabs: [
4813
4919
  {
4814
4920
  id: "context",
4815
4921
  label: "Context",
@@ -5034,6 +5140,8 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
5034
5140
  else {
5035
5141
  pendingSettingsRef.current = {
5036
5142
  ...(pendingSettingsRef.current || {}),
5143
+ profileId: nextProfile.id,
5144
+ profileName: nextProfile.name,
5037
5145
  };
5038
5146
  setAgentMetadata((current) => {
5039
5147
  const next = {
@@ -5120,7 +5228,16 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
5120
5228
  }, children: _jsx(ExternalLink, { className: "h-2.5 w-2.5", strokeWidth: 1.5 }) }), backendAssignedSkillSet.has(skillId.toLowerCase()) ? (_jsx("span", { className: "text-[9px] text-gray-500", children: "auto" })) : (_jsx("button", { type: "button", className: "rounded p-0.5 text-gray-500 hover:bg-gray-200 hover:text-gray-700", onClick: () => {
5121
5229
  void handleRemoveSkill(skillId);
5122
5230
  }, title: "Remove skill", "aria-label": `Remove ${skill?.name || skillId}`, children: _jsx(X, { className: "h-2.5 w-2.5", strokeWidth: 1 }) }))] }, skillId));
5123
- }) }))] }), _jsxs("div", { children: [_jsx("div", { className: "mb-0.5 px-0.5 text-[11px] font-medium text-gray-700", children: "Subscribed triggers" }), _jsx("div", { className: "max-h-28 overflow-y-auto rounded border border-gray-100 bg-gray-50/50 p-1", children: triggerSubscriptionsLoading ? (_jsx("div", { className: "px-1 text-[10px] text-gray-500", children: "Loading subscribed triggers..." })) : activeTriggerSubscriptions.length > 0 ? (_jsx("div", { className: "space-y-0.5", children: activeTriggerSubscriptions.map((sub) => {
5231
+ }) }))] }), _jsxs("div", { children: [_jsx("div", { className: "mb-0.5 px-0.5 text-[11px] font-medium text-gray-700", children: "Allowances" }), _jsx("div", { className: "max-h-36 overflow-y-auto rounded border border-gray-100 bg-gray-50/50 p-1", "data-testid": "agent-allowances-section", children: operationAllowancesLoading ? (_jsx("div", { className: "px-1 text-[10px] text-gray-500", children: "Loading allowances..." })) : hasAnyAllowances ? (_jsx("div", { className: "space-y-1", children: allowanceGroups.map((group) => group.rows.length > 0 ? (_jsxs("div", { className: "space-y-0.5", children: [_jsx("div", { className: "px-1 text-[9px] font-medium uppercase tracking-wide text-gray-400", children: group.label }), group.rows.map((allowance, index) => {
5232
+ const sourceLabel = formatAllowanceSource(allowance.source);
5233
+ const pathLabel = "itemPath" in allowance
5234
+ ? allowance.itemPath
5235
+ : allowance.normalizedPath;
5236
+ return (_jsxs("div", { className: "rounded px-1 py-0.5 hover:bg-white/60 transition-colors", "data-testid": `agent-allowance-row-${group.key}`, children: [_jsxs("div", { className: "flex items-baseline gap-1.5", children: [_jsx("div", { className: "shrink-0 text-[10px] font-medium text-gray-700", children: allowance.operationType || "*" }), _jsx("div", { className: "truncate text-[9px] text-gray-500", title: formatAllowanceLabel(allowance), children: pathLabel })] }), (sourceLabel ||
5237
+ allowance.grantedBy) && (_jsx("div", { className: "truncate pl-6 text-[9px] text-gray-400", children: [sourceLabel, allowance.grantedBy]
5238
+ .filter(Boolean)
5239
+ .join(" · ") }))] }, `${group.key}-${allowance.operationType}-${pathLabel}-${index}`));
5240
+ })] }, group.key)) : null) })) : (_jsx("div", { className: "px-1 text-[10px] text-gray-500", children: "No active allowances" })) }), operationAllowancesError && (_jsx("div", { className: "mt-1 text-[10px] text-red-600", children: operationAllowancesError }))] }), _jsxs("div", { children: [_jsx("div", { className: "mb-0.5 px-0.5 text-[11px] font-medium text-gray-700", children: "Subscribed triggers" }), _jsx("div", { className: "max-h-28 overflow-y-auto rounded border border-gray-100 bg-gray-50/50 p-1", children: triggerSubscriptionsLoading ? (_jsx("div", { className: "px-1 text-[10px] text-gray-500", children: "Loading subscribed triggers..." })) : activeTriggerSubscriptions.length > 0 ? (_jsx("div", { className: "space-y-0.5", children: activeTriggerSubscriptions.map((sub) => {
5124
5241
  const filterText = (sub.filter || "").trim();
5125
5242
  return (_jsxs("div", { className: "flex items-baseline gap-1.5 rounded px-1 py-0.5 hover:bg-white/60 transition-colors", children: [_jsx("div", { className: "shrink-0 text-[10px] font-medium text-gray-700", children: sub.triggerName }), filterText.length > 0 && (_jsx("div", { className: "truncate text-[9px] text-gray-400", title: filterText, children: filterText }))] }, sub.id));
5126
5243
  }) })) : (_jsx("div", { className: "px-1 text-[10px] text-gray-500", children: "No active trigger subscriptions" })) }), triggerSubscriptionsError && (_jsx("div", { className: "mt-1 text-[10px] text-red-600", children: triggerSubscriptionsError }))] })] }) })] }), activeProfile?.prompts?.length ? (_jsxs(Popover, { open: showPredefined, onOpenChange: setShowPredefined, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { className: "rounded p-1 hover:bg-gray-100", onClick: () => { }, title: "Predefined prompts", "aria-label": "Predefined prompts", type: "button", children: _jsx(Wand2, { className: "h-3 w-3", strokeWidth: 1 }) }) }), _jsx(PopoverContent, { className: "w-64 p-0", align: "start", children: _jsx("div", { className: "max-h-56 overflow-y-auto p-2", children: activeProfile.prompts.map((p, index) => (_jsx("div", { className: "cursor-pointer rounded p-1.5 text-[10px] text-gray-700 hover:bg-gray-100", onClick: () => {
@@ -5128,10 +5245,10 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
5128
5245
  setShowPredefined(false);
5129
5246
  if (textareaRef.current)
5130
5247
  textareaRef.current.focus();
5131
- }, children: p.title }, index))) }) })] })) : null, !hideBottomControls && !simpleMode && isMobile && (_jsxs(Popover, { open: showCostAndAgent, onOpenChange: setShowCostAndAgent, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { onClick: () => {
5132
- if (isMobile)
5248
+ }, children: p.title }, index))) }) })] })) : null, !hideBottomControls && !simpleMode && editContext?.isMobile && (_jsxs(Popover, { open: showCostAndAgent, onOpenChange: setShowCostAndAgent, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { onClick: () => {
5249
+ if (editContext?.isMobile)
5133
5250
  setShowCostAndAgent((prev) => !prev);
5134
- }, variant: "outline", size: "sm", className: "h-5.5 w-5.5 cursor-pointer rounded-full", "aria-expanded": isMobile ? showCostAndAgent : undefined, "aria-label": "Toggle cost and context info", children: _jsx(DollarSign, { className: "size-3", strokeWidth: 1 }) }) }), _jsx(PopoverContent, { className: "w-64 p-0", align: "start", children: _jsx("div", { className: "max-h-56 overflow-y-auto p-2", children: _jsx(AgentTerminalStatusBar, { agent: agent, contextWindowStatus: contextWindowStatus, effectiveModelName: effectiveModelName, liveTotals: liveTotals, totalTokens: liveTotals
5251
+ }, variant: "outline", size: "sm", className: "h-5.5 w-5.5 cursor-pointer rounded-full", "aria-expanded": editContext?.isMobile ? showCostAndAgent : undefined, "aria-label": "Toggle cost and context info", children: _jsx(DollarSign, { className: "size-3", strokeWidth: 1 }) }) }), _jsx(PopoverContent, { className: "w-64 p-0", align: "start", children: _jsx("div", { className: "max-h-56 overflow-y-auto p-2", children: _jsx(AgentTerminalStatusBar, { agent: agent, contextWindowStatus: contextWindowStatus, effectiveModelName: effectiveModelName, liveTotals: liveTotals, totalTokens: liveTotals
5135
5252
  ? {
5136
5253
  input: liveTotals.input,
5137
5254
  output: liveTotals.output,
@@ -5141,6 +5258,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
5141
5258
  outputCost: liveTotals.outputCost,
5142
5259
  cachedCost: liveTotals.cachedCost,
5143
5260
  cacheWriteCost: liveTotals.cacheWriteCost ?? 0,
5261
+ imageCost: liveTotals.imageCost ?? 0,
5144
5262
  totalCost: liveTotals.totalCost,
5145
5263
  }
5146
5264
  : totalTokens, effectiveCostLimit: effectiveCostLimit, messages: messages, showCompressionPopover: showCompressionPopover, setShowCompressionPopover: setShowCompressionPopover }) }) })] }))] })), _jsxs("div", { className: "flex items-center gap-1 self-end", children: [_jsx("span", { title: isVoiceDisabled
@@ -5164,7 +5282,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
5164
5282
  : allPendingApprovals.length > 0
5165
5283
  ? "Approve or reject pending tool calls first"
5166
5284
  : "Send", "aria-label": isExecuting ? "Stop" : "Send", "data-testid": "agent-send-stop-button", "data-executing": isExecuting ? "true" : "false", children: isExecuting ? (_jsx(Square, { className: "size-3", strokeWidth: 1 })) : (_jsx(Send, { className: "size-3", strokeWidth: 1 })) })] })] }));
5167
- })(), !hideBottomControls && !simpleMode && !isMobile && (_jsx(AgentTerminalStatusBar, { agent: agent, contextWindowStatus: contextWindowStatus, effectiveModelName: effectiveModelName, liveTotals: liveTotals, totalTokens: liveTotals
5285
+ })(), !hideBottomControls && !simpleMode && !editContext?.isMobile && (_jsx(AgentTerminalStatusBar, { agent: agent, contextWindowStatus: contextWindowStatus, effectiveModelName: effectiveModelName, liveTotals: liveTotals, totalTokens: liveTotals
5168
5286
  ? {
5169
5287
  input: liveTotals.input,
5170
5288
  output: liveTotals.output,
@@ -5174,6 +5292,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
5174
5292
  outputCost: liveTotals.outputCost,
5175
5293
  cachedCost: liveTotals.cachedCost,
5176
5294
  cacheWriteCost: liveTotals.cacheWriteCost ?? 0,
5295
+ imageCost: liveTotals.imageCost ?? 0,
5177
5296
  totalCost: liveTotals.totalCost,
5178
5297
  }
5179
5298
  : totalTokens, effectiveCostLimit: effectiveCostLimit, messages: messages, showCompressionPopover: showCompressionPopover, setShowCompressionPopover: setShowCompressionPopover }))] })] }));