@kortix/ui 0.15.4 → 0.15.6

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.
@@ -48,6 +48,10 @@ export function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs,
48
48
  : tSharing('visibilityEveryone');
49
49
  const [url, setUrl] = useState(app?.url ?? initial?.url ?? '');
50
50
  const [audience, setAudience] = useState({ audience: 'private', picked: NO_PICKS });
51
+ // The phase running while Connect is pending: a slow server can stretch the
52
+ // serial phases to minutes, and the wait must say what it is waiting on
53
+ // (KRTX-4640).
54
+ const [stage, setStage] = useState(null);
51
55
  // The catalogue app's own server, unchanged: named after the app, and its
52
56
  // sign-in is known to be one click (`mcpServerFor`).
53
57
  const appServer = app !== null && url.trim() === app.url;
@@ -69,7 +73,7 @@ export function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs,
69
73
  grantees: newAccountGrantees(audience.picked),
70
74
  takenSlugs,
71
75
  returnUrl: (slug) => `${window.location.origin}${connectorHref(projectId, slug)}`,
72
- }, sdkAddMcpServerDeps(accountId)),
76
+ }, { ...sdkAddMcpServerDeps(accountId), onStage: setStage }),
73
77
  onSuccess: (result) => {
74
78
  onAdded();
75
79
  if (result.signInUrl) {
@@ -110,11 +114,12 @@ export function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs,
110
114
  setUrl(app?.url ?? '');
111
115
  setNameEdit(null);
112
116
  setAudience({ audience: 'private', picked: NO_PICKS });
117
+ setStage(null);
113
118
  }
114
119
  };
115
120
  return (_jsx(Modal, { open: open, onOpenChange: close, children: _jsxs(ModalContent, { className: "lg:max-w-md", children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: app ? t('addMcpAppTitle', { name: app.name }) : t('addMcpTitle') }), _jsx(ModalDescription, { children: app ? t('addMcpAppDescription', { name: app.name }) : t('addMcpDescription') })] }), _jsxs("form", { onSubmit: (event) => {
116
121
  event.preventDefault();
117
122
  if (canSubmit)
118
123
  add.mutate();
119
- }, children: [_jsxs(ModalBody, { className: "max-h-[60vh] space-y-4 overflow-y-auto", children: [app ? null : (_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: `${id}-url`, children: t('addMcpUrlLabel') }), _jsx(Input, { id: `${id}-url`, type: "url", inputMode: "url", autoComplete: "off", spellCheck: false, value: url, onChange: (event) => setUrl(event.target.value), placeholder: "https://mcp.example.com/mcp", "aria-invalid": urlInvalid || undefined, disabled: add.isPending, autoFocus: !app }), urlInvalid ? (_jsx(FieldDescription, { className: "text-destructive", role: "alert", children: t('addMcpUrlInvalid') })) : (_jsx(FieldDescription, { children: t('addMcpUrlHint') }))] })), app && nameEdit === null ? null : (_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: `${id}-name`, children: t('installNameLabel') }), _jsx(Input, { id: `${id}-name`, value: nameEdit ?? identity?.name ?? '', onChange: (event) => setNameEdit(event.target.value), autoComplete: "off", disabled: add.isPending || identity === null }), _jsx(FieldDescription, { children: t('installProfileHint') })] })), _jsx(AudienceFields, { projectId: projectId, value: audience, onChange: setAudience, canShare: canManageConnections, accountId: accountId, everyoneLabel: everyoneLabel, shareRequiresLabel: tSharing('shareRequiresManage'), disabled: add.isPending })] }), _jsxs(ModalFooter, { className: "sm:justify-between", children: [app && nameEdit === null ? (_jsx(Button, { type: "button", variant: "text", size: "sm", className: "px-0", onClick: () => setNameEdit(identity?.name ?? app.name), disabled: add.isPending, children: t('installRename') })) : null, _jsx(Button, { type: "button", variant: "outline-ghost", className: app && nameEdit === null ? 'sm:ml-auto' : undefined, onClick: () => close(false), disabled: add.isPending, children: tI18nComplete.raw('text19766ed6ccb2') }), _jsxs(Button, { type: "submit", disabled: !canSubmit, children: [add.isPending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, t('addMcpConnect')] })] })] })] }) }));
124
+ }, children: [_jsxs(ModalBody, { className: "max-h-[60vh] space-y-4 overflow-y-auto", children: [app ? null : (_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: `${id}-url`, children: t('addMcpUrlLabel') }), _jsx(Input, { id: `${id}-url`, type: "url", inputMode: "url", autoComplete: "off", spellCheck: false, value: url, onChange: (event) => setUrl(event.target.value), placeholder: "https://mcp.example.com/mcp", "aria-invalid": urlInvalid || undefined, disabled: add.isPending, autoFocus: !app }), urlInvalid ? (_jsx(FieldDescription, { className: "text-destructive", role: "alert", children: t('addMcpUrlInvalid') })) : (_jsx(FieldDescription, { children: t('addMcpUrlHint') }))] })), app && nameEdit === null ? null : (_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: `${id}-name`, children: t('installNameLabel') }), _jsx(Input, { id: `${id}-name`, value: nameEdit ?? identity?.name ?? '', onChange: (event) => setNameEdit(event.target.value), autoComplete: "off", disabled: add.isPending || identity === null }), _jsx(FieldDescription, { children: t('installProfileHint') })] })), _jsx(AudienceFields, { projectId: projectId, value: audience, onChange: setAudience, canShare: canManageConnections, accountId: accountId, everyoneLabel: everyoneLabel, shareRequiresLabel: tSharing('shareRequiresManage'), disabled: add.isPending }), add.isPending && stage ? (_jsx(FieldDescription, { role: "status", "aria-live": "polite", children: t(stage === 'connector' ? 'addMcpStageConnector' : stage === 'account' ? 'addMcpStageAccount' : 'addMcpStageSignIn') })) : null] }), _jsxs(ModalFooter, { className: "sm:justify-between", children: [app && nameEdit === null ? (_jsx(Button, { type: "button", variant: "text", size: "sm", className: "px-0", onClick: () => setNameEdit(identity?.name ?? app.name), disabled: add.isPending, children: t('installRename') })) : null, _jsx(Button, { type: "button", variant: "outline-ghost", className: app && nameEdit === null ? 'sm:ml-auto' : undefined, onClick: () => close(false), disabled: add.isPending, children: tI18nComplete.raw('text19766ed6ccb2') }), _jsxs(Button, { type: "submit", disabled: !canSubmit, children: [add.isPending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, t('addMcpConnect')] })] })] })] }) }));
120
125
  }
@@ -20,7 +20,14 @@ export type Grantee = {
20
20
  type: 'user' | 'group' | 'service_account';
21
21
  id: string;
22
22
  };
23
+ /** What `addMcpServer` is doing while the Connect press runs. Each stage is a
24
+ * serial network phase (create+sync, account, sign-in discovery) that a slow
25
+ * server can stretch to minutes — the dialog shows it instead of a spinner
26
+ * alone (KRTX-4640). */
27
+ export type AddMcpStage = 'connector' | 'account' | 'sign-in';
23
28
  export interface AddMcpServerDeps {
29
+ /** Surfaces the current phase while the mutation is pending. */
30
+ onStage?: (stage: AddMcpStage) => void;
24
31
  /** Creates the connector and runs its first sync (`createConnectorWithOptionalOAuth2`). */
25
32
  createConnector: (projectId: string, draft: ConnectorDraftInput) => Promise<{
26
33
  syncError: string | null;
@@ -60,6 +60,7 @@ export async function addMcpServer(projectId, input, deps) {
60
60
  if (!identity)
61
61
  throw new Error('Enter the MCP server URL, starting with https://');
62
62
  const { slug, name } = identity;
63
+ deps.onStage?.('connector');
63
64
  const created = await deps.createConnector(projectId, {
64
65
  slug,
65
66
  name,
@@ -70,6 +71,7 @@ export async function addMcpServer(projectId, input, deps) {
70
71
  // A slug another connector already has answers 409; it never replaces that connector.
71
72
  create_only: true,
72
73
  });
74
+ deps.onStage?.('account');
73
75
  const account = input.audience === 'private'
74
76
  ? await deps.createMemberAccount(projectId, { connector_alias: slug, label: name })
75
77
  : await deps.projectAccount(projectId, slug, name);
@@ -87,6 +89,7 @@ export async function addMcpServer(projectId, input, deps) {
87
89
  // The connector and its account exist either way: a sign-in that cannot
88
90
  // start says why, and the connector page retries it.
89
91
  try {
92
+ deps.onStage?.('sign-in');
90
93
  const signInUrl = await deps.startSignIn(projectId, connectionId, input.returnUrl(slug));
91
94
  // No one-click sign-in: the 401 stays, and the connector page asks for a credential.
92
95
  const syncError = signInUrl ? null : created.syncError;
package/dist/i18n/en.d.ts CHANGED
@@ -6813,6 +6813,9 @@ declare const catalog: {
6813
6813
  addMcpUrlNamed: string;
6814
6814
  addMcpUrlInvalid: string;
6815
6815
  addMcpConnect: string;
6816
+ addMcpStageConnector: string;
6817
+ addMcpStageAccount: string;
6818
+ addMcpStageSignIn: string;
6816
6819
  addMcpConnected: string;
6817
6820
  addMcpSignInFailed: string;
6818
6821
  addMcpFailed: string;
package/dist/i18n/en.js CHANGED
@@ -1585,15 +1585,15 @@ const catalog = {
1585
1585
  "title": "Threads",
1586
1586
  "newThread": "New Thread",
1587
1587
  "sendMessage": "Send message",
1588
- "queueList": "Queue List",
1588
+ "queueList": "Waiting messages",
1589
1589
  "quoteCount": "{count, plural, one {# Quote} other {# Quotes}}",
1590
1590
  "expandQuotes": "Expand quotes",
1591
1591
  "collapseQuotes": "Collapse quotes",
1592
1592
  "stopUnconfirmed": "Could not confirm Stop. The agent may still be running. Try Stop again.",
1593
1593
  "stoppedBy": "Stopped by {name}",
1594
- "queued": "Queued",
1594
+ "queued": "Waiting",
1595
1595
  "queuedFiles": "{count, plural, one {# file} other {# files}}",
1596
- "queuedCount": "{count} Queued",
1596
+ "queuedCount": "{count} waiting",
1597
1597
  "editingQueued": "Editing",
1598
1598
  "queuedActions": "Message actions",
1599
1599
  "steerNextStep": "Read at next step",
@@ -1602,11 +1602,11 @@ const catalog = {
1602
1602
  "steerFallbackUnsupported": "Waits for this turn. This session cannot take messages mid-turn.",
1603
1603
  "steerFallbackNotPrompter": "Waits for this turn. Another member started it.",
1604
1604
  "steerFallbackTurnEnded": "Runs as its own turn. The turn ended first.",
1605
- "stopAndSend": "Stop and send",
1606
- "stopAndSendFailed": "Could not stop and send that message",
1605
+ "stopAndSend": "Send now",
1606
+ "stopAndSendFailed": "Could not send that message now",
1607
1607
  "submitEdit": "Submit",
1608
- "collapseQueue": "Collapse queue",
1609
- "expandQueue": "Expand queue",
1608
+ "collapseQueue": "Collapse waiting messages",
1609
+ "expandQueue": "Expand waiting messages",
1610
1610
  "placeholder": "Type your message...",
1611
1611
  "messageInput": "Message input",
1612
1612
  "attachFiles": "Attach files",
@@ -6814,6 +6814,9 @@ const catalog = {
6814
6814
  "addMcpUrlNamed": "Adds the connector {name}.",
6815
6815
  "addMcpUrlInvalid": "Enter a URL that starts with https://",
6816
6816
  "addMcpConnect": "Connect",
6817
+ "addMcpStageConnector": "Reaching the server and loading its tools…",
6818
+ "addMcpStageAccount": "Preparing the account…",
6819
+ "addMcpStageSignIn": "Starting the sign-in…",
6817
6820
  "addMcpConnected": "{name} is connected. Agents can use its tools.",
6818
6821
  "addMcpSignInFailed": "Could not start the {name} sign-in: {reason}",
6819
6822
  "addMcpFailed": "Could not add the MCP server",
@@ -48,8 +48,7 @@ export interface QueueRow {
48
48
  steer?: true;
49
49
  /** Why a steer prompt waits for the turn to end instead. */
50
50
  steerFallback?: SessionPromptSteerFallback;
51
- /** "Stop and send" can turn it into Quick Queue: it is still waiting and
52
- * not yet on the wire. */
51
+ /** "Send now" can send it next: it is still waiting and not yet on the wire. */
53
52
  interruptible: boolean;
54
53
  /** A `/` command held in this tab until the session can run it
55
54
  * (`held-commands.ts`). Not an inbox row. */
@@ -91,14 +90,17 @@ export declare function projectQueueRows(input: {
91
90
  viewer?: SessionPromptViewer;
92
91
  }): QueueProjection;
93
92
  /**
94
- * How a composer send reaches the session (D9.1).
93
+ * How a composer send reaches the session. One mode (2026-11-04):
95
94
  *
96
- * - Enter while a turn runs: `steer`. The running turn reads it at its next
97
- * step. It waits in the list above the composer until the transcript has it.
98
- * - Cmd/Ctrl+Enter (`composer`): `queue` (Queue List).
99
- * - Enter while idle: unchanged. It starts a turn and paints in the transcript.
95
+ * - While a turn runs: `steer`. The running turn reads it after its current
96
+ * tool call. It waits in the list above the composer until the transcript
97
+ * has it.
98
+ * - While idle: it starts a turn and paints in the transcript.
99
+ *
100
+ * Enter and Cmd/Ctrl+Enter send the same way; `placement` is ignored. The
101
+ * server delivers every prompt as a steer whatever a client asks for.
100
102
  */
101
- export declare function composerSendDelivery(placement: 'transcript' | 'composer', busy: boolean): {
103
+ export declare function composerSendDelivery(_placement: 'transcript' | 'composer', busy: boolean): {
102
104
  placement: 'transcript' | 'composer';
103
105
  delivery?: SessionPromptDelivery;
104
106
  };
@@ -131,15 +131,16 @@ export function projectQueueRows(input) {
131
131
  return { rows, heldCount };
132
132
  }
133
133
  /**
134
- * How a composer send reaches the session (D9.1).
134
+ * How a composer send reaches the session. One mode (2026-11-04):
135
135
  *
136
- * - Enter while a turn runs: `steer`. The running turn reads it at its next
137
- * step. It waits in the list above the composer until the transcript has it.
138
- * - Cmd/Ctrl+Enter (`composer`): `queue` (Queue List).
139
- * - Enter while idle: unchanged. It starts a turn and paints in the transcript.
136
+ * - While a turn runs: `steer`. The running turn reads it after its current
137
+ * tool call. It waits in the list above the composer until the transcript
138
+ * has it.
139
+ * - While idle: it starts a turn and paints in the transcript.
140
+ *
141
+ * Enter and Cmd/Ctrl+Enter send the same way; `placement` is ignored. The
142
+ * server delivers every prompt as a steer whatever a client asks for.
140
143
  */
141
- export function composerSendDelivery(placement, busy) {
142
- if (placement === 'composer')
143
- return { placement, delivery: 'queue' };
144
- return busy ? { placement: 'composer', delivery: 'steer' } : { placement };
144
+ export function composerSendDelivery(_placement, busy) {
145
+ return busy ? { placement: 'composer', delivery: 'steer' } : { placement: 'transcript' };
145
146
  }
@@ -250,8 +250,8 @@ function planSend({ text, files, options, attachments, projectId, sessionId, sub
250
250
  // through its delivery chain: a text-only send never overtakes an upload.
251
251
  //
252
252
  // The first send starts the session. A send typed while the first boots
253
- // is an inbox row carrying its queue placement, drawn as a Quick Queue
254
- // bubble or a Queue List row until the row lists it.
253
+ // is an inbox row carrying its placement, drawn as a transcript bubble or
254
+ // a waiting row above the composer until the row lists it.
255
255
  //
256
256
  // One exception: a first send that is not detached (no uploads, nothing
257
257
  // earlier still delivering) paints after its POST. The hero composer that
@@ -1217,8 +1217,8 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
1217
1217
  },
1218
1218
  // eslint-disable-next-line react-hooks/exhaustive-deps
1219
1219
  [promptInbox.retry]);
1220
- // "Stop and send": the waiting row becomes Quick Queue. The running turn
1221
- // ends after its running tool, then this row runs.
1220
+ // "Send now": the waiting row goes next, ahead of older waiting rows, and
1221
+ // steers the running turn. The turn does not stop.
1222
1222
  const handleStopAndSendQueuedMessage = useCallback((id) => {
1223
1223
  void promptInbox
1224
1224
  .interrupt(id)
@@ -1536,7 +1536,7 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
1536
1536
  return (liveQuestions.some((q) => q.id === renderedQuestion.id) ||
1537
1537
  parkedAskIdByRequest.has(renderedQuestion.id));
1538
1538
  }, [renderedQuestion, liveQuestions, parkedAskIdByRequest]);
1539
- // Quick Queue entries share the turn renderer. The inbox marks their IDs as
1539
+ // Transcript-placed waiting entries share the turn renderer. The inbox marks their IDs as
1540
1540
  // pending until delivery; a client-minted wire ID does not place a message.
1541
1541
  // Each is the user message `sessionLogPromptMessage` mints for its prompt.
1542
1542
  const queuedSyntheticMessages = useMemo(() => {
@@ -2394,8 +2394,9 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
2394
2394
  }
2395
2395
  const placement = overrides?.placement ?? 'transcript';
2396
2396
  const delivery = overrides?.delivery;
2397
- // Placement decides WHERE the send waits: Quick Queue paints its bubble in
2398
- // the transcript now, Queue List draws a row above the composer. Busy
2397
+ // Placement decides WHERE the send waits: an idle send paints its bubble
2398
+ // in the transcript now, a send into a running turn draws a row above the
2399
+ // composer until the turn reads it. Busy
2399
2400
  // state or earlier live rows decide only whether it waits at all.
2400
2401
  const willQueue = isBusyRef.current || promptInbox.prompts.some((prompt) => prompt.state !== 'failed');
2401
2402
  const paintTranscript = placement === 'transcript';
@@ -3967,7 +3968,7 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
3967
3968
  autoFocus: deferComposerFocus || !composerAutoFocus ? false : undefined, onSend: async (text, files, mentions, attachments, placement) => {
3968
3969
  if (await queueEdit.save(text))
3969
3970
  return;
3970
- // Enter while a turn runs steers it (D9.1); Cmd/Ctrl+Enter is Queue List.
3971
+ // Enter or Cmd/Ctrl+Enter while a turn runs steers it (one delivery mode).
3971
3972
  await handleSend(text, files, mentions, attachments, composerSendDelivery(placement ?? 'transcript', isBusyRef.current));
3972
3973
  }, prefill: composerPrefill, onPrefillApplied: (id) => {
3973
3974
  useSessionComposerPrefillStore.getState().clearPrefill(sessionId, id);
@@ -6822,6 +6822,9 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
6822
6822
  addMcpUrlNamed: string;
6823
6823
  addMcpUrlInvalid: string;
6824
6824
  addMcpConnect: string;
6825
+ addMcpStageConnector: string;
6826
+ addMcpStageAccount: string;
6827
+ addMcpStageSignIn: string;
6825
6828
  addMcpConnected: string;
6826
6829
  addMcpSignInFailed: string;
6827
6830
  addMcpFailed: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kortix/ui",
3
- "version": "0.15.4",
3
+ "version": "0.15.6",
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",
@@ -2197,7 +2197,7 @@
2197
2197
  "@extend-ai/react-docx": "^0.7.5",
2198
2198
  "@extend-ai/react-xlsx": "0.13.4",
2199
2199
  "@glideapps/glide-data-grid": "6.0.4-alpha24",
2200
- "@kortix/llm-catalog": "0.15.4",
2200
+ "@kortix/llm-catalog": "0.15.6",
2201
2201
  "@lezer/highlight": "1.2.3",
2202
2202
  "@paper-design/shaders-react": "^0.0.76",
2203
2203
  "@phosphor-icons/react": "2.1.10",
@@ -2296,7 +2296,7 @@
2296
2296
  "yaml": "^2.8.2"
2297
2297
  },
2298
2298
  "peerDependencies": {
2299
- "@kortix/sdk": "^0.15.4",
2299
+ "@kortix/sdk": "^0.15.6",
2300
2300
  "@tanstack/react-query": "^5.75.2",
2301
2301
  "@types/react": ">=18",
2302
2302
  "react": ">=19",