@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
@@ -6,7 +6,7 @@ import { SessionOverridesComposer } from '../overrides/session-overrides-compose
6
6
  import { SessionChatInput, } from './session-chat-input.js';
7
7
  import { useProjectConfig, useRuntimeAgents, useRuntimeCommands, useRuntimeConfig, useRuntimeProviders, useSessionModelSelection } from '@kortix/sdk/react';
8
8
  import { appendMentionRefs } from '../../internal/lib/project-preamble.js';
9
- import { resolveComposerAgent, withChannelAgents } from './composer-agent-access.js';
9
+ import { chatStartAgent, resolveComposerAgent, withChannelAgents } from './composer-agent-access.js';
10
10
  import { inheritedModelFor } from './chat-input/chat-input-summary.js';
11
11
  /**
12
12
  * The canonical "compose a first message" input: {@link SessionChatInput}
@@ -24,7 +24,9 @@ export function ComposerChatInput({ onSend, onCommand, sessionId, projectId, isB
24
24
  const { data: providers, isLoading: providersLoading } = useRuntimeProviders();
25
25
  const { data: config } = useRuntimeConfig();
26
26
  const projectConfig = useProjectConfig(projectId);
27
- const startAgent = defaultAgentName || projectConfig?.default_agent;
27
+ // A new chat starts on the place's agent (a channel's), else My Kortix when
28
+ // the workspace runs it, else kortix.yaml `default_agent` (`chatStartAgent`).
29
+ const startAgent = defaultAgentName || chatStartAgent(projectConfig);
28
30
  const local = useSessionModelSelection({
29
31
  agents,
30
32
  providers,
@@ -32,6 +34,9 @@ export function ComposerChatInput({ onSend, onCommand, sessionId, projectId, isB
32
34
  sessionId,
33
35
  boundAgentName,
34
36
  defaultAgentName: startAgent,
37
+ // A new workspace chat remembers the person's pick and starts the next one
38
+ // on it. A place with its own default agent (a channel) keeps that default.
39
+ rememberAgent: !sessionId && !boundAgentName && !defaultAgentName,
35
40
  projectSession,
36
41
  });
37
42
  const setAgent = local.agent.set;
@@ -194,6 +194,13 @@ export declare function planPrefillMerge(input: {
194
194
  /** `editorRef.current.isEmpty()`. */
195
195
  currentIsEmpty: boolean;
196
196
  }): JSONContent | null;
197
+ /**
198
+ * `doc` with `text` added to the end of its last paragraph (or in a new
199
+ * paragraph when the last block is not one). Keys typed before the editor
200
+ * existed continue the restored draft this way (`prefill.restoreDraft`).
201
+ * `text` must be non-empty: ProseMirror text nodes cannot be empty.
202
+ */
203
+ export declare function appendTextToDocument(doc: JSONContent, text: string): JSONContent;
197
204
  export interface ShouldApplyPrefillInput {
198
205
  /** `prefill?.id` — `undefined` means "no prefill at all". */
199
206
  prefillId: number | undefined;
@@ -194,6 +194,24 @@ export function planPrefillMerge(input) {
194
194
  const merged = mergeFailedSubmissionDocument(input.currentDoc, input.currentIsEmpty, input.prefillDoc, input.prefillIsEmpty);
195
195
  return merged === input.currentDoc ? null : merged;
196
196
  }
197
+ /**
198
+ * `doc` with `text` added to the end of its last paragraph (or in a new
199
+ * paragraph when the last block is not one). Keys typed before the editor
200
+ * existed continue the restored draft this way (`prefill.restoreDraft`).
201
+ * `text` must be non-empty: ProseMirror text nodes cannot be empty.
202
+ */
203
+ export function appendTextToDocument(doc, text) {
204
+ const content = [...(doc.content ?? [])];
205
+ const last = content[content.length - 1];
206
+ const node = { type: 'text', text };
207
+ if (last?.type === 'paragraph') {
208
+ content[content.length - 1] = { ...last, content: [...(last.content ?? []), node] };
209
+ }
210
+ else {
211
+ content.push({ type: 'paragraph', content: [node] });
212
+ }
213
+ return { ...doc, type: 'doc', content };
214
+ }
197
215
  /**
198
216
  * Whether a `prefill` prop should be applied right now.
199
217
  *
@@ -4,21 +4,15 @@ import type { AttachedFile } from './session-chat-input.js';
4
4
  *
5
5
  * - `true` — every in-thread composer. It stays mounted, so it resets in
6
6
  * place and revokes the local object URLs nobody references any more.
7
- * - `'text-only'` — project home. It clears like any other composer, so the
8
- * message visibly LEAVES the box, but it revokes nothing: the same local
9
- * URLs are what the instant shell draws its attachment previews from a
10
- * moment later, on the other side of the navigation.
7
+ * - `'text-only'` — a space composer (`space-view.tsx`). It clears like any
8
+ * other composer, so the message visibly LEAVES the box, but it revokes
9
+ * nothing: the same local URLs are what the new thread draws its
10
+ * attachment previews from a moment later.
11
11
  * - `false` — a composer that must keep the submitted draft on screen
12
- * untouched. Nothing clears and nothing is revoked.
13
- *
14
- * `'text-only'` exists because the two halves of `false` turned out to be
15
- * separate decisions. Project home held BOTH — text on screen and URLs alive —
16
- * for one reason (the URLs), and the text half was the visible cost: Enter left
17
- * the sentence sitting in a locked box under a spinner for the whole create
18
- * round trip (measured 1165ms end to end on localhost, `POST .../sessions`
19
- * alone 908ms; longer over a real network), which reads as a send that did not
20
- * happen. Splitting them lets the box empty at the keypress, like everywhere
21
- * else in the app, with the previews still intact when the shell takes over.
12
+ * untouched. Nothing clears and nothing is revoked. Project home is one:
13
+ * the sent message stays in the locked box under the spinner until the
14
+ * session page opens, so the user sees what is being sent and a refused
15
+ * send leaves the text in place.
22
16
  */
23
17
  export type ComposerSendReset = boolean | 'text-only';
24
18
  /**
@@ -94,6 +94,8 @@ export interface ComposerToolbarProps {
94
94
  leading?: React.ReactNode;
95
95
  /** The `chat_input` control holds model and effort: this toolbar draws neither. */
96
96
  pickersInChatInput?: boolean;
97
+ /** The agent runs a program (`run`), not a model: this toolbar draws neither model nor effort. */
98
+ noModel?: boolean;
97
99
  isSending: boolean;
98
100
  isBusy: boolean;
99
101
  onStop?: () => void;
@@ -121,4 +123,4 @@ export interface ComposerToolbarProps {
121
123
  call?: ComposerCall;
122
124
  onSubmit: () => void;
123
125
  }
124
- export declare function ComposerToolbar({ models, modelsLoading, selectedModel, onModelChange, modelDefaultControls, providers, modelRequired, modelMenuOpen, onModelMenuOpenChange, reasoningMenuOpen, onReasoningMenuOpenChange, variants, selectedVariant, onVariantChange, projectId, toolbarSlot, rewind, leading, pickersInChatInput, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable, attachmentFailed, attachmentUnsupported, call, onSubmit, }: ComposerToolbarProps): import("react").JSX.Element;
126
+ export declare function ComposerToolbar({ models, modelsLoading, selectedModel, onModelChange, modelDefaultControls, providers, modelRequired, modelMenuOpen, onModelMenuOpenChange, reasoningMenuOpen, onReasoningMenuOpenChange, variants, selectedVariant, onVariantChange, projectId, toolbarSlot, rewind, leading, pickersInChatInput, noModel, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable, attachmentFailed, attachmentUnsupported, call, onSubmit, }: ComposerToolbarProps): import("react").JSX.Element;
@@ -9,10 +9,10 @@ import Loading from '../../primitives/loading.js';
9
9
  import { ModelSelector } from '../models/model-selector.js';
10
10
  import { ReasoningEffortSelector } from './reasoning-effort-selector.js';
11
11
  import { SendStopControl } from './send-stop-control.js';
12
- export function ComposerToolbar({ models, modelsLoading, selectedModel, onModelChange, modelDefaultControls, providers, modelRequired, modelMenuOpen, onModelMenuOpenChange, reasoningMenuOpen, onReasoningMenuOpenChange, variants, selectedVariant, onVariantChange, projectId, toolbarSlot, rewind, leading, pickersInChatInput = false, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable = false, attachmentFailed = false, attachmentUnsupported = null, call, onSubmit, }) {
12
+ export function ComposerToolbar({ models, modelsLoading, selectedModel, onModelChange, modelDefaultControls, providers, modelRequired, modelMenuOpen, onModelMenuOpenChange, reasoningMenuOpen, onReasoningMenuOpenChange, variants, selectedVariant, onVariantChange, projectId, toolbarSlot, rewind, leading, pickersInChatInput = false, noModel = false, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable = false, attachmentFailed = false, attachmentUnsupported = null, call, onSubmit, }) {
13
13
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
14
14
  const { modelPickerEnabled } = useUiHostConfig();
15
- const showModel = !pickersInChatInput && modelPickerEnabled && (models.length > 0 || modelRequired) && !!onModelChange;
15
+ const showModel = !noModel && !pickersInChatInput && modelPickerEnabled && (models.length > 0 || modelRequired) && !!onModelChange;
16
16
  // Either `/` palette row opens the one merged popover.
17
17
  const pickerOpen = modelMenuOpen === undefined && reasoningMenuOpen === undefined
18
18
  ? undefined
@@ -22,7 +22,7 @@ export function ComposerToolbar({ models, modelsLoading, selectedModel, onModelC
22
22
  if (!next)
23
23
  onReasoningMenuOpenChange?.(false);
24
24
  };
25
- return (_jsxs("div", { className: "kortix-composer-toolbar flex items-center justify-between gap-1 overflow-visible", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-1 overflow-visible", children: [leading, showModel && (_jsx(ModelSelector, { models: models, modelsLoading: modelsLoading, selectedModel: selectedModel, onSelect: onModelChange, providers: providers, defaultControls: modelDefaultControls, triggerLabelClassName: "max-w-[7rem]", projectId: projectId, offerProviderAccounts: true, open: pickerOpen, onOpenChange: onPickerOpenChange, reasoning: { variants, selectedVariant, onVariantChange } })), !showModel && modelPickerEnabled && !pickersInChatInput && _jsx(ReasoningEffortSelector, { variants: variants, selectedVariant: selectedVariant, onVariantChange: onVariantChange, open: reasoningMenuOpen, onOpenChange: onReasoningMenuOpenChange })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [rewind && (_jsxs(HoverCard, { openDelay: 0, closeDelay: 0, children: [_jsx(HoverCardTrigger, { asChild: true, children: _jsx("span", { className: "inline-flex", children: _jsxs(Button, { type: "button", variant: "ghost", size: "sm", disabled: rewind.pending || rewind.disabled, onClick: rewind.onRestore, className: "text-muted-foreground hover:text-foreground gap-1.5", children: [rewind.pending ? (_jsx(Loading, { className: "size-3.5 shrink-0" })) : (_jsx(ArrowCounterClockwiseIcon, { className: "size-3.5 shrink-0" })), tI18nComplete.raw('texta76e13b98392')] }) }) }), _jsx(HoverCardContent, { className: "px-3 py-2 text-sm text-balance", children: rewind.disabled && !rewind.pending
25
+ return (_jsxs("div", { className: "kortix-composer-toolbar flex items-center justify-between gap-1 overflow-visible", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-1 overflow-visible", children: [leading, showModel && (_jsx(ModelSelector, { models: models, modelsLoading: modelsLoading, selectedModel: selectedModel, onSelect: onModelChange, providers: providers, defaultControls: modelDefaultControls, triggerLabelClassName: "max-w-[7rem]", projectId: projectId, offerProviderAccounts: true, open: pickerOpen, onOpenChange: onPickerOpenChange, reasoning: { variants, selectedVariant, onVariantChange } })), !showModel && !noModel && modelPickerEnabled && !pickersInChatInput && _jsx(ReasoningEffortSelector, { variants: variants, selectedVariant: selectedVariant, onVariantChange: onVariantChange, open: reasoningMenuOpen, onOpenChange: onReasoningMenuOpenChange })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [rewind && (_jsxs(HoverCard, { openDelay: 0, closeDelay: 0, children: [_jsx(HoverCardTrigger, { asChild: true, children: _jsx("span", { className: "inline-flex", children: _jsxs(Button, { type: "button", variant: "ghost", size: "sm", disabled: rewind.pending || rewind.disabled, onClick: rewind.onRestore, className: "text-muted-foreground hover:text-foreground gap-1.5", children: [rewind.pending ? (_jsx(Loading, { className: "size-3.5 shrink-0" })) : (_jsx(ArrowCounterClockwiseIcon, { className: "size-3.5 shrink-0" })), tI18nComplete.raw('texta76e13b98392')] }) }) }), _jsx(HoverCardContent, { className: "px-3 py-2 text-sm text-balance", children: rewind.disabled && !rewind.pending
26
26
  ? tI18nComplete.raw('text98433e61649a')
27
27
  : tI18nComplete.raw('text4c25090df9ea') })] })), toolbarSlot, _jsx(SendStopControl, { isSending: isSending, isBusy: isBusy, onStop: onStop, stopDisabled: stopDisabled, canStop: canStop, escCount: escCount, lockForQuestion: lockForQuestion, questionButtonLabel: questionButtonLabel, submitLabel: submitLabel, questionCanAct: questionCanAct, hasText: hasText, canSubmit: canSubmit, submitDisabled: submitDisabled, disabled: disabled, modelUnavailable: modelUnavailable, agentUnavailable: agentUnavailable, attachmentFailed: attachmentFailed, attachmentUnsupported: attachmentUnsupported, call: call, onSubmit: onSubmit })] })] }));
28
28
  }
@@ -205,6 +205,13 @@ export interface SessionChatInputProps {
205
205
  id: number;
206
206
  files?: AttachedFile[];
207
207
  mode?: 'replace' | 'merge';
208
+ /**
209
+ * Restore the saved draft first, then merge this text after it. Only the
210
+ * home typing buffer sets it (`use-home-typing-buffer.ts`): keys typed
211
+ * while the page loaded continue the draft. Any other prefill still wins
212
+ * over the draft.
213
+ */
214
+ restoreDraft?: boolean;
208
215
  /**
209
216
  * Submit the prefill once it has landed, exactly as if the person pressed
210
217
  * Enter. For one-click starters (the first chat's "Update memory"): the
@@ -363,8 +370,8 @@ export interface SessionChatInputProps {
363
370
  *
364
371
  * The gutter is equal on both sides. It used to carry `md:pr-1`, a right-side
365
372
  * trim against the collapsed action-panel chevron rail, which then took ~37px
366
- * of the row's width. That rail now takes no width (`COLLAPSED_RAIL_OFFSET` in
367
- * `session-action-panel-column.tsx`), so the trim only shifted the card 5.5px
373
+ * of the row's width. Collapsed, the column now takes no width at all
374
+ * (`session-action-panel-column.tsx`), so the trim only shifted the card 5.5px
368
375
  * right of center. A breakpoint may never ZERO this gutter — zero is what let
369
376
  * the card touch the panel divider, and `composer-underbar.test.tsx` guards
370
377
  * exactly that line.
@@ -7,7 +7,7 @@ import { cn } from '../../lib/utils.js';
7
7
  import { isImageFile } from '../../internal/lib/utils/file-utils.js';
8
8
  import { useProjectConfig, usePromptAttachments, useRuntimeSessions } from '@kortix/sdk/react';
9
9
  import { useActiveSpace } from '../../internal/stores/active-space-store.js';
10
- import { newPastedContentId, splitPastedContent, trimPastedText } from '../../_vendor/kortix-shared.js';
10
+ import { agentDisplayName, newPastedContentId, splitPastedContent, trimPastedText } from '../../_vendor/kortix-shared.js';
11
11
  import { memo, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
12
12
  import { extractClipboardFiles } from './clipboard-files.js';
13
13
  import { mergeFailedSubmissionFiles } from './composer-draft-recovery.js';
@@ -25,7 +25,7 @@ import { ComposerCard } from './ComposerCard.js';
25
25
  import { handleBillingError } from '../../internal/lib/error-handler.js';
26
26
  import { attachedFileUploadId, attachmentsBlockSend, captureAttachmentSubmission, dispatchLatched, planAttachmentReplacement, refusedFilesToast, runComposerSend, heldTraySizes, splitComposerFiles, stageComposerFiles, takeNewBillingRefusals, } from './attachment-submission.js';
27
27
  import { draftWillRunCommand, planCommandAttachments, planUnresolvedCommandChip, readCommandChipLabel, } from './command-attachments.js';
28
- import { appendComposerQuote, classifyPaste, isUndoKey, popPasteUndo, extractReplyQuotes, nextPastedTextFileName, planDraftSubmission, planFailedSendRecovery, planPrefillMerge, planQuoteRequests, removeComposerQuote, resolveEditorPlaceholder, restoreComposerQuotes, shouldApplyPrefill, shouldSubmitPrefill, shouldSubmitWhenReady, textToDocument, } from './composer-logic.js';
28
+ import { appendComposerQuote, classifyPaste, isUndoKey, popPasteUndo, extractReplyQuotes, nextPastedTextFileName, planDraftSubmission, planFailedSendRecovery, planPrefillMerge, appendTextToDocument, planQuoteRequests, removeComposerQuote, resolveEditorPlaceholder, restoreComposerQuotes, shouldApplyPrefill, shouldSubmitPrefill, shouldSubmitWhenReady, textToDocument, } from './composer-logic.js';
29
29
  import { getContextUsage } from './context-ring.js';
30
30
  import { useComposerFocus } from './hooks/use-composer-focus.js';
31
31
  import { useMenuRevalidation } from './hooks/use-file-search.js';
@@ -64,8 +64,8 @@ import { createSubmitLatch } from './submit-latch.js';
64
64
  *
65
65
  * The gutter is equal on both sides. It used to carry `md:pr-1`, a right-side
66
66
  * trim against the collapsed action-panel chevron rail, which then took ~37px
67
- * of the row's width. That rail now takes no width (`COLLAPSED_RAIL_OFFSET` in
68
- * `session-action-panel-column.tsx`), so the trim only shifted the card 5.5px
67
+ * of the row's width. Collapsed, the column now takes no width at all
68
+ * (`session-action-panel-column.tsx`), so the trim only shifted the card 5.5px
69
69
  * right of center. A breakpoint may never ZERO this gutter — zero is what let
70
70
  * the card touch the panel divider, and `composer-underbar.test.tsx` guards
71
71
  * exactly that line.
@@ -199,7 +199,7 @@ function ComposerImpl(props) {
199
199
  const [menuOpen, setMenuOpen] = useState(false);
200
200
  useMenuRevalidation(menuOpen, projectId);
201
201
  const fileInputRef = useRef(null);
202
- const { takeFiles, modelPickerEnabled, contextMeterEnabled, runtimeSlashEnabled, useSlashActions } = useUiHostConfig();
202
+ const { takeFiles, modelPickerEnabled, contextMeterEnabled, runtimeSlashEnabled, useSlashActions, agentLabels } = useUiHostConfig();
203
203
  // The host's own `/` rows. The config is fixed for the app's life, so the hook is the same one every render.
204
204
  const hostSlashRows = (useSlashActions ?? useNoSlashActions)();
205
205
  // A host that hides the harness lists none of its commands, and a typed "/init" stays text.
@@ -310,7 +310,7 @@ function ComposerImpl(props) {
310
310
  quotes: quoteTexts,
311
311
  pastes,
312
312
  uploads: draftUploads,
313
- hasPrefill: !!prefill,
313
+ hasPrefill: !!prefill && !prefill.restoreDraft,
314
314
  onRestore: handleDraftRestore,
315
315
  });
316
316
  /**
@@ -743,11 +743,14 @@ function ComposerImpl(props) {
743
743
  const prefillText = prefill?.text ?? '';
744
744
  const prefillFiles = prefill?.files;
745
745
  const prefillMode = prefill?.mode;
746
+ const prefillRestoreDraft = prefill?.restoreDraft === true;
746
747
  const prefillSubmit = prefill?.submit === true;
747
748
  // `handleSubmit` is declared further down; the prefill effect reaches it
748
749
  // through this ref, bound in an effect right after that declaration.
749
750
  const handleSubmitRef = useRef(() => undefined);
750
751
  const submittedPrefillIdRef = useRef(null);
752
+ // An append is not idempotent: each `restoreDraft` prefill lands once.
753
+ const appendedPrefillIdRef = useRef(null);
751
754
  // The prefill id that landed in the editor: `'when-ready'` submits only after it.
752
755
  const [landedPrefillId, setLandedPrefillId] = useState(null);
753
756
  const onPrefillAppliedRef = useRef(onPrefillApplied);
@@ -774,7 +777,17 @@ function ComposerImpl(props) {
774
777
  const quoted = extractReplyQuotes(prefillText);
775
778
  const pasted = splitPastedContent(quoted.text);
776
779
  const incoming = { quotes: quoted.quotes, text: pasted.text };
777
- if (prefillMode === 'merge') {
780
+ if (prefillRestoreDraft) {
781
+ // Keys typed while the page loaded continue the restored draft, at its
782
+ // end, where the caret lands (`setDocument` focuses the end). The draft
783
+ // is already in the editor: `useComposerDraft`'s restore effect is
784
+ // declared above this one, so it runs first in the same commit.
785
+ if (incoming.text && appendedPrefillIdRef.current !== prefillId) {
786
+ appendedPrefillIdRef.current = prefillId;
787
+ editorRef.current?.setDocument(appendTextToDocument(editorRef.current?.getDocument() ?? EMPTY_DOCUMENT, incoming.text));
788
+ }
789
+ }
790
+ else if (prefillMode === 'merge') {
778
791
  const merged = planPrefillMerge({
779
792
  prefillDoc: textToDocument(incoming.text),
780
793
  prefillIsEmpty: incoming.text.length === 0,
@@ -850,6 +863,7 @@ function ComposerImpl(props) {
850
863
  prefillText,
851
864
  prefillFiles,
852
865
  prefillMode,
866
+ prefillRestoreDraft,
853
867
  prefillSubmit,
854
868
  editorElement,
855
869
  addPromptAttachments,
@@ -966,7 +980,8 @@ function ComposerImpl(props) {
966
980
  });
967
981
  return available.map((action) => {
968
982
  if (action.id === 'switch-agent' && selectedAgent) {
969
- return { ...action, value: selectedAgent };
983
+ // The name the agent chip shows, not the slug.
984
+ return { ...action, value: agentLabels?.[selectedAgent] ?? agentDisplayName(selectedAgent, agents.find((a) => a.name === selectedAgent)?.title) };
970
985
  }
971
986
  // The ring icon (via `context`) plus the reading as the row's
972
987
  // "current setting" text — same grammar as the agent row's value.
@@ -976,7 +991,7 @@ function ComposerImpl(props) {
976
991
  return action;
977
992
  }).concat(hostSlashActions(hostSlashRows));
978
993
  }, [
979
- selectedAgent, canSwitchAgent, onCompactClick, onContextClick, contextUsage, tI18nComplete,
994
+ selectedAgent, agents, agentLabels, canSwitchAgent, onCompactClick, onContextClick, contextUsage, tI18nComplete,
980
995
  modelPickerEnabled, contextMeterEnabled, runtimeSlashEnabled, hostSlashRows,
981
996
  ]);
982
997
  const handleSelectAction = useCallback((action) => {
@@ -354,6 +354,9 @@ export const ComposerEditor = forwardRef(function ComposerEditor({ placeholder,
354
354
  role: 'textbox',
355
355
  'aria-multiline': 'true',
356
356
  'aria-label': t('messageInput'),
357
+ // A locale-free hook for code outside the composer that must know
358
+ // the editor exists (`use-home-typing-buffer.ts` in apps/web).
359
+ 'data-composer-editor': '',
357
360
  /**
358
361
  * `min-h-[3.5em]` — taller than one line by design. History: was
359
362
  * `1.5em` (exactly one line) on the reasoning that a taller floor
@@ -400,10 +403,9 @@ export const ComposerEditor = forwardRef(function ComposerEditor({ placeholder,
400
403
  * dev.kortix.com: clear at T, phantom write at T+406ms, and the next
401
404
  * visit to project home restored "Hi" into the composer.
402
405
  *
403
- * That composer clears now (`clearOnSend="text-only"`), so its phantom
404
- * write would carry an empty document. The guard stays: it is about
405
- * `setEditable`, and every composer that flips `disabled` mid-send is one
406
- * debounce away from the same bug.
406
+ * Project home keeps the sent text in the locked box again, so this
407
+ * guard is what keeps the message out of the saved draft. Every composer
408
+ * that flips `disabled` mid-send is one debounce away from the same bug.
407
409
  *
408
410
  * The view still refreshes — `setOptions` calls `view.updateState`
409
411
  * whether or not the event is emitted.
@@ -13,7 +13,17 @@ import type { QueryKey } from '@tanstack/react-query';
13
13
  * across a session switch must stop reusing its pre-switch entry the moment
14
14
  * the active sandbox changes — `server` is what makes both true.
15
15
  */
16
- export declare const composerFileSearchKey: (server: string, query: string) => readonly ["web", "composer", "file-search", string, string];
16
+ export declare const composerFileSearchKey: (server: string, query: string, workspaceId?: string | null) => readonly ["web", "composer", "file-search", string, string, string | null];
17
+ /**
18
+ * The `@` menu's file rows: the session computer's files first, then the
19
+ * workspace repo's files that the computer does not hold, each path once.
20
+ *
21
+ * The computer's `/workspace` holds no repo unless an agent declares
22
+ * `workspace.repos`, and workspace home has no computer at all. Without the
23
+ * repo rows the menu offered no file there although the placeholder says
24
+ * "Type @ to mention files and agents".
25
+ */
26
+ export declare function mergeFileResults(runtime: readonly string[], repo: readonly string[]): string[];
17
27
  /**
18
28
  * Whether a previous query's results may still be shown as placeholder data.
19
29
  *
@@ -28,7 +38,7 @@ export declare const composerFileSearchKey: (server: string, query: string) => r
28
38
  * never-flash-empty behaviour while a query is merely being retyped, and drops
29
39
  * it exactly when the workspace underneath changed.
30
40
  */
31
- export declare function canKeepPlaceholderFiles(server: string, previousQueryKey: readonly unknown[] | undefined): boolean;
41
+ export declare function canKeepPlaceholderFiles(server: string, previousQueryKey: readonly unknown[] | undefined, workspaceId?: string | null): boolean;
32
42
  /**
33
43
  * File results for the `@` menu.
34
44
  *
@@ -1,7 +1,8 @@
1
1
  'use client';
2
- import { useEffect, useRef } from 'react';
2
+ import { useEffect, useMemo, useRef } from 'react';
3
3
  import { searchWorkspaceFiles } from '../../../files/runtime/index.js';
4
- import { qk, runtimeKeys, useActiveSandboxProxyContext } from '@kortix/sdk/react';
4
+ import { searchWorkspaceFiles as searchWorkspaceRepoFiles } from '@kortix/sdk';
5
+ import { qk, runtimeKeys, useActiveSandboxProxyContext, useKortixRouteWorkspaceId } from '@kortix/sdk/react';
5
6
  import { useQuery, useQueryClient } from '@tanstack/react-query';
6
7
  import { useDebouncedValue } from './use-debounced-value.js';
7
8
  /** Stands in for `serverUrl` before a runtime binds, or on self-hosted local
@@ -24,11 +25,56 @@ const UNBOUND_SERVER = 'unbound';
24
25
  * across a session switch must stop reusing its pre-switch entry the moment
25
26
  * the active sandbox changes — `server` is what makes both true.
26
27
  */
27
- export const composerFileSearchKey = (server, query) => ['web', 'composer', 'file-search', server, query];
28
+ export const composerFileSearchKey = (server, query, workspaceId = null) => ['web', 'composer', 'file-search', server, query, workspaceId];
29
+ /** The `server` slot of the repo query's key: the repo is not on a computer. */
30
+ const REPO_SOURCE = 'workspace-repo';
31
+ /** Repo rows the `@` menu asks for. The menu shows 20 file rows at most. */
32
+ const REPO_SEARCH_LIMIT = 20;
33
+ /**
34
+ * The `@` menu's file rows: the session computer's files first, then the
35
+ * workspace repo's files that the computer does not hold, each path once.
36
+ *
37
+ * The computer's `/workspace` holds no repo unless an agent declares
38
+ * `workspace.repos`, and workspace home has no computer at all. Without the
39
+ * repo rows the menu offered no file there although the placeholder says
40
+ * "Type @ to mention files and agents".
41
+ */
42
+ export function mergeFileResults(runtime, repo) {
43
+ const seen = new Set();
44
+ const merged = [];
45
+ for (const path of [...runtime, ...repo]) {
46
+ const key = path.replace(/^\/workspace\//, '').replace(/^\.\//, '');
47
+ if (!key || seen.has(key))
48
+ continue;
49
+ seen.add(key);
50
+ merged.push(path);
51
+ }
52
+ return merged;
53
+ }
54
+ // replica-local: workspaces whose repo search answered 403 in this tab. A
55
+ // member without file read stops asking on every keystroke.
56
+ const repoSearchDenied = new Set();
57
+ async function searchRepoFiles(workspaceId, query) {
58
+ const q = query.trim();
59
+ if (!workspaceId || !q || repoSearchDenied.has(workspaceId))
60
+ return [];
61
+ // Silent: a member without file read gets a 403 here, and the runtime rows still list.
62
+ try {
63
+ const { results } = await searchWorkspaceRepoFiles(workspaceId, q, { limit: REPO_SEARCH_LIMIT, showErrors: false });
64
+ return results.map((match) => match.path);
65
+ }
66
+ catch (error) {
67
+ if (error?.status === 403)
68
+ repoSearchDenied.add(workspaceId);
69
+ throw error;
70
+ }
71
+ }
28
72
  /** Index of `server` inside `composerFileSearchKey`'s tuple. Named rather than
29
73
  * inlined so the coupling between the key shape and the placeholder guard
30
74
  * below is a single, testable fact instead of a magic `3`. */
31
75
  const SERVER_KEY_INDEX = 3;
76
+ /** Index of the workspace id inside `composerFileSearchKey`'s tuple. */
77
+ const WORKSPACE_KEY_INDEX = 5;
32
78
  /**
33
79
  * Whether a previous query's results may still be shown as placeholder data.
34
80
  *
@@ -43,8 +89,10 @@ const SERVER_KEY_INDEX = 3;
43
89
  * never-flash-empty behaviour while a query is merely being retyped, and drops
44
90
  * it exactly when the workspace underneath changed.
45
91
  */
46
- export function canKeepPlaceholderFiles(server, previousQueryKey) {
47
- return previousQueryKey?.[SERVER_KEY_INDEX] === server;
92
+ export function canKeepPlaceholderFiles(server, previousQueryKey, workspaceId = null) {
93
+ // The repo rows belong to one workspace: a switch to another workspace on
94
+ // the same server (or on no server, `unbound`) drops them too.
95
+ return previousQueryKey?.[SERVER_KEY_INDEX] === server && (previousQueryKey?.[WORKSPACE_KEY_INDEX] ?? null) === workspaceId;
48
96
  }
49
97
  /**
50
98
  * File results for the `@` menu.
@@ -71,7 +119,11 @@ export function useFileSearch(query, enabled) {
71
119
  // actually calls never drift apart.
72
120
  const { serverUrl } = useActiveSandboxProxyContext();
73
121
  const server = serverUrl || UNBOUND_SERVER;
74
- const { data, isFetching } = useQuery({
122
+ // The workspace on screen: its repo is the second source of file rows.
123
+ const workspaceId = useKortixRouteWorkspaceId();
124
+ // Two queries, merged at render: the computer's rows show as soon as they
125
+ // arrive and never wait on the git-backed repo search.
126
+ const runtime = useQuery({
75
127
  queryKey: composerFileSearchKey(server, debounced),
76
128
  queryFn: () => searchWorkspaceFiles(debounced),
77
129
  enabled,
@@ -91,7 +143,19 @@ export function useFileSearch(query, enabled) {
91
143
  placeholderData: (previous, previousQuery) => canKeepPlaceholderFiles(server, previousQuery?.queryKey) ? previous : undefined,
92
144
  retry: false,
93
145
  });
94
- return { files: data ?? [], isLoading: isFetching && !data };
146
+ const repo = useQuery({
147
+ queryKey: composerFileSearchKey(REPO_SOURCE, debounced, workspaceId),
148
+ queryFn: () => searchRepoFiles(workspaceId, debounced),
149
+ enabled: enabled && Boolean(workspaceId) && debounced.trim().length > 0,
150
+ staleTime: 30_000,
151
+ gcTime: 5 * 60_000,
152
+ // The same guard, scoped to the workspace: its repo rows never outlive a switch.
153
+ placeholderData: (previous, previousQuery) => canKeepPlaceholderFiles(REPO_SOURCE, previousQuery?.queryKey, workspaceId) ? previous : undefined,
154
+ retry: false,
155
+ });
156
+ const files = useMemo(() => mergeFileResults(runtime.data ?? [], repo.data ?? []), [runtime.data, repo.data]);
157
+ const isLoading = (runtime.isFetching && !runtime.data) || (repo.isFetching && !repo.data);
158
+ return { files, isLoading };
95
159
  }
96
160
  /**
97
161
  * The pure decision at the heart of `useMenuRevalidation`, below: given the
@@ -1,3 +1,4 @@
1
+ import { agentDisplayName } from '../../../_vendor/kortix-shared.js';
1
2
  import { translateUiCatalogText } from '../../../i18n/ui-catalog/localize-ui-catalog.js';
2
3
  import { REMAINING_UI_TRANSLATION_KEYS } from '../../../i18n/ui-catalog/remaining-ui-translation-keys.generated.js';
3
4
  export function formatRelativeTime(timestamp, now) {
@@ -53,9 +54,12 @@ export function buildMentionSections({ agents, sessions, files, query, currentSe
53
54
  // something to fold into this refactor — see the pinning test below.
54
55
  const agentRows = [];
55
56
  for (const a of agents) {
56
- if (!(a.name || '').toLowerCase().includes(q))
57
+ const name = a.name || '';
58
+ // The row reads the name every other surface shows; the slug stays the value.
59
+ const label = name ? agentDisplayName(name, a.title) : '';
60
+ if (!name.toLowerCase().includes(q) && !label.toLowerCase().includes(q))
57
61
  continue;
58
- agentRows.push({ index: index++, kind: 'agent', label: a.name || '', value: a.name || '' });
62
+ agentRows.push({ index: index++, kind: 'agent', label, value: name });
59
63
  }
60
64
  if (agentRows.length)
61
65
  sections.push({ kind: 'agent', heading: heading('Agents'), items: agentRows });
@@ -13,9 +13,11 @@
13
13
  * look like it was doing something while changing nothing. The z-index belongs
14
14
  * on the mounted element itself and is set in `mount.ts`.
15
15
  */
16
- export declare function MenuCard({ className, children, }: {
16
+ export declare function MenuCard({ className, children, cardRef, style, }: {
17
17
  className?: string;
18
18
  children: React.ReactNode;
19
+ cardRef?: React.Ref<HTMLDivElement>;
20
+ style?: React.CSSProperties;
19
21
  }): import("react").JSX.Element;
20
22
  /** Section label above a group of rows ("Skills", "Agents", "Connectors"). */
21
23
  export declare function MenuSectionHeading({ children }: {
@@ -17,8 +17,8 @@ import { useEffect, useRef } from 'react';
17
17
  * look like it was doing something while changing nothing. The z-index belongs
18
18
  * on the mounted element itself and is set in `mount.ts`.
19
19
  */
20
- export function MenuCard({ className, children, }) {
21
- return (_jsx("div", { className: cn('bg-popover text-popover-foreground overflow-hidden rounded-md border shadow-md', className), children: children }));
20
+ export function MenuCard({ className, children, cardRef, style, }) {
21
+ return (_jsx("div", { ref: cardRef, style: style, className: cn('bg-popover text-popover-foreground overflow-hidden rounded-md border shadow-md', className), children: children }));
22
22
  }
23
23
  /** Section label above a group of rows ("Skills", "Agents", "Connectors"). */
24
24
  export function MenuSectionHeading({ children }) {
@@ -1,4 +1,11 @@
1
1
  import type { SlashRow, SlashSection } from './slash-items.js';
2
+ /**
3
+ * The height left between the card's top edge and the viewport bottom, so a
4
+ * menu docked BELOW the composer (workspace home) never runs past the window.
5
+ * At 1440×900 the home menu ended at y 906. A menu docked above the composer
6
+ * always has the composer below it, so the cap never bites there.
7
+ */
8
+ export declare function fitHeightBelow(top: number, viewportHeight: number): number;
2
9
  /**
3
10
  * The `/` palette.
4
11
  *
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useLayoutEffect, useRef, useState } from 'react';
3
4
  import { Kbd } from '../../../primitives/kbd.js';
4
5
  import { getFileIcon } from '../../../files/project/components/file-icon.js';
5
6
  import { cn } from '../../../lib/utils.js';
@@ -67,6 +68,50 @@ function SlashRowIcon({ row, heading, className, }) {
67
68
  return _jsx(PlugsConnectedIcon, { className: className });
68
69
  return _jsx(TerminalWindowIcon, { className: className });
69
70
  }
71
+ /** Space kept between the menu's bottom edge and the viewport's bottom edge. */
72
+ const VIEWPORT_GAP_PX = 8;
73
+ /** The menu never shrinks below this: a few rows stay usable on a short window. */
74
+ const MIN_FIT_PX = 120;
75
+ /**
76
+ * The height left between the card's top edge and the viewport bottom, so a
77
+ * menu docked BELOW the composer (workspace home) never runs past the window.
78
+ * At 1440×900 the home menu ended at y 906. A menu docked above the composer
79
+ * always has the composer below it, so the cap never bites there.
80
+ */
81
+ export function fitHeightBelow(top, viewportHeight) {
82
+ return Math.max(MIN_FIT_PX, Math.floor(viewportHeight - top - VIEWPORT_GAP_PX));
83
+ }
84
+ function useViewportFitHeight(mounted) {
85
+ const cardRef = useRef(null);
86
+ const [maxHeight, setMaxHeight] = useState(null);
87
+ useLayoutEffect(() => {
88
+ const measure = () => {
89
+ const el = cardRef.current;
90
+ if (!el || !el.isConnected)
91
+ return;
92
+ const next = fitHeightBelow(el.getBoundingClientRect().top, window.innerHeight);
93
+ setMaxHeight((prev) => (prev === next ? prev : next));
94
+ };
95
+ measure();
96
+ // The suggestion plugin renders this card BEFORE it appends it to the dock
97
+ // (`mountDockedMenu`), so the first measure sees a detached node at top 0.
98
+ // The observer fires once the card has layout in the dock; the frame is
99
+ // the fallback where ResizeObserver does not exist.
100
+ const frame = window.requestAnimationFrame(measure);
101
+ const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(measure);
102
+ if (cardRef.current)
103
+ observer?.observe(cardRef.current);
104
+ window.addEventListener('resize', measure);
105
+ window.addEventListener('scroll', measure, { capture: true, passive: true });
106
+ return () => {
107
+ window.cancelAnimationFrame(frame);
108
+ observer?.disconnect();
109
+ window.removeEventListener('resize', measure);
110
+ window.removeEventListener('scroll', measure, { capture: true });
111
+ };
112
+ }, [mounted]);
113
+ return { cardRef, maxHeight };
114
+ }
70
115
  /**
71
116
  * The `/` palette.
72
117
  *
@@ -106,6 +151,8 @@ function SlashRowIcon({ row, heading, className, }) {
106
151
  */
107
152
  export function SlashMenu({ sections, selectedIndex, onSelect, onHover, }) {
108
153
  const t = useTranslations('sessionUi.composerMenus');
154
+ // The list card mounts only when a section exists: measure again when it does.
155
+ const { cardRef, maxHeight } = useViewportFitHeight(sections.length > 0);
109
156
  // A query that matches nothing keeps the card, with one dead row saying so.
110
157
  // Returning `null` made the palette DISAPPEAR mid-word — the user could not
111
158
  // tell "no match" from "the menu closed", and one backspace brought it back
@@ -123,7 +170,7 @@ export function SlashMenu({ sections, selectedIndex, onSelect, onHover, }) {
123
170
  const activeUsage = active && active.row.type === 'action' && active.row.action?.id === 'show-context'
124
171
  ? active.row.action.context
125
172
  : undefined;
126
- return (_jsxs(MenuCard, { className: cn('mb-2.5 flex max-h-96 w-full overflow-hidden rounded-lg shadow-xs'), children: [_jsx("div", { role: "listbox", "aria-label": t('commandsAndActions'), "aria-activedescendant": `slash-row-${selectedIndex}`,
173
+ return (_jsxs(MenuCard, { cardRef: cardRef, style: maxHeight === null ? undefined : { maxHeight: `min(calc(var(--spacing) * 96), ${maxHeight}px)` }, className: cn('mb-2.5 flex max-h-96 w-full overflow-hidden rounded-lg shadow-xs'), children: [_jsx("div", { role: "listbox", "aria-label": t('commandsAndActions'), "aria-activedescendant": `slash-row-${selectedIndex}`,
127
174
  // `-1`, matching `mention-menu.tsx`: focusable for AT, but never a tab
128
175
  // stop. Keyboard interaction stays in the composer editor, which
129
176
  // proxies arrow/Enter to this listbox — a real tab stop here trapped
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
- import { errorToast } from '../../primitives/toast.js';
3
+ import { onlineManager } from '@tanstack/react-query';
4
+ import { errorToast, infoToast } from '../../primitives/toast.js';
4
5
  import { isFirstPromptRow } from './queue-projection.js';
5
6
  import { promptFileParts, sentAttachmentsOf } from './uploaded-file-refs.js';
6
7
  import { firstPromptAttachments, } from './sent-attachment-previews.js';
@@ -321,6 +322,7 @@ export function useInstantSessionSend(props) {
321
322
  const { projectId, sessionId, hydrated, onSubmit, promptInbox } = props;
322
323
  const tI18nHardcoded = useTranslations('hardcodedUi');
323
324
  const tComposerAttachments = useTranslations('hardcodedUi.composerAttachments');
325
+ const tThreads = useTranslations('threads');
324
326
  const { submission, setSubmission, extraSends, setExtraSends, firstSendInFlight, mountedRef } = useSendMemory();
325
327
  const { submitted, effectiveSubmission } = useFirstPromptSources({
326
328
  sessionId,
@@ -351,6 +353,9 @@ export function useInstantSessionSend(props) {
351
353
  firstSendInFlight,
352
354
  mountedRef,
353
355
  };
356
+ // A new session's first prompt has no row on screen to say it waits: say it once.
357
+ if (send.first && !onlineManager.isOnline())
358
+ infoToast(tThreads('notSentYet'));
354
359
  paintSend(send, env);
355
360
  const post = buildPost(send, env);
356
361
  const { detached } = send;
@@ -369,6 +374,7 @@ export function useInstantSessionSend(props) {
369
374
  projectId,
370
375
  tI18nHardcoded,
371
376
  tComposerAttachments,
377
+ tThreads,
372
378
  onSubmit,
373
379
  promptInbox.enqueue,
374
380
  setSubmission,