@kortix/ui 0.15.10 → 0.16.0

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 (469) hide show
  1. package/dist/_vendor/kortix-shared.js +769 -76
  2. package/dist/_vendor/shared/app-config.d.ts +6 -30
  3. package/dist/_vendor/shared/channel-descriptors.d.ts +0 -34
  4. package/dist/_vendor/shared/channel-header.d.ts +2 -1
  5. package/dist/_vendor/shared/connector-sections.d.ts +0 -25
  6. package/dist/_vendor/shared/file-tags.d.ts +2 -1
  7. package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
  8. package/dist/_vendor/shared/pasted-content.d.ts +0 -4
  9. package/dist/_vendor/shared/pixel-mark.d.ts +0 -17
  10. package/dist/_vendor/shared/project-glyphs.d.ts +0 -1
  11. package/dist/_vendor/shared/session/attachment-tile.d.ts +8 -0
  12. package/dist/_vendor/shared/workspace-settings.d.ts +3 -0
  13. package/dist/access/access/copy-row.d.ts +7 -1
  14. package/dist/access/access/copy-row.js +2 -2
  15. package/dist/animated-copy-icon.js +2 -1
  16. package/dist/browser/sandbox-browser-chrome.d.ts +2 -1
  17. package/dist/browser/sandbox-browser-chrome.js +1 -1
  18. package/dist/customize/agents/agent-cover-card.d.ts +1 -1
  19. package/dist/customize/agents/agent-cover-card.js +10 -2
  20. package/dist/customize/agents/agent-filter.js +3 -1
  21. package/dist/customize/agents/agent-model-view.d.ts +11 -1
  22. package/dist/customize/agents/agent-model-view.js +12 -1
  23. package/dist/customize/agents/agent-overview.d.ts +10 -0
  24. package/dist/customize/agents/agent-overview.js +5 -4
  25. package/dist/customize/agents/agent-page-chrome.d.ts +5 -6
  26. package/dist/customize/agents/agent-page-chrome.js +16 -13
  27. package/dist/customize/agents/agent-page.js +25 -34
  28. package/dist/customize/agents/agent-tabs.d.ts +3 -0
  29. package/dist/customize/agents/agent-tabs.js +3 -0
  30. package/dist/customize/agents/agents-page.js +3 -3
  31. package/dist/customize/agents/create-agent-modal.d.ts +9 -0
  32. package/dist/customize/agents/create-agent-modal.js +21 -3
  33. package/dist/customize/agents/use-default-agent.js +2 -2
  34. package/dist/customize/connectors/connector-identity.d.ts +11 -2
  35. package/dist/customize/connectors/connector-identity.js +16 -4
  36. package/dist/customize/connectors/connectors-page.js +10 -6
  37. package/dist/customize/connectors/detail/app-page.js +2 -2
  38. package/dist/customize/connectors/detail/connector-triggers.js +1 -1
  39. package/dist/customize/connectors/install/install-dialog.d.ts +2 -0
  40. package/dist/customize/connectors/install/install-dialog.js +6 -1
  41. package/dist/customize/connectors/use-agent-access.d.ts +2 -0
  42. package/dist/customize/evals/eval-compare-view.d.ts +10 -0
  43. package/dist/customize/evals/eval-compare-view.js +68 -0
  44. package/dist/customize/evals/eval-dataset-view.d.ts +20 -0
  45. package/dist/customize/evals/eval-dataset-view.js +81 -0
  46. package/dist/customize/evals/eval-datasets-page.d.ts +25 -0
  47. package/dist/customize/evals/eval-datasets-page.js +91 -0
  48. package/dist/customize/evals/eval-job-view.d.ts +12 -0
  49. package/dist/customize/evals/eval-job-view.js +360 -0
  50. package/dist/customize/evals/eval-jobs-page.d.ts +4 -0
  51. package/dist/customize/evals/eval-jobs-page.js +69 -0
  52. package/dist/customize/evals/eval-meta.d.ts +97 -0
  53. package/dist/customize/evals/eval-meta.js +228 -0
  54. package/dist/customize/evals/eval-task-view.d.ts +13 -0
  55. package/dist/customize/evals/eval-task-view.js +123 -0
  56. package/dist/customize/evals/eval-tasks-page.d.ts +8 -0
  57. package/dist/customize/evals/eval-tasks-page.js +56 -0
  58. package/dist/customize/evals/eval-ui.d.ts +97 -0
  59. package/dist/customize/evals/eval-ui.js +153 -0
  60. package/dist/customize/evals/evals-page.d.ts +10 -0
  61. package/dist/customize/evals/evals-page.js +56 -0
  62. package/dist/customize/evals/run-eval-modal.d.ts +28 -0
  63. package/dist/customize/evals/run-eval-modal.js +167 -0
  64. package/dist/customize/project-settings/project-admin-sections.d.ts +3 -2
  65. package/dist/customize/project-settings/project-admin-sections.js +6 -1
  66. package/dist/customize/providers/provider-connect.d.ts +13 -0
  67. package/dist/customize/providers/provider-connect.js +29 -5
  68. package/dist/customize/providers/provider-sheet.js +5 -4
  69. package/dist/customize/sections/component/teams-byo-wizard.js +4 -1
  70. package/dist/customize/sections/view/gateway/gateway-overview.d.ts +5 -0
  71. package/dist/customize/sections/view/gateway/gateway-overview.js +32 -6
  72. package/dist/customize/sections/view/gateway/routing-parts.d.ts +6 -0
  73. package/dist/customize/sections/view/gateway/routing-parts.js +21 -13
  74. package/dist/customize/sections/view/git-view.d.ts +19 -1
  75. package/dist/customize/sections/view/git-view.js +7 -3
  76. package/dist/customize/sections/view/manifest-issue-list.d.ts +16 -0
  77. package/dist/customize/sections/view/manifest-issue-list.js +41 -0
  78. package/dist/customize/sections/view/manifest-issues-row.d.ts +24 -0
  79. package/dist/customize/sections/view/manifest-issues-row.js +39 -0
  80. package/dist/customize/sections/view/sandbox-provider-coverage.d.ts +7 -1
  81. package/dist/customize/sections/view/sandbox-provider-coverage.js +7 -5
  82. package/dist/customize/sections/view/secrets-view.d.ts +13 -0
  83. package/dist/customize/sections/view/secrets-view.js +10 -6
  84. package/dist/customize/sections/view/subscription-usage.d.ts +2 -7
  85. package/dist/customize/sections/view/subscription-usage.js +4 -8
  86. package/dist/customize/settings/settings-tab-header.js +12 -3
  87. package/dist/customize/settings/tabs/experimental-tab.d.ts +16 -5
  88. package/dist/customize/settings/tabs/experimental-tab.js +36 -11
  89. package/dist/customize/settings/tabs/general-tab.js +1 -1
  90. package/dist/customize/settings/tabs/sandbox-tab.d.ts +10 -0
  91. package/dist/customize/settings/tabs/sandbox-tab.js +27 -4
  92. package/dist/customize/settings/tabs/snapshots-tab.d.ts +31 -0
  93. package/dist/customize/settings/tabs/snapshots-tab.js +61 -5
  94. package/dist/customize/settings/tabs/workspace-keys.js +6 -3
  95. package/dist/customize/shared/capability-page-shell.js +9 -1
  96. package/dist/customize/shared/catalog/catalog-card.d.ts +1 -1
  97. package/dist/customize/shared/catalog/catalog-card.js +15 -5
  98. package/dist/customize/shared/customize-tab-bar.js +1 -1
  99. package/dist/customize/shared/new-entity-menu.d.ts +1 -1
  100. package/dist/customize/shared/new-entity-menu.js +38 -1
  101. package/dist/customize/triggers/runtime-triggers.d.ts +4 -0
  102. package/dist/customize/triggers/runtime-triggers.js +33 -3
  103. package/dist/customize/triggers/schedule/event-trigger-copy.js +1 -1
  104. package/dist/customize/triggers/schedule/post-to-field.js +2 -2
  105. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +5 -4
  106. package/dist/customize/triggers/schedule/then-fields.d.ts +5 -1
  107. package/dist/customize/triggers/schedule/then-fields.js +23 -3
  108. package/dist/customize/triggers/schedule/trigger-callouts.js +1 -1
  109. package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +27 -0
  110. package/dist/customize/triggers/schedule/trigger-composer-logic.js +51 -5
  111. package/dist/customize/triggers/schedule/trigger-composer.js +19 -13
  112. package/dist/customize/triggers/schedule/trigger-edit-logic.js +25 -5
  113. package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -3
  114. package/dist/customize/triggers/schedule/trigger-filter.js +7 -6
  115. package/dist/customize/triggers/schedule/trigger-readonly.js +1 -1
  116. package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -1
  117. package/dist/customize/triggers/schedule/when-event.js +1 -1
  118. package/dist/customize/triggers/schedule/when-schedule.d.ts +5 -1
  119. package/dist/customize/triggers/schedule/when-schedule.js +16 -1
  120. package/dist/customize/triggers/schedule-view.js +6 -3
  121. package/dist/files/project/components/drive-explorer.js +33 -70
  122. package/dist/files/project/components/drive-grid-view.d.ts +2 -31
  123. package/dist/files/project/components/drive-grid-view.js +12 -22
  124. package/dist/files/project/components/drive-list-view.d.ts +3 -30
  125. package/dist/files/project/components/drive-list-view.js +8 -18
  126. package/dist/files/project/components/drive-selection-bar.d.ts +4 -5
  127. package/dist/files/project/components/drive-selection-bar.js +13 -20
  128. package/dist/files/project/components/explorer-listing.d.ts +48 -0
  129. package/dist/files/project/components/explorer-listing.js +64 -0
  130. package/dist/files/project/components/file-explorer-page.js +7 -204
  131. package/dist/files/project/components/file-thumbnail.js +3 -1
  132. package/dist/files/project/components/manifest-issue-mark.d.ts +9 -0
  133. package/dist/files/project/components/manifest-issue-mark.js +26 -0
  134. package/dist/files/project/hooks/use-change-requests.d.ts +10 -0
  135. package/dist/files/project/hooks/use-change-requests.js +17 -0
  136. package/dist/files/project/manifest-annotations.d.ts +16 -0
  137. package/dist/files/project/manifest-annotations.js +19 -0
  138. package/dist/files/project/store/version-store.d.ts +1 -1
  139. package/dist/files/project/upload-batch.d.ts +20 -0
  140. package/dist/files/project/upload-batch.js +20 -0
  141. package/dist/files/runtime/hooks/use-binary-blob.js +3 -2
  142. package/dist/files/runtime/hooks/use-file-content.js +3 -2
  143. package/dist/files/runtime/hooks/use-file-list.js +1 -2
  144. package/dist/files/runtime/hooks/use-file-mutations.js +69 -6
  145. package/dist/files/runtime/hooks/use-file-refresh.d.ts +4 -0
  146. package/dist/files/runtime/hooks/use-file-refresh.js +6 -0
  147. package/dist/files/tree/components/file-tree-item.js +1 -4
  148. package/dist/files/viewer/file-annotations.d.ts +18 -0
  149. package/dist/files/viewer/file-annotations.js +21 -0
  150. package/dist/files/viewer/file-content-renderer.js +1 -1
  151. package/dist/files/viewer/file-viewer.js +2 -1
  152. package/dist/files/viewer/index.d.ts +1 -0
  153. package/dist/files/viewer/index.js +1 -0
  154. package/dist/files/viewer/use-file-content-state.js +8 -1
  155. package/dist/i18n/en.d.ts +544 -46
  156. package/dist/i18n/en.js +593 -95
  157. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -4
  158. package/dist/icons/caret-right-solid.d.ts +11 -0
  159. package/dist/icons/caret-right-solid.js +15 -0
  160. package/dist/internal/auth/auth-art.d.ts +12 -0
  161. package/dist/internal/auth/auth-art.js +118 -0
  162. package/dist/internal/auth/auth-card-shell.d.ts +14 -10
  163. package/dist/internal/auth/auth-card-shell.js +20 -31
  164. package/dist/internal/auth/auth-consent.d.ts +3 -1
  165. package/dist/internal/auth/auth-consent.js +2 -2
  166. package/dist/internal/auth/auth-primitives.d.ts +26 -1
  167. package/dist/internal/auth/auth-primitives.js +37 -8
  168. package/dist/internal/connector-logo/connector-logo.d.ts +2 -1
  169. package/dist/internal/connector-logo/connector-logo.js +11 -2
  170. package/dist/internal/files/file-read-retry.d.ts +18 -2
  171. package/dist/internal/files/file-read-retry.js +42 -4
  172. package/dist/internal/hooks/projects/use-new-project-session.js +5 -10
  173. package/dist/internal/hooks/use-auto-scroll-physics.d.ts +1 -1
  174. package/dist/internal/hooks/use-auto-scroll-physics.js +2 -10
  175. package/dist/internal/hooks/use-reduced-motion.d.ts +4 -0
  176. package/dist/internal/hooks/use-reduced-motion.js +12 -0
  177. package/dist/internal/hooks/use-save-shortcut.d.ts +8 -0
  178. package/dist/internal/hooks/use-save-shortcut.js +28 -0
  179. package/dist/internal/layout/connect-mcp-modal.d.ts +1 -1
  180. package/dist/internal/layout/connect-mcp-modal.js +9 -4
  181. package/dist/internal/layout/panel-chrome.d.ts +28 -0
  182. package/dist/internal/layout/panel-chrome.js +27 -0
  183. package/dist/internal/layout/project-page-header.js +5 -1
  184. package/dist/internal/layout/project-settings-nav.d.ts +17 -0
  185. package/dist/internal/layout/project-settings-nav.js +24 -0
  186. package/dist/internal/lib/browser-noise/rules/webview.js +16 -0
  187. package/dist/internal/lib/capability-tab-routes.d.ts +8 -0
  188. package/dist/internal/lib/capability-tab-routes.js +11 -0
  189. package/dist/internal/lib/manifest-health.d.ts +25 -1
  190. package/dist/internal/lib/manifest-health.js +56 -0
  191. package/dist/internal/lib/project-preamble.js +1 -1
  192. package/dist/internal/lib/web-notifications.d.ts +1 -1
  193. package/dist/internal/lib/web-notifications.js +3 -0
  194. package/dist/internal/notifications/notification-inbox.js +2 -1
  195. package/dist/internal/notifications/notification-rows.d.ts +1 -1
  196. package/dist/internal/notifications/notification-rows.js +15 -1
  197. package/dist/internal/selection/selection-bar.d.ts +2 -8
  198. package/dist/internal/selection/selection-bar.js +15 -38
  199. package/dist/internal/stores/active-space-store.d.ts +1 -1
  200. package/dist/internal/stores/browser-recents-store.d.ts +1 -1
  201. package/dist/internal/stores/composer-prefill-store.d.ts +7 -0
  202. package/dist/internal/stores/composer-prefill-store.js +1 -0
  203. package/dist/internal/stores/current-account-store.d.ts +1 -1
  204. package/dist/internal/stores/first-chat-store.d.ts +1 -1
  205. package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
  206. package/dist/internal/stores/session-browser-store.d.ts +1 -1
  207. package/dist/internal/stores/session-expanded-store.d.ts +1 -1
  208. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  209. package/dist/internal/stores/session-history-view-store.d.ts +1 -1
  210. package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
  211. package/dist/internal/stores/sound-store.d.ts +1 -1
  212. package/dist/internal/stores/tab-store.d.ts +1 -1
  213. package/dist/internal/stores/user-preferences-store.d.ts +9 -1
  214. package/dist/internal/stores/user-preferences-store.js +2 -0
  215. package/dist/internal/stores/web-notification-store.d.ts +1 -1
  216. package/dist/lib/base-ui-compat.js +28 -1
  217. package/dist/lib/dotmatrix-hooks.d.ts +1 -0
  218. package/dist/lib/dotmatrix-hooks.js +3 -13
  219. package/dist/lib/reduced-motion.d.ts +10 -0
  220. package/dist/lib/reduced-motion.js +104 -0
  221. package/dist/lib/routes.d.ts +9 -0
  222. package/dist/lib/routes.js +7 -4
  223. package/dist/markdown/artifact-link.d.ts +11 -0
  224. package/dist/markdown/artifact-link.js +62 -0
  225. package/dist/markdown/code/index.d.ts +1 -1
  226. package/dist/markdown/code/index.js +1 -1
  227. package/dist/markdown/code/inline-code.d.ts +1 -1
  228. package/dist/markdown/code/inline-code.js +1 -1
  229. package/dist/markdown/genui/components/map-canvas.js +2 -1
  230. package/dist/markdown/index.d.ts +3 -1
  231. package/dist/markdown/index.js +2 -1
  232. package/dist/markdown/{code/inline-chip.js → inline-chip.js} +2 -2
  233. package/dist/markdown/inline-code-text.d.ts +34 -0
  234. package/dist/markdown/inline-code-text.js +68 -0
  235. package/dist/markdown/setup-links/approval-decision.js +3 -3
  236. package/dist/markdown/soft-breaks.d.ts +21 -0
  237. package/dist/markdown/soft-breaks.js +33 -0
  238. package/dist/markdown/unified-markdown.d.ts +9 -1
  239. package/dist/markdown/unified-markdown.js +31 -9
  240. package/dist/primitives/action-bar.d.ts +50 -0
  241. package/dist/primitives/action-bar.js +87 -0
  242. package/dist/primitives/calendar.js +4 -2
  243. package/dist/primitives/inline-meta.js +2 -2
  244. package/dist/primitives/kortix-loader.js +2 -1
  245. package/dist/primitives/modal.d.ts +1 -1
  246. package/dist/primitives/paper-wallpaper-shaders.d.ts +1 -0
  247. package/dist/primitives/paper-wallpaper-shaders.js +6 -0
  248. package/dist/primitives/resizable.d.ts +1 -1
  249. package/dist/primitives/resize-seam.d.ts +3 -2
  250. package/dist/primitives/resize-seam.js +4 -3
  251. package/dist/primitives/settings-section-header.d.ts +30 -1
  252. package/dist/primitives/settings-section-header.js +37 -0
  253. package/dist/primitives/sliding-tab-indicator.js +2 -1
  254. package/dist/primitives/switch.js +15 -8
  255. package/dist/primitives/text-shimmer.js +6 -0
  256. package/dist/primitives/toast-clearance.d.ts +52 -0
  257. package/dist/primitives/toast-clearance.js +116 -0
  258. package/dist/primitives/toast.d.ts +3 -1
  259. package/dist/primitives/toast.js +2 -0
  260. package/dist/primitives/typed-title.js +1 -1
  261. package/dist/primitives/wallpaper-shaders.js +1 -1
  262. package/dist/session/actions/project-session-list-helpers.d.ts +16 -0
  263. package/dist/session/actions/project-session-list-helpers.js +18 -0
  264. package/dist/session/actions/session-label.js +2 -2
  265. package/dist/session/agents/agent-model.d.ts +1 -0
  266. package/dist/session/agents/agent-model.js +2 -1
  267. package/dist/session/agents/agent-strip.d.ts +10 -5
  268. package/dist/session/agents/agent-strip.js +49 -15
  269. package/dist/session/agents/held-messages.d.ts +6 -2
  270. package/dist/session/agents/held-messages.js +6 -3
  271. package/dist/session/agents/workflow-run-controls.d.ts +27 -4
  272. package/dist/session/agents/workflow-run-controls.js +63 -10
  273. package/dist/session/composer/ComposerCard.js +7 -1
  274. package/dist/session/composer/agent-selector.d.ts +2 -0
  275. package/dist/session/composer/agent-selector.js +11 -4
  276. package/dist/session/composer/animated-placeholder.js +2 -1
  277. package/dist/session/composer/attachment-tile.d.ts +2 -2
  278. package/dist/session/composer/attachment-tile.js +25 -3
  279. package/dist/session/composer/composer-agent-access.d.ts +10 -1
  280. package/dist/session/composer/composer-agent-access.js +18 -4
  281. package/dist/session/composer/composer-chat-input.d.ts +1 -0
  282. package/dist/session/composer/composer-chat-input.js +7 -2
  283. package/dist/session/composer/composer-logic.d.ts +7 -0
  284. package/dist/session/composer/composer-logic.js +18 -0
  285. package/dist/session/composer/composer-reset.d.ts +8 -14
  286. package/dist/session/composer/composer-toolbar.d.ts +3 -1
  287. package/dist/session/composer/composer-toolbar.js +3 -3
  288. package/dist/session/composer/composer.d.ts +9 -2
  289. package/dist/session/composer/composer.js +24 -9
  290. package/dist/session/composer/editor/composer-editor.js +6 -4
  291. package/dist/session/composer/hooks/use-file-search.d.ts +12 -2
  292. package/dist/session/composer/hooks/use-file-search.js +71 -7
  293. package/dist/session/composer/menus/menu-items.js +6 -2
  294. package/dist/session/composer/menus/menu-shell.d.ts +3 -1
  295. package/dist/session/composer/menus/menu-shell.js +2 -2
  296. package/dist/session/composer/menus/slash-menu.d.ts +7 -0
  297. package/dist/session/composer/menus/slash-menu.js +48 -1
  298. package/dist/session/composer/use-instant-session-send.js +7 -1
  299. package/dist/session/header/session-reminders-indicator.js +3 -2
  300. package/dist/session/header/session-site-header.d.ts +3 -1
  301. package/dist/session/header/session-site-header.js +27 -8
  302. package/dist/session/media/sandbox-url-detector.js +1 -1
  303. package/dist/session/models/connect-model-step.d.ts +29 -0
  304. package/dist/session/models/connect-model-step.js +50 -0
  305. package/dist/session/models/model-connection-gate.js +2 -1
  306. package/dist/session/models/model-selector.js +1 -1
  307. package/dist/session/models/subscription-switcher.d.ts +7 -0
  308. package/dist/session/models/subscription-switcher.js +52 -10
  309. package/dist/session/models/subscription-windows.d.ts +2 -0
  310. package/dist/session/models/subscription-windows.js +2 -0
  311. package/dist/session/models/use-workspace-model-gate.d.ts +11 -0
  312. package/dist/session/models/use-workspace-model-gate.js +62 -0
  313. package/dist/session/models/workspace-model-gate.d.ts +46 -0
  314. package/dist/session/models/workspace-model-gate.js +66 -0
  315. package/dist/session/outcomes/session-outcomes-provider.js +14 -7
  316. package/dist/session/panel/action-panel.js +8 -19
  317. package/dist/session/panel/easy/app-preview.d.ts +4 -1
  318. package/dist/session/panel/easy/app-preview.js +95 -33
  319. package/dist/session/panel/easy/apps-card.js +6 -11
  320. package/dist/session/panel/easy/change-requests-card.js +1 -1
  321. package/dist/session/panel/easy/changes-card.d.ts +14 -0
  322. package/dist/session/panel/easy/changes-card.js +60 -0
  323. package/dist/session/panel/easy/context-card.d.ts +5 -1
  324. package/dist/session/panel/easy/context-card.js +13 -28
  325. package/dist/session/panel/easy/context-meter.d.ts +18 -0
  326. package/dist/session/panel/easy/context-meter.js +73 -0
  327. package/dist/session/panel/easy/detail-view.d.ts +1 -1
  328. package/dist/session/panel/easy/detail-view.js +24 -21
  329. package/dist/session/panel/easy/easy-panel.js +7 -5
  330. package/dist/session/panel/easy/file-preview.js +3 -1
  331. package/dist/session/panel/easy/frame-history.d.ts +91 -0
  332. package/dist/session/panel/easy/frame-history.js +198 -0
  333. package/dist/session/panel/easy/outputs-card.d.ts +10 -0
  334. package/dist/session/panel/easy/outputs-card.js +28 -31
  335. package/dist/session/panel/easy/panel-card.d.ts +1 -3
  336. package/dist/session/panel/easy/panel-card.js +24 -8
  337. package/dist/session/panel/easy/plan-card.js +2 -2
  338. package/dist/session/panel/easy/step-icon.d.ts +4 -1
  339. package/dist/session/panel/easy/step-icon.js +2 -2
  340. package/dist/session/panel/session-action-panel-column.d.ts +5 -0
  341. package/dist/session/panel/session-action-panel-column.js +198 -101
  342. package/dist/session/panel/session-desktop.js +5 -1
  343. package/dist/session/panel/session-diff-viewer.d.ts +3 -1
  344. package/dist/session/panel/session-diff-viewer.js +7 -4
  345. package/dist/session/panel/session-panel-provider.js +29 -5
  346. package/dist/session/panel/shared/derive-panels.js +64 -4
  347. package/dist/session/prompts/session-connect-card.d.ts +63 -0
  348. package/dist/session/prompts/{session-connect-prompt.js → session-connect-card.js} +53 -42
  349. package/dist/session/status/session-busy-indicator.js +2 -1
  350. package/dist/session/status/session-error-banner.js +1 -1
  351. package/dist/session/thread/chat-minimap.js +2 -1
  352. package/dist/session/thread/session-body.js +4 -1
  353. package/dist/session/thread/session-chat.js +311 -300
  354. package/dist/session/thread/session-turn-meta-rows.d.ts +13 -5
  355. package/dist/session/thread/session-turn-meta-rows.js +33 -5
  356. package/dist/session/thread/transcript.d.ts +3 -3
  357. package/dist/session/thread/transcript.js +33 -27
  358. package/dist/session/thread/typing-indicator.d.ts +2 -2
  359. package/dist/session/thread/typing-indicator.js +10 -3
  360. package/dist/session/tool/tool-part-renderer.js +7 -2
  361. package/dist/session/tool/tools/kortix-action-tool.js +10 -2
  362. package/dist/session/tool/tools/session-spawn-tool.js +3 -3
  363. package/dist/session/tool/tools/workflow-run-card.d.ts +11 -1
  364. package/dist/session/tool/tools/workflow-run-card.js +31 -7
  365. package/dist/session/tool/tools/workflow-run-cost.d.ts +29 -0
  366. package/dist/session/tool/tools/workflow-run-cost.js +75 -0
  367. package/dist/session/tool/tools/workflow-tool.d.ts +1 -1
  368. package/dist/session/tool/tools/workflow-tool.js +40 -15
  369. package/dist/session/turn/peer-message-row.js +1 -1
  370. package/dist/session/turn/queued-prompt-bubbles.d.ts +3 -2
  371. package/dist/session/turn/queued-prompt-bubbles.js +1 -1
  372. package/dist/session/turn/throttled-markdown.js +1 -1
  373. package/dist/session/turn/turn-viewport.d.ts +66 -10
  374. package/dist/session/turn/turn-viewport.js +92 -12
  375. package/dist/session/turn/user-message.js +7 -5
  376. package/dist/styles/theme.css +68 -0
  377. package/dist/styles.css +1 -1
  378. package/dist/terminal/pty-terminal.js +1 -1
  379. package/dist/terminal/session-terminal-connect-bar.js +2 -1
  380. package/dist/test-utils/intl.d.ts +544 -46
  381. package/dist/workspace/admin/project-admin-dashboard.js +23 -11
  382. package/dist/workspace/admin/settings-search-landing.js +2 -1
  383. package/dist/workspace/calendar/calendar-dates.d.ts +31 -0
  384. package/dist/workspace/calendar/calendar-dates.js +64 -0
  385. package/dist/workspace/calendar/calendar-new-item.d.ts +11 -0
  386. package/dist/workspace/calendar/calendar-new-item.js +47 -0
  387. package/dist/workspace/calendar/calendar-page.d.ts +3 -0
  388. package/dist/workspace/calendar/calendar-page.js +177 -0
  389. package/dist/workspace/calendar/calendar-panel.d.ts +13 -0
  390. package/dist/workspace/calendar/calendar-panel.js +103 -0
  391. package/dist/workspace/calendar/calendar-people.d.ts +52 -0
  392. package/dist/workspace/calendar/calendar-people.js +117 -0
  393. package/dist/workspace/calendar/calendar-scheduled.d.ts +29 -0
  394. package/dist/workspace/calendar/calendar-scheduled.js +118 -0
  395. package/dist/workspace/calendar/calendar-views.d.ts +32 -0
  396. package/dist/workspace/calendar/calendar-views.js +124 -0
  397. package/dist/workspace/calendar/calendar-when.d.ts +14 -0
  398. package/dist/workspace/calendar/calendar-when.js +81 -0
  399. package/dist/workspace/calendar/mention-textarea.d.ts +19 -0
  400. package/dist/workspace/calendar/mention-textarea.js +84 -0
  401. package/dist/workspace/home/access-requests-bell.js +2 -1
  402. package/dist/workspace/home/existing-repo-setup-prompt.d.ts +5 -8
  403. package/dist/workspace/home/existing-repo-setup-prompt.js +16 -42
  404. package/dist/workspace/home/no-agent-home.d.ts +3 -1
  405. package/dist/workspace/home/no-agent-home.js +2 -2
  406. package/dist/workspace/inbox/workspace-inbox.d.ts +1 -1
  407. package/dist/workspace/inbox/workspace-inbox.js +1 -1
  408. package/dist/workspace/layout/project-files-view.js +2 -1
  409. package/dist/workspace/layout/project-home.js +16 -9
  410. package/dist/workspace/memory/memory-page-list.js +1 -1
  411. package/dist/workspace/new/workspace-handoff.js +2 -1
  412. package/dist/workspace/projects/modal/project-icon-field.js +2 -1
  413. package/dist/workspace/session-workspace.js +13 -12
  414. package/dist/workspace/setup/setup-steps.d.ts +43 -0
  415. package/dist/workspace/setup/setup-steps.js +38 -0
  416. package/dist/workspace/setup/workspace-setup-page.d.ts +10 -0
  417. package/dist/workspace/setup/workspace-setup-page.js +124 -0
  418. package/dist/workspace/sidebar/footer/project-artifacts-nav.js +5 -1
  419. package/dist/workspace/sidebar/footer/project-calendar-nav.d.ts +8 -0
  420. package/dist/workspace/sidebar/footer/project-calendar-nav.js +31 -0
  421. package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +14 -6
  422. package/dist/workspace/sidebar/footer/project-chrome-nav.js +37 -25
  423. package/dist/workspace/sidebar/footer/project-computer-nav.d.ts +17 -9
  424. package/dist/workspace/sidebar/footer/project-computer-nav.js +36 -26
  425. package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +7 -7
  426. package/dist/workspace/sidebar/footer/project-download-app-nav.js +25 -13
  427. package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +8 -0
  428. package/dist/workspace/sidebar/footer/project-inbox-nav.js +29 -0
  429. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +3 -13
  430. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +6 -48
  431. package/dist/workspace/sidebar/footer/project-mcp-nav.d.ts +7 -7
  432. package/dist/workspace/sidebar/footer/project-mcp-nav.js +31 -13
  433. package/dist/workspace/sidebar/footer/project-phone-app-nav.d.ts +10 -0
  434. package/dist/workspace/sidebar/footer/project-phone-app-nav.js +61 -0
  435. package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +21 -0
  436. package/dist/workspace/sidebar/footer/project-promo-cards.js +33 -0
  437. package/dist/workspace/sidebar/footer/promo-card.d.ts +41 -0
  438. package/dist/workspace/sidebar/footer/promo-card.js +47 -0
  439. package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
  440. package/dist/workspace/sidebar/project-nav-items.js +12 -4
  441. package/dist/workspace/sidebar/project-session-list.js +58 -26
  442. package/dist/workspace/sidebar/project-sidebar.js +2 -5
  443. package/dist/workspace/sidebar/project-spaces-nav.js +2 -1
  444. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +24 -0
  445. package/dist/workspace/sidebar/session-brief-hover-card.js +4 -3
  446. package/dist/workspace/sidebar/session-group-sections.d.ts +26 -7
  447. package/dist/workspace/sidebar/session-group-sections.js +121 -41
  448. package/dist/workspace/sidebar/session-grouping.d.ts +1 -1
  449. package/dist/workspace/sidebar/session-grouping.js +1 -1
  450. package/dist/workspace/sidebar/sidebar-drill.js +6 -0
  451. package/dist/workspace/sidebar/sidebar-more-group.js +3 -2
  452. package/dist/workspace/sidebar/use-workspace-list.d.ts +7 -0
  453. package/dist/workspace/sidebar/use-workspace-list.js +11 -1
  454. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +14 -0
  455. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +46 -2
  456. package/dist/workspace/space/space-tab-panels.js +1 -1
  457. package/dist/workspace/spaces/space-details-panel.js +2 -2
  458. package/dist/workspace/spaces/space-timeline.js +2 -2
  459. package/dist/workspace/spaces/space-triggers.js +2 -2
  460. package/dist/workspace/spaces/space-view.js +11 -5
  461. package/package.json +79 -10
  462. package/skills/kortix-ui/SKILL.md +2 -2
  463. package/skills/kortix-ui/references/modules.md +5 -3
  464. package/dist/session/prompts/session-connect-prompt.d.ts +0 -40
  465. package/dist/session/thread/turn-share.d.ts +0 -16
  466. package/dist/session/thread/turn-share.js +0 -161
  467. package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +0 -11
  468. package/dist/workspace/sidebar/footer/promo-nav-row.js +0 -7
  469. /package/dist/markdown/{code/inline-chip.d.ts → inline-chip.d.ts} +0 -0
@@ -5,7 +5,7 @@ import { uiRoutes } from '../../lib/routes.js';
5
5
  import { isQuestionTool } from '@kortix/sdk';
6
6
  import { SessionAccessPrompt } from '../prompts/session-access-prompt.js';
7
7
  import { SessionApprovalPrompt } from '../prompts/session-approval-prompt.js';
8
- import { SessionConnectPrompt } from '../prompts/session-connect-prompt.js';
8
+ import { SessionConnectRequestsProvider } from '../prompts/session-connect-card.js';
9
9
  import { childSessionHref } from '../tool/tools/session-spawn-urls.js';
10
10
  import { SessionPermissionPrompt } from '../prompts/session-permission-prompt.js';
11
11
  import { useSessionWallpaperLayer } from '../panel/session-wallpaper-layer.js';
@@ -106,7 +106,7 @@ import { getRetryInfo } from '../../internal/session-types/index.js';
106
106
  import { useModelPricingLookup } from '../../internal/lib/model-pricing.js';
107
107
  import { isAbortError, latestPromptModel, SESSION_NOTICE, turnEndNotice } from '@kortix/sdk';
108
108
  import { failureShownByTurn, failureSupersededByTurn, persistedFailureText, } from './persisted-turn-failure.js';
109
- import { abandonOptimisticSend, applyOptimisticAbort, ascendingId, awaitAbortSettlement, beginOptimisticSend, classifySendError, clearStartStash, formatModelString, formatPromptModel, markOptimisticSendDispatched, markOptimisticSendInboxBacked, mintSessionWireMessageId, readStartStash, recoverFromSendFailure, rejectQuestion, replyToPermission, replyToQuestion, requestRuntimeReconnect, startSessionWithPrompt, useAbortRuntimeSession, useExecuteRuntimeCommand, useProjectConfig, useRuntimeAgents, useProjectSpaces, useRuntimeBootStalled, useRuntimeCommands, useRuntimeConfig, useRuntimeConnectionStore, useRuntimePendingStore, useRuntimePhase, useRuntimeProviders, useRuntimeReady, useRuntimeSession, useRuntimeSessions, useRuntimeSupports, useSessionModelSelection, useSessionPrompts, useSessionStateStore, useSessionSync, useSessionTurnOutcome, useSessionWorking, useSessionWorkingStore, useAnswerSessionAsk, useSessionNeedsYou, } from '@kortix/sdk/react';
109
+ import { abandonOptimisticSend, applyOptimisticAbort, ascendingId, awaitAbortSettlement, beginOptimisticSend, classifySendError, clearStartStash, formatModelString, formatPromptModel, markOptimisticSendDispatched, markOptimisticSendInboxBacked, mintSessionWireMessageId, readStartStash, recoverFromSendFailure, rejectQuestion, replyToPermission, replyToQuestion, requestRuntimeReconnect, startSessionWithPrompt, useAbortRuntimeSession, useExecuteRuntimeCommand, useProjectConfig, useRuntimeAgents, useProjectSpaces, useRuntimeBootStalled, useRuntimeCommands, useRuntimeConfig, useRuntimeConnectionStore, useRuntimePendingStore, useRuntimePhase, useRuntimeProviders, useRuntimeReady, useRuntimeSession, useRuntimeSessions, useRuntimeSupports, useSessionModelSelection, useSessionPrompts, useSessionStateStore, useSessionSync, useSessionTurnOutcome, useSessionWorking, useSessionWorkingStore, useAnswerSessionAsk, useSessionNeedsYou, useNetworkOnline, } from '@kortix/sdk/react';
110
110
  import { useStableCallback } from '../../internal/hooks/use-stable-callback.js';
111
111
  import { useReloadForensics } from '../status/reload-forensics.js';
112
112
  import { resolveLastTurnWorking, serverHoldsOpenTurn, sessionComposerReadiness, } from '../composer/session-composer-readiness.js';
@@ -734,6 +734,12 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
734
734
  * it — a refused send, Stop, and leaving the session.
735
735
  */
736
736
  const receiptSessionId = projectSessionId ?? '';
737
+ // The browser reports no network: a send waits for it (the SDK holds the
738
+ // POST), so it takes no receipt until it goes out, and the composer shows
739
+ // the offline line instead of a turn that never started (finding 07).
740
+ const networkOnline = useNetworkOnline();
741
+ const networkOnlineRef = useRef(networkOnline);
742
+ networkOnlineRef.current = networkOnline;
737
743
  const noteSendReceipt = useCallback((messageId, turnId = messageId) => useSessionWorkingStore
738
744
  .getState()
739
745
  .noteSendReceipt(receiptSessionId, { messageId, turnId, atMs: Date.now() }), [receiptSessionId]);
@@ -1500,8 +1506,6 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
1500
1506
  const [approvalDocked, setApprovalDocked] = useState(false);
1501
1507
  // My Kortix asking to give a colleague access docks the same way.
1502
1508
  const [accessDocked, setAccessDocked] = useState(false);
1503
- // A connector sign-in the agent started docks the same way (`SessionConnectPrompt`).
1504
- const [connectDocked, setConnectDocked] = useState(false);
1505
1509
  const questionPromptTimerRef = useRef(null);
1506
1510
  useEffect(() => {
1507
1511
  const nextQuestion = activePendingQuestion;
@@ -2655,7 +2659,12 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
2655
2659
  // The prompt is out of this tab's hands the moment the row lands, so the
2656
2660
  // receipt is taken BEFORE the POST: it is what holds the composer on
2657
2661
  // "working" until `GET .../turn` reports the turn the inbox admitted.
2658
- noteSendReceipt(messageID, receiptTurnId);
2662
+ // Offline: no receipt yet. The POST waits for the network; the receipt is
2663
+ // taken when the server has the prompt, so no Thinking row stands for a
2664
+ // send that has not left the page.
2665
+ const heldOffline = !networkOnlineRef.current;
2666
+ if (!heldOffline)
2667
+ noteSendReceipt(messageID, receiptTurnId);
2659
2668
  const result = await (async () => {
2660
2669
  try {
2661
2670
  if (!projectId || !projectSessionId) {
@@ -2694,6 +2703,8 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
2694
2703
  // for it. `useSessionPrompts` raises the inbox floor at the same
2695
2704
  // moment, which is what covers the window before the row is
2696
2705
  // delivered and becomes a turn.
2706
+ if (heldOffline)
2707
+ noteSendReceipt(messageID, receiptTurnId);
2697
2708
  acceptSendReceipt(messageID);
2698
2709
  attachments?.release();
2699
2710
  // The durable row now carries this prompt, so the tab-local draft
@@ -2707,6 +2718,8 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
2707
2718
  // Resolve that verdict before the composer can restore its draft:
2708
2719
  // recoverFromSendFailure checks asynchronously and returns an error now.
2709
2720
  if (!keepsPainted && (await inboxRowExists().catch(() => false))) {
2721
+ if (heldOffline)
2722
+ noteSendReceipt(messageID, receiptTurnId);
2710
2723
  acceptSendReceipt(messageID);
2711
2724
  attachments?.release();
2712
2725
  if (!paintTranscript)
@@ -3439,7 +3452,7 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
3439
3452
  // The agents this session started, as one line in the composer's under-row
3440
3453
  // (Claude Code's agent panel). It reads its own lists and never holds the composer.
3441
3454
  const agentsLineCompact = !!transcriptRows && !isPhone;
3442
- const chatUnderbarSlot = useMemo(() => _jsx(AgentsLine, { projectId: projectId, sessionId: projectSessionId, compact: agentsLineCompact }), [projectId, projectSessionId, agentsLineCompact]);
3455
+ const chatUnderbarSlot = useMemo(() => (_jsx(AgentsLine, { projectId: projectId, sessionId: projectSessionId, compact: agentsLineCompact, live: isServerBusy })), [projectId, projectSessionId, agentsLineCompact, isServerBusy]);
3443
3456
  // A space's thread lists only the queue's live messages in its card: failed
3444
3457
  // ones and a Stop hold read as calm lines (`ChatQueueLines`), reports wait behind Resume.
3445
3458
  const calmRest = useMemo(() => [...queueRows.rows, ...heldCommandRows(heldCommands)].filter((row) => row.state !== 'failed' && !row.synthetic), [queueRows.rows, heldCommands]);
@@ -3481,13 +3494,11 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
3481
3494
  effectiveBusy,
3482
3495
  canStop,
3483
3496
  ]);
3484
- const chatInputSlot = useMemo(() => (_jsxs(_Fragment, { children: [_jsx(SessionApprovalPrompt, { onDockedChange: setApprovalDocked }), _jsx(SessionAccessPrompt, { projectId: projectId ?? '', asks: accessAsks, onDockedChange: setAccessDocked }), projectId && projectSessionId ? (_jsx(SessionConnectPrompt, { projectId: projectId, sessionId: projectSessionId, busy: effectiveBusy, onDockedChange: setConnectDocked })) : null, _jsx(SessionPermissionPrompt, { sessionId: sessionId, agentName: sessionScopeAgentName, permissions: pendingPermissions, onReply: handlePermissionReply }), renderedQuestion ? (_jsx("div", { className: cn('w-full overflow-hidden transition-[max-height,opacity,transform] ease-in-out', questionPromptVisible
3497
+ const chatInputSlot = useMemo(() => (_jsxs(_Fragment, { children: [_jsx(SessionApprovalPrompt, { onDockedChange: setApprovalDocked }), _jsx(SessionAccessPrompt, { projectId: projectId ?? '', asks: accessAsks, onDockedChange: setAccessDocked }), _jsx(SessionPermissionPrompt, { sessionId: sessionId, agentName: sessionScopeAgentName, permissions: pendingPermissions, onReply: handlePermissionReply }), renderedQuestion ? (_jsx("div", { className: cn('w-full overflow-hidden transition-[max-height,opacity,transform] ease-in-out', questionPromptVisible
3485
3498
  ? 'duration-slow max-h-130 translate-y-0 opacity-100'
3486
3499
  : 'duration-slow pointer-events-none max-h-0 -translate-y-1 opacity-0'), children: _jsx(QuestionPrompt, { ref: questionPromptRef, request: renderedQuestion, onReply: handleQuestionReply, onReject: handleQuestionReject, onActionChange: handleQuestionActionChange }, renderedQuestion.id) })) : null] })), [
3487
3500
  projectId,
3488
3501
  accessAsks,
3489
- effectiveBusy,
3490
- projectSessionId,
3491
3502
  sessionId,
3492
3503
  sessionScopeAgentName,
3493
3504
  pendingPermissions,
@@ -3748,299 +3759,299 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
3748
3759
  }
3749
3760
  return (
3750
3761
  // A read-only view (the sub-session modal) offers no fix inside a tool card.
3751
- _jsx(ReadOnlySessionContext.Provider, { value: !!readOnly, children: _jsx(AgentActivateContext.Provider, { value: agentActivate, children: _jsx(SessionPromptContext.Provider, { value: readOnly ? null : sendSessionPrompt, children: _jsx(ProjectFilesProvider, { value: { projectId: projectId ?? '', ref: outcomesBaseRef, defaultBranch: outcomesBaseRef }, children: _jsxs(ComposerDropZone, { className: cn('relative flex h-full flex-col', 'pb-[env(safe-area-inset-bottom)]', // audit:allow device safe-area inset, not a spacing step — the composer column lifts above the home indicator in the installed PWA; desktop reports a 0px inset
3752
- // Transparent in the welcome state so the root-level full-bleed wallpaper
3753
- // (portaled into SessionLayout) reads through; solid once real content
3754
- // takes over. Same base color either way, so non-welcome is unchanged.
3755
- shouldShowWelcomeOverlay || transparent ? 'bg-transparent' : 'bg-background'), "data-testid": "session-chat", children: [isPreparingPrint && (_jsxs("div", { "data-print-hide": true, role: "status", className: "bg-popover text-muted-foreground fixed bottom-6 left-1/2 z-50 flex -translate-x-1/2 items-center gap-2 rounded-lg border px-4 py-2 text-xs shadow-lg", children: [_jsx(Loading, { className: "size-3.5 shrink-0" }), tHardcodedUi.raw('i18nComplete.text7dac2ca010fe')] })), wallpaperLayer
3756
- ? welcomeWallpaper && createPortal(welcomeWallpaper, wallpaperLayer)
3757
- : welcomeWallpaper, !hideHeader && (_jsx(SessionSiteHeader, { sessionId: sessionId, sessionTitle: session?.title || 'Untitled', leadingAction: headerLeadingAction, parent: parentCrumb })), _jsx(ModelSwitchHistory, { history: projectSessionRow?.metadata?.model_switches, current: projectSessionRow?.metadata?.model }), _jsx(SessionContextModal, { open: contextModalOpen, onOpenChange: setContextModalOpen,
3758
- // A chat with no `useSession` source: the raw explorer lists the
3759
- // rows `useSessionSync` read for it.
3760
- detachedRows: sessionState ? undefined : hookMessages, source: sessionState ?? DETACHED_SESSION_MESSAGES, session: session, sessionRow: projectSessionRow, providers: providers, allSessions: allSessions, servedModel: sessionServedModel, billedCost: sessionBilledCost(modelUsage) }), _jsx(CompactModal, { sessionId: sessionId, open: compactModalOpen, onOpenChange: setCompactModalOpen }), _jsx(ChangeRequestDetailDialog, { crId: openCrId, onClose: () => setOpenCrId(null), onOpenChangeRequest: setOpenCrId }), _jsxs(SessionBodyRow, { actionPanel: !hideHeader && !readOnly, children: [isNotFound ? (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 text-center", children: [_jsx("div", { className: "text-muted-foreground text-sm", children: tHardcodedUi.raw('componentsSessionSessionChat.line5821JsxTextThisSessionIsNotAccessibleRightNow') }), _jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsx(Link, { href: "/", prefetch: true, onClick: () => {
3761
- try {
3762
- if (sessionId)
3763
- useTabStore.getState().closeTab?.(sessionId);
3764
- }
3765
- catch { }
3766
- }, children: tHardcodedUi.raw('componentsSessionSessionChat.line5833JsxTextGoToHome') }) })] })) : (_jsxs("div", { ref: chatAreaRef, className: "relative z-10 min-h-0 flex-1", children: [_jsx("div", { ref: scrollContainerCallbackRef, className: cn(
3767
- // overflow-anchor:none — this scroll area does ALL of its own
3768
- // anchoring (useAutoScroll's spacer + RAF follow, the send-path
3769
- // turn anchor, and the history-prepend content-space restore in
3770
- // session-history-scroll.ts). The browser's native scroll
3771
- // anchoring (default `overflow-anchor: auto`) tries to
3772
- // compensate for the SAME prepends independently, and the two
3773
- // corrections stacking is the other half of the scroll-up
3774
- // teleport: ours restores the reader's position, then the
3775
- // native one nudges it again.
3776
- 'scrollbar-hide relative z-10 h-full flex-1 overflow-y-auto [scroll-behavior:auto] [overflow-anchor:none]', shouldShowWelcomeOverlay || transparent ? 'bg-transparent' : 'bg-background'), onMouseUp: handleChatMouseUp, onMouseDown: handleChatMouseDown, onScroll: handleChatScroll, children: _jsxs("div", { ref: contentRef, role: "log",
3777
- // Width and gutters live in `SESSION_TRANSCRIPT_CLASS`: the
3778
- // instant shell draws this same column and the two crossfade
3779
- // into each other, so a difference here is a sideways jump on
3780
- // screen, not a style opinion. See session-body.tsx.
3781
- //
3782
- // No bottom padding, there or here: the space under the last
3783
- // message is the auto-scroll spacer's job alone. The `pb-32`
3784
- // that used to sit here stacked 128px of dead space on top of
3785
- // it — the "extra inset at the bottom of the session".
3786
- // Rows run edge to edge: each row owns its gutters and its hover fill.
3787
- className: transcriptRows ? 'w-full min-w-0 pt-4' : SESSION_TRANSCRIPT_CLASS, children: [_jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx(SessionPrintHeader, { title: session?.title || 'Untitled', agentName: composerAgentName }), (hasOlder || showOlderLoading) && (_jsxs("div", { className: "mb-6 flex flex-col items-center gap-2", children: [hasOlder && (_jsx("div", { ref: olderSentinelRef, "aria-hidden": true, className: "h-px w-full" })), showOlderLoading && (_jsxs("div", { role: "status", className: "text-muted-foreground flex items-center gap-2 py-1 text-xs", children: [_jsx(Loading, { className: "size-3.5 shrink-0" }), tHardcodedUi.raw('i18nComplete.text85bf890776a7')] })), !showOlderLoading &&
3788
- !olderPullFailed &&
3789
- olderAutoloadExhausted({ hasOlder, autoLoadedPages }) && (_jsx(Button, { type: "button", variant: "outline-ghost", size: "sm", onClick: () => void handleLoadOlder(), children: tHardcodedUi.raw('i18nComplete.textf17671d83db0') })), olderPullFailed && !showOlderLoading && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-muted-foreground text-xs", children: tHardcodedUi.raw('i18nComplete.textb03a0041ce33') }), _jsx(Button, { type: "button", variant: "outline-ghost", size: "sm", onClick: () => void handleLoadOlder(), children: tHardcodedUi.raw('i18nComplete.text942087cc2d41') })] }))] })), restoreNotice && !restoreDismissed && (_jsx(RestoreNotice, { notice: restoreNotice, onDismiss: () => dismissRestore(historyKey, restoreNotice.generation) })), _jsx(SessionOutcomesProvider, { projectSessionId: projectSessionId, turnSpans: turnSpans, busy: effectiveBusy, onOpen: handleOpenOutcome, onJump: handleJumpToOutcome, jumping: jumpingToOutcome, children: _jsxs(ToolActivateContext.Provider, { value: toolActivate, children: [showFirstPromptPreview &&
3790
- firstPromptSource &&
3791
- queuedSyntheticMessages.length === 0 &&
3792
- rowsContext && (
3793
- // A channel thread draws the stand-in as rows, the same
3794
- // rows its boot body drew (`ThreadBootRows`).
3795
- _jsx(PendingPromptRows, { text: buildOptimisticPromptTextWithUploads(firstPromptSource.text, firstPromptSource.files), author: rowsContext.owner, sessionId: sessionId, busy: turns.length === 0 && (lastTurnWorking || promptInbox.prompts.some(isFirstPromptRow)) })), showFirstPromptPreview &&
3796
- firstPromptSource &&
3797
- queuedSyntheticMessages.length === 0 &&
3798
- !rowsContext && (_jsx(OptimisticTurn, { text: buildOptimisticPromptTextWithUploads(firstPromptSource.text, firstPromptSource.files),
3799
- // Preserve a real failed-send status through the
3800
- // boot-shell handover without inventing upload progress.
3801
- // A first prompt held on its uploads carries its own.
3802
- uploadStatus: firstPromptSource.uploadStatus ?? firstPromptUploadStatus, agentNames: agentNames, onFileClick: openFileInComputer, sessionId: sessionId,
3803
- // The first item of the conversation, like turn 0, which has no
3804
- // top margin. `first:mt-0` misses here: the list opens with a
3805
- // zero-height <header>, so the stand-in sat 44px lower than turn 0
3806
- // and every swap between the two jumped the bubble (KRTX-2931).
3807
- className: "mt-0",
3808
- // An undelivered first prompt is a turn about to start, as the
3809
- // shell above this chat shows it: busy from the first frame,
3810
- // before the working projection has read the inbox (KRTX-2931).
3811
- busy: turns.length === 0 && (lastTurnWorking || promptInbox.prompts.some(isFirstPromptRow)) })), turns.map((turn, turnIndex) => {
3812
- // Check if this turn is a compaction summary — and
3813
- // whether it actually PRODUCED one. A failed/aborted
3814
- // attempt (compaction-flagged, no content, not the
3815
- // working turn) renders as one slim row, draws no
3816
- // divider, and stacks tight against a neighbouring
3817
- // failed attempt.
3818
- const compaction = turn.compaction;
3819
- const hasCompaction = compaction !== null;
3820
- const isTurnWorking = turn.live;
3821
- // `inFlight` (message state) alongside the projection:
3822
- // classifying by projection alone flipped a streaming
3823
- // compaction to "failed" for the frames where the two
3824
- // disagree, popping the divider in and out — a layout
3825
- // bounce right where the reader is looking.
3826
- const isFailedCompaction = compaction !== null &&
3827
- !compaction.hasContent &&
3828
- !compaction.inFlight &&
3829
- !isTurnWorking;
3830
- // Retries collapse to ONE visible row, GLOBALLY: a
3831
- // failed attempt with ANY later compaction turn (a
3832
- // retry, or the one that finally landed) is history —
3833
- // it keeps its TurnViewport (stable keys, scroll
3834
- // anchors) but renders no content, and an empty
3835
- // TurnViewport costs 0px (turn-viewport.tsx RULE 2).
3836
- // Adjacency was not enough: attempts whose error landed
3837
- // on a plain assistant message used to interleave as
3838
- // unclassified turns, breaking every consecutive run.
3839
- const suppressedFailedCompaction = isFailedCompaction && turnIndex < lastCompactionTurnIndex;
3840
- // Notification-only early-return removed: it rendered the
3841
- // user's pty_* card but skipped the turn's replies,
3842
- // hiding every subsequent assistant response in that turn.
3843
- // Fall through to the normal turn renderer instead.
3844
- const confirmedActive = turnIsConfirmedActive({
3845
- isTurnWorking,
3846
- turnId: turn.id,
3847
- activeTurnId,
3848
- pendingDelivery: !!working.pendingDelivery,
3849
- });
3850
- const pendingPrompt = !confirmedActive && turn.assistant.length === 0
3851
- ? pendingPromptsByMessageId.get(turn.id)
3852
- : undefined;
3853
- // A queued prompt is not in the runtime transcript yet;
3854
- // its author still shows (`authorForTurn`).
3855
- const promptAuthorId = pendingPromptsByMessageId.get(turn.id)?.author_user_id;
3856
- const turnAuthor = authorForTurn(transcriptAuthors, messageAuthors, turn.id, pendingPrompt?.wire_message_id) ??
3857
- participantAuthor(sessionParticipants, promptAuthorId) ??
3858
- (sentHereIds.current.has(turn.id) ||
3859
- sentHereIds.current.has(turnRenderKeys.get(turn.id) ?? '') ||
3860
- (viewerId !== undefined && promptAuthorId === viewerId) ||
3861
- // The first prompt of a session the viewer started,
3862
- // sent from another surface (project home), before
3863
- // the first authors read lands.
3864
- (messageAuthorsLoading &&
3865
- viewerId !== undefined &&
3866
- projectSessionRow?.created_by === viewerId &&
3867
- turn.id === userMessageIds[0])
3868
- ? viewerAsAuthor
3869
- : undefined);
3870
- return (_jsx(TranscriptTurnRow
3871
- // ONE element per prompt: keyed by the id the
3872
- // bubble was FIRST painted under, so the swap to a
3873
- // re-minted echo id re-renders this node instead
3874
- // of mounting a new one (opacity keeps animating,
3875
- // hover state survives, nothing jumps).
3876
- , { turnId: turn.id, modelOptions: modelOptions,
3877
- // An absorbed run turn keeps its viewport (keys, scroll
3878
- // anchors) and draws nothing: its anchor folds it.
3879
- suppressed: suppressedFailedCompaction || agentRunLayout.absorbed.has(turn.id), ...agentRunLayout.propsOf(turn.id), continuedWith: harnessSwitches.get(turn.id)?.harness, fullTextState: loaded.state[turn.id] ?? 'idle', onLoadFullText: loadFullTexts, showBusyRow: showFallbackBusyRow &&
3880
- fallbackBusyRowTurnId === turn.id,
3881
- // Queued bubbles STACK: a pending turn right after
3882
- // another pending turn sits close to it, like a
3883
- // list of what is waiting — not a turn's width
3884
- // apart as if each had been answered in between.
3885
- // (Failed compaction rows need no stacking rule any
3886
- // more — at most one is visible at a time.)
3887
- viewportClassName: turnIndex === 0 || transcriptRows
3888
- ? ''
3889
- : // A compaction, the work after it and another agent's notice continue the turn above.
3890
- turn.compaction || turn.continues || agentNoticeTurnIds.has(turn.id)
3891
- ? 'mt-6'
3892
- : lastTurnWorking &&
3893
- pendingTurnIds.has(turn.id) &&
3894
- pendingTurnIds.has(turns[turnIndex - 1].id)
3895
- ? 'mt-3'
3896
- : 'mt-12', turn: turn, author: turnAuthor,
3897
- // Reserve the sender row while the authors load,
3898
- // for a queued prompt whose sender is known, and
3899
- // for a live message until its author resolves.
3900
- showAuthor: !!turnAuthor ||
3901
- messageAuthorsLoading ||
3902
- !!promptAuthorId ||
3903
- (loadedUserIds?.sessionId === sessionId &&
3904
- !loadedUserIds.ids.has(turn.id) &&
3905
- authorsGaveUp !== missingAuthors), stoppedBy: stoppedByName(messageAuthors, turn.id, viewerId), servedModel: servedModelOfTurn(modelUsage, turn.id, turns[turnIndex - 1]?.id), turnOutcome: turnOutcome, isLast: turn.id === lastUserMessageId, ownsPlan: turn.id === planAnchorId, sessionId: sessionId, projectId: projectId, projectSessionId: projectSessionId, sessionStatus: sessionStatus, permissions: pendingPermissions, questions: pendingQuestions, agentNames: agentNames, isFirstTurn: turnIndex === 0,
3906
- // Handed over only once the stand-in has stepped
3907
- // aside — while it is up it draws these itself.
3908
- pendingText: turnIndex === 0 ? firstTurnHandover?.text : undefined, pendingAttachments: sentAttachmentsForTurn({
3909
- sentByMessage: sentAttachmentsByMessage,
3910
- messageId: turn.id,
3911
- originId: optimisticOriginOf(sessionId, turn.id),
3912
- isFirstTurn: turnIndex === 0,
3913
- firstTurnHandover: firstTurnHandover?.attachments,
3914
- firstTurnSent: firstPromptAttachments(projectSessionId),
3915
- queuedRowAttachments: inboxRowsByMessageId.get(turn.id)?.attachments,
3916
- }), uploadStatus: heldSendFailures?.[turn.id]
3917
- ? {
3918
- state: 'failed',
3919
- message: heldSendFailures[turn.id].message,
3920
- onRetry: () => retryHeldSend(sessionId, turn.id, resendHeldSend, (error) => classifySessionError(error).message),
3921
- }
3922
- : turnIndex === 0 && firstTurnHandover?.attachments.length
3923
- ? firstPromptUploadStatus
3924
- : undefined, sessionWorking: lastTurnWorking, isWorkingTurn: turn.live, suppressBusyIndicator: suppressWorkingTurnBusy, awaitingUser: awaitingUserInput,
3925
- // An idle send stays in the inbox until delivery,
3926
- // but nothing runs ahead of it: queued only while
3927
- // it waits behind a turn (`turnRendersQueued`).
3928
- // The first turn, with no turn working, has
3929
- // nothing ahead of it: a session's first prompt is
3930
- // starting, not queued, while the computer comes up
3931
- // and before the turn layer marks it queued or live.
3932
- pending: turnIndex === 0 && workingTurn.workingTurnId === null && !confirmedActive
3933
- ? pendingPrompt?.state === 'waiting' || pendingPrompt?.state === 'failed'
3934
- : turnRendersQueued({
3935
- turnId: turn.id,
3936
- resolution: workingTurn,
3937
- sessionWorking: lastTurnWorking,
3938
- confirmedActive,
3939
- inboxPrompt: pendingPrompt,
3940
- }), pendingPrompt: pendingPrompt, onRetryQueued: stableRetryQueued, onRemoveQueued: stableRemoveQueued, queuedPromptViewer: queuedPromptViewer, interruptedBeforeRun: interruptedTurnIds.has(turn.id), isCompaction: hasCompaction, onOpenCompactionSummary: panel ? stableOpenCompactionSummary : undefined, onOpenPastedContent: panel ? stableOpenPastedContent : undefined, providers: providers, commandMessages: commandMessagesRef.current, commands: commands, disableToolNavigation: disableToolNavigation, onPermissionReply: stablePermissionReply, onRewind: stableRewind, editingText: rewindTarget?.messageId === turn.id
3941
- ? rewindTarget.text
3942
- : null, editPending: editSendPending || !!sessionState?.rewindPending, onEditCancel: stableEditCancel, onEditSend: stableEditSend, rewindDisabled: !!readOnly ||
3943
- (rewindable !== null && !rewindable.has(turn.id)) ||
3944
- !runtimeCanRewind ||
3945
- !sessionState ||
3946
- isBusy ||
3947
- sessionState.rewindPending ||
3948
- // The runtime is not idle while queued prompts
3949
- // are still on their way to it — a rewind mid-
3950
- // delivery fails downstream with "Session is
3951
- // busy" (measured); refuse it up front instead.
3952
- promptInbox.prompts.length > 0 }, turnRenderKeys.get(turn.id)));
3953
- })] }) }), isOptimisticCompacting && !hasCompactionTurn && (_jsx("div", { className: turns.length > 0 ? 'mt-12' : 'mt-2', children: _jsx(CompactionMarker, { running: true }) })), [
3954
- ...(turnOutcome.recent_failures ?? []),
3955
- ...(turnOutcome.last_ended?.end_reason === 'failed' &&
3956
- !turnOutcome.recent_failures?.some((failure) => failure.message_id === turnOutcome.last_ended?.message_id)
3957
- ? [turnOutcome.last_ended]
3958
- : []),
3959
- ].filter((failure) => !isAbortError(failure.error) &&
3960
- !failureShownByTurn(failure, turns) &&
3961
- !failureSupersededByTurn(failure, turns) &&
3962
- (!failure.error?.message || failure.error.message !== commandError?.message)).map((failure) => {
3963
- const messageId = failure.message_id ?? 'persisted-turn-failure';
3964
- // Use the SDK's settle window for a cause that may arrive
3965
- // one frame later, including an unnamed failed last turn.
3966
- const notice = turnEndNotice({
3967
- ...turnOutcome,
3968
- recent_failures: [{ ...failure, message_id: messageId, error: failure.error ?? null }],
3969
- }, messageId, { hasError: false, isAbort: false });
3970
- return notice ? (_jsx(TurnErrorDisplay, { errorText: notice.kind === 'unexplained'
3971
- ? tHardcodedUi.raw('i18nComplete.text73112526c03a')
3972
- : persistedFailureText(failure.error), className: "mt-2" }, messageId)) : null;
3973
- }), commandError && (_jsx(TurnErrorDisplay, { error: commandError, isAbort: isAbortError(commandError.cause), modelOptions: modelOptions, className: "mt-2" })), showFallbackBusyRow && fallbackBusyRowTurnId === null && (rowsContext ? (
3974
- // A channel thread waits in the agent's answer row.
3975
- _jsx(AgentBusyRow, { sessionId: sessionId })) : (_jsx(SessionBusyIndicator, { sessionId: sessionId,
3976
- // Matches the stand-in's row spacing under a bubble
3977
- // (`OptimisticTurn`), so the crossfade into the real
3978
- // transcript does not move it. Nothing above it when
3979
- // the transcript is empty, so no margin there.
3980
- className: turns.length === 0 ? undefined : 'mt-6' })))] }), _jsx("div", { ref: spacerElRef, "data-scroll-spacer": true })] }) }), selectionPopup && (_jsx("div", { "data-reply-popup": true, className: "absolute z-50", style: {
3981
- left: `${selectionPopup.x}px`,
3982
- top: `${selectionPopup.y}px`,
3983
- transform: 'translate(-50%, -100%)',
3984
- }, children: _jsxs(Button, { onClick: handleSelectionReply, size: "sm", className: "animate-in fade-in-0 zoom-in-95 duration-normal origin-bottom px-3 text-xs ease-out has-[>svg]:px-3", children: [tHardcodedUi.raw('i18nComplete.textc253f451bdd5'), _jsx(ArrowBendUpLeftIcon, { className: "size-4 shrink-0" })] }) })), transcriptRows ? null : (_jsx(ChatMinimap, { turns: turns, scrollRef: scrollRef, contentRef: contentRef })), _jsx("div", { className: cn('absolute inset-x-0 bottom-4 z-20 flex justify-center', !showScrollButton && 'pointer-events-none'), children: _jsx(Button, { variant: "outline", size: "icon-md", "aria-hidden": !showScrollButton, tabIndex: showScrollButton ? undefined : -1, className: cn('hit-area-2 bg-background hover:bg-muted rounded-full', 'transition-[opacity,scale] ease-[cubic-bezier(0.23,1,0.32,1)] active:scale-[0.96] motion-reduce:scale-100 motion-reduce:transition-opacity', showScrollButton
3985
- ? 'duration-normal scale-100 opacity-100'
3986
- : 'duration-fast scale-[0.97] opacity-0'), onClick: smoothScrollToAbsoluteBottom, children: _jsx(CaretDownIcon, { className: "size-4" }) }) })] })), readOnly && inputReplacement ? (_jsx("div", { className: cn(COMPOSER_SHELL_CLASS, 'pb-4'), children: inputReplacement })) : null, !readOnly && (_jsxs(_Fragment, { children: [_jsx(SessionChatInput
3987
- // `undefined`, not `true`, once released: the composer's own
3988
- // viewport rule (>= 640px) still decides, so this never forces
3989
- // focus onto a phone keyboard.
3990
- // A thread a space's chat opened by itself does not take the focus (`ComposerAutoFocusContext`).
3991
- , {
3762
+ _jsx(ReadOnlySessionContext.Provider, { value: !!readOnly, children: _jsx(SessionConnectRequestsProvider, { projectId: readOnly ? null : projectId, sessionId: projectSessionId, busy: effectiveBusy, children: _jsx(AgentActivateContext.Provider, { value: agentActivate, children: _jsx(SessionPromptContext.Provider, { value: readOnly ? null : sendSessionPrompt, children: _jsx(ProjectFilesProvider, { value: { projectId: projectId ?? '', ref: outcomesBaseRef, defaultBranch: outcomesBaseRef }, children: _jsxs(ComposerDropZone, { className: cn('relative flex h-full flex-col', 'pb-[env(safe-area-inset-bottom)]', // audit:allow device safe-area inset, not a spacing step — the composer column lifts above the home indicator in the installed PWA; desktop reports a 0px inset
3763
+ // Transparent in the welcome state so the root-level full-bleed wallpaper
3764
+ // (portaled into SessionLayout) reads through; solid once real content
3765
+ // takes over. Same base color either way, so non-welcome is unchanged.
3766
+ shouldShowWelcomeOverlay || transparent ? 'bg-transparent' : 'bg-background'), "data-testid": "session-chat", children: [isPreparingPrint && (_jsxs("div", { "data-print-hide": true, role: "status", className: "bg-popover text-muted-foreground fixed bottom-6 left-1/2 z-50 flex -translate-x-1/2 items-center gap-2 rounded-lg border px-4 py-2 text-xs shadow-lg", children: [_jsx(Loading, { className: "size-3.5 shrink-0" }), tHardcodedUi.raw('i18nComplete.text7dac2ca010fe')] })), wallpaperLayer
3767
+ ? welcomeWallpaper && createPortal(welcomeWallpaper, wallpaperLayer)
3768
+ : welcomeWallpaper, !hideHeader && (_jsx(SessionSiteHeader, { sessionId: sessionId, sessionTitle: session?.title || 'Untitled', leadingAction: headerLeadingAction, parent: parentCrumb, live: isServerBusy })), _jsx(ModelSwitchHistory, { history: projectSessionRow?.metadata?.model_switches, current: projectSessionRow?.metadata?.model }), _jsx(SessionContextModal, { open: contextModalOpen, onOpenChange: setContextModalOpen,
3769
+ // A chat with no `useSession` source: the raw explorer lists the
3770
+ // rows `useSessionSync` read for it.
3771
+ detachedRows: sessionState ? undefined : hookMessages, source: sessionState ?? DETACHED_SESSION_MESSAGES, session: session, sessionRow: projectSessionRow, providers: providers, allSessions: allSessions, servedModel: sessionServedModel, billedCost: sessionBilledCost(modelUsage) }), _jsx(CompactModal, { sessionId: sessionId, open: compactModalOpen, onOpenChange: setCompactModalOpen }), _jsx(ChangeRequestDetailDialog, { crId: openCrId, onClose: () => setOpenCrId(null), onOpenChangeRequest: setOpenCrId }), _jsxs(SessionBodyRow, { actionPanel: !hideHeader && !readOnly, children: [isNotFound ? (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 text-center", children: [_jsx("div", { className: "text-muted-foreground text-sm", children: tHardcodedUi.raw('componentsSessionSessionChat.line5821JsxTextThisSessionIsNotAccessibleRightNow') }), _jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsx(Link, { href: "/", prefetch: true, onClick: () => {
3772
+ try {
3773
+ if (sessionId)
3774
+ useTabStore.getState().closeTab?.(sessionId);
3775
+ }
3776
+ catch { }
3777
+ }, children: tHardcodedUi.raw('componentsSessionSessionChat.line5833JsxTextGoToHome') }) })] })) : (_jsxs("div", { ref: chatAreaRef, className: "relative z-10 min-h-0 flex-1", children: [_jsx("div", { ref: scrollContainerCallbackRef, className: cn(
3778
+ // overflow-anchor:none — this scroll area does ALL of its own
3779
+ // anchoring (useAutoScroll's spacer + RAF follow, the send-path
3780
+ // turn anchor, and the history-prepend content-space restore in
3781
+ // session-history-scroll.ts). The browser's native scroll
3782
+ // anchoring (default `overflow-anchor: auto`) tries to
3783
+ // compensate for the SAME prepends independently, and the two
3784
+ // corrections stacking is the other half of the scroll-up
3785
+ // teleport: ours restores the reader's position, then the
3786
+ // native one nudges it again.
3787
+ 'scrollbar-hide relative z-10 h-full flex-1 overflow-y-auto [scroll-behavior:auto] [overflow-anchor:none]', shouldShowWelcomeOverlay || transparent ? 'bg-transparent' : 'bg-background'), onMouseUp: handleChatMouseUp, onMouseDown: handleChatMouseDown, onScroll: handleChatScroll, children: _jsxs("div", { ref: contentRef, role: "log",
3788
+ // Width and gutters live in `SESSION_TRANSCRIPT_CLASS`: the
3789
+ // instant shell draws this same column and the two crossfade
3790
+ // into each other, so a difference here is a sideways jump on
3791
+ // screen, not a style opinion. See session-body.tsx.
3792
+ //
3793
+ // No bottom padding, there or here: the space under the last
3794
+ // message is the auto-scroll spacer's job alone. The `pb-32`
3795
+ // that used to sit here stacked 128px of dead space on top of
3796
+ // it — the "extra inset at the bottom of the session".
3797
+ // Rows run edge to edge: each row owns its gutters and its hover fill.
3798
+ className: transcriptRows ? 'w-full min-w-0 pt-4' : SESSION_TRANSCRIPT_CLASS, children: [_jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx(SessionPrintHeader, { title: session?.title || 'Untitled', agentName: composerAgentName }), (hasOlder || showOlderLoading) && (_jsxs("div", { className: "mb-6 flex flex-col items-center gap-2", children: [hasOlder && (_jsx("div", { ref: olderSentinelRef, "aria-hidden": true, className: "h-px w-full" })), showOlderLoading && (_jsxs("div", { role: "status", className: "text-muted-foreground flex items-center gap-2 py-1 text-xs", children: [_jsx(Loading, { className: "size-3.5 shrink-0" }), tHardcodedUi.raw('i18nComplete.text85bf890776a7')] })), !showOlderLoading &&
3799
+ !olderPullFailed &&
3800
+ olderAutoloadExhausted({ hasOlder, autoLoadedPages }) && (_jsx(Button, { type: "button", variant: "outline-ghost", size: "sm", onClick: () => void handleLoadOlder(), children: tHardcodedUi.raw('i18nComplete.textf17671d83db0') })), olderPullFailed && !showOlderLoading && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-muted-foreground text-xs", children: tHardcodedUi.raw('i18nComplete.textb03a0041ce33') }), _jsx(Button, { type: "button", variant: "outline-ghost", size: "sm", onClick: () => void handleLoadOlder(), children: tHardcodedUi.raw('i18nComplete.text942087cc2d41') })] }))] })), restoreNotice && !restoreDismissed && (_jsx(RestoreNotice, { notice: restoreNotice, onDismiss: () => dismissRestore(historyKey, restoreNotice.generation) })), _jsx(SessionOutcomesProvider, { projectSessionId: projectSessionId, turnSpans: turnSpans, busy: effectiveBusy, onOpen: handleOpenOutcome, onJump: handleJumpToOutcome, jumping: jumpingToOutcome, children: _jsxs(ToolActivateContext.Provider, { value: toolActivate, children: [showFirstPromptPreview &&
3801
+ firstPromptSource &&
3802
+ queuedSyntheticMessages.length === 0 &&
3803
+ rowsContext && (
3804
+ // A channel thread draws the stand-in as rows, the same
3805
+ // rows its boot body drew (`ThreadBootRows`).
3806
+ _jsx(PendingPromptRows, { text: buildOptimisticPromptTextWithUploads(firstPromptSource.text, firstPromptSource.files), author: rowsContext.owner, sessionId: sessionId, busy: turns.length === 0 && (lastTurnWorking || promptInbox.prompts.some(isFirstPromptRow)) })), showFirstPromptPreview &&
3807
+ firstPromptSource &&
3808
+ queuedSyntheticMessages.length === 0 &&
3809
+ !rowsContext && (_jsx(OptimisticTurn, { text: buildOptimisticPromptTextWithUploads(firstPromptSource.text, firstPromptSource.files),
3810
+ // Preserve a real failed-send status through the
3811
+ // boot-shell handover without inventing upload progress.
3812
+ // A first prompt held on its uploads carries its own.
3813
+ uploadStatus: firstPromptSource.uploadStatus ?? firstPromptUploadStatus, agentNames: agentNames, onFileClick: openFileInComputer, sessionId: sessionId,
3814
+ // The first item of the conversation, like turn 0, which has no
3815
+ // top margin. `first:mt-0` misses here: the list opens with a
3816
+ // zero-height <header>, so the stand-in sat 44px lower than turn 0
3817
+ // and every swap between the two jumped the bubble (KRTX-2931).
3818
+ className: "mt-0",
3819
+ // An undelivered first prompt is a turn about to start, as the
3820
+ // shell above this chat shows it: busy from the first frame,
3821
+ // before the working projection has read the inbox (KRTX-2931).
3822
+ busy: turns.length === 0 && (lastTurnWorking || promptInbox.prompts.some(isFirstPromptRow)) })), turns.map((turn, turnIndex) => {
3823
+ // Check if this turn is a compaction summary — and
3824
+ // whether it actually PRODUCED one. A failed/aborted
3825
+ // attempt (compaction-flagged, no content, not the
3826
+ // working turn) renders as one slim row, draws no
3827
+ // divider, and stacks tight against a neighbouring
3828
+ // failed attempt.
3829
+ const compaction = turn.compaction;
3830
+ const hasCompaction = compaction !== null;
3831
+ const isTurnWorking = turn.live;
3832
+ // `inFlight` (message state) alongside the projection:
3833
+ // classifying by projection alone flipped a streaming
3834
+ // compaction to "failed" for the frames where the two
3835
+ // disagree, popping the divider in and out — a layout
3836
+ // bounce right where the reader is looking.
3837
+ const isFailedCompaction = compaction !== null &&
3838
+ !compaction.hasContent &&
3839
+ !compaction.inFlight &&
3840
+ !isTurnWorking;
3841
+ // Retries collapse to ONE visible row, GLOBALLY: a
3842
+ // failed attempt with ANY later compaction turn (a
3843
+ // retry, or the one that finally landed) is history —
3844
+ // it keeps its TurnViewport (stable keys, scroll
3845
+ // anchors) but renders no content, and an empty
3846
+ // TurnViewport costs 0px (turn-viewport.tsx RULE 2).
3847
+ // Adjacency was not enough: attempts whose error landed
3848
+ // on a plain assistant message used to interleave as
3849
+ // unclassified turns, breaking every consecutive run.
3850
+ const suppressedFailedCompaction = isFailedCompaction && turnIndex < lastCompactionTurnIndex;
3851
+ // Notification-only early-return removed: it rendered the
3852
+ // user's pty_* card but skipped the turn's replies,
3853
+ // hiding every subsequent assistant response in that turn.
3854
+ // Fall through to the normal turn renderer instead.
3855
+ const confirmedActive = turnIsConfirmedActive({
3856
+ isTurnWorking,
3857
+ turnId: turn.id,
3858
+ activeTurnId,
3859
+ pendingDelivery: !!working.pendingDelivery,
3860
+ });
3861
+ const pendingPrompt = !confirmedActive && turn.assistant.length === 0
3862
+ ? pendingPromptsByMessageId.get(turn.id)
3863
+ : undefined;
3864
+ // A queued prompt is not in the runtime transcript yet;
3865
+ // its author still shows (`authorForTurn`).
3866
+ const promptAuthorId = pendingPromptsByMessageId.get(turn.id)?.author_user_id;
3867
+ const turnAuthor = authorForTurn(transcriptAuthors, messageAuthors, turn.id, pendingPrompt?.wire_message_id) ??
3868
+ participantAuthor(sessionParticipants, promptAuthorId) ??
3869
+ (sentHereIds.current.has(turn.id) ||
3870
+ sentHereIds.current.has(turnRenderKeys.get(turn.id) ?? '') ||
3871
+ (viewerId !== undefined && promptAuthorId === viewerId) ||
3872
+ // The first prompt of a session the viewer started,
3873
+ // sent from another surface (project home), before
3874
+ // the first authors read lands.
3875
+ (messageAuthorsLoading &&
3876
+ viewerId !== undefined &&
3877
+ projectSessionRow?.created_by === viewerId &&
3878
+ turn.id === userMessageIds[0])
3879
+ ? viewerAsAuthor
3880
+ : undefined);
3881
+ return (_jsx(TranscriptTurnRow
3882
+ // ONE element per prompt: keyed by the id the
3883
+ // bubble was FIRST painted under, so the swap to a
3884
+ // re-minted echo id re-renders this node instead
3885
+ // of mounting a new one (opacity keeps animating,
3886
+ // hover state survives, nothing jumps).
3887
+ , { turnId: turn.id, modelOptions: modelOptions,
3888
+ // An absorbed run turn keeps its viewport (keys, scroll
3889
+ // anchors) and draws nothing: its anchor folds it.
3890
+ suppressed: suppressedFailedCompaction || agentRunLayout.absorbed.has(turn.id), ...agentRunLayout.propsOf(turn.id), continuedWith: harnessSwitches.get(turn.id)?.harness, fullTextState: loaded.state[turn.id] ?? 'idle', onLoadFullText: loadFullTexts, showBusyRow: showFallbackBusyRow &&
3891
+ fallbackBusyRowTurnId === turn.id,
3892
+ // Queued bubbles STACK: a pending turn right after
3893
+ // another pending turn sits close to it, like a
3894
+ // list of what is waiting — not a turn's width
3895
+ // apart as if each had been answered in between.
3896
+ // (Failed compaction rows need no stacking rule any
3897
+ // more — at most one is visible at a time.)
3898
+ viewportClassName: turnIndex === 0 || transcriptRows
3899
+ ? ''
3900
+ : // A compaction, the work after it and another agent's notice continue the turn above.
3901
+ turn.compaction || turn.continues || agentNoticeTurnIds.has(turn.id)
3902
+ ? 'mt-6'
3903
+ : lastTurnWorking &&
3904
+ pendingTurnIds.has(turn.id) &&
3905
+ pendingTurnIds.has(turns[turnIndex - 1].id)
3906
+ ? 'mt-3'
3907
+ : 'mt-12', turn: turn, author: turnAuthor,
3908
+ // Reserve the sender row while the authors load,
3909
+ // for a queued prompt whose sender is known, and
3910
+ // for a live message until its author resolves.
3911
+ showAuthor: !!turnAuthor ||
3912
+ messageAuthorsLoading ||
3913
+ !!promptAuthorId ||
3914
+ (loadedUserIds?.sessionId === sessionId &&
3915
+ !loadedUserIds.ids.has(turn.id) &&
3916
+ authorsGaveUp !== missingAuthors), stoppedBy: stoppedByName(messageAuthors, turn.id, viewerId), servedModel: servedModelOfTurn(modelUsage, turn.id, turns[turnIndex - 1]?.id), turnOutcome: turnOutcome, isLast: turn.id === lastUserMessageId, ownsPlan: turn.id === planAnchorId, sessionId: sessionId, projectId: projectId, projectSessionId: projectSessionId, sessionStatus: sessionStatus, permissions: pendingPermissions, questions: pendingQuestions, agentNames: agentNames, isFirstTurn: turnIndex === 0,
3917
+ // Handed over only once the stand-in has stepped
3918
+ // aside — while it is up it draws these itself.
3919
+ pendingText: turnIndex === 0 ? firstTurnHandover?.text : undefined, pendingAttachments: sentAttachmentsForTurn({
3920
+ sentByMessage: sentAttachmentsByMessage,
3921
+ messageId: turn.id,
3922
+ originId: optimisticOriginOf(sessionId, turn.id),
3923
+ isFirstTurn: turnIndex === 0,
3924
+ firstTurnHandover: firstTurnHandover?.attachments,
3925
+ firstTurnSent: firstPromptAttachments(projectSessionId),
3926
+ queuedRowAttachments: inboxRowsByMessageId.get(turn.id)?.attachments,
3927
+ }), uploadStatus: heldSendFailures?.[turn.id]
3928
+ ? {
3929
+ state: 'failed',
3930
+ message: heldSendFailures[turn.id].message,
3931
+ onRetry: () => retryHeldSend(sessionId, turn.id, resendHeldSend, (error) => classifySessionError(error).message),
3932
+ }
3933
+ : turnIndex === 0 && firstTurnHandover?.attachments.length
3934
+ ? firstPromptUploadStatus
3935
+ : undefined, sessionWorking: lastTurnWorking, isWorkingTurn: turn.live, suppressBusyIndicator: suppressWorkingTurnBusy, awaitingUser: awaitingUserInput,
3936
+ // An idle send stays in the inbox until delivery,
3937
+ // but nothing runs ahead of it: queued only while
3938
+ // it waits behind a turn (`turnRendersQueued`).
3939
+ // The first turn, with no turn working, has
3940
+ // nothing ahead of it: a session's first prompt is
3941
+ // starting, not queued, while the computer comes up
3942
+ // and before the turn layer marks it queued or live.
3943
+ pending: turnIndex === 0 && workingTurn.workingTurnId === null && !confirmedActive
3944
+ ? pendingPrompt?.state === 'waiting' || pendingPrompt?.state === 'failed'
3945
+ : turnRendersQueued({
3946
+ turnId: turn.id,
3947
+ resolution: workingTurn,
3948
+ sessionWorking: lastTurnWorking,
3949
+ confirmedActive,
3950
+ inboxPrompt: pendingPrompt,
3951
+ }), pendingPrompt: pendingPrompt, onRetryQueued: stableRetryQueued, onRemoveQueued: stableRemoveQueued, queuedPromptViewer: queuedPromptViewer, interruptedBeforeRun: interruptedTurnIds.has(turn.id), isCompaction: hasCompaction, onOpenCompactionSummary: panel ? stableOpenCompactionSummary : undefined, onOpenPastedContent: panel ? stableOpenPastedContent : undefined, providers: providers, commandMessages: commandMessagesRef.current, commands: commands, disableToolNavigation: disableToolNavigation, onPermissionReply: stablePermissionReply, onRewind: stableRewind, editingText: rewindTarget?.messageId === turn.id
3952
+ ? rewindTarget.text
3953
+ : null, editPending: editSendPending || !!sessionState?.rewindPending, onEditCancel: stableEditCancel, onEditSend: stableEditSend, rewindDisabled: !!readOnly ||
3954
+ (rewindable !== null && !rewindable.has(turn.id)) ||
3955
+ !runtimeCanRewind ||
3956
+ !sessionState ||
3957
+ isBusy ||
3958
+ sessionState.rewindPending ||
3959
+ // The runtime is not idle while queued prompts
3960
+ // are still on their way to it — a rewind mid-
3961
+ // delivery fails downstream with "Session is
3962
+ // busy" (measured); refuse it up front instead.
3963
+ promptInbox.prompts.length > 0 }, turnRenderKeys.get(turn.id)));
3964
+ })] }) }), isOptimisticCompacting && !hasCompactionTurn && (_jsx("div", { className: turns.length > 0 ? 'mt-12' : 'mt-2', children: _jsx(CompactionMarker, { running: true }) })), [
3965
+ ...(turnOutcome.recent_failures ?? []),
3966
+ ...(turnOutcome.last_ended?.end_reason === 'failed' &&
3967
+ !turnOutcome.recent_failures?.some((failure) => failure.message_id === turnOutcome.last_ended?.message_id)
3968
+ ? [turnOutcome.last_ended]
3969
+ : []),
3970
+ ].filter((failure) => !isAbortError(failure.error) &&
3971
+ !failureShownByTurn(failure, turns) &&
3972
+ !failureSupersededByTurn(failure, turns) &&
3973
+ (!failure.error?.message || failure.error.message !== commandError?.message)).map((failure) => {
3974
+ const messageId = failure.message_id ?? 'persisted-turn-failure';
3975
+ // Use the SDK's settle window for a cause that may arrive
3976
+ // one frame later, including an unnamed failed last turn.
3977
+ const notice = turnEndNotice({
3978
+ ...turnOutcome,
3979
+ recent_failures: [{ ...failure, message_id: messageId, error: failure.error ?? null }],
3980
+ }, messageId, { hasError: false, isAbort: false });
3981
+ return notice ? (_jsx(TurnErrorDisplay, { errorText: notice.kind === 'unexplained'
3982
+ ? tHardcodedUi.raw('i18nComplete.text73112526c03a')
3983
+ : persistedFailureText(failure.error), className: "mt-2" }, messageId)) : null;
3984
+ }), commandError && (_jsx(TurnErrorDisplay, { error: commandError, isAbort: isAbortError(commandError.cause), modelOptions: modelOptions, className: "mt-2" })), showFallbackBusyRow && fallbackBusyRowTurnId === null && (rowsContext ? (
3985
+ // A channel thread waits in the agent's answer row.
3986
+ _jsx(AgentBusyRow, { sessionId: sessionId })) : (_jsx(SessionBusyIndicator, { sessionId: sessionId,
3987
+ // Matches the stand-in's row spacing under a bubble
3988
+ // (`OptimisticTurn`), so the crossfade into the real
3989
+ // transcript does not move it. Nothing above it when
3990
+ // the transcript is empty, so no margin there.
3991
+ className: turns.length === 0 ? undefined : 'mt-6' })))] }), _jsx("div", { ref: spacerElRef, "data-scroll-spacer": true })] }) }), selectionPopup && (_jsx("div", { "data-reply-popup": true, className: "absolute z-50", style: {
3992
+ left: `${selectionPopup.x}px`,
3993
+ top: `${selectionPopup.y}px`,
3994
+ transform: 'translate(-50%, -100%)',
3995
+ }, children: _jsxs(Button, { onClick: handleSelectionReply, size: "sm", className: "animate-in fade-in-0 zoom-in-95 duration-normal origin-bottom px-3 text-xs ease-out has-[>svg]:px-3", children: [tHardcodedUi.raw('i18nComplete.textc253f451bdd5'), _jsx(ArrowBendUpLeftIcon, { className: "size-4 shrink-0" })] }) })), transcriptRows ? null : (_jsx(ChatMinimap, { turns: turns, scrollRef: scrollRef, contentRef: contentRef })), _jsx("div", { className: cn('absolute inset-x-0 bottom-4 z-20 flex justify-center', !showScrollButton && 'pointer-events-none'), children: _jsx(Button, { variant: "outline", size: "icon-md", "aria-hidden": !showScrollButton, tabIndex: showScrollButton ? undefined : -1, className: cn('hit-area-2 bg-background hover:bg-muted rounded-full', 'transition-[opacity,scale] ease-[cubic-bezier(0.23,1,0.32,1)] active:scale-[0.96] motion-reduce:scale-100 motion-reduce:transition-opacity', showScrollButton
3996
+ ? 'duration-normal scale-100 opacity-100'
3997
+ : 'duration-fast scale-[0.97] opacity-0'), onClick: smoothScrollToAbsoluteBottom, children: _jsx(CaretDownIcon, { className: "size-4" }) }) })] })), readOnly && inputReplacement ? (_jsx("div", { className: cn(COMPOSER_SHELL_CLASS, 'pb-4'), children: inputReplacement })) : null, !readOnly && (_jsxs(_Fragment, { children: [!networkOnline && (_jsx("div", { className: cn(COMPOSER_SHELL_CLASS, 'pb-1.5'), children: _jsx("p", { role: "status", "aria-live": "polite", className: "text-muted-foreground text-xs", children: tQueue('offlineReconnecting') }) })), _jsx(SessionChatInput
3992
3998
  // `undefined`, not `true`, once released: the composer's own
3993
3999
  // viewport rule (>= 640px) still decides, so this never forces
3994
4000
  // focus onto a phone keyboard.
3995
4001
  // A thread a space's chat opened by itself does not take the focus (`ComposerAutoFocusContext`).
3996
- autoFocus: deferComposerFocus || !composerAutoFocus ? false : undefined, onSend: async (text, files, mentions, attachments, placement) => {
3997
- if (await queueEdit.save(text))
3998
- return;
3999
- // Enter or Cmd/Ctrl+Enter while a turn runs steers it (one delivery mode).
4000
- await handleSend(text, files, mentions, attachments, composerSendDelivery(placement ?? 'transcript', isBusyRef.current));
4001
- }, prefill: composerPrefill, onPrefillApplied: (id) => {
4002
- useSessionComposerPrefillStore.getState().clearPrefill(sessionId, id);
4003
- },
4004
- // Up from the first row takes the queue back; the placeholder
4005
- // says so while there is something to take.
4006
- onArrowUpAtStart: () => queueEdit.takeBack(),
4007
- // A host placeholder ("Reply…") is static: the rotating tips would replace it.
4008
- hint: canTakeBackQueue ? tHardcodedUi.raw('i18nComplete.text03a01dd53ffa') : composerPlaceholder,
4009
- // Editing a queued message: the send saves it back into the
4010
- // queue, so the control says Submit, never Stop.
4011
- submitLabel: queueEdit.editing ? tQueue('submitEdit') : null, draftScope: composerDraftScope, draftActive: !deferComposerFocus, attachRequestId: attachRequestId, isBusy: isBusy,
4012
- // The ONE projection, not the 300 ms busy fade: it is what
4013
- // decides whether a `/` command may be dispatched, and a fade
4014
- // timer that has already lapsed would let one abort a live turn.
4015
- // `effectiveBusy` folds in optimistic compaction (not a turn, so
4016
- // not in `working`) and the retrying-turn predicate, so this
4017
- // site reads one value instead of re-OR-ing a term onto it.
4018
- sessionWorking: effectiveBusy,
4019
- // Gates `/` COMMANDS only. A prompt typed at a sleeping box is
4020
- // an inbox row and goes out when the box answers; a command has
4021
- // no row, and `runCommand` swallows it silently until the
4022
- // runtime is switched.
4023
- runtimeReady: runtimeReady, rewind: composerRewind, onStop: handleStop, canStop: canStop, escCount: escCount, agents: local.agent.list, selectedAgent: composerAgentName, onAgentChange: handleAgentChange, noAccessibleAgents: noAccessibleAgents, commands: chatCommands, commandsResolved: agentCommands !== undefined, slashFiles: chatSlashFiles, onOpenPastedContent: panel ? stableOpenPastedContent : undefined, onCommand: handleCommand, onHoldCommand: handleHoldCommand, models: local.model.list, selectedModel: local.model.currentKey ?? null, onModelChange: handleModelChange, modelDefaultControls: chatModelDefaultControls, inheritedModel: inheritedModelFor(local.model, composerAgentName), variants: local.model.variant.list, selectedVariant: local.model.variant.current ?? null, onVariantChange: handleVariantChange, messages: messages, sessionId: sessionId, projectId: projectId, providers: providers, modelRequired: true, modelsLoading: providersLoading, onContextClick: handleContextClick, onCompactClick: runtimeCanCompact ? handleCompactClick : undefined, quoteRequests: quoteRequests, onQuoteRequestsApplied: handleQuoteRequestsApplied,
4024
- // Locks while the docked question is answerable — a live
4025
- // question or a parked ask — see `questionLock` above.
4026
- lockForQuestion: questionLock,
4027
- // Same dead-prompt guard as questions: only lock while the agent is
4028
- // actually paused on the decision (isBusy), so a stale card can't
4029
- // swallow the composer on an idle session.
4030
- lockForApproval: runtimePermissionLocksComposer(livePermissions.length, isBusy), onCustomAnswer: handleCustomAnswer, questionButtonLabel: renderedQuestion ? questionAction.label : null, questionActive: !!renderedQuestion || approvalDocked || accessDocked || connectDocked, questionCanAct: questionAction.canAct, onQuestionAction: handleQuestionAction, aboveSlot: chatAboveSlot, inputSlot: chatInputSlot, toolbarSlot: chatToolbarSlot, underbarSlot: chatUnderbarSlot,
4031
- // The shell can now render on a cached transcript alone, i.e. before
4032
- // the sandbox answers — so sending has to be gated separately from
4033
- // reading. See sessionComposerReadiness.
4034
- notice: hostNotice(composerReadiness.notice, rowsContext?.notices),
4035
- // Inside the thread panel's bordered box, as the channel composer.
4036
- // A phone keeps the row under the card; a 720px desktop window does not.
4037
- underbarPlacement: transcriptRows && !isPhone ? 'inline' : undefined,
4038
- // The panel's toolbar is narrow: the agent is its tile, the model keeps its name.
4039
- agentPickerCompact: transcriptRows && !isPhone,
4040
- // A thread panel's rows run `px-5`, and the channel composer
4041
- // beside it sits `pb-4` off the window's bottom edge: the same
4042
- // margins, so the two boxes line up.
4043
- parentClassName: transcriptRows ? 'max-w-none px-5 pb-4' : undefined, call: composerCall, onNoticeRetry: composerReadiness.notice && composerReadiness.retryable
4044
- ? requestRuntimeReconnect
4045
- : undefined }), _jsx("div", { className: cn(COMPOSER_SHELL_CLASS, 'pb-3 empty:hidden', transcriptRows && 'max-w-none px-5'), children: _jsx(HeldMessages, { projectId: projectId, sessionId: projectSessionId }) })] }))] })] }) }) }) }) }));
4002
+ , {
4003
+ // `undefined`, not `true`, once released: the composer's own
4004
+ // viewport rule (>= 640px) still decides, so this never forces
4005
+ // focus onto a phone keyboard.
4006
+ // A thread a space's chat opened by itself does not take the focus (`ComposerAutoFocusContext`).
4007
+ autoFocus: deferComposerFocus || !composerAutoFocus ? false : undefined, onSend: async (text, files, mentions, attachments, placement) => {
4008
+ if (await queueEdit.save(text))
4009
+ return;
4010
+ // Enter or Cmd/Ctrl+Enter while a turn runs steers it (one delivery mode).
4011
+ await handleSend(text, files, mentions, attachments, composerSendDelivery(placement ?? 'transcript', isBusyRef.current));
4012
+ }, prefill: composerPrefill, onPrefillApplied: (id) => {
4013
+ useSessionComposerPrefillStore.getState().clearPrefill(sessionId, id);
4014
+ },
4015
+ // Up from the first row takes the queue back; the placeholder
4016
+ // says so while there is something to take.
4017
+ onArrowUpAtStart: () => queueEdit.takeBack(),
4018
+ // A host placeholder ("Reply…") is static: the rotating tips would replace it.
4019
+ hint: canTakeBackQueue ? tHardcodedUi.raw('i18nComplete.text03a01dd53ffa') : composerPlaceholder,
4020
+ // Editing a queued message: the send saves it back into the
4021
+ // queue, so the control says Submit, never Stop.
4022
+ submitLabel: queueEdit.editing ? tQueue('submitEdit') : null, draftScope: composerDraftScope, draftActive: !deferComposerFocus, attachRequestId: attachRequestId, isBusy: isBusy,
4023
+ // The ONE projection, not the 300 ms busy fade: it is what
4024
+ // decides whether a `/` command may be dispatched, and a fade
4025
+ // timer that has already lapsed would let one abort a live turn.
4026
+ // `effectiveBusy` folds in optimistic compaction (not a turn, so
4027
+ // not in `working`) and the retrying-turn predicate, so this
4028
+ // site reads one value instead of re-OR-ing a term onto it.
4029
+ sessionWorking: effectiveBusy,
4030
+ // Gates `/` COMMANDS only. A prompt typed at a sleeping box is
4031
+ // an inbox row and goes out when the box answers; a command has
4032
+ // no row, and `runCommand` swallows it silently until the
4033
+ // runtime is switched.
4034
+ runtimeReady: runtimeReady, rewind: composerRewind, onStop: handleStop, canStop: canStop, escCount: escCount, agents: local.agent.list, selectedAgent: composerAgentName, onAgentChange: handleAgentChange, noAccessibleAgents: noAccessibleAgents, commands: chatCommands, commandsResolved: agentCommands !== undefined, slashFiles: chatSlashFiles, onOpenPastedContent: panel ? stableOpenPastedContent : undefined, onCommand: handleCommand, onHoldCommand: handleHoldCommand, models: local.model.list, selectedModel: local.model.currentKey ?? null, onModelChange: handleModelChange, modelDefaultControls: chatModelDefaultControls, inheritedModel: inheritedModelFor(local.model, composerAgentName), variants: local.model.variant.list, selectedVariant: local.model.variant.current ?? null, onVariantChange: handleVariantChange, messages: messages, sessionId: sessionId, projectId: projectId, providers: providers, modelRequired: true, modelsLoading: providersLoading, onContextClick: handleContextClick, onCompactClick: runtimeCanCompact ? handleCompactClick : undefined, quoteRequests: quoteRequests, onQuoteRequestsApplied: handleQuoteRequestsApplied,
4035
+ // Locks while the docked question is answerable — a live
4036
+ // question or a parked ask — see `questionLock` above.
4037
+ lockForQuestion: questionLock,
4038
+ // Same dead-prompt guard as questions: only lock while the agent is
4039
+ // actually paused on the decision (isBusy), so a stale card can't
4040
+ // swallow the composer on an idle session.
4041
+ lockForApproval: runtimePermissionLocksComposer(livePermissions.length, isBusy), onCustomAnswer: handleCustomAnswer, questionButtonLabel: renderedQuestion ? questionAction.label : null, questionActive: !!renderedQuestion || approvalDocked || accessDocked, questionCanAct: questionAction.canAct, onQuestionAction: handleQuestionAction, aboveSlot: chatAboveSlot, inputSlot: chatInputSlot, toolbarSlot: chatToolbarSlot, underbarSlot: chatUnderbarSlot,
4042
+ // The shell can now render on a cached transcript alone, i.e. before
4043
+ // the sandbox answers — so sending has to be gated separately from
4044
+ // reading. See sessionComposerReadiness.
4045
+ notice: hostNotice(composerReadiness.notice, rowsContext?.notices),
4046
+ // Inside the thread panel's bordered box, as the channel composer.
4047
+ // A phone keeps the row under the card; a 720px desktop window does not.
4048
+ underbarPlacement: transcriptRows && !isPhone ? 'inline' : undefined,
4049
+ // The panel's toolbar is narrow: the agent is its tile, the model keeps its name.
4050
+ agentPickerCompact: transcriptRows && !isPhone,
4051
+ // A thread panel's rows run `px-5`, and the channel composer
4052
+ // beside it sits `pb-4` off the window's bottom edge: the same
4053
+ // margins, so the two boxes line up.
4054
+ parentClassName: transcriptRows ? 'max-w-none px-5 pb-4' : undefined, call: composerCall, onNoticeRetry: composerReadiness.notice && composerReadiness.retryable
4055
+ ? requestRuntimeReconnect
4056
+ : undefined }), _jsx("div", { className: cn(COMPOSER_SHELL_CLASS, 'pb-3 empty:hidden', transcriptRows && 'max-w-none px-5'), children: _jsx(HeldMessages, { projectId: projectId, sessionId: projectSessionId, live: isServerBusy }) })] }))] })] }) }) }) }) }) }));
4046
4057
  }