@kortix/ui 0.16.1 → 0.16.2

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 (277) hide show
  1. package/dist/_vendor/kortix-shared.js +133 -26
  2. package/dist/_vendor/shared/index.d.ts +1 -0
  3. package/dist/_vendor/shared/space-icon.d.ts +30 -0
  4. package/dist/_vendor/shared/space-slug.d.ts +12 -0
  5. package/dist/access/access/access-dialog.js +2 -2
  6. package/dist/access/share-dialog.d.ts +77 -0
  7. package/dist/access/share-dialog.js +160 -0
  8. package/dist/access/sharing-picker.d.ts +8 -1
  9. package/dist/access/sharing-picker.js +2 -2
  10. package/dist/changes/change-list.js +3 -3
  11. package/dist/customize/connectors/catalog/catalog-paging.d.ts +1 -1
  12. package/dist/customize/connectors/catalog/catalog-paging.js +1 -1
  13. package/dist/customize/providers/provider-sheet.js +17 -7
  14. package/dist/customize/sections/component/manifest-copy-block.js +1 -1
  15. package/dist/customize/sections/component/section-wrapper.d.ts +1 -8
  16. package/dist/customize/sections/component/section-wrapper.js +3 -3
  17. package/dist/customize/sections/llm-provider/model-capability-icons.js +1 -1
  18. package/dist/customize/sections/view/gateway/generation-controls.js +1 -1
  19. package/dist/customize/sections/view/git-view.js +1 -1
  20. package/dist/customize/settings/settings-tabs.js +0 -5
  21. package/dist/customize/settings/tabs/general-tab.js +2 -2
  22. package/dist/customize/shared/capability-page-shell.d.ts +2 -2
  23. package/dist/customize/shared/capability-page-shell.js +7 -5
  24. package/dist/customize/shared/capability-scroll-root.js +1 -2
  25. package/dist/customize/shared/catalog/catalog-card.js +1 -1
  26. package/dist/files/project/components/change-requests-panel.js +2 -2
  27. package/dist/files/project/components/checkpoint-detail-dialog.js +4 -4
  28. package/dist/files/project/components/checkpoints-panel.js +2 -2
  29. package/dist/files/project/components/drive-explorer.js +2 -2
  30. package/dist/files/project/components/file-breadcrumbs.js +1 -1
  31. package/dist/files/project/components/file-history-popover.js +2 -2
  32. package/dist/files/project/components/file-thumbnail.js +1 -1
  33. package/dist/files/project/components/open-change-request-dialog.js +1 -1
  34. package/dist/files/renderers/mermaid/mermaid-diagram.js +2 -2
  35. package/dist/files/renderers/show-content-renderer.js +6 -6
  36. package/dist/files/renderers/sqlite-renderer.js +8 -8
  37. package/dist/files/renderers/zip/zip-renderer.js +2 -2
  38. package/dist/files/viewer/file-content-renderer.js +5 -5
  39. package/dist/files/viewer/json-tree-view.js +3 -3
  40. package/dist/i18n/en.d.ts +131 -8
  41. package/dist/i18n/en.js +167 -44
  42. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -3
  43. package/dist/internal/billing/use-cost-explorer.d.ts +9 -2
  44. package/dist/internal/billing/use-cost-explorer.js +22 -0
  45. package/dist/internal/billing/use-session-costs.d.ts +7 -2
  46. package/dist/internal/billing/use-session-costs.js +6 -0
  47. package/dist/internal/chrome/use-chrome-offered.d.ts +3 -3
  48. package/dist/internal/chrome/use-chrome-offered.js +3 -3
  49. package/dist/internal/components/nav-rail.d.ts +1 -20
  50. package/dist/internal/components/nav-rail.js +1 -15
  51. package/dist/internal/layout/project-page-header.d.ts +13 -9
  52. package/dist/internal/layout/project-page-header.js +14 -10
  53. package/dist/internal/lib/browser-noise/evidence.d.ts +2 -0
  54. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +16 -1
  55. package/dist/internal/lib/error-handler.js +0 -9
  56. package/dist/internal/lib/interface-theme-defaults.js +2 -2
  57. package/dist/internal/lib/project-actions.d.ts +4 -5
  58. package/dist/internal/lib/project-actions.js +3 -5
  59. package/dist/internal/lib/project-preamble.d.ts +42 -4
  60. package/dist/internal/lib/project-preamble.js +49 -5
  61. package/dist/internal/lib/web-notifications.js +17 -29
  62. package/dist/internal/outcomes/outcome-vocabulary.js +1 -1
  63. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  64. package/dist/internal/stores/user-preferences-store.d.ts +2 -2
  65. package/dist/internal/stores/workspace-settings-rail-store.d.ts +0 -8
  66. package/dist/internal/stores/workspace-settings-rail-store.js +0 -2
  67. package/dist/lib/routes.d.ts +7 -0
  68. package/dist/lib/routes.js +6 -1
  69. package/dist/markdown/doc-editor/doc-extensions.js +2 -0
  70. package/dist/markdown/doc-editor/doc-paste.d.ts +13 -0
  71. package/dist/markdown/doc-editor/doc-paste.js +67 -0
  72. package/dist/markdown/markdown-frontmatter.js +3 -3
  73. package/dist/markdown/markdown-policy.d.ts +1 -1
  74. package/dist/markdown/ordered-list.js +1 -1
  75. package/dist/primitives/context-menu.d.ts +1 -0
  76. package/dist/primitives/definition-list.js +1 -1
  77. package/dist/primitives/dropdown-menu.d.ts +1 -0
  78. package/dist/primitives/emoji-picker.js +1 -1
  79. package/dist/primitives/expandable-search.d.ts +57 -0
  80. package/dist/primitives/expandable-search.js +58 -0
  81. package/dist/primitives/favicon-avatar.js +1 -1
  82. package/dist/primitives/file-tree.d.ts +1 -1
  83. package/dist/primitives/file-tree.js +1 -1
  84. package/dist/primitives/glyph-picker.js +2 -2
  85. package/dist/primitives/input-group.js +1 -1
  86. package/dist/primitives/menu-base.d.ts +10 -0
  87. package/dist/primitives/menu-base.js +7 -2
  88. package/dist/primitives/phone-input.js +1 -1
  89. package/dist/primitives/profile-hover-card.d.ts +28 -0
  90. package/dist/primitives/profile-hover-card.js +22 -0
  91. package/dist/primitives/settings-section-header.d.ts +5 -5
  92. package/dist/primitives/settings-section-header.js +5 -5
  93. package/dist/primitives/sort-menu.d.ts +23 -0
  94. package/dist/primitives/sort-menu.js +54 -0
  95. package/dist/primitives/tabs.js +1 -1
  96. package/dist/primitives/toast-clearance.d.ts +12 -28
  97. package/dist/primitives/toast-clearance.js +23 -45
  98. package/dist/primitives/user-avatar.js +2 -3
  99. package/dist/session/agents/subagent-dialog-content.js +28 -70
  100. package/dist/session/composer/ComposerCard.d.ts +4 -1
  101. package/dist/session/composer/ComposerCard.js +51 -7
  102. package/dist/session/composer/composer-chat-input.js +3 -1
  103. package/dist/session/composer/composer-toolbar.d.ts +3 -1
  104. package/dist/session/composer/composer-toolbar.js +6 -2
  105. package/dist/session/composer/composer-underbar.d.ts +3 -1
  106. package/dist/session/composer/composer-underbar.js +2 -2
  107. package/dist/session/composer/composer.d.ts +12 -0
  108. package/dist/session/composer/composer.js +112 -6
  109. package/dist/session/composer/draft/composer-draft.d.ts +1 -0
  110. package/dist/session/composer/draft/composer-draft.js +10 -2
  111. package/dist/session/composer/draft/draft-uploads.js +13 -2
  112. package/dist/session/composer/draft/use-composer-draft.d.ts +2 -0
  113. package/dist/session/composer/draft/use-composer-draft.js +41 -6
  114. package/dist/session/composer/drive-mentions.d.ts +34 -0
  115. package/dist/session/composer/drive-mentions.js +98 -0
  116. package/dist/session/composer/editor/composer-editor.d.ts +3 -0
  117. package/dist/session/composer/editor/composer-editor.js +3 -1
  118. package/dist/session/composer/editor/serialize.js +3 -4
  119. package/dist/session/composer/menus/mention-controller.d.ts +3 -0
  120. package/dist/session/composer/menus/mention-controller.js +5 -0
  121. package/dist/session/composer/menus/mention-menu.d.ts +20 -3
  122. package/dist/session/composer/menus/mention-menu.js +33 -6
  123. package/dist/session/composer/menus/menu-items.d.ts +16 -1
  124. package/dist/session/composer/menus/menu-items.js +21 -1
  125. package/dist/session/composer/submit-latch.d.ts +3 -1
  126. package/dist/session/composer/submit-latch.js +5 -1
  127. package/dist/session/composer/types.d.ts +9 -2
  128. package/dist/session/header/session-changes-indicator.js +1 -1
  129. package/dist/session/header/session-site-header.js +2 -2
  130. package/dist/session/media/sandbox-url-detector.js +3 -3
  131. package/dist/session/models/model-connection-gate.d.ts +5 -0
  132. package/dist/session/models/model-connection-gate.js +12 -3
  133. package/dist/session/models/model-connection-layout.d.ts +7 -0
  134. package/dist/session/models/model-connection-layout.js +7 -0
  135. package/dist/session/models/provider-failure-recovery.js +1 -1
  136. package/dist/session/models/subscription-offer.d.ts +6 -5
  137. package/dist/session/models/subscription-offer.js +6 -6
  138. package/dist/session/panel/advanced/advanced-panel.js +1 -1
  139. package/dist/session/panel/session-detail-panel.js +1 -1
  140. package/dist/session/panel/session-diff-viewer.js +1 -1
  141. package/dist/session/panel/session-files-explorer.js +1 -1
  142. package/dist/session/panel/session-files-panel.js +3 -3
  143. package/dist/session/panel/shared/action-navigator.js +1 -1
  144. package/dist/session/status/provisioning-failure.d.ts +4 -4
  145. package/dist/session/status/provisioning-failure.js +4 -4
  146. package/dist/session/status/session-busy-indicator.js +1 -1
  147. package/dist/session/status/session-error-banner.js +6 -1
  148. package/dist/session/thread/mention-chip.d.ts +1 -1
  149. package/dist/session/thread/mention-segments.d.ts +4 -2
  150. package/dist/session/thread/mention-segments.js +28 -1
  151. package/dist/session/thread/message-parsing.d.ts +11 -0
  152. package/dist/session/thread/message-parsing.js +22 -3
  153. package/dist/session/thread/optimistic-turn.d.ts +4 -2
  154. package/dist/session/thread/optimistic-turn.js +13 -11
  155. package/dist/session/thread/session-chat.js +6 -1
  156. package/dist/session/thread/session-context-message-explorer.js +1 -1
  157. package/dist/session/thread/session-older-autoload.d.ts +2 -3
  158. package/dist/session/thread/session-older-autoload.js +2 -3
  159. package/dist/session/thread/transcript.js +8 -10
  160. package/dist/session/tool/shared/error-and-connector.js +1 -1
  161. package/dist/session/tool/shared/file-list.js +2 -2
  162. package/dist/session/tool/shared/infrastructure-parts.js +1 -1
  163. package/dist/session/tool/shared/infrastructure-preview.js +1 -1
  164. package/dist/session/tool/shared/infrastructure-row-header.js +3 -3
  165. package/dist/session/tool/shared/infrastructure-rows.js +2 -2
  166. package/dist/session/tool/shared/output-block.js +4 -4
  167. package/dist/session/tool/shared/session-helpers.js +3 -3
  168. package/dist/session/tool/shared/structured-output.js +3 -3
  169. package/dist/session/tool/shared/todo-helpers.js +1 -1
  170. package/dist/session/tool/tool-error.js +2 -2
  171. package/dist/session/tool/tools/agent-spawn-tool.js +3 -3
  172. package/dist/session/tool/tools/agent-status-tool.js +1 -1
  173. package/dist/session/tool/tools/apply-patch-tool.js +1 -1
  174. package/dist/session/tool/tools/connector-get-tool.js +1 -1
  175. package/dist/session/tool/tools/connector-list-tool.js +1 -1
  176. package/dist/session/tool/tools/connector-tools.js +1 -1
  177. package/dist/session/tool/tools/edit-tool.js +1 -1
  178. package/dist/session/tool/tools/get-mem-tool.js +1 -1
  179. package/dist/session/tool/tools/glob-tool.js +1 -1
  180. package/dist/session/tool/tools/image-search-tool.js +1 -1
  181. package/dist/session/tool/tools/memory-search-tool.js +1 -1
  182. package/dist/session/tool/tools/memory-tool.js +4 -4
  183. package/dist/session/tool/tools/presentation-gen-tool.js +2 -2
  184. package/dist/session/tool/tools/project-delete-tool.js +1 -1
  185. package/dist/session/tool/tools/project-list-tool.js +1 -1
  186. package/dist/session/tool/tools/pty-read-tool.js +1 -1
  187. package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
  188. package/dist/session/tool/tools/pty-write-tool.js +1 -1
  189. package/dist/session/tool/tools/read-tool.js +1 -1
  190. package/dist/session/tool/tools/removed-connector-tool.js +1 -1
  191. package/dist/session/tool/tools/scrape-webpage-tool.js +1 -1
  192. package/dist/session/tool/tools/session-get-tool.js +3 -3
  193. package/dist/session/tool/tools/session-list-background-tool.js +1 -1
  194. package/dist/session/tool/tools/session-read-tool.js +1 -1
  195. package/dist/session/tool/tools/session-search-tool.js +1 -1
  196. package/dist/session/tool/tools/session-spawn-tool.js +1 -1
  197. package/dist/session/tool/tools/skill-tool.js +1 -1
  198. package/dist/session/tool/tools/todo-write-tool.js +1 -1
  199. package/dist/session/tool/tools/web-fetch-tool.js +1 -1
  200. package/dist/session/tool/tools/write-tool.js +1 -1
  201. package/dist/session/turn/activity-file-chips.js +7 -3
  202. package/dist/session/turn/activity-step.js +1 -1
  203. package/dist/session/turn/burst-summary-trigger.js +3 -3
  204. package/dist/session/turn/chain-step-trigger.js +1 -1
  205. package/dist/session/turn/plan-card.js +1 -1
  206. package/dist/session/turn/thought-chain-step.js +1 -1
  207. package/dist/session/turn/turn-work-accordion.js +1 -1
  208. package/dist/session/turn/user-message.js +13 -6
  209. package/dist/session/voice/use-call-card-position.d.ts +30 -0
  210. package/dist/session/voice/use-call-card-position.js +126 -0
  211. package/dist/session/voice/voice-call-card.js +10 -3
  212. package/dist/styles/theme.css +12 -0
  213. package/dist/styles/tokens.css +12 -6
  214. package/dist/styles.css +1 -1
  215. package/dist/terminal/session-terminal-panel.js +1 -1
  216. package/dist/test-utils/intl.d.ts +131 -8
  217. package/dist/workspace/admin/project-admin-dashboard.js +7 -24
  218. package/dist/workspace/calendar/calendar-page.js +1 -1
  219. package/dist/workspace/home/first-chat.d.ts +4 -3
  220. package/dist/workspace/home/first-chat.js +6 -6
  221. package/dist/workspace/home/welcome-body.js +2 -2
  222. package/dist/workspace/index.d.ts +1 -1
  223. package/dist/workspace/index.js +1 -1
  224. package/dist/workspace/layout/project-home.js +9 -3
  225. package/dist/workspace/layout/use-project-home-send.d.ts +3 -1
  226. package/dist/workspace/layout/use-project-home-send.js +6 -2
  227. package/dist/workspace/memory/company-memory-page.js +2 -4
  228. package/dist/workspace/new/github-source.js +0 -1
  229. package/dist/workspace/new/new-workspace-form.d.ts +0 -1
  230. package/dist/workspace/new/new-workspace-form.js +0 -3
  231. package/dist/workspace/new/use-create-workspace.d.ts +1 -1
  232. package/dist/workspace/new/use-create-workspace.js +1 -2
  233. package/dist/workspace/session-spaces/space-detail-page.d.ts +35 -0
  234. package/dist/workspace/session-spaces/space-detail-page.js +307 -0
  235. package/dist/workspace/session-spaces/space-form-modal.d.ts +16 -0
  236. package/dist/workspace/session-spaces/space-form-modal.js +92 -0
  237. package/dist/workspace/session-spaces/space-icon.d.ts +36 -0
  238. package/dist/workspace/session-spaces/space-icon.js +52 -0
  239. package/dist/workspace/session-spaces/space-people.d.ts +51 -0
  240. package/dist/workspace/session-spaces/space-people.js +91 -0
  241. package/dist/workspace/session-spaces/space-picker.d.ts +11 -0
  242. package/dist/workspace/session-spaces/space-picker.js +42 -0
  243. package/dist/workspace/session-spaces/space-share-modal.d.ts +14 -0
  244. package/dist/workspace/session-spaces/space-share-modal.js +93 -0
  245. package/dist/workspace/session-spaces/spaces-page.d.ts +8 -0
  246. package/dist/workspace/session-spaces/spaces-page.js +125 -0
  247. package/dist/workspace/sessions/session-owner-filters.d.ts +2 -0
  248. package/dist/workspace/sessions/session-owner-filters.js +2 -0
  249. package/dist/workspace/sidebar/footer/project-artifacts-nav.js +1 -1
  250. package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +7 -2
  251. package/dist/workspace/sidebar/footer/project-promo-cards.js +4 -3
  252. package/dist/workspace/sidebar/footer/project-sandbox-alert.js +1 -1
  253. package/dist/workspace/sidebar/footer/promo-card.d.ts +10 -1
  254. package/dist/workspace/sidebar/footer/promo-card.js +31 -2
  255. package/dist/workspace/sidebar/modal/session-people-picker.d.ts +13 -0
  256. package/dist/workspace/sidebar/modal/session-people-picker.js +72 -0
  257. package/dist/workspace/sidebar/modal/share-session-modal.js +2 -1
  258. package/dist/workspace/sidebar/project-nav-items.d.ts +1 -3
  259. package/dist/workspace/sidebar/project-nav-items.js +3 -8
  260. package/dist/workspace/sidebar/project-session-list.js +19 -12
  261. package/dist/workspace/sidebar/project-sidebar.js +13 -13
  262. package/dist/workspace/sidebar/project-spaces-nav.js +1 -2
  263. package/dist/workspace/sidebar/session-filter-menu.js +19 -13
  264. package/dist/workspace/sidebar/session-group-sections.d.ts +12 -12
  265. package/dist/workspace/sidebar/session-group-sections.js +56 -75
  266. package/dist/workspace/sidebar/sidebar-more-group.js +1 -1
  267. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +2 -2
  268. package/dist/workspace/spaces/space-tabs.d.ts +26 -6
  269. package/dist/workspace/spaces/space-tabs.js +19 -8
  270. package/package.json +27 -31
  271. package/skills/kortix-ui/references/modules.md +2 -2
  272. package/dist/workspace/new/clone-param.d.ts +0 -11
  273. package/dist/workspace/new/clone-param.js +0 -15
  274. package/dist/workspace/new/provision-new-workspace.d.ts +0 -14
  275. package/dist/workspace/new/provision-new-workspace.js +0 -14
  276. package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +0 -8
  277. package/dist/workspace/sidebar/footer/project-inbox-nav.js +0 -29
@@ -1,5 +1,6 @@
1
1
  /** @internal Kortix apps only. No semver: it may change in any release. */
2
2
  import { type GetSessionCostRecordOptions, type KortixProject, type ListSessionCostsOptions, type SessionCostDetail, type SessionCostSort, type SessionCostsPage } from '@kortix/sdk';
3
+ import { costReadBusyRetryDelay, retryCostReadBusy } from './use-cost-explorer.js';
3
4
  export declare const SESSION_COST_PAGE_SIZE = 25;
4
5
  export interface SessionCostQuerySources {
5
6
  list(options?: ListSessionCostsOptions): Promise<SessionCostsPage>;
@@ -36,6 +37,8 @@ export declare function buildSessionCostsListQuery(input: SessionCostsListInput,
36
37
  queryFn: () => Promise<SessionCostsPage>;
37
38
  enabled: boolean;
38
39
  staleTime: number;
40
+ retry: typeof retryCostReadBusy;
41
+ retryDelay: typeof costReadBusyRetryDelay;
39
42
  };
40
43
  export declare function buildSessionCostDetailQuery(input: SessionCostDetailInput, sources?: SessionCostQuerySources): {
41
44
  queryKey: readonly ["session-costs", "detail", {
@@ -46,6 +49,8 @@ export declare function buildSessionCostDetailQuery(input: SessionCostDetailInpu
46
49
  queryFn: () => Promise<SessionCostDetail>;
47
50
  enabled: boolean;
48
51
  staleTime: number;
52
+ retry: typeof retryCostReadBusy;
53
+ retryDelay: typeof costReadBusyRetryDelay;
49
54
  };
50
55
  export declare function buildSessionCostProjectsQuery(accountId: string | undefined, sources?: SessionCostQuerySources): {
51
56
  queryKey: readonly ["session-costs", "projects", string | null];
@@ -67,9 +72,9 @@ export declare function useSessionCosts(input: {
67
72
  to?: string;
68
73
  sort?: SessionCostSort;
69
74
  ownerId?: string;
70
- }): import("@tanstack/react-query").UseQueryResult<SessionCostsPage, Error>;
75
+ }): import("@tanstack/react-query").UseQueryResult<SessionCostsPage, unknown>;
71
76
  export declare function useSessionCostDetail(input: {
72
77
  projectId: string | null;
73
78
  sessionId: string | null;
74
- }): import("@tanstack/react-query").UseQueryResult<SessionCostDetail, Error>;
79
+ }): import("@tanstack/react-query").UseQueryResult<SessionCostDetail, unknown>;
75
80
  export declare function useSessionCostProjects(): import("@tanstack/react-query").UseQueryResult<KortixProject[], Error>;
@@ -1,6 +1,7 @@
1
1
  import { getSessionCostRecord, listProjectsForAccount, listSessionCosts, } from '@kortix/sdk';
2
2
  import { useQuery } from '@tanstack/react-query';
3
3
  import { useBillingAccountId } from '../stores/billing-account-context.js';
4
+ import { costReadBusyRetryDelay, retryCostReadBusy } from './use-cost-explorer.js';
4
5
  export const SESSION_COST_PAGE_SIZE = 25;
5
6
  const SESSION_COST_STALE_TIME_MS = 30_000;
6
7
  const sdkSources = {
@@ -34,6 +35,8 @@ export function buildSessionCostsListQuery(input, sources = sdkSources) {
34
35
  queryFn: () => sources.list(options),
35
36
  enabled: Boolean(input.accountId),
36
37
  staleTime: SESSION_COST_STALE_TIME_MS,
38
+ retry: retryCostReadBusy,
39
+ retryDelay: costReadBusyRetryDelay,
37
40
  };
38
41
  }
39
42
  export function buildSessionCostDetailQuery(input, sources = sdkSources) {
@@ -64,6 +67,9 @@ export function buildSessionCostDetailQuery(input, sources = sdkSources) {
64
67
  // for the exact session the user is looking at).
65
68
  enabled: Boolean(input.sessionId) && Boolean(input.accountId),
66
69
  staleTime: SESSION_COST_STALE_TIME_MS,
70
+ // The detail route shares the per-caller cost-read bound: a 429 is "try again shortly".
71
+ retry: retryCostReadBusy,
72
+ retryDelay: costReadBusyRetryDelay,
67
73
  };
68
74
  }
69
75
  export function buildSessionCostProjectsQuery(accountId, sources = sdkSources) {
@@ -3,15 +3,15 @@
3
3
  * The web app's master switch for Kortix in Chrome. Off, no surface renders
4
4
  * and nothing calls /v1/chrome/*: no Settings page, no command-palette entry,
5
5
  * no sidebar row and no card in Apps and extensions. Off on every deployment
6
- * until launch: the probe below logged a 404 in the console on staging and
7
- * prod, where the API's KORTIX_CHROME_ENABLED is off. Set true to bring the
6
+ * until launch: a person must not see a Chrome surface before the Chrome Web
7
+ * Store listing is public. Set true to bring the
8
8
  * surfaces back where the API serves the routes. The value is
9
9
  * `CHROME_LAUNCHED`, which the API and the CLI read too.
10
10
  */
11
11
  export declare const CHROME_UI_ENABLED = false;
12
12
  /**
13
13
  * Whether this platform offers Kortix in Chrome at all. The API answers 404
14
- * on /v1/chrome/* where KORTIX_CHROME_ENABLED is off (staging, prod), so the
14
+ * on /v1/chrome/* where KORTIX_CHROME_ENABLED is off (a self-hosted server), so the
15
15
  * account-level surfaces — Settings → Kortix in Chrome and its command-palette
16
16
  * entry — show only once the browser list answers. Project surfaces read the
17
17
  * project's `chrome` flag and `CHROME_UI_ENABLED` instead.
@@ -7,15 +7,15 @@ import { useQuery } from '@tanstack/react-query';
7
7
  * The web app's master switch for Kortix in Chrome. Off, no surface renders
8
8
  * and nothing calls /v1/chrome/*: no Settings page, no command-palette entry,
9
9
  * no sidebar row and no card in Apps and extensions. Off on every deployment
10
- * until launch: the probe below logged a 404 in the console on staging and
11
- * prod, where the API's KORTIX_CHROME_ENABLED is off. Set true to bring the
10
+ * until launch: a person must not see a Chrome surface before the Chrome Web
11
+ * Store listing is public. Set true to bring the
12
12
  * surfaces back where the API serves the routes. The value is
13
13
  * `CHROME_LAUNCHED`, which the API and the CLI read too.
14
14
  */
15
15
  export const CHROME_UI_ENABLED = CHROME_LAUNCHED;
16
16
  /**
17
17
  * Whether this platform offers Kortix in Chrome at all. The API answers 404
18
- * on /v1/chrome/* where KORTIX_CHROME_ENABLED is off (staging, prod), so the
18
+ * on /v1/chrome/* where KORTIX_CHROME_ENABLED is off (a self-hosted server), so the
19
19
  * account-level surfaces — Settings → Kortix in Chrome and its command-palette
20
20
  * entry — show only once the browser list answers. Project surfaces read the
21
21
  * project's `chrome` flag and `CHROME_UI_ENABLED` instead.
@@ -1,24 +1,5 @@
1
1
  /** @internal Kortix apps only. No semver: it may change in any release. */
2
- /**
3
- * The one left-rail recipe: Project admin and the agent page. A rail is
4
- * vertical `Tabs` whose rows are real links (the section is URL state),
5
- * grouped under muted labels in the account hub's dialect
6
- * (Workspace settings, `project-admin-dashboard.tsx`).
7
- */
8
- import type { ReactNode } from 'react';
9
- /**
10
- * Each group is its own labelled tablist: arrow keys move inside a group, Tab
11
- * moves to the next one. `after` sits below the list, outside it: a link that
12
- * is not a tab. A group without `label` draws no heading.
13
- */
14
- export declare function RailGroup({ label, children, after }: {
15
- label?: string;
16
- children: ReactNode;
17
- after?: ReactNode;
18
- }): import("react").JSX.Element;
19
- /** A rail row: pass to `TabsTrigger` with `size="md"`. */
20
- export declare const RAIL_ROW_CLASS: string;
21
- /** The same row on the narrow-screen horizontal strip. */
2
+ /** The settings rail's row on the narrow-screen horizontal strip (Workspace settings). */
22
3
  export declare const RAIL_HORIZONTAL_ROW_CLASS = "w-auto shrink-0 gap-2.5 px-3 py-0.75 whitespace-nowrap";
23
4
  /** The settings rail's width: Workspace settings and the personal Settings panel share it. */
24
5
  export declare const SETTINGS_SIDEBAR_WIDTH_PX = 300;
@@ -1,18 +1,4 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { cn } from '../lib/utils.js';
4
- import { TabsList } from '../../primitives/tabs.js';
5
- /**
6
- * Each group is its own labelled tablist: arrow keys move inside a group, Tab
7
- * moves to the next one. `after` sits below the list, outside it: a link that
8
- * is not a tab. A group without `label` draws no heading.
9
- */
10
- export function RailGroup({ label, children, after }) {
11
- return (_jsxs("div", { children: [label ? _jsx("p", { className: "text-muted-foreground flex h-8 items-center px-2.5 text-xs font-medium", children: label }) : null, _jsx(TabsList, { orientation: "vertical", "aria-label": label, className: "w-full", children: children }), after] }));
12
- }
13
- /** A rail row: pass to `TabsTrigger` with `size="md"`. */
14
- export const RAIL_ROW_CLASS = cn('gap-2 px-2.5 py-1 font-normal transition-none has-[>svg]:px-2.5', 'text-foreground data-[state=inactive]:text-foreground hover:bg-hover hover:text-foreground', 'data-[state=active]:bg-active data-[state=active]:font-medium', '[&_svg]:text-muted-foreground data-[state=active]:[&_svg]:text-foreground');
15
- /** The same row on the narrow-screen horizontal strip. */
1
+ /** The settings rail's row on the narrow-screen horizontal strip (Workspace settings). */
16
2
  export const RAIL_HORIZONTAL_ROW_CLASS = 'w-auto shrink-0 gap-2.5 px-3 py-0.75 whitespace-nowrap';
17
3
  /** The settings rail's width: Workspace settings and the personal Settings panel share it. */
18
4
  export const SETTINGS_SIDEBAR_WIDTH_PX = 300;
@@ -1,16 +1,20 @@
1
1
  /** @internal Kortix apps only. No semver: it may change in any release. */
2
2
  /**
3
- * The header of a standalone project page (Files, Apps):
4
- * the sidebar toggle, then the page title as the page's `<h1>`. It uses the
5
- * same title-bar classes as the agent identity header (`agent-page-chrome.tsx`), so it
6
- * has the same height and clears the desktop window controls the same way.
7
- * A page has one view, so the title is plain text, not a one-tab underline
8
- * bar. `titleAccessory` sits right after the title (a docs link). `children`
9
- * sit at the trailing edge (page actions).
3
+ * The one header of a standalone project page (Spaces, Goals, Apps, Artifacts,
4
+ * Files, Calendar, a goal, an artifact): 44px tall (`h-12`), 11px gutters
5
+ * (`px-3`), the sidebar toggle, the title as the page's `<h1>` on the toggle's
6
+ * line, and the actions 8px apart (`gap-2`) at the trailing edge. Actions are
7
+ * `size="sm"` buttons or `size="icon-base"` icon buttons (both 29px), the
8
+ * primary one in the default variant. A page that draws its own row (the
9
+ * artifact viewer) uses `PROJECT_PAGE_HEADER_CLASS`, never its own numbers.
10
10
  *
11
- * The e2e journey `18-apps-ui` finds the page by the
12
- * `<h1>`.
11
+ * The title-bar classes (`kx-titlebar-row`, `kx-titlebar-tabs`) let the
12
+ * desktop app give the row its window-control band. `breadcrumb` sits before
13
+ * the title ("Goals ›"), `titleAccessory` after it (a docs link).
14
+ *
15
+ * The e2e journey `18-apps-ui` finds the page by the `<h1>`.
13
16
  */
17
+ export declare const PROJECT_PAGE_HEADER_CLASS = "kx-titlebar-row kx-capability-titlebar border-border relative flex h-12 shrink-0 items-center gap-2 border-b px-3";
14
18
  export declare function ProjectPageHeader({ title, titleAccessory, breadcrumb, children, }: {
15
19
  title: string;
16
20
  /** The parent page before the title (a link and a separator): "Goals › <goal>". */
@@ -4,21 +4,25 @@ import { useSettingsPageTitle } from '../../primitives/settings-section-header.j
4
4
  import { useOptionalSidebar } from '../../primitives/sidebar.js';
5
5
  import { SidebarToggle } from './sidebar-toggle.js';
6
6
  /**
7
- * The header of a standalone project page (Files, Apps):
8
- * the sidebar toggle, then the page title as the page's `<h1>`. It uses the
9
- * same title-bar classes as the agent identity header (`agent-page-chrome.tsx`), so it
10
- * has the same height and clears the desktop window controls the same way.
11
- * A page has one view, so the title is plain text, not a one-tab underline
12
- * bar. `titleAccessory` sits right after the title (a docs link). `children`
13
- * sit at the trailing edge (page actions).
7
+ * The one header of a standalone project page (Spaces, Goals, Apps, Artifacts,
8
+ * Files, Calendar, a goal, an artifact): 44px tall (`h-12`), 11px gutters
9
+ * (`px-3`), the sidebar toggle, the title as the page's `<h1>` on the toggle's
10
+ * line, and the actions 8px apart (`gap-2`) at the trailing edge. Actions are
11
+ * `size="sm"` buttons or `size="icon-base"` icon buttons (both 29px), the
12
+ * primary one in the default variant. A page that draws its own row (the
13
+ * artifact viewer) uses `PROJECT_PAGE_HEADER_CLASS`, never its own numbers.
14
14
  *
15
- * The e2e journey `18-apps-ui` finds the page by the
16
- * `<h1>`.
15
+ * The title-bar classes (`kx-titlebar-row`, `kx-titlebar-tabs`) let the
16
+ * desktop app give the row its window-control band. `breadcrumb` sits before
17
+ * the title ("Goals ›"), `titleAccessory` after it (a docs link).
18
+ *
19
+ * The e2e journey `18-apps-ui` finds the page by the `<h1>`.
17
20
  */
21
+ export const PROJECT_PAGE_HEADER_CLASS = 'kx-titlebar-row kx-capability-titlebar border-border relative flex h-12 shrink-0 items-center gap-2 border-b px-3';
18
22
  export function ProjectPageHeader({ title, titleAccessory, breadcrumb, children, }) {
19
23
  const sidebar = useOptionalSidebar();
20
24
  // Inside Workspace settings (Repository) the settings page header above is
21
25
  // the page's h1 and names the page: this row is only the browser's toolbar.
22
26
  const inSettings = useSettingsPageTitle() !== null;
23
- return (_jsxs("div", { className: "kx-titlebar-row kx-capability-titlebar relative flex shrink-0 items-center gap-1 border-b px-2", "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [_jsx(SidebarToggle, {}), _jsxs("div", { className: "kx-titlebar-tabs flex h-10 min-w-0 flex-1 items-center gap-1.5 px-3", children: [breadcrumb, inSettings ? null : _jsx("h1", { className: "text-foreground truncate text-sm font-medium", children: title }), titleAccessory] }), children ? _jsx("div", { className: "flex shrink-0 items-center gap-1", children: children }) : null] }));
27
+ return (_jsxs("div", { className: PROJECT_PAGE_HEADER_CLASS, "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [_jsx(SidebarToggle, {}), _jsxs("div", { className: "kx-titlebar-tabs flex h-full min-w-0 flex-1 items-center gap-1.5", children: [breadcrumb, inSettings ? null : _jsx("h1", { className: "text-foreground truncate text-sm font-medium", children: title }), titleAccessory] }), children ? _jsx("div", { className: "flex shrink-0 items-center gap-2", children: children }) : null] }));
24
28
  }
@@ -3,6 +3,8 @@ export type NoiseKind = 'runtime' | 'sentry';
3
3
  export interface NoiseFrame {
4
4
  filename?: unknown;
5
5
  function?: unknown;
6
+ lineno?: unknown;
7
+ colno?: unknown;
6
8
  }
7
9
  export interface NoiseEvidence {
8
10
  message: unknown;
@@ -374,6 +374,7 @@ export function isVercelLiveFeedbackNoise(input) {
374
374
  /^https?:\/\/[^/]+\/_next-live\/feedback\//.test(normalizeString(source));
375
375
  return sources.some(isFeedbackFrame) && !sources.some(isFirstPartyResolvedSource);
376
376
  }
377
+ const CSP_EVAL_MESSAGE = /^Evaluating a string as JavaScript violates the following Content Security Policy directive because 'unsafe-eval' is not an allowed source of script/;
377
378
  export const INJECTED_SCRIPT_RULES = [
378
379
  { id: 'onetrust-json-parse', appliesTo: 'both', match: isOneTrustJsonParseNoise },
379
380
  { id: 'redefine-webdriver', appliesTo: 'both', match: isRedefineWebdriverNoise },
@@ -402,8 +403,22 @@ export const INJECTED_SCRIPT_RULES = [
402
403
  // stack of only `<anonymous>` frames; any other frame or no stack reports.
403
404
  id: 'injected-csp-eval',
404
405
  appliesTo: 'sentry',
405
- match: ({ message, frames }) => /^Evaluating a string as JavaScript violates the following Content Security Policy directive because 'unsafe-eval' is not an allowed source of script/.test(normalizeString(message)) &&
406
+ match: ({ message, frames }) => CSP_EVAL_MESSAGE.test(normalizeString(message)) &&
406
407
  frames.length > 0 &&
407
408
  frames.every((frame) => frame.filename === '<anonymous>'),
408
409
  },
410
+ {
411
+ // KRTX-5011: heic2any's decoder worker calls `new Function` at worker line
412
+ // 2:1320381, and the CSP blocks it (KRTX-3580). PR #10981 removed heic2any
413
+ // from Kortix; a third-party script that bundles it (a browser extension)
414
+ // still starts the worker on our pages. Require the CSP message and a
415
+ // stack of exactly that one `blob:` frame; any other blob worker reports.
416
+ id: 'third-party-heic2any-worker-csp-eval',
417
+ appliesTo: 'sentry',
418
+ match: ({ message, frames }) => CSP_EVAL_MESSAGE.test(stripErrorWrappers(normalizeString(message).replace(/^Uncaught /, ''))) &&
419
+ frames.length === 1 &&
420
+ normalizeString(frames[0]?.filename).startsWith('blob:') &&
421
+ frames[0]?.lineno === 2 &&
422
+ frames[0]?.colno === 1320381,
423
+ },
409
424
  ];
@@ -251,15 +251,6 @@ export const handleApiError = (error, context, tI18nComplete) => {
251
251
  }
252
252
  return;
253
253
  }
254
- // Marketplace imports can use either a paid managed model or a provider
255
- // key. Preserve the server's remedy instead of swallowing this BillingError
256
- // or sending an already-paid customer to the plan picker.
257
- if (v2Status === 402 && v2Code === 'no_servable_model') {
258
- if (!context?.silent) {
259
- errorToast(v2Message ?? errorMessage, { duration: 6000 });
260
- }
261
- return;
262
- }
263
254
  // Billing block on a user action (session start, send, purchase). One modal
264
255
  // handles both shapes and picks the right view off the 402's billing_state +
265
256
  // has_subscription: a free/no-plan account gets the plan picker; a paying
@@ -1,2 +1,2 @@
1
- export const DEFAULT_LIGHT_THEME = 'pure-light';
2
- export const DEFAULT_DARK_THEME = 'pure-dark';
1
+ export const DEFAULT_LIGHT_THEME = 'light';
2
+ export const DEFAULT_DARK_THEME = 'dark';
@@ -28,7 +28,7 @@ export { PROJECT_ACTIONS, type ProjectAction };
28
28
  * maps a `SettingsTab` onto one of these ids to reuse the IAM read leaf below
29
29
  * — the ids themselves never reach the UI as tab names anymore.
30
30
  */
31
- export type CustomizeSection = 'git' | 'review' | 'commands' | 'marketplace' | 'secrets' | 'llm-management' | 'llm-overview' | 'llm-providers' | 'llm-logs' | 'llm-budgets' | 'llm-keys' | 'llm-api' | 'members' | 'schedules' | 'webhooks' | 'channels' | 'sandbox' | 'settings' | 'feature-flags';
31
+ export type CustomizeSection = 'git' | 'review' | 'commands' | 'secrets' | 'llm-management' | 'llm-overview' | 'llm-providers' | 'llm-logs' | 'llm-budgets' | 'llm-keys' | 'llm-api' | 'members' | 'schedules' | 'webhooks' | 'channels' | 'sandbox' | 'settings' | 'feature-flags';
32
32
  /**
33
33
  * Per-section gating leaves.
34
34
  *
@@ -42,10 +42,9 @@ export type CustomizeSection = 'git' | 'review' | 'commands' | 'marketplace' | '
42
42
  * actual Slack connect/disconnect routes assert project.connector.write.
43
43
  * - `git` surfaces repository metadata and clone instructions; pushes remain
44
44
  * separately gated by project.gitops.push.
45
- * - sandbox/settings/marketplace have no dedicated read leaf, so
46
- * they stay visible on project.read and gate writes on the closest real leaf
47
- * the backend asserts (e.g. sandbox rebuild → sandbox.write, marketplace
48
- * install → gitops.push).
45
+ * - sandbox/settings have no dedicated read leaf, so they stay visible on
46
+ * project.read and gate writes on the closest real leaf the backend asserts
47
+ * (e.g. sandbox rebuild → sandbox.write).
49
48
  */
50
49
  export declare const CUSTOMIZE_SECTION_ACCESS: Record<CustomizeSection, {
51
50
  read: ProjectAction;
@@ -31,10 +31,9 @@ export { PROJECT_ACTIONS };
31
31
  * actual Slack connect/disconnect routes assert project.connector.write.
32
32
  * - `git` surfaces repository metadata and clone instructions; pushes remain
33
33
  * separately gated by project.gitops.push.
34
- * - sandbox/settings/marketplace have no dedicated read leaf, so
35
- * they stay visible on project.read and gate writes on the closest real leaf
36
- * the backend asserts (e.g. sandbox rebuild → sandbox.write, marketplace
37
- * install → gitops.push).
34
+ * - sandbox/settings have no dedicated read leaf, so they stay visible on
35
+ * project.read and gate writes on the closest real leaf the backend asserts
36
+ * (e.g. sandbox rebuild → sandbox.write).
38
37
  */
39
38
  export const CUSTOMIZE_SECTION_ACCESS = {
40
39
  // No `agents` entry: Agents graduated to /workspaces/<id>/agent, which gates
@@ -82,7 +81,6 @@ export const CUSTOMIZE_SECTION_ACCESS = {
82
81
  read: PROJECT_ACTIONS.PROJECT_MEMBERS_READ,
83
82
  write: PROJECT_ACTIONS.PROJECT_MEMBERS_MANAGE,
84
83
  },
85
- marketplace: { read: PROJECT_ACTIONS.PROJECT_READ, write: PROJECT_ACTIONS.PROJECT_GITOPS_PUSH },
86
84
  // LLM gateway sections — visible to any project member; the backend enforces
87
85
  // the specific gateway capability (logs/spend.read, budget.set, keys.manage)
88
86
  // on each mutation route, so visibility gates on project.read.
@@ -20,6 +20,9 @@
20
20
  *
21
21
  * Referenced sessions (...):
22
22
  * <session_ref id="..." title="..." />
23
+ *
24
+ * Referenced Drive files (...):
25
+ * <drive_ref path="..." name="..." />
23
26
  */
24
27
  /**
25
28
  * Escape a value for a double-quoted XML attribute in ONE pass: `&`, `"`,
@@ -44,12 +47,45 @@ export interface SessionRefLike {
44
47
  }
45
48
  export declare function buildFileRef(f: FileRefLike): string;
46
49
  export declare function buildAgentRef(a: AgentRefLike): string;
50
+ /**
51
+ * A file in the project's Drive: `path` is its Drive path (`/Company/a.png`),
52
+ * not a sandbox path; `file` is the name of the upload that carries its bytes.
53
+ */
54
+ export interface DriveRefLike {
55
+ path: string;
56
+ name: string;
57
+ file: string;
58
+ }
59
+ export declare function buildDriveRef(d: DriveRefLike): string;
47
60
  export declare function buildSessionRef(s: SessionRefLike): string;
48
61
  export declare function buildFileRefsBlock(files: ReadonlyArray<FileRefLike>): string;
49
62
  export declare function buildAgentRefsBlock(agents: ReadonlyArray<AgentRefLike>): string;
50
63
  /** The parenthesised hint `parseSessionReferences` strips with the header. */
51
64
  export declare const SESSION_REFS_HINT = "use the session_context tool to fetch details when needed";
52
65
  export declare function buildSessionRefsBlock(sessions: ReadonlyArray<SessionRefLike>): string;
66
+ export declare function buildDriveRefsBlock(files: ReadonlyArray<DriveRefLike>): string;
67
+ /** An attached file as `driveRefsOf` reads it: its upload name, and the Drive path it was staged from. */
68
+ export interface DriveUploadLike {
69
+ name: string;
70
+ drivePath?: string;
71
+ }
72
+ /**
73
+ * One Drive ref per path, in mention order, for the paths whose upload rides
74
+ * with this message. A chip whose file is not attached (still downloading,
75
+ * refused, removed from the tray) gets no ref: the agent is never told of a
76
+ * file it does not have.
77
+ */
78
+ export declare function driveRefsOf(mentions: ReadonlyArray<MentionRefLike> | undefined, files: ReadonlyArray<DriveUploadLike>): DriveRefLike[];
79
+ /**
80
+ * The Drive refs an edited message keeps: the ones whose `@name` is still in
81
+ * the text and whose upload the edit kept. The edit sends those uploads again.
82
+ */
83
+ export declare function keptDriveRefs(text: string, refs: ReadonlyArray<{
84
+ path: string;
85
+ name: string;
86
+ file?: string;
87
+ }>, keptFiles: ReadonlyArray<string>): DriveRefLike[];
88
+ export declare function appendDriveRefs(text: string, files: ReadonlyArray<DriveRefLike>): string;
53
89
  export declare function appendFileRefs(text: string, files: ReadonlyArray<FileRefLike>): string;
54
90
  export declare function appendAgentRefs(text: string, agents: ReadonlyArray<AgentRefLike>): string;
55
91
  export declare function appendSessionRefs(text: string, sessions: ReadonlyArray<SessionRefLike>): string;
@@ -57,15 +93,17 @@ export declare function appendSessionRefs(text: string, sessions: ReadonlyArray<
57
93
  export interface MentionRefLike {
58
94
  kind: string;
59
95
  label: string;
60
- /** A session mention's session id. */
96
+ /** A session mention's session id; a Drive mention's Drive path. */
61
97
  value?: string;
62
98
  }
63
99
  /**
64
- * Append the reference blocks for a draft's `@` mentions: sessions, then files,
65
- * then agents, the order an in-session send writes them. The draft text holds
100
+ * Append the reference blocks for a draft's `@` mentions: sessions, files,
101
+ * Drive files, then agents, the order an in-session send writes them. The draft text holds
66
102
  * only `@label`, so without these blocks the agent gets no path to open and no
67
103
  * agent to hand off to. Used by every path that is not that send: a chat's
68
104
  * first message (`ComposerChatInput`) and a slash command's args
69
105
  * (`planDraftSubmission`).
70
106
  */
71
- export declare function appendMentionRefs(text: string, mentions: ReadonlyArray<MentionRefLike> | undefined): string;
107
+ export declare function appendMentionRefs(text: string, mentions: ReadonlyArray<MentionRefLike> | undefined,
108
+ /** The files the message carries: a Drive mention gets a ref only when its upload is among them. */
109
+ files?: ReadonlyArray<DriveUploadLike>): string;
@@ -19,6 +19,9 @@
19
19
  *
20
20
  * Referenced sessions (...):
21
21
  * <session_ref id="..." title="..." />
22
+ *
23
+ * Referenced Drive files (...):
24
+ * <drive_ref path="..." name="..." />
22
25
  */
23
26
  // ─── Attribute escaping ─────────────────────────────────────────────────────
24
27
  const XML_ATTR_ESCAPES = {
@@ -46,6 +49,9 @@ export function buildFileRef(f) {
46
49
  export function buildAgentRef(a) {
47
50
  return `<agent_ref name="${escapeXmlAttr(a.name)}" />`;
48
51
  }
52
+ export function buildDriveRef(d) {
53
+ return `<drive_ref path="${escapeXmlAttr(d.path)}" name="${escapeXmlAttr(d.name)}" file="${escapeXmlAttr(d.file)}" />`;
54
+ }
49
55
  export function buildSessionRef(s) {
50
56
  return `<session_ref id="${escapeXmlAttr(s.id)}" title="${escapeXmlAttr(s.title)}" />`;
51
57
  }
@@ -70,6 +76,42 @@ export function buildSessionRefsBlock(sessions) {
70
76
  const refs = sessions.map(buildSessionRef).join('\n');
71
77
  return `Referenced sessions (${SESSION_REFS_HINT}):\n${refs}`;
72
78
  }
79
+ export function buildDriveRefsBlock(files) {
80
+ if (!files.length)
81
+ return '';
82
+ const refs = files.map(buildDriveRef).join('\n');
83
+ return `Referenced Drive files (the user picked these from the project's Drive; each one is the attached upload named in its file attribute):\n${refs}`;
84
+ }
85
+ /**
86
+ * One Drive ref per path, in mention order, for the paths whose upload rides
87
+ * with this message. A chip whose file is not attached (still downloading,
88
+ * refused, removed from the tray) gets no ref: the agent is never told of a
89
+ * file it does not have.
90
+ */
91
+ export function driveRefsOf(mentions, files) {
92
+ const refs = new Map();
93
+ for (const mention of mentions ?? []) {
94
+ if (mention.kind !== 'drive' || !mention.value || !mention.label || refs.has(mention.value))
95
+ continue;
96
+ const upload = files.find((file) => file.drivePath === mention.value);
97
+ if (upload)
98
+ refs.set(mention.value, { path: mention.value, name: mention.label, file: upload.name });
99
+ }
100
+ return [...refs.values()];
101
+ }
102
+ /**
103
+ * The Drive refs an edited message keeps: the ones whose `@name` is still in
104
+ * the text and whose upload the edit kept. The edit sends those uploads again.
105
+ */
106
+ export function keptDriveRefs(text, refs, keptFiles) {
107
+ return refs.flatMap((ref) => ref.file && keptFiles.includes(ref.file) && text.includes(`@${ref.name}`) ? [{ path: ref.path, name: ref.name, file: ref.file }] : []);
108
+ }
109
+ export function appendDriveRefs(text, files) {
110
+ const block = buildDriveRefsBlock(files);
111
+ if (!block)
112
+ return text;
113
+ return `${text}\n\n${block}`;
114
+ }
73
115
  // ─── Appenders (text-in, text-out) ──────────────────────────────────────────
74
116
  export function appendFileRefs(text, files) {
75
117
  const block = buildFileRefsBlock(files);
@@ -90,23 +132,25 @@ export function appendSessionRefs(text, sessions) {
90
132
  return `${text}\n\n${block}`;
91
133
  }
92
134
  /**
93
- * Append the reference blocks for a draft's `@` mentions: sessions, then files,
94
- * then agents, the order an in-session send writes them. The draft text holds
135
+ * Append the reference blocks for a draft's `@` mentions: sessions, files,
136
+ * Drive files, then agents, the order an in-session send writes them. The draft text holds
95
137
  * only `@label`, so without these blocks the agent gets no path to open and no
96
138
  * agent to hand off to. Used by every path that is not that send: a chat's
97
139
  * first message (`ComposerChatInput`) and a slash command's args
98
140
  * (`planDraftSubmission`).
99
141
  */
100
- export function appendMentionRefs(text, mentions) {
142
+ export function appendMentionRefs(text, mentions,
143
+ /** The files the message carries: a Drive mention gets a ref only when its upload is among them. */
144
+ files = []) {
101
145
  const labelled = (mentions ?? []).filter((mention) => mention.label);
102
146
  const sessions = labelled
103
147
  .filter((mention) => mention.kind === 'session' && mention.value)
104
148
  .map((mention) => ({ id: mention.value, title: mention.label }));
105
- const files = labelled
149
+ const workspaceFiles = labelled
106
150
  .filter((mention) => mention.kind === 'file')
107
151
  .map((mention) => ({ path: mention.label, name: mention.label }));
108
152
  const agents = labelled
109
153
  .filter((mention) => mention.kind === 'agent')
110
154
  .map((mention) => ({ name: mention.label }));
111
- return appendAgentRefs(appendFileRefs(appendSessionRefs(text, sessions), files), agents);
155
+ return appendAgentRefs(appendDriveRefs(appendFileRefs(appendSessionRefs(text, sessions), workspaceFiles), driveRefsOf(labelled, files)), agents);
112
156
  }
@@ -117,7 +117,12 @@ export function isOtherProject(projectId) {
117
117
  return current !== null && current !== projectId;
118
118
  }
119
119
  /**
120
- * Navigate to a session by opening/activating its tab and navigating to it.
120
+ * Open a session: activate its tab and route to it through the App Router, the
121
+ * way the sidebar's session link does.
122
+ *
123
+ * A bare `history.pushState` moved the URL, and the sidebar's selection with
124
+ * it, but not the route params the session page renders: the session on screen
125
+ * kept its transcript (KRTX-5008).
121
126
  *
122
127
  * `projectId` is required for a real URL. `/sessions/<id>` — what this used to
123
128
  * build — is not a route at all: it is a leftover of the instance-scoped scheme
@@ -129,26 +134,12 @@ function navigateToSession(sessionId, sessionTitle, opts) {
129
134
  const projectId = opts?.projectId ?? currentProjectId();
130
135
  if (!projectId)
131
136
  return;
132
- const href = projectSessionHref(projectId, sessionId) + (opts?.search ?? '');
133
- try {
134
- // Open/activate the tab in the tab store + pushState
135
- openTabAndNavigate({
136
- id: sessionId,
137
- title: sessionTitle || 'Session',
138
- type: 'session',
139
- href,
140
- });
141
- // A native notification click can arrive while the tab is backgrounded, so
142
- // the tab store's pushState alone may not bring the session into view.
143
- // `softNavigate` routes through the App Router; `window.location.assign`
144
- // here tore down and rebooted the whole SPA on every notification click.
145
- if (opts?.forceNavigation && window.location.pathname !== href) {
146
- softNavigate(href);
147
- }
148
- }
149
- catch {
150
- softNavigate(href);
151
- }
137
+ openTabAndNavigate({
138
+ id: sessionId,
139
+ title: sessionTitle || 'Session',
140
+ type: 'session',
141
+ href: projectSessionHref(projectId, sessionId) + (opts?.search ?? ''),
142
+ }, undefined, softNavigate);
152
143
  }
153
144
  /**
154
145
  * Check if the user is NOT actively looking at the app — either switched
@@ -366,7 +357,7 @@ force = false) {
366
357
  notification.onclick = () => {
367
358
  window.focus();
368
359
  notification?.close();
369
- openPayload(payload, true);
360
+ openPayload(payload);
370
361
  payload.onClick?.();
371
362
  };
372
363
  // Auto-close after 8s (in case the browser doesn't)
@@ -451,15 +442,12 @@ const NOTIFICATION_TOAST_VARIANT = {
451
442
  mention: 'info',
452
443
  };
453
444
  /** Open what the notification is about: its session, or its `href`. */
454
- function openPayload(payload, forceNavigation) {
445
+ function openPayload(payload) {
455
446
  if (payload.threadHref) {
456
447
  softNavigate(payload.threadHref);
457
448
  }
458
449
  else if (payload.sessionId) {
459
- navigateToSession(payload.sessionId, payload.body, {
460
- forceNavigation,
461
- projectId: payload.projectId,
462
- });
450
+ navigateToSession(payload.sessionId, payload.body, { projectId: payload.projectId });
463
451
  }
464
452
  else if (payload.href) {
465
453
  softNavigate(payload.href);
@@ -538,7 +526,7 @@ function showInAppToast(payload) {
538
526
  {
539
527
  label: actionLabel,
540
528
  onClick: () => {
541
- openPayload(payload, false);
529
+ openPayload(payload);
542
530
  payload.onClick?.();
543
531
  },
544
532
  },
@@ -579,7 +567,7 @@ function showSessionToast(payload, sessionId) {
579
567
  ]);
580
568
  }
581
569
  function openSessionToast(target) {
582
- openPayload(target.payload, false);
570
+ openPayload(target.payload);
583
571
  target.payload.onClick?.();
584
572
  }
585
573
  /**
@@ -49,7 +49,7 @@ export const OUTCOME_TINT = {
49
49
  },
50
50
  destructive: { bg: 'bg-kortix-red/15', fg: 'text-kortix-red/85', ring: 'ring-kortix-red/40' },
51
51
  info: { bg: 'bg-kortix-blue/15', fg: 'text-kortix-blue/85', ring: 'ring-kortix-blue/40' },
52
- neutral: { bg: 'bg-muted', fg: 'text-muted-foreground/85', ring: 'ring-border/70' },
52
+ neutral: { bg: 'bg-muted', fg: 'text-muted-foreground', ring: 'ring-border/70' },
53
53
  };
54
54
  export function outcomeTint(tone) {
55
55
  return OUTCOME_TINT[tone] ?? OUTCOME_TINT.neutral;
@@ -23,7 +23,7 @@ export declare const EMPTY_LIST: readonly never[];
23
23
  * The sidebar keeps the bare `projectId` as its key, so every value persisted
24
24
  * before surfaces existed keeps working and keeps belonging to the sidebar.
25
25
  */
26
- export type SessionViewSurface = 'sidebar' | 'page';
26
+ export type SessionViewSurface = 'sidebar' | 'page' | 'space';
27
27
  interface State {
28
28
  groupByProject: Record<string, SessionGroupMode>;
29
29
  orderByProject: Record<string, SessionOrderMode>;
@@ -20,8 +20,8 @@ export interface KeyboardShortcutPreferences {
20
20
  export interface UserPreferences {
21
21
  keyboard: KeyboardShortcutPreferences;
22
22
  /**
23
- * The palette used in light mode and in dark mode — defaults 'pure-light'
24
- * and 'pure-dark'. The mode itself (light / dark / system) stays in
23
+ * The palette used in light mode and in dark mode — defaults 'light'
24
+ * and 'dark' (Kortix light / Kortix dark). The mode itself (light / dark / system) stays in
25
25
  * `next-themes`; see `lib/interface-themes.ts`. Legacy persisted preferences
26
26
  * predate these keys, so read sites go through `normalizeLightTheme` /
27
27
  * `normalizeDarkTheme`.