@kortix/ui 0.15.2 → 0.15.4

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 (455) hide show
  1. package/dist/_vendor/kortix-shared.js +243 -30
  2. package/dist/_vendor/shared/channel-descriptors.d.ts +1 -1
  3. package/dist/_vendor/shared/index.d.ts +1 -0
  4. package/dist/_vendor/shared/markdown-math.d.ts +6 -0
  5. package/dist/_vendor/shared/workspace-actions.d.ts +155 -0
  6. package/dist/_vendor/shared/workspace-settings.d.ts +62 -0
  7. package/dist/access/access/access-dialog-share.js +6 -6
  8. package/dist/access/access/access-dialog.d.ts +44 -1
  9. package/dist/access/access/access-dialog.js +8 -8
  10. package/dist/access/access/agent-principals.d.ts +3 -3
  11. package/dist/access/access/agent-principals.js +5 -4
  12. package/dist/access/access/invite-people-dialog.d.ts +37 -0
  13. package/dist/access/access/invite-people-dialog.js +140 -0
  14. package/dist/access/access/principal-picker.js +3 -2
  15. package/dist/access/access/project-select.js +2 -2
  16. package/dist/access/access/role-select.d.ts +9 -8
  17. package/dist/access/access/role-select.js +22 -25
  18. package/dist/access/access/workspace-role-dialog.d.ts +27 -0
  19. package/dist/access/access/workspace-role-dialog.js +48 -0
  20. package/dist/access/iam/add-github-account-dialog.d.ts +1 -1
  21. package/dist/access/iam/add-github-account-dialog.js +1 -1
  22. package/dist/access/iam/api-key-expiry.d.ts +18 -0
  23. package/dist/access/iam/api-key-expiry.js +47 -0
  24. package/dist/access/iam/api-key-rows.d.ts +6 -0
  25. package/dist/access/iam/api-key-rows.js +3 -0
  26. package/dist/access/iam/workspace-key-acts-as.d.ts +41 -0
  27. package/dist/access/iam/workspace-key-acts-as.js +48 -0
  28. package/dist/access/sharing-intent.js +1 -1
  29. package/dist/access/sharing-picker.js +1 -1
  30. package/dist/animated-copy-icon.d.ts +2 -2
  31. package/dist/animated-copy-icon.js +7 -4
  32. package/dist/apps/app-shared.js +2 -2
  33. package/dist/artifacts/artifact-session.js +1 -1
  34. package/dist/customize/agents/agent-drives-section.d.ts +1 -3
  35. package/dist/customize/agents/agent-drives-section.js +5 -6
  36. package/dist/customize/agents/agent-page-chrome.js +1 -1
  37. package/dist/customize/agents/agent-page.js +6 -7
  38. package/dist/customize/agents/agent-tabs.d.ts +1 -1
  39. package/dist/customize/agents/agent-tabs.js +1 -2
  40. package/dist/customize/agents/agents-page.js +2 -3
  41. package/dist/customize/connectors/connector-identity.d.ts +1 -1
  42. package/dist/customize/connectors/connector-identity.js +1 -1
  43. package/dist/customize/connectors/connector-moves-banner.js +2 -2
  44. package/dist/customize/connectors/connectors-page.d.ts +10 -2
  45. package/dist/customize/connectors/connectors-page.js +38 -5
  46. package/dist/customize/connectors/detail/app-page.js +1 -1
  47. package/dist/customize/connectors/detail/connector-page.d.ts +1 -1
  48. package/dist/customize/connectors/detail/connector-page.js +1 -1
  49. package/dist/customize/connectors/detail/connector-policy-sets.js +2 -2
  50. package/dist/customize/connectors/detail/connector-tools.js +7 -7
  51. package/dist/customize/connectors/detail/connector-triggers.js +2 -3
  52. package/dist/customize/connectors/detail/email-inboxes.js +2 -2
  53. package/dist/customize/models/models-page.d.ts +1 -1
  54. package/dist/customize/models/models-page.js +1 -1
  55. package/dist/customize/project-settings/project-admin-sections.d.ts +53 -17
  56. package/dist/customize/project-settings/project-admin-sections.js +80 -31
  57. package/dist/customize/project-settings/project-settings-page.d.ts +2 -2
  58. package/dist/customize/project-settings/project-settings-page.js +6 -4
  59. package/dist/customize/project-settings/project-settings-sections.d.ts +2 -3
  60. package/dist/customize/project-settings/project-settings-sections.js +9 -4
  61. package/dist/customize/providers/provider-accordion.d.ts +3 -1
  62. package/dist/customize/providers/provider-accordion.js +2 -2
  63. package/dist/customize/secrets/secrets-page.d.ts +1 -1
  64. package/dist/customize/secrets/secrets-page.js +1 -1
  65. package/dist/customize/sections/component/email-connect-form.js +2 -2
  66. package/dist/customize/sections/component/slack-byo-wizard.js +3 -3
  67. package/dist/customize/sections/connectors-view.js +17 -17
  68. package/dist/customize/sections/gateway-view.d.ts +7 -5
  69. package/dist/customize/sections/gateway-view.js +28 -17
  70. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +2 -2
  71. package/dist/customize/sections/llm-provider/custom-provider-form.js +2 -2
  72. package/dist/customize/sections/llm-provider/llm-provider-modal.d.ts +1 -1
  73. package/dist/customize/sections/llm-provider/llm-provider-modal.js +4 -4
  74. package/dist/customize/sections/llm-provider/models-tab-row.js +5 -3
  75. package/dist/customize/sections/llm-provider/types.d.ts +2 -0
  76. package/dist/customize/sections/view/agent-editor-access-fields.js +1 -3
  77. package/dist/customize/sections/view/agent-editor-catalog.d.ts +5 -6
  78. package/dist/customize/sections/view/agent-editor-catalog.js +33 -14
  79. package/dist/customize/sections/view/agent-editor.js +1 -1
  80. package/dist/customize/sections/view/channels-view.js +13 -13
  81. package/dist/customize/sections/view/gateway/gateway-budgets.js +12 -10
  82. package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
  83. package/dist/customize/sections/view/gateway/gateway-logs.js +3 -3
  84. package/dist/customize/sections/view/gateway/gateway-overview.js +1 -1
  85. package/dist/customize/sections/view/gateway/gateway-routing.js +1 -1
  86. package/dist/customize/sections/view/git-view.js +3 -3
  87. package/dist/customize/sections/view/grant-mode-field.js +2 -2
  88. package/dist/customize/sections/view/review-center-connected.js +1 -1
  89. package/dist/customize/sections/view/review-view.d.ts +0 -15
  90. package/dist/customize/sections/view/review-view.js +1 -23
  91. package/dist/customize/sections/view/secret-delivery.js +2 -2
  92. package/dist/customize/sections/view/secrets-view.js +16 -16
  93. package/dist/customize/sections/view/subscription-usage-tab.d.ts +12 -1
  94. package/dist/customize/sections/view/subscription-usage-tab.js +71 -72
  95. package/dist/customize/settings/rail-copy-context.js +1 -1
  96. package/dist/customize/settings/rail.d.ts +1 -1
  97. package/dist/customize/settings/rail.js +11 -18
  98. package/dist/customize/settings/settings-tab-header.d.ts +1 -1
  99. package/dist/customize/settings/settings-tab-header.js +1 -1
  100. package/dist/customize/settings/settings-tabs.d.ts +5 -12
  101. package/dist/customize/settings/settings-tabs.js +31 -44
  102. package/dist/customize/settings/tabs/experimental-tab.js +4 -4
  103. package/dist/customize/settings/tabs/general-tab.d.ts +29 -11
  104. package/dist/customize/settings/tabs/general-tab.js +55 -25
  105. package/dist/customize/settings/tabs/project-edit-patch.d.ts +0 -13
  106. package/dist/customize/settings/tabs/project-edit-patch.js +0 -28
  107. package/dist/customize/settings/tabs/sandbox-tab.js +2 -2
  108. package/dist/customize/settings/tabs/tokens-tab.d.ts +32 -2
  109. package/dist/customize/settings/tabs/tokens-tab.js +157 -32
  110. package/dist/customize/settings/tabs/workspace-keys.d.ts +6 -0
  111. package/dist/customize/settings/tabs/workspace-keys.js +240 -0
  112. package/dist/customize/shared/capability-library.js +3 -1
  113. package/dist/customize/shared/catalog/catalog-space-tabs.js +2 -2
  114. package/dist/customize/shared/customize-tab-bar.d.ts +6 -2
  115. package/dist/customize/shared/customize-tab-bar.js +36 -35
  116. package/dist/customize/shared/standalone-settings-nav.js +2 -2
  117. package/dist/customize/triggers/schedule/schedule-copy.d.ts +1 -1
  118. package/dist/customize/triggers/schedule/trigger-composer.js +5 -6
  119. package/dist/customize/triggers/schedule/trigger-list.js +2 -2
  120. package/dist/customize/triggers/schedule/trigger-session-access-copy.d.ts +6 -6
  121. package/dist/customize/triggers/schedule/trigger-session-access-copy.js +3 -3
  122. package/dist/customize/triggers/schedule/when-event.js +4 -4
  123. package/dist/customize/triggers/schedule/when-webhook-address.js +2 -2
  124. package/dist/customize/triggers/schedule/when-webhook.js +2 -2
  125. package/dist/customize/triggers/schedule-view.js +4 -5
  126. package/dist/customize/triggers/triggers-page.d.ts +1 -1
  127. package/dist/customize/triggers/triggers-page.js +1 -1
  128. package/dist/files/drives/drive-storage.d.ts +2 -2
  129. package/dist/files/drives/drive-storage.js +13 -6
  130. package/dist/files/project/components/change-request-detail-dialog.js +6 -6
  131. package/dist/files/project/components/change-requests-panel.js +2 -2
  132. package/dist/files/project/components/diff-preview-banner.d.ts +1 -1
  133. package/dist/files/project/components/diff-preview-banner.js +1 -1
  134. package/dist/files/project/components/drive-explorer.js +64 -43
  135. package/dist/files/project/components/drive-grid-view.js +1 -1
  136. package/dist/files/project/components/drive-list-view.js +1 -1
  137. package/dist/files/project/components/drive-upload-tray.d.ts +2 -1
  138. package/dist/files/project/components/drive-upload-tray.js +9 -4
  139. package/dist/files/project/context.d.ts +1 -1
  140. package/dist/files/project/context.js +1 -1
  141. package/dist/files/project/drop-tree.d.ts +16 -0
  142. package/dist/files/project/drop-tree.js +39 -0
  143. package/dist/files/project/upload-batch.d.ts +15 -0
  144. package/dist/files/project/upload-batch.js +12 -0
  145. package/dist/files/renderers/image-renderer.js +1 -1
  146. package/dist/files/runtime/hooks/use-binary-blob.js +12 -2
  147. package/dist/files/runtime/hooks/use-file-content.js +18 -2
  148. package/dist/files/viewer/file-content-renderer.js +2 -2
  149. package/dist/files/viewer/preview-fit.d.ts +1 -1
  150. package/dist/files/viewer/preview-fit.js +1 -1
  151. package/dist/i18n/en.d.ts +317 -31
  152. package/dist/i18n/en.js +882 -596
  153. package/dist/i18n/ui-catalog/account-hub-translation-keys.generated.js +9 -9
  154. package/dist/i18n/ui-catalog/app-registry-translation-keys.generated.js +12 -6
  155. package/dist/i18n/ui-catalog/product-catalog-translation-keys.generated.js +5 -5
  156. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +67 -60
  157. package/dist/icons/index.d.ts +1 -0
  158. package/dist/icons/index.js +1 -0
  159. package/dist/icons/solid-right-arrow.d.ts +8 -0
  160. package/dist/icons/solid-right-arrow.js +11 -0
  161. package/dist/index.d.ts +1 -1
  162. package/dist/index.js +1 -1
  163. package/dist/internal/account-hub/account-hub-entry.js +9 -8
  164. package/dist/internal/account-hub/account-hub-location.d.ts +20 -3
  165. package/dist/internal/account-hub/account-hub-location.js +16 -7
  166. package/dist/internal/account-hub/hub-sheet.d.ts +1 -1
  167. package/dist/internal/account-hub/hub-sheet.js +1 -1
  168. package/dist/internal/account-hub/sections.d.ts +2 -2
  169. package/dist/internal/account-hub/sections.js +10 -10
  170. package/dist/internal/account-hub/use-account-hub-access.d.ts +2 -0
  171. package/dist/internal/account-hub/use-account-hub-access.js +13 -5
  172. package/dist/internal/account-hub/workspace-settings-route.d.ts +27 -0
  173. package/dist/internal/account-hub/workspace-settings-route.js +51 -0
  174. package/dist/internal/billing/use-cost-explorer.d.ts +19 -1
  175. package/dist/internal/billing/use-cost-explorer.js +27 -1
  176. package/dist/internal/components/nav-rail.d.ts +3 -1
  177. package/dist/internal/components/nav-rail.js +2 -0
  178. package/dist/internal/components/repository-disconnected.js +2 -2
  179. package/dist/internal/desktop/desktop-back-button.d.ts +1 -1
  180. package/dist/internal/files/file-read-retry.d.ts +13 -0
  181. package/dist/internal/files/file-read-retry.js +53 -1
  182. package/dist/internal/goals/goal-meta.d.ts +2 -1
  183. package/dist/internal/goals/goal-meta.js +4 -2
  184. package/dist/internal/hooks/account/use-accounts-list.d.ts +2 -12
  185. package/dist/internal/hooks/account/use-accounts-list.js +1 -14
  186. package/dist/internal/hooks/account/use-my-invites.d.ts +1 -1
  187. package/dist/internal/hooks/account/use-my-invites.js +1 -1
  188. package/dist/internal/hooks/use-review-session-summary.d.ts +7 -0
  189. package/dist/internal/hooks/use-review-session-summary.js +12 -1
  190. package/dist/internal/layout/project-capability-nav.d.ts +6 -17
  191. package/dist/internal/layout/project-capability-nav.js +7 -79
  192. package/dist/internal/layout/project-settings-nav.d.ts +2 -2
  193. package/dist/internal/layout/project-settings-nav.js +3 -3
  194. package/dist/internal/lib/billing/billing-gate-state.d.ts +10 -0
  195. package/dist/internal/lib/billing/billing-gate-state.js +20 -3
  196. package/dist/internal/lib/browser-error-noise.d.ts +1 -1
  197. package/dist/internal/lib/browser-error-noise.js +1 -1
  198. package/dist/internal/lib/browser-noise/rules/expected-states.js +2 -3
  199. package/dist/internal/lib/browser-noise/rules/extensions.js +18 -0
  200. package/dist/internal/lib/browser-noise/rules/injected-scripts.d.ts +5 -1
  201. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +141 -5
  202. package/dist/internal/lib/capability-tab-routes.d.ts +16 -40
  203. package/dist/internal/lib/capability-tab-routes.js +25 -54
  204. package/dist/internal/lib/desktop.d.ts +1 -1
  205. package/dist/internal/lib/desktop.js +1 -1
  206. package/dist/internal/lib/github-installations.d.ts +1 -1
  207. package/dist/internal/lib/github-installations.js +1 -1
  208. package/dist/internal/lib/mermaid-utils.js +2 -24
  209. package/dist/internal/lib/model-pricing.js +1 -1
  210. package/dist/internal/lib/navigation/session-href.d.ts +1 -1
  211. package/dist/internal/lib/navigation/session-href.js +1 -1
  212. package/dist/internal/lib/onboarding/landing-destination.d.ts +12 -4
  213. package/dist/internal/lib/onboarding/landing-destination.js +17 -5
  214. package/dist/internal/lib/onboarding/last-project-cookie.d.ts +1 -1
  215. package/dist/internal/lib/onboarding/last-project-cookie.js +1 -1
  216. package/dist/internal/lib/project-actions.d.ts +1 -4
  217. package/dist/internal/lib/project-actions.js +2 -5
  218. package/dist/internal/lib/provider-branding.js +11 -3
  219. package/dist/internal/lib/use-project-can.d.ts +1 -3
  220. package/dist/internal/lib/use-project-can.js +0 -5
  221. package/dist/internal/lib/web-notifications.js +5 -5
  222. package/dist/internal/notifications/notification-inbox.d.ts +8 -2
  223. package/dist/internal/notifications/notification-inbox.js +8 -5
  224. package/dist/internal/notifications/use-inbox-summary.d.ts +8 -4
  225. package/dist/internal/notifications/use-inbox-summary.js +12 -6
  226. package/dist/internal/reminders/use-refetch-after-fire.d.ts +0 -2
  227. package/dist/internal/reminders/use-refetch-after-fire.js +1 -10
  228. package/dist/internal/stores/account-panel-store.d.ts +17 -1
  229. package/dist/internal/stores/account-panel-store.js +19 -2
  230. package/dist/internal/stores/project-switch-store.d.ts +2 -2
  231. package/dist/internal/stores/project-switch-store.js +4 -4
  232. package/dist/internal/stores/settings-panel-store.d.ts +6 -0
  233. package/dist/internal/stores/settings-panel-store.js +4 -1
  234. package/dist/internal/stores/workspace-settings-rail-store.d.ts +67 -0
  235. package/dist/internal/stores/workspace-settings-rail-store.js +11 -0
  236. package/dist/lib/routes.js +19 -18
  237. package/dist/lib/z-stack.d.ts +7 -0
  238. package/dist/lib/z-stack.js +13 -0
  239. package/dist/markdown/copy-button.d.ts +2 -2
  240. package/dist/markdown/copy-button.js +22 -20
  241. package/dist/markdown/setup-links/setup-link-button.js +1 -1
  242. package/dist/primitives/emoji-tint.d.ts +1 -1
  243. package/dist/primitives/emoji-tint.js +1 -1
  244. package/dist/primitives/error-state.js +8 -1
  245. package/dist/primitives/inline-meta.d.ts +12 -1
  246. package/dist/primitives/inline-meta.js +38 -5
  247. package/dist/primitives/mermaid-render.js +3 -20
  248. package/dist/primitives/page-search-bar.js +6 -6
  249. package/dist/primitives/section.d.ts +3 -3
  250. package/dist/primitives/section.js +9 -9
  251. package/dist/primitives/status.d.ts +5 -5
  252. package/dist/primitives/status.js +33 -33
  253. package/dist/primitives/tabs.d.ts +14 -26
  254. package/dist/primitives/tabs.js +103 -105
  255. package/dist/primitives/tag.d.ts +1 -1
  256. package/dist/primitives/toast.d.ts +6 -6
  257. package/dist/primitives/toast.js +55 -48
  258. package/dist/providers/session-ids.d.ts +1 -1
  259. package/dist/providers/ui-provider.d.ts +2 -0
  260. package/dist/session/agents/agent-strip.js +6 -6
  261. package/dist/session/agents/subagent-dialog-content.js +3 -4
  262. package/dist/session/agents/workflow-run-controls.d.ts +0 -2
  263. package/dist/session/agents/workflow-run-controls.js +1 -12
  264. package/dist/session/composer/ComposerCard.d.ts +1 -1
  265. package/dist/session/composer/ComposerCard.js +2 -2
  266. package/dist/session/composer/animated-placeholder.js +1 -1
  267. package/dist/session/composer/chat-input/chat-input-control.js +1 -8
  268. package/dist/session/composer/composer-chat-input.d.ts +14 -1
  269. package/dist/session/composer/composer-chat-input.js +4 -2
  270. package/dist/session/composer/composer-toolbar.d.ts +22 -17
  271. package/dist/session/composer/composer-toolbar.js +12 -3
  272. package/dist/session/composer/composer.d.ts +8 -0
  273. package/dist/session/composer/composer.js +5 -13
  274. package/dist/session/composer/reasoning-effort-selector.d.ts +21 -0
  275. package/dist/session/composer/reasoning-effort-selector.js +46 -1
  276. package/dist/session/composer/send-stop-control.d.ts +15 -1
  277. package/dist/session/composer/send-stop-control.js +30 -5
  278. package/dist/session/header/session-embed-menu-item.d.ts +12 -0
  279. package/dist/session/header/session-embed-menu-item.js +30 -0
  280. package/dist/{workspace/sidebar/modal/session-embed-section.d.ts → session/header/session-embed-snippet.d.ts} +2 -11
  281. package/dist/session/header/session-embed-snippet.js +21 -0
  282. package/dist/session/header/session-goal-indicator.js +2 -3
  283. package/dist/session/header/session-reminders-indicator.js +3 -3
  284. package/dist/session/header/session-site-header.js +10 -3
  285. package/dist/session/index.d.ts +1 -1
  286. package/dist/session/models/ask-owner-for-credits-button.d.ts +7 -1
  287. package/dist/session/models/ask-owner-for-credits-button.js +3 -2
  288. package/dist/session/models/model-availability.d.ts +11 -0
  289. package/dist/session/models/model-availability.js +12 -0
  290. package/dist/session/models/model-connection-gate.d.ts +11 -26
  291. package/dist/session/models/model-connection-gate.js +22 -35
  292. package/dist/session/models/model-grouping.d.ts +30 -0
  293. package/dist/session/models/model-grouping.js +46 -0
  294. package/dist/session/models/model-picker-panel.d.ts +62 -0
  295. package/dist/session/models/model-picker-panel.js +181 -0
  296. package/dist/session/models/model-selector.d.ts +28 -4
  297. package/dist/session/models/model-selector.js +59 -15
  298. package/dist/session/models/model-tags.d.ts +4 -8
  299. package/dist/session/models/model-tags.js +20 -13
  300. package/dist/session/models/subscription-offer.d.ts +35 -0
  301. package/dist/session/models/subscription-offer.js +91 -0
  302. package/dist/session/models/use-model-connection-gate.d.ts +3 -3
  303. package/dist/session/models/use-model-connection-gate.js +8 -6
  304. package/dist/session/overrides/session-overrides-toolbar.js +8 -5
  305. package/dist/session/panel/open-session-quick-view.js +1 -1
  306. package/dist/session/panel/session-detail-panel.js +5 -1
  307. package/dist/session/panel/session-panel-provider.js +2 -2
  308. package/dist/session/panel/session-reminders-panel.js +2 -2
  309. package/dist/session/panel/shared/use-panel-derivations.d.ts +1 -0
  310. package/dist/session/panel/shared/use-panel-derivations.js +1 -1
  311. package/dist/session/panel/shared/use-panel-handoffs.d.ts +2 -2
  312. package/dist/session/panel/shared/use-panel-handoffs.js +22 -3
  313. package/dist/session/panel/use-session-panel-state.js +1 -1
  314. package/dist/session/prompts/ask-deck.d.ts +5 -3
  315. package/dist/session/prompts/ask-deck.js +30 -10
  316. package/dist/session/prompts/session-access-prompt.d.ts +61 -0
  317. package/dist/session/prompts/session-access-prompt.js +88 -0
  318. package/dist/session/prompts/session-permission-prompt.js +1 -1
  319. package/dist/session/scope/session-scope-control.js +2 -2
  320. package/dist/session/status/session-notice-banner.js +3 -3
  321. package/dist/session/status/session-route-prefetch.d.ts +2 -2
  322. package/dist/session/thread/optimistic-turn.js +1 -1
  323. package/dist/session/thread/session-chat.js +51 -19
  324. package/dist/session/thread/session-context-message-explorer.js +2 -2
  325. package/dist/session/thread/session-history.js +3 -3
  326. package/dist/session/tool/render-static.d.ts +11 -0
  327. package/dist/session/tool/render-static.js +16 -0
  328. package/dist/session/tool/shared/session-helpers.js +2 -2
  329. package/dist/session/tool/tool-part-renderer.d.ts +6 -1
  330. package/dist/session/tool/tool-part-renderer.js +9 -5
  331. package/dist/session/tool/tools/kortix-action-tool.js +4 -25
  332. package/dist/session/tool/tools/task-tool.js +9 -2
  333. package/dist/session/tool/tools/workflow-run-card.js +5 -1
  334. package/dist/session/tool/tools/workflow-tool.js +3 -14
  335. package/dist/session/turn/user-message.js +1 -1
  336. package/dist/session/voice/composer-call.d.ts +31 -0
  337. package/dist/session/voice/composer-call.js +46 -0
  338. package/dist/session/voice/voice-call-card.js +2 -0
  339. package/dist/session/voice/voice-call-store.d.ts +8 -0
  340. package/dist/session/voice/voice-call-store.js +5 -0
  341. package/dist/session/voice/voice-call.d.ts +2 -2
  342. package/dist/session/voice/voice-call.js +6 -6
  343. package/dist/styles.css +1 -1
  344. package/dist/test-utils/intl.d.ts +10103 -0
  345. package/dist/test-utils/intl.js +27 -0
  346. package/dist/test-utils/strip-tags.d.ts +24 -0
  347. package/dist/test-utils/strip-tags.js +32 -0
  348. package/dist/workspace/admin/project-admin-dashboard.d.ts +51 -33
  349. package/dist/workspace/admin/project-admin-dashboard.js +269 -81
  350. package/dist/workspace/admin/settings-search-landing.d.ts +11 -0
  351. package/dist/workspace/admin/settings-search-landing.js +103 -0
  352. package/dist/workspace/admin/settings-search.d.ts +69 -0
  353. package/dist/workspace/admin/settings-search.js +393 -0
  354. package/dist/workspace/home/existing-repo-setup-prompt.d.ts +22 -0
  355. package/dist/workspace/home/existing-repo-setup-prompt.js +57 -0
  356. package/dist/workspace/home/no-agent-home.d.ts +25 -0
  357. package/dist/workspace/home/no-agent-home.js +44 -0
  358. package/dist/workspace/home/welcome-body.js +2 -1
  359. package/dist/workspace/inbox/workspace-inbox.d.ts +21 -0
  360. package/dist/workspace/inbox/workspace-inbox.js +52 -0
  361. package/dist/workspace/instant-session-shell.js +11 -1
  362. package/dist/workspace/layout/project-files-view.js +1 -1
  363. package/dist/workspace/layout/project-home.js +84 -11
  364. package/dist/workspace/layout/use-project-home-call.d.ts +24 -0
  365. package/dist/workspace/layout/use-project-home-call.js +56 -0
  366. package/dist/workspace/memory/memory-body.js +2 -2
  367. package/dist/workspace/new/account-param.d.ts +1 -1
  368. package/dist/workspace/new/account-param.js +4 -4
  369. package/dist/workspace/new/advanced-fields.js +3 -3
  370. package/dist/workspace/new/clone-param.d.ts +1 -1
  371. package/dist/workspace/new/clone-param.js +1 -1
  372. package/dist/workspace/new/create-workspace-key.js +1 -1
  373. package/dist/workspace/new/github-source.d.ts +6 -6
  374. package/dist/workspace/new/github-source.js +6 -6
  375. package/dist/workspace/new/new-workspace-form.d.ts +11 -141
  376. package/dist/workspace/new/new-workspace-form.js +9 -195
  377. package/dist/workspace/new/provision-new-workspace.d.ts +14 -0
  378. package/dist/workspace/new/provision-new-workspace.js +14 -0
  379. package/dist/workspace/new/repository-options.d.ts +2 -2
  380. package/dist/workspace/new/repository-options.js +2 -2
  381. package/dist/workspace/new/source-param.d.ts +2 -2
  382. package/dist/workspace/new/source-param.js +2 -2
  383. package/dist/workspace/new/use-create-workspace.d.ts +43 -102
  384. package/dist/workspace/new/use-create-workspace.js +77 -136
  385. package/dist/workspace/new/use-project-quota.d.ts +1 -1
  386. package/dist/workspace/new/use-project-quota.js +1 -1
  387. package/dist/workspace/new/workspace-handoff.d.ts +2 -2
  388. package/dist/workspace/new/workspace-handoff.js +2 -2
  389. package/dist/workspace/new/workspace-name.d.ts +14 -1
  390. package/dist/workspace/new/workspace-name.js +21 -1
  391. package/dist/workspace/project-selector/project-selector-model.d.ts +115 -57
  392. package/dist/workspace/project-selector/project-selector-model.js +157 -111
  393. package/dist/workspace/projects/modal/project-icon-field.d.ts +5 -5
  394. package/dist/workspace/projects/modal/project-icon-field.js +4 -4
  395. package/dist/workspace/projects/policies-panel.js +3 -3
  396. package/dist/workspace/sessions/board-grouping.js +1 -1
  397. package/dist/workspace/sessions/project-sessions-view.js +2 -2
  398. package/dist/workspace/sessions/session-detail.js +2 -2
  399. package/dist/workspace/sessions/sessions-board.d.ts +1 -1
  400. package/dist/workspace/sessions/sessions-board.js +1 -1
  401. package/dist/workspace/settings/split-notice-banner.d.ts +13 -0
  402. package/dist/workspace/settings/split-notice-banner.js +59 -0
  403. package/dist/workspace/settings/use-leave-workspace.d.ts +16 -0
  404. package/dist/workspace/settings/use-leave-workspace.js +60 -0
  405. package/dist/workspace/sidebar/footer/project-balance-warning.js +9 -6
  406. package/dist/workspace/sidebar/footer/project-files-nav.js +2 -2
  407. package/dist/workspace/sidebar/footer/sandbox-health.js +1 -1
  408. package/dist/workspace/sidebar/footer/sidebar-alert.d.ts +1 -1
  409. package/dist/workspace/sidebar/invitations-menu-group.d.ts +2 -2
  410. package/dist/workspace/sidebar/invitations-menu-group.js +4 -4
  411. package/dist/workspace/sidebar/modal/share-session-access.js +1 -1
  412. package/dist/workspace/sidebar/modal/share-session-modal.js +4 -5
  413. package/dist/workspace/sidebar/project-nav-items.js +14 -25
  414. package/dist/workspace/sidebar/project-sidebar.js +17 -2
  415. package/dist/workspace/sidebar/project-spaces-nav.js +6 -15
  416. package/dist/workspace/sidebar/sidebar-drill.d.ts +37 -0
  417. package/dist/workspace/sidebar/sidebar-drill.js +110 -0
  418. package/dist/workspace/sidebar/use-workspace-directory.d.ts +24 -0
  419. package/dist/workspace/sidebar/use-workspace-directory.js +24 -0
  420. package/dist/workspace/sidebar/use-workspace-list.d.ts +37 -0
  421. package/dist/workspace/sidebar/use-workspace-list.js +71 -0
  422. package/dist/workspace/sidebar/workspace-grouping.d.ts +6 -67
  423. package/dist/workspace/sidebar/workspace-grouping.js +4 -107
  424. package/dist/workspace/sidebar/workspace-menu-model.d.ts +30 -12
  425. package/dist/workspace/sidebar/workspace-menu-model.js +13 -107
  426. package/dist/workspace/sidebar/workspace-menu-section.d.ts +7 -1
  427. package/dist/workspace/sidebar/workspace-menu-section.js +65 -100
  428. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +34 -0
  429. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +282 -0
  430. package/dist/workspace/space/space-filter-tabs.js +2 -2
  431. package/dist/workspace/space/space-page.d.ts +1 -1
  432. package/dist/workspace/space/space-page.js +1 -1
  433. package/package.json +55 -51
  434. package/skills/kortix-ui/SKILL.md +66 -66
  435. package/skills/kortix-ui/references/custom-dashboard.md +15 -15
  436. package/skills/kortix-ui/references/modules.md +15 -15
  437. package/dist/customize/agents/agent-pin-button.d.ts +0 -10
  438. package/dist/customize/agents/agent-pin-button.js +0 -20
  439. package/dist/customize/settings/tabs/transfer-workspace-dialog.d.ts +0 -4
  440. package/dist/customize/settings/tabs/transfer-workspace-dialog.js +0 -82
  441. package/dist/internal/account-hub/account-settings-shell.d.ts +0 -7
  442. package/dist/internal/account-hub/account-settings-shell.js +0 -87
  443. package/dist/internal/account-hub/account-settings-sidebar.d.ts +0 -2
  444. package/dist/internal/account-hub/account-settings-sidebar.js +0 -169
  445. package/dist/internal/lib/use-project-feature-flags.d.ts +0 -28
  446. package/dist/internal/lib/use-project-feature-flags.js +0 -76
  447. package/dist/internal/stores/pinned-agents-store.d.ts +0 -26
  448. package/dist/internal/stores/pinned-agents-store.js +0 -20
  449. package/dist/primitives/info-banner.d.ts +0 -14
  450. package/dist/primitives/info-banner.js +0 -72
  451. package/dist/workspace/new/account-picker.d.ts +0 -71
  452. package/dist/workspace/new/account-picker.js +0 -92
  453. package/dist/workspace/new/use-creatable-accounts.d.ts +0 -8
  454. package/dist/workspace/new/use-creatable-accounts.js +0 -33
  455. package/dist/workspace/sidebar/modal/session-embed-section.js +0 -71
@@ -0,0 +1,240 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ /**
4
+ * Workspace settings › API keys: ONE list of every key of the workspace, and
5
+ * ONE create that asks who the key acts as (design.md §3.2 C4b).
6
+ *
7
+ * - You: your role in this workspace; revoked when you leave.
8
+ * - An agent: a kortix.yaml agent's own identity, exactly its grant inside
9
+ * its role; audited as the agent; it survives its creator leaving.
10
+ * - A bot: a machine identity for CI or an integration, with its own roles.
11
+ *
12
+ * Every member sees and manages their own keys. Agent and bot keys need
13
+ * `token.create` (`can_manage_principals` on the list). This replaced the two
14
+ * lists "Your keys for this workspace" and "Service account tokens".
15
+ */
16
+ import { useRef, useState } from 'react';
17
+ import { createWorkspaceKey, getPatPolicy, listPermissions, listWorkspaceKeys, revokeWorkspaceKey, } from '@kortix/sdk';
18
+ import { KeyIcon, PlusIcon, ProhibitIcon, RobotIcon, TerminalWindowIcon, TrashIcon, UserIcon } from '@phosphor-icons/react';
19
+ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
20
+ import { defaultKeyExpiryOption, keyExpiresAt, keyExpiryOptions } from '../../../access/iam/api-key-expiry.js';
21
+ import { NEW_BOT, actsAsInput, actsAsOptions, keyRowAction, keyStatus, sortKeys, } from '../../../access/iam/workspace-key-acts-as.js';
22
+ import { CopyRow } from '../../../access/access/index.js';
23
+ import { RowKebab } from '../../../access/access/access-row.js';
24
+ import { useLocale, useTranslations } from '../../../i18n/index.js';
25
+ import { MFA_REQUIRED_EVENT } from '../../../internal/auth/mfa-pending-action.js';
26
+ import { Badge } from '../../../primitives/badge.js';
27
+ import { Button } from '../../../primitives/button.js';
28
+ import { ConfirmDialog } from '../../../primitives/confirm-dialog.js';
29
+ import { EmptyState } from '../../../primitives/empty-state.js';
30
+ import { ErrorState } from '../../../primitives/error-state.js';
31
+ import { Alert as BannerAlert, AlertTitle as BannerAlertTitle, AlertDescription as BannerAlertDescription, AlertActions as BannerAlertActions } from '../../../primitives/alert.js';
32
+ import { Input } from '../../../primitives/input.js';
33
+ import { Label } from '../../../primitives/label.js';
34
+ import Loading from '../../../primitives/loading.js';
35
+ import { Modal, ModalBody, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalTitle } from '../../../primitives/modal.js';
36
+ import { Select, SelectContent, SelectItem, SelectSeparator, SelectTrigger, SelectValue } from '../../../primitives/select.js';
37
+ import { SettingsSubsectionHeader } from '../../../primitives/settings-subsection-header.js';
38
+ import { Skeleton } from '../../../primitives/skeleton.js';
39
+ import { errorToast, successToast } from '../../../primitives/toast.js';
40
+ import { PermissionPicker, formatShortDate, localizedRelativeTime } from './tokens-tab.js';
41
+ const KEYS_QUERY = (workspaceId) => ['workspace-keys', workspaceId];
42
+ const STATUS_BADGE = { active: 'success', expired: 'update', revoked: 'muted' };
43
+ const ACTS_AS_ICON = { me: UserIcon, agent: RobotIcon, bot: TerminalWindowIcon };
44
+ function isMfaRequired(error) {
45
+ return error?.code === 'account_mfa_required';
46
+ }
47
+ /** "You", "Agent · reporter" or "Bot · ci". */
48
+ function useActsAsLabel() {
49
+ const t = useTranslations('workspaces.settings.keys');
50
+ return (actsAs) => actsAs.type === 'me'
51
+ ? t('rowYou')
52
+ : actsAs.type === 'agent'
53
+ ? t('rowAgent', { name: actsAs.name ?? '' })
54
+ : t('rowBot', { name: actsAs.name ?? '' });
55
+ }
56
+ export function WorkspaceKeysSection({ workspaceId, accountId, heading = true, }) {
57
+ const t = useTranslations('workspaces.settings.keys');
58
+ const tTokens = useTranslations('settings.tokens');
59
+ const tWorkspaces = useTranslations('workspaces.settings');
60
+ const locale = useLocale();
61
+ const queryClient = useQueryClient();
62
+ const actsAsLabel = useActsAsLabel();
63
+ const [createOpen, setCreateOpen] = useState(false);
64
+ const [pending, setPending] = useState(null);
65
+ const [mountAt] = useState(() => Date.now());
66
+ const keysQuery = useQuery({
67
+ queryKey: KEYS_QUERY(workspaceId),
68
+ queryFn: () => listWorkspaceKeys(workspaceId),
69
+ staleTime: 30_000,
70
+ });
71
+ const now = keysQuery.dataUpdatedAt || mountAt;
72
+ const refresh = () => queryClient.invalidateQueries({ queryKey: KEYS_QUERY(workspaceId) });
73
+ const revoke = useMutation({
74
+ mutationFn: ({ key, action }) => revokeWorkspaceKey(workspaceId, key.key_id, { deleteRevoked: action === 'delete' }),
75
+ onSuccess: (_result, { action }) => {
76
+ successToast(action === 'delete' ? tTokens('keyDeleted') : tTokens('keyRevoked'));
77
+ refresh();
78
+ setPending(null);
79
+ },
80
+ onError: (err, { action }) => errorToast(err.message || (action === 'delete' ? tTokens('deleteFailed') : tTokens('revokeFailed'))),
81
+ });
82
+ const list = keysQuery.data;
83
+ const keys = sortKeys(list?.keys ?? [], now);
84
+ const accessLabel = (key) => key.scope === 'read'
85
+ ? tWorkspaces('keyAccessRead')
86
+ : key.scope === 'custom'
87
+ ? tWorkspaces('keyAccessCustomCount', { count: key.workspace_permissions?.length ?? 0 })
88
+ : tWorkspaces('keyAccessFull');
89
+ const relative = (iso) => localizedRelativeTime(iso, locale, now);
90
+ const newKeyButton = (variant) => (_jsxs(Button, { size: "sm", variant: variant, className: "gap-1.5", onClick: () => setCreateOpen(true), children: [_jsx(PlusIcon, { className: "size-3.5 shrink-0" }), t('newKey')] }));
91
+ let body;
92
+ if (keysQuery.isLoading) {
93
+ body = (_jsxs("div", { className: "space-y-2", children: [_jsx(Skeleton, { className: "h-14 rounded-md" }), _jsx(Skeleton, { className: "h-14 rounded-md" })] }));
94
+ }
95
+ else if (keysQuery.isError) {
96
+ body = isMfaRequired(keysQuery.error) ? (_jsxs(BannerAlert, { variant: "warning", children: [_jsx(BannerAlertTitle, { children: tTokens('confirmIdentity') }), _jsx(BannerAlertDescription, { children: tTokens('mfaDescription') }), _jsx(BannerAlertActions, { children: _jsx(Button, { variant: "outline", size: "sm", onClick: () => window.dispatchEvent(new CustomEvent(MFA_REQUIRED_EVENT)), children: tTokens('verify') }) })] })) : (_jsx(ErrorState, { size: "sm", title: tTokens('loadFailed'), description: keysQuery.error instanceof Error ? keysQuery.error.message : undefined, action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => keysQuery.refetch(), children: tTokens('retry') }) }));
97
+ }
98
+ else if (keys.length === 0) {
99
+ body = _jsx(EmptyState, { icon: KeyIcon, size: "sm", title: t('emptyTitle'), description: t('emptyDescription'), action: newKeyButton('outline') });
100
+ }
101
+ else {
102
+ body = (
103
+ // One card of flat rows, the key list's established layout.
104
+ _jsxs("div", { className: "bg-surface overflow-hidden rounded-lg border", children: [_jsxs("div", { className: "flex h-12 items-center justify-between gap-3 border-b pr-2 pl-4", children: [_jsx("span", { className: "text-foreground text-sm font-medium", children: t('count', { count: keys.length }) }), heading ? null : newKeyButton('ghost')] }), _jsx("ul", { className: "divide-y", "aria-label": t('title'), children: keys.map((key) => {
105
+ const status = keyStatus(key, now);
106
+ const action = keyRowAction(key, list?.can_manage_principals === true, now);
107
+ const Icon = ACTS_AS_ICON[key.acts_as.type];
108
+ const kebab = action
109
+ ? [
110
+ {
111
+ label: action === 'revoke' ? tTokens('revokeKey') : tTokens('deleteKey'),
112
+ icon: action === 'revoke' ? _jsx(ProhibitIcon, { className: "size-3.5 shrink-0" }) : _jsx(TrashIcon, { className: "size-3.5 shrink-0" }),
113
+ variant: 'destructive',
114
+ onSelect: () => setPending({ key, action }),
115
+ },
116
+ ]
117
+ : [];
118
+ const meta = [
119
+ accessLabel(key),
120
+ key.last_used_at ? tTokens('lastUsed', { time: relative(key.last_used_at) }) : tTokens('neverUsed'),
121
+ status === 'revoked'
122
+ ? tTokens('status.revoked')
123
+ : key.expires_at
124
+ ? status === 'expired'
125
+ ? tTokens('expiredAt', { time: relative(key.expires_at) })
126
+ : tTokens('expiresAt', { time: relative(key.expires_at) })
127
+ : tTokens('neverExpires'),
128
+ key.acts_as.type !== 'me' && key.created_by_email
129
+ ? t('createdBy', { email: key.created_by_email })
130
+ : tTokens('createdOn', { date: formatShortDate(key.created_at, locale) }),
131
+ ];
132
+ return (_jsxs("li", { className: "flex items-center gap-3 px-4 py-3", "data-acts-as": key.acts_as.type, children: [_jsx("span", { className: "bg-muted text-muted-foreground flex size-8 shrink-0 items-center justify-center rounded-md", children: _jsx(Icon, { className: "size-4" }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { className: "text-foreground truncate text-sm font-medium", children: key.name }), _jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: actsAsLabel(key.acts_as) }), status !== 'active' ? (_jsx(Badge, { variant: STATUS_BADGE[status], size: "sm", children: tTokens(`status.${status}`) })) : null] }), _jsxs("span", { className: "text-muted-foreground block truncate text-xs", children: [_jsx("span", { className: "font-mono", children: key.public_key }), " \u00B7 ", meta.join(' · ')] })] }), kebab.length > 0 ? _jsx(RowKebab, { items: kebab, label: tTokens('actionsFor', { name: key.name }) }) : null] }, key.key_id));
133
+ }) })] }));
134
+ }
135
+ return (_jsxs("section", { className: "mx-auto w-full max-w-2xl space-y-4", children: [heading ? _jsx(SettingsSubsectionHeader, { title: t('title'), description: t('description'), action: newKeyButton('secondary') }) : null, body, _jsx(CreateWorkspaceKeyDialog, { workspaceId: workspaceId, accountId: accountId, list: list ?? null, open: createOpen, onOpenChange: setCreateOpen, onCreated: refresh }), _jsx(ConfirmDialog, { open: !!pending, onOpenChange: (open) => {
136
+ if (!open)
137
+ setPending(null);
138
+ }, title: pending?.action === 'delete' ? tTokens('deleteTitle') : tTokens('revokeTitle'), description: pending
139
+ ? pending.action === 'delete'
140
+ ? tTokens('deleteDescription', { name: pending.key.name })
141
+ : tTokens('revokeDescription', { name: pending.key.name })
142
+ : '', confirmLabel: pending?.action === 'delete' ? tTokens('deleteKey') : tTokens('revoke'), confirmVariant: "destructive", isPending: revoke.isPending, onConfirm: () => {
143
+ if (pending)
144
+ revoke.mutate(pending);
145
+ } })] }));
146
+ }
147
+ /** Create, then show the secret once, in one modal (a one-time secret is never lost to a reopen). */
148
+ function CreateWorkspaceKeyDialog({ workspaceId, accountId, list, open, onOpenChange, onCreated, }) {
149
+ const t = useTranslations('workspaces.settings.keys');
150
+ const tTokens = useTranslations('settings.tokens');
151
+ const tWorkspaces = useTranslations('workspaces.settings');
152
+ const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
153
+ const common = useTranslations('common');
154
+ const actsAsLabel = useActsAsLabel();
155
+ const [name, setName] = useState('');
156
+ const [draft, setDraft] = useState({ actsAs: 'me', agent: '', bot: '', newBotName: '' });
157
+ const [access, setAccess] = useState('full');
158
+ const [picked, setPicked] = useState(() => new Set());
159
+ const [expiry, setExpiry] = useState('');
160
+ const [created, setCreated] = useState(null);
161
+ const submitInFlight = useRef(false);
162
+ const options = actsAsOptions(list);
163
+ const blockLabel = (block) => block === 'needs_permission' ? t('needsPermission') : block === 'no_agents' ? t('noAgents') : null;
164
+ const permissionsQuery = useQuery({
165
+ queryKey: ['iam-permissions', workspaceId],
166
+ queryFn: () => listPermissions(workspaceId),
167
+ enabled: open && access === 'custom',
168
+ staleTime: 5 * 60_000,
169
+ retry: false,
170
+ });
171
+ const policyQuery = useQuery({
172
+ queryKey: ['iam-pat-policy', accountId],
173
+ queryFn: () => getPatPolicy(accountId),
174
+ staleTime: 30_000,
175
+ enabled: open,
176
+ retry: false,
177
+ });
178
+ const policy = policyQuery.data ?? null;
179
+ const expiryChoices = keyExpiryOptions(policy, tI18nComplete).map((choice) => ({
180
+ ...choice,
181
+ label: Number.isNaN(Number(choice.value))
182
+ ? tTokens('expiryNever')
183
+ : Number(choice.value) === 365
184
+ ? tTokens('expiryOneYear')
185
+ : tTokens('expiryDays', { count: Number(choice.value) }),
186
+ }));
187
+ const selectedExpiry = expiryChoices.some((o) => o.value === expiry) ? expiry : defaultKeyExpiryOption(policy, tI18nComplete);
188
+ const principal = actsAsInput(draft);
189
+ const ready = !!name.trim() && !!principal && !(access === 'custom' && picked.size === 0);
190
+ const pickedBot = draft.actsAs === 'bot' && draft.bot && draft.bot !== NEW_BOT ? list?.bots.find((b) => b.bot_id === draft.bot) : undefined;
191
+ const mutation = useMutation({
192
+ mutationFn: () => createWorkspaceKey(workspaceId, {
193
+ name: name.trim(),
194
+ actsAs: principal,
195
+ scopes: access === 'custom' ? [...picked] : access,
196
+ expiresAt: keyExpiresAt(selectedExpiry),
197
+ }),
198
+ onSuccess: (key) => {
199
+ onCreated();
200
+ setCreated(key);
201
+ },
202
+ onError: (err) => errorToast(err.message || tTokens('createFailed')),
203
+ onSettled: () => {
204
+ submitInFlight.current = false;
205
+ },
206
+ });
207
+ function close() {
208
+ onOpenChange(false);
209
+ setTimeout(() => {
210
+ setName('');
211
+ setDraft({ actsAs: 'me', agent: '', bot: '', newBotName: '' });
212
+ setAccess('full');
213
+ setPicked(new Set());
214
+ setExpiry('');
215
+ setCreated(null);
216
+ }, 200);
217
+ }
218
+ const hint = draft.actsAs === 'me' ? t('actsAsMeHint') : draft.actsAs === 'agent' ? t('actsAsAgentHint') : t('actsAsBotHint');
219
+ return (_jsx(Modal, { open: open, onOpenChange: (next) => {
220
+ if (mutation.isPending)
221
+ return;
222
+ if (!next)
223
+ close();
224
+ else
225
+ onOpenChange(true);
226
+ }, children: _jsx(ModalContent, { className: "lg:max-w-lg", closeLabel: common('close'), children: created ? (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: tTokens('copyNow') }), _jsx(ModalDescription, { children: t('createdDescription', { name: created.name, actsAs: actsAsLabel(created.acts_as) }) })] }), _jsx(ModalBody, { children: _jsx(CopyRow, { value: created.secret_key, successMessage: tTokens('keyCopied') }) }), _jsx(ModalFooter, { children: _jsx(Button, { type: "button", size: "sm", onClick: close, children: tTokens('done') }) })] })) : (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: t('newKey') }), _jsx(ModalDescription, { children: t('description') })] }), _jsxs("form", { onSubmit: (event) => {
227
+ event.preventDefault();
228
+ if (!ready || mutation.isPending || submitInFlight.current)
229
+ return;
230
+ submitInFlight.current = true;
231
+ mutation.mutate();
232
+ }, children: [_jsxs(ModalBody, { className: "space-y-4", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-name", children: tTokens('name') }), _jsx(Input, { id: "workspace-key-name", value: name, onChange: (event) => setName(event.target.value), placeholder: tTokens('namePlaceholder'), disabled: mutation.isPending, maxLength: 128, autoFocus: true, variant: "popover" })] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-acts-as", children: t('actsAs') }), _jsxs(Select, { value: draft.actsAs, onValueChange: (value) => setDraft((d) => ({ ...d, actsAs: value })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-acts-as", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: options.map((option) => (_jsx(SelectItem, { value: option.value, disabled: option.block !== null, description: blockLabel(option.block) ?? undefined, children: option.value === 'me' ? t('actsAsMe') : option.value === 'agent' ? t('actsAsAgent') : t('actsAsBot') }, option.value))) })] }), _jsx("p", { className: "text-muted-foreground text-xs", children: hint })] }), draft.actsAs === 'agent' ? (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-agent", children: t('agent') }), _jsxs(Select, { value: draft.agent, onValueChange: (agent) => setDraft((d) => ({ ...d, agent })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-agent", size: "md", className: "w-full", children: _jsx(SelectValue, { placeholder: t('agentPlaceholder') }) }), _jsx(SelectContent, { children: (list?.agents ?? []).map((agent) => (_jsx(SelectItem, { value: agent.name, children: agent.name }, agent.name))) })] })] })) : null, draft.actsAs === 'bot' ? (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-bot", children: t('bot') }), _jsxs(Select, { value: draft.bot, onValueChange: (bot) => setDraft((d) => ({ ...d, bot })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-bot", size: "md", className: "w-full", children: _jsx(SelectValue, { placeholder: t('botPlaceholder') }) }), _jsxs(SelectContent, { children: [(list?.bots ?? []).map((bot) => (_jsx(SelectItem, { value: bot.bot_id, children: bot.name }, bot.bot_id))), (list?.bots.length ?? 0) > 0 ? _jsx(SelectSeparator, {}) : null, _jsx(SelectItem, { value: NEW_BOT, children: t('newBot') })] })] }), draft.bot === NEW_BOT ? (_jsxs(_Fragment, { children: [_jsx(Input, { "aria-label": t('newBotName'), value: draft.newBotName, onChange: (event) => setDraft((d) => ({ ...d, newBotName: event.target.value })), placeholder: t('newBotNamePlaceholder'), maxLength: 128, disabled: mutation.isPending, variant: "popover" }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('newBotHint') })] })) : pickedBot && !pickedBot.has_role ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('botNoRole') })) : null] })) : null, _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-access", children: tWorkspaces('keyAccess') }), _jsxs(Select, { value: access, onValueChange: (value) => setAccess(value), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-access", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "full", children: tWorkspaces('keyAccessFull') }), _jsx(SelectItem, { value: "read", children: tWorkspaces('keyAccessRead') }), _jsx(SelectItem, { value: "custom", children: tWorkspaces('keyAccessCustom') })] })] }), _jsx("p", { className: "text-muted-foreground text-xs", children: access === 'read' ? tWorkspaces('keyAccessReadHint') : access === 'custom' ? t('accessCustomHint') : t('accessFullHint') }), access === 'custom' ? (_jsx(PermissionPicker, { query: permissionsQuery, picked: picked, onToggle: (action, on) => setPicked((prev) => {
233
+ const next = new Set(prev);
234
+ if (on)
235
+ next.add(action);
236
+ else
237
+ next.delete(action);
238
+ return next;
239
+ }), disabled: mutation.isPending })) : null] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-expiry", children: tTokens('expires') }), _jsxs(Select, { value: selectedExpiry, onValueChange: setExpiry, disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-expiry", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: expiryChoices.map((choice) => (_jsx(SelectItem, { value: choice.value, children: choice.label }, choice.value))) })] }), policy?.require_expiry ? _jsx("p", { className: "text-muted-foreground text-xs", children: tTokens('expiryRequired') }) : null] })] }), _jsxs(ModalFooter, { className: "sm:justify-between", children: [_jsx(Button, { type: "button", variant: "outline-ghost", size: "sm", onClick: close, disabled: mutation.isPending, children: tTokens('cancel') }), _jsxs(Button, { type: "submit", size: "sm", disabled: !ready || mutation.isPending, className: "gap-1.5", children: [mutation.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tTokens('createKey')] })] })] })] })) }) }));
240
+ }
@@ -225,7 +225,9 @@ export function CapabilityLibrary({ projectId, view, agent, footer, }) {
225
225
  const shownProject = project;
226
226
  const shownBuiltin = builtinGroups.filter((g) => g.items.length > 0);
227
227
  const projectSections = (_jsxs(_Fragment, { children: [shownProject.length > 0 ? cardGrid('project', t('groups.project'), shownProject, false) : null, shownBuiltin.map((g) => cardGrid(g.group, t(`groups.${g.group}`), g.items, true)), shownProject.length === 0 && shownBuiltin.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: search ? t('noMatch') : empty })) : null] }));
228
- const body = catalog && railCard ? (_jsx("div", { "data-testid": `capability-library-${view}`, "data-grant": JSON.stringify(agent?.editor.draft[view] ?? null), children: cardRows.length > 0 ? (_jsx(AccessList, { items: cardRows })) : (_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: search ? t('noMatch') : empty })) })) : catalog ? (_jsx("div", { className: "space-y-6", "data-testid": `capability-library-${view}`, "data-grant": agent ? JSON.stringify(agent.editor.draft[view] ?? null) : undefined, children: agent ? agentSections : projectSections })) : query.isError ? (_jsx(ErrorState, { size: "sm", title: t('loadError'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void query.refetch(), children: t('retry') }) })) : !agent ? (
228
+ const body = catalog && railCard ? (_jsx("div", { "data-testid": `capability-library-${view}`, "data-grant": JSON.stringify(agent?.editor.draft[view] ?? null), children: cardRows.length > 0 ? (_jsx(AccessList, { items: cardRows })) : (_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: search ? t('noMatch') : empty })) })) : catalog ? (_jsx("div", { className: "space-y-6", "data-testid": `capability-library-${view}`, "data-grant": agent ? JSON.stringify(agent.editor.draft[view] ?? null) : undefined, children: agent ? agentSections : projectSections })) : query.isError ? (_jsx(ErrorState, { size: "sm",
229
+ // Workspace Skills names its own list; an agent's page loads all three at once.
230
+ title: !agent && view === 'skills' ? t('skillsLoadError') : t('loadError'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void query.refetch(), children: t('retry') }) })) : !agent ? (
229
231
  // Project admin loads into the same card grid it renders.
230
232
  _jsx(CatalogGridSkeleton, { count: 6 })) : (_jsx(EditorList, { children: [0, 1, 2, 3].map((i) => (_jsx("li", { className: "flex min-h-12 items-center gap-3 px-4 py-2", children: _jsx(Skeleton, { className: "h-4 w-40 rounded-sm" }) }, i))) }));
231
233
  return (_jsxs(CapabilityPageShell, { title: t(VIEW_COPY[view].titleKey), description: agent ? t(`${view}Description`) : t(`${view}ProjectDescription`), action: skills.createButton, search: _jsxs(InputGroupSearch, { children: [_jsx(InputGroupSearchIcon, { children: _jsx(MagnifyingGlassIcon, {}) }), _jsx(InputGroupSearchInput, { placeholder: t(`${view}Search`), value: search, onChange: (event) => setSearch(event.target.value), size: "sm" }), search ? _jsx(InputGroupSearchClear, { onClick: () => setSearch('') }) : null] }), filters: agent ? (grant ? _jsx(GrantModeTabs, { grant: grant, label: t(VIEW_COPY[view].access), agentName: agent.name }) : undefined) : undefined, children: [body, footer, skills.modals, view === 'skills' && !agent ? (_jsx(BuiltinSkillModal, { projectId: projectId, name: builtinSkill, description: (() => {
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useTranslations } from '../../../i18n/index.js';
3
3
  import { CountBadge } from '../../../primitives/count-badge.js';
4
- import { Tabs, TabsListCompact, TabsTriggerCompact } from '../../../primitives/tabs.js';
4
+ import { Tabs, TabsList, TabsTrigger } from '../../../primitives/tabs.js';
5
5
  /** The sentinel filter value that shows every space (grouped). */
6
6
  export const ALL_SPACES = 'all';
7
7
  /**
@@ -16,5 +16,5 @@ export function CatalogSpaceTabs({ groups, value, onValueChange, }) {
16
16
  const hasRealSplit = groups.some((g) => !g.isDefault);
17
17
  if (!hasRealSplit)
18
18
  return null;
19
- return (_jsx(Tabs, { value: value, onValueChange: onValueChange, children: _jsxs(TabsListCompact, { "aria-label": t('filter'), children: [_jsx(TabsTriggerCompact, { value: ALL_SPACES, children: t('all') }), groups.map((group) => (_jsxs(TabsTriggerCompact, { value: group.name, children: [group.label, _jsx(CountBadge, { count: group.items.length, tone: "neutral" })] }, group.name)))] }) }));
19
+ return (_jsx(Tabs, { value: value, onValueChange: onValueChange, children: _jsxs(TabsList, { size: "xs", "aria-label": t('filter'), children: [_jsx(TabsTrigger, { value: ALL_SPACES, children: t('all') }), groups.map((group) => (_jsxs(TabsTrigger, { value: group.name, children: [group.label, _jsx(CountBadge, { count: group.items.length, tone: "neutral" })] }, group.name)))] }) }));
20
20
  }
@@ -1,12 +1,16 @@
1
1
  import { type ReactNode } from 'react';
2
2
  /** True under `CustomizeFrame`: the bar above holds the title-bar row and the sidebar opener. */
3
3
  export declare function useInCustomizeFrame(): boolean;
4
- /** The bar, then the page. Every Customize and Project admin route renders through it,
5
- * the Agents list and each agent's page included. */
4
+ /** The bar, then the page. Every Customize route renders through it, the
5
+ * Agents list and each agent's page included. */
6
6
  export declare function CustomizeFrame({ projectId, children }: {
7
7
  projectId: string;
8
8
  children: ReactNode;
9
9
  }): import("react").JSX.Element;
10
+ /** Workspace settings' frame: the title-bar row with the sidebar opener and the panel's name, then the panel. */
11
+ export declare function SettingsFrame({ children }: {
12
+ children: ReactNode;
13
+ }): import("react").JSX.Element;
10
14
  export declare function CustomizeTabBar({ projectId }: {
11
15
  projectId: string;
12
16
  }): import("react").JSX.Element;
@@ -1,56 +1,59 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  /**
4
- * Customize's top bar, over every Customize and Project admin page, the
5
- * agent pages included: Agents, a separator, the project's libraries
6
- * (Connectors, Secrets, Skills, Tools, Extensions, Drives, Triggers, Models,
7
- * Repo), Review, then Members ↗ and Settings on the right (Jay, 2026-11-03:
8
- * Agents leads the bar again). Prod's layout (Jay, 2026-10-29): one row of tabs,
9
- * no second column beside the sidebar. A library tab opens its Project admin
10
- * page full width; Settings opens Project admin's settings sections, which
11
- * keep a short sub-nav of their own.
4
+ * Customize's top bar, over every Customize page, the agent pages included:
5
+ * Agents, a separator, the workspace's libraries (each a link into its section
6
+ * of Workspace settings), Review, then one "Workspace settings" link on the
7
+ * right. Prod's layout (Jay, 2026-10-29): one row of tabs, no second column
8
+ * beside the sidebar.
12
9
  *
13
- * `CustomizeFrame` draws the bar above its children and tells the page
14
- * headers below it (`useInCustomizeFrame`) that the bar is the window's
15
- * title-bar row and holds the sidebar opener, so they do not draw a second.
10
+ * Workspace settings (`/workspaces/<id>/admin/<section>`) draws no tab bar:
11
+ * its one rail is the navigation (design.md §3.2 C7). `SettingsFrame` gives it
12
+ * the same title-bar row (the sidebar opener and the window's drag region)
13
+ * with the panel's name only.
14
+ *
15
+ * Both frames tell the page headers below (`useInCustomizeFrame`) that the
16
+ * bar is the window's title-bar row and holds the sidebar opener, so they do
17
+ * not draw a second.
16
18
  *
17
19
  * The tabs a caller sees follow the same rules as the pages: Review and
18
20
  * Settings by `capabilityAccess`, each library by its row's capability
19
21
  * and the `drives` flag (`PROJECT_ADMIN_RESOURCES`).
20
22
  */
21
- import { getProjectDetail } from '@kortix/sdk';
22
- import { contract, qk, useFeatureFlag } from '@kortix/sdk/react';
23
- import { ArrowUpRightIcon } from '@phosphor-icons/react';
24
- import { useQuery } from '@tanstack/react-query';
23
+ import { useFeatureFlag } from '@kortix/sdk/react';
25
24
  import { createContext, useContext } from 'react';
26
25
  import { useTranslations } from '../../i18n/index.js';
27
- import { HubLink } from '../../internal/account-hub/account-hub-location.js';
28
26
  import { useCapabilityAccess } from '../../internal/layout/project-settings-nav.js';
29
27
  import { SidebarToggle } from '../../internal/layout/sidebar-toggle.js';
30
28
  import { capabilityTabHref } from '../../internal/lib/capability-tab-routes.js';
31
29
  import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
32
30
  import { useProjectPageCans } from '../../internal/lib/use-project-can.js';
33
31
  import { cn } from '../../internal/lib/utils.js';
34
- import { hubTarget } from '../../internal/stores/account-panel-store.js';
35
32
  import { adminPath } from '../../lib/routes.js';
36
33
  import { FadedScrollArea } from '../../primitives/faded-scroll-area.js';
37
34
  import { useOptionalSidebar } from '../../primitives/sidebar.js';
38
35
  import { Tabs, TabsList, TabsTrigger } from '../../primitives/tabs.js';
39
36
  import { UiLink as Link, useUiPathname } from '../../providers/ui-provider.js';
40
- import { PROJECT_ADMIN_RESOURCES, RESOURCE_LABEL_KEYS, isProjectAdminResource, parseProjectAdminSection, projectAdminHref, } from '../project-settings/project-admin-sections.js';
37
+ import { PROJECT_ADMIN_RESOURCES, isProjectAdminResource, parseProjectAdminSection, projectAdminHref, sectionLabelKey, } from '../project-settings/project-admin-sections.js';
41
38
  import { receivedDenial } from './capability-access-gate.js';
42
39
  const InCustomizeFrame = createContext(false);
43
40
  /** True under `CustomizeFrame`: the bar above holds the title-bar row and the sidebar opener. */
44
41
  export function useInCustomizeFrame() {
45
42
  return useContext(InCustomizeFrame);
46
43
  }
47
- /** The bar, then the page. Every Customize and Project admin route renders through it,
48
- * the Agents list and each agent's page included. */
44
+ /** The bar, then the page. Every Customize route renders through it, the
45
+ * Agents list and each agent's page included. */
49
46
  export function CustomizeFrame({ projectId, children }) {
50
47
  return (_jsxs(InCustomizeFrame.Provider, { value: true, children: [_jsx(CustomizeTabBar, { projectId: projectId }), children] }));
51
48
  }
49
+ /** Workspace settings' frame: the title-bar row with the sidebar opener and the panel's name, then the panel. */
50
+ export function SettingsFrame({ children }) {
51
+ const tSettings = useTranslations('workspaces.settings');
52
+ const sidebar = useOptionalSidebar();
53
+ return (_jsxs(InCustomizeFrame.Provider, { value: true, children: [_jsxs("div", { className: "kx-titlebar-row kx-capability-titlebar relative flex h-11 shrink-0 items-center gap-1 border-b px-2", "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [_jsx(SidebarToggle, {}), _jsx("h1", { className: "text-foreground truncate px-2 text-sm font-medium", children: tSettings('title') })] }), children] }));
54
+ }
52
55
  const TAB_CLASS = 'w-fit flex-none px-1 py-3';
53
- const MEMBERS_LINK_CLASS = 'text-muted-foreground hover:text-foreground flex w-fit flex-none items-center gap-1 px-1 py-3 text-sm font-medium whitespace-nowrap transition-colors';
56
+ const SETTINGS_LINK_CLASS = 'text-muted-foreground hover:text-foreground flex w-fit flex-none items-center gap-1 px-1 py-3 text-sm font-medium whitespace-nowrap transition-colors';
54
57
  /** The active tab: `/admin/<library>` that library, Review, or any settings section Settings. */
55
58
  function activeTab(pathname) {
56
59
  if (/\/customize\/agents(\/|$)/.test(pathname))
@@ -63,23 +66,22 @@ function activeTab(pathname) {
63
66
  return '';
64
67
  return isProjectAdminResource(key) ? key : 'settings';
65
68
  }
66
- function MembersLink({ projectId }) {
67
- const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
68
- const { data } = useQuery({
69
- queryKey: qk.project.detail(projectId),
70
- queryFn: () => getProjectDetail(projectId),
71
- ...contract('config'),
72
- });
69
+ /**
70
+ * The one way from Customize into Workspace settings. A caller who may not
71
+ * open General (a member who reads Members only) lands on the first section
72
+ * they may open: `/admin` picks it.
73
+ */
74
+ function WorkspaceSettingsLink({ projectId, config }) {
75
+ const tSettings = useTranslations('workspaces.settings');
73
76
  const canReadMembers = useProjectPageCans(projectId)[PROJECT_ACTIONS.PROJECT_MEMBERS_READ];
74
- const accountId = data?.project?.account_id;
75
- if (receivedDenial(canReadMembers) || !accountId)
77
+ if (!config && receivedDenial(canReadMembers))
76
78
  return null;
77
- return (_jsxs(HubLink, { to: hubTarget(accountId, { tab: 'access-projects', project: projectId }), className: MEMBERS_LINK_CLASS, children: [tI18nComplete.raw('text1044a4c056d0'), _jsx(ArrowUpRightIcon, { className: "size-3 opacity-60", "aria-hidden": true })] }));
79
+ return (_jsx(Link, { href: adminPath(projectId), prefetch: true, className: SETTINGS_LINK_CLASS, children: tSettings('title') }));
78
80
  }
79
81
  export function CustomizeTabBar({ projectId }) {
80
82
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
81
83
  const tTabs = useTranslations('agentEditor.tabs');
82
- const tAdmin = useTranslations('projectAdmin');
84
+ const tSettings = useTranslations('workspaces.settings');
83
85
  const pathname = useUiPathname() ?? '';
84
86
  const sidebar = useOptionalSidebar();
85
87
  const access = useCapabilityAccess(projectId);
@@ -88,7 +90,6 @@ export function CustomizeTabBar({ projectId }) {
88
90
  const libraries = PROJECT_ADMIN_RESOURCES.filter((r) => !r.host && (!r.capability || allowed.has(r.capability)) && (r.flag !== 'drives' || drives.enabled));
89
91
  const tab = (value, href, label) => (_jsx(TabsTrigger, { value: value, asChild: true, className: TAB_CLASS, children: _jsx(Link, { href: href, prefetch: true, children: label }) }, value));
90
92
  return (_jsxs("div", { className: "kx-titlebar-row kx-capability-titlebar relative flex shrink-0 items-center gap-1 border-b px-2", "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [_jsx(SidebarToggle, {}), _jsx(FadedScrollArea, { orientation: "horizontal", fadeColor: "from-background", rootClassName: "min-w-0 flex-1", children: _jsx(Tabs, { value: activeTab(pathname), className: "w-max min-w-full", children: _jsxs(TabsList, { type: "underline", underlineSize: "md", size: "lg", className: cn('h-auto w-full justify-start gap-5 border-b-0 px-2', !access.settled && 'invisible'), "aria-busy": !access.settled || undefined, children: [allowed.has('agent') ? (_jsxs(_Fragment, { children: [tab('agents', capabilityTabHref(projectId, 'agent'), tI18nComplete.raw('text279b44d2ab4b')), _jsx("span", { "aria-hidden": true, className: "bg-border h-4 w-px shrink-0 self-center" })] })) : null, libraries.map((r) => {
91
- const legacy = RESOURCE_LABEL_KEYS[r.key];
92
- return tab(r.key, projectAdminHref(projectId, r.key), legacy ? tI18nComplete.raw(legacy) : tAdmin(r.key));
93
- }), allowed.has('review') ? tab('review', capabilityTabHref(projectId, 'review'), tTabs('review')) : null, _jsxs("span", { className: "ml-auto flex items-center gap-5", children: [_jsx(MembersLink, { projectId: projectId }), allowed.has('config') ? tab('settings', adminPath(projectId, 'general'), tTabs('settings')) : null] })] }) }) })] }));
93
+ return tab(r.key, projectAdminHref(projectId, r.key), tSettings(`sections.${sectionLabelKey(r.key)}`));
94
+ }), allowed.has('review') ? tab('review', capabilityTabHref(projectId, 'review'), tTabs('review')) : null, _jsx("span", { className: "ml-auto flex items-center gap-5", children: _jsx(WorkspaceSettingsLink, { projectId: projectId, config: allowed.has('config') }) })] }) }) })] }));
94
95
  }
@@ -48,7 +48,7 @@ export function projectCapabilityNavTarget(tab) {
48
48
  // `'members'` — not a `CapabilityTab['key']`: Members graduated off the
49
49
  // project entirely, onto the account hub's Access tab. Still named here
50
50
  // (rather than left to the `isAccountGraduatedSection` fallback) so the
51
- // result routes through `/projects/<id>/members` — the redirect route that
51
+ // result routes through `/workspaces/<id>/members` — the redirect route that
52
52
  // already knows how to resolve `account_id` and append the `&project=`
53
53
  // scoping — instead of duplicating that resolution here.
54
54
  if (tab === 'members')
@@ -105,7 +105,7 @@ export function buildStandaloneCapabilityNav(state) {
105
105
  // this branch, `tab` matched none of the checks above or below and the
106
106
  // click did nothing at all. Deliberately NOT `legacySectionRedirect` —
107
107
  // that helper's own fallback also resolves overlay-still ids
108
- // (`preferences` -> `/projects/<id>/settings/preferences`, a route),
108
+ // (`preferences` -> `/workspaces/<id>/settings/preferences`, a route),
109
109
  // which would bypass the store-based `openSettings()` call below and
110
110
  // break this adapter's "opens the overlay, not a route" contract.
111
111
  if (state.accountId && isAccountGraduatedSection(tab)) {
@@ -101,7 +101,7 @@ export declare function describeConditions(filter: Record<string, string> | null
101
101
  * these were two tabs of the Settings overlay — every pane in that overlay
102
102
  * takes its title and description from its rail entry, and being the one
103
103
  * exception is what let the copy drift before. They are capability PAGES now
104
- * (`/projects/<id>/schedules`, `/projects/<id>/webhooks`), not panes, so they
104
+ * (`/workspaces/<id>/schedules`, `/workspaces/<id>/webhooks`), not panes, so they
105
105
  * have no rail entry to read: a rail lookup that finds nothing renders no
106
106
  * heading and throws nothing, which is exactly the silent failure to avoid.
107
107
  * The copy is the wording those rail entries carried, moved verbatim.
@@ -16,7 +16,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
16
16
  * are off (the beta flag `event_triggers`, Project admin › Feature flags).
17
17
  */
18
18
  import { Button } from '../../../primitives/button.js';
19
- import { InfoBanner } from '../../../primitives/info-banner.js';
19
+ import { Alert as BannerAlert, AlertDescription as BannerAlertDescription, AlertActions as BannerAlertActions } from '../../../primitives/alert.js';
20
20
  import { Input } from '../../../primitives/input.js';
21
21
  import { Label } from '../../../primitives/label.js';
22
22
  import Loading from '../../../primitives/loading.js';
@@ -26,12 +26,11 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../primitives/ta
26
26
  import { successToast } from '../../../primitives/toast.js';
27
27
  import { agentDisplayLabel } from '../../../session/composer/session-chat-input.js';
28
28
  import { useTranslations as useI18nTranslations } from '../../../i18n/index.js';
29
- import { useProjectFeatureFlags } from '../../../internal/lib/use-project-feature-flags.js';
30
29
  import { UiLink as Link, useUiViewerId } from '../../../providers/ui-provider.js';
31
30
  import { uiRoutes } from '../../../lib/routes.js';
32
31
  import { projectSettingsSectionHref } from '../../project-settings/project-settings-sections.js';
33
32
  import { createProjectTrigger, upsertProjectSecret } from '@kortix/sdk';
34
- import { modelKeyToWire, useProjectApps, useProjectTriggerEventApps, useVisibleAgents, } from '@kortix/sdk/react';
33
+ import { modelKeyToWire, useProjectApps, useProjectTriggerEventApps, useVisibleAgents, useFeatureFlags, } from '@kortix/sdk/react';
35
34
  import { AppWindowIcon, GitMergeIcon, LightningIcon, TimerIcon, WebhooksLogoIcon } from '@phosphor-icons/react';
36
35
  import { useMutation } from '@tanstack/react-query';
37
36
  import { useEffect, useMemo, useRef, useState } from 'react';
@@ -84,7 +83,7 @@ const KIND_LABEL_KEY = {
84
83
  };
85
84
  /** A source this project cannot use yet: one sentence on why, and the link that fixes it. */
86
85
  function Unavailable({ children, action }) {
87
- return (_jsx(InfoBanner, { tone: "info", className: "text-xs", action: action, children: children }));
86
+ return (_jsxs(BannerAlert, { variant: "default", className: "text-xs", children: [_jsx(BannerAlertDescription, { children: children }), _jsx(BannerAlertActions, { children: action })] }));
88
87
  }
89
88
  function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null, initialKind = null, initialApp = null, initialConnector = null, initialSpace = null, onBusyChange, }) {
90
89
  const viewerId = useUiViewerId();
@@ -92,7 +91,7 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
92
91
  const tComposer = useI18nTranslations('triggerComposer');
93
92
  // Connector events are a beta feature behind the project flag `event_triggers`. Off: the tab
94
93
  // stays and its panel says how to turn it on; no catalog request is sent.
95
- const eventsOn = useProjectFeatureFlags(projectId).flags.event_triggers === true;
94
+ const eventsOn = useFeatureFlags(projectId).flags.event_triggers === true;
96
95
  const [draft, setDraft] = useState(() => ({
97
96
  ...initialDraft({
98
97
  kind: initialKind ?? (initialApp || initialConnector ? 'event' : null),
@@ -318,5 +317,5 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
318
317
  const pickKind = (kind) => setDraft((d) => withKind(d, kind));
319
318
  return (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { className: "pr-12 pb-3", children: [_jsx(ModalTitle, { children: tI18nComplete.raw('texta38f4ea67a30') }), _jsx(ModalDescription, { className: "text-pretty", "aria-live": "polite", children: summarize(draft, app, agentDisplayLabel(agents, draft.agent), tI18nComplete) })] }), _jsx(ModalBody, { className: "min-h-0 flex-1 overflow-y-auto px-5 py-4 lg:max-h-[min(calc(100dvh-13rem),44rem)] lg:flex-none", children: _jsxs("div", { ref: bodyRef, className: "space-y-8", children: [_jsxs("section", { "data-block": "when", className: "space-y-3", children: [_jsx(SectionTitle, { children: tI18nComplete.raw('textcf9c7aa24a26') }), _jsxs(Tabs, { value: draft.kind, onValueChange: pickKind, children: [_jsxs(Select, { value: draft.kind, onValueChange: pickKind, children: [_jsx(SelectTrigger, { className: "w-full cursor-pointer text-sm lg:hidden", "aria-label": tI18nComplete.raw('textcf9c7aa24a26'), children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: COMPOSER_KINDS.map((kind) => (_jsx(SelectItem, { value: kind, className: "cursor-pointer", children: _jsxs("span", { className: "flex items-center gap-1.5", children: [tabIcon(kind), kindLabel(kind)] }) }, kind))) })] }), _jsx(TabsList, { className: "hidden w-full lg:flex", children: COMPOSER_KINDS.map((kind) => (_jsxs(TabsTrigger, { value: kind, className: "flex-1 gap-1.5", children: [tabIcon(kind), kindLabel(kind)] }, kind))) }), _jsx(TabsContent, { value: "cron", className: "pt-3", children: _jsx(WhenSchedule, { draft: draft, patch: patch, error: blockError('when') }) }), _jsx(TabsContent, { value: "app", className: "pt-3", children: kortixApps.length > 0 || draft.kortixApp || projectApps.isLoading ? (_jsx(WhenApp, { apps: kortixApps, draft: draft, patch: patch, error: blockError('when') })) : (_jsx(Unavailable, { action: appsHref ? (_jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: appsHref, children: tComposer('openApps') }) })) : null, children: tComposer.rich('noApps', {
320
319
  code: (chunks) => (_jsx("code", { className: "bg-muted text-foreground rounded-sm px-1 py-0.5 font-mono text-xs", children: chunks })),
321
- }) })) }), _jsx(TabsContent, { value: "event", className: "pt-3", children: eventsOn ? (_jsx(WhenEvent, { projectId: projectId, apps: apps, draft: draft, patch: patch, setDraft: setDraft, configFields: configFields, configErrors: configErrors, canConnect: canConnect, error: blockError('when') })) : (_jsx(Unavailable, { action: _jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: projectSettingsSectionHref(projectId, 'feature-flags'), children: tI18nComplete.raw('text20a2e59ba129') }) }), children: tComposer('eventsOff') })) }), _jsx(TabsContent, { value: "webhook", className: "pt-3", children: _jsx(WhenWebhook, { draft: draft, patch: patch, error: blockError('when') }) }), _jsx(TabsContent, { value: "change_request", className: "pt-3", children: _jsx(WhenChangeRequest, { draft: draft, patch: patch }) })] })] }), _jsxs("section", { "data-block": "then", className: "space-y-3", children: [_jsx(SectionTitle, { children: tI18nComplete.raw('text0597f441dcca') }), _jsx(ThenFields, { agents: agents, draft: draft, patch: patch, payloadSchema: draft.eventType?.payload_schema, error: blockError('then') })] }), _jsxs("section", { className: "space-y-3", children: [_jsx(SectionTitle, { children: tComposer('details') }), _jsxs("div", { "data-block": "name", className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "trigger-name", className: "text-xs", children: tI18nComplete.raw('textdcd1d5223f73') }), _jsx(Input, { id: "trigger-name", value: name, onChange: (e) => patch({ nameOverride: e.target.value }), placeholder: tI18nComplete.raw('textc8cf587a3b6c'), maxLength: 64, "aria-invalid": blockError('name') || nameError ? true : undefined }), _jsx(InlineError, { message: blockError('name') ?? nameError })] }), _jsx(PostToField, { projectId: projectId, draft: draft, patch: patch, baseAccess: initialDraft({}).sessionAccess }), _jsx("div", { "data-block": "options", children: _jsx(TriggerOptions, { projectId: projectId, draft: draft, patch: patch, name: name, open: optionsOpen, onOpenChange: setOptionsOpen, error: blockError('options') }) })] }), error ? (_jsx("div", { ref: errorRef, children: _jsx(InfoBanner, { tone: "destructive", className: "text-xs", children: error }) })) : null] }) }), _jsxs(ModalFooter, { className: "mt-0 shrink-0 flex-row gap-2 border-t px-5 py-3 sm:space-x-0", children: [_jsx(Button, { variant: "ghost", size: "sm", disabled: create.isPending, onClick: () => onOpenChange(false), children: tI18nComplete.raw('text19766ed6ccb2') }), _jsxs(Button, { size: "sm", className: "gap-1.5", onClick: submit, disabled: create.isPending || unavailable, children: [create.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('texte18bbdd15a81')] })] })] }));
320
+ }) })) }), _jsx(TabsContent, { value: "event", className: "pt-3", children: eventsOn ? (_jsx(WhenEvent, { projectId: projectId, apps: apps, draft: draft, patch: patch, setDraft: setDraft, configFields: configFields, configErrors: configErrors, canConnect: canConnect, error: blockError('when') })) : (_jsx(Unavailable, { action: _jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: projectSettingsSectionHref(projectId, 'feature-flags'), children: tI18nComplete.raw('text20a2e59ba129') }) }), children: tComposer('eventsOff') })) }), _jsx(TabsContent, { value: "webhook", className: "pt-3", children: _jsx(WhenWebhook, { draft: draft, patch: patch, error: blockError('when') }) }), _jsx(TabsContent, { value: "change_request", className: "pt-3", children: _jsx(WhenChangeRequest, { draft: draft, patch: patch }) })] })] }), _jsxs("section", { "data-block": "then", className: "space-y-3", children: [_jsx(SectionTitle, { children: tI18nComplete.raw('text0597f441dcca') }), _jsx(ThenFields, { agents: agents, draft: draft, patch: patch, payloadSchema: draft.eventType?.payload_schema, error: blockError('then') })] }), _jsxs("section", { className: "space-y-3", children: [_jsx(SectionTitle, { children: tComposer('details') }), _jsxs("div", { "data-block": "name", className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "trigger-name", className: "text-xs", children: tI18nComplete.raw('textdcd1d5223f73') }), _jsx(Input, { id: "trigger-name", value: name, onChange: (e) => patch({ nameOverride: e.target.value }), placeholder: tI18nComplete.raw('textc8cf587a3b6c'), maxLength: 64, "aria-invalid": blockError('name') || nameError ? true : undefined }), _jsx(InlineError, { message: blockError('name') ?? nameError })] }), _jsx(PostToField, { projectId: projectId, draft: draft, patch: patch, baseAccess: initialDraft({}).sessionAccess }), _jsx("div", { "data-block": "options", children: _jsx(TriggerOptions, { projectId: projectId, draft: draft, patch: patch, name: name, open: optionsOpen, onOpenChange: setOptionsOpen, error: blockError('options') }) })] }), error ? (_jsx("div", { ref: errorRef, children: _jsx(BannerAlert, { variant: "destructive", className: "text-xs", children: _jsx(BannerAlertDescription, { children: error }) }) })) : null] }) }), _jsxs(ModalFooter, { className: "mt-0 shrink-0 flex-row gap-2 border-t px-5 py-3 sm:space-x-0", children: [_jsx(Button, { variant: "ghost", size: "sm", disabled: create.isPending, onClick: () => onOpenChange(false), children: tI18nComplete.raw('text19766ed6ccb2') }), _jsxs(Button, { size: "sm", className: "gap-1.5", onClick: submit, disabled: create.isPending || unavailable, children: [create.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('texte18bbdd15a81')] })] })] }));
322
321
  }
@@ -10,8 +10,8 @@ import { Checkbox } from '../../../primitives/checkbox.js';
10
10
  import { SessionDotMatrix } from '../../../primitives/dot-matrix/session-dot-matrix.js';
11
11
  import { useLocale, useTranslations } from '../../../i18n/index.js';
12
12
  import { lastRunLabel, nextRunIn } from '../../../internal/lib/trigger-clock.js';
13
- import { useNow } from '../../../internal/reminders/use-refetch-after-fire.js';
14
13
  import { cn } from '../../../internal/lib/utils.js';
14
+ import { useNow } from '@kortix/sdk/react';
15
15
  import { Fragment } from 'react';
16
16
  import { describeNextRun, describeWhen, triggerName, triggerSubtitle } from './schedule-copy.js';
17
17
  import { TriggerTile } from './trigger-tile.js';
@@ -30,7 +30,7 @@ export function nextRunLabel(trigger, t, locale, now) {
30
30
  }
31
31
  export function TriggerList({ triggers, groups, eventNames, selectedSlug, runningSlug = null, onOpen, selection = null, projectPaused = false, }) {
32
32
  // A 30 s tick: the list's poll keeps unchanged data, so nothing else re-renders the countdown.
33
- const now = useNow();
33
+ const now = useNow(30_000);
34
34
  const row = (trigger) => (_jsx(TriggerRow, { trigger: trigger, now: now, eventNames: eventNames, selected: !selection && trigger.slug === selectedSlug, running: trigger.slug === runningSlug, onOpen: () => onOpen(trigger), checked: selection ? selection.selected.has(trigger.slug) : null, projectPaused: projectPaused, onToggle: (range) => selection?.onToggle(trigger, range) }, trigger.slug));
35
35
  return (
36
36
  // A resting panel (`bg-card`, border, `rounded-lg`), so the rows sit on a
@@ -17,30 +17,30 @@ export declare const TRIGGER_SESSION_ACCESS_COPY: {
17
17
  readonly heading: "Who can open sessions this trigger creates";
18
18
  readonly private: {
19
19
  readonly label: "Trigger managers only";
20
- readonly desc: "Anyone whose project role includes the project.trigger.update permission — Project manager by default — plus account owners and admins. The trigger's own agent always can.";
20
+ readonly desc: "Anyone whose access role includes the project.trigger.update permission — Manager by default — plus workspace owners and admins. The trigger's own agent always can.";
21
21
  };
22
22
  readonly members: {
23
23
  readonly label: "Selected teammates";
24
24
  readonly desc: "The members and groups you pick, in addition to trigger managers.";
25
25
  };
26
26
  readonly project: {
27
- readonly label: "Whole project";
28
- readonly desc: "Every project member.";
27
+ readonly label: "Whole workspace";
28
+ readonly desc: "Every workspace member.";
29
29
  };
30
30
  };
31
31
  export declare function triggerSessionAccessCopy(tI18nComplete: UiTranslator): {
32
32
  readonly heading: "Who can open sessions this trigger creates";
33
33
  readonly private: {
34
34
  readonly label: "Trigger managers only";
35
- readonly desc: "Anyone whose project role includes the project.trigger.update permission — Project manager by default — plus account owners and admins. The trigger's own agent always can.";
35
+ readonly desc: "Anyone whose access role includes the project.trigger.update permission — Manager by default — plus workspace owners and admins. The trigger's own agent always can.";
36
36
  };
37
37
  readonly members: {
38
38
  readonly label: "Selected teammates";
39
39
  readonly desc: "The members and groups you pick, in addition to trigger managers.";
40
40
  };
41
41
  readonly project: {
42
- readonly label: "Whole project";
43
- readonly desc: "Every project member.";
42
+ readonly label: "Whole workspace";
43
+ readonly desc: "Every workspace member.";
44
44
  };
45
45
  };
46
46
  import type { UiTranslator } from '../../../i18n/index.js';