@kortix/ui 0.15.11 → 0.16.0
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 +478 -179
- package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
- package/dist/_vendor/shared/session/attachment-tile.d.ts +8 -0
- package/dist/_vendor/shared/workspace-settings.d.ts +3 -0
- package/dist/access/access/copy-row.d.ts +7 -1
- package/dist/access/access/copy-row.js +2 -2
- package/dist/animated-copy-icon.js +2 -1
- package/dist/browser/sandbox-browser-chrome.d.ts +2 -1
- package/dist/browser/sandbox-browser-chrome.js +1 -1
- package/dist/customize/agents/agent-cover-card.d.ts +1 -1
- package/dist/customize/agents/agent-cover-card.js +10 -2
- package/dist/customize/agents/agent-filter.js +3 -1
- package/dist/customize/agents/agent-overview.d.ts +10 -0
- package/dist/customize/agents/agent-overview.js +5 -4
- package/dist/customize/agents/agent-page-chrome.d.ts +5 -6
- package/dist/customize/agents/agent-page-chrome.js +16 -13
- package/dist/customize/agents/agent-page.js +6 -28
- package/dist/customize/agents/agent-tabs.d.ts +1 -0
- package/dist/customize/agents/agent-tabs.js +1 -0
- package/dist/customize/agents/agents-page.js +3 -3
- package/dist/customize/agents/create-agent-modal.d.ts +9 -0
- package/dist/customize/agents/create-agent-modal.js +21 -3
- package/dist/customize/agents/use-default-agent.js +2 -2
- package/dist/customize/connectors/connector-identity.d.ts +11 -2
- package/dist/customize/connectors/connector-identity.js +16 -4
- package/dist/customize/connectors/connectors-page.js +10 -6
- package/dist/customize/connectors/detail/app-page.js +2 -2
- package/dist/customize/connectors/install/install-dialog.d.ts +2 -0
- package/dist/customize/connectors/install/install-dialog.js +6 -1
- package/dist/customize/connectors/use-agent-access.d.ts +1 -0
- package/dist/customize/evals/eval-compare-view.d.ts +10 -0
- package/dist/customize/evals/eval-compare-view.js +68 -0
- package/dist/customize/evals/eval-dataset-view.d.ts +20 -0
- package/dist/customize/evals/eval-dataset-view.js +81 -0
- package/dist/customize/evals/eval-datasets-page.d.ts +25 -0
- package/dist/customize/evals/eval-datasets-page.js +91 -0
- package/dist/customize/evals/eval-job-view.d.ts +12 -0
- package/dist/customize/evals/eval-job-view.js +360 -0
- package/dist/customize/evals/eval-jobs-page.d.ts +4 -0
- package/dist/customize/evals/eval-jobs-page.js +69 -0
- package/dist/customize/evals/eval-meta.d.ts +97 -0
- package/dist/customize/evals/eval-meta.js +228 -0
- package/dist/customize/evals/eval-task-view.d.ts +13 -0
- package/dist/customize/evals/eval-task-view.js +123 -0
- package/dist/customize/evals/eval-tasks-page.d.ts +8 -0
- package/dist/customize/evals/eval-tasks-page.js +56 -0
- package/dist/customize/evals/eval-ui.d.ts +97 -0
- package/dist/customize/evals/eval-ui.js +153 -0
- package/dist/customize/evals/evals-page.d.ts +10 -0
- package/dist/customize/evals/evals-page.js +56 -0
- package/dist/customize/evals/run-eval-modal.d.ts +28 -0
- package/dist/customize/evals/run-eval-modal.js +167 -0
- package/dist/customize/project-settings/project-admin-sections.d.ts +3 -2
- package/dist/customize/project-settings/project-admin-sections.js +6 -1
- package/dist/customize/providers/provider-connect.d.ts +13 -0
- package/dist/customize/providers/provider-connect.js +29 -5
- package/dist/customize/providers/provider-sheet.js +5 -4
- package/dist/customize/sections/view/gateway/gateway-overview.d.ts +5 -0
- package/dist/customize/sections/view/gateway/gateway-overview.js +32 -6
- package/dist/customize/sections/view/gateway/routing-parts.d.ts +6 -0
- package/dist/customize/sections/view/gateway/routing-parts.js +21 -13
- package/dist/customize/sections/view/git-view.d.ts +19 -1
- package/dist/customize/sections/view/git-view.js +7 -3
- package/dist/customize/sections/view/manifest-issue-list.d.ts +16 -0
- package/dist/customize/sections/view/manifest-issue-list.js +41 -0
- package/dist/customize/sections/view/manifest-issues-row.d.ts +24 -0
- package/dist/customize/sections/view/manifest-issues-row.js +39 -0
- package/dist/customize/sections/view/sandbox-provider-coverage.d.ts +7 -1
- package/dist/customize/sections/view/sandbox-provider-coverage.js +7 -5
- package/dist/customize/sections/view/secrets-view.d.ts +13 -0
- package/dist/customize/sections/view/secrets-view.js +10 -6
- package/dist/customize/sections/view/subscription-usage.d.ts +2 -7
- package/dist/customize/sections/view/subscription-usage.js +4 -8
- package/dist/customize/settings/settings-tab-header.js +12 -3
- package/dist/customize/settings/tabs/experimental-tab.d.ts +16 -5
- package/dist/customize/settings/tabs/experimental-tab.js +36 -11
- package/dist/customize/settings/tabs/general-tab.js +1 -1
- package/dist/customize/settings/tabs/sandbox-tab.d.ts +10 -0
- package/dist/customize/settings/tabs/sandbox-tab.js +27 -4
- package/dist/customize/settings/tabs/snapshots-tab.d.ts +31 -0
- package/dist/customize/settings/tabs/snapshots-tab.js +61 -5
- package/dist/customize/settings/tabs/workspace-keys.js +6 -3
- package/dist/customize/shared/capability-page-shell.js +9 -1
- package/dist/customize/shared/catalog/catalog-card.d.ts +1 -1
- package/dist/customize/shared/catalog/catalog-card.js +15 -5
- package/dist/customize/shared/customize-tab-bar.js +1 -1
- package/dist/customize/shared/new-entity-menu.d.ts +1 -1
- package/dist/customize/shared/new-entity-menu.js +38 -1
- package/dist/customize/triggers/runtime-triggers.d.ts +4 -0
- package/dist/customize/triggers/runtime-triggers.js +21 -2
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule-view.js +2 -1
- package/dist/files/project/components/drive-explorer.js +33 -70
- package/dist/files/project/components/drive-grid-view.d.ts +2 -31
- package/dist/files/project/components/drive-grid-view.js +12 -22
- package/dist/files/project/components/drive-list-view.d.ts +3 -30
- package/dist/files/project/components/drive-list-view.js +8 -18
- package/dist/files/project/components/drive-selection-bar.d.ts +4 -5
- package/dist/files/project/components/drive-selection-bar.js +13 -20
- package/dist/files/project/components/explorer-listing.d.ts +48 -0
- package/dist/files/project/components/explorer-listing.js +64 -0
- package/dist/files/project/components/file-explorer-page.js +7 -204
- package/dist/files/project/components/file-thumbnail.js +3 -1
- package/dist/files/project/components/manifest-issue-mark.d.ts +9 -0
- package/dist/files/project/components/manifest-issue-mark.js +26 -0
- package/dist/files/project/hooks/use-change-requests.d.ts +10 -0
- package/dist/files/project/hooks/use-change-requests.js +17 -0
- package/dist/files/project/manifest-annotations.d.ts +16 -0
- package/dist/files/project/manifest-annotations.js +19 -0
- package/dist/files/project/store/version-store.d.ts +1 -1
- package/dist/files/project/upload-batch.d.ts +20 -0
- package/dist/files/project/upload-batch.js +20 -0
- package/dist/files/runtime/hooks/use-binary-blob.js +3 -2
- package/dist/files/runtime/hooks/use-file-content.js +3 -2
- package/dist/files/runtime/hooks/use-file-list.js +1 -2
- package/dist/files/runtime/hooks/use-file-mutations.js +69 -6
- package/dist/files/runtime/hooks/use-file-refresh.d.ts +4 -0
- package/dist/files/runtime/hooks/use-file-refresh.js +6 -0
- package/dist/files/tree/components/file-tree-item.js +1 -4
- package/dist/files/viewer/file-annotations.d.ts +18 -0
- package/dist/files/viewer/file-annotations.js +21 -0
- package/dist/files/viewer/file-content-renderer.js +1 -1
- package/dist/files/viewer/file-viewer.js +2 -1
- package/dist/files/viewer/index.d.ts +1 -0
- package/dist/files/viewer/index.js +1 -0
- package/dist/files/viewer/use-file-content-state.js +8 -1
- package/dist/i18n/en.d.ts +495 -46
- package/dist/i18n/en.js +536 -87
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -4
- package/dist/icons/caret-right-solid.d.ts +11 -0
- package/dist/icons/caret-right-solid.js +15 -0
- package/dist/internal/auth/auth-art.d.ts +12 -0
- package/dist/internal/auth/auth-art.js +118 -0
- package/dist/internal/auth/auth-card-shell.d.ts +14 -10
- package/dist/internal/auth/auth-card-shell.js +20 -31
- package/dist/internal/auth/auth-consent.d.ts +3 -1
- package/dist/internal/auth/auth-consent.js +2 -2
- package/dist/internal/auth/auth-primitives.d.ts +26 -1
- package/dist/internal/auth/auth-primitives.js +37 -8
- package/dist/internal/connector-logo/connector-logo.d.ts +2 -1
- package/dist/internal/connector-logo/connector-logo.js +11 -2
- package/dist/internal/files/file-read-retry.d.ts +18 -2
- package/dist/internal/files/file-read-retry.js +42 -4
- package/dist/internal/hooks/projects/use-new-project-session.js +5 -10
- package/dist/internal/hooks/use-auto-scroll-physics.d.ts +1 -1
- package/dist/internal/hooks/use-auto-scroll-physics.js +2 -10
- package/dist/internal/hooks/use-reduced-motion.d.ts +4 -0
- package/dist/internal/hooks/use-reduced-motion.js +12 -0
- package/dist/internal/hooks/use-save-shortcut.d.ts +8 -0
- package/dist/internal/hooks/use-save-shortcut.js +28 -0
- package/dist/internal/layout/connect-mcp-modal.d.ts +1 -1
- package/dist/internal/layout/connect-mcp-modal.js +9 -4
- package/dist/internal/layout/panel-chrome.d.ts +28 -0
- package/dist/internal/layout/panel-chrome.js +27 -0
- package/dist/internal/layout/project-page-header.js +5 -1
- package/dist/internal/lib/browser-noise/rules/webview.js +16 -0
- package/dist/internal/lib/manifest-health.d.ts +25 -1
- package/dist/internal/lib/manifest-health.js +56 -0
- package/dist/internal/lib/project-preamble.js +1 -1
- package/dist/internal/lib/web-notifications.d.ts +1 -1
- package/dist/internal/lib/web-notifications.js +3 -0
- package/dist/internal/notifications/notification-inbox.js +2 -1
- package/dist/internal/notifications/notification-rows.d.ts +1 -1
- package/dist/internal/notifications/notification-rows.js +15 -1
- package/dist/internal/selection/selection-bar.d.ts +2 -8
- package/dist/internal/selection/selection-bar.js +15 -38
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/browser-recents-store.d.ts +1 -1
- package/dist/internal/stores/current-account-store.d.ts +1 -1
- package/dist/internal/stores/first-chat-store.d.ts +1 -1
- package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
- package/dist/internal/stores/session-browser-store.d.ts +1 -1
- package/dist/internal/stores/session-expanded-store.d.ts +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/session-history-view-store.d.ts +1 -1
- package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
- package/dist/internal/stores/sound-store.d.ts +1 -1
- package/dist/internal/stores/tab-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +9 -1
- package/dist/internal/stores/user-preferences-store.js +2 -0
- package/dist/internal/stores/web-notification-store.d.ts +1 -1
- package/dist/lib/base-ui-compat.js +28 -1
- package/dist/lib/dotmatrix-hooks.d.ts +1 -0
- package/dist/lib/dotmatrix-hooks.js +3 -13
- package/dist/lib/reduced-motion.d.ts +10 -0
- package/dist/lib/reduced-motion.js +104 -0
- package/dist/lib/routes.d.ts +9 -0
- package/dist/lib/routes.js +7 -4
- package/dist/markdown/artifact-link.d.ts +11 -0
- package/dist/markdown/artifact-link.js +62 -0
- package/dist/markdown/code/index.d.ts +1 -1
- package/dist/markdown/code/index.js +1 -1
- package/dist/markdown/code/inline-code.d.ts +1 -1
- package/dist/markdown/code/inline-code.js +1 -1
- package/dist/markdown/genui/components/map-canvas.js +2 -1
- package/dist/markdown/index.d.ts +3 -1
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/{code/inline-chip.js → inline-chip.js} +2 -2
- package/dist/markdown/inline-code-text.d.ts +34 -0
- package/dist/markdown/inline-code-text.js +68 -0
- package/dist/markdown/setup-links/approval-decision.js +3 -3
- package/dist/markdown/soft-breaks.d.ts +21 -0
- package/dist/markdown/soft-breaks.js +33 -0
- package/dist/markdown/unified-markdown.d.ts +9 -1
- package/dist/markdown/unified-markdown.js +31 -9
- package/dist/primitives/action-bar.d.ts +50 -0
- package/dist/primitives/action-bar.js +87 -0
- package/dist/primitives/calendar.js +4 -2
- package/dist/primitives/inline-meta.js +2 -2
- package/dist/primitives/kortix-loader.js +2 -1
- package/dist/primitives/modal.d.ts +1 -1
- package/dist/primitives/paper-wallpaper-shaders.d.ts +1 -0
- package/dist/primitives/paper-wallpaper-shaders.js +6 -0
- package/dist/primitives/resizable.d.ts +1 -1
- package/dist/primitives/resize-seam.d.ts +3 -2
- package/dist/primitives/resize-seam.js +4 -3
- package/dist/primitives/settings-section-header.d.ts +30 -1
- package/dist/primitives/settings-section-header.js +37 -0
- package/dist/primitives/sliding-tab-indicator.js +2 -1
- package/dist/primitives/switch.js +15 -8
- package/dist/primitives/text-shimmer.js +6 -0
- package/dist/primitives/toast-clearance.d.ts +52 -0
- package/dist/primitives/toast-clearance.js +116 -0
- package/dist/primitives/toast.d.ts +3 -1
- package/dist/primitives/toast.js +2 -0
- package/dist/primitives/typed-title.js +1 -1
- package/dist/primitives/wallpaper-shaders.js +1 -1
- package/dist/session/actions/project-session-list-helpers.d.ts +16 -0
- package/dist/session/actions/project-session-list-helpers.js +18 -0
- package/dist/session/agents/agent-model.d.ts +1 -0
- package/dist/session/agents/agent-model.js +2 -1
- package/dist/session/agents/agent-strip.js +10 -4
- package/dist/session/agents/workflow-run-controls.d.ts +27 -4
- package/dist/session/agents/workflow-run-controls.js +63 -10
- package/dist/session/composer/ComposerCard.js +3 -0
- package/dist/session/composer/agent-selector.js +6 -4
- package/dist/session/composer/animated-placeholder.js +2 -1
- package/dist/session/composer/attachment-tile.d.ts +2 -2
- package/dist/session/composer/attachment-tile.js +25 -3
- package/dist/session/composer/composer-agent-access.d.ts +10 -1
- package/dist/session/composer/composer-agent-access.js +18 -4
- package/dist/session/composer/composer-chat-input.js +7 -2
- package/dist/session/composer/composer.d.ts +2 -2
- package/dist/session/composer/composer.js +7 -6
- package/dist/session/composer/hooks/use-file-search.d.ts +12 -2
- package/dist/session/composer/hooks/use-file-search.js +71 -7
- package/dist/session/composer/menus/menu-items.js +6 -2
- package/dist/session/composer/menus/menu-shell.d.ts +3 -1
- package/dist/session/composer/menus/menu-shell.js +2 -2
- package/dist/session/composer/menus/slash-menu.d.ts +7 -0
- package/dist/session/composer/menus/slash-menu.js +48 -1
- package/dist/session/composer/use-instant-session-send.js +7 -1
- package/dist/session/header/session-reminders-indicator.js +3 -2
- package/dist/session/header/session-site-header.js +24 -6
- package/dist/session/media/sandbox-url-detector.js +1 -1
- package/dist/session/models/model-connection-gate.js +2 -1
- package/dist/session/models/model-selector.js +1 -1
- package/dist/session/models/subscription-switcher.d.ts +7 -0
- package/dist/session/models/subscription-switcher.js +52 -10
- package/dist/session/models/subscription-windows.d.ts +2 -0
- package/dist/session/models/subscription-windows.js +2 -0
- package/dist/session/outcomes/session-outcomes-provider.js +14 -7
- package/dist/session/panel/action-panel.js +8 -19
- package/dist/session/panel/easy/app-preview.d.ts +4 -1
- package/dist/session/panel/easy/app-preview.js +95 -33
- package/dist/session/panel/easy/apps-card.js +6 -11
- package/dist/session/panel/easy/change-requests-card.js +1 -1
- package/dist/session/panel/easy/changes-card.d.ts +14 -0
- package/dist/session/panel/easy/changes-card.js +60 -0
- package/dist/session/panel/easy/context-card.d.ts +5 -1
- package/dist/session/panel/easy/context-card.js +13 -28
- package/dist/session/panel/easy/context-meter.d.ts +18 -0
- package/dist/session/panel/easy/context-meter.js +73 -0
- package/dist/session/panel/easy/detail-view.d.ts +1 -1
- package/dist/session/panel/easy/detail-view.js +24 -21
- package/dist/session/panel/easy/easy-panel.js +7 -5
- package/dist/session/panel/easy/file-preview.js +3 -1
- package/dist/session/panel/easy/frame-history.d.ts +91 -0
- package/dist/session/panel/easy/frame-history.js +198 -0
- package/dist/session/panel/easy/outputs-card.d.ts +10 -0
- package/dist/session/panel/easy/outputs-card.js +28 -31
- package/dist/session/panel/easy/panel-card.d.ts +1 -3
- package/dist/session/panel/easy/panel-card.js +24 -8
- package/dist/session/panel/easy/plan-card.js +2 -2
- package/dist/session/panel/easy/step-icon.d.ts +4 -1
- package/dist/session/panel/easy/step-icon.js +2 -2
- package/dist/session/panel/session-action-panel-column.d.ts +5 -0
- package/dist/session/panel/session-action-panel-column.js +198 -101
- package/dist/session/panel/session-desktop.js +5 -1
- package/dist/session/panel/session-diff-viewer.d.ts +3 -1
- package/dist/session/panel/session-diff-viewer.js +7 -4
- package/dist/session/panel/session-panel-provider.js +29 -5
- package/dist/session/panel/shared/derive-panels.js +64 -4
- package/dist/session/status/session-busy-indicator.js +2 -1
- package/dist/session/status/session-error-banner.js +1 -1
- package/dist/session/thread/chat-minimap.js +2 -1
- package/dist/session/thread/session-body.js +4 -1
- package/dist/session/thread/session-chat.js +18 -3
- package/dist/session/thread/session-turn-meta-rows.d.ts +13 -5
- package/dist/session/thread/session-turn-meta-rows.js +33 -5
- package/dist/session/thread/transcript.d.ts +1 -2
- package/dist/session/thread/transcript.js +26 -24
- package/dist/session/thread/typing-indicator.d.ts +2 -2
- package/dist/session/thread/typing-indicator.js +10 -3
- package/dist/session/tool/tools/session-spawn-tool.js +3 -3
- package/dist/session/tool/tools/workflow-run-card.d.ts +11 -1
- package/dist/session/tool/tools/workflow-run-card.js +31 -7
- package/dist/session/tool/tools/workflow-run-cost.d.ts +29 -0
- package/dist/session/tool/tools/workflow-run-cost.js +75 -0
- package/dist/session/tool/tools/workflow-tool.d.ts +1 -1
- package/dist/session/tool/tools/workflow-tool.js +40 -15
- package/dist/session/turn/peer-message-row.js +1 -1
- package/dist/session/turn/queued-prompt-bubbles.d.ts +3 -2
- package/dist/session/turn/queued-prompt-bubbles.js +1 -1
- package/dist/session/turn/throttled-markdown.js +1 -1
- package/dist/styles/theme.css +68 -0
- package/dist/styles.css +1 -1
- package/dist/terminal/pty-terminal.js +1 -1
- package/dist/terminal/session-terminal-connect-bar.js +2 -1
- package/dist/test-utils/intl.d.ts +495 -46
- package/dist/workspace/admin/project-admin-dashboard.js +21 -7
- package/dist/workspace/admin/settings-search-landing.js +2 -1
- package/dist/workspace/calendar/calendar-dates.d.ts +31 -0
- package/dist/workspace/calendar/calendar-dates.js +64 -0
- package/dist/workspace/calendar/calendar-new-item.d.ts +11 -0
- package/dist/workspace/calendar/calendar-new-item.js +47 -0
- package/dist/workspace/calendar/calendar-page.d.ts +3 -0
- package/dist/workspace/calendar/calendar-page.js +177 -0
- package/dist/workspace/calendar/calendar-panel.d.ts +13 -0
- package/dist/workspace/calendar/calendar-panel.js +103 -0
- package/dist/workspace/calendar/calendar-people.d.ts +52 -0
- package/dist/workspace/calendar/calendar-people.js +117 -0
- package/dist/workspace/calendar/calendar-scheduled.d.ts +29 -0
- package/dist/workspace/calendar/calendar-scheduled.js +118 -0
- package/dist/workspace/calendar/calendar-views.d.ts +32 -0
- package/dist/workspace/calendar/calendar-views.js +124 -0
- package/dist/workspace/calendar/calendar-when.d.ts +14 -0
- package/dist/workspace/calendar/calendar-when.js +81 -0
- package/dist/workspace/calendar/mention-textarea.d.ts +19 -0
- package/dist/workspace/calendar/mention-textarea.js +84 -0
- package/dist/workspace/home/access-requests-bell.js +2 -1
- package/dist/workspace/inbox/workspace-inbox.d.ts +1 -1
- package/dist/workspace/inbox/workspace-inbox.js +1 -1
- package/dist/workspace/layout/project-files-view.js +2 -1
- package/dist/workspace/memory/memory-page-list.js +1 -1
- package/dist/workspace/new/workspace-handoff.js +2 -1
- package/dist/workspace/projects/modal/project-icon-field.js +2 -1
- package/dist/workspace/session-workspace.js +13 -12
- package/dist/workspace/setup/setup-steps.d.ts +43 -0
- package/dist/workspace/setup/setup-steps.js +38 -0
- package/dist/workspace/setup/workspace-setup-page.d.ts +10 -0
- package/dist/workspace/setup/workspace-setup-page.js +124 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +5 -1
- package/dist/workspace/sidebar/footer/project-calendar-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-calendar-nav.js +31 -0
- package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +14 -6
- package/dist/workspace/sidebar/footer/project-chrome-nav.js +37 -25
- package/dist/workspace/sidebar/footer/project-computer-nav.d.ts +17 -9
- package/dist/workspace/sidebar/footer/project-computer-nav.js +36 -26
- package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-download-app-nav.js +25 -13
- package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-inbox-nav.js +29 -0
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +3 -13
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +6 -48
- package/dist/workspace/sidebar/footer/project-mcp-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-mcp-nav.js +31 -13
- package/dist/workspace/sidebar/footer/project-phone-app-nav.d.ts +10 -0
- package/dist/workspace/sidebar/footer/project-phone-app-nav.js +61 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +21 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.js +33 -0
- package/dist/workspace/sidebar/footer/promo-card.d.ts +41 -0
- package/dist/workspace/sidebar/footer/promo-card.js +47 -0
- package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
- package/dist/workspace/sidebar/project-nav-items.js +12 -4
- package/dist/workspace/sidebar/project-session-list.js +58 -26
- package/dist/workspace/sidebar/project-sidebar.js +2 -5
- package/dist/workspace/sidebar/project-spaces-nav.js +2 -1
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +24 -0
- package/dist/workspace/sidebar/session-brief-hover-card.js +4 -3
- package/dist/workspace/sidebar/session-group-sections.d.ts +26 -7
- package/dist/workspace/sidebar/session-group-sections.js +121 -41
- package/dist/workspace/sidebar/sidebar-drill.js +6 -0
- package/dist/workspace/sidebar/sidebar-more-group.js +3 -2
- package/dist/workspace/sidebar/use-workspace-list.d.ts +7 -0
- package/dist/workspace/sidebar/use-workspace-list.js +11 -1
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +14 -0
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +46 -2
- package/dist/workspace/space/space-tab-panels.js +1 -1
- package/dist/workspace/spaces/space-timeline.js +2 -2
- package/package.json +67 -10
- package/skills/kortix-ui/SKILL.md +2 -2
- package/skills/kortix-ui/references/modules.md +5 -3
- package/dist/session/thread/turn-share.d.ts +0 -16
- package/dist/session/thread/turn-share.js +0 -161
- package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +0 -11
- package/dist/workspace/sidebar/footer/promo-nav-row.js +0 -7
- /package/dist/markdown/{code/inline-chip.d.ts → inline-chip.d.ts} +0 -0
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
|
-
* The action panel column — the Outputs/Context/Preview
|
|
5
|
-
*
|
|
4
|
+
* The action panel column — the Outputs/Context/Preview sections as a docked
|
|
5
|
+
* pane beside the chat.
|
|
6
6
|
*
|
|
7
7
|
* IN FLOW, never an overlay. It sits beside the chat as a sibling, so opening
|
|
8
8
|
* it takes width away from the transcript and the chat re-centers itself in
|
|
9
|
-
* what is left.
|
|
10
|
-
* and covered it; this one moves it.
|
|
9
|
+
* what is left.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* Docked, not floating. One hairline (`border-l`) separates it from the chat
|
|
12
|
+
* and it runs the full height of the body, under the session header's rule.
|
|
13
|
+
* The sections inside are flat rows divided by hairlines (`easy/panel-card.tsx`).
|
|
14
|
+
* No card, radius or shadow: the brand rule for an in-flow surface
|
|
15
|
+
* (`effects.md`), and the look of a docked pane.
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* Resizable. The left edge is a drag handle (pointer and arrow keys); the width
|
|
18
|
+
* persists per browser. Double-click the edge to reset it.
|
|
19
|
+
*
|
|
20
|
+
* Its toggle lives in the session header (`session-site-header.tsx`), beside
|
|
21
|
+
* the other panel controls, never as a rail over the chat.
|
|
19
22
|
*
|
|
20
23
|
* It toggles ONLY itself. Opening it never opens the right-hand detail panel;
|
|
21
24
|
* that surface is content-driven and opens when something gives it a detail to
|
|
@@ -30,53 +33,179 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
30
33
|
* "toggle the right side", which is `toggleRightPanel` in the store: close
|
|
31
34
|
* whatever is docked there — this column, a detail panel, or both — and, when
|
|
32
35
|
* nothing is, reopen what this session was last showing, falling back to this
|
|
33
|
-
* column. One key for one visual region.
|
|
34
|
-
* the session and the key is back to opening this column.
|
|
36
|
+
* column. One key for one visual region.
|
|
35
37
|
*
|
|
36
38
|
* The binding lives on this component only because this is the surface that is
|
|
37
39
|
* always mounted for a session (the detail panel is content-driven and may
|
|
38
40
|
* have nothing to render). It stays mounted while `hidden` under a detail,
|
|
39
41
|
* which is what lets the key close that detail.
|
|
40
|
-
*
|
|
41
|
-
* The chevron is unaffected: it is this column's own control, so it toggles
|
|
42
|
-
* this column and nothing else.
|
|
43
42
|
*/
|
|
44
|
-
import Hint from '../../primitives/hint.js';
|
|
45
|
-
import { Kbd, KbdGroup } from '../../primitives/kbd.js';
|
|
46
43
|
import { ActionPanel } from './action-panel.js';
|
|
47
44
|
import { useOptionalSessionPanel } from './session-panel-provider.js';
|
|
48
45
|
import { useIsMobile } from '../../internal/hooks/index.js';
|
|
49
46
|
import { cn } from '../../lib/utils.js';
|
|
50
|
-
import {
|
|
47
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
48
|
+
import { RESIZE_SEAM_CLASS } from '../../primitives/resize-seam.js';
|
|
49
|
+
import { useIsActionPanelOpen, useIsSidePanelOpen, useToggleRightPanel, } from '../../internal/stores/kortix-computer-store.js';
|
|
51
50
|
import { useTabStore } from '../../internal/stores/tab-store.js';
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import { useEffect } from 'react';
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
const
|
|
51
|
+
import { m } from 'motion/react';
|
|
52
|
+
import { useReducedMotion } from '../../internal/hooks/use-reduced-motion.js';
|
|
53
|
+
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
54
|
+
/** Width bounds, in px. The chat keeps at least the rest of the row. */
|
|
55
|
+
export const ACTION_PANEL_DEFAULT_WIDTH = 340;
|
|
56
|
+
export const ACTION_PANEL_MIN_WIDTH = 280;
|
|
57
|
+
export const ACTION_PANEL_MAX_WIDTH = 560;
|
|
58
|
+
/** One arrow-key step on the resize edge. */
|
|
59
|
+
const KEY_STEP = 16;
|
|
60
|
+
const WIDTH_STORAGE_KEY = 'kortix:session-action-panel-width';
|
|
61
|
+
export function clampActionPanelWidth(width, max = ACTION_PANEL_MAX_WIDTH) {
|
|
62
|
+
if (!Number.isFinite(width))
|
|
63
|
+
return ACTION_PANEL_DEFAULT_WIDTH;
|
|
64
|
+
return Math.round(Math.min(max, Math.max(ACTION_PANEL_MIN_WIDTH, width)));
|
|
65
|
+
}
|
|
61
66
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
* The width on screen and the widest it may go right now, read from the DOM.
|
|
68
|
+
* The column is capped at half its row (`max-w-[50cqw]`), so on a narrow
|
|
69
|
+
* window the visible width is below the stored one. A resize must start from
|
|
70
|
+
* what the user sees, or the edge does not follow the pointer until the drag
|
|
71
|
+
* passes the stored width.
|
|
72
|
+
*/
|
|
73
|
+
function liveBounds(handle) {
|
|
74
|
+
const column = handle.parentElement;
|
|
75
|
+
const row = column?.parentElement;
|
|
76
|
+
const rendered = column?.getBoundingClientRect().width ?? ACTION_PANEL_DEFAULT_WIDTH;
|
|
77
|
+
const max = row
|
|
78
|
+
? Math.min(ACTION_PANEL_MAX_WIDTH, Math.floor(row.getBoundingClientRect().width / 2))
|
|
79
|
+
: ACTION_PANEL_MAX_WIDTH;
|
|
80
|
+
return { rendered, max };
|
|
81
|
+
}
|
|
82
|
+
function readStoredWidth() {
|
|
83
|
+
try {
|
|
84
|
+
const raw = window.localStorage.getItem(WIDTH_STORAGE_KEY);
|
|
85
|
+
return raw ? clampActionPanelWidth(Number(raw)) : ACTION_PANEL_DEFAULT_WIDTH;
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return ACTION_PANEL_DEFAULT_WIDTH;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Same-tab writers notify through this event; other tabs through `storage`. */
|
|
92
|
+
const WIDTH_EVENT = 'kortix:session-action-panel-width';
|
|
93
|
+
/** Set only while storage writes fail, so a resize still lasts for this page.
|
|
94
|
+
* A working store stays the source of truth, which keeps other tabs' writes
|
|
95
|
+
* (the `storage` event) visible here. */
|
|
96
|
+
let memoryWidth = null;
|
|
97
|
+
function writeStoredWidth(width) {
|
|
98
|
+
try {
|
|
99
|
+
window.localStorage.setItem(WIDTH_STORAGE_KEY, String(width));
|
|
100
|
+
memoryWidth = null;
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
memoryWidth = width;
|
|
104
|
+
}
|
|
105
|
+
window.dispatchEvent(new Event(WIDTH_EVENT));
|
|
106
|
+
}
|
|
107
|
+
function subscribeStoredWidth(onChange) {
|
|
108
|
+
const onStorage = (e) => {
|
|
109
|
+
if (e.key === WIDTH_STORAGE_KEY)
|
|
110
|
+
onChange();
|
|
111
|
+
};
|
|
112
|
+
window.addEventListener(WIDTH_EVENT, onChange);
|
|
113
|
+
window.addEventListener('storage', onStorage);
|
|
114
|
+
return () => {
|
|
115
|
+
window.removeEventListener(WIDTH_EVENT, onChange);
|
|
116
|
+
window.removeEventListener('storage', onStorage);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const getStoredWidth = () => memoryWidth ?? readStoredWidth();
|
|
120
|
+
// The server has no storage: it renders the default, and the client swaps in
|
|
121
|
+
// the stored width after hydration without a mismatch.
|
|
122
|
+
const getServerWidth = () => ACTION_PANEL_DEFAULT_WIDTH;
|
|
123
|
+
/**
|
|
124
|
+
* The column's width, plus a drag/keyboard handle for its left edge. The edge
|
|
125
|
+
* sits on the column's LEFT, so dragging left (a smaller clientX) widens it.
|
|
126
|
+
*/
|
|
127
|
+
function useActionPanelWidth() {
|
|
128
|
+
const storedWidth = useSyncExternalStore(subscribeStoredWidth, getStoredWidth, getServerWidth);
|
|
129
|
+
// The live width while a drag is in flight; storage is written once, on drop.
|
|
130
|
+
const [dragWidth, setDragWidth] = useState(null);
|
|
131
|
+
const drag = useRef(null);
|
|
132
|
+
const width = dragWidth ?? storedWidth;
|
|
133
|
+
const dragging = dragWidth !== null;
|
|
134
|
+
const commit = useCallback((next, max) => {
|
|
135
|
+
writeStoredWidth(clampActionPanelWidth(next, max));
|
|
136
|
+
}, []);
|
|
137
|
+
const onPointerDown = useCallback((e) => {
|
|
138
|
+
if (e.button !== 0)
|
|
139
|
+
return;
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
142
|
+
const { rendered, max } = liveBounds(e.currentTarget);
|
|
143
|
+
const start = clampActionPanelWidth(rendered, max);
|
|
144
|
+
drag.current = { startX: e.clientX, startWidth: start, max, last: start, moved: false };
|
|
145
|
+
setDragWidth(start);
|
|
146
|
+
}, []);
|
|
147
|
+
const onPointerMove = useCallback((e) => {
|
|
148
|
+
const start = drag.current;
|
|
149
|
+
if (!start)
|
|
150
|
+
return;
|
|
151
|
+
const next = clampActionPanelWidth(start.startWidth + (start.startX - e.clientX), start.max);
|
|
152
|
+
start.last = next;
|
|
153
|
+
if (e.clientX !== start.startX)
|
|
154
|
+
start.moved = true;
|
|
155
|
+
setDragWidth(next);
|
|
156
|
+
}, []);
|
|
157
|
+
const onPointerEnd = useCallback((e) => {
|
|
158
|
+
const ended = drag.current;
|
|
159
|
+
if (!ended)
|
|
160
|
+
return;
|
|
161
|
+
drag.current = null;
|
|
162
|
+
if (e.currentTarget.hasPointerCapture(e.pointerId)) {
|
|
163
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
164
|
+
}
|
|
165
|
+
// Saved from the ref, not from render state: the last move may not have
|
|
166
|
+
// rendered yet when the pointer lifts.
|
|
167
|
+
if (ended.moved)
|
|
168
|
+
commit(ended.last);
|
|
169
|
+
setDragWidth(null);
|
|
170
|
+
}, [commit]);
|
|
171
|
+
const onKeyDown = useCallback((e) => {
|
|
172
|
+
const step = e.shiftKey ? KEY_STEP * 4 : KEY_STEP;
|
|
173
|
+
const { rendered, max } = liveBounds(e.currentTarget);
|
|
174
|
+
if (e.key === 'ArrowLeft')
|
|
175
|
+
commit(rendered + step, max);
|
|
176
|
+
else if (e.key === 'ArrowRight')
|
|
177
|
+
commit(rendered - step, max);
|
|
178
|
+
else if (e.key === 'Home')
|
|
179
|
+
commit(max, max);
|
|
180
|
+
else if (e.key === 'End')
|
|
181
|
+
commit(ACTION_PANEL_MIN_WIDTH, max);
|
|
182
|
+
else
|
|
183
|
+
return;
|
|
184
|
+
e.preventDefault();
|
|
185
|
+
}, [commit]);
|
|
186
|
+
const onDoubleClick = useCallback(() => commit(ACTION_PANEL_DEFAULT_WIDTH), [commit]);
|
|
187
|
+
return {
|
|
188
|
+
width,
|
|
189
|
+
dragging,
|
|
190
|
+
handleProps: {
|
|
191
|
+
onPointerDown,
|
|
192
|
+
onPointerMove,
|
|
193
|
+
onPointerUp: onPointerEnd,
|
|
194
|
+
onPointerCancel: onPointerEnd,
|
|
195
|
+
onKeyDown,
|
|
196
|
+
onDoubleClick,
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Motion. Pushing the chat aside IS a layout change, so the width animates —
|
|
202
|
+
* one 200ms one-shot on an explicit toggle, on a single element. Ease-out,
|
|
203
|
+
* 200ms in, 160ms out. A drag never animates: the edge follows the pointer.
|
|
70
204
|
*/
|
|
71
|
-
/** Collapsed, the column is only the chevron: `size-7` + `mr-1` + the `gap-2`
|
|
72
|
-
* before the zero-width panel = 10 spacing tokens (`--spacing: 0.23rem`). A
|
|
73
|
-
* negative margin of the same size cancels it, so the chat centers on the
|
|
74
|
-
* full row width and the chevron sits over its right edge. Kept in rem so
|
|
75
|
-
* motion can interpolate it against `0rem`. */
|
|
76
|
-
const COLLAPSED_RAIL_OFFSET = '-2.3rem';
|
|
77
205
|
const EASE_OUT = [0.23, 1, 0.32, 1];
|
|
78
206
|
const ENTER = { duration: 0.2, ease: EASE_OUT };
|
|
79
207
|
const EXIT = { duration: 0.16, ease: EASE_OUT };
|
|
208
|
+
const INSTANT = { duration: 0 };
|
|
80
209
|
export function SessionActionPanelColumn({
|
|
81
210
|
/**
|
|
82
211
|
* Own the ⌘I / Ctrl+I binding. False for the instant boot shell: it and the
|
|
@@ -86,19 +215,19 @@ export function SessionActionPanelColumn({
|
|
|
86
215
|
* shell yields it; the surface that outlives the fade keeps it.
|
|
87
216
|
*/
|
|
88
217
|
hotkey = true, } = {}) {
|
|
218
|
+
const t = useTranslations('sessionUi.panel');
|
|
89
219
|
const panel = useOptionalSessionPanel();
|
|
90
220
|
const isMobile = useIsMobile();
|
|
91
221
|
const isOpen = useIsActionPanelOpen();
|
|
92
|
-
// The chevron's own action — it is this column's control, so it moves this
|
|
93
|
-
// column and nothing else.
|
|
94
|
-
const toggle = useToggleActionPanel();
|
|
95
222
|
// ⌘I's action — the whole right side, whichever surface is docked there.
|
|
96
223
|
const toggleRight = useToggleRightPanel();
|
|
97
|
-
const readyChip = useReadyChip();
|
|
98
224
|
const reduce = useReducedMotion();
|
|
225
|
+
const { width, dragging, handleProps } = useActionPanelWidth();
|
|
226
|
+
// Built once: a drag re-renders this column on every pointer move, and the
|
|
227
|
+
// sections (Outputs can hold hundreds of rows) must not re-render with it.
|
|
228
|
+
const sections = useMemo(() => _jsx(ActionPanel, {}), []);
|
|
99
229
|
// The right-hand detail panel is showing a browser, a terminal, a file
|
|
100
|
-
// explorer or a file preview.
|
|
101
|
-
// this flag is true exactly when one of those is on screen.
|
|
230
|
+
// explorer or a file preview.
|
|
102
231
|
const detailPanelOpen = useIsSidePanelOpen();
|
|
103
232
|
const sessionId = panel?.sessionId;
|
|
104
233
|
const isInTabSystem = useTabStore((s) => (sessionId ? !!s.tabs[sessionId] : false));
|
|
@@ -112,11 +241,8 @@ hotkey = true, } = {}) {
|
|
|
112
241
|
const onKey = (e) => {
|
|
113
242
|
if ((e.metaKey || e.ctrlKey) && (e.key === 'i' || e.key === 'I')) {
|
|
114
243
|
e.preventDefault();
|
|
115
|
-
// NOT
|
|
116
|
-
// the
|
|
117
|
-
// detail panel (browser, terminal, files, a preview) with no keyboard
|
|
118
|
-
// close at all, and pressing ⌘I under one silently moved a column the
|
|
119
|
-
// detail was covering.
|
|
244
|
+
// NOT the column's own toggle — see this file's header. The key owns
|
|
245
|
+
// the right side, so it also closes a detail panel.
|
|
120
246
|
toggleRight();
|
|
121
247
|
}
|
|
122
248
|
};
|
|
@@ -135,56 +261,27 @@ hotkey = true, } = {}) {
|
|
|
135
261
|
}, [shouldHandleHotkey, toggleRight]);
|
|
136
262
|
// No provider means no panel to render: `SessionChat` also renders read-only
|
|
137
263
|
// inside `legacy-subagent-chat.tsx`, outside `SessionLayout`. Mobile has no
|
|
138
|
-
// column either — at 375px a side column is the whole screen, so the
|
|
139
|
-
// stay in the bottom drawer
|
|
264
|
+
// column either — at 375px a side column is the whole screen, so the
|
|
265
|
+
// sections stay in the bottom drawer.
|
|
140
266
|
if (!panel || isMobile)
|
|
141
267
|
return null;
|
|
142
|
-
const showReadyDot = readyChip?.sessionId === sessionId && !isOpen;
|
|
143
|
-
const label = isOpen ? 'Collapse pane' : 'Expand pane';
|
|
144
268
|
return (
|
|
145
|
-
// The
|
|
146
|
-
//
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
//
|
|
150
|
-
|
|
151
|
-
//
|
|
152
|
-
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
// purpose: `isActionPanelOpen` is never written here, so closing the
|
|
164
|
-
// detail brings the column back exactly as the user left it. The two
|
|
165
|
-
// states stay independent — only what is PAINTED depends on both.
|
|
166
|
-
detailPanelOpen && 'hidden'), "data-testid": "session-action-panel", children: [_jsx(Hint, { side: "left", sideOffset: 4, delayDuration: 300, label: _jsxs("span", { className: "flex items-center gap-1.5", children: [label, _jsxs(KbdGroup, { children: [_jsx(Kbd, { className: "font-mono", children: modSymbol }), _jsx(Kbd, { className: "font-mono", children: "I" })] })] }), children: _jsx("button", { type: "button", "aria-label": label, "aria-expanded": isOpen, onClick: toggle, className: cn('flex size-7 shrink-0 items-center justify-center rounded-md', 'text-foreground/80 hover:text-foreground hover:bg-accent', 'transition-[color,background-color,transform,opacity] duration-150 ease-out active:scale-[0.96]',
|
|
167
|
-
// Expanded, the collapse control steps out of the way: the cards
|
|
168
|
-
// are the content, and a permanently visible chevron beside them is
|
|
169
|
-
// chrome the user has already read. Hovering anywhere in the column
|
|
170
|
-
// brings it back, as does tabbing to it.
|
|
171
|
-
//
|
|
172
|
-
// `pointer-events-none` rides WITH the fade, deliberately. Opacity
|
|
173
|
-
// zero still occupies space AND still receives pointer events, so a
|
|
174
|
-
// faded-out button stays clickable — an invisible hit target pinned
|
|
175
|
-
// against the panel's edge. (This is the opacity/visibility
|
|
176
|
-
// distinction: `visibility: hidden` would drop interaction for us,
|
|
177
|
-
// but it is not animatable, and the fade is the point.) Both are
|
|
178
|
-
// restored together on reveal. Focus is unaffected by
|
|
179
|
-
// `pointer-events`, so the keyboard path still reaches it.
|
|
180
|
-
isOpen
|
|
181
|
-
? 'pointer-events-none opacity-0 group-hover/panel:pointer-events-auto group-hover/panel:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100'
|
|
182
|
-
: 'pointer-events-auto mr-1'), children: _jsx("span", { className: "relative inline-flex", children: isOpen ? (_jsx(CaretDoubleRightIcon, { className: "size-4" })) : (_jsx(CaretDoubleLeftIcon, { className: "size-4" })) }) }) }), _jsx(m.div, { initial: false, animate: { width: isOpen ? PANEL_WIDTH : 0 }, transition: reduce ? { duration: 0 } : isOpen ? ENTER : EXIT, "aria-hidden": !isOpen, inert: !isOpen || undefined,
|
|
183
|
-
// `self-stretch` against the column's `items-start`: the cards inside
|
|
184
|
-
// divide the available height between them, and "available" has to be
|
|
185
|
-
// a real number for that to mean anything. Left at `items-start` this
|
|
186
|
-
// box was only as tall as its content, so `h-full` further down
|
|
187
|
-
// resolved against nothing and every card fell back to its natural
|
|
188
|
-
// height — the stack the panel used to be.
|
|
189
|
-
className: "min-h-0 self-stretch overflow-hidden", children: _jsx("div", { className: "scrollbar-minimal h-full overflow-y-auto overscroll-contain pr-3", style: { width: PANEL_WIDTH }, children: _jsx(ActionPanel, {}) }) })] }));
|
|
269
|
+
// The width animates; the content inside is pinned to the open width, so
|
|
270
|
+
// the sections slide into view instead of reflowing on every frame.
|
|
271
|
+
_jsxs(m.div, { initial: false, animate: { width: isOpen ? width : 0 }, transition: reduce || dragging ? INSTANT : isOpen ? ENTER : EXIT, "aria-hidden": !isOpen, inert: !isOpen || undefined, className: cn(
|
|
272
|
+
// Never more than half the body row (`SessionBodyRow` is the
|
|
273
|
+
// container): on a narrow window the chat keeps the other half.
|
|
274
|
+
'relative z-10 min-h-0 max-w-[50cqw] shrink-0 self-stretch',
|
|
275
|
+
// A detail panel is showing on the right: the column steps aside, so
|
|
276
|
+
// the session is the chat plus the one thing being looked at. `hidden`,
|
|
277
|
+
// not an unmount, so the sections keep their expanded state.
|
|
278
|
+
detailPanelOpen && 'hidden'), "data-testid": "session-action-panel", children: [isOpen && (
|
|
279
|
+
// The resize edge: zero-width over the column's `border-l`, with a
|
|
280
|
+
// 12px hit strip. Hover, focus and drag light the shared resize seam.
|
|
281
|
+
_jsx("div", { role: "separator", "aria-orientation": "vertical", "aria-label": t('resizePane'), "aria-valuemin": ACTION_PANEL_MIN_WIDTH, "aria-valuemax": ACTION_PANEL_MAX_WIDTH, "aria-valuenow": width, tabIndex: 0, "data-dragging": dragging || undefined, className: cn('absolute inset-y-0 -left-1.5 z-20 w-3 cursor-col-resize touch-none outline-none', RESIZE_SEAM_CLASS, 'hover:before:opacity-100 focus-visible:before:opacity-100 data-[dragging]:before:opacity-100'), ...handleProps })), _jsx("div", { className: "h-full overflow-hidden", children: _jsx("div", { className: cn(
|
|
282
|
+
// The same cap as the column, so a capped column still shows its
|
|
283
|
+
// sections whole instead of clipping their right edge.
|
|
284
|
+
'border-border bg-background scrollbar-minimal h-full max-w-[50cqw] overflow-y-auto overscroll-contain border-l',
|
|
285
|
+
// A drag must not select transcript text under the pointer.
|
|
286
|
+
dragging && 'select-none'), style: { width }, "data-review-scroll": true, children: sections }) })] }));
|
|
190
287
|
}
|
|
@@ -48,6 +48,7 @@ import { probePreviewPort } from '@kortix/sdk';
|
|
|
48
48
|
import { useHasSessionDesktop } from '@kortix/sdk/react';
|
|
49
49
|
import { ArrowSquareOutIcon, MonitorIcon } from '@phosphor-icons/react';
|
|
50
50
|
import { useEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
51
|
+
import { SESSION_BAR_CLASS } from '../../internal/layout/panel-chrome.js';
|
|
51
52
|
export const DESKTOP_URL = 'http://localhost:6901/';
|
|
52
53
|
/** How often the panel asks again until the desktop answers. */
|
|
53
54
|
const PROBE_INTERVAL_MS = 3_000;
|
|
@@ -104,7 +105,10 @@ export function SessionDesktop({ projectId, projectSessionId, onClose, }) {
|
|
|
104
105
|
setControl(true);
|
|
105
106
|
frameRef.current?.focus();
|
|
106
107
|
};
|
|
107
|
-
return (
|
|
108
|
+
return (
|
|
109
|
+
// `@container/desktop`: the control status text hides when the panel is
|
|
110
|
+
// narrow, so the header never wraps; the button alone still says it.
|
|
111
|
+
_jsxs("div", { className: "bg-background @container/desktop flex h-full min-h-0 min-w-0 flex-col", children: [_jsxs("div", { className: cn(SESSION_BAR_CLASS, 'gap-1 px-2'), children: [_jsx(DetailSidebarToggle, { className: "size-7" }), _jsx(MonitorIcon, { className: "text-muted-foreground ml-1 size-3.5 shrink-0" }), _jsx("span", { className: "truncate text-sm font-medium", children: t('title') }), _jsx("div", { className: "flex-1" }), live && (_jsxs("div", { className: "flex shrink-0 items-center gap-2 pr-1", children: [_jsx("span", { className: "text-muted-foreground hidden truncate text-xs @md/desktop:inline", children: control ? t('userControl') : t('agentControl') }), _jsx(Button, { variant: control ? 'secondary' : 'default', size: "xs", "aria-pressed": control, onClick: control ? () => setControl(false) : takeOver, children: control ? t('returnControl') : t('takeOver') })] })), _jsxs(ButtonGroup, { className: "shrink-0", children: [_jsx(Button, { variant: "secondary", size: "icon", className: "size-7", disabled: !live, "aria-label": t('openTab'), onClick: () => src && window.open(src, '_blank', 'noopener,noreferrer'), children: _jsx(ArrowSquareOutIcon, { className: "size-3.5" }) }), _jsx(PanelWidthButton, { isMobile: isMobile }), _jsx(CloseButton, { onClose: onClose })] })] }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: _jsx("div", { "data-slot": "desktop-screen", "data-control": control ? 'user' : 'agent', className: cn('bg-muted relative min-h-0 flex-1 overflow-hidden', control && 'ring-primary ring-2 ring-inset'), children: hasDesktop === false ? (_jsx(DesktopNotice, { title: t('noDesktop'), hint: t('noDesktopHint') })) : probe === 'unreachable' ? (_jsx(DesktopNotice, { title: t('offline'), hint: _jsxs(_Fragment, { children: [t('start'), " ", _jsx("code", { children: "kortix-desktop start" }), "."] }), children: _jsx(Button, { variant: "secondary", size: "sm", onClick: () => setAttempt((n) => n + 1), children: t('retry') }) })) : !hasDesktop || !src || !visible ? (_jsx("div", { className: "flex h-full items-center justify-center", children: _jsx(Loading, { className: "size-4" }) })) : (_jsxs(_Fragment, { children: [_jsx("iframe", { ref: frameRef, src: src, title: t('title'), className: cn('h-full w-full border-0', !live && 'invisible'), sandbox: framePolicy('app', src).sandbox, allow: "clipboard-read; clipboard-write; autoplay; fullscreen", tabIndex: control ? 0 : -1 }, live ? 'live' : 'waiting'), !live && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: _jsx(Loading, { className: "size-4" }) })), live && !control && (_jsx("button", { type: "button", "aria-label": t('takeOver'), "data-slot": "desktop-shield", className: "absolute inset-0 cursor-pointer", onClick: takeOver }))] })) }) })] }));
|
|
108
112
|
}
|
|
109
113
|
function DesktopNotice({ title, hint, children }) {
|
|
110
114
|
return (_jsxs("div", { className: "text-muted-foreground flex h-full flex-col items-center justify-center gap-3 px-6 text-center text-sm", children: [_jsx(MonitorIcon, { className: "size-10 opacity-20" }), _jsx("p", { children: title }), _jsx("p", { className: "text-xs", children: hint }), children] }));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
interface SessionDiffViewerProps {
|
|
2
|
+
/** A Changes-section row opens one exact file; other mounts keep the full comparison. */
|
|
3
|
+
filePath?: string;
|
|
2
4
|
isFullscreen?: boolean;
|
|
3
5
|
onToggleFullscreen?: () => void;
|
|
4
6
|
/**
|
|
@@ -8,5 +10,5 @@ interface SessionDiffViewerProps {
|
|
|
8
10
|
*/
|
|
9
11
|
reserveCloseGutter?: boolean;
|
|
10
12
|
}
|
|
11
|
-
export declare function SessionDiffViewer({ isFullscreen, onToggleFullscreen, reserveCloseGutter, }: SessionDiffViewerProps): import("react").JSX.Element;
|
|
13
|
+
export declare function SessionDiffViewer({ filePath, isFullscreen, onToggleFullscreen, reserveCloseGutter, }: SessionDiffViewerProps): import("react").JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -33,13 +33,13 @@ import { useSessionChanges } from './session-changes-shared.js';
|
|
|
33
33
|
import { cn } from '../../lib/utils.js';
|
|
34
34
|
import { ArrowsInSimpleIcon, ArrowsOutSimpleIcon, FileDashedIcon } from '@phosphor-icons/react';
|
|
35
35
|
import { useMemo, useState } from 'react';
|
|
36
|
-
export function SessionDiffViewer({ isFullscreen, onToggleFullscreen, reserveCloseGutter, }) {
|
|
36
|
+
export function SessionDiffViewer({ filePath, isFullscreen, onToggleFullscreen, reserveCloseGutter, }) {
|
|
37
37
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
38
38
|
// The SAME query the tab badge and the header chip count. One array, one key
|
|
39
39
|
// — the body can no longer say "no changes" under a badge reading 32.
|
|
40
40
|
const { files, isPending, error, refetch } = useSessionChanges();
|
|
41
41
|
const [layout, setLayout] = useState('unified');
|
|
42
|
-
const entries = useMemo(() => files.map(entryFromVcsFile), [files]);
|
|
42
|
+
const entries = useMemo(() => files.filter((file) => !filePath || file.file === filePath).map(entryFromVcsFile), [files, filePath]);
|
|
43
43
|
const { expanded, setRow, allExpanded, toggleAll } = useChangeExpansion(entries);
|
|
44
44
|
// A DISABLED query is not an empty result. While the sandbox boots, nothing
|
|
45
45
|
// has been asked yet, so the honest state is "loading", not "no changes yet".
|
|
@@ -53,8 +53,11 @@ export function SessionDiffViewer({ isFullscreen, onToggleFullscreen, reserveClo
|
|
|
53
53
|
return (_jsx(ErrorState, { size: "sm", className: "h-full", title: tI18nComplete.raw('texte65f8a02d565'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void refetch(), children: tI18nComplete.raw('textd8b8392e2c54') }) }));
|
|
54
54
|
}
|
|
55
55
|
if (entries.length === 0) {
|
|
56
|
-
return (_jsx(EmptyState, { icon: FileDashedIcon, size: "sm", className: "h-full", title: tI18nComplete.raw('text0b348466332c'),
|
|
56
|
+
return (_jsx(EmptyState, { icon: FileDashedIcon, size: "sm", className: "h-full", title: tI18nComplete.raw('text0b348466332c'),
|
|
57
|
+
// One file opened from the Changes section: say it is THIS file that
|
|
58
|
+
// has nothing left, not that the session changed nothing.
|
|
59
|
+
description: tI18nComplete.raw(filePath ? 'textcc6d004b577f' : 'textc88aaafcef61') }));
|
|
57
60
|
}
|
|
58
61
|
const fullscreenLabel = isFullscreen ? 'Exit fullscreen' : 'Fullscreen';
|
|
59
|
-
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" }), _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/70 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 })] }) }));
|
|
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/70 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 })] }) }));
|
|
60
63
|
}
|
|
@@ -45,10 +45,11 @@ import { panelToRestore, rememberedPanelOf, useSessionPanelMemoryStore, } from '
|
|
|
45
45
|
import { useUserPreferencesStore } from '../../internal/stores/user-preferences-store.js';
|
|
46
46
|
import { getProjectSession, SANDBOX_PORTS } from '@kortix/sdk';
|
|
47
47
|
import { FileTextIcon as FileText } from '@phosphor-icons/react';
|
|
48
|
-
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
48
|
+
import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
49
49
|
import { AppPreview, AppPreviewBooting } from './easy/app-preview.js';
|
|
50
50
|
import { isWideDeliverable, neighborOutputs, outputKey, quickBrowserOutput, } from './easy/easy-panel-logic.js';
|
|
51
51
|
import { FilePreview, reportsIntrinsicSize } from './easy/file-preview.js';
|
|
52
|
+
import { forgetFrameHistory, noteBrowserApps, resumableFrameHistory } from './easy/frame-history.js';
|
|
52
53
|
import { usePanelDerivations } from './shared/use-panel-derivations.js';
|
|
53
54
|
import { usePanelHandoffs } from './shared/use-panel-handoffs.js';
|
|
54
55
|
import { useDeliverableReadiness } from './shared/use-deliverable-readiness.js';
|
|
@@ -188,12 +189,19 @@ export function SessionPanelProvider({ sessionId, isSessionBusy = false, project
|
|
|
188
189
|
setDetail((current) => (current ? null : current));
|
|
189
190
|
setTerminalOpen((open) => (open ? false : open));
|
|
190
191
|
}, [activeSessionId]);
|
|
192
|
+
// The Browser's page and Back/Forward end with the detail (frame-history.ts).
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
forgetFrameHistory(sessionId);
|
|
195
|
+
}, [activeSessionId, sessionId]);
|
|
191
196
|
// Forget the session when its provider goes away: an unmounted provider has
|
|
192
197
|
// dropped its detail state, so a `true` left behind would promise ⌘I content
|
|
193
198
|
// that no longer exists and reopen an empty panel. Read through `getState()`
|
|
194
199
|
// so the teardown cannot capture a stale action, and so it runs on unmount
|
|
195
200
|
// ONLY, never on a content change.
|
|
196
|
-
useEffect(() => () =>
|
|
201
|
+
useEffect(() => () => {
|
|
202
|
+
useKortixComputerStore.getState().setDetailContent(sessionId, null);
|
|
203
|
+
forgetFrameHistory(sessionId);
|
|
204
|
+
}, [sessionId]);
|
|
197
205
|
// Mutual exclusion: the terminal layer and a `detail` never show at once —
|
|
198
206
|
// opening one closes the other, and the toggle records HOW (`terminalSwap`):
|
|
199
207
|
// over a detail it's a crossfade, from home it's the arrival slide.
|
|
@@ -298,10 +306,18 @@ export function SessionPanelProvider({ sessionId, isSessionBusy = false, project
|
|
|
298
306
|
*
|
|
299
307
|
* `source` is telemetry-only (W5) — see `OpenSource`.
|
|
300
308
|
*/
|
|
309
|
+
// The latest app list for `handleOpenOutput`, without making it a dependency.
|
|
310
|
+
const appsRef = useRef(apps);
|
|
311
|
+
useLayoutEffect(() => {
|
|
312
|
+
appsRef.current = apps;
|
|
313
|
+
}, [apps]);
|
|
301
314
|
const handleOpenOutput = useCallback((output, siblings, source = 'row') => {
|
|
302
315
|
// The human title, when the output carries one (W3) — never the raw
|
|
303
316
|
// filename in a spot the user reads as the thing's name.
|
|
304
317
|
const displayName = output.title ?? output.name;
|
|
318
|
+
// Any Browser open records the app list it saw (`resumableFrameHistory`).
|
|
319
|
+
if (output.kind === 'app')
|
|
320
|
+
noteBrowserApps(sessionId, appsRef.current.map((app) => app.url ?? ''));
|
|
305
321
|
// Wide split (Marko's feedback): a presentation deliverable grows the
|
|
306
322
|
// panel to its widest split with the glide — see `isWideDeliverable`.
|
|
307
323
|
// Set AFTER `openDetail` below, whose own generic default
|
|
@@ -345,7 +361,7 @@ export function SessionPanelProvider({ sessionId, isSessionBusy = false, project
|
|
|
345
361
|
hideHeader: true,
|
|
346
362
|
padded: false,
|
|
347
363
|
nav,
|
|
348
|
-
body: (_jsx(SessionBootGate, { boot: _jsx(AppPreviewBooting, { onClose: closeDetail, children: _jsx(SessionBootStatus, { projectId: projectId, sessionId: projectSessionId }) }), children: _jsx(AppPreview, { url: output.url ?? '', name: displayName, projectId: projectId, shareContext: projectId && projectSessionId
|
|
364
|
+
body: (_jsx(SessionBootGate, { boot: _jsx(AppPreviewBooting, { onClose: closeDetail, children: _jsx(SessionBootStatus, { projectId: projectId, sessionId: projectSessionId }) }), children: _jsx(AppPreview, { url: output.url ?? '', name: displayName, historyKey: sessionId, projectId: projectId, shareContext: projectId && projectSessionId
|
|
349
365
|
? { projectId, sessionId: projectSessionId }
|
|
350
366
|
: undefined, onClose: closeDetail, onSendToAgent: () => sendAppToAgent(output) }) })),
|
|
351
367
|
});
|
|
@@ -389,6 +405,7 @@ export function SessionPanelProvider({ sessionId, isSessionBusy = false, project
|
|
|
389
405
|
projectId,
|
|
390
406
|
projectSessionId,
|
|
391
407
|
sendAppToAgent,
|
|
408
|
+
sessionId,
|
|
392
409
|
]);
|
|
393
410
|
// W1/W9 — announce finished deliverables and blocked-on-you states while the
|
|
394
411
|
// panel is closed. Headless: writes the ready chip; the header renders it.
|
|
@@ -459,8 +476,15 @@ export function SessionPanelProvider({ sessionId, isSessionBusy = false, project
|
|
|
459
476
|
// A targeted request (a `show` preview button, a localhost link in chat)
|
|
460
477
|
// names the exact page it wants. Without honoring it the browser would
|
|
461
478
|
// open on the first running app instead — right surface, wrong page.
|
|
462
|
-
|
|
463
|
-
|
|
479
|
+
const output = quickBrowserOutput(apps, target);
|
|
480
|
+
// An untargeted open (the header's Browser, the palette) returns to the
|
|
481
|
+
// page this session's Browser was last on, with its Back/Forward — the
|
|
482
|
+
// same way the Terminal keeps its shell across a switch (D-06).
|
|
483
|
+
const resumed = target?.url
|
|
484
|
+
? undefined
|
|
485
|
+
: resumableFrameHistory(sessionId, apps.map((app) => app.url ?? ''));
|
|
486
|
+
handleOpenOutput(resumed && output.kind === 'app' ? { ...output, url: resumed.entries[resumed.index] ?? '' } : output, undefined, 'quick');
|
|
487
|
+
}, [apps, handleOpenOutput, sessionId]);
|
|
464
488
|
const { outputsDefaultOpen, pendingQuickView } = usePanelHandoffs({
|
|
465
489
|
sessionId, projectId, projectSessionId, isRunning, outcome, apps, files, steps, calls,
|
|
466
490
|
detail, handleOpenOutput, openDetail, closeDetail, openTerminal, openAudit, openReminders, openDesktop, openBrowser, openFiles,
|
|
@@ -372,7 +372,8 @@ function titleFromFetchOutput(call) {
|
|
|
372
372
|
* The real-world pages a `web`-family call is "about" — the identities
|
|
373
373
|
* `deriveContext` dedups on and the truthful labels it shows.
|
|
374
374
|
*
|
|
375
|
-
* - `web_fetch
|
|
375
|
+
* - `web_fetch` targets one URL (`input.url`); `scrape_webpage` targets one or
|
|
376
|
+
* more (`input.urls`, comma-separated). Each URL is one page.
|
|
376
377
|
* - `web_search`-style calls have no URL of their own; their OUTPUT is the
|
|
377
378
|
* search-results payload, and EVERY parsed result is a page the search
|
|
378
379
|
* surfaced — returning only the first is how "searched 10 sources" used to
|
|
@@ -402,10 +403,69 @@ function webSourcesOf(call) {
|
|
|
402
403
|
// web_fetch / webfetch / scrape_webpage / scrapewebpage — identified by
|
|
403
404
|
// the page it targeted. The label is the real page title when the fetch's
|
|
404
405
|
// own output is parseable HTML; otherwise the domain — never the raw URL.
|
|
405
|
-
const
|
|
406
|
-
if (
|
|
406
|
+
const urls = fetchUrlsOf(input);
|
|
407
|
+
if (urls.length === 0)
|
|
407
408
|
return [];
|
|
408
|
-
|
|
409
|
+
if (urls.length === 1) {
|
|
410
|
+
const url = urls[0];
|
|
411
|
+
return [{ url, label: titleFromFetchOutput(call) || scrapeTitlesOf(call).get(url) || wsDomain(url) }];
|
|
412
|
+
}
|
|
413
|
+
const titles = scrapeTitlesOf(call);
|
|
414
|
+
return urls.map((url) => ({ url, label: titles.get(url) || wsDomain(url) }));
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* The pages a fetch-style call targeted. `web_fetch` takes one `url`;
|
|
418
|
+
* `scrape_webpage` takes `urls`, a comma-separated string
|
|
419
|
+
* (`apps/kortix-sandbox-agent-server/src/services/tools/kortix/scrape_webpage.ts`).
|
|
420
|
+
* An array is accepted too: an ejected copy of the tool may change the schema.
|
|
421
|
+
*/
|
|
422
|
+
function fetchUrlsOf(input) {
|
|
423
|
+
const raw = [];
|
|
424
|
+
if (typeof input.url === 'string')
|
|
425
|
+
raw.push(input.url);
|
|
426
|
+
if (typeof input.urls === 'string')
|
|
427
|
+
raw.push(...input.urls.split(','));
|
|
428
|
+
else if (Array.isArray(input.urls))
|
|
429
|
+
raw.push(...input.urls);
|
|
430
|
+
const out = [];
|
|
431
|
+
for (const value of raw) {
|
|
432
|
+
if (typeof value !== 'string')
|
|
433
|
+
continue;
|
|
434
|
+
const url = value.trim();
|
|
435
|
+
if (url && !out.includes(url))
|
|
436
|
+
out.push(url);
|
|
437
|
+
}
|
|
438
|
+
return out;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Page titles from `scrape_webpage` JSON output: one result object, or
|
|
442
|
+
* `{ results: [...] }` for several URLs. Keyed by the URL the tool echoes.
|
|
443
|
+
*/
|
|
444
|
+
function scrapeTitlesOf(call) {
|
|
445
|
+
const titles = new Map();
|
|
446
|
+
const output = rawOutputOf(call);
|
|
447
|
+
if (!output || !output.trimStart().startsWith('{'))
|
|
448
|
+
return titles;
|
|
449
|
+
let parsed;
|
|
450
|
+
try {
|
|
451
|
+
parsed = JSON.parse(output);
|
|
452
|
+
}
|
|
453
|
+
catch {
|
|
454
|
+
return titles;
|
|
455
|
+
}
|
|
456
|
+
if (!parsed || typeof parsed !== 'object')
|
|
457
|
+
return titles;
|
|
458
|
+
const record = parsed;
|
|
459
|
+
const results = Array.isArray(record.results) ? record.results : [record];
|
|
460
|
+
for (const result of results) {
|
|
461
|
+
if (!result || typeof result !== 'object')
|
|
462
|
+
continue;
|
|
463
|
+
const { url, title } = result;
|
|
464
|
+
if (typeof url === 'string' && typeof title === 'string' && title.trim()) {
|
|
465
|
+
titles.set(url.trim(), title.trim());
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
return titles;
|
|
409
469
|
}
|
|
410
470
|
export function deriveContext(calls) {
|
|
411
471
|
const files = [];
|