@kortix/ui 0.15.10 → 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 +769 -76
- package/dist/_vendor/shared/app-config.d.ts +6 -30
- package/dist/_vendor/shared/channel-descriptors.d.ts +0 -34
- package/dist/_vendor/shared/channel-header.d.ts +2 -1
- package/dist/_vendor/shared/connector-sections.d.ts +0 -25
- package/dist/_vendor/shared/file-tags.d.ts +2 -1
- package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
- package/dist/_vendor/shared/pasted-content.d.ts +0 -4
- package/dist/_vendor/shared/pixel-mark.d.ts +0 -17
- package/dist/_vendor/shared/project-glyphs.d.ts +0 -1
- 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-model-view.d.ts +11 -1
- package/dist/customize/agents/agent-model-view.js +12 -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 +25 -34
- package/dist/customize/agents/agent-tabs.d.ts +3 -0
- package/dist/customize/agents/agent-tabs.js +3 -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/detail/connector-triggers.js +1 -1
- 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 +2 -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/component/teams-byo-wizard.js +4 -1
- 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 +33 -3
- package/dist/customize/triggers/schedule/event-trigger-copy.js +1 -1
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +5 -4
- package/dist/customize/triggers/schedule/then-fields.d.ts +5 -1
- package/dist/customize/triggers/schedule/then-fields.js +23 -3
- package/dist/customize/triggers/schedule/trigger-callouts.js +1 -1
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +27 -0
- package/dist/customize/triggers/schedule/trigger-composer-logic.js +51 -5
- package/dist/customize/triggers/schedule/trigger-composer.js +19 -13
- package/dist/customize/triggers/schedule/trigger-edit-logic.js +25 -5
- package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -3
- package/dist/customize/triggers/schedule/trigger-filter.js +7 -6
- package/dist/customize/triggers/schedule/trigger-readonly.js +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -1
- package/dist/customize/triggers/schedule/when-event.js +1 -1
- package/dist/customize/triggers/schedule/when-schedule.d.ts +5 -1
- package/dist/customize/triggers/schedule/when-schedule.js +16 -1
- package/dist/customize/triggers/schedule-view.js +6 -3
- 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 +544 -46
- package/dist/i18n/en.js +593 -95
- 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/layout/project-settings-nav.d.ts +17 -0
- package/dist/internal/layout/project-settings-nav.js +24 -0
- package/dist/internal/lib/browser-noise/rules/webview.js +16 -0
- package/dist/internal/lib/capability-tab-routes.d.ts +8 -0
- package/dist/internal/lib/capability-tab-routes.js +11 -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/composer-prefill-store.d.ts +7 -0
- package/dist/internal/stores/composer-prefill-store.js +1 -0
- 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/actions/session-label.js +2 -2
- 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.d.ts +10 -5
- package/dist/session/agents/agent-strip.js +49 -15
- package/dist/session/agents/held-messages.d.ts +6 -2
- package/dist/session/agents/held-messages.js +6 -3
- 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 +7 -1
- package/dist/session/composer/agent-selector.d.ts +2 -0
- package/dist/session/composer/agent-selector.js +11 -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.d.ts +1 -0
- package/dist/session/composer/composer-chat-input.js +7 -2
- package/dist/session/composer/composer-logic.d.ts +7 -0
- package/dist/session/composer/composer-logic.js +18 -0
- package/dist/session/composer/composer-reset.d.ts +8 -14
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +3 -3
- package/dist/session/composer/composer.d.ts +9 -2
- package/dist/session/composer/composer.js +24 -9
- package/dist/session/composer/editor/composer-editor.js +6 -4
- 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.d.ts +3 -1
- package/dist/session/header/session-site-header.js +27 -8
- package/dist/session/media/sandbox-url-detector.js +1 -1
- package/dist/session/models/connect-model-step.d.ts +29 -0
- package/dist/session/models/connect-model-step.js +50 -0
- 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/models/use-workspace-model-gate.d.ts +11 -0
- package/dist/session/models/use-workspace-model-gate.js +62 -0
- package/dist/session/models/workspace-model-gate.d.ts +46 -0
- package/dist/session/models/workspace-model-gate.js +66 -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/prompts/session-connect-card.d.ts +63 -0
- package/dist/session/prompts/{session-connect-prompt.js → session-connect-card.js} +53 -42
- 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 +311 -300
- 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 +3 -3
- package/dist/session/thread/transcript.js +33 -27
- package/dist/session/thread/typing-indicator.d.ts +2 -2
- package/dist/session/thread/typing-indicator.js +10 -3
- package/dist/session/tool/tool-part-renderer.js +7 -2
- package/dist/session/tool/tools/kortix-action-tool.js +10 -2
- 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/session/turn/turn-viewport.d.ts +66 -10
- package/dist/session/turn/turn-viewport.js +92 -12
- package/dist/session/turn/user-message.js +7 -5
- 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 +544 -46
- package/dist/workspace/admin/project-admin-dashboard.js +23 -11
- 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/home/existing-repo-setup-prompt.d.ts +5 -8
- package/dist/workspace/home/existing-repo-setup-prompt.js +16 -42
- package/dist/workspace/home/no-agent-home.d.ts +3 -1
- package/dist/workspace/home/no-agent-home.js +2 -2
- 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/layout/project-home.js +16 -9
- 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/session-grouping.d.ts +1 -1
- package/dist/workspace/sidebar/session-grouping.js +1 -1
- 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-details-panel.js +2 -2
- package/dist/workspace/spaces/space-timeline.js +2 -2
- package/dist/workspace/spaces/space-triggers.js +2 -2
- package/dist/workspace/spaces/space-view.js +11 -5
- package/package.json +79 -10
- package/skills/kortix-ui/SKILL.md +2 -2
- package/skills/kortix-ui/references/modules.md +5 -3
- package/dist/session/prompts/session-connect-prompt.d.ts +0 -40
- 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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { formatUsdAsCredits } from '../../../_vendor/kortix-shared.js';
|
|
5
|
+
import { useSessionUsage } from '@kortix/sdk/react';
|
|
6
|
+
import Hint from '../../../primitives/hint.js';
|
|
7
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
8
|
+
/** While the run works, its spend is read again this often. */
|
|
9
|
+
const LIVE_REFRESH_MS = 30_000;
|
|
10
|
+
/** After the run ends, one more read this much later: billing rows of its last minute land late. */
|
|
11
|
+
const SETTLE_REFRESH_MS = 10_000;
|
|
12
|
+
/** What Kortix debited for one usage entry: model calls plus compute; a server before compute was added gives model calls only. */
|
|
13
|
+
function billed(totals) {
|
|
14
|
+
return totals.billed_cost ?? totals.kortix_cost;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* What a workflow run cost so far, in USD, from the session usage tree
|
|
18
|
+
* (`GET …/sessions/:id/usage`): model calls and box time that Kortix billed.
|
|
19
|
+
*
|
|
20
|
+
* - A background run: its runner session and every agent session under it
|
|
21
|
+
* (`total`), which is the whole run.
|
|
22
|
+
* - A run in the calling session: only its agents' sessions and their
|
|
23
|
+
* descendants. The caller's own turns are not part of the run.
|
|
24
|
+
*
|
|
25
|
+
* Own-key (BYOK) model spend is not in it: Kortix did not bill it. Exported for tests.
|
|
26
|
+
*/
|
|
27
|
+
export function runSpentUsd(usage, agentSessionIds) {
|
|
28
|
+
if (!agentSessionIds)
|
|
29
|
+
return billed(usage.total);
|
|
30
|
+
const inRun = new Set(agentSessionIds);
|
|
31
|
+
let sum = 0;
|
|
32
|
+
// `sessions` is depth-first, so a parent is decided before its children.
|
|
33
|
+
for (const entry of usage.sessions) {
|
|
34
|
+
if (!inRun.has(entry.session_id) && !(entry.parent_session_id && inRun.has(entry.parent_session_id)))
|
|
35
|
+
continue;
|
|
36
|
+
inRun.add(entry.session_id);
|
|
37
|
+
sum += billed(entry);
|
|
38
|
+
}
|
|
39
|
+
return sum;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* "Spent N credits" for a workflow run card: the actual spend, never an
|
|
43
|
+
* estimate. Renders nothing until the read answers, and nothing for a run that
|
|
44
|
+
* has cost nothing yet. Refreshed every 30 s while the run works, and twice as
|
|
45
|
+
* it ends (at once, then 10 s later), so the final number is the final spend.
|
|
46
|
+
* Inline text for the card's status line: `separated` puts a " · " before it.
|
|
47
|
+
*/
|
|
48
|
+
export function WorkflowRunCost({ projectId, rootSessionId, agentSessionIds, live, separated = false, }) {
|
|
49
|
+
const t = useTranslations('tools.workflow');
|
|
50
|
+
const usage = useSessionUsage(projectId, rootSessionId);
|
|
51
|
+
const { refetch } = usage;
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (!live)
|
|
54
|
+
return;
|
|
55
|
+
const timer = setInterval(() => void refetch(), LIVE_REFRESH_MS);
|
|
56
|
+
return () => clearInterval(timer);
|
|
57
|
+
}, [live, refetch]);
|
|
58
|
+
// The run just ended: read the final spend, then once more for rows that land late.
|
|
59
|
+
const wasLive = useRef(live);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
const ended = wasLive.current && !live;
|
|
62
|
+
wasLive.current = live;
|
|
63
|
+
if (!ended)
|
|
64
|
+
return;
|
|
65
|
+
void refetch();
|
|
66
|
+
const timer = setTimeout(() => void refetch(), SETTLE_REFRESH_MS);
|
|
67
|
+
return () => clearTimeout(timer);
|
|
68
|
+
}, [live, refetch]);
|
|
69
|
+
if (!usage.data)
|
|
70
|
+
return null;
|
|
71
|
+
const usd = runSpentUsd(usage.data, agentSessionIds);
|
|
72
|
+
if (!(usd > 0))
|
|
73
|
+
return null;
|
|
74
|
+
return (_jsx(Hint, { label: t('spentHint'), side: "top", children: _jsxs("span", { "data-testid": "workflow-run-cost", className: "text-muted-foreground min-w-0 truncate tabular-nums", children: [separated && _jsx("span", { "aria-hidden": true, children: '\u00a0·\u00a0' }), t('spent', { credits: formatUsdAsCredits(usd) })] }) }));
|
|
75
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ToolProps } from '../shared/types.js';
|
|
2
|
-
import {
|
|
2
|
+
import type { ProjectSession } from '@kortix/sdk';
|
|
3
3
|
import { type WorkflowRun } from './workflow-run.js';
|
|
4
4
|
/**
|
|
5
5
|
* A live run read from this session's children: each `agent()` is a child session named after
|
|
@@ -16,12 +16,13 @@ import { Button } from '../../../primitives/button.js';
|
|
|
16
16
|
import { useCallback, useContext, useMemo, useState } from 'react';
|
|
17
17
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
18
18
|
import { qk, useNow, useProjectSession, useSessionChildren } from '@kortix/sdk/react';
|
|
19
|
-
import { stopProjectSession } from '@kortix/sdk';
|
|
20
19
|
import { useSessionIds } from '../../../providers/session-ids.js';
|
|
21
20
|
import { RunProgressRing } from './workflow-progress.js';
|
|
22
21
|
import { boardStateOf } from '../../agents/agent-model.js';
|
|
23
22
|
import { WorkflowRunCard } from './workflow-run-card.js';
|
|
24
|
-
import {
|
|
23
|
+
import { WorkflowRunCost } from './workflow-run-cost.js';
|
|
24
|
+
import { isLargeRun, LargeRunBadge, runNotStarted, useLiveWorkflowRun, useRestartAgent, useStopAgent, WorkflowRunControls, } from '../../agents/workflow-run-controls.js';
|
|
25
|
+
import { quietAgents } from './workflow-run-card.js';
|
|
25
26
|
import { countAgents, elapsedMs, formatElapsed, isWorkflowTool, parseWorkflowResult, parseWorkflowRun, } from './workflow-run.js';
|
|
26
27
|
/**
|
|
27
28
|
* The card of pi's `workflow` tool: one script that runs several agents, each in
|
|
@@ -111,6 +112,7 @@ export function WorkflowTool(props) {
|
|
|
111
112
|
// Live: a foreground run while its call runs, or a background run its runner still runs.
|
|
112
113
|
const live = !!run && run.status === 'running' && (fromRunner || (!settled && !run.background && running));
|
|
113
114
|
const restart = useRestartAgent(ids.projectId, controlSessionId, live ? run : null);
|
|
115
|
+
const stopWorkflowAgent = useStopAgent(ids.projectId, controlSessionId, live ? run : null);
|
|
114
116
|
const now = useNow(1_000, live);
|
|
115
117
|
const [open, setOpen] = useState(null);
|
|
116
118
|
const onOpen = useCallback((agent) => {
|
|
@@ -122,7 +124,7 @@ export function WorkflowTool(props) {
|
|
|
122
124
|
const queryClient = useQueryClient();
|
|
123
125
|
const [stopping, setStopping] = useState(() => new Set());
|
|
124
126
|
const stopAgent = useMutation({
|
|
125
|
-
mutationFn: (agent) =>
|
|
127
|
+
mutationFn: (agent) => stopWorkflowAgent(agent),
|
|
126
128
|
onSuccess: () => {
|
|
127
129
|
if (ids.projectId)
|
|
128
130
|
void queryClient.invalidateQueries({ queryKey: qk.project.sessionsScope(ids.projectId) });
|
|
@@ -169,21 +171,28 @@ export function WorkflowTool(props) {
|
|
|
169
171
|
if (run.background && !fromRunner) {
|
|
170
172
|
const runnerSession = run.background.sessionId;
|
|
171
173
|
const openRunner = () => setOpen({ sessionId: runnerSession, title });
|
|
172
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { "data-testid": "workflow-run-link", className: "border-border bg-background mt-1.5 flex w-full min-w-0 items-start gap-2.5 rounded-lg border px-4 py-3 text-left text-xs", children: [_jsx("span", { className: "flex h-5 shrink-0 items-center", children: runnerEnded === 'done' ? (_jsx(RunProgressRing, { done: 1, failed: 0, total: 1, ended: "done" })) : runnerEnded === 'stopped' ? (_jsx(RunProgressRing, { done: 0, failed: 0, total: 1, ended: "stopped" })) : runnerEnded === 'failed' ? (_jsx(RunProgressRing, { done: 0, failed: 1, total: 1 })) : (_jsx(RunProgressRing, { done: tally.done, failed: tally.failed, total: Math.max(tally.total, 1) })) }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: "text-foreground min-w-0 truncate text-sm font-medium", children: title }), _jsx(RunChips, { run: run })] }),
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { "data-testid": "workflow-run-link", className: "border-border bg-background mt-1.5 flex w-full min-w-0 flex-wrap items-start gap-x-2.5 gap-y-1.5 rounded-lg border px-4 py-3 text-left text-xs", children: [_jsx("span", { className: "flex h-5 shrink-0 items-center", children: runnerEnded === 'done' ? (_jsx(RunProgressRing, { done: 1, failed: 0, total: 1, ended: "done" })) : runnerEnded === 'stopped' ? (_jsx(RunProgressRing, { done: 0, failed: 0, total: 1, ended: "stopped" })) : runnerEnded === 'failed' ? (_jsx(RunProgressRing, { done: 0, failed: 1, total: 1 })) : (_jsx(RunProgressRing, { done: tally.done, failed: tally.failed, total: Math.max(tally.total, 1) })) }), _jsxs("span", { className: "flex min-w-0 flex-1 basis-64 flex-col gap-0.5", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: "text-foreground min-w-0 truncate text-sm font-medium", children: title }), _jsx(RunChips, { run: run })] }), _jsxs("span", { className: "text-muted-foreground flex min-w-0 items-center", children: [_jsx("span", { className: "max-w-full shrink-0 truncate", children: runnerEnded === 'done'
|
|
175
|
+
? t('status.done')
|
|
176
|
+
: runnerEnded === 'failed'
|
|
177
|
+
? t('didntFinish')
|
|
178
|
+
: runnerEnded === 'stopped'
|
|
179
|
+
? t('status.stopped')
|
|
180
|
+
: [t('status.running'), tally.total > 0 ? t('progress', { done: tally.done, total: tally.total }) : null].filter(Boolean).join(' · ') }), _jsx(WorkflowRunCost, { projectId: ids.projectId, rootSessionId: runnerSession, live: !runnerEnded, separated: true })] })] }), _jsxs(Button, { type: "button", variant: "secondary", size: "xs", "aria-label": t('openRunLabel'), onClick: openRunner, className: "-my-1 ml-auto shrink-0", children: [t('openRun'), _jsx(ArrowUpRightIcon, { "aria-hidden": true, className: "size-3.5 shrink-0" })] })] }), modal] }));
|
|
179
181
|
}
|
|
180
182
|
const counts = countAgents(run.agents);
|
|
181
183
|
const progress = counts.total > 0 ? t('progress', { done: counts.done, total: counts.total }) : undefined;
|
|
182
184
|
const failedPart = counts.failed > 0 ? t('failedSuffix', { count: counts.failed }) : undefined;
|
|
183
|
-
|
|
185
|
+
// Before the run exists (its approval is open) there is no run clock: the card is a question.
|
|
186
|
+
const notStarted = runNotStarted(run);
|
|
187
|
+
const runElapsed = notStarted ? undefined : elapsedMs(run, live, now);
|
|
184
188
|
const elapsed = runElapsed !== undefined && runElapsed >= 1_000 ? formatElapsed(runElapsed) : undefined;
|
|
185
189
|
const join = (...parts) => parts.filter(Boolean).join(' · ') || undefined;
|
|
186
|
-
|
|
190
|
+
// A hold stops new agents only: the ones at work go on, and the line says so.
|
|
191
|
+
// Held agents queued for a slot (`starting`, no session) are not working: only a live child counts.
|
|
192
|
+
const working = run.agents.filter((agent) => agent.status === 'running' || (agent.status === 'starting' && Boolean(agent.sessionId))).length;
|
|
193
|
+
const paused = run.paused ? (working > 0 ? t('holdingWorking', { count: working }) : tm('holding')) : undefined;
|
|
194
|
+
const quiet = live ? quietAgents(run.agents, now) : 0;
|
|
195
|
+
const quietPart = quiet > 0 ? t('quietCount', { count: quiet }) : undefined;
|
|
187
196
|
const subtitle = run.status === 'running'
|
|
188
197
|
? // A call that returned while its run goes on: the run works on without this turn.
|
|
189
198
|
settled || run.background
|
|
@@ -200,13 +209,23 @@ export function WorkflowTool(props) {
|
|
|
200
209
|
const phaseCounts = countAgents(phaseAgents);
|
|
201
210
|
const phaseLine = phase && phaseCounts.total > 0 ? t('phaseProgress', { phase: phase.title, done: phaseCounts.done, total: phaseCounts.total }) : undefined;
|
|
202
211
|
// Ended, the card is one line that says how it ended (Paper F2, F4, F5).
|
|
203
|
-
const
|
|
204
|
-
? join(paused ?? (settled || run.background ? t('background') : undefined), phaseLine ?? progress, failedPart, elapsed)
|
|
212
|
+
const runLine = run.status === 'running'
|
|
213
|
+
? join(paused ?? (settled || run.background ? t('background') : undefined), phaseLine ?? progress, failedPart, quietPart, elapsed)
|
|
205
214
|
: run.status === 'done'
|
|
206
215
|
? join(t('status.done'), counts.total > 0 ? t('agents', { count: counts.total }) : undefined, elapsed)
|
|
207
216
|
: run.status === 'failed'
|
|
208
217
|
? join(t('didntFinish'), counts.total > 0 ? progress : undefined, failedPart, elapsed)
|
|
209
218
|
: join(t('status.stopped'), counts.total > 0 ? progress : undefined, elapsed);
|
|
219
|
+
// Not a run yet, or never one: the approval is open, or the person said no to it (their choice, not a failure).
|
|
220
|
+
const cardSubtitle = run.declined
|
|
221
|
+
? run.declined === 'chat'
|
|
222
|
+
? t('answeredInChat')
|
|
223
|
+
: t('cancelled')
|
|
224
|
+
: run.status === 'running' && run.awaitingApproval
|
|
225
|
+
? t('waitingForYou')
|
|
226
|
+
: notStarted
|
|
227
|
+
? t('status.starting')
|
|
228
|
+
: runLine;
|
|
210
229
|
const callError = status === 'error' ? partError(call) : undefined;
|
|
211
230
|
const runError = run.error ?? callError;
|
|
212
231
|
const output = status === 'completed' ? partOutput(call) : '';
|
|
@@ -214,7 +233,13 @@ export function WorkflowTool(props) {
|
|
|
214
233
|
return (
|
|
215
234
|
// A failed run leads with the shared failure triangle, as every failed call does. A
|
|
216
235
|
// completed call whose run did not fail is not a failure, whatever its output says.
|
|
217
|
-
_jsxs(ToolOutcomeContext.Provider, { value: run.status === 'failed' || status === 'error' ? 'failed' : 'ok', children: [_jsx(WorkflowRunCard, { run: run, title: title, subtitle: cardSubtitle, live: live, now: now, onOpen: onOpen, stop: stop,
|
|
236
|
+
_jsxs(ToolOutcomeContext.Provider, { value: run.status === 'failed' || status === 'error' ? 'failed' : 'ok', children: [_jsx(WorkflowRunCard, { run: run, title: title, subtitle: cardSubtitle, live: live, now: now, onOpen: onOpen, stop: stop,
|
|
237
|
+
// A declined run is one muted line: nothing ran, so there are no rows to show.
|
|
238
|
+
bare: !!run.declined, chips: _jsx(RunChips, { run: run }), result: result ? _jsx(OutputBlock, { text: result.text, markdown: result.kind === 'markdown' }) : undefined, meta: _jsx(WorkflowRunCost, { projectId: ids.projectId, rootSessionId: run.background?.sessionId ?? ids.sessionId,
|
|
239
|
+
// Every attempt's session: a restart or a stall retry keeps what the earlier attempt spent.
|
|
240
|
+
agentSessionIds: run.background
|
|
241
|
+
? undefined
|
|
242
|
+
: run.agents.flatMap((agent) => [...(agent.earlierSessionIds ?? []), ...(agent.sessionId ? [agent.sessionId] : [])]), live: live, separated: !!cardSubtitle }), actions: _jsxs(_Fragment, { children: [!run.declined && (live || (!!run.runId && !run.name && !!ids.sessionId)) && (_jsx(WorkflowRunControls, { projectId: ids.projectId, controlSessionId: live ? controlSessionId : undefined, ownerSessionId: ids.sessionId, run: run, appearance: "text" })), run.background && (_jsxs(Button, { type: "button", variant: "secondary", size: "xs", "aria-label": t('openRunLabel'), onClick: () => setOpen({ sessionId: run.background.sessionId, title }), className: "ml-1", children: [t('openRun'), _jsx(ArrowUpRightIcon, { "aria-hidden": true, className: "size-3.5 shrink-0" })] }))] }) }), runError && run.status !== 'running' && !run.declined && (_jsx("div", { className: "mt-2 px-4 text-sm", children: _jsx(AgentFailure, { sentence: t('failedSentence'), raw: runError }) })), modal] }));
|
|
218
243
|
}
|
|
219
244
|
/** How a background run ended, read from its runner session; null while it still runs. */
|
|
220
245
|
function runnerOutcome(state) {
|
|
@@ -45,5 +45,5 @@ export function PeerMessageRow({ info, actions }) {
|
|
|
45
45
|
: idle
|
|
46
46
|
? t('kind.finished')
|
|
47
47
|
: t('kind.message');
|
|
48
|
-
return (_jsxs("div", { "data-testid": "peer-message-turn", "data-peer-kind": info.kind, "data-peer-message-id": info.messageId, className: "flex min-w-0 flex-col gap-1", children: [_jsx(AgentRowScope, { children: _jsx(BasicTool, { icon: _jsx(AgentFace, { handle: from }), trigger: _jsx(AgentTrigger, { title: name, subtitle: idle ? preview : info.summary?.trim() }), triggerAction: _jsx(AgentStatus, { status: idle ? 'done' : undefined, label: kindWord, opens: !!body }), defaultOpen: !idle, children: body ? (_jsx(AgentRowBody, { children: _jsx("div", { "data-slot": "peer-message-body", className: "min-w-0", children: _jsx(UnifiedMarkdown, { content: body, trust: "agent", isStreaming: false }) }) })) : undefined }) }), actions] }));
|
|
48
|
+
return (_jsxs("div", { "data-testid": "peer-message-turn", "data-peer-kind": info.kind, "data-peer-message-id": info.messageId, className: "flex min-w-0 flex-col gap-1", children: [_jsx(AgentRowScope, { children: _jsx(BasicTool, { icon: _jsx(AgentFace, { handle: from }), trigger: _jsx(AgentTrigger, { title: name, subtitle: idle ? preview : info.summary?.trim() }), triggerAction: _jsx(AgentStatus, { status: idle ? 'done' : undefined, label: kindWord, opens: !!body }), defaultOpen: !idle, children: body ? (_jsx(AgentRowBody, { children: _jsx("div", { "data-slot": "peer-message-body", className: "min-w-0", children: _jsx(UnifiedMarkdown, { content: body, trust: "agent", isStreaming: false, lineBreaks: "chat" }) }) })) : undefined }) }), actions] }));
|
|
49
49
|
}
|
|
@@ -3,14 +3,15 @@ export declare const QUEUED_BUBBLE_OPACITY_CLASS = "[&_.text-foreground]:text-mu
|
|
|
3
3
|
/** `interrupted`: the runtime holds the message but a Stop ended the turn
|
|
4
4
|
* before a step opened under it — it runs with the next send. */
|
|
5
5
|
export type QueuedPromptState = 'queued' | 'interrupted';
|
|
6
|
-
|
|
6
|
+
/** `unsent`: sent while offline; the POST waits for the network (finding 07). */
|
|
7
|
+
export type QueuedPromptStatusState = QueuedPromptState | 'failed' | 'sending' | 'held' | 'unsent';
|
|
7
8
|
/** Ring tone for a queued bubble. `pending` covers waiting and sending, so a
|
|
8
9
|
* delivery retry that flips a row between them never changes the ring. */
|
|
9
10
|
type QueuedBubbleTone = 'pending' | 'held' | 'failed';
|
|
10
11
|
export declare function queuedBubbleTone(state: QueuedPromptStatusState | null | undefined): QueuedBubbleTone | undefined;
|
|
11
12
|
/** Show delivery progress on the message itself, not only on the send button. */
|
|
12
13
|
export declare function QueuedPromptProgress({ state }: {
|
|
13
|
-
state: 'queued' | 'sending' | 'interrupted';
|
|
14
|
+
state: 'queued' | 'sending' | 'interrupted' | 'unsent';
|
|
14
15
|
}): import("react").JSX.Element;
|
|
15
16
|
/**
|
|
16
17
|
* A delivery failure retains its cause and recovery actions.
|
|
@@ -18,7 +18,7 @@ export function queuedBubbleTone(state) {
|
|
|
18
18
|
/** Show delivery progress on the message itself, not only on the send button. */
|
|
19
19
|
export function QueuedPromptProgress({ state }) {
|
|
20
20
|
const t = useTranslations('threads');
|
|
21
|
-
return (_jsx(InlineMeta, { children: _jsx("span", { role: "status", "data-queued-status": state, className: "text-muted-foreground text-xs", children: state === 'sending' ? t('sending') : t('queued') }) }));
|
|
21
|
+
return (_jsx(InlineMeta, { children: _jsx("span", { role: "status", "data-queued-status": state, className: "text-muted-foreground text-xs", children: state === 'unsent' ? t('notSentYet') : state === 'sending' ? t('sending') : t('queued') }) }));
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* A delivery failure retains its cause and recovery actions.
|
|
@@ -115,7 +115,7 @@ function ThrottledMarkdownImpl({ content, isStreaming, revealKey, response = fal
|
|
|
115
115
|
if (streaming && !displayContent)
|
|
116
116
|
return null;
|
|
117
117
|
// Session transcript assistant text: the one renderer (with SandboxUrlDetector) that opts in to generative UI.
|
|
118
|
-
return _jsx(UnifiedMarkdown, { content: displayContent, trust: "agent", isStreaming: streaming, genui: true });
|
|
118
|
+
return _jsx(UnifiedMarkdown, { content: displayContent, trust: "agent", isStreaming: streaming, genui: true, lineBreaks: "chat" });
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* Every prop is a primitive, so this memo bites immediately: a settled
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Containment for a turn wrapper — and the
|
|
2
|
+
* Containment for a turn wrapper — and the four rules that make it safe.
|
|
3
3
|
*
|
|
4
4
|
* `content-visibility: auto` lets the browser skip layout and paint for a turn
|
|
5
5
|
* that is off screen. That is a real saving here: the transcript grows by a
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
* while I scroll back"). So the stand-in is the turn's own measured height,
|
|
22
22
|
* written per turn, and no turn is contained before it has one.
|
|
23
23
|
*
|
|
24
|
-
* RULE 3 — no containment below `TURN_MIN_CONTAIN_PX`. See its own comment:
|
|
25
|
-
* a turn skipped at a near-zero stand-in can never come back.
|
|
26
|
-
*
|
|
27
24
|
* RULE 2 — no containment for an EMPTY turn, ever. A zero-height element can
|
|
28
25
|
* never intersect the viewport, so `content-visibility: auto` classifies it as
|
|
29
26
|
* "not relevant" and SKIPS it — permanently — and a skipped element stands in
|
|
@@ -37,6 +34,42 @@
|
|
|
37
34
|
* because ANY empty turn reproduces it.) An empty turn also drops the spacing
|
|
38
35
|
* its caller gave it, so a run of invisible turns contributes 0px, not a
|
|
39
36
|
* stack of 48px margins.
|
|
37
|
+
*
|
|
38
|
+
* RULE 3 — no containment below `TURN_MIN_CONTAIN_PX`. See its own comment:
|
|
39
|
+
* a turn skipped at a near-zero stand-in can never come back.
|
|
40
|
+
*
|
|
41
|
+
* RULE 4 — containment is only ever ADDED while the turn is off screen.
|
|
42
|
+
* Chrome resolves `content-visibility: auto` relevance after the frame that
|
|
43
|
+
* adds the property, so a turn contained while the reader looks at it is
|
|
44
|
+
* skipped for that frame: its bubble and avatar report a `previousRect` of
|
|
45
|
+
* 0x0 and the turn box a stale one, and the frame is scored as a layout shift.
|
|
46
|
+
* Measured on a plain send (F-022, 2026-11-13): 0.026-0.046 per new turn,
|
|
47
|
+
* 900ms after it mounted (`TURN_SETTLE_MS` plus the measure frames), with an
|
|
48
|
+
* rAF probe that saw the turn's box never move. Forcing `content-visibility:
|
|
49
|
+
* visible` on the same build removed every turn shift. The queued turns of a
|
|
50
|
+
* burst each paid it in turn, which is where the audit's 0.107-0.141 shifts
|
|
51
|
+
* came from. Containment only saves work on a turn that is off screen, so
|
|
52
|
+
* holding it until the turn is out of view costs nothing: the turn is
|
|
53
|
+
* contained out of sight, where no shift is scored and none is seen. "Was off
|
|
54
|
+
* screen once" is not enough: a queued turn mounts below the fold, the
|
|
55
|
+
* auto-scroll brings it up, and its height settles 500ms later in full view
|
|
56
|
+
* (measured: 0.072 for one queued turn). So the decision is taken while the
|
|
57
|
+
* turn is out of view, and then held: once contained, `content-visibility:
|
|
58
|
+
* auto` tracks relevance by itself. Losing its stand-in (RULE 2/3) drops the
|
|
59
|
+
* hold, so containment comes back only out of view again.
|
|
60
|
+
*
|
|
61
|
+
* And it is granted only at the height the turn has AT THAT MOMENT. A turn
|
|
62
|
+
* contained for the first time out of view has no last-remembered size, so it
|
|
63
|
+
* stands in at the published height, and a turn that just grew has not
|
|
64
|
+
* published its new one yet (`TURN_SETTLE_MS`). Measured: a queued turn whose
|
|
65
|
+
* answer took it from 130px to 206px was scrolled off and contained at 130px
|
|
66
|
+
* in the same second, pulling everything under it up 76px (0.097). A height
|
|
67
|
+
* still settling waits for its publish, and the grant is checked again then.
|
|
68
|
+
*
|
|
69
|
+
* "Out of view" is read from layout at the moment of the grant, never from the
|
|
70
|
+
* observer's last report: that report is a frame late, and an auto-scroll can
|
|
71
|
+
* bring the turn on screen inside that frame. The observer only says WHEN to
|
|
72
|
+
* look again.
|
|
40
73
|
*/
|
|
41
74
|
export type TurnMeasureState = 'unmeasured' | 'empty' | 'measured';
|
|
42
75
|
/**
|
|
@@ -66,7 +99,26 @@ export declare const TURN_MIN_CONTAIN_PX = 48;
|
|
|
66
99
|
* short to be a credible box, which is the case a stand-in can never recover
|
|
67
100
|
* from.
|
|
68
101
|
*/
|
|
69
|
-
export declare function turnIntrinsicSize(state: TurnMeasureState, measuredHeight: number): string | undefined;
|
|
102
|
+
export declare function turnIntrinsicSize(state: TurnMeasureState, measuredHeight: number, containedOffscreen: boolean): string | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* RULE 4's hold, as one pure step. Dropped the moment the turn has no stand-in
|
|
105
|
+
* (RULE 2/3); kept once granted; granted only while the turn is out of view AND
|
|
106
|
+
* its current layout height is the published one.
|
|
107
|
+
*/
|
|
108
|
+
export declare function nextContainHold(input: {
|
|
109
|
+
held: boolean;
|
|
110
|
+
hasStandIn: boolean;
|
|
111
|
+
outOfView: boolean;
|
|
112
|
+
heightSettled: boolean;
|
|
113
|
+
}): boolean;
|
|
114
|
+
/** RULE 4's geometry: no pixel of the turn is inside the visible band. */
|
|
115
|
+
export declare function turnOutOfView(turn: {
|
|
116
|
+
top: number;
|
|
117
|
+
bottom: number;
|
|
118
|
+
}, visible: {
|
|
119
|
+
top: number;
|
|
120
|
+
bottom: number;
|
|
121
|
+
}): boolean;
|
|
70
122
|
/**
|
|
71
123
|
* The wrapper's full class list. Pure and DOM-free so every rule above has a
|
|
72
124
|
* test that can fail:
|
|
@@ -75,12 +127,14 @@ export declare function turnIntrinsicSize(state: TurnMeasureState, measuredHeigh
|
|
|
75
127
|
* - `empty` → no containment (RULE 2), and `mt-0` AFTER the caller's
|
|
76
128
|
* classes so tailwind-merge drops the caller's `mt-*`.
|
|
77
129
|
* - `measured` → containment, but ONLY when it has a stand-in to be skipped
|
|
78
|
-
* at (RULE 3)
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
130
|
+
* at (RULE 3) and the hold was granted out of view, at
|
|
131
|
+
* its current height (RULE 4). The size itself is an
|
|
132
|
+
* inline style, so the class is driven by
|
|
133
|
+
* `turnIntrinsicSize` rather than by the state: that is
|
|
134
|
+
* what makes "contained" and "has a stand-in" the same fact
|
|
135
|
+
* instead of two that can disagree.
|
|
82
136
|
*/
|
|
83
|
-
export declare function turnViewportClassName(state: TurnMeasureState, className?: string, measuredHeight?: number): string;
|
|
137
|
+
export declare function turnViewportClassName(state: TurnMeasureState, className?: string, measuredHeight?: number, containedOffscreen?: boolean): string;
|
|
84
138
|
/**
|
|
85
139
|
* How long a turn's height must hold still before it is allowed to skip.
|
|
86
140
|
*
|
|
@@ -132,6 +186,8 @@ export declare function turnLayoutHeight(el: HTMLElement): number;
|
|
|
132
186
|
export declare function useTurnMeasure(ref: React.RefObject<HTMLDivElement | null>): {
|
|
133
187
|
state: TurnMeasureState;
|
|
134
188
|
height: number;
|
|
189
|
+
/** RULE 4: containment was granted while the turn was out of view. */
|
|
190
|
+
containedOffscreen: boolean;
|
|
135
191
|
};
|
|
136
192
|
/**
|
|
137
193
|
* One turn's wrapper: the scroll anchor (`data-turn-id`) plus the containment
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from '../../lib/utils.js';
|
|
4
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
5
5
|
/**
|
|
6
6
|
* The smallest stand-in a turn may be skipped at — RULE 3.
|
|
7
7
|
*
|
|
@@ -29,13 +29,51 @@ export const TURN_MIN_CONTAIN_PX = 48;
|
|
|
29
29
|
* short to be a credible box, which is the case a stand-in can never recover
|
|
30
30
|
* from.
|
|
31
31
|
*/
|
|
32
|
-
export function turnIntrinsicSize(state, measuredHeight) {
|
|
32
|
+
export function turnIntrinsicSize(state, measuredHeight, containedOffscreen) {
|
|
33
33
|
if (state !== 'measured')
|
|
34
34
|
return undefined;
|
|
35
|
+
if (!containedOffscreen)
|
|
36
|
+
return undefined; // RULE 4
|
|
35
37
|
if (!(measuredHeight >= TURN_MIN_CONTAIN_PX))
|
|
36
38
|
return undefined;
|
|
37
39
|
return `auto ${measuredHeight}px`;
|
|
38
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* RULE 4's hold, as one pure step. Dropped the moment the turn has no stand-in
|
|
43
|
+
* (RULE 2/3); kept once granted; granted only while the turn is out of view AND
|
|
44
|
+
* its current layout height is the published one.
|
|
45
|
+
*/
|
|
46
|
+
export function nextContainHold(input) {
|
|
47
|
+
if (!input.hasStandIn)
|
|
48
|
+
return false;
|
|
49
|
+
if (input.held)
|
|
50
|
+
return true;
|
|
51
|
+
return input.outOfView && input.heightSettled;
|
|
52
|
+
}
|
|
53
|
+
/** RULE 4's geometry: no pixel of the turn is inside the visible band. */
|
|
54
|
+
export function turnOutOfView(turn, visible) {
|
|
55
|
+
return turn.bottom <= visible.top || turn.top >= visible.bottom;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The band a turn can be seen in: its nearest clipping ancestor's box, clipped
|
|
59
|
+
* to the window. A clip wrapper inside the scroller only narrows the band, so
|
|
60
|
+
* the error is always "in view" (left uncontained), never a visible turn
|
|
61
|
+
* contained.
|
|
62
|
+
*/
|
|
63
|
+
function visibleBand(el) {
|
|
64
|
+
let top = 0;
|
|
65
|
+
let bottom = window.innerHeight;
|
|
66
|
+
for (let a = el.parentElement; a; a = a.parentElement) {
|
|
67
|
+
const overflowY = getComputedStyle(a).overflowY;
|
|
68
|
+
if (overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'hidden') {
|
|
69
|
+
const r = a.getBoundingClientRect();
|
|
70
|
+
top = Math.max(top, r.top);
|
|
71
|
+
bottom = Math.min(bottom, r.bottom);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return { top, bottom };
|
|
76
|
+
}
|
|
39
77
|
/**
|
|
40
78
|
* The wrapper's full class list. Pure and DOM-free so every rule above has a
|
|
41
79
|
* test that can fail:
|
|
@@ -44,13 +82,15 @@ export function turnIntrinsicSize(state, measuredHeight) {
|
|
|
44
82
|
* - `empty` → no containment (RULE 2), and `mt-0` AFTER the caller's
|
|
45
83
|
* classes so tailwind-merge drops the caller's `mt-*`.
|
|
46
84
|
* - `measured` → containment, but ONLY when it has a stand-in to be skipped
|
|
47
|
-
* at (RULE 3)
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
85
|
+
* at (RULE 3) and the hold was granted out of view, at
|
|
86
|
+
* its current height (RULE 4). The size itself is an
|
|
87
|
+
* inline style, so the class is driven by
|
|
88
|
+
* `turnIntrinsicSize` rather than by the state: that is
|
|
89
|
+
* what makes "contained" and "has a stand-in" the same fact
|
|
90
|
+
* instead of two that can disagree.
|
|
51
91
|
*/
|
|
52
|
-
export function turnViewportClassName(state, className, measuredHeight = 0) {
|
|
53
|
-
return cn(turnIntrinsicSize(state, measuredHeight) !== undefined && '[content-visibility:auto]', className, state === 'empty' && 'mt-0');
|
|
92
|
+
export function turnViewportClassName(state, className, measuredHeight = 0, containedOffscreen = false) {
|
|
93
|
+
return cn(turnIntrinsicSize(state, measuredHeight, containedOffscreen) !== undefined && '[content-visibility:auto]', className, state === 'empty' && 'mt-0');
|
|
54
94
|
}
|
|
55
95
|
/**
|
|
56
96
|
* How long a turn's height must hold still before it is allowed to skip.
|
|
@@ -103,6 +143,24 @@ export function turnLayoutHeight(el) {
|
|
|
103
143
|
* value.
|
|
104
144
|
*/
|
|
105
145
|
export function useTurnMeasure(ref) {
|
|
146
|
+
// RULE 4. Whether the turn is in view right now. The scroll container clips
|
|
147
|
+
// the turn, so a root-less observer sees it leave. Starts as "in view": a
|
|
148
|
+
// turn is never contained before the observer has reported once.
|
|
149
|
+
const [inView, setInView] = useState(true);
|
|
150
|
+
const [containedOffscreen, setContainedOffscreen] = useState(false);
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
const el = ref.current;
|
|
153
|
+
// Held: `content-visibility: auto` tracks relevance now; stop observing.
|
|
154
|
+
if (!el || containedOffscreen || typeof IntersectionObserver === 'undefined')
|
|
155
|
+
return;
|
|
156
|
+
const io = new IntersectionObserver((entries) => {
|
|
157
|
+
const entry = entries[entries.length - 1];
|
|
158
|
+
if (entry)
|
|
159
|
+
setInView(entry.isIntersecting);
|
|
160
|
+
});
|
|
161
|
+
io.observe(el);
|
|
162
|
+
return () => io.disconnect();
|
|
163
|
+
}, [ref, containedOffscreen]);
|
|
106
164
|
const [measure, setMeasure] = useState({
|
|
107
165
|
state: 'unmeasured',
|
|
108
166
|
height: 0,
|
|
@@ -151,7 +209,29 @@ export function useTurnMeasure(ref) {
|
|
|
151
209
|
ro?.disconnect();
|
|
152
210
|
};
|
|
153
211
|
}, [ref]);
|
|
154
|
-
|
|
212
|
+
// The hold (`nextContainHold`). Dropping it needs no layout read: a guarded
|
|
213
|
+
// render-phase update, so the class goes in the commit that loses the
|
|
214
|
+
// stand-in. Granting reads layout, so it is a layout effect: the geometry
|
|
215
|
+
// check and the class land in the same frame.
|
|
216
|
+
const hasStandIn = turnIntrinsicSize(measure.state, measure.height, true) !== undefined;
|
|
217
|
+
if (!hasStandIn && containedOffscreen)
|
|
218
|
+
setContainedOffscreen(false);
|
|
219
|
+
useLayoutEffect(() => {
|
|
220
|
+
const el = ref.current;
|
|
221
|
+
if (!el || containedOffscreen || !hasStandIn || inView)
|
|
222
|
+
return;
|
|
223
|
+
const box = el.getBoundingClientRect();
|
|
224
|
+
const grant = nextContainHold({
|
|
225
|
+
held: false,
|
|
226
|
+
hasStandIn,
|
|
227
|
+
outOfView: turnOutOfView(box, visibleBand(el)),
|
|
228
|
+
// Still settling: the publish re-runs this with the height it settles at.
|
|
229
|
+
heightSettled: box.height === measure.height,
|
|
230
|
+
});
|
|
231
|
+
if (grant)
|
|
232
|
+
setContainedOffscreen(true);
|
|
233
|
+
}, [ref, measure.height, hasStandIn, inView, containedOffscreen]);
|
|
234
|
+
return { ...measure, containedOffscreen };
|
|
155
235
|
}
|
|
156
236
|
/**
|
|
157
237
|
* One turn's wrapper: the scroll anchor (`data-turn-id`) plus the containment
|
|
@@ -159,7 +239,7 @@ export function useTurnMeasure(ref) {
|
|
|
159
239
|
*/
|
|
160
240
|
export function TurnViewport({ turnId, className, continues, children, }) {
|
|
161
241
|
const ref = useRef(null);
|
|
162
|
-
const { state, height } = useTurnMeasure(ref);
|
|
163
|
-
const containIntrinsicSize = turnIntrinsicSize(state, height);
|
|
164
|
-
return (_jsx("div", { ref: ref, "data-turn-id": turnId, "data-turn-continues": continues || undefined, className: turnViewportClassName(state, className, height), style: containIntrinsicSize ? { containIntrinsicSize } : undefined, children: children }));
|
|
242
|
+
const { state, height, containedOffscreen } = useTurnMeasure(ref);
|
|
243
|
+
const containIntrinsicSize = turnIntrinsicSize(state, height, containedOffscreen);
|
|
244
|
+
return (_jsx("div", { ref: ref, "data-turn-id": turnId, "data-turn-continues": continues || undefined, className: turnViewportClassName(state, className, height, containedOffscreen), style: containIntrinsicSize ? { containIntrinsicSize } : undefined, children: children }));
|
|
165
245
|
}
|
|
@@ -3,7 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { attachmentMime } from '../../internal/lib/attachment-mime.js';
|
|
4
4
|
import { AttachmentPreview } from './attachment-preview.js';
|
|
5
5
|
import { getFileCategory } from '../../files/viewer/preview-policy.js';
|
|
6
|
-
import {
|
|
6
|
+
import { triggerHref } from '../../internal/lib/capability-tab-routes.js';
|
|
7
|
+
import { useTriggersPageOpen } from '../../internal/layout/project-settings-nav.js';
|
|
7
8
|
import { MessageSenderAbove } from '../participants/session-participants.js';
|
|
8
9
|
import { MessageAuthorLabel } from './message-author-label.js';
|
|
9
10
|
import { MESSAGE_TEXT_CLASS, RowToolbar } from './message-row.js';
|
|
@@ -127,8 +128,8 @@ function PlatformPromptMessage({ pill, text, actions, ...data }) {
|
|
|
127
128
|
}
|
|
128
129
|
/**
|
|
129
130
|
* A loop fire (`[REMINDER reminder.<id> …]`, the wire name). The pill says
|
|
130
|
-
* Loop and whether it repeats; its card carries the id and a link to
|
|
131
|
-
*
|
|
131
|
+
* Loop and whether it repeats; its card carries the id and a Manage link to
|
|
132
|
+
* the loop's own row on the Triggers page (`?id=<reminder id>`).
|
|
132
133
|
*/
|
|
133
134
|
/**
|
|
134
135
|
* A voice call's turn the voice answered itself (voice-turn.ts): the caller's words as their own bubble under a Call
|
|
@@ -141,8 +142,9 @@ function VoiceTurnMessage({ info, actions }) {
|
|
|
141
142
|
function ReminderMessage({ info, actions }) {
|
|
142
143
|
const t = useTranslations('reminders');
|
|
143
144
|
const ids = useSessionIds();
|
|
144
|
-
|
|
145
|
-
const
|
|
145
|
+
// The loop's own row on the Triggers page, shown only to a caller that page lets in.
|
|
146
|
+
const canOpenTriggers = useTriggersPageOpen(ids.projectId ?? undefined);
|
|
147
|
+
const manageHref = ids.projectId && canOpenTriggers ? triggerHref(ids.projectId, info.id) : null;
|
|
146
148
|
return (_jsx(PlatformPromptMessage, { "data-testid": "reminder-turn", "data-reminder-id": info.id, text: info.prompt, actions: actions, pill: _jsx(SourcePill, { mark: _jsx(AlarmIcon, { className: "size-3 shrink-0", "aria-hidden": true }), source: t('cardLabel'), sender: info.recurring ? t('cardRecurring') : t('cardOneTime'), card: _jsx(SourceCard, { mark: _jsx(AlarmIcon, { className: "size-3.5 shrink-0", "aria-hidden": true }), title: t('cardLabel'), footer: _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-muted-foreground truncate font-mono", children: info.id }), manageHref && (_jsx(HoverPrefetchLink, { href: manageHref, className: "text-foreground shrink-0 font-medium underline-offset-2 hover:underline", children: t('cardManage') }))] }) }) }) }));
|
|
147
149
|
}
|
|
148
150
|
/** A trigger fire (`<trigger_event>{…}</trigger_event>`): the trigger's name in the pill, the prompt in the bubble. */
|
package/dist/styles/theme.css
CHANGED
|
@@ -32,6 +32,74 @@
|
|
|
32
32
|
|
|
33
33
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
34
34
|
|
|
35
|
+
/* Reduce motion (Settings ▸ Preferences). The person's switch puts
|
|
36
|
+
`data-reduce-motion` on <html>; it counts the same as the OS
|
|
37
|
+
`prefers-reduced-motion: reduce`. Both Tailwind motion variants follow it, so
|
|
38
|
+
every `motion-reduce:` / `motion-safe:` class in the app obeys the switch
|
|
39
|
+
without a second class. See `internal/hooks/use-reduced-motion.ts`. */
|
|
40
|
+
@custom-variant motion-reduce {
|
|
41
|
+
@media (prefers-reduced-motion: reduce) {
|
|
42
|
+
@slot;
|
|
43
|
+
}
|
|
44
|
+
&:where([data-reduce-motion] *) {
|
|
45
|
+
@slot;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
@custom-variant motion-safe {
|
|
49
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
50
|
+
&:where(:root:not([data-reduce-motion]) *) {
|
|
51
|
+
@slot;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* The switch stops every CSS animation and transition: shimmer sweeps, pulses,
|
|
57
|
+
skeletons, enter/exit fades, hover fades, smooth scroll. Durations collapse to
|
|
58
|
+
0.01ms instead of `none`, so each animation still lands on its end state and
|
|
59
|
+
still fires `animationend` / `transitionend` — Radix presence and exit
|
|
60
|
+
handlers wait for those events. Infinite loops play once and stop.
|
|
61
|
+
Background-position sweeps (the shimmer) repaint every frame and never reach
|
|
62
|
+
the compositor; this rule is where the switch saves the most work. */
|
|
63
|
+
:root[data-reduce-motion] *,
|
|
64
|
+
:root[data-reduce-motion] *::before,
|
|
65
|
+
:root[data-reduce-motion] *::after {
|
|
66
|
+
animation-duration: 0.01ms !important;
|
|
67
|
+
animation-delay: 0s !important;
|
|
68
|
+
animation-iteration-count: 1 !important;
|
|
69
|
+
transition-duration: 0.01ms !important;
|
|
70
|
+
transition-delay: 0s !important;
|
|
71
|
+
scroll-behavior: auto !important;
|
|
72
|
+
}
|
|
73
|
+
:root[data-reduce-motion] {
|
|
74
|
+
scroll-behavior: auto !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* A loader still has to say "working". The spinners keep the calm,
|
|
78
|
+
constant-speed spin the OS reduced-motion rule below gives them — one
|
|
79
|
+
compositor-only rotation, no repaint. */
|
|
80
|
+
:root[data-reduce-motion] .animate-spinner-orbit,
|
|
81
|
+
:root[data-reduce-motion] .animate-spinner-spin {
|
|
82
|
+
animation: spinner-orbit 1.4s linear infinite !important;
|
|
83
|
+
}
|
|
84
|
+
:root[data-reduce-motion] .animate-spinner-dash {
|
|
85
|
+
animation: none !important;
|
|
86
|
+
stroke-dashoffset: 34;
|
|
87
|
+
transform: none;
|
|
88
|
+
}
|
|
89
|
+
:root[data-reduce-motion] .animate-spinner-spokes {
|
|
90
|
+
animation: spinner-spokes 1.4s linear infinite !important;
|
|
91
|
+
}
|
|
92
|
+
:root[data-reduce-motion] .animate-spin {
|
|
93
|
+
animation-duration: 1s !important;
|
|
94
|
+
animation-iteration-count: infinite !important;
|
|
95
|
+
}
|
|
96
|
+
/* `KortixLoader` spins through an inline `animation`; its duration rides in
|
|
97
|
+
`--kx-spin-duration` so this rule can give it back. */
|
|
98
|
+
:root[data-reduce-motion] [data-kx-spinner] {
|
|
99
|
+
animation-duration: var(--kx-spin-duration, 1s) !important;
|
|
100
|
+
animation-iteration-count: infinite !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
35
103
|
/* Host-neutral base rules. Every host gets them, so the page itself follows the
|
|
36
104
|
tokens: the body paints --background and --foreground (a white-label
|
|
37
105
|
override of either reaches the page), borders and outlines default to
|