@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
|
@@ -86,14 +86,14 @@ export function ConnectPlanRows({ projectId, dismissible, className, }) {
|
|
|
86
86
|
* composer. New projects run on Kortix models, and most people already pay
|
|
87
87
|
* for ChatGPT or Claude.
|
|
88
88
|
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* Claude plan serves one yet, and the
|
|
92
|
-
*
|
|
89
|
+
* The composer's `ModelConnectionBar` renders it, only when the composer has a
|
|
90
|
+
* model (with none, the bar shows the same rows, undismissible). It then shows
|
|
91
|
+
* when a model already runs, no ChatGPT or Claude plan serves one yet, and the
|
|
92
|
+
* viewer may change the project's models.
|
|
93
93
|
*/
|
|
94
|
-
export function SubscriptionOffer({ projectId }) {
|
|
94
|
+
export function SubscriptionOffer({ projectId, className }) {
|
|
95
95
|
const models = useWorkspaceModels(projectId);
|
|
96
96
|
const { canWriteProviders } = useModelConnectionGate(undefined, { projectId });
|
|
97
97
|
const show = canWriteProviders && models.some(isRunnableModel) && !hasRunnableSubscriptionModel(models);
|
|
98
|
-
return show ? _jsx(ConnectPlanRows, { projectId: projectId, dismissible: true, className:
|
|
98
|
+
return show ? _jsx(ConnectPlanRows, { projectId: projectId, dismissible: true, className: className }) : null;
|
|
99
99
|
}
|
|
@@ -51,7 +51,7 @@ export const AdvancedPanel = memo(function AdvancedPanel({ sessionId, messages,
|
|
|
51
51
|
clearFocusedToolCall();
|
|
52
52
|
}, [focusedToolCallId, calls, count, clearFocusedToolCall]);
|
|
53
53
|
if (count === 0) {
|
|
54
|
-
return (_jsx("div", { className: "text-muted-foreground
|
|
54
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-full items-center justify-center p-8 text-center text-sm", children: tHardcodedUi.raw('componentsSessionSessionActionsPanel.line152JsxTextNoActionsYet') }));
|
|
55
55
|
}
|
|
56
56
|
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsx("div", { className: cn('min-h-0 flex-1 overflow-auto',
|
|
57
57
|
// Uncapped so the focused tool fills the panel instead of scrolling
|
|
@@ -56,5 +56,5 @@ export function SessionDetailPanel() {
|
|
|
56
56
|
// a detail or the terminal in the same update, but a click whose
|
|
57
57
|
// content has not landed yet can sit in between. Name the state;
|
|
58
58
|
// never draw a blank panel.
|
|
59
|
-
!detail && !terminalOpen ? (_jsx("div", { className: "text-muted-foreground
|
|
59
|
+
!detail && !terminalOpen ? (_jsx("div", { className: "text-muted-foreground flex h-full items-center justify-center p-8 text-center text-sm", children: tI18nComplete.raw('text49abaf804ab3') })) : null }) }));
|
|
60
60
|
}
|
|
@@ -59,5 +59,5 @@ export function SessionDiffViewer({ filePath, isFullscreen, onToggleFullscreen,
|
|
|
59
59
|
description: tI18nComplete.raw(filePath ? 'textcc6d004b577f' : 'textc88aaafcef61') }));
|
|
60
60
|
}
|
|
61
61
|
const fullscreenLabel = isFullscreen ? 'Exit fullscreen' : 'Fullscreen';
|
|
62
|
-
return (_jsx(ScrollArea, { className: "h-full", children: _jsxs("div", { className: "space-y-2 p-2", children: [_jsxs("div", { className: cn('flex items-center gap-1.5', reserveCloseGutter && 'pr-11'), children: [_jsx(ChangeSummary, { entries: entries, className: "min-w-0 flex-1" }), !filePath && _jsx(ExpandAllButton, { allExpanded: allExpanded, onToggle: toggleAll }), _jsx(DiffLayoutToggle, { layout: layout, onChange: setLayout }), onToggleFullscreen && (_jsx(Hint, { label: fullscreenLabel, side: "bottom", children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": fullscreenLabel, "aria-pressed": !!isFullscreen, onClick: onToggleFullscreen, className: "text-muted-foreground
|
|
62
|
+
return (_jsx(ScrollArea, { className: "h-full", children: _jsxs("div", { className: "space-y-2 p-2", children: [_jsxs("div", { className: cn('flex items-center gap-1.5', reserveCloseGutter && 'pr-11'), children: [_jsx(ChangeSummary, { entries: entries, className: "min-w-0 flex-1" }), !filePath && _jsx(ExpandAllButton, { allExpanded: allExpanded, onToggle: toggleAll }), _jsx(DiffLayoutToggle, { layout: layout, onChange: setLayout }), onToggleFullscreen && (_jsx(Hint, { label: fullscreenLabel, side: "bottom", children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": fullscreenLabel, "aria-pressed": !!isFullscreen, onClick: onToggleFullscreen, className: "text-muted-foreground hover:text-foreground active:scale-[0.96]", children: isFullscreen ? (_jsx(ArrowsInSimpleIcon, { className: "size-3.5" })) : (_jsx(ArrowsOutSimpleIcon, { className: "size-3.5" })) }) }))] }), _jsx(ChangeList, { entries: entries, layout: layout, expanded: expanded, onRowOpenChange: setRow })] }) }));
|
|
63
63
|
}
|
|
@@ -92,7 +92,7 @@ function SessionFilesExplorerInner({ chatSessionId, projectId, projectSessionId,
|
|
|
92
92
|
// Changes tab is built on — so an idle session still shows its files.
|
|
93
93
|
mirrorRef: routeProjectId && gitSessionId
|
|
94
94
|
? { projectId: routeProjectId, ref: gitSessionId }
|
|
95
|
-
: undefined })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: DRIVE_ACTION_ROW_CLASS, children: [_jsx(PanelTabs, { changedCount: changedCount }), changedCount > 0 && (_jsxs(Button, { size: "xs", className: "ml-auto shrink-0 gap-1.5 active:scale-[0.96]", onClick: openChangeRequest, disabled: asking, children: [asking ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('text73eeb5083986')] }))] }), _jsxs(TabsContent, { value: "changes", className: "flex min-h-0 flex-1 flex-col overflow-hidden", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-1.5 px-2 pt-2", children: [versionId && (_jsxs(_Fragment, { children: [_jsx(Badge, { variant: "outline", size: "sm", className: "font-mono", children: versionId }), _jsx(ArrowRightIcon, { "aria-hidden": true, className: "text-muted-foreground
|
|
95
|
+
: undefined })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: DRIVE_ACTION_ROW_CLASS, children: [_jsx(PanelTabs, { changedCount: changedCount }), changedCount > 0 && (_jsxs(Button, { size: "xs", className: "ml-auto shrink-0 gap-1.5 active:scale-[0.96]", onClick: openChangeRequest, disabled: asking, children: [asking ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('text73eeb5083986')] }))] }), _jsxs(TabsContent, { value: "changes", className: "flex min-h-0 flex-1 flex-col overflow-hidden", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-1.5 px-2 pt-2", children: [versionId && (_jsxs(_Fragment, { children: [_jsx(Badge, { variant: "outline", size: "sm", className: "font-mono", children: versionId }), _jsx(ArrowRightIcon, { "aria-hidden": true, className: "text-muted-foreground size-3 shrink-0" }), _jsx("span", { className: "sr-only", children: tI18nComplete.raw('text6b847a0ed0b2') })] })), _jsx(Badge, { variant: "outline", size: "sm", className: "max-w-32 min-w-0 font-mono", children: _jsx("span", { className: "truncate", children: baseRef }) }), _jsx("span", { className: "text-muted-foreground text-xs", children: tI18nComplete.raw('text4c31974fceb2') })] }), _jsx("div", { className: "min-h-0 flex-1", children: _jsx(SessionDiffViewer, {}) })] })] })) }));
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
* The explorer's chrome while the session's computer boots: the same tab row,
|
|
@@ -89,10 +89,10 @@ chatSessionId, } = {}) {
|
|
|
89
89
|
setAsking(false);
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("div", { className: "border-border/40 shrink-0 space-y-3 border-b p-4", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx("h3", { className: "text-foreground text-sm font-medium", children: tHardcodedUi.raw('componentsSessionSessionFilesPanel.line80JsxTextThisSessionIsItsOwnVersion') }), _jsxs("p", { className: "text-muted-foreground text-xs leading-relaxed", children: [tHardcodedUi.raw('componentsSessionSessionFilesPanel.line83JsxTextChangesHereLiveOnAStandaloneVersionOf'), ' ', _jsx("span", { className: "text-foreground/80 font-mono", children: baseRef }), tHardcodedUi.raw('componentsSessionSessionFilesPanel.line85JsxTextSoYouCanWorkInParallelWithoutAffecting'), ' ', _jsx("span", { className: "text-foreground/80 font-medium", children: tHardcodedUi.raw('componentsSessionSessionFilesPanel.line88JsxTextChangeRequest') }), tHardcodedUi.raw('componentsSessionSessionFilesPanel.line89JsxTextYouCanReviewAndMergeItInto'), ' ', _jsx("span", { className: "text-foreground/80 font-mono", children: baseRef }), ' ', tHardcodedUi.raw('componentsSessionSessionFilesPanel.line91JsxTextWheneverYouReReady')] })] }), _jsxs(Button, { size: "sm", className: "w-full", onClick: askAgentToOpenChangeRequest, disabled: asking, children: [asking ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : _jsx(Sparkles, { className: "size-3.5" }), tHardcodedUi.raw('componentsSessionSessionFilesPanel.line96JsxTextAskAgentToOpenAChangeRequest')] })] }), _jsxs("div", { className: "min-h-0 flex-1 overflow-auto p-3", children: [_jsxs("div", { className: "text-muted-foreground
|
|
92
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("div", { className: "border-border/40 shrink-0 space-y-3 border-b p-4", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx("h3", { className: "text-foreground text-sm font-medium", children: tHardcodedUi.raw('componentsSessionSessionFilesPanel.line80JsxTextThisSessionIsItsOwnVersion') }), _jsxs("p", { className: "text-muted-foreground text-xs leading-relaxed", children: [tHardcodedUi.raw('componentsSessionSessionFilesPanel.line83JsxTextChangesHereLiveOnAStandaloneVersionOf'), ' ', _jsx("span", { className: "text-foreground/80 font-mono", children: baseRef }), tHardcodedUi.raw('componentsSessionSessionFilesPanel.line85JsxTextSoYouCanWorkInParallelWithoutAffecting'), ' ', _jsx("span", { className: "text-foreground/80 font-medium", children: tHardcodedUi.raw('componentsSessionSessionFilesPanel.line88JsxTextChangeRequest') }), tHardcodedUi.raw('componentsSessionSessionFilesPanel.line89JsxTextYouCanReviewAndMergeItInto'), ' ', _jsx("span", { className: "text-foreground/80 font-mono", children: baseRef }), ' ', tHardcodedUi.raw('componentsSessionSessionFilesPanel.line91JsxTextWheneverYouReReady')] })] }), _jsxs(Button, { size: "sm", className: "w-full", onClick: askAgentToOpenChangeRequest, disabled: asking, children: [asking ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : _jsx(Sparkles, { className: "size-3.5" }), tHardcodedUi.raw('componentsSessionSessionFilesPanel.line96JsxTextAskAgentToOpenAChangeRequest')] })] }), _jsxs("div", { className: "min-h-0 flex-1 overflow-auto p-3", children: [_jsxs("div", { className: "text-muted-foreground mb-2 flex items-center gap-1.5 px-1 text-xs font-medium tracking-wide uppercase", children: [_jsx(FileDiff, { className: "size-3.5" }), tHardcodedUi.raw('i18nComplete.textbbd4b6a86bc6'), changedCount > 0 && _jsxs("span", { className: "text-muted-foreground", children: ["\u00B7 ", changedCount] })] }), isLoadingChanges ? (_jsxs("div", { className: "text-muted-foreground flex items-center justify-center gap-2 py-10 text-xs", children: [_jsx(Loading, { className: "size-4 shrink-0" }), tHardcodedUi.raw('componentsSessionSessionFilesPanel.line113JsxTextLoadingChanges')] })) : changedCount > 0 ? (_jsx("div", { className: "space-y-0.5", children: changedFiles.map((file) => {
|
|
93
93
|
const badge = statusBadges[file.status] ?? statusBadges.modified;
|
|
94
94
|
const name = file.path.split('/').pop() || file.path;
|
|
95
95
|
const dir = file.path.slice(0, file.path.length - name.length);
|
|
96
|
-
return (_jsxs("button", { type: "button", onClick: () => openPreview(file.path), className: "hover:bg-muted/60 flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-xs transition-colors", children: [_jsx("span", { className: cn('w-3 shrink-0 text-center font-mono font-semibold', badge.cls), title: badge.label, children: badge.letter }), _jsx("span", { className: "text-foreground/90 truncate font-medium", children: name }), dir && (_jsx("span", { className: "text-muted-foreground
|
|
97
|
-
}) })) : (_jsx("div", { className: "text-muted-foreground
|
|
96
|
+
return (_jsxs("button", { type: "button", onClick: () => openPreview(file.path), className: "hover:bg-muted/60 flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-xs transition-colors", children: [_jsx("span", { className: cn('w-3 shrink-0 text-center font-mono font-semibold', badge.cls), title: badge.label, children: badge.letter }), _jsx("span", { className: "text-foreground/90 truncate font-medium", children: name }), dir && (_jsx("span", { className: "text-muted-foreground truncate font-mono text-[10px]", children: dir.replace(/\/$/, '') }))] }, file.path));
|
|
97
|
+
}) })) : (_jsx("div", { className: "text-muted-foreground px-1 py-8 text-center text-xs", children: tHardcodedUi.raw('componentsSessionSessionFilesPanel.line151JsxTextNoChangesYetFilesTheAgentCreatesOr') }))] })] }));
|
|
98
98
|
}
|
|
@@ -61,5 +61,5 @@ export function ActionNavigator({ calls, index, onIndexChange, isLive, className
|
|
|
61
61
|
if (count <= 1)
|
|
62
62
|
return null;
|
|
63
63
|
const atLatest = index >= count - 1;
|
|
64
|
-
return (_jsxs("div", { className: cn('border-border flex shrink-0 items-center gap-2 border-t px-2 py-1.5 pr-3.5', className), children: [_jsxs("div", { className: "flex shrink-0 items-center", children: [_jsx(Button, { variant: "ghost", size: "icon", onClick: goPrev, className: "hit-area-2 hit-area-r-0", disabled: index === 0, "aria-label": tI18nComplete.raw('text730c9f9f651f'), children: _jsx(ChevronLeft, { className: "size-4" }) }), _jsx(Button, { variant: "ghost", size: "icon", onClick: goNext, className: "hit-area-2 hit-area-l-0", disabled: atLatest, "aria-label": tI18nComplete.raw('text365987d015f7'), children: _jsx(ChevronRight, { className: "size-4" }) })] }), _jsx(NativeSlider, { value: [index], min: 0, max: count - 1, step: 1, onValueChange: handleScrub, tooltip: timeLabel ? _jsx("span", { className: "tabular-nums", children: timeLabel }) : undefined, className: cn('min-w-0 flex-1', '[&_[data-slot=slider-thumb]]:transition-[background-color,border-color,box-shadow]') }), _jsxs("span", { className: "text-muted-foreground flex shrink-0 items-center gap-1.5 pl-1 text-xs tabular-nums", children: [mounted && timeLabel && _jsx("span", { className: "text-muted-foreground
|
|
64
|
+
return (_jsxs("div", { className: cn('border-border flex shrink-0 items-center gap-2 border-t px-2 py-1.5 pr-3.5', className), children: [_jsxs("div", { className: "flex shrink-0 items-center", children: [_jsx(Button, { variant: "ghost", size: "icon", onClick: goPrev, className: "hit-area-2 hit-area-r-0", disabled: index === 0, "aria-label": tI18nComplete.raw('text730c9f9f651f'), children: _jsx(ChevronLeft, { className: "size-4" }) }), _jsx(Button, { variant: "ghost", size: "icon", onClick: goNext, className: "hit-area-2 hit-area-l-0", disabled: atLatest, "aria-label": tI18nComplete.raw('text365987d015f7'), children: _jsx(ChevronRight, { className: "size-4" }) })] }), _jsx(NativeSlider, { value: [index], min: 0, max: count - 1, step: 1, onValueChange: handleScrub, tooltip: timeLabel ? _jsx("span", { className: "tabular-nums", children: timeLabel }) : undefined, className: cn('min-w-0 flex-1', '[&_[data-slot=slider-thumb]]:transition-[background-color,border-color,box-shadow]') }), _jsxs("span", { className: "text-muted-foreground flex shrink-0 items-center gap-1.5 pl-1 text-xs tabular-nums", children: [mounted && timeLabel && _jsx("span", { className: "text-muted-foreground", children: timeLabel }), _jsxs("span", { children: [index + 1, _jsx("span", { className: "text-muted-foreground", children: "/" }), count] }), isLive && atLatest && (_jsx("span", { className: "bg-primary/60 size-1.5 rounded-full", "aria-label": tI18nComplete.raw('textb64ac05f17e6') }))] })] }));
|
|
65
65
|
}
|
|
@@ -37,10 +37,10 @@ export interface RecoveryPrompt extends PendingSessionPrompt {
|
|
|
37
37
|
* read yet. Reading both keeps the failure card's "copy your prompt" and Retry
|
|
38
38
|
* working before and after the session row loads.
|
|
39
39
|
*
|
|
40
|
-
* A session that an agent, a trigger, a channel
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
40
|
+
* A session that an agent, a trigger, a channel or MCP created has neither:
|
|
41
|
+
* its first prompt is `metadata.initial_prompt`. That prompt is shown only
|
|
42
|
+
* while `runtimeSessionId` is empty, which is the same condition under which
|
|
43
|
+
* the restart re-delivers it.
|
|
44
44
|
*
|
|
45
45
|
* `inboxPrompts` is `GET .../prompts`. A session the current API created keeps
|
|
46
46
|
* its first prompt ONLY there, so it answers before the start stash: the stash
|
|
@@ -109,10 +109,10 @@ function inboxPromptForRecovery(prompts) {
|
|
|
109
109
|
* read yet. Reading both keeps the failure card's "copy your prompt" and Retry
|
|
110
110
|
* working before and after the session row loads.
|
|
111
111
|
*
|
|
112
|
-
* A session that an agent, a trigger, a channel
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
112
|
+
* A session that an agent, a trigger, a channel or MCP created has neither:
|
|
113
|
+
* its first prompt is `metadata.initial_prompt`. That prompt is shown only
|
|
114
|
+
* while `runtimeSessionId` is empty, which is the same condition under which
|
|
115
|
+
* the restart re-delivers it.
|
|
116
116
|
*
|
|
117
117
|
* `inboxPrompts` is `GET .../prompts`. A session the current API created keeps
|
|
118
118
|
* its first prompt ONLY there, so it answers before the start stash: the stash
|
|
@@ -52,5 +52,5 @@ export function SessionBusyIndicator({ statusText, elapsedLabel, retryLabel, amb
|
|
|
52
52
|
status ||
|
|
53
53
|
(useAmbient ? AMBIENT_MESSAGES[ambientIdx % AMBIENT_MESSAGES.length] : DEFAULT_STATUS);
|
|
54
54
|
const swap = reduceMotion ? FADE_SWAP : ROLL_SWAP;
|
|
55
|
-
return (_jsxs(m.div, { role: "status", "aria-live": useAmbient ? 'off' : 'polite', "data-testid": "session-busy-indicator", className: cn('text-muted-foreground flex w-full min-w-0 items-center gap-1.5 py-0.5 text-xs', className), children: [_jsx(SessionDotMatrix, { sessionId: sessionId, size: 14, className: "shrink-0" }), _jsx("span", { className: "relative min-w-0 flex-1", "aria-hidden": true, children: isRetrying ? (_jsx("span", { className: "text-muted-foreground
|
|
55
|
+
return (_jsxs(m.div, { role: "status", "aria-live": useAmbient ? 'off' : 'polite', "data-testid": "session-busy-indicator", className: cn('text-muted-foreground flex w-full min-w-0 items-center gap-1.5 py-0.5 text-xs', className), children: [_jsx(SessionDotMatrix, { sessionId: sessionId, size: 14, className: "shrink-0" }), _jsx("span", { className: "relative min-w-0 flex-1", "aria-hidden": true, children: isRetrying ? (_jsx("span", { className: "text-muted-foreground block truncate text-sm leading-5 tabular-nums", children: label })) : (_jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: "relative block min-w-0 flex-1 overflow-hidden leading-5", children: _jsx(AnimatePresence, { initial: false, mode: "popLayout", children: _jsx(m.span, { initial: swap.initial, animate: swap.animate, exit: swap.exit, transition: swap.transition, className: "block min-w-0 whitespace-nowrap", children: _jsx(TextShimmer, { className: "truncate text-center align-middle text-sm leading-5", children: label }) }, label) }) }), elapsed ? (_jsx("span", { className: "text-muted-foreground shrink-0 text-sm leading-5 tabular-nums", children: elapsed })) : null] })) }), _jsx("span", { className: "sr-only", children: label })] }));
|
|
56
56
|
}
|
|
@@ -9,6 +9,7 @@ import { ClaudeConnectionSlot, claudeConnectionAction } from '../models/claude-c
|
|
|
9
9
|
import { AskOwnerForCreditsButton } from '../models/ask-owner-for-credits-button.js';
|
|
10
10
|
import { providerKeyFix } from '../models/provider-key-action.js';
|
|
11
11
|
import { ProviderKeySlot } from '../models/provider-key-slot.js';
|
|
12
|
+
import { PROVIDER_LABELS } from '../../internal/lib/provider-branding.js';
|
|
12
13
|
import { Button } from '../../primitives/button.js';
|
|
13
14
|
import { ChainOfThoughtStep } from '../../primitives/chain-of-thought.js';
|
|
14
15
|
import { DisclosureContent, DisclosureTrigger } from '../../primitives/disclosure.js';
|
|
@@ -224,6 +225,7 @@ function TurnErrorCheckpoint({ text, gateway, raw, defaultOpen, action, modelOpt
|
|
|
224
225
|
* failure to report back to them, whatever its `AbortReason`.
|
|
225
226
|
*/
|
|
226
227
|
export function TurnErrorDisplay({ errorText, errorDetails, errorRaw, defaultDetailsOpen, error, isAbort, modelOptions, className, }) {
|
|
228
|
+
const tKeys = useTranslations('pooledSecrets');
|
|
227
229
|
const text = error ? error.message : errorText;
|
|
228
230
|
if (!text)
|
|
229
231
|
return null;
|
|
@@ -274,8 +276,11 @@ export function TurnErrorDisplay({ errorText, errorDetails, errorRaw, defaultDet
|
|
|
274
276
|
const chatGpt = chatGptConnectionAction(gateway);
|
|
275
277
|
// The same for the member's own Claude subscription (Claude models run on it).
|
|
276
278
|
const claude = chatGpt ? null : claudeConnectionAction(text);
|
|
279
|
+
// A refused key reads as the key, not the provider's own words ("User not
|
|
280
|
+
// found."); those stay in the fold.
|
|
281
|
+
const keyRejected = providerFix?.code === 'provider_key_rejected';
|
|
277
282
|
// Real errors → a checkpoint row in the activity lane, not a boxed alert.
|
|
278
|
-
return (_jsx(TurnErrorCheckpoint, { text: text, gateway: gateway, raw: errorRaw, defaultOpen: defaultDetailsOpen, action: chatGpt ? _jsx(ChatGptConnectionSlot, { action: chatGpt }) : claude ? _jsx(ClaudeConnectionSlot, { action: claude })
|
|
283
|
+
return (_jsx(TurnErrorCheckpoint, { text: keyRejected ? tKeys('keyRejected', { provider: PROVIDER_LABELS[providerFix.providerId] ?? providerFix.providerId }) : text, gateway: gateway, raw: keyRejected ? (errorRaw ?? text) : errorRaw, defaultOpen: defaultDetailsOpen, action: chatGpt ? _jsx(ChatGptConnectionSlot, { action: chatGpt }) : claude ? _jsx(ClaudeConnectionSlot, { action: claude })
|
|
279
284
|
: providerFix ? _jsx(ProviderKeySlot, { providerId: providerFix.providerId }) : undefined, modelOptions: modelOptions, className: className }));
|
|
280
285
|
}
|
|
281
286
|
export function SessionRetryDisplay({ message, attempt, secondsLeft, details, className, }) {
|
|
@@ -29,7 +29,7 @@ export declare function chipAriaLabel(kind: string, label: string): string;
|
|
|
29
29
|
*/
|
|
30
30
|
export declare function chipClass(_kind: string): string;
|
|
31
31
|
export interface MentionChipProps {
|
|
32
|
-
/** `file` | `agent` | `session` | `command`. */
|
|
32
|
+
/** `file` | `agent` | `session` | `drive` | `command`. */
|
|
33
33
|
kind: string;
|
|
34
34
|
/** The chip's text WITHOUT its prefix — `chipText` adds `@` or `/`. */
|
|
35
35
|
label: string;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* React-free on purpose — `mention-chip.tsx` owns how a segment LOOKS, this
|
|
14
14
|
* owns where segments ARE, and only the latter is worth testing without a DOM.
|
|
15
15
|
*/
|
|
16
|
-
export type MentionSegmentType = 'file' | 'agent' | 'session';
|
|
16
|
+
export type MentionSegmentType = 'file' | 'agent' | 'session' | 'drive';
|
|
17
17
|
export interface MentionSegment {
|
|
18
18
|
text: string;
|
|
19
19
|
/** Absent for a plain run of prose. */
|
|
@@ -36,12 +36,14 @@ export interface MentionSourceRef {
|
|
|
36
36
|
* click handler will try to open.
|
|
37
37
|
*/
|
|
38
38
|
export declare function classifyMentionToken(token: string, agentNames: ReadonlySet<string>): MentionSegmentType;
|
|
39
|
-
export declare function buildMentionSegments({ text, sourceRefs, sessionTitles, agentNames, }: {
|
|
39
|
+
export declare function buildMentionSegments({ text, sourceRefs, sessionTitles, driveNames, agentNames, }: {
|
|
40
40
|
text: string;
|
|
41
41
|
/** Server-located spans — takes precedence over everything below. */
|
|
42
42
|
sourceRefs?: readonly MentionSourceRef[];
|
|
43
43
|
/** `<session_ref>` titles, matched as `@<title>` (titles contain spaces). */
|
|
44
44
|
sessionTitles?: readonly string[];
|
|
45
|
+
/** `<drive_ref>` names, matched as `@<name>` (names contain spaces). Every occurrence chips. */
|
|
46
|
+
driveNames?: readonly string[];
|
|
45
47
|
/** Known agent names, so `@build` chips as an agent rather than a file. */
|
|
46
48
|
agentNames?: readonly string[];
|
|
47
49
|
}): MentionSegment[];
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* React-free on purpose — `mention-chip.tsx` owns how a segment LOOKS, this
|
|
14
14
|
* owns where segments ARE, and only the latter is worth testing without a DOM.
|
|
15
15
|
*/
|
|
16
|
+
import { MAX_PROMPT_ATTACHMENT_FILES } from '../../_vendor/kortix-shared.js';
|
|
16
17
|
/**
|
|
17
18
|
* `@` must open a token, not sit inside one.
|
|
18
19
|
*
|
|
@@ -36,6 +37,10 @@ function trimTrailingPunctuation(token) {
|
|
|
36
37
|
end -= 1;
|
|
37
38
|
return token.slice(0, end);
|
|
38
39
|
}
|
|
40
|
+
/** The most Drive chips one message draws: far past any real message, and a bound on the work. */
|
|
41
|
+
const MAX_DRIVE_CHIPS = 100;
|
|
42
|
+
/** What may follow a whole mention: space, or the sentence punctuation `trimTrailingPunctuation` drops. */
|
|
43
|
+
const TOKEN_END = /[\s.,;:!?)\]}'"]/;
|
|
39
44
|
function overlaps(ranges, start, end) {
|
|
40
45
|
return ranges.some((r) => start < r.end && end > r.start);
|
|
41
46
|
}
|
|
@@ -52,7 +57,7 @@ export function classifyMentionToken(token, agentNames) {
|
|
|
52
57
|
return 'agent';
|
|
53
58
|
return 'file';
|
|
54
59
|
}
|
|
55
|
-
export function buildMentionSegments({ text, sourceRefs = [], sessionTitles = [], agentNames = [], }) {
|
|
60
|
+
export function buildMentionSegments({ text, sourceRefs = [], sessionTitles = [], driveNames = [], agentNames = [], }) {
|
|
56
61
|
if (!text)
|
|
57
62
|
return [];
|
|
58
63
|
const ranges = [];
|
|
@@ -71,6 +76,28 @@ export function buildMentionSegments({ text, sourceRefs = [], sessionTitles = []
|
|
|
71
76
|
continue;
|
|
72
77
|
ranges.push({ start: idx, end: idx + needle.length, type: 'session' });
|
|
73
78
|
}
|
|
79
|
+
// Drive file names: a name can contain spaces, and the same file can be
|
|
80
|
+
// mentioned twice, so every occurrence is claimed — longest name first, so
|
|
81
|
+
// `@a b.png` wins over `@a`. The names come out of the message body, so they
|
|
82
|
+
// are deduplicated and capped at the most files a message carries: a body
|
|
83
|
+
// that spells out a thousand `<drive_ref>` tags buys no thousand full scans.
|
|
84
|
+
// The chips are capped too (`MAX_DRIVE_CHIPS`): each one is checked against every range claimed
|
|
85
|
+
// before it, so a body dense in one short `@name` must not buy a quadratic walk.
|
|
86
|
+
const distinctDriveNames = [...new Set(driveNames.filter(Boolean))].slice(0, MAX_PROMPT_ATTACHMENT_FILES);
|
|
87
|
+
let driveChips = 0;
|
|
88
|
+
drive: for (const name of distinctDriveNames.sort((a, b) => b.length - a.length)) {
|
|
89
|
+
const needle = `@${name}`;
|
|
90
|
+
for (let idx = text.indexOf(needle); idx !== -1; idx = text.indexOf(needle, idx + 1)) {
|
|
91
|
+
const end = idx + needle.length;
|
|
92
|
+
// A whole mention only: `@a` is not the start of `@ab`, nor the tail of `x@a`.
|
|
93
|
+
const whole = (idx === 0 || /\s/.test(text.charAt(idx - 1))) && (end === text.length || TOKEN_END.test(text.charAt(end)));
|
|
94
|
+
if (!whole || overlaps(ranges, idx, end))
|
|
95
|
+
continue;
|
|
96
|
+
ranges.push({ start: idx, end, type: 'drive' });
|
|
97
|
+
if (++driveChips >= MAX_DRIVE_CHIPS)
|
|
98
|
+
break drive;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
74
101
|
for (const ref of sourceRefs) {
|
|
75
102
|
if (ref.start >= ref.end)
|
|
76
103
|
continue;
|
|
@@ -32,12 +32,23 @@ interface ParsedFileMentionRef {
|
|
|
32
32
|
path: string;
|
|
33
33
|
name: string;
|
|
34
34
|
}
|
|
35
|
+
/** A `<drive_ref>`: a file of the project's Drive, by its Drive path, and the upload that carried it. */
|
|
36
|
+
export interface ParsedDriveMentionRef {
|
|
37
|
+
path: string;
|
|
38
|
+
name: string;
|
|
39
|
+
file?: string;
|
|
40
|
+
}
|
|
35
41
|
interface ParsedAgentMentionRef {
|
|
36
42
|
name: string;
|
|
37
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Strips the `<file_ref>` and `<drive_ref>` blocks the composer appends for
|
|
46
|
+
* `@` file mentions: every caller that cleans a message for display gets both.
|
|
47
|
+
*/
|
|
38
48
|
export declare function parseFileMentionReferences(text: string): {
|
|
39
49
|
cleanText: string;
|
|
40
50
|
files: ParsedFileMentionRef[];
|
|
51
|
+
drives: ParsedDriveMentionRef[];
|
|
41
52
|
};
|
|
42
53
|
export declare function parseAgentMentionReferences(text: string): {
|
|
43
54
|
cleanText: string;
|
|
@@ -81,8 +81,13 @@ export function parseProjectReferences(text) {
|
|
|
81
81
|
cleaned = removeSpans(cleaned, referenceHeaders(cleaned, 'projects')).trim();
|
|
82
82
|
return { cleanText: cleaned, projects: [] };
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Strips the `<file_ref>` and `<drive_ref>` blocks the composer appends for
|
|
86
|
+
* `@` file mentions: every caller that cleans a message for display gets both.
|
|
87
|
+
*/
|
|
84
88
|
export function parseFileMentionReferences(text) {
|
|
85
89
|
const files = [];
|
|
90
|
+
const drives = [];
|
|
86
91
|
let cleaned = replaceSpans(text, selfClosingTags(text, 'file_ref'), ({ attrs }) => {
|
|
87
92
|
const pick = (key) => {
|
|
88
93
|
const m = attrs.match(new RegExp(`${key}="([^"]*?)"`));
|
|
@@ -94,8 +99,22 @@ export function parseFileMentionReferences(text) {
|
|
|
94
99
|
files.push({ path, name: name || path });
|
|
95
100
|
return '';
|
|
96
101
|
});
|
|
97
|
-
cleaned = removeSpans(cleaned, referenceHeaders(cleaned, 'files'))
|
|
98
|
-
|
|
102
|
+
cleaned = removeSpans(cleaned, referenceHeaders(cleaned, 'files'));
|
|
103
|
+
cleaned = replaceSpans(cleaned, selfClosingTags(cleaned, 'drive_ref'), ({ attrs }) => {
|
|
104
|
+
const path = attrs.match(/\bpath="([^"]*?)"/)?.[1];
|
|
105
|
+
const name = attrs.match(/\bname="([^"]*?)"/)?.[1];
|
|
106
|
+
const file = attrs.match(/\bfile="([^"]*?)"/)?.[1];
|
|
107
|
+
if (path) {
|
|
108
|
+
drives.push({
|
|
109
|
+
path: unescapeAttr(path),
|
|
110
|
+
name: unescapeAttr(name ?? '') || unescapeAttr(path),
|
|
111
|
+
...(file ? { file: unescapeAttr(file) } : {}),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return '';
|
|
115
|
+
});
|
|
116
|
+
cleaned = removeSpans(cleaned, referenceHeaders(cleaned, 'Drive files')).trim();
|
|
117
|
+
return { cleanText: cleaned, files, drives };
|
|
99
118
|
}
|
|
100
119
|
export function parseAgentMentionReferences(text) {
|
|
101
120
|
const agents = [];
|
|
@@ -239,5 +258,5 @@ export function SystemNotificationCard({ notification }) {
|
|
|
239
258
|
detail = value;
|
|
240
259
|
}
|
|
241
260
|
}
|
|
242
|
-
return (_jsxs(Disclosure, { variant: "outline", className: "bg-secondary", children: [_jsx(DisclosureTrigger, { children: _jsx(SystemMessage, { variant: systemNotificationSeverity(notification.tag), fill: true, children: _jsxs("span", { className: "block truncate", children: [notification.label, detail && _jsx("span", { className: "ml-1.5 opacity-70", children: detail })] }) }) }), _jsx(DisclosureContent, { children: _jsxs("div", { className: "space-y-1 px-3 pb-2 text-xs", children: [notification.fields.length > 0 && (_jsx("div", { className: "space-y-0.5", children: notification.fields.map(([key, value]) => (_jsxs("div", { className: "flex min-w-0 gap-2", children: [_jsxs("span", { className: "text-muted-foreground shrink-0", children: [key, ":"] }), _jsx("span", { className: "text-foreground font-mono text-xs break-all", children: value })] }, `${key}:${value}`))) })), notification.body && (_jsx("div", { className: "text-muted-foreground
|
|
261
|
+
return (_jsxs(Disclosure, { variant: "outline", className: "bg-secondary", children: [_jsx(DisclosureTrigger, { children: _jsx(SystemMessage, { variant: systemNotificationSeverity(notification.tag), fill: true, children: _jsxs("span", { className: "block truncate", children: [notification.label, detail && _jsx("span", { className: "ml-1.5 opacity-70", children: detail })] }) }) }), _jsx(DisclosureContent, { children: _jsxs("div", { className: "space-y-1 px-3 pb-2 text-xs", children: [notification.fields.length > 0 && (_jsx("div", { className: "space-y-0.5", children: notification.fields.map(([key, value]) => (_jsxs("div", { className: "flex min-w-0 gap-2", children: [_jsxs("span", { className: "text-muted-foreground shrink-0", children: [key, ":"] }), _jsx("span", { className: "text-foreground font-mono text-xs break-all", children: value })] }, `${key}:${value}`))) })), notification.body && (_jsx("div", { className: "text-muted-foreground max-h-48 overflow-y-auto font-mono text-xs break-all whitespace-pre-wrap", children: notification.body.slice(0, 2000) }))] }) })] }));
|
|
243
262
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { parseSessionReferences } from './message-parsing.js';
|
|
2
|
+
import { parseFileMentionReferences, parseSessionReferences } from './message-parsing.js';
|
|
3
3
|
import type { SentAttachment } from '../composer/sent-attachment-previews.js';
|
|
4
4
|
import { type AttachmentUploadStatus } from '../turn/user-message.js';
|
|
5
5
|
/**
|
|
@@ -83,11 +83,13 @@ busy, deliveryStatus, className, }: {
|
|
|
83
83
|
* app: chip in the composer, underline in the optimistic bubble, underline
|
|
84
84
|
* again in the server turn.
|
|
85
85
|
*/
|
|
86
|
-
export declare function HighlightMentions({ text, sessions: parsedSessions, agentNames, onFileClick, }: {
|
|
86
|
+
export declare function HighlightMentions({ text, sessions: parsedSessions, drives: parsedDrives, agentNames, onFileClick, }: {
|
|
87
87
|
text: string;
|
|
88
88
|
/** The session refs the caller already stripped from `text`. Then `text` is
|
|
89
89
|
* not parsed again: a second parse finds no refs and loses every title. */
|
|
90
90
|
sessions?: ReturnType<typeof parseSessionReferences>['sessions'];
|
|
91
|
+
/** The Drive refs the caller already stripped, for the same reason. */
|
|
92
|
+
drives?: ReturnType<typeof parseFileMentionReferences>['drives'];
|
|
91
93
|
agentNames?: string[];
|
|
92
94
|
onFileClick?: (path: string) => void;
|
|
93
95
|
}): import("react").JSX.Element;
|
|
@@ -87,16 +87,16 @@ function OptimisticUserBubble({ text, agentNames, onFileClick, deferPreview, sta
|
|
|
87
87
|
// Strip every ref block the composer folded into the prompt, in the order it
|
|
88
88
|
// folded them in, so the bubble shows the sentence the user typed and the
|
|
89
89
|
// attachments as tiles — never raw XML.
|
|
90
|
-
const { quotes, files, cleanText, pastes, sessions } = useMemo(() => {
|
|
90
|
+
const { quotes, files, cleanText, pastes, sessions, drives } = useMemo(() => {
|
|
91
91
|
// Pastes first, as on the sent turn: a ref inside a paste is paste text.
|
|
92
92
|
const { text: afterPastes, pastes } = splitPastedContent(text);
|
|
93
93
|
const { cleanText: afterReply, quotes } = parseReplyContexts(afterPastes);
|
|
94
94
|
const { cleanText: afterFiles, files } = parseFileReferences(afterReply);
|
|
95
95
|
const { cleanText: afterProjects } = parseProjectReferences(afterFiles);
|
|
96
|
-
const { cleanText: afterFileMentions } = parseFileMentionReferences(afterProjects);
|
|
96
|
+
const { cleanText: afterFileMentions, drives } = parseFileMentionReferences(afterProjects);
|
|
97
97
|
const { cleanText: afterAgentMentions } = parseAgentMentionReferences(afterFileMentions);
|
|
98
98
|
const { cleanText, sessions } = parseSessionReferences(afterAgentMentions);
|
|
99
|
-
return { quotes, files, cleanText, pastes, sessions };
|
|
99
|
+
return { quotes, files, cleanText, pastes, sessions, drives };
|
|
100
100
|
}, [text]);
|
|
101
101
|
// Quotes are drawn where they were written, by the same component the sent
|
|
102
102
|
// message uses — see `QuotedMessageBody`.
|
|
@@ -138,7 +138,7 @@ function OptimisticUserBubble({ text, agentNames, onFileClick, deferPreview, sta
|
|
|
138
138
|
const author = viewerAuthor(viewer);
|
|
139
139
|
return author?.kind === 'member' ? author : null;
|
|
140
140
|
}, [viewer]);
|
|
141
|
-
return (_jsxs("div", { className: "ml-auto flex w-full max-w-[80%] flex-col items-end gap-2 self-end", children: [attachments.length > 0 && (_jsx(MessageAttachments, { attachments: attachments, status: uploadStatus })), (cleanText || quotedPieces) && (_jsx(MessageSenderAbove, { sender: sender, reserve: true, children: _jsx("div", { className: cn(BUBBLE_SURFACE, 'w-fit overflow-hidden rounded-tr-[calc(var(--radius)-6px)]'), children: quotedPieces ? (_jsx(QuotedMessageBody, { pieces: quotedPieces, renderText: (runText) => (_jsx(HighlightMentions, { text: runText, sessions: sessions, agentNames: agentNames, onFileClick: onFileClick })) })) : (_jsx("p", { className: BUBBLE_TEXT, children: _jsx(HighlightMentions, { text: cleanText, sessions: sessions, agentNames: agentNames, onFileClick: onFileClick }) })) }) })), _jsx(UserMessageActions, { timestamp: null, copyText: expandPastedContent(text), deliveryStatus: deliveryStatus })] }));
|
|
141
|
+
return (_jsxs("div", { className: "ml-auto flex w-full max-w-[80%] flex-col items-end gap-2 self-end", children: [attachments.length > 0 && (_jsx(MessageAttachments, { attachments: attachments, status: uploadStatus })), (cleanText || quotedPieces) && (_jsx(MessageSenderAbove, { sender: sender, reserve: true, children: _jsx("div", { className: cn(BUBBLE_SURFACE, 'w-fit overflow-hidden rounded-tr-[calc(var(--radius)-6px)]'), children: quotedPieces ? (_jsx(QuotedMessageBody, { pieces: quotedPieces, renderText: (runText) => (_jsx(HighlightMentions, { text: runText, sessions: sessions, drives: drives, agentNames: agentNames, onFileClick: onFileClick })) })) : (_jsx("p", { className: BUBBLE_TEXT, children: _jsx(HighlightMentions, { text: cleanText, sessions: sessions, drives: drives, agentNames: agentNames, onFileClick: onFileClick }) })) }) })), _jsx(UserMessageActions, { timestamp: null, copyText: expandPastedContent(text), deliveryStatus: deliveryStatus })] }));
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* Highlight @mentions in plain text (for optimistic & user messages).
|
|
@@ -150,13 +150,13 @@ function OptimisticUserBubble({ text, agentNames, onFileClick, deferPreview, sta
|
|
|
150
150
|
* app: chip in the composer, underline in the optimistic bubble, underline
|
|
151
151
|
* again in the server turn.
|
|
152
152
|
*/
|
|
153
|
-
export function HighlightMentions({ text, sessions: parsedSessions, agentNames, onFileClick, }) {
|
|
153
|
+
export function HighlightMentions({ text, sessions: parsedSessions, drives: parsedDrives, agentNames, onFileClick, }) {
|
|
154
154
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
155
155
|
// Strip every ref block (project/file/agent/session) before processing
|
|
156
156
|
// inline @ mentions so the visible text never shows raw XML.
|
|
157
|
-
const { cleanText, sessions } = useMemo(() => {
|
|
157
|
+
const { cleanText, sessions, drives } = useMemo(() => {
|
|
158
158
|
if (parsedSessions)
|
|
159
|
-
return { cleanText: text, sessions: parsedSessions };
|
|
159
|
+
return { cleanText: text, sessions: parsedSessions, drives: parsedDrives ?? [] };
|
|
160
160
|
const a = parseProjectReferences(text);
|
|
161
161
|
const b = parseFileMentionReferences(a.cleanText);
|
|
162
162
|
const c = parseAgentMentionReferences(b.cleanText);
|
|
@@ -164,11 +164,13 @@ export function HighlightMentions({ text, sessions: parsedSessions, agentNames,
|
|
|
164
164
|
return {
|
|
165
165
|
cleanText: d.cleanText,
|
|
166
166
|
sessions: d.sessions,
|
|
167
|
+
drives: b.drives,
|
|
167
168
|
};
|
|
168
|
-
}, [text, parsedSessions]);
|
|
169
|
+
}, [text, parsedSessions, parsedDrives]);
|
|
169
170
|
const sessionTitles = useMemo(() => sessions.map((s) => s.title), [sessions]);
|
|
171
|
+
const driveNames = useMemo(() => drives.map((d) => d.name), [drives]);
|
|
170
172
|
const segments = useMemo(() => {
|
|
171
|
-
const built = buildMentionSegments({ text: cleanText, sessionTitles, agentNames });
|
|
173
|
+
const built = buildMentionSegments({ text: cleanText, sessionTitles, driveNames, agentNames });
|
|
172
174
|
// Key each segment by its source offset in the text — content-derived and
|
|
173
175
|
// unique per segment, even when the same mention appears twice.
|
|
174
176
|
let offset = 0;
|
|
@@ -177,7 +179,7 @@ export function HighlightMentions({ text, sessions: parsedSessions, agentNames,
|
|
|
177
179
|
offset += seg.text.length;
|
|
178
180
|
return { ...seg, key };
|
|
179
181
|
});
|
|
180
|
-
}, [cleanText, sessionTitles, agentNames]);
|
|
182
|
+
}, [cleanText, sessionTitles, driveNames, agentNames]);
|
|
181
183
|
const sessionHref = useProjectSessionHref();
|
|
182
184
|
const shallowNavigate = useUiShallowNavigate();
|
|
183
185
|
const openSessionMention = (raw) => {
|
|
@@ -214,5 +216,5 @@ export function HighlightMentions({ text, sessions: parsedSessions, agentNames,
|
|
|
214
216
|
// Static when there is no runtime to open the file in yet (the
|
|
215
217
|
// instant shell) — a chip that looks pressable and does nothing is
|
|
216
218
|
// worse than one that plainly does not.
|
|
217
|
-
_jsx(MentionChip, { kind: "file", label: seg.text.replace(/^@/, ''), onClick: onFileClick ? () => onFileClick(seg.text.replace(/^@/, '')) : undefined }, seg.key)) : seg.type === 'session' ? (_jsx(MentionChip, { kind: "session", label: seg.text.replace(/^@/, ''), onClick: () => openSessionMention(seg.text.replace(/^@/, '')) }, seg.key)) : seg.type === 'agent' ? (_jsx(MentionChip, { kind: "agent", label: seg.text.replace(/^@/, '') }, seg.key)) : (_jsx("span", { children: seg.text }, seg.key))) }));
|
|
219
|
+
_jsx(MentionChip, { kind: "file", label: seg.text.replace(/^@/, ''), onClick: onFileClick ? () => onFileClick(seg.text.replace(/^@/, '')) : undefined }, seg.key)) : seg.type === 'session' ? (_jsx(MentionChip, { kind: "session", label: seg.text.replace(/^@/, ''), onClick: () => openSessionMention(seg.text.replace(/^@/, '')) }, seg.key)) : seg.type === 'agent' ? (_jsx(MentionChip, { kind: "agent", label: seg.text.replace(/^@/, '') }, seg.key)) : seg.type === 'drive' ? (_jsx(MentionChip, { kind: "drive", label: seg.text.replace(/^@/, '') }, seg.key)) : (_jsx("span", { children: seg.text }, seg.key))) }));
|
|
218
220
|
}
|
|
@@ -89,8 +89,9 @@ import { ReadOnlySessionContext } from '../tool/shared/infrastructure-contexts.j
|
|
|
89
89
|
import { firstPromptAttachments, retainSentAttachmentPreviews, sentAttachmentsForTurn, } from '../composer/sent-attachment-previews.js';
|
|
90
90
|
import { buildOptimisticPromptTextWithUploads, promptFileParts, sentAttachmentsOf, } from '../composer/uploaded-file-refs.js';
|
|
91
91
|
import { useAutoScroll } from '../../internal/hooks/use-auto-scroll.js';
|
|
92
|
-
import { appendSessionRefs, buildAgentRefsBlock, buildFileRefsBlock, } from '../../internal/lib/project-preamble.js';
|
|
92
|
+
import { appendDriveRefs, appendSessionRefs, buildAgentRefsBlock, buildFileRefsBlock, driveRefsOf, } from '../../internal/lib/project-preamble.js';
|
|
93
93
|
import { playSound } from '../../internal/lib/sounds.js';
|
|
94
|
+
import { driveUploadsOf } from '../composer/drive-mentions.js';
|
|
94
95
|
import { track } from '../../lib/telemetry.js';
|
|
95
96
|
import { cn } from '../../lib/utils.js';
|
|
96
97
|
import { useChatSendStore } from '../../internal/stores/chat-send-store.js';
|
|
@@ -587,6 +588,7 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
|
|
|
587
588
|
providers,
|
|
588
589
|
config,
|
|
589
590
|
sessionId,
|
|
591
|
+
projectSessionId,
|
|
590
592
|
boundAgentName,
|
|
591
593
|
defaultAgentName: projectConfig?.default_agent,
|
|
592
594
|
projectSession: projectSessionRow,
|
|
@@ -2323,6 +2325,7 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
|
|
|
2323
2325
|
else if (m.kind === 'agent')
|
|
2324
2326
|
agentMentionRefs.push({ name: m.label });
|
|
2325
2327
|
}
|
|
2328
|
+
const driveMentionRefs = driveRefsOf(mentions, driveUploadsOf(files));
|
|
2326
2329
|
// Play send sound
|
|
2327
2330
|
playSound('send');
|
|
2328
2331
|
// ONE id for the prompt's whole life. This is the WIRE id the inbox row
|
|
@@ -2379,6 +2382,7 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
|
|
|
2379
2382
|
if (block)
|
|
2380
2383
|
optimisticText = `${optimisticText}\n\n${block}`;
|
|
2381
2384
|
}
|
|
2385
|
+
optimisticText = appendDriveRefs(optimisticText, driveMentionRefs);
|
|
2382
2386
|
if (agentMentionRefs.length > 0) {
|
|
2383
2387
|
const block = buildAgentRefsBlock(agentMentionRefs);
|
|
2384
2388
|
if (block)
|
|
@@ -2581,6 +2585,7 @@ export function SessionChat({ sessionId, projectSessionId, sessionState, project
|
|
|
2581
2585
|
if (block)
|
|
2582
2586
|
textPrompt.text = `${textPrompt.text}\n\n${block}`;
|
|
2583
2587
|
}
|
|
2588
|
+
textPrompt.text = appendDriveRefs(textPrompt.text, driveMentionRefs);
|
|
2584
2589
|
if (agentMentionRefs.length > 0) {
|
|
2585
2590
|
const block = buildAgentRefsBlock(agentMentionRefs);
|
|
2586
2591
|
if (block)
|
|
@@ -77,7 +77,7 @@ function RawMessageJson({ value }) {
|
|
|
77
77
|
return (_jsxs("div", { className: "relative", children: [_jsx("pre", { className: "bg-muted/40 max-h-[400px] overflow-x-auto overflow-y-auto rounded-md p-3 font-mono text-xs break-all whitespace-pre-wrap select-text", children: json }), _jsx("div", { className: "absolute top-2 right-2", children: _jsx(CopyButton, { code: json, size: "sm" }) })] }));
|
|
78
78
|
}
|
|
79
79
|
const RawMessage = memo(function RawMessage({ row, formatTime, }) {
|
|
80
|
-
return (_jsxs(AccordionItem, { value: row.id, className: "border-b-0 [contain-intrinsic-size:auto_37px] [content-visibility:auto]", children: [_jsx(AccordionTrigger, { className: "hover:bg-muted/40 rounded-md px-3 py-2 text-xs hover:no-underline", children: _jsxs("div", { className: "flex w-full items-center justify-between gap-2 pr-2", children: [_jsxs("div", { className: "min-w-0 truncate font-mono", children: [_jsx(Badge, { variant: row.role === 'user' ? 'info' : 'success', size: "sm", className: "mr-2 font-semibold uppercase", children: row.role }), _jsx("span", { className: "text-muted-foreground", children: row.id })] }), _jsx("div", { className: "text-muted-foreground
|
|
80
|
+
return (_jsxs(AccordionItem, { value: row.id, className: "border-b-0 [contain-intrinsic-size:auto_37px] [content-visibility:auto]", children: [_jsx(AccordionTrigger, { className: "hover:bg-muted/40 rounded-md px-3 py-2 text-xs hover:no-underline", children: _jsxs("div", { className: "flex w-full items-center justify-between gap-2 pr-2", children: [_jsxs("div", { className: "min-w-0 truncate font-mono", children: [_jsx(Badge, { variant: row.role === 'user' ? 'info' : 'success', size: "sm", className: "mr-2 font-semibold uppercase", children: row.role }), _jsx("span", { className: "text-muted-foreground", children: row.id })] }), _jsx("div", { className: "text-muted-foreground shrink-0 text-xs tabular-nums", children: formatTime(row.created) })] }) }), _jsx(AccordionContent, { className: "px-3 pb-2", children: _jsx(RawMessageJson, { value: row.value }) })] }));
|
|
81
81
|
});
|
|
82
82
|
/** Preserve the raw explorer's role and case-insensitive ID/text search. */
|
|
83
83
|
export function filterRawMessages(rows, rawRole, deferredRawQuery) {
|
|
@@ -56,9 +56,8 @@ export declare function olderAutoloadExhausted(state: {
|
|
|
56
56
|
autoLoadedPages?: number;
|
|
57
57
|
}): boolean;
|
|
58
58
|
/** Decides whether the top sentinel coming into view should pull the previous
|
|
59
|
-
* page of history
|
|
60
|
-
*
|
|
61
|
-
* decision is then unit-testable without a real `IntersectionObserver`.
|
|
59
|
+
* page of history. Extracted so the paging decision is unit-testable without
|
|
60
|
+
* a real `IntersectionObserver`.
|
|
62
61
|
*
|
|
63
62
|
* `lastPullFailed` is the one condition the old manual button gave us for
|
|
64
63
|
* free. An observer re-arms whenever its dependencies change, so a cursor the
|
|
@@ -19,9 +19,8 @@ export function olderAutoloadExhausted(state) {
|
|
|
19
19
|
return state.hasOlder && (state.autoLoadedPages ?? 0) >= OLDER_AUTOLOAD_MAX_PAGES;
|
|
20
20
|
}
|
|
21
21
|
/** Decides whether the top sentinel coming into view should pull the previous
|
|
22
|
-
* page of history
|
|
23
|
-
*
|
|
24
|
-
* decision is then unit-testable without a real `IntersectionObserver`.
|
|
22
|
+
* page of history. Extracted so the paging decision is unit-testable without
|
|
23
|
+
* a real `IntersectionObserver`.
|
|
25
24
|
*
|
|
26
25
|
* `lastPullFailed` is the one condition the old manual button gave us for
|
|
27
26
|
* free. An observer re-arms whenever its dependencies change, so a cursor the
|
|
@@ -1104,7 +1104,7 @@ function TurnToolBlocks(props) {
|
|
|
1104
1104
|
// reads one way. A turn the reader touched while it worked (opened or closed
|
|
1105
1105
|
// a row) settles with its "Worked for" row open, so nothing they were
|
|
1106
1106
|
// reading disappears under them.
|
|
1107
|
-
const split = useMemo(() => (fold && !working ? splitSessionLogTurnWork(segments.filter(segmentRendersSomething), { working, foldStartedWork }) : null), [fold, segments, working, foldStartedWork]);
|
|
1107
|
+
const split = useMemo(() => (fold && (!working || !!runLabel) ? splitSessionLogTurnWork(segments.filter(segmentRendersSomething), { working: working && !runLabel, foldStartedWork }) : null), [fold, segments, working, foldStartedWork, runLabel]);
|
|
1108
1108
|
// A settled turn whose prompt is another agent's notice folds the notice
|
|
1109
1109
|
// row into this work fold with the work it led to (KRTX-4732): the parent's
|
|
1110
1110
|
// answer below is the only top-level message, and the row stays reachable
|
|
@@ -1114,7 +1114,7 @@ function TurnToolBlocks(props) {
|
|
|
1114
1114
|
// answer instead — the gate below keeps the block mounted for it.
|
|
1115
1115
|
// The run's other turns fold here too (KRTX-4732); while the turn still works, the run's
|
|
1116
1116
|
// row already stands, closed, over the reports that came before.
|
|
1117
|
-
const noticeFold = (!!workNotice || !!runContent) && fold && !working;
|
|
1117
|
+
const noticeFold = (!!workNotice || !!runContent) && fold && (!working || !!runLabel);
|
|
1118
1118
|
// A turn whose only work started agents has no steps, but its agent rows are what the
|
|
1119
1119
|
// person tracks: they draw (and fold once every agent reported, `foldStartedWork`).
|
|
1120
1120
|
const startedWork = useMemo(() => segments.some((segment) => segment.kind === 'standalone' && toolKind(segment.block.name) === 'task'), [segments]);
|
|
@@ -1514,14 +1514,12 @@ function SessionTurnImpl(props) {
|
|
|
1514
1514
|
const inRun = !!props.agentRun || !!props.runMember;
|
|
1515
1515
|
const turnSegments = useMemo(() => (inRun ? withoutRelayCalls(segments) : segments), [inRun, segments]);
|
|
1516
1516
|
const { runTurns, agentRun } = props;
|
|
1517
|
-
// The run's other turns
|
|
1518
|
-
//
|
|
1519
|
-
// shallow prop
|
|
1520
|
-
const
|
|
1521
|
-
? runTurns.
|
|
1517
|
+
// The run's other turns stay inside the anchor's activity fold, including interim replies.
|
|
1518
|
+
// Only the anchor's final answer stays at the top level. Memoized members only
|
|
1519
|
+
// need a shallow prop comparison when their anchor streams.
|
|
1520
|
+
const runContent = agentRun && runTurns?.length
|
|
1521
|
+
? runTurns.flatMap((member) => ['work', 'answer'].map((part) => (_jsx(SessionTurn, { ...props, turn: member, runMember: part, agentRun: undefined, runTurns: undefined, foldStartedWork: false, isWorkingTurn: false, pending: false, pendingPrompt: undefined, interruptedBeforeRun: false, isFirstTurn: false, isLast: false, ownsPlan: false }, `${member.id}:${part}`))))
|
|
1522
1522
|
: null;
|
|
1523
|
-
const runContent = runMembers('work');
|
|
1524
|
-
const runAnswers = runMembers('answer');
|
|
1525
1523
|
// A compaction turn's message-state — `inFlight` (the marker still
|
|
1526
1524
|
// streams its summary) is the half of "is this compaction running" the
|
|
1527
1525
|
// working projection cannot see, because it deliberately knows nothing
|
|
@@ -1623,7 +1621,7 @@ function SessionTurnImpl(props) {
|
|
|
1623
1621
|
// The segments are already the message's: nothing is left to fold.
|
|
1624
1622
|
fold: !messagesOnly && !answered.shouldUseInlineContent, durationMs: meta.turnDurationMs })), _jsx(TurnAssistantBlock, { ...props, model: model, answered: answered, userContent: userContent, tHardcodedUi: tHardcodedUi })] }), messagesOnly && !model.working && errors.turnErrorIsAbort && model.response.trim() === '' && shownSegments.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: tTurnRows('stopped') })) : null, _jsx(TurnFooter, { ...props, hideActionBar: true, quietBusy: messagesOnly, model: model, errors: errors, answered: answered, status: status, retry: retry, meta: meta, tHardcodedUi: tHardcodedUi, connectProviderOpen: connectProviderOpen, onConnectProviderOpenChange: setConnectProviderOpen }), messagesOnly && !model.working ? (_jsx(TurnMessageWork, { ...props, model: model, segments: segments, shown: shownSegments, userContent: userContent, conversationDensity: conversationDensity, front: rows.front === true })) : null] }) })) : null] }));
|
|
1625
1623
|
}
|
|
1626
|
-
return (_jsxs("div", { className: "group/turn text-factor-[2] space-y-2.5", children: [_jsx(TurnUserBlock, { ...props, model: model, queueTone: queueTone, userContent: userContent, noticeInWork: !!workNotice }), props.isFirstTurn ? afterFirstPrompt : null, _jsx(TurnFallbackRows, { working: model.working, events: props.servedModel?.fallbacks }), _jsxs(GenuiTelemetryContext.Provider, { value: genuiTelemetry, children: [_jsx(TurnToolBlocks, { ...props, model: model, segments: turnSegments, conversationDensity: conversationDensity, fold: !answered.shouldUseInlineContent, durationMs: meta.turnDurationMs, workNotice: workNotice, runContent: runContent, runLabel: agentRun ? sessionLogAgentRunLabel(agentRun) : undefined, foldStartedWork: props.foldStartedWork }),
|
|
1624
|
+
return (_jsxs("div", { className: "group/turn text-factor-[2] space-y-2.5", children: [_jsx(TurnUserBlock, { ...props, model: model, queueTone: queueTone, userContent: userContent, noticeInWork: !!workNotice }), props.isFirstTurn ? afterFirstPrompt : null, _jsx(TurnFallbackRows, { working: model.working, events: props.servedModel?.fallbacks }), _jsxs(GenuiTelemetryContext.Provider, { value: genuiTelemetry, children: [_jsx(TurnToolBlocks, { ...props, model: model, segments: turnSegments, conversationDensity: conversationDensity, fold: !answered.shouldUseInlineContent, durationMs: meta.turnDurationMs, workNotice: workNotice, runContent: runContent, runLabel: agentRun ? sessionLogAgentRunLabel(agentRun) : undefined, foldStartedWork: props.foldStartedWork }), _jsx(TurnAssistantBlock, { ...props, model: model, answered: answered, userContent: userContent, tHardcodedUi: tHardcodedUi })] }), _jsx(TurnFooter, { ...props, model: model, errors: errors, answered: answered, status: status, retry: retry, meta: meta, tHardcodedUi: tHardcodedUi, connectProviderOpen: connectProviderOpen, onConnectProviderOpenChange: setConnectProviderOpen })] }));
|
|
1627
1625
|
}
|
|
1628
1626
|
/**
|
|
1629
1627
|
* The boundary that stops the transcript re-rendering with the stream.
|