@kortix/ui 0.15.7 → 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 (181) 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/sections/gateway-view.d.ts +1 -1
  9. package/dist/customize/sections/gateway-view.js +1 -1
  10. package/dist/customize/sections/view/account-secret-resources-panel.js +4 -2
  11. package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
  12. package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
  13. package/dist/customize/sections/view/git-view.js +1 -1
  14. package/dist/customize/sections/view/permission-editor.js +1 -1
  15. package/dist/customize/sections/view/subscription-usage.d.ts +3 -32
  16. package/dist/customize/sections/view/subscription-usage.js +2 -86
  17. package/dist/customize/shared/entity/entity-modal.js +8 -10
  18. package/dist/files/project/components/drive-toolbar.d.ts +1 -1
  19. package/dist/files/project/components/drive-toolbar.js +1 -1
  20. package/dist/files/project/store/version-store.d.ts +1 -1
  21. package/dist/files/renderers/shared/scroll-area-compat.d.ts +6 -6
  22. package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
  23. package/dist/files/renderers/shared/select-compat.js +3 -7
  24. package/dist/files/viewer/file-preview-modal.d.ts +10 -11
  25. package/dist/files/viewer/file-preview-modal.js +17 -18
  26. package/dist/i18n/en.d.ts +3 -0
  27. package/dist/i18n/en.js +7 -4
  28. package/dist/index.js +1 -1
  29. package/dist/internal/account-hub/account-hub-location.js +2 -2
  30. package/dist/internal/account-hub/use-account-members.d.ts +28 -1
  31. package/dist/internal/account-hub/use-account-members.js +27 -10
  32. package/dist/internal/components/agent-mark.d.ts +1 -8
  33. package/dist/internal/components/agent-mark.js +2 -19
  34. package/dist/internal/lib/navigation/modified-click.js +2 -2
  35. package/dist/internal/lib/pixel-mark.d.ts +3 -20
  36. package/dist/internal/lib/pixel-mark.js +3 -34
  37. package/dist/internal/stores/active-space-store.d.ts +1 -1
  38. package/dist/internal/stores/browser-recents-store.d.ts +1 -1
  39. package/dist/internal/stores/current-account-store.d.ts +1 -1
  40. package/dist/internal/stores/first-chat-store.d.ts +1 -1
  41. package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
  42. package/dist/internal/stores/session-browser-store.d.ts +1 -1
  43. package/dist/internal/stores/session-expanded-store.d.ts +1 -1
  44. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  45. package/dist/internal/stores/session-history-view-store.d.ts +1 -1
  46. package/dist/internal/stores/session-hover-store.d.ts +1 -1
  47. package/dist/internal/stores/session-hover-store.js +1 -1
  48. package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
  49. package/dist/internal/stores/sound-store.d.ts +1 -1
  50. package/dist/internal/stores/tab-store.d.ts +1 -1
  51. package/dist/internal/stores/user-preferences-store.d.ts +1 -1
  52. package/dist/internal/stores/web-notification-store.d.ts +1 -1
  53. package/dist/lib/base-ui-compat.d.ts +149 -0
  54. package/dist/lib/base-ui-compat.js +339 -0
  55. package/dist/lib/portal-container.d.ts +3 -7
  56. package/dist/lib/portal-container.js +5 -3
  57. package/dist/lib/z-stack.d.ts +4 -4
  58. package/dist/lib/z-stack.js +5 -5
  59. package/dist/primitives/accordion.d.ts +36 -5
  60. package/dist/primitives/accordion.js +41 -8
  61. package/dist/primitives/alert-dialog.d.ts +33 -11
  62. package/dist/primitives/alert-dialog.js +41 -19
  63. package/dist/primitives/avatar.d.ts +5 -2
  64. package/dist/primitives/avatar.js +3 -3
  65. package/dist/primitives/badge.js +1 -1
  66. package/dist/primitives/breadcrumb.js +1 -1
  67. package/dist/primitives/button-group.js +3 -3
  68. package/dist/primitives/button.js +1 -1
  69. package/dist/primitives/checkbox.d.ts +14 -5
  70. package/dist/primitives/checkbox.js +24 -9
  71. package/dist/primitives/collapsible.d.ts +16 -4
  72. package/dist/primitives/collapsible.js +18 -7
  73. package/dist/primitives/command-core.d.ts +121 -0
  74. package/dist/primitives/command-core.js +642 -0
  75. package/dist/primitives/command.d.ts +38 -4
  76. package/dist/primitives/command.js +22 -13
  77. package/dist/primitives/context-menu.d.ts +61 -31
  78. package/dist/primitives/context-menu.js +40 -53
  79. package/dist/primitives/dialog.d.ts +48 -10
  80. package/dist/primitives/dialog.js +48 -19
  81. package/dist/primitives/disclosure.d.ts +1 -1
  82. package/dist/primitives/disclosure.js +2 -2
  83. package/dist/primitives/drawer.d.ts +28 -9
  84. package/dist/primitives/drawer.js +42 -18
  85. package/dist/primitives/dropdown-menu.d.ts +55 -33
  86. package/dist/primitives/dropdown-menu.js +46 -82
  87. package/dist/primitives/faded-scroll-area.js +2 -1
  88. package/dist/primitives/hint.js +3 -3
  89. package/dist/primitives/hover-card.d.ts +17 -5
  90. package/dist/primitives/hover-card.js +45 -8
  91. package/dist/primitives/item.js +2 -2
  92. package/dist/primitives/label.d.ts +5 -2
  93. package/dist/primitives/label.js +10 -3
  94. package/dist/primitives/menu-base.d.ts +150 -0
  95. package/dist/primitives/menu-base.js +171 -0
  96. package/dist/primitives/menu-recipe.d.ts +1 -1
  97. package/dist/primitives/menu-recipe.js +2 -7
  98. package/dist/primitives/modal.d.ts +19 -52
  99. package/dist/primitives/modal.js +24 -28
  100. package/dist/primitives/navigation-menu.d.ts +36 -11
  101. package/dist/primitives/navigation-menu.js +31 -12
  102. package/dist/primitives/popover.d.ts +31 -6
  103. package/dist/primitives/popover.js +79 -12
  104. package/dist/primitives/preview-image.d.ts +18 -7
  105. package/dist/primitives/preview-image.js +14 -11
  106. package/dist/primitives/progress.d.ts +4 -2
  107. package/dist/primitives/progress.js +4 -3
  108. package/dist/primitives/project-icon-picker.js +2 -2
  109. package/dist/primitives/radio-group.d.ts +28 -5
  110. package/dist/primitives/radio-group.js +18 -10
  111. package/dist/primitives/scroll-area.d.ts +2 -2
  112. package/dist/primitives/scroll-area.js +8 -3
  113. package/dist/primitives/select.d.ts +55 -12
  114. package/dist/primitives/select.js +93 -36
  115. package/dist/primitives/separator.d.ts +6 -2
  116. package/dist/primitives/separator.js +10 -2
  117. package/dist/primitives/sheet.d.ts +17 -10
  118. package/dist/primitives/sheet.js +19 -22
  119. package/dist/primitives/sidebar-menu-primitives.js +8 -8
  120. package/dist/primitives/slider-native.d.ts +2 -2
  121. package/dist/primitives/slider-native.js +11 -9
  122. package/dist/primitives/slider.d.ts +24 -6
  123. package/dist/primitives/slider.js +26 -24
  124. package/dist/primitives/slot.d.ts +6 -0
  125. package/dist/primitives/slot.js +7 -0
  126. package/dist/primitives/split-sheet.js +1 -1
  127. package/dist/primitives/stepper.js +1 -1
  128. package/dist/primitives/switch.d.ts +16 -3
  129. package/dist/primitives/switch.js +7 -6
  130. package/dist/primitives/tabs.d.ts +36 -20
  131. package/dist/primitives/tabs.js +131 -102
  132. package/dist/primitives/toggle.d.ts +16 -3
  133. package/dist/primitives/toggle.js +8 -3
  134. package/dist/primitives/tooltip.d.ts +24 -5
  135. package/dist/primitives/tooltip.js +32 -10
  136. package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
  137. package/dist/primitives/type-to-confirm-dialog.js +1 -1
  138. package/dist/session/composer/animated-placeholder.js +1 -1
  139. package/dist/session/composer/chat-input/chat-input-control.js +3 -3
  140. package/dist/session/composer/editor/composer-editor.js +1 -1
  141. package/dist/session/composer/menus/menu-shell.d.ts +1 -1
  142. package/dist/session/composer/menus/menu-shell.js +1 -1
  143. package/dist/session/composer/menus/mount.js +1 -1
  144. package/dist/session/composer/reasoning-effort-selector.js +1 -1
  145. package/dist/session/header/session-site-header.js +2 -2
  146. package/dist/session/header/subagent-hover-card.js +2 -2
  147. package/dist/session/media/image-preview.js +1 -1
  148. package/dist/session/models/model-selector.d.ts +1 -1
  149. package/dist/session/models/model-selector.js +18 -12
  150. package/dist/session/models/subscription-switcher.d.ts +37 -0
  151. package/dist/session/models/subscription-switcher.js +97 -0
  152. package/dist/session/models/subscription-windows.d.ts +40 -0
  153. package/dist/session/models/subscription-windows.js +86 -0
  154. package/dist/session/overrides/session-overrides-control.js +3 -3
  155. package/dist/session/panel/diff-dialog.js +1 -1
  156. package/dist/session/panel/easy/detail-view.js +3 -3
  157. package/dist/session/panel/mobile-tool-drawer.js +2 -2
  158. package/dist/session/panel/panel-fallback.js +1 -1
  159. package/dist/session/panel/session-files-explorer.d.ts +1 -1
  160. package/dist/session/panel/session-files-explorer.js +1 -1
  161. package/dist/session/thread/session-chat.js +2 -2
  162. package/dist/session/thread/session-context-message-explorer.js +1 -1
  163. package/dist/session/thread/turn-share.js +3 -4
  164. package/dist/session/tool/shared/show-helpers.js +1 -1
  165. package/dist/session/turn/message-time-label.js +1 -1
  166. package/dist/styles.css +1 -1
  167. package/dist/test-utils/intl.d.ts +3 -0
  168. package/dist/workspace/projects/modal/project-icon-field.js +9 -23
  169. package/dist/workspace/review/review-center.js +1 -1
  170. package/dist/workspace/sessions/session-row.js +1 -1
  171. package/dist/workspace/sidebar/project-session-list.js +2 -2
  172. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
  173. package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
  174. package/dist/workspace/sidebar/session-title.d.ts +2 -2
  175. package/dist/workspace/sidebar/session-title.js +2 -2
  176. package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
  177. package/dist/workspace/spaces/space-links.js +1 -1
  178. package/dist/workspace/spaces/space-threads-tab.js +1 -1
  179. package/package.json +16 -35
  180. package/skills/kortix-ui/SKILL.md +1 -1
  181. package/skills/kortix-ui/references/custom-dashboard.md +1 -1
@@ -41,17 +41,16 @@ const NO_REFRESH = {
41
41
  * source down; this component owns all the chrome so every surface looks and
42
42
  * behaves identically (one full-bleed brand style, no variants).
43
43
  *
44
- * It portals to <body>. Two things make it survive being nested inside a
45
- * parent Radix modal Dialog (the Customize overlay), which would otherwise
46
- * make it inert:
47
- * 1. `pointer-events-auto` on the backdrop + surface — Radix sets body
48
- * `pointer-events:none` on everything outside its own content, so without
49
- * this every click is dead.
50
- * 2. A native `wheel`/`touchmove` listener that stops propagation before the
51
- * event reaches `document`, where Radix's `react-remove-scroll` would call
52
- * `preventDefault` and kill mouse-wheel scrolling. (Keyboard scroll never
53
- * hit that path, which is why only the mouse appeared broken.)
54
- * Z-index is dialog-depth aware so it always stacks above its host overlay.
44
+ * It portals to <body>, also when nested inside a parent modal dialog (the
45
+ * Customize overlay). That dialog blocks outside pointer input with a
46
+ * full-screen backdrop and locks page scroll. Three things keep this preview
47
+ * usable on top of it:
48
+ * 1. Z-index is dialog-depth aware, so it stacks above the host's backdrop.
49
+ * 2. `pointer-events-auto` on the backdrop + surface, so an ancestor that
50
+ * sets `pointer-events:none` cannot make it inert.
51
+ * 3. A native `wheel`/`touchmove` listener that stops propagation before the
52
+ * event reaches `document`, so no document-level wheel handler can cancel
53
+ * scrolling here.
55
54
  */
56
55
  export function FilePreviewModal({ selectedFilePath, panelMode, filePathList, currentFileIndex, onClose: closePreview, onNext: nextPreview, onPrev: prevPreview, source, HistoryContent, renderFileIcon, statusSlot, extraActions, shareContext, historyLabel = "History", embedded = false, targetLine = null, }) {
57
56
  const tI18nHardcoded = useTranslations("hardcodedUi");
@@ -98,14 +97,14 @@ export function FilePreviewModal({ selectedFilePath, panelMode, filePathList, cu
98
97
  setExpanded(false);
99
98
  }, [selectedFilePath, targetLine]);
100
99
  // Keyboard navigation. Capture-phase + stopImmediatePropagation so ESC only
101
- // closes the preview, not a host Radix dialog underneath (Customize overlay).
100
+ // closes the preview, not a host dialog underneath (Customize overlay).
102
101
  useEffect(() => {
103
102
  if (!isOpen)
104
103
  return;
105
104
  const handleKeyDown = (e) => {
106
105
  // Focus trap: keep Tab cycling within the dialog. Only acts when focus is
107
- // already inside our surface, so when nested under the Customize Radix
108
- // dialog (whose own FocusScope owns focus) we don't hijack its Tab order.
106
+ // already inside our surface, so when nested under the Customize
107
+ // dialog (whose own focus trap owns focus) we don't hijack its Tab order.
109
108
  if (e.key === "Tab") {
110
109
  const surface = surfaceRef.current;
111
110
  if (surface && surface.contains(document.activeElement)) {
@@ -178,7 +177,7 @@ export function FilePreviewModal({ selectedFilePath, panelMode, filePathList, cu
178
177
  ]);
179
178
  // Move focus into the dialog on open and restore it to the triggering element
180
179
  // on close. Standalone (session Files tab) this completes the focus trap;
181
- // nested under the Customize Radix dialog, Radix's FocusScope may keep focus —
180
+ // nested under the Customize dialog, that dialog's focus trap may keep focus —
182
181
  // we make a single, non-looping attempt and don't fight it (no regression).
183
182
  useEffect(() => {
184
183
  // Inline (embedded) viewers must not steal focus from the chat composer.
@@ -202,10 +201,10 @@ export function FilePreviewModal({ selectedFilePath, panelMode, filePathList, cu
202
201
  };
203
202
  }
204
203
  }, [isOpen, fullscreen]);
205
- // Keep wheel/touch scroll alive when nested under a Radix modal Dialog:
206
- // stop the event before it reaches document, where react-remove-scroll would
204
+ // Keep wheel/touch scroll alive when nested under a modal dialog: stop the
205
+ // event before it reaches document, where a scroll-lock listener could
207
206
  // preventDefault it. Native listener (not React onWheel) so it fires during
208
- // real DOM bubbling, ahead of the document-level listener.
207
+ // real DOM bubbling, ahead of any document-level listener.
209
208
  const contentRef = useRef(null);
210
209
  // A host theme with larger controls, or a narrow panel: the toolbar drops the
211
210
  // Download label, the previous/next pair (the arrow keys still step), the
package/dist/i18n/en.d.ts CHANGED
@@ -139,6 +139,9 @@ declare const catalog: {
139
139
  providerKeys: string;
140
140
  chooseSharedKeys: string;
141
141
  sessionKeyPool: string;
142
+ subscriptionSwitcher: string;
143
+ subscriptionSwitcherDefault: string;
144
+ subscriptionSwitcherUse: string;
142
145
  sharedSessionKeys: string;
143
146
  promptedSessionKeys: string;
144
147
  noPersonSessionKeys: string;
package/dist/i18n/en.js CHANGED
@@ -52,7 +52,7 @@ const catalog = {
52
52
  "oauthWaiting": "Waiting for authorization…",
53
53
  "oauthFinishing": "Signed in. Saving your account…",
54
54
  "oauthExpired": "Authorization timed out. Try again.",
55
- "oauthPrivateDescription": "Use your ChatGPT Plus or Pro plan in this workspace. New accounts are private to you until you share them.",
55
+ "oauthPrivateDescription": "Use your ChatGPT Plus or Pro plan in this workspace. New accounts are shared with every workspace member. You can make one private.",
56
56
  "chatGptSubscription": "ChatGPT subscription",
57
57
  "manageChatGptAccounts": "Manage ChatGPT accounts",
58
58
  "connect": "Connect",
@@ -88,7 +88,7 @@ const catalog = {
88
88
  "deleteError": "Secret could not be deleted",
89
89
  "accessError": "Access could not be changed",
90
90
  "sharedTitle": "Provider connections",
91
- "sharedDescription": "Add API keys, ChatGPT accounts and Claude accounts. New ones are private to you until you share them. Choose which ones each session uses.",
91
+ "sharedDescription": "Add API keys, ChatGPT accounts and Claude accounts. New ones are shared with every workspace member. You can make one private. Choose which ones each session uses.",
92
92
  "legacyProjectKey": "Existing workspace key · Used when this session has no key selection",
93
93
  "keyCount": "{count, plural, one {# key} other {# keys}}",
94
94
  "providerKeysFor": "{provider} API keys",
@@ -140,6 +140,9 @@ const catalog = {
140
140
  "providerKeys": "Provider keys",
141
141
  "chooseSharedKeys": "Choose the shared keys this session can use.",
142
142
  "sessionKeyPool": "Session key pool",
143
+ "subscriptionSwitcher": "Subscription",
144
+ "subscriptionSwitcherDefault": "Rotates through every connected subscription",
145
+ "subscriptionSwitcherUse": "Use {label} for this session",
143
146
  "sharedSessionKeys": "This session is shared with the workspace, so only keys shared with the whole workspace work here. Keys granted to you work in your private sessions.",
144
147
  "promptedSessionKeys": "Another member has prompted this session, so it no longer acts for its owner. Only keys shared with the whole workspace work here.",
145
148
  "noPersonSessionKeys": "This session does not act for a person: it started before personal keys existed, or unattended. Only keys shared with the whole workspace work here. Start a new session to use your own keys.",
@@ -159,7 +162,7 @@ const catalog = {
159
162
  "claudeAccounts": "Claude accounts",
160
163
  "noClaudeAccounts": "No Claude accounts yet",
161
164
  "connectClaude": "Sign in with Claude",
162
- "claudeOauthPrivateDescription": "Use your Claude Pro or Max plan for Claude models in this workspace. New accounts are private to you until you share them.",
165
+ "claudeOauthPrivateDescription": "Use your Claude Pro or Max plan for Claude models in this workspace. New accounts are shared with every workspace member. You can make one private.",
163
166
  "claudeOauthCreationDescription": "Sign in with your Claude Pro or Max account. Kortix stores the login encrypted and never shows it.",
164
167
  "claudeDefaultAccountLabel": "Claude · {name}",
165
168
  "claudeAccountConnected": "Claude account connected",
@@ -2705,7 +2708,7 @@ const catalog = {
2705
2708
  "text0026c5053478": "Revert",
2706
2709
  "text004bad6bfbd7": "Patched the retry to back off",
2707
2710
  "text0059798b7f70": "(optional)",
2708
- "text005b4c1dad87": "Search workspaces, accounts, owners",
2711
+ "text005b4c1dad87": "Search workspaces, accounts, owners or an ID",
2709
2712
  "text005c9bcbce1e": "Creating trigger...",
2710
2713
  "text008e94f6ea7c": "What you own",
2711
2714
  "text009e910ccb18": "enterpriseAccordionTokenBody",
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // @kortix/ui root barrel: light core primitives only (Radix, cva, motion).
1
+ // @kortix/ui root barrel: light core primitives only (Base UI, cva, motion).
2
2
  // Heavy or app-shaped modules are reachable only through their own subpath,
3
3
  // never from here: charts ('@kortix/ui/chart'), maps ('@kortix/ui/map'), grids
4
4
  // ('@kortix/ui/data-grid'), mermaid, emoji data ('@kortix/ui/emoji-picker'),
@@ -113,8 +113,8 @@ export const HubLink = forwardRef(function HubLink({ to, onClick, onPointerEnter
113
113
  return;
114
114
  event.preventDefault();
115
115
  // One frame later, not now. Many of these rows live inside a menu or
116
- // another modal, and Radix restores focus to the trigger as that layer
117
- // unmounts. Opening a focus-trapping dialog in the same tick lets that
116
+ // another modal, and a closing layer restores focus to its trigger as
117
+ // it unmounts. Opening a focus-trapping dialog in the same tick lets that
118
118
  // restore land last and pull focus back OUT of the hub. A frame is
119
119
  // imperceptible and puts the two in the right order.
120
120
  requestAnimationFrame(() => openAccountPanel(to));
@@ -1,2 +1,29 @@
1
1
  /** @internal Kortix apps only. No semver: it may change in any release. */
2
- export declare function useAccountMembers(accountId: string | undefined): import("@tanstack/react-query").UseQueryResult<import("@kortix/sdk").AccountMember[], Error>;
2
+ /**
3
+ * The account member list, read once and shared by the hub page (the Members
4
+ * pane) and the settings sidebar (the count beside "Members"). One key, one
5
+ * fetcher, one gate — two hand-typed copies is how a "13 readers, one
6
+ * request" property quietly becomes two requests (see
7
+ * `packages/ui/src/internal/hooks/account/use-accounts-list.ts` for the longer version of that story).
8
+ */
9
+ import type { AccountRole } from '@kortix/sdk';
10
+ import { listAccountMembers } from '@kortix/sdk';
11
+ import { type UseQueryResult } from '@tanstack/react-query';
12
+ /** Account-level standing of one member, keyed by user id. */
13
+ export interface AccountMemberMeta {
14
+ email: string | null;
15
+ accountRole: AccountRole;
16
+ isSuperAdmin: boolean;
17
+ }
18
+ export declare function useAccountMembers(accountId: string | undefined,
19
+ /** Extra gate ANDed with the signed-in check — a surface that only needs
20
+ * the roster while a dialog is open passes `{ enabled: isOpen }`. */
21
+ options?: {
22
+ enabled?: boolean;
23
+ }): UseQueryResult<Awaited<ReturnType<typeof listAccountMembers>>, Error> & {
24
+ /** user_id → email. Members without an email are absent: the caller
25
+ * renders the raw user id (the fallback the IAM tables show). */
26
+ emailByUserId: Map<string, string>;
27
+ /** user_id → account-level standing (email, role, super-admin flag). */
28
+ accountMetaByUserId: Map<string, AccountMemberMeta>;
29
+ };
@@ -1,24 +1,41 @@
1
1
  'use client';
2
- /**
3
- * The account member list, read once and shared by the hub page (the Members
4
- * pane) and the settings sidebar (the count beside "Members"). One key, one
5
- * fetcher, one gate — two hand-typed copies is how a "13 readers, one
6
- * request" property quietly becomes two requests (see
7
- * `packages/ui/src/internal/hooks/account/use-accounts-list.ts` for the longer version of that story).
8
- */
9
2
  import { listAccountMembers } from '@kortix/sdk';
10
3
  import { contract } from '@kortix/sdk/react';
11
4
  import { useQuery } from '@tanstack/react-query';
5
+ import { useMemo } from 'react';
12
6
  import { useUiViewerId } from '../../providers/ui-provider.js';
13
- export function useAccountMembers(accountId) {
7
+ export function useAccountMembers(accountId,
8
+ /** Extra gate ANDed with the signed-in check — a surface that only needs
9
+ * the roster while a dialog is open passes `{ enabled: isOpen }`. */
10
+ options) {
14
11
  const viewerId = useUiViewerId();
15
12
  // `GET .../members` answers every account member: the whole directory with
16
13
  // `member.read`, else only the caller. No probe to
17
14
  // wait for.
18
- return useQuery({
15
+ const query = useQuery({
19
16
  queryKey: ['account-members', accountId],
20
17
  queryFn: () => listAccountMembers(accountId),
21
- enabled: !!viewerId && !!accountId,
18
+ enabled: !!viewerId && !!accountId && (options?.enabled ?? true),
22
19
  ...contract('directory'),
23
20
  });
21
+ const emailByUserId = useMemo(() => {
22
+ const map = new Map();
23
+ for (const m of query.data ?? []) {
24
+ if (m.email)
25
+ map.set(m.user_id, m.email);
26
+ }
27
+ return map;
28
+ }, [query.data]);
29
+ const accountMetaByUserId = useMemo(() => {
30
+ const map = new Map();
31
+ for (const m of query.data ?? []) {
32
+ map.set(m.user_id, {
33
+ email: m.email,
34
+ accountRole: m.account_role,
35
+ isSuperAdmin: !!m.is_super_admin,
36
+ });
37
+ }
38
+ return map;
39
+ }, [query.data]);
40
+ return { ...query, emailByUserId, accountMetaByUserId };
24
41
  }
@@ -39,11 +39,4 @@ export declare function AgentMark({ slug, size, tile, label, className, }: {
39
39
  label?: string;
40
40
  className?: string;
41
41
  }): import("react").JSX.Element;
42
- /**
43
- * An agent's name as a person reads it: My Kortix for the built-in agent,
44
- * otherwise the manifest key in sentence case with its separators as spaces
45
- * (`session-reviewer` → "Session reviewer"). One helper, so the sidebar, the
46
- * agent page, the index and the hover hint name an agent the same way.
47
- */
48
- export declare function agentDisplayName(slug: string): string;
49
- export {};
42
+ export { agentDisplayName } from '../../_vendor/shared/index.js';
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cn } from '../lib/utils.js';
4
4
  import { Hint } from '../../primitives/hint.js';
5
- import { isMyKortixAgentName, MY_KORTIX_DISPLAY_NAME } from '../../_vendor/kortix-shared.js';
5
+ import { agentDisplayName } from '../../_vendor/kortix-shared.js';
6
6
  import { pixelMark } from '../lib/pixel-mark.js';
7
7
  /** Mark size → tile size. The mark is a multiple of 7, so each pixel lands on
8
8
  * whole device pixels; any other size blurs the edges. Literal px because
@@ -50,21 +50,4 @@ export function AgentMark({ slug, size = 14, tile = TILE[size], label, className
50
50
  const mark = (_jsx("span", { "aria-hidden": true, "data-slot": "agent-mark", style: { ...agentMarkVars(slug), width: tile, height: tile }, className: cn('inline-flex shrink-0 items-center justify-center bg-(--mark-tile)', size >= 28 ? 'rounded-md' : 'rounded-sm', agentMarkTileClass(slug), className), children: _jsx(AgentMarkGlyph, { slug: slug, size: size }) }));
51
51
  return (_jsx(Hint, { side: "top", sideOffset: 6, alignOffset: 0, label: label ?? agentDisplayName(slug), children: mark }));
52
52
  }
53
- /**
54
- * An agent's name as a person reads it: My Kortix for the built-in agent,
55
- * otherwise the manifest key in sentence case with its separators as spaces
56
- * (`session-reviewer` → "Session reviewer"). One helper, so the sidebar, the
57
- * agent page, the index and the hover hint name an agent the same way.
58
- */
59
- export function agentDisplayName(slug) {
60
- if (isMyKortixAgentName(slug))
61
- return MY_KORTIX_DISPLAY_NAME;
62
- // Model tool input and event data reach this through `as string` casts, so the
63
- // slug is `unknown` at runtime. A truthy non-string degrades to its string
64
- // form instead of crashing the render tree (KRTX-4511: `e.replace is not a
65
- // function` took down the session page).
66
- if (typeof slug !== 'string')
67
- return String(slug);
68
- const words = slug.replace(/[-_]+/g, ' ').trim();
69
- return words.charAt(0).toUpperCase() + words.slice(1);
70
- }
53
+ export { agentDisplayName } from '../../_vendor/kortix-shared.js';
@@ -15,7 +15,7 @@ export function isModifiedClick(event) {
15
15
  event.ctrlKey ||
16
16
  event.shiftKey ||
17
17
  event.altKey ||
18
- // 0 = primary. Radix's keyboard activation synthesises a click with
19
- // button 0, so Enter still counts as an ordinary activation.
18
+ // 0 = primary. Keyboard activation (Enter on a button or menu item) fires
19
+ // a click with button 0, so Enter still counts as an ordinary activation.
20
20
  event.button !== 0);
21
21
  }
@@ -1,23 +1,6 @@
1
1
  /** @internal Kortix apps only. No semver: it may change in any release. */
2
2
  /**
3
- * An agent's pixel mark on its tile: the shape from `pixelMarkShape`
4
- * (`@kortix/shared/pixel-mark`) plus a tile tone from a second hash of the slug.
3
+ * An agent's pixel mark on its tile. The shape and the tone live in
4
+ * `@kortix/shared/pixel-mark`, so the API paints the same face (Slack posts).
5
5
  */
6
- export { passesPixelMarkGate } from '../../_vendor/shared/pixel-mark.js';
7
- export interface PixelMarkTone {
8
- name: string;
9
- tile: string;
10
- ink: string;
11
- /** Dark theme: the pair inverts, so the tile stays visible on a dark page. */
12
- tileDark: string;
13
- inkDark: string;
14
- }
15
- export declare const PIXEL_MARK_TONES: readonly PixelMarkTone[];
16
- export declare function pixelMark(slug: string): {
17
- tone: PixelMarkTone;
18
- grid: boolean[][];
19
- path: string;
20
- ditherPath: string;
21
- width: number;
22
- height: number;
23
- };
6
+ export { passesPixelMarkGate, pixelMark, PIXEL_MARK_TONES, type PixelMarkTone } from '../../_vendor/shared/pixel-mark.js';
@@ -1,36 +1,5 @@
1
1
  /**
2
- * An agent's pixel mark on its tile: the shape from `pixelMarkShape`
3
- * (`@kortix/shared/pixel-mark`) plus a tile tone from a second hash of the slug.
2
+ * An agent's pixel mark on its tile. The shape and the tone live in
3
+ * `@kortix/shared/pixel-mark`, so the API paints the same face (Slack posts).
4
4
  */
5
- import { fnv1a, pixelMarkShape } from '../../_vendor/kortix-shared.js';
6
- export { passesPixelMarkGate } from '../../_vendor/kortix-shared.js';
7
- const tone = (name, tile, ink) => ({
8
- name,
9
- tile,
10
- ink,
11
- tileDark: ink,
12
- inkDark: tile,
13
- });
14
- export const PIXEL_MARK_TONES = [
15
- tone('graphite', '#EDEDED', '#191919'),
16
- tone('sand', '#F1EBDD', '#6B5A3A'),
17
- tone('moss', '#E6EDE0', '#3F5A33'),
18
- tone('sea', '#E2ECF0', '#2E5566'),
19
- tone('blue', '#E6EEFF', '#2457C5'),
20
- tone('plum', '#EEE6F0', '#5E3A68'),
21
- tone('clay', '#F3E6E0', '#7A4532'),
22
- tone('slate', '#E4E7EC', '#3B4656'),
23
- ];
24
- /** The starter's `kortix` agent and My Kortix (slug `mykortix`) keep the brand tile. */
25
- const BRAND = {
26
- name: 'brand',
27
- tile: '#1F1F1F',
28
- ink: '#FFFFFF',
29
- tileDark: '#2C2C2C',
30
- inkDark: '#FFFFFF',
31
- };
32
- const RESERVED = { kortix: BRAND, mykortix: BRAND, meta: BRAND };
33
- export function pixelMark(slug) {
34
- const tone = RESERVED[slug] ?? PIXEL_MARK_TONES[fnv1a(`${slug}#tone`) % PIXEL_MARK_TONES.length];
35
- return { ...pixelMarkShape(slug), tone };
36
- }
5
+ export { passesPixelMarkGate, pixelMark, PIXEL_MARK_TONES } from '../../_vendor/kortix-shared.js';
@@ -12,7 +12,7 @@ interface ActiveSpaceState {
12
12
  byProject: ActiveByProject;
13
13
  setSpace: (projectId: string, space: string | null) => void;
14
14
  }
15
- export declare const useActiveSpaceStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ActiveSpaceState>, "setState" | "persist"> & {
15
+ export declare const useActiveSpaceStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ActiveSpaceState>, "persist" | "setState"> & {
16
16
  setState(partial: ActiveSpaceState | Partial<ActiveSpaceState> | ((state: ActiveSpaceState) => ActiveSpaceState | Partial<ActiveSpaceState>), replace?: false | undefined): unknown;
17
17
  setState(state: ActiveSpaceState | ((state: ActiveSpaceState) => ActiveSpaceState), replace: true): unknown;
18
18
  persist: {
@@ -20,7 +20,7 @@ interface BrowserRecentsState {
20
20
  removeRecent: (url: string) => void;
21
21
  clearRecents: () => void;
22
22
  }
23
- export declare const useBrowserRecentsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<BrowserRecentsState>, "setState" | "persist"> & {
23
+ export declare const useBrowserRecentsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<BrowserRecentsState>, "persist" | "setState"> & {
24
24
  setState(partial: BrowserRecentsState | Partial<BrowserRecentsState> | ((state: BrowserRecentsState) => BrowserRecentsState | Partial<BrowserRecentsState>), replace?: false | undefined): unknown;
25
25
  setState(state: BrowserRecentsState | ((state: BrowserRecentsState) => BrowserRecentsState), replace: true): unknown;
26
26
  persist: {
@@ -12,7 +12,7 @@ interface CurrentAccountState {
12
12
  setSelectedAccountId: (id: string | null) => void;
13
13
  clear: () => void;
14
14
  }
15
- export declare const useCurrentAccountStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<CurrentAccountState>, "setState" | "persist"> & {
15
+ export declare const useCurrentAccountStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<CurrentAccountState>, "persist" | "setState"> & {
16
16
  setState(partial: CurrentAccountState | Partial<CurrentAccountState> | ((state: CurrentAccountState) => CurrentAccountState | Partial<CurrentAccountState>), replace?: false | undefined): unknown;
17
17
  setState(state: CurrentAccountState | ((state: CurrentAccountState) => CurrentAccountState), replace: true): unknown;
18
18
  persist: {
@@ -4,7 +4,7 @@ interface FirstChatState {
4
4
  start: (projectId: string) => void;
5
5
  finish: (projectId: string) => void;
6
6
  }
7
- export declare const useFirstChatStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<FirstChatState>, "setState" | "persist"> & {
7
+ export declare const useFirstChatStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<FirstChatState>, "persist" | "setState"> & {
8
8
  setState(partial: FirstChatState | Partial<FirstChatState> | ((state: FirstChatState) => FirstChatState | Partial<FirstChatState>), replace?: false | undefined): unknown;
9
9
  setState(state: FirstChatState | ((state: FirstChatState) => FirstChatState), replace: true): unknown;
10
10
  persist: {
@@ -3,7 +3,7 @@ interface MobileAppPromoState {
3
3
  closed: boolean;
4
4
  close: () => void;
5
5
  }
6
- export declare const useMobileAppPromoStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<MobileAppPromoState>, "setState" | "persist"> & {
6
+ export declare const useMobileAppPromoStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<MobileAppPromoState>, "persist" | "setState"> & {
7
7
  setState(partial: MobileAppPromoState | Partial<MobileAppPromoState> | ((state: MobileAppPromoState) => MobileAppPromoState | Partial<MobileAppPromoState>), replace?: false | undefined): unknown;
8
8
  setState(state: MobileAppPromoState | ((state: MobileAppPromoState) => MobileAppPromoState), replace: true): unknown;
9
9
  persist: {
@@ -72,7 +72,7 @@ interface SessionBrowserState {
72
72
  activeSessionId: string | null;
73
73
  setActiveSessionId: (id: string | null) => void;
74
74
  }
75
- export declare const useSessionBrowserStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SessionBrowserState>, "setState" | "persist"> & {
75
+ export declare const useSessionBrowserStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SessionBrowserState>, "persist" | "setState"> & {
76
76
  setState(partial: SessionBrowserState | Partial<SessionBrowserState> | ((state: SessionBrowserState) => SessionBrowserState | Partial<SessionBrowserState>), replace?: false | undefined): unknown;
77
77
  setState(state: SessionBrowserState | ((state: SessionBrowserState) => SessionBrowserState), replace: true): unknown;
78
78
  persist: {
@@ -5,7 +5,7 @@ interface State {
5
5
  toggleExpanded: (projectId: string, id: string) => void;
6
6
  }
7
7
  export declare const selectExpandedIds: (projectId: string) => (s: State) => readonly string[];
8
- export declare const useSessionExpandedStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State>, "setState" | "persist"> & {
8
+ export declare const useSessionExpandedStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State>, "persist" | "setState"> & {
9
9
  setState(partial: State | Partial<State> | ((state: State) => State | Partial<State>), replace?: false | undefined): unknown;
10
10
  setState(state: State | ((state: State) => State), replace: true): unknown;
11
11
  persist: {
@@ -75,7 +75,7 @@ export declare const selectHiddenSections: (projectId: string, surface?: Session
75
75
  * to see everything should do.
76
76
  */
77
77
  export declare const selectCollapsedSections: (projectId: string, surface?: SessionViewSurface) => (s: State) => string[];
78
- export declare const useSessionFilterStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State & Actions>, "setState" | "persist"> & {
78
+ export declare const useSessionFilterStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State & Actions>, "persist" | "setState"> & {
79
79
  setState(partial: (State & Actions) | Partial<State & Actions> | ((state: State & Actions) => (State & Actions) | Partial<State & Actions>), replace?: false | undefined): unknown;
80
80
  setState(state: (State & Actions) | ((state: State & Actions) => State & Actions), replace: true): unknown;
81
81
  persist: {
@@ -7,7 +7,7 @@ interface State {
7
7
  dismissRestore: (sessionId: string, generation: number) => void;
8
8
  setOutOfContext: (sessionId: string, present: boolean) => void;
9
9
  }
10
- export declare const useSessionHistoryViewStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State>, "setState" | "persist"> & {
10
+ export declare const useSessionHistoryViewStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State>, "persist" | "setState"> & {
11
11
  setState(partial: State | Partial<State> | ((state: State) => State | Partial<State>), replace?: false | undefined): unknown;
12
12
  setState(state: State | ((state: State) => State), replace: true): unknown;
13
13
  persist: {
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Which session row's brief is showing, for the whole sidebar at once.
4
4
  *
5
- * Radix HoverCard has no group concept — each instance owns its own delays and
5
+ * `HoverCard` has no group concept — each instance owns its own delays and
6
6
  * knows nothing about its siblings — so moving between two rows played out as
7
7
  * "row A closes after 100ms, row B opens after 200ms": the card vanished and
8
8
  * came back somewhere else. `Tooltip.Provider` solves this with
@@ -3,7 +3,7 @@ import { create } from 'zustand';
3
3
  /**
4
4
  * Which session row's brief is showing, for the whole sidebar at once.
5
5
  *
6
- * Radix HoverCard has no group concept — each instance owns its own delays and
6
+ * `HoverCard` has no group concept — each instance owns its own delays and
7
7
  * knows nothing about its siblings — so moving between two rows played out as
8
8
  * "row A closes after 100ms, row B opens after 200ms": the card vanished and
9
9
  * came back somewhere else. `Tooltip.Provider` solves this with
@@ -41,7 +41,7 @@ interface SessionPanelMemoryState {
41
41
  /** Remember what `sessionId`'s panel shows; null forgets it. */
42
42
  remember: (sessionId: string, panel: RememberedPanel | null) => void;
43
43
  }
44
- export declare const useSessionPanelMemoryStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SessionPanelMemoryState>, "setState" | "persist"> & {
44
+ export declare const useSessionPanelMemoryStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SessionPanelMemoryState>, "persist" | "setState"> & {
45
45
  setState(partial: SessionPanelMemoryState | Partial<SessionPanelMemoryState> | ((state: SessionPanelMemoryState) => SessionPanelMemoryState | Partial<SessionPanelMemoryState>), replace?: false | undefined): unknown;
46
46
  setState(state: SessionPanelMemoryState | ((state: SessionPanelMemoryState) => SessionPanelMemoryState), replace: true): unknown;
47
47
  persist: {
@@ -35,7 +35,7 @@ interface SoundState {
35
35
  /** Check if a specific event should play sound */
36
36
  isEventEnabled: (event: SoundEvent) => boolean;
37
37
  }
38
- export declare const useSoundStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SoundState>, "setState" | "persist"> & {
38
+ export declare const useSoundStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SoundState>, "persist" | "setState"> & {
39
39
  setState(partial: SoundState | Partial<SoundState> | ((state: SoundState) => SoundState | Partial<SoundState>), replace?: false | undefined): unknown;
40
40
  setState(state: SoundState | ((state: SoundState) => SoundState), replace: true): unknown;
41
41
  persist: {
@@ -40,7 +40,7 @@ interface TabState {
40
40
  /** Set the active tab */
41
41
  setActiveTab: (tabId: string) => void;
42
42
  }
43
- export declare const useTabStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<TabState>, "setState" | "persist"> & {
43
+ export declare const useTabStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<TabState>, "persist" | "setState"> & {
44
44
  setState(partial: TabState | Partial<TabState> | ((state: TabState) => TabState | Partial<TabState>), replace?: false | undefined): unknown;
45
45
  setState(state: TabState | ((state: TabState) => TabState), replace: true): unknown;
46
46
  persist: {
@@ -64,7 +64,7 @@ interface UserPreferencesState {
64
64
  /** Get the label for the current tab switch modifier (e.g. "Cmd" or "Ctrl") */
65
65
  getModifierLabel: () => string;
66
66
  }
67
- export declare const useUserPreferencesStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<UserPreferencesState>, "setState" | "persist"> & {
67
+ export declare const useUserPreferencesStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<UserPreferencesState>, "persist" | "setState"> & {
68
68
  setState(partial: UserPreferencesState | Partial<UserPreferencesState> | ((state: UserPreferencesState) => UserPreferencesState | Partial<UserPreferencesState>), replace?: false | undefined): unknown;
69
69
  setState(state: UserPreferencesState | ((state: UserPreferencesState) => UserPreferencesState), replace: true): unknown;
70
70
  persist: {
@@ -31,7 +31,7 @@ interface WebNotificationState {
31
31
  /** Dismiss the notification enable prompt */
32
32
  dismissPrompt: () => void;
33
33
  }
34
- export declare const useWebNotificationStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<WebNotificationState>, "setState" | "persist"> & {
34
+ export declare const useWebNotificationStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<WebNotificationState>, "persist" | "setState"> & {
35
35
  setState(partial: WebNotificationState | Partial<WebNotificationState> | ((state: WebNotificationState) => WebNotificationState | Partial<WebNotificationState>), replace?: false | undefined): unknown;
36
36
  setState(state: WebNotificationState | ((state: WebNotificationState) => WebNotificationState), replace: true): unknown;
37
37
  persist: {