@kortix/ui 0.16.1 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_vendor/kortix-shared.js +133 -26
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/space-icon.d.ts +30 -0
- package/dist/_vendor/shared/space-slug.d.ts +12 -0
- package/dist/access/access/access-dialog.js +2 -2
- package/dist/access/share-dialog.d.ts +77 -0
- package/dist/access/share-dialog.js +160 -0
- package/dist/access/sharing-picker.d.ts +8 -1
- package/dist/access/sharing-picker.js +2 -2
- package/dist/changes/change-list.js +3 -3
- package/dist/customize/connectors/catalog/catalog-paging.d.ts +1 -1
- package/dist/customize/connectors/catalog/catalog-paging.js +1 -1
- package/dist/customize/providers/provider-sheet.js +17 -7
- package/dist/customize/sections/component/manifest-copy-block.js +1 -1
- package/dist/customize/sections/component/section-wrapper.d.ts +1 -8
- package/dist/customize/sections/component/section-wrapper.js +3 -3
- package/dist/customize/sections/llm-provider/model-capability-icons.js +1 -1
- package/dist/customize/sections/view/gateway/generation-controls.js +1 -1
- package/dist/customize/sections/view/git-view.js +1 -1
- package/dist/customize/settings/settings-tabs.js +0 -5
- package/dist/customize/settings/tabs/general-tab.js +2 -2
- package/dist/customize/shared/capability-page-shell.d.ts +2 -2
- package/dist/customize/shared/capability-page-shell.js +7 -5
- package/dist/customize/shared/capability-scroll-root.js +1 -2
- package/dist/customize/shared/catalog/catalog-card.js +1 -1
- package/dist/files/project/components/change-requests-panel.js +2 -2
- package/dist/files/project/components/checkpoint-detail-dialog.js +4 -4
- package/dist/files/project/components/checkpoints-panel.js +2 -2
- package/dist/files/project/components/drive-explorer.js +2 -2
- package/dist/files/project/components/file-breadcrumbs.js +1 -1
- package/dist/files/project/components/file-history-popover.js +2 -2
- package/dist/files/project/components/file-thumbnail.js +1 -1
- package/dist/files/project/components/open-change-request-dialog.js +1 -1
- package/dist/files/renderers/mermaid/mermaid-diagram.js +2 -2
- package/dist/files/renderers/show-content-renderer.js +6 -6
- package/dist/files/renderers/sqlite-renderer.js +8 -8
- package/dist/files/renderers/zip/zip-renderer.js +2 -2
- package/dist/files/viewer/file-content-renderer.js +5 -5
- package/dist/files/viewer/json-tree-view.js +3 -3
- package/dist/i18n/en.d.ts +131 -8
- package/dist/i18n/en.js +167 -44
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -3
- package/dist/internal/billing/use-cost-explorer.d.ts +9 -2
- package/dist/internal/billing/use-cost-explorer.js +22 -0
- package/dist/internal/billing/use-session-costs.d.ts +7 -2
- package/dist/internal/billing/use-session-costs.js +6 -0
- package/dist/internal/chrome/use-chrome-offered.d.ts +3 -3
- package/dist/internal/chrome/use-chrome-offered.js +3 -3
- package/dist/internal/components/nav-rail.d.ts +1 -20
- package/dist/internal/components/nav-rail.js +1 -15
- package/dist/internal/layout/project-page-header.d.ts +13 -9
- package/dist/internal/layout/project-page-header.js +14 -10
- package/dist/internal/lib/browser-noise/evidence.d.ts +2 -0
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +16 -1
- package/dist/internal/lib/error-handler.js +0 -9
- package/dist/internal/lib/interface-theme-defaults.js +2 -2
- package/dist/internal/lib/project-actions.d.ts +4 -5
- package/dist/internal/lib/project-actions.js +3 -5
- package/dist/internal/lib/project-preamble.d.ts +42 -4
- package/dist/internal/lib/project-preamble.js +49 -5
- package/dist/internal/lib/web-notifications.js +17 -29
- package/dist/internal/outcomes/outcome-vocabulary.js +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +2 -2
- package/dist/internal/stores/workspace-settings-rail-store.d.ts +0 -8
- package/dist/internal/stores/workspace-settings-rail-store.js +0 -2
- package/dist/lib/routes.d.ts +7 -0
- package/dist/lib/routes.js +6 -1
- package/dist/markdown/doc-editor/doc-extensions.js +2 -0
- package/dist/markdown/doc-editor/doc-paste.d.ts +13 -0
- package/dist/markdown/doc-editor/doc-paste.js +67 -0
- package/dist/markdown/markdown-frontmatter.js +3 -3
- package/dist/markdown/markdown-policy.d.ts +1 -1
- package/dist/markdown/ordered-list.js +1 -1
- package/dist/primitives/context-menu.d.ts +1 -0
- package/dist/primitives/definition-list.js +1 -1
- package/dist/primitives/dropdown-menu.d.ts +1 -0
- package/dist/primitives/emoji-picker.js +1 -1
- package/dist/primitives/expandable-search.d.ts +57 -0
- package/dist/primitives/expandable-search.js +58 -0
- package/dist/primitives/favicon-avatar.js +1 -1
- package/dist/primitives/file-tree.d.ts +1 -1
- package/dist/primitives/file-tree.js +1 -1
- package/dist/primitives/glyph-picker.js +2 -2
- package/dist/primitives/input-group.js +1 -1
- package/dist/primitives/menu-base.d.ts +10 -0
- package/dist/primitives/menu-base.js +7 -2
- package/dist/primitives/phone-input.js +1 -1
- package/dist/primitives/profile-hover-card.d.ts +28 -0
- package/dist/primitives/profile-hover-card.js +22 -0
- package/dist/primitives/settings-section-header.d.ts +5 -5
- package/dist/primitives/settings-section-header.js +5 -5
- package/dist/primitives/sort-menu.d.ts +23 -0
- package/dist/primitives/sort-menu.js +54 -0
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/toast-clearance.d.ts +12 -28
- package/dist/primitives/toast-clearance.js +23 -45
- package/dist/primitives/user-avatar.js +2 -3
- package/dist/session/agents/subagent-dialog-content.js +28 -70
- package/dist/session/composer/ComposerCard.d.ts +4 -1
- package/dist/session/composer/ComposerCard.js +51 -7
- package/dist/session/composer/composer-chat-input.js +3 -1
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +6 -2
- package/dist/session/composer/composer-underbar.d.ts +3 -1
- package/dist/session/composer/composer-underbar.js +2 -2
- package/dist/session/composer/composer.d.ts +12 -0
- package/dist/session/composer/composer.js +112 -6
- package/dist/session/composer/draft/composer-draft.d.ts +1 -0
- package/dist/session/composer/draft/composer-draft.js +10 -2
- package/dist/session/composer/draft/draft-uploads.js +13 -2
- package/dist/session/composer/draft/use-composer-draft.d.ts +2 -0
- package/dist/session/composer/draft/use-composer-draft.js +41 -6
- package/dist/session/composer/drive-mentions.d.ts +34 -0
- package/dist/session/composer/drive-mentions.js +98 -0
- package/dist/session/composer/editor/composer-editor.d.ts +3 -0
- package/dist/session/composer/editor/composer-editor.js +3 -1
- package/dist/session/composer/editor/serialize.js +3 -4
- package/dist/session/composer/menus/mention-controller.d.ts +3 -0
- package/dist/session/composer/menus/mention-controller.js +5 -0
- package/dist/session/composer/menus/mention-menu.d.ts +20 -3
- package/dist/session/composer/menus/mention-menu.js +33 -6
- package/dist/session/composer/menus/menu-items.d.ts +16 -1
- package/dist/session/composer/menus/menu-items.js +21 -1
- package/dist/session/composer/submit-latch.d.ts +3 -1
- package/dist/session/composer/submit-latch.js +5 -1
- package/dist/session/composer/types.d.ts +9 -2
- package/dist/session/header/session-changes-indicator.js +1 -1
- package/dist/session/header/session-site-header.js +2 -2
- package/dist/session/media/sandbox-url-detector.js +3 -3
- package/dist/session/models/model-connection-gate.d.ts +5 -0
- package/dist/session/models/model-connection-gate.js +12 -3
- package/dist/session/models/model-connection-layout.d.ts +7 -0
- package/dist/session/models/model-connection-layout.js +7 -0
- package/dist/session/models/provider-failure-recovery.js +1 -1
- package/dist/session/models/subscription-offer.d.ts +6 -5
- package/dist/session/models/subscription-offer.js +6 -6
- package/dist/session/panel/advanced/advanced-panel.js +1 -1
- package/dist/session/panel/session-detail-panel.js +1 -1
- package/dist/session/panel/session-diff-viewer.js +1 -1
- package/dist/session/panel/session-files-explorer.js +1 -1
- package/dist/session/panel/session-files-panel.js +3 -3
- package/dist/session/panel/shared/action-navigator.js +1 -1
- package/dist/session/status/provisioning-failure.d.ts +4 -4
- package/dist/session/status/provisioning-failure.js +4 -4
- package/dist/session/status/session-busy-indicator.js +1 -1
- package/dist/session/status/session-error-banner.js +6 -1
- package/dist/session/thread/mention-chip.d.ts +1 -1
- package/dist/session/thread/mention-segments.d.ts +4 -2
- package/dist/session/thread/mention-segments.js +28 -1
- package/dist/session/thread/message-parsing.d.ts +11 -0
- package/dist/session/thread/message-parsing.js +22 -3
- package/dist/session/thread/optimistic-turn.d.ts +4 -2
- package/dist/session/thread/optimistic-turn.js +13 -11
- package/dist/session/thread/session-chat.js +6 -1
- package/dist/session/thread/session-context-message-explorer.js +1 -1
- package/dist/session/thread/session-older-autoload.d.ts +2 -3
- package/dist/session/thread/session-older-autoload.js +2 -3
- package/dist/session/thread/transcript.js +8 -10
- package/dist/session/tool/shared/error-and-connector.js +1 -1
- package/dist/session/tool/shared/file-list.js +2 -2
- package/dist/session/tool/shared/infrastructure-parts.js +1 -1
- package/dist/session/tool/shared/infrastructure-preview.js +1 -1
- package/dist/session/tool/shared/infrastructure-row-header.js +3 -3
- package/dist/session/tool/shared/infrastructure-rows.js +2 -2
- package/dist/session/tool/shared/output-block.js +4 -4
- package/dist/session/tool/shared/session-helpers.js +3 -3
- package/dist/session/tool/shared/structured-output.js +3 -3
- package/dist/session/tool/shared/todo-helpers.js +1 -1
- package/dist/session/tool/tool-error.js +2 -2
- package/dist/session/tool/tools/agent-spawn-tool.js +3 -3
- package/dist/session/tool/tools/agent-status-tool.js +1 -1
- package/dist/session/tool/tools/apply-patch-tool.js +1 -1
- package/dist/session/tool/tools/connector-get-tool.js +1 -1
- package/dist/session/tool/tools/connector-list-tool.js +1 -1
- package/dist/session/tool/tools/connector-tools.js +1 -1
- package/dist/session/tool/tools/edit-tool.js +1 -1
- package/dist/session/tool/tools/get-mem-tool.js +1 -1
- package/dist/session/tool/tools/glob-tool.js +1 -1
- package/dist/session/tool/tools/image-search-tool.js +1 -1
- package/dist/session/tool/tools/memory-search-tool.js +1 -1
- package/dist/session/tool/tools/memory-tool.js +4 -4
- package/dist/session/tool/tools/presentation-gen-tool.js +2 -2
- package/dist/session/tool/tools/project-delete-tool.js +1 -1
- package/dist/session/tool/tools/project-list-tool.js +1 -1
- package/dist/session/tool/tools/pty-read-tool.js +1 -1
- package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
- package/dist/session/tool/tools/pty-write-tool.js +1 -1
- package/dist/session/tool/tools/read-tool.js +1 -1
- package/dist/session/tool/tools/removed-connector-tool.js +1 -1
- package/dist/session/tool/tools/scrape-webpage-tool.js +1 -1
- package/dist/session/tool/tools/session-get-tool.js +3 -3
- package/dist/session/tool/tools/session-list-background-tool.js +1 -1
- package/dist/session/tool/tools/session-read-tool.js +1 -1
- package/dist/session/tool/tools/session-search-tool.js +1 -1
- package/dist/session/tool/tools/session-spawn-tool.js +1 -1
- package/dist/session/tool/tools/skill-tool.js +1 -1
- package/dist/session/tool/tools/todo-write-tool.js +1 -1
- package/dist/session/tool/tools/web-fetch-tool.js +1 -1
- package/dist/session/tool/tools/write-tool.js +1 -1
- package/dist/session/turn/activity-file-chips.js +7 -3
- package/dist/session/turn/activity-step.js +1 -1
- package/dist/session/turn/burst-summary-trigger.js +3 -3
- package/dist/session/turn/chain-step-trigger.js +1 -1
- package/dist/session/turn/plan-card.js +1 -1
- package/dist/session/turn/thought-chain-step.js +1 -1
- package/dist/session/turn/turn-work-accordion.js +1 -1
- package/dist/session/turn/user-message.js +13 -6
- package/dist/session/voice/use-call-card-position.d.ts +30 -0
- package/dist/session/voice/use-call-card-position.js +126 -0
- package/dist/session/voice/voice-call-card.js +10 -3
- package/dist/styles/theme.css +12 -0
- package/dist/styles/tokens.css +12 -6
- package/dist/styles.css +1 -1
- package/dist/terminal/session-terminal-panel.js +1 -1
- package/dist/test-utils/intl.d.ts +131 -8
- package/dist/workspace/admin/project-admin-dashboard.js +7 -24
- package/dist/workspace/calendar/calendar-page.js +1 -1
- package/dist/workspace/home/first-chat.d.ts +4 -3
- package/dist/workspace/home/first-chat.js +6 -6
- package/dist/workspace/home/welcome-body.js +2 -2
- package/dist/workspace/index.d.ts +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/layout/project-home.js +9 -3
- package/dist/workspace/layout/use-project-home-send.d.ts +3 -1
- package/dist/workspace/layout/use-project-home-send.js +6 -2
- package/dist/workspace/memory/company-memory-page.js +2 -4
- package/dist/workspace/new/github-source.js +0 -1
- package/dist/workspace/new/new-workspace-form.d.ts +0 -1
- package/dist/workspace/new/new-workspace-form.js +0 -3
- package/dist/workspace/new/use-create-workspace.d.ts +1 -1
- package/dist/workspace/new/use-create-workspace.js +1 -2
- package/dist/workspace/session-spaces/space-detail-page.d.ts +35 -0
- package/dist/workspace/session-spaces/space-detail-page.js +307 -0
- package/dist/workspace/session-spaces/space-form-modal.d.ts +16 -0
- package/dist/workspace/session-spaces/space-form-modal.js +92 -0
- package/dist/workspace/session-spaces/space-icon.d.ts +36 -0
- package/dist/workspace/session-spaces/space-icon.js +52 -0
- package/dist/workspace/session-spaces/space-people.d.ts +51 -0
- package/dist/workspace/session-spaces/space-people.js +91 -0
- package/dist/workspace/session-spaces/space-picker.d.ts +11 -0
- package/dist/workspace/session-spaces/space-picker.js +42 -0
- package/dist/workspace/session-spaces/space-share-modal.d.ts +14 -0
- package/dist/workspace/session-spaces/space-share-modal.js +93 -0
- package/dist/workspace/session-spaces/spaces-page.d.ts +8 -0
- package/dist/workspace/session-spaces/spaces-page.js +125 -0
- package/dist/workspace/sessions/session-owner-filters.d.ts +2 -0
- package/dist/workspace/sessions/session-owner-filters.js +2 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +1 -1
- package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +7 -2
- package/dist/workspace/sidebar/footer/project-promo-cards.js +4 -3
- package/dist/workspace/sidebar/footer/project-sandbox-alert.js +1 -1
- package/dist/workspace/sidebar/footer/promo-card.d.ts +10 -1
- package/dist/workspace/sidebar/footer/promo-card.js +31 -2
- package/dist/workspace/sidebar/modal/session-people-picker.d.ts +13 -0
- package/dist/workspace/sidebar/modal/session-people-picker.js +72 -0
- package/dist/workspace/sidebar/modal/share-session-modal.js +2 -1
- package/dist/workspace/sidebar/project-nav-items.d.ts +1 -3
- package/dist/workspace/sidebar/project-nav-items.js +3 -8
- package/dist/workspace/sidebar/project-session-list.js +19 -12
- package/dist/workspace/sidebar/project-sidebar.js +13 -13
- package/dist/workspace/sidebar/project-spaces-nav.js +1 -2
- package/dist/workspace/sidebar/session-filter-menu.js +19 -13
- package/dist/workspace/sidebar/session-group-sections.d.ts +12 -12
- package/dist/workspace/sidebar/session-group-sections.js +56 -75
- package/dist/workspace/sidebar/sidebar-more-group.js +1 -1
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +2 -2
- package/dist/workspace/spaces/space-tabs.d.ts +26 -6
- package/dist/workspace/spaces/space-tabs.js +19 -8
- package/package.json +27 -31
- package/skills/kortix-ui/references/modules.md +2 -2
- package/dist/workspace/new/clone-param.d.ts +0 -11
- package/dist/workspace/new/clone-param.js +0 -15
- package/dist/workspace/new/provision-new-workspace.d.ts +0 -14
- package/dist/workspace/new/provision-new-workspace.js +0 -14
- package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +0 -8
- package/dist/workspace/sidebar/footer/project-inbox-nav.js +0 -29
|
@@ -50,7 +50,7 @@ function ScrapeResultItem({ result }) {
|
|
|
50
50
|
const content = useMemo(() => getScrapeContent(result), [result]);
|
|
51
51
|
if (!url)
|
|
52
52
|
return null;
|
|
53
|
-
return (_jsxs(Disclosure, { className: "group", children: [_jsx(DisclosureTrigger, { children: _jsxs("div", { className: "hover:bg-muted flex w-full cursor-pointer items-center gap-2.5 rounded-sm px-2 py-2 transition-colors duration-150", children: [_jsx(CaretRightIcon, { className: "text-muted-foreground
|
|
53
|
+
return (_jsxs(Disclosure, { className: "group", children: [_jsx(DisclosureTrigger, { children: _jsxs("div", { className: "hover:bg-muted flex w-full cursor-pointer items-center gap-2.5 rounded-sm px-2 py-2 transition-colors duration-150", children: [_jsx(CaretRightIcon, { className: "text-muted-foreground size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90" }), _jsx(FaviconAvatar, { value: url, size: "xs", className: "shrink-0" }), _jsx("span", { className: "text-foreground min-w-0 flex-1 truncate text-sm", children: result.title || hostname }), !result.success && (_jsx(DangerTriangleSolid, { weight: "fill", className: cn('size-3 shrink-0', STATUS_TEXT.destructive) })), _jsx("span", { className: "text-muted-foreground max-w-[40%] shrink-0 truncate text-sm", children: hostname })] }) }), _jsx(DisclosureContent, { className: "p-0", children: _jsx(DisclosureBody, { className: "px-2 pb-2", children: _jsx("div", { className: cn('text-foreground/80 text-xs', MD_FLUSH_CLASSES), children: _jsx(UnifiedMarkdown, { content: content, trust: "untrusted", isStreaming: false }) }) }) })] }));
|
|
54
54
|
}
|
|
55
55
|
export function ScrapeWebpageTool({ call, defaultOpen, forceOpen, locked }) {
|
|
56
56
|
const tTools = useTranslations('tools');
|
|
@@ -36,10 +36,10 @@ export function SessionGetTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
36
36
|
title: parsed?.title ?? tHardcodedUi.raw('i18nComplete.text5885ace14d89'),
|
|
37
37
|
subtitle: parsed?.id || sid,
|
|
38
38
|
args: headerArgs,
|
|
39
|
-
}, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: isErrorOutput(output) ? (_jsx(ToolOutputFallback, { output: output, toolName: "session_get" })) : parsed ? (_jsxs("div", { className: "divide-border/20 divide-y", children: [_jsxs("div", { className: "text-muted-foreground
|
|
39
|
+
}, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: isErrorOutput(output) ? (_jsx(ToolOutputFallback, { output: output, toolName: "session_get" })) : parsed ? (_jsxs("div", { className: "divide-border/20 divide-y", children: [_jsxs("div", { className: "text-muted-foreground flex flex-wrap gap-x-4 gap-y-1 px-3 py-2.5 text-xs", children: [parsed.id && _jsx("span", { className: "font-mono text-xs", children: parsed.id }), parsed.created && (_jsxs("span", { className: "flex items-center gap-1", children: [_jsx(Clock, { className: "size-2.5" }), parsed.created] })), parsed.updated && parsed.updated !== parsed.created && (_jsxs("span", { className: "flex items-center gap-1", children: [_jsx(RefreshCw, { className: "size-2.5" }), parsed.updated] })), parsed.changes && (_jsxs("span", { className: "flex items-center gap-1", children: [_jsx(FileText, { className: "size-2.5" }), parsed.changes] })), parsed.parent && (_jsxs("span", { className: "flex items-center gap-1 font-mono text-xs", children: [tHardcodedUi.raw('i18nComplete.text8add5fd1782e'), " ", parsed.parent] }))] }), parsed.todos.length > 0 && (_jsxs(Disclosure, { open: showTodos, onOpenChange: setShowTodos, children: [_jsx(DisclosureTrigger, { children: _jsxs("button", { type: "button", className: "hover:bg-muted/20 flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left transition-colors", children: [showTodos ? (_jsx(ChevronDown, { className: "text-muted-foreground size-2.5" })) : (_jsx(ChevronRight, { className: "text-muted-foreground size-2.5" })), _jsx(ListTodo, { className: "text-muted-foreground size-3" }), _jsx("span", { className: "text-xs font-medium", children: tHardcodedUi.raw('i18nComplete.textbd02b9a7d71d') }), _jsx("span", { className: "text-muted-foreground ml-auto text-xs", children: parsed.todos.length })] }) }), _jsx(DisclosureContent, { children: _jsx("div", { className: "space-y-1 px-3 pb-2", children: parsed.todos.map((todo) => {
|
|
40
40
|
const isComplete = todo.status === 'completed';
|
|
41
41
|
const isProgress = todo.status === 'in_progress';
|
|
42
|
-
return (_jsxs("div", { className: "flex items-start gap-2 text-xs", children: [_jsxs("div", { className: cn('mt-[2px] flex h-3 w-3 shrink-0 items-center justify-center rounded border', isComplete && cn(STATUS_BG.success, STATUS_BORDER.success), isProgress && STATUS_BORDER.info, !isComplete && !isProgress && 'border-border'), children: [isComplete && _jsx(Check, { className: cn('size-2', STATUS_TEXT.success) }), isProgress && _jsx(StatusDot, { tone: "info" })] }), _jsx("span", { className: cn('leading-snug', isComplete && 'text-muted-foreground
|
|
43
|
-
}) }) })] })), parsed.hasConversation && parsed.conversation && (_jsxs(Disclosure, { open: showConv, onOpenChange: setShowConv, children: [_jsx(DisclosureTrigger, { children: _jsxs("button", { type: "button", className: "hover:bg-muted/20 flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left transition-colors", children: [showConv ? (_jsx(ChevronDown, { className: "text-muted-foreground
|
|
42
|
+
return (_jsxs("div", { className: "flex items-start gap-2 text-xs", children: [_jsxs("div", { className: cn('mt-[2px] flex h-3 w-3 shrink-0 items-center justify-center rounded border', isComplete && cn(STATUS_BG.success, STATUS_BORDER.success), isProgress && STATUS_BORDER.info, !isComplete && !isProgress && 'border-border'), children: [isComplete && _jsx(Check, { className: cn('size-2', STATUS_TEXT.success) }), isProgress && _jsx(StatusDot, { tone: "info" })] }), _jsx("span", { className: cn('leading-snug', isComplete && 'text-muted-foreground line-through', isProgress && 'font-medium'), children: todo.text })] }, todo.text));
|
|
43
|
+
}) }) })] })), parsed.hasConversation && parsed.conversation && (_jsxs(Disclosure, { open: showConv, onOpenChange: setShowConv, children: [_jsx(DisclosureTrigger, { children: _jsxs("button", { type: "button", className: "hover:bg-muted/20 flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left transition-colors", children: [showConv ? (_jsx(ChevronDown, { className: "text-muted-foreground size-2.5" })) : (_jsx(ChevronRight, { className: "text-muted-foreground size-2.5" })), _jsx(MessageCircle, { className: "text-muted-foreground size-3" }), _jsx("span", { className: "text-xs font-medium", children: tHardcodedUi.raw('i18nComplete.textccca18175753') }), _jsxs("span", { className: "text-muted-foreground ml-auto text-xs", children: [parsed.msgCount, ' ', tHardcodedUi.raw('componentsSessionToolRenderers.line5824JsxTextMsgs'), parsed.toolCount, " ", tHardcodedUi.raw('i18nComplete.textf9d35d43770d')] })] }) }), _jsx(DisclosureContent, { children: _jsx("div", { className: "px-3 py-2", children: _jsx(OutputBlock, { text: parsed.conversation, markdown: true }) }) })] })), parsed.compression && (_jsxs("div", { className: "text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs", children: [_jsx(Minimize2, { className: "size-2.5" }), _jsx("span", { children: parsed.compression })] })), !parsed.hasConversation && parsed.todos.length === 0 && (_jsx("div", { className: "px-3 py-3 text-center", children: _jsx("p", { className: "text-muted-foreground text-xs italic", children: tHardcodedUi.raw('componentsSessionToolRenderers.line5856JsxTextNoMessagesInThisSession') }) }))] })) : output ? (_jsx(ToolOutputFallback, { output: output, toolName: "session_get" })) : null }));
|
|
44
44
|
}
|
|
45
45
|
ToolRegistry.register('session-get', SessionGetTool);
|
|
@@ -24,7 +24,7 @@ export function SessionListBackgroundTool({ call, defaultOpen, forceOpen, locked
|
|
|
24
24
|
title: tHardcodedUi.raw('i18nComplete.textdb08291c7ba0'),
|
|
25
25
|
subtitle: project || tHardcodedUi.raw('i18nComplete.text1ff8ad6301d4'),
|
|
26
26
|
args: workers.length > 0 ? [`${workers.length} workers`] : noWorkers ? ['none'] : [],
|
|
27
|
-
}, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: workers.length > 0 ? (_jsx("div", { "data-scrollable": true, className: "divide-border/20 max-h-56 divide-y overflow-auto", children: workers.map((w) => (_jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [_jsx(StatusDot, { tone: w.status === 'running' ? 'info' : w.status === 'complete' ? 'success' : 'neutral', className: "shrink-0" }), _jsx("span", { className: "text-foreground/70 truncate font-mono text-xs", children: w.id.slice(-12) }), _jsx("span", { className: "text-muted-foreground
|
|
27
|
+
}, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: workers.length > 0 ? (_jsx("div", { "data-scrollable": true, className: "divide-border/20 max-h-56 divide-y overflow-auto", children: workers.map((w) => (_jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [_jsx(StatusDot, { tone: w.status === 'running' ? 'info' : w.status === 'complete' ? 'success' : 'neutral', className: "shrink-0" }), _jsx("span", { className: "text-foreground/70 truncate font-mono text-xs", children: w.id.slice(-12) }), _jsx("span", { className: "text-muted-foreground flex-1 truncate text-xs", children: w.project }), _jsx("span", { className: "text-muted-foreground text-xs", children: w.status })] }, w.id))) })) : outputIsError ? (_jsx(ToolOutputFallback, { output: output, toolName: "session_list" })) : output ? (_jsx(OutputBlock, { text: output, markdown: true })) : noWorkers ? (_jsx(ToolEmptyState, { message: tHardcodedUi.raw('componentsSessionToolRenderers.line6183JsxAttrMessageNoBackgroundSessions') })) : null }));
|
|
28
28
|
}
|
|
29
29
|
ToolRegistry.register('session-list', SessionListBackgroundTool);
|
|
30
30
|
ToolRegistry.register('session-list-background', SessionListBackgroundTool);
|
|
@@ -74,6 +74,6 @@ export function SessionReadTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
74
74
|
title: tI18nComplete('textc616e8ff6ba3', { value0: modeLabel }),
|
|
75
75
|
subtitle: sid,
|
|
76
76
|
args: statusArgs,
|
|
77
|
-
}, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: mode === 'tools' && toolEntries.length > 0 ? (_jsx("div", { "data-scrollable": true, className: "max-h-96 overflow-auto", children: toolEntries.map((entry) => (_jsxs("div", { className: "border-border/10 flex items-start gap-0 border-b last:border-b-0", children: [_jsx("span", { className: "w-6 shrink-0 py-1 text-center font-mono text-xs select-none", children: entry.status === 'completed' ? (_jsx(Check, { className: cn('inline size-2.5', STATUS_TEXT.success) })) : entry.status === 'pending' ? (_jsx(Clock, { className: "text-muted-foreground
|
|
77
|
+
}, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: mode === 'tools' && toolEntries.length > 0 ? (_jsx("div", { "data-scrollable": true, className: "max-h-96 overflow-auto", children: toolEntries.map((entry) => (_jsxs("div", { className: "border-border/10 flex items-start gap-0 border-b last:border-b-0", children: [_jsx("span", { className: "w-6 shrink-0 py-1 text-center font-mono text-xs select-none", children: entry.status === 'completed' ? (_jsx(Check, { className: cn('inline size-2.5', STATUS_TEXT.success) })) : entry.status === 'pending' ? (_jsx(Clock, { className: "text-muted-foreground inline size-2.5" })) : (_jsx(CircleAlert, { className: cn('inline size-2.5', STATUS_TEXT.destructive) })) }), _jsx("span", { className: "text-foreground/80 w-24 shrink-0 truncate py-1 font-mono text-xs font-medium", children: entry.tool }), _jsx("span", { className: "text-muted-foreground truncate py-1 pr-2 font-mono text-xs", children: entry.summary })] }, entry.at))) })) : outputIsError ? (_jsx(ToolOutputFallback, { output: output, toolName: "session_read" })) : output ? (_jsx(OutputBlock, { text: output, markdown: true })) : null }));
|
|
78
78
|
}
|
|
79
79
|
ToolRegistry.register('session-read', SessionReadTool);
|
|
@@ -26,6 +26,6 @@ export function SessionSearchTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
26
26
|
: noResults
|
|
27
27
|
? [tI18nComplete.raw('text0ed6af34915f')]
|
|
28
28
|
: [],
|
|
29
|
-
}, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: hits.length > 0 ? (_jsx("div", { "data-scrollable": true, className: "divide-border/20 max-h-96 divide-y overflow-auto", children: hits.map((h) => (_jsxs("div", { className: "hover:bg-muted/20 px-3 py-2 transition-colors", children: [_jsxs("div", { className: "mb-0.5 flex items-center gap-2", children: [_jsx("span", { className: "text-foreground flex-1 truncate text-xs font-medium", children: h.title || '(untitled)' }), _jsx("span", { className: "text-muted-foreground
|
|
29
|
+
}, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: hits.length > 0 ? (_jsx("div", { "data-scrollable": true, className: "divide-border/20 max-h-96 divide-y overflow-auto", children: hits.map((h) => (_jsxs("div", { className: "hover:bg-muted/20 px-3 py-2 transition-colors", children: [_jsxs("div", { className: "mb-0.5 flex items-center gap-2", children: [_jsx("span", { className: "text-foreground flex-1 truncate text-xs font-medium", children: h.title || '(untitled)' }), _jsx("span", { className: "text-muted-foreground bg-muted/40 shrink-0 rounded px-1 font-mono text-xs", children: h.score })] }), h.snippet && (_jsx("p", { className: "text-muted-foreground line-clamp-1 text-xs", children: h.snippet })), _jsxs("div", { className: "text-muted-foreground mt-0.5 flex items-center gap-2 text-xs", children: [_jsx("span", { className: "font-mono", children: h.id.slice(-12) }), _jsx("span", { children: h.updated })] })] }, h.id))) })) : noResults ? (_jsx(ToolEmptyState, { message: tI18nComplete('text1fc03af173f4', { value0: query }) })) : output ? (_jsx(ToolOutputFallback, { output: output, toolName: "session_search" })) : null }));
|
|
30
30
|
}
|
|
31
31
|
ToolRegistry.register('session-search', SessionSearchTool);
|
|
@@ -52,7 +52,7 @@ export function SessionSpawnTool({ call, forceOpen }) {
|
|
|
52
52
|
if (hasPreview)
|
|
53
53
|
setModalOpen(true);
|
|
54
54
|
};
|
|
55
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { "data-component": "tool-trigger", className: cn('group text-muted-foreground
|
|
55
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { "data-component": "tool-trigger", className: cn('group text-muted-foreground flex max-w-full items-center gap-1.5 py-0.5 text-xs transition-colors select-none', '[&>span:first-child>svg]:text-muted-foreground [&>span:first-child>svg]:size-3.5'), children: [_jsx("span", { className: "shrink-0", children: _jsx(Cpu, {}) }), _jsxs("button", { type: "button", disabled: !hasPreview, onClick: openPreview, className: cn('flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden text-left', hasPreview ? 'cursor-pointer' : 'cursor-default'), children: [_jsxs("span", { className: "shrink-0 whitespace-nowrap", children: [tI18nComplete.raw('text2ee7054bf895'), " ", agentName] }), subtitle && (_jsx("span", { className: "text-muted-foreground min-w-0 truncate font-mono text-xs", children: subtitle })), isRunning && (_jsx("span", { className: "ml-auto size-2 shrink-0 animate-pulse rounded-full bg-current opacity-50" })), isCompleted && childCalls.length > 0 && (_jsxs("span", { className: "text-muted-foreground ml-auto shrink-0 font-mono text-xs whitespace-nowrap", children: [childCalls.length, " ", tI18nComplete.raw('textb7595e2a8639')] }))] }), childHref && (_jsx(Button, { asChild: true, variant: "ghost", size: "xs", className: "h-6 shrink-0 gap-1 px-1.5 text-xs", children: _jsxs(Link, { href: childHref, prefetch: true, children: [tI18nComplete.raw('textb205bb47f81a'), _jsx(ExternalLink, { className: "size-3" })] }) }))] }), forceOpen && childCalls.length > 0 && (_jsx(SubAgentActivity, { childSessionId: childSessionId, calls: childCalls })), _jsx(SubAgentStatusBanner, { childSessionId: childSessionId, childThread: childThread }), childSessionId && (_jsx(SubagentDialog, { open: modalOpen, onOpenChange: setModalOpen, sessionId: childSessionId, title: tI18nComplete('textc65feb0006ea', {
|
|
56
56
|
value0: agentName,
|
|
57
57
|
value1: label ? tI18nComplete('textb581fd88ea24', { value0: label }) : '',
|
|
58
58
|
}) }))] }));
|
|
@@ -42,6 +42,6 @@ export function SkillTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
42
42
|
return (_jsx(BasicTool, { icon: _jsx(FileDashedIcon, { className: "size-3.5 shrink-0" }), trigger: {
|
|
43
43
|
title: tI18nComplete.raw('text6df1bb18a59a'),
|
|
44
44
|
subtitle: rawName || undefined,
|
|
45
|
-
}, onSubtitleClick: docPath ? openSkillDoc : undefined, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, className: "overflow-hidden p-0", children: failure ? (_jsx(ToolOutputFallback, { output: output, toolName: "skill" })) : hasBody ? (_jsxs(_Fragment, { children: [documentContent ? _jsx(ToolMarkdownCard, { code: documentContent }) : null, skillFiles.length > 0 ? (_jsx(ToolResultCard, { bodyClassName: "space-y-0.5 px-2 py-1.5", children: skillFiles.map((file) => (_jsxs("div", { className: "text-muted-foreground
|
|
45
|
+
}, onSubtitleClick: docPath ? openSkillDoc : undefined, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, className: "overflow-hidden p-0", children: failure ? (_jsx(ToolOutputFallback, { output: output, toolName: "skill" })) : hasBody ? (_jsxs(_Fragment, { children: [documentContent ? _jsx(ToolMarkdownCard, { code: documentContent }) : null, skillFiles.length > 0 ? (_jsx(ToolResultCard, { bodyClassName: "space-y-0.5 px-2 py-1.5", children: skillFiles.map((file) => (_jsxs("div", { className: "text-muted-foreground flex items-center gap-1.5 font-mono text-xs", children: [_jsx(FileDashedIcon, { className: "text-muted-foreground size-3 shrink-0" }), _jsx("span", { className: "truncate", children: file })] }, file))) })) : null] })) : null }));
|
|
46
46
|
}
|
|
47
47
|
ToolRegistry.register('skill', SkillTool);
|
|
@@ -48,7 +48,7 @@ export function TodoWriteTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
48
48
|
});
|
|
49
49
|
}, [todos]);
|
|
50
50
|
const subtitle = active ? active.content : total ? `${done} of ${total} done` : undefined;
|
|
51
|
-
return (_jsx(BasicTool, { icon: _jsx(ListTodo, { className: "size-3.5 shrink-0" }), trigger: { title: tI18nHardcoded.raw('i18nComplete.textbd02b9a7d71d'), subtitle }, badge: total ? (_jsxs("span", { className: "tabular-nums", children: [done, "/", total] })) : undefined, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: total > 0 ? (_jsxs("div", { "data-scrollable": true, className: "overflow-auto", children: [_jsx(Progress, { value: pct, className: "bg-primary/[0.08] mb-3 h-1", indicatorClassName: "bg-kortix-green" }), _jsx(Stepper, { orientation: "vertical", count: total, className: "flex w-full flex-col", children: keyedTodos.map(({ todo, key }, i) => (_jsxs("div", { className: "flex gap-2.5", children: [_jsxs(StepperItem, { step: i + 1, completed: todo.status === 'completed', className: "items-center", children: [_jsx(StepperTrigger, { asChild: true, children: _jsx("span", { className: "mt-px flex shrink-0 items-center justify-center", children: _jsx(TodoStatusIcon, { status: todo.status }) }) }), _jsx(StepperSeparator, { className: "bg-border group-data-[state=completed]/step:bg-kortix-green/40 m-0 my-0.5 group-data-[orientation=vertical]/stepper:min-h-1" })] }), _jsx("p", { className: cn('min-w-0 flex-1 text-xs leading-snug text-pretty', i + 1 < total && 'pb-3', todo.status === 'completed' && 'text-muted-foreground
|
|
51
|
+
return (_jsx(BasicTool, { icon: _jsx(ListTodo, { className: "size-3.5 shrink-0" }), trigger: { title: tI18nHardcoded.raw('i18nComplete.textbd02b9a7d71d'), subtitle }, badge: total ? (_jsxs("span", { className: "tabular-nums", children: [done, "/", total] })) : undefined, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: total > 0 ? (_jsxs("div", { "data-scrollable": true, className: "overflow-auto", children: [_jsx(Progress, { value: pct, className: "bg-primary/[0.08] mb-3 h-1", indicatorClassName: "bg-kortix-green" }), _jsx(Stepper, { orientation: "vertical", count: total, className: "flex w-full flex-col", children: keyedTodos.map(({ todo, key }, i) => (_jsxs("div", { className: "flex gap-2.5", children: [_jsxs(StepperItem, { step: i + 1, completed: todo.status === 'completed', className: "items-center", children: [_jsx(StepperTrigger, { asChild: true, children: _jsx("span", { className: "mt-px flex shrink-0 items-center justify-center", children: _jsx(TodoStatusIcon, { status: todo.status }) }) }), _jsx(StepperSeparator, { className: "bg-border group-data-[state=completed]/step:bg-kortix-green/40 m-0 my-0.5 group-data-[orientation=vertical]/stepper:min-h-1" })] }), _jsx("p", { className: cn('min-w-0 flex-1 text-xs leading-snug text-pretty', i + 1 < total && 'pb-3', todo.status === 'completed' && 'text-muted-foreground line-through', todo.status === 'in_progress' && 'text-foreground font-medium', todo.status === 'pending' && 'text-muted-foreground', todo.status === 'cancelled' && 'text-muted-foreground line-through'), children: todo.content })] }, key))) })] })) : (_jsx(ToolEmptyState, { message: tI18nHardcoded.raw('autoFeaturesSessionToolRenderersJsxAttrMessageNoTasksYet198712c5') })) }));
|
|
52
52
|
}
|
|
53
53
|
ToolRegistry.register('todowrite', TodoWriteTool);
|
|
54
54
|
ToolRegistry.register('todo-write', TodoWriteTool);
|
|
@@ -47,7 +47,7 @@ export function WebFetchTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
47
47
|
title: pageTitle || domain || url,
|
|
48
48
|
subtitle: showDomainSubtitle ? domain : undefined,
|
|
49
49
|
args: format ? [format] : undefined,
|
|
50
|
-
}, onSubtitleClick: safeUrl ? openUrl : undefined, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: !output ? null : isError && safeUrl ? (_jsxs("div", { "data-scrollable": true, className: "max-h-[28rem] overflow-auto", children: [_jsxs("a", { href: safeUrl, target: "_blank", rel: "noopener noreferrer", "data-component": "web-source-row", className: "group border-border/40 hover:bg-muted/30 flex items-center gap-2 border-b px-3 py-2", children: [_jsx(FaviconAvatar, { value: url, size: "xs", className: "shrink-0" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground group-hover:text-primary block truncate text-xs font-medium", children: domain }), _jsx("span", { className: "text-muted-foreground
|
|
50
|
+
}, onSubtitleClick: safeUrl ? openUrl : undefined, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: !output ? null : isError && safeUrl ? (_jsxs("div", { "data-scrollable": true, className: "max-h-[28rem] overflow-auto", children: [_jsxs("a", { href: safeUrl, target: "_blank", rel: "noopener noreferrer", "data-component": "web-source-row", className: "group border-border/40 hover:bg-muted/30 flex items-center gap-2 border-b px-3 py-2", children: [_jsx(FaviconAvatar, { value: url, size: "xs", className: "shrink-0" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground group-hover:text-primary block truncate text-xs font-medium", children: domain }), _jsx("span", { className: "text-muted-foreground block truncate font-mono text-[10px]", children: domain })] }), _jsx(ExternalLink, { className: "text-muted-foreground group-hover:text-foreground size-3 shrink-0" })] }), _jsx("p", { className: "text-muted-foreground px-3 py-2 font-mono text-xs leading-relaxed wrap-break-word whitespace-pre-wrap", children: errorSummary })] })) : readable ? (_jsxs("div", { "data-scrollable": true, className: "max-h-[28rem] overflow-auto", children: [_jsxs("a", { href: safeUrl ?? undefined, target: "_blank", rel: "noopener noreferrer", "data-component": "web-source-row", className: "group border-border/40 hover:bg-muted/30 flex items-center gap-2 border-b px-3 py-2", children: [_jsx(FaviconAvatar, { value: url, size: "xs", className: "shrink-0" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground group-hover:text-primary block truncate text-xs font-medium", children: readable.title || domain }), _jsx("span", { className: "text-muted-foreground block truncate font-mono text-[10px]", children: domain })] }), _jsx(ExternalLink, { className: "text-muted-foreground group-hover:text-foreground size-3 shrink-0" })] }), _jsx("p", { className: "text-foreground/80 px-3 py-2 text-xs leading-relaxed wrap-break-word whitespace-pre-wrap", children: readableText || tI18nHardcoded.raw('i18nComplete.texta94794d69ea1') }), _jsxs(Disclosure, { open: rawOpen, onOpenChange: setRawOpen, children: [_jsx(DisclosureTrigger, { children: _jsxs("button", { type: "button", className: "border-border/40 text-muted-foreground hover:text-foreground flex w-full items-center gap-1.5 border-t px-3 py-2 text-xs transition-colors", children: [_jsx(ChevronRight, { className: cn('size-3 transition-transform', rawOpen && 'rotate-90') }), tI18nHardcoded.raw('autoFeaturesSessionToolRenderersJsxTextViewRawHTMLa2f4484f')] }) }), _jsx(DisclosureContent, { children: _jsx("pre", { className: "text-muted-foreground max-h-96 overflow-auto px-3 pb-2 font-mono text-[11px] leading-relaxed wrap-break-word whitespace-pre-wrap", children: rawHtmlPreview }) })] })] })) : (_jsx(ToolOutputFallback, { output: output, isStreaming: status === 'running', toolName: "web_fetch" })) }));
|
|
51
51
|
}
|
|
52
52
|
ToolRegistry.register('webfetch', WebFetchTool);
|
|
53
53
|
ToolRegistry.register('web_fetch', WebFetchTool);
|
|
@@ -87,6 +87,6 @@ export function WriteTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
87
87
|
// A stale part is DONE waiting — the run it belonged to is over. The
|
|
88
88
|
// shimmer this used to draw promised content that could never arrive,
|
|
89
89
|
// on every restored session, forever.
|
|
90
|
-
_jsx(ToolResultCard, { bodyClassName: "px-2 py-1.5", children: _jsx("span", { className: "text-muted-foreground
|
|
90
|
+
_jsx(ToolResultCard, { bodyClassName: "px-2 py-1.5", children: _jsx("span", { className: "text-muted-foreground text-xs", children: tI18nComplete.raw('text93168435f3ae') }) })) : null, _jsx(DiagnosticsDisplay, { diagnostics: diagnostics, filePath: filePath })] }));
|
|
91
91
|
}
|
|
92
92
|
ToolRegistry.register('write', WriteTool);
|
|
@@ -218,10 +218,14 @@ function ActivityFileChipStepImpl({ calls, sessionId, disableNavigation, bare, }
|
|
|
218
218
|
const object = count === 1 && paths.length === 1
|
|
219
219
|
? toDisplayPath(paths[0])
|
|
220
220
|
: `${count} ${count === 1 ? 'file' : 'files'}`;
|
|
221
|
-
const
|
|
222
|
-
|
|
221
|
+
const verb = status === 'running' ? family.running : family.verb;
|
|
222
|
+
const failed = status === 'error' ? ` · ${failedCount} failed` : '';
|
|
223
|
+
const label = `${verb} ${object}${failed}`;
|
|
223
224
|
const Icon = iconFor(calls[0]);
|
|
224
|
-
return (_jsxs(_Fragment, { children: [_jsx(ChainStepTrigger, { status: status, icon: status === 'error' ? (_jsxs(_Fragment, { children: [_jsx(WarningIcon, { weight: "fill", "aria-label": tI18nComplete.raw('textf0103f528539'), className: cn('size-4 flex-none group-data-[state=open]/step:hidden', STATUS_TEXT.destructive) }), _jsx(Icon, { className: "text-muted-foreground hidden size-4 flex-none group-data-[state=open]/step:block" })] })) : (_jsx(Icon, { className: "text-muted-foreground size-4 flex-none" })), label: status === 'running' ? (_jsx(TextShimmer, { className: "min-w-0 truncate leading-[1.5] font-medium", children: label })) : (
|
|
225
|
+
return (_jsxs(_Fragment, { children: [_jsx(ChainStepTrigger, { status: status, icon: status === 'error' ? (_jsxs(_Fragment, { children: [_jsx(WarningIcon, { weight: "fill", "aria-label": tI18nComplete.raw('textf0103f528539'), className: cn('size-4 flex-none group-data-[state=open]/step:hidden', STATUS_TEXT.destructive) }), _jsx(Icon, { className: "text-muted-foreground hidden size-4 flex-none group-data-[state=open]/step:block" })] })) : (_jsx(Icon, { className: "text-muted-foreground size-4 flex-none" })), label: status === 'running' ? (_jsx(TextShimmer, { className: "min-w-0 truncate leading-[1.5] font-medium", children: label })) : (
|
|
226
|
+
// Verb, path and verdict as separate text nodes: a masked session
|
|
227
|
+
// replay keeps the verb and hides the path (apps/web replay-labels.ts).
|
|
228
|
+
_jsxs("span", { className: "min-w-0 truncate font-medium", children: [verb, " ", object, failed] })) }), _jsx(DisclosureContent, { children: _jsxs("div", { className: "mt-3 space-y-3 pl-7", children: [paths.length > 0 && (_jsx("ul", { className: "flex flex-wrap gap-2", children: paths.map((path) => (_jsx(FileChip, { path: path, onOpen: openPreview }, path))) })), fallbacks.length > 0 && (_jsx("div", { className: "space-y-3", children: fallbacks.map((call) => (_jsx(ActivityStep, { call: call, sessionId: sessionId, disableNavigation: disableNavigation }, call.id))) }))] }) })] }));
|
|
225
229
|
}
|
|
226
230
|
/**
|
|
227
231
|
* A chip is a path and a click. Both are stable — `openPreview` is a zustand
|
|
@@ -40,7 +40,7 @@ export function iconFor(call) {
|
|
|
40
40
|
* is neither tool nor reasoning still gets this row (`StepBody`).
|
|
41
41
|
*/
|
|
42
42
|
export function StepLabelRow({ label, running, bare, }) {
|
|
43
|
-
return (_jsx("div", { className: "min-w-0", children: _jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [!bare && _jsx(StackIcon, { className: "text-muted-foreground size-4 flex-none" }), _jsx("span", { className: "text-foreground/80 flex-none text-sm leading-[1.5]", children: running ? label.running : label.verb }), label.object && (_jsx("span", { className: "text-muted-foreground
|
|
43
|
+
return (_jsx("div", { className: "min-w-0", children: _jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [!bare && _jsx(StackIcon, { className: "text-muted-foreground size-4 flex-none" }), _jsx("span", { className: "text-foreground/80 flex-none text-sm leading-[1.5]", children: running ? label.running : label.verb }), label.object && (_jsx("span", { className: "text-muted-foreground min-w-0 truncate font-mono text-sm leading-[1.5]", title: label.object, children: label.object }))] }) }));
|
|
44
44
|
}
|
|
45
45
|
function ActivityStepImpl({ call, sessionId, disableNavigation, bare, }) {
|
|
46
46
|
/**
|
|
@@ -9,9 +9,9 @@ import { CaretRightIcon } from '@phosphor-icons/react';
|
|
|
9
9
|
* open state would rotate every burst caret nested inside it.
|
|
10
10
|
*/
|
|
11
11
|
const CARET_SCOPE = {
|
|
12
|
-
burst: 'group-hover/burst:text-
|
|
13
|
-
work: 'group-hover/work:text-
|
|
12
|
+
burst: 'group-hover/burst:text-foreground group-data-[state=open]/burst:rotate-90',
|
|
13
|
+
work: 'group-hover/work:text-foreground group-data-[state=open]/work:rotate-90',
|
|
14
14
|
};
|
|
15
15
|
export function BurstSummaryTrigger({ bare, running, title, scope = 'burst', }) {
|
|
16
|
-
return (_jsx(_Fragment, { children: _jsx(DisclosureTrigger, { className: "select-none", children: bare ? (_jsx("div", { className: "hidden", "aria-hidden": true })) : (_jsxs("div", { className: cn('text-muted-foreground
|
|
16
|
+
return (_jsx(_Fragment, { children: _jsx(DisclosureTrigger, { className: "select-none", children: bare ? (_jsx("div", { className: "hidden", "aria-hidden": true })) : (_jsxs("div", { className: cn('text-muted-foreground hover:text-foreground', 'flex w-full cursor-pointer items-center gap-2', 'text-left text-sm transition-colors'), children: [running ? (_jsx(TextShimmer, { className: cn('min-w-0 truncate tabular-nums', '[--base-color:color-mix(in_oklch,var(--muted-foreground)_55%,transparent)] [--base-gradient-color:var(--muted-foreground)]', 'dark:[--base-color:color-mix(in_oklch,var(--muted-foreground)_55%,transparent)] dark:[--base-gradient-color:var(--muted-foreground)]'), children: title })) : (_jsx("span", { className: "min-w-0 truncate tabular-nums", children: title })), _jsx(CaretRightIcon, { className: cn('text-muted-foreground size-3.5 flex-none transition-[transform,color]', CARET_SCOPE[scope]) })] })) }) }));
|
|
17
17
|
}
|
|
@@ -3,5 +3,5 @@ import { DisclosureTrigger } from '../../primitives/disclosure.js';
|
|
|
3
3
|
import { cn } from '../../lib/utils.js';
|
|
4
4
|
import { CaretRightIcon } from '@phosphor-icons/react';
|
|
5
5
|
export function ChainStepTrigger({ icon, label, trailing, status, }) {
|
|
6
|
-
return (_jsx(DisclosureTrigger, { children: _jsxs("div", { "data-status": status, className: cn('text-foreground/80 hover:text-foreground', 'flex w-full cursor-pointer items-center gap-3', 'text-left text-sm leading-[1.5] transition-colors'), children: [icon, label, trailing, _jsx(CaretRightIcon, { className: cn('text-muted-foreground
|
|
6
|
+
return (_jsx(DisclosureTrigger, { children: _jsxs("div", { "data-status": status, className: cn('text-foreground/80 hover:text-foreground', 'flex w-full cursor-pointer items-center gap-3', 'text-left text-sm leading-[1.5] transition-colors'), children: [icon, label, trailing, _jsx(CaretRightIcon, { className: cn('text-muted-foreground size-3.5 flex-none', 'transition-transform group-data-[state=open]/step:rotate-90') })] }) }));
|
|
7
7
|
}
|
|
@@ -319,5 +319,5 @@ export function PlanSteps({ rows, className, }) {
|
|
|
319
319
|
// No stepper rail. Each todo carries its own status glyph, so a connecting
|
|
320
320
|
// separator drew a second, weaker reading of the sequence the list already
|
|
321
321
|
// implies.
|
|
322
|
-
_jsx("ul", { className: cn('flex w-full flex-col gap-2', className), children: rows.map(({ todo, key }) => (_jsxs("li", { className: cn(RAIL_ROW, 'items-start'), children: [_jsx(TodoStatusIcon, { status: todo.status, className: cn(RAIL_SLOT, GLYPH_ON_FIRST_LINE) }), _jsx("p", { className: cn('min-w-0 flex-1 text-pretty', ROW_TEXT, todo.status === 'completed' && 'text-muted-foreground
|
|
322
|
+
_jsx("ul", { className: cn('flex w-full flex-col gap-2', className), children: rows.map(({ todo, key }) => (_jsxs("li", { className: cn(RAIL_ROW, 'items-start'), children: [_jsx(TodoStatusIcon, { status: todo.status, className: cn(RAIL_SLOT, GLYPH_ON_FIRST_LINE) }), _jsx("p", { className: cn('min-w-0 flex-1 text-pretty', ROW_TEXT, todo.status === 'completed' && 'text-muted-foreground line-through', todo.status === 'cancelled' && 'text-muted-foreground line-through', todo.status === 'in_progress' && 'text-foreground font-medium', todo.status === 'pending' && 'text-foreground/85'), children: todo.content })] }, key))) }));
|
|
323
323
|
}
|
|
@@ -64,7 +64,7 @@ function ThoughtStepBody({ texts, running }) {
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
}, [running, text]);
|
|
67
|
-
return (_jsx("div", { className: "min-w-0 flex-1", children: _jsx(FadedScrollArea, { ref: scrollRef, fadeColor: "from-background", rootClassName: cn('h-auto', THOUGHT_MAX_H), className: THOUGHT_MAX_H, children: _jsx("p", { className: "text-foreground
|
|
67
|
+
return (_jsx("div", { className: "min-w-0 flex-1", children: _jsx(FadedScrollArea, { ref: scrollRef, fadeColor: "from-background", rootClassName: cn('h-auto', THOUGHT_MAX_H), className: THOUGHT_MAX_H, children: _jsx("p", { className: "text-muted-foreground text-sm leading-[1.5] text-pretty", children: text }) }) }));
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Whole seconds since this row went live, or 0 when it is not.
|
|
@@ -28,5 +28,5 @@ export const WorkFoldContext = createContext(false);
|
|
|
28
28
|
*/
|
|
29
29
|
export const WorkTouchContext = createContext(null);
|
|
30
30
|
export function TurnWorkAccordion({ label, durationMs, open, onToggle, contentId, }) {
|
|
31
|
-
return (_jsx("div", { className: cn('flex items-center', open && 'border-border/60 border-b pb-2'), children: _jsxs("button", { type: "button", "aria-expanded": open, "aria-controls": open ? contentId : undefined, onClick: onToggle, className: cn('group/work text-muted-foreground
|
|
31
|
+
return (_jsx("div", { className: cn('flex items-center', open && 'border-border/60 border-b pb-2'), children: _jsxs("button", { type: "button", "aria-expanded": open, "aria-controls": open ? contentId : undefined, onClick: onToggle, className: cn('group/work text-muted-foreground hover:text-foreground flex min-w-0 cursor-pointer items-center gap-2', 'focus-visible:ring-ring/50 rounded-sm text-left text-sm transition-colors select-none focus-visible:ring-2 focus-visible:outline-none'), children: [_jsx("span", { className: "min-w-0 truncate tabular-nums", children: label ?? workedForLabel(durationMs) }), _jsx(CaretRightIcon, { "aria-hidden": true, className: cn('text-muted-foreground group-hover/work:text-foreground size-3.5 flex-none transition-[transform,color]', open && 'rotate-90') })] }) }));
|
|
32
32
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { attachmentMime } from '../../internal/lib/attachment-mime.js';
|
|
4
|
+
import { appendDriveRefs, keptDriveRefs } from '../../internal/lib/project-preamble.js';
|
|
4
5
|
import { AttachmentPreview } from './attachment-preview.js';
|
|
5
6
|
import { getFileCategory } from '../../files/viewer/preview-policy.js';
|
|
6
7
|
import { triggerHref } from '../../internal/lib/capability-tab-routes.js';
|
|
@@ -637,7 +638,7 @@ export function UserMessageBubble({ canExpand, expanded, onToggle, fullWidth, te
|
|
|
637
638
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
638
639
|
return (_jsxs("div", { className: cn(BUBBLE_SURFACE, 'relative overflow-hidden',
|
|
639
640
|
// 4px: `--radius` (10) minus 6, the corner under the sender's avatar.
|
|
640
|
-
tail && 'rounded-tr-[calc(var(--radius)-6px)]', fullWidth ? 'w-full' : 'w-fit'), children: [children && (_jsxs("div", { className: "relative", children: [_jsx("div", { ref: textRef, id: textId, className: cn('max-w-full min-w-0', !quoted && BUBBLE_TEXT, !expanded && 'max-h-[200px] overflow-hidden'), children: children }), canExpand && !expanded && (_jsx("div", { className: "from-muted pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t to-transparent" }))] })), children && canExpand && (_jsx("button", { type: "button", "aria-expanded": expanded, "aria-controls": textId, onClick: onToggle, className: "text-muted-foreground hover:text-foreground hit-area-x-2 hit-area-r-20 hit-area-y-2 focus-visible:ring-ring mt-1.5 self-start rounded-sm text-xs font-medium transition-colors duration-(--duration-normal) focus-visible:ring-2 focus-visible:outline-none print:hidden", children: expanded ? tI18nComplete.raw('text94ea9b1d33a0') : tI18nComplete.raw('textf5c9bd131486') }))] }));
|
|
641
|
+
tail && 'rounded-tr-[calc(var(--radius)-6px)]', fullWidth ? 'w-full' : 'w-fit'), children: [children && (_jsxs("div", { className: "relative", children: [_jsx("div", { ref: textRef, id: textId, "data-replay-content": "", className: cn('max-w-full min-w-0', !quoted && BUBBLE_TEXT, !expanded && 'max-h-[200px] overflow-hidden'), children: children }), canExpand && !expanded && (_jsx("div", { className: "from-muted pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t to-transparent" }))] })), children && canExpand && (_jsx("button", { type: "button", "aria-expanded": expanded, "aria-controls": textId, onClick: onToggle, className: "text-muted-foreground hover:text-foreground hit-area-x-2 hit-area-r-20 hit-area-y-2 focus-visible:ring-ring mt-1.5 self-start rounded-sm text-xs font-medium transition-colors duration-(--duration-normal) focus-visible:ring-2 focus-visible:outline-none print:hidden", children: expanded ? tI18nComplete.raw('text94ea9b1d33a0') : tI18nComplete.raw('textf5c9bd131486') }))] }));
|
|
641
642
|
}
|
|
642
643
|
// ============================================================================
|
|
643
644
|
// User message meta — when it was sent, what you can do
|
|
@@ -802,7 +803,7 @@ export function UserMessage({ message, author, showAuthor, agentNames, commandIn
|
|
|
802
803
|
// of workspace references that appeared in earlier text blocks.
|
|
803
804
|
const { rawText, textAfterFiles, quotes, uploads: uploadedFiles, pastes: partPastes, } = useMemo(() => parseAttachmentContent(message.blocks), [message.blocks]);
|
|
804
805
|
const { cleanText: textAfterProjects } = useMemo(() => parseProjectReferences(textAfterFiles), [textAfterFiles]);
|
|
805
|
-
const { cleanText: textAfterFileMentions, files: fileMentionRefs } = useMemo(() => parseFileMentionReferences(textAfterProjects), [textAfterProjects]);
|
|
806
|
+
const { cleanText: textAfterFileMentions, files: fileMentionRefs, drives: driveMentionRefs } = useMemo(() => parseFileMentionReferences(textAfterProjects), [textAfterProjects]);
|
|
806
807
|
const { cleanText: textAfterAgentMentions, agents: agentMentionRefs } = useMemo(() => parseAgentMentionReferences(textAfterFileMentions), [textAfterFileMentions]);
|
|
807
808
|
const { cleanText: textAfterSessions, sessions: sessionRefs } = useMemo(() => parseSessionReferences(textAfterAgentMentions), [textAfterAgentMentions]);
|
|
808
809
|
// System notification XML — parsed LAST so all other XML subsystems
|
|
@@ -961,6 +962,7 @@ export function UserMessage({ message, author, showAuthor, agentNames, commandIn
|
|
|
961
962
|
});
|
|
962
963
|
}, [effectiveCommandInfo, message.blocks]);
|
|
963
964
|
const sessionTitles = useMemo(() => sessionRefs.map((s) => s.title), [sessionRefs]);
|
|
965
|
+
const driveNames = useMemo(() => driveMentionRefs.map((d) => d.name), [driveMentionRefs]);
|
|
964
966
|
// Build highlighted text segments — see `../thread/mention-segments.ts`. The walk
|
|
965
967
|
// used to live inline here and in `optimistic-turn.tsx`, and the two copies
|
|
966
968
|
// had already diverged.
|
|
@@ -968,8 +970,9 @@ export function UserMessage({ message, author, showAuthor, agentNames, commandIn
|
|
|
968
970
|
text: bodyText,
|
|
969
971
|
sourceRefs,
|
|
970
972
|
sessionTitles,
|
|
973
|
+
driveNames,
|
|
971
974
|
agentNames,
|
|
972
|
-
})), [bodyText, sourceRefs, sessionTitles, agentNames]);
|
|
975
|
+
})), [bodyText, sourceRefs, sessionTitles, driveNames, agentNames]);
|
|
973
976
|
/**
|
|
974
977
|
* The body split at its reply quotes, or `null` for a message without any —
|
|
975
978
|
* that message keeps the single-run render below, unchanged.
|
|
@@ -1041,8 +1044,10 @@ export function UserMessage({ message, author, showAuthor, agentNames, commandIn
|
|
|
1041
1044
|
const renderSegments = (segs) => segs.map((seg) => seg.type === 'file' ? (_jsx(MentionChip, { kind: "file", label: seg.text.replace(/^@/, ''), onClick: () => openFileInComputer(seg.text.replace(/^@/, '')) }, seg.key)) : seg.type === 'session' ? (_jsx(MentionChip, { kind: "session", label: seg.text.replace(/^@/, ''), onClick: () => openSessionMention(seg.text.replace(/^@/, '')) }, seg.key)) : seg.type === 'agent' ? (
|
|
1042
1045
|
// Static: an agent is named, not navigable. Same surface,
|
|
1043
1046
|
// no press affordance it cannot honour.
|
|
1044
|
-
_jsx(MentionChip, { kind: "agent", label: seg.text.replace(/^@/, '') }, seg.key)) :
|
|
1045
|
-
|
|
1047
|
+
_jsx(MentionChip, { kind: "agent", label: seg.text.replace(/^@/, '') }, seg.key)) : seg.type === 'drive' ? (
|
|
1048
|
+
// Static: the file itself is in the attachment strip.
|
|
1049
|
+
_jsx(MentionChip, { kind: "drive", label: seg.text.replace(/^@/, '') }, seg.key)) : (_jsx("span", { children: seg.text }, seg.key)));
|
|
1050
|
+
const renderRunSegments = (runText) => renderSegments(keyMentionSegments(buildMentionSegments({ text: runText, sessionTitles, driveNames, agentNames })));
|
|
1046
1051
|
/** One text run of a quoted body. The run holding `COMMAND_SLOT` draws the
|
|
1047
1052
|
* chip there, with the same spacing `commandLead` uses. */
|
|
1048
1053
|
const renderQuotedRun = (runText) => {
|
|
@@ -1057,7 +1062,9 @@ export function UserMessage({ message, author, showAuthor, agentNames, commandIn
|
|
|
1057
1062
|
// with the full-width editor, ChatGPT-style. Placed after every hook above so
|
|
1058
1063
|
// the hook count never changes when editing starts or ends.
|
|
1059
1064
|
if (editingText != null && onEditSend && onEditCancel) {
|
|
1060
|
-
return (_jsx(UserMessageEditor, { initialText: editingText, attachments: allAttachments, pending: editPending, onCancel: onEditCancel, onSend: (text, kept) => onEditSend(message.message_id,
|
|
1065
|
+
return (_jsx(UserMessageEditor, { initialText: editingText, attachments: allAttachments, pending: editPending, onCancel: onEditCancel, onSend: (text, kept) => onEditSend(message.message_id,
|
|
1066
|
+
// The inline editor holds plain text: the Drive refs of the chips and files it kept go again.
|
|
1067
|
+
appendDriveRefs(text, keptDriveRefs(text, driveMentionRefs, kept.map((file) => file.filename))), kept) }));
|
|
1061
1068
|
}
|
|
1062
1069
|
// Channel messages (Slack / Microsoft Teams / Telegram): a branded card with the sender
|
|
1063
1070
|
if (channelMessageInfo) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type PointerEvent as ReactPointerEvent, type RefObject } from 'react';
|
|
2
|
+
/** A card spot as viewport pixels: the box's `left`/`top`, `right`/`bottom` off. */
|
|
3
|
+
export interface CallCardSpot {
|
|
4
|
+
left: number;
|
|
5
|
+
top: number;
|
|
6
|
+
}
|
|
7
|
+
/** Keep a spot fully on screen: where every drag ends and every resize pulls a saved spot back to. */
|
|
8
|
+
export declare function clampSpot(spot: CallCardSpot, size: {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}, vw: number, vh: number): CallCardSpot;
|
|
12
|
+
/** The spot the person last dragged the card to, or null (never dragged, or a broken save). */
|
|
13
|
+
export declare function readSpot(): CallCardSpot | null;
|
|
14
|
+
/**
|
|
15
|
+
* Where the call card sits: the classes' bottom-right until the person drags it, then wherever they left it —
|
|
16
|
+
* kept in localStorage across calls and reloads (a durable preference, never reclaimed). Dragging captures the
|
|
17
|
+
* pointer on the card; a press on its controls (a `button` under the pointer) never starts one. Every window
|
|
18
|
+
* resize pulls the saved spot back on screen. Null `spot` means "no spot yet": the card keeps its default
|
|
19
|
+
* `right-4 bottom-4` classes, and the server's first paint matches, so no hydration mismatch.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useCallCardPosition(cardRef: RefObject<HTMLElement | null>): {
|
|
22
|
+
spot: CallCardSpot | null;
|
|
23
|
+
dragging: boolean;
|
|
24
|
+
dragHandlers: {
|
|
25
|
+
onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;
|
|
26
|
+
onPointerMove: (event: ReactPointerEvent<HTMLElement>) => void;
|
|
27
|
+
onPointerUp: (event: ReactPointerEvent<HTMLElement>) => void;
|
|
28
|
+
onPointerCancel: (event: ReactPointerEvent<HTMLElement>) => void;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
+
import { safeGetItem, safeSetItem } from '../../internal/lib/storage/managed-storage.js';
|
|
4
|
+
const SPOT_KEY = 'kortix-voice-call-card';
|
|
5
|
+
/** Keep a spot fully on screen: where every drag ends and every resize pulls a saved spot back to. */
|
|
6
|
+
export function clampSpot(spot, size, vw, vh) {
|
|
7
|
+
return {
|
|
8
|
+
left: Math.min(Math.max(spot.left, 0), Math.max(0, vw - size.width)),
|
|
9
|
+
top: Math.min(Math.max(spot.top, 0), Math.max(0, vh - size.height)),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** The spot the person last dragged the card to, or null (never dragged, or a broken save). */
|
|
13
|
+
export function readSpot() {
|
|
14
|
+
const raw = safeGetItem(SPOT_KEY);
|
|
15
|
+
if (!raw)
|
|
16
|
+
return null;
|
|
17
|
+
try {
|
|
18
|
+
const spot = JSON.parse(raw);
|
|
19
|
+
// `Number.isFinite` never coerces: a string or a NaN/Infinity save reads as none.
|
|
20
|
+
if (!spot || typeof spot !== 'object' || !Number.isFinite(spot.left) || !Number.isFinite(spot.top)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return { left: spot.left, top: spot.top };
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Where the call card sits: the classes' bottom-right until the person drags it, then wherever they left it —
|
|
31
|
+
* kept in localStorage across calls and reloads (a durable preference, never reclaimed). Dragging captures the
|
|
32
|
+
* pointer on the card; a press on its controls (a `button` under the pointer) never starts one. Every window
|
|
33
|
+
* resize pulls the saved spot back on screen. Null `spot` means "no spot yet": the card keeps its default
|
|
34
|
+
* `right-4 bottom-4` classes, and the server's first paint matches, so no hydration mismatch.
|
|
35
|
+
*/
|
|
36
|
+
export function useCallCardPosition(cardRef) {
|
|
37
|
+
const [spot, setSpot] = useState(null);
|
|
38
|
+
const [dragging, setDragging] = useState(false);
|
|
39
|
+
// The live spot for the drag end's save, and the drag's start state, in refs: a pointer-move
|
|
40
|
+
// handler reads them without re-rendering the card's other listeners.
|
|
41
|
+
const spotRef = useRef(null);
|
|
42
|
+
const drag = useRef(null);
|
|
43
|
+
const clamp = useCallback((next) => {
|
|
44
|
+
const rect = cardRef.current?.getBoundingClientRect();
|
|
45
|
+
// No measured box (unmounted): leave the spot alone rather than guess a size.
|
|
46
|
+
if (!rect || rect.width === 0)
|
|
47
|
+
return next;
|
|
48
|
+
return clampSpot(next, { width: rect.width, height: rect.height }, window.innerWidth, window.innerHeight);
|
|
49
|
+
}, [cardRef]);
|
|
50
|
+
const applySpot = useCallback((next) => {
|
|
51
|
+
spotRef.current = next;
|
|
52
|
+
setSpot(next);
|
|
53
|
+
}, []);
|
|
54
|
+
// The saved spot, once on mount: client only, after the card has its box to clamp against.
|
|
55
|
+
// A layout effect on purpose: the swap lands before first paint, so the card never flashes
|
|
56
|
+
// at the default corner, and the value cannot be read during render (the store starts empty
|
|
57
|
+
// on the server, so the card never renders there at all).
|
|
58
|
+
useLayoutEffect(() => {
|
|
59
|
+
const saved = readSpot();
|
|
60
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect -- the value cannot be read during render (no window on the server)
|
|
61
|
+
if (saved)
|
|
62
|
+
applySpot(clamp(saved));
|
|
63
|
+
}, [applySpot, clamp]);
|
|
64
|
+
// A smaller window (a display change, a zoom) pulls the saved spot back on screen.
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const onResize = () => {
|
|
67
|
+
if (spotRef.current)
|
|
68
|
+
applySpot(clamp(spotRef.current));
|
|
69
|
+
};
|
|
70
|
+
window.addEventListener('resize', onResize);
|
|
71
|
+
return () => window.removeEventListener('resize', onResize);
|
|
72
|
+
}, [applySpot, clamp]);
|
|
73
|
+
const onPointerDown = useCallback((event) => {
|
|
74
|
+
if (event.button !== 0)
|
|
75
|
+
return;
|
|
76
|
+
// The controls answer presses; the card around them drags.
|
|
77
|
+
if (event.target.closest('button, a, input, textarea, select, [role="button"]'))
|
|
78
|
+
return;
|
|
79
|
+
const el = cardRef.current;
|
|
80
|
+
if (!el || drag.current)
|
|
81
|
+
return;
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
el.setPointerCapture(event.pointerId);
|
|
84
|
+
// Where the card sits right now (the classes' bottom-right on the first drag), and its box,
|
|
85
|
+
// measured once: the drag's every move clamps against the box it started with.
|
|
86
|
+
const rect = el.getBoundingClientRect();
|
|
87
|
+
drag.current = {
|
|
88
|
+
id: event.pointerId,
|
|
89
|
+
left: rect.left,
|
|
90
|
+
top: rect.top,
|
|
91
|
+
x: event.clientX,
|
|
92
|
+
y: event.clientY,
|
|
93
|
+
width: rect.width,
|
|
94
|
+
height: rect.height,
|
|
95
|
+
moved: false,
|
|
96
|
+
};
|
|
97
|
+
setDragging(true);
|
|
98
|
+
}, [cardRef]);
|
|
99
|
+
const onPointerMove = useCallback((event) => {
|
|
100
|
+
const d = drag.current;
|
|
101
|
+
if (!d || event.pointerId !== d.id)
|
|
102
|
+
return;
|
|
103
|
+
d.moved = true;
|
|
104
|
+
// Clamped against the box the drag started with: no layout read per move.
|
|
105
|
+
applySpot(clampSpot({
|
|
106
|
+
left: d.left + (event.clientX - d.x),
|
|
107
|
+
top: d.top + (event.clientY - d.y),
|
|
108
|
+
}, { width: d.width, height: d.height }, window.innerWidth, window.innerHeight));
|
|
109
|
+
}, [applySpot]);
|
|
110
|
+
const onPointerEnd = useCallback((event) => {
|
|
111
|
+
if (!drag.current || event.pointerId !== drag.current.id)
|
|
112
|
+
return;
|
|
113
|
+
const moved = drag.current.moved;
|
|
114
|
+
drag.current = null;
|
|
115
|
+
setDragging(false);
|
|
116
|
+
// A press that never moved saves nothing: the spot on screen is the spot already saved.
|
|
117
|
+
const final = spotRef.current;
|
|
118
|
+
if (moved && final)
|
|
119
|
+
safeSetItem(SPOT_KEY, JSON.stringify(final));
|
|
120
|
+
}, []);
|
|
121
|
+
return {
|
|
122
|
+
spot,
|
|
123
|
+
dragging,
|
|
124
|
+
dragHandlers: { onPointerDown, onPointerMove, onPointerUp: onPointerEnd, onPointerCancel: onPointerEnd },
|
|
125
|
+
};
|
|
126
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { startProjectSession } from '@kortix/sdk';
|
|
4
4
|
import { ChatCircleIcon, MicrophoneIcon, MicrophoneSlashIcon, PhoneDisconnectIcon, PhoneIcon, ScreencastIcon, XIcon, } from '@phosphor-icons/react';
|
|
5
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import { useTranslations } from '../../i18n/index.js';
|
|
7
7
|
import { AgentMark, agentDisplayName } from '../../internal/components/agent-mark.js';
|
|
8
8
|
import { isDesktop } from '../../internal/lib/desktop-detect.js';
|
|
@@ -13,6 +13,7 @@ import { SessionDotMatrix } from '../../primitives/dot-matrix/session-dot-matrix
|
|
|
13
13
|
import Hint from '../../primitives/hint.js';
|
|
14
14
|
import { useUiRouter } from '../../providers/ui-provider.js';
|
|
15
15
|
import { callTime, ringback } from './call-ring.js';
|
|
16
|
+
import { useCallCardPosition } from './use-call-card-position.js';
|
|
16
17
|
import { useVoiceCall } from './use-voice-call.js';
|
|
17
18
|
import { INITIAL_CALL } from './voice-call-state.js';
|
|
18
19
|
import { useVoiceCallStore } from './voice-call-store.js';
|
|
@@ -95,6 +96,10 @@ function Card({ call, status, state, liveAt, controls, }) {
|
|
|
95
96
|
const t = useTranslations('voiceCall');
|
|
96
97
|
const router = useUiRouter();
|
|
97
98
|
const end = useVoiceCallStore((s) => s.end);
|
|
99
|
+
// Draggable wherever it helps: the person drags the card off the composer it covers, the spot
|
|
100
|
+
// sticks. The controls are no drag handles; the card around them is.
|
|
101
|
+
const cardRef = useRef(null);
|
|
102
|
+
const { spot, dragging, dragHandlers } = useCallCardPosition(cardRef);
|
|
98
103
|
const hangUp = () => end(call.sessionId);
|
|
99
104
|
const openChat = () => router.push(uiRoutes().session(call.projectId, call.sessionId));
|
|
100
105
|
const name = agentDisplayName(call.agent);
|
|
@@ -108,8 +113,10 @@ function Card({ call, status, state, liveAt, controls, }) {
|
|
|
108
113
|
}, [liveAt]);
|
|
109
114
|
const ended = state?.phase === 'ended' && state.end ? ENDED[state.end] : undefined;
|
|
110
115
|
const line = state?.line;
|
|
111
|
-
return (_jsxs("section", { "aria-label": t('title'), className:
|
|
116
|
+
return (_jsxs("section", { ref: cardRef, ...dragHandlers, onDragStart: (event) => event.preventDefault(), "aria-label": t('title'), style: spot ? { left: spot.left, top: spot.top, right: 'auto', bottom: 'auto' } : undefined, className: cn('kx-fade-up bg-background border-border fixed right-4 bottom-4 z-50 flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-3 rounded-xl border p-3 shadow-lg select-none touch-none', dragging ? 'cursor-grabbing' : 'cursor-grab'), children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("span", { className: cn('shrink-0 transition-transform duration-300 ease-out motion-reduce:transition-none', status === 'speaking' && 'scale-105'), children: _jsx(AgentMark, { slug: call.agent, size: 42, label: name }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-foreground truncate text-sm font-medium", children: name }), _jsx("div", { role: "status", className: "text-muted-foreground flex items-center gap-1.5 truncate text-xs", children: ended ? (_jsxs(_Fragment, { children: [ended.dot && _jsx("span", { "aria-hidden": true, className: cn('size-2 shrink-0 rounded-full', ended.dot) }), t(ended.key)] })) : status === 'calling' || status === 'connecting' ? (_jsxs(_Fragment, { children: [_jsx(SessionDotMatrix, { sessionId: call.sessionId, size: 14, className: "shrink-0" }), t('calling')] })) : (_jsxs(_Fragment, { children: [status !== 'reconnecting' && _jsx("span", { "aria-hidden": true, className: "bg-kortix-green size-2 shrink-0 rounded-full" }), liveAt ? _jsx("span", { className: "tabular-nums", children: callTime(now - liveAt) }) : null, liveAt ? _jsx("span", { "aria-hidden": true, children: "\u00B7" }) : null, t(status)] })) })] })] }), !ended && (state?.micBlocked || line) ? (_jsx("p", { className: "text-foreground line-clamp-2 text-sm", children: state?.micBlocked ? (_jsx("span", { className: "text-muted-foreground", children: t('noMicrophone') })) : (line && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground", children: line.role === 'agent' ? line.who : t('you') }), " ", line.text] }))) })) : null, _jsx("div", { className: "flex items-center gap-1", children: ended ? (_jsxs(_Fragment, { children: [state?.end !== 'unavailable' && controls && (_jsxs(Button, { variant: "secondary", size: "sm", onClick: controls.callAgain, className: "cursor-default", children: [_jsx(PhoneIcon, { weight: "fill", className: "size-3.5" }), t('callAgain')] })), _jsx(CardButton, { label: t('openChat'), onClick: openChat, children: _jsx(ChatCircleIcon, { className: "size-4" }) }), _jsx("span", { className: "flex-1" }), _jsx(CardButton, { label: t('close'), onClick: hangUp, children: _jsx(XIcon, { className: "size-4" }) })] })) : (_jsxs(_Fragment, { children: [_jsx(CardButton, { label: controls?.muted ? t('unmute') : t('mute'), pressed: controls?.muted, disabled: !controls || state?.micBlocked, onClick: () => controls?.toggleMute(), children: controls?.muted || state?.micBlocked ? _jsx(MicrophoneSlashIcon, { className: "size-4" }) : _jsx(MicrophoneIcon, { className: "size-4" }) }), controls?.canShare !== false && (_jsx(CardButton, { label: controls?.sharing ? t('stopSharing') : t('shareScreen'), pressed: controls?.sharing, disabled: !controls || (status !== 'listening' && status !== 'speaking' && !controls.sharing), onClick: () => void controls?.toggleShare(), children: _jsx(ScreencastIcon, { className: "size-4" }) })), _jsx(CardButton, { label: t('openChat'), onClick: openChat, children: _jsx(ChatCircleIcon, { className: "size-4" }) }), _jsx("span", { className: "flex-1" }), _jsx(Hint, { side: "top", sideOffset: 4, delayDuration: 300, label: t('end'), children: _jsx(Button, { size: "icon", "aria-label": t('end'), onClick: hangUp, className: "bg-kortix-red hover:bg-kortix-red/90 rounded-full text-white cursor-default", children: _jsx(PhoneDisconnectIcon, { weight: "fill", className: "size-4" }) }) })] })) })] }));
|
|
112
117
|
}
|
|
113
118
|
function CardButton({ label, pressed, disabled, onClick, children }) {
|
|
114
|
-
return (_jsx(Hint, { side: "top", sideOffset: 4, delayDuration: 300, label: label, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": label, "aria-pressed": pressed, disabled: disabled, onClick: onClick,
|
|
119
|
+
return (_jsx(Hint, { side: "top", sideOffset: 4, delayDuration: 300, label: label, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": label, "aria-pressed": pressed, disabled: disabled, onClick: onClick,
|
|
120
|
+
// The card around the controls drags (its cursor says so); a control keeps the plain one.
|
|
121
|
+
className: "text-muted-foreground hover:text-foreground aria-pressed:bg-foreground/10 aria-pressed:text-foreground transition-colors active:scale-[0.96] cursor-default", children: children }) }));
|
|
115
122
|
}
|
package/dist/styles/theme.css
CHANGED
|
@@ -700,6 +700,18 @@
|
|
|
700
700
|
0 0 0 1px color-mix(in oklab, var(--border) 60%, transparent);
|
|
701
701
|
}
|
|
702
702
|
|
|
703
|
+
/* The `ring-lg` preset of the same plugin: deeper layers for a card that
|
|
704
|
+
floats over the page in a corner (the promo card). */
|
|
705
|
+
@utility smooth-shadow-ring-lg {
|
|
706
|
+
box-shadow:
|
|
707
|
+
0 25px 50px oklch(0 0 0 / 0.05),
|
|
708
|
+
0 12px 24px oklch(0 0 0 / 0.04),
|
|
709
|
+
0 6px 12px oklch(0 0 0 / 0.03),
|
|
710
|
+
0 3px 6px oklch(0 0 0 / 0.02),
|
|
711
|
+
0 1.5px 3px oklch(0 0 0 / 0.02),
|
|
712
|
+
0 0 0 1px color-mix(in oklab, var(--border) 60%, transparent);
|
|
713
|
+
}
|
|
714
|
+
|
|
703
715
|
/* ─── Liquid glass — frosted tinted surface (tokens: --liquid-glass-*) ─────
|
|
704
716
|
Theme-aware: light drop-shadow, dark inset rim. Specular lives on
|
|
705
717
|
background-image so this does not steal ::before from hit-area.
|