@kortix/ui 0.14.12 → 0.14.14

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 (438) hide show
  1. package/README.md +1 -1
  2. package/dist/_vendor/kortix-shared.js +521 -7045
  3. package/dist/_vendor/shared/app-config.d.ts +8 -0
  4. package/dist/_vendor/shared/artifact-annotations.d.ts +708 -0
  5. package/dist/_vendor/shared/artifact-comments.d.ts +327 -0
  6. package/dist/_vendor/shared/index.d.ts +3 -1
  7. package/dist/_vendor/shared/my-kortix-agent.d.ts +40 -0
  8. package/dist/_vendor/shared/peer-message-prompt.d.ts +35 -0
  9. package/dist/_vendor/shared/pixel-mark.d.ts +11 -0
  10. package/dist/_vendor/shared/prompt-attachments.d.ts +1 -0
  11. package/dist/_vendor/shared/reminder-prompt.d.ts +8 -2
  12. package/dist/_vendor/shared/runtime-versions.d.ts +8 -0
  13. package/dist/artifacts/artifact-frame.d.ts +1 -0
  14. package/dist/artifacts/artifact-frame.js +18 -5
  15. package/dist/artifacts/frame-policy.d.ts +1 -1
  16. package/dist/artifacts/frame-policy.js +10 -5
  17. package/dist/customize/agents/agent-access-text.d.ts +16 -0
  18. package/dist/customize/agents/agent-access-text.js +54 -0
  19. package/dist/customize/agents/agent-approval-rules.d.ts +8 -0
  20. package/dist/customize/agents/agent-approval-rules.js +26 -0
  21. package/dist/customize/agents/agent-authority-card.js +4 -1
  22. package/dist/customize/agents/agent-cover-card.d.ts +4 -1
  23. package/dist/customize/agents/agent-cover-card.js +2 -2
  24. package/dist/customize/agents/agent-detail-aside.d.ts +1 -2
  25. package/dist/customize/agents/agent-detail-aside.js +8 -11
  26. package/dist/customize/agents/agent-drives-section.d.ts +23 -7
  27. package/dist/customize/agents/agent-drives-section.js +107 -41
  28. package/dist/customize/agents/agent-instructions.d.ts +11 -0
  29. package/dist/customize/agents/agent-instructions.js +114 -0
  30. package/dist/customize/agents/agent-model-view.d.ts +17 -0
  31. package/dist/customize/agents/agent-model-view.js +67 -0
  32. package/dist/customize/agents/agent-overview.d.ts +53 -0
  33. package/dist/customize/agents/agent-overview.js +242 -0
  34. package/dist/customize/agents/agent-page-chrome.d.ts +128 -0
  35. package/dist/customize/agents/agent-page-chrome.js +145 -0
  36. package/dist/customize/agents/agent-page.d.ts +13 -1
  37. package/dist/customize/agents/agent-page.js +478 -367
  38. package/dist/customize/agents/agent-pin-button.d.ts +10 -0
  39. package/dist/customize/agents/agent-pin-button.js +20 -0
  40. package/dist/customize/agents/agent-policy-sets-section.d.ts +16 -0
  41. package/dist/customize/agents/agent-policy-sets-section.js +80 -0
  42. package/dist/customize/agents/agent-policy-sets.js +1 -1
  43. package/dist/customize/agents/agent-section-rail.d.ts +21 -0
  44. package/dist/customize/agents/agent-section-rail.js +23 -0
  45. package/dist/customize/agents/agent-share-control.d.ts +4 -3
  46. package/dist/customize/agents/agent-share-control.js +15 -16
  47. package/dist/customize/agents/{agent-people-section.d.ts → agent-share-dialog.d.ts} +3 -1
  48. package/dist/customize/agents/{agent-people-section.js → agent-share-dialog.js} +21 -21
  49. package/dist/customize/agents/agent-tabs.d.ts +95 -0
  50. package/dist/customize/agents/agent-tabs.js +199 -0
  51. package/dist/customize/agents/agents-page.d.ts +0 -21
  52. package/dist/customize/agents/agents-page.js +104 -118
  53. package/dist/customize/agents/connectors-required.d.ts +16 -0
  54. package/dist/customize/agents/connectors-required.js +19 -0
  55. package/dist/customize/agents/create-agent-modal.d.ts +19 -0
  56. package/dist/customize/agents/create-agent-modal.js +94 -0
  57. package/dist/customize/connectors/agent-access.d.ts +4 -4
  58. package/dist/customize/connectors/agent-access.js +7 -10
  59. package/dist/customize/connectors/connector-identity.d.ts +12 -0
  60. package/dist/customize/connectors/connector-identity.js +15 -2
  61. package/dist/customize/connectors/connector-routes.js +2 -2
  62. package/dist/customize/connectors/connectors-page.d.ts +14 -1
  63. package/dist/customize/connectors/connectors-page.js +101 -32
  64. package/dist/customize/connectors/detail/app-page.js +1 -1
  65. package/dist/customize/connectors/detail/connector-agents.js +0 -3
  66. package/dist/customize/connectors/detail/connector-page.d.ts +1 -1
  67. package/dist/customize/connectors/detail/connector-page.js +5 -2
  68. package/dist/customize/connectors/detail/connector-policy-sets.js +1 -1
  69. package/dist/customize/connectors/detail/connector-triggers.js +2 -2
  70. package/dist/customize/connectors/use-agent-access.d.ts +7 -5
  71. package/dist/customize/connectors/use-agent-access.js +2 -6
  72. package/dist/customize/models/models-page.d.ts +7 -1
  73. package/dist/customize/models/models-page.js +2 -2
  74. package/dist/customize/project-settings/project-admin-sections.d.ts +63 -0
  75. package/dist/customize/project-settings/project-admin-sections.js +80 -0
  76. package/dist/customize/project-settings/project-settings-page.d.ts +1 -1
  77. package/dist/customize/project-settings/project-settings-page.js +4 -13
  78. package/dist/customize/project-settings/project-settings-sections.d.ts +5 -5
  79. package/dist/customize/project-settings/project-settings-sections.js +6 -20
  80. package/dist/customize/providers/provider-accordion.js +29 -17
  81. package/dist/customize/providers/provider-connect.js +1 -1
  82. package/dist/customize/providers/provider-sheet.d.ts +4 -1
  83. package/dist/customize/providers/provider-sheet.js +15 -5
  84. package/dist/customize/secrets/secrets-page.d.ts +5 -1
  85. package/dist/customize/secrets/secrets-page.js +2 -2
  86. package/dist/customize/sections/gateway-view.d.ts +10 -2
  87. package/dist/customize/sections/gateway-view.js +16 -4
  88. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.d.ts +12 -5
  89. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +131 -8
  90. package/dist/customize/sections/llm-provider/claude-code-step.d.ts +10 -0
  91. package/dist/customize/sections/llm-provider/claude-code-step.js +32 -0
  92. package/dist/customize/sections/llm-provider/models-tab.js +5 -1
  93. package/dist/customize/sections/view/account-secret-resources-panel.d.ts +5 -3
  94. package/dist/customize/sections/view/account-secret-resources-panel.js +122 -19
  95. package/dist/customize/sections/view/agent-editor-access-fields.d.ts +1 -1
  96. package/dist/customize/sections/view/agent-editor-access-fields.js +8 -4
  97. package/dist/customize/sections/view/agent-editor-basics-fields.d.ts +4 -1
  98. package/dist/customize/sections/view/agent-editor-basics-fields.js +33 -4
  99. package/dist/customize/sections/view/agent-editor-catalog.d.ts +2 -2
  100. package/dist/customize/sections/view/agent-editor-catalog.js +10 -12
  101. package/dist/customize/sections/view/agent-editor-primitives.d.ts +1 -1
  102. package/dist/customize/sections/view/agent-editor-primitives.js +4 -4
  103. package/dist/customize/sections/view/agent-editor.d.ts +37 -26
  104. package/dist/customize/sections/view/agent-editor.js +19 -19
  105. package/dist/customize/sections/view/grant-mode-field.d.ts +8 -20
  106. package/dist/customize/sections/view/grant-mode-field.js +31 -57
  107. package/dist/customize/sections/view/permission-editor.d.ts +3 -1
  108. package/dist/customize/sections/view/permission-editor.js +19 -10
  109. package/dist/customize/sections/view/review-view.d.ts +8 -0
  110. package/dist/customize/sections/view/review-view.js +12 -1
  111. package/dist/customize/sections/view/secret-delivery.js +1 -4
  112. package/dist/customize/sections/view/secrets-view.d.ts +7 -1
  113. package/dist/customize/sections/view/secrets-view.js +42 -6
  114. package/dist/customize/settings/rail.js +2 -8
  115. package/dist/customize/settings/settings-tabs.d.ts +2 -2
  116. package/dist/customize/settings/settings-tabs.js +17 -19
  117. package/dist/customize/settings/tabs/experimental-tab.d.ts +3 -0
  118. package/dist/customize/settings/tabs/experimental-tab.js +6 -1
  119. package/dist/customize/settings/tabs/sandbox-tab.d.ts +4 -6
  120. package/dist/customize/settings/tabs/sandbox-tab.js +9 -9
  121. package/dist/customize/shared/access-list.d.ts +39 -0
  122. package/dist/customize/shared/access-list.js +62 -0
  123. package/dist/customize/shared/agent-resource-scope.d.ts +87 -0
  124. package/dist/customize/shared/agent-resource-scope.js +123 -0
  125. package/dist/customize/shared/capability-library.d.ts +41 -0
  126. package/dist/customize/shared/capability-library.js +271 -0
  127. package/dist/customize/shared/capability-page-shell.d.ts +18 -1
  128. package/dist/customize/shared/capability-page-shell.js +21 -1
  129. package/dist/customize/shared/catalog/catalog-space-tabs.d.ts +14 -0
  130. package/dist/customize/shared/catalog/catalog-space-tabs.js +20 -0
  131. package/dist/customize/shared/customize-tab-bar.d.ts +13 -0
  132. package/dist/customize/shared/customize-tab-bar.js +95 -0
  133. package/dist/customize/shared/entity/entity-modal.d.ts +17 -1
  134. package/dist/customize/shared/entity/entity-modal.js +10 -9
  135. package/dist/customize/shared/leave-guard.d.ts +23 -0
  136. package/dist/customize/shared/leave-guard.js +87 -0
  137. package/dist/customize/shared/standalone-settings-nav.js +4 -1
  138. package/dist/customize/shared/tool-rules.d.ts +11 -0
  139. package/dist/customize/shared/tool-rules.js +29 -0
  140. package/dist/customize/skills/builtin-skill-modal.d.ts +6 -0
  141. package/dist/customize/skills/builtin-skill-modal.js +41 -0
  142. package/dist/customize/skills/skills-page.d.ts +21 -18
  143. package/dist/customize/skills/skills-page.js +16 -110
  144. package/dist/customize/triggers/runtime-triggers.d.ts +17 -0
  145. package/dist/customize/triggers/runtime-triggers.js +57 -0
  146. package/dist/customize/triggers/schedule/event-trigger-copy.js +2 -2
  147. package/dist/customize/triggers/schedule/post-to-field.js +2 -2
  148. package/dist/customize/triggers/schedule/schedule-copy.d.ts +11 -6
  149. package/dist/customize/triggers/schedule/schedule-copy.js +29 -8
  150. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +7 -3
  151. package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +26 -1
  152. package/dist/customize/triggers/schedule/trigger-composer-logic.js +64 -3
  153. package/dist/customize/triggers/schedule/trigger-composer.js +57 -20
  154. package/dist/customize/triggers/schedule/trigger-edit-logic.js +18 -5
  155. package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -0
  156. package/dist/customize/triggers/schedule/trigger-filter.js +16 -0
  157. package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -0
  158. package/dist/customize/triggers/schedule/trigger-toast.js +2 -1
  159. package/dist/customize/triggers/schedule/use-trigger-mutations.d.ts +1 -1
  160. package/dist/customize/triggers/schedule/use-trigger-mutations.js +1 -1
  161. package/dist/customize/triggers/schedule/when-app.d.ts +15 -0
  162. package/dist/customize/triggers/schedule/when-app.js +21 -0
  163. package/dist/customize/triggers/schedule/when-change-request.d.ts +10 -0
  164. package/dist/customize/triggers/schedule/when-change-request.js +15 -0
  165. package/dist/customize/triggers/schedule-view.d.ts +17 -3
  166. package/dist/customize/triggers/schedule-view.js +46 -16
  167. package/dist/customize/triggers/triggers-page.d.ts +3 -3
  168. package/dist/customize/triggers/triggers-page.js +2 -2
  169. package/dist/customize/use-configure-thread.d.ts +8 -2
  170. package/dist/customize/use-configure-thread.js +30 -18
  171. package/dist/files/project/components/change-request-detail-dialog.js +2 -3
  172. package/dist/files/project/components/drive-explorer.js +6 -5
  173. package/dist/files/project/explorer-source.d.ts +3 -0
  174. package/dist/files/project/upload-batch.d.ts +3 -3
  175. package/dist/files/project/upload-batch.js +7 -6
  176. package/dist/files/runtime/sandbox-explorer-source.js +3 -3
  177. package/dist/i18n/en.d.ts +1330 -53
  178. package/dist/i18n/en.js +1422 -145
  179. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +16 -7
  180. package/dist/internal/auth/auth-primitives.d.ts +1 -3
  181. package/dist/internal/auth/auth-primitives.js +2 -2
  182. package/dist/internal/billing/session-cost-format.d.ts +1 -0
  183. package/dist/internal/billing/session-cost-format.js +11 -0
  184. package/dist/internal/components/agent-mark.d.ts +12 -1
  185. package/dist/internal/components/agent-mark.js +34 -11
  186. package/dist/internal/components/nav-rail.d.ts +22 -0
  187. package/dist/internal/components/nav-rail.js +16 -0
  188. package/dist/internal/components/repository-disconnected.js +2 -2
  189. package/dist/internal/goals/goal-meta.d.ts +15 -1
  190. package/dist/internal/goals/goal-meta.js +42 -2
  191. package/dist/internal/hooks/projects/use-agent-config.d.ts +11 -7
  192. package/dist/internal/hooks/projects/use-agent-config.js +28 -11
  193. package/dist/internal/hooks/use-slash-focus.d.ts +7 -1
  194. package/dist/internal/hooks/use-slash-focus.js +9 -3
  195. package/dist/internal/layout/project-capability-nav.d.ts +24 -0
  196. package/dist/internal/layout/project-capability-nav.js +86 -0
  197. package/dist/internal/layout/project-page-header.d.ts +1 -1
  198. package/dist/internal/layout/project-page-header.js +1 -1
  199. package/dist/internal/layout/project-settings-nav.d.ts +3 -2
  200. package/dist/internal/layout/project-settings-nav.js +5 -3
  201. package/dist/internal/lib/browser-noise/rules/old-browsers.js +1 -1
  202. package/dist/internal/lib/capability-tab-routes.d.ts +34 -3
  203. package/dist/internal/lib/capability-tab-routes.js +76 -8
  204. package/dist/internal/lib/manifest-health.d.ts +10 -0
  205. package/dist/internal/lib/manifest-health.js +20 -0
  206. package/dist/internal/lib/pixel-mark.d.ts +4 -1
  207. package/dist/internal/lib/pixel-mark.js +33 -6
  208. package/dist/internal/lib/project-actions.d.ts +1 -1
  209. package/dist/internal/lib/project-actions.js +0 -4
  210. package/dist/internal/lib/provider-branding.js +2 -0
  211. package/dist/internal/lib/space-scope.d.ts +29 -0
  212. package/dist/internal/lib/space-scope.js +28 -0
  213. package/dist/internal/lib/use-project-feature-flags.js +3 -3
  214. package/dist/internal/lib/web-notifications.d.ts +74 -8
  215. package/dist/internal/lib/web-notifications.js +243 -117
  216. package/dist/internal/notifications/notification-rows.d.ts +14 -7
  217. package/dist/internal/notifications/notification-rows.js +21 -14
  218. package/dist/internal/notifications/session-toast-cards.d.ts +2 -2
  219. package/dist/internal/reminders/reminder-format.d.ts +6 -2
  220. package/dist/internal/reminders/reminder-format.js +7 -1
  221. package/dist/internal/stores/active-space-store.d.ts +35 -0
  222. package/dist/internal/stores/active-space-store.js +29 -0
  223. package/dist/internal/stores/kortix-computer-store.js +13 -4
  224. package/dist/internal/stores/pinned-agents-store.d.ts +26 -0
  225. package/dist/internal/stores/pinned-agents-store.js +20 -0
  226. package/dist/internal/stores/session-panel-memory-store.js +3 -0
  227. package/dist/internal/stores/turn-attention-store.d.ts +5 -4
  228. package/dist/lib/routes.d.ts +16 -1
  229. package/dist/lib/routes.js +15 -3
  230. package/dist/markdown/doc-editor/doc-embed.d.ts +31 -0
  231. package/dist/markdown/doc-editor/doc-embed.js +168 -0
  232. package/dist/markdown/doc-editor/doc-extensions.d.ts +26 -0
  233. package/dist/markdown/doc-editor/doc-extensions.js +149 -0
  234. package/dist/markdown/doc-editor/doc-menus.d.ts +9 -0
  235. package/dist/markdown/doc-editor/doc-menus.js +56 -0
  236. package/dist/markdown/doc-editor/markdown.d.ts +12 -0
  237. package/dist/markdown/doc-editor/markdown.js +140 -0
  238. package/dist/markdown/genui/components/inline.d.ts +1 -1
  239. package/dist/primitives/badge.d.ts +1 -1
  240. package/dist/primitives/button.d.ts +1 -1
  241. package/dist/primitives/pixel-kortix-mark.d.ts +5 -4
  242. package/dist/primitives/pixel-kortix-mark.js +5 -15
  243. package/dist/primitives/tag.d.ts +1 -1
  244. package/dist/primitives/textarea.js +14 -0
  245. package/dist/primitives/toast.d.ts +2 -0
  246. package/dist/primitives/toast.js +4 -2
  247. package/dist/providers/ui-provider.d.ts +16 -0
  248. package/dist/session/actions/session-label.d.ts +1 -1
  249. package/dist/session/actions/session-label.js +3 -3
  250. package/dist/session/agents/agent-model.d.ts +92 -0
  251. package/dist/session/agents/agent-model.js +123 -0
  252. package/dist/session/agents/agent-state-mark.d.ts +10 -0
  253. package/dist/session/agents/agent-state-mark.js +22 -0
  254. package/dist/session/agents/agent-strip.d.ts +58 -0
  255. package/dist/session/agents/agent-strip.js +259 -0
  256. package/dist/session/agents/held-messages.d.ts +33 -0
  257. package/dist/session/agents/held-messages.js +50 -0
  258. package/dist/session/agents/legacy-subagent-chat.d.ts +11 -0
  259. package/dist/session/agents/legacy-subagent-chat.js +19 -0
  260. package/dist/session/agents/session-peek.d.ts +20 -0
  261. package/dist/session/agents/session-peek.js +67 -0
  262. package/dist/session/agents/session-prompt.d.ts +13 -0
  263. package/dist/session/agents/session-prompt.js +18 -0
  264. package/dist/session/agents/steer-session.d.ts +13 -0
  265. package/dist/session/agents/steer-session.js +29 -0
  266. package/dist/session/agents/subagent-dialog-content.d.ts +11 -0
  267. package/dist/session/agents/subagent-dialog-content.js +115 -0
  268. package/dist/session/agents/subagent-view.d.ts +8 -0
  269. package/dist/session/agents/subagent-view.js +18 -0
  270. package/dist/session/agents/tasks-panel.d.ts +13 -0
  271. package/dist/session/agents/tasks-panel.js +41 -0
  272. package/dist/session/agents/workflow-run-controls.d.ts +43 -0
  273. package/dist/session/agents/workflow-run-controls.js +141 -0
  274. package/dist/session/composer/ComposerCard.d.ts +1 -1
  275. package/dist/session/composer/ComposerCard.js +3 -3
  276. package/dist/session/composer/agent-selector.js +13 -19
  277. package/dist/session/composer/composer-underbar.d.ts +3 -1
  278. package/dist/session/composer/composer-underbar.js +2 -2
  279. package/dist/session/composer/composer.d.ts +5 -0
  280. package/dist/session/composer/composer.js +16 -10
  281. package/dist/session/composer/editor/composer-editor.js +19 -8
  282. package/dist/session/composer/editor/ultracode.d.ts +34 -0
  283. package/dist/session/composer/editor/ultracode.js +127 -0
  284. package/dist/session/composer/send-blockers.d.ts +1 -11
  285. package/dist/session/composer/send-blockers.js +1 -11
  286. package/dist/session/composer/session-composer-readiness.d.ts +1 -28
  287. package/dist/session/composer/session-composer-readiness.js +5 -16
  288. package/dist/session/header/reminder-parts.d.ts +1 -1
  289. package/dist/session/header/session-site-header.js +6 -3
  290. package/dist/session/header/subagent-hover-card.d.ts +0 -2
  291. package/dist/session/header/subagent-hover-card.js +1 -4
  292. package/dist/session/models/claude-connection-slot.d.ts +11 -0
  293. package/dist/session/models/claude-connection-slot.js +30 -0
  294. package/dist/session/models/model-availability.d.ts +3 -1
  295. package/dist/session/models/model-availability.js +3 -0
  296. package/dist/session/models/model-selector.js +11 -12
  297. package/dist/session/models/model-tags.d.ts +9 -0
  298. package/dist/session/models/model-tags.js +8 -0
  299. package/dist/session/panel/easy/easy-panel.js +1 -1
  300. package/dist/session/panel/easy/step-icon.js +5 -1
  301. package/dist/session/panel/mobile-tool-drawer.js +1 -1
  302. package/dist/session/panel/session-action-panel-column.js +1 -1
  303. package/dist/session/panel/session-desktop.js +41 -14
  304. package/dist/session/panel/session-panel-provider.d.ts +1 -1
  305. package/dist/session/panel/session-panel-provider.js +7 -11
  306. package/dist/session/prompts/question-prompt.js +3 -1
  307. package/dist/session/status/session-error-banner.js +4 -1
  308. package/dist/session/thread/session-chat.js +286 -296
  309. package/dist/session/thread/session-context-modal.js +29 -10
  310. package/dist/session/thread/session-context-spawned-sessions.d.ts +13 -0
  311. package/dist/session/thread/session-context-spawned-sessions.js +44 -0
  312. package/dist/session/thread/session-context-sub-sessions.js +3 -8
  313. package/dist/session/thread/transcript.d.ts +3 -0
  314. package/dist/session/thread/transcript.js +32 -8
  315. package/dist/session/tool/shared/full-view-action.d.ts +29 -0
  316. package/dist/session/tool/shared/full-view-action.js +43 -0
  317. package/dist/session/tool/tool-part-renderer.js +10 -2
  318. package/dist/session/tool/tools/agent-message-tool.js +2 -2
  319. package/dist/session/tool/tools/agent-spawn-tool.js +2 -2
  320. package/dist/session/tool/tools/agent-status-tool.js +2 -2
  321. package/dist/session/tool/tools/kortix-action-tool.d.ts +2 -0
  322. package/dist/session/tool/tools/kortix-action-tool.js +148 -0
  323. package/dist/session/tool/tools/kortix-tool-card.d.ts +83 -0
  324. package/dist/session/tool/tools/kortix-tool-card.js +186 -0
  325. package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +11 -0
  326. package/dist/session/tool/tools/multi-agent-tool-bodies.js +141 -0
  327. package/dist/session/tool/tools/multi-agent-tool-data.d.ts +63 -0
  328. package/dist/session/tool/tools/multi-agent-tool-data.js +118 -0
  329. package/dist/session/tool/tools/multi-agent-tools.d.ts +9 -0
  330. package/dist/session/tool/tools/multi-agent-tools.js +38 -0
  331. package/dist/session/tool/tools/question-tool.js +1 -1
  332. package/dist/session/tool/tools/register.d.ts +3 -0
  333. package/dist/session/tool/tools/register.js +3 -0
  334. package/dist/session/tool/tools/session-spawn-tool.js +2 -2
  335. package/dist/session/tool/tools/task-tool.d.ts +1 -1
  336. package/dist/session/tool/tools/task-tool.js +29 -41
  337. package/dist/session/tool/tools/workflow-progress.d.ts +34 -0
  338. package/dist/session/tool/tools/workflow-progress.js +186 -0
  339. package/dist/session/tool/tools/workflow-run.d.ts +128 -0
  340. package/dist/session/tool/tools/workflow-run.js +251 -0
  341. package/dist/session/tool/tools/workflow-tool.d.ts +9 -0
  342. package/dist/session/tool/tools/workflow-tool.js +253 -0
  343. package/dist/session/turn/notice-batch-group.d.ts +12 -0
  344. package/dist/session/turn/notice-batch-group.js +17 -0
  345. package/dist/session/turn/peer-message-row.d.ts +14 -0
  346. package/dist/session/turn/peer-message-row.js +57 -0
  347. package/dist/session/turn/subagent-notice-row.d.ts +4 -0
  348. package/dist/session/turn/subagent-notice-row.js +50 -0
  349. package/dist/session/turn/subagent-notice.d.ts +58 -0
  350. package/dist/session/turn/subagent-notice.js +111 -0
  351. package/dist/session/turn/user-message.js +24 -5
  352. package/dist/styles/tokens.css +2 -0
  353. package/dist/styles.css +1 -1
  354. package/dist/terminal/session-terminal-connect-bar.js +1 -1
  355. package/dist/workspace/admin/project-admin-dashboard.d.ts +53 -0
  356. package/dist/workspace/admin/project-admin-dashboard.js +252 -0
  357. package/dist/workspace/admin/project-admin-nav.d.ts +20 -0
  358. package/dist/workspace/admin/project-admin-nav.js +41 -0
  359. package/dist/workspace/home/welcome-body.js +25 -3
  360. package/dist/workspace/index.d.ts +6 -2
  361. package/dist/workspace/index.js +12 -2
  362. package/dist/workspace/layout/new-session-create.js +3 -3
  363. package/dist/workspace/layout/project-home.js +3 -3
  364. package/dist/workspace/memory/memory-labels.js +5 -0
  365. package/dist/workspace/repository-disconnected.js +2 -2
  366. package/dist/workspace/sessions/board-dispatch.d.ts +52 -0
  367. package/dist/workspace/sessions/board-dispatch.js +110 -0
  368. package/dist/workspace/sessions/board-grouping.d.ts +63 -0
  369. package/dist/workspace/sessions/board-grouping.js +141 -0
  370. package/dist/workspace/sessions/board-peek.d.ts +15 -0
  371. package/dist/workspace/sessions/board-peek.js +54 -0
  372. package/dist/workspace/sessions/board-state-mark.d.ts +15 -0
  373. package/dist/workspace/sessions/board-state-mark.js +24 -0
  374. package/dist/workspace/sessions/project-sessions-view.js +42 -31
  375. package/dist/workspace/sessions/sessions-board.d.ts +12 -0
  376. package/dist/workspace/sessions/sessions-board.js +214 -0
  377. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +46 -0
  378. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +85 -0
  379. package/dist/workspace/sidebar/footer/sidebar-alert.js +1 -1
  380. package/dist/workspace/sidebar/new-agent-modal-provider.d.ts +12 -0
  381. package/dist/workspace/sidebar/new-agent-modal-provider.js +19 -0
  382. package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
  383. package/dist/workspace/sidebar/project-nav-items.js +53 -5
  384. package/dist/workspace/sidebar/project-session-list.js +35 -12
  385. package/dist/workspace/sidebar/project-sidebar.js +6 -3
  386. package/dist/workspace/sidebar/session-filter-menu.js +2 -1
  387. package/dist/workspace/space/space-blocks.d.ts +25 -0
  388. package/dist/workspace/space/space-blocks.js +124 -0
  389. package/dist/workspace/space/space-filter-tabs.d.ts +17 -0
  390. package/dist/workspace/space/space-filter-tabs.js +31 -0
  391. package/dist/workspace/space/space-page.d.ts +24 -0
  392. package/dist/workspace/space/space-page.js +157 -0
  393. package/dist/workspace/space/space-room.d.ts +20 -0
  394. package/dist/workspace/space/space-room.js +27 -0
  395. package/dist/workspace/space/space-tab-menu.d.ts +14 -0
  396. package/dist/workspace/space/space-tab-menu.js +127 -0
  397. package/dist/workspace/space/space-tab-panels.d.ts +9 -0
  398. package/dist/workspace/space/space-tab-panels.js +203 -0
  399. package/dist/workspace/space/space-templates.d.ts +34 -0
  400. package/dist/workspace/space/space-templates.js +71 -0
  401. package/dist/workspace/space/use-space-filter.d.ts +10 -0
  402. package/dist/workspace/space/use-space-filter.js +40 -0
  403. package/dist/workspace/space/use-space-manifest.d.ts +8 -0
  404. package/dist/workspace/space/use-space-manifest.js +27 -0
  405. package/dist/workspace/spaces/space-timeline.js +2 -2
  406. package/package.json +56 -53
  407. package/skills/kortix-ui/SKILL.md +1 -1
  408. package/skills/kortix-ui/references/custom-dashboard.md +10 -4
  409. package/skills/kortix-ui/references/modules.md +10 -8
  410. package/dist/_vendor/shared/meta-agent.d.ts +0 -7
  411. package/dist/customize/agents/agent-grant-pages.d.ts +0 -37
  412. package/dist/customize/agents/agent-grant-pages.js +0 -226
  413. package/dist/customize/agents/agent-triggers-section.d.ts +0 -17
  414. package/dist/customize/agents/agent-triggers-section.js +0 -109
  415. package/dist/customize/migrate-to-v2/index.d.ts +0 -5
  416. package/dist/customize/migrate-to-v2/index.js +0 -5
  417. package/dist/customize/migrate-to-v2/migration-prompt.d.ts +0 -16
  418. package/dist/customize/migrate-to-v2/migration-prompt.js +0 -59
  419. package/dist/customize/migrate-to-v2/upgrade-defs.d.ts +0 -30
  420. package/dist/customize/migrate-to-v2/upgrade-defs.js +0 -43
  421. package/dist/customize/migrate-to-v2/upgrade-view.d.ts +0 -32
  422. package/dist/customize/migrate-to-v2/upgrade-view.js +0 -152
  423. package/dist/customize/migrate-to-v2/use-run-upgrade.d.ts +0 -18
  424. package/dist/customize/migrate-to-v2/use-run-upgrade.js +0 -16
  425. package/dist/customize/shared/capability-tabs.d.ts +0 -3
  426. package/dist/customize/shared/capability-tabs.js +0 -137
  427. package/dist/customize/skills/skill-scope.d.ts +0 -14
  428. package/dist/customize/skills/skill-scope.js +0 -18
  429. package/dist/internal/lib/manifest-version.d.ts +0 -21
  430. package/dist/internal/lib/manifest-version.js +0 -55
  431. package/dist/session/composer/hooks/use-composer-escape-stop.d.ts +0 -6
  432. package/dist/session/composer/hooks/use-composer-escape-stop.js +0 -28
  433. package/dist/session/thread/sub-session-modal-content.d.ts +0 -8
  434. package/dist/session/thread/sub-session-modal-content.js +0 -23
  435. package/dist/session/thread/sub-session-modal.d.ts +0 -2
  436. package/dist/session/thread/sub-session-modal.js +0 -14
  437. package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.d.ts +0 -13
  438. package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.js +0 -48
@@ -6,12 +6,13 @@ import { Modal, ModalBody, ModalClose, ModalContent, ModalHeader, ModalTitle, }
6
6
  import { Close } from '../../icons/close.js';
7
7
  import { useModelPricingLookup } from '../../internal/lib/model-pricing.js';
8
8
  import { cn } from '../../lib/utils.js';
9
- import { formatUsdAsCredits } from '../../_vendor/kortix-shared.js';
10
- import { useSessionLog, useSessionLogOlder, useSessionLogThread, useSessionMessages, } from '@kortix/sdk/react';
9
+ import { formatSessionCostUsd } from '../../internal/billing/session-cost-format.js';
10
+ import { useSessionLog, useSessionLogOlder, useSessionLogThread, useSessionMessages, useSessionUsage, } from '@kortix/sdk/react';
11
11
  import { useEffect, useMemo } from 'react';
12
12
  import { CopyAllButton, rawExplorerData, SessionContextMessageExplorer, } from './session-context-message-explorer.js';
13
13
  import { getSessionContextMetrics, sessionStartedAt } from './session-context-metrics.js';
14
14
  import { SubSessionSection } from './session-context-sub-sessions.js';
15
+ import { SpawnedSessionSection } from './session-context-spawned-sessions.js';
15
16
  const BREAKDOWN_ORDER = ['system', 'user', 'assistant', 'tool', 'other'];
16
17
  const BREAKDOWN_SEGMENT_CLASS = {
17
18
  system: 'bg-kortix-blue',
@@ -147,10 +148,9 @@ function OverviewStat({ label, value, meta, valueClassName, }) {
147
148
  // subscriptions and metric computations cost nothing during streaming.
148
149
  // ============================================================================
149
150
  const NO_MESSAGES = [];
150
- function SessionContextModalBody({ detachedRows, source, session, sessionRow, providers, allSessions, servedModel, billedCost, }) {
151
+ function SessionContextModalBody({ detachedRows, source, session, sessionRow, providers, allSessions, servedModel, billedCost, onClose, }) {
151
152
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
152
153
  const t = useTranslations('hardcodedUi.componentsSessionSessionContextModal');
153
- const tCredits = useTranslations('settings.credits');
154
154
  const pricingLookup = useModelPricingLookup(providers);
155
155
  // The numbers read the session log's root thread: the `fromV1` view of the
156
156
  // v1 rows while v2 is off, the API's record on v2. The raw explorer and Copy
@@ -171,6 +171,27 @@ function SessionContextModalBody({ detachedRows, source, session, sessionRow, pr
171
171
  const v1Rows = useSessionMessages(readsV1Rows ? source : { ...source, runtimeSessionId: null, opencodeSessionId: null });
172
172
  const raw = useMemo(() => rawExplorerData(logSource, thread?.messages, detachedRows ?? v1Rows), [logSource, thread, detachedRows, v1Rows]);
173
173
  const metrics = useMemo(() => getSessionContextMetrics(thread, providers, pricingLookup), [thread, providers, pricingLookup]);
174
+ // What the session and every session it spawned cost, from the gateway's
175
+ // ledger: the amount billed, in USD. A sub-agent in the session's sandbox
176
+ // bills under the session itself. A chat with no source has no ids: the
177
+ // transcript's estimate stands in, as it does when the read fails.
178
+ const usageQuery = useSessionUsage(source.projectId || null, source.sessionId || null);
179
+ const ledger = usageQuery.data;
180
+ const estimatedCost = billedCost ?? metrics.totalCost;
181
+ const totalCost = ledger ? ledger.total.cost : usageQuery.isError || !source.sessionId ? estimatedCost : null;
182
+ const ownLedger = ledger?.sessions[0];
183
+ const spawnedCount = ledger ? ledger.sessions.length - 1 : 0;
184
+ const costMeta = ledger
185
+ ? spawnedCount > 0 && ownLedger
186
+ ? t('costSplit', {
187
+ own: formatSessionCostUsd(ownLedger.cost),
188
+ spawned: formatSessionCostUsd(ledger.total.cost - ownLedger.cost),
189
+ count: spawnedCount,
190
+ })
191
+ : undefined
192
+ : totalCost != null
193
+ ? t.raw('costEstimated')
194
+ : undefined;
174
195
  const ctx = metrics.context;
175
196
  const fmt = useMemo(() => createFormatter(), []);
176
197
  const counts = metrics.messages;
@@ -208,10 +229,7 @@ function SessionContextModalBody({ detachedRows, source, session, sessionRow, pr
208
229
  : undefined;
209
230
  return (_jsxs(_Fragment, { children: [_jsx(ModalHeader, { children: _jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsx(ModalTitle, { children: t.raw('title') }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(CopyAllButton, { value: raw.copy, copyLabel: t.raw('copyJson'), copiedLabel: t.raw('copied') }), _jsx(ModalClose, { asChild: true, children: _jsxs(Button, { variant: "ghost", className: "size-8 p-0", children: [_jsx(Close, { className: "text-primary size-4 stroke-1" }), _jsx("span", { className: "sr-only", children: tI18nComplete.raw('text7d9eb7acb13e') })] }) })] })] }) }), _jsxs(ModalBody, { className: "space-y-6", children: [_jsxs("div", { className: "flex flex-wrap items-start gap-x-12 gap-y-4", children: [_jsx(OverviewStat, { label: t.raw('statModel'), value: servedModel?.served ?? ctx?.modelLabel ?? '—', meta: servedModel
210
231
  ? `${tI18nComplete.raw('servedModelInPlaceOf')} ${servedModel.fallbackFrom}`
211
- : ctx?.providerLabel }), _jsx(OverviewStat, { label: t.raw('statCost'), value: tCredits('creditCount', {
212
- count: (billedCost ?? metrics.totalCost) * 100,
213
- formatted: formatUsdAsCredits(billedCost ?? metrics.totalCost),
214
- }) }), _jsx(OverviewStat, { label: t.raw('statMessages'), value: counts.all.toLocaleString() })] }), _jsxs("div", { className: "grid gap-x-12 gap-y-8 lg:grid-cols-2", children: [_jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-baseline justify-between gap-4", children: [_jsx("span", { className: "text-foreground text-sm font-medium", children: t.raw('statContextUsed') }), _jsx("span", { className: cn('text-foreground text-sm font-semibold tabular-nums', usageTone), children: fmt.percent(ctx?.usage) })] }), (usageFraction != null || barSegments.length > 0) && (_jsxs(_Fragment, { children: [_jsx("div", { className: "bg-muted flex h-2 w-full overflow-hidden rounded-full", children: barSegments.length > 0 ? (barSegments.map((segment) => (_jsx("div", { className: cn('h-full', BREAKDOWN_SEGMENT_CLASS[segment.key]), style: { width: `${segment.width}%` } }, segment.key)))) : (_jsx("div", { className: "bg-foreground h-full", style: {
232
+ : ctx?.providerLabel }), _jsx(OverviewStat, { label: t.raw('statCost'), value: totalCost == null ? '—' : formatSessionCostUsd(totalCost), meta: costMeta }), _jsx(OverviewStat, { label: t.raw('statMessages'), value: counts.all.toLocaleString() })] }), _jsxs("div", { className: "grid gap-x-12 gap-y-8 lg:grid-cols-2", children: [_jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-baseline justify-between gap-4", children: [_jsx("span", { className: "text-foreground text-sm font-medium", children: t.raw('statContextUsed') }), _jsx("span", { className: cn('text-foreground text-sm font-semibold tabular-nums', usageTone), children: fmt.percent(ctx?.usage) })] }), (usageFraction != null || barSegments.length > 0) && (_jsxs(_Fragment, { children: [_jsx("div", { className: "bg-muted flex h-2 w-full overflow-hidden rounded-full", children: barSegments.length > 0 ? (barSegments.map((segment) => (_jsx("div", { className: cn('h-full', BREAKDOWN_SEGMENT_CLASS[segment.key]), style: { width: `${segment.width}%` } }, segment.key)))) : (_jsx("div", { className: "bg-foreground h-full", style: {
215
233
  width: `${(usageFraction ?? 0) > 0 ? Math.max((usageFraction ?? 0) * 100, 1.5) : 0}%`,
216
234
  } })) }), usageFraction != null && (_jsxs("div", { className: "text-muted-foreground text-right text-xs tabular-nums", children: [fmt.number(ctx?.total), " / ", fmt.number(ctx?.limit)] }))] })), breakdown.length > 0 && (_jsx("ul", { className: "space-y-2 pt-1", children: breakdown.map((segment) => (_jsxs("li", { className: "flex items-center gap-2 text-xs", children: [_jsx("span", { className: cn('size-2 shrink-0 rounded-sm', BREAKDOWN_SEGMENT_CLASS[segment.key]) }), _jsx("span", { className: "text-foreground", children: t.raw(BREAKDOWN_LABEL_KEY[segment.key]) }), _jsxs("span", { className: "text-muted-foreground ml-auto tabular-nums", children: [fmt.number(segment.tokens), " \u00B7 ", segment.percent, "%"] })] }, segment.key))) }))] }), _jsxs("section", { className: "space-y-3", children: [_jsx("span", { className: "text-foreground text-sm font-medium", children: t.raw('detailsLabel') }), _jsx("dl", { className: "divide-border/60 divide-y", children: [
217
235
  { label: t.raw('detailInput'), value: fmt.number(ctx?.input) },
@@ -221,6 +239,7 @@ function SessionContextModalBody({ detachedRows, source, session, sessionRow, pr
221
239
  label: t.raw('detailCache'),
222
240
  value: `${fmt.number(ctx?.cacheRead)} / ${fmt.number(ctx?.cacheWrite)}`,
223
241
  },
242
+ { label: t.raw('detailModelRequests'), value: fmt.number(ownLedger?.request_count) },
224
243
  { label: t.raw('detailUserMessages'), value: counts.user.toLocaleString() },
225
244
  {
226
245
  label: t.raw('detailAssistantMessages'),
@@ -228,8 +247,8 @@ function SessionContextModalBody({ detachedRows, source, session, sessionRow, pr
228
247
  },
229
248
  { label: t.raw('detailStarted'), value: fmt.time(sessionStartedAt(session, sessionRow)) },
230
249
  { label: t.raw('detailLastReply'), value: fmt.time(ctx ? Date.parse(ctx.message.created_at) : undefined) },
231
- ].map((row) => (_jsxs("div", { className: "flex items-baseline justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [_jsx("dt", { className: "text-muted-foreground text-xs", children: row.label }), _jsx("dd", { className: "text-foreground text-xs font-medium tabular-nums", children: row.value })] }, row.label))) })] })] }), _jsx(SubSessionSection, { source: source, session: session, allSessions: allSessions, pricingLookup: pricingLookup, fmt: fmt }), _jsx(SessionContextMessageExplorer, { rows: raw.rows, formatTime: fmt.time, count: counts.all })] })] }));
250
+ ].map((row) => (_jsxs("div", { className: "flex items-baseline justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [_jsx("dt", { className: "text-muted-foreground text-xs", children: row.label }), _jsx("dd", { className: "text-foreground text-xs font-medium tabular-nums", children: row.value })] }, row.label))) })] })] }), _jsx(SpawnedSessionSection, { usage: ledger, projectId: source.projectId, onNavigate: onClose }), _jsx(SubSessionSection, { source: source, session: session, allSessions: allSessions, pricingLookup: pricingLookup, fmt: fmt }), _jsx(SessionContextMessageExplorer, { rows: raw.rows, formatTime: fmt.time, count: counts.all })] })] }));
232
251
  }
233
252
  export function SessionContextModal({ open, onOpenChange, detachedRows, source, session, sessionRow, providers, allSessions, servedModel, billedCost, }) {
234
- return (_jsx(Modal, { open: open, onOpenChange: onOpenChange, children: _jsx(ModalContent, { className: "max-h-[85vh] lg:max-w-3xl", showCloseButton: false, children: _jsx(SessionContextModalBody, { detachedRows: detachedRows, source: source, session: session, sessionRow: sessionRow, providers: providers, allSessions: allSessions, servedModel: servedModel, billedCost: billedCost }) }) }));
253
+ return (_jsx(Modal, { open: open, onOpenChange: onOpenChange, children: _jsx(ModalContent, { className: "max-h-[85vh] lg:max-w-3xl", showCloseButton: false, children: _jsx(SessionContextModalBody, { detachedRows: detachedRows, source: source, session: session, sessionRow: sessionRow, providers: providers, allSessions: allSessions, servedModel: servedModel, billedCost: billedCost, onClose: () => onOpenChange(false) }) }) }));
235
254
  }
@@ -0,0 +1,13 @@
1
+ import type { SessionUsage } from '@kortix/sdk';
2
+ /**
3
+ * The sessions this session spawned (`parent_session_id`, e.g. `kortix sessions
4
+ * create` from inside it), and the ones they spawned, with what each cost.
5
+ * The rows are the API's ledger read (`useSessionUsage`): the session first,
6
+ * then its descendants depth-first.
7
+ */
8
+ export declare function SpawnedSessionSection({ usage, projectId, onNavigate, }: {
9
+ usage: SessionUsage | undefined;
10
+ projectId: string;
11
+ /** A row's link was followed: close the view. */
12
+ onNavigate?: () => void;
13
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,44 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useMemo } from 'react';
4
+ import { useTranslations } from '../../i18n/index.js';
5
+ import { agentDisplayName } from '../../internal/components/agent-mark.js';
6
+ import { HoverPrefetchLink } from '../../internal/components/hover-prefetch-link.js';
7
+ import { formatSessionCostUsd } from '../../internal/billing/session-cost-format.js';
8
+ import { projectSessionHref } from '../../internal/lib/navigation/session-href.js';
9
+ import { Label } from '../../primitives/label.js';
10
+ /**
11
+ * The sessions this session spawned (`parent_session_id`, e.g. `kortix sessions
12
+ * create` from inside it), and the ones they spawned, with what each cost.
13
+ * The rows are the API's ledger read (`useSessionUsage`): the session first,
14
+ * then its descendants depth-first.
15
+ */
16
+ export function SpawnedSessionSection({ usage, projectId, onNavigate, }) {
17
+ const t = useTranslations('hardcodedUi.componentsSessionSessionContextModal');
18
+ const children = useMemo(() => {
19
+ const map = new Map();
20
+ for (const entry of usage?.sessions.slice(1) ?? []) {
21
+ if (!entry.parent_session_id)
22
+ continue;
23
+ const list = map.get(entry.parent_session_id) ?? [];
24
+ list.push(entry);
25
+ map.set(entry.parent_session_id, list);
26
+ }
27
+ return map;
28
+ }, [usage]);
29
+ if (!usage || (usage.sessions.length < 2 && usage.hidden_sessions === 0))
30
+ return null;
31
+ const root = usage.sessions[0];
32
+ const spawned = usage.sessions.length - 1;
33
+ return (_jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: t.raw('spawnedLabel') }), _jsx("p", { className: "text-muted-foreground text-xs", children: t.raw('spawnedNote') })] }), _jsxs("div", { className: "bg-popover rounded-md border", children: [_jsxs("div", { className: "text-muted-foreground grid grid-cols-[minmax(0,1fr)_auto_auto] gap-x-6 border-b px-4 py-2 text-xs", children: [_jsx("span", { children: t('spawnedCount', { count: spawned }) }), _jsx("span", { className: "text-right", children: t.raw('spawnedRequests') }), _jsx("span", { className: "w-20 text-right", children: t.raw('spawnedCost') })] }), _jsxs("div", { className: "px-2 py-2", children: [_jsx(UsageRow, { entry: root, projectId: projectId, label: t.raw('spawnedThisSession') }), (children.get(root.session_id) ?? []).map((entry) => (_jsx(UsageTreeNode, { entry: entry, childMap: children, projectId: projectId, onNavigate: onNavigate }, entry.session_id)))] }), _jsxs("div", { className: "text-foreground grid grid-cols-[minmax(0,1fr)_auto_auto] gap-x-6 border-t px-4 py-2 text-xs font-medium", children: [_jsx("span", { children: t.raw('spawnedTotal') }), _jsx("span", { className: "text-right tabular-nums", children: usage.total.request_count.toLocaleString() }), _jsx("span", { className: "w-20 text-right tabular-nums", children: formatSessionCostUsd(usage.total.cost) })] })] }), usage.hidden_sessions > 0 && (_jsx("p", { className: "text-muted-foreground text-xs", children: t('spawnedHidden', { count: usage.hidden_sessions }) })), usage.truncated && _jsx("p", { className: "text-muted-foreground text-xs", children: t.raw('spawnedTruncated') })] }));
34
+ }
35
+ function UsageTreeNode({ entry, childMap, projectId, onNavigate, }) {
36
+ const children = childMap.get(entry.session_id) ?? [];
37
+ return (_jsxs("div", { className: "border-border/30 ml-4 flex flex-col border-l pl-3", children: [_jsx(UsageRow, { entry: entry, projectId: projectId, onNavigate: onNavigate }), children.map((child) => (_jsx(UsageTreeNode, { entry: child, childMap: childMap, projectId: projectId, onNavigate: onNavigate }, child.session_id)))] }));
38
+ }
39
+ /** One session: its name (a link to it, except for the session being viewed), requests and cost. */
40
+ function UsageRow({ entry, projectId, label, onNavigate, }) {
41
+ const t = useTranslations('hardcodedUi.componentsSessionSessionContextModal');
42
+ const name = entry.title ?? t.raw('spawnedUntitled');
43
+ return (_jsxs("div", { className: "grid grid-cols-[minmax(0,1fr)_auto_auto] items-baseline gap-x-6 rounded-md px-2 py-1.5 text-xs", children: [_jsxs("span", { className: "flex min-w-0 items-baseline gap-2", children: [label ? (_jsx("span", { className: "text-foreground truncate font-medium", children: label })) : (_jsx(HoverPrefetchLink, { href: projectSessionHref(projectId, entry.session_id), onClick: onNavigate, className: "text-foreground truncate font-medium underline-offset-2 hover:underline", children: name })), entry.agent_name && (_jsx("span", { className: "text-muted-foreground shrink-0 truncate", children: agentDisplayName(entry.agent_name) }))] }), _jsx("span", { className: "text-muted-foreground text-right tabular-nums", children: entry.request_count.toLocaleString() }), _jsx("span", { className: "text-foreground w-20 text-right tabular-nums", children: formatSessionCostUsd(entry.cost) })] }));
44
+ }
@@ -3,7 +3,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
3
3
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
4
4
  import { Button } from '../../primitives/button.js';
5
5
  import { useTranslations } from '../../i18n/index.js';
6
- import { formatUsdAsCredits } from '../../_vendor/kortix-shared.js';
6
+ import { formatSessionCostUsd } from '../../internal/billing/session-cost-format.js';
7
7
  import { Label } from '../../primitives/label.js';
8
8
  import { cn } from '../../lib/utils.js';
9
9
  import { useSessionLogRecord, useSessionLogThread, useSessionSync } from '@kortix/sdk/react';
@@ -68,7 +68,6 @@ function LoadSubAgentThread({ id, scope, onFailed }) {
68
68
  }
69
69
  /** One sub-agent's row: its thread's metrics, and its own children under it. */
70
70
  function SubSessionTreeNode({ id, depth = 0, childMap, allSessions, metrics, messagesSuffix, loadFailed, requested, failed, onSeen, }) {
71
- const tCredits = useTranslations('settings.credits');
72
71
  const [expanded, setExpanded] = useState(depth < 1);
73
72
  const rowRef = useRef(null);
74
73
  const isRequested = requested.has(id);
@@ -91,13 +90,12 @@ function SubSessionTreeNode({ id, depth = 0, childMap, allSessions, metrics, mes
91
90
  const title = allSessions.find((s) => s.id === id)?.title ?? id.slice(0, 12);
92
91
  const children = childMap.get(id) ?? [];
93
92
  const hasChildren = children.length > 0;
94
- return (_jsxs("div", { className: cn('flex flex-col', depth > 0 && 'border-border/30 ml-4 border-l pl-3'), children: [_jsxs("button", { ref: rowRef, onClick: () => hasChildren && setExpanded(!expanded), className: cn('flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs', hasChildren && 'hover:bg-muted/40 cursor-pointer', !hasChildren && 'cursor-default'), children: [hasChildren ? (expanded ? (_jsx(CaretDownIcon, { className: "text-muted-foreground size-3 shrink-0" })) : (_jsx(CaretRightIcon, { className: "text-muted-foreground size-3 shrink-0" }))) : (_jsx("div", { className: "size-3 shrink-0" })), _jsx("span", { className: "text-foreground min-w-0 truncate font-medium", children: title }), own ? (_jsxs(_Fragment, { children: [_jsxs("span", { className: "text-muted-foreground ml-auto shrink-0 text-xs tabular-nums", children: [own.messages.all, " ", messagesSuffix] }), _jsx("span", { className: "text-muted-foreground shrink-0 tabular-nums", children: tCredits('creditCount', { count: own.cost * 100, formatted: formatUsdAsCredits(own.cost) }) })] })) : (
93
+ return (_jsxs("div", { className: cn('flex flex-col', depth > 0 && 'border-border/30 ml-4 border-l pl-3'), children: [_jsxs("button", { ref: rowRef, onClick: () => hasChildren && setExpanded(!expanded), className: cn('flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs', hasChildren && 'hover:bg-muted/40 cursor-pointer', !hasChildren && 'cursor-default'), children: [hasChildren ? (expanded ? (_jsx(CaretDownIcon, { className: "text-muted-foreground size-3 shrink-0" })) : (_jsx(CaretRightIcon, { className: "text-muted-foreground size-3 shrink-0" }))) : (_jsx("div", { className: "size-3 shrink-0" })), _jsx("span", { className: "text-foreground min-w-0 truncate font-medium", children: title }), own ? (_jsxs(_Fragment, { children: [_jsxs("span", { className: "text-muted-foreground ml-auto shrink-0 text-xs tabular-nums", children: [own.messages.all, " ", messagesSuffix] }), _jsx("span", { className: "text-muted-foreground shrink-0 tabular-nums", children: formatSessionCostUsd(own.cost) })] })) : (
95
94
  // No thread yet: loading, not requested, or its read failed. Never a false "0 messages".
96
95
  _jsx("span", { className: "text-muted-foreground ml-auto shrink-0 text-xs", children: failed.has(id) ? loadFailed : '—' }))] }), expanded && hasChildren && (_jsx("div", { className: "flex flex-col", children: children.map((childId) => (_jsx(SubSessionTreeNode, { id: childId, depth: depth + 1, childMap: childMap, allSessions: allSessions, metrics: metrics, messagesSuffix: messagesSuffix, loadFailed: loadFailed, requested: requested, failed: failed, onSeen: onSeen }, childId))) }))] }));
97
96
  }
98
97
  export function SubSessionSection({ source, session, allSessions, pricingLookup, fmt }) {
99
98
  const t = useTranslations('hardcodedUi.componentsSessionSessionContextModal');
100
- const tCredits = useTranslations('settings.credits');
101
99
  const childMap = useMemo(() => (allSessions ? childMapByParent(allSessions) : new Map()), [allSessions]);
102
100
  const descendantIds = useMemo(() => (session ? allDescendantIds(childMap, session.id) : []), [childMap, session]);
103
101
  // The root's own metrics, plus every descendant's (the whole tree, whatever
@@ -131,10 +129,7 @@ export function SubSessionSection({ source, session, allSessions, pricingLookup,
131
129
  const loaded = descendantIds.filter((id) => metrics[id]).length;
132
130
  const totals = sumMetrics([rootMetrics, ...descendantIds.map((id) => metrics[id] ?? NO_METRICS)]);
133
131
  return (_jsxs("section", { className: "space-y-3", children: [!onLog &&
134
- [...requested].map((id) => _jsx(LoadSubAgentThread, { id: id, scope: scope, onFailed: onFailed }, id)), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: t.raw('subAgentsLabel') }), _jsx("p", { className: "text-muted-foreground text-xs", children: t.raw('subAgentsNote') }), loaded < descendantIds.length && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("p", { className: "text-muted-foreground text-xs tabular-nums", children: t('subAgentsLoaded', { loaded, total: descendantIds.length }) }), !allRequested && (_jsx(Button, { variant: "outline", size: "xs", onClick: loadAll, children: t('loadAll') }))] }))] }), _jsxs("div", { className: "bg-popover rounded-md border", children: [_jsxs("div", { className: "grid grid-cols-2 gap-4 px-4 py-4 lg:grid-cols-4", children: [_jsx(Stat, { label: t.raw('combinedCost'), value: tCredits('creditCount', {
135
- count: totals.cost * 100,
136
- formatted: formatUsdAsCredits(totals.cost),
137
- }) }), _jsx(Stat, { label: t.raw('combinedMessages'), value: totals.messages.all.toLocaleString() }), _jsx(Stat, { label: t.raw('tokensIn'), value: fmt.number(totals.tokens.input) }), _jsx(Stat, { label: t.raw('tokensOut'), value: fmt.number(totals.tokens.output) })] }), _jsx("div", { className: "border-t px-2 py-2", children: (childMap.get(session.id) ?? []).map((childId) => (_jsx(SubSessionTreeNode, { id: childId, childMap: childMap, allSessions: allSessions, metrics: metrics, messagesSuffix: t.raw('treeMessages'), loadFailed: t.raw('subAgentLoadFailed'), requested: requested, failed: failed, onSeen: onSeen }, childId))) })] })] }));
132
+ [...requested].map((id) => _jsx(LoadSubAgentThread, { id: id, scope: scope, onFailed: onFailed }, id)), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: t.raw('subAgentsLabel') }), _jsx("p", { className: "text-muted-foreground text-xs", children: t.raw('subAgentsNote') }), loaded < descendantIds.length && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("p", { className: "text-muted-foreground text-xs tabular-nums", children: t('subAgentsLoaded', { loaded, total: descendantIds.length }) }), !allRequested && (_jsx(Button, { variant: "outline", size: "xs", onClick: loadAll, children: t('loadAll') }))] }))] }), _jsxs("div", { className: "bg-popover rounded-md border", children: [_jsxs("div", { className: "grid grid-cols-3 gap-4 px-4 py-4", children: [_jsx(Stat, { label: t.raw('combinedMessages'), value: totals.messages.all.toLocaleString() }), _jsx(Stat, { label: t.raw('tokensIn'), value: fmt.number(totals.tokens.input) }), _jsx(Stat, { label: t.raw('tokensOut'), value: fmt.number(totals.tokens.output) })] }), _jsx("div", { className: "border-t px-2 py-2", children: (childMap.get(session.id) ?? []).map((childId) => (_jsx(SubSessionTreeNode, { id: childId, childMap: childMap, allSessions: allSessions, metrics: metrics, messagesSuffix: t.raw('treeMessages'), loadFailed: t.raw('subAgentLoadFailed'), requested: requested, failed: failed, onSeen: onSeen }, childId))) })] })] }));
138
133
  } }));
139
134
  }
140
135
  function Stat({ label, value }) {
@@ -2,6 +2,7 @@ import { useTranslations } from '../../i18n/index.js';
2
2
  import { type SessionLogBlock, type SessionLogMessage, type SessionLogTurn, type SessionMessageAuthor, type SessionPrompt, type SessionPromptViewer, type TextBlock, type ToolCallBlock, type SessionLogReferencedText } from '@kortix/sdk';
3
3
  import type { AttachmentUploadStatus, NormalizedAttachment } from '../turn/user-message.js';
4
4
  import type { TurnServedModel } from '../turn/served-model.js';
5
+ import { type NoticeBatchItem, type SubagentNotice } from '../turn/subagent-notice.js';
5
6
  import { type SentAttachment } from '../composer/sent-attachment-previews.js';
6
7
  import { type KortixSystemMessage, type SessionReport } from '../../internal/lib/utils/kortix-system-tags.js';
7
8
  import { type Command, type PermissionRequest, type QuestionRequest } from '../../internal/session-types/index.js';
@@ -289,6 +290,8 @@ export declare function promptTexts(message: SessionLogMessage): PromptText[];
289
290
  * bubble's visibility, and the command pill. */
290
291
  declare function useTurnUserContent({ turn, commandMessages, commands, }: Pick<SessionTurnProps, 'turn' | 'commandMessages' | 'commands'>): {
291
292
  sessionReport: SessionReport | null;
293
+ noticeBatch: NoticeBatchItem[] | null;
294
+ subagentNotice: SubagentNotice | null;
292
295
  systemMessages: KortixSystemMessage[];
293
296
  hasVisibleUserContent: boolean;
294
297
  userMessageText: string;
@@ -50,7 +50,10 @@ import { sessionTurnDurationMs, sessionTurnEndedAt, sessionTurnSpan, } from './s
50
50
  import { Button } from '../../primitives/button.js';
51
51
  import { Disclosure, DisclosureContent, DisclosureTrigger } from '../../primitives/disclosure.js';
52
52
  import { useUserPreferencesStore } from '../../internal/stores/user-preferences-store.js';
53
- import { SubSessionModal } from './sub-session-modal.js';
53
+ import { SubagentDialog } from '../agents/subagent-view.js';
54
+ import { parseNoticeBatch, parseSubagentNotice } from '../turn/subagent-notice.js';
55
+ import { SubagentNoticeRow } from '../turn/subagent-notice-row.js';
56
+ import { NoticeBatchGroup } from '../turn/notice-batch-group.js';
54
57
  import { ToolPartRenderer, TurnLiveContext } from '../tool/tool-renderers.js';
55
58
  import { ImageGenDigestsContext, ImageGenPathsContext, ImageGenRunsContext, InTranscriptTurnContext, RecoveredCallsContext, } from '../tool/shared/infrastructure.js';
56
59
  import { imageDigestsShownByImageGen, imagePathsShownByImageGen, sessionLogImageGenRuns, showDrawnByImageGen } from '@kortix/sdk';
@@ -613,6 +616,27 @@ function useTurnUserContent({ turn, commandMessages, commands, }) {
613
616
  }
614
617
  return null;
615
618
  }, [texts]);
619
+ // Several notices the API coalesced into one prompt (`session-notice-batch.ts`): one group of
620
+ // compact rows. Read whether or not a session report is in it: idle notices carry none.
621
+ const noticeBatch = useMemo(() => {
622
+ for (const t of texts) {
623
+ const batch = parseNoticeBatch(t.text);
624
+ if (batch && batch.length > 1)
625
+ return batch;
626
+ }
627
+ return null;
628
+ }, [texts]);
629
+ // A background subagent's end notice (`subagentNoticeText` in the API): a compact row, not a card.
630
+ const subagentNotice = useMemo(() => {
631
+ if (!sessionReport || noticeBatch)
632
+ return null;
633
+ for (const t of texts) {
634
+ const notice = parseSubagentNotice(t.text);
635
+ if (notice)
636
+ return notice;
637
+ }
638
+ return null;
639
+ }, [texts, sessionReport, noticeBatch]);
616
640
  // Extract kortix_system messages for inline rendering (goal continuations, etc.)
617
641
  const systemMessages = useMemo(() => {
618
642
  const msgs = [];
@@ -624,7 +648,7 @@ function useTurnUserContent({ turn, commandMessages, commands, }) {
624
648
  }, [tI18nComplete, texts]);
625
649
  const hasVisibleUserContent = useMemo(() => {
626
650
  // Session reports render as their own card — don't show as user bubble
627
- if (sessionReport)
651
+ if (sessionReport || noticeBatch)
628
652
  return false;
629
653
  // The prompt is not loaded (a long run's tail): its stand-in has no blocks
630
654
  // and must not render as the empty bubble a loading prompt would.
@@ -645,7 +669,7 @@ function useTurnUserContent({ turn, commandMessages, commands, }) {
645
669
  if (turn.user.blocks.some((b) => b.type === 'harness' && b.kind === 'agent'))
646
670
  return true;
647
671
  return false;
648
- }, [turn.partial, turn.user.blocks, turn.attachments, texts, sessionReport]);
672
+ }, [turn.partial, turn.user.blocks, turn.attachments, texts, sessionReport, noticeBatch]);
649
673
  // User message text — for copy action
650
674
  const userMessageText = useMemo(() => {
651
675
  const out = [];
@@ -675,7 +699,7 @@ function useTurnUserContent({ turn, commandMessages, commands, }) {
675
699
  const source = Array.isArray(commands) ? commands.find((c) => c.name === commandForTurn.name)?.source : undefined;
676
700
  return source === 'skill' ? undefined : commandForTurn;
677
701
  }, [commandForTurn, commands]);
678
- return { sessionReport, systemMessages, hasVisibleUserContent, userMessageText, commandForTurn, commandOutput };
702
+ return { sessionReport, noticeBatch, subagentNotice, systemMessages, hasVisibleUserContent, userMessageText, commandForTurn, commandOutput };
679
703
  }
680
704
  /** The throttled working status of the working turn: one status change per
681
705
  * 2.5 s, keyed on the turn's parts. */
@@ -952,17 +976,17 @@ function TurnCompactionOutcome(props) {
952
976
  * Owns the modal state: it is the only consumer. */
953
977
  function TurnSessionReport({ report }) {
954
978
  const [sessionReportModalOpen, setSessionReportModalOpen] = useState(false);
955
- return (_jsxs(_Fragment, { children: [_jsx(SessionReportCard, { report: report, onOpen: () => setSessionReportModalOpen(true) }), _jsx(SubSessionModal, { open: sessionReportModalOpen, onOpenChange: setSessionReportModalOpen, sessionId: report.sessionId, title: `Worker${report.project ? ` · ${report.project}` : ''}` })] }));
979
+ return (_jsxs(_Fragment, { children: [_jsx(SessionReportCard, { report: report, onOpen: () => setSessionReportModalOpen(true) }), _jsx(SubagentDialog, { open: sessionReportModalOpen, onOpenChange: setSessionReportModalOpen, sessionId: report.sessionId, title: `Worker${report.project ? ` · ${report.project}` : ''}` })] }));
956
980
  }
957
981
  /** The user side of a turn: the report card, the system-pill line, and the
958
982
  * user bubble (hidden for notification-only turns). */
959
983
  function TurnUserBlock(props) {
960
984
  const { userContent } = props;
961
- const { sessionReport, systemMessages, hasVisibleUserContent } = userContent;
985
+ const { sessionReport, noticeBatch, subagentNotice, systemMessages, hasVisibleUserContent } = userContent;
962
986
  // P5.6: the note a partial restore left for the agent is a notice, not a person's prompt.
963
987
  if (isSessionLogRestoreNote(props.turn.user))
964
988
  return _jsx(RestoreNoteMarker, {});
965
- return (_jsxs(_Fragment, { children: [sessionReport && _jsx(TurnSessionReport, { report: sessionReport }), !hasVisibleUserContent && !sessionReport && systemMessages.length > 0 && (_jsx(SystemMessageIndicator, { messages: systemMessages })), hasVisibleUserContent && _jsx(TurnUserBubble, { ...props })] }));
989
+ return (_jsxs(_Fragment, { children: [noticeBatch ? (_jsx(NoticeBatchGroup, { items: noticeBatch })) : subagentNotice ? (_jsx(SubagentNoticeRow, { notice: subagentNotice })) : (sessionReport && _jsx(TurnSessionReport, { report: sessionReport })), !hasVisibleUserContent && !sessionReport && !noticeBatch && systemMessages.length > 0 && (_jsx(SystemMessageIndicator, { messages: systemMessages })), hasVisibleUserContent && _jsx(TurnUserBubble, { ...props })] }));
966
990
  }
967
991
  /** The user message bubble — dimmed while the prompt waits in the queue. */
968
992
  function TurnUserBubble(props) {
@@ -1265,7 +1289,7 @@ function SessionTurnImpl(props) {
1265
1289
  : rows.owner;
1266
1290
  const personName = person ? participantLabel(person) : '';
1267
1291
  const showAnswer = turn.assistant.length > 0 || model.working || !!errors.turnErrorRow.text;
1268
- return (_jsxs("div", { className: "text-factor-[2]", children: [userContent.hasVisibleUserContent || userContent.sessionReport || userContent.systemMessages.length > 0 ? (_jsx(MessageRow
1292
+ return (_jsxs("div", { className: "text-factor-[2]", children: [userContent.hasVisibleUserContent || userContent.sessionReport || userContent.noticeBatch || userContent.systemMessages.length > 0 ? (_jsx(MessageRow
1269
1293
  // The first message's turn clips its toolbar's overhang: it sits inside the row.
1270
1294
  , {
1271
1295
  // The first message's turn clips its toolbar's overhang: it sits inside the row.
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The way into the sub-agent's own session, pinned to the right edge of the row.
3
+ *
4
+ * It used to be a ghost `Button` at the BOTTOM of the disclosure body, and that
5
+ * was wrong twice over. It sat at the body's left margin — the chain's icon
6
+ * gutter — so it read as one more step in the sub-agent's list rather than as
7
+ * an action on the agent. And it was reachable only by expanding the row, which
8
+ * is backwards for a sub-agent that has not produced a step yet: that is the
9
+ * one moment the full view is the ONLY thing there is to look at.
10
+ *
11
+ * A `span role="button"`, not a `<button>`. This node renders inside the
12
+ * disclosure's trigger, and `DisclosureTrigger` clones that trigger into its own
13
+ * `role="button"` element — a button nested in a button is invalid HTML. The
14
+ * subtitle link in `InlineTriggerTitle` is the same shape for the same reason.
15
+ * Both activation paths `stopPropagation` so reaching the full view does not
16
+ * also toggle the row underneath it.
17
+ *
18
+ * Visible label "Full view", accessible name "Open full view". The row already
19
+ * carries a title plus a live subtitle that has to truncate, so the right edge
20
+ * gets the two words that matter; the longer name rides on `aria-label` and
21
+ * `title`, and it CONTAINS the visible text, so WCAG 2.5.3 (Label in Name)
22
+ * holds.
23
+ *
24
+ * Always visible, never hover-revealed: a hover-only affordance does not exist
25
+ * on touch, and this is the only route to a running sub-agent's full transcript.
26
+ */
27
+ export declare function FullViewAction({ onOpen }: {
28
+ onOpen: () => void;
29
+ }): import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useTranslations } from '../../../i18n/index.js';
4
+ import { cn } from '../../../lib/utils.js';
5
+ /**
6
+ * The way into the sub-agent's own session, pinned to the right edge of the row.
7
+ *
8
+ * It used to be a ghost `Button` at the BOTTOM of the disclosure body, and that
9
+ * was wrong twice over. It sat at the body's left margin — the chain's icon
10
+ * gutter — so it read as one more step in the sub-agent's list rather than as
11
+ * an action on the agent. And it was reachable only by expanding the row, which
12
+ * is backwards for a sub-agent that has not produced a step yet: that is the
13
+ * one moment the full view is the ONLY thing there is to look at.
14
+ *
15
+ * A `span role="button"`, not a `<button>`. This node renders inside the
16
+ * disclosure's trigger, and `DisclosureTrigger` clones that trigger into its own
17
+ * `role="button"` element — a button nested in a button is invalid HTML. The
18
+ * subtitle link in `InlineTriggerTitle` is the same shape for the same reason.
19
+ * Both activation paths `stopPropagation` so reaching the full view does not
20
+ * also toggle the row underneath it.
21
+ *
22
+ * Visible label "Full view", accessible name "Open full view". The row already
23
+ * carries a title plus a live subtitle that has to truncate, so the right edge
24
+ * gets the two words that matter; the longer name rides on `aria-label` and
25
+ * `title`, and it CONTAINS the visible text, so WCAG 2.5.3 (Label in Name)
26
+ * holds.
27
+ *
28
+ * Always visible, never hover-revealed: a hover-only affordance does not exist
29
+ * on touch, and this is the only route to a running sub-agent's full transcript.
30
+ */
31
+ export function FullViewAction({ onOpen }) {
32
+ const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
33
+ return (_jsx("span", { role: "button", tabIndex: 0, "aria-label": tI18nComplete.raw('text229fbeec6b2f'), title: tI18nComplete.raw('text229fbeec6b2f'), onClick: (e) => {
34
+ e.stopPropagation();
35
+ onOpen();
36
+ }, onKeyDown: (e) => {
37
+ if (e.key !== 'Enter' && e.key !== ' ')
38
+ return;
39
+ e.preventDefault();
40
+ e.stopPropagation();
41
+ onOpen();
42
+ }, className: cn('text-muted-foreground hover:text-foreground', 'flex cursor-pointer items-center gap-1 whitespace-nowrap', 'underline-offset-2 transition-colors hover:underline'), children: tI18nComplete.raw('textdcc839a4015c') }));
43
+ }
@@ -10,7 +10,9 @@ import { ToolError } from './tool-error.js';
10
10
  import { replyToInlinePermission } from './inline-permission-reply.js';
11
11
  import { errorToast } from '../../primitives/toast.js';
12
12
  import { cn } from '../../lib/utils.js';
13
- import { partError, partStreamingInput } from './shared/infrastructure-parts.js';
13
+ import { partError, partMetadata, partStreamingInput } from './shared/infrastructure-parts.js';
14
+ import { kortixCardTool, parseKortixToolResult } from './tools/kortix-tool-card.js';
15
+ import { isWorkflowTool, parseWorkflowRun } from './tools/workflow-run.js';
14
16
  import { PERMISSION_LABELS, getChildSessionId, shouldShowToolPart, } from '../../internal/session-types/index.js';
15
17
  import { sessionLogCallStatus, sessionLogOpenCall, toolKind } from '@kortix/sdk';
16
18
  import { useTranslations } from '../../i18n/index.js';
@@ -81,7 +83,13 @@ function ToolPartRendererImpl({ call: given, sessionId, permission, question, on
81
83
  // A failed codemode script keeps its partial output and the calls it made before
82
84
  // the failure: its own row draws them, with the error. The image card draws its
83
85
  // failure (with the Connect ChatGPT action) and a stop in place of the image.
84
- const drawsOwnError = childBearingTaskError || call.name === 'codemode' || call.name === 'image_gen';
86
+ // A My Kortix platform call that threw its result keeps its card ("Needs a permission",
87
+ // who can grant it), and a failed workflow keeps its agents' rows and their sessions.
88
+ const drawsOwnError = childBearingTaskError ||
89
+ call.name === 'codemode' ||
90
+ call.name === 'image_gen' ||
91
+ (errorStr !== undefined && kortixCardTool(call.name) !== undefined && parseKortixToolResult(errorStr, call.name) !== null) ||
92
+ (errorStr !== undefined && isWorkflowTool(call.name) && parseWorkflowRun(partMetadata(call)) !== null);
85
93
  if (errorStr !== undefined && !drawsOwnError) {
86
94
  const { display, server } = (() => {
87
95
  const slashIdx = call.name.lastIndexOf('/');
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { SubSessionModal } from '../../thread/sub-session-modal.js';
3
+ import { SubagentDialog } from '../../agents/subagent-view.js';
4
4
  import { BasicTool, isErrorOutput, partInput, partOutput, partStatus, ToolOutputFallback, } from '../shared/infrastructure.js';
5
5
  import { ToolRegistry } from '../shared/registry.js';
6
6
  import { useTranslations } from '../../../i18n/index.js';
@@ -24,6 +24,6 @@ export function AgentMessageTool({ call, defaultOpen, forceOpen }) {
24
24
  title: tI18nComplete.raw('text8833ce4e6595'),
25
25
  subtitle: taskId ? taskId.slice(-12) : undefined,
26
26
  args: isError ? ['failed'] : undefined,
27
- }, onSubtitleClick: hasSession ? () => setModalOpen(true) : undefined, defaultOpen: defaultOpen, forceOpen: forceOpen, children: isError ? (_jsx(ToolOutputFallback, { output: output, toolName: "agent_message" })) : rawMessage ? (_jsx("div", { className: "text-muted-foreground px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap", children: rawMessage })) : null }), hasSession && (_jsx(SubSessionModal, { open: modalOpen, onOpenChange: setModalOpen, sessionId: childSessionId, title: tI18nComplete('text8116da8fa64c', { value0: taskId || 'worker' }) }))] }));
27
+ }, onSubtitleClick: hasSession ? () => setModalOpen(true) : undefined, defaultOpen: defaultOpen, forceOpen: forceOpen, children: isError ? (_jsx(ToolOutputFallback, { output: output, toolName: "agent_message" })) : rawMessage ? (_jsx("div", { className: "text-muted-foreground px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap", children: rawMessage })) : null }), hasSession && (_jsx(SubagentDialog, { open: modalOpen, onOpenChange: setModalOpen, sessionId: childSessionId, title: tI18nComplete('text8116da8fa64c', { value0: taskId || 'worker' }) }))] }));
28
28
  }
29
29
  ToolRegistry.register('agent-message', AgentMessageTool);
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { SubSessionModal } from '../../thread/sub-session-modal.js';
3
+ import { SubagentDialog } from '../../agents/subagent-view.js';
4
4
  import { BasicTool, firstMeaningfulLine, getAgentCardLabel, parseJsonFailure, partInput, partOutput, partStatus, ToolOutputFallback, ToolSurfaceContext, } from '../shared/infrastructure.js';
5
5
  import { OutputBlock } from '../shared/output-block.js';
6
6
  import { ToolRegistry } from '../shared/registry.js';
@@ -59,7 +59,7 @@ export function AgentSpawnTool({ call, defaultOpen, forceOpen }) {
59
59
  // inside the row card's. `-mx-3` cancels the body's horizontal inset
60
60
  // so the `border-t` spans the card edge to edge, `px-3` puts the
61
61
  // content back where it was, and only the top inset survives.
62
- _jsx("div", { className: "border-border/30 -mx-3 border-t px-3 pt-3", children: _jsx(SubAgentActivity, { childSessionId: childSessionId, calls: childCalls }) })), _jsx(SubAgentStatusBanner, { childSessionId: childSessionId, childThread: childThread })] }), hasSession && (_jsx(SubSessionModal, { open: modalOpen, onOpenChange: setModalOpen, sessionId: childSessionId, title: description }))] }));
62
+ _jsx("div", { className: "border-border/30 -mx-3 border-t px-3 pt-3", children: _jsx(SubAgentActivity, { childSessionId: childSessionId, calls: childCalls }) })), _jsx(SubAgentStatusBanner, { childSessionId: childSessionId, childThread: childThread })] }), hasSession && (_jsx(SubagentDialog, { open: modalOpen, onOpenChange: setModalOpen, sessionId: childSessionId, title: description }))] }));
63
63
  }
64
64
  ToolRegistry.register('agent-spawn', AgentSpawnTool);
65
65
  ToolRegistry.register('agent-task', AgentSpawnTool);
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  import { Badge } from '../../../primitives/badge.js';
4
4
  import Loading from '../../../primitives/loading.js';
5
5
  import { STATUS_TEXT } from '../../../primitives/status.js';
6
- import { SubSessionModal } from '../../thread/sub-session-modal.js';
6
+ import { SubagentDialog } from '../../agents/subagent-view.js';
7
7
  import { BasicTool, isErrorOutput, partOutput, partStatus, ToolOutputFallback, } from '../shared/infrastructure.js';
8
8
  import { ToolRegistry } from '../shared/registry.js';
9
9
  import { cn } from '../../../lib/utils.js';
@@ -38,7 +38,7 @@ export function AgentStatusTool({ call, defaultOpen, forceOpen }) {
38
38
  setModalTitle(row.title);
39
39
  }
40
40
  }, className: cn('border-border/20 flex items-center gap-2.5 px-3 py-2', i > 0 && 'border-t', hasSession && 'hover:bg-accent/50 cursor-pointer transition-colors'), children: [isActive ? (_jsx(Loading, { className: "text-muted-foreground size-3 shrink-0" })) : row.status === 'completed' ? (_jsx(Check, { className: cn('size-3 shrink-0', STATUS_TEXT.success) })) : row.status === 'input_needed' ? (_jsx(Clock, { className: cn('size-3 shrink-0', STATUS_TEXT.warning) })) : row.status === 'cancelled' ? (_jsx(X, { className: "text-muted-foreground/40 size-3 shrink-0" })) : (_jsx(Circle, { className: "text-muted-foreground/40 size-3 shrink-0" })), _jsx("span", { className: "text-foreground/80 flex-1 truncate text-xs", children: row.title }), _jsx("span", { className: "text-muted-foreground/50 shrink-0 font-mono text-xs", children: row.id.slice(-8) }), hasSession && (_jsx(ChevronRight, { className: "text-muted-foreground/20 size-3 shrink-0" }))] }, row.id));
41
- }) })), !isRunning && isError && _jsx(ToolOutputFallback, { output: output, toolName: "agent_status" }), !isRunning && !isError && taskRows.length === 0 && cleanedOutput && (_jsx(OutputBlock, { text: cleanedOutput }))] }), modalSessionId && (_jsx(SubSessionModal, { open: !!modalSessionId, onOpenChange: (open) => {
41
+ }) })), !isRunning && isError && _jsx(ToolOutputFallback, { output: output, toolName: "agent_status" }), !isRunning && !isError && taskRows.length === 0 && cleanedOutput && (_jsx(OutputBlock, { text: cleanedOutput }))] }), modalSessionId && (_jsx(SubagentDialog, { open: !!modalSessionId, onOpenChange: (open) => {
42
42
  if (!open)
43
43
  setModalSessionId(null);
44
44
  }, sessionId: modalSessionId, title: modalTitle }))] }));
@@ -0,0 +1,2 @@
1
+ import type { ToolProps } from '../shared/types.js';
2
+ export declare function KortixActionTool(props: ToolProps): import("react").JSX.Element;