@kortix/ui 0.15.3 → 0.15.5
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.
- package/dist/_vendor/kortix-shared.js +87 -29
- package/dist/_vendor/shared/markdown-math.d.ts +6 -0
- package/dist/customize/agents/agent-drives-section.d.ts +1 -3
- package/dist/customize/agents/agent-drives-section.js +3 -4
- package/dist/customize/agents/agent-page.js +2 -2
- package/dist/customize/agents/agent-tabs.d.ts +1 -1
- package/dist/customize/agents/agent-tabs.js +1 -2
- package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.js +7 -2
- package/dist/customize/connectors/add-mcp/add-mcp-server.d.ts +7 -0
- package/dist/customize/connectors/add-mcp/add-mcp-server.js +3 -0
- package/dist/customize/connectors/connectors-page.d.ts +8 -0
- package/dist/customize/connectors/connectors-page.js +34 -1
- package/dist/customize/sections/view/agent-editor-access-fields.js +1 -3
- package/dist/files/project/components/drive-explorer.js +64 -43
- package/dist/files/project/components/drive-upload-tray.d.ts +2 -1
- package/dist/files/project/components/drive-upload-tray.js +9 -4
- package/dist/files/project/drop-tree.d.ts +16 -0
- package/dist/files/project/drop-tree.js +39 -0
- package/dist/files/project/upload-batch.d.ts +15 -0
- package/dist/files/project/upload-batch.js +12 -0
- package/dist/i18n/en.d.ts +16 -6
- package/dist/i18n/en.js +29 -19
- package/dist/internal/billing/use-cost-explorer.d.ts +19 -1
- package/dist/internal/billing/use-cost-explorer.js +27 -1
- package/dist/internal/lib/billing/billing-gate-state.d.ts +5 -6
- package/dist/internal/lib/billing/billing-gate-state.js +10 -11
- package/dist/internal/lib/browser-error-noise.d.ts +1 -1
- package/dist/internal/lib/browser-error-noise.js +1 -1
- package/dist/internal/lib/browser-noise/rules/injected-scripts.d.ts +5 -1
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +86 -0
- package/dist/internal/lib/mermaid-utils.js +2 -24
- package/dist/primitives/mermaid-render.js +3 -20
- package/dist/session/composer/ComposerCard.d.ts +1 -1
- package/dist/session/composer/ComposerCard.js +2 -2
- package/dist/session/composer/composer-chat-input.d.ts +14 -1
- package/dist/session/composer/composer-chat-input.js +4 -2
- package/dist/session/composer/composer-toolbar.d.ts +4 -1
- package/dist/session/composer/composer-toolbar.js +2 -2
- package/dist/session/composer/composer.d.ts +8 -0
- package/dist/session/composer/queue-projection.d.ts +10 -8
- package/dist/session/composer/queue-projection.js +10 -9
- package/dist/session/composer/send-stop-control.d.ts +15 -1
- package/dist/session/composer/send-stop-control.js +30 -5
- package/dist/session/composer/use-instant-session-send.js +2 -2
- package/dist/session/header/session-embed-menu-item.d.ts +12 -0
- package/dist/session/header/session-embed-menu-item.js +30 -0
- package/dist/{workspace/sidebar/modal/session-embed-section.d.ts → session/header/session-embed-snippet.d.ts} +2 -11
- package/dist/session/header/session-embed-snippet.js +21 -0
- package/dist/session/header/session-site-header.js +9 -2
- package/dist/session/models/ask-owner-for-credits-button.d.ts +7 -1
- package/dist/session/models/ask-owner-for-credits-button.js +3 -2
- package/dist/session/thread/session-chat.js +18 -7
- package/dist/session/voice/composer-call.d.ts +31 -0
- package/dist/session/voice/composer-call.js +46 -0
- package/dist/session/voice/voice-call-card.js +2 -0
- package/dist/session/voice/voice-call-store.d.ts +8 -0
- package/dist/session/voice/voice-call-store.js +5 -0
- package/dist/session/voice/voice-call.d.ts +2 -2
- package/dist/session/voice/voice-call.js +6 -6
- package/dist/test-utils/intl.d.ts +16 -6
- package/dist/workspace/home/existing-repo-setup-prompt.js +2 -3
- package/dist/workspace/instant-session-shell.js +11 -1
- package/dist/workspace/layout/project-home.js +24 -2
- package/dist/workspace/layout/use-project-home-call.d.ts +24 -0
- package/dist/workspace/layout/use-project-home-call.js +56 -0
- package/dist/workspace/new/workspace-name.d.ts +13 -0
- package/dist/workspace/new/workspace-name.js +20 -0
- package/dist/workspace/sidebar/footer/project-balance-warning.js +9 -6
- package/dist/workspace/sidebar/footer/sidebar-alert.d.ts +1 -1
- package/dist/workspace/sidebar/modal/share-session-modal.js +2 -3
- package/package.json +7 -7
- package/dist/workspace/sidebar/modal/session-embed-section.js +0 -71
|
@@ -23,6 +23,26 @@ export function validateWorkspaceName(raw) {
|
|
|
23
23
|
}
|
|
24
24
|
return { ok: true, name };
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* The message a workspace-name field renders for `result`, or null.
|
|
28
|
+
*
|
|
29
|
+
* Every error but `required` reports itself live: it can exist only after the
|
|
30
|
+
* user typed a character, and the form model (`isSubmittable`) already
|
|
31
|
+
* disables submit the moment it exists — a disabled button with no visible
|
|
32
|
+
* reason strands the user (KRTX-4627). `required` is also true before the
|
|
33
|
+
* first keystroke, the normal state while typing a name, so it waits for the
|
|
34
|
+
* field to be left once.
|
|
35
|
+
*/
|
|
36
|
+
export function workspaceNameMessage(result, touched, t) {
|
|
37
|
+
if (result.ok)
|
|
38
|
+
return null;
|
|
39
|
+
if (result.error === 'Name is required')
|
|
40
|
+
return touched ? t('validation.nameRequired') : null;
|
|
41
|
+
if (result.error.startsWith('Name must be')) {
|
|
42
|
+
return t('validation.nameTooLong', { max: WORKSPACE_NAME_MAX_LENGTH });
|
|
43
|
+
}
|
|
44
|
+
return t('validation.nameCharacters');
|
|
45
|
+
}
|
|
26
46
|
const NAME_ADJECTIVES = [
|
|
27
47
|
'Amber',
|
|
28
48
|
'Bright',
|
|
@@ -11,12 +11,15 @@ import { useCallback } from 'react';
|
|
|
11
11
|
function useBalanceWarning(accountId, tI18nComplete) {
|
|
12
12
|
const { data: accountState } = useAccountState({ accountId });
|
|
13
13
|
const openUpgradeDialog = useUpgradeDialogStore((s) => s.openUpgradeDialog);
|
|
14
|
-
//
|
|
15
|
-
// a
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
|
|
14
|
+
// The row is a door into the billing dialog, so it shows only where that
|
|
15
|
+
// dialog has a way out: one-off top-ups, or (since 2026-11-09, when top-ups
|
|
16
|
+
// went Enterprise-only) a live subscription whose monthly tier can be raised.
|
|
17
|
+
// A free account keeps the "Upgrade Plan" button instead. A caller without
|
|
18
|
+
// `billing.write` cannot act either; the session error banner tells them to
|
|
19
|
+
// ask an owner when the wallet actually blocks a run.
|
|
20
|
+
const canTopUp = ((accountState?.tier?.can_purchase_credits ?? false) ||
|
|
21
|
+
(accountState?.has_active_subscription ?? false)) &&
|
|
22
|
+
canManageBilling(accountState);
|
|
20
23
|
const handleClick = useCallback(() => openUpgradeDialog(billingDialogArgs(resolveBillingState(accountState), accountState, accountId, tI18nComplete)), [openUpgradeDialog, accountId, accountState, tI18nComplete]);
|
|
21
24
|
if (!platformConfig().billingEnabled || !accountState || !canTopUp) {
|
|
22
25
|
return { severity: null, handleClick };
|
|
@@ -5,7 +5,7 @@ export declare function SidebarAlertRow({ tone, icon, label, trailing, onClick,
|
|
|
5
5
|
tone: SidebarAlertTone;
|
|
6
6
|
icon: ReactNode;
|
|
7
7
|
label: string;
|
|
8
|
-
/** Optional right-aligned hint naming what the click does ("
|
|
8
|
+
/** Optional right-aligned hint naming what the click does ("Add credits"). */
|
|
9
9
|
trailing?: ReactNode;
|
|
10
10
|
onClick: () => void;
|
|
11
11
|
}): import("react").JSX.Element;
|
|
@@ -13,7 +13,6 @@ import { sessionOversightQueryKey } from '../../../access/iam/session-oversight-
|
|
|
13
13
|
import { ShieldCheckIcon } from '@phosphor-icons/react';
|
|
14
14
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
15
15
|
import { useEffect, useState } from 'react';
|
|
16
|
-
import { SessionEmbedSection } from './session-embed-section.js';
|
|
17
16
|
import { sessionAccessSummary, sessionAccessView } from './share-session-access.js';
|
|
18
17
|
import { refreshAfterShare } from './share-session-cache.js';
|
|
19
18
|
/**
|
|
@@ -59,7 +58,7 @@ export function ShareSessionModal({ projectId, session, open, onOpenChange, onSa
|
|
|
59
58
|
// while the dialog is open (a user action), and silently absent on any error
|
|
60
59
|
// — the IAM read never toasts (`showErrors: false`).
|
|
61
60
|
const accountId = session?.account_id ?? null;
|
|
62
|
-
const { accountApiEnabled
|
|
61
|
+
const { accountApiEnabled } = useUiHostConfig();
|
|
63
62
|
const oversightQuery = useQuery({
|
|
64
63
|
queryKey: sessionOversightQueryKey(accountId ?? ''),
|
|
65
64
|
queryFn: () => getSessionOversight(accountId),
|
|
@@ -105,5 +104,5 @@ export function ShareSessionModal({ projectId, session, open, onOpenChange, onSa
|
|
|
105
104
|
// Read-only, not hidden: a person a session was shared with should
|
|
106
105
|
// still be able to see who else is in it. Withholding that is what
|
|
107
106
|
// sent people to the editable dialog in the first place.
|
|
108
|
-
_jsx("p", { className: "text-foreground text-sm", "data-testid": "session-access-summary", children: session ? sessionAccessSummary(session) : null })), oversightOn ? (_jsxs(BannerAlert, { variant: "default", "data-testid": "session-oversight-disclosure", children: [_jsx(BannerAlertMedia, { children: _jsx(ShieldCheckIcon, {}) }), _jsx(BannerAlertDescription, { children: tOversight.raw('shareDisclosure') })] })) : null
|
|
107
|
+
_jsx("p", { className: "text-foreground text-sm", "data-testid": "session-access-summary", children: session ? sessionAccessSummary(session) : null })), oversightOn ? (_jsxs(BannerAlert, { variant: "default", "data-testid": "session-oversight-disclosure", children: [_jsx(BannerAlertMedia, { children: _jsx(ShieldCheckIcon, {}) }), _jsx(BannerAlertDescription, { children: tOversight.raw('shareDisclosure') })] })) : null] }), _jsxs(ModalFooter, { className: "sm:justify-between", children: [_jsx(Button, { variant: "outline-ghost", size: "sm", className: "w-full sm:w-auto", onClick: () => onOpenChange(false), disabled: save.isPending, children: view.canEdit ? 'Cancel' : 'Close' }), view.canEdit && (_jsxs(Button, { size: "sm", onClick: () => save.mutate(), disabled: save.isPending || !isSharingComplete(sharing) || blockedSelection, className: "w-full sm:w-auto", children: [save.isPending && _jsx(Loading, {}), tI18nHardcoded.raw('i18nComplete.text1509f561f241')] }))] })] }) }));
|
|
109
108
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kortix/ui",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.5",
|
|
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",
|
|
@@ -185,10 +185,6 @@
|
|
|
185
185
|
"types": "./dist/customize/agents/agent-apps-grant.d.ts",
|
|
186
186
|
"import": "./dist/customize/agents/agent-apps-grant.js"
|
|
187
187
|
},
|
|
188
|
-
"./customize/agents/agent-detail-aside": {
|
|
189
|
-
"types": "./dist/customize/agents/agent-detail-aside.d.ts",
|
|
190
|
-
"import": "./dist/customize/agents/agent-detail-aside.js"
|
|
191
|
-
},
|
|
192
188
|
"./customize/agents/agent-page": {
|
|
193
189
|
"types": "./dist/customize/agents/agent-page.d.ts",
|
|
194
190
|
"import": "./dist/customize/agents/agent-page.js"
|
|
@@ -1661,6 +1657,10 @@
|
|
|
1661
1657
|
"types": "./dist/session/composer/session-chat-input.d.ts",
|
|
1662
1658
|
"import": "./dist/session/composer/session-chat-input.js"
|
|
1663
1659
|
},
|
|
1660
|
+
"./session/models/ask-owner-for-credits-button": {
|
|
1661
|
+
"types": "./dist/session/models/ask-owner-for-credits-button.d.ts",
|
|
1662
|
+
"import": "./dist/session/models/ask-owner-for-credits-button.js"
|
|
1663
|
+
},
|
|
1664
1664
|
"./session/models/model-grouping": {
|
|
1665
1665
|
"types": "./dist/session/models/model-grouping.d.ts",
|
|
1666
1666
|
"import": "./dist/session/models/model-grouping.js"
|
|
@@ -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.
|
|
2200
|
+
"@kortix/llm-catalog": "0.15.5",
|
|
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.
|
|
2299
|
+
"@kortix/sdk": "^0.15.5",
|
|
2300
2300
|
"@tanstack/react-query": "^5.75.2",
|
|
2301
2301
|
"@types/react": ">=18",
|
|
2302
2302
|
"react": ">=19",
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Button } from '../../../primitives/button.js';
|
|
4
|
-
import { Label } from '../../../primitives/label.js';
|
|
5
|
-
import { errorToast, successToast } from '../../../primitives/toast.js';
|
|
6
|
-
import { useTranslations } from '../../../i18n/index.js';
|
|
7
|
-
import { CheckIcon, CodeIcon } from '@phosphor-icons/react';
|
|
8
|
-
import { useEffect, useRef, useState } from 'react';
|
|
9
|
-
/**
|
|
10
|
-
* The iframe snippet a host page pastes: the ACTUAL session page
|
|
11
|
-
* (`/projects/:projectId/sessions/:sessionId`), not a separate widget or
|
|
12
|
-
* viewer. Pure, so the test can pin the exact HTML without a browser.
|
|
13
|
-
*
|
|
14
|
-
* The snippet is static HTML by construction: the URL is built from ids, and
|
|
15
|
-
* the `title` attribute is a fixed string. Never interpolate a session title
|
|
16
|
-
* into the attribute — an unescaped quote would break out of it on the HOST
|
|
17
|
-
* page, which does not share this app's CSP.
|
|
18
|
-
*/
|
|
19
|
-
export function sessionEmbedSnippet(projectId, sessionId, origin) {
|
|
20
|
-
if (!projectId || !sessionId || !origin)
|
|
21
|
-
return null;
|
|
22
|
-
const src = `${origin}/workspaces/${encodeURIComponent(projectId)}/sessions/${encodeURIComponent(sessionId)}`;
|
|
23
|
-
return `<iframe src="${src}" style="height:640px;width:100%;border:0;border-radius:12px" title="Kortix session" loading="lazy"></iframe>`;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* "Embed" in the Share dialog: one copy button for the iframe snippet above.
|
|
27
|
-
* Framing the session page is allowed by the CSP `frame-ancestors` rule on
|
|
28
|
-
* that route (next.config.ts); the viewer inside the frame is the app's own
|
|
29
|
-
* auth. Same-site embeds require an existing signed-in session; cross-site
|
|
30
|
-
* embeds cannot sign in inside the frame (SameSite=Lax and /auth's CSP).
|
|
31
|
-
*
|
|
32
|
-
* Mounted inside `ModalContent`, so `window` is read at render time of an open
|
|
33
|
-
* dialog, never during SSR.
|
|
34
|
-
*/
|
|
35
|
-
export function SessionEmbedSection({ projectId, sessionId, }) {
|
|
36
|
-
const t = useTranslations('hardcodedUi.sessionEmbed');
|
|
37
|
-
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
38
|
-
const [copied, setCopied] = useState(false);
|
|
39
|
-
const copiedTimer = useRef(null);
|
|
40
|
-
const mounted = useRef(false);
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
mounted.current = true;
|
|
43
|
-
return () => {
|
|
44
|
-
mounted.current = false;
|
|
45
|
-
if (copiedTimer.current)
|
|
46
|
-
clearTimeout(copiedTimer.current);
|
|
47
|
-
};
|
|
48
|
-
}, []);
|
|
49
|
-
const origin = typeof window === 'undefined' ? null : window.location.origin;
|
|
50
|
-
const snippet = origin ? sessionEmbedSnippet(projectId, sessionId, origin) : null;
|
|
51
|
-
const copy = async () => {
|
|
52
|
-
if (!snippet)
|
|
53
|
-
return;
|
|
54
|
-
try {
|
|
55
|
-
await navigator.clipboard.writeText(snippet);
|
|
56
|
-
if (!mounted.current)
|
|
57
|
-
return;
|
|
58
|
-
setCopied(true);
|
|
59
|
-
successToast(t('copied'));
|
|
60
|
-
if (copiedTimer.current)
|
|
61
|
-
clearTimeout(copiedTimer.current);
|
|
62
|
-
copiedTimer.current = setTimeout(() => setCopied(false), 2000);
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
if (!mounted.current)
|
|
66
|
-
return;
|
|
67
|
-
errorToast(tI18nComplete.raw('text167c96824acb'));
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
return (_jsxs("section", { className: "space-y-2", "data-testid": "session-embed", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: t('sectionTitle') }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('sectionDescription') })] }), _jsxs(Button, { variant: "outline", size: "sm", disabled: !snippet, onClick: copy, children: [copied ? (_jsx(CheckIcon, { className: "text-kortix-green size-4 shrink-0" })) : (_jsx(CodeIcon, { className: "size-4 shrink-0" })), t('copy')] })] }));
|
|
71
|
-
}
|