@kortix/ui 0.14.3 → 0.14.5

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 (3134) hide show
  1. package/README.md +245 -49
  2. package/dist/_vendor/kortix-shared.js +10551 -54
  3. package/dist/_vendor/shared/channel-header.d.ts +12 -0
  4. package/dist/_vendor/shared/channel-message.d.ts +38 -0
  5. package/dist/_vendor/shared/chat-mention.d.ts +6 -0
  6. package/dist/_vendor/shared/code-language.d.ts +25 -0
  7. package/dist/_vendor/shared/connector-sections.d.ts +180 -0
  8. package/dist/_vendor/shared/constants/auto-topup.d.ts +13 -0
  9. package/dist/_vendor/shared/constants/upload-limits.d.ts +23 -0
  10. package/dist/_vendor/shared/file-tags.d.ts +28 -0
  11. package/dist/_vendor/shared/index.d.ts +28 -0
  12. package/dist/_vendor/shared/markdown-math.d.ts +46 -0
  13. package/dist/_vendor/shared/meta-agent.d.ts +7 -0
  14. package/dist/_vendor/shared/pasted-content.d.ts +38 -0
  15. package/dist/_vendor/shared/project-glyphs.d.ts +93 -0
  16. package/dist/_vendor/shared/prompt-attachments.d.ts +20 -0
  17. package/dist/_vendor/shared/reminder-prompt.d.ts +21 -0
  18. package/dist/_vendor/shared/room-prompt.d.ts +66 -0
  19. package/dist/_vendor/shared/runtime-versions.d.ts +57 -0
  20. package/dist/_vendor/shared/session-attachments.d.ts +8 -0
  21. package/dist/_vendor/shared/slack-text.d.ts +21 -0
  22. package/dist/_vendor/shared/tag-blocks.d.ts +118 -0
  23. package/dist/_vendor/shared/tool-output/background-workers.d.ts +11 -0
  24. package/dist/_vendor/shared/tool-output/diagnostics.d.ts +25 -0
  25. package/dist/_vendor/shared/tool-output/index.d.ts +25 -0
  26. package/dist/_vendor/shared/tool-output/markdown-detect.d.ts +18 -0
  27. package/dist/_vendor/shared/tool-output/media-path.d.ts +15 -0
  28. package/dist/_vendor/shared/tool-output/memory-entry.d.ts +55 -0
  29. package/dist/_vendor/shared/tool-output/memory-search.d.ts +41 -0
  30. package/dist/_vendor/shared/tool-output/projects.d.ts +81 -0
  31. package/dist/_vendor/shared/tool-output/scan.d.ts +39 -0
  32. package/dist/_vendor/shared/tool-output/session-dump.d.ts +62 -0
  33. package/dist/_vendor/shared/tool-output/session-get.d.ts +47 -0
  34. package/dist/_vendor/shared/tool-output/session-search.d.ts +15 -0
  35. package/dist/_vendor/shared/tool-output/skill.d.ts +6 -0
  36. package/dist/_vendor/shared/tool-output/tags.d.ts +19 -0
  37. package/dist/_vendor/shared/tool-output/triggers.d.ts +22 -0
  38. package/dist/_vendor/shared/tools/html-text.d.ts +12 -0
  39. package/dist/_vendor/shared/tools/index.d.ts +6 -0
  40. package/dist/_vendor/shared/tools/safe-url.d.ts +9 -0
  41. package/dist/_vendor/shared/tools/tool-registry-lookup.d.ts +2 -0
  42. package/dist/_vendor/shared/trigger-event.d.ts +21 -0
  43. package/dist/_vendor/shared/utils/ambiguous-write.d.ts +32 -0
  44. package/dist/_vendor/shared/utils/chalk-colors.d.ts +15 -0
  45. package/dist/_vendor/shared/utils/configure-prompts.d.ts +11 -0
  46. package/dist/_vendor/shared/utils/credit-formatter.d.ts +53 -0
  47. package/dist/_vendor/shared/utils/format-relative.d.ts +27 -0
  48. package/dist/_vendor/shared/utils/index.d.ts +12 -0
  49. package/dist/_vendor/shared/utils/json.d.ts +24 -0
  50. package/dist/_vendor/shared/utils/string.d.ts +18 -0
  51. package/dist/_vendor/shared/utils/unicode.d.ts +41 -0
  52. package/dist/_vendor/shared/utils/url-autolink.d.ts +48 -0
  53. package/dist/_vendor/shared/webhook-signing.d.ts +14 -0
  54. package/dist/access/access/access-detail-shell.d.ts +34 -0
  55. package/dist/access/access/access-detail-shell.js +22 -0
  56. package/dist/access/access/access-dialog-share.d.ts +54 -0
  57. package/dist/access/access/access-dialog-share.js +206 -0
  58. package/dist/access/access/access-dialog.d.ts +207 -0
  59. package/dist/access/access/access-dialog.js +982 -0
  60. package/dist/access/access/access-row.d.ts +106 -0
  61. package/dist/access/access/access-row.js +79 -0
  62. package/dist/access/access/access-shared.d.ts +86 -0
  63. package/dist/access/access/access-shared.js +143 -0
  64. package/dist/access/access/account-role-editor.d.ts +52 -0
  65. package/dist/access/access/account-role-editor.js +63 -0
  66. package/dist/access/access/agent-principals.d.ts +97 -0
  67. package/dist/access/access/agent-principals.js +210 -0
  68. package/dist/access/access/copy-row.d.ts +19 -0
  69. package/dist/access/access/copy-row.js +41 -0
  70. package/dist/access/access/index.d.ts +9 -0
  71. package/dist/access/access/index.js +16 -0
  72. package/dist/access/access/principal-picker.d.ts +90 -0
  73. package/dist/access/access/principal-picker.js +271 -0
  74. package/dist/access/access/project-select.d.ts +41 -0
  75. package/dist/access/access/project-select.js +59 -0
  76. package/dist/access/access/role-select.d.ts +108 -0
  77. package/dist/access/access/role-select.js +199 -0
  78. package/dist/access/iam/add-github-account-dialog.d.ts +33 -0
  79. package/dist/access/iam/add-github-account-dialog.js +51 -0
  80. package/dist/access/iam/api-key-expiry.d.ts +53 -0
  81. package/dist/access/iam/api-key-expiry.js +68 -0
  82. package/dist/access/iam/api-key-rows.d.ts +161 -0
  83. package/dist/access/iam/api-key-rows.js +178 -0
  84. package/dist/access/iam/managed-git-notice.d.ts +2 -0
  85. package/dist/access/iam/managed-git-notice.js +44 -0
  86. package/dist/access/iam/session-oversight-card.d.ts +4 -0
  87. package/dist/access/iam/session-oversight-card.js +52 -0
  88. package/dist/access/index.d.ts +7 -0
  89. package/dist/access/index.js +7 -0
  90. package/dist/access/sandbox-template-menu.d.ts +41 -0
  91. package/dist/access/sandbox-template-menu.js +69 -0
  92. package/dist/access/sharing-intent.d.ts +31 -0
  93. package/dist/access/sharing-intent.js +28 -0
  94. package/dist/access/sharing-picker.d.ts +55 -0
  95. package/dist/access/sharing-picker.js +61 -0
  96. package/dist/animated-copy-icon.d.ts +5 -0
  97. package/dist/animated-copy-icon.js +6 -0
  98. package/dist/apps/app-preview-pool.d.ts +31 -0
  99. package/dist/apps/app-preview-pool.js +157 -0
  100. package/dist/apps/app-preview.d.ts +128 -0
  101. package/dist/apps/app-preview.js +258 -0
  102. package/dist/apps/app-shared.d.ts +154 -0
  103. package/dist/apps/app-shared.js +213 -0
  104. package/dist/apps/index.d.ts +7 -0
  105. package/dist/apps/index.js +7 -0
  106. package/dist/apps/kortix-app-url.d.ts +7 -0
  107. package/dist/apps/kortix-app-url.js +20 -0
  108. package/dist/browser/app-in-browser.d.ts +20 -0
  109. package/dist/browser/app-in-browser.js +79 -0
  110. package/dist/browser/browser-landing.d.ts +32 -0
  111. package/dist/browser/browser-landing.js +103 -0
  112. package/dist/browser/browser-panel.d.ts +15 -0
  113. package/dist/browser/browser-panel.js +317 -0
  114. package/dist/browser/index.d.ts +5 -0
  115. package/dist/browser/index.js +5 -0
  116. package/dist/browser/sandbox-browser-chrome.d.ts +69 -0
  117. package/dist/browser/sandbox-browser-chrome.js +149 -0
  118. package/dist/changes/change-list.d.ts +50 -0
  119. package/dist/changes/change-list.js +129 -0
  120. package/dist/changes/change-vocabulary.d.ts +154 -0
  121. package/dist/changes/change-vocabulary.js +289 -0
  122. package/dist/changes/index.d.ts +2 -0
  123. package/dist/changes/index.js +2 -0
  124. package/dist/customize/agents/agent-apps-grant.d.ts +19 -0
  125. package/dist/customize/agents/agent-apps-grant.js +23 -0
  126. package/dist/customize/agents/agent-authority-card.d.ts +8 -0
  127. package/dist/customize/agents/agent-authority-card.js +46 -0
  128. package/dist/customize/agents/agent-detail-aside.d.ts +81 -0
  129. package/dist/customize/agents/agent-detail-aside.js +249 -0
  130. package/dist/customize/agents/agent-drives-section.d.ts +11 -0
  131. package/dist/customize/agents/agent-drives-section.js +67 -0
  132. package/dist/customize/agents/agent-filter.d.ts +27 -0
  133. package/dist/customize/agents/agent-filter.js +32 -0
  134. package/dist/customize/agents/agent-grant-pages.d.ts +33 -0
  135. package/dist/customize/agents/agent-grant-pages.js +203 -0
  136. package/dist/customize/agents/agent-page.d.ts +4 -0
  137. package/dist/customize/agents/agent-page.js +453 -0
  138. package/dist/customize/agents/agent-people-section.d.ts +8 -0
  139. package/dist/customize/agents/agent-people-section.js +152 -0
  140. package/dist/customize/agents/agent-share-control.d.ts +6 -0
  141. package/dist/customize/agents/agent-share-control.js +63 -0
  142. package/dist/customize/agents/agent-status.d.ts +7 -0
  143. package/dist/customize/agents/agent-status.js +9 -0
  144. package/dist/customize/agents/agent-triggers-section.d.ts +17 -0
  145. package/dist/customize/agents/agent-triggers-section.js +107 -0
  146. package/dist/customize/agents/agents-page.d.ts +24 -0
  147. package/dist/customize/agents/agents-page.js +214 -0
  148. package/dist/customize/agents/use-agent-grants.d.ts +1 -0
  149. package/dist/customize/agents/use-agent-grants.js +13 -0
  150. package/dist/customize/agents/use-default-agent.d.ts +1 -0
  151. package/dist/customize/agents/use-default-agent.js +19 -0
  152. package/dist/customize/connectors/add-mcp/add-mcp-server-deps.d.ts +3 -0
  153. package/dist/customize/connectors/add-mcp/add-mcp-server-deps.js +25 -0
  154. package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.d.ts +20 -0
  155. package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.js +114 -0
  156. package/dist/customize/connectors/add-mcp/add-mcp-server.d.ts +77 -0
  157. package/dist/customize/connectors/add-mcp/add-mcp-server.js +97 -0
  158. package/dist/customize/connectors/catalog/browse-sections.d.ts +62 -0
  159. package/dist/customize/connectors/catalog/browse-sections.js +119 -0
  160. package/dist/customize/connectors/catalog/catalog-entry.d.ts +111 -0
  161. package/dist/customize/connectors/catalog/catalog-entry.js +172 -0
  162. package/dist/customize/connectors/catalog/catalog-foot.d.ts +24 -0
  163. package/dist/customize/connectors/catalog/catalog-foot.js +39 -0
  164. package/dist/customize/connectors/catalog/catalog-paging.d.ts +34 -0
  165. package/dist/customize/connectors/catalog/catalog-paging.js +33 -0
  166. package/dist/customize/connectors/catalog/connector-browse.d.ts +34 -0
  167. package/dist/customize/connectors/catalog/connector-browse.js +151 -0
  168. package/dist/customize/connectors/catalog/connector-categories.d.ts +20 -0
  169. package/dist/customize/connectors/catalog/connector-categories.js +25 -0
  170. package/dist/customize/connectors/catalog/merge-search.d.ts +10 -0
  171. package/dist/customize/connectors/catalog/merge-search.js +26 -0
  172. package/dist/customize/connectors/catalog/use-catalog-autoload.d.ts +29 -0
  173. package/dist/customize/connectors/catalog/use-catalog-autoload.js +79 -0
  174. package/dist/customize/connectors/catalog/use-catalog.d.ts +161 -0
  175. package/dist/customize/connectors/catalog/use-catalog.js +336 -0
  176. package/dist/customize/connectors/connector-filter.d.ts +80 -0
  177. package/dist/customize/connectors/connector-filter.js +79 -0
  178. package/dist/customize/connectors/connector-identity.d.ts +35 -0
  179. package/dist/customize/connectors/connector-identity.js +67 -0
  180. package/dist/customize/connectors/connector-moves-banner.d.ts +4 -0
  181. package/dist/customize/connectors/connector-moves-banner.js +25 -0
  182. package/dist/customize/connectors/connector-routes.d.ts +40 -0
  183. package/dist/customize/connectors/connector-routes.js +74 -0
  184. package/dist/customize/connectors/connectors-app-return-bar.d.ts +18 -0
  185. package/dist/customize/connectors/connectors-app-return-bar.js +56 -0
  186. package/dist/customize/connectors/connectors-page.d.ts +40 -0
  187. package/dist/customize/connectors/connectors-page.js +412 -0
  188. package/dist/customize/connectors/detail/account-info.d.ts +5 -0
  189. package/dist/customize/connectors/detail/account-info.js +24 -0
  190. package/dist/customize/connectors/detail/app-page.d.ts +4 -0
  191. package/dist/customize/connectors/detail/app-page.js +263 -0
  192. package/dist/customize/connectors/detail/connector-accounts.d.ts +51 -0
  193. package/dist/customize/connectors/detail/connector-accounts.js +42 -0
  194. package/dist/customize/connectors/detail/connector-advanced-tools.d.ts +13 -0
  195. package/dist/customize/connectors/detail/connector-advanced-tools.js +75 -0
  196. package/dist/customize/connectors/detail/connector-detail-tabs.d.ts +10 -0
  197. package/dist/customize/connectors/detail/connector-detail-tabs.js +18 -0
  198. package/dist/customize/connectors/detail/connector-header-cta.d.ts +23 -0
  199. package/dist/customize/connectors/detail/connector-header-cta.js +9 -0
  200. package/dist/customize/connectors/detail/connector-modal.d.ts +32 -0
  201. package/dist/customize/connectors/detail/connector-modal.js +117 -0
  202. package/dist/customize/connectors/detail/connector-move-row.d.ts +17 -0
  203. package/dist/customize/connectors/detail/connector-move-row.js +73 -0
  204. package/dist/customize/connectors/detail/connector-notice-view.d.ts +22 -0
  205. package/dist/customize/connectors/detail/connector-notice-view.js +22 -0
  206. package/dist/customize/connectors/detail/connector-notice.d.ts +76 -0
  207. package/dist/customize/connectors/detail/connector-notice.js +79 -0
  208. package/dist/customize/connectors/detail/connector-page-state.d.ts +57 -0
  209. package/dist/customize/connectors/detail/connector-page-state.js +51 -0
  210. package/dist/customize/connectors/detail/connector-page.d.ts +19 -0
  211. package/dist/customize/connectors/detail/connector-page.js +343 -0
  212. package/dist/customize/connectors/detail/connector-settings.d.ts +36 -0
  213. package/dist/customize/connectors/detail/connector-settings.js +81 -0
  214. package/dist/customize/connectors/detail/connector-status.d.ts +20 -0
  215. package/dist/customize/connectors/detail/connector-status.js +42 -0
  216. package/dist/customize/connectors/detail/connector-tabs.d.ts +29 -0
  217. package/dist/customize/connectors/detail/connector-tabs.js +39 -0
  218. package/dist/customize/connectors/detail/connector-tools.d.ts +37 -0
  219. package/dist/customize/connectors/detail/connector-tools.js +224 -0
  220. package/dist/customize/connectors/detail/connector-triggers.d.ts +24 -0
  221. package/dist/customize/connectors/detail/connector-triggers.js +57 -0
  222. package/dist/customize/connectors/detail/detail-page-shell.d.ts +6 -0
  223. package/dist/customize/connectors/detail/detail-page-shell.js +5 -0
  224. package/dist/customize/connectors/detail/find-easy-connect-app.d.ts +29 -0
  225. package/dist/customize/connectors/detail/find-easy-connect-app.js +22 -0
  226. package/dist/customize/connectors/detail/provider-info.d.ts +14 -0
  227. package/dist/customize/connectors/detail/provider-info.js +32 -0
  228. package/dist/customize/connectors/detail/status-badge.d.ts +5 -0
  229. package/dist/customize/connectors/detail/status-badge.js +16 -0
  230. package/dist/customize/connectors/detail/use-connector-detail.d.ts +37 -0
  231. package/dist/customize/connectors/detail/use-connector-detail.js +134 -0
  232. package/dist/customize/connectors/install/install-menu.d.ts +19 -0
  233. package/dist/customize/connectors/install/install-menu.js +14 -0
  234. package/dist/customize/connectors/install/install.d.ts +71 -0
  235. package/dist/customize/connectors/install/install.js +97 -0
  236. package/dist/customize/connectors/install/mcp-first.d.ts +15 -0
  237. package/dist/customize/connectors/install/mcp-first.js +17 -0
  238. package/dist/customize/connectors/install/pick-surface.d.ts +22 -0
  239. package/dist/customize/connectors/install/pick-surface.js +32 -0
  240. package/dist/customize/connectors/install/use-install.d.ts +28 -0
  241. package/dist/customize/connectors/install/use-install.js +126 -0
  242. package/dist/customize/connectors/invalidate-connections.d.ts +2 -0
  243. package/dist/customize/connectors/invalidate-connections.js +4 -0
  244. package/dist/customize/connectors/provider-label.d.ts +20 -0
  245. package/dist/customize/connectors/provider-label.js +41 -0
  246. package/dist/customize/connectors/tools/pattern-rule-draft.d.ts +40 -0
  247. package/dist/customize/connectors/tools/pattern-rule-draft.js +43 -0
  248. package/dist/customize/connectors/tools/tool-groups.d.ts +46 -0
  249. package/dist/customize/connectors/tools/tool-groups.js +55 -0
  250. package/dist/customize/connectors/tools/tool-policy-control.d.ts +30 -0
  251. package/dist/customize/connectors/tools/tool-policy-control.js +47 -0
  252. package/dist/customize/connectors/tools/tool-policy-labels.d.ts +30 -0
  253. package/dist/customize/connectors/tools/tool-policy-labels.js +42 -0
  254. package/dist/customize/connectors/tools/tool-policy.d.ts +83 -0
  255. package/dist/customize/connectors/tools/tool-policy.js +116 -0
  256. package/dist/customize/index.d.ts +13 -0
  257. package/dist/customize/index.js +13 -0
  258. package/dist/customize/migrate-to-v2/index.d.ts +6 -0
  259. package/dist/customize/migrate-to-v2/index.js +6 -0
  260. package/dist/customize/migrate-to-v2/migration-prompt.d.ts +28 -0
  261. package/dist/customize/migrate-to-v2/migration-prompt.js +260 -0
  262. package/dist/customize/migrate-to-v2/upgrade-defs.d.ts +30 -0
  263. package/dist/customize/migrate-to-v2/upgrade-defs.js +42 -0
  264. package/dist/customize/migrate-to-v2/upgrade-view.d.ts +32 -0
  265. package/dist/customize/migrate-to-v2/upgrade-view.js +152 -0
  266. package/dist/customize/migrate-to-v2/use-migrate-to-v2.d.ts +9 -0
  267. package/dist/customize/migrate-to-v2/use-migrate-to-v2.js +24 -0
  268. package/dist/customize/migrate-to-v2/use-run-upgrade.d.ts +18 -0
  269. package/dist/customize/migrate-to-v2/use-run-upgrade.js +16 -0
  270. package/dist/customize/models/app-return-bar.d.ts +20 -0
  271. package/dist/customize/models/app-return-bar.js +42 -0
  272. package/dist/customize/models/app-return.d.ts +8 -0
  273. package/dist/customize/models/app-return.js +11 -0
  274. package/dist/customize/models/models-page.d.ts +28 -0
  275. package/dist/customize/models/models-page.js +35 -0
  276. package/dist/customize/project-settings/project-settings-page.d.ts +106 -0
  277. package/dist/customize/project-settings/project-settings-page.js +286 -0
  278. package/dist/customize/project-settings/project-settings-sections.d.ts +84 -0
  279. package/dist/customize/project-settings/project-settings-sections.js +99 -0
  280. package/dist/customize/providers/provider-accordion.d.ts +54 -0
  281. package/dist/customize/providers/provider-accordion.js +296 -0
  282. package/dist/customize/providers/provider-connect.d.ts +106 -0
  283. package/dist/customize/providers/provider-connect.js +277 -0
  284. package/dist/customize/providers/provider-sheet.d.ts +88 -0
  285. package/dist/customize/providers/provider-sheet.js +301 -0
  286. package/dist/customize/secrets/secrets-page.d.ts +29 -0
  287. package/dist/customize/secrets/secrets-page.js +35 -0
  288. package/dist/customize/sections/add-account-fields.d.ts +39 -0
  289. package/dist/customize/sections/add-account-fields.js +39 -0
  290. package/dist/customize/sections/component/byo-wizard-modal.d.ts +13 -0
  291. package/dist/customize/sections/component/byo-wizard-modal.js +18 -0
  292. package/dist/customize/sections/component/channel-connect-hero.d.ts +27 -0
  293. package/dist/customize/sections/component/channel-connect-hero.js +19 -0
  294. package/dist/customize/sections/component/channel-row.d.ts +29 -0
  295. package/dist/customize/sections/component/channel-row.js +62 -0
  296. package/dist/customize/sections/component/config-entity-source-path.d.ts +1 -0
  297. package/dist/customize/sections/component/config-entity-source-path.js +3 -0
  298. package/dist/customize/sections/component/manifest-copy-block.d.ts +12 -0
  299. package/dist/customize/sections/component/manifest-copy-block.js +81 -0
  300. package/dist/customize/sections/component/section-wrapper.d.ts +32 -0
  301. package/dist/customize/sections/component/section-wrapper.js +52 -0
  302. package/dist/customize/sections/component/slack-byo-wizard.d.ts +5 -0
  303. package/dist/customize/sections/component/slack-byo-wizard.js +120 -0
  304. package/dist/customize/sections/component/slack-connect-card.d.ts +5 -0
  305. package/dist/customize/sections/component/slack-connect-card.js +54 -0
  306. package/dist/customize/sections/component/teams-byo-wizard.d.ts +7 -0
  307. package/dist/customize/sections/component/teams-byo-wizard.js +155 -0
  308. package/dist/customize/sections/component/teams-connect-card.d.ts +6 -0
  309. package/dist/customize/sections/component/teams-connect-card.js +49 -0
  310. package/dist/customize/sections/component/telegram-channel-row.d.ts +6 -0
  311. package/dist/customize/sections/component/telegram-channel-row.js +77 -0
  312. package/dist/customize/sections/connector-connection-form.d.ts +56 -0
  313. package/dist/customize/sections/connector-connection-form.js +148 -0
  314. package/dist/customize/sections/connector-connection-header.d.ts +36 -0
  315. package/dist/customize/sections/connector-connection-header.js +33 -0
  316. package/dist/customize/sections/connector-connection-modal.d.ts +34 -0
  317. package/dist/customize/sections/connector-connection-modal.js +70 -0
  318. package/dist/customize/sections/connector-credential-target.d.ts +29 -0
  319. package/dist/customize/sections/connector-credential-target.js +23 -0
  320. package/dist/customize/sections/connector-oauth2-application-fields.d.ts +6 -0
  321. package/dist/customize/sections/connector-oauth2-application-fields.js +14 -0
  322. package/dist/customize/sections/connector-oauth2-auto.d.ts +45 -0
  323. package/dist/customize/sections/connector-oauth2-auto.js +78 -0
  324. package/dist/customize/sections/connector-oauth2-fields.d.ts +7 -0
  325. package/dist/customize/sections/connector-oauth2-fields.js +14 -0
  326. package/dist/customize/sections/connector-oauth2-scope-fields.d.ts +7 -0
  327. package/dist/customize/sections/connector-oauth2-scope-fields.js +10 -0
  328. package/dist/customize/sections/connector-oauth2-start.d.ts +22 -0
  329. package/dist/customize/sections/connector-oauth2-start.js +40 -0
  330. package/dist/customize/sections/connector-oauth2.d.ts +50 -0
  331. package/dist/customize/sections/connector-oauth2.js +165 -0
  332. package/dist/customize/sections/connectors-view.d.ts +103 -0
  333. package/dist/customize/sections/connectors-view.js +1267 -0
  334. package/dist/customize/sections/discover-catalogue-card.d.ts +19 -0
  335. package/dist/customize/sections/discover-catalogue-card.js +26 -0
  336. package/dist/customize/sections/discover-catalogue-detail.d.ts +15 -0
  337. package/dist/customize/sections/discover-catalogue-detail.js +24 -0
  338. package/dist/customize/sections/discover-catalogue.d.ts +17 -0
  339. package/dist/customize/sections/discover-catalogue.js +132 -0
  340. package/dist/customize/sections/gateway-access-tab.d.ts +6 -0
  341. package/dist/customize/sections/gateway-access-tab.js +66 -0
  342. package/dist/customize/sections/gateway-view.d.ts +176 -0
  343. package/dist/customize/sections/gateway-view.js +244 -0
  344. package/dist/customize/sections/llm-provider/chatgpt-device-challenge.d.ts +6 -0
  345. package/dist/customize/sections/llm-provider/chatgpt-device-challenge.js +11 -0
  346. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.d.ts +66 -0
  347. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +163 -0
  348. package/dist/customize/sections/llm-provider/constants.d.ts +2 -0
  349. package/dist/customize/sections/llm-provider/constants.js +2 -0
  350. package/dist/customize/sections/llm-provider/custom-provider-form.d.ts +16 -0
  351. package/dist/customize/sections/llm-provider/custom-provider-form.js +114 -0
  352. package/dist/customize/sections/llm-provider/custom-provider-panel.d.ts +12 -0
  353. package/dist/customize/sections/llm-provider/custom-provider-panel.js +179 -0
  354. package/dist/customize/sections/llm-provider/device-grant.d.ts +15 -0
  355. package/dist/customize/sections/llm-provider/device-grant.js +53 -0
  356. package/dist/customize/sections/llm-provider/llm-provider-modal.d.ts +3 -0
  357. package/dist/customize/sections/llm-provider/llm-provider-modal.js +86 -0
  358. package/dist/customize/sections/llm-provider/model-capability-icons.d.ts +13 -0
  359. package/dist/customize/sections/llm-provider/model-capability-icons.js +23 -0
  360. package/dist/customize/sections/llm-provider/model-rows.d.ts +23 -0
  361. package/dist/customize/sections/llm-provider/model-rows.js +73 -0
  362. package/dist/customize/sections/llm-provider/models-tab-group.d.ts +6 -0
  363. package/dist/customize/sections/llm-provider/models-tab-group.js +39 -0
  364. package/dist/customize/sections/llm-provider/models-tab-row.d.ts +12 -0
  365. package/dist/customize/sections/llm-provider/models-tab-row.js +85 -0
  366. package/dist/customize/sections/llm-provider/models-tab.d.ts +12 -0
  367. package/dist/customize/sections/llm-provider/models-tab.js +85 -0
  368. package/dist/customize/sections/llm-provider/provider-access-menu.d.ts +10 -0
  369. package/dist/customize/sections/llm-provider/provider-access-menu.js +23 -0
  370. package/dist/customize/sections/llm-provider/provider-loading-state.d.ts +10 -0
  371. package/dist/customize/sections/llm-provider/provider-loading-state.js +3 -0
  372. package/dist/customize/sections/llm-provider/subscription-control.d.ts +42 -0
  373. package/dist/customize/sections/llm-provider/subscription-control.js +42 -0
  374. package/dist/customize/sections/llm-provider/types.d.ts +43 -0
  375. package/dist/customize/sections/llm-provider/types.js +1 -0
  376. package/dist/customize/sections/llm-provider/use-connected-providers.d.ts +6 -0
  377. package/dist/customize/sections/llm-provider/use-connected-providers.js +70 -0
  378. package/dist/customize/sections/llm-provider/use-live-catalog.d.ts +23 -0
  379. package/dist/customize/sections/llm-provider/use-live-catalog.js +44 -0
  380. package/dist/customize/sections/llm-provider/utils.d.ts +141 -0
  381. package/dist/customize/sections/llm-provider/utils.js +269 -0
  382. package/dist/customize/sections/models-page-sheet.d.ts +24 -0
  383. package/dist/customize/sections/models-page-sheet.js +34 -0
  384. package/dist/customize/sections/use-add-request.d.ts +11 -0
  385. package/dist/customize/sections/use-add-request.js +23 -0
  386. package/dist/customize/sections/use-create-custom-connector.d.ts +19 -0
  387. package/dist/customize/sections/use-create-custom-connector.js +36 -0
  388. package/dist/customize/sections/view/account-secret-resources-panel.d.ts +18 -0
  389. package/dist/customize/sections/view/account-secret-resources-panel.js +295 -0
  390. package/dist/customize/sections/view/agent-editor-access-fields.d.ts +63 -0
  391. package/dist/customize/sections/view/agent-editor-access-fields.js +129 -0
  392. package/dist/customize/sections/view/agent-editor-basics-fields.d.ts +37 -0
  393. package/dist/customize/sections/view/agent-editor-basics-fields.js +102 -0
  394. package/dist/customize/sections/view/agent-editor-catalog.d.ts +64 -0
  395. package/dist/customize/sections/view/agent-editor-catalog.js +234 -0
  396. package/dist/customize/sections/view/agent-editor-primitives.d.ts +73 -0
  397. package/dist/customize/sections/view/agent-editor-primitives.js +66 -0
  398. package/dist/customize/sections/view/agent-editor.d.ts +330 -0
  399. package/dist/customize/sections/view/agent-editor.js +358 -0
  400. package/dist/customize/sections/view/audience-badge.d.ts +18 -0
  401. package/dist/customize/sections/view/audience-badge.js +40 -0
  402. package/dist/customize/sections/view/channel-binding-tabs.d.ts +9 -0
  403. package/dist/customize/sections/view/channel-binding-tabs.js +14 -0
  404. package/dist/customize/sections/view/channel-settings-patch.d.ts +19 -0
  405. package/dist/customize/sections/view/channel-settings-patch.js +19 -0
  406. package/dist/customize/sections/view/channels-view.d.ts +3 -0
  407. package/dist/customize/sections/view/channels-view.js +611 -0
  408. package/dist/customize/sections/view/connector-connections.d.ts +87 -0
  409. package/dist/customize/sections/view/connector-connections.js +101 -0
  410. package/dist/customize/sections/view/connectors-personal.d.ts +13 -0
  411. package/dist/customize/sections/view/connectors-personal.js +22 -0
  412. package/dist/customize/sections/view/gateway/_metrics.d.ts +101 -0
  413. package/dist/customize/sections/view/gateway/_metrics.js +99 -0
  414. package/dist/customize/sections/view/gateway/_shared.d.ts +35 -0
  415. package/dist/customize/sections/view/gateway/_shared.js +49 -0
  416. package/dist/customize/sections/view/gateway/gateway-api-reference.d.ts +27 -0
  417. package/dist/customize/sections/view/gateway/gateway-api-reference.js +173 -0
  418. package/dist/customize/sections/view/gateway/gateway-budgets.d.ts +38 -0
  419. package/dist/customize/sections/view/gateway/gateway-budgets.js +270 -0
  420. package/dist/customize/sections/view/gateway/gateway-keys.d.ts +24 -0
  421. package/dist/customize/sections/view/gateway/gateway-keys.js +133 -0
  422. package/dist/customize/sections/view/gateway/gateway-logs.d.ts +111 -0
  423. package/dist/customize/sections/view/gateway/gateway-logs.js +500 -0
  424. package/dist/customize/sections/view/gateway/gateway-overview.d.ts +31 -0
  425. package/dist/customize/sections/view/gateway/gateway-overview.js +189 -0
  426. package/dist/customize/sections/view/gateway/gateway-routing.d.ts +30 -0
  427. package/dist/customize/sections/view/gateway/gateway-routing.js +501 -0
  428. package/dist/customize/sections/view/gateway/generation-controls.d.ts +22 -0
  429. package/dist/customize/sections/view/gateway/generation-controls.js +60 -0
  430. package/dist/customize/sections/view/git-view-helpers.d.ts +65 -0
  431. package/dist/customize/sections/view/git-view-helpers.js +81 -0
  432. package/dist/customize/sections/view/git-view.d.ts +38 -0
  433. package/dist/customize/sections/view/git-view.js +510 -0
  434. package/dist/customize/sections/view/grant-mode-field.d.ts +54 -0
  435. package/dist/customize/sections/view/grant-mode-field.js +97 -0
  436. package/dist/customize/sections/view/permission-editor.d.ts +13 -0
  437. package/dist/customize/sections/view/permission-editor.js +117 -0
  438. package/dist/customize/sections/view/review-center-connected.d.ts +3 -0
  439. package/dist/customize/sections/view/review-center-connected.js +250 -0
  440. package/dist/customize/sections/view/review-view.d.ts +8 -0
  441. package/dist/customize/sections/view/review-view.js +19 -0
  442. package/dist/customize/sections/view/sandbox-provider-coverage.d.ts +37 -0
  443. package/dist/customize/sections/view/sandbox-provider-coverage.js +65 -0
  444. package/dist/customize/sections/view/secret-audience.d.ts +12 -0
  445. package/dist/customize/sections/view/secret-audience.js +42 -0
  446. package/dist/customize/sections/view/secret-delivery.d.ts +449 -0
  447. package/dist/customize/sections/view/secret-delivery.js +720 -0
  448. package/dist/customize/sections/view/secret-optimistic-cache.d.ts +19 -0
  449. package/dist/customize/sections/view/secret-optimistic-cache.js +60 -0
  450. package/dist/customize/sections/view/secrets-view.d.ts +60 -0
  451. package/dist/customize/sections/view/secrets-view.js +699 -0
  452. package/dist/customize/sections/view/undecryptable-value.d.ts +13 -0
  453. package/dist/customize/sections/view/undecryptable-value.js +18 -0
  454. package/dist/customize/settings/rail-copy-context.d.ts +20 -0
  455. package/dist/customize/settings/rail-copy-context.js +29 -0
  456. package/dist/customize/settings/rail.d.ts +51 -0
  457. package/dist/customize/settings/rail.js +246 -0
  458. package/dist/customize/settings/settings-tab-header.d.ts +30 -0
  459. package/dist/customize/settings/settings-tab-header.js +42 -0
  460. package/dist/customize/settings/settings-tabs.d.ts +121 -0
  461. package/dist/customize/settings/settings-tabs.js +353 -0
  462. package/dist/customize/settings/tabs/connected-apps.d.ts +13 -0
  463. package/dist/customize/settings/tabs/connected-apps.js +85 -0
  464. package/dist/customize/settings/tabs/experimental-tab.d.ts +110 -0
  465. package/dist/customize/settings/tabs/experimental-tab.js +277 -0
  466. package/dist/customize/settings/tabs/fact-cell.d.ts +10 -0
  467. package/dist/customize/settings/tabs/fact-cell.js +5 -0
  468. package/dist/customize/settings/tabs/general-tab.d.ts +102 -0
  469. package/dist/customize/settings/tabs/general-tab.js +290 -0
  470. package/dist/customize/settings/tabs/project-edit-patch.d.ts +83 -0
  471. package/dist/customize/settings/tabs/project-edit-patch.js +76 -0
  472. package/dist/customize/settings/tabs/sandbox-tab.d.ts +98 -0
  473. package/dist/customize/settings/tabs/sandbox-tab.js +239 -0
  474. package/dist/customize/settings/tabs/sandbox-template-form.d.ts +9 -0
  475. package/dist/customize/settings/tabs/sandbox-template-form.js +162 -0
  476. package/dist/customize/settings/tabs/snapshots-query.d.ts +11 -0
  477. package/dist/customize/settings/tabs/snapshots-query.js +16 -0
  478. package/dist/customize/settings/tabs/snapshots-tab.d.ts +142 -0
  479. package/dist/customize/settings/tabs/snapshots-tab.js +358 -0
  480. package/dist/customize/settings/tabs/tokens-tab.d.ts +32 -0
  481. package/dist/customize/settings/tabs/tokens-tab.js +418 -0
  482. package/dist/customize/settings/type.d.ts +42 -0
  483. package/dist/customize/settings/type.js +1 -0
  484. package/dist/customize/shared/app-return-url.d.ts +7 -0
  485. package/dist/customize/shared/app-return-url.js +36 -0
  486. package/dist/customize/shared/capability-access-gate.d.ts +19 -0
  487. package/dist/customize/shared/capability-access-gate.js +52 -0
  488. package/dist/customize/shared/capability-page-shell.d.ts +43 -0
  489. package/dist/customize/shared/capability-page-shell.js +26 -0
  490. package/dist/customize/shared/capability-scroll-root.d.ts +12 -0
  491. package/dist/customize/shared/capability-scroll-root.js +43 -0
  492. package/dist/customize/shared/capability-skeleton.d.ts +14 -0
  493. package/dist/customize/shared/capability-skeleton.js +19 -0
  494. package/dist/customize/shared/capability-tabs.d.ts +3 -0
  495. package/dist/customize/shared/capability-tabs.js +136 -0
  496. package/dist/customize/shared/catalog/catalog-card.d.ts +45 -0
  497. package/dist/customize/shared/catalog/catalog-card.js +31 -0
  498. package/dist/customize/shared/catalog/catalog-empty-state.d.ts +31 -0
  499. package/dist/customize/shared/catalog/catalog-empty-state.js +22 -0
  500. package/dist/customize/shared/catalog/catalog-empty.d.ts +18 -0
  501. package/dist/customize/shared/catalog/catalog-empty.js +22 -0
  502. package/dist/customize/shared/catalog/catalog-error.d.ts +9 -0
  503. package/dist/customize/shared/catalog/catalog-error.js +65 -0
  504. package/dist/customize/shared/catalog/catalog-grid-tokens.d.ts +58 -0
  505. package/dist/customize/shared/catalog/catalog-grid-tokens.js +58 -0
  506. package/dist/customize/shared/catalog/catalog-grid.d.ts +53 -0
  507. package/dist/customize/shared/catalog/catalog-grid.js +66 -0
  508. package/dist/customize/shared/detail-selection.d.ts +54 -0
  509. package/dist/customize/shared/detail-selection.js +11 -0
  510. package/dist/customize/shared/entity/entity-files.d.ts +26 -0
  511. package/dist/customize/shared/entity/entity-files.js +121 -0
  512. package/dist/customize/shared/entity/entity-modal.d.ts +62 -0
  513. package/dist/customize/shared/entity/entity-modal.js +147 -0
  514. package/dist/customize/shared/feature-gate-screen.d.ts +11 -0
  515. package/dist/customize/shared/feature-gate-screen.js +44 -0
  516. package/dist/customize/shared/new-entity-menu.d.ts +61 -0
  517. package/dist/customize/shared/new-entity-menu.js +41 -0
  518. package/dist/customize/shared/standalone-settings-nav.d.ts +38 -0
  519. package/dist/customize/shared/standalone-settings-nav.js +129 -0
  520. package/dist/customize/shared/use-customize-prefetch.d.ts +67 -0
  521. package/dist/customize/shared/use-customize-prefetch.js +231 -0
  522. package/dist/customize/shared/utils.d.ts +21 -0
  523. package/dist/customize/shared/utils.js +23 -0
  524. package/dist/customize/shared/with-search.d.ts +2 -0
  525. package/dist/customize/shared/with-search.js +10 -0
  526. package/dist/customize/skills/new-skill-modal.d.ts +12 -0
  527. package/dist/customize/skills/new-skill-modal.js +57 -0
  528. package/dist/customize/skills/remove-skill-button.d.ts +16 -0
  529. package/dist/customize/skills/remove-skill-button.js +42 -0
  530. package/dist/customize/skills/skill-scope.d.ts +14 -0
  531. package/dist/customize/skills/skill-scope.js +18 -0
  532. package/dist/customize/skills/skills-page.d.ts +22 -0
  533. package/dist/customize/skills/skills-page.js +117 -0
  534. package/dist/customize/triggers/schedule/composer-parts.d.ts +12 -0
  535. package/dist/customize/triggers/schedule/composer-parts.js +16 -0
  536. package/dist/customize/triggers/schedule/event-account-picker.d.ts +16 -0
  537. package/dist/customize/triggers/schedule/event-account-picker.js +82 -0
  538. package/dist/customize/triggers/schedule/event-apps-strip.d.ts +7 -0
  539. package/dist/customize/triggers/schedule/event-apps-strip.js +21 -0
  540. package/dist/customize/triggers/schedule/event-check-times.d.ts +11 -0
  541. package/dist/customize/triggers/schedule/event-check-times.js +41 -0
  542. package/dist/customize/triggers/schedule/event-count.d.ts +5 -0
  543. package/dist/customize/triggers/schedule/event-count.js +11 -0
  544. package/dist/customize/triggers/schedule/event-trigger-copy.d.ts +176 -0
  545. package/dist/customize/triggers/schedule/event-trigger-copy.js +451 -0
  546. package/dist/customize/triggers/schedule/event-trigger-fields.d.ts +17 -0
  547. package/dist/customize/triggers/schedule/event-trigger-fields.js +47 -0
  548. package/dist/customize/triggers/schedule/schedule-builder.d.ts +25 -0
  549. package/dist/customize/triggers/schedule/schedule-builder.js +284 -0
  550. package/dist/customize/triggers/schedule/schedule-copy.d.ts +139 -0
  551. package/dist/customize/triggers/schedule/schedule-copy.js +368 -0
  552. package/dist/customize/triggers/schedule/schedule-detail-sheet.d.ts +37 -0
  553. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +287 -0
  554. package/dist/customize/triggers/schedule/schedule-fields.d.ts +97 -0
  555. package/dist/customize/triggers/schedule/schedule-fields.js +172 -0
  556. package/dist/customize/triggers/schedule/then-fields.d.ts +12 -0
  557. package/dist/customize/triggers/schedule/then-fields.js +36 -0
  558. package/dist/customize/triggers/schedule/trigger-callouts.d.ts +12 -0
  559. package/dist/customize/triggers/schedule/trigger-callouts.js +34 -0
  560. package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +149 -0
  561. package/dist/customize/triggers/schedule/trigger-composer-logic.js +252 -0
  562. package/dist/customize/triggers/schedule/trigger-composer.d.ts +24 -0
  563. package/dist/customize/triggers/schedule/trigger-composer.js +273 -0
  564. package/dist/customize/triggers/schedule/trigger-controls.d.ts +3 -0
  565. package/dist/customize/triggers/schedule/trigger-controls.js +19 -0
  566. package/dist/customize/triggers/schedule/trigger-edit-logic.d.ts +18 -0
  567. package/dist/customize/triggers/schedule/trigger-edit-logic.js +133 -0
  568. package/dist/customize/triggers/schedule/trigger-filter.d.ts +54 -0
  569. package/dist/customize/triggers/schedule/trigger-filter.js +77 -0
  570. package/dist/customize/triggers/schedule/trigger-list.d.ts +26 -0
  571. package/dist/customize/triggers/schedule/trigger-list.js +70 -0
  572. package/dist/customize/triggers/schedule/trigger-options.d.ts +14 -0
  573. package/dist/customize/triggers/schedule/trigger-options.js +38 -0
  574. package/dist/customize/triggers/schedule/trigger-readonly.d.ts +8 -0
  575. package/dist/customize/triggers/schedule/trigger-readonly.js +51 -0
  576. package/dist/customize/triggers/schedule/trigger-runs-histogram.d.ts +14 -0
  577. package/dist/customize/triggers/schedule/trigger-runs-histogram.js +68 -0
  578. package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +49 -0
  579. package/dist/customize/triggers/schedule/trigger-runs-logic.js +90 -0
  580. package/dist/customize/triggers/schedule/trigger-runs-panel.d.ts +32 -0
  581. package/dist/customize/triggers/schedule/trigger-runs-panel.js +216 -0
  582. package/dist/customize/triggers/schedule/trigger-selection-bar.d.ts +22 -0
  583. package/dist/customize/triggers/schedule/trigger-selection-bar.js +47 -0
  584. package/dist/customize/triggers/schedule/trigger-selection.d.ts +33 -0
  585. package/dist/customize/triggers/schedule/trigger-selection.js +42 -0
  586. package/dist/customize/triggers/schedule/trigger-session-access-copy.d.ts +46 -0
  587. package/dist/customize/triggers/schedule/trigger-session-access-copy.js +35 -0
  588. package/dist/customize/triggers/schedule/trigger-status-badge.d.ts +13 -0
  589. package/dist/customize/triggers/schedule/trigger-status-badge.js +34 -0
  590. package/dist/customize/triggers/schedule/trigger-test-dialog.d.ts +7 -0
  591. package/dist/customize/triggers/schedule/trigger-test-dialog.js +61 -0
  592. package/dist/customize/triggers/schedule/trigger-tile.d.ts +20 -0
  593. package/dist/customize/triggers/schedule/trigger-tile.js +52 -0
  594. package/dist/customize/triggers/schedule/trigger-toast.d.ts +15 -0
  595. package/dist/customize/triggers/schedule/trigger-toast.js +50 -0
  596. package/dist/customize/triggers/schedule/use-event-app-connect.d.ts +8 -0
  597. package/dist/customize/triggers/schedule/use-event-app-connect.js +205 -0
  598. package/dist/customize/triggers/schedule/use-event-titles.d.ts +11 -0
  599. package/dist/customize/triggers/schedule/use-event-titles.js +28 -0
  600. package/dist/customize/triggers/schedule/use-trigger-mutations.d.ts +33 -0
  601. package/dist/customize/triggers/schedule/use-trigger-mutations.js +67 -0
  602. package/dist/customize/triggers/schedule/when-event-summary.d.ts +13 -0
  603. package/dist/customize/triggers/schedule/when-event-summary.js +28 -0
  604. package/dist/customize/triggers/schedule/when-event.d.ts +18 -0
  605. package/dist/customize/triggers/schedule/when-event.js +162 -0
  606. package/dist/customize/triggers/schedule/when-schedule.d.ts +8 -0
  607. package/dist/customize/triggers/schedule/when-schedule.js +11 -0
  608. package/dist/customize/triggers/schedule/when-webhook-address.d.ts +10 -0
  609. package/dist/customize/triggers/schedule/when-webhook-address.js +20 -0
  610. package/dist/customize/triggers/schedule/when-webhook.d.ts +8 -0
  611. package/dist/customize/triggers/schedule/when-webhook.js +16 -0
  612. package/dist/customize/triggers/schedule-view.d.ts +56 -0
  613. package/dist/customize/triggers/schedule-view.js +421 -0
  614. package/dist/customize/triggers/triggers-page.d.ts +21 -0
  615. package/dist/customize/triggers/triggers-page.js +24 -0
  616. package/dist/customize/use-configure-thread.d.ts +15 -0
  617. package/dist/customize/use-configure-thread.js +47 -0
  618. package/dist/diff/diff-view.d.ts +49 -0
  619. package/dist/diff/diff-view.js +61 -0
  620. package/dist/diff/index.d.ts +4 -0
  621. package/dist/diff/index.js +4 -0
  622. package/dist/files/drives/session-drives-chip.d.ts +19 -0
  623. package/dist/files/drives/session-drives-chip.js +71 -0
  624. package/dist/files/drives/use-drives.d.ts +10 -0
  625. package/dist/files/drives/use-drives.js +32 -0
  626. package/dist/files/editor/code-editor.d.ts +28 -0
  627. package/dist/files/editor/code-editor.js +518 -0
  628. package/dist/files/editor/codemirror-diagnostics.d.ts +29 -0
  629. package/dist/files/editor/codemirror-diagnostics.js +243 -0
  630. package/dist/files/editor/external-content.d.ts +19 -0
  631. package/dist/files/editor/external-content.js +17 -0
  632. package/dist/files/editor/lazy-code-editor.d.ts +9 -0
  633. package/dist/files/editor/lazy-code-editor.js +14 -0
  634. package/dist/files/editor/target-line.d.ts +9 -0
  635. package/dist/files/editor/target-line.js +35 -0
  636. package/dist/files/file-preview-dialog.d.ts +2 -0
  637. package/dist/files/file-preview-dialog.js +43 -0
  638. package/dist/files/file-preview-host.d.ts +5 -0
  639. package/dist/files/file-preview-host.js +18 -0
  640. package/dist/files/index.d.ts +23 -0
  641. package/dist/files/index.js +23 -0
  642. package/dist/files/project/api/branches.d.ts +8 -0
  643. package/dist/files/project/api/branches.js +10 -0
  644. package/dist/files/project/api/change-requests.d.ts +36 -0
  645. package/dist/files/project/api/change-requests.js +42 -0
  646. package/dist/files/project/api/commits.d.ts +15 -0
  647. package/dist/files/project/api/commits.js +14 -0
  648. package/dist/files/project/api/git-history.d.ts +14 -0
  649. package/dist/files/project/api/git-history.js +63 -0
  650. package/dist/files/project/api/runtime-files.d.ts +103 -0
  651. package/dist/files/project/api/runtime-files.js +289 -0
  652. package/dist/files/project/change-request-recovery.d.ts +26 -0
  653. package/dist/files/project/change-request-recovery.js +59 -0
  654. package/dist/files/project/components/change-request-detail-dialog.d.ts +13 -0
  655. package/dist/files/project/components/change-request-detail-dialog.js +187 -0
  656. package/dist/files/project/components/change-requests-panel.d.ts +14 -0
  657. package/dist/files/project/components/change-requests-panel.js +94 -0
  658. package/dist/files/project/components/checkpoint-detail-dialog.d.ts +11 -0
  659. package/dist/files/project/components/checkpoint-detail-dialog.js +201 -0
  660. package/dist/files/project/components/checkpoints-panel.d.ts +18 -0
  661. package/dist/files/project/components/checkpoints-panel.js +76 -0
  662. package/dist/files/project/components/diff-preview-banner.d.ts +30 -0
  663. package/dist/files/project/components/diff-preview-banner.js +45 -0
  664. package/dist/files/project/components/diff-renderer.d.ts +19 -0
  665. package/dist/files/project/components/diff-renderer.js +14 -0
  666. package/dist/files/project/components/drive-create-dialog.d.ts +26 -0
  667. package/dist/files/project/components/drive-create-dialog.js +52 -0
  668. package/dist/files/project/components/drive-empty-art.d.ts +2 -0
  669. package/dist/files/project/components/drive-empty-art.js +5 -0
  670. package/dist/files/project/components/drive-explorer.d.ts +84 -0
  671. package/dist/files/project/components/drive-explorer.js +1055 -0
  672. package/dist/files/project/components/drive-folder-thumbnail.d.ts +27 -0
  673. package/dist/files/project/components/drive-folder-thumbnail.js +63 -0
  674. package/dist/files/project/components/drive-grid-view.d.ts +72 -0
  675. package/dist/files/project/components/drive-grid-view.js +133 -0
  676. package/dist/files/project/components/drive-header.d.ts +61 -0
  677. package/dist/files/project/components/drive-header.js +75 -0
  678. package/dist/files/project/components/drive-list-view.d.ts +37 -0
  679. package/dist/files/project/components/drive-list-view.js +128 -0
  680. package/dist/files/project/components/drive-rename-dialog.d.ts +19 -0
  681. package/dist/files/project/components/drive-rename-dialog.js +57 -0
  682. package/dist/files/project/components/drive-selection-bar.d.ts +22 -0
  683. package/dist/files/project/components/drive-selection-bar.js +30 -0
  684. package/dist/files/project/components/drive-selection-ui.d.ts +18 -0
  685. package/dist/files/project/components/drive-selection-ui.js +17 -0
  686. package/dist/files/project/components/drive-selection.d.ts +68 -0
  687. package/dist/files/project/components/drive-selection.js +73 -0
  688. package/dist/files/project/components/drive-toolbar.d.ts +121 -0
  689. package/dist/files/project/components/drive-toolbar.js +185 -0
  690. package/dist/files/project/components/drive-upload-tray.d.ts +9 -0
  691. package/dist/files/project/components/drive-upload-tray.js +74 -0
  692. package/dist/files/project/components/file-breadcrumbs.d.ts +23 -0
  693. package/dist/files/project/components/file-breadcrumbs.js +147 -0
  694. package/dist/files/project/components/file-content-renderer.d.ts +5 -0
  695. package/dist/files/project/components/file-content-renderer.js +11 -0
  696. package/dist/files/project/components/file-explorer-page.d.ts +11 -0
  697. package/dist/files/project/components/file-explorer-page.js +367 -0
  698. package/dist/files/project/components/file-history-popover.d.ts +6 -0
  699. package/dist/files/project/components/file-history-popover.js +103 -0
  700. package/dist/files/project/components/file-icon.d.ts +16 -0
  701. package/dist/files/project/components/file-icon.js +203 -0
  702. package/dist/files/project/components/file-preview-modal.d.ts +14 -0
  703. package/dist/files/project/components/file-preview-modal.js +46 -0
  704. package/dist/files/project/components/file-route-state.d.ts +2 -0
  705. package/dist/files/project/components/file-route-state.js +3 -0
  706. package/dist/files/project/components/file-search.d.ts +1 -0
  707. package/dist/files/project/components/file-search.js +135 -0
  708. package/dist/files/project/components/file-thumbnail.d.ts +28 -0
  709. package/dist/files/project/components/file-thumbnail.js +81 -0
  710. package/dist/files/project/components/index.d.ts +18 -0
  711. package/dist/files/project/components/index.js +17 -0
  712. package/dist/files/project/components/load-more-row.d.ts +18 -0
  713. package/dist/files/project/components/load-more-row.js +35 -0
  714. package/dist/files/project/components/open-change-request-dialog.d.ts +12 -0
  715. package/dist/files/project/components/open-change-request-dialog.js +129 -0
  716. package/dist/files/project/components/own-clicks.d.ts +12 -0
  717. package/dist/files/project/components/own-clicks.js +20 -0
  718. package/dist/files/project/components/review-panel.d.ts +73 -0
  719. package/dist/files/project/components/review-panel.js +72 -0
  720. package/dist/files/project/components/use-drive-row-interactions.d.ts +27 -0
  721. package/dist/files/project/components/use-drive-row-interactions.js +121 -0
  722. package/dist/files/project/components/version-selector.d.ts +1 -0
  723. package/dist/files/project/components/version-selector.js +66 -0
  724. package/dist/files/project/context.d.ts +32 -0
  725. package/dist/files/project/context.js +38 -0
  726. package/dist/files/project/drop-tree.d.ts +34 -0
  727. package/dist/files/project/drop-tree.js +63 -0
  728. package/dist/files/project/explorer-source.d.ts +163 -0
  729. package/dist/files/project/explorer-source.js +14 -0
  730. package/dist/files/project/file-source.d.ts +11 -0
  731. package/dist/files/project/file-source.js +30 -0
  732. package/dist/files/project/git-ref-explorer-source.d.ts +6 -0
  733. package/dist/files/project/git-ref-explorer-source.js +50 -0
  734. package/dist/files/project/hooks/index.d.ts +14 -0
  735. package/dist/files/project/hooks/index.js +24 -0
  736. package/dist/files/project/hooks/use-binary-blob.d.ts +26 -0
  737. package/dist/files/project/hooks/use-binary-blob.js +72 -0
  738. package/dist/files/project/hooks/use-branches.d.ts +14 -0
  739. package/dist/files/project/hooks/use-branches.js +23 -0
  740. package/dist/files/project/hooks/use-change-request-recovery.d.ts +5 -0
  741. package/dist/files/project/hooks/use-change-request-recovery.js +53 -0
  742. package/dist/files/project/hooks/use-change-requests.d.ts +153 -0
  743. package/dist/files/project/hooks/use-change-requests.js +317 -0
  744. package/dist/files/project/hooks/use-commits.d.ts +30 -0
  745. package/dist/files/project/hooks/use-commits.js +57 -0
  746. package/dist/files/project/hooks/use-directory-download.d.ts +10 -0
  747. package/dist/files/project/hooks/use-directory-download.js +46 -0
  748. package/dist/files/project/hooks/use-file-content.d.ts +13 -0
  749. package/dist/files/project/hooks/use-file-content.js +52 -0
  750. package/dist/files/project/hooks/use-file-history.d.ts +31 -0
  751. package/dist/files/project/hooks/use-file-history.js +55 -0
  752. package/dist/files/project/hooks/use-file-list.d.ts +39 -0
  753. package/dist/files/project/hooks/use-file-list.js +83 -0
  754. package/dist/files/project/hooks/use-file-mutations.d.ts +22 -0
  755. package/dist/files/project/hooks/use-file-mutations.js +46 -0
  756. package/dist/files/project/hooks/use-file-search.d.ts +23 -0
  757. package/dist/files/project/hooks/use-file-search.js +54 -0
  758. package/dist/files/project/hooks/use-git-status.d.ts +21 -0
  759. package/dist/files/project/hooks/use-git-status.js +36 -0
  760. package/dist/files/project/hooks/use-server-health.d.ts +27 -0
  761. package/dist/files/project/hooks/use-server-health.js +36 -0
  762. package/dist/files/project/index.d.ts +20 -0
  763. package/dist/files/project/index.js +32 -0
  764. package/dist/files/project/search/workspace-search-service.d.ts +18 -0
  765. package/dist/files/project/search/workspace-search-service.js +19 -0
  766. package/dist/files/project/store/upload-store.d.ts +25 -0
  767. package/dist/files/project/store/upload-store.js +16 -0
  768. package/dist/files/project/store/version-store.d.ts +19 -0
  769. package/dist/files/project/store/version-store.js +25 -0
  770. package/dist/files/project/upload-batch.d.ts +92 -0
  771. package/dist/files/project/upload-batch.js +105 -0
  772. package/dist/files/renderers/csv/csv-copy.d.ts +8 -0
  773. package/dist/files/renderers/csv/csv-copy.js +36 -0
  774. package/dist/files/renderers/csv/csv-renderer.d.ts +15 -0
  775. package/dist/files/renderers/csv/csv-renderer.js +18 -0
  776. package/dist/files/renderers/csv/csv-viewer.d.ts +18 -0
  777. package/dist/files/renderers/csv/csv-viewer.js +342 -0
  778. package/dist/files/renderers/docx/docx-annotation-card.d.ts +4 -0
  779. package/dist/files/renderers/docx/docx-annotation-card.js +62 -0
  780. package/dist/files/renderers/docx/docx-renderer.d.ts +38 -0
  781. package/dist/files/renderers/docx/docx-renderer.js +49 -0
  782. package/dist/files/renderers/docx/docx-viewer.d.ts +13 -0
  783. package/dist/files/renderers/docx/docx-viewer.js +624 -0
  784. package/dist/files/renderers/image-renderer.d.ts +29 -0
  785. package/dist/files/renderers/image-renderer.js +285 -0
  786. package/dist/files/renderers/mermaid/mermaid-diagram.d.ts +10 -0
  787. package/dist/files/renderers/mermaid/mermaid-diagram.js +159 -0
  788. package/dist/files/renderers/mermaid/mermaid-utils.d.ts +44 -0
  789. package/dist/files/renderers/mermaid/mermaid-utils.js +119 -0
  790. package/dist/files/renderers/pdf/pdf-engine-loader.d.ts +2 -0
  791. package/dist/files/renderers/pdf/pdf-engine-loader.js +15 -0
  792. package/dist/files/renderers/pdf/pdf-renderer.d.ts +23 -0
  793. package/dist/files/renderers/pdf/pdf-renderer.js +54 -0
  794. package/dist/files/renderers/pdf/pdf-viewer.d.ts +86 -0
  795. package/dist/files/renderers/pdf/pdf-viewer.js +1361 -0
  796. package/dist/files/renderers/pptx-i18n.d.ts +2 -0
  797. package/dist/files/renderers/pptx-i18n.js +33 -0
  798. package/dist/files/renderers/pptx-renderer.d.ts +26 -0
  799. package/dist/files/renderers/pptx-renderer.js +153 -0
  800. package/dist/files/renderers/pptx-viewer.css +147 -0
  801. package/dist/files/renderers/presentation/FullScreenPresentationViewer.d.ts +10 -0
  802. package/dist/files/renderers/presentation/FullScreenPresentationViewer.js +337 -0
  803. package/dist/files/renderers/presentation/presentation-utils.d.ts +20 -0
  804. package/dist/files/renderers/presentation/presentation-utils.js +53 -0
  805. package/dist/files/renderers/presentation/presentation-viewer-store.d.ts +27 -0
  806. package/dist/files/renderers/presentation/presentation-viewer-store.js +37 -0
  807. package/dist/files/renderers/shared/document-viewer-sidebar.d.ts +15 -0
  808. package/dist/files/renderers/shared/document-viewer-sidebar.js +61 -0
  809. package/dist/files/renderers/shared/file-thumbnail.d.ts +17 -0
  810. package/dist/files/renderers/shared/file-thumbnail.js +71 -0
  811. package/dist/files/renderers/shared/scroll-area-compat.d.ts +45 -0
  812. package/dist/files/renderers/shared/scroll-area-compat.js +41 -0
  813. package/dist/files/renderers/shared/select-compat.d.ts +11 -0
  814. package/dist/files/renderers/shared/select-compat.js +19 -0
  815. package/dist/files/renderers/shared/spinner.d.ts +3 -0
  816. package/dist/files/renderers/shared/spinner.js +7 -0
  817. package/dist/files/renderers/shared/use-viewer-search.d.ts +13 -0
  818. package/dist/files/renderers/shared/use-viewer-search.js +86 -0
  819. package/dist/files/renderers/shared/viewer-copy-menu.d.ts +9 -0
  820. package/dist/files/renderers/shared/viewer-copy-menu.js +16 -0
  821. package/dist/files/renderers/shared/viewer-download-button.d.ts +10 -0
  822. package/dist/files/renderers/shared/viewer-download-button.js +27 -0
  823. package/dist/files/renderers/shared/viewer-file-name.d.ts +11 -0
  824. package/dist/files/renderers/shared/viewer-file-name.js +16 -0
  825. package/dist/files/renderers/shared/viewer-frame.d.ts +6 -0
  826. package/dist/files/renderers/shared/viewer-frame.js +26 -0
  827. package/dist/files/renderers/show-content-renderer.d.ts +116 -0
  828. package/dist/files/renderers/show-content-renderer.js +707 -0
  829. package/dist/files/renderers/show-type-utils.d.ts +45 -0
  830. package/dist/files/renderers/show-type-utils.js +85 -0
  831. package/dist/files/renderers/sqlite-renderer.d.ts +14 -0
  832. package/dist/files/renderers/sqlite-renderer.js +727 -0
  833. package/dist/files/renderers/video-renderer.d.ts +14 -0
  834. package/dist/files/renderers/video-renderer.js +181 -0
  835. package/dist/files/renderers/xlsx/xlsx-renderer.d.ts +25 -0
  836. package/dist/files/renderers/xlsx/xlsx-renderer.js +72 -0
  837. package/dist/files/renderers/xlsx/xlsx-viewer.d.ts +39 -0
  838. package/dist/files/renderers/xlsx/xlsx-viewer.js +722 -0
  839. package/dist/files/renderers/zip/zip-entries.d.ts +154 -0
  840. package/dist/files/renderers/zip/zip-entries.js +271 -0
  841. package/dist/files/renderers/zip/zip-renderer.d.ts +20 -0
  842. package/dist/files/renderers/zip/zip-renderer.js +317 -0
  843. package/dist/files/runtime/components/file-content-renderer.d.ts +5 -0
  844. package/dist/files/runtime/components/file-content-renderer.js +10 -0
  845. package/dist/files/runtime/file-source.d.ts +6 -0
  846. package/dist/files/runtime/file-source.js +22 -0
  847. package/dist/files/runtime/hooks/blob-identity.d.ts +12 -0
  848. package/dist/files/runtime/hooks/blob-identity.js +23 -0
  849. package/dist/files/runtime/hooks/index.d.ts +12 -0
  850. package/dist/files/runtime/hooks/index.js +21 -0
  851. package/dist/files/runtime/hooks/server-health-state.d.ts +18 -0
  852. package/dist/files/runtime/hooks/server-health-state.js +20 -0
  853. package/dist/files/runtime/hooks/system-dir.d.ts +1 -0
  854. package/dist/files/runtime/hooks/system-dir.js +16 -0
  855. package/dist/files/runtime/hooks/use-binary-blob.d.ts +29 -0
  856. package/dist/files/runtime/hooks/use-binary-blob.js +102 -0
  857. package/dist/files/runtime/hooks/use-directory-download.d.ts +16 -0
  858. package/dist/files/runtime/hooks/use-directory-download.js +59 -0
  859. package/dist/files/runtime/hooks/use-file-content.d.ts +17 -0
  860. package/dist/files/runtime/hooks/use-file-content.js +53 -0
  861. package/dist/files/runtime/hooks/use-file-history.d.ts +35 -0
  862. package/dist/files/runtime/hooks/use-file-history.js +75 -0
  863. package/dist/files/runtime/hooks/use-file-list.d.ts +172 -0
  864. package/dist/files/runtime/hooks/use-file-list.js +67 -0
  865. package/dist/files/runtime/hooks/use-file-mutations.d.ts +22 -0
  866. package/dist/files/runtime/hooks/use-file-mutations.js +122 -0
  867. package/dist/files/runtime/hooks/use-file-refresh.d.ts +16 -0
  868. package/dist/files/runtime/hooks/use-file-refresh.js +32 -0
  869. package/dist/files/runtime/hooks/use-file-search.d.ts +14 -0
  870. package/dist/files/runtime/hooks/use-file-search.js +26 -0
  871. package/dist/files/runtime/hooks/use-git-status.d.ts +16 -0
  872. package/dist/files/runtime/hooks/use-git-status.js +61 -0
  873. package/dist/files/runtime/hooks/use-server-health.d.ts +33 -0
  874. package/dist/files/runtime/hooks/use-server-health.js +49 -0
  875. package/dist/files/runtime/hooks/use-workspace-search.d.ts +54 -0
  876. package/dist/files/runtime/hooks/use-workspace-search.js +91 -0
  877. package/dist/files/runtime/index.d.ts +15 -0
  878. package/dist/files/runtime/index.js +25 -0
  879. package/dist/files/runtime/path-utils.d.ts +15 -0
  880. package/dist/files/runtime/path-utils.js +20 -0
  881. package/dist/files/runtime/sandbox-explorer-source.d.ts +7 -0
  882. package/dist/files/runtime/sandbox-explorer-source.js +74 -0
  883. package/dist/files/runtime/sandbox-file-explorer.d.ts +30 -0
  884. package/dist/files/runtime/sandbox-file-explorer.js +77 -0
  885. package/dist/files/runtime/search/workspace-search-service.d.ts +3 -0
  886. package/dist/files/runtime/search/workspace-search-service.js +7 -0
  887. package/dist/files/tree/components/file-tree-item.d.ts +31 -0
  888. package/dist/files/tree/components/file-tree-item.js +176 -0
  889. package/dist/files/tree/hooks/use-file-events.d.ts +11 -0
  890. package/dist/files/tree/hooks/use-file-events.js +14 -0
  891. package/dist/files/viewer/file-content-renderer.d.ts +48 -0
  892. package/dist/files/viewer/file-content-renderer.js +128 -0
  893. package/dist/files/viewer/file-header.d.ts +37 -0
  894. package/dist/files/viewer/file-header.js +21 -0
  895. package/dist/files/viewer/file-preview-modal.d.ts +63 -0
  896. package/dist/files/viewer/file-preview-modal.js +320 -0
  897. package/dist/files/viewer/file-source.d.ts +116 -0
  898. package/dist/files/viewer/file-source.js +14 -0
  899. package/dist/files/viewer/file-viewer.d.ts +36 -0
  900. package/dist/files/viewer/file-viewer.js +196 -0
  901. package/dist/files/viewer/html-preview.d.ts +32 -0
  902. package/dist/files/viewer/html-preview.js +101 -0
  903. package/dist/files/viewer/index.d.ts +20 -0
  904. package/dist/files/viewer/index.js +15 -0
  905. package/dist/files/viewer/json-tree-view.d.ts +3 -0
  906. package/dist/files/viewer/json-tree-view.js +49 -0
  907. package/dist/files/viewer/markdown-pdf.d.ts +38 -0
  908. package/dist/files/viewer/markdown-pdf.js +111 -0
  909. package/dist/files/viewer/preview-fit.d.ts +50 -0
  910. package/dist/files/viewer/preview-fit.js +51 -0
  911. package/dist/files/viewer/preview-policy.d.ts +46 -0
  912. package/dist/files/viewer/preview-policy.js +190 -0
  913. package/dist/files/viewer/print-document.d.ts +29 -0
  914. package/dist/files/viewer/print-document.js +88 -0
  915. package/dist/files/viewer/save-as-pdf-button.d.ts +22 -0
  916. package/dist/files/viewer/save-as-pdf-button.js +63 -0
  917. package/dist/files/viewer/use-content-revision.d.ts +18 -0
  918. package/dist/files/viewer/use-content-revision.js +29 -0
  919. package/dist/files/viewer/use-file-content-state.d.ts +60 -0
  920. package/dist/files/viewer/use-file-content-state.js +352 -0
  921. package/dist/files/viewer/viewer-actions.d.ts +99 -0
  922. package/dist/files/viewer/viewer-actions.js +262 -0
  923. package/dist/files/viewer/viewer-chrome.d.ts +27 -0
  924. package/dist/files/viewer/viewer-chrome.js +61 -0
  925. package/dist/hooks/use-is-dark.d.ts +6 -0
  926. package/dist/hooks/use-is-dark.js +11 -16
  927. package/dist/i18n/en.d.ts +6912 -0
  928. package/dist/i18n/en.js +6913 -0
  929. package/dist/i18n/index.d.ts +18 -0
  930. package/dist/i18n/index.js +33 -0
  931. package/dist/i18n/ui-catalog/account-hub-translation-keys.generated.d.ts +1 -0
  932. package/dist/i18n/ui-catalog/account-hub-translation-keys.generated.js +30 -0
  933. package/dist/i18n/ui-catalog/app-registry-translation-keys.generated.d.ts +1 -0
  934. package/dist/i18n/ui-catalog/app-registry-translation-keys.generated.js +109 -0
  935. package/dist/i18n/ui-catalog/localize-ui-catalog.d.ts +4 -0
  936. package/dist/i18n/ui-catalog/localize-ui-catalog.js +49 -0
  937. package/dist/i18n/ui-catalog/product-catalog-translation-keys.generated.d.ts +1 -0
  938. package/dist/i18n/ui-catalog/product-catalog-translation-keys.generated.js +149 -0
  939. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.d.ts +1 -0
  940. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +902 -0
  941. package/dist/i18n/ui-catalog/review-meta-translation-keys.generated.d.ts +1 -0
  942. package/dist/i18n/ui-catalog/review-meta-translation-keys.generated.js +21 -0
  943. package/dist/i18n/ui-catalog/review-mock-translation-keys.generated.d.ts +1 -0
  944. package/dist/i18n/ui-catalog/review-mock-translation-keys.generated.js +43 -0
  945. package/dist/i18n/ui-catalog/use-localized-ui-catalog.d.ts +1 -0
  946. package/dist/i18n/ui-catalog/use-localized-ui-catalog.js +9 -0
  947. package/dist/icons/index.d.ts +6 -0
  948. package/dist/icons/index.js +6 -0
  949. package/dist/icons/sidebar-toggle.d.ts +2 -2
  950. package/dist/icons/sidebar-toggle.js +1 -1
  951. package/dist/index.d.ts +36 -22
  952. package/dist/index.js +37 -23
  953. package/dist/internal/account-hub/account-hub-entry.d.ts +5 -0
  954. package/dist/internal/account-hub/account-hub-entry.js +22 -0
  955. package/dist/internal/account-hub/account-hub-location.d.ts +54 -0
  956. package/dist/internal/account-hub/account-hub-location.js +113 -0
  957. package/dist/internal/account-hub/account-settings-shell.d.ts +7 -0
  958. package/dist/internal/account-hub/account-settings-shell.js +87 -0
  959. package/dist/internal/account-hub/account-settings-sidebar.d.ts +2 -0
  960. package/dist/internal/account-hub/account-settings-sidebar.js +169 -0
  961. package/dist/internal/account-hub/hub-sheet.d.ts +39 -0
  962. package/dist/internal/account-hub/hub-sheet.js +46 -0
  963. package/dist/internal/account-hub/sections.d.ts +95 -0
  964. package/dist/internal/account-hub/sections.js +232 -0
  965. package/dist/internal/account-hub/use-account-detail.d.ts +2 -0
  966. package/dist/internal/account-hub/use-account-detail.js +20 -0
  967. package/dist/internal/account-hub/use-account-hub-access.d.ts +56 -0
  968. package/dist/internal/account-hub/use-account-hub-access.js +156 -0
  969. package/dist/internal/account-hub/use-account-members.d.ts +2 -0
  970. package/dist/internal/account-hub/use-account-members.js +24 -0
  971. package/dist/internal/auth/auth-card-shell.d.ts +36 -0
  972. package/dist/internal/auth/auth-card-shell.js +66 -0
  973. package/dist/internal/auth/auth-consent.d.ts +71 -0
  974. package/dist/internal/auth/auth-consent.js +75 -0
  975. package/dist/internal/auth/auth-primitives.d.ts +67 -0
  976. package/dist/internal/auth/auth-primitives.js +94 -0
  977. package/dist/internal/auth/code-input-logic.d.ts +23 -0
  978. package/dist/internal/auth/code-input-logic.js +33 -0
  979. package/dist/internal/auth/mfa-pending-action.d.ts +8 -0
  980. package/dist/internal/auth/mfa-pending-action.js +24 -0
  981. package/dist/internal/billing/account-state-gating.d.ts +23 -0
  982. package/dist/internal/billing/account-state-gating.js +21 -0
  983. package/dist/internal/billing/compute-pricing.d.ts +88 -0
  984. package/dist/internal/billing/compute-pricing.js +119 -0
  985. package/dist/internal/billing/index.d.ts +20 -0
  986. package/dist/internal/billing/index.js +36 -0
  987. package/dist/internal/billing/session-cost-format.d.ts +4 -0
  988. package/dist/internal/billing/session-cost-format.js +37 -0
  989. package/dist/internal/billing/use-account-state.d.ts +64 -0
  990. package/dist/internal/billing/use-account-state.js +231 -0
  991. package/dist/internal/billing/use-cost-explorer.d.ts +73 -0
  992. package/dist/internal/billing/use-cost-explorer.js +90 -0
  993. package/dist/internal/billing/use-download-restriction.d.ts +33 -0
  994. package/dist/internal/billing/use-download-restriction.js +60 -0
  995. package/dist/internal/billing/use-session-costs.d.ts +75 -0
  996. package/dist/internal/billing/use-session-costs.js +105 -0
  997. package/dist/internal/billing/use-transactions.d.ts +5 -0
  998. package/dist/internal/billing/use-transactions.js +34 -0
  999. package/dist/internal/branding/branding-provider.d.ts +39 -0
  1000. package/dist/internal/branding/branding-provider.js +203 -0
  1001. package/dist/internal/capture/use-capture-area.d.ts +51 -0
  1002. package/dist/internal/capture/use-capture-area.js +96 -0
  1003. package/dist/internal/components/clickable-path.d.ts +64 -0
  1004. package/dist/internal/components/clickable-path.js +170 -0
  1005. package/dist/internal/components/hover-prefetch-link.d.ts +32 -0
  1006. package/dist/internal/components/hover-prefetch-link.js +39 -0
  1007. package/dist/internal/components/mobile-store-qr.d.ts +18 -0
  1008. package/dist/internal/components/mobile-store-qr.js +40 -0
  1009. package/dist/internal/components/repository-disconnected.d.ts +46 -0
  1010. package/dist/internal/components/repository-disconnected.js +80 -0
  1011. package/dist/internal/desktop/desktop-back-button.d.ts +93 -0
  1012. package/dist/internal/desktop/desktop-back-button.js +128 -0
  1013. package/dist/internal/desktop/titlebar-control.d.ts +16 -0
  1014. package/dist/internal/desktop/titlebar-control.js +15 -0
  1015. package/dist/internal/files/file-availability.d.ts +34 -0
  1016. package/dist/internal/files/file-availability.js +81 -0
  1017. package/dist/internal/files/file-read-retry.d.ts +28 -0
  1018. package/dist/internal/files/file-read-retry.js +109 -0
  1019. package/dist/internal/files/git-history.d.ts +35 -0
  1020. package/dist/internal/files/git-history.js +221 -0
  1021. package/dist/internal/files/runtime-file-read.d.ts +5 -0
  1022. package/dist/internal/files/runtime-file-read.js +29 -0
  1023. package/dist/internal/files/runtime-files.d.ts +52 -0
  1024. package/dist/internal/files/runtime-files.js +193 -0
  1025. package/dist/internal/files/session-drive-files.d.ts +63 -0
  1026. package/dist/internal/files/session-drive-files.js +109 -0
  1027. package/dist/internal/files/types.d.ts +137 -0
  1028. package/dist/internal/files/types.js +5 -0
  1029. package/dist/internal/files/use-oc-file-open.d.ts +25 -0
  1030. package/dist/internal/files/use-oc-file-open.js +234 -0
  1031. package/dist/internal/hooks/account/use-accounts-list.d.ts +105 -0
  1032. package/dist/internal/hooks/account/use-accounts-list.js +103 -0
  1033. package/dist/internal/hooks/account/use-my-invites.d.ts +15 -0
  1034. package/dist/internal/hooks/account/use-my-invites.js +22 -0
  1035. package/dist/internal/hooks/admin/use-admin-role.d.ts +6 -0
  1036. package/dist/internal/hooks/admin/use-admin-role.js +6 -0
  1037. package/dist/internal/hooks/channels/use-channels-installations.d.ts +49 -0
  1038. package/dist/internal/hooks/channels/use-channels-installations.js +151 -0
  1039. package/dist/internal/hooks/connectors/use-add-account.d.ts +38 -0
  1040. package/dist/internal/hooks/connectors/use-add-account.js +138 -0
  1041. package/dist/internal/hooks/connectors/use-add-managed-account.d.ts +18 -0
  1042. package/dist/internal/hooks/connectors/use-add-managed-account.js +33 -0
  1043. package/dist/internal/hooks/connectors/use-connect-link.d.ts +20 -0
  1044. package/dist/internal/hooks/connectors/use-connect-link.js +115 -0
  1045. package/dist/internal/hooks/connectors/use-oauth2-return.d.ts +8 -0
  1046. package/dist/internal/hooks/connectors/use-oauth2-return.js +33 -0
  1047. package/dist/internal/hooks/connectors/use-pipedream-connect-member.d.ts +10 -0
  1048. package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +38 -0
  1049. package/dist/internal/hooks/connectors/use-pipedream-connect-project.d.ts +67 -0
  1050. package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +112 -0
  1051. package/dist/internal/hooks/connectors/use-tool-connect.d.ts +45 -0
  1052. package/dist/internal/hooks/connectors/use-tool-connect.js +50 -0
  1053. package/dist/internal/hooks/index.d.ts +7 -0
  1054. package/dist/internal/hooks/index.js +6 -0
  1055. package/dist/internal/hooks/projects/new-session-failure.d.ts +26 -0
  1056. package/dist/internal/hooks/projects/new-session-failure.js +72 -0
  1057. package/dist/internal/hooks/projects/new-session-guard.d.ts +48 -0
  1058. package/dist/internal/hooks/projects/new-session-guard.js +63 -0
  1059. package/dist/internal/hooks/projects/project-rename-cache.d.ts +42 -0
  1060. package/dist/internal/hooks/projects/project-rename-cache.js +51 -0
  1061. package/dist/internal/hooks/projects/session-reload-progress.d.ts +10 -0
  1062. package/dist/internal/hooks/projects/session-reload-progress.js +28 -0
  1063. package/dist/internal/hooks/projects/use-agent-config.d.ts +49 -0
  1064. package/dist/internal/hooks/projects/use-agent-config.js +73 -0
  1065. package/dist/internal/hooks/projects/use-new-project-session.d.ts +65 -0
  1066. package/dist/internal/hooks/projects/use-new-project-session.js +296 -0
  1067. package/dist/internal/hooks/projects/use-project-can-run.d.ts +8 -0
  1068. package/dist/internal/hooks/projects/use-project-can-run.js +46 -0
  1069. package/dist/internal/hooks/projects/use-restart-project-session.d.ts +49 -0
  1070. package/dist/internal/hooks/projects/use-restart-project-session.js +90 -0
  1071. package/dist/internal/hooks/projects/use-session-config-freshness.d.ts +106 -0
  1072. package/dist/internal/hooks/projects/use-session-config-freshness.js +291 -0
  1073. package/dist/internal/hooks/projects/use-warm-project-session.d.ts +270 -0
  1074. package/dist/internal/hooks/projects/use-warm-project-session.js +362 -0
  1075. package/dist/internal/hooks/projects/warm-session-seed.d.ts +66 -0
  1076. package/dist/internal/hooks/projects/warm-session-seed.js +80 -0
  1077. package/dist/internal/hooks/projects/warm-session-taken-registry.d.ts +61 -0
  1078. package/dist/internal/hooks/projects/warm-session-taken-registry.js +141 -0
  1079. package/dist/internal/hooks/use-auto-scroll-physics.d.ts +129 -0
  1080. package/dist/internal/hooks/use-auto-scroll-physics.js +191 -0
  1081. package/dist/internal/hooks/use-auto-scroll.d.ts +30 -0
  1082. package/dist/internal/hooks/use-auto-scroll.js +469 -0
  1083. package/dist/internal/hooks/use-bounded-runtime-wait.d.ts +4 -0
  1084. package/dist/internal/hooks/use-bounded-runtime-wait.js +20 -0
  1085. package/dist/internal/hooks/use-channel-bindings.d.ts +8 -0
  1086. package/dist/internal/hooks/use-channel-bindings.js +27 -0
  1087. package/dist/internal/hooks/use-copy.d.ts +11 -0
  1088. package/dist/internal/hooks/use-copy.js +38 -0
  1089. package/dist/internal/hooks/use-debounced-value.d.ts +2 -0
  1090. package/dist/internal/hooks/use-debounced-value.js +9 -0
  1091. package/dist/internal/hooks/use-heic-url.d.ts +9 -0
  1092. package/dist/internal/hooks/use-heic-url.js +49 -0
  1093. package/dist/internal/hooks/use-media-query.d.ts +2 -0
  1094. package/dist/internal/hooks/use-media-query.js +15 -0
  1095. package/dist/internal/hooks/use-notification-center.d.ts +43 -0
  1096. package/dist/internal/hooks/use-notification-center.js +117 -0
  1097. package/dist/internal/hooks/use-open-preview-link.d.ts +30 -0
  1098. package/dist/internal/hooks/use-open-preview-link.js +42 -0
  1099. package/dist/internal/hooks/use-opened-once.d.ts +9 -0
  1100. package/dist/internal/hooks/use-opened-once.js +15 -0
  1101. package/dist/internal/hooks/use-preview-frame-url.d.ts +13 -0
  1102. package/dist/internal/hooks/use-preview-frame-url.js +24 -0
  1103. package/dist/internal/hooks/use-review-session-summary.d.ts +59 -0
  1104. package/dist/internal/hooks/use-review-session-summary.js +95 -0
  1105. package/dist/internal/hooks/use-sandbox-proxy.d.ts +31 -0
  1106. package/dist/internal/hooks/use-sandbox-proxy.js +40 -0
  1107. package/dist/internal/hooks/use-slash-focus.d.ts +15 -0
  1108. package/dist/internal/hooks/use-slash-focus.js +44 -0
  1109. package/dist/internal/hooks/use-stable-callback.d.ts +15 -0
  1110. package/dist/internal/hooks/use-stable-callback.js +22 -0
  1111. package/dist/internal/icons/claude-code.d.ts +5 -0
  1112. package/dist/internal/icons/claude-code.js +7 -0
  1113. package/dist/internal/icons/claude.d.ts +4 -0
  1114. package/dist/internal/icons/claude.js +8 -0
  1115. package/dist/internal/icons/codex.d.ts +5 -0
  1116. package/dist/internal/icons/codex.js +14 -0
  1117. package/dist/internal/icons/cursor.d.ts +5 -0
  1118. package/dist/internal/icons/cursor.js +11 -0
  1119. package/dist/internal/icons/customize.d.ts +5 -0
  1120. package/dist/internal/icons/customize.js +6 -0
  1121. package/dist/internal/icons/download.d.ts +2 -0
  1122. package/dist/internal/icons/download.js +6 -0
  1123. package/dist/internal/icons/email.d.ts +5 -0
  1124. package/dist/internal/icons/email.js +7 -0
  1125. package/dist/internal/icons/github.d.ts +4 -0
  1126. package/dist/internal/icons/github.js +8 -0
  1127. package/dist/internal/icons/home.d.ts +5 -0
  1128. package/dist/internal/icons/home.js +7 -0
  1129. package/dist/internal/icons/kortix.d.ts +14 -0
  1130. package/dist/internal/icons/kortix.js +25 -0
  1131. package/dist/internal/icons/mcp.d.ts +9 -0
  1132. package/dist/internal/icons/mcp.js +9 -0
  1133. package/dist/internal/icons/microsoft-teams.d.ts +4 -0
  1134. package/dist/internal/icons/microsoft-teams.js +11 -0
  1135. package/dist/internal/icons/open-ai.d.ts +4 -0
  1136. package/dist/internal/icons/open-ai.js +8 -0
  1137. package/dist/internal/icons/plus.d.ts +4 -0
  1138. package/dist/internal/icons/plus.js +6 -0
  1139. package/dist/internal/icons/schedule.d.ts +5 -0
  1140. package/dist/internal/icons/schedule.js +7 -0
  1141. package/dist/internal/icons/slack.d.ts +4 -0
  1142. package/dist/internal/icons/slack.js +6 -0
  1143. package/dist/internal/icons/solid-check-icon.d.ts +2 -0
  1144. package/dist/internal/icons/solid-check-icon.js +6 -0
  1145. package/dist/internal/icons/telegram.d.ts +4 -0
  1146. package/dist/internal/icons/telegram.js +6 -0
  1147. package/dist/internal/layout/connect-mcp-modal.d.ts +35 -0
  1148. package/dist/internal/layout/connect-mcp-modal.js +78 -0
  1149. package/dist/internal/layout/files-nav-label.d.ts +14 -0
  1150. package/dist/internal/layout/files-nav-label.js +10 -0
  1151. package/dist/internal/layout/open-command-palette.d.ts +22 -0
  1152. package/dist/internal/layout/open-command-palette.js +34 -0
  1153. package/dist/internal/layout/project-nav-row.d.ts +9 -0
  1154. package/dist/internal/layout/project-nav-row.js +15 -0
  1155. package/dist/internal/layout/project-page-header.d.ts +16 -0
  1156. package/dist/internal/layout/project-page-header.js +19 -0
  1157. package/dist/internal/layout/project-settings-nav.d.ts +125 -0
  1158. package/dist/internal/layout/project-settings-nav.js +206 -0
  1159. package/dist/internal/layout/settings-nav-context.d.ts +74 -0
  1160. package/dist/internal/layout/settings-nav-context.js +58 -0
  1161. package/dist/internal/layout/sidebar-opener.d.ts +74 -0
  1162. package/dist/internal/layout/sidebar-opener.js +86 -0
  1163. package/dist/internal/layout/sidebar-toggle.d.ts +44 -0
  1164. package/dist/internal/layout/sidebar-toggle.js +56 -0
  1165. package/dist/internal/lib/account-secret-access.d.ts +42 -0
  1166. package/dist/internal/lib/account-secret-access.js +46 -0
  1167. package/dist/internal/lib/approval-expired.d.ts +3 -0
  1168. package/dist/internal/lib/approval-expired.js +4 -0
  1169. package/dist/internal/lib/attachment-mime.d.ts +30 -0
  1170. package/dist/internal/lib/attachment-mime.js +123 -0
  1171. package/dist/internal/lib/billing/billing-gate-state.d.ts +126 -0
  1172. package/dist/internal/lib/billing/billing-gate-state.js +217 -0
  1173. package/dist/internal/lib/browser-error-noise.d.ts +23 -0
  1174. package/dist/internal/lib/browser-error-noise.js +68 -0
  1175. package/dist/internal/lib/browser-noise/evidence.d.ts +73 -0
  1176. package/dist/internal/lib/browser-noise/evidence.js +101 -0
  1177. package/dist/internal/lib/browser-noise/rules/chunk-load.d.ts +37 -0
  1178. package/dist/internal/lib/browser-noise/rules/chunk-load.js +158 -0
  1179. package/dist/internal/lib/browser-noise/rules/expected-states.d.ts +85 -0
  1180. package/dist/internal/lib/browser-noise/rules/expected-states.js +390 -0
  1181. package/dist/internal/lib/browser-noise/rules/extensions.d.ts +196 -0
  1182. package/dist/internal/lib/browser-noise/rules/extensions.js +722 -0
  1183. package/dist/internal/lib/browser-noise/rules/graphics.d.ts +142 -0
  1184. package/dist/internal/lib/browser-noise/rules/graphics.js +606 -0
  1185. package/dist/internal/lib/browser-noise/rules/injected-scripts.d.ts +80 -0
  1186. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +229 -0
  1187. package/dist/internal/lib/browser-noise/rules/messages.d.ts +5 -0
  1188. package/dist/internal/lib/browser-noise/rules/messages.js +81 -0
  1189. package/dist/internal/lib/browser-noise/rules/network.d.ts +117 -0
  1190. package/dist/internal/lib/browser-noise/rules/network.js +441 -0
  1191. package/dist/internal/lib/browser-noise/rules/old-browsers.d.ts +216 -0
  1192. package/dist/internal/lib/browser-noise/rules/old-browsers.js +684 -0
  1193. package/dist/internal/lib/browser-noise/rules/pdf.d.ts +60 -0
  1194. package/dist/internal/lib/browser-noise/rules/pdf.js +184 -0
  1195. package/dist/internal/lib/browser-noise/rules/react.d.ts +99 -0
  1196. package/dist/internal/lib/browser-noise/rules/react.js +504 -0
  1197. package/dist/internal/lib/browser-noise/rules/rejections.d.ts +140 -0
  1198. package/dist/internal/lib/browser-noise/rules/rejections.js +543 -0
  1199. package/dist/internal/lib/browser-noise/rules/storage.d.ts +65 -0
  1200. package/dist/internal/lib/browser-noise/rules/storage.js +190 -0
  1201. package/dist/internal/lib/browser-noise/rules/webview.d.ts +103 -0
  1202. package/dist/internal/lib/browser-noise/rules/webview.js +392 -0
  1203. package/dist/internal/lib/capability-tab-routes.d.ts +160 -0
  1204. package/dist/internal/lib/capability-tab-routes.js +176 -0
  1205. package/dist/internal/lib/chunk-load-recovery.d.ts +46 -0
  1206. package/dist/internal/lib/chunk-load-recovery.js +107 -0
  1207. package/dist/internal/lib/chunk-reload.d.ts +31 -0
  1208. package/dist/internal/lib/chunk-reload.js +59 -0
  1209. package/dist/internal/lib/code-theme.d.ts +22 -0
  1210. package/dist/internal/lib/code-theme.js +16 -0
  1211. package/dist/internal/lib/codemirror-pierre-theme.d.ts +3 -0
  1212. package/dist/internal/lib/codemirror-pierre-theme.js +138 -0
  1213. package/dist/internal/lib/delivered-but-disconnected.d.ts +4 -0
  1214. package/dist/internal/lib/delivered-but-disconnected.js +106 -0
  1215. package/dist/internal/lib/desktop-detect.d.ts +17 -0
  1216. package/dist/internal/lib/desktop-detect.js +36 -0
  1217. package/dist/internal/lib/desktop.d.ts +237 -0
  1218. package/dist/internal/lib/desktop.js +356 -0
  1219. package/dist/internal/lib/error-handler.d.ts +25 -0
  1220. package/dist/internal/lib/error-handler.js +327 -0
  1221. package/dist/internal/lib/github-installations.d.ts +47 -0
  1222. package/dist/internal/lib/github-installations.js +54 -0
  1223. package/dist/internal/lib/github-user-proof.d.ts +3 -0
  1224. package/dist/internal/lib/github-user-proof.js +38 -0
  1225. package/dist/internal/lib/interface-theme-defaults.d.ts +6 -0
  1226. package/dist/internal/lib/interface-theme-defaults.js +2 -0
  1227. package/dist/internal/lib/kortix-cli.d.ts +12 -0
  1228. package/dist/internal/lib/kortix-cli.js +31 -0
  1229. package/dist/internal/lib/llm-providers.d.ts +185 -0
  1230. package/dist/internal/lib/llm-providers.js +197 -0
  1231. package/dist/internal/lib/logger.d.ts +29 -0
  1232. package/dist/internal/lib/logger.js +36 -0
  1233. package/dist/internal/lib/manifest-version.d.ts +21 -0
  1234. package/dist/internal/lib/manifest-version.js +55 -0
  1235. package/dist/internal/lib/mermaid-utils.d.ts +22 -0
  1236. package/dist/internal/lib/mermaid-utils.js +85 -0
  1237. package/dist/internal/lib/mobile-store-urls.d.ts +9 -0
  1238. package/dist/internal/lib/mobile-store-urls.js +8 -0
  1239. package/dist/internal/lib/model-pricing.d.ts +33 -0
  1240. package/dist/internal/lib/model-pricing.js +107 -0
  1241. package/dist/internal/lib/navigation/modified-click.d.ts +15 -0
  1242. package/dist/internal/lib/navigation/modified-click.js +21 -0
  1243. package/dist/internal/lib/navigation/router-bridge.d.ts +20 -0
  1244. package/dist/internal/lib/navigation/router-bridge.js +60 -0
  1245. package/dist/internal/lib/navigation/session-href.d.ts +24 -0
  1246. package/dist/internal/lib/navigation/session-href.js +31 -0
  1247. package/dist/internal/lib/object-url-cache.d.ts +30 -0
  1248. package/dist/internal/lib/object-url-cache.js +72 -0
  1249. package/dist/internal/lib/onboarding/landing-destination.d.ts +111 -0
  1250. package/dist/internal/lib/onboarding/landing-destination.js +155 -0
  1251. package/dist/internal/lib/onboarding/last-project-cookie.d.ts +44 -0
  1252. package/dist/internal/lib/onboarding/last-project-cookie.js +77 -0
  1253. package/dist/internal/lib/onboarding/provision-errors.d.ts +29 -0
  1254. package/dist/internal/lib/onboarding/provision-errors.js +47 -0
  1255. package/dist/internal/lib/onboarding/use-app-home.d.ts +17 -0
  1256. package/dist/internal/lib/onboarding/use-app-home.js +22 -0
  1257. package/dist/internal/lib/project-actions.d.ts +75 -0
  1258. package/dist/internal/lib/project-actions.js +133 -0
  1259. package/dist/internal/lib/project-preamble.d.ts +71 -0
  1260. package/dist/internal/lib/project-preamble.js +112 -0
  1261. package/dist/internal/lib/promo-art.d.ts +9 -0
  1262. package/dist/internal/lib/promo-art.js +9 -0
  1263. package/dist/internal/lib/provider-branding.d.ts +26 -0
  1264. package/dist/internal/lib/provider-branding.js +186 -0
  1265. package/dist/internal/lib/query-client-singleton.d.ts +9 -0
  1266. package/dist/internal/lib/query-client-singleton.js +34 -0
  1267. package/dist/internal/lib/relative-time.d.ts +22 -0
  1268. package/dist/internal/lib/relative-time.js +48 -0
  1269. package/dist/internal/lib/safe-url.d.ts +2 -0
  1270. package/dist/internal/lib/safe-url.js +7 -0
  1271. package/dist/internal/lib/sandbox-providers.d.ts +11 -0
  1272. package/dist/internal/lib/sandbox-providers.js +27 -0
  1273. package/dist/internal/lib/security/iframe-sandbox.d.ts +15 -0
  1274. package/dist/internal/lib/security/iframe-sandbox.js +26 -0
  1275. package/dist/internal/lib/security/privileged-frame-origins.d.ts +10 -0
  1276. package/dist/internal/lib/security/privileged-frame-origins.js +22 -0
  1277. package/dist/internal/lib/settings-tab-id.d.ts +3 -0
  1278. package/dist/internal/lib/settings-tab-id.js +1 -0
  1279. package/dist/internal/lib/shaders-react.d.ts +2 -0
  1280. package/dist/internal/lib/shaders-react.js +1 -0
  1281. package/dist/internal/lib/site-metadata.d.ts +17 -0
  1282. package/dist/internal/lib/site-metadata.js +16 -0
  1283. package/dist/internal/lib/sounds.d.ts +37 -0
  1284. package/dist/internal/lib/sounds.js +131 -0
  1285. package/dist/internal/lib/storage/managed-storage.d.ts +2 -0
  1286. package/dist/internal/lib/storage/managed-storage.js +5 -0
  1287. package/dist/internal/lib/timeout-toast-policy.d.ts +5 -0
  1288. package/dist/internal/lib/timeout-toast-policy.js +14 -0
  1289. package/dist/internal/lib/trigger-clock.d.ts +42 -0
  1290. package/dist/internal/lib/trigger-clock.js +34 -0
  1291. package/dist/internal/lib/turn-broadcast.d.ts +47 -0
  1292. package/dist/internal/lib/turn-broadcast.js +90 -0
  1293. package/dist/internal/lib/use-deployment-cli-install-command.d.ts +7 -0
  1294. package/dist/internal/lib/use-deployment-cli-install-command.js +15 -0
  1295. package/dist/internal/lib/use-permission.d.ts +23 -0
  1296. package/dist/internal/lib/use-permission.js +79 -0
  1297. package/dist/internal/lib/use-project-can.d.ts +37 -0
  1298. package/dist/internal/lib/use-project-can.js +64 -0
  1299. package/dist/internal/lib/use-project-feature-flags.d.ts +26 -0
  1300. package/dist/internal/lib/use-project-feature-flags.js +72 -0
  1301. package/dist/internal/lib/utils/app-access-token.d.ts +10 -0
  1302. package/dist/internal/lib/utils/app-access-token.js +20 -0
  1303. package/dist/internal/lib/utils/clipboard.d.ts +7 -0
  1304. package/dist/internal/lib/utils/clipboard.js +19 -0
  1305. package/dist/internal/lib/utils/download.d.ts +2 -0
  1306. package/dist/internal/lib/utils/download.js +11 -0
  1307. package/dist/internal/lib/utils/file-utils.d.ts +44 -0
  1308. package/dist/internal/lib/utils/file-utils.js +287 -0
  1309. package/dist/internal/lib/utils/focus-without-scroll.d.ts +19 -0
  1310. package/dist/internal/lib/utils/focus-without-scroll.js +18 -0
  1311. package/dist/internal/lib/utils/heic-convert.d.ts +7 -0
  1312. package/dist/internal/lib/utils/heic-convert.js +13 -0
  1313. package/dist/internal/lib/utils/kortix-system-tags.d.ts +45 -0
  1314. package/dist/internal/lib/utils/kortix-system-tags.js +222 -0
  1315. package/dist/internal/lib/utils/kortix-tool-output.d.ts +58 -0
  1316. package/dist/internal/lib/utils/kortix-tool-output.js +148 -0
  1317. package/dist/internal/lib/utils/path-detection.d.ts +43 -0
  1318. package/dist/internal/lib/utils/path-detection.js +339 -0
  1319. package/dist/internal/lib/utils/random-uuid.d.ts +9 -0
  1320. package/dist/internal/lib/utils/random-uuid.js +16 -0
  1321. package/dist/internal/lib/utils/safe-scroll-to.d.ts +20 -0
  1322. package/dist/internal/lib/utils/safe-scroll-to.js +21 -0
  1323. package/dist/internal/lib/utils/sandbox-proxy.d.ts +8 -0
  1324. package/dist/internal/lib/utils/sandbox-proxy.js +15 -0
  1325. package/dist/internal/lib/utils/session-context.d.ts +25 -0
  1326. package/dist/internal/lib/utils/session-context.js +42 -0
  1327. package/dist/internal/lib/utils/strip-html-tags.d.ts +6 -0
  1328. package/dist/internal/lib/utils/strip-html-tags.js +13 -0
  1329. package/dist/internal/lib/utils/structured-output.d.ts +51 -0
  1330. package/dist/internal/lib/utils/structured-output.js +178 -0
  1331. package/dist/internal/lib/utils/time-budget.d.ts +37 -0
  1332. package/dist/internal/lib/utils/time-budget.js +37 -0
  1333. package/dist/internal/lib/utils.d.ts +8 -0
  1334. package/dist/internal/lib/utils.js +58 -0
  1335. package/dist/internal/lib/web-notifications.d.ts +127 -0
  1336. package/dist/internal/lib/web-notifications.js +703 -0
  1337. package/dist/internal/notifications/notification-bell.d.ts +46 -0
  1338. package/dist/internal/notifications/notification-bell.js +135 -0
  1339. package/dist/internal/notifications/notification-rows.d.ts +86 -0
  1340. package/dist/internal/notifications/notification-rows.js +128 -0
  1341. package/dist/internal/notifications/session-toast-cards.d.ts +26 -0
  1342. package/dist/internal/notifications/session-toast-cards.js +32 -0
  1343. package/dist/internal/notifications/web-push.d.ts +63 -0
  1344. package/dist/internal/notifications/web-push.js +193 -0
  1345. package/dist/internal/outcomes/outcome-card.d.ts +81 -0
  1346. package/dist/internal/outcomes/outcome-card.js +54 -0
  1347. package/dist/internal/outcomes/outcome-types.d.ts +77 -0
  1348. package/dist/internal/outcomes/outcome-types.js +15 -0
  1349. package/dist/internal/outcomes/outcome-vocabulary.d.ts +95 -0
  1350. package/dist/internal/outcomes/outcome-vocabulary.js +99 -0
  1351. package/dist/internal/project-scope.d.ts +13 -0
  1352. package/dist/internal/project-scope.js +15 -0
  1353. package/dist/internal/reminders/reminder-filter.d.ts +12 -0
  1354. package/dist/internal/reminders/reminder-filter.js +34 -0
  1355. package/dist/internal/reminders/reminder-format.d.ts +26 -0
  1356. package/dist/internal/reminders/reminder-format.js +90 -0
  1357. package/dist/internal/reminders/use-refetch-after-fire.d.ts +10 -0
  1358. package/dist/internal/reminders/use-refetch-after-fire.js +30 -0
  1359. package/dist/internal/selection/selection-bar.d.ts +31 -0
  1360. package/dist/internal/selection/selection-bar.js +45 -0
  1361. package/dist/internal/selection/selection.d.ts +9 -0
  1362. package/dist/internal/selection/selection.js +25 -0
  1363. package/dist/internal/session-types/index.d.ts +30 -0
  1364. package/dist/internal/session-types/index.js +28 -0
  1365. package/dist/internal/session-types/types.d.ts +78 -0
  1366. package/dist/internal/session-types/types.js +20 -0
  1367. package/dist/internal/share/public-share-link-button.d.ts +14 -0
  1368. package/dist/internal/share/public-share-link-button.js +17 -0
  1369. package/dist/internal/share/public-share-link-confirm.d.ts +15 -0
  1370. package/dist/internal/share/public-share-link-confirm.js +13 -0
  1371. package/dist/internal/share/session-shares-modal.d.ts +7 -0
  1372. package/dist/internal/share/session-shares-modal.js +59 -0
  1373. package/dist/internal/share/use-public-share-link.d.ts +39 -0
  1374. package/dist/internal/share/use-public-share-link.js +110 -0
  1375. package/dist/internal/share/use-session-public-shares.d.ts +60 -0
  1376. package/dist/internal/share/use-session-public-shares.js +140 -0
  1377. package/dist/internal/stores/account-panel-store.d.ts +94 -0
  1378. package/dist/internal/stores/account-panel-store.js +183 -0
  1379. package/dist/internal/stores/account-settings-modal-store.d.ts +41 -0
  1380. package/dist/internal/stores/account-settings-modal-store.js +33 -0
  1381. package/dist/internal/stores/billing-account-context.d.ts +16 -0
  1382. package/dist/internal/stores/billing-account-context.js +20 -0
  1383. package/dist/internal/stores/browser-recents-store.d.ts +36 -0
  1384. package/dist/internal/stores/browser-recents-store.js +50 -0
  1385. package/dist/internal/stores/chat-send-store.d.ts +34 -0
  1386. package/dist/internal/stores/chat-send-store.js +22 -0
  1387. package/dist/internal/stores/composer-prefill-store.d.ts +37 -0
  1388. package/dist/internal/stores/composer-prefill-store.js +27 -0
  1389. package/dist/internal/stores/connector-gate-store.d.ts +27 -0
  1390. package/dist/internal/stores/connector-gate-store.js +9 -0
  1391. package/dist/internal/stores/current-account-store.d.ts +28 -0
  1392. package/dist/internal/stores/current-account-store.js +12 -0
  1393. package/dist/internal/stores/diagnostics-store.d.ts +2 -0
  1394. package/dist/internal/stores/diagnostics-store.js +5 -0
  1395. package/dist/internal/stores/file-preview-store.d.ts +15 -0
  1396. package/dist/internal/stores/file-preview-store.js +24 -0
  1397. package/dist/internal/stores/files-store.d.ts +155 -0
  1398. package/dist/internal/stores/files-store.js +316 -0
  1399. package/dist/internal/stores/first-chat-store.d.ts +23 -0
  1400. package/dist/internal/stores/first-chat-store.js +53 -0
  1401. package/dist/internal/stores/kortix-computer-store.d.ts +230 -0
  1402. package/dist/internal/stores/kortix-computer-store.js +437 -0
  1403. package/dist/internal/stores/message-jump-store.d.ts +8 -0
  1404. package/dist/internal/stores/message-jump-store.js +6 -0
  1405. package/dist/internal/stores/mobile-app-promo-store.d.ts +19 -0
  1406. package/dist/internal/stores/mobile-app-promo-store.js +28 -0
  1407. package/dist/internal/stores/onboarding-mode-store.d.ts +34 -0
  1408. package/dist/internal/stores/onboarding-mode-store.js +20 -0
  1409. package/dist/internal/stores/panel-fallback-store.d.ts +32 -0
  1410. package/dist/internal/stores/panel-fallback-store.js +21 -0
  1411. package/dist/internal/stores/persisted-store-registry.d.ts +58 -0
  1412. package/dist/internal/stores/persisted-store-registry.js +57 -0
  1413. package/dist/internal/stores/project-switch-store.d.ts +49 -0
  1414. package/dist/internal/stores/project-switch-store.js +39 -0
  1415. package/dist/internal/stores/provider-modal-store.d.ts +10 -0
  1416. package/dist/internal/stores/provider-modal-store.js +7 -0
  1417. package/dist/internal/stores/session-browser-store.d.ts +111 -0
  1418. package/dist/internal/stores/session-browser-store.js +115 -0
  1419. package/dist/internal/stores/session-expanded-store.d.ts +21 -0
  1420. package/dist/internal/stores/session-expanded-store.js +42 -0
  1421. package/dist/internal/stores/session-filter-store.d.ts +91 -0
  1422. package/dist/internal/stores/session-filter-store.js +192 -0
  1423. package/dist/internal/stores/session-history-view-store.d.ts +23 -0
  1424. package/dist/internal/stores/session-history-view-store.js +43 -0
  1425. package/dist/internal/stores/session-hover-store.d.ts +64 -0
  1426. package/dist/internal/stores/session-hover-store.js +109 -0
  1427. package/dist/internal/stores/session-panel-memory-store.d.ts +57 -0
  1428. package/dist/internal/stores/session-panel-memory-store.js +76 -0
  1429. package/dist/internal/stores/session-switch-store.d.ts +24 -0
  1430. package/dist/internal/stores/session-switch-store.js +25 -0
  1431. package/dist/internal/stores/settings-panel-store.d.ts +38 -0
  1432. package/dist/internal/stores/settings-panel-store.js +35 -0
  1433. package/dist/internal/stores/sidebar-nav-store.d.ts +78 -0
  1434. package/dist/internal/stores/sidebar-nav-store.js +121 -0
  1435. package/dist/internal/stores/sound-store.d.ts +51 -0
  1436. package/dist/internal/stores/sound-store.js +42 -0
  1437. package/dist/internal/stores/subscription-store.d.ts +36 -0
  1438. package/dist/internal/stores/subscription-store.js +57 -0
  1439. package/dist/internal/stores/tab-store.d.ts +79 -0
  1440. package/dist/internal/stores/tab-store.js +222 -0
  1441. package/dist/internal/stores/turn-attention-store.d.ts +20 -0
  1442. package/dist/internal/stores/turn-attention-store.js +12 -0
  1443. package/dist/internal/stores/upgrade-dialog-store.d.ts +34 -0
  1444. package/dist/internal/stores/upgrade-dialog-store.js +20 -0
  1445. package/dist/internal/stores/user-preferences-store.d.ts +80 -0
  1446. package/dist/internal/stores/user-preferences-store.js +63 -0
  1447. package/dist/internal/stores/web-notification-store.d.ts +50 -0
  1448. package/dist/internal/stores/web-notification-store.js +76 -0
  1449. package/dist/internal/tunnel/computer-connect.d.ts +175 -0
  1450. package/dist/internal/tunnel/computer-connect.js +355 -0
  1451. package/dist/internal/tunnel/tunnel-connect-command.d.ts +23 -0
  1452. package/dist/internal/tunnel/tunnel-connect-command.js +23 -0
  1453. package/dist/lib/dotmatrix-core.d.ts +1 -2
  1454. package/dist/lib/dotmatrix-core.js +2 -3
  1455. package/dist/lib/host-env.d.ts +22 -0
  1456. package/dist/lib/host-env.js +9 -0
  1457. package/dist/lib/icon-config.d.ts +1 -1
  1458. package/dist/lib/lazy-client.d.ts +10 -0
  1459. package/dist/lib/lazy-client.js +20 -0
  1460. package/dist/lib/portal-container.d.ts +12 -0
  1461. package/dist/lib/portal-container.js +23 -0
  1462. package/dist/lib/routes.d.ts +52 -0
  1463. package/dist/lib/routes.js +54 -0
  1464. package/dist/lib/telemetry.d.ts +44 -0
  1465. package/dist/lib/telemetry.js +24 -0
  1466. package/dist/lib/utils.d.ts +1 -0
  1467. package/dist/lib/utils.js +8 -1
  1468. package/dist/markdown/code/children-text.d.ts +15 -0
  1469. package/dist/markdown/code/children-text.js +29 -0
  1470. package/dist/markdown/code/code-block.d.ts +33 -0
  1471. package/dist/markdown/code/code-block.js +88 -0
  1472. package/dist/markdown/code/copy-overlay.d.ts +6 -0
  1473. package/dist/markdown/code/copy-overlay.js +15 -0
  1474. package/dist/markdown/code/genui-fence.d.ts +35 -0
  1475. package/dist/markdown/code/genui-fence.js +81 -0
  1476. package/dist/markdown/code/index.d.ts +6 -0
  1477. package/dist/markdown/code/index.js +18 -0
  1478. package/dist/markdown/code/inline-chip.d.ts +42 -0
  1479. package/dist/markdown/code/inline-chip.js +108 -0
  1480. package/dist/markdown/code/inline-code.d.ts +6 -0
  1481. package/dist/markdown/code/inline-code.js +150 -0
  1482. package/dist/markdown/code/inside-link-context.d.ts +15 -0
  1483. package/dist/markdown/code/inside-link-context.js +17 -0
  1484. package/dist/markdown/code/markdown-code.d.ts +41 -0
  1485. package/dist/markdown/code/markdown-code.js +92 -0
  1486. package/dist/markdown/code/shiki-highlighter.d.ts +45 -0
  1487. package/dist/markdown/code/shiki-highlighter.js +261 -0
  1488. package/dist/markdown/copy-button.d.ts +8 -0
  1489. package/dist/markdown/copy-button.js +51 -0
  1490. package/dist/markdown/file-links.d.ts +13 -0
  1491. package/dist/markdown/file-links.js +93 -0
  1492. package/dist/markdown/genui/block-telemetry.d.ts +21 -0
  1493. package/dist/markdown/genui/block-telemetry.js +39 -0
  1494. package/dist/markdown/genui/components/charts.d.ts +7 -0
  1495. package/dist/markdown/genui/components/charts.js +185 -0
  1496. package/dist/markdown/genui/components/data.d.ts +15 -0
  1497. package/dist/markdown/genui/components/data.js +110 -0
  1498. package/dist/markdown/genui/components/index.d.ts +4 -0
  1499. package/dist/markdown/genui/components/index.js +38 -0
  1500. package/dist/markdown/genui/components/inline.d.ts +17 -0
  1501. package/dist/markdown/genui/components/inline.js +53 -0
  1502. package/dist/markdown/genui/components/layout.d.ts +6 -0
  1503. package/dist/markdown/genui/components/layout.js +180 -0
  1504. package/dist/markdown/genui/components/map-canvas.d.ts +35 -0
  1505. package/dist/markdown/genui/components/map-canvas.js +109 -0
  1506. package/dist/markdown/genui/components/map-geo.d.ts +45 -0
  1507. package/dist/markdown/genui/components/map-geo.js +52 -0
  1508. package/dist/markdown/genui/components/map.d.ts +6 -0
  1509. package/dist/markdown/genui/components/map.js +77 -0
  1510. package/dist/markdown/genui/components/pending.d.ts +19 -0
  1511. package/dist/markdown/genui/components/pending.js +38 -0
  1512. package/dist/markdown/genui/genui-message-block.d.ts +12 -0
  1513. package/dist/markdown/genui/genui-message-block.js +18 -0
  1514. package/dist/markdown/genui/index.d.ts +11 -0
  1515. package/dist/markdown/genui/index.js +11 -0
  1516. package/dist/markdown/genui/sdk.d.ts +10 -0
  1517. package/dist/markdown/genui/sdk.js +9 -0
  1518. package/dist/markdown/genui/to-markdown.d.ts +46 -0
  1519. package/dist/markdown/genui/to-markdown.js +86 -0
  1520. package/dist/markdown/genui/use-genui-enabled.d.ts +4 -0
  1521. package/dist/markdown/genui/use-genui-enabled.js +10 -0
  1522. package/dist/markdown/index.d.ts +16 -0
  1523. package/dist/markdown/index.js +14 -0
  1524. package/dist/markdown/katex-block.d.ts +4 -0
  1525. package/dist/markdown/katex-block.js +25 -0
  1526. package/dist/markdown/katex-markdown.d.ts +24 -0
  1527. package/dist/markdown/katex-markdown.js +163 -0
  1528. package/dist/markdown/markdown-frontmatter.d.ts +31 -0
  1529. package/dist/markdown/markdown-frontmatter.js +118 -0
  1530. package/dist/markdown/markdown-policy.d.ts +48 -0
  1531. package/dist/markdown/markdown-policy.js +31 -0
  1532. package/dist/markdown/ordered-list.d.ts +31 -0
  1533. package/dist/markdown/ordered-list.js +40 -0
  1534. package/dist/markdown/setup-link-blocks.d.ts +32 -0
  1535. package/dist/markdown/setup-link-blocks.js +114 -0
  1536. package/dist/markdown/setup-links/api-base.d.ts +2 -0
  1537. package/dist/markdown/setup-links/api-base.js +5 -0
  1538. package/dist/markdown/setup-links/approval-decision.d.ts +72 -0
  1539. package/dist/markdown/setup-links/approval-decision.js +322 -0
  1540. package/dist/markdown/setup-links/connector-handshake.d.ts +60 -0
  1541. package/dist/markdown/setup-links/connector-handshake.js +71 -0
  1542. package/dist/markdown/setup-links/connector-link-info.d.ts +3 -0
  1543. package/dist/markdown/setup-links/connector-link-info.js +15 -0
  1544. package/dist/markdown/setup-links/secret-intake-form.d.ts +14 -0
  1545. package/dist/markdown/setup-links/secret-intake-form.js +168 -0
  1546. package/dist/markdown/setup-links/setup-link-button.d.ts +26 -0
  1547. package/dist/markdown/setup-links/setup-link-button.js +150 -0
  1548. package/dist/markdown/setup-links/setup-link-close-finalize.d.ts +23 -0
  1549. package/dist/markdown/setup-links/setup-link-close-finalize.js +33 -0
  1550. package/dist/markdown/setup-links/util.d.ts +80 -0
  1551. package/dist/markdown/setup-links/util.js +220 -0
  1552. package/dist/markdown/stream-words.d.ts +68 -0
  1553. package/dist/markdown/stream-words.js +113 -0
  1554. package/dist/markdown/unified-markdown-utils.d.ts +68 -0
  1555. package/dist/markdown/unified-markdown-utils.js +151 -0
  1556. package/dist/markdown/unified-markdown.d.ts +46 -0
  1557. package/dist/markdown/unified-markdown.js +293 -0
  1558. package/dist/primitives/accordion.js +18 -0
  1559. package/dist/primitives/alert-dialog.js +50 -0
  1560. package/dist/primitives/alert.d.ts +13 -0
  1561. package/dist/primitives/alert.js +67 -0
  1562. package/dist/primitives/avatar.js +23 -0
  1563. package/dist/primitives/back-pill.js +18 -0
  1564. package/dist/primitives/badge.d.ts +10 -0
  1565. package/dist/primitives/badge.js +42 -0
  1566. package/dist/primitives/breadcrumb.js +28 -0
  1567. package/dist/primitives/bubble.d.ts +20 -0
  1568. package/dist/primitives/bubble.js +38 -0
  1569. package/dist/primitives/button-group.js +32 -0
  1570. package/dist/primitives/button.d.ts +13 -0
  1571. package/dist/primitives/button.js +67 -0
  1572. package/dist/primitives/calendar.js +39 -0
  1573. package/dist/primitives/card.d.ts +96 -0
  1574. package/dist/primitives/card.js +291 -0
  1575. package/dist/primitives/chain-of-thought.js +66 -0
  1576. package/dist/primitives/chart.js +118 -0
  1577. package/dist/primitives/checkbox-group.js +41 -0
  1578. package/dist/primitives/checkbox.js +27 -0
  1579. package/dist/primitives/collapsible.js +14 -0
  1580. package/dist/primitives/command.js +135 -0
  1581. package/dist/primitives/confirm-dialog.js +30 -0
  1582. package/dist/primitives/context-menu.d.ts +48 -0
  1583. package/dist/primitives/context-menu.js +94 -0
  1584. package/dist/primitives/count-badge.d.ts +28 -0
  1585. package/dist/primitives/count-badge.js +26 -0
  1586. package/dist/primitives/data-grid.js +107 -0
  1587. package/dist/primitives/date-range-picker.js +190 -0
  1588. package/dist/primitives/definition-list.js +26 -0
  1589. package/dist/primitives/dialog.d.ts +32 -0
  1590. package/dist/primitives/dialog.js +54 -0
  1591. package/dist/primitives/disclosure.js +138 -0
  1592. package/dist/primitives/dot-matrix/dotm-3x3-10.d.ts +4 -0
  1593. package/dist/primitives/dot-matrix/dotm-3x3-10.js +29 -0
  1594. package/dist/primitives/dot-matrix/dotm-3x3-12.d.ts +4 -0
  1595. package/dist/primitives/dot-matrix/dotm-3x3-12.js +19 -0
  1596. package/dist/primitives/dot-matrix/dotm-3x3-13.d.ts +4 -0
  1597. package/dist/primitives/dot-matrix/dotm-3x3-13.js +19 -0
  1598. package/dist/primitives/dot-matrix/dotm-3x3-15.d.ts +4 -0
  1599. package/dist/primitives/dot-matrix/dotm-3x3-15.js +22 -0
  1600. package/dist/primitives/dot-matrix/dotm-3x3-16.d.ts +4 -0
  1601. package/dist/primitives/dot-matrix/dotm-3x3-16.js +5 -0
  1602. package/dist/primitives/dot-matrix/dotm-3x3-18.d.ts +4 -0
  1603. package/dist/primitives/dot-matrix/dotm-3x3-18.js +5 -0
  1604. package/dist/primitives/dot-matrix/dotm-3x3-19.d.ts +4 -0
  1605. package/dist/primitives/dot-matrix/dotm-3x3-19.js +5 -0
  1606. package/dist/primitives/dot-matrix/dotm-3x3-2.d.ts +4 -0
  1607. package/dist/primitives/dot-matrix/dotm-3x3-2.js +3 -0
  1608. package/dist/primitives/dot-matrix/dotm-3x3-20.d.ts +4 -0
  1609. package/dist/primitives/dot-matrix/dotm-3x3-20.js +5 -0
  1610. package/dist/primitives/dot-matrix/dotm-3x3-21.d.ts +4 -0
  1611. package/dist/primitives/dot-matrix/dotm-3x3-21.js +5 -0
  1612. package/dist/primitives/dot-matrix/dotm-3x3-3.d.ts +4 -0
  1613. package/dist/primitives/dot-matrix/dotm-3x3-3.js +3 -0
  1614. package/dist/primitives/dot-matrix/dotm-3x3-4.d.ts +4 -0
  1615. package/dist/primitives/dot-matrix/dotm-3x3-4.js +3 -0
  1616. package/dist/primitives/dot-matrix/dotm-3x3-5.d.ts +4 -0
  1617. package/dist/primitives/dot-matrix/dotm-3x3-5.js +3 -0
  1618. package/dist/primitives/dot-matrix/dotm-3x3-6.d.ts +4 -0
  1619. package/dist/primitives/dot-matrix/dotm-3x3-6.js +19 -0
  1620. package/dist/primitives/dot-matrix/dotm-3x3-7.d.ts +4 -0
  1621. package/dist/primitives/dot-matrix/dotm-3x3-7.js +19 -0
  1622. package/dist/primitives/dot-matrix/dotm-3x3-8.d.ts +4 -0
  1623. package/dist/primitives/dot-matrix/dotm-3x3-8.js +19 -0
  1624. package/dist/primitives/dot-matrix/dotm-3x3-9.d.ts +4 -0
  1625. package/dist/primitives/dot-matrix/dotm-3x3-9.js +23 -0
  1626. package/dist/primitives/dot-matrix/dotm-circular-1.d.ts +4 -0
  1627. package/dist/primitives/dot-matrix/dotm-circular-1.js +28 -0
  1628. package/dist/primitives/dot-matrix/dotm-circular-10.d.ts +4 -0
  1629. package/dist/primitives/dot-matrix/dotm-circular-10.js +40 -0
  1630. package/dist/primitives/dot-matrix/dotm-circular-11.d.ts +4 -0
  1631. package/dist/primitives/dot-matrix/dotm-circular-11.js +37 -0
  1632. package/dist/primitives/dot-matrix/dotm-circular-12.d.ts +4 -0
  1633. package/dist/primitives/dot-matrix/dotm-circular-12.js +42 -0
  1634. package/dist/primitives/dot-matrix/dotm-circular-14.d.ts +4 -0
  1635. package/dist/primitives/dot-matrix/dotm-circular-14.js +37 -0
  1636. package/dist/primitives/dot-matrix/dotm-circular-15.d.ts +4 -0
  1637. package/dist/primitives/dot-matrix/dotm-circular-15.js +49 -0
  1638. package/dist/primitives/dot-matrix/dotm-circular-17.d.ts +4 -0
  1639. package/dist/primitives/dot-matrix/dotm-circular-17.js +31 -0
  1640. package/dist/primitives/dot-matrix/dotm-circular-2.d.ts +4 -0
  1641. package/dist/primitives/dot-matrix/dotm-circular-2.js +37 -0
  1642. package/dist/primitives/dot-matrix/dotm-circular-3.d.ts +4 -0
  1643. package/dist/primitives/dot-matrix/dotm-circular-3.js +54 -0
  1644. package/dist/primitives/dot-matrix/dotm-circular-4.d.ts +4 -0
  1645. package/dist/primitives/dot-matrix/dotm-circular-4.js +35 -0
  1646. package/dist/primitives/dot-matrix/dotm-circular-5.d.ts +4 -0
  1647. package/dist/primitives/dot-matrix/dotm-circular-5.js +30 -0
  1648. package/dist/primitives/dot-matrix/dotm-circular-6.d.ts +4 -0
  1649. package/dist/primitives/dot-matrix/dotm-circular-6.js +37 -0
  1650. package/dist/primitives/dot-matrix/dotm-circular-7.d.ts +4 -0
  1651. package/dist/primitives/dot-matrix/dotm-circular-7.js +25 -0
  1652. package/dist/primitives/dot-matrix/dotm-circular-8.d.ts +4 -0
  1653. package/dist/primitives/dot-matrix/dotm-circular-8.js +26 -0
  1654. package/dist/primitives/dot-matrix/dotm-circular-9.d.ts +4 -0
  1655. package/dist/primitives/dot-matrix/dotm-circular-9.js +41 -0
  1656. package/dist/primitives/dot-matrix/dotm-square-1.d.ts +4 -0
  1657. package/dist/primitives/dot-matrix/dotm-square-1.js +27 -0
  1658. package/dist/primitives/dot-matrix/dotm-square-10.d.ts +4 -0
  1659. package/dist/primitives/dot-matrix/dotm-square-10.js +27 -0
  1660. package/dist/primitives/dot-matrix/dotm-square-11.d.ts +4 -0
  1661. package/dist/primitives/dot-matrix/dotm-square-11.js +25 -0
  1662. package/dist/primitives/dot-matrix/dotm-square-12.d.ts +4 -0
  1663. package/dist/primitives/dot-matrix/dotm-square-12.js +28 -0
  1664. package/dist/primitives/dot-matrix/dotm-square-13.d.ts +4 -0
  1665. package/dist/primitives/dot-matrix/dotm-square-13.js +45 -0
  1666. package/dist/primitives/dot-matrix/dotm-square-14.d.ts +4 -0
  1667. package/dist/primitives/dot-matrix/dotm-square-14.js +38 -0
  1668. package/dist/primitives/dot-matrix/dotm-square-15.d.ts +4 -0
  1669. package/dist/primitives/dot-matrix/dotm-square-15.js +31 -0
  1670. package/dist/primitives/dot-matrix/dotm-square-16.d.ts +4 -0
  1671. package/dist/primitives/dot-matrix/dotm-square-16.js +33 -0
  1672. package/dist/primitives/dot-matrix/dotm-square-17.d.ts +4 -0
  1673. package/dist/primitives/dot-matrix/dotm-square-17.js +27 -0
  1674. package/dist/primitives/dot-matrix/dotm-square-18.d.ts +4 -0
  1675. package/dist/primitives/dot-matrix/dotm-square-18.js +29 -0
  1676. package/dist/primitives/dot-matrix/dotm-square-19.d.ts +4 -0
  1677. package/dist/primitives/dot-matrix/dotm-square-19.js +74 -0
  1678. package/dist/primitives/dot-matrix/dotm-square-2.d.ts +4 -0
  1679. package/dist/primitives/dot-matrix/dotm-square-2.js +72 -0
  1680. package/dist/primitives/dot-matrix/dotm-square-20.d.ts +4 -0
  1681. package/dist/primitives/dot-matrix/dotm-square-20.js +79 -0
  1682. package/dist/primitives/dot-matrix/dotm-square-3.d.ts +4 -0
  1683. package/dist/primitives/dot-matrix/dotm-square-3.js +23 -0
  1684. package/dist/primitives/dot-matrix/dotm-square-4.d.ts +4 -0
  1685. package/dist/primitives/dot-matrix/dotm-square-4.js +41 -0
  1686. package/dist/primitives/dot-matrix/dotm-square-5.d.ts +4 -0
  1687. package/dist/primitives/dot-matrix/dotm-square-5.js +23 -0
  1688. package/dist/primitives/dot-matrix/dotm-square-6.d.ts +4 -0
  1689. package/dist/primitives/dot-matrix/dotm-square-6.js +20 -0
  1690. package/dist/primitives/dot-matrix/dotm-square-7.d.ts +4 -0
  1691. package/dist/primitives/dot-matrix/dotm-square-7.js +43 -0
  1692. package/dist/primitives/dot-matrix/dotm-square-8.d.ts +4 -0
  1693. package/dist/primitives/dot-matrix/dotm-square-8.js +57 -0
  1694. package/dist/primitives/dot-matrix/dotm-square-9.d.ts +4 -0
  1695. package/dist/primitives/dot-matrix/dotm-square-9.js +89 -0
  1696. package/dist/primitives/dot-matrix/session-dot-matrix.d.ts +46 -0
  1697. package/dist/primitives/drawer.js +37 -0
  1698. package/dist/primitives/dropdown-menu.d.ts +52 -0
  1699. package/dist/primitives/dropdown-menu.js +114 -0
  1700. package/dist/primitives/emoji-picker.js +137 -0
  1701. package/dist/primitives/empty-state.d.ts +14 -0
  1702. package/dist/primitives/empty-state.js +23 -0
  1703. package/dist/primitives/empty.js +33 -0
  1704. package/dist/primitives/entity-avatar.js +106 -0
  1705. package/dist/primitives/error-boundary.d.ts +24 -0
  1706. package/dist/primitives/error-boundary.js +25 -0
  1707. package/dist/primitives/error-state.d.ts +12 -0
  1708. package/dist/primitives/error-state.js +21 -0
  1709. package/dist/primitives/faded-scroll-area.js +80 -0
  1710. package/dist/primitives/favicon-avatar.js +18 -0
  1711. package/dist/primitives/field.d.ts +15 -0
  1712. package/dist/primitives/field.js +48 -0
  1713. package/dist/primitives/file-tree.js +30 -0
  1714. package/dist/primitives/glyph-face.js +37 -0
  1715. package/dist/primitives/glyph-paths-source.js +40 -0
  1716. package/dist/primitives/glyph-paths.generated.js +207 -0
  1717. package/dist/primitives/glyph-picker.js +118 -0
  1718. package/dist/primitives/glyph-tint.js +93 -0
  1719. package/dist/primitives/histogram-bars.js +93 -0
  1720. package/dist/primitives/hover-card.d.ts +28 -0
  1721. package/dist/primitives/hover-card.js +40 -0
  1722. package/dist/primitives/icon-provider.js +30 -0
  1723. package/dist/primitives/info-banner.js +72 -0
  1724. package/dist/primitives/inline-meta.js +8 -0
  1725. package/dist/primitives/input-group.js +73 -0
  1726. package/dist/primitives/input.js +23 -0
  1727. package/dist/primitives/item.d.ts +23 -0
  1728. package/dist/primitives/item.js +67 -0
  1729. package/dist/primitives/kbd.js +20 -0
  1730. package/dist/primitives/kortix-asterisk.js +17 -0
  1731. package/dist/primitives/kortix-loader.js +74 -0
  1732. package/dist/primitives/kortix-logo.js +47 -0
  1733. package/dist/primitives/label.js +9 -0
  1734. package/dist/primitives/list.js +25 -0
  1735. package/dist/primitives/loading.js +31 -0
  1736. package/dist/primitives/map.js +257 -0
  1737. package/dist/primitives/marker.d.ts +14 -0
  1738. package/dist/primitives/marker.js +28 -0
  1739. package/dist/primitives/menu-recipe.js +129 -0
  1740. package/dist/primitives/mermaid-render.d.ts +52 -0
  1741. package/dist/primitives/mermaid-render.js +135 -0
  1742. package/dist/primitives/mermaid-renderer.js +262 -0
  1743. package/dist/primitives/message.js +26 -0
  1744. package/dist/primitives/modal.d.ts +107 -0
  1745. package/dist/primitives/modal.js +181 -0
  1746. package/dist/primitives/navigation-menu.js +35 -0
  1747. package/dist/primitives/page-search-bar.js +13 -0
  1748. package/dist/primitives/paper-wallpaper-shaders.d.ts +14 -0
  1749. package/dist/primitives/paper-wallpaper-shaders.js +73 -0
  1750. package/dist/primitives/phone-input.js +59 -0
  1751. package/dist/primitives/pixel-kortix-mark.js +40 -0
  1752. package/dist/primitives/popover.js +40 -0
  1753. package/dist/primitives/portal.js +17 -0
  1754. package/dist/primitives/preview-image.d.ts +17 -0
  1755. package/dist/primitives/preview-image.js +59 -0
  1756. package/dist/primitives/progress-ring.js +9 -0
  1757. package/dist/primitives/progress.js +8 -0
  1758. package/dist/primitives/project-icon-picker.d.ts +11 -0
  1759. package/dist/primitives/project-icon-picker.js +56 -0
  1760. package/dist/primitives/radio-group.js +20 -0
  1761. package/dist/primitives/resizable.d.ts +24 -0
  1762. package/dist/primitives/resizable.js +16 -0
  1763. package/dist/primitives/scroll-area.js +11 -0
  1764. package/dist/primitives/section-card.js +14 -0
  1765. package/dist/primitives/section.js +22 -0
  1766. package/dist/primitives/select.js +61 -0
  1767. package/dist/primitives/separator.js +8 -0
  1768. package/dist/primitives/settings-row.d.ts +54 -0
  1769. package/dist/primitives/settings-row.js +43 -0
  1770. package/dist/primitives/settings-section-header.d.ts +13 -0
  1771. package/dist/primitives/settings-section-header.js +11 -0
  1772. package/dist/primitives/settings-subsection-header.d.ts +48 -0
  1773. package/dist/primitives/settings-subsection-header.js +37 -0
  1774. package/dist/primitives/sheet.d.ts +35 -0
  1775. package/dist/primitives/sheet.js +56 -0
  1776. package/dist/primitives/sidebar-menu-primitives.d.ts +38 -0
  1777. package/dist/primitives/sidebar-menu-primitives.js +97 -0
  1778. package/dist/primitives/sidebar-panel.js +265 -0
  1779. package/dist/primitives/sidebar.js +194 -0
  1780. package/dist/primitives/skeleton.js +6 -0
  1781. package/dist/primitives/slider-native.js +16 -0
  1782. package/dist/primitives/slider.js +48 -0
  1783. package/dist/primitives/sliding-tab-indicator.js +128 -0
  1784. package/dist/primitives/split-sheet.js +239 -0
  1785. package/dist/primitives/spotlight-card.js +43 -0
  1786. package/dist/primitives/status.js +76 -0
  1787. package/dist/primitives/stepper.js +73 -0
  1788. package/dist/primitives/switch.js +131 -0
  1789. package/dist/primitives/system-message.js +51 -0
  1790. package/dist/primitives/table.js +28 -0
  1791. package/dist/primitives/tabs.js +207 -0
  1792. package/dist/primitives/tag.d.ts +7 -0
  1793. package/dist/primitives/tag.js +22 -0
  1794. package/dist/primitives/text-shimmer.js +91 -0
  1795. package/dist/primitives/textarea.js +87 -0
  1796. package/dist/primitives/toast.js +233 -0
  1797. package/dist/primitives/toggle.d.ts +12 -0
  1798. package/dist/primitives/toggle.js +26 -0
  1799. package/dist/primitives/tooltip.js +19 -0
  1800. package/dist/primitives/trigger-variants.js +67 -0
  1801. package/dist/primitives/type-to-confirm-dialog.js +101 -0
  1802. package/dist/primitives/typed-title.js +66 -0
  1803. package/dist/primitives/typing-animation.js +141 -0
  1804. package/dist/primitives/user-avatar.js +46 -0
  1805. package/dist/primitives/wallpaper-shaders.d.ts +7 -0
  1806. package/dist/primitives/wallpaper-shaders.js +50 -0
  1807. package/dist/providers/motion-features.d.ts +1 -0
  1808. package/dist/providers/motion-features.js +3 -0
  1809. package/dist/providers/session-ids.d.ts +21 -0
  1810. package/dist/providers/session-ids.js +13 -0
  1811. package/dist/providers/ui-provider.d.ts +338 -86
  1812. package/dist/providers/ui-provider.js +186 -61
  1813. package/dist/providers/use-host-preview-url.d.ts +14 -0
  1814. package/dist/providers/use-host-preview-url.js +32 -0
  1815. package/dist/session/actions/project-session-list-helpers.d.ts +156 -0
  1816. package/dist/session/actions/project-session-list-helpers.js +339 -0
  1817. package/dist/session/actions/rename-session-cache.d.ts +35 -0
  1818. package/dist/session/actions/rename-session-cache.js +50 -0
  1819. package/dist/session/actions/session-delete-modal.d.ts +17 -0
  1820. package/dist/session/actions/session-delete-modal.js +128 -0
  1821. package/dist/session/actions/session-label.d.ts +107 -0
  1822. package/dist/session/actions/session-label.js +149 -0
  1823. package/dist/session/actions/use-rename-session.d.ts +9 -0
  1824. package/dist/session/actions/use-rename-session.js +66 -0
  1825. package/dist/session/actions/use-session-list-actions.d.ts +10 -0
  1826. package/dist/session/actions/use-session-list-actions.js +51 -0
  1827. package/dist/session/composer/ComposerAboveCard.d.ts +23 -0
  1828. package/dist/session/composer/ComposerAboveCard.js +28 -0
  1829. package/dist/session/composer/ComposerCard.d.ts +74 -0
  1830. package/dist/session/composer/ComposerCard.js +63 -0
  1831. package/dist/session/composer/agent-selector.d.ts +20 -0
  1832. package/dist/session/composer/agent-selector.js +149 -0
  1833. package/dist/session/composer/animated-placeholder.d.ts +65 -0
  1834. package/dist/session/composer/animated-placeholder.js +119 -0
  1835. package/dist/session/composer/attachment-submission.d.ts +184 -0
  1836. package/dist/session/composer/attachment-submission.js +302 -0
  1837. package/dist/session/composer/attachment-tile.d.ts +84 -0
  1838. package/dist/session/composer/attachment-tile.js +124 -0
  1839. package/dist/session/composer/attachment-tiles.d.ts +53 -0
  1840. package/dist/session/composer/attachment-tiles.js +201 -0
  1841. package/dist/session/composer/clipboard-files.d.ts +16 -0
  1842. package/dist/session/composer/clipboard-files.js +23 -0
  1843. package/dist/session/composer/command-attachments.d.ts +151 -0
  1844. package/dist/session/composer/command-attachments.js +128 -0
  1845. package/dist/session/composer/composer-agent-access.d.ts +83 -0
  1846. package/dist/session/composer/composer-agent-access.js +89 -0
  1847. package/dist/session/composer/composer-chat-input.d.ts +89 -0
  1848. package/dist/session/composer/composer-chat-input.js +143 -0
  1849. package/dist/session/composer/composer-draft-recovery.d.ts +42 -0
  1850. package/dist/session/composer/composer-draft-recovery.js +83 -0
  1851. package/dist/session/composer/composer-drop-zone.d.ts +22 -0
  1852. package/dist/session/composer/composer-drop-zone.js +79 -0
  1853. package/dist/session/composer/composer-logic.d.ts +395 -0
  1854. package/dist/session/composer/composer-logic.js +389 -0
  1855. package/dist/session/composer/composer-reset.d.ts +34 -0
  1856. package/dist/session/composer/composer-reset.js +21 -0
  1857. package/dist/session/composer/composer-text-metrics.d.ts +28 -0
  1858. package/dist/session/composer/composer-text-metrics.js +28 -0
  1859. package/dist/session/composer/composer-toolbar.d.ts +117 -0
  1860. package/dist/session/composer/composer-toolbar.js +19 -0
  1861. package/dist/session/composer/composer-underbar.d.ts +54 -0
  1862. package/dist/session/composer/composer-underbar.js +58 -0
  1863. package/dist/session/composer/composer.d.ts +356 -0
  1864. package/dist/session/composer/composer.js +1455 -0
  1865. package/dist/session/composer/context-ring.d.ts +6 -0
  1866. package/dist/session/composer/context-ring.js +21 -0
  1867. package/dist/session/composer/context-usage.d.ts +48 -0
  1868. package/dist/session/composer/context-usage.js +93 -0
  1869. package/dist/session/composer/delivery-chain.d.ts +28 -0
  1870. package/dist/session/composer/delivery-chain.js +60 -0
  1871. package/dist/session/composer/draft/composer-draft-store.d.ts +21 -0
  1872. package/dist/session/composer/draft/composer-draft-store.js +41 -0
  1873. package/dist/session/composer/draft/composer-draft.d.ts +142 -0
  1874. package/dist/session/composer/draft/composer-draft.js +188 -0
  1875. package/dist/session/composer/draft/draft-uploads.d.ts +29 -0
  1876. package/dist/session/composer/draft/draft-uploads.js +84 -0
  1877. package/dist/session/composer/draft/use-composer-draft.d.ts +49 -0
  1878. package/dist/session/composer/draft/use-composer-draft.js +169 -0
  1879. package/dist/session/composer/editor/composer-editor.d.ts +266 -0
  1880. package/dist/session/composer/editor/composer-editor.js +436 -0
  1881. package/dist/session/composer/editor/extensions.d.ts +65 -0
  1882. package/dist/session/composer/editor/extensions.js +80 -0
  1883. package/dist/session/composer/editor/first-visual-line.d.ts +13 -0
  1884. package/dist/session/composer/editor/first-visual-line.js +19 -0
  1885. package/dist/session/composer/editor/mention-node.d.ts +51 -0
  1886. package/dist/session/composer/editor/mention-node.js +125 -0
  1887. package/dist/session/composer/editor/serialize.d.ts +69 -0
  1888. package/dist/session/composer/editor/serialize.js +175 -0
  1889. package/dist/session/composer/editor/suggestion.d.ts +87 -0
  1890. package/dist/session/composer/editor/suggestion.js +76 -0
  1891. package/dist/session/composer/entitlements-pending.d.ts +60 -0
  1892. package/dist/session/composer/entitlements-pending.js +57 -0
  1893. package/dist/session/composer/esc-to-stop.d.ts +50 -0
  1894. package/dist/session/composer/esc-to-stop.js +24 -0
  1895. package/dist/session/composer/held-commands.d.ts +44 -0
  1896. package/dist/session/composer/held-commands.js +41 -0
  1897. package/dist/session/composer/held-send-guard.d.ts +9 -0
  1898. package/dist/session/composer/held-send-guard.js +26 -0
  1899. package/dist/session/composer/hooks/use-composer-escape-stop.d.ts +6 -0
  1900. package/dist/session/composer/hooks/use-composer-escape-stop.js +28 -0
  1901. package/dist/session/composer/hooks/use-composer-focus.d.ts +33 -0
  1902. package/dist/session/composer/hooks/use-composer-focus.js +181 -0
  1903. package/dist/session/composer/hooks/use-debounced-value.d.ts +8 -0
  1904. package/dist/session/composer/hooks/use-debounced-value.js +27 -0
  1905. package/dist/session/composer/hooks/use-file-search.d.ts +137 -0
  1906. package/dist/session/composer/hooks/use-file-search.js +205 -0
  1907. package/dist/session/composer/hooks/use-latest-ref.d.ts +8 -0
  1908. package/dist/session/composer/hooks/use-latest-ref.js +15 -0
  1909. package/dist/session/composer/inbox-live-prompt.d.ts +9 -0
  1910. package/dist/session/composer/inbox-live-prompt.js +10 -0
  1911. package/dist/session/composer/inbox-row-claims.d.ts +64 -0
  1912. package/dist/session/composer/inbox-row-claims.js +61 -0
  1913. package/dist/session/composer/index.d.ts +24 -0
  1914. package/dist/session/composer/index.js +22 -0
  1915. package/dist/session/composer/menus/mention-controller.d.ts +40 -0
  1916. package/dist/session/composer/menus/mention-controller.js +107 -0
  1917. package/dist/session/composer/menus/mention-menu.d.ts +45 -0
  1918. package/dist/session/composer/menus/mention-menu.js +80 -0
  1919. package/dist/session/composer/menus/menu-items.d.ts +27 -0
  1920. package/dist/session/composer/menus/menu-items.js +89 -0
  1921. package/dist/session/composer/menus/menu-nav-state.d.ts +169 -0
  1922. package/dist/session/composer/menus/menu-nav-state.js +194 -0
  1923. package/dist/session/composer/menus/menu-navigation.d.ts +3 -0
  1924. package/dist/session/composer/menus/menu-navigation.js +29 -0
  1925. package/dist/session/composer/menus/menu-selection.d.ts +15 -0
  1926. package/dist/session/composer/menus/menu-selection.js +23 -0
  1927. package/dist/session/composer/menus/menu-shell.d.ts +69 -0
  1928. package/dist/session/composer/menus/menu-shell.js +91 -0
  1929. package/dist/session/composer/menus/mount.d.ts +79 -0
  1930. package/dist/session/composer/menus/mount.js +128 -0
  1931. package/dist/session/composer/menus/slash-actions.d.ts +78 -0
  1932. package/dist/session/composer/menus/slash-actions.js +89 -0
  1933. package/dist/session/composer/menus/slash-controller.d.ts +80 -0
  1934. package/dist/session/composer/menus/slash-controller.js +152 -0
  1935. package/dist/session/composer/menus/slash-files.d.ts +69 -0
  1936. package/dist/session/composer/menus/slash-files.js +97 -0
  1937. package/dist/session/composer/menus/slash-items.d.ts +86 -0
  1938. package/dist/session/composer/menus/slash-items.js +184 -0
  1939. package/dist/session/composer/menus/slash-menu.d.ts +44 -0
  1940. package/dist/session/composer/menus/slash-menu.js +138 -0
  1941. package/dist/session/composer/pasted-text.d.ts +25 -0
  1942. package/dist/session/composer/pasted-text.js +55 -0
  1943. package/dist/session/composer/queue-projection.d.ts +102 -0
  1944. package/dist/session/composer/queue-projection.js +144 -0
  1945. package/dist/session/composer/queued-message-restore.d.ts +58 -0
  1946. package/dist/session/composer/queued-message-restore.js +67 -0
  1947. package/dist/session/composer/queued-prompt-edit.d.ts +79 -0
  1948. package/dist/session/composer/queued-prompt-edit.js +114 -0
  1949. package/dist/session/composer/queued-prompt-list.d.ts +36 -0
  1950. package/dist/session/composer/queued-prompt-list.js +84 -0
  1951. package/dist/session/composer/quote-list.d.ts +47 -0
  1952. package/dist/session/composer/quote-list.js +41 -0
  1953. package/dist/session/composer/reasoning-effort-selector.d.ts +36 -0
  1954. package/dist/session/composer/reasoning-effort-selector.js +121 -0
  1955. package/dist/session/composer/send-blockers.d.ts +101 -0
  1956. package/dist/session/composer/send-blockers.js +122 -0
  1957. package/dist/session/composer/send-stop-control.d.ts +39 -0
  1958. package/dist/session/composer/send-stop-control.js +68 -0
  1959. package/dist/session/composer/sent-attachment-previews.d.ts +59 -0
  1960. package/dist/session/composer/sent-attachment-previews.js +128 -0
  1961. package/dist/session/composer/session-chat-input.d.ts +8 -0
  1962. package/dist/session/composer/session-chat-input.js +7 -0
  1963. package/dist/session/composer/session-composer-readiness.d.ts +173 -0
  1964. package/dist/session/composer/session-composer-readiness.js +158 -0
  1965. package/dist/session/composer/stores/queued-draft-store.d.ts +46 -0
  1966. package/dist/session/composer/stores/queued-draft-store.js +33 -0
  1967. package/dist/session/composer/stores/session-composer-handoff-store.d.ts +125 -0
  1968. package/dist/session/composer/stores/session-composer-handoff-store.js +142 -0
  1969. package/dist/session/composer/stores/session-composer-prefill-store.d.ts +54 -0
  1970. package/dist/session/composer/stores/session-composer-prefill-store.js +57 -0
  1971. package/dist/session/composer/submit-latch.d.ts +9 -0
  1972. package/dist/session/composer/submit-latch.js +27 -0
  1973. package/dist/session/composer/token-progress.d.ts +35 -0
  1974. package/dist/session/composer/token-progress.js +102 -0
  1975. package/dist/session/composer/types.d.ts +60 -0
  1976. package/dist/session/composer/types.js +9 -0
  1977. package/dist/session/composer/uploaded-file-refs.d.ts +51 -0
  1978. package/dist/session/composer/uploaded-file-refs.js +90 -0
  1979. package/dist/session/composer/use-instant-session-send.d.ts +82 -0
  1980. package/dist/session/composer/use-instant-session-send.js +383 -0
  1981. package/dist/session/header/compact-modal.d.ts +10 -0
  1982. package/dist/session/header/compact-modal.js +24 -0
  1983. package/dist/session/header/export-transcript-modal.d.ts +31 -0
  1984. package/dist/session/header/export-transcript-modal.js +158 -0
  1985. package/dist/session/header/reminder-parts.d.ts +285 -0
  1986. package/dist/session/header/reminder-parts.js +115 -0
  1987. package/dist/session/header/session-changes-indicator.d.ts +3 -0
  1988. package/dist/session/header/session-changes-indicator.js +82 -0
  1989. package/dist/session/header/session-config-indicator.d.ts +34 -0
  1990. package/dist/session/header/session-config-indicator.js +127 -0
  1991. package/dist/session/header/session-pending-approvals-indicator.d.ts +3 -0
  1992. package/dist/session/header/session-pending-approvals-indicator.js +43 -0
  1993. package/dist/session/header/session-reload-progress-view.d.ts +4 -0
  1994. package/dist/session/header/session-reload-progress-view.js +12 -0
  1995. package/dist/session/header/session-reminders-indicator.d.ts +16 -0
  1996. package/dist/session/header/session-reminders-indicator.js +185 -0
  1997. package/dist/session/header/session-site-header.d.ts +12 -0
  1998. package/dist/session/header/session-site-header.js +287 -0
  1999. package/dist/session/header/session-title-input.d.ts +20 -0
  2000. package/dist/session/header/session-title-input.js +56 -0
  2001. package/dist/session/header/subagent-hover-card.d.ts +23 -0
  2002. package/dist/session/header/subagent-hover-card.js +35 -0
  2003. package/dist/session/index.d.ts +65 -0
  2004. package/dist/session/index.js +63 -0
  2005. package/dist/session/media/image-output-path.d.ts +9 -0
  2006. package/dist/session/media/image-output-path.js +43 -0
  2007. package/dist/session/media/image-preview.d.ts +11 -0
  2008. package/dist/session/media/image-preview.js +13 -0
  2009. package/dist/session/media/sandbox-image.d.ts +24 -0
  2010. package/dist/session/media/sandbox-image.js +144 -0
  2011. package/dist/session/media/sandbox-url-detector.d.ts +29 -0
  2012. package/dist/session/media/sandbox-url-detector.js +180 -0
  2013. package/dist/session/models/ask-owner-for-credits-button.d.ts +7 -0
  2014. package/dist/session/models/ask-owner-for-credits-button.js +33 -0
  2015. package/dist/session/models/chatgpt-connection-action.d.ts +22 -0
  2016. package/dist/session/models/chatgpt-connection-action.js +33 -0
  2017. package/dist/session/models/model-availability.d.ts +71 -0
  2018. package/dist/session/models/model-availability.js +60 -0
  2019. package/dist/session/models/model-connection-gate.d.ts +38 -0
  2020. package/dist/session/models/model-connection-gate.js +76 -0
  2021. package/dist/session/models/model-grouping.d.ts +85 -0
  2022. package/dist/session/models/model-grouping.js +122 -0
  2023. package/dist/session/models/model-search-empty.d.ts +6 -0
  2024. package/dist/session/models/model-search-empty.js +10 -0
  2025. package/dist/session/models/model-selector.d.ts +86 -0
  2026. package/dist/session/models/model-selector.js +337 -0
  2027. package/dist/session/models/model-tags.d.ts +27 -0
  2028. package/dist/session/models/model-tags.js +35 -0
  2029. package/dist/session/models/provider-failure-recovery.d.ts +11 -0
  2030. package/dist/session/models/provider-failure-recovery.js +12 -0
  2031. package/dist/session/models/use-model-connection-gate.d.ts +57 -0
  2032. package/dist/session/models/use-model-connection-gate.js +165 -0
  2033. package/dist/session/outcomes/anchor-outcomes.d.ts +18 -0
  2034. package/dist/session/outcomes/anchor-outcomes.js +48 -0
  2035. package/dist/session/outcomes/change-request-outcomes.d.ts +28 -0
  2036. package/dist/session/outcomes/change-request-outcomes.js +80 -0
  2037. package/dist/session/outcomes/session-outcomes-provider.d.ts +16 -0
  2038. package/dist/session/outcomes/session-outcomes-provider.js +107 -0
  2039. package/dist/session/outcomes/turn-outcomes.d.ts +10 -0
  2040. package/dist/session/outcomes/turn-outcomes.js +38 -0
  2041. package/dist/session/overrides/provider-pool-draft-context.d.ts +17 -0
  2042. package/dist/session/overrides/provider-pool-draft-context.js +26 -0
  2043. package/dist/session/overrides/provider-pool-draft.d.ts +48 -0
  2044. package/dist/session/overrides/provider-pool-draft.js +62 -0
  2045. package/dist/session/overrides/provider-secret-pool-editor.d.ts +13 -0
  2046. package/dist/session/overrides/provider-secret-pool-editor.js +110 -0
  2047. package/dist/session/overrides/session-overrides-composer.d.ts +44 -0
  2048. package/dist/session/overrides/session-overrides-composer.js +41 -0
  2049. package/dist/session/overrides/session-overrides-control.d.ts +71 -0
  2050. package/dist/session/overrides/session-overrides-control.js +71 -0
  2051. package/dist/session/overrides/session-overrides-toolbar.d.ts +56 -0
  2052. package/dist/session/overrides/session-overrides-toolbar.js +323 -0
  2053. package/dist/session/panel/action-panel.d.ts +1 -0
  2054. package/dist/session/panel/action-panel.js +28 -0
  2055. package/dist/session/panel/advanced/advanced-panel.d.ts +15 -0
  2056. package/dist/session/panel/advanced/advanced-panel.js +67 -0
  2057. package/dist/session/panel/audit/audit-credential-label.d.ts +20 -0
  2058. package/dist/session/panel/audit/audit-credential-label.js +22 -0
  2059. package/dist/session/panel/diff-dialog.d.ts +7 -0
  2060. package/dist/session/panel/diff-dialog.js +24 -0
  2061. package/dist/session/panel/easy/app-preview.d.ts +19 -0
  2062. package/dist/session/panel/easy/app-preview.js +270 -0
  2063. package/dist/session/panel/easy/apps-card.d.ts +5 -0
  2064. package/dist/session/panel/easy/apps-card.js +67 -0
  2065. package/dist/session/panel/easy/context-card.d.ts +18 -0
  2066. package/dist/session/panel/easy/context-card.js +150 -0
  2067. package/dist/session/panel/easy/detail-view.d.ts +193 -0
  2068. package/dist/session/panel/easy/detail-view.js +385 -0
  2069. package/dist/session/panel/easy/easy-panel-logic.d.ts +187 -0
  2070. package/dist/session/panel/easy/easy-panel-logic.js +241 -0
  2071. package/dist/session/panel/easy/easy-panel.d.ts +1 -0
  2072. package/dist/session/panel/easy/easy-panel.js +66 -0
  2073. package/dist/session/panel/easy/file-preview.d.ts +58 -0
  2074. package/dist/session/panel/easy/file-preview.js +250 -0
  2075. package/dist/session/panel/easy/outputs-card.d.ts +22 -0
  2076. package/dist/session/panel/easy/outputs-card.js +209 -0
  2077. package/dist/session/panel/easy/panel-card.d.ts +58 -0
  2078. package/dist/session/panel/easy/panel-card.js +44 -0
  2079. package/dist/session/panel/easy/plan-card.d.ts +20 -0
  2080. package/dist/session/panel/easy/plan-card.js +108 -0
  2081. package/dist/session/panel/easy/preview-load.d.ts +193 -0
  2082. package/dist/session/panel/easy/preview-load.js +165 -0
  2083. package/dist/session/panel/easy/step-detail-body.d.ts +24 -0
  2084. package/dist/session/panel/easy/step-detail-body.js +33 -0
  2085. package/dist/session/panel/easy/step-icon.d.ts +6 -0
  2086. package/dist/session/panel/easy/step-icon.js +44 -0
  2087. package/dist/session/panel/index.d.ts +17 -0
  2088. package/dist/session/panel/index.js +17 -0
  2089. package/dist/session/panel/mobile-tool-drawer.d.ts +5 -0
  2090. package/dist/session/panel/mobile-tool-drawer.js +44 -0
  2091. package/dist/session/panel/open-session-quick-view.d.ts +6 -0
  2092. package/dist/session/panel/open-session-quick-view.js +77 -0
  2093. package/dist/session/panel/panel-fallback.d.ts +8 -0
  2094. package/dist/session/panel/panel-fallback.js +66 -0
  2095. package/dist/session/panel/session-action-panel-column.d.ts +11 -0
  2096. package/dist/session/panel/session-action-panel-column.js +180 -0
  2097. package/dist/session/panel/session-audit-panel.d.ts +4 -0
  2098. package/dist/session/panel/session-audit-panel.js +100 -0
  2099. package/dist/session/panel/session-audit-shared.d.ts +102 -0
  2100. package/dist/session/panel/session-audit-shared.js +188 -0
  2101. package/dist/session/panel/session-changes-shared.d.ts +57 -0
  2102. package/dist/session/panel/session-changes-shared.js +92 -0
  2103. package/dist/session/panel/session-detail-panel.d.ts +1 -0
  2104. package/dist/session/panel/session-detail-panel.js +50 -0
  2105. package/dist/session/panel/session-diff-viewer.d.ts +12 -0
  2106. package/dist/session/panel/session-diff-viewer.js +60 -0
  2107. package/dist/session/panel/session-files-explorer-logic.d.ts +47 -0
  2108. package/dist/session/panel/session-files-explorer-logic.js +48 -0
  2109. package/dist/session/panel/session-files-explorer.d.ts +38 -0
  2110. package/dist/session/panel/session-files-explorer.js +114 -0
  2111. package/dist/session/panel/session-files-panel.d.ts +22 -0
  2112. package/dist/session/panel/session-files-panel.js +98 -0
  2113. package/dist/session/panel/session-files-store-registry.d.ts +3 -0
  2114. package/dist/session/panel/session-files-store-registry.js +23 -0
  2115. package/dist/session/panel/session-panel-header.d.ts +15 -0
  2116. package/dist/session/panel/session-panel-header.js +23 -0
  2117. package/dist/session/panel/session-panel-provider.d.ts +60 -0
  2118. package/dist/session/panel/session-panel-provider.js +581 -0
  2119. package/dist/session/panel/session-panel-sizing.d.ts +82 -0
  2120. package/dist/session/panel/session-panel-sizing.js +109 -0
  2121. package/dist/session/panel/session-reminders-panel.d.ts +4 -0
  2122. package/dist/session/panel/session-reminders-panel.js +109 -0
  2123. package/dist/session/panel/session-wallpaper-layer.d.ts +13 -0
  2124. package/dist/session/panel/session-wallpaper-layer.js +17 -0
  2125. package/dist/session/panel/shared/action-navigator-logic.d.ts +44 -0
  2126. package/dist/session/panel/shared/action-navigator-logic.js +69 -0
  2127. package/dist/session/panel/shared/action-navigator.d.ts +11 -0
  2128. package/dist/session/panel/shared/action-navigator.js +65 -0
  2129. package/dist/session/panel/shared/collect-tool-parts.d.ts +38 -0
  2130. package/dist/session/panel/shared/collect-tool-parts.js +56 -0
  2131. package/dist/session/panel/shared/deliverable-readiness.d.ts +22 -0
  2132. package/dist/session/panel/shared/deliverable-readiness.js +34 -0
  2133. package/dist/session/panel/shared/derive-panels.d.ts +81 -0
  2134. package/dist/session/panel/shared/derive-panels.js +475 -0
  2135. package/dist/session/panel/shared/latest-run.d.ts +9 -0
  2136. package/dist/session/panel/shared/latest-run.js +22 -0
  2137. package/dist/session/panel/shared/output-priority.d.ts +40 -0
  2138. package/dist/session/panel/shared/output-priority.js +119 -0
  2139. package/dist/session/panel/shared/run-outcome.d.ts +13 -0
  2140. package/dist/session/panel/shared/run-outcome.js +34 -0
  2141. package/dist/session/panel/shared/use-deliverable-readiness.d.ts +9 -0
  2142. package/dist/session/panel/shared/use-deliverable-readiness.js +90 -0
  2143. package/dist/session/panel/shared/use-panel-derivations.d.ts +23 -0
  2144. package/dist/session/panel/shared/use-panel-derivations.js +64 -0
  2145. package/dist/session/panel/shared/use-panel-handoffs.d.ts +13 -0
  2146. package/dist/session/panel/shared/use-panel-handoffs.js +174 -0
  2147. package/dist/session/panel/use-session-panel-layout.d.ts +22 -0
  2148. package/dist/session/panel/use-session-panel-layout.js +222 -0
  2149. package/dist/session/panel/use-session-panel-state.d.ts +19 -0
  2150. package/dist/session/panel/use-session-panel-state.js +116 -0
  2151. package/dist/session/participants/session-participants.d.ts +29 -0
  2152. package/dist/session/participants/session-participants.js +58 -0
  2153. package/dist/session/print/load-entire-history.d.ts +66 -0
  2154. package/dist/session/print/load-entire-history.js +61 -0
  2155. package/dist/session/print/print-chain.d.ts +64 -0
  2156. package/dist/session/print/print-chain.js +69 -0
  2157. package/dist/session/print/session-print-header.d.ts +16 -0
  2158. package/dist/session/print/session-print-header.js +47 -0
  2159. package/dist/session/print/use-session-print.d.ts +45 -0
  2160. package/dist/session/print/use-session-print.js +108 -0
  2161. package/dist/session/prompts/approval-request.d.ts +195 -0
  2162. package/dist/session/prompts/approval-request.js +514 -0
  2163. package/dist/session/prompts/question-prompt.d.ts +26 -0
  2164. package/dist/session/prompts/question-prompt.js +224 -0
  2165. package/dist/session/prompts/session-approval-prompt.d.ts +68 -0
  2166. package/dist/session/prompts/session-approval-prompt.js +169 -0
  2167. package/dist/session/prompts/session-approval-review.d.ts +85 -0
  2168. package/dist/session/prompts/session-approval-review.js +176 -0
  2169. package/dist/session/prompts/session-permission-prompt.d.ts +19 -0
  2170. package/dist/session/prompts/session-permission-prompt.js +223 -0
  2171. package/dist/session/scope/create-scoped-session.d.ts +12 -0
  2172. package/dist/session/scope/create-scoped-session.js +28 -0
  2173. package/dist/session/scope/session-scope-control.d.ts +31 -0
  2174. package/dist/session/scope/session-scope-control.js +83 -0
  2175. package/dist/session/scope/session-scope-model.d.ts +113 -0
  2176. package/dist/session/scope/session-scope-model.js +249 -0
  2177. package/dist/session/scope/session-scope-toolbar.d.ts +22 -0
  2178. package/dist/session/scope/session-scope-toolbar.js +76 -0
  2179. package/dist/session/scope/use-session-scope.d.ts +61 -0
  2180. package/dist/session/scope/use-session-scope.js +206 -0
  2181. package/dist/session/status/agent-git-reconciliation.d.ts +2 -0
  2182. package/dist/session/status/agent-git-reconciliation.js +32 -0
  2183. package/dist/session/status/previous-repository-session.d.ts +17 -0
  2184. package/dist/session/status/previous-repository-session.js +130 -0
  2185. package/dist/session/status/provisioning-failure.d.ts +22 -0
  2186. package/dist/session/status/provisioning-failure.js +97 -0
  2187. package/dist/session/status/reload-forensics.d.ts +77 -0
  2188. package/dist/session/status/reload-forensics.js +200 -0
  2189. package/dist/session/status/sandbox-loading-boundary.d.ts +3 -0
  2190. package/dist/session/status/sandbox-loading-boundary.js +43 -0
  2191. package/dist/session/status/session-busy-indicator.d.ts +19 -0
  2192. package/dist/session/status/session-busy-indicator.js +55 -0
  2193. package/dist/session/status/session-chat-busy.d.ts +17 -0
  2194. package/dist/session/status/session-chat-busy.js +15 -0
  2195. package/dist/session/status/session-error-banner.d.ts +82 -0
  2196. package/dist/session/status/session-error-banner.js +327 -0
  2197. package/dist/session/status/session-load-state.d.ts +98 -0
  2198. package/dist/session/status/session-load-state.js +86 -0
  2199. package/dist/session/status/session-notice-banner.d.ts +27 -0
  2200. package/dist/session/status/session-notice-banner.js +27 -0
  2201. package/dist/session/status/session-resume.d.ts +126 -0
  2202. package/dist/session/status/session-resume.js +142 -0
  2203. package/dist/session/status/session-route-prefetch.d.ts +40 -0
  2204. package/dist/session/status/session-route-prefetch.js +18 -0
  2205. package/dist/session/status/session-start-gate.d.ts +27 -0
  2206. package/dist/session/status/session-start-gate.js +25 -0
  2207. package/dist/session/status/session-starting-loader.d.ts +83 -0
  2208. package/dist/session/status/session-starting-loader.js +190 -0
  2209. package/dist/session/status/session-surface.d.ts +175 -0
  2210. package/dist/session/status/session-surface.js +129 -0
  2211. package/dist/session/status/session-tab-title-sync.d.ts +20 -0
  2212. package/dist/session/status/session-tab-title-sync.js +44 -0
  2213. package/dist/session/status/session-tab-title.d.ts +33 -0
  2214. package/dist/session/status/session-tab-title.js +60 -0
  2215. package/dist/session/status/session-terminal-state.d.ts +70 -0
  2216. package/dist/session/status/session-terminal-state.js +62 -0
  2217. package/dist/session/status/stop-refusal.d.ts +14 -0
  2218. package/dist/session/status/stop-refusal.js +21 -0
  2219. package/dist/session/status/use-readiness-settling.d.ts +18 -0
  2220. package/dist/session/status/use-readiness-settling.js +43 -0
  2221. package/dist/session/thread/chat-minimap-items.d.ts +94 -0
  2222. package/dist/session/thread/chat-minimap-items.js +234 -0
  2223. package/dist/session/thread/chat-minimap.d.ts +8 -0
  2224. package/dist/session/thread/chat-minimap.js +138 -0
  2225. package/dist/session/thread/detect-command.d.ts +13 -0
  2226. package/dist/session/thread/detect-command.js +117 -0
  2227. package/dist/session/thread/first-prompt-handover.d.ts +54 -0
  2228. package/dist/session/thread/first-prompt-handover.js +78 -0
  2229. package/dist/session/thread/mention-chip.d.ts +51 -0
  2230. package/dist/session/thread/mention-chip.js +86 -0
  2231. package/dist/session/thread/mention-segments.d.ts +47 -0
  2232. package/dist/session/thread/mention-segments.js +117 -0
  2233. package/dist/session/thread/message-parsing.d.ts +80 -0
  2234. package/dist/session/thread/message-parsing.js +244 -0
  2235. package/dist/session/thread/optimistic-turn.d.ts +93 -0
  2236. package/dist/session/thread/optimistic-turn.js +209 -0
  2237. package/dist/session/thread/persisted-turn-failure.d.ts +25 -0
  2238. package/dist/session/thread/persisted-turn-failure.js +36 -0
  2239. package/dist/session/thread/pinned-root-session.d.ts +16 -0
  2240. package/dist/session/thread/pinned-root-session.js +18 -0
  2241. package/dist/session/thread/plan-surface.d.ts +9 -0
  2242. package/dist/session/thread/plan-surface.js +29 -0
  2243. package/dist/session/thread/reply-context.d.ts +38 -0
  2244. package/dist/session/thread/reply-context.js +179 -0
  2245. package/dist/session/thread/session-body.d.ts +28 -0
  2246. package/dist/session/thread/session-body.js +50 -0
  2247. package/dist/session/thread/session-chat.d.ts +67 -0
  2248. package/dist/session/thread/session-chat.js +3676 -0
  2249. package/dist/session/thread/session-context-message-explorer.d.ts +44 -0
  2250. package/dist/session/thread/session-context-message-explorer.js +118 -0
  2251. package/dist/session/thread/session-context-metrics.d.ts +24 -0
  2252. package/dist/session/thread/session-context-metrics.js +44 -0
  2253. package/dist/session/thread/session-context-modal.d.ts +34 -0
  2254. package/dist/session/thread/session-context-modal.js +228 -0
  2255. package/dist/session/thread/session-context-sub-sessions.d.ts +16 -0
  2256. package/dist/session/thread/session-context-sub-sessions.js +142 -0
  2257. package/dist/session/thread/session-history-scroll.d.ts +55 -0
  2258. package/dist/session/thread/session-history-scroll.js +88 -0
  2259. package/dist/session/thread/session-history.d.ts +22 -0
  2260. package/dist/session/thread/session-history.js +90 -0
  2261. package/dist/session/thread/session-older-autoload.d.ts +82 -0
  2262. package/dist/session/thread/session-older-autoload.js +55 -0
  2263. package/dist/session/thread/session-older-loading.d.ts +41 -0
  2264. package/dist/session/thread/session-older-loading.js +57 -0
  2265. package/dist/session/thread/session-thread.d.ts +35 -0
  2266. package/dist/session/thread/session-thread.js +13 -0
  2267. package/dist/session/thread/session-transcript-class.d.ts +19 -0
  2268. package/dist/session/thread/session-transcript-class.js +19 -0
  2269. package/dist/session/thread/session-turn-meta-rows.d.ts +44 -0
  2270. package/dist/session/thread/session-turn-meta-rows.js +82 -0
  2271. package/dist/session/thread/session-turn-meta.d.ts +9 -0
  2272. package/dist/session/thread/session-turn-meta.js +54 -0
  2273. package/dist/session/thread/session-welcome.d.ts +1 -0
  2274. package/dist/session/thread/session-welcome.js +7 -0
  2275. package/dist/session/thread/sub-session-modal-content.d.ts +8 -0
  2276. package/dist/session/thread/sub-session-modal-content.js +23 -0
  2277. package/dist/session/thread/sub-session-modal.d.ts +2 -0
  2278. package/dist/session/thread/sub-session-modal.js +14 -0
  2279. package/dist/session/thread/transcript.d.ts +351 -0
  2280. package/dist/session/thread/transcript.js +1213 -0
  2281. package/dist/session/tool/foreign-tool-calls.d.ts +11 -0
  2282. package/dist/session/tool/foreign-tool-calls.js +60 -0
  2283. package/dist/session/tool/generic-tool.d.ts +16 -0
  2284. package/dist/session/tool/generic-tool.js +74 -0
  2285. package/dist/session/tool/inline-permission-reply.d.ts +8 -0
  2286. package/dist/session/tool/inline-permission-reply.js +18 -0
  2287. package/dist/session/tool/shared/error-and-connector.d.ts +19 -0
  2288. package/dist/session/tool/shared/error-and-connector.js +106 -0
  2289. package/dist/session/tool/shared/file-list.d.ts +35 -0
  2290. package/dist/session/tool/shared/file-list.js +91 -0
  2291. package/dist/session/tool/shared/infrastructure-contexts.d.ts +65 -0
  2292. package/dist/session/tool/shared/infrastructure-contexts.js +101 -0
  2293. package/dist/session/tool/shared/infrastructure-files.d.ts +60 -0
  2294. package/dist/session/tool/shared/infrastructure-files.js +129 -0
  2295. package/dist/session/tool/shared/infrastructure-output.d.ts +32 -0
  2296. package/dist/session/tool/shared/infrastructure-output.js +93 -0
  2297. package/dist/session/tool/shared/infrastructure-parts.d.ts +18 -0
  2298. package/dist/session/tool/shared/infrastructure-parts.js +201 -0
  2299. package/dist/session/tool/shared/infrastructure-preview.d.ts +60 -0
  2300. package/dist/session/tool/shared/infrastructure-preview.js +245 -0
  2301. package/dist/session/tool/shared/infrastructure-row-header.d.ts +53 -0
  2302. package/dist/session/tool/shared/infrastructure-row-header.js +133 -0
  2303. package/dist/session/tool/shared/infrastructure-rows.d.ts +2 -0
  2304. package/dist/session/tool/shared/infrastructure-rows.js +153 -0
  2305. package/dist/session/tool/shared/infrastructure.d.ts +9 -0
  2306. package/dist/session/tool/shared/infrastructure.js +10 -0
  2307. package/dist/session/tool/shared/output-block.d.ts +66 -0
  2308. package/dist/session/tool/shared/output-block.js +71 -0
  2309. package/dist/session/tool/shared/patch-helpers.d.ts +26 -0
  2310. package/dist/session/tool/shared/patch-helpers.js +52 -0
  2311. package/dist/session/tool/shared/registry.d.ts +17 -0
  2312. package/dist/session/tool/shared/registry.js +55 -0
  2313. package/dist/session/tool/shared/result-card.d.ts +28 -0
  2314. package/dist/session/tool/shared/result-card.js +54 -0
  2315. package/dist/session/tool/shared/session-helpers.d.ts +17 -0
  2316. package/dist/session/tool/shared/session-helpers.js +116 -0
  2317. package/dist/session/tool/shared/show-helpers.d.ts +96 -0
  2318. package/dist/session/tool/shared/show-helpers.js +359 -0
  2319. package/dist/session/tool/shared/structured-output.d.ts +4 -0
  2320. package/dist/session/tool/shared/structured-output.js +51 -0
  2321. package/dist/session/tool/shared/sub-agent.d.ts +57 -0
  2322. package/dist/session/tool/shared/sub-agent.js +103 -0
  2323. package/dist/session/tool/shared/surface.d.ts +80 -0
  2324. package/dist/session/tool/shared/surface.js +84 -0
  2325. package/dist/session/tool/shared/todo-helpers.d.ts +24 -0
  2326. package/dist/session/tool/shared/todo-helpers.js +95 -0
  2327. package/dist/session/tool/shared/tool-action-bar.d.ts +21 -0
  2328. package/dist/session/tool/shared/tool-action-bar.js +14 -0
  2329. package/dist/session/tool/shared/types.d.ts +42 -0
  2330. package/dist/session/tool/shared/types.js +1 -0
  2331. package/dist/session/tool/shared/web-source-row.d.ts +4 -0
  2332. package/dist/session/tool/shared/web-source-row.js +26 -0
  2333. package/dist/session/tool/show-group-renderer.d.ts +19 -0
  2334. package/dist/session/tool/show-group-renderer.js +22 -0
  2335. package/dist/session/tool/tool-error.d.ts +4 -0
  2336. package/dist/session/tool/tool-error.js +30 -0
  2337. package/dist/session/tool/tool-meta.d.ts +15 -0
  2338. package/dist/session/tool/tool-meta.js +27 -0
  2339. package/dist/session/tool/tool-part-renderer.d.ts +39 -0
  2340. package/dist/session/tool/tool-part-renderer.js +150 -0
  2341. package/dist/session/tool/tool-renderers.d.ts +8 -0
  2342. package/dist/session/tool/tool-renderers.js +8 -0
  2343. package/dist/session/tool/tools/agent-message-tool.d.ts +2 -0
  2344. package/dist/session/tool/tools/agent-message-tool.js +29 -0
  2345. package/dist/session/tool/tools/agent-spawn-tool.d.ts +2 -0
  2346. package/dist/session/tool/tools/agent-spawn-tool.js +69 -0
  2347. package/dist/session/tool/tools/agent-status-tool.d.ts +2 -0
  2348. package/dist/session/tool/tools/agent-status-tool.js +47 -0
  2349. package/dist/session/tool/tools/agent-stop-tool.d.ts +2 -0
  2350. package/dist/session/tool/tools/agent-stop-tool.js +17 -0
  2351. package/dist/session/tool/tools/agent-task-update-tool.d.ts +2 -0
  2352. package/dist/session/tool/tools/agent-task-update-tool.js +43 -0
  2353. package/dist/session/tool/tools/apply-patch-tool.d.ts +2 -0
  2354. package/dist/session/tool/tools/apply-patch-tool.js +122 -0
  2355. package/dist/session/tool/tools/bash-tool.d.ts +54 -0
  2356. package/dist/session/tool/tools/bash-tool.js +279 -0
  2357. package/dist/session/tool/tools/channel-send-card.d.ts +18 -0
  2358. package/dist/session/tool/tools/channel-send-card.js +42 -0
  2359. package/dist/session/tool/tools/channel-send.d.ts +38 -0
  2360. package/dist/session/tool/tools/channel-send.js +191 -0
  2361. package/dist/session/tool/tools/codemode-tool.d.ts +21 -0
  2362. package/dist/session/tool/tools/codemode-tool.js +106 -0
  2363. package/dist/session/tool/tools/connector-get-tool.d.ts +2 -0
  2364. package/dist/session/tool/tools/connector-get-tool.js +22 -0
  2365. package/dist/session/tool/tools/connector-list-tool.d.ts +2 -0
  2366. package/dist/session/tool/tools/connector-list-tool.js +27 -0
  2367. package/dist/session/tool/tools/connector-setup-tool.d.ts +2 -0
  2368. package/dist/session/tool/tools/connector-setup-tool.js +39 -0
  2369. package/dist/session/tool/tools/connector-tools.d.ts +5 -0
  2370. package/dist/session/tool/tools/connector-tools.js +129 -0
  2371. package/dist/session/tool/tools/edit-tool.d.ts +2 -0
  2372. package/dist/session/tool/tools/edit-tool.js +123 -0
  2373. package/dist/session/tool/tools/get-mem-tool.d.ts +2 -0
  2374. package/dist/session/tool/tools/get-mem-tool.js +57 -0
  2375. package/dist/session/tool/tools/glob-tool.d.ts +2 -0
  2376. package/dist/session/tool/tools/glob-tool.js +70 -0
  2377. package/dist/session/tool/tools/grep-tool.d.ts +2 -0
  2378. package/dist/session/tool/tools/grep-tool.js +48 -0
  2379. package/dist/session/tool/tools/image-gen-tool.d.ts +2 -0
  2380. package/dist/session/tool/tools/image-gen-tool.js +61 -0
  2381. package/dist/session/tool/tools/image-search-tool.d.ts +2 -0
  2382. package/dist/session/tool/tools/image-search-tool.js +90 -0
  2383. package/dist/session/tool/tools/list-tool.d.ts +2 -0
  2384. package/dist/session/tool/tools/list-tool.js +57 -0
  2385. package/dist/session/tool/tools/memory-search-tool.d.ts +11 -0
  2386. package/dist/session/tool/tools/memory-search-tool.js +65 -0
  2387. package/dist/session/tool/tools/memory-tool.d.ts +51 -0
  2388. package/dist/session/tool/tools/memory-tool.js +175 -0
  2389. package/dist/session/tool/tools/presentation-gen-tool.d.ts +2 -0
  2390. package/dist/session/tool/tools/presentation-gen-tool.js +83 -0
  2391. package/dist/session/tool/tools/project-create-tool.d.ts +2 -0
  2392. package/dist/session/tool/tools/project-create-tool.js +39 -0
  2393. package/dist/session/tool/tools/project-delete-tool.d.ts +2 -0
  2394. package/dist/session/tool/tools/project-delete-tool.js +55 -0
  2395. package/dist/session/tool/tools/project-get-tool.d.ts +2 -0
  2396. package/dist/session/tool/tools/project-get-tool.js +24 -0
  2397. package/dist/session/tool/tools/project-list-tool.d.ts +2 -0
  2398. package/dist/session/tool/tools/project-list-tool.js +22 -0
  2399. package/dist/session/tool/tools/project-select-tool.d.ts +2 -0
  2400. package/dist/session/tool/tools/project-select-tool.js +36 -0
  2401. package/dist/session/tool/tools/pty-kill-tool.d.ts +2 -0
  2402. package/dist/session/tool/tools/pty-kill-tool.js +26 -0
  2403. package/dist/session/tool/tools/pty-read-tool.d.ts +21 -0
  2404. package/dist/session/tool/tools/pty-read-tool.js +100 -0
  2405. package/dist/session/tool/tools/pty-spawn-tool.d.ts +2 -0
  2406. package/dist/session/tool/tools/pty-spawn-tool.js +54 -0
  2407. package/dist/session/tool/tools/pty-write-tool.d.ts +2 -0
  2408. package/dist/session/tool/tools/pty-write-tool.js +20 -0
  2409. package/dist/session/tool/tools/question-tool.d.ts +2 -0
  2410. package/dist/session/tool/tools/question-tool.js +79 -0
  2411. package/dist/session/tool/tools/read-tool.d.ts +2 -0
  2412. package/dist/session/tool/tools/read-tool.js +72 -0
  2413. package/dist/session/tool/tools/register.d.ts +55 -0
  2414. package/dist/session/tool/tools/register.js +55 -0
  2415. package/dist/session/tool/tools/removed-connector-tool.d.ts +2 -0
  2416. package/dist/session/tool/tools/removed-connector-tool.js +21 -0
  2417. package/dist/session/tool/tools/scrape-webpage-tool.d.ts +2 -0
  2418. package/dist/session/tool/tools/scrape-webpage-tool.js +81 -0
  2419. package/dist/session/tool/tools/session-get-tool.d.ts +3 -0
  2420. package/dist/session/tool/tools/session-get-tool.js +45 -0
  2421. package/dist/session/tool/tools/session-lineage-tool.d.ts +2 -0
  2422. package/dist/session/tool/tools/session-lineage-tool.js +28 -0
  2423. package/dist/session/tool/tools/session-list-background-tool.d.ts +2 -0
  2424. package/dist/session/tool/tools/session-list-background-tool.js +31 -0
  2425. package/dist/session/tool/tools/session-message-tool.d.ts +2 -0
  2426. package/dist/session/tool/tools/session-message-tool.js +23 -0
  2427. package/dist/session/tool/tools/session-read-tool.d.ts +2 -0
  2428. package/dist/session/tool/tools/session-read-tool.js +79 -0
  2429. package/dist/session/tool/tools/session-search-tool.d.ts +2 -0
  2430. package/dist/session/tool/tools/session-search-tool.js +31 -0
  2431. package/dist/session/tool/tools/session-spawn-tool.d.ts +2 -0
  2432. package/dist/session/tool/tools/session-spawn-tool.js +58 -0
  2433. package/dist/session/tool/tools/session-spawn-urls.d.ts +16 -0
  2434. package/dist/session/tool/tools/session-spawn-urls.js +26 -0
  2435. package/dist/session/tool/tools/session-stats-tool.d.ts +2 -0
  2436. package/dist/session/tool/tools/session-stats-tool.js +17 -0
  2437. package/dist/session/tool/tools/show-tool.d.ts +13 -0
  2438. package/dist/session/tool/tools/show-tool.js +197 -0
  2439. package/dist/session/tool/tools/skill-tool.d.ts +10 -0
  2440. package/dist/session/tool/tools/skill-tool.js +47 -0
  2441. package/dist/session/tool/tools/task-delete-tool.d.ts +2 -0
  2442. package/dist/session/tool/tools/task-delete-tool.js +21 -0
  2443. package/dist/session/tool/tools/task-done-tool.d.ts +2 -0
  2444. package/dist/session/tool/tools/task-done-tool.js +19 -0
  2445. package/dist/session/tool/tools/task-list-tool.d.ts +2 -0
  2446. package/dist/session/tool/tools/task-list-tool.js +21 -0
  2447. package/dist/session/tool/tools/task-tool.d.ts +24 -0
  2448. package/dist/session/tool/tools/task-tool.js +140 -0
  2449. package/dist/session/tool/tools/todo-write-tool.d.ts +2 -0
  2450. package/dist/session/tool/tools/todo-write-tool.js +53 -0
  2451. package/dist/session/tool/tools/triggers-tool.d.ts +2 -0
  2452. package/dist/session/tool/tools/triggers-tool.js +132 -0
  2453. package/dist/session/tool/tools/video-gen-tool.d.ts +2 -0
  2454. package/dist/session/tool/tools/video-gen-tool.js +21 -0
  2455. package/dist/session/tool/tools/web-fetch-tool.d.ts +2 -0
  2456. package/dist/session/tool/tools/web-fetch-tool.js +53 -0
  2457. package/dist/session/tool/tools/web-search-tool.d.ts +2 -0
  2458. package/dist/session/tool/tools/web-search-tool.js +64 -0
  2459. package/dist/session/tool/tools/write-tool.d.ts +23 -0
  2460. package/dist/session/tool/tools/write-tool.js +92 -0
  2461. package/dist/session/turn/activity-burst.d.ts +65 -0
  2462. package/dist/session/turn/activity-burst.js +117 -0
  2463. package/dist/session/turn/activity-file-chips.d.ts +44 -0
  2464. package/dist/session/turn/activity-file-chips.js +238 -0
  2465. package/dist/session/turn/activity-group-step.d.ts +101 -0
  2466. package/dist/session/turn/activity-group-step.js +62 -0
  2467. package/dist/session/turn/activity-step.d.ts +34 -0
  2468. package/dist/session/turn/activity-step.js +116 -0
  2469. package/dist/session/turn/answered-question-step.d.ts +15 -0
  2470. package/dist/session/turn/answered-question-step.js +58 -0
  2471. package/dist/session/turn/attachment-preview.d.ts +7 -0
  2472. package/dist/session/turn/attachment-preview.js +46 -0
  2473. package/dist/session/turn/burst-step-body.d.ts +20 -0
  2474. package/dist/session/turn/burst-step-body.js +68 -0
  2475. package/dist/session/turn/burst-summary-trigger.d.ts +7 -0
  2476. package/dist/session/turn/burst-summary-trigger.js +17 -0
  2477. package/dist/session/turn/chain-step-trigger.d.ts +7 -0
  2478. package/dist/session/turn/chain-step-trigger.js +7 -0
  2479. package/dist/session/turn/channel-brand.d.ts +22 -0
  2480. package/dist/session/turn/channel-brand.js +34 -0
  2481. package/dist/session/turn/channel-message.d.ts +27 -0
  2482. package/dist/session/turn/channel-message.js +33 -0
  2483. package/dist/session/turn/checkpoint.d.ts +8 -0
  2484. package/dist/session/turn/checkpoint.js +11 -0
  2485. package/dist/session/turn/compaction-card.d.ts +41 -0
  2486. package/dist/session/turn/compaction-card.js +82 -0
  2487. package/dist/session/turn/expandable-output.d.ts +87 -0
  2488. package/dist/session/turn/expandable-output.js +147 -0
  2489. package/dist/session/turn/fallback-row.d.ts +10 -0
  2490. package/dist/session/turn/fallback-row.js +31 -0
  2491. package/dist/session/turn/message-author-label.d.ts +5 -0
  2492. package/dist/session/turn/message-author-label.js +63 -0
  2493. package/dist/session/turn/message-author.d.ts +47 -0
  2494. package/dist/session/turn/message-author.js +75 -0
  2495. package/dist/session/turn/message-time-label.d.ts +14 -0
  2496. package/dist/session/turn/message-time-label.js +103 -0
  2497. package/dist/session/turn/plan-anchor.d.ts +92 -0
  2498. package/dist/session/turn/plan-anchor.js +59 -0
  2499. package/dist/session/turn/plan-card.d.ts +113 -0
  2500. package/dist/session/turn/plan-card.js +316 -0
  2501. package/dist/session/turn/queued-prompt-bubbles.d.ts +23 -0
  2502. package/dist/session/turn/queued-prompt-bubbles.js +27 -0
  2503. package/dist/session/turn/same-parts.d.ts +21 -0
  2504. package/dist/session/turn/same-parts.js +31 -0
  2505. package/dist/session/turn/served-model.d.ts +63 -0
  2506. package/dist/session/turn/served-model.js +92 -0
  2507. package/dist/session/turn/source-pill.d.ts +26 -0
  2508. package/dist/session/turn/source-pill.js +20 -0
  2509. package/dist/session/turn/status-elapsed.d.ts +12 -0
  2510. package/dist/session/turn/status-elapsed.js +14 -0
  2511. package/dist/session/turn/streaming-cadence.d.ts +69 -0
  2512. package/dist/session/turn/streaming-cadence.js +304 -0
  2513. package/dist/session/turn/thought-chain-step.d.ts +58 -0
  2514. package/dist/session/turn/thought-chain-step.js +161 -0
  2515. package/dist/session/turn/throttled-markdown.d.ts +38 -0
  2516. package/dist/session/turn/throttled-markdown.js +123 -0
  2517. package/dist/session/turn/turn-viewport.d.ts +146 -0
  2518. package/dist/session/turn/turn-viewport.js +165 -0
  2519. package/dist/session/turn/turn-work-accordion.d.ts +12 -0
  2520. package/dist/session/turn/turn-work-accordion.js +25 -0
  2521. package/dist/session/turn/user-message.d.ts +353 -0
  2522. package/dist/session/turn/user-message.js +1089 -0
  2523. package/dist/styles/components.css +187 -0
  2524. package/dist/styles/print.css +461 -0
  2525. package/dist/styles/theme.css +82 -41
  2526. package/dist/styles/tokens.css +8 -8
  2527. package/dist/styles.css +1 -1
  2528. package/dist/terminal/index.d.ts +7 -0
  2529. package/dist/terminal/index.js +7 -0
  2530. package/dist/terminal/pty-attach-status.d.ts +15 -0
  2531. package/dist/terminal/pty-attach-status.js +42 -0
  2532. package/dist/terminal/pty-connection.d.ts +83 -0
  2533. package/dist/terminal/pty-connection.js +86 -0
  2534. package/dist/terminal/pty-terminal-sanitize.d.ts +2 -0
  2535. package/dist/terminal/pty-terminal-sanitize.js +26 -0
  2536. package/dist/terminal/pty-terminal.d.ts +19 -0
  2537. package/dist/terminal/pty-terminal.js +162 -0
  2538. package/dist/terminal/session-terminal-connect-bar.d.ts +15 -0
  2539. package/dist/terminal/session-terminal-connect-bar.js +67 -0
  2540. package/dist/terminal/session-terminal-panel.d.ts +17 -0
  2541. package/dist/terminal/session-terminal-panel.js +242 -0
  2542. package/dist/terminal/terminal-card-gate.d.ts +51 -0
  2543. package/dist/terminal/terminal-card-gate.js +54 -0
  2544. package/dist/terminal/use-pty-connection.d.ts +59 -0
  2545. package/dist/terminal/use-pty-connection.js +380 -0
  2546. package/dist/theme/index.d.ts +3 -0
  2547. package/dist/theme/index.js +5 -0
  2548. package/dist/theme/theme-scope.d.ts +24 -0
  2549. package/dist/theme/theme-scope.js +39 -0
  2550. package/dist/theme/theme.d.ts +123 -0
  2551. package/dist/theme/theme.js +224 -0
  2552. package/dist/theme/wallpapers.d.ts +26 -0
  2553. package/dist/theme/wallpapers.js +54 -0
  2554. package/dist/workspace/home/access-requests-bell.d.ts +34 -0
  2555. package/dist/workspace/home/access-requests-bell.js +48 -0
  2556. package/dist/workspace/home/first-chat-name.d.ts +7 -0
  2557. package/dist/workspace/home/first-chat-name.js +12 -0
  2558. package/dist/workspace/home/first-chat.d.ts +39 -0
  2559. package/dist/workspace/home/first-chat.js +101 -0
  2560. package/dist/workspace/home/home-greeting.d.ts +34 -0
  2561. package/dist/workspace/home/home-greeting.js +27 -0
  2562. package/dist/workspace/home/mobile-app-promo.d.ts +7 -0
  2563. package/dist/workspace/home/mobile-app-promo.js +55 -0
  2564. package/dist/workspace/home/sandbox-picker.d.ts +13 -0
  2565. package/dist/workspace/home/sandbox-picker.js +24 -0
  2566. package/dist/workspace/home/welcome-body.d.ts +54 -0
  2567. package/dist/workspace/home/welcome-body.js +67 -0
  2568. package/dist/workspace/index.d.ts +25 -0
  2569. package/dist/workspace/index.js +25 -0
  2570. package/dist/workspace/instant-session-shell.d.ts +48 -0
  2571. package/dist/workspace/instant-session-shell.js +216 -0
  2572. package/dist/workspace/layout/new-session-create.d.ts +26 -0
  2573. package/dist/workspace/layout/new-session-create.js +41 -0
  2574. package/dist/workspace/layout/project-files-skeleton.d.ts +15 -0
  2575. package/dist/workspace/layout/project-files-skeleton.js +19 -0
  2576. package/dist/workspace/layout/project-files-view.d.ts +3 -0
  2577. package/dist/workspace/layout/project-files-view.js +54 -0
  2578. package/dist/workspace/layout/project-home.d.ts +39 -0
  2579. package/dist/workspace/layout/project-home.js +195 -0
  2580. package/dist/workspace/layout/resolve-files-ref.d.ts +29 -0
  2581. package/dist/workspace/layout/resolve-files-ref.js +18 -0
  2582. package/dist/workspace/layout/sidebar-cookie.d.ts +12 -0
  2583. package/dist/workspace/layout/sidebar-cookie.js +17 -0
  2584. package/dist/workspace/layout/use-project-home-send.d.ts +20 -0
  2585. package/dist/workspace/layout/use-project-home-send.js +136 -0
  2586. package/dist/workspace/new/account-param.d.ts +3 -0
  2587. package/dist/workspace/new/account-param.js +34 -0
  2588. package/dist/workspace/new/account-picker.d.ts +71 -0
  2589. package/dist/workspace/new/account-picker.js +92 -0
  2590. package/dist/workspace/new/advanced-fields.d.ts +30 -0
  2591. package/dist/workspace/new/advanced-fields.js +261 -0
  2592. package/dist/workspace/new/clone-param.d.ts +11 -0
  2593. package/dist/workspace/new/clone-param.js +15 -0
  2594. package/dist/workspace/new/create-workspace-key.d.ts +10 -0
  2595. package/dist/workspace/new/create-workspace-key.js +106 -0
  2596. package/dist/workspace/new/github-source.d.ts +136 -0
  2597. package/dist/workspace/new/github-source.js +205 -0
  2598. package/dist/workspace/new/github-user-authorization.d.ts +28 -0
  2599. package/dist/workspace/new/github-user-authorization.js +37 -0
  2600. package/dist/workspace/new/new-workspace-form.d.ts +179 -0
  2601. package/dist/workspace/new/new-workspace-form.js +247 -0
  2602. package/dist/workspace/new/repository-options.d.ts +89 -0
  2603. package/dist/workspace/new/repository-options.js +126 -0
  2604. package/dist/workspace/new/source-param.d.ts +19 -0
  2605. package/dist/workspace/new/source-param.js +20 -0
  2606. package/dist/workspace/new/use-creatable-accounts.d.ts +8 -0
  2607. package/dist/workspace/new/use-creatable-accounts.js +24 -0
  2608. package/dist/workspace/new/use-create-workspace.d.ts +520 -0
  2609. package/dist/workspace/new/use-create-workspace.js +751 -0
  2610. package/dist/workspace/new/use-project-quota.d.ts +24 -0
  2611. package/dist/workspace/new/use-project-quota.js +30 -0
  2612. package/dist/workspace/new/workspace-handoff.d.ts +52 -0
  2613. package/dist/workspace/new/workspace-handoff.js +76 -0
  2614. package/dist/workspace/new/workspace-name.d.ts +27 -0
  2615. package/dist/workspace/new/workspace-name.js +71 -0
  2616. package/dist/workspace/project-selector/project-selector-model.d.ts +99 -0
  2617. package/dist/workspace/project-selector/project-selector-model.js +151 -0
  2618. package/dist/workspace/projects/modal/github-import-pickers.d.ts +16 -0
  2619. package/dist/workspace/projects/modal/github-import-pickers.js +78 -0
  2620. package/dist/workspace/projects/modal/project-icon-field.d.ts +74 -0
  2621. package/dist/workspace/projects/modal/project-icon-field.js +225 -0
  2622. package/dist/workspace/projects/onboarding/app-logo.d.ts +5 -0
  2623. package/dist/workspace/projects/onboarding/app-logo.js +18 -0
  2624. package/dist/workspace/projects/onboarding/connect-app.d.ts +37 -0
  2625. package/dist/workspace/projects/onboarding/connect-app.js +48 -0
  2626. package/dist/workspace/projects/policies-panel.d.ts +58 -0
  2627. package/dist/workspace/projects/policies-panel.js +270 -0
  2628. package/dist/workspace/projects/session-shared-icon.d.ts +8 -0
  2629. package/dist/workspace/projects/session-shared-icon.js +12 -0
  2630. package/dist/workspace/projects/session-starter.d.ts +19 -0
  2631. package/dist/workspace/projects/session-starter.js +17 -0
  2632. package/dist/workspace/repository-disconnected.d.ts +12 -0
  2633. package/dist/workspace/repository-disconnected.js +28 -0
  2634. package/dist/workspace/review/approval-modal.d.ts +43 -0
  2635. package/dist/workspace/review/approval-modal.js +91 -0
  2636. package/dist/workspace/review/change-files.d.ts +3 -0
  2637. package/dist/workspace/review/change-files.js +58 -0
  2638. package/dist/workspace/review/hooks/use-review-items.d.ts +64 -0
  2639. package/dist/workspace/review/hooks/use-review-items.js +109 -0
  2640. package/dist/workspace/review/map.d.ts +24 -0
  2641. package/dist/workspace/review/map.js +47 -0
  2642. package/dist/workspace/review/mock-data.d.ts +10 -0
  2643. package/dist/workspace/review/mock-data.js +408 -0
  2644. package/dist/workspace/review/review-actions.d.ts +98 -0
  2645. package/dist/workspace/review/review-actions.js +177 -0
  2646. package/dist/workspace/review/review-center.d.ts +46 -0
  2647. package/dist/workspace/review/review-center.js +798 -0
  2648. package/dist/workspace/review/review-detail.d.ts +30 -0
  2649. package/dist/workspace/review/review-detail.js +210 -0
  2650. package/dist/workspace/review/review-meta.d.ts +59 -0
  2651. package/dist/workspace/review/review-meta.js +100 -0
  2652. package/dist/workspace/review/review-reducer.d.ts +51 -0
  2653. package/dist/workspace/review/review-reducer.js +120 -0
  2654. package/dist/workspace/review/types.d.ts +42 -0
  2655. package/dist/workspace/review/types.js +16 -0
  2656. package/dist/workspace/saved-session-skeleton-rows.d.ts +18 -0
  2657. package/dist/workspace/saved-session-skeleton-rows.js +20 -0
  2658. package/dist/workspace/saved-session-skeleton-shape.d.ts +65 -0
  2659. package/dist/workspace/saved-session-skeleton-shape.js +75 -0
  2660. package/dist/workspace/saved-session-skeleton.d.ts +7 -0
  2661. package/dist/workspace/saved-session-skeleton.js +43 -0
  2662. package/dist/workspace/session-workspace.d.ts +35 -0
  2663. package/dist/workspace/session-workspace.js +234 -0
  2664. package/dist/workspace/sessions/deleted-session-row.d.ts +11 -0
  2665. package/dist/workspace/sessions/deleted-session-row.js +25 -0
  2666. package/dist/workspace/sessions/project-sessions-helpers.d.ts +88 -0
  2667. package/dist/workspace/sessions/project-sessions-helpers.js +208 -0
  2668. package/dist/workspace/sessions/project-sessions-view.d.ts +3 -0
  2669. package/dist/workspace/sessions/project-sessions-view.js +571 -0
  2670. package/dist/workspace/sessions/session-detail.d.ts +10 -0
  2671. package/dist/workspace/sessions/session-detail.js +20 -0
  2672. package/dist/workspace/sessions/session-label-badges.d.ts +7 -0
  2673. package/dist/workspace/sessions/session-label-badges.js +13 -0
  2674. package/dist/workspace/sessions/session-owner-filters.d.ts +61 -0
  2675. package/dist/workspace/sessions/session-owner-filters.js +106 -0
  2676. package/dist/workspace/sessions/session-row.d.ts +57 -0
  2677. package/dist/workspace/sessions/session-row.js +156 -0
  2678. package/dist/workspace/sessions/session-starter-mark.d.ts +15 -0
  2679. package/dist/workspace/sessions/session-starter-mark.js +53 -0
  2680. package/dist/workspace/sessions/sessions-bulk-delete-dialog.d.ts +8 -0
  2681. package/dist/workspace/sessions/sessions-bulk-delete-dialog.js +15 -0
  2682. package/dist/workspace/sessions/sessions-empty-state.d.ts +16 -0
  2683. package/dist/workspace/sessions/sessions-empty-state.js +25 -0
  2684. package/dist/workspace/sessions/sessions-selection-bar.d.ts +15 -0
  2685. package/dist/workspace/sessions/sessions-selection-bar.js +14 -0
  2686. package/dist/workspace/sessions/sessions-toolbar.d.ts +18 -0
  2687. package/dist/workspace/sessions/sessions-toolbar.js +40 -0
  2688. package/dist/workspace/sidebar/customize-sidebar-modal.d.ts +9 -0
  2689. package/dist/workspace/sidebar/customize-sidebar-modal.js +198 -0
  2690. package/dist/workspace/sidebar/footer/project-apps-nav.d.ts +10 -0
  2691. package/dist/workspace/sidebar/footer/project-apps-nav.js +34 -0
  2692. package/dist/workspace/sidebar/footer/project-balance-warning.d.ts +10 -0
  2693. package/dist/workspace/sidebar/footer/project-balance-warning.js +47 -0
  2694. package/dist/workspace/sidebar/footer/project-computer-nav.d.ts +17 -0
  2695. package/dist/workspace/sidebar/footer/project-computer-nav.js +71 -0
  2696. package/dist/workspace/sidebar/footer/project-files-nav.d.ts +29 -0
  2697. package/dist/workspace/sidebar/footer/project-files-nav.js +80 -0
  2698. package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.d.ts +13 -0
  2699. package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.js +48 -0
  2700. package/dist/workspace/sidebar/footer/project-mcp-nav.d.ts +10 -0
  2701. package/dist/workspace/sidebar/footer/project-mcp-nav.js +46 -0
  2702. package/dist/workspace/sidebar/footer/project-rooms-nav.d.ts +9 -0
  2703. package/dist/workspace/sidebar/footer/project-rooms-nav.js +32 -0
  2704. package/dist/workspace/sidebar/footer/project-sandbox-alert.d.ts +3 -0
  2705. package/dist/workspace/sidebar/footer/project-sandbox-alert.js +125 -0
  2706. package/dist/workspace/sidebar/footer/project-upgrade-button.d.ts +6 -0
  2707. package/dist/workspace/sidebar/footer/project-upgrade-button.js +46 -0
  2708. package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +10 -0
  2709. package/dist/workspace/sidebar/footer/promo-nav-row.js +7 -0
  2710. package/dist/workspace/sidebar/footer/sandbox-alert-state.d.ts +31 -0
  2711. package/dist/workspace/sidebar/footer/sandbox-alert-state.js +47 -0
  2712. package/dist/workspace/sidebar/footer/sandbox-health.d.ts +22 -0
  2713. package/dist/workspace/sidebar/footer/sandbox-health.js +107 -0
  2714. package/dist/workspace/sidebar/footer/sidebar-alert.d.ts +54 -0
  2715. package/dist/workspace/sidebar/footer/sidebar-alert.js +86 -0
  2716. package/dist/workspace/sidebar/invitations-menu-group.d.ts +6 -0
  2717. package/dist/workspace/sidebar/invitations-menu-group.js +56 -0
  2718. package/dist/workspace/sidebar/modal/rename-session-modal.d.ts +10 -0
  2719. package/dist/workspace/sidebar/modal/rename-session-modal.js +41 -0
  2720. package/dist/workspace/sidebar/modal/session-labels-modal.d.ts +13 -0
  2721. package/dist/workspace/sidebar/modal/session-labels-modal.js +91 -0
  2722. package/dist/workspace/sidebar/modal/session-labels.d.ts +10 -0
  2723. package/dist/workspace/sidebar/modal/session-labels.js +17 -0
  2724. package/dist/workspace/sidebar/modal/session-public-link-section.d.ts +13 -0
  2725. package/dist/workspace/sidebar/modal/session-public-link-section.js +66 -0
  2726. package/dist/workspace/sidebar/modal/share-session-access.d.ts +33 -0
  2727. package/dist/workspace/sidebar/modal/share-session-access.js +44 -0
  2728. package/dist/workspace/sidebar/modal/share-session-cache.d.ts +15 -0
  2729. package/dist/workspace/sidebar/modal/share-session-cache.js +16 -0
  2730. package/dist/workspace/sidebar/modal/share-session-modal.d.ts +8 -0
  2731. package/dist/workspace/sidebar/modal/share-session-modal.js +109 -0
  2732. package/dist/workspace/sidebar/nav-row-meta.d.ts +14 -0
  2733. package/dist/workspace/sidebar/nav-row-meta.js +70 -0
  2734. package/dist/workspace/sidebar/project-nav-items.d.ts +12 -0
  2735. package/dist/workspace/sidebar/project-nav-items.js +99 -0
  2736. package/dist/workspace/sidebar/project-session-list.d.ts +5 -0
  2737. package/dist/workspace/sidebar/project-session-list.js +608 -0
  2738. package/dist/workspace/sidebar/project-sidebar.d.ts +15 -0
  2739. package/dist/workspace/sidebar/project-sidebar.js +101 -0
  2740. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +68 -0
  2741. package/dist/workspace/sidebar/session-brief-hover-card.js +230 -0
  2742. package/dist/workspace/sidebar/session-filter-menu.d.ts +79 -0
  2743. package/dist/workspace/sidebar/session-filter-menu.js +253 -0
  2744. package/dist/workspace/sidebar/session-grouping.d.ts +142 -0
  2745. package/dist/workspace/sidebar/session-grouping.js +199 -0
  2746. package/dist/workspace/sidebar/session-label-facet.d.ts +14 -0
  2747. package/dist/workspace/sidebar/session-label-facet.js +19 -0
  2748. package/dist/workspace/sidebar/session-open-intent.d.ts +30 -0
  2749. package/dist/workspace/sidebar/session-open-intent.js +58 -0
  2750. package/dist/workspace/sidebar/session-section-labels.d.ts +3 -0
  2751. package/dist/workspace/sidebar/session-section-labels.js +4 -0
  2752. package/dist/workspace/sidebar/session-source-icons.d.ts +19 -0
  2753. package/dist/workspace/sidebar/session-source-icons.js +31 -0
  2754. package/dist/workspace/sidebar/session-status-mark.d.ts +19 -0
  2755. package/dist/workspace/sidebar/session-status-mark.js +70 -0
  2756. package/dist/workspace/sidebar/session-title.d.ts +24 -0
  2757. package/dist/workspace/sidebar/session-title.js +26 -0
  2758. package/dist/workspace/sidebar/workspace-grouping.d.ts +83 -0
  2759. package/dist/workspace/sidebar/workspace-grouping.js +135 -0
  2760. package/dist/workspace/sidebar/workspace-menu-model.d.ts +12 -0
  2761. package/dist/workspace/sidebar/workspace-menu-model.js +108 -0
  2762. package/dist/workspace/sidebar/workspace-menu-section.d.ts +1 -0
  2763. package/dist/workspace/sidebar/workspace-menu-section.js +124 -0
  2764. package/package.json +1819 -417
  2765. package/skills/kortix-ui/SKILL.md +76 -76
  2766. package/skills/kortix-ui/references/custom-dashboard.md +471 -0
  2767. package/skills/kortix-ui/references/modules.md +417 -0
  2768. package/skills/kortix-ui/references/theming.md +107 -0
  2769. package/dist/chat/agent-picker.d.ts +0 -8
  2770. package/dist/chat/agent-picker.js +0 -18
  2771. package/dist/chat/composer.d.ts +0 -31
  2772. package/dist/chat/composer.js +0 -114
  2773. package/dist/chat/index.d.ts +0 -22
  2774. package/dist/chat/index.js +0 -22
  2775. package/dist/chat/markdown.d.ts +0 -10
  2776. package/dist/chat/markdown.js +0 -36
  2777. package/dist/chat/message-list.d.ts +0 -25
  2778. package/dist/chat/message-list.js +0 -73
  2779. package/dist/chat/message-view.d.ts +0 -17
  2780. package/dist/chat/message-view.js +0 -86
  2781. package/dist/chat/model-picker.d.ts +0 -10
  2782. package/dist/chat/model-picker.js +0 -68
  2783. package/dist/chat/permission-prompt.d.ts +0 -10
  2784. package/dist/chat/permission-prompt.js +0 -40
  2785. package/dist/chat/question-prompt.d.ts +0 -8
  2786. package/dist/chat/question-prompt.js +0 -60
  2787. package/dist/chat/send-failure.d.ts +0 -9
  2788. package/dist/chat/send-failure.js +0 -21
  2789. package/dist/chat/session-thread.d.ts +0 -28
  2790. package/dist/chat/session-thread.js +0 -47
  2791. package/dist/chat/streaming-markdown.d.ts +0 -21
  2792. package/dist/chat/streaming-markdown.js +0 -59
  2793. package/dist/chat/tool-call.d.ts +0 -4
  2794. package/dist/chat/tool-call.js +0 -150
  2795. package/dist/chat/user-message-parts.d.ts +0 -6
  2796. package/dist/chat/user-message-parts.js +0 -11
  2797. package/dist/components/ui/accordion.js +0 -18
  2798. package/dist/components/ui/alert-dialog.js +0 -48
  2799. package/dist/components/ui/alert.d.ts +0 -13
  2800. package/dist/components/ui/alert.js +0 -67
  2801. package/dist/components/ui/avatar.js +0 -23
  2802. package/dist/components/ui/back-pill.js +0 -18
  2803. package/dist/components/ui/badge.d.ts +0 -10
  2804. package/dist/components/ui/badge.js +0 -42
  2805. package/dist/components/ui/breadcrumb.js +0 -28
  2806. package/dist/components/ui/bubble.d.ts +0 -20
  2807. package/dist/components/ui/bubble.js +0 -38
  2808. package/dist/components/ui/button-group.js +0 -32
  2809. package/dist/components/ui/button.d.ts +0 -13
  2810. package/dist/components/ui/button.js +0 -67
  2811. package/dist/components/ui/calendar.js +0 -39
  2812. package/dist/components/ui/card.d.ts +0 -96
  2813. package/dist/components/ui/card.js +0 -291
  2814. package/dist/components/ui/chain-of-thought.js +0 -66
  2815. package/dist/components/ui/chart.js +0 -118
  2816. package/dist/components/ui/checkbox-group.js +0 -41
  2817. package/dist/components/ui/checkbox.js +0 -27
  2818. package/dist/components/ui/collapsible.js +0 -14
  2819. package/dist/components/ui/command.js +0 -135
  2820. package/dist/components/ui/confirm-dialog.js +0 -30
  2821. package/dist/components/ui/context-menu.d.ts +0 -45
  2822. package/dist/components/ui/context-menu.js +0 -93
  2823. package/dist/components/ui/count-badge.d.ts +0 -26
  2824. package/dist/components/ui/count-badge.js +0 -26
  2825. package/dist/components/ui/data-grid.js +0 -107
  2826. package/dist/components/ui/date-range-picker.js +0 -190
  2827. package/dist/components/ui/definition-list.js +0 -26
  2828. package/dist/components/ui/dialog.d.ts +0 -29
  2829. package/dist/components/ui/dialog.js +0 -52
  2830. package/dist/components/ui/disclosure.js +0 -138
  2831. package/dist/components/ui/dot-matrix/dotm-3x3-10.d.ts +0 -4
  2832. package/dist/components/ui/dot-matrix/dotm-3x3-10.js +0 -29
  2833. package/dist/components/ui/dot-matrix/dotm-3x3-12.d.ts +0 -4
  2834. package/dist/components/ui/dot-matrix/dotm-3x3-12.js +0 -19
  2835. package/dist/components/ui/dot-matrix/dotm-3x3-13.d.ts +0 -4
  2836. package/dist/components/ui/dot-matrix/dotm-3x3-13.js +0 -19
  2837. package/dist/components/ui/dot-matrix/dotm-3x3-15.d.ts +0 -4
  2838. package/dist/components/ui/dot-matrix/dotm-3x3-15.js +0 -22
  2839. package/dist/components/ui/dot-matrix/dotm-3x3-16.d.ts +0 -4
  2840. package/dist/components/ui/dot-matrix/dotm-3x3-16.js +0 -5
  2841. package/dist/components/ui/dot-matrix/dotm-3x3-18.d.ts +0 -4
  2842. package/dist/components/ui/dot-matrix/dotm-3x3-18.js +0 -5
  2843. package/dist/components/ui/dot-matrix/dotm-3x3-19.d.ts +0 -4
  2844. package/dist/components/ui/dot-matrix/dotm-3x3-19.js +0 -5
  2845. package/dist/components/ui/dot-matrix/dotm-3x3-2.d.ts +0 -4
  2846. package/dist/components/ui/dot-matrix/dotm-3x3-2.js +0 -3
  2847. package/dist/components/ui/dot-matrix/dotm-3x3-20.d.ts +0 -4
  2848. package/dist/components/ui/dot-matrix/dotm-3x3-20.js +0 -5
  2849. package/dist/components/ui/dot-matrix/dotm-3x3-21.d.ts +0 -4
  2850. package/dist/components/ui/dot-matrix/dotm-3x3-21.js +0 -5
  2851. package/dist/components/ui/dot-matrix/dotm-3x3-3.d.ts +0 -4
  2852. package/dist/components/ui/dot-matrix/dotm-3x3-3.js +0 -3
  2853. package/dist/components/ui/dot-matrix/dotm-3x3-4.d.ts +0 -4
  2854. package/dist/components/ui/dot-matrix/dotm-3x3-4.js +0 -3
  2855. package/dist/components/ui/dot-matrix/dotm-3x3-5.d.ts +0 -4
  2856. package/dist/components/ui/dot-matrix/dotm-3x3-5.js +0 -3
  2857. package/dist/components/ui/dot-matrix/dotm-3x3-6.d.ts +0 -4
  2858. package/dist/components/ui/dot-matrix/dotm-3x3-6.js +0 -19
  2859. package/dist/components/ui/dot-matrix/dotm-3x3-7.d.ts +0 -4
  2860. package/dist/components/ui/dot-matrix/dotm-3x3-7.js +0 -19
  2861. package/dist/components/ui/dot-matrix/dotm-3x3-8.d.ts +0 -4
  2862. package/dist/components/ui/dot-matrix/dotm-3x3-8.js +0 -19
  2863. package/dist/components/ui/dot-matrix/dotm-3x3-9.d.ts +0 -4
  2864. package/dist/components/ui/dot-matrix/dotm-3x3-9.js +0 -23
  2865. package/dist/components/ui/dot-matrix/dotm-circular-1.d.ts +0 -4
  2866. package/dist/components/ui/dot-matrix/dotm-circular-1.js +0 -28
  2867. package/dist/components/ui/dot-matrix/dotm-circular-10.d.ts +0 -4
  2868. package/dist/components/ui/dot-matrix/dotm-circular-10.js +0 -40
  2869. package/dist/components/ui/dot-matrix/dotm-circular-11.d.ts +0 -4
  2870. package/dist/components/ui/dot-matrix/dotm-circular-11.js +0 -37
  2871. package/dist/components/ui/dot-matrix/dotm-circular-12.d.ts +0 -4
  2872. package/dist/components/ui/dot-matrix/dotm-circular-12.js +0 -42
  2873. package/dist/components/ui/dot-matrix/dotm-circular-14.d.ts +0 -4
  2874. package/dist/components/ui/dot-matrix/dotm-circular-14.js +0 -37
  2875. package/dist/components/ui/dot-matrix/dotm-circular-15.d.ts +0 -4
  2876. package/dist/components/ui/dot-matrix/dotm-circular-15.js +0 -49
  2877. package/dist/components/ui/dot-matrix/dotm-circular-17.d.ts +0 -4
  2878. package/dist/components/ui/dot-matrix/dotm-circular-17.js +0 -31
  2879. package/dist/components/ui/dot-matrix/dotm-circular-2.d.ts +0 -4
  2880. package/dist/components/ui/dot-matrix/dotm-circular-2.js +0 -37
  2881. package/dist/components/ui/dot-matrix/dotm-circular-3.d.ts +0 -4
  2882. package/dist/components/ui/dot-matrix/dotm-circular-3.js +0 -54
  2883. package/dist/components/ui/dot-matrix/dotm-circular-4.d.ts +0 -4
  2884. package/dist/components/ui/dot-matrix/dotm-circular-4.js +0 -35
  2885. package/dist/components/ui/dot-matrix/dotm-circular-5.d.ts +0 -4
  2886. package/dist/components/ui/dot-matrix/dotm-circular-5.js +0 -30
  2887. package/dist/components/ui/dot-matrix/dotm-circular-6.d.ts +0 -4
  2888. package/dist/components/ui/dot-matrix/dotm-circular-6.js +0 -37
  2889. package/dist/components/ui/dot-matrix/dotm-circular-7.d.ts +0 -4
  2890. package/dist/components/ui/dot-matrix/dotm-circular-7.js +0 -25
  2891. package/dist/components/ui/dot-matrix/dotm-circular-8.d.ts +0 -4
  2892. package/dist/components/ui/dot-matrix/dotm-circular-8.js +0 -26
  2893. package/dist/components/ui/dot-matrix/dotm-circular-9.d.ts +0 -4
  2894. package/dist/components/ui/dot-matrix/dotm-circular-9.js +0 -41
  2895. package/dist/components/ui/dot-matrix/dotm-square-1.d.ts +0 -4
  2896. package/dist/components/ui/dot-matrix/dotm-square-1.js +0 -27
  2897. package/dist/components/ui/dot-matrix/dotm-square-10.d.ts +0 -4
  2898. package/dist/components/ui/dot-matrix/dotm-square-10.js +0 -27
  2899. package/dist/components/ui/dot-matrix/dotm-square-11.d.ts +0 -4
  2900. package/dist/components/ui/dot-matrix/dotm-square-11.js +0 -25
  2901. package/dist/components/ui/dot-matrix/dotm-square-12.d.ts +0 -4
  2902. package/dist/components/ui/dot-matrix/dotm-square-12.js +0 -28
  2903. package/dist/components/ui/dot-matrix/dotm-square-13.d.ts +0 -4
  2904. package/dist/components/ui/dot-matrix/dotm-square-13.js +0 -45
  2905. package/dist/components/ui/dot-matrix/dotm-square-14.d.ts +0 -4
  2906. package/dist/components/ui/dot-matrix/dotm-square-14.js +0 -38
  2907. package/dist/components/ui/dot-matrix/dotm-square-15.d.ts +0 -4
  2908. package/dist/components/ui/dot-matrix/dotm-square-15.js +0 -31
  2909. package/dist/components/ui/dot-matrix/dotm-square-16.d.ts +0 -4
  2910. package/dist/components/ui/dot-matrix/dotm-square-16.js +0 -33
  2911. package/dist/components/ui/dot-matrix/dotm-square-17.d.ts +0 -4
  2912. package/dist/components/ui/dot-matrix/dotm-square-17.js +0 -27
  2913. package/dist/components/ui/dot-matrix/dotm-square-18.d.ts +0 -4
  2914. package/dist/components/ui/dot-matrix/dotm-square-18.js +0 -29
  2915. package/dist/components/ui/dot-matrix/dotm-square-19.d.ts +0 -4
  2916. package/dist/components/ui/dot-matrix/dotm-square-19.js +0 -74
  2917. package/dist/components/ui/dot-matrix/dotm-square-2.d.ts +0 -4
  2918. package/dist/components/ui/dot-matrix/dotm-square-2.js +0 -72
  2919. package/dist/components/ui/dot-matrix/dotm-square-20.d.ts +0 -4
  2920. package/dist/components/ui/dot-matrix/dotm-square-20.js +0 -79
  2921. package/dist/components/ui/dot-matrix/dotm-square-3.d.ts +0 -4
  2922. package/dist/components/ui/dot-matrix/dotm-square-3.js +0 -23
  2923. package/dist/components/ui/dot-matrix/dotm-square-4.d.ts +0 -4
  2924. package/dist/components/ui/dot-matrix/dotm-square-4.js +0 -41
  2925. package/dist/components/ui/dot-matrix/dotm-square-5.d.ts +0 -4
  2926. package/dist/components/ui/dot-matrix/dotm-square-5.js +0 -23
  2927. package/dist/components/ui/dot-matrix/dotm-square-6.d.ts +0 -4
  2928. package/dist/components/ui/dot-matrix/dotm-square-6.js +0 -20
  2929. package/dist/components/ui/dot-matrix/dotm-square-7.d.ts +0 -4
  2930. package/dist/components/ui/dot-matrix/dotm-square-7.js +0 -43
  2931. package/dist/components/ui/dot-matrix/dotm-square-8.d.ts +0 -4
  2932. package/dist/components/ui/dot-matrix/dotm-square-8.js +0 -57
  2933. package/dist/components/ui/dot-matrix/dotm-square-9.d.ts +0 -4
  2934. package/dist/components/ui/dot-matrix/dotm-square-9.js +0 -89
  2935. package/dist/components/ui/dot-matrix/session-dot-matrix.d.ts +0 -46
  2936. package/dist/components/ui/drawer.js +0 -35
  2937. package/dist/components/ui/dropdown-menu.d.ts +0 -49
  2938. package/dist/components/ui/dropdown-menu.js +0 -113
  2939. package/dist/components/ui/emoji-picker.js +0 -137
  2940. package/dist/components/ui/empty.js +0 -33
  2941. package/dist/components/ui/entity-avatar.js +0 -106
  2942. package/dist/components/ui/faded-scroll-area.js +0 -80
  2943. package/dist/components/ui/favicon-avatar.js +0 -18
  2944. package/dist/components/ui/field.d.ts +0 -15
  2945. package/dist/components/ui/field.js +0 -48
  2946. package/dist/components/ui/file-tree.js +0 -30
  2947. package/dist/components/ui/glyph-face.js +0 -37
  2948. package/dist/components/ui/glyph-paths-source.js +0 -40
  2949. package/dist/components/ui/glyph-paths.generated.js +0 -207
  2950. package/dist/components/ui/glyph-picker.js +0 -118
  2951. package/dist/components/ui/glyph-tint.js +0 -93
  2952. package/dist/components/ui/histogram-bars.js +0 -93
  2953. package/dist/components/ui/hover-card.d.ts +0 -28
  2954. package/dist/components/ui/hover-card.js +0 -35
  2955. package/dist/components/ui/icon-provider.js +0 -30
  2956. package/dist/components/ui/info-banner.js +0 -72
  2957. package/dist/components/ui/inline-meta.js +0 -8
  2958. package/dist/components/ui/input-group.js +0 -73
  2959. package/dist/components/ui/input.js +0 -23
  2960. package/dist/components/ui/item.d.ts +0 -23
  2961. package/dist/components/ui/item.js +0 -67
  2962. package/dist/components/ui/kbd.js +0 -20
  2963. package/dist/components/ui/kortix-asterisk.js +0 -17
  2964. package/dist/components/ui/kortix-loader.js +0 -74
  2965. package/dist/components/ui/kortix-logo.js +0 -47
  2966. package/dist/components/ui/label.js +0 -9
  2967. package/dist/components/ui/list.js +0 -25
  2968. package/dist/components/ui/loading.js +0 -31
  2969. package/dist/components/ui/map.js +0 -257
  2970. package/dist/components/ui/marker.d.ts +0 -14
  2971. package/dist/components/ui/marker.js +0 -28
  2972. package/dist/components/ui/menu-recipe.js +0 -129
  2973. package/dist/components/ui/mermaid-render.d.ts +0 -51
  2974. package/dist/components/ui/mermaid-render.js +0 -65
  2975. package/dist/components/ui/mermaid-renderer.js +0 -340
  2976. package/dist/components/ui/message.js +0 -26
  2977. package/dist/components/ui/modal.d.ts +0 -104
  2978. package/dist/components/ui/modal.js +0 -180
  2979. package/dist/components/ui/navigation-menu.js +0 -35
  2980. package/dist/components/ui/page-search-bar.js +0 -13
  2981. package/dist/components/ui/phone-input.js +0 -59
  2982. package/dist/components/ui/pixel-kortix-mark.js +0 -40
  2983. package/dist/components/ui/popover.js +0 -38
  2984. package/dist/components/ui/portal.js +0 -15
  2985. package/dist/components/ui/preview-image.d.ts +0 -14
  2986. package/dist/components/ui/preview-image.js +0 -58
  2987. package/dist/components/ui/progress-ring.js +0 -9
  2988. package/dist/components/ui/progress.js +0 -8
  2989. package/dist/components/ui/radio-group.js +0 -20
  2990. package/dist/components/ui/resizable.d.ts +0 -24
  2991. package/dist/components/ui/resizable.js +0 -16
  2992. package/dist/components/ui/scroll-area.js +0 -11
  2993. package/dist/components/ui/section-card.js +0 -14
  2994. package/dist/components/ui/section.js +0 -22
  2995. package/dist/components/ui/select.js +0 -59
  2996. package/dist/components/ui/separator.js +0 -8
  2997. package/dist/components/ui/sheet.d.ts +0 -32
  2998. package/dist/components/ui/sheet.js +0 -55
  2999. package/dist/components/ui/sidebar-menu-primitives.d.ts +0 -38
  3000. package/dist/components/ui/sidebar-menu-primitives.js +0 -97
  3001. package/dist/components/ui/sidebar-panel.js +0 -265
  3002. package/dist/components/ui/sidebar.js +0 -194
  3003. package/dist/components/ui/skeleton.js +0 -6
  3004. package/dist/components/ui/slider-native.js +0 -16
  3005. package/dist/components/ui/slider.js +0 -48
  3006. package/dist/components/ui/sliding-tab-indicator.js +0 -128
  3007. package/dist/components/ui/split-sheet.js +0 -239
  3008. package/dist/components/ui/spotlight-card.js +0 -43
  3009. package/dist/components/ui/status.js +0 -76
  3010. package/dist/components/ui/stepper.js +0 -73
  3011. package/dist/components/ui/switch.js +0 -131
  3012. package/dist/components/ui/system-message.js +0 -51
  3013. package/dist/components/ui/table.js +0 -28
  3014. package/dist/components/ui/tabs.js +0 -207
  3015. package/dist/components/ui/tag.d.ts +0 -7
  3016. package/dist/components/ui/tag.js +0 -22
  3017. package/dist/components/ui/text-shimmer.js +0 -91
  3018. package/dist/components/ui/textarea.js +0 -87
  3019. package/dist/components/ui/toast.js +0 -233
  3020. package/dist/components/ui/toggle.d.ts +0 -12
  3021. package/dist/components/ui/toggle.js +0 -26
  3022. package/dist/components/ui/tooltip.js +0 -16
  3023. package/dist/components/ui/trigger-variants.js +0 -67
  3024. package/dist/components/ui/type-to-confirm-dialog.js +0 -101
  3025. package/dist/components/ui/typed-title.js +0 -66
  3026. package/dist/components/ui/typing-animation.js +0 -141
  3027. package/dist/components/ui/user-avatar.js +0 -46
  3028. /package/dist/{components/ui → primitives}/accordion.d.ts +0 -0
  3029. /package/dist/{components/ui → primitives}/alert-dialog.d.ts +0 -0
  3030. /package/dist/{components/ui → primitives}/avatar.d.ts +0 -0
  3031. /package/dist/{components/ui → primitives}/back-pill.d.ts +0 -0
  3032. /package/dist/{components/ui → primitives}/breadcrumb.d.ts +0 -0
  3033. /package/dist/{components/ui → primitives}/button-group.d.ts +0 -0
  3034. /package/dist/{components/ui → primitives}/calendar.d.ts +0 -0
  3035. /package/dist/{components/ui → primitives}/chain-of-thought.d.ts +0 -0
  3036. /package/dist/{components/ui → primitives}/chart.d.ts +0 -0
  3037. /package/dist/{components/ui → primitives}/checkbox-group.d.ts +0 -0
  3038. /package/dist/{components/ui → primitives}/checkbox.d.ts +0 -0
  3039. /package/dist/{components/ui → primitives}/collapsible.d.ts +0 -0
  3040. /package/dist/{components/ui → primitives}/command.d.ts +0 -0
  3041. /package/dist/{components/ui → primitives}/confirm-dialog.d.ts +0 -0
  3042. /package/dist/{components/ui → primitives}/data-grid.d.ts +0 -0
  3043. /package/dist/{components/ui → primitives}/date-range-picker.d.ts +0 -0
  3044. /package/dist/{components/ui → primitives}/definition-list.d.ts +0 -0
  3045. /package/dist/{components/ui → primitives}/disclosure.d.ts +0 -0
  3046. /package/dist/{components/ui → primitives}/dot-matrix/session-dot-matrix.js +0 -0
  3047. /package/dist/{components/ui → primitives}/drawer.d.ts +0 -0
  3048. /package/dist/{components/ui → primitives}/emoji-picker.d.ts +0 -0
  3049. /package/dist/{components/ui → primitives}/emoji-tint.d.ts +0 -0
  3050. /package/dist/{components/ui → primitives}/emoji-tint.js +0 -0
  3051. /package/dist/{components/ui → primitives}/empty.d.ts +0 -0
  3052. /package/dist/{components/ui → primitives}/entity-avatar.d.ts +0 -0
  3053. /package/dist/{components/ui → primitives}/faded-scroll-area.d.ts +0 -0
  3054. /package/dist/{components/ui → primitives}/favicon-avatar.d.ts +0 -0
  3055. /package/dist/{components/ui → primitives}/file-tree.d.ts +0 -0
  3056. /package/dist/{components/ui → primitives}/glyph-face.d.ts +0 -0
  3057. /package/dist/{components/ui → primitives}/glyph-paths-source.d.ts +0 -0
  3058. /package/dist/{components/ui → primitives}/glyph-paths.generated.d.ts +0 -0
  3059. /package/dist/{components/ui → primitives}/glyph-picker.d.ts +0 -0
  3060. /package/dist/{components/ui → primitives}/glyph-registry.d.ts +0 -0
  3061. /package/dist/{components/ui → primitives}/glyph-registry.js +0 -0
  3062. /package/dist/{components/ui → primitives}/glyph-tint.d.ts +0 -0
  3063. /package/dist/{components/ui → primitives}/hint.d.ts +0 -0
  3064. /package/dist/{components/ui → primitives}/hint.js +0 -0
  3065. /package/dist/{components/ui → primitives}/histogram-bars.d.ts +0 -0
  3066. /package/dist/{components/ui → primitives}/icon-provider.d.ts +0 -0
  3067. /package/dist/{components/ui → primitives}/info-banner.d.ts +0 -0
  3068. /package/dist/{components/ui → primitives}/inline-meta.d.ts +0 -0
  3069. /package/dist/{components/ui → primitives}/input-group.d.ts +0 -0
  3070. /package/dist/{components/ui → primitives}/input.d.ts +0 -0
  3071. /package/dist/{components/ui → primitives}/kbd.d.ts +0 -0
  3072. /package/dist/{components/ui → primitives}/kortix-asterisk.d.ts +0 -0
  3073. /package/dist/{components/ui → primitives}/kortix-icons.d.ts +0 -0
  3074. /package/dist/{components/ui → primitives}/kortix-icons.js +0 -0
  3075. /package/dist/{components/ui → primitives}/kortix-loader.d.ts +0 -0
  3076. /package/dist/{components/ui → primitives}/kortix-logo.d.ts +0 -0
  3077. /package/dist/{components/ui → primitives}/label.d.ts +0 -0
  3078. /package/dist/{components/ui → primitives}/list.d.ts +0 -0
  3079. /package/dist/{components/ui → primitives}/loading.d.ts +0 -0
  3080. /package/dist/{components/ui → primitives}/local-time.d.ts +0 -0
  3081. /package/dist/{components/ui → primitives}/local-time.js +0 -0
  3082. /package/dist/{components/ui → primitives}/map.d.ts +0 -0
  3083. /package/dist/{components/ui → primitives}/menu-recipe.d.ts +0 -0
  3084. /package/dist/{components/ui → primitives}/mermaid-renderer.d.ts +0 -0
  3085. /package/dist/{components/ui → primitives}/message.d.ts +0 -0
  3086. /package/dist/{components/ui → primitives}/navigation-menu.d.ts +0 -0
  3087. /package/dist/{components/ui → primitives}/page-search-bar.d.ts +0 -0
  3088. /package/dist/{components/ui → primitives}/phone-input.d.ts +0 -0
  3089. /package/dist/{components/ui → primitives}/pixel-kortix-mark.d.ts +0 -0
  3090. /package/dist/{components/ui → primitives}/popover.d.ts +0 -0
  3091. /package/dist/{components/ui → primitives}/portal.d.ts +0 -0
  3092. /package/dist/{components/ui → primitives}/progress-ring.d.ts +0 -0
  3093. /package/dist/{components/ui → primitives}/progress.d.ts +0 -0
  3094. /package/dist/{components/ui → primitives}/radio-group.d.ts +0 -0
  3095. /package/dist/{components/ui → primitives}/scroll-area.d.ts +0 -0
  3096. /package/dist/{components/ui → primitives}/section-card.d.ts +0 -0
  3097. /package/dist/{components/ui → primitives}/section.d.ts +0 -0
  3098. /package/dist/{components/ui → primitives}/select.d.ts +0 -0
  3099. /package/dist/{components/ui → primitives}/separator.d.ts +0 -0
  3100. /package/dist/{components/ui → primitives}/shader-safe.d.ts +0 -0
  3101. /package/dist/{components/ui → primitives}/shader-safe.js +0 -0
  3102. /package/dist/{components/ui → primitives}/sidebar-context.d.ts +0 -0
  3103. /package/dist/{components/ui → primitives}/sidebar-context.js +0 -0
  3104. /package/dist/{components/ui → primitives}/sidebar-panel.d.ts +0 -0
  3105. /package/dist/{components/ui → primitives}/sidebar-peek.d.ts +0 -0
  3106. /package/dist/{components/ui → primitives}/sidebar-peek.js +0 -0
  3107. /package/dist/{components/ui → primitives}/sidebar-width.d.ts +0 -0
  3108. /package/dist/{components/ui → primitives}/sidebar-width.js +0 -0
  3109. /package/dist/{components/ui → primitives}/sidebar.d.ts +0 -0
  3110. /package/dist/{components/ui → primitives}/skeleton.d.ts +0 -0
  3111. /package/dist/{components/ui → primitives}/slider-native.d.ts +0 -0
  3112. /package/dist/{components/ui → primitives}/slider.d.ts +0 -0
  3113. /package/dist/{components/ui → primitives}/sliding-tab-indicator.d.ts +0 -0
  3114. /package/dist/{components/ui → primitives}/split-sheet.d.ts +0 -0
  3115. /package/dist/{components/ui → primitives}/spotlight-card.d.ts +0 -0
  3116. /package/dist/{components/ui → primitives}/status-ring.d.ts +0 -0
  3117. /package/dist/{components/ui → primitives}/status-ring.js +0 -0
  3118. /package/dist/{components/ui → primitives}/status.d.ts +0 -0
  3119. /package/dist/{components/ui → primitives}/stepper.d.ts +0 -0
  3120. /package/dist/{components/ui → primitives}/switch.d.ts +0 -0
  3121. /package/dist/{components/ui → primitives}/system-message.d.ts +0 -0
  3122. /package/dist/{components/ui → primitives}/table.d.ts +0 -0
  3123. /package/dist/{components/ui → primitives}/tabs.d.ts +0 -0
  3124. /package/dist/{components/ui → primitives}/text-shimmer.d.ts +0 -0
  3125. /package/dist/{components/ui → primitives}/textarea.d.ts +0 -0
  3126. /package/dist/{components/ui → primitives}/toast.d.ts +0 -0
  3127. /package/dist/{components/ui → primitives}/tooltip.d.ts +0 -0
  3128. /package/dist/{components/ui → primitives}/trigger-variants.d.ts +0 -0
  3129. /package/dist/{components/ui → primitives}/type-to-confirm-dialog.d.ts +0 -0
  3130. /package/dist/{components/ui → primitives}/typed-title-logic.d.ts +0 -0
  3131. /package/dist/{components/ui → primitives}/typed-title-logic.js +0 -0
  3132. /package/dist/{components/ui → primitives}/typed-title.d.ts +0 -0
  3133. /package/dist/{components/ui → primitives}/typing-animation.d.ts +0 -0
  3134. /package/dist/{components/ui → primitives}/user-avatar.d.ts +0 -0
@@ -0,0 +1,3676 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { uiRoutes } from '../../lib/routes.js';
4
+ import { isQuestionTool } from '@kortix/sdk';
5
+ import { SessionApprovalPrompt } from '../prompts/session-approval-prompt.js';
6
+ import { childSessionHref } from '../tool/tools/session-spawn-urls.js';
7
+ import { SessionPermissionPrompt } from '../prompts/session-permission-prompt.js';
8
+ import { useSessionWallpaperLayer } from '../panel/session-wallpaper-layer.js';
9
+ import { useTranslations } from '../../i18n/index.js';
10
+ import { errorMessageOf, isDeliveredButDisconnected } from '../../internal/lib/delivered-but-disconnected.js';
11
+ import { useQueuedDraftStore, useQueuedDrafts } from '../composer/stores/queued-draft-store.js';
12
+ import { SESSION_LOG_MINOR, SESSION_LOG_SCHEMA, listSessionPrompts, projectSessionConnection, sessionLogOfV1Rows, sessionLogPromptMessage, sessionLogRetrying, sessionLogTurns, fetchSessionAttachment, sessionLogFullTextPlan, sessionLogHarnessSwitches, sessionLogRestoreNotice, sessionLogWithFullTexts, } from '@kortix/sdk';
13
+ import { useProjectSession, useSessionLogOlder, useSessionLogRecord, useSessionLogThread, useSessionMessageAuthors, useSessionModelUsage, useSessionParticipants, } from '@kortix/sdk/react';
14
+ import { ArrowBendUpLeftIcon, CaretDownIcon, StackIcon as Layers, } from '@phosphor-icons/react';
15
+ import { useUiLink, useUiPathname, useUiRouter, useUiShallowNavigate, useUiSearchParams, useUiViewerId, } from '../../providers/ui-provider.js';
16
+ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
17
+ import { createPortal } from 'react-dom';
18
+ import { AUTHOR_RETRY_DELAYS_MS, authorForTurn, awaitsAgent, missingAuthorKey, resolveTranscriptAuthors, showAuthorName, stoppedByName, } from '../turn/message-author.js';
19
+ import { stopRefusalMessage } from '../status/stop-refusal.js';
20
+ import { QueuedPromptList } from '../composer/queued-prompt-list.js';
21
+ import { runtimePermissionLocksComposer } from '../composer/send-blockers.js';
22
+ import { SessionPrintHeader } from '../print/session-print-header.js';
23
+ import { useSessionPrint } from '../print/use-session-print.js';
24
+ import { COMPOSER_EDITOR_SELECTOR, SUGGESTION_MENU_SELECTOR, shouldCountEscape, } from '../composer/esc-to-stop.js';
25
+ import { composerSendDelivery, isFirstPromptRow, projectQueueRows } from '../composer/queue-projection.js';
26
+ import { useQueuedPromptEdit } from '../composer/queued-prompt-edit.js';
27
+ import { createQueueUndoAction } from '../composer/queued-message-restore.js';
28
+ import { CompactionMarker, CompactionSummaryBody } from '../turn/compaction-card.js';
29
+ import { chatPlanAnchorId } from '../turn/plan-anchor.js';
30
+ import { PastedTextBody, PastedTextCopy, PastedTextMeta } from '../composer/pasted-text.js';
31
+ import { fallbackBusyRowAfterTurnId, freshSendHint, shouldSuppressWorkingTurnBusy, turnIsConfirmedActive, turnRendersQueued, workingTurnDrawsBusyRow, } from '@kortix/sdk';
32
+ import { ChangeRequestDetailDialog } from '../../files/project/components/change-request-detail-dialog.js';
33
+ import { warmHighlighter } from '../../markdown/code/shiki-highlighter.js';
34
+ import { ProjectFilesProvider } from '../../files/project/context.js';
35
+ import { useOptionalSessionPanel } from '../panel/session-panel-provider.js';
36
+ import { COMPOSER_SHELL_CLASS, Composer as SessionChatInput, } from '../composer/composer.js';
37
+ import { ComposerDropZone } from '../composer/composer-drop-zone.js';
38
+ import { resolveComposerAgent } from '../composer/composer-agent-access.js';
39
+ import { acknowledgeQuoteRequests, } from '../composer/composer-logic.js';
40
+ import { sessionSlashFiles } from '../composer/menus/slash-files.js';
41
+ import { resolveFirstPromptHandover, transcriptCarriesFirstPrompt, } from './first-prompt-handover.js';
42
+ import { CompactModal } from '../header/compact-modal.js';
43
+ import { SessionSiteHeader } from '../header/session-site-header.js';
44
+ import { claimFirstTurnRow } from '../composer/inbox-row-claims.js';
45
+ import { OptimisticTurn } from './optimistic-turn.js';
46
+ import { inboxHoldsLivePrompt } from '../composer/inbox-live-prompt.js';
47
+ import { SessionOutcomesProvider } from '../outcomes/session-outcomes-provider.js';
48
+ import { SessionOverridesComposer } from '../overrides/session-overrides-composer.js';
49
+ import { QuestionPrompt, } from '../prompts/question-prompt.js';
50
+ import { SESSION_TRANSCRIPT_CLASS, SessionBodyRow } from './session-body.js';
51
+ import { SessionContextModal } from './session-context-modal.js';
52
+ import { TurnErrorDisplay } from '../status/session-error-banner.js';
53
+ import { deliverAfterPaint, sentFailureMessage, } from '../composer/attachment-submission.js';
54
+ import { SessionWelcome } from './session-welcome.js';
55
+ import { editResendAttachments, } from '../turn/user-message.js';
56
+ import { SessionBusyIndicator } from '../status/session-busy-indicator.js';
57
+ import { useSessionBaseRef } from '../panel/session-changes-shared.js';
58
+ import { resolveEffectiveBusy } from '../status/session-chat-busy.js';
59
+ import { MODEL_USAGE_SETTLE_MS, servedModelNotice, sessionBilledCost, turnServedModelResolver } from '../turn/served-model.js';
60
+ import { sessionTurnSpan } from './session-turn-meta-rows.js';
61
+ import { Button } from '../../primitives/button.js';
62
+ import Loading from '../../primitives/loading.js';
63
+ import { dismissToast, errorToast, infoToast, undoToast } from '../../primitives/toast.js';
64
+ // billingApi / invalidateAccountState / useQueryClient removed — billing is handled server-side by the router
65
+ import { ChatMinimap } from './chat-minimap.js';
66
+ import { usePlanInChat } from './plan-surface.js';
67
+ import { SessionStartingLoader } from '../status/session-starting-loader.js';
68
+ import { ToolActivateContext } from '../tool/tool-renderers.js';
69
+ import { firstPromptAttachments, retainSentAttachmentPreviews, sentAttachmentsForTurn, } from '../composer/sent-attachment-previews.js';
70
+ import { buildOptimisticPromptTextWithUploads, promptFileParts, sentAttachmentsOf, } from '../composer/uploaded-file-refs.js';
71
+ import { useAutoScroll } from '../../internal/hooks/use-auto-scroll.js';
72
+ import { appendSessionRefs, buildAgentRefsBlock, buildFileRefsBlock, } from '../../internal/lib/project-preamble.js';
73
+ import { playSound } from '../../internal/lib/sounds.js';
74
+ import { track } from '../../lib/telemetry.js';
75
+ import { cn } from '../../lib/utils.js';
76
+ import { useChatSendStore } from '../../internal/stores/chat-send-store.js';
77
+ import { useKortixComputerStore } from '../../internal/stores/kortix-computer-store.js';
78
+ import { useMessageJumpStore } from '../../internal/stores/message-jump-store.js';
79
+ import { useOnboardingModeStore } from '../../internal/stores/onboarding-mode-store.js';
80
+ import { useSessionBrowserStore } from '../../internal/stores/session-browser-store.js';
81
+ import { retryHeldSend, useFirstPromptPreviewStore, useHeldSendFailureStore, } from '../composer/stores/session-composer-handoff-store.js';
82
+ import { useAttachRequest, useSessionComposerPrefillStore, useSessionPrefill, } from '../composer/stores/session-composer-prefill-store.js';
83
+ import { openTabAndNavigate, useTabStore } from '../../internal/stores/tab-store.js';
84
+ import { projectSessionHref } from '../../internal/lib/navigation/session-href.js';
85
+ import { getRetryInfo } from '../../internal/session-types/index.js';
86
+ import { useModelPricingLookup } from '../../internal/lib/model-pricing.js';
87
+ import { isAbortError, latestPromptModel, turnEndNotice } from '@kortix/sdk';
88
+ import { failureShownByTurn, failureSupersededByTurn, persistedFailureText, } from './persisted-turn-failure.js';
89
+ import { abandonOptimisticSend, applyOptimisticAbort, ascendingId, awaitAbortSettlement, beginOptimisticSend, classifySendError, clearStartStash, formatModelString, formatPromptModel, markOptimisticSendDispatched, markOptimisticSendInboxBacked, mintSessionWireMessageId, readStartStash, recoverFromSendFailure, rejectQuestion, replyToPermission, replyToQuestion, requestRuntimeReconnect, startSessionWithPrompt, useAbortRuntimeSession, useExecuteRuntimeCommand, useProjectConfig, useRuntimeAgents, useRuntimeBootStalled, useRuntimeCommands, useRuntimeConfig, useRuntimeConnectionStore, useRuntimePendingStore, useRuntimePhase, useRuntimeProviders, useRuntimeReady, useRuntimeSession, useRuntimeSessions, useRuntimeSupports, useSessionModelSelection, useSessionPrompts, useSessionStateStore, useSessionSync, useSessionTurnOutcome, useSessionWorking, useSessionWorkingStore, } from '@kortix/sdk/react';
90
+ import { useStableCallback } from '../../internal/hooks/use-stable-callback.js';
91
+ import { useReloadForensics } from '../status/reload-forensics.js';
92
+ import { resolveLastTurnWorking, serverHoldsOpenTurn, sessionComposerReadiness, } from '../composer/session-composer-readiness.js';
93
+ import { captureTurnScrollAnchor, holdTurnScrollAnchor } from './session-history-scroll.js';
94
+ import { resolveSessionContentState } from '../status/session-load-state.js';
95
+ import { nextOlderAutoloadArm, olderAutoloadExhausted, shouldLoadOlderHistory, } from './session-older-autoload.js';
96
+ import { OLDER_LOADING_MIN_MS, useHeldOlderLoading } from './session-older-loading.js';
97
+ import { HELD_COMMAND_ROW_PREFIX, canReleaseHeldCommand, heldCommandRows, } from '../composer/held-commands.js';
98
+ import { useReadinessSettling } from '../status/use-readiness-settling.js';
99
+ import { useSessionHistoryViewStore } from '../../internal/stores/session-history-view-store.js';
100
+ import { downloadBlob } from '../../internal/lib/utils/download.js';
101
+ import { RestoreNotice, hasOutOfContext } from './session-history.js';
102
+ import { TranscriptTurnRow, strandedPromptIds, optimisticAnswersCache, promptTexts, resolveTurnError, } from './transcript.js';
103
+ export { SessionReportCard, deriveTurnErrorAbortState, deriveTurnErrorPresentation } from './transcript.js';
104
+ // ============================================================================
105
+ // Sub-Session Breadcrumb
106
+ // ============================================================================
107
+ // SubSessionBar removed — subsessions show their parent as the header breadcrumb
108
+ function formatCommandError(errorLike) {
109
+ const err = errorLike;
110
+ const root = err?.data ?? err;
111
+ const data = root?.data;
112
+ const directMessage = root?.message ||
113
+ err?.message ||
114
+ root?.error ||
115
+ err?.error ||
116
+ (typeof err === 'string' ? err : '');
117
+ if (typeof directMessage === 'string' && directMessage.trim()) {
118
+ return directMessage.trim();
119
+ }
120
+ if (root?.name === 'ProviderModelNotFoundError') {
121
+ const providerID = typeof data?.providerID === 'string' && data.providerID
122
+ ? data.providerID
123
+ : 'selected provider';
124
+ const modelID = typeof data?.modelID === 'string' && data.modelID ? data.modelID : 'selected model';
125
+ if (providerID === '[object Object]') {
126
+ return 'Invalid model selection was sent to the command endpoint. Please reselect a model and try again.';
127
+ }
128
+ return `Model ${modelID} was not found for provider ${providerID}.`;
129
+ }
130
+ if (typeof root?.name === 'string' && root.name) {
131
+ return root.name;
132
+ }
133
+ if (typeof err === 'object') {
134
+ try {
135
+ return JSON.stringify(err);
136
+ }
137
+ catch {
138
+ return 'Command failed';
139
+ }
140
+ }
141
+ return 'Command failed';
142
+ }
143
+ /**
144
+ * Classify a send/command failure onto the SDK's typed `KortixSendError`
145
+ * layer (billing vs runtime-not-ready vs runtime-error) so the banner can key
146
+ * off `.kind` instead of regexing the message — while keeping this file's
147
+ * richer message formatting (`formatCommandError` special-cases things like
148
+ * `ProviderModelNotFoundError` that the SDK's generic formatter doesn't know
149
+ * about).
150
+ */
151
+ function classifySessionError(err) {
152
+ return { ...classifySendError(err), message: formatCommandError(err) };
153
+ }
154
+ // ============================================================================
155
+ // Message parsing exported to message-parsing.tsx
156
+ // ============================================================================
157
+ /** How long Stop will wait for the inbox hold before it issues the cancel
158
+ * anyway. The hold going first is a preference — it saves a stopped prompt
159
+ * from coming back a reaper pass later — while the abort is the thing the user
160
+ * pressed the button for, and a stalled request must never hold it hostage
161
+ * with the agent still running. One round-trip's worth, no more. */
162
+ const STOP_HOLD_DEADLINE_MS = 1500;
163
+ /**
164
+ * Transcript delivery cadence while a turn streams. Everything this component
165
+ * derives from the rows (turn grouping, per-turn props, the O(messages) memos)
166
+ * re-runs per delivery, and the streaming text itself is paced at 80 ms by
167
+ * `ThrottledMarkdown`, so delivering faster than this buys no visible update.
168
+ * The first change after a quiet interval still shows at once.
169
+ */
170
+ const TRANSCRIPT_THROTTLE_MS = 50;
171
+ /** `useSessionMessages` input when no `useSession` owns this chat: reads nothing. */
172
+ const DETACHED_SESSION_MESSAGES = { projectId: '', sessionId: '', runtimeSessionId: null };
173
+ const NO_FULL_TEXTS = new Map();
174
+ export function SessionChat({ sessionId, projectSessionId, sessionState, projectId, boundAgentName, headerLeadingAction, hideHeader, readOnly, inputReplacement, initialScrollTop, savedHistoryScope, onContentReady, deferComposerFocus, hostQuote, }) {
175
+ const tHardcodedUi = useTranslations('hardcodedUi');
176
+ const tQueue = useTranslations('threads');
177
+ const tComposerAttachments = useTranslations('hardcodedUi.composerAttachments');
178
+ const onboardingActive = useOnboardingModeStore((s) => s.active);
179
+ const onboardingSessionId = useOnboardingModeStore((s) => s.sessionId);
180
+ const disableToolNavigation = onboardingActive && onboardingSessionId === sessionId;
181
+ // Every open session tab is pre-mounted at once (see layout-content.tsx), so
182
+ // only the visible tab may be treated as "active" — otherwise every busy
183
+ // session would react to global shortcuts (ESC-to-stop, auto question
184
+ // handling) at the same time. The standalone project session route
185
+ // (/projects/[id]/sessions/[sessionId]) mounts a single SessionChat whose id
186
+ // is never registered in this tab store; there it's the only chat mounted, so
187
+ // it's always active.
188
+ //
189
+ // Subscribe to the BOOLEAN result rather than the raw activeTabId value: a
190
+ // tab switch then only re-renders the two sessions whose active state flips,
191
+ // not every mounted SessionChat. This is what keeps tab switching 0-latency.
192
+ const isActiveSessionTab = useTabStore((s) => s.tabs[sessionId] ? s.activeTabId === sessionId : true);
193
+ // Clicking a tool call in the chat opens the side panel (Actions view)
194
+ // focused on that tool's large preview — instead of expanding inline.
195
+ const focusToolCall = useKortixComputerStore((s) => s.focusToolCall);
196
+ const setSidePanelView = useSessionBrowserStore((s) => s.setView);
197
+ const handleToolActivate = useCallback((callID) => {
198
+ // Telemetry honesty (MINOR SWEEP c): the panel's own chat-focus effect
199
+ // (`easy-panel.tsx`) can't tell whether this open was fresh — by the
200
+ // time that effect runs, `focusToolCall` has already flipped
201
+ // `isSidePanelOpen` to true, so reading the store there always reports
202
+ // "already open". This callback is the only point in the flow where
203
+ // the PRE-open state is still observable, so the `panel_opened` event
204
+ // is tracked here instead, gated on that read.
205
+ const wasOpen = useKortixComputerStore.getState().isSidePanelOpen;
206
+ setSidePanelView(sessionId, 'actions');
207
+ focusToolCall(callID);
208
+ if (!wasOpen)
209
+ track('panel_opened', { source: 'chat_tool' });
210
+ }, [sessionId, setSidePanelView, focusToolCall]);
211
+ const toolActivate = readOnly || disableToolNavigation ? null : handleToolActivate;
212
+ // ---- Context modal ----
213
+ const [contextModalOpen, setContextModalOpen] = useState(false);
214
+ // The composer's `/compact` row opens this instance; the header keeps its
215
+ // own independently-stated one (two mounted Modals, at most one ever open).
216
+ const [compactModalOpen, setCompactModalOpen] = useState(false);
217
+ // ---- Question prompt ref + action state (for unified send button) ----
218
+ const questionPromptRef = useRef(null);
219
+ const [questionAction, setQuestionAction] = useState({ label: null, canAct: true });
220
+ const handleQuestionActionChange = useCallback((action, canAct) => {
221
+ const label = action === 'next' ? 'Next' : action === 'submit' ? 'Submit' : null;
222
+ setQuestionAction({ label, canAct });
223
+ }, []);
224
+ // ---- Reply quotes (text selection → the composer's quote list) ----
225
+ // Each "Reply" asks the composer to add one quote to the card above its
226
+ // input. The composer owns the list from then on and writes each quote as a
227
+ // leading `<reply_context>` line on send, so there is no reply state to
228
+ // hold here — only the id-keyed requests, each removed once the composer
229
+ // has applied it. A FIFO: two "Reply" clicks in one render keep both, in
230
+ // order.
231
+ const [quoteRequests, setQuoteRequests] = useState([]);
232
+ const quoteRequestIdRef = useRef(0);
233
+ const handleQuoteRequestsApplied = useCallback((requestIds) => {
234
+ setQuoteRequests((current) => acknowledgeQuoteRequests(current, requestIds));
235
+ }, []);
236
+ // Floating "Reply" popup — shown near selected text in the chat area
237
+ const [selectionPopup, setSelectionPopup] = useState(null);
238
+ const chatAreaRef = useRef(null);
239
+ // On mouseup inside the chat area, check for text selection
240
+ const handleChatMouseUp = useCallback(() => {
241
+ // Small delay so the selection is finalized
242
+ requestAnimationFrame(() => {
243
+ const sel = window.getSelection();
244
+ const selectedText = sel?.toString().trim();
245
+ if (!selectedText || selectedText.length < 2) {
246
+ setSelectionPopup(null);
247
+ return;
248
+ }
249
+ // Make sure the selection is inside the chat area
250
+ if (!sel?.rangeCount || !chatAreaRef.current?.contains(sel.anchorNode)) {
251
+ setSelectionPopup(null);
252
+ return;
253
+ }
254
+ const range = sel.getRangeAt(0);
255
+ const rect = range.getBoundingClientRect();
256
+ const containerRect = chatAreaRef.current.getBoundingClientRect();
257
+ setSelectionPopup({
258
+ x: rect.left + rect.width / 2 - containerRect.left,
259
+ y: rect.top - containerRect.top - 8,
260
+ text: selectedText.slice(0, 500),
261
+ });
262
+ });
263
+ }, []);
264
+ // Dismiss popup on mousedown (new click) unless clicking the popup itself
265
+ const handleChatMouseDown = useCallback((e) => {
266
+ // If clicking inside the popup, don't dismiss
267
+ const target = e.target;
268
+ if (target.closest('[data-reply-popup]'))
269
+ return;
270
+ setSelectionPopup(null);
271
+ }, []);
272
+ // Dismiss popup on scroll
273
+ // Set the first time the reader scrolls the transcript UP, and read by the
274
+ // older-history sentinel: history loads when someone reaches for it, never
275
+ // because the first page happened to be shorter than the viewport.
276
+ const readerScrolledUpRef = useRef(false);
277
+ const lastScrollTopRef = useRef(null);
278
+ const handleChatScroll = useCallback((event) => {
279
+ setSelectionPopup(null);
280
+ const top = event.currentTarget.scrollTop;
281
+ if (lastScrollTopRef.current !== null && top < lastScrollTopRef.current) {
282
+ readerScrolledUpRef.current = true;
283
+ }
284
+ lastScrollTopRef.current = top;
285
+ }, []);
286
+ // A host's quote: each new id is one more request, like a "Reply" click.
287
+ const hostQuoteIdRef = useRef(null);
288
+ useEffect(() => {
289
+ const text = hostQuote?.text.trim();
290
+ if (!hostQuote || !text || hostQuoteIdRef.current === hostQuote.id)
291
+ return;
292
+ hostQuoteIdRef.current = hostQuote.id;
293
+ quoteRequestIdRef.current += 1;
294
+ const request = { id: quoteRequestIdRef.current, text };
295
+ setQuoteRequests((current) => [...current, request]);
296
+ }, [hostQuote]);
297
+ // When user clicks "Reply" in the popup
298
+ const handleSelectionReply = useCallback(() => {
299
+ if (!selectionPopup)
300
+ return;
301
+ quoteRequestIdRef.current += 1;
302
+ const request = { id: quoteRequestIdRef.current, text: selectionPopup.text };
303
+ setQuoteRequests((current) => [...current, request]);
304
+ setSelectionPopup(null);
305
+ window.getSelection()?.removeAllRanges();
306
+ }, [selectionPopup]);
307
+ // ---- KortixComputer side panel ----
308
+ // No `isSidePanelOpen` subscription here any more. The header's toggle was
309
+ // the only thing that needed it, and the chat was re-rendering in full on
310
+ // every open and close of a panel beside it for a value it no longer reads.
311
+ // The action panel column owns its own flag and subscribes to it itself.
312
+ const openFileInComputer = useKortixComputerStore((s) => s.openFileInComputer);
313
+ // ---- Hooks ----
314
+ // runtimeReady gates the session query (it's disabled until the sandbox
315
+ // runtime is connected + healthy). We need it here too so the render logic
316
+ // can tell "still booting" apart from "genuinely gone".
317
+ const runtimeReady = useRuntimeReady();
318
+ // The model gate holds during boot too (KRTX-1667): a pre-ready send becomes a
319
+ // durable inbox row nobody re-checks, so a Free plan's queued prompt died at the
320
+ // gateway. The served catalog (`GET /model-picker`) answers before the boot
321
+ // window opens, and the composer's loading flags keep the gate silent while it
322
+ // is still in flight — queue-while-booting survives wherever a model exists.
323
+ const allowSendBeforeReady = !!projectSessionId && !runtimeReady;
324
+ // "The health poller GAVE UP", which `!runtimeReady` does not say — that is
325
+ // also every ordinary boot. Only the composer notice reads it, to tell a probe
326
+ // that has not answered yet from one that keeps failing.
327
+ const runtimeUnreachable = useRuntimeConnectionStore((s) => s.status === 'unreachable');
328
+ // E1: the features this session's runtime serves. A pi session has no
329
+ // rewind and no on-demand compaction, so their controls do not render.
330
+ const runtimeCanRewind = useRuntimeSupports('session.rewind');
331
+ const runtimeCanCompact = useRuntimeSupports('session.compact');
332
+ const { data: session, isFetched: sessionFetched } = useRuntimeSession(sessionId);
333
+ // useSessionSync is the SINGLE source of truth for messages (matches OpenCode SolidJS).
334
+ // It fetches on first access, then SSE events keep it up to date.
335
+ // No React Query fallback — prevents stale refetches from overwriting live data.
336
+ // A chat with no `useSession` (a sub-agent's: `sub-session-modal`, the `?rs=` route) runs
337
+ // inside the route's session. While that session reads its log (v2: the store holds it),
338
+ // the sub-agent's thread and its older pages are the log's, and no saved copy is read.
339
+ const [scopeProjectId = '', scopeSessionId = ''] = savedHistoryScope?.split('/') ?? [];
340
+ const parentSource = useMemo(() => ({ projectId: projectId ?? scopeProjectId, sessionId: projectSessionId ?? scopeSessionId, runtimeSessionId: null }), [projectId, projectSessionId, scopeProjectId, scopeSessionId]);
341
+ const onParentLog = useSessionLogRecord(sessionState ? DETACHED_SESSION_MESSAGES : parentSource) !== null;
342
+ const localSync = useSessionSync(sessionState ? '' : sessionId, savedHistoryScope ? { kortixSessionScope: savedHistoryScope, savedChild: true, sessionLog: onParentLog } : undefined);
343
+ // The page's `useSession` runs with `subscribeMessages: false`, so its
344
+ // `messages` is a render-time snapshot and the page does not re-render per
345
+ // streamed delta. The live thread is read HERE, where it is drawn: the
346
+ // session log's root thread (`useSessionLogThread`), the `fromV1` view of
347
+ // the v1 rows while the session reads v1, the API's log on v2. A sub-agent's
348
+ // chat on v2 reads its thread of the route session's log.
349
+ const liveThread = useSessionLogThread(sessionState ?? (onParentLog ? parentSource : DETACHED_SESSION_MESSAGES), sessionState || !onParentLog ? undefined : sessionId, { throttleMs: TRANSCRIPT_THROTTLE_MS });
350
+ const parentLogOlder = useSessionLogOlder(parentSource, sessionId, { enabled: !sessionState && onParentLog });
351
+ const { messages: hookMessages, isLoading: syncMessagesLoading,
352
+ // Transcript-read state. `loading` with no messages is a WAIT (the box may
353
+ // be waking — the SDK keeps retrying), `error` with no messages is a
354
+ // failure that needs a retry affordance. Neither is an empty session: a
355
+ // swallowed 503 used to render exactly that, blank and "complete".
356
+ freshness: transcriptFreshness, retryTranscript, } = sessionState ?? localSync;
357
+ // A chat with no `useSession` (a sub-agent's, `sub-session-modal`) reads its
358
+ // runtime session's rows through `useSessionSync`: the same `fromV1` view.
359
+ // On v2 that is the fallback while the log does not hold the sub-agent's thread yet.
360
+ const detachedThread = useMemo(() => sessionState || hookMessages.length === 0
361
+ ? null
362
+ : (sessionLogOfV1Rows(sessionId, sessionId, hookMessages).threads[0] ?? null), [sessionState, sessionId, hookMessages]);
363
+ const thread = sessionState ? liveThread : (liveThread ?? detachedThread);
364
+ const { hasOlder, isLoadingOlder, loadOlder } = sessionState ?? (liveThread ? parentLogOlder : localSync);
365
+ // P5.6. The session record of the v2 log (null on v1): the restore notice and the harness
366
+ // history. `useSessionLogRecord` keeps its identity through message puts, so a streamed
367
+ // delta does not re-render the chat through it. The view settings are per session.
368
+ const historyKey = projectSessionId || sessionId;
369
+ const sessionRecord = useSessionLogRecord(sessionState ?? DETACHED_SESSION_MESSAGES);
370
+ // The transcript reads the session log (v2): the session's own, or the parent's for a sub-agent chat.
371
+ const transcriptOnLog = sessionState ? sessionRecord !== null : onParentLog;
372
+ const restoreNotice = useMemo(() => sessionLogRestoreNotice(sessionRecord), [sessionRecord]);
373
+ const restoreDismissed = useSessionHistoryViewStore((s) => !!restoreNotice && s.dismissedRestore[historyKey] === restoreNotice.generation);
374
+ const dismissRestore = useSessionHistoryViewStore((s) => s.dismissRestore);
375
+ const hideOutOfContext = useSessionHistoryViewStore((s) => s.hidden.includes(historyKey));
376
+ const setOutOfContext = useSessionHistoryViewStore((s) => s.setOutOfContext);
377
+ const threadHasOutOfContext = hasOutOfContext(thread?.messages);
378
+ useEffect(() => {
379
+ setOutOfContext(historyKey, threadHasOutOfContext);
380
+ }, [historyKey, threadHasOutOfContext, setOutOfContext]);
381
+ useEffect(() => () => setOutOfContext(historyKey, false), [historyKey, setOutOfContext]);
382
+ // Texts the API stored by reference that the person loaded in full, by `ref`, for this session.
383
+ const [fullTexts, setFullTexts] = useState({
384
+ key: historyKey,
385
+ texts: NO_FULL_TEXTS,
386
+ state: {},
387
+ });
388
+ const loaded = fullTexts.key === historyKey ? fullTexts : { key: historyKey, texts: NO_FULL_TEXTS, state: {} };
389
+ const messages = thread?.messages.length ? thread.messages : undefined;
390
+ // The thread for handlers that read it at call time (the optimistic answers cache).
391
+ const threadRef = useRef(thread);
392
+ threadRef.current = thread;
393
+ const messagesLoading = syncMessagesLoading;
394
+ // Who wrote each user message. A one-person session stays unlabelled.
395
+ const viewerId = useUiViewerId();
396
+ const Link = useUiLink();
397
+ // Only a user message adds an author, so only user messages key the refetch.
398
+ const userMessageIds = useMemo(() => (messages ?? []).filter((m) => m.role === 'user').map((m) => m.message_id), [messages]);
399
+ const newestUserMessageId = userMessageIds.at(-1) ?? '';
400
+ // What the control plane recorded about how this session's turns ended.
401
+ const turnOutcome = useSessionTurnOutcome(projectId ?? '', projectSessionId ?? '');
402
+ // A stop adds no message but does add a name ("Stopped by"): the turn that
403
+ // ended keys the read too, so the stopper shows when that turn ends.
404
+ const { data: messageAuthors, refetch: refetchMessageAuthors } = useSessionMessageAuthors(projectId, projectSessionId, `${newestUserMessageId}|${turnOutcome.last_ended?.turn_token ?? ''}`);
405
+ const transcriptAuthors = useMemo(() => resolveTranscriptAuthors(userMessageIds, messageAuthors), [userMessageIds, messageAuthors]);
406
+ // A session two or more people can open reads as a group chat from its first
407
+ // prompt: every author shows, the viewer included. Same cache as the header.
408
+ const { data: sessionParticipants } = useSessionParticipants(projectId, projectSessionId);
409
+ const groupChat = transcriptAuthors.multiAuthor || !!sessionParticipants?.multi_user;
410
+ // Project sessions use the server-side project agent roster. A sub-agent's
411
+ // chat has no projectId, but runs inside the parent scope's project: its
412
+ // roster is that project's. Only a chat with neither falls back to the
413
+ // runtime's own agent list, which a pi box does not serve (KRTX-2887).
414
+ const { data: agents } = useRuntimeAgents({
415
+ directory: session?.directory,
416
+ projectId: projectId ?? (scopeProjectId || undefined),
417
+ });
418
+ const { data: commands } = useRuntimeCommands();
419
+ const { data: providers, isLoading: providersLoading } = useRuntimeProviders();
420
+ const { data: allSessions } = useRuntimeSessions();
421
+ const { data: config } = useRuntimeConfig();
422
+ const projectConfig = useProjectConfig(projectId);
423
+ const abortSession = useAbortRuntimeSession();
424
+ const executeCommand = useExecuteRuntimeCommand();
425
+ // THE send path. Every prompt this composer accepts becomes a durable server
426
+ // row before anything else happens, so a closed tab, a second device, or a
427
+ // crash cannot lose it, and the server — not this component — decides whether
428
+ // it runs now or waits for the turn in flight.
429
+ const promptInbox = useSessionPrompts(projectId, projectSessionId);
430
+ // A `no_reply` prompt runs no turn: it draws no Sending/Queued chip and no
431
+ // Thinking row. Its bubble still comes from `queuedSyntheticMessages`.
432
+ const agentPrompts = useMemo(() => promptInbox.prompts.filter(awaitsAgent), [promptInbox.prompts]);
433
+ // Every user message and queued prompt on screen wants an author. The ledger
434
+ // records a delivered id a moment after the runtime shows it, and a prompt
435
+ // someone else just queued is newer than the cached answer: while any id is
436
+ // unattributed, ask again on a short backoff (`AUTHOR_RETRY_DELAYS_MS`).
437
+ const missingAuthors = missingAuthorKey(messageAuthors, [
438
+ ...userMessageIds,
439
+ ...promptInbox.prompts.flatMap((prompt) => [prompt.message_id, prompt.wire_message_id ?? '']),
440
+ ]);
441
+ const authorRetry = useRef({ key: '', count: 0 });
442
+ useEffect(() => {
443
+ if (!missingAuthors)
444
+ return;
445
+ if (authorRetry.current.key !== missingAuthors)
446
+ authorRetry.current = { key: missingAuthors, count: 0 };
447
+ const delay = AUTHOR_RETRY_DELAYS_MS[authorRetry.current.count];
448
+ if (delay === undefined)
449
+ return;
450
+ const timer = setTimeout(() => {
451
+ authorRetry.current.count += 1;
452
+ void refetchMessageAuthors();
453
+ }, delay);
454
+ return () => clearTimeout(timer);
455
+ }, [missingAuthors, messageAuthors, refetchMessageAuthors]);
456
+ /**
457
+ * What the first prompt's attachment strip should say before runtime delivery.
458
+ *
459
+ * Browser upload completes before prompt acceptance. The undelivered row
460
+ * carries names and reports a real failed send through `last_error`.
461
+ */
462
+ const firstPromptUploadStatus = useMemo(() => {
463
+ const row = promptInbox.prompts.find((p) => (p.attachments?.length ?? 0) > 0);
464
+ if (!row)
465
+ return undefined;
466
+ // `state`, never `last_error` alone: the API writes `last_error` on rows
467
+ // it keeps `queued` and retries, and never clears it on success — read
468
+ // as a failure it turned every transient retry into "upload failed"
469
+ // (review finding, 2026-09-05).
470
+ return row.state === 'failed'
471
+ ? { state: 'failed', ...(row.last_error ? { message: row.last_error } : {}) }
472
+ : undefined;
473
+ }, [promptInbox.prompts]);
474
+ /**
475
+ * The one place that issues a stop/cancel for this session's run, whether
476
+ * through the mounted `sessionState` hook or the fallback raw mutation.
477
+ * Both branches resolve a real `AbortSettlement` (never throwing — see
478
+ * `awaitAbortSettlement`).
479
+ */
480
+ const issueSessionCancel = useCallback(() => {
481
+ // The stop's own receipt, taken before the cancel goes out and settled
482
+ // when it is acknowledged. `applyOptimisticAbort` writes an idle status
483
+ // frame, which invalidates the `/turn` query — and the read that comes
484
+ // back still shows the turn, because the cancel needs ~1.6s to reach the
485
+ // daemon. Without this the composer flipped Send back to Stop ~120ms after
486
+ // the click and stayed there for the whole abort. See `AbortReceipt`.
487
+ useSessionWorkingStore.getState().noteAbortReceipt(projectSessionId ?? '', Date.now());
488
+ const settlement = sessionState
489
+ ? sessionState.cancel()
490
+ : awaitAbortSettlement(() => abortSession.mutateAsync(sessionId));
491
+ void settlement.then((result) => {
492
+ useSessionWorkingStore.getState().settleAbortReceipt(projectSessionId ?? '', Date.now(), result.status);
493
+ if (result.status === 'timed-out' || result.status === 'failed') {
494
+ // A refused stop says who may stop it; anything else is unconfirmed.
495
+ const refusal = result.status === 'failed' ? stopRefusalMessage(result.error) : null;
496
+ errorToast(refusal ?? tQueue('stopUnconfirmed'));
497
+ }
498
+ });
499
+ return settlement;
500
+ }, [sessionId, projectSessionId, sessionState, abortSession, tQueue]);
501
+ // The newest user message: its agent seeds the picker, and a new one is a
502
+ // queue row that just landed (see below).
503
+ const lastUserMessage = useMemo(() => (messages ? [...messages].reverse().find((m) => m.role === 'user') : undefined), [messages]);
504
+ // The session row: its model pin, sharing and sandbox status. One cache
505
+ // entry for every read below, so this mounts no second poll.
506
+ const projectSessionRow = useProjectSession(projectId, projectSessionId ?? undefined, {
507
+ enabled: !!projectId && !!projectSessionId,
508
+ }).data;
509
+ // ---- Unified model/agent/variant state (1:1 port of SolidJS local.tsx) ----
510
+ // The composer opens on the model the session already runs (its pin, or its
511
+ // last prompt's model), so a session set from the CLI, the SDK or Slack does
512
+ // not switch model on its first web message.
513
+ const local = useSessionModelSelection({
514
+ agents,
515
+ providers,
516
+ config,
517
+ sessionId,
518
+ boundAgentName,
519
+ defaultAgentName: projectConfig?.default_agent ?? projectConfig?.open_code_default_agent,
520
+ projectSession: projectSessionRow,
521
+ lastPromptModel: latestPromptModel(messages),
522
+ });
523
+ /**
524
+ * The agent this composer will ACTUALLY run — see `composer-agent-access.ts`.
525
+ *
526
+ * Project agents are deny-by-default for a member: `agents` can come back
527
+ * empty, and the project's `default_agent` may not be in it. `local.agent`
528
+ * resolves over the SDK's visible roster (subagents included) and yields
529
+ * `undefined` on an empty one, which rendered no agent in the picker while
530
+ * the send still went out under the server's manifest default.
531
+ */
532
+ const composerAgent = resolveComposerAgent({
533
+ agents,
534
+ boundAgent: boundAgentName,
535
+ defaultAgent: projectConfig?.default_agent ?? projectConfig?.open_code_default_agent,
536
+ selectedAgent: local.agent.current?.name ?? null,
537
+ });
538
+ const composerAgentName = composerAgent.selected;
539
+ const noAccessibleAgents = composerAgent.disabled;
540
+ // The slash menu lists only the commands the composer's agent may run. The
541
+ // transcript keeps the full list: a past turn may have run any of them.
542
+ const { data: agentCommands } = useRuntimeCommands({ agent: composerAgentName ?? undefined });
543
+ const localAgentSet = local.agent.set;
544
+ const localModelCurrentKey = local.model.currentKey;
545
+ // Wire model to SEND: `auto` when on the default (gateway resolves it), else
546
+ // the explicit pick. Always send this — not currentKey, which is for display.
547
+ const localModelSendKey = local.model.sendKey;
548
+ const localModelList = local.model.list;
549
+ // How many models the account can actually pick (KRTX-2598): the same
550
+ // flattened list the picker derives, filtered by the same enablement
551
+ // predicate `isOfferedModel` uses. 1 means "choose another model" has no
552
+ // move to name — the error row says to wait instead.
553
+ const modelOptions = useMemo(() => localModelList.filter((m) => m.enabled !== false).length, [localModelList]);
554
+ const localModelSet = local.model.set;
555
+ const localModelVisible = local.model.visible;
556
+ const localVariantSet = local.model.variant.set;
557
+ // Default the agent picker to whichever agent owns the latest assistant
558
+ // turn in this session. Catches PM onboarding sessions (first turn was PM),
559
+ // "Ask PM" sessions, team-agent ticket sessions, etc. — without relying on
560
+ // title patterns. Falls through if there's no assistant msg yet.
561
+ const defaultedAgentRef = useRef(false);
562
+ useEffect(() => {
563
+ if (defaultedAgentRef.current)
564
+ return;
565
+ if (!messages || messages.length === 0)
566
+ return;
567
+ let lastAgent = null;
568
+ for (let i = messages.length - 1; i >= 0; i--) {
569
+ const message = messages[i];
570
+ if (message?.role === 'assistant' && message.agent) {
571
+ lastAgent = message.agent;
572
+ break;
573
+ }
574
+ }
575
+ if (!lastAgent)
576
+ return;
577
+ const agentEntry = local.agent.list.find((a) => a?.name === lastAgent);
578
+ if (!agentEntry)
579
+ return;
580
+ if (local.agent.current?.name !== lastAgent) {
581
+ local.agent.set(lastAgent);
582
+ }
583
+ defaultedAgentRef.current = true;
584
+ }, [messages, local.agent]);
585
+ const pendingPromptHandled = useRef(false);
586
+ const [commandError, setCommandError] = useState(null);
587
+ // The last prompt handed to the runtime, verbatim. Only read by the
588
+ // connector-refusal card, to re-send exactly what was refused.
589
+ const lastSubmittedRef = useRef(null);
590
+ // The message currently open in the inline edit-from-here editor. Setting
591
+ // this swaps that bubble for the full-width editor; nothing is staged
592
+ // against the session until the editor's Send.
593
+ const [rewindTarget, setRewindTarget] = useState(null);
594
+ const [editSendPending, setEditSendPending] = useState(false);
595
+ // "Ask for changes" (W12) — a deliverable's toolbar can hand the composer a
596
+ // starter line. Held (not one-shot) in the store; the composer's own
597
+ // `prefill.id` effect below is what makes application happen exactly once.
598
+ const sessionPrefill = useSessionPrefill(sessionId);
599
+ // The lazy editor acknowledges application. A parent effect can run before
600
+ // that editor mounts and erase a queued edit during the startup handoff.
601
+ // WHICH held draft the composer is handed right now, in priority order, in
602
+ // ONE place. The four sources mint their ids from four independent counters,
603
+ // so `prefill.id` alone cannot say which one the composer just applied — and
604
+ // the carried draft's handshake below has to know exactly that.
605
+ const composerPrefill = useMemo(() => {
606
+ if (sessionPrefill) {
607
+ return {
608
+ source: 'session',
609
+ text: sessionPrefill.text,
610
+ id: sessionPrefill.id,
611
+ ...(sessionPrefill.files ? { files: sessionPrefill.files } : {}),
612
+ mode: sessionPrefill.mode ?? 'merge',
613
+ ...(sessionPrefill.submit ? { submit: true } : {}),
614
+ };
615
+ }
616
+ return null;
617
+ }, [sessionPrefill]);
618
+ // "Add context" (Task 5) — the empty Context card's button asks the
619
+ // composer to open its attach flow. Same held/id-keyed handoff as the
620
+ // prefill above, cleared the same way once the composer's own id-keyed
621
+ // effect has acted on it.
622
+ const attachRequestId = useAttachRequest(sessionId);
623
+ useEffect(() => {
624
+ if (attachRequestId != null) {
625
+ useSessionComposerPrefillStore.getState().clearAttachRequest(sessionId);
626
+ }
627
+ }, [attachRequestId, sessionId]);
628
+ // Map of user message IDs → command info, so UserMessage can render
629
+ // a compact command pill instead of the raw expanded template text.
630
+ const commandMessagesRef = useRef(new Map());
631
+ // Stash the pending command info so we can associate it with the user message
632
+ // even if the busy signal arrives before the message list updates.
633
+ const pendingCommandStashRef = useRef(null);
634
+ /**
635
+ * This tab's record that a prompt went out, and when.
636
+ *
637
+ * It replaces `pendingSendInFlight` — a boolean set on send, cleared by an
638
+ * effect that watched for a busy status or a matching assistant reply, and
639
+ * backstopped by a 30s timer because both of those signals can be lost. The
640
+ * receipt is the same fact with a bound and a provenance tag: it claims
641
+ * `working` only until a server source that CAN know about the send answers,
642
+ * and `projectWorking` releases it either way — see `useSessionWorking`.
643
+ *
644
+ * It lives in the SDK's per-session store rather than in this component
645
+ * because `useSession` mounts a projection for the SAME session and both
646
+ * share one `GET .../turn` cache entry. With a receipt each, the observer
647
+ * that had none polled on its own timer, wrote an uninformed "no turns" read
648
+ * into that shared entry, and flipped this composer to idle mid-send.
649
+ *
650
+ * `note` is taken before the POST; `accept` is what lets a `/turn` read
651
+ * answer for the send at all, because until `POST .../prompts` returns there
652
+ * is no row for it to see. Only the paths that know nothing is coming clear
653
+ * it — a refused send, Stop, and leaving the session.
654
+ */
655
+ const receiptSessionId = projectSessionId ?? '';
656
+ const noteSendReceipt = useCallback((messageId, turnId = messageId) => useSessionWorkingStore
657
+ .getState()
658
+ .noteSendReceipt(receiptSessionId, { messageId, turnId, atMs: Date.now() }), [receiptSessionId]);
659
+ const acceptSendReceipt = useCallback((messageId) => useSessionWorkingStore.getState().acceptSendReceipt(receiptSessionId, messageId, Date.now()), [receiptSessionId]);
660
+ const clearSendReceipt = useCallback(
661
+ // The id is REQUIRED of every caller that has one: `clearSendReceipt` is
662
+ // keyed by session, so an unguarded clear from an older send's failure
663
+ // deleted a NEWER send's receipt while its POST was still on the wire, and
664
+ // an uninformed `/turn` read then flipped the composer back to Send
665
+ // mid-send. Omitted only where nothing is coming for ANY send.
666
+ (messageId) => useSessionWorkingStore.getState().clearSendReceipt(receiptSessionId, messageId), [receiptSessionId]);
667
+ // ---- Start-stash PICKS seeding (model/agent/variant) ----
668
+ //
669
+ // The stash no longer carries the first prompt for this host: the prompt is
670
+ // a durable inbox row before this component ever mounts (created server-side
671
+ // from `create.pending_prompt`, or POSTed by `startSessionWithPrompt`), and
672
+ // it renders in the queue strip like every other pending prompt. What still
673
+ // travels here are the producer's PICKS, seeded once into this session's
674
+ // local stores. The old replay effect — a 30s readiness poll, an optimistic
675
+ // bubble that its own timeout path never cleared, and per-send receipt
676
+ // bookkeeping — is gone with the hand-off it served.
677
+ //
678
+ // A NON-empty prompt in the stash is a legacy hand-off (a pre-deploy tab, or
679
+ // an unconverted producer): POST it to the inbox rather than dropping it.
680
+ useEffect(() => {
681
+ if (pendingPromptHandled.current)
682
+ return;
683
+ const stash = readStartStash(sessionId);
684
+ if (!stash)
685
+ return;
686
+ pendingPromptHandled.current = true;
687
+ clearStartStash(sessionId);
688
+ if (stash.agent)
689
+ localAgentSet(stash.agent);
690
+ // The seed and the legacy replay share ONE validity check. A stash that
691
+ // names a model this session's catalog does not list must neither seed
692
+ // the store nor ride the legacy prompt.
693
+ const stashModelValid = !!stash.model &&
694
+ localModelList.some((m) => m.providerID === stash.model.providerID && m.modelID === stash.model.modelID) &&
695
+ localModelVisible(stash.model);
696
+ if (stashModelValid) {
697
+ localModelSet(stash.model, { autoSeed: true });
698
+ }
699
+ if (stash.variant)
700
+ localVariantSet(stash.variant);
701
+ const legacyPrompt = stash.prompt.trim();
702
+ if (legacyPrompt && projectId && projectSessionId) {
703
+ void startSessionWithPrompt(projectId, projectSessionId, {
704
+ parts: [{ type: 'text', text: legacyPrompt }],
705
+ overrides: {
706
+ ...(stash.agent ? { agent: stash.agent } : {}),
707
+ ...(stashModelValid ? { model: stash.model } : {}),
708
+ ...(stash.variant ? { variant: stash.variant } : {}),
709
+ },
710
+ }).catch((error) => {
711
+ console.error('[session-chat] failed to queue the stashed legacy prompt', error);
712
+ setCommandError(classifySessionError(error));
713
+ });
714
+ }
715
+ // eslint-disable-next-line react-hooks/exhaustive-deps
716
+ }, [sessionId, projectId, projectSessionId]);
717
+ const agentNames = useMemo(() => local.agent.list.map((a) => a.name), [local.agent.list]);
718
+ // ---- Restore the agent from the last user message ----
719
+ // The model needs no seed: `lastPromptModel` above feeds the resolution
720
+ // directly. Seeding it into the picker slots leaked one session's model into
721
+ // every other session of the same agent, and was skipped whenever the
722
+ // account had a default model.
723
+ // A NEW user bubble in the transcript is a queue row that just landed —
724
+ // OpenCode persisted a forwarded prompt. Re-read the inbox NOW so the row
725
+ // leaves the strip in the same beat its bubble appears, instead of on the
726
+ // next poll: the two were visible together for up to a poll interval.
727
+ const newestUserBubbleId = lastUserMessage?.message_id;
728
+ useEffect(() => {
729
+ if (!newestUserBubbleId)
730
+ return;
731
+ void promptInbox.refetch();
732
+ // eslint-disable-next-line react-hooks/exhaustive-deps
733
+ }, [newestUserBubbleId]);
734
+ const lastUserMsgIdRef = useRef(undefined);
735
+ useEffect(() => {
736
+ if (!lastUserMessage)
737
+ return;
738
+ if (lastUserMsgIdRef.current === lastUserMessage.message_id)
739
+ return;
740
+ lastUserMsgIdRef.current = lastUserMessage.message_id;
741
+ const msg = lastUserMessage;
742
+ if (msg.agent)
743
+ local.agent.set(msg.agent);
744
+ // eslint-disable-next-line react-hooks/exhaustive-deps
745
+ }, [lastUserMessage?.message_id]);
746
+ // ---- Session status ----
747
+ // Use sync store as primary (matches OpenCode), fall back to status store
748
+ const syncStatus = useSessionStateStore((s) => s.sessionStatus[sessionId]);
749
+ const isOptimisticCompacting = sessionState?.isCompacting ?? false;
750
+ const sessionStatus = sessionState?.status ?? syncStatus;
751
+ /**
752
+ * IS THIS SESSION WORKING — one answer, and it says where it came from.
753
+ *
754
+ * It used to be read straight off the SSE status slot, which is a stream
755
+ * this tab can miss frames from: a dropped end-of-turn frame left the
756
+ * composer on "stop" until a reload, and a dropped start-of-turn frame let
757
+ * the queue drain into a live turn. The projection reads the control plane's
758
+ * turn authority first (`GET .../turn`), the stream second, and this tab's
759
+ * own send receipt only until either of them answers.
760
+ */
761
+ // A child-session mount (`sub-session-modal.tsx` passes no project ids) has
762
+ // no Kortix session row for `/turn` to answer about, so the projection below
763
+ // is disabled and every working read falls back to the raw stream slot —
764
+ // the same split `session-layout.tsx` makes for its busy indicator.
765
+ const isChildSession = !projectId || !projectSessionId;
766
+ const working = useSessionWorking(projectId ?? '', projectSessionId ?? '', {
767
+ enabled: !isChildSession,
768
+ runtimeSessionId: sessionId,
769
+ });
770
+ const isServerBusy = working.state === 'working';
771
+ // In a shared session only the member who started the run, the session owner
772
+ // or a project manager may stop it. Without it: no Stop, no Esc×3, no "Stop
773
+ // and send" — a send queues behind the turn.
774
+ const canStop = sessionState?.canStop ?? true;
775
+ // The one transcript-derived gate that survives, and the only one that
776
+ // carries proof: during a provider 429 OpenCode stamps `info.error` with
777
+ // `data.isRetryable === true` and keeps writing the SAME assistant message,
778
+ // while the status frame this tab holds can read non-busy for all of it. The
779
+ // projection cannot substitute — a frame stamped after the last `/turn` read
780
+ // outranks that read by design — so without this a `/` command submitted
781
+ // now would go out into a turn that is still running.
782
+ //
783
+ // Paired with the server's own authority so it can never wedge: an assistant
784
+ // message left open by a sandbox that died mid-turn (no error, no
785
+ // completion) is not a retry, AND a dead box's turn is husk-finalized, so
786
+ // `serverOpenTurnToken` goes null and the gate opens. That pair is what the
787
+ // old 10s husk clock and its confirmation round-trip existed to approximate.
788
+ //
789
+ // The TOKEN, not the message id: a `/` command's own turn carries no wire
790
+ // `messageID`, so keying this on the id left the gate open for exactly the
791
+ // producer it guards.
792
+ //
793
+ // It gates COMMANDS only now (`sessionWorking` on the composer). A prompt is
794
+ // an inbox row and the server's admission gate holds it.
795
+ const hasRetryingAssistant = useMemo(() => !!thread && sessionLogRetrying(thread) && working.serverOpenTurnToken !== null, [thread, working.serverOpenTurnToken]);
796
+ // The working projection, plus compaction — which `projectWorking`
797
+ // deliberately knows nothing about, because a compaction is not a turn and
798
+ // `GET .../turn` reports none for it.
799
+ //
800
+ // It is no longer a client-only latch either. `sessionState.isCompacting` is
801
+ // its own projection (`core/session/compaction.ts`) over the runtime's
802
+ // `Session.time.compacting` row plus this tab's own bounded `/compact` stamp,
803
+ // so a lost `session.compacted` frame stops pinning the composer at
804
+ // `OPTIMISTIC_COMPACTION_MAX_MS` instead of for the lifetime of the tab, and
805
+ // a compaction started by a second device is visible here at all.
806
+ const effectiveBusy = resolveEffectiveBusy({
807
+ isServerBusy,
808
+ isOptimisticCompacting,
809
+ hasRetryingAssistant,
810
+ });
811
+ // Short visual fade (300ms) — matches the reference's 260ms delay-hide.
812
+ // Goes true immediately, stays visible briefly after going idle so the
813
+ // UI doesn't flicker between agentic steps. NOT a 2s debounce.
814
+ const [isBusy, setIsBusy] = useState(effectiveBusy);
815
+ const busyTimerRef = useRef(undefined);
816
+ useEffect(() => {
817
+ if (effectiveBusy) {
818
+ clearTimeout(busyTimerRef.current);
819
+ setIsBusy(true);
820
+ }
821
+ else {
822
+ busyTimerRef.current = setTimeout(() => setIsBusy(false), 300);
823
+ }
824
+ return () => clearTimeout(busyTimerRef.current);
825
+ }, [effectiveBusy]);
826
+ // Read by `handleSend` for its ANCHORING decision only (a send into a running
827
+ // turn must not yank the viewport). Refs, not the values: `handleSend` is a stable callback
828
+ // that a dozen surfaces hold, and adding busy state to its deps would rebuild
829
+ // it on every turn transition. Written in an EFFECT, never during render — a
830
+ // render-phase ref write is what deadlocked the session shell once already.
831
+ const isBusyRef = useRef(false);
832
+ useEffect(() => {
833
+ isBusyRef.current = effectiveBusy;
834
+ }, [effectiveBusy]);
835
+ // Which model answered each turn, and what Kortix billed for it, from the
836
+ // gateway's request record. The transcript and the model selector name the
837
+ // model a turn ASKED for; a fallback chain decides what answers. A request's
838
+ // row is written as the request ends: read again on each new assistant
839
+ // message and at the end of a turn, then once more for its last request.
840
+ const newestAssistantMessageId = useMemo(() => (messages ?? []).findLast((m) => m.role === 'assistant')?.message_id ?? '', [messages]);
841
+ const { data: modelUsage, refetch: refetchModelUsage } = useSessionModelUsage(projectId, projectSessionId);
842
+ useEffect(() => {
843
+ // `refetch` ignores `enabled`: a chat with no project session (the sub-agent modal) asks nothing.
844
+ if (!newestAssistantMessageId || !projectId || !projectSessionId)
845
+ return;
846
+ // `cancelRefetch: false`: a read already in flight (the mount's own) is the read.
847
+ void refetchModelUsage({ cancelRefetch: false });
848
+ if (effectiveBusy)
849
+ return;
850
+ const timer = setTimeout(() => void refetchModelUsage(), MODEL_USAGE_SETTLE_MS);
851
+ return () => clearTimeout(timer);
852
+ }, [newestAssistantMessageId, effectiveBusy, refetchModelUsage, projectId, projectSessionId]);
853
+ // Not gated on the composer's selection: the session modal reports the
854
+ // session, not what the composer will send next.
855
+ const sessionServedModel = useMemo(() => servedModelNotice(modelUsage, local.model.list), [modelUsage, local.model.list]);
856
+ const servedModelOfTurn = useMemo(() => turnServedModelResolver(local.model.list), [local.model.list]);
857
+ // WHICH INBOX ROWS ARE ALREADY ON SCREEN — the queued list above the composer
858
+ // (`projectQueueRows`, `QueuedPromptList`) lists only the rest.
859
+ //
860
+ // `GET .../prompts` is the queue: durable, shared across tabs and devices,
861
+ // ordered and admitted by the control plane. There is no browser lane beside
862
+ // it any more, so there is no second list to keep in sync, no per-row origin
863
+ // to route actions by, and nothing left that a closed tab can lose.
864
+ //
865
+ // The transcript is passed in because a row whose message is ALREADY on
866
+ // screen is not a queue row. Every prompt this tab sends is painted into the
867
+ // transcript on Enter under its WIRE id — the same id its row carries — so
868
+ // its row is never drawn. When the runtime echoes it under a RE-MINTED id,
869
+ // the store remembers the alias (`optimisticOriginOf`), and the row — which
870
+ // reports the original id until its next poll — stays hidden through the
871
+ // swap. Without both, the same text is on screen twice for a frame or a
872
+ // second: once as the bubble, once as a queued row.
873
+ const transcriptUserMessageIds = useMemo(() => {
874
+ const ids = new Set();
875
+ const store = useSessionStateStore.getState();
876
+ for (const message of messages ?? []) {
877
+ if (message.role !== 'user')
878
+ continue;
879
+ ids.add(message.message_id);
880
+ const origin = store.optimisticOriginOf(sessionId, message.message_id);
881
+ if (origin)
882
+ ids.add(origin);
883
+ }
884
+ // A prompt whose wire/echo id is already on screen also contributes its
885
+ // client_message_id — the one id stable across a re-mint AND a reload — so
886
+ // the queue projection's client-id hide clause is live even when the
887
+ // transcript only knows the re-minted id (the sticky-"Queued" reload case).
888
+ for (const prompt of promptInbox.prompts) {
889
+ if (!prompt.client_message_id)
890
+ continue;
891
+ if ((prompt.message_id && ids.has(prompt.message_id)) ||
892
+ (prompt.wire_message_id && ids.has(prompt.wire_message_id))) {
893
+ ids.add(prompt.client_message_id);
894
+ }
895
+ }
896
+ return ids;
897
+ }, [messages, sessionId, promptInbox.prompts]);
898
+ /**
899
+ * The transcript's ONE user message, when there is exactly one and this tab
900
+ * did not paint it — the only shape in which a row can be claimed by
901
+ * elimination. See `claimFirstTurnRow`.
902
+ *
903
+ * Whether it has been ANSWERED does not matter, and briefly requiring that it
904
+ * had not was wrong: the stale cached row this exists for outlives the start
905
+ * of the answer by exactly the window the user can see (the row is gone from
906
+ * the server the moment the turn is accepted; the tab learns that one poll
907
+ * later), so the claim has to hold through the first tokens.
908
+ */
909
+ const onlyUserMessage = useMemo(() => {
910
+ const store = useSessionStateStore.getState();
911
+ let only = null;
912
+ let users = 0;
913
+ for (const message of messages ?? []) {
914
+ if (message.role !== 'user')
915
+ continue;
916
+ users += 1;
917
+ if (store.isOptimisticMessage(sessionId, message.message_id)) {
918
+ only = null;
919
+ continue;
920
+ }
921
+ // The bubble's own words: the non-synthetic texts, joined.
922
+ const text = promptTexts(message)
923
+ .filter((t) => !t.synthetic)
924
+ .map((t) => t.text)
925
+ .join('\n');
926
+ only = { id: message.message_id, text };
927
+ }
928
+ return users === 1 ? only : null;
929
+ }, [messages, sessionId]);
930
+ /**
931
+ * The row whose message is on screen under an id the row has not reported
932
+ * yet — the re-mint window. Claimed by elimination, never by id; every
933
+ * refusal is documented in `claimFirstTurnRow`.
934
+ */
935
+ const firstTurnClaim = useMemo(() => claimFirstTurnRow({
936
+ prompts: promptInbox.prompts,
937
+ onlyUserMessage,
938
+ claimedIds: transcriptUserMessageIds,
939
+ }), [promptInbox.prompts, onlyUserMessage, transcriptUserMessageIds]);
940
+ /**
941
+ * The claim's row ids folded into the SAME set every id-matching consumer
942
+ * reads, so one decision reaches all of them: `queuedSyntheticMessages` stops
943
+ * minting a second bubble, and `projectQueueRows` stops listing the row.
944
+ * Nothing downstream needed changing.
945
+ */
946
+ const transcriptClaimedIds = useMemo(() => {
947
+ if (!firstTurnClaim)
948
+ return transcriptUserMessageIds;
949
+ const ids = new Set(transcriptUserMessageIds);
950
+ ids.add(firstTurnClaim.rowMessageId);
951
+ if (firstTurnClaim.rowWireMessageId)
952
+ ids.add(firstTurnClaim.rowWireMessageId);
953
+ if (firstTurnClaim.rowClientMessageId)
954
+ ids.add(firstTurnClaim.rowClientMessageId);
955
+ return ids;
956
+ }, [transcriptUserMessageIds, firstTurnClaim]);
957
+ // The row names the re-minted id, and it is the ONLY thing that does: the
958
+ // runtime's echo carries no client id, and this tab strips the part ids that
959
+ // would otherwise correlate it. So every prompt in the inbox announces its
960
+ // pairing here — which lets the echo supersede ITS OWN bubble rather than the
961
+ // oldest one in flight, and (when the echo already landed unmatched, which a
962
+ // burst makes the common case) retires that bubble on the spot.
963
+ //
964
+ // An EFFECT, not the memo below that reads the result: `registerOptimisticEcho`
965
+ // writes to the sync store, and a store write during render re-renders every
966
+ // subscriber mid-render. It ran inside the memo until the retire-on-late-alias
967
+ // rule gave it something to write.
968
+ useEffect(() => {
969
+ const store = useSessionStateStore.getState();
970
+ for (const prompt of promptInbox.prompts) {
971
+ if (!prompt.message_id || !prompt.wire_message_id)
972
+ continue;
973
+ if (prompt.wire_message_id === prompt.message_id)
974
+ continue;
975
+ store.registerOptimisticEcho(sessionId, prompt.wire_message_id, prompt.message_id);
976
+ }
977
+ }, [promptInbox.prompts, sessionId]);
978
+ // WHAT THE QUEUED LIST ABOVE THE COMPOSER RENDERS — see `projectQueueRows`.
979
+ // This tab's own queued sends add the text as typed, the original files, and
980
+ // a row for the upload window (`queued-draft-store.ts`).
981
+ const queuedDrafts = useQueuedDrafts(sessionId);
982
+ // Inbox rows keyed by the transcript id they will confirm under — the
983
+ // original wire id AND, after a re-mint, the echo — so a painted bubble can
984
+ // find its own row and draw the files that row carries.
985
+ const inboxRowsByMessageId = useMemo(() => {
986
+ const store = useSessionStateStore.getState();
987
+ const byId = new Map();
988
+ for (const prompt of promptInbox.prompts) {
989
+ if (!prompt.message_id)
990
+ continue;
991
+ byId.set(prompt.message_id, prompt);
992
+ const echo = store.optimisticEchoOf(sessionId, prompt.message_id);
993
+ if (echo)
994
+ byId.set(echo, prompt);
995
+ // The id this tab painted under, when the drain already re-minted.
996
+ if (prompt.wire_message_id && prompt.wire_message_id !== prompt.message_id) {
997
+ byId.set(prompt.wire_message_id, prompt);
998
+ const wireEcho = store.optimisticEchoOf(sessionId, prompt.wire_message_id);
999
+ if (wireEcho)
1000
+ byId.set(wireEcho, prompt);
1001
+ }
1002
+ }
1003
+ // The bubble claimed by elimination carries its row's files too: hiding the
1004
+ // duplicate must not cost the surviving copy what the row alone reports.
1005
+ if (firstTurnClaim) {
1006
+ const claimed = promptInbox.prompts.find((p) => p.prompt_id === firstTurnClaim.promptId);
1007
+ if (claimed)
1008
+ byId.set(firstTurnClaim.messageId, claimed);
1009
+ }
1010
+ return byId;
1011
+ // `messages` is a dependency because the aliases this reads are registered
1012
+ // by the effect above, i.e. AFTER the render that first sees a row.
1013
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1014
+ }, [promptInbox.prompts, sessionId, messages, firstTurnClaim]);
1015
+ // A queued prompt runs as its author: only they edit or send it, and the
1016
+ // session's managers may remove it. Same cache entry as the header's read.
1017
+ const viewerManagesSession = projectSessionRow?.can_manage_lifecycle !== false;
1018
+ const queuedPromptViewer = useMemo(() => ({ userId: viewerId, managesSession: viewerManagesSession }), [viewerId, viewerManagesSession]);
1019
+ const queueRows = useMemo(() => projectQueueRows({
1020
+ prompts: promptInbox.prompts,
1021
+ transcriptMessageIds: transcriptClaimedIds,
1022
+ drafts: queuedDrafts,
1023
+ viewer: queuedPromptViewer,
1024
+ }), [promptInbox.prompts, transcriptClaimedIds, queuedDrafts, queuedPromptViewer]);
1025
+ // A posted draft whose row the inbox no longer lists was delivered or
1026
+ // removed; nothing reads it again.
1027
+ useEffect(() => {
1028
+ const listed = new Set();
1029
+ for (const prompt of promptInbox.prompts) {
1030
+ if (prompt.client_message_id)
1031
+ listed.add(prompt.client_message_id);
1032
+ }
1033
+ useQueuedDraftStore.getState().prune(sessionId, listed);
1034
+ }, [promptInbox.prompts, queuedDrafts, sessionId]);
1035
+ // Read by `handleSend` and the queue edit, which are stable callbacks.
1036
+ // Written in an effect, never during render — the same rule as `isBusyRef`.
1037
+ const queueRowsRef = useRef(queueRows.rows);
1038
+ useEffect(() => {
1039
+ queueRowsRef.current = queueRows.rows;
1040
+ }, [queueRows.rows]);
1041
+ const canTakeBackQueue = queueRows.rows.some((row) => row.takeBackEligible);
1042
+ // `/` commands typed while the session could not run them. `SessionChat` is
1043
+ // keyed by session, so the list never crosses sessions.
1044
+ const [heldCommands, setHeldCommands] = useState([]);
1045
+ // Removing used to be a local-store delete with an undo toast that restored
1046
+ // the entry into that store. The row is durable now, so a removal is a real
1047
+ // DELETE and the undo has to re-create it — which the inbox makes exact,
1048
+ // because re-POSTing the SAME `clientMessageId` is idempotent by unique
1049
+ // index rather than by a client-side latch.
1050
+ const handleRemoveQueuedMessage = useCallback(async (id) => {
1051
+ // The DELETE hands back what it destroyed, and that is the only lossless
1052
+ // undo: the row is hard-deleted, and the list view carries a 2000-char
1053
+ // text preview with no parts at all. Restoring from the list dropped
1054
+ // every attachment and the model/agent picks — silently, under a button
1055
+ // that says "Undo".
1056
+ let removed;
1057
+ try {
1058
+ removed = await promptInbox.remove(id);
1059
+ }
1060
+ catch (error) {
1061
+ // Branch on the STATUS, and say what the server said.
1062
+ //
1063
+ // This used to test `/409/` against `error.message` — but `ApiError`
1064
+ // carries the server's prose in `message` and the code in `status`, so
1065
+ // that regex could never match. Every failure rendered the same
1066
+ // "Could not remove that prompt", including the 409 that has a precise
1067
+ // explanation ("Prompt is already being answered") and the 404 that
1068
+ // means something entirely different. Two unrelated causes behind one
1069
+ // dead-end string is why this looked like the button simply never
1070
+ // worked.
1071
+ const status = error?.status;
1072
+ const detail = error instanceof Error && error.message.trim() ? error.message.trim() : null;
1073
+ errorToast(status === 409
1074
+ ? (detail ?? tHardcodedUi.raw('i18nComplete.text3e739b3b4329'))
1075
+ : status === 404
1076
+ ? tHardcodedUi.raw('i18nComplete.text128773c76940')
1077
+ : (detail ?? tHardcodedUi.raw('i18nComplete.text42fcd9dda5f6')));
1078
+ return;
1079
+ }
1080
+ if (!removed)
1081
+ return;
1082
+ // The bubble IS the queue entry: the row is gone, so every copy of the
1083
+ // message goes with it — the optimistic bubble, a confirmed echo, and
1084
+ // the ownership marks that would otherwise resurrect it when the
1085
+ // runtime relays the deletion.
1086
+ const store = useSessionStateStore.getState();
1087
+ store.optimisticRemove(sessionId, removed.message_id);
1088
+ for (const id of removed.removed_message_ids ?? [removed.message_id]) {
1089
+ store.forgetControlPlaneMessage(sessionId, id);
1090
+ }
1091
+ // Undo rather than a confirm dialog. A queue is something you curate —
1092
+ // gating every removal behind a modal would make it unusable, and the
1093
+ // thing being removed is a draft, not data. Reversible beats guarded.
1094
+ const undoToastId = `queue-undo-${sessionId}-${removed.prompt_id}`;
1095
+ undoToast(tHardcodedUi.raw('i18nComplete.text2c6041fda32c'), {
1096
+ id: undoToastId,
1097
+ duration: 5000,
1098
+ undoLabel: tHardcodedUi.raw('i18nComplete.texta737e54996f8'),
1099
+ // The SAME `clientMessageId`, so an undo re-creates ONE row and a
1100
+ // double-click cannot create two. A FRESH wire id, because
1101
+ // OpenCode orders by id and the original one was minted before the
1102
+ // turn that has been writing higher ids since. The parts and
1103
+ // overrides are the ORIGINALS, straight from the delete's own
1104
+ // response — see `createQueueUndoAction`.
1105
+ onUndo: createQueueUndoAction({
1106
+ removed,
1107
+ mintMessageId: () => mintSessionWireMessageId(sessionId),
1108
+ enqueue: promptInbox.enqueue,
1109
+ dismiss: () => dismissToast(undoToastId),
1110
+ onError: () => errorToast(tHardcodedUi.raw('i18nComplete.text8af21acebf14')),
1111
+ }),
1112
+ });
1113
+ },
1114
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1115
+ [sessionId, promptInbox.remove, promptInbox.enqueue]);
1116
+ const handleRetryQueuedMessage = useCallback((id) => {
1117
+ // Re-queued UNDER ITS ORIGINAL WIRE ID, so a delivery that actually
1118
+ // landed is still absorbed by the proxy instead of running twice.
1119
+ // This is the ONE client path for the retry route's two labels (the
1120
+ // route's own comment names them one primitive): a failed row's
1121
+ // "Retry" (KRTX-1587 wires the queue list's queued rows here too as
1122
+ // "Send now"), so its failure toast speaks of retrying either way.
1123
+ void promptInbox
1124
+ .retry(id)
1125
+ .catch(() => errorToast(tHardcodedUi.raw('i18nComplete.text4869b2a820dd')));
1126
+ },
1127
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1128
+ [promptInbox.retry]);
1129
+ // "Stop and send": the waiting row becomes Quick Queue. The running turn
1130
+ // ends after its running tool, then this row runs.
1131
+ const handleStopAndSendQueuedMessage = useCallback((id) => {
1132
+ void promptInbox
1133
+ .interrupt(id)
1134
+ .catch((error) => errorToast(stopRefusalMessage(error) ?? tQueue('stopAndSendFailed')));
1135
+ },
1136
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1137
+ [promptInbox.interrupt]);
1138
+ // Associate stashed command info with the newest user message when messages
1139
+ // arrive, so `UserMessage` renders the command pill instead of raw template
1140
+ // text. `prevMsgLenRef` exists for this one observation.
1141
+ const prevMsgLenRef = useRef(messages?.length || 0);
1142
+ useEffect(() => {
1143
+ const stash = pendingCommandStashRef.current;
1144
+ if (!stash || !messages)
1145
+ return;
1146
+ const len = messages.length;
1147
+ if (len <= prevMsgLenRef.current)
1148
+ return;
1149
+ // Find the last user message — the one just created by the command
1150
+ for (let i = len - 1; i >= 0; i--) {
1151
+ if (messages[i].role === 'user') {
1152
+ commandMessagesRef.current.set(messages[i].message_id, stash);
1153
+ pendingCommandStashRef.current = null;
1154
+ break;
1155
+ }
1156
+ }
1157
+ }, [messages]);
1158
+ useEffect(() => {
1159
+ prevMsgLenRef.current = messages?.length || 0;
1160
+ }, [messages?.length]);
1161
+ // Compile the code highlighter while the session sits idle, so its one-time
1162
+ // ~125 ms setup never freezes a streaming reply (see `warmHighlighter`).
1163
+ useEffect(() => warmHighlighter(), []);
1164
+ // ---- Auto-scroll: see use-auto-scroll.ts (room + end + follow) ----
1165
+ const messageCount = messages?.length ?? 0;
1166
+ const { scrollRef, contentRef, spacerElRef, showScrollButton, scrollToBottom, smoothScrollToAbsoluteBottom, anchorTurn, startAtTop, } = useAutoScroll({
1167
+ hasContent: messageCount > 0,
1168
+ });
1169
+ // Cmd/Ctrl+P prints the WHOLE conversation. The shortcut is intercepted
1170
+ // because neither half of what printing needs can be done in CSS: the
1171
+ // transcript is paged (so the tail would print alone) and its ancestors clip
1172
+ // (so one viewport would print). See `use-session-print.ts`.
1173
+ const { isPreparing: isPreparingPrint } = useSessionPrint({
1174
+ scrollRef,
1175
+ hasOlder,
1176
+ isLoadingOlder,
1177
+ loadOlder,
1178
+ enabled: !hideHeader,
1179
+ });
1180
+ // Older history loads by scrolling, not by clicking: a sentinel above the
1181
+ // first turn pulls the previous page as it nears the top of the viewport.
1182
+ // A pull always prepends content above the reader, so every one is wrapped
1183
+ // in the turn anchor — capture where the topmost visible turn sits and hold
1184
+ // it there until the pull's last change has rendered (session-history-scroll.ts),
1185
+ // and the viewport never jumps.
1186
+ const [olderPullFailed, setOlderPullFailed] = useState(false);
1187
+ // The row the reader actually sees while a page is in flight — the live flag
1188
+ // held long enough to be read (`session-older-loading.ts`).
1189
+ const showOlderLoading = useHeldOlderLoading(isLoadingOlder);
1190
+ // Pages the SENTINEL has pulled. An explicit pull never counts — see
1191
+ // `OLDER_AUTOLOAD_MAX_PAGES` for why the automatic path is the one bounded.
1192
+ const [autoLoadedPages, setAutoLoadedPages] = useState(0);
1193
+ // The sentinel's re-arm latch (`nextOlderAutoloadArm`). A pull disarms it;
1194
+ // it re-arms only once the sentinel has LEFT the 400px rootMargin zone. A
1195
+ // prepend of short/collapsed turns that fails to push the sentinel out of
1196
+ // the zone used to re-fire the observer immediately and chain pulls in one
1197
+ // paint — while the rAF anchor-restore of pull N raced the capture of pull
1198
+ // N+1, which is the jump behind "keeps fetching". A ref, not state: arming
1199
+ // must not re-create the observer.
1200
+ const olderAutoloadArmedRef = useRef(true);
1201
+ useEffect(() => {
1202
+ setOlderPullFailed(false);
1203
+ setAutoLoadedPages(0);
1204
+ olderAutoloadArmedRef.current = true;
1205
+ }, [sessionId]);
1206
+ // The anchor hold of the pull in flight. It ends when the loading row comes
1207
+ // down: the row rises after the capture, the page lands under it (during a
1208
+ // live reply on the paced transcript's trailing edge, frames after the pull
1209
+ // resolved), and the row's fall is the last change a pull makes above the
1210
+ // reader. The release runs in that commit's layout effect, before paint. A
1211
+ // new pull, a session switch and unmount end the hold too.
1212
+ const releaseOlderAnchorRef = useRef(null);
1213
+ const releaseOlderAnchor = useCallback(() => {
1214
+ releaseOlderAnchorRef.current?.();
1215
+ releaseOlderAnchorRef.current = null;
1216
+ }, []);
1217
+ useLayoutEffect(() => {
1218
+ if (!showOlderLoading)
1219
+ releaseOlderAnchor();
1220
+ }, [showOlderLoading, releaseOlderAnchor]);
1221
+ useEffect(() => releaseOlderAnchor, [sessionId, releaseOlderAnchor]);
1222
+ const handleLoadOlder = useCallback(async () => {
1223
+ const node = scrollRef.current;
1224
+ const content = contentRef.current;
1225
+ releaseOlderAnchor();
1226
+ const release = node && content ? holdTurnScrollAnchor(node, content, captureTurnScrollAnchor(node)) : null;
1227
+ releaseOlderAnchorRef.current = release;
1228
+ try {
1229
+ await loadOlder();
1230
+ setOlderPullFailed(false);
1231
+ }
1232
+ catch {
1233
+ // Surface a retry instead of letting the sentinel re-arm into a loop.
1234
+ setOlderPullFailed(true);
1235
+ }
1236
+ // A pull that settled before its row ever rendered has no fall to end the
1237
+ // hold: end it once the page has had ample time to land.
1238
+ window.setTimeout(() => {
1239
+ if (releaseOlderAnchorRef.current === release)
1240
+ releaseOlderAnchor();
1241
+ }, 2 * OLDER_LOADING_MIN_MS);
1242
+ }, [loadOlder, scrollRef, contentRef, releaseOlderAnchor]);
1243
+ const olderSentinelRef = useRef(null);
1244
+ useEffect(() => {
1245
+ const node = olderSentinelRef.current;
1246
+ if (!node || !hasOlder)
1247
+ return;
1248
+ const observer = new IntersectionObserver(([entry]) => {
1249
+ const isIntersecting = !!entry?.isIntersecting;
1250
+ // On the session log a transcript shorter than its viewport cannot be scrolled: a 40-message
1251
+ // first page often folds to a few rows (a turn is one row), and the reader has no other way
1252
+ // to reach older history. Pull until it fills the viewport, within the auto-load page budget.
1253
+ // The auto-scroll spacer pads the content to the viewport: measure without it.
1254
+ const root = scrollRef.current;
1255
+ const cannotScroll = transcriptOnLog && !!root && root.scrollHeight - (spacerElRef.current?.offsetHeight ?? 0) <= root.clientHeight;
1256
+ const didPull = shouldLoadOlderHistory({
1257
+ isIntersecting,
1258
+ hasOlder,
1259
+ isLoadingOlder,
1260
+ lastPullFailed: olderPullFailed,
1261
+ autoLoadedPages,
1262
+ readerScrolledUp: readerScrolledUpRef.current || cannotScroll,
1263
+ armed: olderAutoloadArmedRef.current || cannotScroll,
1264
+ });
1265
+ olderAutoloadArmedRef.current = nextOlderAutoloadArm({
1266
+ armed: olderAutoloadArmedRef.current,
1267
+ isIntersecting,
1268
+ didPull,
1269
+ });
1270
+ if (didPull) {
1271
+ setAutoLoadedPages((pages) => pages + 1);
1272
+ void handleLoadOlder();
1273
+ }
1274
+ },
1275
+ // Pull before the reader reaches the top so history is already there.
1276
+ { root: scrollRef.current, rootMargin: '400px 0px 0px 0px' });
1277
+ observer.observe(node);
1278
+ return () => observer.disconnect();
1279
+ // sessionId is a dep because switching sessions swaps the scroll
1280
+ // container the observer is rooted in.
1281
+ }, [
1282
+ hasOlder,
1283
+ isLoadingOlder,
1284
+ olderPullFailed,
1285
+ autoLoadedPages,
1286
+ handleLoadOlder,
1287
+ scrollRef,
1288
+ sessionId,
1289
+ transcriptOnLog,
1290
+ ]);
1291
+ // Scroll to the bottom on initial load / session change.
1292
+ // Uses a callback ref on the scroll container to guarantee it's mounted.
1293
+ // A session opens at its end: `useAutoScroll` follows from the first layout
1294
+ // (no near-bottom-then-smooth choreography, which fought the follow). The
1295
+ // one exception is a sub-session viewed from its start.
1296
+ const initialScrollDoneRef = useRef(null);
1297
+ const scrollContainerCallbackRef = useCallback((node) => {
1298
+ // Always keep scrollRef updated
1299
+ scrollRef.current = node;
1300
+ if (!node)
1301
+ return;
1302
+ if (initialScrollDoneRef.current === sessionId)
1303
+ return;
1304
+ initialScrollDoneRef.current = sessionId;
1305
+ if (initialScrollTop)
1306
+ startAtTop();
1307
+ else
1308
+ scrollToBottom();
1309
+ }, [sessionId, scrollRef, initialScrollTop, startAtTop, scrollToBottom]);
1310
+ // Tab switch: the DOM stays mounted (hidden class), so the browser
1311
+ // preserves scroll position automatically. No action needed here.
1312
+ // ---- Pending permissions & questions ----
1313
+ const allPermissions = useRuntimePendingStore((s) => s.permissions);
1314
+ const allQuestions = useRuntimePendingStore((s) => s.questions);
1315
+ const pendingPermissions = useMemo(() => sessionState?.permissions ??
1316
+ Object.values(allPermissions).filter((p) => p.sessionID === sessionId), [sessionState?.permissions, allPermissions, sessionId]);
1317
+ const suppressedQuestionIdsRef = useRef(new Map());
1318
+ const suppressQuestionFor = useCallback((requestId, ms = 15000) => {
1319
+ suppressedQuestionIdsRef.current.set(requestId, Date.now() + ms);
1320
+ }, []);
1321
+ const isQuestionSuppressed = useCallback((requestId) => {
1322
+ const expiresAt = suppressedQuestionIdsRef.current.get(requestId);
1323
+ if (!expiresAt)
1324
+ return false;
1325
+ if (expiresAt <= Date.now()) {
1326
+ suppressedQuestionIdsRef.current.delete(requestId);
1327
+ return false;
1328
+ }
1329
+ return true;
1330
+ }, []);
1331
+ const pendingQuestions = useMemo(() => (sessionState?.questions ??
1332
+ Object.values(allQuestions).filter((q) => q.sessionID === sessionId)).filter((q) => !isQuestionSuppressed(q.id)), [sessionState?.questions, allQuestions, sessionId, isQuestionSuppressed]);
1333
+ /**
1334
+ * The runtime is parked on an answer only the user can give.
1335
+ *
1336
+ * Both lists are already session-scoped above. Either one means OpenCode has
1337
+ * stopped inside the turn and is blocked on a reply — the `question` tool, or
1338
+ * a tool asking for permission — so the turn row stays `active` and every
1339
+ * observer keeps reporting `working` with nothing to bound it but the reader.
1340
+ * The shimmer and its clock read that as progress; see
1341
+ * `showTurnBusyIndicator` for the measurement.
1342
+ *
1343
+ * The RAW question list, not `renderedQuestion`: that one is held an extra
1344
+ * 320ms past the answer to let the card fade out, and the waiting row must
1345
+ * come back the instant the agent is running again, not a third of a second
1346
+ * later.
1347
+ */
1348
+ const awaitingUserInput = pendingQuestions.length > 0 || pendingPermissions.length > 0;
1349
+ const QUESTION_PROMPT_ANIMATION_MS = 320;
1350
+ const activePendingQuestion = pendingQuestions[0] ?? null;
1351
+ const [renderedQuestion, setRenderedQuestion] = useState(null);
1352
+ const [questionPromptVisible, setQuestionPromptVisible] = useState(false);
1353
+ // A connector call waiting on a decision docks onto the composer the way a
1354
+ // question does (`SessionApprovalPrompt` reports it).
1355
+ const [approvalDocked, setApprovalDocked] = useState(false);
1356
+ const questionPromptTimerRef = useRef(null);
1357
+ useEffect(() => {
1358
+ const nextQuestion = activePendingQuestion;
1359
+ if (questionPromptTimerRef.current) {
1360
+ clearTimeout(questionPromptTimerRef.current);
1361
+ questionPromptTimerRef.current = null;
1362
+ }
1363
+ if (nextQuestion) {
1364
+ setRenderedQuestion(nextQuestion);
1365
+ requestAnimationFrame(() => setQuestionPromptVisible(true));
1366
+ return;
1367
+ }
1368
+ setQuestionPromptVisible(false);
1369
+ questionPromptTimerRef.current = setTimeout(() => {
1370
+ setRenderedQuestion(null);
1371
+ questionPromptTimerRef.current = null;
1372
+ }, QUESTION_PROMPT_ANIMATION_MS);
1373
+ }, [activePendingQuestion]);
1374
+ useEffect(() => {
1375
+ return () => {
1376
+ if (questionPromptTimerRef.current) {
1377
+ clearTimeout(questionPromptTimerRef.current);
1378
+ }
1379
+ };
1380
+ }, []);
1381
+ // Quick Queue entries share the turn renderer. The inbox marks their IDs as
1382
+ // pending until delivery; a client-minted wire ID does not place a message.
1383
+ // Each is the user message `sessionLogPromptMessage` mints for its prompt.
1384
+ const queuedSyntheticMessages = useMemo(() => {
1385
+ const out = [];
1386
+ for (const prompt of promptInbox.prompts) {
1387
+ if (prompt.state === 'failed' && prompt.placement !== 'transcript')
1388
+ continue;
1389
+ // Enter sends appear before delivery. Composer entries stay above the input.
1390
+ if (!isFirstPromptRow(prompt) && prompt.placement !== 'transcript')
1391
+ continue;
1392
+ if (!(prompt.full_text ?? prompt.text).trim() && !prompt.attachments?.length)
1393
+ continue;
1394
+ if (prompt.message_id && transcriptClaimedIds.has(prompt.message_id))
1395
+ continue;
1396
+ if (prompt.wire_message_id && transcriptClaimedIds.has(prompt.wire_message_id))
1397
+ continue;
1398
+ out.push(sessionLogPromptMessage(prompt, thread?.thread_id ?? sessionId));
1399
+ }
1400
+ return out;
1401
+ }, [promptInbox.prompts, transcriptClaimedIds, thread?.thread_id, sessionId]);
1402
+ const pendingDisplayIds = useMemo(() => {
1403
+ const ids = new Set();
1404
+ for (const prompt of agentPrompts) {
1405
+ if (prompt.message_id)
1406
+ ids.add(prompt.message_id);
1407
+ if (prompt.wire_message_id)
1408
+ ids.add(prompt.wire_message_id);
1409
+ ids.add(`queued-${prompt.prompt_id}`);
1410
+ }
1411
+ // A response is stronger evidence than a queue poll that has not caught up.
1412
+ for (const message of messages ?? []) {
1413
+ if (message.role === 'assistant' && message.reply_to) {
1414
+ ids.delete(message.reply_to);
1415
+ }
1416
+ }
1417
+ return ids;
1418
+ }, [agentPrompts, messages]);
1419
+ /**
1420
+ * The thread the turns read: the session log's messages, then the queued
1421
+ * prompts the thread has not placed yet. `sessionLogTurns` keeps a turn's
1422
+ * object identity while its messages and derived fields hold, so a
1423
+ * fifty-turn session hands React one new `turn` per streamed delta, not
1424
+ * fifty: `turn` is the dependency of ~28 memos inside `SessionTurn`.
1425
+ */
1426
+ const shownThread = useMemo(() => (thread ? sessionLogWithFullTexts(thread, loaded.texts) : null), [thread, loaded.texts]);
1427
+ const turnThread = useMemo(() => {
1428
+ const thread = shownThread;
1429
+ if (!thread && queuedSyntheticMessages.length === 0)
1430
+ return null;
1431
+ if (queuedSyntheticMessages.length === 0)
1432
+ return thread;
1433
+ const base = thread ?? {
1434
+ schema: SESSION_LOG_SCHEMA,
1435
+ v: SESSION_LOG_MINOR,
1436
+ thread_id: sessionId,
1437
+ parent_thread_id: null,
1438
+ spawned_by: null,
1439
+ agent: null,
1440
+ title: null,
1441
+ created_at: '',
1442
+ messages: [],
1443
+ };
1444
+ return { ...base, messages: [...base.messages, ...queuedSyntheticMessages] };
1445
+ }, [shownThread, queuedSyntheticMessages, sessionId]);
1446
+ // The store's alias for a re-minted echo — stable function reference, read
1447
+ // per turn for the React key (see the `TurnViewport` key below).
1448
+ const optimisticOriginOf = useSessionStateStore((state) => state.optimisticOriginOf);
1449
+ // The one working answer the LAST turn card renders (its shimmer). Resolved
1450
+ // here, once, so the card never reads the raw slot for a Kortix session —
1451
+ // see `resolveLastTurnWorking` for the split and the defect it removes.
1452
+ const lastTurnWorking = resolveLastTurnWorking({
1453
+ isChildSession,
1454
+ // The delay-hidden projection, so the card and the composer settle on the
1455
+ // same frame instead of the card flickering 300ms earlier. It is the SAME
1456
+ // value the composer's Stop reads: while Stop shows, a Thinking row shows.
1457
+ projectionBusy: isBusy,
1458
+ // The raw SSE slot: any status but idle (busy, retry).
1459
+ rawSlotBusy: !!sessionStatus && sessionStatus.type !== 'idle',
1460
+ });
1461
+ /**
1462
+ * The prompts the server still holds in its inbox, in queue order: their
1463
+ * turns render after the transcript and the agent is provably not on them
1464
+ * (`sessionLogTurns` `held`). Keyed by every id a bubble can be on screen
1465
+ * under, because the drain re-mints `message_id` while the tab still paints
1466
+ * `wire_message_id`. The row claimed by elimination is held too, under the
1467
+ * id it is on screen under, until a reply names it.
1468
+ */
1469
+ const heldTurnIds = useMemo(() => {
1470
+ const ids = [...pendingDisplayIds];
1471
+ const claimed = firstTurnClaim?.messageId;
1472
+ if (claimed &&
1473
+ !pendingDisplayIds.has(claimed) &&
1474
+ !(messages ?? []).some((m) => m.role === 'assistant' && m.reply_to === claimed)) {
1475
+ ids.unshift(claimed);
1476
+ }
1477
+ return ids;
1478
+ }, [pendingDisplayIds, firstTurnClaim, messages]);
1479
+ // Prices a turn whose replies report usage without a cost.
1480
+ const pricingLookup = useModelPricingLookup(providers);
1481
+ // The idle send this tab made last (`handleSend`), scoped to its session.
1482
+ // While its turn is unanswered it is the working turn even where the
1483
+ // projection names none — see `freshSendHint` for the double jump it removes.
1484
+ const [freshSend, setFreshSend] = useState(null);
1485
+ const turnOptions = useCallback((liveMessageId) => ({
1486
+ busy: lastTurnWorking,
1487
+ liveMessageId,
1488
+ held: heldTurnIds,
1489
+ pricing: pricingLookup,
1490
+ hideOutOfContext,
1491
+ foldCompactions: true,
1492
+ }), [lastTurnWorking, heldTurnIds, pricingLookup, hideOutOfContext]);
1493
+ // WHICH turn carries the shimmer (`live`), and which user bubbles are still
1494
+ // queued at the agent (`queued`): the working projection's turn, else this
1495
+ // tab's fresh send, else the transcript (`sessionLogTurns`).
1496
+ const projectedTurns = useMemo(() => (turnThread ? sessionLogTurns(turnThread, turnOptions(working.turnId)) : []), [turnThread, turnOptions, working.turnId]);
1497
+ const freshSendTurnId = useMemo(() => {
1498
+ if (working.turnId || !freshSend || freshSend.sessionId !== sessionId)
1499
+ return null;
1500
+ return freshSendHint(projectedTurns, (id) => id === freshSend.messageId || optimisticOriginOf(sessionId, id) === freshSend.messageId);
1501
+ }, [working.turnId, freshSend, sessionId, projectedTurns, optimisticOriginOf]);
1502
+ const turns = useMemo(() => freshSendTurnId && turnThread
1503
+ ? sessionLogTurns(turnThread, turnOptions(freshSendTurnId))
1504
+ : projectedTurns, [freshSendTurnId, turnThread, turnOptions, projectedTurns]);
1505
+ // P5.6: a switch `harness.history` records, drawn before the turn it lands on.
1506
+ const harnessSwitches = useMemo(() => sessionLogHarnessSwitches(sessionRecord?.harness?.history, turns), [sessionRecord?.harness?.history, turns]);
1507
+ // P5.6: load the whole of every text a turn shows as a preview, on request only.
1508
+ const fullTextsRef = useRef(loaded);
1509
+ fullTextsRef.current = loaded;
1510
+ const loadFullTexts = useCallback((turnId, refs) => {
1511
+ const key = fullTextsRef.current.key;
1512
+ const mark = (state) => setFullTexts((prev) => {
1513
+ const base = prev.key === key ? prev : { key, texts: NO_FULL_TEXTS, state: {} };
1514
+ return { ...base, state: { ...base.state, [turnId]: state } };
1515
+ });
1516
+ mark('loading');
1517
+ // Up to 1 MB in all the texts show inline; above it only the large ones download as files
1518
+ // (a multi-MB text in markdown stalls the tab), the small ones still show inline.
1519
+ const plan = sessionLogFullTextPlan(refs);
1520
+ void Promise.all([
1521
+ Promise.all(plan.inline.map(async ({ ref }) => [ref, await (await fetchSessionAttachment(ref)).text()])),
1522
+ Promise.all(plan.download.map(({ ref }) => fetchSessionAttachment(ref))),
1523
+ ])
1524
+ .then(([pairs, blobs]) => {
1525
+ blobs.forEach((blob, i) => downloadBlob(blob, blobs.length > 1 ? `full-text-${i + 1}.txt` : 'full-text.txt'));
1526
+ setFullTexts((prev) => {
1527
+ const base = prev.key === key ? prev : { key, texts: NO_FULL_TEXTS, state: {} };
1528
+ return { key, texts: pairs.length ? new Map([...base.texts, ...pairs]) : base.texts, state: { ...base.state, [turnId]: 'idle' } };
1529
+ });
1530
+ })
1531
+ .catch(() => mark('error'));
1532
+ }, []);
1533
+ // Outcomes anchor to the SAME id `TurnViewport` receives as `turnId`
1534
+ // (`turn.id`) — never `turnRenderKeys`, which re-aliases a turn to its
1535
+ // optimistic origin id on an id swap, so anchoring to it would make an
1536
+ // outcome card jump between turns mid-stream.
1537
+ //
1538
+ // Stabilised BY CONTENT: `turns` is a new array whenever any turn changed,
1539
+ // which is every frame while ANY turn is streaming. Without this,
1540
+ // `turnSpans` — and everything built on it below — would be new every
1541
+ // frame, which makes `SessionOutcomesProvider`'s context `value` new every
1542
+ // frame, which re-renders every `TurnOutcomes` in the transcript on every
1543
+ // SSE frame. The ref is written in a `useEffect` AFTER commit, so render
1544
+ // stays pure.
1545
+ const stableSpansRef = useRef([]);
1546
+ const turnSpans = useMemo(() => {
1547
+ const next = turns.map((turn) => ({
1548
+ key: turn.id,
1549
+ ...sessionTurnSpan(turn),
1550
+ }));
1551
+ const prev = stableSpansRef.current;
1552
+ const same = prev.length === next.length &&
1553
+ prev.every((p, i) => p.key === next[i].key &&
1554
+ p.startedAt === next[i].startedAt &&
1555
+ p.endedAt === next[i].endedAt);
1556
+ return same ? prev : next;
1557
+ }, [turns]);
1558
+ useEffect(() => {
1559
+ stableSpansRef.current = turnSpans;
1560
+ }, [turnSpans]);
1561
+ // The first prompt as its producer left it for the boot shell — drawn here
1562
+ // too, inert, until the transcript or the inbox has the real thing, then
1563
+ // released. See `useFirstPromptPreviewStore`.
1564
+ const firstPromptPreview = useFirstPromptPreviewStore((state) => projectSessionId ? (state.previewBySession[projectSessionId] ?? null) : null);
1565
+ const clearFirstPromptPreview = useFirstPromptPreviewStore((state) => state.clearFirstPromptPreview);
1566
+ // Two different questions, and they used to be one.
1567
+ //
1568
+ // WHEN DOES THE STAND-IN STEP ASIDE? The frame the transcript shows the
1569
+ // text. Holding it past that stacked a second bubble on top of the real one
1570
+ // for the whole text-first window (review finding, 2026-09-05).
1571
+ //
1572
+ // WHEN IS THE PREVIEW FORGOTTEN? Only once the transcript's message carries
1573
+ // the attachments it promised — the runtime streams the text part first and
1574
+ // the file parts seconds later, and forgetting on text alone was what left
1575
+ // the real bubble with no tiles for those seconds. Until then the preview's
1576
+ // file identities and names are handed to the real turn, which draws them as
1577
+ // finished tiles with no upload chrome, so the strip never blinks out. See
1578
+ // `first-prompt-handover.ts`.
1579
+ const transcriptShowsFirstPrompt = useMemo(() => transcriptCarriesFirstPrompt(turns, 0), [turns]);
1580
+ const previewAttachmentCount = firstPromptPreview?.files.length ?? 0;
1581
+ const transcriptCarriesFirstPromptFiles = useMemo(() => transcriptCarriesFirstPrompt(turns, previewAttachmentCount), [turns, previewAttachmentCount]);
1582
+ // A RELEASE IS A LATCH. The transcript's first message briefly has no parts
1583
+ // while the store swaps the optimistic copy for the runtime's echo (~176 ms
1584
+ // as the file parts land, on video 2026-09-06); a live boolean brought the
1585
+ // stand-in back at full opacity over the dimmed real turn for those frames.
1586
+ // Once released, the real turn owns the prompt — see
1587
+ // `resolveFirstPromptHandover`.
1588
+ const [firstPromptReleased, setFirstPromptReleased] = useState(false);
1589
+ /**
1590
+ * THIS COMPONENT'S OWN COPY of the first prompt, kept past the store's.
1591
+ *
1592
+ * Two things read `useFirstPromptPreviewStore`, and they need it for
1593
+ * different lengths of time. The BOOT SHELL (and the route, which pins the
1594
+ * shell while a preview exists) needs it only until the transcript shows the
1595
+ * prompt — one frame longer and the shell's copy dissolves over the real
1596
+ * bubble during the crossfade, two bubbles for the length of the fade
1597
+ * (measured 2026-09-08: both stand-ins at full opacity, ~200 ms). This
1598
+ * component needs the TEXT for longer: the runtime's echo arrives as an info
1599
+ * frame with its text part following separately, and on the project-home
1600
+ * path nothing bridges the two (the producer POSTed a durable row, not an
1601
+ * optimistic message), so the bubble drew nothing for that gap — the blank
1602
+ * thread on the 2026-09-06 recording.
1603
+ *
1604
+ * So the store keeps its original, short life — cleared the frame the
1605
+ * transcript carries the prompt — and the longer life is local: a snapshot
1606
+ * this component holds until the prompt is SETTLED (answered, or the session
1607
+ * is finished with it: idle, nothing left in the inbox). Local state cannot
1608
+ * pin the route's shell, cannot outlive a navigation, and is invisible to
1609
+ * every other reader of the store.
1610
+ */
1611
+ // SETTLED: answered, or the session is finished with it (idle, nothing left
1612
+ // in the inbox — Stop, a failure, a delivery that never ran).
1613
+ const firstPromptSettled = turns.length > 0 &&
1614
+ (turns[0].assistant.length > 0 || (!isBusy && promptInbox.prompts.length === 0));
1615
+ // Guarded render-phase updates, the same shape as `contentPainted` below:
1616
+ // mirror the store's copy while the prompt is live, drop it once settled. The
1617
+ // mirror is suppressed once settled, or the two would re-adopt and re-drop
1618
+ // each other on every render.
1619
+ const [firstPromptKeep, setFirstPromptKeep] = useState(null);
1620
+ if (firstPromptSettled) {
1621
+ if (firstPromptKeep)
1622
+ setFirstPromptKeep(null);
1623
+ }
1624
+ else if (firstPromptPreview && firstPromptKeep !== firstPromptPreview) {
1625
+ setFirstPromptKeep(firstPromptPreview);
1626
+ }
1627
+ const firstPromptSource = firstPromptPreview ?? firstPromptKeep;
1628
+ const handover = resolveFirstPromptHandover({
1629
+ hasPreview: !!firstPromptSource,
1630
+ transcriptShowsText: transcriptShowsFirstPrompt,
1631
+ transcriptCarriesFiles: transcriptCarriesFirstPromptFiles,
1632
+ releasedBefore: firstPromptReleased,
1633
+ transcriptEmpty: turns.length === 0,
1634
+ });
1635
+ useEffect(() => {
1636
+ if (handover.released && !firstPromptReleased)
1637
+ setFirstPromptReleased(true);
1638
+ }, [handover.released, firstPromptReleased]);
1639
+ const showFirstPromptPreview = handover.showStandIn;
1640
+ // The STORE's copy is forgotten the frame the transcript carries the prompt —
1641
+ // the original rule, and the one the shell's crossfade depends on.
1642
+ useEffect(() => {
1643
+ if (!projectSessionId || !firstPromptPreview)
1644
+ return;
1645
+ if (transcriptCarriesFirstPromptFiles)
1646
+ clearFirstPromptPreview(projectSessionId);
1647
+ }, [
1648
+ projectSessionId,
1649
+ firstPromptPreview,
1650
+ transcriptCarriesFirstPromptFiles,
1651
+ clearFirstPromptPreview,
1652
+ ]);
1653
+ /** What the real first turn is handed once the stand-in has stepped aside:
1654
+ * the prompt's text and its files' identities and names, so it keeps
1655
+ * drawing the bubble and its tiles through any frame where its own parts
1656
+ * are still streaming. Nothing once the transcript carries the files itself. */
1657
+ const firstTurnHandover = useMemo(() => {
1658
+ if (!firstPromptSource || !handover.handOverToRealTurn)
1659
+ return undefined;
1660
+ return {
1661
+ text: firstPromptSource.text,
1662
+ attachments: sentAttachmentsOf(firstPromptSource.files),
1663
+ };
1664
+ }, [firstPromptSource, handover.handOverToRealTurn]);
1665
+ /**
1666
+ * Which turn, if any, draws the plan.
1667
+ *
1668
+ * Null on desktop, always: the Easy panel owns the plan at every width above
1669
+ * 768px — collapsed column and detail panel included — so no turn claims it
1670
+ * and the transcript scan below never runs. Mobile has no panel column at
1671
+ * all, so the chat keeps it there. `usePlanInChat` is the single decision
1672
+ * both surfaces read; see `plan-surface.ts` and `planBelongsToChat`.
1673
+ *
1674
+ * One scan of the transcript, not one per turn. `planAnchorMessageId`
1675
+ * inspects every part of every message. It used to run inside each turn,
1676
+ * which made it O(turns x total-parts) — on the order of 100k part
1677
+ * inspections per frame for a long session.
1678
+ */
1679
+ const planInChat = usePlanInChat();
1680
+ const planAnchorId = useMemo(() => chatPlanAnchorId(turns, planInChat), [turns, planInChat]);
1681
+ const lastUserMessageId = useMemo(() => {
1682
+ if (!messages)
1683
+ return null;
1684
+ for (let i = messages.length - 1; i >= 0; i--) {
1685
+ if (messages[i].role === 'user')
1686
+ return messages[i].message_id;
1687
+ }
1688
+ return null;
1689
+ }, [messages]);
1690
+ // Inbox rows keyed by every id a bubble can be on screen under, because the
1691
+ // drain re-mints `message_id` while the tab still paints `wire_message_id`.
1692
+ const pendingPromptsByMessageId = useMemo(() => {
1693
+ const byId = new Map();
1694
+ for (const prompt of agentPrompts) {
1695
+ if (prompt.message_id)
1696
+ byId.set(prompt.message_id, prompt);
1697
+ if (prompt.wire_message_id)
1698
+ byId.set(prompt.wire_message_id, prompt);
1699
+ }
1700
+ return byId;
1701
+ }, [agentPrompts]);
1702
+ // Every id a prompt the inbox is delivering right now can render under,
1703
+ // including the synthetic `queued-` id a bubble with no message id uses.
1704
+ const deliveringPromptIds = useMemo(() => {
1705
+ const ids = new Set();
1706
+ for (const prompt of agentPrompts) {
1707
+ if (prompt.state !== 'delivering')
1708
+ continue;
1709
+ if (prompt.message_id)
1710
+ ids.add(prompt.message_id);
1711
+ if (prompt.wire_message_id)
1712
+ ids.add(prompt.wire_message_id);
1713
+ ids.add(`queued-${prompt.prompt_id}`);
1714
+ }
1715
+ return ids;
1716
+ }, [agentPrompts]);
1717
+ // The working turn and the turns the agent has not reached, as the turn
1718
+ // layer resolved them (`live`, `queued`): the working turn is named only
1719
+ // while the session works.
1720
+ const workingTurn = useMemo(() => ({
1721
+ workingTurnId: turns.find((t) => t.live)?.id ?? null,
1722
+ pendingTurnIds: turns.filter((t) => t.queued).map((t) => t.id),
1723
+ }), [turns]);
1724
+ const workingTurnIdRef = useRef(workingTurn.workingTurnId);
1725
+ useEffect(() => {
1726
+ workingTurnIdRef.current = workingTurn.workingTurnId;
1727
+ }, [workingTurn.workingTurnId]);
1728
+ const pendingTurnIds = useMemo(() => new Set(workingTurn.pendingTurnIds), [workingTurn]);
1729
+ // The turn the working projection names. After a compaction inside the running turn the work
1730
+ // renders under its continuation turn, while the projection still names the prompt or the marker.
1731
+ const activeTurnId = useMemo(() => {
1732
+ const c = turns.find((t) => t.live)?.continues;
1733
+ return c && (working.turnId === c.marker || working.turnId === c.prompt) ? workingTurn.workingTurnId : working.turnId;
1734
+ }, [turns, workingTurn.workingTurnId, working.turnId]);
1735
+ /**
1736
+ * Does the resolved working turn have a COMPLETED answer while queued prompts
1737
+ * wait below it? `resolveWorkingTurn` falls back to the newest turn WITH
1738
+ * content when every pending prompt is still held in the inbox (rule 4). If
1739
+ * that turn's answer is already complete, its live busy row would render above
1740
+ * the just-sent (queued) message and then jump down when the prompt starts
1741
+ * running. In that one case the working turn shows no indicator — the queued
1742
+ * turns are their own dimmed bubbles until one runs. Only a FINISHED answer
1743
+ * suppresses; a turn streaming between steps has an OPEN assistant message, so
1744
+ * `resolveWorkingTurn` rule 1 picks it and this stays false (no flicker).
1745
+ * A completed assistant message can also be an intermediate step. When the
1746
+ * working projection still names this turn, its indicator stays here.
1747
+ */
1748
+ const suppressWorkingTurnBusy = useMemo(() => {
1749
+ if (workingTurn.pendingTurnIds.length === 0)
1750
+ return false;
1751
+ const wt = turns.find((t) => t.id === workingTurn.workingTurnId);
1752
+ if (!wt || wt.assistant.length === 0)
1753
+ return false;
1754
+ const newest = wt.assistant[wt.assistant.length - 1];
1755
+ return shouldSuppressWorkingTurnBusy({
1756
+ hasPendingTurns: true,
1757
+ newestAssistantCompleted: newest.completed_at !== null,
1758
+ workingTurnId: wt.id,
1759
+ activeTurnId,
1760
+ pendingDelivery: !!working.pendingDelivery,
1761
+ deliveringBelow: workingTurn.pendingTurnIds.some((id) => deliveringPromptIds.has(id)),
1762
+ });
1763
+ }, [turns, workingTurn, activeTurnId, working.pendingDelivery, deliveringPromptIds]);
1764
+ /**
1765
+ * Is ANY turn going to draw the waiting row?
1766
+ *
1767
+ * `resolveWorkingTurn` deliberately declines to name a turn in two states,
1768
+ * and both are states in which the session is very much working:
1769
+ *
1770
+ * - every prompt on screen is still held by the server AND no turn has
1771
+ * assistant content yet — the fresh-session case, where rule 4 has no
1772
+ * "newest turn with content" to fall back to and returns null;
1773
+ * - the fallback landed on a turn whose answer is COMPLETE while queued
1774
+ * prompts wait below it (`suppressWorkingTurnBusy`).
1775
+ *
1776
+ * Neither is wrong: the shimmer must not sit on a prompt the agent has not
1777
+ * reached, nor on a finished answer. But nothing else drew the row either,
1778
+ * so the whole surface read as idle while the composer showed Stop — the
1779
+ * user's session going INACTIVE with their prompt in flight (dev,
1780
+ * 2026-09-06, on video: ~11s of it on the first prompt, ~1s on the second).
1781
+ *
1782
+ * The row below is that missing fallback. It is the same element and the
1783
+ * same wording every other surface uses, and it is already what a session
1784
+ * with no turns at all shows.
1785
+ */
1786
+ const workingTurnHasError = useMemo(() => {
1787
+ const wt = turns.find((t) => t.id === workingTurn.workingTurnId);
1788
+ return !!wt && !!resolveTurnError(wt);
1789
+ }, [turns, workingTurn.workingTurnId]);
1790
+ const someTurnDrawsBusyRow = workingTurnDrawsBusyRow({
1791
+ lastTurnWorking,
1792
+ workingTurnId: workingTurn.workingTurnId,
1793
+ suppressed: suppressWorkingTurnBusy,
1794
+ workingTurnHasError,
1795
+ isRetrying: !!getRetryInfo(sessionStatus),
1796
+ awaitingUser: awaitingUserInput,
1797
+ });
1798
+ const showFallbackBusyRow = lastTurnWorking &&
1799
+ !someTurnDrawsBusyRow &&
1800
+ // The fallback exists so a busy session never shows zero rows. A session
1801
+ // parked on a question is the one case where zero rows is the right
1802
+ // answer, so it is excluded here rather than catching the row the working
1803
+ // turn just declined to draw.
1804
+ !awaitingUserInput &&
1805
+ !(showFirstPromptPreview &&
1806
+ firstPromptSource &&
1807
+ queuedSyntheticMessages.length === 0 &&
1808
+ turns.length === 0);
1809
+ const fallbackBusyRowTurnId = useMemo(() => fallbackBusyRowAfterTurnId({
1810
+ turns,
1811
+ pendingTurnIds,
1812
+ pendingPromptIds: pendingPromptsByMessageId,
1813
+ deliveringPromptIds,
1814
+ }), [turns, pendingTurnIds, pendingPromptsByMessageId, deliveringPromptIds]);
1815
+ /**
1816
+ * ONE render key per turn. A turn keeps the id its bubble was FIRST painted
1817
+ * under (the optimistic origin), so a re-minted echo re-renders the same
1818
+ * element instead of mounting a new one. But an origin can transiently be
1819
+ * claimed by TWO turns — an old echo still on screen while its re-placed
1820
+ * copy arrives — and duplicate React keys corrupt the whole list (measured:
1821
+ * 1.5k "two children with the same key" errors in one churn). The origin
1822
+ * key goes to the FIRST claimant; any other turn falls back to its own id.
1823
+ */
1824
+ const turnRenderKeys = useMemo(() => {
1825
+ const keys = new Map();
1826
+ const used = new Set();
1827
+ for (const turn of turns) {
1828
+ const id = turn.id;
1829
+ const origin = optimisticOriginOf(sessionId, id);
1830
+ let key = origin && !used.has(origin) ? origin : id;
1831
+ // Belt and braces: whatever aliasing produced a collision, NEVER hand
1832
+ // React two children with one key — that corrupts the whole list.
1833
+ while (used.has(key))
1834
+ key = `${key}~`;
1835
+ keys.set(id, key);
1836
+ used.add(key);
1837
+ }
1838
+ return keys;
1839
+ }, [turns, sessionId, optimisticOriginOf]);
1840
+ // User messages a Stop stranded, while the session is idle (`strandedPromptIds`).
1841
+ const interruptedTurnIds = useMemo(() => (lastTurnWorking ? new Set() : strandedPromptIds(turns, messages)), [turns, messages, lastTurnWorking]);
1842
+ /** Hoisted out of the JSX: an inline arrow prop defeats `React.memo` by itself.
1843
+ * Opens the inline editor on that message — nothing is staged until its Send. */
1844
+ const handleRewind = useCallback((messageId, text) => setRewindTarget({ messageId, text }), []);
1845
+ const hasAnyMessages = turns.length > 0;
1846
+ // A pending inbox row counts as content: the session HAS the user's message
1847
+ // (durably), so the welcome overlay must not paint over the queue strip.
1848
+ const hasChatContent = hasAnyMessages || promptInbox.prompts.length > 0 || firstPromptPreview !== null;
1849
+ // Full-bleed wallpaper layer mounted by SessionLayout (null on mobile /
1850
+ // standalone). When present, the welcome wallpaper is portaled into it so it
1851
+ // spans the entire session width instead of shrinking with the chat panel.
1852
+ const wallpaperLayer = useSessionWallpaperLayer();
1853
+ const WELCOME_FADE_MS = 900;
1854
+ const [welcomeFadeActive, setWelcomeFadeActive] = useState(false);
1855
+ const welcomeFadeTimerRef = useRef(null);
1856
+ const prevHasChatContentRef = useRef(hasChatContent);
1857
+ useEffect(() => {
1858
+ const hadContent = prevHasChatContentRef.current;
1859
+ if (!hadContent && hasChatContent) {
1860
+ setWelcomeFadeActive(true);
1861
+ if (welcomeFadeTimerRef.current) {
1862
+ clearTimeout(welcomeFadeTimerRef.current);
1863
+ }
1864
+ welcomeFadeTimerRef.current = setTimeout(() => {
1865
+ setWelcomeFadeActive(false);
1866
+ welcomeFadeTimerRef.current = null;
1867
+ }, WELCOME_FADE_MS + 120);
1868
+ }
1869
+ if (!hasChatContent) {
1870
+ setWelcomeFadeActive(false);
1871
+ }
1872
+ prevHasChatContentRef.current = hasChatContent;
1873
+ }, [hasChatContent]);
1874
+ useEffect(() => {
1875
+ return () => {
1876
+ if (welcomeFadeTimerRef.current) {
1877
+ clearTimeout(welcomeFadeTimerRef.current);
1878
+ }
1879
+ };
1880
+ }, []);
1881
+ // The 2 s permission/question self-heal polls that used to sit here are
1882
+ // gone: the session stream's runtime channel is SEQUENCED (a lost
1883
+ // `question.asked` frame is a detectable gap, not a silent hole), and the
1884
+ // `kortix.control.runtime_state` snapshots re-seed open asks on every
1885
+ // attach/reconnect — see the SDK's `useSessionRuntimeStream`.
1886
+ // ---- Permission/question reply handlers ----
1887
+ const removePermission = useRuntimePendingStore((s) => s.removePermission);
1888
+ const removeQuestion = useRuntimePendingStore((s) => s.removeQuestion);
1889
+ const handlePermissionReply = useCallback(async (requestId, reply) => {
1890
+ // No optimistic remove: only drop the card once the runtime accepted the
1891
+ // reply — a failed reply must stay answerable. Rethrow so callers
1892
+ // (prompt buttons) reset their busy state and surface the error.
1893
+ if (sessionState) {
1894
+ await sessionState.answerPermission(requestId, reply);
1895
+ }
1896
+ else {
1897
+ await replyToPermission(requestId, reply);
1898
+ removePermission(requestId);
1899
+ }
1900
+ }, [sessionState, removePermission]);
1901
+ const handleQuestionReply = useCallback(async (requestId, answers) => {
1902
+ // Snapshot the question BEFORE removing it so we can cache the
1903
+ // answer against the tool part's ID.
1904
+ const questionReq = sessionState?.questions.find((question) => question.id === requestId) ??
1905
+ useRuntimePendingStore.getState().questions[requestId];
1906
+ suppressQuestionFor(requestId);
1907
+ // Optimistically remove the question so the textarea shows immediately
1908
+ removeQuestion(requestId);
1909
+ // Save the answers in the optimistic cache keyed by the question call's
1910
+ // block id. This cache survives updates that may overwrite the call
1911
+ // before the server includes its answers; the transcript's answered
1912
+ // questions read from it as a fallback.
1913
+ if (questionReq?.tool?.messageID) {
1914
+ const { messageID, callID } = questionReq.tool;
1915
+ const message = threadRef.current?.messages.find((m) => m.message_id === messageID);
1916
+ const match = message?.blocks.find((b) => b.type === 'tool_call' && isQuestionTool(b.name) && b.call_id === callID);
1917
+ if (match?.type === 'tool_call') {
1918
+ optimisticAnswersCache.set(match.id, {
1919
+ answers,
1920
+ input: match.input && typeof match.input === 'object'
1921
+ ? match.input
1922
+ : {},
1923
+ });
1924
+ }
1925
+ }
1926
+ try {
1927
+ if (sessionState)
1928
+ await sessionState.answerQuestion(requestId, answers);
1929
+ else
1930
+ await replyToQuestion(requestId, answers);
1931
+ }
1932
+ catch {
1933
+ // ignore — SSE "question.replied" event will also remove it
1934
+ }
1935
+ }, [sessionState, removeQuestion, suppressQuestionFor]);
1936
+ const handleQuestionReject = useCallback(async (requestId) => {
1937
+ suppressQuestionFor(requestId);
1938
+ // Optimistically remove the question so the textarea shows immediately
1939
+ removeQuestion(requestId);
1940
+ try {
1941
+ if (sessionState)
1942
+ await sessionState.rejectQuestion(requestId);
1943
+ else
1944
+ await rejectQuestion(requestId);
1945
+ }
1946
+ catch {
1947
+ // ignore — SSE "question.rejected" event will also remove it
1948
+ }
1949
+ // Also abort the session so the "The operation was aborted." banner
1950
+ // appears. Routed through `issueSessionCancel` (T10) so this
1951
+ // cancel's `AbortSettlement` is tracked the same as every other stop
1952
+ // path, in case a queued "send now" follows a question rejection.
1953
+ if (sessionState) {
1954
+ issueSessionCancel();
1955
+ }
1956
+ else if (!abortSession.isPending) {
1957
+ issueSessionCancel();
1958
+ }
1959
+ }, [sessionState, removeQuestion, abortSession, suppressQuestionFor, issueSessionCancel]);
1960
+ // A compaction turn of any state (`turn.compaction`), so a failed attempt's
1961
+ // turn suppresses the optimistic "Compacting…" marker instead of leaving it
1962
+ // shimmering beside the failure row.
1963
+ const hasCompactionTurn = useMemo(() => turns.some((turn) => turn.compaction !== null || turn.blocks.some((block) => block.type === 'compaction')), [turns]);
1964
+ // Index of the LAST compaction turn (any state). Every FAILED attempt
1965
+ // before it is history the reader retried past — a run of retries renders
1966
+ // as ONE failure row (the latest), not a stack of near-identical lines.
1967
+ const lastCompactionTurnIndex = useMemo(() => {
1968
+ for (let i = turns.length - 1; i >= 0; i--) {
1969
+ if (turns[i].compaction !== null)
1970
+ return i;
1971
+ }
1972
+ return -1;
1973
+ }, [turns]);
1974
+ // ---- Jump-to-message (from CMD+K or minimap) ----
1975
+ const targetMessageId = useMessageJumpStore((s) => s.targetMessageId);
1976
+ const clearJumpTarget = useMessageJumpStore((s) => s.clearTarget);
1977
+ useEffect(() => {
1978
+ if (!targetMessageId)
1979
+ return;
1980
+ const contentEl = contentRef.current;
1981
+ const scrollEl = scrollRef.current;
1982
+ if (!contentEl || !scrollEl)
1983
+ return;
1984
+ const target = contentEl.querySelector(`[data-turn-id="${targetMessageId}"]`);
1985
+ if (!target) {
1986
+ clearJumpTarget();
1987
+ return;
1988
+ }
1989
+ const scrollRect = scrollEl.getBoundingClientRect();
1990
+ const targetRect = target.getBoundingClientRect();
1991
+ const offset = targetRect.top - scrollRect.top + scrollEl.scrollTop - 24;
1992
+ scrollEl.scrollTo({ top: Math.max(0, offset), behavior: 'smooth' });
1993
+ clearJumpTarget();
1994
+ }, [targetMessageId, clearJumpTarget, contentRef, scrollRef]);
1995
+ // Reset on session change
1996
+ useEffect(() => {
1997
+ clearSendReceipt();
1998
+ setRewindTarget(null);
1999
+ }, [sessionId, clearSendReceipt]);
2000
+ // ============================================================================
2001
+ // Billing: DISABLED — billing is handled server-side by the LLM gateway
2002
+ // (it deducts credits per LLM call).
2003
+ // This frontend useEffect was causing double-billing once opencode.jsonc
2004
+ // got cost config and step-finish.cost became non-zero.
2005
+ // ============================================================================
2006
+ // No composer-draft side effect any more: the old flow prefilled the
2007
+ // composer with the rewound prompt and Restore had to wipe that prefill.
2008
+ // The inline editor never touches the composer, so wiping it here would
2009
+ // only destroy an unrelated draft the user had typed.
2010
+ const handleRestoreRewind = useCallback(async () => {
2011
+ if (!sessionState?.rewindMessageId)
2012
+ return;
2013
+ try {
2014
+ await sessionState.restoreRewind();
2015
+ }
2016
+ catch (error) {
2017
+ errorToast(tHardcodedUi.raw('i18nComplete.text8f43efcd9139'), {
2018
+ description: formatCommandError(error),
2019
+ });
2020
+ }
2021
+ }, [sessionState, tHardcodedUi]);
2022
+ // ============================================================================
2023
+ // Send / Stop / Command handlers
2024
+ // ============================================================================
2025
+ /**
2026
+ * The files each send carried, by the message id its bubble was painted
2027
+ * under. Its turn draws them by identity until each delivered part renders
2028
+ * (`mergeSentAttachments`), so the strip never shrinks while the echo streams.
2029
+ */
2030
+ const [sentAttachmentsByMessage, setSentAttachmentsByMessage] = useState({});
2031
+ // A mounted session holds the sent pictures; the last one to unmount revokes them.
2032
+ useEffect(() => retainSentAttachmentPreviews(), []);
2033
+ const handleSend = useCallback(async (rawText, files, mentions, attachments,
2034
+ /**
2035
+ * Optional per-call overrides — used by the message queue drain so a
2036
+ * queued message uses the agent/model/variant captured at enqueue time
2037
+ * rather than whatever is currently active in the local store
2038
+ * (matches OpenCode FollowupDraft semantics).
2039
+ */
2040
+ overrides) => {
2041
+ setCommandError(null);
2042
+ // Reply quotes are already in `rawText`: the composer prepends each
2043
+ // quote as its own `<reply_context>` line (`withReplyQuotes`).
2044
+ const text = rawText;
2045
+ // Structured @-mention refs — emitted as <file_ref /> / <agent_ref />
2046
+ // blocks appended to the outgoing text. Same shape as
2047
+ // the existing <session_ref /> handling, so the agent gets uniform
2048
+ // metadata and the frontend can strip them back out on render.
2049
+ // File and agent refs from tracked @ mentions. File uploads still use
2050
+ // the separate <file path="..." mime="..." ...>…</file> block below —
2051
+ // these are only for plain @ references to existing files/agents.
2052
+ const fileMentionRefs = [];
2053
+ const agentMentionRefs = [];
2054
+ for (const m of mentions ?? []) {
2055
+ if (!m.label)
2056
+ continue;
2057
+ if (m.kind === 'file')
2058
+ fileMentionRefs.push({ path: m.label, name: m.label });
2059
+ else if (m.kind === 'agent')
2060
+ agentMentionRefs.push({ name: m.label });
2061
+ }
2062
+ // Play send sound
2063
+ playSound('send');
2064
+ // ONE id for the prompt's whole life. This is the WIRE id the inbox row
2065
+ // carries and the runtime persists — minted by the SDK against this
2066
+ // session's transcript (idempotent per `clientMessageId`, so an undo or
2067
+ // retry re-uses it). The optimistic bubble is painted with it, so the
2068
+ // server's echo confirms it IN PLACE, and the inbox row is never a
2069
+ // second thing on screen (`transcriptUserMessageIds`). It used to be an
2070
+ // `ascendingId` that only the optimistic bubble knew — three ids per
2071
+ // prompt (optimistic, wire, delivered) and two surfaces, and every
2072
+ // hand-off between them was a frame where the message doubled, blinked
2073
+ // or jumped.
2074
+ const clientMessageId = overrides?.clientMessageId ?? ascendingId('msg');
2075
+ const sentAtMs = Date.now();
2076
+ const messageID = mintSessionWireMessageId(sessionId, clientMessageId);
2077
+ // Generate part IDs upfront so the optimistic message and the server
2078
+ // request use the SAME IDs. When the server echoes parts via
2079
+ // message.part.updated, the sync store's upsertPart will UPDATE
2080
+ // (not duplicate) the optimistic parts. This matches OpenCode's
2081
+ // SolidJS approach where part IDs are sent with the prompt request.
2082
+ const textPartId = ascendingId('prt');
2083
+ const attachedFiles = files ?? [];
2084
+ // Build optimistic text that includes session ref XML so that
2085
+ // HighlightMentions / UserMessage can detect multi-word session
2086
+ // mentions (e.g. "@Intro message") before the server echoes back.
2087
+ const sessionMentionsForOptimistic = mentions?.filter((m) => m.kind === 'session' && m.value) ?? [];
2088
+ // Also detect raw @ses_<id> patterns typed directly
2089
+ const rawOptimisticSessionIds = [];
2090
+ const rawOptimisticRegex = /@(ses_[A-Za-z0-9]+)/g;
2091
+ let rawOptimisticMatch;
2092
+ let optimisticSessionsById = null;
2093
+ while ((rawOptimisticMatch = rawOptimisticRegex.exec(text)) !== null) {
2094
+ const rawId = rawOptimisticMatch[1];
2095
+ if (sessionMentionsForOptimistic.some((m) => m.value === rawId))
2096
+ continue;
2097
+ optimisticSessionsById ??= new Map((allSessions ?? []).map((s) => [s.id, s]));
2098
+ const found = optimisticSessionsById.get(rawId);
2099
+ rawOptimisticSessionIds.push({
2100
+ kind: 'session',
2101
+ label: found?.title || rawId,
2102
+ value: rawId,
2103
+ });
2104
+ }
2105
+ const allOptimisticSessionMentions = [
2106
+ ...sessionMentionsForOptimistic,
2107
+ ...rawOptimisticSessionIds,
2108
+ ];
2109
+ let optimisticText = text;
2110
+ optimisticText = buildOptimisticPromptTextWithUploads(optimisticText, attachedFiles);
2111
+ optimisticText = appendSessionRefs(optimisticText, allOptimisticSessionMentions.map((m) => ({ id: m.value ?? '', title: m.label })));
2112
+ if (fileMentionRefs.length > 0) {
2113
+ const block = buildFileRefsBlock(fileMentionRefs);
2114
+ if (block)
2115
+ optimisticText = `${optimisticText}\n\n${block}`;
2116
+ }
2117
+ if (agentMentionRefs.length > 0) {
2118
+ const block = buildAgentRefsBlock(agentMentionRefs);
2119
+ if (block)
2120
+ optimisticText = `${optimisticText}\n\n${block}`;
2121
+ }
2122
+ // ENTER NEVER INTERRUPTS, AND A QUEUED MESSAGE IS NOT IN THE TRANSCRIPT.
2123
+ //
2124
+ // While a turn runs — or while anything is already queued, so FIFO holds —
2125
+ // the prompt goes to the queued list above the composer
2126
+ // (`QueuedPromptList`) and nothing is painted here. It enters the
2127
+ // transcript as a normal user message when the runtime echoes it. The
2128
+ // draft is written NOW, before the uploads below, so the list shows the
2129
+ // message from the keypress.
2130
+ //
2131
+ // Idle with an empty queue, the bubble is in the transcript from THIS
2132
+ // frame, under the wire id the inbox row carries, and the turn runs at
2133
+ // once.
2134
+ // The files this Send carried, by identity, so the bubble draws finished
2135
+ // tiles from the browser's own bytes the moment it paints — the upload
2136
+ // already completed (`whenReady`), and the runtime echo merges into the
2137
+ // same strip (`mergeSentAttachments`) instead of replacing it.
2138
+ if (attachedFiles.length > 0) {
2139
+ setSentAttachmentsByMessage((current) => ({
2140
+ ...current,
2141
+ [messageID]: sentAttachmentsOf(attachedFiles),
2142
+ }));
2143
+ }
2144
+ const placement = overrides?.placement ?? 'transcript';
2145
+ const delivery = overrides?.delivery;
2146
+ // Placement decides WHERE the send waits: Quick Queue paints its bubble in
2147
+ // the transcript now, Queue List draws a row above the composer. Busy
2148
+ // state or earlier live rows decide only whether it waits at all.
2149
+ const willQueue = isBusyRef.current || promptInbox.prompts.some((prompt) => prompt.state !== 'failed');
2150
+ const paintTranscript = placement === 'transcript';
2151
+ if (!paintTranscript) {
2152
+ useQueuedDraftStore.getState().add(sessionId, {
2153
+ clientMessageId,
2154
+ placement,
2155
+ ...(delivery ? { delivery } : {}),
2156
+ text: rawText,
2157
+ files: attachedFiles,
2158
+ createdAtMs: sentAtMs,
2159
+ posted: false,
2160
+ });
2161
+ }
2162
+ else {
2163
+ beginOptimisticSend(sessionId, messageID, optimisticText, [textPartId]);
2164
+ // Inbox-backed from THIS tick, before the first `await` below: the row
2165
+ // it becomes is durable, and this send's own failure paths are the ONLY
2166
+ // things allowed to take the bubble away.
2167
+ markOptimisticSendInboxBacked(sessionId, messageID);
2168
+ if (!willQueue) {
2169
+ // Until this turn has an answer it is the working turn
2170
+ // (`freshSendHint`). The bubble glides ONCE to the top of the screen.
2171
+ setFreshSend({ sessionId, messageId: messageID });
2172
+ anchorTurn(messageID);
2173
+ }
2174
+ }
2175
+ const receiptTurnId = willQueue ? workingTurnIdRef.current : messageID;
2176
+ const options = {};
2177
+ const overrideAgent = overrides?.agent;
2178
+ const overrideModel = overrides?.model;
2179
+ const overrideVariant = overrides?.variant;
2180
+ if (overrideAgent !== undefined) {
2181
+ if (overrideAgent)
2182
+ options.agent = overrideAgent;
2183
+ }
2184
+ else if (composerAgentName) {
2185
+ // The name the picker is SHOWING, not `local.agent.current`: an
2186
+ // inaccessible project default resolves to the first agent this user
2187
+ // holds a grant on, and the send must carry that same one.
2188
+ options.agent = composerAgentName;
2189
+ }
2190
+ if (overrideModel !== undefined) {
2191
+ if (overrideModel)
2192
+ options.model = overrideModel;
2193
+ }
2194
+ else if (local.model.sendKey) {
2195
+ options.model = local.model.sendKey;
2196
+ }
2197
+ if (overrideVariant !== undefined) {
2198
+ if (overrideVariant)
2199
+ options.variant = overrideVariant;
2200
+ }
2201
+ else if (local.model.variant.current) {
2202
+ options.variant = local.model.variant.current;
2203
+ }
2204
+ // Parts: the text first, then each attachment as a handle-only file part
2205
+ // from `whenReady`. The runtime receives files by reference, never bytes.
2206
+ const textPrompt = { id: textPartId, type: 'text', text };
2207
+ // A Retry of a kept send (`resendHeldSend`, the one caller that passes the
2208
+ // send's `clientMessageId`) has no composer draft to return to either.
2209
+ const retryingKeptSend = overrides?.clientMessageId !== undefined;
2210
+ const markHeldSendFailed = (error) => {
2211
+ const classified = classifySessionError(error);
2212
+ // A refusal with a remedy (a plan, a connector) also shows its card.
2213
+ if (classified.kind === 'billing' || classified.kind === 'connector') {
2214
+ setCommandError(classified);
2215
+ }
2216
+ useHeldSendFailureStore.getState().setHeldSendFailure(sessionId, messageID, {
2217
+ message: sentFailureMessage(error, tComposerAttachments, classified.message),
2218
+ send: {
2219
+ text,
2220
+ files,
2221
+ mentions,
2222
+ attachments: attachments,
2223
+ overrides: { ...overrides, clientMessageId },
2224
+ },
2225
+ });
2226
+ };
2227
+ // `clientMessageId` is the POST's idempotency key, so the row is
2228
+ // addressable by exactly the thing this send already holds. A `failed`
2229
+ // row with that key is a refusal, never proof the send landed.
2230
+ const inboxRowExists = async () => {
2231
+ if (!projectId || !projectSessionId)
2232
+ return false;
2233
+ const { prompts } = await listSessionPrompts(projectId, projectSessionId);
2234
+ return inboxHoldsLivePrompt(prompts, clientMessageId);
2235
+ };
2236
+ const deliver = async (detached) => {
2237
+ // A detached send (uploads, or an earlier send of this session still
2238
+ // delivering) is never taken back after this paint: no composer waits
2239
+ // for it, so an upload or POST failure keeps the message, marked failed,
2240
+ // with Retry.
2241
+ const keepsPainted = detached || retryingKeptSend;
2242
+ // The POST waits here until every handed-off upload is ready. The
2243
+ // message above is already painted.
2244
+ let attachmentParts = [];
2245
+ if (attachments) {
2246
+ try {
2247
+ attachmentParts = await attachments.whenReady();
2248
+ }
2249
+ catch (err) {
2250
+ // An upload failed after the message was painted. Retry restarts the
2251
+ // failed uploads and sends again under the same id; finished uploads
2252
+ // are not sent again (`retryHeldSend`).
2253
+ markHeldSendFailed(err);
2254
+ return messageID;
2255
+ }
2256
+ }
2257
+ const parts = [textPrompt];
2258
+ try {
2259
+ parts.push(...promptFileParts(attachedFiles, attachmentParts));
2260
+ }
2261
+ catch (err) {
2262
+ if (keepsPainted) {
2263
+ markHeldSendFailed(err);
2264
+ return messageID;
2265
+ }
2266
+ // Never reached the network — nothing to rehydrate from the server,
2267
+ // so just clear busy and drop the optimistic message outright.
2268
+ abandonOptimisticSend(sessionId, messageID);
2269
+ // The composer puts the draft back in the editor; the list row goes.
2270
+ if (!paintTranscript)
2271
+ useQueuedDraftStore.getState().remove(sessionId, [clientMessageId]);
2272
+ const classified = classifySessionError(err);
2273
+ setCommandError(classified);
2274
+ throw err instanceof Error ? err : new Error(classified.message);
2275
+ }
2276
+ // Append session reference hints for @session mentions.
2277
+ // Merge tracked mentions with any raw @ses_<id> tags typed directly.
2278
+ const trackedSessionMentions = mentions?.filter((m) => m.kind === 'session' && m.value) ?? [];
2279
+ // Detect raw @ses_<id> patterns in the text (e.g. @ses_2ec118d4...)
2280
+ const rawSessionIdMentions = [];
2281
+ const rawSessionIdRegex = /@(ses_[A-Za-z0-9]+)/g;
2282
+ let rawMatch;
2283
+ let sessionsById = null;
2284
+ while ((rawMatch = rawSessionIdRegex.exec(textPrompt.text)) !== null) {
2285
+ const rawId = rawMatch[1];
2286
+ // Skip if already covered by a tracked mention
2287
+ if (trackedSessionMentions.some((m) => m.value === rawId))
2288
+ continue;
2289
+ // Look up session by ID
2290
+ sessionsById ??= new Map((allSessions ?? []).map((s) => [s.id, s]));
2291
+ const found = sessionsById.get(rawId);
2292
+ if (found) {
2293
+ rawSessionIdMentions.push({
2294
+ kind: 'session',
2295
+ label: found.title || rawId,
2296
+ value: rawId,
2297
+ });
2298
+ }
2299
+ else {
2300
+ // Unknown session ID — still include it so the agent can attempt to fetch it
2301
+ rawSessionIdMentions.push({
2302
+ kind: 'session',
2303
+ label: rawId,
2304
+ value: rawId,
2305
+ });
2306
+ }
2307
+ }
2308
+ const allSessionMentions = [...trackedSessionMentions, ...rawSessionIdMentions];
2309
+ textPrompt.text = appendSessionRefs(textPrompt.text, allSessionMentions.map((m) => ({ id: m.value ?? '', title: m.label })));
2310
+ if (fileMentionRefs.length > 0) {
2311
+ const block = buildFileRefsBlock(fileMentionRefs);
2312
+ if (block)
2313
+ textPrompt.text = `${textPrompt.text}\n\n${block}`;
2314
+ }
2315
+ if (agentMentionRefs.length > 0) {
2316
+ const block = buildAgentRefsBlock(agentMentionRefs);
2317
+ if (block)
2318
+ textPrompt.text = `${textPrompt.text}\n\n${block}`;
2319
+ }
2320
+ // Send via the SDK's promptRuntimeMessage — the server accepts the
2321
+ // prompt (204) and streams the response over SSE; we await the ACK so
2322
+ // callers (queue drain, input box) can handle send failures, but the
2323
+ // actual response body still arrives via the sync store.
2324
+ //
2325
+ // Don't send part IDs. `ascendingId` encodes the HIGH bits of the id
2326
+ // clock where opencode encodes the LOW 48 (see the warning on it in the
2327
+ // SDK), so a client id of that shape sorts before EVERY server id: the
2328
+ // server's "has this prompt already been answered?" ordering check reads
2329
+ // a stale assistant reply as the answer and the turn never runs.
2330
+ //
2331
+ // The `messageID` is a different matter and IS sent — by the SDK, not
2332
+ // from here. `promptOpenCodeMessage` mints it in opencode's own wire
2333
+ // format and places it above everything already in this session's
2334
+ // transcript, which is what makes it safe; without one, two identical
2335
+ // prompts inside 60s hash to a single proxy delivery and the second is
2336
+ // silently dropped. Do not "restore" the old no-messageID behaviour on
2337
+ // the strength of the part-id reasoning above — they are not the same
2338
+ // hazard, and the mint is the guard against this one.
2339
+ const mappedParts = parts.map((p) => {
2340
+ if (p.type === 'file')
2341
+ return {
2342
+ type: 'file',
2343
+ mime: p.mime,
2344
+ url: p.url,
2345
+ attachment_id: p.attachment_id,
2346
+ filename: p.filename,
2347
+ };
2348
+ return { type: 'text', text: p.text };
2349
+ });
2350
+ const sendOpts = Object.keys(options).length > 0 ? options : undefined;
2351
+ // Kept so a turn refused for a missing connector can be re-sent verbatim
2352
+ // once the account is connected. Without it the user connects, the card
2353
+ // retries, and re-sends nothing — losing the message they typed, which is
2354
+ // a worse outcome than the refusal they started with.
2355
+ lastSubmittedRef.current = { parts: mappedParts, options };
2356
+ // The prompt is going out, so the optimistic message stops being
2357
+ // `pending`. This is what lets the server's echo — which arrives under a
2358
+ // DIFFERENT id — supersede it instead of rendering beside it.
2359
+ //
2360
+ // `useSession.sendParts` normally marks dispatch by correlating the
2361
+ // client-generated part ids carried with the prompt. We strip those ids
2362
+ // on purpose (see the note above `mappedParts`: client ids can sort
2363
+ // before server ids under clock skew and make the server's loop exit
2364
+ // early), so there is nothing for it to correlate on and the mark never
2365
+ // happened. The result was every message rendering twice for the whole
2366
+ // turn, until the session went idle and the optimistic sweep ran.
2367
+ // A queued send was never painted into the transcript, so there is no
2368
+ // optimistic message to mark dispatched — its row lives in the list
2369
+ // above the composer until the runtime echoes it.
2370
+ if (paintTranscript)
2371
+ markOptimisticSendDispatched(sessionId, messageID);
2372
+ const selectedAgent = typeof sendOpts?.agent === 'string' ? sendOpts.agent : null;
2373
+ const selectedVariant = typeof sendOpts?.variant === 'string' ? sendOpts.variant : null;
2374
+ const selectedModel = sendOpts?.model ? sendOpts.model : null;
2375
+ // THE ONE SEND PATH: the server-side prompt inbox.
2376
+ //
2377
+ // This used to POST straight into the sandbox's OpenCode server, and
2378
+ // anything the user typed while the agent was busy went into a browser
2379
+ // queue instead — which meant a closed tab, a second device, or a crash
2380
+ // lost it silently, and two tabs on one session disagreed about what was
2381
+ // pending. Now every prompt becomes a durable row first, and the SERVER
2382
+ // decides whether it runs now or waits: the admission gate reads the same
2383
+ // turn authority `GET .../turn` serves from, so the composer never has to
2384
+ // guess whether a turn is in flight.
2385
+ //
2386
+ // The WIRE id is minted here, by the SDK, and never by the control plane:
2387
+ // OpenCode resolves "has this prompt already been answered?" by id ORDER,
2388
+ // and only this process holds the transcript to place one against. It is
2389
+ // `messageID` above. `clientMessageId` is only the inbox idempotency key.
2390
+ // The prompt is out of this tab's hands the moment the row lands, so the
2391
+ // receipt is taken BEFORE the POST: it is what holds the composer on
2392
+ // "working" until `GET .../turn` reports the turn the inbox admitted.
2393
+ noteSendReceipt(messageID, receiptTurnId);
2394
+ const result = await (async () => {
2395
+ try {
2396
+ if (!projectId || !projectSessionId) {
2397
+ throw new Error('This session has no project — cannot queue a prompt');
2398
+ }
2399
+ const created = await promptInbox.enqueue({
2400
+ placement,
2401
+ ...(delivery ? { delivery } : {}),
2402
+ clientMessageId,
2403
+ messageId: messageID,
2404
+ parts: mappedParts,
2405
+ // Enter time, not POST time: uploads and a busy API sit between
2406
+ // the two, and the server orders racing sends by THIS.
2407
+ clientSentAtMs: sentAtMs,
2408
+ overrides: {
2409
+ // Pass the session's directory so opencode resolves project-scoped
2410
+ // agents (.opencode/agent/*.md under the project) and applies them
2411
+ // when the user picked a project agent from the picker.
2412
+ ...(session?.directory ? { directory: session.directory } : {}),
2413
+ ...(selectedAgent ? { agent: selectedAgent } : {}),
2414
+ ...(selectedModel ? { model: formatPromptModel(selectedModel) } : {}),
2415
+ ...(selectedVariant ? { variant: selectedVariant } : {}),
2416
+ },
2417
+ });
2418
+ // The server's admission verdict, not a guess. A `failed` row is a
2419
+ // real refusal wearing a 200: a re-POST of a `clientMessageId` whose
2420
+ // row already dead-lettered dedupes into that row, and discarding
2421
+ // the result used to accept the receipt, clear the draft, and tell
2422
+ // the user nothing. Thrown here so the ordinary failure path below
2423
+ // clears the named receipt and surfaces the error.
2424
+ if (created.state === 'failed') {
2425
+ throw new Error('This prompt was refused — its earlier delivery already failed. Edit it and send again.');
2426
+ }
2427
+ // The server has the prompt. From here — and NOT before — a
2428
+ // `GET .../turn` read is able to see it, so one is allowed to answer
2429
+ // for it. `useSessionPrompts` raises the inbox floor at the same
2430
+ // moment, which is what covers the window before the row is
2431
+ // delivered and becomes a turn.
2432
+ acceptSendReceipt(messageID);
2433
+ attachments?.release();
2434
+ // The durable row now carries this prompt, so the tab-local draft
2435
+ // that held its place in the queued list can stop standing in.
2436
+ if (!paintTranscript)
2437
+ useQueuedDraftStore.getState().markPosted(sessionId, clientMessageId);
2438
+ return { ok: true };
2439
+ }
2440
+ catch (cause) {
2441
+ // A kept send is settled below: its painted message stays.
2442
+ if (keepsPainted)
2443
+ return { ok: false, cause, error: null };
2444
+ // Ask the INBOX, not the runtime. This prompt's home is a durable
2445
+ // control-plane row; OpenCode's transcript cannot see it until the
2446
+ // admission gate delivers it, so a rehydrate always reports it
2447
+ // missing and the recovery used to delete the bubble on that answer —
2448
+ // while the row was already running. Reported from a live self-host:
2449
+ // "it queues the message and starts running it, but doesn't show in
2450
+ // the frontend."
2451
+ const error = recoverFromSendFailure(sessionId, messageID, cause, {
2452
+ classify: classifySessionError,
2453
+ inboxRowExists,
2454
+ });
2455
+ return { ok: false, cause, error };
2456
+ }
2457
+ })();
2458
+ if (!result.ok) {
2459
+ if (!result.error) {
2460
+ // The message stays. A row the inbox holds means the POST landed and
2461
+ // only its response was lost: the send succeeded after all.
2462
+ clearSendReceipt(messageID);
2463
+ if (await inboxRowExists().catch(() => false)) {
2464
+ noteSendReceipt(messageID, receiptTurnId);
2465
+ acceptSendReceipt(messageID);
2466
+ attachments?.release();
2467
+ return messageID;
2468
+ }
2469
+ markHeldSendFailed(result.cause);
2470
+ return messageID;
2471
+ }
2472
+ // Nothing durable was created, so nothing is coming — drop the receipt
2473
+ // rather than let a refused send claim `working` for a minute. Named,
2474
+ // so a slow refusal cannot drop the receipt of a send the user made
2475
+ // after it.
2476
+ //
2477
+ // ONE exception, and it resolves AFTER this line: if the inbox turns
2478
+ // out to hold the row, `recoverFromSendFailure` re-takes the receipt
2479
+ // when its lookup lands, so the composer goes back to working on its
2480
+ // own. This clear is still right in the moment — as far as this tab
2481
+ // knows right now, nothing is coming — and it is NAMED, so it can only
2482
+ // ever drop this send's own receipt.
2483
+ clearSendReceipt(messageID);
2484
+ // The composer puts the draft back in the editor; the list row goes.
2485
+ if (!paintTranscript)
2486
+ useQueuedDraftStore.getState().remove(sessionId, [clientMessageId]);
2487
+ setCommandError(result.error);
2488
+ throw result.cause instanceof Error ? result.cause : new Error(result.error.message);
2489
+ }
2490
+ return messageID;
2491
+ };
2492
+ // Every POST of this session leaves in Send order, through the session's
2493
+ // delivery chain, keyed by the Kortix session id like the boot shell and
2494
+ // project home. A send with uploads, or one behind an earlier send, returns
2495
+ // right after its paint, so the composer is free for the next Send. Any
2496
+ // other send awaits its POST, and a refusal returns the draft. The inline
2497
+ // edit's send (`commitsRewind`) POSTs at once, outside the chain.
2498
+ return deliverAfterPaint(projectSessionId ?? sessionId, attachments, deliver, messageID, {
2499
+ immediate: overrides?.commitsRewind === true,
2500
+ });
2501
+ },
2502
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2503
+ [
2504
+ sessionId,
2505
+ projectId,
2506
+ projectSessionId,
2507
+ promptInbox.enqueue,
2508
+ promptInbox.prompts,
2509
+ noteSendReceipt,
2510
+ acceptSendReceipt,
2511
+ clearSendReceipt,
2512
+ composerAgentName,
2513
+ local.model.currentKey,
2514
+ local.model.sendKey,
2515
+ local.model.variant.current,
2516
+ anchorTurn,
2517
+ smoothScrollToAbsoluteBottom,
2518
+ scrollRef,
2519
+ messages,
2520
+ sessionState,
2521
+ tComposerAttachments,
2522
+ ]);
2523
+ /**
2524
+ * Sends painted here whose uploads failed before the POST, by message id.
2525
+ * The message stays in the transcript, marked failed; its Retry sends it
2526
+ * again through this mounted instance (`retryHeldSend`, at click time). The
2527
+ * store outlives this component, as the painted bubble does.
2528
+ */
2529
+ const heldSendFailures = useHeldSendFailureStore((state) => state.failuresBySession[sessionId]);
2530
+ const resendHeldSend = useCallback((send) => handleSend(send.text, send.files, send.mentions, send.attachments, send.overrides), [handleSend]);
2531
+ // Expose this session's canonical sender so sibling surfaces (e.g. the
2532
+ // "Changes" side panel's "Ask agent to open a change request" button) can
2533
+ // drive the agent through the SAME robust path the input uses — optimistic
2534
+ // message, SSE wiring, error propagation — instead of copying a prompt to the
2535
+ // clipboard. Keyed by the OpenCode chat session id (`sessionId`).
2536
+ const registerSender = useChatSendStore((s) => s.registerSender);
2537
+ const unregisterSender = useChatSendStore((s) => s.unregisterSender);
2538
+ useEffect(() => {
2539
+ registerSender(sessionId, async (text) => {
2540
+ // No local queue-vs-send decision any more: the send IS the queue. The
2541
+ // inbox admits the prompt when the session can take it, so a caller
2542
+ // that used to be told "queued" is simply told "sent" — the prompt is
2543
+ // durable either way, which is the stronger promise.
2544
+ await handleSend(text);
2545
+ return 'sent';
2546
+ }, projectSessionId ? [projectSessionId] : []);
2547
+ return () => unregisterSender(sessionId);
2548
+ // No local busy/queue gates in the deps any more: the sender does not read
2549
+ // them, because the server decides admission.
2550
+ }, [sessionId, projectSessionId, handleSend, registerSender, unregisterSender]);
2551
+ // NOTE: no client-side "auto-continue after approval" here — resuming the
2552
+ // agent when nobody was holding the gated call is the RESOLVE ENDPOINT's job
2553
+ // (server-side continueSession delivery in r7.ts), so it works with zero
2554
+ // browsers open. A web-side nudge would just double-send.
2555
+ const handleEditCancel = useCallback(() => setRewindTarget(null), []);
2556
+ /**
2557
+ * The inline editor's Send: stage the rewind at the edited message, then
2558
+ * deliver the edited text through the ONE send path. The delivery is what
2559
+ * commits the truncation, so the turns below the message clear only on Send
2560
+ * — Cancel leaves the session untouched.
2561
+ *
2562
+ * This replaced `handleConfirmRewind` + `ConfirmDialog` + a composer
2563
+ * prefill: the dialog asked for a decision before the user had typed
2564
+ * anything, and the prefill left a second decision (press send again) in a
2565
+ * different control. Now the editor IS the confirmation.
2566
+ */
2567
+ const handleEditSend = useCallback(async (messageId, text, kept = []) => {
2568
+ if (!sessionState)
2569
+ return;
2570
+ setEditSendPending(true);
2571
+ try {
2572
+ await sessionState.rewind(messageId);
2573
+ // THE QUEUED ROWS GO, and this is not a preference.
2574
+ //
2575
+ // A rewind stages `session.revert`; the NEXT prompt delivered is what
2576
+ // commits the truncation. The inbox admits by `created_at`, so a row
2577
+ // queued before the rewind is admitted BEFORE the replacement prompt
2578
+ // this send delivers — it would commit the user's rewind and then run
2579
+ // against the trajectory that rewind just deleted.
2580
+ //
2581
+ // Holding them instead does not hold: `POST .../prompts` releases the
2582
+ // session's hold, and the send that releases it is precisely this
2583
+ // edit's replacement prompt. So the rows are removed, exactly as the
2584
+ // browser queue's `clearSession` removed them — but visibly, and once,
2585
+ // for every tab, rather than per tab.
2586
+ const doomed = promptInbox.prompts.filter((prompt) => prompt.state !== 'delivering');
2587
+ let removed = 0;
2588
+ for (const prompt of doomed) {
2589
+ // Sequential: a row that turns out to be on the wire answers 409, and
2590
+ // that is not a reason to stop removing the rest.
2591
+ const gone = await promptInbox.remove(prompt.prompt_id).catch((error) => {
2592
+ console.warn('[session-chat] failed to remove a queued prompt on rewind', error);
2593
+ return null;
2594
+ });
2595
+ if (gone)
2596
+ removed += 1;
2597
+ }
2598
+ if (removed > 0) {
2599
+ infoToast(removed === 1
2600
+ ? tHardcodedUi.raw('i18nComplete.textcd165519e204')
2601
+ : tHardcodedUi('i18nComplete.textba6a7b88050c', { value0: removed }), {
2602
+ description: tHardcodedUi.raw('i18nComplete.text8190a722b30a'),
2603
+ });
2604
+ }
2605
+ setRewindTarget(null);
2606
+ // handleSend surfaces its own failures (commandError card + receipt
2607
+ // clear), so a refused send must not wear the rewind toast below —
2608
+ // its rejection is swallowed here, not ignored.
2609
+ let sendOk = true;
2610
+ // This send commits the rewind staged above, so it POSTs at once: it never
2611
+ // waits behind an earlier Send still in the session's delivery chain.
2612
+ const editSend = { commitsRewind: true };
2613
+ // The kept attachments go again: a saved copy as a URL part, a path-only upload as its ref.
2614
+ const { files, text: sendText } = editResendAttachments(kept, text);
2615
+ const resend = files.length ? files : undefined;
2616
+ await handleSend(sendText, resend, undefined, undefined, editSend).catch(() => {
2617
+ sendOk = false;
2618
+ });
2619
+ // Mirror the SDK's own send path (`use-session.ts` `sendParts`, which
2620
+ // ends in `commitSessionRevert`): delivering ANY prompt makes OpenCode
2621
+ // commit the staged revert — it deletes the reverted messages and
2622
+ // clears the pointer (`SessionRevert.cleanup`, run first thing in
2623
+ // `SessionPrompt.prompt`). But the classic server NEVER emits a
2624
+ // `session.next.revert.*` wire event (`setRevert`/`clearRevert` are
2625
+ // bare session patches, and `syncSessionRevertFromInfo` deliberately
2626
+ // ignores an absent `revert` field), and this send goes through the
2627
+ // prompt inbox, not `sendParts` — so nothing else ever flips the local
2628
+ // record. Without this line the composer's Restore button outlives the
2629
+ // path it claims to restore, and every click is a guaranteed no-op:
2630
+ // `unrevert` finds nothing staged (or throws BusyError mid-run).
2631
+ // A FAILED send leaves the record staged on purpose — the revert is
2632
+ // still real server-side and Restore genuinely works there.
2633
+ if (sendOk && sessionState.runtimeSessionId) {
2634
+ useSessionStateStore.getState().commitSessionRevert(sessionState.runtimeSessionId);
2635
+ }
2636
+ }
2637
+ catch (error) {
2638
+ errorToast(tHardcodedUi.raw('i18nComplete.text810b28e5110c'), {
2639
+ description: formatCommandError(error),
2640
+ });
2641
+ }
2642
+ finally {
2643
+ setEditSendPending(false);
2644
+ }
2645
+ }, [sessionState, promptInbox.prompts, promptInbox.remove, handleSend, tHardcodedUi]);
2646
+ const handleStop = useCallback(async () => {
2647
+ // Guard against rapid clicks — ignore if an abort is already in flight
2648
+ if (abortSession.isPending) {
2649
+ console.log(`[handleStop] Ignoring - abort already in flight for session ${sessionId}`);
2650
+ return;
2651
+ }
2652
+ // Stop means stop: a held command would otherwise start a new turn the
2653
+ // moment this one ends.
2654
+ setHeldCommands([]);
2655
+ console.log(`[handleStop] Stopping session ${sessionId}`);
2656
+ // Optimistically mark the session idle + patch an abort error onto the
2657
+ // last assistant message (so the turn reads as stopped instantly — no
2658
+ // waiting for the SSE session.error round-trip, and no error row in the
2659
+ // gap: `TurnErrorDisplay` renders nothing for an abort). Also clear the
2660
+ // busy debounce timer to bypass the 2s delay.
2661
+ applyOptimisticAbort(sessionId);
2662
+ clearTimeout(busyTimerRef.current);
2663
+ setIsBusy(false);
2664
+ // Stop means the send this tab was still waiting on is over too.
2665
+ clearSendReceipt();
2666
+ // Stopping means stop doing things, and that includes the queue. Without
2667
+ // this the interrupt is followed a beat later by exactly the message the
2668
+ // user was trying to get ahead of.
2669
+ //
2670
+ // ONE hold, on the server, because the queue is not in this tab any more.
2671
+ // Pausing a browser drain left every OTHER tab's view of the queue running
2672
+ // and never reached the server at all.
2673
+ //
2674
+ // AWAITED, and BEFORE the abort. A prompt is now forwarded to OpenCode the
2675
+ // moment it is admitted, so at stop time the session's queue can hold rows
2676
+ // that OpenCode already has. The abort drops OpenCode's in-memory queue,
2677
+ // and the reaper then sees those messages unanswered and hands them back —
2678
+ // due now — unless the hold has already marked them stop-paused. Ordering
2679
+ // the two calls makes "the hold precedes the abort" a fact instead of an
2680
+ // argument about reaper cadence. The user sees no delay: the optimistic
2681
+ // paint above already ran, so only the network abort moves one hop later.
2682
+ //
2683
+ // BOUNDED, because the abort is now sequenced behind a network call and
2684
+ // `holdSessionPrompts` carries no client timeout of its own. A stalled
2685
+ // socket can hang for minutes, and every one of those is the agent still
2686
+ // running, still calling tools and still spending tokens under a UI that
2687
+ // says it stopped. Past the bound the abort goes out anyway and the hold
2688
+ // finishes on its own — the ordering is a preference, the abort is not.
2689
+ let refusal = null;
2690
+ await Promise.race([
2691
+ promptInbox.hold(true).catch((error) => {
2692
+ // The server refused the stop: this viewer did not start the run and
2693
+ // does not own or manage the session. The abort would be refused for
2694
+ // the same reason, so none goes out; the run goes on.
2695
+ refusal = stopRefusalMessage(error);
2696
+ if (refusal)
2697
+ return;
2698
+ // Caught, never rethrown: a failed hold must not also cost the user
2699
+ // their abort. The cost of that path is the one this ordering removes —
2700
+ // a stopped prompt can still come back a reaper pass later.
2701
+ //
2702
+ // SURFACED, not swallowed. A failed hold means the queue is NOT paused,
2703
+ // so a prompt the user pressed Stop to get ahead of can still be
2704
+ // delivered a reaper pass later — silently. The user has to know the
2705
+ // stop did not also pause the queue, and that pressing Stop again (or
2706
+ // Resume/Send-now) is how they recover.
2707
+ console.warn('[session-chat] failed to hold the prompt inbox on stop', error);
2708
+ errorToast(tHardcodedUi.raw('i18nComplete.text57a524b52549'), {
2709
+ description: tHardcodedUi.raw('i18nComplete.text45eca4a01ff2'),
2710
+ });
2711
+ }),
2712
+ new Promise((resolve) => setTimeout(resolve, STOP_HOLD_DEADLINE_MS)),
2713
+ ]);
2714
+ if (refusal) {
2715
+ errorToast(refusal);
2716
+ setIsBusy(isBusyRef.current);
2717
+ return;
2718
+ }
2719
+ issueSessionCancel();
2720
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2721
+ }, [sessionId, abortSession, issueSessionCancel, promptInbox.hold]);
2722
+ // Release the Stop hold for the WHOLE queue at once. `hold(false)` un-pauses
2723
+ // every held row on the server (shared across tabs), and the hook clears the
2724
+ // paused state on the click (`releaseHeldPrompts`). `resumePending` disables
2725
+ // Resume while the release is in flight. A failed release is surfaced: the
2726
+ // user has to know the queue is still paused.
2727
+ const [resumePending, setResumePending] = useState(false);
2728
+ const handleResumeQueue = useCallback(async () => {
2729
+ setResumePending(true);
2730
+ try {
2731
+ await promptInbox.hold(false);
2732
+ }
2733
+ catch (error) {
2734
+ console.warn('[session-chat] failed to release the prompt inbox hold', error);
2735
+ errorToast(tHardcodedUi.raw('i18nComplete.text06619384104c'), {
2736
+ description: tHardcodedUi.raw('i18nComplete.text29cc3339fce9'),
2737
+ });
2738
+ }
2739
+ finally {
2740
+ setResumePending(false);
2741
+ }
2742
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2743
+ }, [promptInbox.hold]);
2744
+ // Edit (the pencil) and Up open a queued message in the composer; Submit
2745
+ // saves the new words into the same row. Shared with the boot shell, which
2746
+ // may hand over an open edit: see `queued-prompt-edit.ts`.
2747
+ const queueEdit = useQueuedPromptEdit({
2748
+ key: projectSessionId ?? sessionId,
2749
+ rows: () => queueRowsRef.current,
2750
+ editPrompt: promptInbox.edit,
2751
+ setComposerText: (text) => useSessionComposerPrefillStore.getState().setPrefill(sessionId, text, undefined, 'replace'),
2752
+ forgetLocalDraft: (clientMessageId) => useQueuedDraftStore.getState().remove(sessionId, [clientMessageId]),
2753
+ });
2754
+ // ---- Triple-ESC to stop ----
2755
+ // ESC 1 → show hint (2 more). ESC 2 → show hint (1 more). ESC 3 → stop.
2756
+ // 4s cooloff window — resets if you wait too long between presses.
2757
+ const [escCount, setEscCount] = useState(0); // 0 = idle, 1 = first press, 2 = second press
2758
+ const escDeadlineRef = useRef(0);
2759
+ const escFadeTimerRef = useRef(null);
2760
+ const clearEscHint = useCallback(() => {
2761
+ escDeadlineRef.current = 0;
2762
+ setEscCount(0);
2763
+ if (escFadeTimerRef.current) {
2764
+ clearTimeout(escFadeTimerRef.current);
2765
+ escFadeTimerRef.current = null;
2766
+ }
2767
+ }, []);
2768
+ // When this SessionChat is not the active tab, make sure any lingering
2769
+ // ESC-counter state is cleared. Prevents stale "2 more to stop" hints from
2770
+ // being carried over when the user switches tabs.
2771
+ useEffect(() => {
2772
+ if (!isActiveSessionTab)
2773
+ clearEscHint();
2774
+ }, [isActiveSessionTab, clearEscHint]);
2775
+ useEffect(() => {
2776
+ // CRITICAL: all open session tabs are pre-mounted simultaneously by
2777
+ // SessionTabsContainer (see layout-content.tsx), so every mounted
2778
+ // SessionChat would otherwise receive the same window keydown event and
2779
+ // each busy session would independently advance its ESC counter and
2780
+ // abort itself on triple-ESC. Only the visible (active) session tab may
2781
+ // handle ESC — and never in read-only viewers (e.g. the sub-session
2782
+ // modal), which must not issue stop commands.
2783
+ if (!isActiveSessionTab || readOnly)
2784
+ return;
2785
+ // Sampled in the CAPTURE phase — before ProseMirror/@tiptap/suggestion
2786
+ // run — because an Escape that dismisses the `@`/`/` menu unmounts its
2787
+ // listbox synchronously inside the editor's own keydown handling; by
2788
+ // bubble time the menu this press was meant for is already gone. See
2789
+ // `EscapePress` in esc-to-stop.ts.
2790
+ let suggestionMenuWasOpen = false;
2791
+ const onKeyDownCapture = (e) => {
2792
+ if (e.key !== 'Escape')
2793
+ return;
2794
+ suggestionMenuWasOpen = document.querySelector(SUGGESTION_MENU_SELECTOR) !== null;
2795
+ };
2796
+ const onKeyDown = (e) => {
2797
+ if (e.key !== 'Escape' || !isBusy || !canStop)
2798
+ return;
2799
+ // ESC-to-stop is a page-wide shortcut: it must fire whether or not the
2800
+ // composer is focused, because users watch the agent run with focus
2801
+ // elsewhere (chat body, a tool view, or nothing at all) AND with focus
2802
+ // in the chat input itself. The presses that must not advance the
2803
+ // counter: one meant for an open overlay the user is interacting with
2804
+ // (focus in a dialog/menu/popover/select — that ESC dismisses it; a
2805
+ // hovered tooltip never takes focus, so the stop button's own tooltip
2806
+ // can't suppress the shortcut), and one another control already
2807
+ // consumed. `defaultPrevented` decides "consumed" EXCEPT for presses
2808
+ // inside the composer editor: ProseMirror's backdrop key mapping
2809
+ // preventDefaults EVERY Escape in the contenteditable, so there the
2810
+ // real consumed-signal is the `@`/`/` menu having been open at capture
2811
+ // time. shouldCountEscape (esc-to-stop.ts) owns the decision.
2812
+ const active = document.activeElement;
2813
+ const focusInOverlay = active?.closest('[role="dialog"],[role="alertdialog"],[role="menu"],[data-radix-popper-content-wrapper]') != null;
2814
+ const fromComposerEditor = e.target instanceof Element && e.target.closest(COMPOSER_EDITOR_SELECTOR) !== null;
2815
+ if (!shouldCountEscape({
2816
+ fromComposerEditor,
2817
+ defaultPrevented: e.defaultPrevented,
2818
+ suggestionMenuWasOpen,
2819
+ focusInOverlay,
2820
+ isComposing: e.isComposing,
2821
+ })) {
2822
+ return;
2823
+ }
2824
+ e.preventDefault();
2825
+ const now = Date.now();
2826
+ const withinWindow = now < escDeadlineRef.current;
2827
+ if (withinWindow) {
2828
+ const currentCount = escDeadlineRef.current ? Math.max(1, escCount) : 0;
2829
+ if (currentCount >= 2) {
2830
+ // Third ESC → stop. Not awaited: the keyboard path has nothing to
2831
+ // sequence after it, and `handleStop` never rejects.
2832
+ clearEscHint();
2833
+ void handleStop();
2834
+ }
2835
+ else {
2836
+ // Second ESC → advance count, refresh cooloff
2837
+ setEscCount(2);
2838
+ escDeadlineRef.current = now + 4000;
2839
+ if (escFadeTimerRef.current)
2840
+ clearTimeout(escFadeTimerRef.current);
2841
+ escFadeTimerRef.current = setTimeout(() => {
2842
+ escDeadlineRef.current = 0;
2843
+ setEscCount(0);
2844
+ }, 4000);
2845
+ }
2846
+ }
2847
+ else {
2848
+ // First ESC (or cooloff expired) → start fresh
2849
+ setEscCount(1);
2850
+ escDeadlineRef.current = now + 4000;
2851
+ if (escFadeTimerRef.current)
2852
+ clearTimeout(escFadeTimerRef.current);
2853
+ escFadeTimerRef.current = setTimeout(() => {
2854
+ escDeadlineRef.current = 0;
2855
+ setEscCount(0);
2856
+ }, 4000);
2857
+ }
2858
+ };
2859
+ window.addEventListener('keydown', onKeyDownCapture, true);
2860
+ window.addEventListener('keydown', onKeyDown);
2861
+ return () => {
2862
+ window.removeEventListener('keydown', onKeyDownCapture, true);
2863
+ window.removeEventListener('keydown', onKeyDown);
2864
+ };
2865
+ }, [isActiveSessionTab, readOnly, isBusy, canStop, handleStop, clearEscHint, escCount]);
2866
+ // Reset when session goes idle
2867
+ useEffect(() => {
2868
+ if (!isBusy)
2869
+ clearEscHint();
2870
+ }, [isBusy, clearEscHint]);
2871
+ // Unmount-only: a fade timer armed by a keydown must not outlive the chat.
2872
+ useEffect(() => {
2873
+ return () => {
2874
+ if (escFadeTimerRef.current) {
2875
+ clearTimeout(escFadeTimerRef.current);
2876
+ }
2877
+ };
2878
+ }, []);
2879
+ // Ref-based guard against rapid double-fire of commands (replaces
2880
+ // the old executeCommand.isPending check from the TQ mutation).
2881
+ const commandInFlightRef = useRef(false);
2882
+ const handleCommand = useCallback((cmd, args, split) => {
2883
+ // Returns whether the command was DISPATCHED, not whether it succeeded.
2884
+ // The composer needs that distinction: a swallowed dispatch that reports
2885
+ // success clears the draft, so the command is lost with nothing on screen
2886
+ // to say so.
2887
+ if (commandInFlightRef.current)
2888
+ return false;
2889
+ setCommandError(null);
2890
+ playSound('send');
2891
+ // Rebuild the sentence the way it was WRITTEN, not command-first. This
2892
+ // used to be `/${name} ${args}` unconditionally, which is why typing
2893
+ // `explain /webapp to me` produced `/webapp explain to me` — the chip's
2894
+ // position is not recoverable from `args`, so it has to be carried
2895
+ // (`split`, from the editor's serializer) or it is lost here.
2896
+ const label = split
2897
+ ? [split.before, `/${cmd.name}`, split.after].filter(Boolean).join(' ')
2898
+ : args
2899
+ ? `/${cmd.name} ${args}`
2900
+ : `/${cmd.name}`;
2901
+ const selectedModel = local.model.sendKey ?? undefined;
2902
+ const handleCommandError = (err) => {
2903
+ // A command that was DELIVERED and then lost its connection is not a
2904
+ // failed command. `/command` blocks for the whole turn, so both proxy
2905
+ // hops routinely stop waiting while opencode is still working — and the
2906
+ // request was already on the wire when they did. Clearing the session
2907
+ // to `idle` and painting an error here told the user their message had
2908
+ // not sent while the agent was actively answering it, and invited the
2909
+ // retry that aborts the live turn and stamps it "Interrupted".
2910
+ // See `delivered-but-disconnected.ts`.
2911
+ if (isDeliveredButDisconnected(errorMessageOf(err))) {
2912
+ pendingCommandStashRef.current = null;
2913
+ // The session status stays put on purpose: the turn is live and SSE
2914
+ // owns it from here.
2915
+ return;
2916
+ }
2917
+ // Release the receipt taken at dispatch — it is what held the composer
2918
+ // on "working" for a command that has now failed. No fabricated idle
2919
+ // frame beside it: dropping the receipt IS the honest signal, and a
2920
+ // written frame outranked the control plane's `/turn` answer.
2921
+ clearSendReceipt(label);
2922
+ pendingCommandStashRef.current = null;
2923
+ setCommandError(classifySessionError(err));
2924
+ };
2925
+ pendingCommandStashRef.current = {
2926
+ name: cmd.name,
2927
+ args: args || cmd.description,
2928
+ // Carried to `UserMessage` via `commandMessagesRef` so the sent bubble
2929
+ // draws the chip where it was typed. Display only.
2930
+ split,
2931
+ };
2932
+ // Closes the queue drain's working gate SYNCHRONOUSLY. Without it a
2933
+ // command dispatched from the queue left every gate clear: the drain's
2934
+ // 700ms settle window would elapse before the server reported busy, the
2935
+ // next queued message would go out, and a new prompt mid-turn aborts the
2936
+ // one running — the "Interrupted" symptom the queue exists to prevent.
2937
+ // A command is not an inbox row, so this receipt is the only thing that
2938
+ // covers it until the runtime reports the turn.
2939
+ noteSendReceipt(label);
2940
+ // Match SolidJS reference (submit.ts:259-289): fire command
2941
+ // directly via SDK — no TanStack Query, no mutation retry, no
2942
+ // optimistic message. The server creates the user message and
2943
+ // SSE delivers it. Commands use the blocking /command endpoint
2944
+ // which can take minutes; using TQ would cause retry on timeout.
2945
+ commandInFlightRef.current = true;
2946
+ const agent = composerAgentName ?? undefined;
2947
+ const variant = local.model.variant.current;
2948
+ void (sessionState?.runCommand(cmd.name, args || '', {
2949
+ agent,
2950
+ model: selectedModel,
2951
+ variant,
2952
+ }) ??
2953
+ executeCommand.mutateAsync({
2954
+ sessionId,
2955
+ command: cmd.name,
2956
+ args: args || '',
2957
+ ...(agent ? { agent } : {}),
2958
+ ...(selectedModel ? { model: formatModelString(selectedModel) } : {}),
2959
+ ...(variant ? { variant } : {}),
2960
+ }))
2961
+ .then((res) => {
2962
+ if (res?.error) {
2963
+ handleCommandError(res.error);
2964
+ }
2965
+ })
2966
+ .catch(handleCommandError)
2967
+ .finally(() => {
2968
+ commandInFlightRef.current = false;
2969
+ // `/command` blocks for the whole turn, so this is the turn ending —
2970
+ // and the instant from which a `/turn` read can speak for it. Nothing
2971
+ // accepted a command's receipt before, and an unaccepted receipt puts
2972
+ // the server floor at infinity: for a full 60s after every `/compact`
2973
+ // the control plane's own "no turns" answer was discarded, and a
2974
+ // dropped idle frame held the composer on Stop for twice the 30s
2975
+ // backstop this replaced. A no-op when `handleCommandError` already
2976
+ // dropped the receipt, or when a newer send replaced it.
2977
+ acceptSendReceipt(label);
2978
+ });
2979
+ setTimeout(() => scrollToBottom(), 50);
2980
+ return true;
2981
+ },
2982
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2983
+ [
2984
+ sessionId,
2985
+ scrollToBottom,
2986
+ sessionState,
2987
+ executeCommand,
2988
+ composerAgentName,
2989
+ local.model.currentKey,
2990
+ local.model.sendKey,
2991
+ local.model.variant.current,
2992
+ ]);
2993
+ const handleHoldCommand = useCallback((command, args, split) => {
2994
+ setHeldCommands((held) => [...held, { id: crypto.randomUUID(), command, args, split }]);
2995
+ }, []);
2996
+ // Release the oldest held command once nothing else can run first. One at a
2997
+ // time: the dispatch takes a send receipt, so `effectiveBusy` closes the gate
2998
+ // again before the next one is considered.
2999
+ useEffect(() => {
3000
+ const next = heldCommands[0];
3001
+ if (!next)
3002
+ return;
3003
+ if (!canReleaseHeldCommand({
3004
+ sessionWorking: effectiveBusy,
3005
+ runtimeReady,
3006
+ awaitingUserInput,
3007
+ inboxRows: queueRows.rows,
3008
+ })) {
3009
+ return;
3010
+ }
3011
+ if (handleCommand(next.command, next.args, next.split)) {
3012
+ setHeldCommands((held) => held.filter((entry) => entry.id !== next.id));
3013
+ }
3014
+ }, [heldCommands, effectiveBusy, runtimeReady, awaitingUserInput, queueRows.rows, handleCommand]);
3015
+ const pathname = useUiPathname();
3016
+ const router = useUiRouter();
3017
+ const shallowNavigate = useUiShallowNavigate();
3018
+ // Thread context for subsessions only (real parentID).
3019
+ const { data: parentSessionData } = useRuntimeSession(session?.parentID || '');
3020
+ // The parent crumb's destination, resolved the moment the
3021
+ // parent session loads. It is a route-cache miss on the `?rs=` branch, so it
3022
+ // is warmed below instead of being fetched cold on the click.
3023
+ const backToParentHref = useMemo(() => {
3024
+ if (!session?.parentID || !parentSessionData)
3025
+ return null;
3026
+ if (!projectId || !projectSessionId)
3027
+ return null;
3028
+ const href = uiRoutes().session(projectId, projectSessionId);
3029
+ return parentSessionData.parentID ? childSessionHref(href, parentSessionData.id) : href;
3030
+ }, [session?.parentID, parentSessionData, projectId, projectSessionId]);
3031
+ useEffect(() => {
3032
+ if (backToParentHref)
3033
+ router.prefetch(backToParentHref);
3034
+ }, [backToParentHref, router]);
3035
+ // The header breadcrumb's "Home" crumb: the parent session, for a subsession.
3036
+ const parentCrumb = useMemo(() => {
3037
+ if (!session?.parentID || !parentSessionData)
3038
+ return undefined;
3039
+ return {
3040
+ onOpen: () => {
3041
+ if (backToParentHref) {
3042
+ // nav-contract: prefetch-only — the header crumb's contract carries
3043
+ // an opaque `onOpen: () => void`, so it cannot render an anchor
3044
+ // until that contract carries the href.
3045
+ router.push(backToParentHref);
3046
+ return;
3047
+ }
3048
+ // The fallback when the panel contract carries no href. Project-scoped,
3049
+ // because `/sessions/<id>` is not a route: the tab stays mounted so the
3050
+ // click looks fine, but that URL 404s on reload or Back.
3051
+ openTabAndNavigate({
3052
+ id: parentSessionData.id,
3053
+ title: parentSessionData.title || 'Parent session',
3054
+ type: 'session',
3055
+ href: projectId
3056
+ ? projectSessionHref(projectId, parentSessionData.id)
3057
+ : `/sessions/${parentSessionData.id}`,
3058
+ }, undefined, shallowNavigate);
3059
+ },
3060
+ };
3061
+ }, [session?.parentID, parentSessionData, backToParentHref, router, projectId, shallowNavigate]);
3062
+ // ---- Stable props for <SessionChatInput> (it's React.memo-wrapped, so every
3063
+ // prop below must keep referential identity across renders that don't
3064
+ // actually change it — otherwise the memo is defeated on every streaming
3065
+ // token). Bodies are verbatim copies of what used to be inlined in the JSX. ----
3066
+ const handleAgentChange = useCallback((name) => local.agent.set(name ?? undefined), [local.agent]);
3067
+ const handleModelChange = useCallback((m) => local.model.set(m ?? undefined, { recent: true }), [local.model]);
3068
+ // Only the ACCOUNT default is settable from the picker now — it is the one
3069
+ // scope with no screen of its own. The project default lives in the provider
3070
+ // modal's Models tab and the agent default on the agent's detail page, both
3071
+ // of which also SHOW and can CLEAR what is set. See ModelDefaultControls.
3072
+ const chatModelDefaultControls = useMemo(() => ({
3073
+ accountDefault: local.model.defaults.accountDefault ?? null,
3074
+ onSetAccountDefault: (m) => {
3075
+ void local.model.defaults.setAccountDefault(m);
3076
+ },
3077
+ }), [local.model.defaults]);
3078
+ const handleVariantChange = useCallback((v) => local.model.variant.set(v ?? undefined), [local.model.variant]);
3079
+ const handleContextClick = useCallback(() => setContextModalOpen(true), []);
3080
+ const handleCompactClick = useCallback(() => setCompactModalOpen(true), []);
3081
+ const handleCustomAnswer = useCallback((text) => {
3082
+ questionPromptRef.current?.submitCustomAnswer(text);
3083
+ }, []);
3084
+ const handleQuestionAction = useCallback(() => {
3085
+ questionPromptRef.current?.performAction();
3086
+ }, []);
3087
+ const chatCommands = useMemo(() => agentCommands || [], [agentCommands]);
3088
+ /**
3089
+ * Where this session's unsent draft is persisted.
3090
+ *
3091
+ * `projectSessionId` — the KORTIX session id — not the OpenCode `sessionId`:
3092
+ * it is the id the boot shell also keys on, so a draft typed in the instant
3093
+ * shell is still there after the crossfade into this component, and it is
3094
+ * the same id every other per-session handoff store uses
3095
+ * (`session-composer-handoff-store.ts`). Null before it resolves, which just
3096
+ * means the composer persists nothing for those few frames.
3097
+ *
3098
+ * Memoized like every other prop in this block: SessionChatInput is
3099
+ * React.memo-wrapped, and a fresh object literal per render would defeat the
3100
+ * memo on every streaming token.
3101
+ */
3102
+ const composerDraftScope = useMemo(() => (projectSessionId ? { kind: 'session', sessionId: projectSessionId } : null), [projectSessionId]);
3103
+ // Null in the sub-session modal, which renders this chat read-only and
3104
+ // OUTSIDE `SessionPanelProvider` — the same self-gating every other panel
3105
+ // consumer does (see `easy-panel.tsx`).
3106
+ const panel = useOptionalSessionPanel();
3107
+ // A landed compaction summary opens HERE, in the panel's detail view — the
3108
+ // same surface a file opens into. Read through a ref so the callback stays
3109
+ // identity-stable while the panel context value churns with messages
3110
+ // (SessionTurn is memoized on its props; see `onOpenCompactionSummary`).
3111
+ const panelRef = useRef(panel);
3112
+ useEffect(() => {
3113
+ panelRef.current = panel;
3114
+ }, [panel]);
3115
+ const handleOpenCompactionSummary = useCallback((turnId, summary) => {
3116
+ panelRef.current?.openDetail({
3117
+ key: `compaction:${turnId}`,
3118
+ title: tHardcodedUi.raw('i18nComplete.text9859804cb618'),
3119
+ icon: _jsx(Layers, { weight: "duotone", className: "size-4" }),
3120
+ padded: true,
3121
+ body: _jsx(CompactionSummaryBody, { summary: summary }),
3122
+ });
3123
+ }, [tHardcodedUi]);
3124
+ // A sent paste opens the same way, keyed by its id.
3125
+ const handleOpenPastedContent = useCallback((id, text) => {
3126
+ panelRef.current?.openDetail({
3127
+ key: `pasted:${id}`,
3128
+ title: tHardcodedUi.raw('i18nComplete.text39cfc32bd12c'),
3129
+ meta: _jsx(PastedTextMeta, { text: text }),
3130
+ actions: _jsx(PastedTextCopy, { text: text }),
3131
+ padded: true,
3132
+ body: _jsx(PastedTextBody, { text: text }),
3133
+ });
3134
+ }, [tHardcodedUi]);
3135
+ // Stable identities for every handler a memoized `SessionTurn` receives.
3136
+ // Several of these close over the live transcript (`handleEditSend` →
3137
+ // `handleSend` → `messages`), so their `useCallback` identity changed on
3138
+ // every streamed delta and re-rendered every settled turn with it.
3139
+ const stableRetryQueued = useStableCallback(handleRetryQueuedMessage);
3140
+ const stableRemoveQueued = useStableCallback(handleRemoveQueuedMessage);
3141
+ const stableOpenCompactionSummary = useStableCallback(handleOpenCompactionSummary);
3142
+ const stableOpenPastedContent = useStableCallback(handleOpenPastedContent);
3143
+ const stablePermissionReply = useStableCallback(handlePermissionReply);
3144
+ const stableRewind = useStableCallback(handleRewind);
3145
+ const stableEditCancel = useStableCallback(handleEditCancel);
3146
+ const stableEditSend = useStableCallback(handleEditSend);
3147
+ /**
3148
+ * The session's files, handed to the composer so the `/` palette can offer
3149
+ * them — the Outputs card's deliverables and the Context card's reads, as
3150
+ * `sessionSlashFiles` flattens them.
3151
+ *
3152
+ * Read here rather than inside the composer because this component already
3153
+ * sits beside the panel, and the composer is also mounted on project home
3154
+ * and in the marketing demo, where importing the panel provider would drag
3155
+ * the whole detail-panel tree into their bundles. See `Composer`'s
3156
+ * `slashFiles` prop.
3157
+ *
3158
+ * `panel.files` arrives already ranked — this run's deliverables first, then
3159
+ * everything older, each group in `sortOutputs` order — so the palette and
3160
+ * the Outputs card cannot disagree about which file matters most.
3161
+ *
3162
+ * Both inputs are re-derived from `messages`, so their identity changes on
3163
+ * every streaming update and this memo re-runs with them. That is a walk of
3164
+ * a few dozen items; it is not worth a deeper equality check, and this
3165
+ * component is already re-rendered by the same `messages` change.
3166
+ */
3167
+ const panelOutputs = panel?.files;
3168
+ const panelContextFiles = panel?.context.files;
3169
+ const chatSlashFiles = useMemo(() => sessionSlashFiles({
3170
+ outputs: panelOutputs ?? [],
3171
+ contextFiles: panelContextFiles ?? [],
3172
+ }), [panelOutputs, panelContextFiles]);
3173
+ const sessionScopeAgentName = composerAgentName ?? undefined;
3174
+ const chatToolbarSlot = useMemo(() => projectId && projectSessionId ? (_jsx(SessionOverridesComposer, { projectId: projectId, sessionId: projectSessionId, selectedAgent: sessionScopeAgentName ?? null })) : undefined, [projectId, projectSessionId, sessionScopeAgentName]);
3175
+ // The queued messages and the one Resume while a Stop holds the queue: their
3176
+ // own full-width card above the composer stack, not inside the strip.
3177
+ const chatAboveSlot = useMemo(() => (_jsx(QueuedPromptList, { rows: heldCommands.length > 0 ? [...queueRows.rows, ...heldCommandRows(heldCommands)] : queueRows.rows, heldCount: queueRows.heldCount, resumePending: resumePending, onResume: () => void handleResumeQueue(), onEdit: (id) => {
3178
+ queueEdit.takeBack(id);
3179
+ }, onRemove: (id) => {
3180
+ if (id.startsWith(HELD_COMMAND_ROW_PREFIX)) {
3181
+ const heldId = id.slice(HELD_COMMAND_ROW_PREFIX.length);
3182
+ setHeldCommands((held) => held.filter((entry) => entry.id !== heldId));
3183
+ return;
3184
+ }
3185
+ void handleRemoveQueuedMessage(id);
3186
+ }, onRetry: handleRetryQueuedMessage, onStopAndSend: effectiveBusy && canStop ? handleStopAndSendQueuedMessage : undefined, editing: queueEdit.editing, onCancelEdit: queueEdit.cancel })), [
3187
+ heldCommands,
3188
+ queueEdit.editing,
3189
+ queueEdit.cancel,
3190
+ queueEdit.takeBack,
3191
+ queueRows,
3192
+ resumePending,
3193
+ handleResumeQueue,
3194
+ handleRemoveQueuedMessage,
3195
+ handleRetryQueuedMessage,
3196
+ handleStopAndSendQueuedMessage,
3197
+ effectiveBusy,
3198
+ canStop,
3199
+ ]);
3200
+ const chatInputSlot = useMemo(() => (_jsxs(_Fragment, { children: [_jsx(SessionApprovalPrompt, { onDockedChange: setApprovalDocked }), _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
3201
+ ? 'duration-slow max-h-130 translate-y-0 opacity-100'
3202
+ : '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] })), [
3203
+ sessionId,
3204
+ pendingPermissions,
3205
+ handlePermissionReply,
3206
+ renderedQuestion,
3207
+ questionPromptVisible,
3208
+ handleQuestionReply,
3209
+ handleQuestionReject,
3210
+ handleQuestionActionChange,
3211
+ tHardcodedUi,
3212
+ local.model.fallback,
3213
+ local.model.list,
3214
+ handleModelChange,
3215
+ ]);
3216
+ // The rewound-path notice lives on the composer toolbar, beside send/stop —
3217
+ // send is what commits the path, so the control sits at the moment of
3218
+ // commitment instead of in a banner above the card. No manual useMemo: the
3219
+ // React Compiler memoizes this component, and a hand-written dependency list
3220
+ // narrower than `sessionState` makes it skip the whole component.
3221
+ // `!editSendPending` — during an inline edit's Send the revert is staged
3222
+ // FIRST and committed only after `handleSend` resolves, so without the gate
3223
+ // the Restore button paints for the milliseconds in between: a control that
3224
+ // flashes in and vanishes. While the edit-send is in flight the staged
3225
+ // revert is already spoken for; only a FAILED send (editSendPending back to
3226
+ // false, record still staged) should surface it.
3227
+ const composerRewind = sessionState?.rewindMessageId && !editSendPending
3228
+ ? {
3229
+ pending: sessionState.rewindPending,
3230
+ // OpenCode's `unrevert` asserts the session is idle (`assertNotBusy`
3231
+ // → BusyError) — offering the button mid-run offers a guaranteed
3232
+ // failure, so it waits, visibly, instead.
3233
+ disabled: isBusy,
3234
+ onRestore: () => void handleRestoreRewind(),
3235
+ }
3236
+ : undefined;
3237
+ // ============================================================================
3238
+ // Loading / Not-found states
3239
+ // ============================================================================
3240
+ //
3241
+ // IMPORTANT: Do NOT use early returns here. Returning a different component
3242
+ // tree unmounts the textarea, losing user input, focus, and all local state.
3243
+ // Instead, the loading/not-found states are rendered inline in the content
3244
+ // area while the header and input remain mounted.
3245
+ // Show loader ONLY when we have zero knowledge about this session.
3246
+ // Once session metadata is available (from cache, placeholderData, or
3247
+ // fetch), skip the loader and show the content area immediately — the
3248
+ // welcome screen for empty sessions, cached messages for non-empty ones.
3249
+ // This eliminates the loader for empty sessions entirely: instead of
3250
+ // spinning while we wait to confirm "0 messages", we show the welcome
3251
+ // screen right away.
3252
+ const hasMessages = Boolean(messages?.length);
3253
+ // "Not found" is a TERMINAL answer, never a loading guess. It's only true once
3254
+ // the runtime is connected AND the session lookup has actually run and come
3255
+ // back empty. While the runtime is still connecting (the query is disabled and
3256
+ // therefore reports isLoading=false) or the lookup is in flight, we know
3257
+ // nothing yet — so we must show the loading state, not the error. This is what
3258
+ // stops the "This session is not accessible right now." flash on boot.
3259
+ // `useRuntimePhase()` distinguishes a booting/reconnecting sandbox from one
3260
+ // confirmed unreachable past the poll loop's failure threshold — plain
3261
+ // `runtimeReady` collapses both into the same false. See `retryable` on
3262
+ // `SessionComposerReadiness`.
3263
+ const runtimePhase = useRuntimePhase();
3264
+ // Covers the one gap `unreachable` can't: a sandbox proxy that keeps
3265
+ // answering with a 503 (OpenCode wedged mid-boot) resets the probe's
3266
+ // failure counter every tick, so `unreachable` never fires no matter how
3267
+ // long it stays wedged. See `useRuntimeBootStalled`.
3268
+ const runtimeStalled = useRuntimeBootStalled();
3269
+ // Classify an involuntary page load (discarded tab, or a chunk 404 after a
3270
+ // deploy) so the next "my session randomly disconnected" report arrives with
3271
+ // its cause attached instead of a shrug. An actionable cause reports to
3272
+ // Sentry; a routine browser tab discard only leaves a breadcrumb.
3273
+ useReloadForensics(projectSessionId);
3274
+ // Nothing has answered yet and the mount is young: the difference between
3275
+ // "this session is asleep" and "we have not looked yet". Without it, every
3276
+ // page load painted the waking notice for a beat over a session that was
3277
+ // never asleep — which reads as a disconnect. See `settling`.
3278
+ const composerSettling = useReadinessSettling(runtimePhase === 'connecting');
3279
+ // ONE answer for every surface that draws this session's runtime, and the
3280
+ // reason the composer no longer guesses: `unknown` and `connecting` are
3281
+ // waits, and a wait is not a fault. Only the control plane saying the box is
3282
+ // down earns the waking notice.
3283
+ const sessionConnection = projectSessionConnection({
3284
+ sandbox: projectSessionRow?.status ?? null,
3285
+ runtimeReady,
3286
+ unreachable: runtimePhase === 'unreachable' || runtimeUnreachable,
3287
+ stalled: runtimeStalled,
3288
+ activityFresh: working.state === 'working' && working.source === 'stream',
3289
+ });
3290
+ const composerReadiness = sessionComposerReadiness({
3291
+ runtimeReady,
3292
+ pendingPrompt: allowSendBeforeReady && working.state === 'working',
3293
+ pendingDelivery: working.pendingDelivery,
3294
+ connection: sessionConnection,
3295
+ settling: composerSettling,
3296
+ // Only an OPEN TURN the control plane is holding counts here. This tab's
3297
+ // optimistic receipt and a stream frame both survive a box that died
3298
+ // mid-turn, and a durable inbox row (which the projection also sources to
3299
+ // `server`) exists precisely while nothing is running yet — see
3300
+ // `serverHoldsOpenTurn`.
3301
+ serverTurnLive: serverHoldsOpenTurn(working),
3302
+ unreachable: runtimePhase === 'unreachable' || runtimeUnreachable,
3303
+ stalled: runtimeStalled,
3304
+ // The route's `/start` is bringing the computer up (or has not answered):
3305
+ // the same fact the boot pill above the thread shows.
3306
+ starting: !!sessionState &&
3307
+ (sessionState.stage == null ||
3308
+ sessionState.stage === 'provisioning' ||
3309
+ sessionState.stage === 'starting'),
3310
+ });
3311
+ // #6509's `promptLikelyDropped` notice is deliberately NOT carried over: it
3312
+ // instrumented the deleted prompt-observation stall machinery to warn about
3313
+ // accepted-but-never-started prompts, and that state is structurally gone —
3314
+ // a prompt is a durable inbox row before anything else happens, and an
3315
+ // unconfirmed delivery is redelivered by the reaper (see step 7).
3316
+ const { isNotFound, isDataLoading: resolvedDataLoading } = resolveSessionContentState({
3317
+ runtimeReady,
3318
+ sessionFetched,
3319
+ hasRuntimeSession: Boolean(session),
3320
+ hasMessages,
3321
+ // The producer's own copy of the first prompt counts as content here for
3322
+ // the same reason it counts in `hasChatContent` above: it is a bubble this
3323
+ // component will paint. It used to count in one place and not the other, so
3324
+ // on the home->session hand-off — the one path that plants a preview —
3325
+ // there was a window with content to draw and `isDataLoading` still true.
3326
+ // The early return below then replaced the instant shell's thread with the
3327
+ // compact "starting" loader for a frame or two before the real chat
3328
+ // appeared: the flicker, mid-crossfade.
3329
+ hasOptimisticPrompt: promptInbox.prompts.length > 0 || firstPromptPreview !== null,
3330
+ // The session OBJECT arriving is not the transcript arriving — they are two
3331
+ // different requests, and the message read is the one that loses to a
3332
+ // waking box. Without this the shell rendered over an unread session and
3333
+ // the user saw an empty conversation instead of a wait.
3334
+ transcriptLoaded: !syncMessagesLoading,
3335
+ });
3336
+ // MONOTONIC: once this component has painted content, the loader may never
3337
+ // replace it. The resolver holds the FIRST paint for the transcript read
3338
+ // (so a session open paints the whole conversation at once instead of
3339
+ // user-only inbox bubbles with the replies popping in later) — but the same
3340
+ // rule re-evaluated after content is on screen would hide it again: the
3341
+ // home→session hand-off paints the first-prompt preview before the runtime
3342
+ // session resolves, and a bubble typed mid-boot exists before the first
3343
+ // read lands. A loader is a promise about what is coming, not a curtain
3344
+ // over what is already there.
3345
+ const [contentPainted, setContentPainted] = useState(false);
3346
+ if (!resolvedDataLoading && !contentPainted)
3347
+ setContentPainted(true);
3348
+ const isDataLoading = resolvedDataLoading && !contentPainted;
3349
+ // Everything that isn't "we have content" and isn't the terminal not-found
3350
+ // state is loading — including the boot window where the query is still
3351
+ // disabled (isLoading=false) waiting on the runtime.
3352
+ //
3353
+ // Tell the route when that window closes, so the crossfade out of the instant
3354
+ // shell lands on the conversation and not on the loader below.
3355
+ useEffect(() => {
3356
+ if (!isDataLoading)
3357
+ onContentReady?.();
3358
+ }, [isDataLoading, onContentReady]);
3359
+ const isTransitioningFromWelcome = !prevHasChatContentRef.current && hasChatContent;
3360
+ // The welcome wallpaper is the EMPTY-STATE backdrop for a *resolved* session.
3361
+ // The loading/connecting phase never reaches here (it early-returns the loader
3362
+ // below), so this only needs to exclude the not-found screen.
3363
+ const shouldShowWelcomeOverlay = !isNotFound && (!hasChatContent || welcomeFadeActive || isTransitioningFromWelcome);
3364
+ // The welcome wallpaper. When SessionLayout provides a root-level wallpaper
3365
+ // layer we portal it in there so it spans the FULL session width (never
3366
+ // squished into the chat panel when the side panel is open); otherwise it
3367
+ // renders inline (mobile / standalone, where the chat panel is full width).
3368
+ const welcomeWallpaper = shouldShowWelcomeOverlay ? (_jsx("div", { className: cn('pointer-events-none absolute inset-0 z-0 transition-opacity ease-out', hasChatContent ? 'opacity-0' : 'opacity-100'), style: { transitionDuration: `${WELCOME_FADE_MS}ms` }, children: _jsx(SessionWelcome, {}) })) : null;
3369
+ // ---- Outcomes: turn footer cards + the change request's shareable link ----
3370
+ // The base branch this session forks from — the SAME read the Changes tab
3371
+ // uses (`useSessionBaseRef`), so the transcript and Changes cannot disagree
3372
+ // about which ref backs a change request.
3373
+ const outcomesBaseRef = useSessionBaseRef(projectId, projectSessionId);
3374
+ const searchParams = useUiSearchParams();
3375
+ // `readOnly` is the nested sub-session modal (`sub-session-modal.tsx`) — it
3376
+ // shares this component but must not rewrite the parent route's URL.
3377
+ const [openCrId, setOpenCrIdState] = useState(() => readOnly ? null : (searchParams?.get('cr') ?? null));
3378
+ const setOpenCrId = useCallback((id) => {
3379
+ setOpenCrIdState(id);
3380
+ if (readOnly)
3381
+ return;
3382
+ const params = new URLSearchParams(searchParams?.toString());
3383
+ if (id)
3384
+ params.set('cr', id);
3385
+ else
3386
+ params.delete('cr');
3387
+ const qs = params.toString();
3388
+ // A shallow replace, not `router.replace`: `cr` is a param this page has
3389
+ // already resolved client-side, so there is no server data to fetch.
3390
+ // Under Next.js `router.replace` would run a COLD RSC FETCH on every
3391
+ // open/close of this dialog, on the hottest route in the app (see
3392
+ // app/(app)/projects/[id]/sessions/[sessionId]/page.tsx:1309); Next
3393
+ // observes `history.replaceState`, which `useUiShallowNavigate` writes
3394
+ // when the host router observes history and routes through it otherwise.
3395
+ shallowNavigate(qs ? `${pathname}?${qs}` : pathname, { replace: true });
3396
+ }, [readOnly, pathname, searchParams, shallowNavigate]);
3397
+ // A session tab stays mounted, so a later `?cr=` (the turn-done toast's
3398
+ // Review) must open the dialog too, not only the one read at mount.
3399
+ const crParam = readOnly ? null : (searchParams?.get('cr') ?? null);
3400
+ useEffect(() => {
3401
+ if (crParam)
3402
+ setOpenCrIdState(crParam);
3403
+ }, [crParam]);
3404
+ const handleOpenOutcome = useCallback((outcome) => {
3405
+ // Change requests are the only kind a turn produces. `external` exists on
3406
+ // the union for `setup-links/setup-link-button.tsx`, which renders this
3407
+ // card inline in prose and handles its own open.
3408
+ if (outcome.kind === 'change_request')
3409
+ setOpenCrId(outcome.id.slice('cr:'.length));
3410
+ }, [setOpenCrId]);
3411
+ // While the session is still connecting / loading its content, render ONLY the
3412
+ // staged loader — never the session shell (header + input) at the same time.
3413
+ // Showing both reads as "loaded and loading at once" (the very contradiction
3414
+ // the loader exists to avoid). The connection keeps running in the parent
3415
+ // ProjectSessionRuntimeConnection, so as soon as the runtime is ready
3416
+ // isDataLoading flips and the full shell renders in one shot.
3417
+ if (isDataLoading) {
3418
+ // A transcript read that genuinely FAILED (not a waking box — the SDK keeps
3419
+ // those on `loading` and retries them itself) gets an explicit retry, not
3420
+ // an eternal loader. Only with nothing to paint: once any message is on
3421
+ // screen, staleness is repaired in the background instead.
3422
+ if (transcriptFreshness === 'error' && !hasMessages) {
3423
+ return (_jsx("div", { className: "bg-background relative flex h-full flex-col", "data-testid": "session-chat", children: _jsxs("div", { className: "flex flex-1 flex-col items-center justify-center gap-3 p-6", "data-testid": "session-transcript-error", children: [_jsx("p", { className: "text-muted-foreground text-sm", children: tHardcodedUi.raw('i18nComplete.text8d0cef2d3405') }), _jsx(Button, { variant: "outline", size: "sm", onClick: () => retryTranscript(), children: tHardcodedUi.raw('i18nComplete.text942087cc2d41') })] }) }));
3424
+ }
3425
+ return (_jsx("div", { className: "bg-background relative flex h-full flex-col", "data-testid": "session-chat", children: _jsx(SessionStartingLoader, { stage: runtimeReady ? 'ready' : 'starting', variant: "compact", projectId: projectId, sessionId: projectSessionId }) }));
3426
+ }
3427
+ return (
3428
+ // Outcomes' cache coherence and the shareable `?cr=` link both hinge on
3429
+ // ONE `ProjectFilesProvider`: `useChangeRequests` inside
3430
+ // `SessionOutcomesProvider` and `ChangeRequestDetailDialog` below both read
3431
+ // their project id from this context, which is what keeps them on the same
3432
+ // React Query cache entry (see `outcomes/session-outcomes-provider.tsx`).
3433
+ _jsx(ProjectFilesProvider, { value: { projectId: projectId ?? '', ref: outcomesBaseRef, defaultBranch: outcomesBaseRef }, children: _jsxs(ComposerDropZone, { className: cn('relative flex h-full flex-col',
3434
+ // Transparent in the welcome state so the root-level full-bleed wallpaper
3435
+ // (portaled into SessionLayout) reads through; solid once real content
3436
+ // takes over. Same base color either way, so non-welcome is unchanged.
3437
+ shouldShowWelcomeOverlay ? '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
3438
+ ? welcomeWallpaper && createPortal(welcomeWallpaper, wallpaperLayer)
3439
+ : welcomeWallpaper, !hideHeader && (_jsx(SessionSiteHeader, { sessionId: sessionId, sessionTitle: session?.title || 'Untitled', leadingAction: headerLeadingAction, parent: parentCrumb })), _jsx(SessionContextModal, { open: contextModalOpen, onOpenChange: setContextModalOpen,
3440
+ // A chat with no `useSession` source: the raw explorer lists the
3441
+ // rows `useSessionSync` read for it.
3442
+ detachedRows: sessionState ? undefined : hookMessages, source: sessionState ?? DETACHED_SESSION_MESSAGES, session: session, providers: providers, allSessions: allSessions, servedModel: sessionServedModel, billedCost: sessionBilledCost(modelUsage) }), _jsx(CompactModal, { sessionId: sessionId, open: compactModalOpen, onOpenChange: setCompactModalOpen }), _jsx(ChangeRequestDetailDialog, { crId: openCrId, onClose: () => setOpenCrId(null) }), _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: () => {
3443
+ try {
3444
+ if (sessionId)
3445
+ useTabStore.getState().closeTab?.(sessionId);
3446
+ }
3447
+ catch { }
3448
+ }, 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(
3449
+ // overflow-anchor:none — this scroll area does ALL of its own
3450
+ // anchoring (useAutoScroll's spacer + RAF follow, the send-path
3451
+ // turn anchor, and the history-prepend content-space restore in
3452
+ // session-history-scroll.ts). The browser's native scroll
3453
+ // anchoring (default `overflow-anchor: auto`) tries to
3454
+ // compensate for the SAME prepends independently, and the two
3455
+ // corrections stacking is the other half of the scroll-up
3456
+ // teleport: ours restores the reader's position, then the
3457
+ // native one nudges it again.
3458
+ 'scrollbar-hide relative z-10 h-full flex-1 overflow-y-auto [scroll-behavior:auto] [overflow-anchor:none]', shouldShowWelcomeOverlay ? 'bg-transparent' : 'bg-background'), onMouseUp: handleChatMouseUp, onMouseDown: handleChatMouseDown, onScroll: handleChatScroll, children: _jsxs("div", { ref: contentRef, role: "log",
3459
+ // Width and gutters live in `SESSION_TRANSCRIPT_CLASS`: the
3460
+ // instant shell draws this same column and the two crossfade
3461
+ // into each other, so a difference here is a sideways jump on
3462
+ // screen, not a style opinion. See session-body.tsx.
3463
+ //
3464
+ // No bottom padding, there or here: the space under the last
3465
+ // message is the auto-scroll spacer's job alone. The `pb-32`
3466
+ // that used to sit here stacked 128px of dead space on top of
3467
+ // it — the "extra inset at the bottom of the session".
3468
+ className: 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 &&
3469
+ !olderPullFailed &&
3470
+ 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, children: _jsxs(ToolActivateContext.Provider, { value: toolActivate, children: [showFirstPromptPreview &&
3471
+ firstPromptSource &&
3472
+ queuedSyntheticMessages.length === 0 && (_jsx(OptimisticTurn, { text: buildOptimisticPromptTextWithUploads(firstPromptSource.text, firstPromptSource.files),
3473
+ // Preserve a real failed-send status through the
3474
+ // boot-shell handover without inventing upload progress.
3475
+ // A first prompt held on its uploads carries its own.
3476
+ uploadStatus: firstPromptSource.uploadStatus ?? firstPromptUploadStatus, agentNames: agentNames, onFileClick: openFileInComputer, sessionId: sessionId,
3477
+ // The first item of the conversation, like turn 0, which has no
3478
+ // top margin. `first:mt-0` misses here: the list opens with a
3479
+ // zero-height <header>, so the stand-in sat 44px lower than turn 0
3480
+ // and every swap between the two jumped the bubble (KRTX-2931).
3481
+ className: "mt-0",
3482
+ // An undelivered first prompt is a turn about to start, as the
3483
+ // shell above this chat shows it: busy from the first frame,
3484
+ // before the working projection has read the inbox (KRTX-2931).
3485
+ busy: turns.length === 0 && (lastTurnWorking || promptInbox.prompts.some(isFirstPromptRow)) })), turns.map((turn, turnIndex) => {
3486
+ // Check if this turn is a compaction summary — and
3487
+ // whether it actually PRODUCED one. A failed/aborted
3488
+ // attempt (compaction-flagged, no content, not the
3489
+ // working turn) renders as one slim row, draws no
3490
+ // divider, and stacks tight against a neighbouring
3491
+ // failed attempt.
3492
+ const compaction = turn.compaction;
3493
+ const hasCompaction = compaction !== null;
3494
+ const isTurnWorking = turn.live;
3495
+ // `inFlight` (message state) alongside the projection:
3496
+ // classifying by projection alone flipped a streaming
3497
+ // compaction to "failed" for the frames where the two
3498
+ // disagree, popping the divider in and out — a layout
3499
+ // bounce right where the reader is looking.
3500
+ const isFailedCompaction = compaction !== null &&
3501
+ !compaction.hasContent &&
3502
+ !compaction.inFlight &&
3503
+ !isTurnWorking;
3504
+ // Retries collapse to ONE visible row, GLOBALLY: a
3505
+ // failed attempt with ANY later compaction turn (a
3506
+ // retry, or the one that finally landed) is history —
3507
+ // it keeps its TurnViewport (stable keys, scroll
3508
+ // anchors) but renders no content, and an empty
3509
+ // TurnViewport costs 0px (turn-viewport.tsx RULE 2).
3510
+ // Adjacency was not enough: attempts whose error landed
3511
+ // on a plain assistant message used to interleave as
3512
+ // unclassified turns, breaking every consecutive run.
3513
+ const suppressedFailedCompaction = isFailedCompaction && turnIndex < lastCompactionTurnIndex;
3514
+ // Notification-only early-return removed: it rendered the
3515
+ // user's pty_* card but skipped the turn's replies,
3516
+ // hiding every subsequent assistant response in that turn.
3517
+ // Fall through to the normal turn renderer instead.
3518
+ const confirmedActive = turnIsConfirmedActive({
3519
+ isTurnWorking,
3520
+ turnId: turn.id,
3521
+ activeTurnId,
3522
+ pendingDelivery: !!working.pendingDelivery,
3523
+ });
3524
+ const pendingPrompt = !confirmedActive && turn.assistant.length === 0
3525
+ ? pendingPromptsByMessageId.get(turn.id)
3526
+ : undefined;
3527
+ // A queued prompt is not in the runtime transcript yet;
3528
+ // its author still shows (`authorForTurn`).
3529
+ const turnAuthor = authorForTurn(transcriptAuthors, messageAuthors, turn.id, pendingPrompt?.wire_message_id);
3530
+ return (_jsx(TranscriptTurnRow
3531
+ // ONE element per prompt: keyed by the id the
3532
+ // bubble was FIRST painted under, so the swap to a
3533
+ // re-minted echo id re-renders this node instead
3534
+ // of mounting a new one (opacity keeps animating,
3535
+ // hover state survives, nothing jumps).
3536
+ , { turnId: turn.id, modelOptions: modelOptions, suppressed: suppressedFailedCompaction, continuedWith: harnessSwitches.get(turn.id)?.harness, fullTextState: loaded.state[turn.id] ?? 'idle', onLoadFullText: loadFullTexts, showBusyRow: showFallbackBusyRow &&
3537
+ fallbackBusyRowTurnId === turn.id,
3538
+ // Queued bubbles STACK: a pending turn right after
3539
+ // another pending turn sits close to it, like a
3540
+ // list of what is waiting — not a turn's width
3541
+ // apart as if each had been answered in between.
3542
+ // (Failed compaction rows need no stacking rule any
3543
+ // more — at most one is visible at a time.)
3544
+ viewportClassName: turnIndex === 0
3545
+ ? ''
3546
+ : // A compaction and the work after it continue the turn above.
3547
+ turn.compaction || turn.continues
3548
+ ? 'mt-6'
3549
+ : lastTurnWorking &&
3550
+ pendingTurnIds.has(turn.id) &&
3551
+ pendingTurnIds.has(turns[turnIndex - 1].id)
3552
+ ? 'mt-3'
3553
+ : 'mt-12', turn: turn, author: turnAuthor, showAuthor: showAuthorName(turnAuthor, groupChat, viewerId), 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, sessionStatus: sessionStatus, permissions: pendingPermissions, questions: pendingQuestions, agentNames: agentNames, isFirstTurn: turnIndex === 0,
3554
+ // Handed over only once the stand-in has stepped
3555
+ // aside — while it is up it draws these itself.
3556
+ pendingText: turnIndex === 0 ? firstTurnHandover?.text : undefined, pendingAttachments: sentAttachmentsForTurn({
3557
+ sentByMessage: sentAttachmentsByMessage,
3558
+ messageId: turn.id,
3559
+ originId: optimisticOriginOf(sessionId, turn.id),
3560
+ isFirstTurn: turnIndex === 0,
3561
+ firstTurnHandover: firstTurnHandover?.attachments,
3562
+ firstTurnSent: firstPromptAttachments(projectSessionId),
3563
+ queuedRowAttachments: inboxRowsByMessageId.get(turn.id)?.attachments,
3564
+ }), uploadStatus: heldSendFailures?.[turn.id]
3565
+ ? {
3566
+ state: 'failed',
3567
+ message: heldSendFailures[turn.id].message,
3568
+ onRetry: () => retryHeldSend(sessionId, turn.id, resendHeldSend, (error) => classifySessionError(error).message),
3569
+ }
3570
+ : turnIndex === 0 && firstTurnHandover?.attachments.length
3571
+ ? firstPromptUploadStatus
3572
+ : undefined, sessionWorking: lastTurnWorking, isWorkingTurn: turn.live, suppressBusyIndicator: suppressWorkingTurnBusy, awaitingUser: awaitingUserInput,
3573
+ // An idle send stays in the inbox until delivery,
3574
+ // but nothing runs ahead of it: queued only while
3575
+ // it waits behind a turn (`turnRendersQueued`).
3576
+ pending: turnRendersQueued({
3577
+ turnId: turn.id,
3578
+ resolution: workingTurn,
3579
+ sessionWorking: lastTurnWorking,
3580
+ confirmedActive,
3581
+ inboxPrompt: pendingPrompt,
3582
+ }), 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
3583
+ ? rewindTarget.text
3584
+ : null, editPending: editSendPending || !!sessionState?.rewindPending, onEditCancel: stableEditCancel, onEditSend: stableEditSend, rewindDisabled: !!readOnly ||
3585
+ !runtimeCanRewind ||
3586
+ !sessionState ||
3587
+ isBusy ||
3588
+ sessionState.rewindPending ||
3589
+ // The runtime is not idle while queued prompts
3590
+ // are still on their way to it — a rewind mid-
3591
+ // delivery fails downstream with "Session is
3592
+ // busy" (measured); refuse it up front instead.
3593
+ promptInbox.prompts.length > 0 }, turnRenderKeys.get(turn.id)));
3594
+ })] }) }), isOptimisticCompacting && !hasCompactionTurn && (_jsx("div", { className: turns.length > 0 ? 'mt-12' : 'mt-2', children: _jsx(CompactionMarker, { running: true }) })), [
3595
+ ...(turnOutcome.recent_failures ?? []),
3596
+ ...(turnOutcome.last_ended?.end_reason === 'failed' &&
3597
+ !turnOutcome.recent_failures?.some((failure) => failure.message_id === turnOutcome.last_ended?.message_id)
3598
+ ? [turnOutcome.last_ended]
3599
+ : []),
3600
+ ].filter((failure) => !isAbortError(failure.error) &&
3601
+ !failureShownByTurn(failure, turns) &&
3602
+ !failureSupersededByTurn(failure, turns) &&
3603
+ (!failure.error?.message || failure.error.message !== commandError?.message)).map((failure) => {
3604
+ const messageId = failure.message_id ?? 'persisted-turn-failure';
3605
+ // Use the SDK's settle window for a cause that may arrive
3606
+ // one frame later, including an unnamed failed last turn.
3607
+ const notice = turnEndNotice({
3608
+ ...turnOutcome,
3609
+ recent_failures: [{ ...failure, message_id: messageId, error: failure.error ?? null }],
3610
+ }, messageId, { hasError: false, isAbort: false });
3611
+ return notice ? (_jsx(TurnErrorDisplay, { errorText: notice.kind === 'unexplained'
3612
+ ? tHardcodedUi.raw('i18nComplete.text73112526c03a')
3613
+ : persistedFailureText(failure.error), className: "mt-2" }, messageId)) : null;
3614
+ }), commandError && (_jsx(TurnErrorDisplay, { error: commandError, isAbort: isAbortError(commandError.cause), modelOptions: modelOptions, className: "mt-2" })), showFallbackBusyRow && fallbackBusyRowTurnId === null && (_jsx(SessionBusyIndicator, { sessionId: sessionId,
3615
+ // Matches the stand-in's row spacing under a bubble
3616
+ // (`OptimisticTurn`), so the crossfade into the real
3617
+ // transcript does not move it. Nothing above it when
3618
+ // the transcript is empty, so no margin there.
3619
+ 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: {
3620
+ left: `${selectionPopup.x}px`,
3621
+ top: `${selectionPopup.y}px`,
3622
+ transform: 'translate(-50%, -100%)',
3623
+ }, 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" })] }) })), _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
3624
+ ? 'duration-normal scale-100 opacity-100'
3625
+ : '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 && (_jsx(_Fragment, { children: _jsx(SessionChatInput
3626
+ // `undefined`, not `true`, once released: the composer's own
3627
+ // viewport rule (>= 640px) still decides, so this never forces
3628
+ // focus onto a phone keyboard.
3629
+ , {
3630
+ // `undefined`, not `true`, once released: the composer's own
3631
+ // viewport rule (>= 640px) still decides, so this never forces
3632
+ // focus onto a phone keyboard.
3633
+ autoFocus: deferComposerFocus ? false : undefined, onSend: async (text, files, mentions, attachments, placement) => {
3634
+ if (await queueEdit.save(text))
3635
+ return;
3636
+ // Enter while a turn runs steers it (D9.1); Cmd/Ctrl+Enter is Queue List.
3637
+ await handleSend(text, files, mentions, attachments, composerSendDelivery(placement ?? 'transcript', isBusyRef.current));
3638
+ }, prefill: composerPrefill, onPrefillApplied: (id) => {
3639
+ useSessionComposerPrefillStore.getState().clearPrefill(sessionId, id);
3640
+ },
3641
+ // Up from the first row takes the queue back; the placeholder
3642
+ // says so while there is something to take.
3643
+ onArrowUpAtStart: () => queueEdit.takeBack(), hint: canTakeBackQueue ? tHardcodedUi.raw('i18nComplete.text03a01dd53ffa') : undefined,
3644
+ // Editing a queued message: the send saves it back into the
3645
+ // queue, so the control says Submit, never Stop.
3646
+ submitLabel: queueEdit.editing ? tQueue('submitEdit') : null, draftScope: composerDraftScope, draftActive: !deferComposerFocus, attachRequestId: attachRequestId, isBusy: isBusy,
3647
+ // The ONE projection, not the 300 ms busy fade: it is what
3648
+ // decides whether a `/` command may be dispatched, and a fade
3649
+ // timer that has already lapsed would let one abort a live turn.
3650
+ // `effectiveBusy` folds in optimistic compaction (not a turn, so
3651
+ // not in `working`) and the retrying-turn predicate, so this
3652
+ // site reads one value instead of re-OR-ing a term onto it.
3653
+ sessionWorking: effectiveBusy,
3654
+ // Gates `/` COMMANDS only. A prompt typed at a sleeping box is
3655
+ // an inbox row and goes out when the box answers; a command has
3656
+ // no row, and `runCommand` swallows it silently until the
3657
+ // runtime is switched.
3658
+ 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, 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,
3659
+ // Only lock the input into question-answer mode while the session is
3660
+ // actually busy (a live question keeps the run busy). If a question
3661
+ // chip is ever showing while the session is idle — e.g. a dead /
3662
+ // abandoned question the agent left behind — the input stays unlocked
3663
+ // so a typed message is sent to the agent instead of being swallowed
3664
+ // as a custom answer.
3665
+ lockForQuestion: !!renderedQuestion && isBusy,
3666
+ // Same dead-prompt guard as questions: only lock while the agent is
3667
+ // actually paused on the decision (isBusy), so a stale card can't
3668
+ // swallow the composer on an idle session.
3669
+ lockForApproval: runtimePermissionLocksComposer(pendingPermissions.length, isBusy), onCustomAnswer: handleCustomAnswer, questionButtonLabel: renderedQuestion ? questionAction.label : null, questionActive: !!renderedQuestion || approvalDocked, questionCanAct: questionAction.canAct, onQuestionAction: handleQuestionAction, aboveSlot: chatAboveSlot, inputSlot: chatInputSlot, toolbarSlot: chatToolbarSlot,
3670
+ // The shell can now render on a cached transcript alone, i.e. before
3671
+ // the sandbox answers — so sending has to be gated separately from
3672
+ // reading. See sessionComposerReadiness.
3673
+ notice: composerReadiness.notice, onNoticeRetry: composerReadiness.notice && composerReadiness.retryable
3674
+ ? requestRuntimeReconnect
3675
+ : undefined }) }))] })] }) }));
3676
+ }