@kortix/ui 0.15.6 → 0.15.8

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 (226) hide show
  1. package/README.md +7 -7
  2. package/dist/_vendor/kortix-shared.js +36 -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/customize/connectors/catalog/connector-categories.d.ts +2 -2
  6. package/dist/customize/connectors/catalog/connector-categories.js +2 -2
  7. package/dist/customize/connectors/detail/connector-modal.js +1 -1
  8. package/dist/customize/providers/provider-accordion.js +3 -2
  9. package/dist/customize/providers/provider-connect.d.ts +7 -0
  10. package/dist/customize/providers/provider-connect.js +21 -2
  11. package/dist/customize/providers/provider-sheet.js +3 -2
  12. package/dist/customize/sections/gateway-view.d.ts +2 -2
  13. package/dist/customize/sections/gateway-view.js +30 -15
  14. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.d.ts +3 -1
  15. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +2 -2
  16. package/dist/customize/sections/view/account-secret-resources-panel.js +8 -5
  17. package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
  18. package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
  19. package/dist/customize/sections/view/git-view.js +1 -1
  20. package/dist/customize/sections/view/permission-editor.js +1 -1
  21. package/dist/customize/sections/view/review-center-connected.js +15 -3
  22. package/dist/customize/sections/view/subscription-usage.d.ts +269 -17
  23. package/dist/customize/sections/view/subscription-usage.js +197 -54
  24. package/dist/customize/shared/entity/entity-modal.js +8 -10
  25. package/dist/files/project/components/drive-toolbar.d.ts +1 -1
  26. package/dist/files/project/components/drive-toolbar.js +1 -1
  27. package/dist/files/project/store/version-store.d.ts +1 -1
  28. package/dist/files/renderers/shared/scroll-area-compat.d.ts +6 -6
  29. package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
  30. package/dist/files/renderers/shared/select-compat.js +3 -7
  31. package/dist/files/viewer/file-preview-modal.d.ts +10 -11
  32. package/dist/files/viewer/file-preview-modal.js +17 -18
  33. package/dist/i18n/en.d.ts +40 -47
  34. package/dist/i18n/en.js +47 -54
  35. package/dist/i18n/ui-catalog/app-registry-translation-keys.generated.js +5 -0
  36. package/dist/index.js +1 -1
  37. package/dist/internal/account-hub/account-hub-location.js +2 -2
  38. package/dist/internal/account-hub/use-account-members.d.ts +28 -1
  39. package/dist/internal/account-hub/use-account-members.js +27 -10
  40. package/dist/internal/auth/auth-primitives.d.ts +27 -0
  41. package/dist/internal/auth/auth-primitives.js +21 -0
  42. package/dist/internal/billing/index.d.ts +1 -0
  43. package/dist/internal/billing/index.js +2 -0
  44. package/dist/internal/billing/use-free-grant-unspent.d.ts +10 -0
  45. package/dist/internal/billing/use-free-grant-unspent.js +20 -0
  46. package/dist/internal/components/agent-mark.d.ts +1 -8
  47. package/dist/internal/components/agent-mark.js +2 -19
  48. package/dist/internal/lib/billing/billing-gate-state.d.ts +20 -0
  49. package/dist/internal/lib/billing/billing-gate-state.js +22 -0
  50. package/dist/internal/lib/error-handler.js +0 -2
  51. package/dist/internal/lib/navigation/modified-click.js +2 -2
  52. package/dist/internal/lib/pixel-mark.d.ts +3 -20
  53. package/dist/internal/lib/pixel-mark.js +3 -34
  54. package/dist/internal/notifications/notification-inbox.js +1 -1
  55. package/dist/internal/stores/active-space-store.d.ts +1 -1
  56. package/dist/internal/stores/browser-recents-store.d.ts +1 -1
  57. package/dist/internal/stores/current-account-store.d.ts +1 -1
  58. package/dist/internal/stores/first-chat-store.d.ts +1 -1
  59. package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
  60. package/dist/internal/stores/session-browser-store.d.ts +1 -1
  61. package/dist/internal/stores/session-expanded-store.d.ts +1 -1
  62. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  63. package/dist/internal/stores/session-history-view-store.d.ts +1 -1
  64. package/dist/internal/stores/session-hover-store.d.ts +1 -1
  65. package/dist/internal/stores/session-hover-store.js +1 -1
  66. package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
  67. package/dist/internal/stores/sound-store.d.ts +1 -1
  68. package/dist/internal/stores/tab-store.d.ts +1 -1
  69. package/dist/internal/stores/upgrade-dialog-store.d.ts +0 -2
  70. package/dist/internal/stores/upgrade-dialog-store.js +0 -2
  71. package/dist/internal/stores/user-preferences-store.d.ts +1 -1
  72. package/dist/internal/stores/web-notification-store.d.ts +1 -1
  73. package/dist/lib/base-ui-compat.d.ts +149 -0
  74. package/dist/lib/base-ui-compat.js +339 -0
  75. package/dist/lib/portal-container.d.ts +3 -7
  76. package/dist/lib/portal-container.js +5 -3
  77. package/dist/lib/z-stack.d.ts +4 -4
  78. package/dist/lib/z-stack.js +5 -5
  79. package/dist/markdown/setup-links/approval-decision.d.ts +1 -1
  80. package/dist/markdown/setup-links/approval-decision.js +1 -1
  81. package/dist/primitives/accordion.d.ts +36 -5
  82. package/dist/primitives/accordion.js +41 -8
  83. package/dist/primitives/alert-dialog.d.ts +33 -11
  84. package/dist/primitives/alert-dialog.js +41 -19
  85. package/dist/primitives/avatar.d.ts +5 -2
  86. package/dist/primitives/avatar.js +3 -3
  87. package/dist/primitives/badge.js +1 -1
  88. package/dist/primitives/breadcrumb.js +1 -1
  89. package/dist/primitives/button-group.js +3 -3
  90. package/dist/primitives/button.js +1 -1
  91. package/dist/primitives/checkbox.d.ts +14 -5
  92. package/dist/primitives/checkbox.js +24 -9
  93. package/dist/primitives/collapsible.d.ts +16 -4
  94. package/dist/primitives/collapsible.js +18 -7
  95. package/dist/primitives/command-core.d.ts +121 -0
  96. package/dist/primitives/command-core.js +642 -0
  97. package/dist/primitives/command.d.ts +38 -4
  98. package/dist/primitives/command.js +22 -13
  99. package/dist/primitives/context-menu.d.ts +61 -31
  100. package/dist/primitives/context-menu.js +40 -53
  101. package/dist/primitives/dialog.d.ts +48 -10
  102. package/dist/primitives/dialog.js +48 -19
  103. package/dist/primitives/disclosure.d.ts +1 -1
  104. package/dist/primitives/disclosure.js +2 -2
  105. package/dist/primitives/drawer.d.ts +28 -9
  106. package/dist/primitives/drawer.js +42 -18
  107. package/dist/primitives/dropdown-menu.d.ts +55 -33
  108. package/dist/primitives/dropdown-menu.js +46 -82
  109. package/dist/primitives/faded-scroll-area.js +2 -1
  110. package/dist/primitives/hint.js +3 -3
  111. package/dist/primitives/hover-card.d.ts +17 -5
  112. package/dist/primitives/hover-card.js +45 -8
  113. package/dist/primitives/item.js +2 -2
  114. package/dist/primitives/label.d.ts +5 -2
  115. package/dist/primitives/label.js +10 -3
  116. package/dist/primitives/menu-base.d.ts +150 -0
  117. package/dist/primitives/menu-base.js +171 -0
  118. package/dist/primitives/menu-recipe.d.ts +1 -1
  119. package/dist/primitives/menu-recipe.js +2 -7
  120. package/dist/primitives/modal.d.ts +19 -52
  121. package/dist/primitives/modal.js +24 -28
  122. package/dist/primitives/navigation-menu.d.ts +36 -11
  123. package/dist/primitives/navigation-menu.js +31 -12
  124. package/dist/primitives/popover.d.ts +31 -6
  125. package/dist/primitives/popover.js +79 -12
  126. package/dist/primitives/preview-image.d.ts +18 -7
  127. package/dist/primitives/preview-image.js +14 -11
  128. package/dist/primitives/progress.d.ts +4 -2
  129. package/dist/primitives/progress.js +4 -3
  130. package/dist/primitives/project-icon-picker.js +2 -2
  131. package/dist/primitives/radio-group.d.ts +28 -5
  132. package/dist/primitives/radio-group.js +18 -10
  133. package/dist/primitives/scroll-area.d.ts +2 -2
  134. package/dist/primitives/scroll-area.js +8 -3
  135. package/dist/primitives/select.d.ts +55 -12
  136. package/dist/primitives/select.js +93 -36
  137. package/dist/primitives/separator.d.ts +6 -2
  138. package/dist/primitives/separator.js +10 -2
  139. package/dist/primitives/sheet.d.ts +17 -10
  140. package/dist/primitives/sheet.js +19 -22
  141. package/dist/primitives/sidebar-menu-primitives.js +8 -8
  142. package/dist/primitives/slider-native.d.ts +2 -2
  143. package/dist/primitives/slider-native.js +11 -9
  144. package/dist/primitives/slider.d.ts +24 -6
  145. package/dist/primitives/slider.js +26 -24
  146. package/dist/primitives/slot.d.ts +6 -0
  147. package/dist/primitives/slot.js +7 -0
  148. package/dist/primitives/split-sheet.js +1 -1
  149. package/dist/primitives/stepper.js +1 -1
  150. package/dist/primitives/switch.d.ts +16 -3
  151. package/dist/primitives/switch.js +7 -6
  152. package/dist/primitives/tabs.d.ts +36 -20
  153. package/dist/primitives/tabs.js +131 -102
  154. package/dist/primitives/toggle.d.ts +16 -3
  155. package/dist/primitives/toggle.js +8 -3
  156. package/dist/primitives/tooltip.d.ts +24 -5
  157. package/dist/primitives/tooltip.js +32 -10
  158. package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
  159. package/dist/primitives/type-to-confirm-dialog.js +1 -1
  160. package/dist/session/composer/animated-placeholder.js +1 -1
  161. package/dist/session/composer/chat-input/chat-input-control.js +3 -3
  162. package/dist/session/composer/editor/composer-editor.js +1 -1
  163. package/dist/session/composer/menus/menu-shell.d.ts +1 -1
  164. package/dist/session/composer/menus/menu-shell.js +1 -1
  165. package/dist/session/composer/menus/mount.js +1 -1
  166. package/dist/session/composer/reasoning-effort-selector.js +1 -1
  167. package/dist/session/header/session-site-header.js +2 -2
  168. package/dist/session/header/subagent-hover-card.js +2 -2
  169. package/dist/session/media/image-preview.js +1 -1
  170. package/dist/session/models/model-selector.d.ts +1 -1
  171. package/dist/session/models/model-selector.js +18 -12
  172. package/dist/session/models/subscription-switcher.d.ts +37 -0
  173. package/dist/session/models/subscription-switcher.js +97 -0
  174. package/dist/session/models/subscription-windows.d.ts +40 -0
  175. package/dist/session/models/subscription-windows.js +86 -0
  176. package/dist/session/overrides/session-overrides-control.js +3 -3
  177. package/dist/session/panel/diff-dialog.js +1 -1
  178. package/dist/session/panel/easy/detail-view.js +3 -3
  179. package/dist/session/panel/mobile-tool-drawer.js +2 -2
  180. package/dist/session/panel/panel-fallback.js +1 -1
  181. package/dist/session/panel/session-files-explorer.d.ts +1 -1
  182. package/dist/session/panel/session-files-explorer.js +1 -1
  183. package/dist/session/prompts/ask-deck.d.ts +14 -2
  184. package/dist/session/prompts/ask-deck.js +6 -2
  185. package/dist/session/thread/session-chat.js +2 -2
  186. package/dist/session/thread/session-context-message-explorer.js +1 -1
  187. package/dist/session/thread/turn-share.js +3 -4
  188. package/dist/session/tool/shared/show-helpers.js +1 -1
  189. package/dist/session/turn/message-time-label.js +1 -1
  190. package/dist/styles.css +1 -1
  191. package/dist/test-utils/intl.d.ts +40 -47
  192. package/dist/workspace/admin/settings-search.js +4 -12
  193. package/dist/workspace/inbox/workspace-inbox.js +11 -2
  194. package/dist/workspace/layout/new-session-create.d.ts +4 -2
  195. package/dist/workspace/layout/new-session-create.js +11 -0
  196. package/dist/workspace/projects/modal/project-icon-field.js +9 -23
  197. package/dist/workspace/review/approval-modal.d.ts +6 -6
  198. package/dist/workspace/review/approval-modal.js +10 -14
  199. package/dist/workspace/review/review-center.d.ts +9 -2
  200. package/dist/workspace/review/review-center.js +258 -126
  201. package/dist/workspace/review/review-detail.d.ts +20 -10
  202. package/dist/workspace/review/review-detail.js +39 -44
  203. package/dist/workspace/review/review-meta.d.ts +27 -6
  204. package/dist/workspace/review/review-meta.js +46 -34
  205. package/dist/workspace/sessions/session-row.js +1 -1
  206. package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +10 -0
  207. package/dist/workspace/sidebar/footer/project-download-app-nav.js +53 -0
  208. package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +2 -1
  209. package/dist/workspace/sidebar/footer/promo-nav-row.js +1 -1
  210. package/dist/workspace/sidebar/project-session-list.js +2 -2
  211. package/dist/workspace/sidebar/project-sidebar.d.ts +6 -1
  212. package/dist/workspace/sidebar/project-sidebar.js +3 -2
  213. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
  214. package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
  215. package/dist/workspace/sidebar/session-title.d.ts +2 -2
  216. package/dist/workspace/sidebar/session-title.js +2 -2
  217. package/dist/workspace/sidebar/workspace-menu-model.d.ts +19 -13
  218. package/dist/workspace/sidebar/workspace-menu-model.js +7 -8
  219. package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
  220. package/dist/workspace/spaces/space-links.js +1 -1
  221. package/dist/workspace/spaces/space-threads-tab.js +1 -1
  222. package/package.json +16 -35
  223. package/skills/kortix-ui/SKILL.md +1 -1
  224. package/skills/kortix-ui/references/custom-dashboard.md +1 -1
  225. package/dist/customize/sections/view/subscription-usage-tab.d.ts +0 -25
  226. package/dist/customize/sections/view/subscription-usage-tab.js +0 -121
package/README.md CHANGED
@@ -310,9 +310,9 @@ How it stays themable:
310
310
  with their variable (`--text-sm`, `--shadow-md`, `--ease-default`, bare
311
311
  `rounded`) live in `@theme inline reference`, so Tailwind never emits the
312
312
  `--x: var(--x)` cycle into `:root`.
313
- - Every Radix portal goes through `withPortalContainer`
313
+ - Every overlay portal goes through `withPortalContainer`
314
314
  (`src/lib/portal-container.tsx`). Without a `ThemeScope` it portals to
315
- `document.body`, as before.
315
+ `document.body`.
316
316
  - A new component reads tokens only: no hex, no palette class, no fixed
317
317
  radius. `apps/web` must look identical: every new variable defaults to the
318
318
  value it replaces.
@@ -320,11 +320,11 @@ How it stays themable:
320
320
  ## Known issues
321
321
 
322
322
  - Server rendering: the entries that render sessions or files (`session`, `composer`, `session-panel`, `workspace`, `files`, `file-viewer`, `markdown`, `genui`, `customize`) import CSS (KaTeX and others) from JS, so plain Node cannot evaluate them (`ERR_UNKNOWN_FILE_EXTENSION ".css"`). A Vite SSR host adds `ssr: { noExternal: ['@kortix/ui'] }`. A Next.js host lists `@kortix/ui` in `transpilePackages`. Or load those blocks on the client only (`lazyClient`). The root, `theme`, `i18n`, `icons`, `diff`, `changes`, `terminal`, `browser`, `apps` and `access` entries evaluate in Node.
323
- - `cmdk@0.2.1` declares a React 18 peer and nests `@radix-ui/react-dialog@1.0.0`.
324
- `Command` works on React 19. A host with `strict-peer-dependencies` must allow
325
- `cmdk`'s React peer. `cmdk` 1.x
326
- changes the selection model `command.tsx` is tuned to, and `apps/web` imports
327
- `cmdk` directly, so the upgrade is its own change.
323
+ - `Command` does not depend on the `cmdk` package. `src/primitives/command-core.tsx`
324
+ is a vendored MIT port of `cmdk` 0.2.1 without its Radix dialog. It keeps cmdk's
325
+ selection model, filter scoring and `[cmdk-*]` attributes, which `command.tsx`
326
+ and the ⌘K palette are tuned to. `useCommandState` is exported from
327
+ `@kortix/ui/command`.
328
328
 
329
329
  ## Rules
330
330
 
@@ -629,6 +629,12 @@ function peerHandleLabel(handle) {
629
629
  function isMyKortixAgentName(name) {
630
630
  return name === MY_KORTIX_AGENT_NAME || name === LEGACY_MY_KORTIX_AGENT_NAME;
631
631
  }
632
+ function agentDisplayName(slug) {
633
+ if (isMyKortixAgentName(slug)) return MY_KORTIX_DISPLAY_NAME;
634
+ if (typeof slug !== "string") return String(slug);
635
+ const words = slug.replace(/[-_]+/g, " ").trim();
636
+ return words.charAt(0).toUpperCase() + words.slice(1);
637
+ }
632
638
 
633
639
  // ../manifest-schema/src/slug.ts
634
640
  var SLUG_MAX_LENGTH = 128;
@@ -4256,6 +4262,35 @@ function pixelMarkShape(slug) {
4256
4262
  height: PIXEL_MARK_SIZE
4257
4263
  };
4258
4264
  }
4265
+ var tone = (name, tile, ink) => ({
4266
+ name,
4267
+ tile,
4268
+ ink,
4269
+ tileDark: ink,
4270
+ inkDark: tile
4271
+ });
4272
+ var PIXEL_MARK_TONES = [
4273
+ tone("graphite", "#EDEDED", "#191919"),
4274
+ tone("sand", "#F1EBDD", "#6B5A3A"),
4275
+ tone("moss", "#E6EDE0", "#3F5A33"),
4276
+ tone("sea", "#E2ECF0", "#2E5566"),
4277
+ tone("blue", "#E6EEFF", "#2457C5"),
4278
+ tone("plum", "#EEE6F0", "#5E3A68"),
4279
+ tone("clay", "#F3E6E0", "#7A4532"),
4280
+ tone("slate", "#E4E7EC", "#3B4656")
4281
+ ];
4282
+ var BRAND = {
4283
+ name: "brand",
4284
+ tile: "#1F1F1F",
4285
+ ink: "#FFFFFF",
4286
+ tileDark: "#2C2C2C",
4287
+ inkDark: "#FFFFFF"
4288
+ };
4289
+ var RESERVED_TONES = { kortix: BRAND, mykortix: BRAND, meta: BRAND };
4290
+ function pixelMark(slug) {
4291
+ const tone2 = RESERVED_TONES[slug] ?? PIXEL_MARK_TONES[fnv1a(`${slug}#tone`) % PIXEL_MARK_TONES.length];
4292
+ return { ...pixelMarkShape(slug), tone: tone2 };
4293
+ }
4259
4294
 
4260
4295
  // ../shared/src/preview-state-page.ts
4261
4296
  var PREVIEW_BUILDING_STATES = /* @__PURE__ */ new Set([
@@ -5767,4 +5802,4 @@ function parseWorkspaceSettingsSection(raw) {
5767
5802
  return Object.prototype.hasOwnProperty.call(WORKSPACE_SETTINGS_SECTION_ALIASES, value) ? WORKSPACE_SETTINGS_SECTION_ALIASES[value] : null;
5768
5803
  }
5769
5804
 
5770
- export { ARTIFACT_DOC_CSS, AVATAR_INK, CARD_TEXT_RATIO, CHANNELS, CHANNEL_PLATFORM_IDS, COMMIT_CONFIRM_ATTEMPTS, COMMIT_CONFIRM_DELAY_MS, CREDITS_PER_DOLLAR, CURATED_SECTIONS, HUMAN_ONLY, KATEX_FENCE_LANGUAGES, LANGUAGE_ALIASES, MAX_PROMPT_ATTACHMENTS_BYTES, MAX_PROMPT_ATTACHMENT_BYTES, MAX_PROMPT_ATTACHMENT_FILES, MAX_PROMPT_UPLOAD_FILENAME_BYTES, MERMAID_DIAGRAM_STARTERS, MY_KORTIX_AGENT_NAME, MY_KORTIX_DISPLAY_NAME, MY_KORTIX_SANDBOX_SLUG, OTHER, PASTED_INLINE_MAX_BYTES, PIXEL_KORTIX_ROWS, POLICY_SETS_UNSUPPORTED_PROVIDERS, POPULAR_SECTION, PREVIEW_BUILDING_STATES, PREVIEW_STATE_MESSAGE, PROJECT_GLYPH_COLORS, PROJECT_GLYPH_GROUPS, SPACE_POST_SUMMARY, UNKNOWN_RATIO, UPLOAD_LIMITS, WORKSPACE_SETTINGS_GROUPS, appAdminsOnly, autoLinkUrls, avatarFill, buildWebhookSampleRequest, capitalizeWords, cardImageShape, cardListLayout, chalkColors, channelPromptTail, confirmCommitted, countInSection, dollarsToCredits, editConfigPrompt, errorCode, escapeCurrencyDollars, expandPastedContent, extractReadableHtml, fileTagBlocks, fixManifestText, fnv1a, formatFileSize, formatRelative, formatUsdAsCredits, gridApps, groupIntoSections, hasReferenceDefinitionOutsideFences, humanizeCategory, indexOfIgnoreCase, isAllowedWebPushHost, isAmbiguousCreateFailure, isChannelFileLabel, isChannelPlatform, isMermaidCode, isMyKortixAgentName, isProjectGlyphColor, isProjectGlyphName, isProjectGlyphPaletteColor, languageLabel, looksLikeMarkdown, masonryColumns, neutralizePastedTags, newConfigPrompt, newPastedContentId, normalizeLanguage, normalizeLatexDelimiters, normalizeProjectGlyphColor, openMarkdownLinkAtEnd, parseBackgroundWorkers, parseBalanceUsd, parseChannelMessage, parseGrepOutput, parseManifestText, parseMemoryEntryOutput, parseMemorySearchOutput, parsePeerMessagePrompt, parseReminderPrompt, parseSessionGetOutput, parseSessionMessagesOutput, parseSessionMetadataOutput, parseSessionSearchHits, parseTriggerEvent, parseTriggerLines, parseWorkspaceSettingsSection, passesPixelMarkGate, peerHandleLabel, pixelMarkShape, policySetNameError, prefersPreviewLink, prepareMarkdownForKatex, prepareMarkdownForMath, promptFileReferenceXml, ptyOutputBlock, ptySpawnedBody, pushTypeOf, referenceHeaders, removeSpans, replaceSpans, resolveRegisteredKey, safeHttpUrl, sandboxMediaPath, sanitizePromptUploadFilename, sectionKeyForCategory, sectionKeysForEntry, sectionTitle, selfClosingTags, serializePromptWithPastes, shouldTilePaste, skillDocumentBody, slackPlainText, slugifySlug, spaceDriveFolders, spaceSlug, splitPastedContent, stripBashMetadata, stripChatMentionMarkup, stripMarkupForToolOutput, tagBlocks, toolRegistryCandidates, trimPastedText, truncateString, utf8Bytes, withoutEdgeQuotes, xmlBlocks };
5805
+ export { ARTIFACT_DOC_CSS, AVATAR_INK, CARD_TEXT_RATIO, CHANNELS, CHANNEL_PLATFORM_IDS, COMMIT_CONFIRM_ATTEMPTS, COMMIT_CONFIRM_DELAY_MS, CREDITS_PER_DOLLAR, CURATED_SECTIONS, HUMAN_ONLY, KATEX_FENCE_LANGUAGES, LANGUAGE_ALIASES, MAX_PROMPT_ATTACHMENTS_BYTES, MAX_PROMPT_ATTACHMENT_BYTES, MAX_PROMPT_ATTACHMENT_FILES, MAX_PROMPT_UPLOAD_FILENAME_BYTES, MERMAID_DIAGRAM_STARTERS, MY_KORTIX_AGENT_NAME, MY_KORTIX_DISPLAY_NAME, MY_KORTIX_SANDBOX_SLUG, OTHER, PASTED_INLINE_MAX_BYTES, PIXEL_KORTIX_ROWS, PIXEL_MARK_TONES, POLICY_SETS_UNSUPPORTED_PROVIDERS, POPULAR_SECTION, PREVIEW_BUILDING_STATES, PREVIEW_STATE_MESSAGE, PROJECT_GLYPH_COLORS, PROJECT_GLYPH_GROUPS, SPACE_POST_SUMMARY, UNKNOWN_RATIO, UPLOAD_LIMITS, WORKSPACE_SETTINGS_GROUPS, agentDisplayName, appAdminsOnly, autoLinkUrls, avatarFill, buildWebhookSampleRequest, capitalizeWords, cardImageShape, cardListLayout, chalkColors, channelPromptTail, confirmCommitted, countInSection, dollarsToCredits, editConfigPrompt, errorCode, escapeCurrencyDollars, expandPastedContent, extractReadableHtml, fileTagBlocks, fixManifestText, formatFileSize, formatRelative, formatUsdAsCredits, gridApps, groupIntoSections, hasReferenceDefinitionOutsideFences, humanizeCategory, indexOfIgnoreCase, isAllowedWebPushHost, isAmbiguousCreateFailure, isChannelFileLabel, isChannelPlatform, isMermaidCode, isMyKortixAgentName, isProjectGlyphColor, isProjectGlyphName, isProjectGlyphPaletteColor, languageLabel, looksLikeMarkdown, masonryColumns, neutralizePastedTags, newConfigPrompt, newPastedContentId, normalizeLanguage, normalizeLatexDelimiters, normalizeProjectGlyphColor, openMarkdownLinkAtEnd, parseBackgroundWorkers, parseBalanceUsd, parseChannelMessage, parseGrepOutput, parseManifestText, parseMemoryEntryOutput, parseMemorySearchOutput, parsePeerMessagePrompt, parseReminderPrompt, parseSessionGetOutput, parseSessionMessagesOutput, parseSessionMetadataOutput, parseSessionSearchHits, parseTriggerEvent, parseTriggerLines, parseWorkspaceSettingsSection, passesPixelMarkGate, peerHandleLabel, pixelMark, policySetNameError, prefersPreviewLink, prepareMarkdownForKatex, prepareMarkdownForMath, promptFileReferenceXml, ptyOutputBlock, ptySpawnedBody, pushTypeOf, referenceHeaders, removeSpans, replaceSpans, resolveRegisteredKey, safeHttpUrl, sandboxMediaPath, sanitizePromptUploadFilename, sectionKeyForCategory, sectionKeysForEntry, sectionTitle, selfClosingTags, serializePromptWithPastes, shouldTilePaste, skillDocumentBody, slackPlainText, slugifySlug, spaceDriveFolders, spaceSlug, splitPastedContent, stripBashMetadata, stripChatMentionMarkup, stripMarkupForToolOutput, tagBlocks, toolRegistryCandidates, trimPastedText, truncateString, utf8Bytes, withoutEdgeQuotes, xmlBlocks };
@@ -38,3 +38,10 @@ export type BuiltinAgentKey = keyof typeof BUILTIN_AGENTS;
38
38
  export declare const BUILTIN_AGENT_KEYS: BuiltinAgentKey[];
39
39
  /** The `builtin_agents` key of a built-in agent slug (legacy `meta` included), or `null` for a declared agent. */
40
40
  export declare function builtinAgentKeyOf(agentName: string | null | undefined): BuiltinAgentKey | null;
41
+ /**
42
+ * An agent's name as a person reads it: My Kortix for the built-in agent,
43
+ * otherwise the manifest key in sentence case with its separators as spaces
44
+ * (`session-reviewer` → "Session reviewer"). One helper, so the web app, the
45
+ * sidebar and channel posts (Slack) name an agent the same way.
46
+ */
47
+ export declare function agentDisplayName(slug: string): string;
@@ -36,4 +36,22 @@ export declare function pixelMarkShape(slug: string): {
36
36
  width: number;
37
37
  height: number;
38
38
  };
39
+ export interface PixelMarkTone {
40
+ name: string;
41
+ tile: string;
42
+ ink: string;
43
+ /** Dark theme: the pair inverts, so the tile stays visible on a dark page. */
44
+ tileDark: string;
45
+ inkDark: string;
46
+ }
47
+ export declare const PIXEL_MARK_TONES: readonly PixelMarkTone[];
48
+ /** The agent's mark: its shape and its tile tone. */
49
+ export declare function pixelMark(slug: string): {
50
+ tone: PixelMarkTone;
51
+ grid: boolean[][];
52
+ path: string;
53
+ ditherPath: string;
54
+ width: number;
55
+ height: number;
56
+ };
39
57
  export {};
@@ -10,8 +10,8 @@ export type { CatalogSectionDef } from '../../../_vendor/shared/connector-sectio
10
10
  */
11
11
  export declare const CATEGORY_ROW_CAP = 6;
12
12
  /**
13
- * The category `Select`'s "no category" value. Radix `SelectItem` cannot hold
14
- * an empty string, so this needs a sentinel no real category can collide with.
13
+ * The category `Select`'s "no category" value. `Select` reads an empty string
14
+ * as "no value", so this needs a sentinel no real category can collide with.
15
15
  * `groupIntoSections` trims every key and every curated key is
16
16
  * lowercase-kebab, so a leading space is unreachable by construction — this is
17
17
  * provably distinct rather than merely unlikely.
@@ -13,8 +13,8 @@ export { OTHER, POPULAR_SECTION, CURATED_SECTIONS, sectionKeyForCategory, sectio
13
13
  */
14
14
  export const CATEGORY_ROW_CAP = 6;
15
15
  /**
16
- * The category `Select`'s "no category" value. Radix `SelectItem` cannot hold
17
- * an empty string, so this needs a sentinel no real category can collide with.
16
+ * The category `Select`'s "no category" value. `Select` reads an empty string
17
+ * as "no value", so this needs a sentinel no real category can collide with.
18
18
  * `groupIntoSections` trims every key and every curated key is
19
19
  * lowercase-kebab, so a leading space is unreachable by construction — this is
20
20
  * provably distinct rather than merely unlikely.
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useTranslations } from '../../../i18n/index.js';
4
- import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
4
+ import { VisuallyHidden } from '../../../lib/base-ui-compat.js';
5
5
  import { Button } from '../../../primitives/button.js';
6
6
  import { Modal, ModalClose, ModalContent, ModalTitle } from '../../../primitives/modal.js';
7
7
  import { Skeleton } from '../../../primitives/skeleton.js';
@@ -43,6 +43,7 @@ import { useConnectedProviders } from '../sections/llm-provider/use-connected-pr
43
43
  import { useLiveLlmProviderCatalog, useLlmProviderCatalogRevision, } from '../sections/llm-provider/use-live-catalog.js';
44
44
  import { orderProviderRows } from '../sections/llm-provider/utils.js';
45
45
  import { AccountSecretResourcesPanel } from '../sections/view/account-secret-resources-panel.js';
46
+ import { LegacyChatGptUsage, SubscriptionUsageSection } from '../sections/view/subscription-usage.js';
46
47
  import { useTranslations } from '../../i18n/index.js';
47
48
  import { LLM_PROVIDERS, LLM_PROVIDER_BY_ID } from '../../internal/lib/llm-providers.js';
48
49
  import { cn } from '../../internal/lib/utils.js';
@@ -179,11 +180,11 @@ function ExpandedBody({ projectId, entry, status, keyConnected, canWrite, enable
179
180
  content = (_jsx(AccordionSubRow, { children: entry.hint }));
180
181
  }
181
182
  else if (pooled.pooledSecretsEnabled && pooled.accountId && entry.id === 'openai') {
182
- content = (_jsxs("div", { className: "border-border space-y-3 border-t py-3", children: [_jsx("p", { className: "text-foreground text-xs font-medium", children: tPooled('chatGptAccounts') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "codex", providerName: "ChatGPT Plus/Pro", envVar: "CODEX_AUTH_JSON", canWrite: true, oauth: { projectId, onConnected: () => undefined } }), _jsx(ChatGptSubscriptionConnect, { projectId: projectId, onConnected: () => undefined, legacyOnly: true })] }));
183
+ content = (_jsxs("div", { className: "border-border space-y-3 border-t py-3", children: [_jsx(SubscriptionUsageSection, { accountId: pooled.accountId, projectId: projectId, providerId: "codex", compact: true }), _jsx("p", { className: "text-foreground text-xs font-medium", children: tPooled('chatGptAccounts') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "codex", providerName: "ChatGPT Plus/Pro", envVar: "CODEX_AUTH_JSON", canWrite: true, oauth: { projectId, onConnected: () => undefined } }), _jsx(ChatGptSubscriptionConnect, { projectId: projectId, onConnected: () => undefined, legacyOnly: true, usageSlot: _jsx(LegacyChatGptUsage, { accountId: pooled.accountId, projectId: projectId }) })] }));
183
184
  }
184
185
  else if (pooled.pooledSecretsEnabled && pooled.accountId && entry.id === 'anthropic') {
185
186
  // Claude accounts, exactly as OpenAI lists ChatGPT accounts; Anthropic API keys below them.
186
- content = (_jsxs(_Fragment, { children: [_jsxs("div", { className: "border-border space-y-3 border-t py-3", children: [_jsx("p", { className: "text-foreground text-xs font-medium", children: tPooled('claudeAccounts') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "claude-agent", providerName: "Claude Pro/Max", envVar: "CLAUDE_CODE_OAUTH_TOKEN", canWrite: true, oauth: { projectId, onConnected: () => undefined, kind: 'claude' } })] }), _jsx("div", { className: "border-border border-t py-3", children: _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true }) })] }));
187
+ content = (_jsxs(_Fragment, { children: [_jsxs("div", { className: "border-border space-y-3 border-t py-3", children: [_jsx(SubscriptionUsageSection, { accountId: pooled.accountId, projectId: projectId, providerId: "claude-agent", compact: true }), _jsx("p", { className: "text-foreground text-xs font-medium", children: tPooled('claudeAccounts') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "claude-agent", providerName: "Claude Pro/Max", envVar: "CLAUDE_CODE_OAUTH_TOKEN", canWrite: true, oauth: { projectId, onConnected: () => undefined, kind: 'claude' } })] }), _jsx("div", { className: "border-border border-t py-3", children: _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true }) })] }));
187
188
  }
188
189
  else if (pooled.pooledSecretsEnabled && pooled.accountId && supportsPooledProviderKey(entry)) {
189
190
  content = (_jsxs(_Fragment, { children: [SUBSCRIPTION_BY_PROVIDER[entry.id] ? _jsx(SignInSubRows, { projectId: projectId, entry: entry, canWrite: canWrite }) : null, _jsx("div", { className: "border-border border-t py-3", children: _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true }) })] }));
@@ -1,5 +1,6 @@
1
1
  import { type LlmProviderEntry } from '../../internal/lib/llm-providers.js';
2
2
  import { type ProviderConnectMethod, type ProviderConnectedVia, providerConnectMethod, providerConnectedVia } from '@kortix/sdk';
3
+ import { type UsageTone } from '../sections/view/subscription-usage.js';
3
4
  export { FIRST_CLASS_PROVIDER_IDS, supportsPooledProviderKey, } from '@kortix/sdk';
4
5
  /** Providers whose sheet offers a subscription sign-in beside the API key. */
5
6
  export declare const SUBSCRIPTION_PROVIDER_IDS: ReadonlySet<string>;
@@ -25,6 +26,12 @@ export interface ProviderListRow {
25
26
  via?: ConnectedVia;
26
27
  /** Inference turned off for this project; credentials are kept. */
27
28
  disabled?: boolean;
29
+ /** ChatGPT and Claude subscription usage across every login: the row's trailing line. */
30
+ usage?: {
31
+ text: string;
32
+ percent: number;
33
+ tone: UsageTone;
34
+ } | null;
28
35
  }
29
36
  /**
30
37
  * The provider logo with its status on the tile's corner: a solid green check
@@ -37,6 +37,7 @@ import { PLATFORM_FEE_PERCENT } from '../../internal/billing/compute-pricing.js'
37
37
  import { FIRST_CLASS_PROVIDER_IDS, PROVIDER_SUBSCRIPTIONS, getProjectDetail, providerConnectMethod, providerConnectedVia, } from '@kortix/sdk';
38
38
  import { qk, useAccountSecretResources, useFeatureFlag, useModelAccess, useProjectModelPickerCatalog, } from '@kortix/sdk/react';
39
39
  import { useQuery } from '@tanstack/react-query';
40
+ import { SUBSCRIPTION_ROW, SubscriptionRowMeter, summarizeSubscriptions, useLiveSubscriptionUsages, useSubscriptionLogins, useSubscriptionRowSummary, } from '../sections/view/subscription-usage.js';
40
41
  export { FIRST_CLASS_PROVIDER_IDS, supportsPooledProviderKey, } from '@kortix/sdk';
41
42
  /** Providers whose sheet offers a subscription sign-in beside the API key. */
42
43
  export const SUBSCRIPTION_PROVIDER_IDS = new Set(Object.keys(PROVIDER_SUBSCRIPTIONS));
@@ -92,7 +93,7 @@ function ProviderRow({ row, selected, onSelect, }) {
92
93
  const tAccess = useTranslations('modelAccess');
93
94
  return (_jsxs("button", { type: "button", "data-provider-row": row.id, "aria-current": selected || undefined, onClick: () => onSelect(row.id), className: cn('group flex min-h-12 w-full items-center gap-3 rounded-md px-3 py-2 text-left', 'hover:bg-muted/60 transition-[background-color] duration-(--duration-normal) ease-out', 'focus-visible:ring-ring/50 outline-none focus-visible:ring-2', selected && 'bg-muted hover:bg-muted'), children: [_jsx(ProviderLogoStatus, { providerId: row.id, label: row.label, status: row.status, size: "medium" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground block truncate text-sm font-medium", children: row.label }), _jsx("span", { className: "text-muted-foreground block truncate text-xs", children: row.method === 'included' && row.modelCount === 0
94
95
  ? row.hint ?? tAccess('managedUpgradeHint')
95
- : meta(row.method, row.modelCount, row.id, row.via) })] }), row.disabled ? (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: t('turnedOff') })) : null, _jsx(CaretRightIcon, { className: cn('text-muted-foreground size-3.5 shrink-0 transition-[color] duration-(--duration-normal)', 'group-hover:text-foreground', selected && 'text-foreground') })] }));
96
+ : meta(row.method, row.modelCount, row.id, row.via) })] }), row.disabled ? (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: t('turnedOff') })) : row.usage ? (_jsx(SubscriptionRowMeter, { ...row.usage })) : null, _jsx(CaretRightIcon, { className: cn('text-muted-foreground size-3.5 shrink-0 transition-[color] duration-(--duration-normal)', 'group-hover:text-foreground', selected && 'text-foreground') })] }));
96
97
  }
97
98
  function ProviderGroup({ label, rows, selectedId, onSelect, }) {
98
99
  if (rows.length === 0)
@@ -186,6 +187,23 @@ export function ProviderConnect({ projectId, canWrite = false, enabled = true, s
186
187
  useLiveLlmProviderCatalog(projectId, enabled);
187
188
  const catalogRevision = useLlmProviderCatalogRevision();
188
189
  const { connectedProviders, providerStateLoading } = useConnectedProviders(projectId, enabled);
190
+ const subscriptionAccountId = enabled && pooled.pooledSecretsEnabled ? pooled.accountId : null;
191
+ const subscriptions = useSubscriptionLogins(subscriptionAccountId, projectId);
192
+ const liveUsage = useLiveSubscriptionUsages(subscriptionAccountId, projectId, subscriptions.logins);
193
+ const rowSummary = useSubscriptionRowSummary();
194
+ // Each subscription login's live usage, summed per provider row (ChatGPT → OpenAI, Claude → Anthropic).
195
+ const now = Math.max(subscriptions.dataUpdatedAt, liveUsage.updatedAt);
196
+ const usageByRow = useMemo(() => {
197
+ const byRow = new Map();
198
+ for (const login of liveUsage.usages) {
199
+ const row = SUBSCRIPTION_ROW[login.secret.provider_id ?? ''];
200
+ if (row)
201
+ byRow.set(row, [...(byRow.get(row) ?? []), login]);
202
+ }
203
+ return new Map([...byRow].map(([row, logins]) => [row, rowSummary(summarizeSubscriptions(logins, now), now)]));
204
+ // `liveUsage.usages` is a fresh array each render; `now` moves with every read it holds.
205
+ // eslint-disable-next-line react-hooks/exhaustive-deps
206
+ }, [now, subscriptions.logins, rowSummary]);
189
207
  const [search, setSearch] = useState('');
190
208
  const [visibleCount, setVisibleCount] = useState(PROVIDER_PAGE_SIZE);
191
209
  const connectedIds = useMemo(() => new Set(connectedProviders.map((provider) => provider.id)), [connectedProviders]);
@@ -223,13 +241,14 @@ export function ProviderConnect({ projectId, canWrite = false, enabled = true, s
223
241
  : 'none',
224
242
  via: connectedVia(entry.id, connectedIds),
225
243
  disabled: disabledProviders.has(entry.id),
244
+ usage: usageByRow.get(entry.id) ?? null,
226
245
  };
227
246
  });
228
247
  return {
229
248
  inUse: rows.filter((row) => row.status !== 'none'),
230
249
  available: rows.filter((row) => row.status === 'none'),
231
250
  };
232
- }, [searchable, connectedIds, pooled.pooledProviderIds, search, access.data]);
251
+ }, [searchable, connectedIds, pooled.pooledProviderIds, search, access.data, usageByRow]);
233
252
  const searching = search.trim().length > 0;
234
253
  const limit = searching ? available.length : visibleCount;
235
254
  const visibleAvailable = available.slice(0, limit);
@@ -43,6 +43,7 @@ import { ChatGptSubscriptionConnect, useSubscriptionSignIn, } from '../sections/
43
43
  import { useConnectedProviders } from '../sections/llm-provider/use-connected-providers.js';
44
44
  import { envVarPlaceholder, formatTokenCount, prettyFieldLabel, providerDisconnectPlan, } from '../sections/llm-provider/utils.js';
45
45
  import { AccountSecretResourcesPanel } from '../sections/view/account-secret-resources-panel.js';
46
+ import { LegacyChatGptUsage, SubscriptionUsageSection } from '../sections/view/subscription-usage.js';
46
47
  import { useTranslations } from '../../i18n/index.js';
47
48
  import { LLM_PROVIDER_BY_ID } from '../../internal/lib/llm-providers.js';
48
49
  import { cn } from '../../internal/lib/utils.js';
@@ -289,11 +290,11 @@ export function ProviderSheet({ projectId, providerId, canWrite, enabled = true,
289
290
  content = (_jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: entry.hint }), models] }));
290
291
  }
291
292
  else if (pooled.pooledSecretsEnabled && pooled.accountId && entry.id === 'openai') {
292
- content = (_jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: tPooled('chatGptAccounts') }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: tPooled('oauthPrivateDescription') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "codex", providerName: "ChatGPT Plus/Pro", envVar: "CODEX_AUTH_JSON", canWrite: true, oauth: { projectId, onConnected: () => undefined } }), _jsx(ChatGptSubscriptionConnect, { projectId: projectId, onConnected: () => undefined, legacyOnly: true })] }), models] }));
293
+ content = (_jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsx(SubscriptionUsageSection, { accountId: pooled.accountId, projectId: projectId, providerId: "codex" }), _jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: tPooled('chatGptAccounts') }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: tPooled('oauthPrivateDescription') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "codex", providerName: "ChatGPT Plus/Pro", envVar: "CODEX_AUTH_JSON", canWrite: true, oauth: { projectId, onConnected: () => undefined } }), _jsx(ChatGptSubscriptionConnect, { projectId: projectId, onConnected: () => undefined, legacyOnly: true, usageSlot: _jsx(LegacyChatGptUsage, { accountId: pooled.accountId, projectId: projectId }) })] }), models] }));
293
294
  }
294
295
  else if (pooled.pooledSecretsEnabled && pooled.accountId && entry.id === 'anthropic') {
295
296
  // Claude accounts, exactly as OpenAI lists ChatGPT accounts; Anthropic API keys below them.
296
- content = (_jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: tPooled('claudeAccounts') }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: tPooled('claudeOauthPrivateDescription') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "claude-agent", providerName: "Claude Pro/Max", envVar: "CLAUDE_CODE_OAUTH_TOKEN", canWrite: true, oauth: { projectId, onConnected: () => undefined, kind: 'claude' } })] }), _jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: tPooled('providerKeysFor', { provider: entry.label }) }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true })] }), models] }));
297
+ content = (_jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsx(SubscriptionUsageSection, { accountId: pooled.accountId, projectId: projectId, providerId: "claude-agent" }), _jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: tPooled('claudeAccounts') }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: tPooled('claudeOauthPrivateDescription') }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: "claude-agent", providerName: "Claude Pro/Max", envVar: "CLAUDE_CODE_OAUTH_TOKEN", canWrite: true, oauth: { projectId, onConnected: () => undefined, kind: 'claude' } })] }), _jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: tPooled('providerKeysFor', { provider: entry.label }) }), _jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true })] }), models] }));
297
298
  }
298
299
  else if (pooled.pooledSecretsEnabled && pooled.accountId && supportsPooledProviderKey(entry)) {
299
300
  content = (_jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsx(AccountSecretResourcesPanel, { accountId: pooled.accountId, projectId: projectId, providerId: entry.id, providerName: entry.label, envVar: entry.envVars[0], canWrite: true }), models] }));
@@ -72,7 +72,7 @@ import { type ReactNode } from 'react';
72
72
  import type { ResourceScope } from '../shared/agent-resource-scope.js';
73
73
  export declare const MODELS_PAGE_TITLE = "Models";
74
74
  export declare const MODELS_PAGE_DESCRIPTION = "Choose the providers and models this workspace can use.";
75
- type LlmTab = 'providers' | 'models' | 'custom' | 'gateway' | 'routing' | 'overview' | 'logs' | 'usage';
75
+ type LlmTab = 'providers' | 'models' | 'custom' | 'gateway' | 'routing' | 'overview' | 'logs';
76
76
  interface LlmTabEntry {
77
77
  /** `agent` exists only on the agent variant (`AGENT_LLM_TABS`). */
78
78
  id: LlmTab | 'agent';
@@ -135,7 +135,7 @@ export declare function ProjectDefaultPicker({ projectId }: {
135
135
  * character.
136
136
  *
137
137
  * One section at a time, by the caller's state — NOT seven `TabsContent`
138
- * panels. Radix keeps every panel in the tree and each one used to open its
138
+ * panels. `Tabs` keeps every panel element in the tree and each one used to open its
139
139
  * own `overflow-y-auto`, which is how this page ended up with three nested
140
140
  * scroll containers under a shell that already had one.
141
141
  *
@@ -88,7 +88,6 @@ import { CapabilityPageShell } from '../shared/capability-page-shell.js';
88
88
  import { GatewayAccessTab } from './gateway-access-tab.js';
89
89
  import { CustomProviderPanel } from './llm-provider/custom-provider-panel.js';
90
90
  import { ModelsTab } from './llm-provider/models-tab.js';
91
- import { SubscriptionUsageTab, useHasSubscriptions } from './view/subscription-usage-tab.js';
92
91
  import { GatewayLogs } from './view/gateway/gateway-logs.js';
93
92
  import { GatewayOverview } from './view/gateway/gateway-overview.js';
94
93
  import { GatewayRouting } from './view/gateway/gateway-routing.js';
@@ -119,7 +118,8 @@ export const LLM_TABS = [
119
118
  // file's own render switch keep working unchanged.
120
119
  { id: 'overview', label: 'Costs' },
121
120
  { id: 'logs', label: 'Logs' },
122
- { id: 'usage', label: 'Usage' },
121
+ // ChatGPT and Claude subscription usage lives in the provider's sheet
122
+ // (OpenAI, Anthropic), beside the accounts it describes: not a tab.
123
123
  ];
124
124
  export const QUICK_LLM_TABS = LLM_TABS.filter((t) => ['providers', 'models', 'custom'].includes(t.id));
125
125
  /** True when `tab` is one of the quick version's three. */
@@ -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
  *
@@ -208,7 +208,7 @@ export function LlmSections({ projectId, tab, onTabChange, canWrite, enabled, se
208
208
  dialog, so connecting Anthropic here opens nothing on top of what
209
209
  you are already looking at. `p-0` because the host column already
210
210
  carries the padding. */
211
- _jsx(ProviderConnect, { projectId: projectId, canWrite: canWrite, enabled: enabled, selectedId: selectedProviderId, onSelect: onSelectProvider })), tab === 'models' && _jsx(ModelsTab, { projectId: projectId, canWrite: canWrite }), tab === 'custom' && _jsx(CustomProviderPanel, { projectId: projectId, canWrite: canWrite }), tab === 'gateway' && (_jsx(GatewayAccessTab, { projectId: projectId, canWrite: canWrite, onViewModels: () => onTabChange('models') })), tab === 'routing' && (_jsx(GatewayRouting, { projectId: projectId, canWrite: canWrite, projectDefaultPending: modelDefaults.isUpdating })), tab === 'overview' && _jsx(GatewayOverview, { projectId: projectId, canWrite: canWrite }), tab === 'logs' && _jsx(GatewayLogs, { projectId: projectId }), tab === 'usage' && (_jsx(SubscriptionUsageTab, { projectId: projectId, onConnect: () => onTabChange('providers') }))] }));
211
+ _jsx(ProviderConnect, { projectId: projectId, canWrite: canWrite, enabled: enabled, selectedId: selectedProviderId, onSelect: onSelectProvider })), tab === 'models' && _jsx(ModelsTab, { projectId: projectId, canWrite: canWrite }), tab === 'custom' && _jsx(CustomProviderPanel, { projectId: projectId, canWrite: canWrite }), tab === 'gateway' && (_jsx(GatewayAccessTab, { projectId: projectId, canWrite: canWrite, onViewModels: () => onTabChange('models') })), tab === 'routing' && (_jsx(GatewayRouting, { projectId: projectId, canWrite: canWrite, projectDefaultPending: modelDefaults.isUpdating })), tab === 'overview' && _jsx(GatewayOverview, { projectId: projectId, canWrite: canWrite }), tab === 'logs' && _jsx(GatewayLogs, { projectId: projectId })] }));
212
212
  }
213
213
  /** The agent variant's own tab, ahead of the seven project tabs. */
214
214
  const AGENT_TAB = 'agent';
@@ -221,9 +221,7 @@ export function LlmManagementView({ projectId, surface = { kind: 'global' }, age
221
221
  const agentScoped = surface.kind === 'agent' && agentSettings !== undefined;
222
222
  const urlTab = !agentScoped ? LLM_TABS.find(entry => entry.id === requestedTab)?.id : undefined;
223
223
  const tAgentScope = useTranslations('agentScope');
224
- // No ChatGPT or Claude login, no Usage tab: it would only say "connect one".
225
- const subscriptions = useHasSubscriptions(projectId);
226
- const pageTabs = useMemo(() => (subscriptions.has ? LLM_TABS : LLM_TABS.filter((entry) => entry.id !== 'usage')), [subscriptions.has]);
224
+ const pageTabs = LLM_TABS;
227
225
  const agentTabs = useMemo(() => [{ id: AGENT_TAB, label: tAgentScope('thisAgent') }, ...pageTabs], [tAgentScope, pageTabs]);
228
226
  const [tab, setTab] = useState(() => urlTab ?? TAB_BY_SECTION[section] ?? (agentScoped ? AGENT_TAB : 'providers'));
229
227
  // A role with the LLM section's READ leaf (project.read) but not
@@ -246,13 +244,30 @@ export function LlmManagementView({ projectId, surface = { kind: 'global' }, age
246
244
  params.delete('provider');
247
245
  navigate(`${pathname}?${params}`, { replace: true });
248
246
  }, [searchParams, pathname, navigate, agentScoped]);
249
- // A link to Usage after the last subscription was disconnected lands on Providers.
250
- useEffect(() => {
251
- if (tab === 'usage' && subscriptions.ready && !subscriptions.has)
252
- selectTab('providers');
253
- }, [tab, subscriptions.ready, subscriptions.has, selectTab]);
254
- const [providerId, setProviderId] = useState(null);
255
- return (_jsx(ProviderSheetSplit, { projectId: projectId, providerId: tab === 'providers' ? providerId : null, onProviderChange: setProviderId, canWrite: canWrite, children: _jsx(CapabilityPageShell, { title: MODELS_PAGE_TITLE, description:
247
+ // `?provider=openai` opens that provider's sheet: search and the command
248
+ // palette link ChatGPT and Claude subscription usage there. The retired
249
+ // `?tab=usage` has no tab and lands on Providers.
250
+ // The open sheet and the URL move together, so the same link opens it again
251
+ // after it was closed.
252
+ const requestedProvider = searchParams.get('provider');
253
+ const [providerId, setProviderId] = useState(requestedProvider);
254
+ const [linkedProvider, setLinkedProvider] = useState(requestedProvider);
255
+ if (linkedProvider !== requestedProvider) {
256
+ setLinkedProvider(requestedProvider);
257
+ setProviderId(requestedProvider);
258
+ }
259
+ const changeProvider = useCallback((next) => {
260
+ setProviderId(next);
261
+ if (agentScoped)
262
+ return;
263
+ const params = new URLSearchParams(searchParams.toString());
264
+ if (next)
265
+ params.set('provider', next);
266
+ else
267
+ params.delete('provider');
268
+ navigate(`${pathname}?${params}`, { replace: true });
269
+ }, [searchParams, pathname, navigate, agentScoped]);
270
+ return (_jsx(ProviderSheetSplit, { projectId: projectId, providerId: tab === 'providers' ? providerId : null, onProviderChange: changeProvider, canWrite: canWrite, children: _jsx(CapabilityPageShell, { title: MODELS_PAGE_TITLE, description:
256
271
  // Only "This agent" is the agent's own; every other tab edits state
257
272
  // that all of the project's agents share, and the line says so.
258
273
  agentScoped ? tAgentScope('modelsDescription') : MODELS_PAGE_DESCRIPTION,
@@ -261,7 +276,7 @@ export function LlmManagementView({ projectId, surface = { kind: 'global' }, age
261
276
  action: canWrite && !agentScoped ? _jsx(ProjectDefaultPicker, { projectId: projectId }) : undefined, filters: _jsx(_Fragment, { children: agentScoped ? (
262
277
  // Eight tabs in the editor's pane, beside the rail: the strip
263
278
  // scrolls rather than push the row wider than the column.
264
- _jsx(FadedScrollArea, { orientation: "horizontal", fadeColor: "from-background", className: "min-w-0 max-w-full", children: _jsx(LlmTabStrip, { value: tab, onValueChange: (v) => selectTab(v), tabs: agentTabs }) })) : (_jsx(FadedScrollArea, { orientation: "horizontal", fadeColor: "from-background", className: "min-w-0 max-w-full", children: _jsx(LlmTabStrip, { value: tab, onValueChange: (v) => selectTab(v), tabs: pageTabs }) })) }), children: tab === AGENT_TAB ? (agentSettings) : (_jsx(LlmSections, { projectId: projectId, tab: tab, onTabChange: selectTab, canWrite: canWrite, enabled: open, selectedProviderId: providerId, onSelectProvider: setProviderId })) }) }));
279
+ _jsx(FadedScrollArea, { orientation: "horizontal", fadeColor: "from-background", className: "min-w-0 max-w-full", children: _jsx(LlmTabStrip, { value: tab, onValueChange: (v) => selectTab(v), tabs: agentTabs }) })) : (_jsx(FadedScrollArea, { orientation: "horizontal", fadeColor: "from-background", className: "min-w-0 max-w-full", children: _jsx(LlmTabStrip, { value: tab, onValueChange: (v) => selectTab(v), tabs: pageTabs }) })) }), children: tab === AGENT_TAB ? (agentSettings) : (_jsx(LlmSections, { projectId: projectId, tab: tab, onTabChange: selectTab, canWrite: canWrite, enabled: open, selectedProviderId: providerId, onSelectProvider: changeProvider })) }) }));
265
280
  }
266
281
  /**
267
282
  * The provider list beside the provider it opened — the page and the quick
@@ -64,10 +64,12 @@ export declare function useSubscriptionSignIn({ projectId, onConnected, kind, }:
64
64
  submitCode: (code: string) => Promise<void>;
65
65
  checking: boolean;
66
66
  };
67
- export declare function ChatGptSubscriptionConnect({ projectId, onConnected, accessSlot, legacyOnly, kind, }: {
67
+ export declare function ChatGptSubscriptionConnect({ projectId, onConnected, accessSlot, usageSlot, legacyOnly, kind, }: {
68
68
  projectId: string;
69
69
  onConnected: (providerId: string) => void;
70
70
  accessSlot?: ReactNode;
71
+ /** The login's plan windows, under its name (the legacy project login). */
72
+ usageSlot?: ReactNode;
71
73
  legacyOnly?: boolean;
72
74
  kind?: SubscriptionKind;
73
75
  }): import("react").JSX.Element | null;
@@ -273,7 +273,7 @@ export function useSubscriptionSignIn({ projectId, onConnected, kind = 'chatgpt'
273
273
  }
274
274
  // Legacy ChatGPT subscription login. With pooled connections enabled this
275
275
  // component shows only an existing project login; new accounts use resources.
276
- export function ChatGptSubscriptionConnect({ projectId, onConnected, accessSlot, legacyOnly = false, kind = 'chatgpt', }) {
276
+ export function ChatGptSubscriptionConnect({ projectId, onConnected, accessSlot, usageSlot, legacyOnly = false, kind = 'chatgpt', }) {
277
277
  const tHardcodedUi = useTranslations('hardcodedUi');
278
278
  const tPooled = useTranslations('pooledSecrets');
279
279
  const { subscription, copy, phase, challenge, error, connected, start: handleConnect, cancel: reset, disconnect, } = useSubscriptionSignIn({ projectId, onConnected, kind });
@@ -281,7 +281,7 @@ export function ChatGptSubscriptionConnect({ projectId, onConnected, accessSlot,
281
281
  const action = subscriptionPrimaryAction({ connected, failed: !!error });
282
282
  if (legacyOnly && !connected)
283
283
  return null;
284
- return (_jsxs("div", { className: "bg-popover rounded-md border px-4 py-4", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(ProviderLogo, { providerID: subscription.logo, name: subscription.logoName, size: "default" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "text-foreground text-sm font-medium", children: legacyOnly ? tPooled('legacyChatGptLogin') : copy.title }), _jsx("p", { className: "text-muted-foreground mt-0.5 text-xs leading-5", children: legacyOnly ? tPooled('legacyChatGptDescription') : copy.description })] }), accessSlot] }), waiting && (_jsxs("div", { className: "border-border bg-muted/30 mt-3 rounded-md border p-3", children: [challenge ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-foreground text-xs font-medium", children: tHardcodedUi.raw('autoComponentsProjectsProjectProviderModalJsxTextAuthorizeInThed882ae47') }), _jsx("div", { className: "mt-3", children: _jsx(ChatGptDeviceChallenge, { url: challenge.url, code: challenge.code, description: copy.deviceDescription }) })] })) : (_jsx("div", { className: "text-foreground text-xs font-medium", children: tHardcodedUi.raw('autoComponentsProjectsProjectProviderModalJsxTextStartingAuthorization35b1fe13') })), _jsxs("div", { className: "text-muted-foreground mt-3 flex items-center gap-2 text-xs", children: [_jsx(Loading, { className: "size-3.5 shrink-0" }), challenge
284
+ return (_jsxs("div", { className: "bg-popover rounded-md border px-4 py-4", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(ProviderLogo, { providerID: subscription.logo, name: subscription.logoName, size: "default" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "text-foreground text-sm font-medium", children: legacyOnly ? tPooled('legacyChatGptLogin') : copy.title }), _jsx("p", { className: "text-muted-foreground mt-0.5 text-xs leading-5", children: legacyOnly ? tPooled('legacyChatGptDescription') : copy.description })] }), accessSlot] }), usageSlot ? _jsx("div", { className: "mt-3", children: usageSlot }) : null, waiting && (_jsxs("div", { className: "border-border bg-muted/30 mt-3 rounded-md border p-3", children: [challenge ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-foreground text-xs font-medium", children: tHardcodedUi.raw('autoComponentsProjectsProjectProviderModalJsxTextAuthorizeInThed882ae47') }), _jsx("div", { className: "mt-3", children: _jsx(ChatGptDeviceChallenge, { url: challenge.url, code: challenge.code, description: copy.deviceDescription }) })] })) : (_jsx("div", { className: "text-foreground text-xs font-medium", children: tHardcodedUi.raw('autoComponentsProjectsProjectProviderModalJsxTextStartingAuthorization35b1fe13') })), _jsxs("div", { className: "text-muted-foreground mt-3 flex items-center gap-2 text-xs", children: [_jsx(Loading, { className: "size-3.5 shrink-0" }), challenge
285
285
  ? tHardcodedUi.raw('i18nComplete.text2f938f9b118b')
286
286
  : copy.connecting] })] })), (phase === 'done' || (connected && !waiting)) && (_jsxs(BannerAlert, { variant: "success", className: "mt-3 text-xs", children: [_jsx(BannerAlertMedia, { children: _jsx(CheckCircle2, {}) }), _jsx(BannerAlertDescription, { children: copy.connectedBanner })] })), error && (_jsxs(BannerAlert, { variant: "destructive", className: "mt-3 text-xs", children: [_jsx(BannerAlertMedia, { children: _jsx(TriangleAlert, {}) }), _jsx(BannerAlertDescription, { children: error })] })), _jsx("div", { className: "mt-3 flex flex-wrap gap-2", children: waiting ? (_jsx(Button, { type: "button", size: "sm", variant: "outline", className: "px-4", onClick: reset, children: tHardcodedUi.raw('i18nComplete.text19766ed6ccb2') })) : action === 'disconnect' ? (_jsx(Button, { type: "button", size: "sm", variant: "outline", className: "px-4", disabled: disconnect.isPending, onClick: () => disconnect.mutate(), children: disconnect.isPending
287
287
  ? tHardcodedUi.raw('i18nComplete.textcb2b6a572a85')
@@ -24,7 +24,7 @@ import { PROJECT_ACTIONS } from '../../../internal/lib/project-actions.js';
24
24
  import { useProjectCan } from '../../../internal/lib/use-project-can.js';
25
25
  import { accessSummary, chatGptSharing, keyAccessFields, labelOwnerName, needsReconnection } from '../../../internal/lib/account-secret-access.js';
26
26
  import { UndecryptableValue } from './undecryptable-value.js';
27
- import { isSubscriptionLogin, SubscriptionAccountLine, SubscriptionUsageMeters } from './subscription-usage.js';
27
+ import { isSubscriptionLogin, SubscriptionAccountLine, SubscriptionAccountUsage } from './subscription-usage.js';
28
28
  const NO_MEMBERS = { memberIds: [], groupIds: [], inviteEmails: [] };
29
29
  /** Between ChatGPT confirming the sign-in and the account appearing in the list. */
30
30
  function ChatGptSignInFinishing({ label }) {
@@ -233,7 +233,9 @@ export function AccountSecretResourcesPanel({ accountId, projectId, providerId,
233
233
  if (reconnecting && reconnecting.label !== reconnectLabel)
234
234
  setReconnectLabel(reconnecting.label);
235
235
  const [sharing, setSharing] = useState(null);
236
- // New connections are private to their creator: sharing is opt-in.
236
+ // A new connection is shared with everyone in the workspace. A viewer who may
237
+ // not share gets "Only you", the one choice the API accepts from them.
238
+ // `openCreate` sets it from the probe's answer when the dialog opens.
237
239
  const [createMode, setCreateMode] = useState('private');
238
240
  const [sharingMode, setSharingMode] = useState('project');
239
241
  const [selectedMembers, setSelectedMembers] = useState(NO_MEMBERS);
@@ -351,7 +353,7 @@ export function AccountSecretResourcesPanel({ accountId, projectId, providerId,
351
353
  },
352
354
  });
353
355
  const openCreate = () => {
354
- setCreateMode('private');
356
+ setCreateMode(canShare ? 'project' : 'private');
355
357
  setSelectedMembers(NO_MEMBERS);
356
358
  setLabel(defaultLabel());
357
359
  save.reset();
@@ -382,9 +384,10 @@ export function AccountSecretResourcesPanel({ accountId, projectId, providerId,
382
384
  // A value Kortix cannot decrypt is lost (KRTX-1719): the gateway skips
383
385
  // it. A login is reconnected; a key is entered again.
384
386
  const undecryptable = secret.status === 'undecryptable';
385
- // A subscription login shows its plan windows; they say "limit reached" and when it resets.
387
+ // A subscription login names its email and plan, and shows every plan
388
+ // window under it; the sheet's summary sits above this list.
386
389
  const usageShown = Boolean(oauth) && isSubscriptionLogin(secret) && !undecryptable;
387
- 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 && _jsx(SubscriptionAccountLine, { accountId: accountId, 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 && _jsx(SubscriptionUsageMeters, { accountId: accountId, 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));
390
+ 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));
388
391
  }) })) : null, _jsx(Modal, { open: creating || rotating !== null, onOpenChange: (open) => { if (!open && !save.isPending && !authorization.finishing)
389
392
  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') })
390
393
  : (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`.