@kortix/ui 0.15.7 → 0.15.9

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 (262) hide show
  1. package/README.md +7 -7
  2. package/dist/_vendor/kortix-shared.js +39 -1
  3. package/dist/_vendor/shared/my-kortix-agent.d.ts +7 -0
  4. package/dist/_vendor/shared/pixel-mark.d.ts +18 -0
  5. package/dist/access/access/access-dialog-share.js +12 -6
  6. package/dist/access/access/share-selection.d.ts +9 -0
  7. package/dist/access/access/share-selection.js +64 -0
  8. package/dist/customize/connectors/catalog/connector-categories.d.ts +2 -2
  9. package/dist/customize/connectors/catalog/connector-categories.js +2 -2
  10. package/dist/customize/connectors/connector-identity.js +3 -3
  11. package/dist/customize/connectors/detail/app-page.js +2 -2
  12. package/dist/customize/connectors/detail/connector-accounts.d.ts +3 -1
  13. package/dist/customize/connectors/detail/connector-accounts.js +2 -2
  14. package/dist/customize/connectors/detail/connector-modal.js +1 -1
  15. package/dist/customize/connectors/detail/connector-notice-view.d.ts +4 -0
  16. package/dist/customize/connectors/detail/connector-notice-view.js +4 -0
  17. package/dist/customize/connectors/detail/connector-notice.d.ts +31 -4
  18. package/dist/customize/connectors/detail/connector-notice.js +23 -4
  19. package/dist/customize/connectors/detail/connector-page.js +27 -7
  20. package/dist/customize/connectors/detail/connector-status.d.ts +12 -1
  21. package/dist/customize/connectors/detail/connector-status.js +11 -0
  22. package/dist/customize/connectors/detail/status-badge.d.ts +3 -3
  23. package/dist/customize/connectors/detail/status-badge.js +2 -1
  24. package/dist/customize/connectors/detail/use-connector-detail.js +10 -2
  25. package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.d.ts +13 -0
  26. package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.js +29 -0
  27. package/dist/customize/providers/provider-accordion.js +5 -4
  28. package/dist/customize/providers/provider-connect.js +3 -1
  29. package/dist/customize/providers/provider-sheet.js +9 -4
  30. package/dist/customize/sections/component/email-connect-form.js +4 -2
  31. package/dist/customize/sections/connectors-view.d.ts +4 -1
  32. package/dist/customize/sections/connectors-view.js +42 -7
  33. package/dist/customize/sections/gateway-view.d.ts +1 -1
  34. package/dist/customize/sections/gateway-view.js +1 -1
  35. package/dist/customize/sections/view/account-secret-resources-panel.d.ts +15 -0
  36. package/dist/customize/sections/view/account-secret-resources-panel.js +48 -7
  37. package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
  38. package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
  39. package/dist/customize/sections/view/git-view.js +1 -1
  40. package/dist/customize/sections/view/permission-editor.js +1 -1
  41. package/dist/customize/sections/view/secret-delivery.d.ts +9 -2
  42. package/dist/customize/sections/view/secret-delivery.js +14 -4
  43. package/dist/customize/sections/view/secrets-view.js +21 -5
  44. package/dist/customize/sections/view/subscription-usage.d.ts +3 -32
  45. package/dist/customize/sections/view/subscription-usage.js +2 -86
  46. package/dist/customize/shared/entity/entity-modal.js +8 -10
  47. package/dist/customize/triggers/schedule/schedule-builder.js +1 -1
  48. package/dist/customize/triggers/schedule/schedule-copy.js +4 -0
  49. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +14 -3
  50. package/dist/customize/triggers/schedule/then-fields.d.ts +3 -1
  51. package/dist/customize/triggers/schedule/then-fields.js +8 -4
  52. package/dist/customize/triggers/schedule/trigger-composer.js +1 -1
  53. package/dist/customize/triggers/schedule/trigger-list.d.ts +3 -1
  54. package/dist/customize/triggers/schedule/trigger-list.js +18 -2
  55. package/dist/customize/triggers/schedule/trigger-runs-logic.js +4 -2
  56. package/dist/customize/triggers/schedule/trigger-runs-panel.js +4 -1
  57. package/dist/files/project/components/drive-toolbar.d.ts +1 -1
  58. package/dist/files/project/components/drive-toolbar.js +1 -1
  59. package/dist/files/project/store/version-store.d.ts +1 -1
  60. package/dist/files/renderers/pptx-renderer.js +5 -20
  61. package/dist/files/renderers/presentation/FullScreenPresentationViewer.d.ts +3 -2
  62. package/dist/files/renderers/presentation/FullScreenPresentationViewer.js +23 -304
  63. package/dist/files/renderers/presentation/presentation-export-menu.d.ts +14 -0
  64. package/dist/files/renderers/presentation/presentation-export-menu.js +44 -0
  65. package/dist/files/renderers/presentation/presentation-utils.d.ts +1 -0
  66. package/dist/files/renderers/presentation/presentation-utils.js +4 -0
  67. package/dist/files/renderers/presentation/slide-iframe.d.ts +23 -0
  68. package/dist/files/renderers/presentation/slide-iframe.js +61 -0
  69. package/dist/files/renderers/presentation/use-presentation-metadata.d.ts +39 -0
  70. package/dist/files/renderers/presentation/use-presentation-metadata.js +137 -0
  71. package/dist/files/renderers/presentation/use-slide-navigation.d.ts +17 -0
  72. package/dist/files/renderers/presentation/use-slide-navigation.js +82 -0
  73. package/dist/files/renderers/shared/scroll-area-compat.d.ts +6 -6
  74. package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
  75. package/dist/files/renderers/shared/select-compat.js +3 -7
  76. package/dist/files/renderers/shared/use-stage-fit-scale.d.ts +19 -0
  77. package/dist/files/renderers/shared/use-stage-fit-scale.js +41 -0
  78. package/dist/files/renderers/show-content-renderer.js +16 -11
  79. package/dist/files/renderers/xlsx/xlsx-renderer.d.ts +4 -13
  80. package/dist/files/renderers/xlsx/xlsx-renderer.js +6 -63
  81. package/dist/files/renderers/xlsx/xlsx-viewer.d.ts +4 -2
  82. package/dist/files/renderers/xlsx/xlsx-viewer.js +28 -34
  83. package/dist/files/viewer/file-content-renderer.js +1 -4
  84. package/dist/files/viewer/file-preview-modal.d.ts +10 -11
  85. package/dist/files/viewer/file-preview-modal.js +17 -18
  86. package/dist/files/viewer/use-file-content-state.js +10 -9
  87. package/dist/i18n/en.d.ts +51 -0
  88. package/dist/i18n/en.js +58 -7
  89. package/dist/index.js +1 -1
  90. package/dist/internal/account-hub/account-hub-location.js +2 -2
  91. package/dist/internal/account-hub/use-account-members.d.ts +28 -1
  92. package/dist/internal/account-hub/use-account-members.js +27 -10
  93. package/dist/internal/chrome/use-chrome-offered.d.ts +2 -1
  94. package/dist/internal/chrome/use-chrome-offered.js +4 -2
  95. package/dist/internal/components/agent-mark.d.ts +1 -8
  96. package/dist/internal/components/agent-mark.js +2 -19
  97. package/dist/internal/hooks/connectors/use-finish-sign-in.d.ts +13 -0
  98. package/dist/internal/hooks/connectors/use-finish-sign-in.js +33 -0
  99. package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +6 -1
  100. package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +6 -1
  101. package/dist/internal/lib/error-handler.js +33 -0
  102. package/dist/internal/lib/navigation/modified-click.js +2 -2
  103. package/dist/internal/lib/pixel-mark.d.ts +3 -20
  104. package/dist/internal/lib/pixel-mark.js +3 -34
  105. package/dist/internal/lib/trigger-clock.d.ts +7 -2
  106. package/dist/internal/lib/trigger-clock.js +17 -3
  107. package/dist/internal/stores/active-space-store.d.ts +1 -1
  108. package/dist/internal/stores/browser-recents-store.d.ts +1 -1
  109. package/dist/internal/stores/current-account-store.d.ts +1 -1
  110. package/dist/internal/stores/first-chat-store.d.ts +1 -1
  111. package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
  112. package/dist/internal/stores/session-browser-store.d.ts +1 -1
  113. package/dist/internal/stores/session-expanded-store.d.ts +1 -1
  114. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  115. package/dist/internal/stores/session-history-view-store.d.ts +1 -1
  116. package/dist/internal/stores/session-hover-store.d.ts +1 -1
  117. package/dist/internal/stores/session-hover-store.js +1 -1
  118. package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
  119. package/dist/internal/stores/sound-store.d.ts +1 -1
  120. package/dist/internal/stores/tab-store.d.ts +1 -1
  121. package/dist/internal/stores/user-preferences-store.d.ts +1 -1
  122. package/dist/internal/stores/web-notification-store.d.ts +1 -1
  123. package/dist/lib/base-ui-compat.d.ts +149 -0
  124. package/dist/lib/base-ui-compat.js +339 -0
  125. package/dist/lib/portal-container.d.ts +3 -7
  126. package/dist/lib/portal-container.js +5 -3
  127. package/dist/lib/z-stack.d.ts +9 -5
  128. package/dist/lib/z-stack.js +17 -7
  129. package/dist/primitives/accordion.d.ts +36 -5
  130. package/dist/primitives/accordion.js +41 -8
  131. package/dist/primitives/alert-dialog.d.ts +33 -11
  132. package/dist/primitives/alert-dialog.js +41 -19
  133. package/dist/primitives/avatar.d.ts +5 -2
  134. package/dist/primitives/avatar.js +3 -3
  135. package/dist/primitives/badge.js +1 -1
  136. package/dist/primitives/breadcrumb.js +1 -1
  137. package/dist/primitives/button-group.js +3 -3
  138. package/dist/primitives/button.js +1 -1
  139. package/dist/primitives/checkbox.d.ts +14 -5
  140. package/dist/primitives/checkbox.js +24 -9
  141. package/dist/primitives/collapsible.d.ts +16 -4
  142. package/dist/primitives/collapsible.js +18 -7
  143. package/dist/primitives/command-core.d.ts +121 -0
  144. package/dist/primitives/command-core.js +642 -0
  145. package/dist/primitives/command.d.ts +38 -4
  146. package/dist/primitives/command.js +22 -13
  147. package/dist/primitives/context-menu.d.ts +61 -31
  148. package/dist/primitives/context-menu.js +40 -53
  149. package/dist/primitives/dialog.d.ts +48 -10
  150. package/dist/primitives/dialog.js +48 -19
  151. package/dist/primitives/disclosure.d.ts +1 -1
  152. package/dist/primitives/disclosure.js +2 -2
  153. package/dist/primitives/drawer.d.ts +28 -9
  154. package/dist/primitives/drawer.js +42 -18
  155. package/dist/primitives/dropdown-menu.d.ts +55 -33
  156. package/dist/primitives/dropdown-menu.js +46 -82
  157. package/dist/primitives/faded-scroll-area.js +2 -1
  158. package/dist/primitives/hint.js +3 -3
  159. package/dist/primitives/hover-card.d.ts +17 -5
  160. package/dist/primitives/hover-card.js +45 -8
  161. package/dist/primitives/item.js +2 -2
  162. package/dist/primitives/label.d.ts +5 -2
  163. package/dist/primitives/label.js +10 -3
  164. package/dist/primitives/menu-base.d.ts +150 -0
  165. package/dist/primitives/menu-base.js +171 -0
  166. package/dist/primitives/menu-recipe.d.ts +1 -1
  167. package/dist/primitives/menu-recipe.js +2 -7
  168. package/dist/primitives/modal.d.ts +19 -52
  169. package/dist/primitives/modal.js +24 -28
  170. package/dist/primitives/navigation-menu.d.ts +36 -11
  171. package/dist/primitives/navigation-menu.js +31 -12
  172. package/dist/primitives/popover.d.ts +31 -6
  173. package/dist/primitives/popover.js +79 -12
  174. package/dist/primitives/preview-image.d.ts +18 -7
  175. package/dist/primitives/preview-image.js +14 -11
  176. package/dist/primitives/progress.d.ts +4 -2
  177. package/dist/primitives/progress.js +4 -3
  178. package/dist/primitives/project-icon-picker.js +2 -2
  179. package/dist/primitives/radio-group.d.ts +28 -5
  180. package/dist/primitives/radio-group.js +18 -10
  181. package/dist/primitives/scroll-area.d.ts +2 -2
  182. package/dist/primitives/scroll-area.js +8 -3
  183. package/dist/primitives/select.d.ts +55 -12
  184. package/dist/primitives/select.js +93 -36
  185. package/dist/primitives/separator.d.ts +6 -2
  186. package/dist/primitives/separator.js +10 -2
  187. package/dist/primitives/sheet.d.ts +17 -10
  188. package/dist/primitives/sheet.js +19 -22
  189. package/dist/primitives/sidebar-menu-primitives.js +8 -8
  190. package/dist/primitives/slider-native.d.ts +2 -2
  191. package/dist/primitives/slider-native.js +11 -9
  192. package/dist/primitives/slider.d.ts +24 -6
  193. package/dist/primitives/slider.js +26 -24
  194. package/dist/primitives/slot.d.ts +6 -0
  195. package/dist/primitives/slot.js +7 -0
  196. package/dist/primitives/split-sheet.js +1 -1
  197. package/dist/primitives/stepper.js +1 -1
  198. package/dist/primitives/switch.d.ts +16 -3
  199. package/dist/primitives/switch.js +7 -6
  200. package/dist/primitives/tabs.d.ts +36 -20
  201. package/dist/primitives/tabs.js +131 -102
  202. package/dist/primitives/toggle.d.ts +16 -3
  203. package/dist/primitives/toggle.js +8 -3
  204. package/dist/primitives/tooltip.d.ts +24 -5
  205. package/dist/primitives/tooltip.js +32 -10
  206. package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
  207. package/dist/primitives/type-to-confirm-dialog.js +1 -1
  208. package/dist/session/composer/animated-placeholder.js +1 -1
  209. package/dist/session/composer/chat-input/chat-input-control.js +3 -3
  210. package/dist/session/composer/editor/composer-editor.js +1 -1
  211. package/dist/session/composer/menus/menu-shell.d.ts +1 -1
  212. package/dist/session/composer/menus/menu-shell.js +1 -1
  213. package/dist/session/composer/menus/mount.js +1 -1
  214. package/dist/session/composer/reasoning-effort-selector.js +1 -1
  215. package/dist/session/header/session-site-header.js +2 -2
  216. package/dist/session/header/subagent-hover-card.js +2 -2
  217. package/dist/session/media/image-preview.js +1 -1
  218. package/dist/session/models/model-connection-gate.js +16 -3
  219. package/dist/session/models/model-picker-panel.js +6 -2
  220. package/dist/session/models/model-selector.d.ts +1 -1
  221. package/dist/session/models/model-selector.js +18 -12
  222. package/dist/session/models/provider-key-action.d.ts +10 -0
  223. package/dist/session/models/provider-key-action.js +35 -0
  224. package/dist/session/models/provider-key-slot.d.ts +9 -0
  225. package/dist/session/models/provider-key-slot.js +19 -0
  226. package/dist/session/models/subscription-switcher.d.ts +37 -0
  227. package/dist/session/models/subscription-switcher.js +97 -0
  228. package/dist/session/models/subscription-windows.d.ts +40 -0
  229. package/dist/session/models/subscription-windows.js +86 -0
  230. package/dist/session/overrides/session-overrides-control.js +3 -3
  231. package/dist/session/panel/diff-dialog.js +1 -1
  232. package/dist/session/panel/easy/detail-view.js +3 -3
  233. package/dist/session/panel/mobile-tool-drawer.js +2 -2
  234. package/dist/session/panel/panel-fallback.js +1 -1
  235. package/dist/session/panel/session-files-explorer.d.ts +1 -1
  236. package/dist/session/panel/session-files-explorer.js +1 -1
  237. package/dist/session/prompts/session-connect-prompt.d.ts +40 -0
  238. package/dist/session/prompts/session-connect-prompt.js +126 -0
  239. package/dist/session/status/session-error-banner.d.ts +1 -1
  240. package/dist/session/status/session-error-banner.js +12 -4
  241. package/dist/session/thread/session-chat.js +9 -4
  242. package/dist/session/thread/session-context-message-explorer.js +1 -1
  243. package/dist/session/thread/transcript.js +31 -7
  244. package/dist/session/thread/turn-share.js +3 -4
  245. package/dist/session/tool/shared/show-helpers.js +1 -1
  246. package/dist/session/turn/message-time-label.js +1 -1
  247. package/dist/styles.css +1 -1
  248. package/dist/test-utils/intl.d.ts +51 -0
  249. package/dist/workspace/projects/modal/project-icon-field.js +9 -23
  250. package/dist/workspace/review/review-center.js +1 -1
  251. package/dist/workspace/sessions/session-row.js +1 -1
  252. package/dist/workspace/sidebar/project-session-list.js +2 -2
  253. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
  254. package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
  255. package/dist/workspace/sidebar/session-title.d.ts +2 -2
  256. package/dist/workspace/sidebar/session-title.js +2 -2
  257. package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
  258. package/dist/workspace/spaces/space-links.js +1 -1
  259. package/dist/workspace/spaces/space-threads-tab.js +1 -1
  260. package/package.json +16 -35
  261. package/skills/kortix-ui/SKILL.md +1 -1
  262. package/skills/kortix-ui/references/custom-dashboard.md +1 -1
@@ -193,7 +193,7 @@ export function ProjectDefaultPicker({ projectId }) {
193
193
  * character.
194
194
  *
195
195
  * One section at a time, by the caller's state — NOT seven `TabsContent`
196
- * panels. Radix keeps every panel in the tree and each one used to open its
196
+ * panels. `Tabs` keeps every panel element in the tree and each one used to open its
197
197
  * own `overflow-y-auto`, which is how this page ended up with three nested
198
198
  * scroll containers under a shell that already had one.
199
199
  *
@@ -1,3 +1,18 @@
1
+ /**
2
+ * The line above the provider list with pooled provider keys on: new keys and
3
+ * accounts are shared with the workspace, or, for a viewer who may not share,
4
+ * only theirs. A component, so the permission read runs only where it shows.
5
+ */
6
+ export declare function PooledProvidersNote({ projectId, className }: {
7
+ projectId: string;
8
+ className?: string;
9
+ }): import("react").JSX.Element;
10
+ /**
11
+ * Whether a new provider key or account the viewer adds is shared with the
12
+ * workspace by default. A viewer without `project.secret.write` adds only
13
+ * private ones ("Only you"), so the copy above each list must say so.
14
+ */
15
+ export declare function useCanShareProviderAccounts(projectId: string): boolean;
1
16
  /**
2
17
  * Provider keys live beside the provider they configure. The secret value stays
3
18
  * write-only. With `oauth`, the panel manages ChatGPT or Claude accounts: any
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
4
4
  import { useCallback, useEffect, useRef, useState } from 'react';
5
5
  import { useTranslations } from '../../../i18n/index.js';
6
- import { ApiError, createAccountSecretResource, deleteAccountSecretResource, listAccountMembers, setAccountSecretResourceAccess, rotateAccountSecretResource, pollProjectProviderOAuth, startProjectProviderOAuth, completeClaudeSubscriptionLogin, startClaudeSubscriptionLogin, } from '@kortix/sdk';
6
+ import { ApiError, createAccountSecretResource, deleteAccountSecretResource, listAccountMembers, setAccountSecretResourceAccess, rotateAccountSecretResource, verifyAccountSecretResource, pollProjectProviderOAuth, startProjectProviderOAuth, completeClaudeSubscriptionLogin, startClaudeSubscriptionLogin, } from '@kortix/sdk';
7
7
  import { refreshProjectProviderState, useAccountSecretResources } from '@kortix/sdk/react';
8
8
  import { ChatGptDeviceChallenge } from '../llm-provider/chatgpt-device-challenge.js';
9
9
  import { ClaudeCodeStep } from '../llm-provider/claude-code-step.js';
@@ -206,6 +206,24 @@ function useClaudeAuthorization(projectId) {
206
206
  }, [projectId]);
207
207
  return { challenge, waiting, finishing, checking, error, authorize, cancel, reset, submitCode };
208
208
  }
209
+ /**
210
+ * The line above the provider list with pooled provider keys on: new keys and
211
+ * accounts are shared with the workspace, or, for a viewer who may not share,
212
+ * only theirs. A component, so the permission read runs only where it shows.
213
+ */
214
+ export function PooledProvidersNote({ projectId, className }) {
215
+ const t = useTranslations('pooledSecrets');
216
+ const canShare = useCanShareProviderAccounts(projectId);
217
+ return _jsx("p", { className: className, children: t(canShare ? 'sharedDescription' : 'sharedOnlyYouDescription') });
218
+ }
219
+ /**
220
+ * Whether a new provider key or account the viewer adds is shared with the
221
+ * workspace by default. A viewer without `project.secret.write` adds only
222
+ * private ones ("Only you"), so the copy above each list must say so.
223
+ */
224
+ export function useCanShareProviderAccounts(projectId) {
225
+ return useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_SECRET_WRITE).allowed === true;
226
+ }
209
227
  /**
210
228
  * Provider keys live beside the provider they configure. The secret value stays
211
229
  * write-only. With `oauth`, the panel manages ChatGPT or Claude accounts: any
@@ -222,7 +240,7 @@ export function AccountSecretResourcesPanel({ accountId, projectId, providerId,
222
240
  const resources = useAccountSecretResources(accountId, projectId);
223
241
  // Hide share controls on anything but an explicit grant: an owner-only
224
242
  // connection is always allowed, so a slow probe never blocks the common case.
225
- const canShare = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_SECRET_WRITE).allowed === true;
243
+ const canShare = useCanShareProviderAccounts(projectId);
226
244
  const [creating, setCreating] = useState(false);
227
245
  const [label, setLabel] = useState('');
228
246
  const [value, setValue] = useState('');
@@ -233,7 +251,9 @@ export function AccountSecretResourcesPanel({ accountId, projectId, providerId,
233
251
  if (reconnecting && reconnecting.label !== reconnectLabel)
234
252
  setReconnectLabel(reconnecting.label);
235
253
  const [sharing, setSharing] = useState(null);
236
- // New connections are private to their creator: sharing is opt-in.
254
+ // A new connection is shared with everyone in the workspace. A viewer who may
255
+ // not share gets "Only you", the one choice the API accepts from them.
256
+ // `openCreate` sets it from the probe's answer when the dialog opens.
237
257
  const [createMode, setCreateMode] = useState('private');
238
258
  const [sharingMode, setSharingMode] = useState('project');
239
259
  const [selectedMembers, setSelectedMembers] = useState(NO_MEMBERS);
@@ -321,16 +341,37 @@ export function AccountSecretResourcesPanel({ accountId, projectId, providerId,
321
341
  value, consumer: 'llm_gateway', strategy: 'broker',
322
342
  });
323
343
  },
324
- onSuccess: async () => {
344
+ onSuccess: async (saved) => {
325
345
  await refresh();
326
346
  setCreating(false);
327
347
  setRotating(null);
328
348
  setLabel('');
329
349
  setValue('');
330
- successToast(t('saved'));
350
+ // The server checked the key with one call to the provider. A refusal
351
+ // keeps the key saved; it says so instead of a plain "saved".
352
+ const verification = saved?.verification;
353
+ if (verification?.status === 'invalid')
354
+ errorToast(t('savedInvalid', { provider: providerName, message: verification.message }));
355
+ else
356
+ successToast(verification?.status === 'verified' ? t('savedVerified') : t('saved'));
331
357
  },
332
358
  onError: (error) => errorToast(error instanceof Error ? error.message : t('saveError')),
333
359
  });
360
+ const verify = useMutation({
361
+ mutationFn: (secretId) => verifyAccountSecretResource(accountId, secretId),
362
+ onSettled: async () => { await refresh(); },
363
+ onError: (error) => errorToast(error instanceof Error ? error.message : t('checkError')),
364
+ });
365
+ const verificationLine = (secret) => {
366
+ const verification = secret.verification;
367
+ if (oauth || !verification)
368
+ return null;
369
+ if (verification.status === 'verified')
370
+ return _jsx("span", { className: "text-muted-foreground block text-xs font-normal", children: t('keyVerified', { provider: providerName }) });
371
+ if (verification.status === 'invalid')
372
+ return _jsx("span", { className: "text-destructive block text-xs font-normal break-words", children: t('keyInvalid', { provider: providerName, message: verification.message }) });
373
+ return _jsx("span", { className: "text-muted-foreground block text-xs font-normal break-words", children: t('keyUnchecked', { message: verification.message }) });
374
+ };
334
375
  const remove = useMutation({
335
376
  mutationFn: (secretId) => deleteAccountSecretResource(accountId, secretId),
336
377
  onSuccess: async () => { await refresh(); setDeleting(null); successToast(t('deleted')); },
@@ -351,7 +392,7 @@ export function AccountSecretResourcesPanel({ accountId, projectId, providerId,
351
392
  },
352
393
  });
353
394
  const openCreate = () => {
354
- setCreateMode('private');
395
+ setCreateMode(canShare ? 'project' : 'private');
355
396
  setSelectedMembers(NO_MEMBERS);
356
397
  setLabel(defaultLabel());
357
398
  save.reset();
@@ -385,7 +426,7 @@ export function AccountSecretResourcesPanel({ accountId, projectId, providerId,
385
426
  // A subscription login names its email and plan, and shows every plan
386
427
  // window under it; the sheet's summary sits above this list.
387
428
  const usageShown = Boolean(oauth) && isSubscriptionLogin(secret) && !undecryptable;
388
- return (_jsxs("li", { className: usageShown ? 'border-border flex min-w-0 items-start gap-3 rounded-md border px-3 py-2' : 'border-border flex min-w-0 items-center gap-3 rounded-md border px-3 py-1.5', children: [_jsxs("span", { className: "text-foreground min-w-0 flex-1 text-sm font-medium", children: [_jsx("span", { className: "block break-words", children: secret.label }), usageShown && oauth && _jsx(SubscriptionAccountLine, { accountId: accountId, projectId: oauth.projectId, secret: secret }), _jsx("span", { className: "text-muted-foreground block text-xs font-normal", children: accessLine(secret) }), stale && (_jsx("span", { className: "text-muted-foreground block text-xs font-normal", children: t('needsReconnection') })), !(usageShown && secret.usage) && secret.cooldown_until && Date.parse(secret.cooldown_until) > resources.dataUpdatedAt && (_jsx("span", { className: "text-muted-foreground block text-xs font-normal", children: t('coolingDown') })), usageShown && oauth && _jsx(SubscriptionAccountUsage, { accountId: accountId, projectId: oauth.projectId, secret: secret })] }), undecryptable && _jsx(UndecryptableValue, { hint: tUndecryptable(oauth ? 'loginHint' : 'keyHint') }), (stale || undecryptable) && canReconnect && (_jsx(Button, { size: "sm", variant: "secondary", "aria-label": t('reconnectTitle', { label: secret.label }), onClick: () => openReconnect(secret), children: t('reconnectAccount') })), undecryptable && canManage && !oauth && (_jsx(Button, { size: "sm", variant: "secondary", onClick: () => { setValue(''); save.reset(); setRotating(secret); }, children: tUndecryptable('reenterKey') })), (canManage || canReconnect) && _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { size: "icon-sm", variant: "ghost", "aria-label": t('actionsFor', { label: secret.label }), children: _jsx(DotsThreeIcon, { className: "size-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [canReconnect && _jsx(DropdownMenuItem, { onSelect: () => openReconnect(secret), children: t('reconnectAccount') }), canChangeAccess && _jsx(DropdownMenuItem, { onSelect: () => { changeGrant.reset(); setSharingMode(secret.access_mode); setSelectedMembers({ memberIds: secret.granted_user_ids, groupIds: [], inviteEmails: [] }); setSharing(secret); }, children: t('manageAccess') }), canManage && !oauth && _jsx(DropdownMenuItem, { onSelect: () => { setValue(''); save.reset(); setRotating(secret); }, children: t('rotateKey') }), canManage && _jsx(DropdownMenuItem, { onSelect: () => setDeleting(secret), children: oauth ? t('deleteAccount') : t('deleteKey') })] })] })] }, secret.secret_id));
429
+ return (_jsxs("li", { className: usageShown ? 'border-border flex min-w-0 items-start gap-3 rounded-md border px-3 py-2' : 'border-border flex min-w-0 items-center gap-3 rounded-md border px-3 py-1.5', children: [_jsxs("span", { className: "text-foreground min-w-0 flex-1 text-sm font-medium", children: [_jsx("span", { className: "block break-words", children: secret.label }), usageShown && oauth && _jsx(SubscriptionAccountLine, { accountId: accountId, projectId: oauth.projectId, secret: secret }), _jsx("span", { className: "text-muted-foreground block text-xs font-normal", children: accessLine(secret) }), verificationLine(secret), stale && (_jsx("span", { className: "text-muted-foreground block text-xs font-normal", children: t('needsReconnection') })), !(usageShown && secret.usage) && secret.cooldown_until && Date.parse(secret.cooldown_until) > resources.dataUpdatedAt && (_jsx("span", { className: "text-muted-foreground block text-xs font-normal", children: t('coolingDown') })), usageShown && oauth && _jsx(SubscriptionAccountUsage, { accountId: accountId, projectId: oauth.projectId, secret: secret })] }), undecryptable && _jsx(UndecryptableValue, { hint: tUndecryptable(oauth ? 'loginHint' : 'keyHint') }), (stale || undecryptable) && canReconnect && (_jsx(Button, { size: "sm", variant: "secondary", "aria-label": t('reconnectTitle', { label: secret.label }), onClick: () => openReconnect(secret), children: t('reconnectAccount') })), undecryptable && canManage && !oauth && (_jsx(Button, { size: "sm", variant: "secondary", onClick: () => { setValue(''); save.reset(); setRotating(secret); }, children: tUndecryptable('reenterKey') })), (canManage || canReconnect) && _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { size: "icon-sm", variant: "ghost", "aria-label": t('actionsFor', { label: secret.label }), children: _jsx(DotsThreeIcon, { className: "size-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [canReconnect && _jsx(DropdownMenuItem, { onSelect: () => openReconnect(secret), children: t('reconnectAccount') }), canChangeAccess && _jsx(DropdownMenuItem, { onSelect: () => { changeGrant.reset(); setSharingMode(secret.access_mode); setSelectedMembers({ memberIds: secret.granted_user_ids, groupIds: [], inviteEmails: [] }); setSharing(secret); }, children: t('manageAccess') }), canManage && !oauth && secret.project_id && _jsx(DropdownMenuItem, { disabled: verify.isPending, onSelect: () => verify.mutate(secret.secret_id), children: t('checkKey') }), canManage && !oauth && _jsx(DropdownMenuItem, { onSelect: () => { setValue(''); save.reset(); setRotating(secret); }, children: t('rotateKey') }), canManage && _jsx(DropdownMenuItem, { onSelect: () => setDeleting(secret), children: oauth ? t('deleteAccount') : t('deleteKey') })] })] })] }, secret.secret_id));
389
430
  }) })) : null, _jsx(Modal, { open: creating || rotating !== null, onOpenChange: (open) => { if (!open && !save.isPending && !authorization.finishing)
390
431
  closeCreate(); }, children: _jsxs(ModalContent, { className: "lg:max-w-md", children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: rotating ? t('rotateLabel', { label: rotating.label }) : `${oauth ? t('addAccount') : t('addKey')} · ${providerName}` }), _jsx(ModalDescription, { children: rotating ? t('valueNeverShown') : oauth ? tAccount('oauthCreationDescription', 'claudeOauthCreationDescription') : t('creationDescription') })] }), _jsxs(ModalBody, { className: "max-h-[60vh] space-y-3 overflow-y-auto", children: [save.isError && _jsx("p", { role: "alert", className: "text-destructive text-sm", children: save.error instanceof Error ? save.error.message : t('saveError') }), oauth && authorization.error && _jsx("p", { role: "alert", className: "text-destructive text-sm", children: authorization.error }), !rotating && _jsx(_Fragment, { children: _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: `provider-key-label-${providerId}`, children: t('label') }), _jsx(Input, { id: `provider-key-label-${providerId}`, value: label, disabled: busy, onChange: (event) => setLabel(event.target.value), placeholder: oauth ? tAccount('accountLabelPlaceholder', 'claudeAccountLabelPlaceholder') : t('primaryKey'), maxLength: 100 })] }) }), oauth ? authorization.finishing ? _jsx(ChatGptSignInFinishing, { label: t('oauthFinishing') })
391
432
  : (authorization.challenge || (claude && authorization.waiting)) && signInStep(authorization.challenge) :
@@ -30,7 +30,7 @@ import { modelRefToKey } from '@kortix/sdk';
30
30
  import { flattenModels, modelKeyToWire, modelProviderMode, useRuntimeProviders, } from '@kortix/sdk/react';
31
31
  import { AGENT_MODE_HELP, AGENT_MODE_LABEL, AGENT_MODES } from './agent-editor-catalog.js';
32
32
  import { EditorSection, InlineAction, SettingBlock, SettingRow } from './agent-editor-primitives.js';
33
- /** Matches the access section's inherit sentinel — Radix forbids `""`. */
33
+ /** Matches the access section's inherit sentinel — `Select` reads `""` as no value. */
34
34
  const INHERIT = '__inherit__';
35
35
  export function BasicsSection({ draft, set, oc, setOc, showDescription = true, }) {
36
36
  const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
@@ -9,7 +9,7 @@ import type { GatewayLogFilters, GatewayLogRow } from '@kortix/sdk';
9
9
  * roving tabindex, and controls no panel. Assistive tech saw three unselected
10
10
  * tabs; keyboard users got no arrow-key movement. It is also not the house
11
11
  * filter control. Replaced with the sanctioned `Tabs`/`TabsList` pair
12
- * (Radix — real `aria-selected`, real roving tabindex), same as the analytics
12
+ * (real `aria-selected`, real roving tabindex), same as the analytics
13
13
  * range picker.
14
14
  * 2. The header read `Live · {logs.length}`, which looked like a total but was
15
15
  * the page size. `All` and `Success` both showed `100` (the server caps a
@@ -181,7 +181,7 @@ function SaveStatus() {
181
181
  * The default-branch picker: a searchable list, not a `<Select>`.
182
182
  *
183
183
  * A long-lived project's remote holds one branch per session, thousands of
184
- * refs. A Radix `<Select>` mounts every option, so opening this pane on such
184
+ * refs. A `<Select>` mounts every option, so opening this pane on such
185
185
  * a project froze the tab and then crashed it. This list renders at most
186
186
  * `BRANCH_PICKER_LIMIT` rows (`filterBranchNames`) and filters as the person
187
187
  * types. The current value always renders, also before `/branches` answers.
@@ -14,7 +14,7 @@ import { PERMISSION_ACTION_LABEL, PERMISSION_ACTION_ONLY_GROUP_LABEL, PERMISSION
14
14
  import { SettingsRow, SettingsRowGroup } from '../../../primitives/settings-row.js';
15
15
  import { SettingsSubsectionHeader } from '../../../primitives/settings-subsection-header.js';
16
16
  import { EditorSection } from './agent-editor-primitives.js';
17
- /** Radix forbids `""` as an item value, so the inherit state carries a sentinel. */
17
+ /** `Select` reads `""` as no value, so the inherit state carries a sentinel. */
18
18
  const INHERIT = '__inherit__';
19
19
  /**
20
20
  * The one allow/ask/deny picker, bound to `PermissionAction`.
@@ -73,7 +73,14 @@ export declare function secretUsage(strategy: SecretDeliveryStrategy, consumer?:
73
73
  * would silently move the secret off the consumer its owning flow reads —
74
74
  * disconnecting a model provider, a connector, or a repository.
75
75
  */
76
- export declare function secretUsageIsAssigned(consumer?: SecretConsumer | null): boolean;
76
+ export declare function secretUsageIsAssigned(consumer?: SecretConsumer | null, opts?: SecretUsageContext): boolean;
77
+ /** What the row's surroundings say about its usage. */
78
+ export type SecretUsageContext = {
79
+ /** A connector resolves this secret. Unknown (absent) reads as bound. */
80
+ connectorBound?: boolean;
81
+ /** The user picked an exposure in this edit. */
82
+ picked?: boolean;
83
+ };
77
84
  /**
78
85
  * The `(strategy, consumer)` pair a save writes, given the picked exposure and
79
86
  * the row it is editing.
@@ -93,7 +100,7 @@ export declare function secretUsageIsAssigned(consumer?: SecretConsumer | null):
93
100
  export declare function secretDeliveryTarget(exposure: SecretExposure, row?: {
94
101
  strategy: SecretDeliveryStrategy;
95
102
  consumer: SecretConsumer | null;
96
- } | null): {
103
+ } | null, opts?: SecretUsageContext): {
97
104
  strategy: SecretDeliveryStrategy;
98
105
  consumer: SecretConsumer | null;
99
106
  };
@@ -53,8 +53,13 @@ export function secretUsage(strategy, consumer) {
53
53
  * would silently move the secret off the consumer its owning flow reads —
54
54
  * disconnecting a model provider, a connector, or a repository.
55
55
  */
56
- export function secretUsageIsAssigned(consumer) {
57
- return consumer === 'llm_gateway' || consumer === 'connector' || consumer === 'git_proxy';
56
+ export function secretUsageIsAssigned(consumer, opts) {
57
+ // A connector-only row that no connector uses (a value typed into a
58
+ // connector-scoped setup link and never bound) has no owning flow to
59
+ // disconnect: its owner picks its delivery.
60
+ if (consumer === 'connector')
61
+ return opts?.connectorBound ?? true;
62
+ return consumer === 'llm_gateway' || consumer === 'git_proxy';
58
63
  }
59
64
  /**
60
65
  * The `(strategy, consumer)` pair a save writes, given the picked exposure and
@@ -72,8 +77,13 @@ export function secretUsageIsAssigned(consumer) {
72
77
  *
73
78
  * Everything else writes the pair its exposure names (spec §3).
74
79
  */
75
- export function secretDeliveryTarget(exposure, row) {
76
- if (row && secretUsageIsAssigned(row.consumer)) {
80
+ export function secretDeliveryTarget(exposure, row, opts) {
81
+ if (row && secretUsageIsAssigned(row.consumer, opts)) {
82
+ return { strategy: row.strategy, consumer: row.consumer };
83
+ }
84
+ // An unbound connector row moves only when its owner picks an exposure: an
85
+ // unrelated save (a new value) keeps it where it is.
86
+ if (row?.consumer === 'connector' && !opts?.picked) {
77
87
  return { strategy: row.strategy, consumer: row.consumer };
78
88
  }
79
89
  if (exposure === 'enforced' && row?.strategy === 'broker' && row.consumer === 'http_broker') {
@@ -404,14 +404,26 @@ function SecretDialog({ open, onOpenChange, projectId, row, connectors, connecto
404
404
  */
405
405
  const [pickedExposure, setPickedExposure] = useState(null);
406
406
  const exposure = pickedExposure ?? defaultSecretExposure(row, classification);
407
- const { strategy, consumer: nextConsumer } = secretDeliveryTarget(exposure, row);
407
+ /**
408
+ * A connector-only row that no connector resolves (a value typed into a
409
+ * connector-scoped setup link, never bound) has no owning flow: its owner
410
+ * may move it to environment delivery. Unknown while connectors load.
411
+ */
412
+ const connectorBound = row?.consumer !== 'connector' ||
413
+ connectorsLoading ||
414
+ connectors.some((connector) => connector.secretIdentifier === row?.identifier);
415
+ const unboundConnectorRow = row?.consumer === 'connector' && !connectorBound;
416
+ const usageContext = { connectorBound, picked: pickedExposure !== null };
417
+ const { strategy, consumer: nextConsumer } = secretDeliveryTarget(exposure, row, usageContext);
408
418
  /**
409
419
  * The LLM gateway, a connector, or the git connection owns this row's
410
420
  * usage, so the picker must not be shown at all. It writes three
411
421
  * `(strategy, consumer)` pairs and none of them is the one this row has;
412
422
  * rendering it would silently disconnect whatever assigned it.
413
423
  */
414
- const usageAssigned = secretUsageIsAssigned(row?.consumer);
424
+ const usageAssigned = secretUsageIsAssigned(row?.consumer, usageContext);
425
+ /** The picker's value: an unbound connector row reads as Connector until moved. */
426
+ const pickerValue = unboundConnectorRow && pickedExposure === null ? 'connector' : exposure;
415
427
  const [selectedConnectorSlugs, setSelectedConnectorSlugs] = useState(null);
416
428
  const effectiveSelectedConnectorSlugs = selectedConnectorSlugs ??
417
429
  connectors
@@ -452,7 +464,8 @@ function SecretDialog({ open, onOpenChange, projectId, row, connectors, connecto
452
464
  const prepareSavePlan = () => {
453
465
  const finalKey = (row?.key ?? key).trim().toUpperCase();
454
466
  const finalIdentifier = (row?.identifier ?? identifier).trim() || finalKey;
455
- const nextConnectorSlugs = row?.consumer === 'connector' ? effectiveSelectedConnectorSlugs : [];
467
+ const keepsConnector = row?.consumer === 'connector' && nextConsumer === 'connector';
468
+ const nextConnectorSlugs = keepsConnector ? effectiveSelectedConnectorSlugs : [];
456
469
  const bindingChanges = connectorBindingChanges(connectors, finalIdentifier, nextConnectorSlugs);
457
470
  if (!SECRET_NAME_REGEX.test(finalKey)) {
458
471
  throw new Error('Key: use A-Z, 0-9, _ only. Must start with a letter or _. Max 64 chars.');
@@ -472,7 +485,9 @@ function SecretDialog({ open, onOpenChange, projectId, row, connectors, connecto
472
485
  if (needsHosts && !enforcedPolicy) {
473
486
  throw new Error('Add at least one exact HTTPS host.');
474
487
  }
475
- if (row?.consumer === 'connector' && nextConnectorSlugs.length === 0) {
488
+ // An unbound connector row may be saved unbound (a new value); a bound one
489
+ // keeps at least one connector.
490
+ if (keepsConnector && connectorBound && nextConnectorSlugs.length === 0) {
476
491
  throw new Error('Select at least one connector.');
477
492
  }
478
493
  if (!nextSharedWith) {
@@ -651,6 +666,7 @@ function SecretDialog({ open, onOpenChange, projectId, row, connectors, connecto
651
666
  ? `Edit ${row.identifier}`
652
667
  : `Set ${row.identifier}`;
653
668
  const selectedDelivery = secretDeliveryPresentation(strategy, nextConsumer, { tI18nComplete });
669
+ const connectorOnlyDelivery = secretDeliveryPresentation('broker', 'connector', { tI18nComplete });
654
670
  const bindingIdentifier = (row?.identifier ?? identifier).trim() || key.trim().toUpperCase();
655
671
  const connectorOptions = connectorBindingOptions(connectors, bindingIdentifier, tI18nComplete);
656
672
  // Offer "Enforce at the network" only when the experimental flag is on, or
@@ -703,7 +719,7 @@ function SecretDialog({ open, onOpenChange, projectId, row, connectors, connecto
703
719
  /* Read-only, because another flow assigned it. Same treatment
704
720
  the git-connection secret always had, now covering the LLM
705
721
  gateway and connector rows it was always true of. */
706
- _jsxs("div", { id: "secret-dialog-delivery", className: "border-border bg-sidebar rounded-md border p-3", children: [_jsx(Badge, { variant: selectedDelivery.tone, size: "sm", children: selectedDelivery.label }), _jsxs("p", { className: "text-muted-foreground mt-2 text-xs text-pretty", children: [selectedDelivery.description, " ", tI18nComplete.raw('text5740535823f9')] })] })) : (_jsxs(Select, { value: exposure, onValueChange: (next) => setPickedExposure(next), disabled: save.isPending, children: [_jsx(SelectTrigger, { id: "secret-dialog-delivery", className: "min-h-10 w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: exposureOptions.map((option) => (_jsx(SelectItem, { value: option.exposure, description: option.description, children: option.label }, option.exposure))) })] })), !usageAssigned && (_jsx(FieldDescription, { children: selectedDelivery.description }))] }), strategy === 'runtime' && (_jsxs(Alert, { variant: "warning", children: [_jsx(AlertTitle, { children: tI18nComplete.raw('text4fb8319405f3') }), _jsx(AlertDescription, { children: tI18nComplete.raw('textdb71b63b5778') })] })), grantNotice && (_jsxs(BannerAlert, { variant: "warning", className: "[&_[data-slot=alert-content]]:min-w-0", children: [_jsx(BannerAlertMedia, { children: _jsx(DangerTriangleSolid, { weight: "fill" }) }), _jsx(BannerAlertTitle, { children: grantNotice.title }), _jsxs(BannerAlertDescription, { children: [_jsx("span", { className: "block text-pretty", children: grantNotice.body }), grantPlan.candidates.length > 0 && (_jsxs("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [grantPlan.candidates.length > 1 && (_jsxs(Select, { value: selectedGrantAgent ?? '', onValueChange: setGrantAgent, disabled: grant.isPending, children: [_jsx(SelectTrigger, { "aria-label": tI18nComplete.raw('text33e745179bcb'), className: "h-8 w-48", children: _jsx(SelectValue, { placeholder: tI18nComplete.raw('textb6890bc23a9c') }) }), _jsx(SelectContent, { children: grantPlan.candidates.map((candidate) => (_jsx(SelectItem, { value: candidate.name, description: agentGrantCandidateHint(candidate) ?? undefined, children: candidate.name }, candidate.name))) })] })), _jsxs(Button, { type: "button", size: "sm", onClick: startGrant, disabled: !selectedGrantAgent || grant.isPending, children: [grant.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, agentGrantActionLabel(grantPlan, selectedGrantAgent)] })] })), grantPlan.candidates.length === 0 && (_jsx("span", { className: "text-muted-foreground mt-2 block text-xs text-pretty", children: tI18nComplete.raw('textf23c70160b5b') })), selectedGrantHint && (_jsx("span", { className: "text-muted-foreground mt-2 block text-xs text-pretty", children: selectedGrantHint })), grant.error && (_jsx("span", { className: "text-kortix-red mt-2 block text-xs text-pretty", children: agentGrantErrorMessage(grant.error) })), _jsx("pre", { className: "border-border bg-muted mt-2 overflow-x-auto rounded-sm border p-2 font-mono text-xs leading-relaxed", children: grantManifest })] })] })), needsHosts && (_jsxs("div", { className: "border-border bg-sidebar space-y-4 rounded-md border p-3", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium", children: tI18nComplete.raw('textd3297c00f7a2') }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: tI18nComplete.raw('text76f48924ee10') })] }), _jsxs(BannerAlert, { variant: "default", className: "[&_[data-slot=alert-content]]:min-w-0", children: [_jsx(BannerAlertTitle, { children: echoNotice.title }), _jsxs(BannerAlertDescription, { children: [_jsx("span", { className: "block text-pretty", children: echoNotice.body }), _jsx("pre", { className: "border-border bg-muted mt-2 overflow-x-auto rounded-sm border p-2 font-mono text-xs leading-relaxed", children: echoNotice.probe }), _jsx(Link, { href: echoNotice.docsHref, target: "_blank", rel: "noreferrer", className: "text-muted-foreground hover:text-foreground mt-2 inline-block text-xs underline underline-offset-2", children: echoNotice.docsLabel })] })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: "secret-dialog-hosts", children: tI18nComplete.raw('textbba9af131107') }), _jsx(Textarea, { id: "secret-dialog-hosts", value: hosts, onChange: (event) => setEditedHosts(event.target.value), placeholder: tI18nComplete.raw('text07de8e6e567f'), minHeight: 56, maxHeight: 112, variant: "outline", className: "font-mono text-xs", disabled: save.isPending }), _jsx(FieldDescription, { children: tI18nComplete.raw('text80befc2e0620') })] }), legacyDetail && (_jsxs("div", { className: "border-border bg-popover space-y-2 rounded-md border p-3", children: [_jsx("p", { className: "text-sm font-medium", children: legacyDetail.title }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: legacyDetail.body }), _jsx("dl", { className: "text-muted-foreground space-y-0.5 font-mono text-xs", children: legacyDetail.lines.map((line) => (_jsx("dd", { children: line }, line))) }), _jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setLegacyInject(null), disabled: save.isPending, children: tI18nComplete.raw('text4a72652fb7e7') })] }))] })), row?.consumer === 'connector' && (_jsx("div", { className: "border-border bg-sidebar space-y-4 rounded-md border p-3", children: _jsxs(Field, { children: [_jsx(FieldLabel, { children: tI18nComplete.raw('textc3d2e79ebdd0') }), connectorsLoading ? (_jsxs("div", { className: "space-y-2", children: [_jsx(Skeleton, { className: "h-12 rounded-md" }), _jsx(Skeleton, { className: "h-12 rounded-md" })] })) : connectorOptions.length === 0 ? (_jsxs(BannerAlert, { variant: "default", children: [_jsx(BannerAlertTitle, { children: tI18nComplete.raw('text10798ef769fd') }), _jsx(BannerAlertDescription, { children: tI18nComplete.raw('text0b834e60371f') })] })) : (_jsx("div", { className: "bg-popover overflow-hidden rounded-md border", children: connectorOptions.map((option, index) => (_jsxs("label", { className: cn('flex min-h-12 items-center gap-3 px-3 py-2', index > 0 && 'border-t', option.disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer'), children: [_jsx(Checkbox, { checked: effectiveSelectedConnectorSlugSet.has(option.slug), disabled: option.disabled || save.isPending, onCheckedChange: (checked) => {
722
+ _jsxs("div", { id: "secret-dialog-delivery", className: "border-border bg-sidebar rounded-md border p-3", children: [_jsx(Badge, { variant: selectedDelivery.tone, size: "sm", children: selectedDelivery.label }), _jsxs("p", { className: "text-muted-foreground mt-2 text-xs text-pretty", children: [selectedDelivery.description, " ", tI18nComplete.raw('text5740535823f9')] })] })) : (_jsxs(Select, { value: pickerValue, onValueChange: (next) => setPickedExposure(next === 'connector' ? null : next), disabled: save.isPending, children: [_jsx(SelectTrigger, { id: "secret-dialog-delivery", className: "min-h-10 w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [unboundConnectorRow && (_jsx(SelectItem, { value: "connector", description: connectorOnlyDelivery.description, children: connectorOnlyDelivery.label })), exposureOptions.map((option) => (_jsx(SelectItem, { value: option.exposure, description: option.description, children: option.label }, option.exposure)))] })] })), !usageAssigned && (_jsx(FieldDescription, { children: selectedDelivery.description }))] }), strategy === 'runtime' && (_jsxs(Alert, { variant: "warning", children: [_jsx(AlertTitle, { children: tI18nComplete.raw('text4fb8319405f3') }), _jsx(AlertDescription, { children: tI18nComplete.raw('textdb71b63b5778') })] })), grantNotice && (_jsxs(BannerAlert, { variant: "warning", className: "[&_[data-slot=alert-content]]:min-w-0", children: [_jsx(BannerAlertMedia, { children: _jsx(DangerTriangleSolid, { weight: "fill" }) }), _jsx(BannerAlertTitle, { children: grantNotice.title }), _jsxs(BannerAlertDescription, { children: [_jsx("span", { className: "block text-pretty", children: grantNotice.body }), grantPlan.candidates.length > 0 && (_jsxs("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [grantPlan.candidates.length > 1 && (_jsxs(Select, { value: selectedGrantAgent ?? '', onValueChange: setGrantAgent, disabled: grant.isPending, children: [_jsx(SelectTrigger, { "aria-label": tI18nComplete.raw('text33e745179bcb'), className: "h-8 w-48", children: _jsx(SelectValue, { placeholder: tI18nComplete.raw('textb6890bc23a9c') }) }), _jsx(SelectContent, { children: grantPlan.candidates.map((candidate) => (_jsx(SelectItem, { value: candidate.name, description: agentGrantCandidateHint(candidate) ?? undefined, children: candidate.name }, candidate.name))) })] })), _jsxs(Button, { type: "button", size: "sm", onClick: startGrant, disabled: !selectedGrantAgent || grant.isPending, children: [grant.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, agentGrantActionLabel(grantPlan, selectedGrantAgent)] })] })), grantPlan.candidates.length === 0 && (_jsx("span", { className: "text-muted-foreground mt-2 block text-xs text-pretty", children: tI18nComplete.raw('textf23c70160b5b') })), selectedGrantHint && (_jsx("span", { className: "text-muted-foreground mt-2 block text-xs text-pretty", children: selectedGrantHint })), grant.error && (_jsx("span", { className: "text-kortix-red mt-2 block text-xs text-pretty", children: agentGrantErrorMessage(grant.error) })), _jsx("pre", { className: "border-border bg-muted mt-2 overflow-x-auto rounded-sm border p-2 font-mono text-xs leading-relaxed", children: grantManifest })] })] })), needsHosts && (_jsxs("div", { className: "border-border bg-sidebar space-y-4 rounded-md border p-3", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium", children: tI18nComplete.raw('textd3297c00f7a2') }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: tI18nComplete.raw('text76f48924ee10') })] }), _jsxs(BannerAlert, { variant: "default", className: "[&_[data-slot=alert-content]]:min-w-0", children: [_jsx(BannerAlertTitle, { children: echoNotice.title }), _jsxs(BannerAlertDescription, { children: [_jsx("span", { className: "block text-pretty", children: echoNotice.body }), _jsx("pre", { className: "border-border bg-muted mt-2 overflow-x-auto rounded-sm border p-2 font-mono text-xs leading-relaxed", children: echoNotice.probe }), _jsx(Link, { href: echoNotice.docsHref, target: "_blank", rel: "noreferrer", className: "text-muted-foreground hover:text-foreground mt-2 inline-block text-xs underline underline-offset-2", children: echoNotice.docsLabel })] })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: "secret-dialog-hosts", children: tI18nComplete.raw('textbba9af131107') }), _jsx(Textarea, { id: "secret-dialog-hosts", value: hosts, onChange: (event) => setEditedHosts(event.target.value), placeholder: tI18nComplete.raw('text07de8e6e567f'), minHeight: 56, maxHeight: 112, variant: "outline", className: "font-mono text-xs", disabled: save.isPending }), _jsx(FieldDescription, { children: tI18nComplete.raw('text80befc2e0620') })] }), legacyDetail && (_jsxs("div", { className: "border-border bg-popover space-y-2 rounded-md border p-3", children: [_jsx("p", { className: "text-sm font-medium", children: legacyDetail.title }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: legacyDetail.body }), _jsx("dl", { className: "text-muted-foreground space-y-0.5 font-mono text-xs", children: legacyDetail.lines.map((line) => (_jsx("dd", { children: line }, line))) }), _jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setLegacyInject(null), disabled: save.isPending, children: tI18nComplete.raw('text4a72652fb7e7') })] }))] })), row?.consumer === 'connector' && nextConsumer === 'connector' && (_jsx("div", { className: "border-border bg-sidebar space-y-4 rounded-md border p-3", children: _jsxs(Field, { children: [_jsx(FieldLabel, { children: tI18nComplete.raw('textc3d2e79ebdd0') }), connectorsLoading ? (_jsxs("div", { className: "space-y-2", children: [_jsx(Skeleton, { className: "h-12 rounded-md" }), _jsx(Skeleton, { className: "h-12 rounded-md" })] })) : connectorOptions.length === 0 ? (_jsxs(BannerAlert, { variant: "default", children: [_jsx(BannerAlertTitle, { children: tI18nComplete.raw('text10798ef769fd') }), _jsx(BannerAlertDescription, { children: tI18nComplete.raw('text0b834e60371f') })] })) : (_jsx("div", { className: "bg-popover overflow-hidden rounded-md border", children: connectorOptions.map((option, index) => (_jsxs("label", { className: cn('flex min-h-12 items-center gap-3 px-3 py-2', index > 0 && 'border-t', option.disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer'), children: [_jsx(Checkbox, { checked: effectiveSelectedConnectorSlugSet.has(option.slug), disabled: option.disabled || save.isPending, onCheckedChange: (checked) => {
707
723
  setSelectedConnectorSlugs((current) => checked
708
724
  ? [
709
725
  ...new Set([
@@ -1,26 +1,8 @@
1
- import type { AccountSecretResource, SubscriptionAccount, SubscriptionConnection, SubscriptionUsage, SubscriptionUsageWindow } from '@kortix/sdk';
2
- import { useTranslations } from '../../../i18n/index.js';
1
+ import type { AccountSecretResource, SubscriptionConnection, SubscriptionUsage, SubscriptionUsageWindow } from '@kortix/sdk';
2
+ import { accountLine, isBlockingWindow, loginLimit, modelName, usageTone, weeklyModel, windowLabel, type UsageTone } from '../../../session/models/subscription-windows.js';
3
+ export { accountLine, isBlockingWindow, loginLimit, modelName, usageTone, weeklyModel, windowLabel, type UsageTone };
3
4
  /** The provider-list row that carries each subscription login's usage. */
4
5
  export declare const SUBSCRIPTION_ROW: Readonly<Record<string, string>>;
5
- export type UsageTone = 'ok' | 'near' | 'critical' | 'limited';
6
- /** Warn at 80%, turn red at 95%, and distinguish a provider-enforced limit. */
7
- export declare function usageTone(window: SubscriptionUsageWindow, limited: boolean): UsageTone;
8
- /**
9
- * Windows that never stop the login's model calls: code review, paid extra
10
- * usage, and one model's own limit (ChatGPT `model_*`, Claude `seven_day_opus`,
11
- * `7d_sonnet`). Claude's OAuth-apps window stays blocking. The server's twin
12
- * is `isBlockingWindow` in packages/llm-gateway/src/usage/subscription-usage.ts.
13
- */
14
- export declare function isBlockingWindow(id: string): boolean;
15
- /** The model name of a model-specific weekly window (`seven_day_opus` → `Opus`), or null. */
16
- export declare function weeklyModel(id: string): string | null;
17
- /** A model limit's id fragment read back as its name: `gpt_5_3_codex_spark` → `GPT-5.3 Codex Spark`. */
18
- export declare function modelName(slug: string): string;
19
- type Translate = ReturnType<typeof useTranslations>;
20
- /** A window's name: `5-hour`, `Weekly`, `Weekly · Opus`, `Code review · Weekly`, `Extra usage`. */
21
- export declare function windowLabel(id: string, t: Translate, options?: {
22
- modelWeekly?: boolean;
23
- }): string;
24
6
  /**
25
7
  * A reset time a person reads at a glance: the clock time today, the weekday
26
8
  * and time within a week, else the date.
@@ -28,11 +10,6 @@ export declare function windowLabel(id: string, t: Translate, options?: {
28
10
  export declare function formatReset(iso: string, now: number, locale: string): string;
29
11
  /** The usage to show: the live read when it answered, else the snapshot the list carried. */
30
12
  export declare function shownUsage(live: SubscriptionUsage | null | undefined, listed: SubscriptionUsage | null | undefined): SubscriptionUsage | null;
31
- /**
32
- * `person@example.test · Pro`: who the login signs in as. The email is left out
33
- * when the label already shows it; null when the provider says nothing.
34
- */
35
- export declare function accountLine(account: SubscriptionAccount | null | undefined, label: string): string | null;
36
13
  /** The login's email and plan, under its name: the live read when it answered, else the list's. */
37
14
  export declare function SubscriptionAccountLine({ accountId, projectId, secret }: {
38
15
  accountId: string;
@@ -42,11 +19,6 @@ export declare function SubscriptionAccountLine({ accountId, projectId, secret }
42
19
  export declare function isSubscriptionLogin(secret: Pick<AccountSecretResource, 'provider_id'>): boolean;
43
20
  /** A login the gateway can route to: active, readable, signed in. */
44
21
  export declare function usable(secret: Pick<SubscriptionConnection, 'active' | 'needs_reauth_at' | 'status'>): boolean;
45
- /** A login that cannot take a model call now, and when that ends (null: unknown). */
46
- export declare function loginLimit(usage: SubscriptionUsage | null, now: number): {
47
- limited: boolean;
48
- until: string | null;
49
- };
50
22
  export interface SubscriptionSummary {
51
23
  total: number;
52
24
  /** Logins that can take a model call now, by their reported usage. */
@@ -312,4 +284,3 @@ export declare function LegacyChatGptUsage({ accountId, projectId }: {
312
284
  accountId: string;
313
285
  projectId: string;
314
286
  }): import("react").JSX.Element | null;
315
- export {};
@@ -6,70 +6,15 @@ import { useLocale, useTranslations } from '../../../i18n/index.js';
6
6
  import { cn } from '../../../lib/utils.js';
7
7
  import { Badge } from '../../../primitives/badge.js';
8
8
  import { Progress } from '../../../primitives/progress.js';
9
+ import { accountLine, currentWindows as current, isBlockingWindow, loginLimit, modelName, usageTone, weeklyModel, windowLabel, } from '../../../session/models/subscription-windows.js';
10
+ export { accountLine, isBlockingWindow, loginLimit, modelName, usageTone, weeklyModel, windowLabel };
9
11
  /** Providers whose stored value is a subscription login with plan windows. */
10
12
  const SUBSCRIPTION_PROVIDERS = new Set(['codex', 'claude-agent']);
11
13
  /** The provider-list row that carries each subscription login's usage. */
12
14
  export const SUBSCRIPTION_ROW = { codex: 'openai', 'claude-agent': 'anthropic' };
13
15
  /** A snapshot older than this says when it was observed. */
14
16
  const STALE_MS = 10 * 60 * 1000;
15
- /** Warn at 80%, turn red at 95%, and distinguish a provider-enforced limit. */
16
- export function usageTone(window, limited) {
17
- if (window.used_percent >= 100 || (limited && window.used_percent >= 90))
18
- return 'limited';
19
- if (window.used_percent >= 95)
20
- return 'critical';
21
- return window.used_percent >= 80 ? 'near' : 'ok';
22
- }
23
17
  const TONE_BAR = { ok: 'bg-primary', near: 'bg-kortix-orange', critical: 'bg-kortix-red', limited: 'bg-kortix-red' };
24
- /**
25
- * Windows that never stop the login's model calls: code review, paid extra
26
- * usage, and one model's own limit (ChatGPT `model_*`, Claude `seven_day_opus`,
27
- * `7d_sonnet`). Claude's OAuth-apps window stays blocking. The server's twin
28
- * is `isBlockingWindow` in packages/llm-gateway/src/usage/subscription-usage.ts.
29
- */
30
- export function isBlockingWindow(id) {
31
- return !/^(?:code_review|extra_usage|model_|seven_day_(?!oauth_apps$)|7d_(?!oauth_apps$))/.test(id);
32
- }
33
- /** The model name of a model-specific weekly window (`seven_day_opus` → `Opus`), or null. */
34
- export function weeklyModel(id) {
35
- const model = /^(?:seven_day|7d)_([a-z]+)$/.exec(id)?.[1];
36
- return model ? model[0].toUpperCase() + model.slice(1) : null;
37
- }
38
- const title = (value) => value.replaceAll('_', ' ').replace(/^./, (first) => first.toUpperCase());
39
- /** A model limit's id fragment read back as its name: `gpt_5_3_codex_spark` → `GPT-5.3 Codex Spark`. */
40
- export function modelName(slug) {
41
- const words = [];
42
- for (const token of slug.split('_').filter(Boolean)) {
43
- const last = words.at(-1);
44
- if (/^\d+$/.test(token) && last && /\d$/.test(last))
45
- words[words.length - 1] = `${last}.${token}`;
46
- else
47
- words.push(token === 'gpt' ? 'GPT' : /^\d/.test(token) ? token : token[0].toUpperCase() + token.slice(1));
48
- }
49
- return words.join(' ').replace(/^GPT (\d)/, 'GPT-$1');
50
- }
51
- /** A window's name: `5-hour`, `Weekly`, `Weekly · Opus`, `Code review · Weekly`, `Extra usage`. */
52
- export function windowLabel(id, t, options = {}) {
53
- if (id === 'five_hour')
54
- return t('fiveHour');
55
- // Beside `Weekly · Opus`, the plain weekly window is the one every model shares.
56
- if (id === 'weekly')
57
- return options.modelWeekly ? t('weeklyAll') : t('weekly');
58
- if (id === 'extra_usage')
59
- return t('extraUsage');
60
- if (id === 'seven_day_oauth_apps' || id === '7d_oauth_apps')
61
- return t('weeklyModel', { model: t('apps') });
62
- const model = weeklyModel(id);
63
- if (model)
64
- return t('weeklyModel', { model });
65
- const scoped = /^(code_review|model_[a-z0-9_]+?)_(five_hour|weekly|primary|secondary)$/.exec(id);
66
- if (scoped) {
67
- const scope = scoped[1] === 'code_review' ? t('codeReview') : modelName(scoped[1].slice('model_'.length));
68
- const span = scoped[2] === 'five_hour' ? t('fiveHour') : scoped[2] === 'weekly' ? t('weekly') : null;
69
- return span ? `${scope} · ${span}` : scope;
70
- }
71
- return title(id);
72
- }
73
18
  /**
74
19
  * A reset time a person reads at a glance: the clock time today, the weekday
75
20
  * and time within a week, else the date.
@@ -91,17 +36,6 @@ export function shownUsage(live, listed) {
91
36
  return Date.parse(live.observed_at) >= Date.parse(listed.observed_at) ? live : listed;
92
37
  return live ?? listed ?? null;
93
38
  }
94
- /**
95
- * `person@example.test · Pro`: who the login signs in as. The email is left out
96
- * when the label already shows it; null when the provider says nothing.
97
- */
98
- export function accountLine(account, label) {
99
- if (!account)
100
- return null;
101
- const email = account.email && !label.toLowerCase().includes(account.email.toLowerCase()) ? account.email : null;
102
- const plan = account.plan ? account.plan[0].toUpperCase() + account.plan.slice(1) : null;
103
- return [email, plan].filter(Boolean).join(' · ') || null;
104
- }
105
39
  /** The login's email and plan, under its name: the live read when it answered, else the list's. */
106
40
  export function SubscriptionAccountLine({ accountId, projectId, secret }) {
107
41
  const live = useSubscriptionUsage(accountId, secret.secret_id, { projectId, storage: 'account_resource', enabled: isSubscriptionLogin(secret) && usable(secret) });
@@ -115,24 +49,6 @@ export function isSubscriptionLogin(secret) {
115
49
  export function usable(secret) {
116
50
  return secret.active && !secret.needs_reauth_at && secret.status !== 'undecryptable';
117
51
  }
118
- /** The windows still in force: a window whose reset passed no longer limits anything. */
119
- function current(usage, now) {
120
- return usage.windows.filter((window) => !window.resets_at || Date.parse(window.resets_at) > now);
121
- }
122
- /** A login that cannot take a model call now, and when that ends (null: unknown). */
123
- export function loginLimit(usage, now) {
124
- if (!usage)
125
- return { limited: false, until: null };
126
- const blocking = current(usage, now).filter((window) => isBlockingWindow(window.id));
127
- const full = blocking.filter((window) => window.used_percent >= 100);
128
- // A rejection whose window already reset is history, not a limit.
129
- const rejected = usage.limited && blocking.length === usage.windows.filter((window) => isBlockingWindow(window.id)).length;
130
- if (!full.length && !rejected)
131
- return { limited: false, until: null };
132
- const resets = (full.length ? full : blocking).map((window) => window.resets_at).filter((at) => Boolean(at));
133
- // Capacity is back only when the LAST full window resets.
134
- return { limited: true, until: resets.length ? resets.reduce((a, b) => (Date.parse(a) > Date.parse(b) ? a : b)) : null };
135
- }
136
52
  /**
137
53
  * One provider's logins in one line: how many can work now, when the next
138
54
  * one is back, and the fullest window of the ones that can.
@@ -62,13 +62,11 @@ const OWNS_ITS_DIRECTORY = {
62
62
  * drop focus trap continuity.
63
63
  */
64
64
  export function EntityDetailModal({ projectId, entity, kind, open, isResolving = false, aside, meta, paneOverride, removable = false, source, onOpenChange, }) {
65
- // A skill/command with no description renders no `ModalDescription`, so
66
- // Radix's Dialog can't find one to auto-associate via `aria-describedby`
67
- // and logs a dev-only "Missing Description" warning. Passing
68
- // `aria-describedby={undefined}` explicitly (as its own prop key, not just
69
- // omitting the attribute) is Radix's documented opt-out — the warning
70
- // message itself names this exact fix. Only applied when there truly is no
71
- // description; when one exists, `ModalDescription` wires up normally.
65
+ // A skill/command with no description renders no `ModalDescription`.
66
+ // Passing `aria-describedby={undefined}` explicitly (as its own prop key,
67
+ // not just omitting the attribute) states that the dialog has no
68
+ // description. Only applied when there truly is no description; when one
69
+ // exists, `ModalDescription` wires up `aria-describedby` normally.
72
70
  const suppressDescriptionWarning = !entity?.description;
73
71
  return (_jsx(Modal, { open: open, onOpenChange: onOpenChange, children: _jsx(ModalContent, { className: "bg-popover space-y-0 lg:max-w-6xl", ...(suppressDescriptionWarning ? { 'aria-describedby': undefined } : {}), children: entity ? (_jsx(EntityModalBody, { projectId: projectId, entity: entity, kind: kind, aside: aside, meta: meta, paneOverride: paneOverride, removable: removable, source: source }, entity.path)) : isResolving ? (_jsx(EntityModalSkeleton, { kind: kind })) : null }) }));
74
72
  }
@@ -77,8 +75,8 @@ export function EntityDetailModal({ projectId, entity, kind, open, isResolving =
77
75
  * has not arrived. Shape-matched to `EntityModalBody` — same header, same
78
76
  * `lg:w-64` file rail — so the handover fills placeholders in place.
79
77
  *
80
- * `ModalTitle` is real, not decorative: Radix's Dialog requires an accessible
81
- * name for the whole time it is open, including this window.
78
+ * `ModalTitle` is real, not decorative: a dialog needs an accessible name for
79
+ * the whole time it is open, including this window.
82
80
  */
83
81
  function EntityModalSkeleton({ kind }) {
84
82
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
@@ -123,7 +121,7 @@ function EntityModalBody({ projectId, entity, kind, aside, meta, paneOverride, r
123
121
  // The click does not send the prompt directly — `configure.start` opens a
124
122
  // whole new chat, which is a bigger commitment than a pencil icon implies,
125
123
  // so an AlertDialog confirms first. The dialog nests inside this modal's
126
- // React tree on purpose: rendered as a sibling, Radix would read every
124
+ // React tree on purpose: rendered as a sibling, the modal would read every
127
125
  // click in the alert as an outside-click and dismiss the modal underneath
128
126
  // (see packages/ui/src/primitives/alert-dialog.tsx).
129
127
  // Kortix's own files (a `source`) are read-only here.
@@ -259,7 +259,7 @@ export function ScheduleBuilder({ value, onChange, disabled, allowOnce, runAt, o
259
259
  const cadences = localizeUiCatalog(CADENCES, tI18nComplete, APP_REGISTRY_TRANSLATION_KEYS);
260
260
  const weekdayButtons = localizeUiCatalog(WEEKDAY_BUTTONS, tI18nComplete, APP_REGISTRY_TRANSLATION_KEYS);
261
261
  const selectedWeekdays = new Set(state.weekdays);
262
- const intervalUnit = (value) => state.frequency === 'minutes' ? 'minutes' : `hour${value === 1 ? '' : 's'}`;
262
+ const intervalUnit = (value) => `${state.frequency === 'minutes' ? 'minute' : 'hour'}${value === 1 ? '' : 's'}`;
263
263
  return (_jsxs("div", { className: cn('space-y-3', disabled && 'pointer-events-none opacity-60 select-none'), children: [_jsxs("div", { className: "flex flex-wrap items-end gap-3", children: [_jsx(ScheduleField, { label: tI18nComplete.raw('textb6b7a0065808'), className: "w-full sm:w-44", children: _jsxs(Select, { value: onceMode ? 'once' : cadence, onValueChange: (next) => next === 'once' ? selectOnce() : selectCadence(next), disabled: disabled, children: [_jsx(SelectTrigger, { className: "h-9 w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [cadences.map((option) => (_jsx(SelectItem, { value: option.value, children: option.label }, option.value))), canOnce ? (_jsx(SelectItem, { value: "once", children: tI18nComplete.raw('textd88f6d8372f4') })) : null] })] }) }), onceMode ? (_jsx(ScheduleField, { label: tI18nComplete.raw('text4b4c31294fb5'), className: "w-full sm:w-auto", children: _jsx(Input, { type: "datetime-local", value: runAt ? isoToLocalInput(runAt) : '', min: isoToLocalInput(new Date().toISOString()), onChange: (event) => onRunAtChange?.(localInputToIso(event.target.value)), onBlur: () => {
264
264
  if (hasPastRunAt)
265
265
  warningToast(tI18nComplete.raw('textabf586cc6ecb'));
@@ -115,6 +115,10 @@ export function describeCadence(expression) {
115
115
  return CUSTOM_TIMING_LABEL;
116
116
  return n === 1 ? 'Every minute' : `Every ${n} minutes`;
117
117
  }
118
+ // Every minute: `*` in the minute field, as `kortix.yaml` often writes it.
119
+ if (minute === '*' && hour === '*' && day === '*' && month === '*' && weekday === '*') {
120
+ return 'Every minute';
121
+ }
118
122
  // Every N hours, on a given minute.
119
123
  if (hour.startsWith('*/') && day === '*' && weekday === '*') {
120
124
  const n = Number(hour.slice(2));