@kortix/ui 0.15.6 → 0.15.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/_vendor/kortix-shared.js +36 -1
- package/dist/_vendor/shared/my-kortix-agent.d.ts +7 -0
- package/dist/_vendor/shared/pixel-mark.d.ts +18 -0
- package/dist/customize/connectors/catalog/connector-categories.d.ts +2 -2
- package/dist/customize/connectors/catalog/connector-categories.js +2 -2
- package/dist/customize/connectors/detail/connector-modal.js +1 -1
- package/dist/customize/providers/provider-accordion.js +3 -2
- package/dist/customize/providers/provider-connect.d.ts +7 -0
- package/dist/customize/providers/provider-connect.js +21 -2
- package/dist/customize/providers/provider-sheet.js +3 -2
- package/dist/customize/sections/gateway-view.d.ts +2 -2
- package/dist/customize/sections/gateway-view.js +30 -15
- package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.d.ts +3 -1
- package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +2 -2
- package/dist/customize/sections/view/account-secret-resources-panel.js +8 -5
- package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
- package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
- package/dist/customize/sections/view/git-view.js +1 -1
- package/dist/customize/sections/view/permission-editor.js +1 -1
- package/dist/customize/sections/view/review-center-connected.js +15 -3
- package/dist/customize/sections/view/subscription-usage.d.ts +269 -17
- package/dist/customize/sections/view/subscription-usage.js +197 -54
- package/dist/customize/shared/entity/entity-modal.js +8 -10
- package/dist/files/project/components/drive-toolbar.d.ts +1 -1
- package/dist/files/project/components/drive-toolbar.js +1 -1
- package/dist/files/project/store/version-store.d.ts +1 -1
- package/dist/files/renderers/shared/scroll-area-compat.d.ts +6 -6
- package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
- package/dist/files/renderers/shared/select-compat.js +3 -7
- package/dist/files/viewer/file-preview-modal.d.ts +10 -11
- package/dist/files/viewer/file-preview-modal.js +17 -18
- package/dist/i18n/en.d.ts +40 -47
- package/dist/i18n/en.js +47 -54
- package/dist/i18n/ui-catalog/app-registry-translation-keys.generated.js +5 -0
- package/dist/index.js +1 -1
- package/dist/internal/account-hub/account-hub-location.js +2 -2
- package/dist/internal/account-hub/use-account-members.d.ts +28 -1
- package/dist/internal/account-hub/use-account-members.js +27 -10
- package/dist/internal/auth/auth-primitives.d.ts +27 -0
- package/dist/internal/auth/auth-primitives.js +21 -0
- package/dist/internal/billing/index.d.ts +1 -0
- package/dist/internal/billing/index.js +2 -0
- package/dist/internal/billing/use-free-grant-unspent.d.ts +10 -0
- package/dist/internal/billing/use-free-grant-unspent.js +20 -0
- package/dist/internal/components/agent-mark.d.ts +1 -8
- package/dist/internal/components/agent-mark.js +2 -19
- package/dist/internal/lib/billing/billing-gate-state.d.ts +20 -0
- package/dist/internal/lib/billing/billing-gate-state.js +22 -0
- package/dist/internal/lib/error-handler.js +0 -2
- package/dist/internal/lib/navigation/modified-click.js +2 -2
- package/dist/internal/lib/pixel-mark.d.ts +3 -20
- package/dist/internal/lib/pixel-mark.js +3 -34
- package/dist/internal/notifications/notification-inbox.js +1 -1
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/browser-recents-store.d.ts +1 -1
- package/dist/internal/stores/current-account-store.d.ts +1 -1
- package/dist/internal/stores/first-chat-store.d.ts +1 -1
- package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
- package/dist/internal/stores/session-browser-store.d.ts +1 -1
- package/dist/internal/stores/session-expanded-store.d.ts +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/session-history-view-store.d.ts +1 -1
- package/dist/internal/stores/session-hover-store.d.ts +1 -1
- package/dist/internal/stores/session-hover-store.js +1 -1
- package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
- package/dist/internal/stores/sound-store.d.ts +1 -1
- package/dist/internal/stores/tab-store.d.ts +1 -1
- package/dist/internal/stores/upgrade-dialog-store.d.ts +0 -2
- package/dist/internal/stores/upgrade-dialog-store.js +0 -2
- package/dist/internal/stores/user-preferences-store.d.ts +1 -1
- package/dist/internal/stores/web-notification-store.d.ts +1 -1
- package/dist/lib/base-ui-compat.d.ts +149 -0
- package/dist/lib/base-ui-compat.js +339 -0
- package/dist/lib/portal-container.d.ts +3 -7
- package/dist/lib/portal-container.js +5 -3
- package/dist/lib/z-stack.d.ts +4 -4
- package/dist/lib/z-stack.js +5 -5
- package/dist/markdown/setup-links/approval-decision.d.ts +1 -1
- package/dist/markdown/setup-links/approval-decision.js +1 -1
- package/dist/primitives/accordion.d.ts +36 -5
- package/dist/primitives/accordion.js +41 -8
- package/dist/primitives/alert-dialog.d.ts +33 -11
- package/dist/primitives/alert-dialog.js +41 -19
- package/dist/primitives/avatar.d.ts +5 -2
- package/dist/primitives/avatar.js +3 -3
- package/dist/primitives/badge.js +1 -1
- package/dist/primitives/breadcrumb.js +1 -1
- package/dist/primitives/button-group.js +3 -3
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/checkbox.d.ts +14 -5
- package/dist/primitives/checkbox.js +24 -9
- package/dist/primitives/collapsible.d.ts +16 -4
- package/dist/primitives/collapsible.js +18 -7
- package/dist/primitives/command-core.d.ts +121 -0
- package/dist/primitives/command-core.js +642 -0
- package/dist/primitives/command.d.ts +38 -4
- package/dist/primitives/command.js +22 -13
- package/dist/primitives/context-menu.d.ts +61 -31
- package/dist/primitives/context-menu.js +40 -53
- package/dist/primitives/dialog.d.ts +48 -10
- package/dist/primitives/dialog.js +48 -19
- package/dist/primitives/disclosure.d.ts +1 -1
- package/dist/primitives/disclosure.js +2 -2
- package/dist/primitives/drawer.d.ts +28 -9
- package/dist/primitives/drawer.js +42 -18
- package/dist/primitives/dropdown-menu.d.ts +55 -33
- package/dist/primitives/dropdown-menu.js +46 -82
- package/dist/primitives/faded-scroll-area.js +2 -1
- package/dist/primitives/hint.js +3 -3
- package/dist/primitives/hover-card.d.ts +17 -5
- package/dist/primitives/hover-card.js +45 -8
- package/dist/primitives/item.js +2 -2
- package/dist/primitives/label.d.ts +5 -2
- package/dist/primitives/label.js +10 -3
- package/dist/primitives/menu-base.d.ts +150 -0
- package/dist/primitives/menu-base.js +171 -0
- package/dist/primitives/menu-recipe.d.ts +1 -1
- package/dist/primitives/menu-recipe.js +2 -7
- package/dist/primitives/modal.d.ts +19 -52
- package/dist/primitives/modal.js +24 -28
- package/dist/primitives/navigation-menu.d.ts +36 -11
- package/dist/primitives/navigation-menu.js +31 -12
- package/dist/primitives/popover.d.ts +31 -6
- package/dist/primitives/popover.js +79 -12
- package/dist/primitives/preview-image.d.ts +18 -7
- package/dist/primitives/preview-image.js +14 -11
- package/dist/primitives/progress.d.ts +4 -2
- package/dist/primitives/progress.js +4 -3
- package/dist/primitives/project-icon-picker.js +2 -2
- package/dist/primitives/radio-group.d.ts +28 -5
- package/dist/primitives/radio-group.js +18 -10
- package/dist/primitives/scroll-area.d.ts +2 -2
- package/dist/primitives/scroll-area.js +8 -3
- package/dist/primitives/select.d.ts +55 -12
- package/dist/primitives/select.js +93 -36
- package/dist/primitives/separator.d.ts +6 -2
- package/dist/primitives/separator.js +10 -2
- package/dist/primitives/sheet.d.ts +17 -10
- package/dist/primitives/sheet.js +19 -22
- package/dist/primitives/sidebar-menu-primitives.js +8 -8
- package/dist/primitives/slider-native.d.ts +2 -2
- package/dist/primitives/slider-native.js +11 -9
- package/dist/primitives/slider.d.ts +24 -6
- package/dist/primitives/slider.js +26 -24
- package/dist/primitives/slot.d.ts +6 -0
- package/dist/primitives/slot.js +7 -0
- package/dist/primitives/split-sheet.js +1 -1
- package/dist/primitives/stepper.js +1 -1
- package/dist/primitives/switch.d.ts +16 -3
- package/dist/primitives/switch.js +7 -6
- package/dist/primitives/tabs.d.ts +36 -20
- package/dist/primitives/tabs.js +131 -102
- package/dist/primitives/toggle.d.ts +16 -3
- package/dist/primitives/toggle.js +8 -3
- package/dist/primitives/tooltip.d.ts +24 -5
- package/dist/primitives/tooltip.js +32 -10
- package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
- package/dist/primitives/type-to-confirm-dialog.js +1 -1
- package/dist/session/composer/animated-placeholder.js +1 -1
- package/dist/session/composer/chat-input/chat-input-control.js +3 -3
- package/dist/session/composer/editor/composer-editor.js +1 -1
- package/dist/session/composer/menus/menu-shell.d.ts +1 -1
- package/dist/session/composer/menus/menu-shell.js +1 -1
- package/dist/session/composer/menus/mount.js +1 -1
- package/dist/session/composer/reasoning-effort-selector.js +1 -1
- package/dist/session/header/session-site-header.js +2 -2
- package/dist/session/header/subagent-hover-card.js +2 -2
- package/dist/session/media/image-preview.js +1 -1
- package/dist/session/models/model-selector.d.ts +1 -1
- package/dist/session/models/model-selector.js +18 -12
- package/dist/session/models/subscription-switcher.d.ts +37 -0
- package/dist/session/models/subscription-switcher.js +97 -0
- package/dist/session/models/subscription-windows.d.ts +40 -0
- package/dist/session/models/subscription-windows.js +86 -0
- package/dist/session/overrides/session-overrides-control.js +3 -3
- package/dist/session/panel/diff-dialog.js +1 -1
- package/dist/session/panel/easy/detail-view.js +3 -3
- package/dist/session/panel/mobile-tool-drawer.js +2 -2
- package/dist/session/panel/panel-fallback.js +1 -1
- package/dist/session/panel/session-files-explorer.d.ts +1 -1
- package/dist/session/panel/session-files-explorer.js +1 -1
- package/dist/session/prompts/ask-deck.d.ts +14 -2
- package/dist/session/prompts/ask-deck.js +6 -2
- package/dist/session/thread/session-chat.js +2 -2
- package/dist/session/thread/session-context-message-explorer.js +1 -1
- package/dist/session/thread/turn-share.js +3 -4
- package/dist/session/tool/shared/show-helpers.js +1 -1
- package/dist/session/turn/message-time-label.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +40 -47
- package/dist/workspace/admin/settings-search.js +4 -12
- package/dist/workspace/inbox/workspace-inbox.js +11 -2
- package/dist/workspace/layout/new-session-create.d.ts +4 -2
- package/dist/workspace/layout/new-session-create.js +11 -0
- package/dist/workspace/projects/modal/project-icon-field.js +9 -23
- package/dist/workspace/review/approval-modal.d.ts +6 -6
- package/dist/workspace/review/approval-modal.js +10 -14
- package/dist/workspace/review/review-center.d.ts +9 -2
- package/dist/workspace/review/review-center.js +258 -126
- package/dist/workspace/review/review-detail.d.ts +20 -10
- package/dist/workspace/review/review-detail.js +39 -44
- package/dist/workspace/review/review-meta.d.ts +27 -6
- package/dist/workspace/review/review-meta.js +46 -34
- package/dist/workspace/sessions/session-row.js +1 -1
- package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +10 -0
- package/dist/workspace/sidebar/footer/project-download-app-nav.js +53 -0
- package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +2 -1
- package/dist/workspace/sidebar/footer/promo-nav-row.js +1 -1
- package/dist/workspace/sidebar/project-session-list.js +2 -2
- package/dist/workspace/sidebar/project-sidebar.d.ts +6 -1
- package/dist/workspace/sidebar/project-sidebar.js +3 -2
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
- package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
- package/dist/workspace/sidebar/session-title.d.ts +2 -2
- package/dist/workspace/sidebar/session-title.js +2 -2
- package/dist/workspace/sidebar/workspace-menu-model.d.ts +19 -13
- package/dist/workspace/sidebar/workspace-menu-model.js +7 -8
- package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
- package/dist/workspace/spaces/space-links.js +1 -1
- package/dist/workspace/spaces/space-threads-tab.js +1 -1
- package/package.json +16 -35
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/custom-dashboard.md +1 -1
- package/dist/customize/sections/view/subscription-usage-tab.d.ts +0 -25
- package/dist/customize/sections/view/subscription-usage-tab.js +0 -121
|
@@ -1,2 +1,29 @@
|
|
|
1
1
|
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The account member list, read once and shared by the hub page (the Members
|
|
4
|
+
* pane) and the settings sidebar (the count beside "Members"). One key, one
|
|
5
|
+
* fetcher, one gate — two hand-typed copies is how a "13 readers, one
|
|
6
|
+
* request" property quietly becomes two requests (see
|
|
7
|
+
* `packages/ui/src/internal/hooks/account/use-accounts-list.ts` for the longer version of that story).
|
|
8
|
+
*/
|
|
9
|
+
import type { AccountRole } from '@kortix/sdk';
|
|
10
|
+
import { listAccountMembers } from '@kortix/sdk';
|
|
11
|
+
import { type UseQueryResult } from '@tanstack/react-query';
|
|
12
|
+
/** Account-level standing of one member, keyed by user id. */
|
|
13
|
+
export interface AccountMemberMeta {
|
|
14
|
+
email: string | null;
|
|
15
|
+
accountRole: AccountRole;
|
|
16
|
+
isSuperAdmin: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function useAccountMembers(accountId: string | undefined,
|
|
19
|
+
/** Extra gate ANDed with the signed-in check — a surface that only needs
|
|
20
|
+
* the roster while a dialog is open passes `{ enabled: isOpen }`. */
|
|
21
|
+
options?: {
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
}): UseQueryResult<Awaited<ReturnType<typeof listAccountMembers>>, Error> & {
|
|
24
|
+
/** user_id → email. Members without an email are absent: the caller
|
|
25
|
+
* renders the raw user id (the fallback the IAM tables show). */
|
|
26
|
+
emailByUserId: Map<string, string>;
|
|
27
|
+
/** user_id → account-level standing (email, role, super-admin flag). */
|
|
28
|
+
accountMetaByUserId: Map<string, AccountMemberMeta>;
|
|
29
|
+
};
|
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
/**
|
|
3
|
-
* The account member list, read once and shared by the hub page (the Members
|
|
4
|
-
* pane) and the settings sidebar (the count beside "Members"). One key, one
|
|
5
|
-
* fetcher, one gate — two hand-typed copies is how a "13 readers, one
|
|
6
|
-
* request" property quietly becomes two requests (see
|
|
7
|
-
* `packages/ui/src/internal/hooks/account/use-accounts-list.ts` for the longer version of that story).
|
|
8
|
-
*/
|
|
9
2
|
import { listAccountMembers } from '@kortix/sdk';
|
|
10
3
|
import { contract } from '@kortix/sdk/react';
|
|
11
4
|
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { useMemo } from 'react';
|
|
12
6
|
import { useUiViewerId } from '../../providers/ui-provider.js';
|
|
13
|
-
export function useAccountMembers(accountId
|
|
7
|
+
export function useAccountMembers(accountId,
|
|
8
|
+
/** Extra gate ANDed with the signed-in check — a surface that only needs
|
|
9
|
+
* the roster while a dialog is open passes `{ enabled: isOpen }`. */
|
|
10
|
+
options) {
|
|
14
11
|
const viewerId = useUiViewerId();
|
|
15
12
|
// `GET .../members` answers every account member: the whole directory with
|
|
16
13
|
// `member.read`, else only the caller. No probe to
|
|
17
14
|
// wait for.
|
|
18
|
-
|
|
15
|
+
const query = useQuery({
|
|
19
16
|
queryKey: ['account-members', accountId],
|
|
20
17
|
queryFn: () => listAccountMembers(accountId),
|
|
21
|
-
enabled: !!viewerId && !!accountId,
|
|
18
|
+
enabled: !!viewerId && !!accountId && (options?.enabled ?? true),
|
|
22
19
|
...contract('directory'),
|
|
23
20
|
});
|
|
21
|
+
const emailByUserId = useMemo(() => {
|
|
22
|
+
const map = new Map();
|
|
23
|
+
for (const m of query.data ?? []) {
|
|
24
|
+
if (m.email)
|
|
25
|
+
map.set(m.user_id, m.email);
|
|
26
|
+
}
|
|
27
|
+
return map;
|
|
28
|
+
}, [query.data]);
|
|
29
|
+
const accountMetaByUserId = useMemo(() => {
|
|
30
|
+
const map = new Map();
|
|
31
|
+
for (const m of query.data ?? []) {
|
|
32
|
+
map.set(m.user_id, {
|
|
33
|
+
email: m.email,
|
|
34
|
+
accountRole: m.account_role,
|
|
35
|
+
isSuperAdmin: !!m.is_super_admin,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return map;
|
|
39
|
+
}, [query.data]);
|
|
40
|
+
return { ...query, emailByUserId, accountMetaByUserId };
|
|
24
41
|
}
|
|
@@ -55,6 +55,33 @@ export declare function InfoStrip({ message }: {
|
|
|
55
55
|
export declare function SuccessStrip({ message }: {
|
|
56
56
|
message: string;
|
|
57
57
|
}): import("react").JSX.Element;
|
|
58
|
+
/**
|
|
59
|
+
* The device-code row of an RFC 8628 approval page (Capture sign-in, computer
|
|
60
|
+
* pairing): the code the person checks against their other screen, and the
|
|
61
|
+
* time left to decide. `countdown` is the formatted `m:ss` remaining.
|
|
62
|
+
*/
|
|
63
|
+
export declare function DeviceCodeHeader({ code, countdown }: {
|
|
64
|
+
code: string;
|
|
65
|
+
countdown: string;
|
|
66
|
+
}): import("react").JSX.Element;
|
|
67
|
+
/**
|
|
68
|
+
* The approve/deny pair of an approval page. One shared busy state: either
|
|
69
|
+
* mutation pending disables both buttons, its spinner on the button that is
|
|
70
|
+
* running. Failures render as the strip above the pair — pass only the errors
|
|
71
|
+
* the page shows. `approveDisabled` adds a page-side gate (no workspace
|
|
72
|
+
* picked yet), on top of the busy state.
|
|
73
|
+
*/
|
|
74
|
+
export declare function ApproveDenyActions({ approveLabel, denyLabel, onApprove, onDeny, approvePending, denyPending, approveError, denyError, approveDisabled, }: {
|
|
75
|
+
approveLabel: React.ReactNode;
|
|
76
|
+
denyLabel: React.ReactNode;
|
|
77
|
+
onApprove: () => void;
|
|
78
|
+
onDeny: () => void;
|
|
79
|
+
approvePending: boolean;
|
|
80
|
+
denyPending: boolean;
|
|
81
|
+
approveError?: string | null;
|
|
82
|
+
denyError?: string | null;
|
|
83
|
+
approveDisabled?: boolean;
|
|
84
|
+
}): import("react").JSX.Element;
|
|
58
85
|
export declare function CodeInput({ value, onChange, disabled, autoFocus, invalid, }: {
|
|
59
86
|
value: string;
|
|
60
87
|
onChange: (next: string) => void;
|
|
@@ -10,6 +10,8 @@ import { m, useReducedMotion } from 'motion/react';
|
|
|
10
10
|
import { useRef } from 'react';
|
|
11
11
|
import { inputFocusClasses, inputSurfaceClasses } from '../../primitives/input.js';
|
|
12
12
|
import { KortixLogo } from '../../primitives/kortix-logo.js';
|
|
13
|
+
import { Button } from '../../primitives/button.js';
|
|
14
|
+
import Loading from '../../primitives/loading.js';
|
|
13
15
|
import { applyBackspace, applyBoxInput, CODE_LENGTH, insertDigits, } from './code-input-logic.js';
|
|
14
16
|
import { useTranslations } from '../../i18n/index.js';
|
|
15
17
|
import { cn } from '../lib/utils.js';
|
|
@@ -60,6 +62,25 @@ export function InfoStrip({ message }) {
|
|
|
60
62
|
export function SuccessStrip({ message }) {
|
|
61
63
|
return (_jsxs("div", { className: "bg-muted text-foreground mb-5 flex items-center gap-2 rounded-md px-3 py-2.5", children: [_jsx(InfoCircleSolid, { weight: "fill", className: "text-kortix-green size-4 shrink-0" }), _jsx("span", { className: "text-sm", children: message })] }));
|
|
62
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* The device-code row of an RFC 8628 approval page (Capture sign-in, computer
|
|
67
|
+
* pairing): the code the person checks against their other screen, and the
|
|
68
|
+
* time left to decide. `countdown` is the formatted `m:ss` remaining.
|
|
69
|
+
*/
|
|
70
|
+
export function DeviceCodeHeader({ code, countdown }) {
|
|
71
|
+
return (_jsxs("div", { className: "flex items-center justify-between gap-3 rounded-md border px-3.5 py-3", children: [_jsx("span", { className: "text-foreground font-mono text-lg font-medium tracking-widest tabular-nums", children: code }), _jsx("span", { className: "text-muted-foreground font-mono text-xs tabular-nums", children: countdown })] }));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The approve/deny pair of an approval page. One shared busy state: either
|
|
75
|
+
* mutation pending disables both buttons, its spinner on the button that is
|
|
76
|
+
* running. Failures render as the strip above the pair — pass only the errors
|
|
77
|
+
* the page shows. `approveDisabled` adds a page-side gate (no workspace
|
|
78
|
+
* picked yet), on top of the busy state.
|
|
79
|
+
*/
|
|
80
|
+
export function ApproveDenyActions({ approveLabel, denyLabel, onApprove, onDeny, approvePending, denyPending, approveError, denyError, approveDisabled = false, }) {
|
|
81
|
+
const busy = approvePending || denyPending;
|
|
82
|
+
return (_jsxs("div", { className: "space-y-3", children: [approveError ? _jsx(ErrorStrip, { message: approveError }) : null, denyError ? _jsx(ErrorStrip, { message: denyError }) : null, _jsxs(Button, { size: "lg", className: "w-full", onClick: onApprove, disabled: busy || approveDisabled, children: [approvePending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, approveLabel] }), _jsxs(Button, { variant: "outline", size: "lg", className: "text-destructive border-destructive/30 hover:bg-destructive/5 hover:text-destructive focus-visible:ring-destructive/35 w-full", onClick: onDeny, disabled: busy, children: [denyPending ? _jsx(Loading, { className: "text-destructive! size-4 shrink-0" }) : null, denyLabel] })] }));
|
|
83
|
+
}
|
|
63
84
|
/* ─── Six-box code input ───────────────────────────────────────────────── */
|
|
64
85
|
export function CodeInput({ value, onChange, disabled, autoFocus = true, invalid = false, }) {
|
|
65
86
|
const refs = useRef([]);
|
|
@@ -10,6 +10,7 @@ export { useTransactions } from './use-transactions.js';
|
|
|
10
10
|
export { SESSION_COST_PAGE_SIZE, useSessionCostDetail, useSessionCostProjects, useSessionCosts, } from './use-session-costs.js';
|
|
11
11
|
export { COST_PAGE_SIZE, useCostByProject, useCostSummary } from './use-cost-explorer.js';
|
|
12
12
|
export { useDownloadRestriction } from './use-download-restriction.js';
|
|
13
|
+
export { useFreeGrantUnspent } from './use-free-grant-unspent.js';
|
|
13
14
|
export type { AccountState, PlanFamily, ResolvedPlanView } from '@kortix/sdk';
|
|
14
15
|
/**
|
|
15
16
|
* The plan the account BEHAVES as. Prefer this over
|
|
@@ -27,6 +27,8 @@ export { SESSION_COST_PAGE_SIZE, useSessionCostDetail, useSessionCostProjects, u
|
|
|
27
27
|
export { COST_PAGE_SIZE, useCostByProject, useCostSummary } from './use-cost-explorer.js';
|
|
28
28
|
// Download restriction for free tier
|
|
29
29
|
export { useDownloadRestriction } from './use-download-restriction.js';
|
|
30
|
+
// The on-open paywall gate for a further workspace (KRTX-4713)
|
|
31
|
+
export { useFreeGrantUnspent } from './use-free-grant-unspent.js';
|
|
30
32
|
/**
|
|
31
33
|
* The plan the account BEHAVES as. Prefer this over
|
|
32
34
|
* `accountStateSelectors.tierKey` for anything a person reads and for any
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
+
import type { AccountState } from '@kortix/sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the person's free credits are unspent while the workspace being
|
|
5
|
+
* opened has none (KRTX-4713) — the decision is `freeGrantUnspentElsewhere`;
|
|
6
|
+
* this hook reads the claimed workspace's state it needs. `undefined` while
|
|
7
|
+
* that read is in flight (or it errored), so a caller never decides from a
|
|
8
|
+
* half-read account: hold the modal, never greet with a paywall.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useFreeGrantUnspent(state: AccountState | null | undefined): boolean | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { freeGrantUnspentElsewhere } from '../lib/billing/billing-gate-state.js';
|
|
3
|
+
import { useAccountState } from './use-account-state.js';
|
|
4
|
+
/**
|
|
5
|
+
* Whether the person's free credits are unspent while the workspace being
|
|
6
|
+
* opened has none (KRTX-4713) — the decision is `freeGrantUnspentElsewhere`;
|
|
7
|
+
* this hook reads the claimed workspace's state it needs. `undefined` while
|
|
8
|
+
* that read is in flight (or it errored), so a caller never decides from a
|
|
9
|
+
* half-read account: hold the modal, never greet with a paywall.
|
|
10
|
+
*/
|
|
11
|
+
export function useFreeGrantUnspent(state) {
|
|
12
|
+
const claimedWorkspaceId = state?.credits?.free_grant?.eligible === false
|
|
13
|
+
? (state.credits.free_grant.claimed_workspace_id ?? null)
|
|
14
|
+
: null;
|
|
15
|
+
const { data: claimedState } = useAccountState({
|
|
16
|
+
accountId: claimedWorkspaceId ?? undefined,
|
|
17
|
+
enabled: !!claimedWorkspaceId,
|
|
18
|
+
});
|
|
19
|
+
return freeGrantUnspentElsewhere(state, claimedState);
|
|
20
|
+
}
|
|
@@ -39,11 +39,4 @@ export declare function AgentMark({ slug, size, tile, label, className, }: {
|
|
|
39
39
|
label?: string;
|
|
40
40
|
className?: string;
|
|
41
41
|
}): import("react").JSX.Element;
|
|
42
|
-
|
|
43
|
-
* An agent's name as a person reads it: My Kortix for the built-in agent,
|
|
44
|
-
* otherwise the manifest key in sentence case with its separators as spaces
|
|
45
|
-
* (`session-reviewer` → "Session reviewer"). One helper, so the sidebar, the
|
|
46
|
-
* agent page, the index and the hover hint name an agent the same way.
|
|
47
|
-
*/
|
|
48
|
-
export declare function agentDisplayName(slug: string): string;
|
|
49
|
-
export {};
|
|
42
|
+
export { agentDisplayName } from '../../_vendor/shared/index.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from '../lib/utils.js';
|
|
4
4
|
import { Hint } from '../../primitives/hint.js';
|
|
5
|
-
import {
|
|
5
|
+
import { agentDisplayName } from '../../_vendor/kortix-shared.js';
|
|
6
6
|
import { pixelMark } from '../lib/pixel-mark.js';
|
|
7
7
|
/** Mark size → tile size. The mark is a multiple of 7, so each pixel lands on
|
|
8
8
|
* whole device pixels; any other size blurs the edges. Literal px because
|
|
@@ -50,21 +50,4 @@ export function AgentMark({ slug, size = 14, tile = TILE[size], label, className
|
|
|
50
50
|
const mark = (_jsx("span", { "aria-hidden": true, "data-slot": "agent-mark", style: { ...agentMarkVars(slug), width: tile, height: tile }, className: cn('inline-flex shrink-0 items-center justify-center bg-(--mark-tile)', size >= 28 ? 'rounded-md' : 'rounded-sm', agentMarkTileClass(slug), className), children: _jsx(AgentMarkGlyph, { slug: slug, size: size }) }));
|
|
51
51
|
return (_jsx(Hint, { side: "top", sideOffset: 6, alignOffset: 0, label: label ?? agentDisplayName(slug), children: mark }));
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
* An agent's name as a person reads it: My Kortix for the built-in agent,
|
|
55
|
-
* otherwise the manifest key in sentence case with its separators as spaces
|
|
56
|
-
* (`session-reviewer` → "Session reviewer"). One helper, so the sidebar, the
|
|
57
|
-
* agent page, the index and the hover hint name an agent the same way.
|
|
58
|
-
*/
|
|
59
|
-
export function agentDisplayName(slug) {
|
|
60
|
-
if (isMyKortixAgentName(slug))
|
|
61
|
-
return MY_KORTIX_DISPLAY_NAME;
|
|
62
|
-
// Model tool input and event data reach this through `as string` casts, so the
|
|
63
|
-
// slug is `unknown` at runtime. A truthy non-string degrades to its string
|
|
64
|
-
// form instead of crashing the render tree (KRTX-4511: `e.replace is not a
|
|
65
|
-
// function` took down the session page).
|
|
66
|
-
if (typeof slug !== 'string')
|
|
67
|
-
return String(slug);
|
|
68
|
-
const words = slug.replace(/[-_]+/g, ' ').trim();
|
|
69
|
-
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
70
|
-
}
|
|
53
|
+
export { agentDisplayName } from '../../_vendor/kortix-shared.js';
|
|
@@ -30,6 +30,10 @@ export type AccountStateLike = Pick<AccountState, 'billing_state' | 'has_active_
|
|
|
30
30
|
total?: number | null;
|
|
31
31
|
lifetime_granted?: number | null;
|
|
32
32
|
lifetime_purchased?: number | null;
|
|
33
|
+
free_grant?: {
|
|
34
|
+
eligible: boolean;
|
|
35
|
+
claimed_workspace_id: string | null;
|
|
36
|
+
} | null;
|
|
33
37
|
} | null;
|
|
34
38
|
subscription?: {
|
|
35
39
|
subscription_id?: string | null;
|
|
@@ -61,6 +65,22 @@ export declare const RUN_FLOOR_USD = 0.01;
|
|
|
61
65
|
* subscription there, never only "Continue on Free" (review finding 10).
|
|
62
66
|
*/
|
|
63
67
|
export declare function billingModalNeedsTopUp(accountState: AccountStateLike | null | undefined, state: BillingState | null): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the person's free credits are unspent while THIS workspace has none
|
|
70
|
+
* (KRTX-4713). A further workspace on Free holds no grant by design — the
|
|
71
|
+
* person's free credits live in their first workspace, reported as
|
|
72
|
+
* `free_grant: { eligible: false, claimed_workspace_id }`. Opening that
|
|
73
|
+
* workspace must never greet them with the Out-of-credits modal while those
|
|
74
|
+
* credits still cover a run: the modal waits for an actual blocked turn (the
|
|
75
|
+
* send gate, a 402). Returns
|
|
76
|
+
*
|
|
77
|
+
* - `false` — not the case: no claim elsewhere, or the claimed wallet is dry
|
|
78
|
+
* (a true zero balance — the modal may open);
|
|
79
|
+
* - `true` — the claimed workspace's wallet still runs: hold the modal;
|
|
80
|
+
* - `undefined` — a claim exists but the claimed workspace's state has not
|
|
81
|
+
* loaded: hold the modal until it does (`useFreeGrantUnspent` reads it).
|
|
82
|
+
*/
|
|
83
|
+
export declare function freeGrantUnspentElsewhere(state: AccountStateLike | null | undefined, claimedState: AccountStateLike | null | undefined): boolean | undefined;
|
|
64
84
|
/**
|
|
65
85
|
* Warn below this wallet value (dollars) on an account that is still running,
|
|
66
86
|
* or below a fifth of what the account has been given, whichever is lower
|
|
@@ -76,6 +76,28 @@ export function billingModalNeedsTopUp(accountState, state) {
|
|
|
76
76
|
const balance = accountState?.credits?.total;
|
|
77
77
|
return typeof balance === 'number' && balance < RUN_FLOOR_USD;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Whether the person's free credits are unspent while THIS workspace has none
|
|
81
|
+
* (KRTX-4713). A further workspace on Free holds no grant by design — the
|
|
82
|
+
* person's free credits live in their first workspace, reported as
|
|
83
|
+
* `free_grant: { eligible: false, claimed_workspace_id }`. Opening that
|
|
84
|
+
* workspace must never greet them with the Out-of-credits modal while those
|
|
85
|
+
* credits still cover a run: the modal waits for an actual blocked turn (the
|
|
86
|
+
* send gate, a 402). Returns
|
|
87
|
+
*
|
|
88
|
+
* - `false` — not the case: no claim elsewhere, or the claimed wallet is dry
|
|
89
|
+
* (a true zero balance — the modal may open);
|
|
90
|
+
* - `true` — the claimed workspace's wallet still runs: hold the modal;
|
|
91
|
+
* - `undefined` — a claim exists but the claimed workspace's state has not
|
|
92
|
+
* loaded: hold the modal until it does (`useFreeGrantUnspent` reads it).
|
|
93
|
+
*/
|
|
94
|
+
export function freeGrantUnspentElsewhere(state, claimedState) {
|
|
95
|
+
const grant = state?.credits?.free_grant;
|
|
96
|
+
if (grant?.eligible !== false || !grant.claimed_workspace_id)
|
|
97
|
+
return false;
|
|
98
|
+
const canRun = claimedState?.credits?.can_run;
|
|
99
|
+
return typeof canRun === 'boolean' ? canRun : undefined;
|
|
100
|
+
}
|
|
79
101
|
/**
|
|
80
102
|
* Warn below this wallet value (dollars) on an account that is still running,
|
|
81
103
|
* or below a fifth of what the account has been given, whichever is lower
|
|
@@ -214,7 +214,6 @@ export const handleApiError = (error, context, tI18nComplete) => {
|
|
|
214
214
|
(typeof errAny === 'object' ? errAny : null);
|
|
215
215
|
const v2Code = v2Detail?.code ?? errAny?.code;
|
|
216
216
|
const v2Message = v2Detail?.message ?? v2Detail?.error ?? errAny?.message;
|
|
217
|
-
const v2Balance = typeof v2Detail?.balance === 'number' ? v2Detail.balance : 0;
|
|
218
217
|
// The blocked account (e.g. the project's team account), surfaced by the
|
|
219
218
|
// billing 402s. Scopes the upgrade dialog so a non-billing member sees the
|
|
220
219
|
// team's gated CTA, not their own primary account. Absent → primary account.
|
|
@@ -241,7 +240,6 @@ export const handleApiError = (error, context, tI18nComplete) => {
|
|
|
241
240
|
useUpgradeDialogStore.getState().openUpgradeDialog({
|
|
242
241
|
reason: v2Code,
|
|
243
242
|
message: v2Message ?? '',
|
|
244
|
-
balance: v2Balance,
|
|
245
243
|
accountId: v2AccountId,
|
|
246
244
|
hasSubscription: typeof v2Detail?.has_subscription === 'boolean' ? v2Detail.has_subscription : undefined,
|
|
247
245
|
// The unambiguous state (billing-state.ts). Preferred over `code`, which
|
|
@@ -15,7 +15,7 @@ export function isModifiedClick(event) {
|
|
|
15
15
|
event.ctrlKey ||
|
|
16
16
|
event.shiftKey ||
|
|
17
17
|
event.altKey ||
|
|
18
|
-
// 0 = primary.
|
|
19
|
-
// button 0, so Enter still counts as an ordinary activation.
|
|
18
|
+
// 0 = primary. Keyboard activation (Enter on a button or menu item) fires
|
|
19
|
+
// a click with button 0, so Enter still counts as an ordinary activation.
|
|
20
20
|
event.button !== 0);
|
|
21
21
|
}
|
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
2
|
/**
|
|
3
|
-
* An agent's pixel mark on its tile
|
|
4
|
-
*
|
|
3
|
+
* An agent's pixel mark on its tile. The shape and the tone live in
|
|
4
|
+
* `@kortix/shared/pixel-mark`, so the API paints the same face (Slack posts).
|
|
5
5
|
*/
|
|
6
|
-
export { passesPixelMarkGate } from '../../_vendor/shared/pixel-mark.js';
|
|
7
|
-
export interface PixelMarkTone {
|
|
8
|
-
name: string;
|
|
9
|
-
tile: string;
|
|
10
|
-
ink: string;
|
|
11
|
-
/** Dark theme: the pair inverts, so the tile stays visible on a dark page. */
|
|
12
|
-
tileDark: string;
|
|
13
|
-
inkDark: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const PIXEL_MARK_TONES: readonly PixelMarkTone[];
|
|
16
|
-
export declare function pixelMark(slug: string): {
|
|
17
|
-
tone: PixelMarkTone;
|
|
18
|
-
grid: boolean[][];
|
|
19
|
-
path: string;
|
|
20
|
-
ditherPath: string;
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
};
|
|
6
|
+
export { passesPixelMarkGate, pixelMark, PIXEL_MARK_TONES, type PixelMarkTone } from '../../_vendor/shared/pixel-mark.js';
|
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* An agent's pixel mark on its tile
|
|
3
|
-
*
|
|
2
|
+
* An agent's pixel mark on its tile. The shape and the tone live in
|
|
3
|
+
* `@kortix/shared/pixel-mark`, so the API paints the same face (Slack posts).
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
export { passesPixelMarkGate } from '../../_vendor/kortix-shared.js';
|
|
7
|
-
const tone = (name, tile, ink) => ({
|
|
8
|
-
name,
|
|
9
|
-
tile,
|
|
10
|
-
ink,
|
|
11
|
-
tileDark: ink,
|
|
12
|
-
inkDark: tile,
|
|
13
|
-
});
|
|
14
|
-
export const PIXEL_MARK_TONES = [
|
|
15
|
-
tone('graphite', '#EDEDED', '#191919'),
|
|
16
|
-
tone('sand', '#F1EBDD', '#6B5A3A'),
|
|
17
|
-
tone('moss', '#E6EDE0', '#3F5A33'),
|
|
18
|
-
tone('sea', '#E2ECF0', '#2E5566'),
|
|
19
|
-
tone('blue', '#E6EEFF', '#2457C5'),
|
|
20
|
-
tone('plum', '#EEE6F0', '#5E3A68'),
|
|
21
|
-
tone('clay', '#F3E6E0', '#7A4532'),
|
|
22
|
-
tone('slate', '#E4E7EC', '#3B4656'),
|
|
23
|
-
];
|
|
24
|
-
/** The starter's `kortix` agent and My Kortix (slug `mykortix`) keep the brand tile. */
|
|
25
|
-
const BRAND = {
|
|
26
|
-
name: 'brand',
|
|
27
|
-
tile: '#1F1F1F',
|
|
28
|
-
ink: '#FFFFFF',
|
|
29
|
-
tileDark: '#2C2C2C',
|
|
30
|
-
inkDark: '#FFFFFF',
|
|
31
|
-
};
|
|
32
|
-
const RESERVED = { kortix: BRAND, mykortix: BRAND, meta: BRAND };
|
|
33
|
-
export function pixelMark(slug) {
|
|
34
|
-
const tone = RESERVED[slug] ?? PIXEL_MARK_TONES[fnv1a(`${slug}#tone`) % PIXEL_MARK_TONES.length];
|
|
35
|
-
return { ...pixelMarkShape(slug), tone };
|
|
36
|
-
}
|
|
5
|
+
export { passesPixelMarkGate, pixelMark, PIXEL_MARK_TONES } from '../../_vendor/kortix-shared.js';
|
|
@@ -66,7 +66,7 @@ export function NotificationInboxView({ rows, state, unreadCount, prompt, settin
|
|
|
66
66
|
const needsCount = tabUnreadCount(rows, 'needs');
|
|
67
67
|
const doneCount = tabUnreadCount(rows, 'done');
|
|
68
68
|
const settingsLabel = (_jsxs(_Fragment, { children: [_jsx(GearSixIcon, { className: "size-3.5 shrink-0" }), t('inbox.settings')] }));
|
|
69
|
-
const list = (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: cn('mx-auto flex w-full max-w-4xl flex-col gap-4 px-4 py-6 pb-20', !bare && 'md:px-8'), children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [header ? _jsx("h1", { className: "text-foreground text-xl font-medium text-balance", children: t('inbox.title') }) : null, _jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('inbox.description') })] }), _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsx(Tabs, { value: tab, onValueChange: (value) => setTab(value), children: _jsxs(TabsList, { children: [_jsxs(TabsTrigger, { value: "all", className: "gap-1.5", children: [t('inbox.tabAll'), unreadCount > 0 ? _jsx(CountBadge, { count: unreadCount }) : null] }), _jsxs(TabsTrigger, { value: "needs", className: "gap-1.5", children: [t('inbox.tabNeedsYou'), needsCount > 0 ? _jsx(CountBadge, { count: needsCount, tone: "waiting" }) : null] }), _jsxs(TabsTrigger, { value: "done", className: "gap-1.5", children: [t('inbox.tabDone'), doneCount > 0 ? _jsx(CountBadge, { count: doneCount }) : null] })] }) }), unreadCount > 0 ? (_jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: onMarkAllRead, children: [_jsx(ChecksIcon, { className: "size-3.5 shrink-0" }), t('inbox.markAllRead')] })) : null] }), prompt ? (_jsxs(BannerAlert, { variant: "default", children: [_jsx(BannerAlertMedia, { children: _jsx(BellIcon, {}) }), _jsx(BannerAlertTitle, { children: prompt }), _jsx(BannerAlertActions, { children: _jsxs(ButtonGroup, { children: [_jsx(Button, { variant: "secondary", size: "xs", onClick: onTurnOn, children: t('inbox.turnOn') }), _jsx(Hint, { label: t('inbox.dismiss'), side: "top", children: _jsx(Button, { variant: "secondary", size: "icon-sm", "aria-label": t('inbox.dismiss'), onClick: onDismissPrompt, children: _jsx(XIcon, { className: "size-3.5 shrink-0" }) }) })] }) })] })) : null, state === 'loading' ? (_jsx("div", { className: "space-y-0.5", children: [0, 1, 2].map((index) => (_jsx(Skeleton, { className: "h-14 w-full rounded-lg" }, index))) })) : state === 'error' ? (_jsx(ErrorState, { size: "sm", title: t('inbox.loadError'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: t('inbox.retry') }) })) : visible.length === 0 ? (_jsx(EmptyState, { size: "sm", media: _jsx(EmptyArt, { icon: BellIcon }), title: tab === 'needs' && rows.length > 0 ? t('inbox.emptyNeedsYou') : t('inbox.empty'), description: tab === 'needs' && rows.length > 0 ? t('inbox.emptyNeedsYouDescription') : t('inbox.emptyDescription') })) : (_jsx("ul", { className: "space-y-0.5", children: visible.map((row) => (_jsx("li", { children: _jsx(InboxRow, { row: row, onOpen: () => onOpenRow(row) }) }, row.id))) })), _jsxs("div", { className: "flex flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between", children: [_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('inbox.emailOptIn') }), 'href' in settings ? (_jsx(Button, { asChild: true, variant: "outline", size: "sm", className: "gap-1.5 self-start sm:self-auto", children: _jsx(UiLink, { href: settings.href, children: settingsLabel }) })) : (_jsx(Button, { variant: "outline", size: "sm", className: "gap-1.5 self-start sm:self-auto", onClick: settings.onOpen, children: settingsLabel }))] })] }) }));
|
|
69
|
+
const list = (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: cn('mx-auto flex w-full max-w-4xl flex-col gap-4 px-4 py-6 pb-20', !bare && 'md:px-8'), children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [header ? _jsx("h1", { className: "text-foreground text-xl font-medium text-balance", children: t('inbox.title') }) : null, _jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('inbox.description') })] }), _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsx(Tabs, { value: tab, onValueChange: (value) => setTab(value), children: _jsxs(TabsList, { variant: "secondary", size: "sm", children: [_jsxs(TabsTrigger, { value: "all", className: "w-fit flex-none gap-1.5 px-2.5", children: [t('inbox.tabAll'), unreadCount > 0 ? _jsx(CountBadge, { count: unreadCount }) : null] }), _jsxs(TabsTrigger, { value: "needs", className: "w-fit flex-none gap-1.5 px-2.5", children: [t('inbox.tabNeedsYou'), needsCount > 0 ? _jsx(CountBadge, { count: needsCount, tone: "waiting" }) : null] }), _jsxs(TabsTrigger, { value: "done", className: "w-fit flex-none gap-1.5 px-2.5", children: [t('inbox.tabDone'), doneCount > 0 ? _jsx(CountBadge, { count: doneCount }) : null] })] }) }), unreadCount > 0 ? (_jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: onMarkAllRead, children: [_jsx(ChecksIcon, { className: "size-3.5 shrink-0" }), t('inbox.markAllRead')] })) : null] }), prompt ? (_jsxs(BannerAlert, { variant: "default", children: [_jsx(BannerAlertMedia, { children: _jsx(BellIcon, {}) }), _jsx(BannerAlertTitle, { children: prompt }), _jsx(BannerAlertActions, { children: _jsxs(ButtonGroup, { children: [_jsx(Button, { variant: "secondary", size: "xs", onClick: onTurnOn, children: t('inbox.turnOn') }), _jsx(Hint, { label: t('inbox.dismiss'), side: "top", children: _jsx(Button, { variant: "secondary", size: "icon-sm", "aria-label": t('inbox.dismiss'), onClick: onDismissPrompt, children: _jsx(XIcon, { className: "size-3.5 shrink-0" }) }) })] }) })] })) : null, state === 'loading' ? (_jsx("div", { className: "space-y-0.5", children: [0, 1, 2].map((index) => (_jsx(Skeleton, { className: "h-14 w-full rounded-lg" }, index))) })) : state === 'error' ? (_jsx(ErrorState, { size: "sm", title: t('inbox.loadError'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: t('inbox.retry') }) })) : visible.length === 0 ? (_jsx(EmptyState, { size: "sm", media: _jsx(EmptyArt, { icon: BellIcon }), title: tab === 'needs' && rows.length > 0 ? t('inbox.emptyNeedsYou') : t('inbox.empty'), description: tab === 'needs' && rows.length > 0 ? t('inbox.emptyNeedsYouDescription') : t('inbox.emptyDescription') })) : (_jsx("ul", { className: "space-y-0.5", children: visible.map((row) => (_jsx("li", { children: _jsx(InboxRow, { row: row, onOpen: () => onOpenRow(row) }) }, row.id))) })), _jsxs("div", { className: "flex flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between", children: [_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('inbox.emailOptIn') }), 'href' in settings ? (_jsx(Button, { asChild: true, variant: "outline", size: "sm", className: "gap-1.5 self-start sm:self-auto", children: _jsx(UiLink, { href: settings.href, children: settingsLabel }) })) : (_jsx(Button, { variant: "outline", size: "sm", className: "gap-1.5 self-start sm:self-auto", onClick: settings.onOpen, children: settingsLabel }))] })] }) }));
|
|
70
70
|
if (bare)
|
|
71
71
|
return list;
|
|
72
72
|
return (
|
|
@@ -12,7 +12,7 @@ interface ActiveSpaceState {
|
|
|
12
12
|
byProject: ActiveByProject;
|
|
13
13
|
setSpace: (projectId: string, space: string | null) => void;
|
|
14
14
|
}
|
|
15
|
-
export declare const useActiveSpaceStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ActiveSpaceState>, "
|
|
15
|
+
export declare const useActiveSpaceStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ActiveSpaceState>, "persist" | "setState"> & {
|
|
16
16
|
setState(partial: ActiveSpaceState | Partial<ActiveSpaceState> | ((state: ActiveSpaceState) => ActiveSpaceState | Partial<ActiveSpaceState>), replace?: false | undefined): unknown;
|
|
17
17
|
setState(state: ActiveSpaceState | ((state: ActiveSpaceState) => ActiveSpaceState), replace: true): unknown;
|
|
18
18
|
persist: {
|
|
@@ -20,7 +20,7 @@ interface BrowserRecentsState {
|
|
|
20
20
|
removeRecent: (url: string) => void;
|
|
21
21
|
clearRecents: () => void;
|
|
22
22
|
}
|
|
23
|
-
export declare const useBrowserRecentsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<BrowserRecentsState>, "
|
|
23
|
+
export declare const useBrowserRecentsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<BrowserRecentsState>, "persist" | "setState"> & {
|
|
24
24
|
setState(partial: BrowserRecentsState | Partial<BrowserRecentsState> | ((state: BrowserRecentsState) => BrowserRecentsState | Partial<BrowserRecentsState>), replace?: false | undefined): unknown;
|
|
25
25
|
setState(state: BrowserRecentsState | ((state: BrowserRecentsState) => BrowserRecentsState), replace: true): unknown;
|
|
26
26
|
persist: {
|
|
@@ -12,7 +12,7 @@ interface CurrentAccountState {
|
|
|
12
12
|
setSelectedAccountId: (id: string | null) => void;
|
|
13
13
|
clear: () => void;
|
|
14
14
|
}
|
|
15
|
-
export declare const useCurrentAccountStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<CurrentAccountState>, "
|
|
15
|
+
export declare const useCurrentAccountStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<CurrentAccountState>, "persist" | "setState"> & {
|
|
16
16
|
setState(partial: CurrentAccountState | Partial<CurrentAccountState> | ((state: CurrentAccountState) => CurrentAccountState | Partial<CurrentAccountState>), replace?: false | undefined): unknown;
|
|
17
17
|
setState(state: CurrentAccountState | ((state: CurrentAccountState) => CurrentAccountState), replace: true): unknown;
|
|
18
18
|
persist: {
|
|
@@ -4,7 +4,7 @@ interface FirstChatState {
|
|
|
4
4
|
start: (projectId: string) => void;
|
|
5
5
|
finish: (projectId: string) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare const useFirstChatStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<FirstChatState>, "
|
|
7
|
+
export declare const useFirstChatStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<FirstChatState>, "persist" | "setState"> & {
|
|
8
8
|
setState(partial: FirstChatState | Partial<FirstChatState> | ((state: FirstChatState) => FirstChatState | Partial<FirstChatState>), replace?: false | undefined): unknown;
|
|
9
9
|
setState(state: FirstChatState | ((state: FirstChatState) => FirstChatState), replace: true): unknown;
|
|
10
10
|
persist: {
|
|
@@ -3,7 +3,7 @@ interface MobileAppPromoState {
|
|
|
3
3
|
closed: boolean;
|
|
4
4
|
close: () => void;
|
|
5
5
|
}
|
|
6
|
-
export declare const useMobileAppPromoStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<MobileAppPromoState>, "
|
|
6
|
+
export declare const useMobileAppPromoStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<MobileAppPromoState>, "persist" | "setState"> & {
|
|
7
7
|
setState(partial: MobileAppPromoState | Partial<MobileAppPromoState> | ((state: MobileAppPromoState) => MobileAppPromoState | Partial<MobileAppPromoState>), replace?: false | undefined): unknown;
|
|
8
8
|
setState(state: MobileAppPromoState | ((state: MobileAppPromoState) => MobileAppPromoState), replace: true): unknown;
|
|
9
9
|
persist: {
|
|
@@ -72,7 +72,7 @@ interface SessionBrowserState {
|
|
|
72
72
|
activeSessionId: string | null;
|
|
73
73
|
setActiveSessionId: (id: string | null) => void;
|
|
74
74
|
}
|
|
75
|
-
export declare const useSessionBrowserStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SessionBrowserState>, "
|
|
75
|
+
export declare const useSessionBrowserStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SessionBrowserState>, "persist" | "setState"> & {
|
|
76
76
|
setState(partial: SessionBrowserState | Partial<SessionBrowserState> | ((state: SessionBrowserState) => SessionBrowserState | Partial<SessionBrowserState>), replace?: false | undefined): unknown;
|
|
77
77
|
setState(state: SessionBrowserState | ((state: SessionBrowserState) => SessionBrowserState), replace: true): unknown;
|
|
78
78
|
persist: {
|
|
@@ -5,7 +5,7 @@ interface State {
|
|
|
5
5
|
toggleExpanded: (projectId: string, id: string) => void;
|
|
6
6
|
}
|
|
7
7
|
export declare const selectExpandedIds: (projectId: string) => (s: State) => readonly string[];
|
|
8
|
-
export declare const useSessionExpandedStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State>, "
|
|
8
|
+
export declare const useSessionExpandedStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State>, "persist" | "setState"> & {
|
|
9
9
|
setState(partial: State | Partial<State> | ((state: State) => State | Partial<State>), replace?: false | undefined): unknown;
|
|
10
10
|
setState(state: State | ((state: State) => State), replace: true): unknown;
|
|
11
11
|
persist: {
|
|
@@ -75,7 +75,7 @@ export declare const selectHiddenSections: (projectId: string, surface?: Session
|
|
|
75
75
|
* to see everything should do.
|
|
76
76
|
*/
|
|
77
77
|
export declare const selectCollapsedSections: (projectId: string, surface?: SessionViewSurface) => (s: State) => string[];
|
|
78
|
-
export declare const useSessionFilterStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State & Actions>, "
|
|
78
|
+
export declare const useSessionFilterStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State & Actions>, "persist" | "setState"> & {
|
|
79
79
|
setState(partial: (State & Actions) | Partial<State & Actions> | ((state: State & Actions) => (State & Actions) | Partial<State & Actions>), replace?: false | undefined): unknown;
|
|
80
80
|
setState(state: (State & Actions) | ((state: State & Actions) => State & Actions), replace: true): unknown;
|
|
81
81
|
persist: {
|
|
@@ -7,7 +7,7 @@ interface State {
|
|
|
7
7
|
dismissRestore: (sessionId: string, generation: number) => void;
|
|
8
8
|
setOutOfContext: (sessionId: string, present: boolean) => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const useSessionHistoryViewStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State>, "
|
|
10
|
+
export declare const useSessionHistoryViewStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<State>, "persist" | "setState"> & {
|
|
11
11
|
setState(partial: State | Partial<State> | ((state: State) => State | Partial<State>), replace?: false | undefined): unknown;
|
|
12
12
|
setState(state: State | ((state: State) => State), replace: true): unknown;
|
|
13
13
|
persist: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Which session row's brief is showing, for the whole sidebar at once.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* `HoverCard` has no group concept — each instance owns its own delays and
|
|
6
6
|
* knows nothing about its siblings — so moving between two rows played out as
|
|
7
7
|
* "row A closes after 100ms, row B opens after 200ms": the card vanished and
|
|
8
8
|
* came back somewhere else. `Tooltip.Provider` solves this with
|
|
@@ -3,7 +3,7 @@ import { create } from 'zustand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Which session row's brief is showing, for the whole sidebar at once.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* `HoverCard` has no group concept — each instance owns its own delays and
|
|
7
7
|
* knows nothing about its siblings — so moving between two rows played out as
|
|
8
8
|
* "row A closes after 100ms, row B opens after 200ms": the card vanished and
|
|
9
9
|
* came back somewhere else. `Tooltip.Provider` solves this with
|
|
@@ -41,7 +41,7 @@ interface SessionPanelMemoryState {
|
|
|
41
41
|
/** Remember what `sessionId`'s panel shows; null forgets it. */
|
|
42
42
|
remember: (sessionId: string, panel: RememberedPanel | null) => void;
|
|
43
43
|
}
|
|
44
|
-
export declare const useSessionPanelMemoryStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SessionPanelMemoryState>, "
|
|
44
|
+
export declare const useSessionPanelMemoryStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SessionPanelMemoryState>, "persist" | "setState"> & {
|
|
45
45
|
setState(partial: SessionPanelMemoryState | Partial<SessionPanelMemoryState> | ((state: SessionPanelMemoryState) => SessionPanelMemoryState | Partial<SessionPanelMemoryState>), replace?: false | undefined): unknown;
|
|
46
46
|
setState(state: SessionPanelMemoryState | ((state: SessionPanelMemoryState) => SessionPanelMemoryState), replace: true): unknown;
|
|
47
47
|
persist: {
|
|
@@ -35,7 +35,7 @@ interface SoundState {
|
|
|
35
35
|
/** Check if a specific event should play sound */
|
|
36
36
|
isEventEnabled: (event: SoundEvent) => boolean;
|
|
37
37
|
}
|
|
38
|
-
export declare const useSoundStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SoundState>, "
|
|
38
|
+
export declare const useSoundStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SoundState>, "persist" | "setState"> & {
|
|
39
39
|
setState(partial: SoundState | Partial<SoundState> | ((state: SoundState) => SoundState | Partial<SoundState>), replace?: false | undefined): unknown;
|
|
40
40
|
setState(state: SoundState | ((state: SoundState) => SoundState), replace: true): unknown;
|
|
41
41
|
persist: {
|
|
@@ -40,7 +40,7 @@ interface TabState {
|
|
|
40
40
|
/** Set the active tab */
|
|
41
41
|
setActiveTab: (tabId: string) => void;
|
|
42
42
|
}
|
|
43
|
-
export declare const useTabStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<TabState>, "
|
|
43
|
+
export declare const useTabStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<TabState>, "persist" | "setState"> & {
|
|
44
44
|
setState(partial: TabState | Partial<TabState> | ((state: TabState) => TabState | Partial<TabState>), replace?: false | undefined): unknown;
|
|
45
45
|
setState(state: TabState | ((state: TabState) => TabState), replace: true): unknown;
|
|
46
46
|
persist: {
|
|
@@ -5,7 +5,6 @@ interface UpgradeDialogState {
|
|
|
5
5
|
isOpen: boolean;
|
|
6
6
|
reason: UpgradeReason;
|
|
7
7
|
message: string;
|
|
8
|
-
balance: number;
|
|
9
8
|
/** The account that actually needs the upgrade (the blocked account from the
|
|
10
9
|
* 402 — e.g. the project's owning team account). `undefined` falls back to the
|
|
11
10
|
* user's primary account. The dialog scopes its billing state + subscribe
|
|
@@ -23,7 +22,6 @@ interface UpgradeDialogState {
|
|
|
23
22
|
openUpgradeDialog: (opts: {
|
|
24
23
|
reason?: UpgradeReason;
|
|
25
24
|
message?: string;
|
|
26
|
-
balance?: number;
|
|
27
25
|
accountId?: string;
|
|
28
26
|
hasSubscription?: boolean;
|
|
29
27
|
billingState?: BillingState;
|