@kortix/ui 0.14.8 → 0.14.10

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 (567) hide show
  1. package/README.md +2 -2
  2. package/dist/_vendor/kortix-shared.js +116 -3
  3. package/dist/_vendor/shared/app-config.d.ts +175 -0
  4. package/dist/_vendor/shared/artifact-comments.d.ts +235 -0
  5. package/dist/_vendor/shared/channel-descriptors.d.ts +96 -0
  6. package/dist/_vendor/shared/channel-message.d.ts +45 -5
  7. package/dist/_vendor/shared/index.d.ts +2 -0
  8. package/dist/_vendor/shared/space-slug.d.ts +37 -0
  9. package/dist/access/access/access-detail-shell.js +1 -1
  10. package/dist/access/access/principal-picker.d.ts +11 -0
  11. package/dist/access/access/principal-picker.js +3 -2
  12. package/dist/apps/app-preview-pool.d.ts +7 -2
  13. package/dist/apps/app-preview-pool.js +30 -7
  14. package/dist/apps/app-shared.d.ts +22 -15
  15. package/dist/apps/app-shared.js +37 -19
  16. package/dist/apps/index.d.ts +2 -2
  17. package/dist/apps/index.js +2 -2
  18. package/dist/artifacts/artifact-frame.d.ts +16 -0
  19. package/dist/artifacts/artifact-frame.js +55 -0
  20. package/dist/artifacts/artifact-session.d.ts +18 -0
  21. package/dist/artifacts/artifact-session.js +101 -0
  22. package/dist/artifacts/frame-policy.d.ts +30 -0
  23. package/dist/artifacts/frame-policy.js +61 -0
  24. package/dist/artifacts/index.d.ts +3 -0
  25. package/dist/artifacts/index.js +5 -0
  26. package/dist/browser/sandbox-browser-chrome.d.ts +4 -1
  27. package/dist/browser/sandbox-browser-chrome.js +2 -2
  28. package/dist/customize/agents/agent-grant-pages.d.ts +5 -1
  29. package/dist/customize/agents/agent-grant-pages.js +30 -4
  30. package/dist/customize/agents/agent-page.js +3 -1
  31. package/dist/customize/agents/agent-policy-sets.d.ts +43 -0
  32. package/dist/customize/agents/agent-policy-sets.js +72 -0
  33. package/dist/customize/agents/agent-triggers-section.js +2 -1
  34. package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.d.ts +6 -1
  35. package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.js +10 -4
  36. package/dist/customize/connectors/agent-access.d.ts +35 -0
  37. package/dist/customize/connectors/agent-access.js +77 -0
  38. package/dist/customize/connectors/catalog/browse-sections.d.ts +2 -29
  39. package/dist/customize/connectors/catalog/browse-sections.js +7 -74
  40. package/dist/customize/connectors/catalog/catalog-entry.d.ts +18 -37
  41. package/dist/customize/connectors/catalog/catalog-entry.js +28 -40
  42. package/dist/customize/connectors/catalog/connector-browse.d.ts +3 -32
  43. package/dist/customize/connectors/catalog/connector-browse.js +19 -50
  44. package/dist/customize/connectors/catalog/use-catalog.d.ts +20 -59
  45. package/dist/customize/connectors/catalog/use-catalog.js +48 -175
  46. package/dist/customize/connectors/connector-identity.d.ts +9 -11
  47. package/dist/customize/connectors/connector-identity.js +13 -42
  48. package/dist/customize/connectors/connector-moves-banner.d.ts +2 -1
  49. package/dist/customize/connectors/connector-moves-banner.js +4 -6
  50. package/dist/customize/connectors/connector-routes.d.ts +21 -9
  51. package/dist/customize/connectors/connector-routes.js +29 -20
  52. package/dist/customize/connectors/connectors-page.js +53 -82
  53. package/dist/customize/connectors/detail/app-page.js +226 -98
  54. package/dist/customize/connectors/detail/computer-app-page.d.ts +16 -0
  55. package/dist/customize/connectors/detail/computer-app-page.js +39 -0
  56. package/dist/customize/connectors/detail/connector-accounts.js +3 -1
  57. package/dist/customize/connectors/detail/connector-advanced-tools.d.ts +4 -1
  58. package/dist/customize/connectors/detail/connector-advanced-tools.js +2 -2
  59. package/dist/customize/connectors/detail/connector-agents.d.ts +14 -0
  60. package/dist/customize/connectors/detail/connector-agents.js +69 -0
  61. package/dist/customize/connectors/detail/connector-detail-tabs.js +2 -1
  62. package/dist/customize/connectors/detail/connector-move-row.d.ts +8 -5
  63. package/dist/customize/connectors/detail/connector-move-row.js +23 -14
  64. package/dist/customize/connectors/detail/connector-page.d.ts +4 -1
  65. package/dist/customize/connectors/detail/connector-page.js +14 -10
  66. package/dist/customize/connectors/detail/connector-policy-sets.d.ts +28 -0
  67. package/dist/customize/connectors/detail/connector-policy-sets.js +203 -0
  68. package/dist/customize/connectors/detail/connector-settings.d.ts +4 -1
  69. package/dist/customize/connectors/detail/connector-settings.js +7 -3
  70. package/dist/customize/connectors/detail/connector-status.d.ts +19 -6
  71. package/dist/customize/connectors/detail/connector-status.js +34 -10
  72. package/dist/customize/connectors/detail/connector-tabs.d.ts +4 -1
  73. package/dist/customize/connectors/detail/connector-tabs.js +8 -2
  74. package/dist/customize/connectors/detail/connector-tools.d.ts +3 -3
  75. package/dist/customize/connectors/detail/connector-tools.js +105 -48
  76. package/dist/customize/connectors/detail/email-inboxes.d.ts +43 -0
  77. package/dist/customize/connectors/detail/email-inboxes.js +184 -0
  78. package/dist/customize/connectors/detail/provider-info.d.ts +1 -1
  79. package/dist/customize/connectors/detail/provider-info.js +2 -2
  80. package/dist/customize/connectors/detail/status-badge.d.ts +1 -1
  81. package/dist/customize/connectors/detail/status-badge.js +4 -5
  82. package/dist/customize/connectors/detail/use-connector-detail.d.ts +6 -0
  83. package/dist/customize/connectors/detail/use-connector-detail.js +14 -4
  84. package/dist/customize/connectors/install/install-dialog.d.ts +23 -0
  85. package/dist/customize/connectors/install/install-dialog.js +40 -0
  86. package/dist/customize/connectors/install/install.d.ts +13 -2
  87. package/dist/customize/connectors/install/install.js +9 -4
  88. package/dist/customize/connectors/install/use-install.d.ts +19 -2
  89. package/dist/customize/connectors/install/use-install.js +65 -37
  90. package/dist/customize/connectors/install/way-kind.d.ts +5 -0
  91. package/dist/customize/connectors/install/way-kind.js +16 -0
  92. package/dist/customize/connectors/provider-label.d.ts +2 -1
  93. package/dist/customize/connectors/provider-label.js +13 -3
  94. package/dist/customize/connectors/tools/pattern-rule-draft.d.ts +4 -0
  95. package/dist/customize/connectors/tools/pattern-rule-draft.js +12 -3
  96. package/dist/customize/connectors/tools/policy-sets.d.ts +27 -0
  97. package/dist/customize/connectors/tools/policy-sets.js +41 -0
  98. package/dist/customize/connectors/tools/tool-groups.d.ts +32 -9
  99. package/dist/customize/connectors/tools/tool-groups.js +78 -16
  100. package/dist/customize/connectors/tools/tool-policy-control.d.ts +11 -10
  101. package/dist/customize/connectors/tools/tool-policy-control.js +15 -16
  102. package/dist/customize/connectors/tools/tool-policy-labels.d.ts +6 -5
  103. package/dist/customize/connectors/tools/tool-policy-labels.js +17 -16
  104. package/dist/customize/connectors/tools/tool-policy.d.ts +50 -4
  105. package/dist/customize/connectors/tools/tool-policy.js +74 -8
  106. package/dist/customize/connectors/use-agent-access.d.ts +85 -0
  107. package/dist/customize/connectors/use-agent-access.js +72 -0
  108. package/dist/customize/migrate-to-v2/index.d.ts +1 -2
  109. package/dist/customize/migrate-to-v2/index.js +1 -2
  110. package/dist/customize/migrate-to-v2/migration-prompt.d.ts +12 -25
  111. package/dist/customize/migrate-to-v2/migration-prompt.js +34 -236
  112. package/dist/customize/migrate-to-v2/upgrade-defs.d.ts +1 -1
  113. package/dist/customize/migrate-to-v2/upgrade-defs.js +7 -6
  114. package/dist/customize/migrate-to-v2/upgrade-view.js +7 -7
  115. package/dist/customize/migrate-to-v2/use-run-upgrade.d.ts +3 -3
  116. package/dist/customize/providers/provider-accordion.js +17 -2
  117. package/dist/customize/sections/component/channel-access-panel.d.ts +16 -0
  118. package/dist/customize/sections/component/channel-access-panel.js +146 -0
  119. package/dist/customize/sections/component/channel-connect-hero.d.ts +3 -2
  120. package/dist/customize/sections/component/channel-connect-hero.js +3 -2
  121. package/dist/customize/sections/component/channel-hero-frame.d.ts +31 -0
  122. package/dist/customize/sections/component/channel-hero-frame.js +40 -0
  123. package/dist/customize/sections/component/channel-mocks.d.ts +6 -0
  124. package/dist/customize/sections/component/channel-mocks.js +46 -0
  125. package/dist/customize/sections/component/channel-row.d.ts +13 -3
  126. package/dist/customize/sections/component/channel-row.js +10 -4
  127. package/dist/customize/sections/component/email-connect-form.d.ts +27 -0
  128. package/dist/customize/sections/component/email-connect-form.js +183 -0
  129. package/dist/customize/sections/component/slack-connect-card.d.ts +7 -0
  130. package/dist/customize/sections/component/slack-connect-card.js +2 -3
  131. package/dist/customize/sections/component/teams-connect-card.d.ts +7 -0
  132. package/dist/customize/sections/component/teams-connect-card.js +2 -3
  133. package/dist/customize/sections/component/telegram-channel-row.js +21 -28
  134. package/dist/customize/sections/connectors-view.d.ts +1 -15
  135. package/dist/customize/sections/connectors-view.js +81 -314
  136. package/dist/customize/sections/view/agent-editor-catalog.js +10 -0
  137. package/dist/customize/sections/view/channels-view.d.ts +6 -1
  138. package/dist/customize/sections/view/channels-view.js +72 -81
  139. package/dist/customize/sections/view/gateway/gateway-overview.js +10 -2
  140. package/dist/customize/settings/rail.js +9 -0
  141. package/dist/customize/settings/settings-tabs.d.ts +1 -1
  142. package/dist/customize/settings/settings-tabs.js +1 -0
  143. package/dist/customize/settings/tabs/chrome-connections-tab.d.ts +6 -0
  144. package/dist/customize/settings/tabs/chrome-connections-tab.js +99 -0
  145. package/dist/customize/settings/tabs/experimental-tab.js +35 -16
  146. package/dist/customize/shared/catalog/catalog-empty-state.d.ts +4 -15
  147. package/dist/customize/shared/catalog/catalog-empty-state.js +9 -7
  148. package/dist/customize/shared/channels-switch-dialog.d.ts +18 -0
  149. package/dist/customize/shared/channels-switch-dialog.js +30 -0
  150. package/dist/customize/shared/feature-gate-screen.js +27 -9
  151. package/dist/customize/shared/use-customize-prefetch.d.ts +2 -3
  152. package/dist/customize/shared/use-customize-prefetch.js +9 -27
  153. package/dist/customize/triggers/schedule/post-to-field.d.ts +18 -0
  154. package/dist/customize/triggers/schedule/post-to-field.js +49 -0
  155. package/dist/customize/triggers/schedule/schedule-copy.d.ts +10 -6
  156. package/dist/customize/triggers/schedule/schedule-copy.js +42 -11
  157. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +2 -1
  158. package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +22 -0
  159. package/dist/customize/triggers/schedule/trigger-composer-logic.js +25 -0
  160. package/dist/customize/triggers/schedule/trigger-composer.d.ts +5 -0
  161. package/dist/customize/triggers/schedule/trigger-composer.js +23 -14
  162. package/dist/customize/triggers/schedule/trigger-edit-logic.js +3 -0
  163. package/dist/customize/triggers/schedule/trigger-filter.js +1 -1
  164. package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +2 -2
  165. package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -0
  166. package/dist/customize/triggers/schedule/trigger-toast.js +2 -1
  167. package/dist/customize/triggers/schedule-view.js +5 -2
  168. package/dist/files/index.d.ts +1 -0
  169. package/dist/files/index.js +1 -0
  170. package/dist/files/project/change-request-recovery.d.ts +1 -26
  171. package/dist/files/project/change-request-recovery.js +1 -59
  172. package/dist/files/project/components/change-request-detail-dialog.js +13 -3
  173. package/dist/files/project/components/drive-explorer.js +15 -15
  174. package/dist/files/project/components/drive-toolbar.d.ts +16 -2
  175. package/dist/files/project/components/drive-toolbar.js +14 -5
  176. package/dist/files/project/hooks/use-change-request-recovery.js +3 -19
  177. package/dist/files/project/hooks/use-change-requests.d.ts +1 -0
  178. package/dist/files/project/hooks/use-change-requests.js +11 -2
  179. package/dist/files/renderers/image-frame.d.ts +48 -0
  180. package/dist/files/renderers/image-frame.js +59 -0
  181. package/dist/files/renderers/image-renderer.d.ts +11 -1
  182. package/dist/files/renderers/image-renderer.js +13 -3
  183. package/dist/files/renderers/pdf/pdf-clipboard.d.ts +2 -0
  184. package/dist/files/renderers/pdf/pdf-clipboard.js +21 -0
  185. package/dist/files/renderers/pdf/pdf-viewer.js +4 -2
  186. package/dist/files/renderers/show-content-renderer.d.ts +9 -1
  187. package/dist/files/renderers/show-content-renderer.js +56 -14
  188. package/dist/files/runtime/file-source.js +2 -0
  189. package/dist/files/runtime/hooks/use-binary-blob.d.ts +10 -1
  190. package/dist/files/runtime/hooks/use-binary-blob.js +10 -4
  191. package/dist/files/runtime/hooks/use-shared-image.d.ts +41 -0
  192. package/dist/files/runtime/hooks/use-shared-image.js +177 -0
  193. package/dist/files/viewer/file-content-renderer.d.ts +22 -1
  194. package/dist/files/viewer/file-content-renderer.js +50 -7
  195. package/dist/files/viewer/file-header.d.ts +7 -3
  196. package/dist/files/viewer/file-header.js +20 -11
  197. package/dist/files/viewer/file-preview-modal.d.ts +1 -1
  198. package/dist/files/viewer/file-preview-modal.js +10 -22
  199. package/dist/files/viewer/file-source.d.ts +13 -0
  200. package/dist/files/viewer/use-file-content-state.d.ts +2 -0
  201. package/dist/files/viewer/use-file-content-state.js +28 -10
  202. package/dist/files/viewer/viewer-actions.d.ts +3 -1
  203. package/dist/files/viewer/viewer-actions.js +2 -2
  204. package/dist/hooks/use-media-query.d.ts +1 -0
  205. package/dist/hooks/use-mobile.d.ts +5 -0
  206. package/dist/hooks/use-mobile.js +8 -0
  207. package/dist/i18n/en.d.ts +1062 -85
  208. package/dist/i18n/en.js +1078 -101
  209. package/dist/i18n/ui-catalog/localize-ui-catalog.js +4 -0
  210. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +15 -3
  211. package/dist/index.d.ts +2 -2
  212. package/dist/index.js +2 -2
  213. package/dist/internal/account-hub/account-settings-sidebar.js +1 -1
  214. package/dist/internal/account-hub/hub-sheet.d.ts +9 -1
  215. package/dist/internal/account-hub/hub-sheet.js +21 -5
  216. package/dist/internal/account-hub/sections.d.ts +1 -1
  217. package/dist/internal/account-hub/sections.js +2 -1
  218. package/dist/internal/apps-and-extensions/apps-modal.d.ts +9 -0
  219. package/dist/internal/apps-and-extensions/apps-modal.js +107 -0
  220. package/dist/internal/auth/auth-card-shell.js +3 -3
  221. package/dist/internal/chrome/browser-icon.d.ts +24 -0
  222. package/dist/internal/chrome/browser-icon.js +58 -0
  223. package/dist/internal/chrome/chrome-card-state.d.ts +16 -0
  224. package/dist/internal/chrome/chrome-card-state.js +9 -0
  225. package/dist/internal/chrome/chrome-connect.d.ts +69 -0
  226. package/dist/internal/chrome/chrome-connect.js +178 -0
  227. package/dist/internal/chrome/chrome-mock.d.ts +4 -0
  228. package/dist/internal/chrome/chrome-mock.js +15 -0
  229. package/dist/internal/chrome/chrome-names.d.ts +15 -0
  230. package/dist/internal/chrome/chrome-names.js +35 -0
  231. package/dist/internal/chrome/extension.d.ts +47 -0
  232. package/dist/internal/chrome/extension.js +91 -0
  233. package/dist/internal/chrome/use-chrome-offered.d.ts +11 -0
  234. package/dist/internal/chrome/use-chrome-offered.js +22 -0
  235. package/dist/internal/components/agent-mark.js +5 -2
  236. package/dist/internal/connector-logo/connector-logo-source.d.ts +64 -0
  237. package/dist/internal/connector-logo/connector-logo-source.js +49 -0
  238. package/dist/internal/connector-logo/connector-logo.d.ts +39 -0
  239. package/dist/internal/connector-logo/connector-logo.js +56 -0
  240. package/dist/internal/connector-logo/connector-mark-files.d.ts +11 -0
  241. package/dist/internal/connector-logo/connector-mark-files.js +35 -0
  242. package/dist/internal/files/file-read-retry.d.ts +13 -0
  243. package/dist/internal/files/file-read-retry.js +23 -3
  244. package/dist/internal/files/session-drive-files.d.ts +5 -1
  245. package/dist/internal/files/session-drive-files.js +7 -2
  246. package/dist/internal/hooks/channels/use-channels-installations.d.ts +32 -5
  247. package/dist/internal/hooks/channels/use-channels-installations.js +55 -7
  248. package/dist/internal/hooks/channels/use-email-inboxes.d.ts +19 -0
  249. package/dist/internal/hooks/channels/use-email-inboxes.js +48 -0
  250. package/dist/internal/hooks/connectors/use-add-account.js +1 -1
  251. package/dist/internal/hooks/index.d.ts +1 -1
  252. package/dist/internal/hooks/index.js +1 -1
  253. package/dist/internal/hooks/projects/use-new-project-session.d.ts +9 -0
  254. package/dist/internal/hooks/projects/use-new-project-session.js +28 -12
  255. package/dist/internal/hooks/use-auto-scroll.d.ts +8 -1
  256. package/dist/internal/hooks/use-auto-scroll.js +4 -4
  257. package/dist/internal/icons/edge.d.ts +5 -0
  258. package/dist/internal/icons/edge.js +10 -0
  259. package/dist/internal/icons/telegram.d.ts +5 -0
  260. package/dist/internal/icons/telegram.js +6 -1
  261. package/dist/internal/layout/nav-hover-card.d.ts +35 -0
  262. package/dist/internal/layout/nav-hover-card.js +84 -0
  263. package/dist/internal/layout/project-nav-row.d.ts +3 -1
  264. package/dist/internal/layout/project-nav-row.js +3 -2
  265. package/dist/internal/layout/project-page-header.d.ts +4 -2
  266. package/dist/internal/layout/project-page-header.js +4 -3
  267. package/dist/internal/layout/project-settings-nav.js +59 -2
  268. package/dist/internal/lib/browser-error-noise.d.ts +1 -1
  269. package/dist/internal/lib/browser-error-noise.js +1 -1
  270. package/dist/internal/lib/browser-noise/rules/extensions.js +17 -3
  271. package/dist/internal/lib/browser-noise/rules/injected-scripts.d.ts +7 -0
  272. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +15 -0
  273. package/dist/internal/lib/detect-os.d.ts +43 -0
  274. package/dist/internal/lib/detect-os.js +70 -0
  275. package/dist/internal/lib/manifest-version.d.ts +1 -1
  276. package/dist/internal/lib/manifest-version.js +2 -2
  277. package/dist/internal/lib/memory-href.d.ts +16 -0
  278. package/dist/internal/lib/memory-href.js +46 -0
  279. package/dist/internal/lib/use-project-feature-flags.js +13 -9
  280. package/dist/internal/lib/utils/heic-convert.d.ts +1 -1
  281. package/dist/internal/lib/utils/heic-convert.js +3 -4
  282. package/dist/internal/lib/web-notifications.d.ts +20 -0
  283. package/dist/internal/lib/web-notifications.js +48 -4
  284. package/dist/internal/notifications/notification-bell.d.ts +4 -1
  285. package/dist/internal/notifications/notification-bell.js +2 -2
  286. package/dist/internal/selection/selection-bar.d.ts +2 -1
  287. package/dist/internal/selection/selection-bar.js +1 -1
  288. package/dist/internal/stores/apps-modal-store.d.ts +8 -0
  289. package/dist/internal/stores/apps-modal-store.js +6 -0
  290. package/dist/internal/stores/composer-prefill-store.d.ts +12 -5
  291. package/dist/internal/stores/file-preview-store.d.ts +29 -2
  292. package/dist/internal/stores/file-preview-store.js +19 -1
  293. package/dist/internal/stores/kortix-computer-store.js +3 -0
  294. package/dist/internal/stores/sidebar-nav-store.d.ts +1 -1
  295. package/dist/internal/stores/sidebar-nav-store.js +3 -1
  296. package/dist/lib/routes.d.ts +13 -1
  297. package/dist/lib/routes.js +13 -0
  298. package/dist/markdown/index.d.ts +2 -1
  299. package/dist/markdown/index.js +2 -1
  300. package/dist/markdown/setup-links/approval-decision.d.ts +1 -0
  301. package/dist/markdown/setup-links/approval-decision.js +9 -3
  302. package/dist/markdown/setup-links/connector-handshake.d.ts +3 -1
  303. package/dist/markdown/setup-links/connector-handshake.js +12 -10
  304. package/dist/markdown/setup-links/secret-intake-form.d.ts +0 -10
  305. package/dist/markdown/setup-links/secret-intake-form.js +1 -1
  306. package/dist/markdown/setup-links/show-connect-hero.d.ts +28 -0
  307. package/dist/markdown/setup-links/show-connect-hero.js +91 -0
  308. package/dist/markdown/unified-markdown.js +5 -5
  309. package/dist/primitives/badge.d.ts +1 -1
  310. package/dist/primitives/badge.js +2 -0
  311. package/dist/primitives/disclosure.js +14 -2
  312. package/dist/primitives/empty-art.d.ts +12 -0
  313. package/dist/primitives/empty-art.js +11 -0
  314. package/dist/primitives/empty-state.d.ts +2 -2
  315. package/dist/primitives/empty-state.js +6 -5
  316. package/dist/primitives/mermaid-renderer.d.ts +2 -0
  317. package/dist/primitives/mermaid-renderer.js +21 -15
  318. package/dist/primitives/resizable.js +6 -1
  319. package/dist/primitives/resize-seam.d.ts +11 -0
  320. package/dist/primitives/resize-seam.js +12 -0
  321. package/dist/primitives/sidebar-panel.js +4 -7
  322. package/dist/primitives/tabs.d.ts +14 -1
  323. package/dist/primitives/tabs.js +1 -1
  324. package/dist/providers/ui-provider.d.ts +9 -0
  325. package/dist/session/composer/ComposerAboveCard.d.ts +1 -1
  326. package/dist/session/composer/ComposerAboveCard.js +2 -2
  327. package/dist/session/composer/ComposerCard.d.ts +1 -1
  328. package/dist/session/composer/ComposerCard.js +3 -3
  329. package/dist/session/composer/agent-selector.d.ts +13 -1
  330. package/dist/session/composer/agent-selector.js +25 -5
  331. package/dist/session/composer/composer-agent-access.d.ts +15 -0
  332. package/dist/session/composer/composer-agent-access.js +27 -0
  333. package/dist/session/composer/composer-chat-input.d.ts +8 -2
  334. package/dist/session/composer/composer-chat-input.js +8 -6
  335. package/dist/session/composer/composer-logic.d.ts +16 -0
  336. package/dist/session/composer/composer-logic.js +12 -0
  337. package/dist/session/composer/composer-underbar.d.ts +3 -1
  338. package/dist/session/composer/composer-underbar.js +4 -3
  339. package/dist/session/composer/composer.d.ts +15 -1
  340. package/dist/session/composer/composer.js +19 -1
  341. package/dist/session/composer/draft/composer-draft.d.ts +6 -2
  342. package/dist/session/composer/draft/composer-draft.js +5 -1
  343. package/dist/session/composer/reasoning-effort-selector.js +1 -1
  344. package/dist/session/models/chatgpt-connection-button.d.ts +11 -0
  345. package/dist/session/models/chatgpt-connection-button.js +54 -0
  346. package/dist/session/models/model-selector.js +5 -2
  347. package/dist/session/models/use-model-connection-gate.d.ts +5 -5
  348. package/dist/session/models/use-model-connection-gate.js +5 -5
  349. package/dist/session/outcomes/jump-to-outcome.d.ts +10 -0
  350. package/dist/session/outcomes/jump-to-outcome.js +11 -0
  351. package/dist/session/outcomes/session-outcomes-bridge.d.ts +14 -0
  352. package/dist/session/outcomes/session-outcomes-bridge.js +12 -0
  353. package/dist/session/outcomes/session-outcomes-provider.d.ts +3 -1
  354. package/dist/session/outcomes/session-outcomes-provider.js +33 -3
  355. package/dist/session/panel/easy/app-preview.d.ts +10 -0
  356. package/dist/session/panel/easy/app-preview.js +31 -12
  357. package/dist/session/panel/easy/change-requests-card.d.ts +7 -0
  358. package/dist/session/panel/easy/change-requests-card.js +17 -0
  359. package/dist/session/panel/easy/easy-panel-logic.js +7 -1
  360. package/dist/session/panel/easy/easy-panel.js +5 -2
  361. package/dist/session/panel/easy/file-preview.js +1 -1
  362. package/dist/session/panel/easy/outputs-card.d.ts +2 -1
  363. package/dist/session/panel/easy/outputs-card.js +3 -2
  364. package/dist/session/panel/mobile-tool-drawer.js +7 -1
  365. package/dist/session/panel/session-audit-panel.js +9 -2
  366. package/dist/session/panel/session-audit-shared.js +3 -1
  367. package/dist/session/panel/session-detail-panel.js +9 -3
  368. package/dist/session/panel/session-files-explorer.d.ts +9 -0
  369. package/dist/session/panel/session-files-explorer.js +12 -3
  370. package/dist/session/panel/session-panel-provider.d.ts +15 -1
  371. package/dist/session/panel/session-panel-provider.js +32 -7
  372. package/dist/session/panel/shared/derive-panels.d.ts +8 -1
  373. package/dist/session/panel/shared/derive-panels.js +12 -2
  374. package/dist/session/panel/shared/output-priority.js +2 -0
  375. package/dist/session/participants/session-participants.d.ts +8 -2
  376. package/dist/session/participants/session-participants.js +11 -4
  377. package/dist/session/prompts/approval-request.d.ts +5 -0
  378. package/dist/session/prompts/approval-request.js +9 -1
  379. package/dist/session/prompts/session-approval-review.d.ts +9 -0
  380. package/dist/session/prompts/session-approval-review.js +18 -0
  381. package/dist/session/status/session-error-banner.js +2 -49
  382. package/dist/session/status/session-starting-loader.d.ts +14 -2
  383. package/dist/session/status/session-starting-loader.js +16 -4
  384. package/dist/session/thread/after-first-prompt.d.ts +7 -0
  385. package/dist/session/thread/after-first-prompt.js +8 -0
  386. package/dist/session/thread/detect-command.d.ts +12 -0
  387. package/dist/session/thread/detect-command.js +20 -0
  388. package/dist/session/thread/session-chat.d.ts +3 -1
  389. package/dist/session/thread/session-chat.js +377 -252
  390. package/dist/session/thread/session-thread.d.ts +15 -1
  391. package/dist/session/thread/session-thread.js +20 -3
  392. package/dist/session/thread/session-transcript-class.d.ts +5 -1
  393. package/dist/session/thread/session-transcript-class.js +5 -1
  394. package/dist/session/thread/thread-boot-rows.d.ts +36 -0
  395. package/dist/session/thread/thread-boot-rows.js +89 -0
  396. package/dist/session/thread/transcript-rows.d.ts +31 -0
  397. package/dist/session/thread/transcript-rows.js +3 -0
  398. package/dist/session/thread/transcript.d.ts +0 -9
  399. package/dist/session/thread/transcript.js +104 -19
  400. package/dist/session/tool/shared/infrastructure-contexts.d.ts +28 -0
  401. package/dist/session/tool/shared/infrastructure-contexts.js +31 -3
  402. package/dist/session/tool/tool-part-renderer.d.ts +5 -4
  403. package/dist/session/tool/tool-part-renderer.js +8 -3
  404. package/dist/session/tool/tools/bash-tool.js +7 -6
  405. package/dist/session/tool/tools/channel-send-card.d.ts +1 -2
  406. package/dist/session/tool/tools/channel-send.d.ts +2 -1
  407. package/dist/session/tool/tools/codemode-tool.js +1 -1
  408. package/dist/session/tool/tools/connector-tools.js +1 -1
  409. package/dist/session/tool/tools/image-gen-tool.d.ts +1 -1
  410. package/dist/session/tool/tools/image-gen-tool.js +241 -53
  411. package/dist/session/tool/tools/show-tool.js +19 -8
  412. package/dist/session/turn/channel-brand.d.ts +8 -3
  413. package/dist/session/turn/channel-brand.js +20 -4
  414. package/dist/session/turn/message-author.d.ts +8 -0
  415. package/dist/session/turn/message-author.js +24 -0
  416. package/dist/session/turn/message-row.d.ts +52 -0
  417. package/dist/session/turn/message-row.js +44 -0
  418. package/dist/session/turn/plan-anchor.d.ts +1 -1
  419. package/dist/session/turn/plan-anchor.js +1 -1
  420. package/dist/session/turn/user-message.d.ts +14 -6
  421. package/dist/session/turn/user-message.js +35 -15
  422. package/dist/styles.css +1 -1
  423. package/dist/workspace/home/access-requests-bell.d.ts +9 -2
  424. package/dist/workspace/home/access-requests-bell.js +20 -6
  425. package/dist/workspace/home/first-chat.d.ts +8 -21
  426. package/dist/workspace/home/first-chat.js +22 -72
  427. package/dist/workspace/index.d.ts +6 -0
  428. package/dist/workspace/index.js +6 -0
  429. package/dist/workspace/layout/project-home.d.ts +14 -2
  430. package/dist/workspace/layout/project-home.js +60 -21
  431. package/dist/workspace/layout/use-project-home-send.d.ts +9 -1
  432. package/dist/workspace/layout/use-project-home-send.js +82 -3
  433. package/dist/workspace/memory/body-doc.d.ts +17 -0
  434. package/dist/workspace/memory/body-doc.js +208 -0
  435. package/dist/workspace/memory/body-extensions.d.ts +38 -0
  436. package/dist/workspace/memory/body-extensions.js +103 -0
  437. package/dist/workspace/memory/company-memory-page.d.ts +8 -0
  438. package/dist/workspace/memory/company-memory-page.js +16 -0
  439. package/dist/workspace/memory/memory-all.d.ts +20 -0
  440. package/dist/workspace/memory/memory-all.js +27 -0
  441. package/dist/workspace/memory/memory-body.d.ts +19 -0
  442. package/dist/workspace/memory/memory-body.js +139 -0
  443. package/dist/workspace/memory/memory-empty.d.ts +13 -0
  444. package/dist/workspace/memory/memory-empty.js +28 -0
  445. package/dist/workspace/memory/memory-history.d.ts +27 -0
  446. package/dist/workspace/memory/memory-history.js +108 -0
  447. package/dist/workspace/memory/memory-labels.d.ts +16 -0
  448. package/dist/workspace/memory/memory-labels.js +47 -0
  449. package/dist/workspace/memory/memory-page-list.d.ts +34 -0
  450. package/dist/workspace/memory/memory-page-list.js +156 -0
  451. package/dist/workspace/memory/memory-reader.d.ts +58 -0
  452. package/dist/workspace/memory/memory-reader.js +123 -0
  453. package/dist/workspace/memory/memory-view.d.ts +21 -0
  454. package/dist/workspace/memory/memory-view.js +124 -0
  455. package/dist/workspace/memory/remember-popover.d.ts +19 -0
  456. package/dist/workspace/memory/remember-popover.js +61 -0
  457. package/dist/workspace/memory/remember-this.d.ts +12 -0
  458. package/dist/workspace/memory/remember-this.js +89 -0
  459. package/dist/workspace/memory/source-mark.d.ts +18 -0
  460. package/dist/workspace/memory/source-mark.js +79 -0
  461. package/dist/workspace/memory/used-memory-chip.d.ts +14 -0
  462. package/dist/workspace/memory/used-memory-chip.js +61 -0
  463. package/dist/workspace/new/advanced-fields.d.ts +2 -1
  464. package/dist/workspace/new/advanced-fields.js +2 -2
  465. package/dist/workspace/new/source-param.d.ts +1 -1
  466. package/dist/workspace/new/source-param.js +3 -1
  467. package/dist/workspace/new/use-create-workspace.d.ts +8 -10
  468. package/dist/workspace/new/use-create-workspace.js +3 -3
  469. package/dist/workspace/projects/onboarding/app-logo.d.ts +7 -2
  470. package/dist/workspace/projects/onboarding/app-logo.js +6 -13
  471. package/dist/workspace/projects/policies-panel.js +5 -3
  472. package/dist/workspace/review/review-actions.d.ts +4 -2
  473. package/dist/workspace/review/review-actions.js +8 -2
  474. package/dist/workspace/review/review-center.js +11 -7
  475. package/dist/workspace/review/review-detail.d.ts +10 -0
  476. package/dist/workspace/review/review-detail.js +101 -13
  477. package/dist/workspace/saved-session-skeleton.d.ts +2 -2
  478. package/dist/workspace/saved-session-skeleton.js +3 -3
  479. package/dist/workspace/session-workspace.js +15 -13
  480. package/dist/workspace/sessions/project-sessions-view.js +3 -2
  481. package/dist/workspace/sessions/session-label-badges.js +2 -1
  482. package/dist/workspace/sessions/sessions-toolbar.d.ts +3 -1
  483. package/dist/workspace/sessions/sessions-toolbar.js +2 -2
  484. package/dist/workspace/sidebar/footer/project-apps-nav.d.ts +5 -0
  485. package/dist/workspace/sidebar/footer/project-apps-nav.js +41 -2
  486. package/dist/workspace/sidebar/footer/project-artifacts-nav.d.ts +6 -0
  487. package/dist/workspace/sidebar/footer/project-artifacts-nav.js +22 -0
  488. package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +10 -0
  489. package/dist/workspace/sidebar/footer/project-chrome-nav.js +56 -0
  490. package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.js +13 -13
  491. package/dist/workspace/sidebar/footer/project-memory-nav.d.ts +7 -0
  492. package/dist/workspace/sidebar/footer/project-memory-nav.js +19 -0
  493. package/dist/workspace/sidebar/nav-row-meta.js +14 -2
  494. package/dist/workspace/sidebar/project-nav-items.js +3 -0
  495. package/dist/workspace/sidebar/project-session-list.js +68 -56
  496. package/dist/workspace/sidebar/project-sidebar.js +13 -2
  497. package/dist/workspace/sidebar/project-spaces-nav.d.ts +8 -0
  498. package/dist/workspace/sidebar/project-spaces-nav.js +69 -0
  499. package/dist/workspace/sidebar/session-group-order.d.ts +9 -0
  500. package/dist/workspace/sidebar/session-group-order.js +25 -0
  501. package/dist/workspace/sidebar/session-group-sections.d.ts +62 -0
  502. package/dist/workspace/sidebar/session-group-sections.js +267 -0
  503. package/dist/workspace/sidebar/session-list-chrome.d.ts +28 -0
  504. package/dist/workspace/sidebar/session-list-chrome.js +50 -0
  505. package/dist/workspace/spaces/channel-glyph.d.ts +5 -0
  506. package/dist/workspace/spaces/channel-glyph.js +6 -0
  507. package/dist/workspace/spaces/channel-setup.d.ts +16 -0
  508. package/dist/workspace/spaces/channel-setup.js +105 -0
  509. package/dist/workspace/spaces/channels-onboarding.d.ts +13 -0
  510. package/dist/workspace/spaces/channels-onboarding.js +37 -0
  511. package/dist/workspace/spaces/create-channel-dialog.d.ts +16 -0
  512. package/dist/workspace/spaces/create-channel-dialog.js +158 -0
  513. package/dist/workspace/spaces/private-channels-not-in.d.ts +9 -0
  514. package/dist/workspace/spaces/private-channels-not-in.js +69 -0
  515. package/dist/workspace/spaces/space-agents.d.ts +10 -0
  516. package/dist/workspace/spaces/space-agents.js +10 -0
  517. package/dist/workspace/spaces/space-details-dialog.d.ts +20 -0
  518. package/dist/workspace/spaces/space-details-dialog.js +176 -0
  519. package/dist/workspace/spaces/space-link-label.d.ts +49 -0
  520. package/dist/workspace/spaces/space-link-label.js +73 -0
  521. package/dist/workspace/spaces/space-links.d.ts +19 -0
  522. package/dist/workspace/spaces/space-links.js +230 -0
  523. package/dist/workspace/spaces/space-members.d.ts +46 -0
  524. package/dist/workspace/spaces/space-members.js +182 -0
  525. package/dist/workspace/spaces/space-roster.d.ts +15 -0
  526. package/dist/workspace/spaces/space-roster.js +44 -0
  527. package/dist/workspace/spaces/space-threads-tab.d.ts +56 -0
  528. package/dist/workspace/spaces/space-threads-tab.js +156 -0
  529. package/dist/workspace/spaces/space-timeline-view.d.ts +254 -0
  530. package/dist/workspace/spaces/space-timeline-view.js +235 -0
  531. package/dist/workspace/spaces/space-timeline.d.ts +106 -0
  532. package/dist/workspace/spaces/space-timeline.js +183 -0
  533. package/dist/workspace/spaces/space-triggers.d.ts +13 -0
  534. package/dist/workspace/spaces/space-triggers.js +78 -0
  535. package/dist/workspace/spaces/space-view.d.ts +37 -0
  536. package/dist/workspace/spaces/space-view.js +436 -0
  537. package/package.json +67 -36
  538. package/skills/kortix-ui/SKILL.md +3 -3
  539. package/skills/kortix-ui/references/custom-dashboard.md +3 -3
  540. package/skills/kortix-ui/references/modules.md +29 -5
  541. package/skills/kortix-ui/references/theming.md +1 -1
  542. package/dist/customize/connectors/catalog/merge-search.d.ts +0 -10
  543. package/dist/customize/connectors/catalog/merge-search.js +0 -26
  544. package/dist/customize/connectors/detail/find-easy-connect-app.d.ts +0 -29
  545. package/dist/customize/connectors/detail/find-easy-connect-app.js +0 -22
  546. package/dist/customize/migrate-to-v2/use-migrate-to-v2.d.ts +0 -9
  547. package/dist/customize/migrate-to-v2/use-migrate-to-v2.js +0 -24
  548. package/dist/customize/sections/connector-connection-header.d.ts +0 -36
  549. package/dist/customize/sections/connector-connection-header.js +0 -33
  550. package/dist/customize/sections/connector-connection-modal.d.ts +0 -34
  551. package/dist/customize/sections/connector-connection-modal.js +0 -72
  552. package/dist/customize/sections/discover-catalogue-card.d.ts +0 -19
  553. package/dist/customize/sections/discover-catalogue-card.js +0 -26
  554. package/dist/customize/sections/discover-catalogue-detail.d.ts +0 -15
  555. package/dist/customize/sections/discover-catalogue-detail.js +0 -24
  556. package/dist/customize/sections/discover-catalogue.d.ts +0 -17
  557. package/dist/customize/sections/discover-catalogue.js +0 -132
  558. package/dist/customize/sections/llm-provider/provider-access-menu.d.ts +0 -10
  559. package/dist/customize/sections/llm-provider/provider-access-menu.js +0 -23
  560. package/dist/files/project/components/drive-empty-art.d.ts +0 -2
  561. package/dist/files/project/components/drive-empty-art.js +0 -5
  562. package/dist/internal/hooks/use-media-query.d.ts +0 -2
  563. package/dist/internal/share/public-share-link-button.d.ts +0 -14
  564. package/dist/internal/share/public-share-link-button.js +0 -17
  565. package/dist/markdown/setup-links/app-credentials-form.d.ts +0 -12
  566. package/dist/markdown/setup-links/app-credentials-form.js +0 -115
  567. /package/dist/{internal/hooks → hooks}/use-media-query.js +0 -0
@@ -1,261 +1,59 @@
1
1
  /**
2
- * The seed prompt for "Migrate to v2" — a normal agent session does the
3
- * conversion because it's just files + git (Marko's framing). We start a
4
- * fresh session with this as the first message; the project's default agent
5
- * reads the repo, rewrites the manifest, and opens a change request for a
6
- * human to review. Nothing here merges anything — that's the whole point of
7
- * routing config changes through the same CR path as any other edit.
2
+ * The seed prompt for "Upgrade manifest to v3": a normal agent session does
3
+ * the conversion, because it is files and git. Upgrading starts a fresh
4
+ * session with this as the first message; the project's default agent runs
5
+ * `kortix migrate`, checks what it cannot know, and opens a change request for
6
+ * a human to review. Nothing here merges anything.
8
7
  *
9
- * Simplified by the 2026-07-05 redirect ("one home per concern"): v1's `.md` frontmatter
10
- * IS already valid v2 OpenCode behavior — a stock OpenCode agent file, no
11
- * Kortix-specific split. The manifest side therefore touches ONLY governance
12
- * (kortix.toml's `[[agents]]` → kortix.yaml's `agents:` map). The same change
13
- * request also moves the project to the root layout (`agents/`, `skills/`,
14
- * `memory/`, `harnesses/opencode/`; see `@kortix/manifest-schema/layout`):
15
- * each agent's `.md` moves with `git mv`, and only its old path references
16
- * change.
8
+ * `kortix migrate` (apps/cli/src/commands/migrate.ts) holds the conversion
9
+ * rules for kortix_version 1 and 2, so this prompt carries only what the tool
10
+ * cannot decide: the marketplace baseline, the checks after the conversion, the
11
+ * old folders, validation and the landing contract.
17
12
  *
18
- * The prompt carries the ENTIRE v1→v2 contract inline — every clean-break the
19
- * v2 validator enforces, a worked before/after example, and pointers to the
20
- * canonical JSON Schema (`kortix schema --version 2` in the sandbox, or the
21
- * published kortix.com/schema documents) — so the agent never has to guess at
22
- * the target shape and `kortix validate` passes on the first try.
23
- *
24
- * Kept as a plain exported constant (not inlined at the call site) so it's
25
- * independently testable and diffable — this is the load-bearing artifact of
26
- * the feature, not the wiring around it.
27
- * @deprecated Moves a v1 project to the OpenCode-era v2 layout (harnesses/opencode). OpenCode is sunset (2026-10-23); migrate with `kortix migrate` to kortix_version 3.
13
+ * `kortix projects upgrade` (apps/cli/src/commands/projects.ts) sends a
14
+ * verbatim copy. `projects-parity.test.ts` fails when the two differ.
28
15
  */
29
- export const MIGRATE_TO_V2_PROMPT = `Migrate this project's manifest from kortix_version 1 (kortix.toml) to kortix_version 2 (kortix.yaml), and move its files to the root layout. Read everything first, then make the change, then land it as a change request — do not merge it yourself.
30
-
31
- ## 1. Read before you write
32
-
33
- - The current manifest: \`kortix.toml\` (or \`kortix.yaml\` if this project already partially moved — check \`kortix_version\` at the top either way).
34
- - Any \`[[agents]]\` entries in the v1 manifest — these carry \`connectors\`, \`kortix_permissions\` (older manifests spell it \`kortix_cli\`), and \`env\` grants per agent name. An agent name with NO \`[[agents]]\` entry at all is today unrestricted (v1's back-compat default is "all" when a grant key is omitted).
35
- - \`.kortix/opencode/opencode.jsonc\` — if it sets a top-level \`default_agent\`, that is the project's existing default; use it. If it doesn't, pick the agent whose \`.kortix/opencode/agents/*.md\` frontmatter has \`mode: primary\` and reads as the general/primary one (usually the first-created or the one with the broadest permissions). Record which you picked and why in the change request description — a human reviews this before it merges, so a defensible choice beats blocking on it.
36
- - **You do NOT need to read each agent's \`.md\` frontmatter to migrate it.** v1's frontmatter (mode/model/temperature/permission/prompt/…) is ALREADY valid v2 OpenCode behavior — its content stays unchanged. Only the file moves (section 5). The manifest conversion is governance-only.
37
- - The current layout: v1 projects keep agents in \`.kortix/opencode/agents/\`, skills in \`.kortix/opencode/skills/\`, the other OpenCode files in \`.kortix/opencode/\`, and memory in \`.kortix/memory/\`. A v1 manifest that sets \`opencode.config_dir\` uses that directory instead of \`.kortix/opencode\`.
38
-
39
- ## 2. Bring the platform baseline up to date first
16
+ export const MIGRATE_TO_V3_PROMPT = `Upgrade this project's manifest to kortix_version 3 (kortix.yaml). Check \`kortix_version\` at the top of the manifest first: kortix_version 1 is \`kortix.toml\`, 2 and 3 are \`kortix.yaml\`. On kortix_version 3 there is nothing to upgrade: say so and stop. Land the upgrade as a change request — do not merge it yourself.
40
17
 
41
- A project still on a v1 manifest is usually also running stale platform skills. Refresh them BEFORE touching the manifest so the migration lands on a current baseline:
18
+ ## 1. Bring the platform baseline up to date first
42
19
 
43
- 1. \`kortix marketplace updates\` — a hash-diff report of every marketplace-tracked item (the kortix-managed skills like \`kortix-system\`/\`kortix-memory\`, plus any marketplace skills the user installed).
44
- 2. If updates are listed, apply them: \`kortix marketplace update --all\`. **This commits directly to \`main\` through the platform's own hash-safe update path — it is intentionally NOT part of your change request.** It only rewrites files whose installed hash no longer matches the catalog, so untouched user files are never clobbered.
20
+ 1. \`kortix marketplace updates\` — a hash-diff report of every marketplace-tracked item (the Kortix-managed skills, plus any marketplace skills the user installed).
21
+ 2. If updates are listed, apply them: \`kortix marketplace update --all\`. **This commits directly to \`main\` through the platform's own hash-safe update path — it is intentionally NOT part of your change request.**
45
22
  3. Sync your session branch on top of the refreshed main: \`git fetch origin && git rebase origin/main\`.
46
23
  4. Items reported as \`orphaned\` (no longer in the catalog) are not updatable — leave them alone and mention them in the change request description.
47
- 5. Marketplace-tracked items are the ONLY thing you refresh this way. Do NOT hand-update anything else "to latest": agents' \`.md\` files, the memory directory, \`opencode.jsonc\`, the continuation plugin, \`tools/*.ts\`, and custom skills are user- or platform-owned files with no update tracking — leave every one of them untouched. Section 5 moves some of them and rewrites their old paths; that is the only change they get.
48
-
49
- ## 3. The authoritative schema is one command away
50
-
51
- Whenever you are unsure about a field name, an allowed value, or whether a key survived into v2, consult the canonical JSON Schema instead of guessing:
52
-
53
- - \`kortix schema --version 2\` — prints the exact v2 schema the validator and the CR-merge gate enforce. Works offline inside your sandbox. \`kortix schema --version 1\` prints the v1 shape you are migrating FROM.
54
- - The same documents are published at \`https://kortix.com/schema/kortix.v2.schema.json\` (and \`kortix.v1.schema.json\`, plus the combined \`kortix.schema.json\` that dispatches on \`kortix_version\`).
55
-
56
- The schema, this prompt, and \`kortix validate\` all enforce the same rules — if they ever appear to disagree, trust \`kortix validate\`'s output and say so in the change request description.
57
-
58
- ## 4. The v2 shape you're producing
59
-
60
- v2's \`agents:\` map is GOVERNANCE ONLY — connectors/secrets/skills/kortix_permissions/workspace/enabled. OpenCode behavior (mode/model/temperature/permission/the prompt itself) is NOT part of the manifest at all; it lives entirely in each agent's own \`.md\` frontmatter + body, exactly as it does today. After section 5 that file is \`agents/<name>.md\`, and the agent's \`file:\` key names it.
61
-
62
- \`\`\`yaml
63
- kortix_version: 2
64
- default_agent: <name> # REQUIRED — must resolve to a declared, enabled agent below
65
-
66
- agents:
67
- <name>:
68
- file: agents/<name>.md # the agent's .md, repo-relative (section 5 moves it there)
69
- enabled: true # optional; false = can't start sessions (default true)
70
- connectors: all # connector slugs | "all" | "none"
71
- secrets: all # renamed from v1's "env" — names | "all" | "none"
72
- kortix_permissions: all # project.* permission names | "all" | "none"
73
- skills: all # names of skills/* this agent may invoke | "all" | "none"
74
- workspace:
75
- project_repository: false # optional — true (default) | false
76
- \`\`\`
77
-
78
- That's the WHOLE block. No \`description\`, no \`model\`, no \`opencode:\` sub-object, no \`mode\`/\`temperature\`/\`permission\`/\`prompt\` — every one of those is a hard schema error if authored here. They already live in the \`.md\` and are staying there.
79
-
80
- Rules that the schema enforces (get these right or \`kortix validate\` fails):
81
-
82
- - \`agents\` is a MAP (\`name: {...}\`), not the v1 \`[[agents]]\` array of tables.
83
- - \`default_agent\` is required at the top level and must name a declared, enabled (\`enabled\` not \`false\`) agent.
84
- - Any behavioral field (\`description\`, \`model\`, \`mode\`, \`temperature\`, \`top_p\`, \`steps\`, \`variant\`, \`color\`, \`hidden\`, \`permission\`, \`prompt\`, or a nested \`opencode:\` block) authored on the manifest agent block is a hard error, pointing you at the agent's own \`.md\` frontmatter instead — because that's where it already lives, untouched.
85
- - \`disable\` is a hard error too — it's the manifest-governance \`enabled\` (inverted): write \`enabled: false\` instead. (This is unrelated to a NATIVE \`disable\` key that might already be hand-authored in an agent's own \`.md\` frontmatter — leave that alone; it's a different, runtime-level concept.)
86
- - \`env\` is a hard error in v2 — it is renamed \`secrets\`. **v2 defaults every omitted grant (\`connectors\`/\`secrets\`/\`kortix_permissions\`/\`skills\`) to \`"none"\` (deny-by-default), unlike v1 which defaulted an omitted grant to \`"all"\`.** To avoid silently narrowing an agent's access during migration, write the EXPLICIT value that reproduces today's behavior for every agent — if a v1 agent had no \`[[agents]]\` entry, or its \`env\`/\`connectors\`/\`kortix_cli\` (or \`kortix_permissions\`) were omitted or set to \`all\`, write \`secrets: all\`, \`connectors: all\`, \`kortix_permissions: all\` explicitly in its v2 block. Only narrow a grant if the v1 manifest already narrowed it (an explicit list, or \`none\`) — carry that exact list over. \`skills\` has no v1 equivalent; default new agents to \`all\` unless you have a specific reason to narrow.
87
- - \`channels\` is removed entirely in v2 — delete any \`[[channels]]\` block. Channel↔agent routing now lives in the dashboard (Customize → Channels), not in git. Do not try to replicate it in the manifest.
88
- - Every other top-level section (\`project\`, \`env\` for required/optional documentation vars — NOT the per-agent grant, \`sandbox\`, \`triggers\`, \`connectors\`, \`apps\`) keeps its v1 shape unchanged — translated to YAML, not restructured. \`opencode.config_dir\` is the one exception: section 5 sets it. If \`triggers[].agent\` names an agent, make sure that name still exists in the new \`agents\` map (rename references if you renamed an agent).
89
- - If an agent has no \`.md\` today (a bare \`[[agents]]\` entry with no matching OpenCode agent file), still declare it in \`agents:\` with its governance grants carried over — don't drop it. Omit its \`file:\` key. It has no behavior until someone adds \`agents/<name>.md\`.
90
-
91
- ## 5. Move to the root layout
92
-
93
- v2 projects keep harness-neutral files at the repo root. Move this project in the same change request. Use \`git mv\`, so git records every move as a rename and keeps each file's history.
94
-
95
- | From | To |
96
- | --- | --- |
97
- | \`.kortix/opencode/agents/<name>.md\` | \`agents/<name>.md\` |
98
- | \`.kortix/opencode/skills/<name>/\` | \`skills/<name>/\` |
99
- | \`.kortix/memory/\` | \`memory/\` |
100
- | the rest of \`.kortix/opencode/\` (\`opencode.jsonc\`, \`package.json\`, \`bun.lock\`, \`plugins/\`, \`tools/\`, \`commands/\`) | \`harnesses/opencode/\` |
101
-
102
- If the v1 manifest sets \`opencode.config_dir\`, that directory is the source instead of \`.kortix/opencode\`. Skip a row when its source does not exist.
103
-
104
- \`\`\`
105
- mkdir -p harnesses
106
- git mv .kortix/opencode/agents agents
107
- git mv .kortix/opencode/skills skills
108
- git mv .kortix/memory memory
109
- git mv .kortix/opencode harnesses/opencode
110
- \`\`\`
111
-
112
- \`git mv <dir> <target>\` moves \`<dir>\` INTO \`<target>\` when \`<target>\` already exists. Check each target with \`ls\` first. When it exists, move the entries one at a time (\`git mv .kortix/opencode/skills/<name> skills/<name>\`).
113
-
114
- Then:
115
-
116
- 1. Set the OpenCode config dir in \`kortix.yaml\`: \`opencode:\` with \`config_dir: harnesses/opencode\`.
117
- 2. Give every agent whose \`.md\` you moved a \`file:\` key: \`file: agents/<name>.md\`.
118
- 3. Update \`.gitignore\`: rewrite each \`.kortix/opencode/<path>\` entry as \`harnesses/opencode/<path>\`, and each \`.kortix/memory/<path>\` entry as \`memory/<path>\`. Keep \`.kortix/state/\` — runtime state stays there.
119
- 4. Find every remaining reference to an old path: \`git grep -n -e '.kortix/opencode' -e '.kortix/memory'\`. Replace each one with its new path. For example, \`tools/memory.ts\` hard-codes \`.kortix/memory\`, and agent prompts often name it. Change only the path. Leave \`.kortix/state/\` and \`.kortix/link.json\` references alone.
120
-
121
- Edge cases:
122
-
123
- - A root \`agents/\`, \`memory/\`, or \`harnesses/\` directory that already holds files unrelated to Kortix: do not merge into it. Skip this whole section, steps 1–4 included, keep the legacy layout (Kortix still reads it), and say why in the change request description.
124
- - A skill that already exists in \`skills/<name>/\` (the marketplace update in section 2 can install it there): keep the root copy and remove the legacy copy with \`git rm -r\`.
125
-
126
- ## 6. Legacy keys v2 refuses — drop these while you convert
127
-
128
- v1 tolerates several retired keys with a deprecation warning; v2 makes every one of them a hard error. Remove them as part of the conversion and note each removal in the change request description:
129
-
130
- - **Retired \`kortix_permissions\` actions** — \`project.session.exec\`, \`project.gateway.routing.edit\`, \`project.schedule.read\`, \`project.schedule.write\`, \`project.webhook.read\`, \`project.webhook.write\`, \`channel.read\`, \`channel.connect\`, \`channel.send\`, \`channel.disconnect\`. These were removed from the enforcement catalog and have been no-ops for a while — granting or omitting them never had any effect, so deleting them from a grant list changes nothing. Do NOT substitute a broader grant (e.g. \`all\`) to "cover" a deleted action.
131
- - **\`credential = "per_user"\` on a \`[[connectors]]\` entry** — the per-user credential mode was removed; every connector is \`"shared"\` now. Delete the \`credential\` key (or write \`shared\` explicitly if the entry already spelled it out).
132
- - **\`agent_scope\` on a \`[[connectors]]\` entry** — retired; the runtime no longer reads it. Per-agent connector access is expressed from the OTHER side now: each agent's \`connectors:\` grant in the \`agents:\` map. If a v1 connector had \`agent_scope = ["a", "b"]\`, make sure agents outside that list don't get that connector slug in their \`connectors\` grant (use an explicit slug list instead of \`all\` for the agents that should keep access), then delete the key.
133
- - **Legacy singular \`[sandbox]\` image keys** (\`image\`, \`dockerfile\`, \`cpu\`, \`memory\`, \`disk\`, …) — already an error in v1's validator; if \`kortix validate\` flags them, move the image definition under \`[[sandbox.templates]]\` → \`sandbox.templates:\` with a named slug.
134
-
135
- ## 7. Worked example
136
-
137
- A representative v1 \`kortix.toml\`:
138
-
139
- \`\`\`toml
140
- kortix_version = 1
141
-
142
- [project]
143
- name = "acme-ops"
144
-
145
- [env]
146
- required = ["DATABASE_URL"]
147
-
148
- [[agents]]
149
- name = "dev"
150
- connectors = ["github", "linear"]
151
- env = "all"
152
- kortix_cli = ["project.file.read", "project.file.write", "project.session.exec"]
153
-
154
- [[agents]]
155
- name = "support"
156
- # no grants declared — v1 treats omitted grants as "all"
157
-
158
- [[channels]]
159
- type = "slack"
160
- agent = "support"
161
-
162
- [[triggers]]
163
- slug = "weekly-summary"
164
- type = "cron"
165
- cron = "0 9 * * 1"
166
- agent = "dev"
167
- prompt = "Post the weekly summary."
168
-
169
- [[connectors]]
170
- slug = "github"
171
- provider = "github"
172
- credential = "per_user"
173
- agent_scope = ["dev"]
174
- \`\`\`
175
-
176
- becomes this v2 \`kortix.yaml\`:
177
-
178
- \`\`\`yaml
179
- kortix_version: 2
180
- default_agent: dev
181
-
182
- project:
183
- name: acme-ops
184
-
185
- env:
186
- required:
187
- - DATABASE_URL
188
-
189
- opencode:
190
- config_dir: harnesses/opencode
191
-
192
- agents:
193
- dev:
194
- file: agents/dev.md
195
- connectors:
196
- - github
197
- - linear
198
- secrets: all # v1 "env = all", renamed
199
- kortix_permissions: # renamed from v1's kortix_cli; project.session.exec dropped — retired no-op action
200
- - project.file.read
201
- - project.file.write
202
- skills: all
203
- support:
204
- file: agents/support.md
205
- # v1 had no grants (implicit all) — but the github connector was
206
- # agent_scoped to dev only, so "all" would WIDEN support's access.
207
- # An explicit list preserves today's effective behavior instead.
208
- connectors: none
209
- secrets: all
210
- kortix_permissions: all
211
- skills: all
212
-
213
- triggers:
214
- - slug: weekly-summary
215
- type: cron
216
- cron: "0 9 * * 1"
217
- agent: dev
218
- prompt: Post the weekly summary.
219
-
220
- connectors:
221
- - slug: github
222
- provider: github
223
- # credential/agent_scope removed — connectors are shared; per-agent
224
- # access now lives in the agents map above.
225
- \`\`\`
226
-
227
- Note what happened: the \`[[channels]]\` block is gone (dashboard-owned now), each agent names its moved \`.md\` with \`file:\`, \`opencode.config_dir\` points at \`harnesses/opencode\`, \`env\` became \`secrets\`, the retired CLI action and connector keys were dropped, every omitted-in-v1 grant was written out explicitly, and the old \`agent_scope\` was honored by adjusting the AGENTS' \`connectors\` grants rather than copied over. Your project will differ — apply the rules, not this output verbatim.
228
24
 
229
- ## 8. Leave every agent's \`.md\` alone
25
+ ## 2. Convert with kortix migrate
230
26
 
231
- Beyond the move and the path updates in section 5, do not edit or reformat any agent's \`.md\` as part of this migration. Its frontmatter (mode/model/permission/temperature/…) and body (the system prompt) are ALREADY the agent's v2 behavior — nothing else about them needs to change. This is what keeps the manifest conversion governance-only and comparatively small: you're translating one array-of-tables into one map of governance grants, full stop.
27
+ 1. Run \`kortix migrate\`. It prints the plan, the new \`kortix.yaml\`, a "Not carried over" list, and whether the result validates. It changes nothing.
28
+ 2. Run \`kortix migrate --write\`. It writes the v3 \`kortix.yaml\`, moves each agent's behavior out of its \`.md\` frontmatter into its \`agents.<name>\` block, keeps the prompt in the \`.md\` as its \`prompt_file\`, and deletes \`kortix.toml\` and \`opencode.json(c)\`. It refuses a result that does not validate: fix what it reports, then run it again.
29
+ 3. Carry over by hand each "Not carried over" item that has a v3 key. \`kortix schema --version 3\` prints the exact schema. List each item that has no v3 key in the change request description; do not invent a key for it.
232
30
 
233
- ## 9. Write the file, remove the old one
31
+ ## 3. Check what kortix migrate cannot decide
234
32
 
235
- - Write the fully assembled manifest to \`kortix.yaml\` at the repo root (same directory as the old \`kortix.toml\`).
236
- - If the project has more than ~10 triggers, or long multi-line prompts, keep \`kortix.yaml\` readable: add \`imports: [triggers/]\` to the root and write the triggers into YAML files under \`triggers/\` (one file per trigger or per group; each file is a \`triggers:\` list). Every other key stays in \`kortix.yaml\`. Slugs must stay unique across all files.
237
- - Carry over meaningful TOML comments as YAML comments next to the same keys — hand-written context in a manifest is documentation someone chose to leave; don't strip it.
238
- - Delete the old \`kortix.toml\` in the same commit — don't leave both files (the platform always prefers \`kortix.yaml\` when both exist, but a stale v1 file next to it is confusing for the next person who edits by hand).
239
- - You do not need to touch any project setting outside git — the platform resolves \`kortix.yaml\` automatically once it exists, regardless of the configured manifest filename.
33
+ - **Grants.** v3 grants are deny-by-default. Every agent must keep the access it has today: \`skills\`, \`subagents\`, \`commands\`, \`extensions\`, \`connectors\`, \`secrets\`, \`kortix_permissions\` and \`workspace: { project_repository: true }\` for an agent that works in the repository. Never widen a grant to cover a key you removed.
34
+ - **The default agent.** \`default_agent\` must name a declared agent with \`mode: primary\` or \`all\`. A kortix_version 1 project takes it from \`opencode.jsonc\`, else from its first agent. Confirm the choice and record it and the reason in the change request description.
35
+ - **Old folders.** v3 reads no harness folder: \`harnesses/\` and \`.kortix/opencode/\` are not read. Move every file that a registry or a \`prompt_file\` still names there to the root folders (\`agents/\`, \`skills/\`, \`tools/\`, \`commands/\`, \`extensions/\`) with \`git mv\`, and update the path in \`kortix.yaml\`. From kortix_version 1, also run \`git mv .kortix/memory memory\`. Keep \`.kortix/state/\` and \`.kortix/link.json\`. Then delete what is left: \`git rm -r harnesses/\` or \`git rm -r .kortix/opencode/\`.
36
+ - **OpenCode-only extensions.** Every new session runs pi, and pi loads only an extension's \`pi:\` implementation. \`kortix migrate\` turns each OpenCode plugin into an extension with only an \`opencode:\` implementation (under \`extensions/opencode/\`), which never loads. Remove each such extension from \`extensions\` and from every agent's \`extensions\` grant, and \`git rm -r\` its files. List each one in the change request description; when it did something the project needs, say that a pi extension (\`pi:\`) replaces it.
37
+ - **Old paths.** Run \`git grep -n -e '.kortix/opencode' -e '.kortix/memory' -e 'harnesses/'\` and replace each old path with the new one, in prompts, skills, tools and \`.gitignore\`. Change only the path.
240
38
 
241
- ## 10. Validate before you're done
39
+ ## 4. Validate before you are done
242
40
 
243
- Run \`kortix validate\` (it auto-detects \`kortix.yaml\`). Fix every error it reports — do not open the change request with a manifest that fails validation. Warnings are fine to leave if they're informational, but read them. If an error surprises you, cross-check the field against \`kortix schema --version 2\`.
41
+ Run \`kortix validate\`. Fix every error it reports. Do not open the change request with a manifest that fails validation.
244
42
 
245
- ## 11. Land it as a change request — never merge
43
+ ## 5. Land it as a change request — never merge
246
44
 
247
- First, re-sync: \`git fetch origin\` and check whether \`origin/main\` advanced while you worked (\`git log HEAD..origin/main --oneline\`) — on active projects it will (connectors added from the dashboard, other sessions merging). If it moved, rebase; if the rebase conflicts on \`kortix.toml\` (main changed the manifest you deleted), don't fight it — \`git rebase --abort\`, \`git reset --hard origin/main\`, and redo the conversion against the CURRENT manifest, then continue. Never revert main's changes to win a conflict.
45
+ First, re-sync: \`git fetch origin\` and check whether \`origin/main\` advanced while you worked (\`git log HEAD..origin/main --oneline\`). If it moved, rebase. If the rebase conflicts on the manifest or a moved file, \`git rebase --abort\`, \`git reset --hard origin/main\`, and redo the conversion against the current files. Never revert main's changes to win a conflict.
248
46
 
249
- Then commit, **push the branch**, and open the change request. A commit that is never pushed leaves the CR empty ("No changes detected") and un-appliable — the platform refuses such a CR outright (\`422 CR_HEAD_NOT_AHEAD\`):
47
+ Then commit, **push the branch**, and open the change request. A commit that is never pushed leaves the CR empty (\`422 CR_HEAD_NOT_AHEAD\`):
250
48
 
251
49
  \`\`\`
252
- git add -A && git commit -m "Migrate to kortix_version 2 (kortix.yaml) and the root layout"
50
+ git add -A && git commit -m "Upgrade to kortix_version 3"
253
51
  git push origin HEAD
254
- kortix cr open --head <your-branch> --title "Migrate to kortix_version 2 (kortix.yaml) and the root layout" --description "<what you converted, which files you moved, which agent you picked as default_agent and why, every legacy key you removed, and any grant you had to leave narrowed>"
52
+ kortix cr open --head <your-branch> --title "Upgrade to kortix_version 3" --description "<the default agent and why, every file you moved or removed, each agent's grants, every item kortix migrate did not carry over and why>"
255
53
  \`\`\`
256
54
 
257
55
  If the push is rejected because the remote session branch moved, \`git fetch origin\` then \`git push --force-with-lease origin HEAD\` — your own session branch only, never any other branch.
258
56
 
259
- Then verify the CR actually carries your diff: run \`kortix cr diff <number>\` — if it reports no changes, your push didn't land; push again and re-check (the CR updates automatically, do not open a second one).
57
+ Then run \`kortix cr diff <number>\`. If it reports no changes, your push did not land; push again and re-check (the CR updates automatically, do not open a second one).
260
58
 
261
- Do **not** run \`kortix cr merge\`. This is a human-reviewed change like any other — stop once the CR is open and verified non-empty, and tell the user its number so they can review the diff and merge it themselves.`;
59
+ Do **not** run \`kortix cr merge\`. Stop once the CR is open and verified non-empty, and tell the user its number so they can review the diff and merge it themselves.`;
@@ -6,7 +6,7 @@
6
6
  * review (never merged by the agent). Adding a new upgrade = adding an entry
7
7
  * here; the view renders whatever is applicable.
8
8
  */
9
- import type { ManifestVersion } from '../../internal/lib/manifest-version.js';
9
+ import { type ManifestVersion } from '../../internal/lib/manifest-version.js';
10
10
  export interface ProjectUpgradeContext {
11
11
  /** `null` while the manifest read hasn't resolved. */
12
12
  manifestVersion: ManifestVersion | null;
@@ -6,14 +6,15 @@
6
6
  * review (never merged by the agent). Adding a new upgrade = adding an entry
7
7
  * here; the view renders whatever is applicable.
8
8
  */
9
- import { MIGRATE_TO_V2_PROMPT } from './migration-prompt.js';
9
+ import { manifestNeedsUpgrade } from '../../internal/lib/manifest-version.js';
10
+ import { MIGRATE_TO_V3_PROMPT } from './migration-prompt.js';
10
11
  export const PROJECT_UPGRADES = [
11
12
  {
12
- id: 'manifest-v2',
13
- title: 'Migrate manifest to v2 (kortix.yaml)',
14
- description: 'Converts the v1 kortix.toml into the governance-first kortix.yaml, refreshes platform-managed skills to the latest marketplace baseline, and opens a change request for review.',
15
- applicable: (ctx) => ctx.manifestVersion === 1,
16
- prompt: MIGRATE_TO_V2_PROMPT,
13
+ id: 'manifest-v3',
14
+ title: 'Upgrade manifest to v3 (kortix.yaml)',
15
+ description: 'Moves kortix.toml or a version 2 kortix.yaml to version 3: the project registers skills, tools, commands and extensions, and each agent enables them by name. Refreshes platform-managed skills and opens a change request for review.',
16
+ applicable: (ctx) => manifestNeedsUpgrade(ctx.manifestVersion),
17
+ prompt: MIGRATE_TO_V3_PROMPT,
17
18
  },
18
19
  ];
19
20
  export function applicableUpgrades(ctx) {
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  * halves:
6
6
  *
7
7
  * 1. The registry (`upgrade-defs.ts`): known upgrades with a detection rule
8
- * (today: the v1→v2 manifest migration). Rows appear only while
8
+ * (today: the v1/v2 → v3 manifest upgrade). Rows appear only while
9
9
  * applicable and disappear for good once done.
10
10
  * 2. A freeform one-off runner: describe a single change ("bump X",
11
11
  * "restructure Y") and a session makes it and opens a change request —
@@ -95,9 +95,9 @@ export const DEFAULT_UPGRADES_COPY = {
95
95
  oneOffPlaceholder: "e.g. Rename the release-bot agent to deploy-bot everywhere it's referenced",
96
96
  runUpgrade: 'Run upgrade',
97
97
  upgrades: {
98
- 'manifest-v2': {
99
- title: 'Migrate manifest to v2 (kortix.yaml)',
100
- description: 'Converts the v1 kortix.toml into the governance-first kortix.yaml, refreshes platform-managed skills to the latest marketplace baseline, and opens a change request for review.',
98
+ 'manifest-v3': {
99
+ title: 'Upgrade manifest to v3 (kortix.yaml)',
100
+ description: 'Moves kortix.toml or a version 2 kortix.yaml to version 3: the project registers skills, tools, commands and extensions, and each agent enables them by name. Refreshes platform-managed skills and opens a change request for review.',
101
101
  },
102
102
  },
103
103
  };
@@ -143,9 +143,9 @@ export function UpgradesView({ projectId }) {
143
143
  oneOffPlaceholder: t('oneOffPlaceholder'),
144
144
  runUpgrade: t('runUpgrade'),
145
145
  upgrades: {
146
- 'manifest-v2': {
147
- title: t('manifestV2.title'),
148
- description: t('manifestV2.description'),
146
+ 'manifest-v3': {
147
+ title: t('manifestV3.title'),
148
+ description: t('manifestV3.description'),
149
149
  },
150
150
  },
151
151
  } }));
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * useRunUpgrade — start any agent-led upgrade session from Customize: mint a
3
3
  * fresh session, stash the given prompt as its first message, close the
4
- * overlay, and drop the user into the thread. The generic engine behind both
5
- * the registry entries in `upgrade-defs.ts` and the one-off prompt runner;
6
- * `useMigrateToV2` is the v2-specific wrapper kept for its button.
4
+ * overlay, and drop the user into the thread. The engine behind the registry
5
+ * entries in `upgrade-defs.ts`, the one-off prompt runner and the sidebar
6
+ * upgrade alert.
7
7
  *
8
8
  * Deliberately does NOT pass `agent_name` — the session boots the project's
9
9
  * default agent (the one with git/CR powers).
@@ -24,10 +24,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
24
24
  * The pieces under `// ─── View` are pure (props only) so they render under
25
25
  * `renderToStaticMarkup`; `ProviderAccordion` owns every hook.
26
26
  */
27
- import { ArrowSquareOutIcon, CaretDownIcon, MagnifyingGlassIcon, XIcon, } from '@phosphor-icons/react';
27
+ import { ArrowSquareOutIcon, CaretDownIcon, CreditCardIcon, MagnifyingGlassIcon, XIcon, } from '@phosphor-icons/react';
28
28
  import { useMemo, useState } from 'react';
29
29
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '../../primitives/alert-dialog.js';
30
30
  import { Button } from '../../primitives/button.js';
31
+ import { useModelConnectionGate } from '../../session/models/use-model-connection-gate.js';
31
32
  import { Input } from '../../primitives/input.js';
32
33
  import { InputGroupSearch, InputGroupSearchClear, InputGroupSearchIcon, InputGroupSearchInput, } from '../../primitives/input-group.js';
33
34
  import Loading from '../../primitives/loading.js';
@@ -152,6 +153,14 @@ function SignInSubRows({ projectId, entry, canWrite, }) {
152
153
  ? t('signingIn', { name: sub.name })
153
154
  : `${t('subscription', { plan: sub.plan })} · ${t('notConnected')}` }), waiting ? (_jsx("div", { className: "border-border border-t py-3", children: _jsx(DeviceCode, { name: sub.name, code: sign.challenge?.code ?? null, url: sign.challenge?.url ?? null, onCopy: copyCode }) })) : null, sign.error ? (_jsx("p", { role: "alert", className: "text-destructive pb-1.5 text-xs text-pretty", children: sign.error })) : null, _jsx(AlertDialog, { open: confirmDisconnect, onOpenChange: setConfirmDisconnect, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: t('disconnectTitle', { plan: sub.plan }) }), _jsx(AlertDialogDescription, { children: t('disconnectBody') })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: t('cancel') }), _jsx(AlertDialogAction, { variant: "destructive", disabled: sign.disconnect.isPending, onClick: () => sign.disconnect.mutate(), children: t('disconnect') })] })] }) })] }));
154
155
  }
156
+ /** Opens the plan dialog. Nothing when billing is off: no plan to sell. */
157
+ function ManagedUpgradeButton({ projectId }) {
158
+ const t = useTranslations('sessionUi.modelGate');
159
+ const { openUpgrade, showUpgradeOption } = useModelConnectionGate(undefined, { projectId });
160
+ if (!showUpgradeOption)
161
+ return null;
162
+ return (_jsxs(Button, { type: "button", size: "xs", className: "shrink-0", onClick: openUpgrade, children: [_jsx(CreditCardIcon, { className: "size-3.5 shrink-0" }), t('upgrade')] }));
163
+ }
155
164
  /** What an open card holds, by how the provider connects. */
156
165
  function ExpandedBody({ projectId, entry, status, keyConnected, canWrite, enabled, pooled, }) {
157
166
  const t = useTranslations('providerSheet');
@@ -161,7 +170,13 @@ function ExpandedBody({ projectId, entry, status, keyConnected, canWrite, enable
161
170
  const enable = status !== 'none' ? (_jsx(EnableSubRow, { projectId: projectId, entry: entry, canWrite: canWrite, enabled: enabled })) : null;
162
171
  let content;
163
172
  if (method === 'included' || (entry.envVars.length === 0 && !SUBSCRIPTION_BY_PROVIDER[entry.id])) {
164
- content = _jsx(AccordionSubRow, { children: entry.hint });
173
+ content = (_jsx(AccordionSubRow
174
+ // Kortix with no servable model is the upgrade story: the row says so,
175
+ // so it carries the way out too.
176
+ , {
177
+ // Kortix with no servable model is the upgrade story: the row says so,
178
+ // so it carries the way out too.
179
+ action: entry.managed && entry.models.length === 0 ? _jsx(ManagedUpgradeButton, { projectId: projectId }) : null, children: entry.hint }));
165
180
  }
166
181
  else if (pooled.pooledSecretsEnabled && pooled.accountId && entry.id === 'openai') {
167
182
  content = (_jsxs("div", { className: "border-border space-y-3 border-t py-3", children: [_jsx("p", { className: "text-foreground text-xs font-medium", children: tPooled('chatGptAccounts') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "codex", providerName: "ChatGPT Plus/Pro", envVar: "CODEX_AUTH_JSON", canWrite: true, oauth: { projectId, onConnected: () => undefined } }), _jsx(ChatGptSubscriptionConnect, { projectId: projectId, onConnected: () => undefined, legacyOnly: true })] }));
@@ -0,0 +1,16 @@
1
+ import { type ChannelAccessPlatform, type ChannelUser } from '../../../internal/hooks/channels/use-channels-installations.js';
2
+ /** What differs per platform. The `copy` values are `connectorPages` keys. */
3
+ export declare const CHANNEL_ACCESS: Record<ChannelAccessPlatform, {
4
+ /** One typed user id, trimmed. Null for anything else. */
5
+ parseUserId: (raw: string) => string | null;
6
+ idPlaceholder: string;
7
+ idInputMode: 'numeric' | 'text';
8
+ copy: Record<'descriptionKey' | 'emptyDescription' | 'loadError' | 'addByIdHint' | 'addByIdInvalid' | 'removeDescription', string>;
9
+ }>;
10
+ /** First and last name, else @username, else the id. */
11
+ export declare function channelUserName(user: Pick<ChannelUser, 'user_id' | 'username' | 'first_name' | 'last_name'>): string;
12
+ export declare function ChannelAccessPanel({ projectId, platform, onDone, }: {
13
+ projectId: string;
14
+ platform: ChannelAccessPlatform;
15
+ onDone: () => void;
16
+ }): import("react").JSX.Element;
@@ -0,0 +1,146 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ /**
4
+ * Who may talk to a project's chat bot, as cards: the people who messaged
5
+ * the bot and wait to be allowed, the allowed users, and an add-by-ID field.
6
+ * Every action saves at once. The API adds or removes one id per call, so two
7
+ * admins never overwrite each other's list. `CHANNEL_ACCESS` holds what differs
8
+ * per platform. Its copy keys stay in this file, which binds `connectorPages`,
9
+ * so scripts/gen-i18n-catalog.mjs copies them into the bundled catalog.
10
+ */
11
+ import { AccessRow } from '../../../access/access/access-row.js';
12
+ import { Button } from '../../../primitives/button.js';
13
+ import { ConfirmDialog } from '../../../primitives/confirm-dialog.js';
14
+ import { CountBadge } from '../../../primitives/count-badge.js';
15
+ import { EmptyArt } from '../../../primitives/empty-art.js';
16
+ import { EmptyState } from '../../../primitives/empty-state.js';
17
+ import { ErrorState } from '../../../primitives/error-state.js';
18
+ import { Field, FieldDescription, FieldLabel } from '../../../primitives/field.js';
19
+ import { Input } from '../../../primitives/input.js';
20
+ import { ModalBody, ModalDescription, ModalFooter, ModalHeader, ModalTitle } from '../../../primitives/modal.js';
21
+ import { Skeleton } from '../../../primitives/skeleton.js';
22
+ import { errorToast } from '../../../primitives/toast.js';
23
+ import { UserAvatar } from '../../../primitives/user-avatar.js';
24
+ import { useAllowChannelUser, useChannelUserPhoto, useChannelUsers, useDismissChannelAccessRequest, useRemoveChannelUser, } from '../../../internal/hooks/channels/use-channels-installations.js';
25
+ import { useTranslations } from '../../../i18n/index.js';
26
+ import { CHANNELS } from '../../../_vendor/kortix-shared.js';
27
+ import { UsersIcon } from '@phosphor-icons/react';
28
+ import { useEffect, useId, useRef, useState } from 'react';
29
+ /** What differs per platform. The `copy` values are `connectorPages` keys. */
30
+ export const CHANNEL_ACCESS = {
31
+ telegram: {
32
+ parseUserId: (raw) => {
33
+ const id = raw.trim();
34
+ return CHANNELS.telegram.access.userId.test(id) ? id : null;
35
+ },
36
+ idPlaceholder: CHANNELS.telegram.access.idPlaceholder,
37
+ idInputMode: CHANNELS.telegram.access.idInputMode,
38
+ copy: {
39
+ descriptionKey: 'telegramUsersDescription',
40
+ emptyDescription: 'telegramUsersEmptyDescription',
41
+ loadError: 'telegramUsersLoadError',
42
+ addByIdHint: 'telegramAddByIdHint',
43
+ addByIdInvalid: 'telegramAddByIdInvalid',
44
+ removeDescription: 'telegramRemoveDescription',
45
+ },
46
+ },
47
+ };
48
+ /** First and last name, else @username, else the id. */
49
+ export function channelUserName(user) {
50
+ const full = [user.first_name, user.last_name].filter(Boolean).join(' ').trim();
51
+ return full || (user.username ? `@${user.username}` : user.user_id);
52
+ }
53
+ const onError = (error) => errorToast(error.message);
54
+ export function ChannelAccessPanel({ projectId, platform, onDone, }) {
55
+ const t = useTranslations('hardcodedUi.i18nComplete');
56
+ const tPages = useTranslations('connectorPages');
57
+ const { copy } = CHANNEL_ACCESS[platform];
58
+ const users = useChannelUsers(projectId, platform, true);
59
+ const remove = useRemoveChannelUser(platform);
60
+ const [removing, setRemoving] = useState(null);
61
+ const [confirmOpen, setConfirmOpen] = useState(false);
62
+ const allowedHeading = useRef(null);
63
+ const requests = users.data?.requests ?? [];
64
+ const allowed = users.data?.allowed ?? [];
65
+ const removingName = removing ? channelUserName(removing) : '';
66
+ return (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: t.raw('text2c3059c25723') }), _jsx(ModalDescription, { children: tPages(copy.descriptionKey) })] }), _jsxs(ModalBody, { children: [users.isError && !users.data ? (_jsx(ErrorState, { size: "sm", title: tPages(copy.loadError), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void users.refetch(), children: t.raw('textd8b8392e2c54') }) })) : (
67
+ // The lists scroll; the add field and the footer stay put. Capped like
68
+ // the channel list in channels-view.tsx, so the footer stays on screen
69
+ // at the 720 × 480 desktop minimum, where this modal is a bottom sheet.
70
+ _jsxs("div", { className: "max-h-[min(45vh,calc(100dvh-21rem))] space-y-4 overflow-y-auto", children: [requests.length > 0 ? (_jsxs("section", { className: "space-y-2", children: [_jsxs("h3", { className: "text-muted-foreground flex items-center gap-2 px-1 text-xs font-medium", children: [tPages('channelAccessRequestsTitle'), _jsx(CountBadge, { count: requests.length, tone: "waiting" })] }), _jsx("ul", { className: "space-y-2", children: requests.map((user) => (_jsx(RequestRow, { projectId: projectId, platform: platform, user: user }, user.user_id))) })] })) : null, _jsxs("section", { className: "space-y-2", children: [_jsxs("h3", { ref: allowedHeading, tabIndex: -1, className: "text-muted-foreground flex items-center gap-2 px-1 text-xs font-medium outline-none", children: [tPages('channelAccessAllowedTitle'), allowed.length > 0 ? _jsx(CountBadge, { count: allowed.length }) : null] }), users.isPending ? (_jsxs("div", { className: "space-y-2", children: [_jsx(Skeleton, { className: "h-12" }), _jsx(Skeleton, { className: "h-12" })] })) : allowed.length === 0 ? (_jsx(EmptyState, { size: "sm", media: _jsx(EmptyArt, { icon: UsersIcon }), title: tPages('channelAccessEmptyTitle'), description: tPages(copy.emptyDescription) })) : (_jsx("ul", { className: "space-y-2", children: allowed.map((user) => {
71
+ const name = channelUserName(user);
72
+ return (_jsx(ChannelUserRow, { projectId: projectId, platform: platform, user: user, pending: remove.isPending && remove.variables?.userId === user.user_id, kebabLabel: t('text33da220b1a34', { value0: name }), kebab: [
73
+ {
74
+ label: t.raw('textc3812fc4acb8'),
75
+ variant: 'destructive',
76
+ onSelect: () => {
77
+ setRemoving(user);
78
+ setConfirmOpen(true);
79
+ },
80
+ },
81
+ ] }, user.user_id));
82
+ }) }))] })] })), _jsx(AddByIdField, { projectId: projectId, platform: platform })] }), _jsx(ModalFooter, { className: "pt-2 pb-5", children: _jsx(Button, { type: "button", variant: "outline-ghost", onClick: onDone, children: t.raw('text11a6767d5674') }) }), _jsx(ConfirmDialog, { open: confirmOpen, onOpenChange: setConfirmOpen, title: tPages('channelAccessRemoveTitle', { name: removingName }), description: tPages(copy.removeDescription, { name: removingName }), confirmLabel: t.raw('textc3812fc4acb8'), confirmVariant: "destructive", isPending: remove.isPending, onConfirm: () => {
83
+ if (!removing)
84
+ return;
85
+ remove.mutate({ projectId, userId: removing.user_id }, {
86
+ onSuccess: () => {
87
+ setConfirmOpen(false);
88
+ allowedHeading.current?.focus();
89
+ },
90
+ onError,
91
+ });
92
+ } })] }));
93
+ }
94
+ function RequestRow({ projectId, platform, user, }) {
95
+ const t = useTranslations('hardcodedUi.i18nComplete');
96
+ const tPages = useTranslations('connectorPages');
97
+ const allow = useAllowChannelUser(platform);
98
+ const dismiss = useDismissChannelAccessRequest(platform);
99
+ const name = channelUserName(user);
100
+ const busy = allow.isPending || dismiss.isPending;
101
+ const vars = { projectId, userId: user.user_id };
102
+ return (_jsx(ChannelUserRow, { projectId: projectId, platform: platform, user: user, pending: busy, actions: _jsx(Button, { size: "sm", disabled: busy, "aria-busy": allow.isPending, "aria-label": tPages('channelAccessAllowAria', { name }), onClick: () => allow.mutate(vars, { onError }), children: t.raw('texte213c161d5ce') }), kebabLabel: t('text33da220b1a34', { value0: name }), kebab: [{ label: t.raw('text48845bff334a'), onSelect: () => dismiss.mutate(vars, { onError }) }] }));
103
+ }
104
+ /** One person as an access card: photo or initials, name, @username, the id in mono. */
105
+ function ChannelUserRow({ projectId, platform, user, ...row }) {
106
+ const name = channelUserName(user);
107
+ const nameIsId = name === user.user_id;
108
+ const handle = user.username ? `@${user.username}` : null;
109
+ return (_jsx(AccessRow, { leading: _jsx(ChannelUserAvatar, { projectId: projectId, platform: platform, user: user, name: name }), title: nameIsId ? _jsx("span", { className: "font-mono tabular-nums", children: name }) : name, metaParts: [
110
+ handle && handle !== name ? handle : null,
111
+ nameIsId ? null : _jsx("span", { className: "font-mono tabular-nums", children: user.user_id }),
112
+ ].filter(Boolean), ...row }));
113
+ }
114
+ function ChannelUserAvatar({ projectId, platform, user, name, }) {
115
+ const { data: photo } = useChannelUserPhoto(projectId, platform, user.user_id, user.photo_version, true);
116
+ const [url, setUrl] = useState(null);
117
+ // The object URL lives as long as this blob: a new photo or an unmount revokes it.
118
+ useEffect(() => {
119
+ if (!photo)
120
+ return;
121
+ const next = URL.createObjectURL(photo);
122
+ setUrl(next);
123
+ return () => {
124
+ URL.revokeObjectURL(next);
125
+ setUrl(null);
126
+ };
127
+ }, [photo]);
128
+ // The id keys the fallback colour, as an email does for a member.
129
+ return _jsx(UserAvatar, { email: user.user_id, name: name, avatarUrl: url, size: "md" });
130
+ }
131
+ function AddByIdField({ projectId, platform }) {
132
+ const t = useTranslations('hardcodedUi.i18nComplete');
133
+ const tPages = useTranslations('connectorPages');
134
+ const { parseUserId, idPlaceholder, idInputMode, copy } = CHANNEL_ACCESS[platform];
135
+ const allow = useAllowChannelUser(platform);
136
+ const inputId = useId();
137
+ const [value, setValue] = useState('');
138
+ const id = parseUserId(value);
139
+ const invalid = value.trim() !== '' && !id;
140
+ return (_jsx("form", { onSubmit: (event) => {
141
+ event.preventDefault();
142
+ if (!id)
143
+ return;
144
+ allow.mutate({ projectId, userId: id }, { onSuccess: () => setValue(''), onError });
145
+ }, children: _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: inputId, children: tPages('channelAccessAddByIdLabel') }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Input, { id: inputId, size: "sm", inputMode: idInputMode, autoComplete: "off", placeholder: idPlaceholder, value: value, onChange: (event) => setValue(event.target.value), "aria-invalid": invalid }), _jsx(Button, { type: "submit", variant: "outline", disabled: !id || allow.isPending, "aria-busy": allow.isPending, children: t.raw('text9fd728c66c9a') })] }), _jsx(FieldDescription, { children: invalid ? tPages(copy.addByIdInvalid) : tPages(copy.addByIdHint) })] }) }));
146
+ }