@kortix/ui 0.15.9 → 0.15.11

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 (202) hide show
  1. package/dist/_vendor/kortix-shared.js +467 -2
  2. package/dist/_vendor/shared/app-config.d.ts +6 -30
  3. package/dist/_vendor/shared/channel-descriptors.d.ts +0 -34
  4. package/dist/_vendor/shared/channel-header.d.ts +2 -1
  5. package/dist/_vendor/shared/connector-sections.d.ts +0 -25
  6. package/dist/_vendor/shared/file-tags.d.ts +2 -1
  7. package/dist/_vendor/shared/index.d.ts +1 -0
  8. package/dist/_vendor/shared/pasted-content.d.ts +0 -4
  9. package/dist/_vendor/shared/pixel-mark.d.ts +0 -17
  10. package/dist/_vendor/shared/project-glyphs.d.ts +0 -1
  11. package/dist/_vendor/shared/session/attachment-tile.d.ts +32 -0
  12. package/dist/_vendor/shared/session/stop-refusal.d.ts +15 -0
  13. package/dist/_vendor/shared/session/tool-row-text.d.ts +58 -0
  14. package/dist/_vendor/shared/session-delivery.d.ts +2 -0
  15. package/dist/customize/agents/agent-model-view.d.ts +11 -1
  16. package/dist/customize/agents/agent-model-view.js +12 -1
  17. package/dist/customize/agents/agent-page.js +19 -6
  18. package/dist/customize/agents/agent-tabs.d.ts +2 -0
  19. package/dist/customize/agents/agent-tabs.js +2 -0
  20. package/dist/customize/connectors/connectors-page.js +1 -1
  21. package/dist/customize/connectors/detail/connector-page.js +9 -4
  22. package/dist/customize/connectors/detail/connector-triggers.js +1 -1
  23. package/dist/customize/connectors/install/use-install.js +1 -1
  24. package/dist/customize/connectors/use-agent-access.d.ts +1 -0
  25. package/dist/customize/providers/provider-accordion.js +5 -5
  26. package/dist/customize/providers/provider-connect.d.ts +3 -3
  27. package/dist/customize/providers/provider-connect.js +8 -16
  28. package/dist/customize/providers/provider-sheet.js +4 -4
  29. package/dist/customize/sections/component/teams-byo-wizard.js +4 -1
  30. package/dist/customize/sections/connector-connection-form.d.ts +0 -1
  31. package/dist/customize/sections/connector-connection-form.js +0 -9
  32. package/dist/customize/sections/view/review-center-connected.js +7 -3
  33. package/dist/customize/settings/tabs/workspace-keys.js +53 -11
  34. package/dist/customize/shared/feature-gate-screen.js +1 -1
  35. package/dist/customize/triggers/runtime-triggers.js +13 -2
  36. package/dist/customize/triggers/schedule/event-account-picker.js +1 -1
  37. package/dist/customize/triggers/schedule/event-trigger-copy.js +1 -1
  38. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +5 -4
  39. package/dist/customize/triggers/schedule/then-fields.d.ts +5 -1
  40. package/dist/customize/triggers/schedule/then-fields.js +23 -3
  41. package/dist/customize/triggers/schedule/trigger-callouts.js +1 -1
  42. package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +27 -0
  43. package/dist/customize/triggers/schedule/trigger-composer-logic.js +51 -5
  44. package/dist/customize/triggers/schedule/trigger-composer.js +19 -13
  45. package/dist/customize/triggers/schedule/trigger-edit-logic.js +25 -5
  46. package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -3
  47. package/dist/customize/triggers/schedule/trigger-filter.js +7 -6
  48. package/dist/customize/triggers/schedule/trigger-readonly.js +1 -1
  49. package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -1
  50. package/dist/customize/triggers/schedule/use-event-app-connect.js +2 -1
  51. package/dist/customize/triggers/schedule/when-event.js +1 -1
  52. package/dist/customize/triggers/schedule/when-schedule.d.ts +5 -1
  53. package/dist/customize/triggers/schedule/when-schedule.js +16 -1
  54. package/dist/customize/triggers/schedule-view.js +4 -2
  55. package/dist/i18n/en.d.ts +56 -7
  56. package/dist/i18n/en.js +65 -16
  57. package/dist/internal/billing/compute-pricing.d.ts +7 -1
  58. package/dist/internal/billing/compute-pricing.js +7 -1
  59. package/dist/internal/hooks/connectors/invalidate-connections.d.ts +10 -0
  60. package/dist/internal/hooks/connectors/invalidate-connections.js +18 -0
  61. package/dist/internal/hooks/connectors/use-finish-sign-in.js +1 -1
  62. package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +1 -1
  63. package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +1 -1
  64. package/dist/internal/hooks/projects/use-new-project-session.d.ts +2 -0
  65. package/dist/internal/hooks/projects/use-new-project-session.js +4 -1
  66. package/dist/internal/hooks/use-review-session-summary.d.ts +1 -1
  67. package/dist/internal/hooks/use-review-session-summary.js +1 -1
  68. package/dist/internal/layout/project-settings-nav.d.ts +17 -0
  69. package/dist/internal/layout/project-settings-nav.js +24 -0
  70. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +2 -2
  71. package/dist/internal/lib/capability-tab-routes.d.ts +8 -0
  72. package/dist/internal/lib/capability-tab-routes.js +11 -0
  73. package/dist/internal/notifications/notification-inbox.d.ts +4 -10
  74. package/dist/internal/notifications/notification-inbox.js +8 -9
  75. package/dist/internal/stores/composer-prefill-store.d.ts +7 -0
  76. package/dist/internal/stores/composer-prefill-store.js +1 -0
  77. package/dist/internal/stores/connector-gate-store.d.ts +3 -1
  78. package/dist/internal/stores/connector-gate-store.js +13 -3
  79. package/dist/internal/stores/upgrade-dialog-store.d.ts +4 -0
  80. package/dist/internal/stores/upgrade-dialog-store.js +2 -0
  81. package/dist/lib/routes.d.ts +4 -11
  82. package/dist/lib/routes.js +3 -5
  83. package/dist/markdown/unified-markdown-utils.d.ts +7 -0
  84. package/dist/markdown/unified-markdown-utils.js +19 -0
  85. package/dist/markdown/unified-markdown.js +16 -3
  86. package/dist/primitives/alert-dialog.js +1 -1
  87. package/dist/primitives/dialog.js +3 -1
  88. package/dist/primitives/drawer.js +1 -1
  89. package/dist/primitives/modal.js +1 -1
  90. package/dist/primitives/preview-image.js +1 -1
  91. package/dist/primitives/sheet.js +1 -1
  92. package/dist/session/actions/session-label.js +2 -2
  93. package/dist/session/agents/agent-strip.d.ts +10 -5
  94. package/dist/session/agents/agent-strip.js +40 -12
  95. package/dist/session/agents/held-messages.d.ts +6 -2
  96. package/dist/session/agents/held-messages.js +6 -3
  97. package/dist/session/composer/ComposerCard.js +8 -3
  98. package/dist/session/composer/agent-selector.d.ts +2 -0
  99. package/dist/session/composer/agent-selector.js +5 -0
  100. package/dist/session/composer/attachment-tile.d.ts +2 -26
  101. package/dist/session/composer/attachment-tile.js +3 -47
  102. package/dist/session/composer/composer-chat-input.d.ts +3 -1
  103. package/dist/session/composer/composer-chat-input.js +2 -2
  104. package/dist/session/composer/composer-logic.d.ts +7 -0
  105. package/dist/session/composer/composer-logic.js +18 -0
  106. package/dist/session/composer/composer-reset.d.ts +8 -14
  107. package/dist/session/composer/composer-toolbar.d.ts +3 -1
  108. package/dist/session/composer/composer-toolbar.js +3 -3
  109. package/dist/session/composer/composer.d.ts +9 -0
  110. package/dist/session/composer/composer.js +22 -11
  111. package/dist/session/composer/draft/home-composer-focus-handoff.d.ts +7 -0
  112. package/dist/session/composer/draft/home-composer-focus-handoff.js +94 -0
  113. package/dist/session/composer/draft/use-composer-draft.d.ts +3 -1
  114. package/dist/session/composer/draft/use-composer-draft.js +22 -2
  115. package/dist/session/composer/editor/composer-editor.d.ts +4 -2
  116. package/dist/session/composer/editor/composer-editor.js +13 -7
  117. package/dist/session/composer/hooks/use-composer-focus.js +4 -2
  118. package/dist/session/header/session-site-header.d.ts +3 -1
  119. package/dist/session/header/session-site-header.js +3 -2
  120. package/dist/session/index.d.ts +1 -0
  121. package/dist/session/index.js +1 -0
  122. package/dist/session/models/chatgpt-connection-button.js +5 -9
  123. package/dist/session/models/connect-model-step.d.ts +29 -0
  124. package/dist/session/models/connect-model-step.js +50 -0
  125. package/dist/session/models/model-connection-gate.d.ts +2 -1
  126. package/dist/session/models/model-connection-gate.js +6 -3
  127. package/dist/session/models/model-connection-layout.d.ts +2 -0
  128. package/dist/session/models/model-connection-layout.js +4 -0
  129. package/dist/session/models/model-selector.d.ts +1 -1
  130. package/dist/session/models/model-selector.js +9 -6
  131. package/dist/session/models/subscription-offer.d.ts +4 -0
  132. package/dist/session/models/subscription-offer.js +11 -3
  133. package/dist/session/models/use-workspace-model-gate.d.ts +11 -0
  134. package/dist/session/models/use-workspace-model-gate.js +62 -0
  135. package/dist/session/models/workspace-model-gate.d.ts +46 -0
  136. package/dist/session/models/workspace-model-gate.js +66 -0
  137. package/dist/session/overrides/session-overrides-toolbar.js +2 -4
  138. package/dist/session/prompts/ask-deck.d.ts +5 -1
  139. package/dist/session/prompts/ask-deck.js +15 -3
  140. package/dist/session/prompts/question-labels.d.ts +16 -0
  141. package/dist/session/prompts/question-labels.js +34 -0
  142. package/dist/session/prompts/question-prompt.js +6 -6
  143. package/dist/session/prompts/session-connect-card.d.ts +63 -0
  144. package/dist/session/prompts/{session-connect-prompt.js → session-connect-card.js} +53 -42
  145. package/dist/session/status/provisioning-failure.d.ts +23 -2
  146. package/dist/session/status/provisioning-failure.js +53 -3
  147. package/dist/session/status/stop-refusal.d.ts +6 -12
  148. package/dist/session/status/stop-refusal.js +6 -19
  149. package/dist/session/thread/agent-run-props.d.ts +19 -0
  150. package/dist/session/thread/agent-run-props.js +54 -0
  151. package/dist/session/thread/session-chat.js +317 -298
  152. package/dist/session/thread/transcript.d.ts +19 -2
  153. package/dist/session/thread/transcript.js +93 -25
  154. package/dist/session/tool/tool-part-renderer.js +7 -2
  155. package/dist/session/tool/tools/bash-tool.d.ts +3 -52
  156. package/dist/session/tool/tools/bash-tool.js +3 -86
  157. package/dist/session/tool/tools/kortix-action-tool.js +10 -2
  158. package/dist/session/turn/answer-streaming.d.ts +21 -0
  159. package/dist/session/turn/answer-streaming.js +34 -0
  160. package/dist/session/turn/queued-prompt-bubbles.d.ts +5 -0
  161. package/dist/session/turn/queued-prompt-bubbles.js +12 -0
  162. package/dist/session/turn/turn-viewport.d.ts +66 -10
  163. package/dist/session/turn/turn-viewport.js +92 -12
  164. package/dist/session/turn/turn-work-accordion.d.ts +3 -1
  165. package/dist/session/turn/turn-work-accordion.js +2 -2
  166. package/dist/session/turn/user-message.js +7 -5
  167. package/dist/styles.css +1 -1
  168. package/dist/test-utils/intl.d.ts +56 -7
  169. package/dist/workspace/admin/project-admin-dashboard.js +2 -4
  170. package/dist/workspace/home/existing-repo-setup-prompt.d.ts +5 -8
  171. package/dist/workspace/home/existing-repo-setup-prompt.js +16 -42
  172. package/dist/workspace/home/first-chat.d.ts +7 -1
  173. package/dist/workspace/home/first-chat.js +12 -5
  174. package/dist/workspace/home/no-agent-home.d.ts +3 -1
  175. package/dist/workspace/home/no-agent-home.js +2 -2
  176. package/dist/workspace/inbox/workspace-inbox.d.ts +6 -16
  177. package/dist/workspace/inbox/workspace-inbox.js +9 -51
  178. package/dist/workspace/layout/project-home.js +17 -16
  179. package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
  180. package/dist/workspace/layout/use-project-home-send.js +29 -15
  181. package/dist/workspace/new/advanced-fields.d.ts +4 -1
  182. package/dist/workspace/new/advanced-fields.js +2 -2
  183. package/dist/workspace/new/workspace-name.d.ts +9 -0
  184. package/dist/workspace/new/workspace-name.js +20 -0
  185. package/dist/workspace/projects/session-starter.d.ts +6 -4
  186. package/dist/workspace/projects/session-starter.js +8 -14
  187. package/dist/workspace/review/review-center.d.ts +6 -2
  188. package/dist/workspace/review/review-center.js +45 -25
  189. package/dist/workspace/sidebar/session-grouping.d.ts +1 -1
  190. package/dist/workspace/sidebar/session-grouping.js +1 -1
  191. package/dist/workspace/sidebar/workspace-menu-model.d.ts +3 -5
  192. package/dist/workspace/sidebar/workspace-menu-model.js +1 -1
  193. package/dist/workspace/spaces/space-details-panel.js +2 -2
  194. package/dist/workspace/spaces/space-triggers.js +2 -2
  195. package/dist/workspace/spaces/space-view.js +11 -5
  196. package/package.json +15 -7
  197. package/skills/kortix-ui/references/modules.md +1 -1
  198. package/dist/customize/connectors/invalidate-connections.d.ts +0 -2
  199. package/dist/customize/connectors/invalidate-connections.js +0 -4
  200. package/dist/internal/notifications/use-inbox-summary.d.ts +0 -17
  201. package/dist/internal/notifications/use-inbox-summary.js +0 -28
  202. package/dist/session/prompts/session-connect-prompt.d.ts +0 -40
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { qk, removeCachedProjectSession, startSessionWithPrompt, upsertCachedProjectSession, writeStartStash, } from '@kortix/sdk/react';
3
3
  import { useQueryClient } from '@tanstack/react-query';
4
- import { useCallback, useState } from 'react';
4
+ import { useCallback, useRef, useState } from 'react';
5
5
  import { useTranslations } from '../../i18n/index.js';
6
6
  import { useNewProjectSession } from '../../internal/hooks/projects/use-new-project-session.js';
7
7
  import { useUiViewer } from '../../providers/ui-provider.js';
@@ -9,6 +9,7 @@ import { errorToast } from '../../primitives/toast.js';
9
9
  import { postWhenUploaded, sentFailureMessage, } from '../../session/composer/attachment-submission.js';
10
10
  import { useFirstPromptPreviewStore } from '../../session/composer/stores/session-composer-handoff-store.js';
11
11
  import { promptFileParts } from '../../session/composer/uploaded-file-refs.js';
12
+ import { handoffHomeComposerFocus } from '../../session/composer/draft/home-composer-focus-handoff.js';
12
13
  import { buildNewSessionCreateInput } from './new-session-create.js';
13
14
  /**
14
15
  * The project home composer's send: create the session (with the prompt as
@@ -25,10 +26,23 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
25
26
  // Composer sending state: spans Enter → create confirmed → navigation. Reset
26
27
  // only on create failure (success navigates this page away).
27
28
  const [sending, setSending] = useState(false);
29
+ const creatingRef = useRef(false);
30
+ const draftHandoffScope = useRef(null);
28
31
  const send = useCallback(async (text, files, options, attachments) => {
29
32
  if (!text.trim() && !files?.length)
30
33
  return;
31
- await beforeSend?.();
34
+ // A follow-up belongs to the session being created. Refuse it so the
35
+ // composer restores the draft for the navigation handoff.
36
+ if (!space && creatingRef.current)
37
+ throw new Error('Session creation in progress');
38
+ creatingRef.current = true;
39
+ try {
40
+ await beforeSend?.();
41
+ }
42
+ catch (error) {
43
+ creatingRef.current = false;
44
+ throw error;
45
+ }
32
46
  // Identical create-first path to every other new-session entry point: the
33
47
  // composer shows a sending spinner for the create RTT (~one round trip),
34
48
  // then navigates into the instant shell, which auto-sends `text` once the
@@ -53,6 +67,7 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
53
67
  }
54
68
  catch (error) {
55
69
  errorToast(error instanceof Error ? error.message : tI18nComplete.raw('texta9c0123d9962'));
70
+ creatingRef.current = false;
56
71
  setSending(false);
57
72
  throw error;
58
73
  }
@@ -77,13 +92,11 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
77
92
  .getState()
78
93
  .setFirstPromptPreview(sessionId, text, files ?? [], uploadStatus), (error) => sentFailureMessage(error, tComposerAttachments));
79
94
  };
80
- // A refused create can still open the session: the connector gate's Retry
81
- // creates it with these same options. By then the Promise below has
82
- // rejected, so nothing after the `await` runs.
83
- let refused = false;
95
+ // The connector gate keeps this submission pending until retry or cancel.
84
96
  let optimisticId = null;
85
97
  const sessionId = await new Promise((resolve, reject) => {
86
98
  newSession({
99
+ deferConnectorRecovery: true,
87
100
  // A space draws the new thread the instant Enter is pressed; the
88
101
  // create's server row replaces it in place (same id).
89
102
  onCreating: space
@@ -123,13 +136,18 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
123
136
  // Create failed (already surfaced by the hook). Reject so the
124
137
  // composer restores its submitted draft and keeps every handle.
125
138
  onError: () => {
126
- refused = true;
127
139
  if (optimisticId)
128
140
  removeCachedProjectSession(queryClient, projectId, optimisticId);
141
+ creatingRef.current = false;
129
142
  setSending(false);
130
143
  reject(new Error('Session creation failed'));
131
144
  },
132
145
  onNavigate: (sessionId) => {
146
+ if (!space) {
147
+ draftHandoffScope.current = { kind: 'session', sessionId };
148
+ if (viewer?.id)
149
+ handoffHomeComposerFocus(sessionId, viewer.id);
150
+ }
133
151
  // PICKS only: the prompt is already a durable inbox row via
134
152
  // create.pending_prompt above. The session page's `migrateStash`
135
153
  // hands this stash off onto the resolved runtime session.
@@ -142,12 +160,6 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
142
160
  // RENDER-only copy for the boot shell, so the bubble is on screen
143
161
  // from the session page's first frame.
144
162
  useFirstPromptPreviewStore.getState().setFirstPromptPreview(sessionId, text, files ?? []);
145
- // A connector-gate Retry of a held send: hand the uploads off again
146
- // and POST from here. A ready send's create carried the prompt.
147
- if (refused && heldAttachments) {
148
- heldAttachments.resubmit();
149
- startHeldPost(heldAttachments, sessionId);
150
- }
151
163
  // A space opens the thread beside its timeline (a gate Retry too).
152
164
  space?.onOpen(sessionId);
153
165
  resolve(sessionId);
@@ -155,15 +167,17 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
155
167
  });
156
168
  });
157
169
  // A space composer stays on screen: it is ready for the next message.
158
- if (space)
170
+ if (space) {
171
+ creatingRef.current = false;
159
172
  setSending(false);
173
+ }
160
174
  if (!heldAttachments) {
161
175
  attachments?.release();
162
176
  return;
163
177
  }
164
178
  startHeldPost(heldAttachments, sessionId);
165
179
  }, [beforeSend, space, newSession, projectId, tI18nComplete, tComposerAttachments, queryClient, viewer]);
166
- return { send, sending };
180
+ return { send, sending, draftHandoffScope };
167
181
  }
168
182
  /**
169
183
  * The new thread's row in its space's cached list, before the create POST: the
@@ -1,5 +1,5 @@
1
1
  import type { NewWorkspaceFormState } from './new-workspace-form.js';
2
- export declare function AdvancedFields({ state, accountId, onChange, connectComputer, }: {
2
+ export declare function AdvancedFields({ state, accountId, noGitHubSourceAccount, onChange, connectComputer, }: {
3
3
  state: NewWorkspaceFormState;
4
4
  connectComputer?: boolean;
5
5
  /** The account the create targets — resolved by the page, which owns the
@@ -7,6 +7,9 @@ export declare function AdvancedFields({ state, accountId, onChange, connectComp
7
7
  * account-scoped, so they cannot run on `state.accountId` alone: that is
8
8
  * legitimately null for a single-account user. */
9
9
  accountId: string | null;
10
+ /** The caller owns or administers no account yet (a first workspace), so
11
+ * there is no GitHub connection to add here: say where GitHub connects. */
12
+ noGitHubSourceAccount?: boolean;
10
13
  onChange: (next: NewWorkspaceFormState) => void;
11
14
  }): import("react").JSX.Element;
12
15
  /**
@@ -55,7 +55,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
55
55
  */
56
56
  /** The `<Select>` value that opens the add-account dialog instead of picking. */
57
57
  const ADD_ACCOUNT_VALUE = '__add_github_account__';
58
- export function AdvancedFields({ state, accountId, onChange, connectComputer, }) {
58
+ export function AdvancedFields({ state, accountId, noGitHubSourceAccount = false, onChange, connectComputer, }) {
59
59
  const t = useTranslations('newWorkspace');
60
60
  const [addOpen, setAddOpen] = useState(false);
61
61
  // Same cache key the account hub's Git tab and `connected-tab.tsx` use, so
@@ -151,7 +151,7 @@ export function AdvancedFields({ state, accountId, onChange, connectComputer, })
151
151
  return (_jsx(SelectItem, { size: "md", value: option.value, children: _jsxs("span", { className: "flex items-baseline gap-2", children: [_jsx("span", { children: option.kind === 'managed'
152
152
  ? t('repository.sources.managed.label')
153
153
  : githubInstallationLabel(option.ownerLogin) }), typeLabel ? (_jsx("span", { className: "text-muted-foreground text-xs", children: typeLabel })) : null] }) }, option.value));
154
- }), accountId ? (_jsxs(_Fragment, { children: [_jsx(SelectSeparator, {}), _jsx(SelectItem, { size: "md", value: ADD_ACCOUNT_VALUE, children: _jsxs("span", { className: "flex items-center gap-2", children: [_jsx(PlusIcon, { className: "size-3.5" }), t('repository.addGitHubAccount')] }) })] })) : null] })] }), selected?.kind === 'managed' ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('repository.sources.managed.description') })) : null, installationsQuery.isError ? (_jsx("p", { className: "text-destructive text-xs", children: t('repository.loadGitHubAccountsError') })) : null] }))] }), selected?.kind === 'github' ? (_jsxs("div", { className: "flex flex-col space-y-3", children: [_jsx(Label, { htmlFor: "workspace-action", children: t('repository.label') }), _jsx(Tabs, { id: "workspace-action", value: action, onValueChange: (value) => onChange(withRepositoryAction(state, value)), children: _jsxs(TabsList, { className: "w-full", children: [_jsx(TabsTrigger, { value: "create", size: "sm", className: "flex-1", children: t('repository.actionCreate') }), _jsx(TabsTrigger, { value: "import", size: "sm", className: "flex-1", children: t('repository.actionImport') })] }) }), createNeedsAuthorization && action === 'create' ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('repository.createPersonalAuthorize') })) : null] })) : null, selected?.kind === 'github' && action === 'import' ? (
154
+ }), accountId ? (_jsxs(_Fragment, { children: [_jsx(SelectSeparator, {}), _jsx(SelectItem, { size: "md", value: ADD_ACCOUNT_VALUE, children: _jsxs("span", { className: "flex items-center gap-2", children: [_jsx(PlusIcon, { className: "size-3.5" }), t('repository.addGitHubAccount')] }) })] })) : null] })] }), selected?.kind === 'managed' ? (_jsxs("p", { className: "text-muted-foreground text-xs", children: [t('repository.sources.managed.description'), noGitHubSourceAccount ? _jsxs(_Fragment, { children: [" ", t('repository.githubAfterCreate')] }) : null] })) : null, installationsQuery.isError ? (_jsx("p", { className: "text-destructive text-xs", children: t('repository.loadGitHubAccountsError') })) : null] }))] }), selected?.kind === 'github' ? (_jsxs("div", { className: "flex flex-col space-y-3", children: [_jsx(Label, { htmlFor: "workspace-action", children: t('repository.label') }), _jsx(Tabs, { id: "workspace-action", value: action, onValueChange: (value) => onChange(withRepositoryAction(state, value)), children: _jsxs(TabsList, { className: "w-full", children: [_jsx(TabsTrigger, { value: "create", size: "sm", className: "flex-1", children: t('repository.actionCreate') }), _jsx(TabsTrigger, { value: "import", size: "sm", className: "flex-1", children: t('repository.actionImport') })] }) }), createNeedsAuthorization && action === 'create' ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('repository.createPersonalAuthorize') })) : null] })) : null, selected?.kind === 'github' && action === 'import' ? (
155
155
  // One decision — which repository, on which branch — so the two
156
156
  // fields share the in-field gap rather than the gap between fields.
157
157
  _jsxs("div", { className: "flex flex-col space-y-3", children: [_jsx(ImportRepositoryField, { state: state, accountId: accountId, onChange: onChange }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('repository.importHint') }), state.repoFullName ? (_jsxs("div", { className: "flex flex-col space-y-3", children: [_jsx(Label, { htmlFor: "workspace-branch", children: t('repository.defaultBranch') }), _jsx(ImportBranchField, { state: state, accountId: accountId, onChange: onChange })] })) : null] })) : null, selected?.kind === 'managed' && managedOperator ? (_jsxs(_Fragment, { children: [_jsx(ManagedImportField, { state: state, onChange: onChange }), state.repoFullName ? (_jsxs("div", { className: "flex flex-col space-y-3", children: [_jsx(Label, { htmlFor: "workspace-branch", children: t('repository.defaultBranch') }), _jsx(Input, { id: "workspace-branch", size: "md", value: state.defaultBranch, onChange: (event) => onChange({ ...state, defaultBranch: event.target.value }), placeholder: "main" })] })) : null] })) : null, addAccountDialog] }));
@@ -38,3 +38,12 @@ export declare function workspaceNameMessage(result: WorkspaceNameResult, touche
38
38
  * for tests.
39
39
  */
40
40
  export declare function suggestWorkspaceName(random?: () => number): string;
41
+ /**
42
+ * `/workspaces/new?name=` — the name the chooser's inline form already shows.
43
+ * "More options" carries it so the page opens on the SAME name instead of a
44
+ * second random suggestion. An invalid or absent value resolves to `null`,
45
+ * and the page keeps its own suggestion.
46
+ */
47
+ export declare function readNameParam(params: URLSearchParams): string | null;
48
+ /** `href` with `?name=` set to `name` (trimmed), keeping any other params. */
49
+ export declare function withNameParam(href: string, name: string): string;
@@ -89,3 +89,23 @@ export function suggestWorkspaceName(random = Math.random) {
89
89
  const pick = (list) => list[Math.floor(random() * list.length)];
90
90
  return `${pick(NAME_ADJECTIVES)} ${pick(NAME_NOUNS)}`;
91
91
  }
92
+ /**
93
+ * `/workspaces/new?name=` — the name the chooser's inline form already shows.
94
+ * "More options" carries it so the page opens on the SAME name instead of a
95
+ * second random suggestion. An invalid or absent value resolves to `null`,
96
+ * and the page keeps its own suggestion.
97
+ */
98
+ export function readNameParam(params) {
99
+ const result = validateWorkspaceName(params.get('name') ?? '');
100
+ return result.ok ? result.name : null;
101
+ }
102
+ /** `href` with `?name=` set to `name` (trimmed), keeping any other params. */
103
+ export function withNameParam(href, name) {
104
+ const trimmed = name.trim();
105
+ if (!trimmed)
106
+ return href;
107
+ const [path, query = ''] = href.split('?');
108
+ const params = new URLSearchParams(query);
109
+ params.set('name', trimmed);
110
+ return `${path}?${params.toString()}`;
111
+ }
@@ -1,9 +1,11 @@
1
1
  import type { ProjectSession, ProjectSessionInitiatorType } from '@kortix/sdk';
2
2
  /**
3
- * Who started the RUN a session belongs to, read from the server-derived
4
- * `initiator` (never from `created_by`: a child keeps its creator's ownership
5
- * but shows its run's starter). A row the backfill could not classify has no
6
- * initiator and reads as a member: the session's creator.
3
+ * Who started the RUN a session belongs to. The classification lives once in
4
+ * `@kortix/shared/session/session-starter` (the server-derived `initiator`:
5
+ * member/trigger/channel/api/system, "You" only when the starter is the
6
+ * viewer); this host derives the row's wording from it — `labels.you`, the
7
+ * member's name with the owner fallbacks, `labels.unknown` when nothing names
8
+ * the starter.
7
9
  */
8
10
  export interface SessionStarter {
9
11
  type: ProjectSessionInitiatorType;
@@ -1,17 +1,11 @@
1
+ import { classifySessionStarter } from '../../_vendor/kortix-shared.js';
1
2
  export function sessionStarter(session, viewerId, labels) {
2
- const initiator = session.initiator;
3
- if (!initiator || initiator.type === 'member') {
4
- const id = initiator?.id ?? session.created_by ?? null;
5
- // No initiator: fall back to the viewer-relative `is_owner`. With an
6
- // initiator, compare its id to the viewer when we know who they are.
7
- const isViewer = initiator?.id && viewerId ? initiator.id === viewerId : session.is_owner !== false;
8
- const name = initiator?.label || session.owner_name || session.owner_email || null;
9
- return { type: 'member', id, isViewer, label: isViewer ? labels.you : (name ?? labels.unknown) };
3
+ const core = classifySessionStarter(session, viewerId);
4
+ if (core.type === 'member') {
5
+ return {
6
+ ...core,
7
+ label: core.isViewer ? labels.you : core.label ?? session.owner_name ?? session.owner_email ?? labels.unknown,
8
+ };
10
9
  }
11
- return {
12
- type: initiator.type,
13
- id: initiator.id,
14
- isViewer: false,
15
- label: initiator.label || initiator.id || labels.unknown,
16
- };
10
+ return { ...core, label: core.label || core.id || labels.unknown };
17
11
  }
@@ -1,8 +1,8 @@
1
- import type { ReviewVerdict } from '@kortix/sdk';
1
+ import type { SessionAsk, ReviewVerdict } from '@kortix/sdk';
2
2
  import { type ReactNode } from 'react';
3
3
  import { type BulkResult } from './review-actions.js';
4
4
  import { type ReviewItem, type ReviewSegment } from './types.js';
5
- export declare function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChange, loadMore, onAct, onBulkAct, onOpenSession, onRecoverChange, recoveringCrId, onRefresh, isLoading, isFetching, isFetched, isError, sessionLabels, verdictAllowed, needsYouDeck, }?: {
5
+ export declare function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChange, loadMore, onAct, onBulkAct, onOpenSession, onRecoverChange, recoveringCrId, onRefresh, isLoading, isFetching, isFetched, isError, sessionLabels, verdictAllowed, needsYouDeck, sessionAsks, onSelectAsk, selectedAskId, }?: {
6
6
  /**
7
7
  * The asks deck (questions and approvals agents wait on): in the empty
8
8
  * detail pane, or above the list on a narrow inbox. It stays mounted while
@@ -12,6 +12,10 @@ export declare function ReviewCenter({ initialItems, segment: segmentProp, onSeg
12
12
  needsYouDeck?: (opts: {
13
13
  paused: boolean;
14
14
  }) => ReactNode;
15
+ /** Open session asks appear beside review items in the Needs you list. */
16
+ sessionAsks?: readonly SessionAsk[];
17
+ onSelectAsk?: (id: string) => void;
18
+ selectedAskId?: string | null;
15
19
  /** When provided, the inbox renders real data instead of the mock fixtures. */
16
20
  initialItems?: ReviewItem[];
17
21
  /** Connected mode: the segment is the server's filter, so the parent owns it. */
@@ -228,7 +228,7 @@ function useContainerWide(ref, min) {
228
228
  }, [ref, min]);
229
229
  return wide;
230
230
  }
231
- export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChange, loadMore, onAct, onBulkAct, onOpenSession, onRecoverChange, recoveringCrId, onRefresh, isLoading, isFetching, isFetched, isError, sessionLabels, verdictAllowed = EVERY_VERDICT, needsYouDeck, } = {}) {
231
+ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChange, loadMore, onAct, onBulkAct, onOpenSession, onRecoverChange, recoveringCrId, onRefresh, isLoading, isFetching, isFetched, isError, sessionLabels, verdictAllowed = EVERY_VERDICT, needsYouDeck, sessionAsks = [], onSelectAsk, selectedAskId, } = {}) {
232
232
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
233
233
  const tBulk = useTranslations('hardcodedUi.reviewBulk');
234
234
  const tSidebar = useTranslations('sidebar');
@@ -324,17 +324,28 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
324
324
  // the visible list when scoped to one session.
325
325
  const seg = items.filter((i) => segmentForStatus(i.status) === segment &&
326
326
  (sessionFilter === 'all' || (i.sessionId ?? '') === sessionFilter));
327
- const c = { all: seg.length };
327
+ const askCount = segment === 'needs_you'
328
+ ? sessionAsks.filter((ask) => sessionFilter === 'all' || ask.surface_session_id === sessionFilter).length
329
+ : 0;
330
+ const c = { all: seg.length + askCount };
328
331
  for (const i of seg)
329
332
  c[i.kind] = (c[i.kind] ?? 0) + 1;
330
333
  return c;
331
- }, [items, segment, sessionFilter]);
334
+ }, [items, segment, sessionFilter, sessionAsks]);
332
335
  // Sessions available to filter by = those present in the CURRENT segment (so
333
336
  // the dropdown only offers sessions you can actually see here).
334
337
  const sessionOpts = useMemo(() => {
335
338
  const seg = items.filter((i) => segmentForStatus(i.status) === segment);
336
- return sessionOptions(seg, labelFor);
337
- }, [items, segment, labelFor]);
339
+ const options = sessionOptions(seg, labelFor);
340
+ if (segment === 'needs_you') {
341
+ for (const ask of sessionAsks) {
342
+ if (!options.some((option) => option.sessionId === ask.surface_session_id)) {
343
+ options.push({ sessionId: ask.surface_session_id, label: ask.session_title ?? labelFor(ask.surface_session_id) ?? `Session ${ask.surface_session_id.slice(0, 8)}` });
344
+ }
345
+ }
346
+ }
347
+ return options;
348
+ }, [items, segment, labelFor, sessionAsks]);
338
349
  // The grouped view: buckets of the currently-visible items, keyed by session.
339
350
  const groups = useMemo(() => groupBySession(visible, labelFor), [visible, labelFor]);
340
351
  // Keyboard nav + focus highlight stay keyed to the flat `visible` order even in
@@ -881,28 +892,34 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
881
892
  setGrouped(false);
882
893
  };
883
894
  const back = () => setSelectedId(null);
895
+ const matchingAsksFor = (session) => segment === 'needs_you' && kindFilter === 'all'
896
+ ? sessionAsks.filter((ask) => (session === 'all' || ask.surface_session_id === session) &&
897
+ `${ask.title} ${ask.session_title ?? ''}`.toLowerCase().includes(query.toLowerCase()))
898
+ : [];
899
+ const visibleAsks = matchingAsksFor(sessionFilter);
884
900
  const listBody = isError && items.length === 0 ? (_jsx(ErrorState, { size: "sm", title: tI18nComplete.raw('text23686ff6ba91'), description: tI18nComplete.raw('text481859b689b0'), action: _jsxs(Button, { variant: "outline", size: "sm", onClick: onRefresh, disabled: isFetching, children: [isFetching ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('text942087cc2d41')] }) })) : isLoading && items.length === 0 ? (_jsx(ListSkeleton, {})) : visible.length === 0 && loadMore ? (
885
901
  // Nothing on the pages read so far matches, and more pages exist:
886
902
  // offer them, never the empty state (KRTX-1727).
887
- _jsx("div", { className: "pt-6", children: loadMoreButton })) : visible.length === 0 && segment === 'needs_you' && needsYouDeck && !query && !wide ? (
888
- // Narrow inbox: the deck above owns the Needs you empty state; an empty
889
- // list under open asks must not say "all caught up". Once the deck
890
- // draws nothing (`peer-empty`), it does.
891
- _jsx("div", { className: "hidden peer-empty:block", children: _jsx(EmptyState, { icon: CheckCircleSolid, size: "sm", title: tI18nComplete.raw('text2f485b9971df'), description: tI18nComplete.raw('text67735374cc20') }) })) : visible.length === 0 ? (_jsx(EmptyState, { icon: CheckCircleSolid, size: "sm", title: query
892
- ? tI18nComplete.raw('text2df01a03ff43')
893
- : segment === 'needs_you' && needsYouDeck
894
- ? // The asks deck beside the list still waits on you: not "all
895
- // caught up", only no review items.
896
- tI18nComplete.raw('textf4c7f41c12d6')
903
+ _jsx("div", { className: "pt-6", children: loadMoreButton })) : visible.length === 0 && wide && visibleAsks.length > 0 ? null
904
+ : visible.length === 0 && segment === 'needs_you' && needsYouDeck && !query && !wide ? (
905
+ // Narrow inbox: the deck above owns the Needs you empty state; an empty
906
+ // list under open asks must not say "all caught up". Once the deck
907
+ // draws nothing (`peer-empty`), it does.
908
+ _jsx("div", { className: "hidden peer-empty:block", children: _jsx(EmptyState, { icon: CheckCircleSolid, size: "sm", title: tI18nComplete.raw('text2f485b9971df'), description: tI18nComplete.raw('text67735374cc20') }) })) : visible.length === 0 ? (_jsx(EmptyState, { icon: CheckCircleSolid, size: "sm", title: query
909
+ ? tI18nComplete.raw('text2df01a03ff43')
910
+ : segment === 'needs_you' && needsYouDeck
911
+ ? // The asks deck beside the list still waits on you: not "all
912
+ // caught up", only no review items.
913
+ tI18nComplete.raw('textf4c7f41c12d6')
914
+ : segment === 'needs_you'
915
+ ? tI18nComplete.raw('text2f485b9971df')
916
+ : tI18nComplete.raw('textf4c7f41c12d6'), description: query
917
+ ? tI18nComplete.raw('text2e6d79de50dc')
897
918
  : segment === 'needs_you'
898
- ? tI18nComplete.raw('text2f485b9971df')
899
- : tI18nComplete.raw('textf4c7f41c12d6'), description: query
900
- ? tI18nComplete.raw('text2e6d79de50dc')
901
- : segment === 'needs_you'
902
- ? tI18nComplete.raw('text67735374cc20')
903
- : segment === 'waiting'
904
- ? tI18nComplete.raw('text2c192433a710')
905
- : tI18nComplete.raw('text6a00736dae3c') })) : grouped ? (_jsx("div", { ...listProps, className: "space-y-4", children: groups.map((g) => (_jsxs("section", { className: "space-y-1", children: [_jsxs("div", { className: "flex h-7 items-center gap-2 px-2.5", children: [_jsx("h2", { className: "text-muted-foreground truncate text-xs font-medium", children: g.label }), _jsx(CountBadge, { count: g.items.length }), g.sessionId && onOpenSession && (_jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground duration-fast ml-auto shrink-0 text-xs transition-colors", onClick: () => onOpenSession(g.sessionId), children: tI18nComplete.raw('textb205bb47f81a') }))] }), _jsx("ul", { ...listboxProps, className: LIST_CLASS, children: g.items.map((item) => renderRow(item, visibleIndexById.get(item.id) ?? 0, true)) })] }, g.sessionId ?? '__none__'))) })) : (_jsx("ul", { ...listProps, ...listboxProps, className: LIST_CLASS, children: visible.map((item, idx) => renderRow(item, idx, false)) }));
919
+ ? tI18nComplete.raw('text67735374cc20')
920
+ : segment === 'waiting'
921
+ ? tI18nComplete.raw('text2c192433a710')
922
+ : tI18nComplete.raw('text6a00736dae3c') })) : grouped ? (_jsx("div", { ...listProps, className: "space-y-4", children: groups.map((g) => (_jsxs("section", { className: "space-y-1", children: [_jsxs("div", { className: "flex h-7 items-center gap-2 px-2.5", children: [_jsx("h2", { className: "text-muted-foreground truncate text-xs font-medium", children: g.label }), _jsx(CountBadge, { count: g.items.length }), g.sessionId && onOpenSession && (_jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground duration-fast ml-auto shrink-0 text-xs transition-colors", onClick: () => onOpenSession(g.sessionId), children: tI18nComplete.raw('textb205bb47f81a') }))] }), _jsx("ul", { ...listboxProps, className: LIST_CLASS, children: g.items.map((item) => renderRow(item, visibleIndexById.get(item.id) ?? 0, true)) })] }, g.sessionId ?? '__none__'))) })) : (_jsx("ul", { ...listProps, ...listboxProps, className: LIST_CLASS, children: visible.map((item, idx) => renderRow(item, idx, false)) }));
906
923
  /** Nothing open: a quiet prompt to pick a row. */
907
924
  const paneEmpty = (_jsx("div", { className: "flex min-h-full flex-1 items-center justify-center px-6 py-8", children: _jsx(EmptyState, { media: _jsx(EmptyArt, { icon: Tray }), size: "sm", title: tPane('emptyTitle'), description: tPane('emptyDescription') }) }));
908
925
  // The detail pane: the open item, else (Needs you, wide) what the agents
@@ -941,7 +958,7 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
941
958
  }, children: _jsx(Search, { className: "size-4" }) }) }), _jsxs(DropdownMenu, { children: [_jsx(Hint, { label: tI18nComplete.raw('text638e249f4a15'), children: _jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: filtered ? 'secondary' : 'ghost', size: "icon-sm", "aria-label": tI18nComplete.raw('text638e249f4a15'), className: cn(!filtered && 'text-muted-foreground'), children: _jsx(FunnelSimple, { className: "size-4" }) }) }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-56", children: [_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [_jsx(Shapes, {}), tI18nComplete.raw('textbaaddf70fb5d')] }), _jsx(DropdownMenuSubContent, { className: "w-52", children: _jsx(DropdownMenuRadioGroup, { value: kindFilter, onValueChange: (v) => setKindFilter(v), children: kindFilters.map((f) => {
942
959
  const Glyph = f.value === 'all' ? Shapes : ROW_TILE[f.value].icon;
943
960
  return (_jsxs(DropdownMenuRadioItem, { value: f.value, side: "left", children: [_jsx(Glyph, { className: "text-muted-foreground size-4 shrink-0" }), f.label, (kindCounts[f.value] ?? 0) > 0 && (_jsx(CountBadge, { count: kindCounts[f.value] ?? 0, className: "ml-auto" }))] }, f.value));
944
- }) }) })] }), sessionOpts.length > 0 && (_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [_jsx(Chats, {}), tI18nComplete.raw('text6959b4159575')] }), _jsx(DropdownMenuSubContent, { className: "max-h-72 w-64 overflow-y-auto", children: _jsxs(DropdownMenuRadioGroup, { value: sessionFilter, onValueChange: setSessionFilter, children: [_jsxs(DropdownMenuRadioItem, { value: "all", side: "left", children: [tI18nComplete.raw('text78648d4d6649'), _jsx(CountBadge, { count: filterItems(items, segment, kindFilter, query, 'all').length, className: "ml-auto" })] }), sessionOpts.map((s) => (_jsxs(DropdownMenuRadioItem, { value: s.sessionId, side: "left", children: [_jsx("span", { className: "truncate", children: s.label }), _jsx(CountBadge, { count: filterItems(items, segment, kindFilter, query, s.sessionId).length, className: "ml-auto" })] }, s.sessionId)))] }) })] })), sessionOpts.length > 0 && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuCheckboxItem, { checked: grouped, onCheckedChange: setGrouped, className: "pl-8", children: tI18nComplete.raw('text137f98df3b9b') })] })), filtered ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: clearFilters, children: tI18nComplete.raw('text7179ea0035fc') })] })) : null] })] })] })] }), showSearch || filtered ? (_jsxs("div", { className: "border-border flex shrink-0 flex-col gap-2 border-b px-2.5 py-2", children: [showSearch ? (_jsxs(InputGroupSearch, { className: "w-full", children: [_jsx(InputGroupSearchIcon, { children: _jsx(Search, {}) }), _jsx(InputGroupSearchInput, { id: "review-search", value: query, onChange: (e) => {
961
+ }) }) })] }), sessionOpts.length > 0 && (_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [_jsx(Chats, {}), tI18nComplete.raw('text6959b4159575')] }), _jsx(DropdownMenuSubContent, { className: "max-h-72 w-64 overflow-y-auto", children: _jsxs(DropdownMenuRadioGroup, { value: sessionFilter, onValueChange: setSessionFilter, children: [_jsxs(DropdownMenuRadioItem, { value: "all", side: "left", children: [tI18nComplete.raw('text78648d4d6649'), _jsx(CountBadge, { count: filterItems(items, segment, kindFilter, query, 'all').length + matchingAsksFor('all').length, className: "ml-auto" })] }), sessionOpts.map((s) => (_jsxs(DropdownMenuRadioItem, { value: s.sessionId, side: "left", children: [_jsx("span", { className: "truncate", children: s.label }), _jsx(CountBadge, { count: filterItems(items, segment, kindFilter, query, s.sessionId).length + matchingAsksFor(s.sessionId).length, className: "ml-auto" })] }, s.sessionId)))] }) })] })), sessionOpts.length > 0 && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuCheckboxItem, { checked: grouped, onCheckedChange: setGrouped, className: "pl-8", children: tI18nComplete.raw('text137f98df3b9b') })] })), filtered ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: clearFilters, children: tI18nComplete.raw('text7179ea0035fc') })] })) : null] })] })] })] }), showSearch || filtered ? (_jsxs("div", { className: "border-border flex shrink-0 flex-col gap-2 border-b px-2.5 py-2", children: [showSearch ? (_jsxs(InputGroupSearch, { className: "w-full", children: [_jsx(InputGroupSearchIcon, { children: _jsx(Search, {}) }), _jsx(InputGroupSearchInput, { id: "review-search", value: query, onChange: (e) => {
945
962
  setQuery(e.target.value);
946
963
  setFocusedIdx(0);
947
964
  }, onBlur: () => {
@@ -950,7 +967,10 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
950
967
  }, placeholder: tI18nComplete.raw('text49c266baaaa7'), variant: "popover", size: "sm" })] })) : null, filtered ? (_jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [activeKind ? (_jsx(FilterChip, { label: activeKind.label, onRemove: () => setKindFilter('all') })) : null, activeSession ? (_jsx(FilterChip, { label: activeSession.label, onRemove: () => setSessionFilter('all') })) : null, grouped ? (_jsx(FilterChip, { label: tI18nComplete.raw('text137f98df3b9b'), onRemove: () => setGrouped(false) })) : null] })) : null] })) : null, _jsxs("div", { className: cn('min-h-0 flex-1 overflow-y-auto p-1.5', selectMode && segment === 'needs_you' && 'pb-20'), children: [segment === 'needs_you' && needsYouDeck && !wide ? (
951
968
  // `peer`: when the deck draws nothing (its Undo window after the
952
969
  // last card), the list's empty state below shows instead.
953
- _jsx("div", { className: "peer px-1 pt-1 pb-3 empty:hidden", children: needsYouDeck({ paused: !!selected }) })) : null, listBody, visible.length > 0 && loadMore ? _jsx("div", { className: "pt-2", children: loadMoreButton }) : null] }), selectMode && segment === 'needs_you' ? (
970
+ _jsx("div", { className: "peer px-1 pt-1 pb-3 empty:hidden", children: needsYouDeck({ paused: !!selected }) })) : null, wide ? visibleAsks.map((ask) => (_jsxs(Button, { "data-testid": "review-ask-row", variant: "ghost", "aria-pressed": !selected && selectedAskId === ask.id, className: cn('h-auto w-full justify-start gap-2 px-2.5 py-3 text-left whitespace-normal', !selected && selectedAskId === ask.id && 'bg-active'), onClick: () => {
971
+ setSelectedId(null);
972
+ onSelectAsk?.(ask.id);
973
+ }, children: [_jsx("span", { className: "flex size-8 shrink-0 items-center justify-center", children: _jsx(Chats, { className: "text-muted-foreground size-4" }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "line-clamp-2 text-sm font-medium", children: ask.title }), ask.session_title ? _jsx("span", { className: "text-muted-foreground block truncate text-xs", children: ask.session_title }) : null] })] }, ask.id))) : null, listBody, visible.length > 0 && loadMore ? _jsx("div", { className: "pt-2", children: loadMoreButton }) : null] }), selectMode && segment === 'needs_you' ? (
954
974
  // Pinned to the bottom of the inbox, not to the end of the list
955
975
  // (`sticky` stops where a short list ends, schedule-view.tsx), and
956
976
  // across the whole inbox: the list column is too narrow for its verbs.
@@ -61,7 +61,7 @@ export declare const SESSION_SECTIONS: {
61
61
  };
62
62
  readonly event: {
63
63
  readonly key: "section.event";
64
- readonly label: "App event";
64
+ readonly label: "Connector event";
65
65
  };
66
66
  readonly manual: {
67
67
  readonly key: "section.manual";
@@ -14,7 +14,7 @@ export const SESSION_SECTIONS = {
14
14
  email: { key: 'section.email', label: 'Email' },
15
15
  schedule: { key: 'section.scheduled', label: 'Scheduled' },
16
16
  webhook: { key: 'section.webhook', label: 'Webhook' },
17
- event: { key: 'section.event', label: 'App event' },
17
+ event: { key: 'section.event', label: 'Connector event' },
18
18
  manual: { key: 'section.manual', label: 'Manual' },
19
19
  all: { key: 'section.all', label: 'All' },
20
20
  };
@@ -6,9 +6,9 @@
6
6
  * count; Create workspace sits at the bottom of that list) · Workspace
7
7
  * settings · Invite people · Leave (only for a person who cannot open
8
8
  * Workspace settings);
9
- * 2. the person: Inbox (notifications from every workspace, KRTX-1742) ·
10
- * Preferences (Mod+,) · Apps and extensions (Chrome, the desktop app,
11
- * your computer, MCP);
9
+ * 2. the person: Inbox (the person's notifications home, every workspace —
10
+ * KRTX-1742, KRTX-4799) · Preferences (Mod+,) · Apps and extensions
11
+ * (Chrome, the desktop app, your computer, MCP);
12
12
  * 3. Help (docs, support, legal) · Log out.
13
13
  *
14
14
  * Flat: one hover deep at most (Switch workspace, Help), never two. No
@@ -29,8 +29,6 @@ export interface WorkspaceMenuGates {
29
29
  canOpenSettings: boolean;
30
30
  /** Not the last owner (`useLeaveWorkspace`). */
31
31
  canLeave: boolean;
32
- /** The host serves an Inbox page (`useInboxSummary(...).href` is set). */
33
- hasInbox: boolean;
34
32
  }
35
33
  /** The menu's groups, top to bottom; a separator sits between two groups. */
36
34
  export declare function workspaceMenuGroups(gates: WorkspaceMenuGates): WorkspaceMenuRow[][];
@@ -7,7 +7,7 @@ export function workspaceMenuGroups(gates) {
7
7
  ...(gates.canInvite ? ['invite'] : []),
8
8
  ...(gates.canLeave && !gates.canOpenSettings ? ['leave'] : []),
9
9
  ],
10
- [...(gates.hasInbox ? ['inbox'] : []), 'preferences', 'apps'],
10
+ ['inbox', 'preferences', 'apps'],
11
11
  ['help', 'logout'],
12
12
  ];
13
13
  }
@@ -10,7 +10,7 @@ import { useTriggerControls } from '../../customize/triggers/schedule/trigger-co
10
10
  import { useTranslations } from '../../i18n/index.js';
11
11
  import { Close } from '../../icons/close.js';
12
12
  import { AgentMark } from '../../internal/components/agent-mark.js';
13
- import { uiRoutes } from '../../lib/routes.js';
13
+ import { triggerHref } from '../../internal/lib/capability-tab-routes.js';
14
14
  import { Button } from '../../primitives/button.js';
15
15
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, } from '../../primitives/dropdown-menu.js';
16
16
  import Hint from '../../primitives/hint.js';
@@ -139,7 +139,7 @@ function RoutinesSection({ projectId, space }) {
139
139
  setCreating(false);
140
140
  void queryClient.invalidateQueries({ queryKey: qk.project.triggers(projectId) });
141
141
  } })] })) : null;
142
- return (_jsxs(Section, { title: t('routines'), add: add, children: [routines.map((trigger) => (_jsx(Row, { avatar: _jsx(LightningIcon, { className: "text-muted-foreground size-4" }), name: triggerName(trigger), tag: describeWhen(trigger), href: uiRoutes().customize(projectId, `triggers?id=${encodeURIComponent(trigger.slug)}`) }, trigger.slug))), privateChannel && routines.length === 0 ? (_jsx("li", { className: "text-muted-foreground px-2 py-1 text-xs text-pretty", children: t('routinesPrivate') })) : null] }));
142
+ return (_jsxs(Section, { title: t('routines'), add: add, children: [routines.map((trigger) => (_jsx(Row, { avatar: _jsx(LightningIcon, { className: "text-muted-foreground size-4" }), name: triggerName(trigger), tag: describeWhen(trigger), href: triggerHref(projectId, trigger.slug) }, trigger.slug))), privateChannel && routines.length === 0 ? (_jsx("li", { className: "text-muted-foreground px-2 py-1 text-xs text-pretty", children: t('routinesPrivate') })) : null] }));
143
143
  }
144
144
  /** The browser's IANA zone, for the daily brief; UTC when it has none. */
145
145
  function browserTimeZone() {
@@ -10,7 +10,7 @@ import { TriggerComposer } from '../../customize/triggers/schedule/trigger-compo
10
10
  import { lastRunLabel } from '../../internal/lib/trigger-clock.js';
11
11
  import { TriggerTile } from '../../customize/triggers/schedule/trigger-tile.js';
12
12
  import { useLocale, useTranslations } from '../../i18n/index.js';
13
- import { uiRoutes } from '../../lib/routes.js';
13
+ import { triggerHref } from '../../internal/lib/capability-tab-routes.js';
14
14
  import { Button } from '../../primitives/button.js';
15
15
  import { EmptyArt } from '../../primitives/empty-art.js';
16
16
  import { EmptyState } from '../../primitives/empty-state.js';
@@ -64,7 +64,7 @@ function TriggerRow({ projectId, trigger, projectPaused, canUpdate, onToggle, })
64
64
  const subtitle = triggerSubtitle(name, describeWhen(trigger), trigger.prompt_template);
65
65
  // An auto-paused trigger is off until resumed: turning it on sends `enabled: true`, which resumes it.
66
66
  const active = trigger.enabled && !trigger.auto_paused_at;
67
- const href = uiRoutes().customize(projectId, `triggers?id=${encodeURIComponent(trigger.slug)}`);
67
+ const href = triggerHref(projectId, trigger.slug);
68
68
  const toggle = (enabled) => {
69
69
  setPending(true);
70
70
  onToggle(enabled)
@@ -390,13 +390,19 @@ function SpaceComposer({ projectId, space, onOpenThread, onAutoOpenThread, befor
390
390
  useEffect(() => {
391
391
  if (!pendingPrefill)
392
392
  return;
393
- consumePrefill(projectId);
393
+ // Apply what `consume` returns, never the render-time snapshot: the
394
+ // typing buffer may have dropped the entry since this render (another
395
+ // account signed in on the tab), and a dropped entry must not land.
396
+ const taken = consumePrefill(projectId);
397
+ if (!taken)
398
+ return;
394
399
  setPrefill({
395
- text: pendingPrefill.text,
400
+ text: taken.text,
396
401
  id: Date.now(),
397
- submit: pendingPrefill.submit,
398
- files: pendingPrefill.files,
399
- options: pendingPrefill.options,
402
+ submit: taken.submit,
403
+ files: taken.files,
404
+ options: taken.options,
405
+ restoreDraft: taken.restoreDraft,
400
406
  });
401
407
  }, [pendingPrefill, projectId, consumePrefill]);
402
408
  const onCommand = useCallback((command, args, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kortix/ui",
3
- "version": "0.15.9",
3
+ "version": "0.15.11",
4
4
  "description": "Kortix UI: the shared React component library for apps/web, Kortix Apps and SDK hosts. Tailwind v4 classes, themed by CSS variables.",
5
5
  "type": "module",
6
6
  "license": "Elastic-2.0",
@@ -1003,6 +1003,10 @@
1003
1003
  "types": "./dist/internal/icons/claude.d.ts",
1004
1004
  "import": "./dist/internal/icons/claude.js"
1005
1005
  },
1006
+ "./internal/icons/codex": {
1007
+ "types": "./dist/internal/icons/codex.d.ts",
1008
+ "import": "./dist/internal/icons/codex.js"
1009
+ },
1006
1010
  "./internal/icons/discord": {
1007
1011
  "types": "./dist/internal/icons/discord.d.ts",
1008
1012
  "import": "./dist/internal/icons/discord.js"
@@ -1267,10 +1271,6 @@
1267
1271
  "types": "./dist/internal/notifications/session-toast-cards.d.ts",
1268
1272
  "import": "./dist/internal/notifications/session-toast-cards.js"
1269
1273
  },
1270
- "./internal/notifications/use-inbox-summary": {
1271
- "types": "./dist/internal/notifications/use-inbox-summary.d.ts",
1272
- "import": "./dist/internal/notifications/use-inbox-summary.js"
1273
- },
1274
1274
  "./internal/notifications/web-push": {
1275
1275
  "types": "./dist/internal/notifications/web-push.d.ts",
1276
1276
  "import": "./dist/internal/notifications/web-push.js"
@@ -1661,6 +1661,10 @@
1661
1661
  "types": "./dist/session/models/ask-owner-for-credits-button.d.ts",
1662
1662
  "import": "./dist/session/models/ask-owner-for-credits-button.js"
1663
1663
  },
1664
+ "./session/models/connect-model-step": {
1665
+ "types": "./dist/session/models/connect-model-step.d.ts",
1666
+ "import": "./dist/session/models/connect-model-step.js"
1667
+ },
1664
1668
  "./session/models/model-grouping": {
1665
1669
  "types": "./dist/session/models/model-grouping.d.ts",
1666
1670
  "import": "./dist/session/models/model-grouping.js"
@@ -1673,6 +1677,10 @@
1673
1677
  "types": "./dist/session/models/model-selector.d.ts",
1674
1678
  "import": "./dist/session/models/model-selector.js"
1675
1679
  },
1680
+ "./session/models/use-workspace-model-gate": {
1681
+ "types": "./dist/session/models/use-workspace-model-gate.d.ts",
1682
+ "import": "./dist/session/models/use-workspace-model-gate.js"
1683
+ },
1676
1684
  "./session/panel/audit/audit-credential-label": {
1677
1685
  "types": "./dist/session/panel/audit/audit-credential-label.d.ts",
1678
1686
  "import": "./dist/session/panel/audit/audit-credential-label.js"
@@ -2202,7 +2210,7 @@
2202
2210
  "@extend-ai/react-docx": "^0.7.5",
2203
2211
  "@extend-ai/react-xlsx": "0.13.4",
2204
2212
  "@glideapps/glide-data-grid": "6.0.4-alpha24",
2205
- "@kortix/llm-catalog": "0.15.9",
2213
+ "@kortix/llm-catalog": "0.15.11",
2206
2214
  "@lezer/highlight": "1.2.3",
2207
2215
  "@paper-design/shaders-react": "^0.0.76",
2208
2216
  "@phosphor-icons/react": "2.1.10",
@@ -2277,7 +2285,7 @@
2277
2285
  "zustand": "^5.0.3"
2278
2286
  },
2279
2287
  "peerDependencies": {
2280
- "@kortix/sdk": "^0.15.9",
2288
+ "@kortix/sdk": "^0.15.11",
2281
2289
  "@tanstack/react-query": "^5.75.2",
2282
2290
  "@types/react": ">=18",
2283
2291
  "react": ">=19",
@@ -328,7 +328,7 @@ export function Chat({ projectId, sessionId }: { projectId: string; sessionId: s
328
328
  }
329
329
  ```
330
330
 
331
- Names: `SessionThread`, `SessionThreadProps`, `UserMessage`, `ThrottledMarkdown`, `UnifiedMarkdown`, `UnifiedMarkdownProps`, `ToolPartRenderer`, `ToolRegistry`, `BasicToolProps`, `ToolComponent`, `ToolProps`, `BasicTool`, `GenericTool`, `SessionChatInput`, `SessionChatInputProps`, `AgentSelector`, `ModelSelector`, `ModelSelectorProps`, `ModelReasoningControls`, `SessionPermissionPrompt`, `QuestionPrompt`, `QuestionPromptHandle`, `TurnErrorDisplay`, `SessionBusyIndicator`, `SessionStartingLoader`, `SessionStatus`, `UNTITLED_SESSION_LABEL`, `getSessionDisplayTitle`, `groupChangeRequestsBySession`, `hasSessionAwaitingTitle`, `isAwaitingTitle`, `projectSessionsRefetchInterval`, `resolveSessionListViewState`, `sessionLastActivityAt`, `sessionTitleHasLanded`, `shortRelative`, `sortSessionsByLastActivity`, `starterSectionOf`, `SessionDeleteModal`, `isLegacyMigratedSession`, `matchesSourceFilters`, `matchesStatusFilters`, `sessionDisplayLabel`, `sessionSource`, `SessionSourceFilter`, `useRenameSession`, `useSessionListActions`, `CompactModal`, `ProviderFailureRecovery`, `useModelConnectionGate`, `ApprovalAgentContext`, `ApprovalDecisionActions`, `ApprovalParameters`, `approvalReviewable`, `useApprovalWaitingText`, `SessionApprovalNotice`, `createScopedSession`, `SandboxLoadingBoundary`, `SessionNoticeBanner`, `SessionConnectingBanner`, `ChatMinimap`, `SessionChat`, `SessionTurn`, `TranscriptTurnRow`, `TurnAssistantBlock`, `ToolSurfaceContext`, `partOutcome`, `ToolOutcomeContext`, `ToolOutputFallback`, `ServicePreviewActions`, `ServicePreviewState`, `ServicePreviewViewport`, `ToolActivateContext`, `TurnLiveContext`, `ActivityBurst`, `PlanCard`, `TurnViewport`, `ATTACHMENT_TILE_CAP`, `BUBBLE_SURFACE`, `ChannelOrigin`, `UserMessageBubble`, `mergeSentAttachments`, `normalizeAttachments`, `planAttachmentGrid`, `ChannelMessage`, `NormalizedAttachment`
331
+ Names: `SessionThread`, `SessionThreadProps`, `UserMessage`, `ThrottledMarkdown`, `UnifiedMarkdown`, `UnifiedMarkdownProps`, `ToolPartRenderer`, `ToolRegistry`, `BasicToolProps`, `ToolComponent`, `ToolProps`, `BasicTool`, `GenericTool`, `SessionChatInput`, `SessionChatInputProps`, `AgentSelector`, `ModelSelector`, `ModelSelectorProps`, `ModelReasoningControls`, `SessionPermissionPrompt`, `QuestionPrompt`, `QuestionPromptHandle`, `TurnErrorDisplay`, `SessionBusyIndicator`, `SessionStartingLoader`, `SessionStatus`, `UNTITLED_SESSION_LABEL`, `getSessionDisplayTitle`, `groupChangeRequestsBySession`, `hasSessionAwaitingTitle`, `isAwaitingTitle`, `projectSessionsRefetchInterval`, `resolveSessionListViewState`, `sessionLastActivityAt`, `sessionTitleHasLanded`, `shortRelative`, `sortSessionsByLastActivity`, `starterSectionOf`, `SessionDeleteModal`, `isLegacyMigratedSession`, `matchesSourceFilters`, `matchesStatusFilters`, `sessionDisplayLabel`, `sessionSource`, `SessionSourceFilter`, `useRenameSession`, `useSessionListActions`, `CompactModal`, `ProviderFailureRecovery`, `useModelConnectionGate`, `ApprovalAgentContext`, `ApprovalDecisionActions`, `ApprovalParameters`, `approvalReviewable`, `useApprovalWaitingText`, `SessionApprovalNotice`, `createScopedSession`, `SandboxLoadingBoundary`, `SessionNoticeBanner`, `SessionConnectingBanner`, `ChatMinimap`, `SessionChat`, `useAgentRunLayout`, `AgentRunLayout`, `AgentRunRowProps`, `SessionTurn`, `TranscriptTurnRow`, `TurnAssistantBlock`, `ToolSurfaceContext`, `partOutcome`, `ToolOutcomeContext`, `ToolOutputFallback`, `ServicePreviewActions`, `ServicePreviewState`, `ServicePreviewViewport`, `ToolActivateContext`, `TurnLiveContext`, `ActivityBurst`, `PlanCard`, `TurnViewport`, `ATTACHMENT_TILE_CAP`, `BUBBLE_SURFACE`, `ChannelOrigin`, `UserMessageBubble`, `mergeSentAttachments`, `normalizeAttachments`, `planAttachmentGrid`, `ChannelMessage`, `NormalizedAttachment`
332
332
 
333
333
  ## `@kortix/ui/session-panel`
334
334
 
@@ -1,2 +0,0 @@
1
- import type { QueryClient } from '@tanstack/react-query';
2
- export declare function invalidateConnections(client: QueryClient, projectId: string): Promise<(void | undefined)[]>;