@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
|
@@ -6,7 +6,7 @@ import type { UiTranslator } from '../../i18n/index.js';
|
|
|
6
6
|
* the whole set from one clock read rather than each row racing its own.
|
|
7
7
|
*/
|
|
8
8
|
import type { TurnCostInfo } from '../../internal/session-types/index.js';
|
|
9
|
-
import type
|
|
9
|
+
import { type SessionLogTurn } from '@kortix/sdk';
|
|
10
10
|
import type { TurnServedModel } from '../turn/served-model.js';
|
|
11
11
|
export interface SessionTurnSpan {
|
|
12
12
|
startedAt: number | null;
|
|
@@ -19,10 +19,18 @@ export interface SessionTurnSpan {
|
|
|
19
19
|
* interrupted before finishing). */
|
|
20
20
|
export declare function sessionTurnSpan(turn: Pick<SessionLogTurn, 'user' | 'assistant'>): SessionTurnSpan;
|
|
21
21
|
export declare function sessionTurnEndedAt(turn: Pick<SessionLogTurn, 'user' | 'assistant'>): number | null;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
/**
|
|
23
|
+
* How long the turn waited for the person: each answered question's
|
|
24
|
+
* open→answered interval (a `question` call's `started_at` → `ended_at`), and
|
|
25
|
+
* each workflow approval (the run document's `approvalWaitMs`). Waiting is
|
|
26
|
+
* not work, so "Worked for" leaves it out. 0 for a turn that asked nothing.
|
|
27
|
+
*/
|
|
28
|
+
export declare function sessionTurnWaitMs(turn: Pick<SessionLogTurn, 'assistant'>): number;
|
|
29
|
+
/** How long the turn took, its waits for the person left out (`sessionTurnWaitMs`).
|
|
30
|
+
* `null` whenever that isn't knowable, INCLUDING `endedAt === startedAt`: one
|
|
31
|
+
* timestamp says WHEN a turn ended and says nothing about how long it took to
|
|
32
|
+
* get there, so a same-instant span is treated the same as no span at all
|
|
33
|
+
* rather than rendered as "0s". */
|
|
26
34
|
export declare function sessionTurnDurationMs(turn: Pick<SessionLogTurn, 'user' | 'assistant'>): number | null;
|
|
27
35
|
export interface SessionTurnMetaRow {
|
|
28
36
|
label: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { formatDuration, formatTokens } from '../../internal/session-types/index.js';
|
|
2
|
+
import { isQuestionTool, isWorkflowTool, parseWorkflowRun, toolCallMetadata } from '@kortix/sdk';
|
|
2
3
|
import { formatUsdAsCredits } from '../../_vendor/kortix-shared.js';
|
|
3
4
|
import { formatDistanceStrict } from 'date-fns';
|
|
4
5
|
/** A record time (`created_at` / `completed_at`, ISO) as epoch ms; null when absent. */
|
|
@@ -20,15 +21,42 @@ export function sessionTurnSpan(turn) {
|
|
|
20
21
|
export function sessionTurnEndedAt(turn) {
|
|
21
22
|
return sessionTurnSpan(turn).endedAt;
|
|
22
23
|
}
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
/**
|
|
25
|
+
* How long the turn waited for the person: each answered question's
|
|
26
|
+
* open→answered interval (a `question` call's `started_at` → `ended_at`), and
|
|
27
|
+
* each workflow approval (the run document's `approvalWaitMs`). Waiting is
|
|
28
|
+
* not work, so "Worked for" leaves it out. 0 for a turn that asked nothing.
|
|
29
|
+
*/
|
|
30
|
+
export function sessionTurnWaitMs(turn) {
|
|
31
|
+
let wait = 0;
|
|
32
|
+
for (const message of turn.assistant) {
|
|
33
|
+
for (const block of message.blocks ?? []) {
|
|
34
|
+
if (block.type !== 'tool_call')
|
|
35
|
+
continue;
|
|
36
|
+
if (isQuestionTool(block.name)) {
|
|
37
|
+
const start = msOf(block.started_at);
|
|
38
|
+
const end = msOf(block.ended_at);
|
|
39
|
+
if (start != null && end != null && end > start)
|
|
40
|
+
wait += end - start;
|
|
41
|
+
}
|
|
42
|
+
else if (isWorkflowTool(block.name)) {
|
|
43
|
+
wait += parseWorkflowRun(toolCallMetadata(block))?.approvalWaitMs ?? 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return wait;
|
|
48
|
+
}
|
|
49
|
+
/** How long the turn took, its waits for the person left out (`sessionTurnWaitMs`).
|
|
50
|
+
* `null` whenever that isn't knowable, INCLUDING `endedAt === startedAt`: one
|
|
51
|
+
* timestamp says WHEN a turn ended and says nothing about how long it took to
|
|
52
|
+
* get there, so a same-instant span is treated the same as no span at all
|
|
53
|
+
* rather than rendered as "0s". */
|
|
27
54
|
export function sessionTurnDurationMs(turn) {
|
|
28
55
|
const { startedAt, endedAt } = sessionTurnSpan(turn);
|
|
29
56
|
if (startedAt == null || endedAt == null || endedAt <= startedAt)
|
|
30
57
|
return null;
|
|
31
|
-
|
|
58
|
+
const worked = endedAt - startedAt - sessionTurnWaitMs(turn);
|
|
59
|
+
return worked > 0 ? worked : null;
|
|
32
60
|
}
|
|
33
61
|
/**
|
|
34
62
|
* The turn's meta as labelled rows, in display order. A row is omitted
|
|
@@ -87,8 +87,7 @@ interface SessionTurnProps {
|
|
|
87
87
|
isLast: boolean;
|
|
88
88
|
ownsPlan: boolean;
|
|
89
89
|
sessionId: string;
|
|
90
|
-
/** The Kortix project and project-session ids.
|
|
91
|
-
* offers Share (`TurnShareButton`). Absent (a child session): no Share. */
|
|
90
|
+
/** The Kortix project and project-session ids. */
|
|
92
91
|
projectId?: string;
|
|
93
92
|
projectSessionId?: string;
|
|
94
93
|
sessionStatus: import('../../internal/session-types/index.js').SessionStatus | undefined;
|
|
@@ -345,7 +344,8 @@ declare function useTurnSegments({ blocks, answeredQuestionCallsById, shouldUseI
|
|
|
345
344
|
/**
|
|
346
345
|
* The segments a messages-only thread (`TranscriptRows.messagesOnly`) draws:
|
|
347
346
|
* the agent's words and the deliverables it showed on purpose (`show`,
|
|
348
|
-
* `image_gen`), plus a call that waits on the person's permission
|
|
347
|
+
* `image_gen`), plus a call that waits on the person's permission or started a
|
|
348
|
+
* connector sign-in (its Connect card). Never a
|
|
349
349
|
* burst (tools, thinking) or another standalone call (a sub-agent card).
|
|
350
350
|
* Settled, the interim sentences are work too: only the deliverables and the
|
|
351
351
|
* final text stay, the rule of the "Worked for" fold (`splitSessionLogTurnWork`).
|
|
@@ -15,7 +15,7 @@ import { detectCommandFromText } from './detect-command.js';
|
|
|
15
15
|
import { GenuiTelemetryContext } from '../../markdown/genui/block-telemetry.js';
|
|
16
16
|
import { copyGenuiText } from '../../markdown/genui/to-markdown.js';
|
|
17
17
|
import { useLocale, useTranslations } from '../../i18n/index.js';
|
|
18
|
-
import { isSessionLogRestoreNote, sessionLogActivityText, sessionLogAnsweredQuestionCall, sessionLogBurstSteps, sessionLogOpenCall, sessionLogTurnSegments, sessionPromptActions, splitSessionLogTurnWork, sessionLogAgentRunLabel, isNoGroupActivityTool, toolCallMetadata, toolKind, } from '@kortix/sdk';
|
|
18
|
+
import { isSessionLogRestoreNote, sessionLogActivityText, sessionLogAnsweredQuestionCall, sessionLogBurstSteps, sessionLogOpenCall, sessionLogTurnSegments, sessionPromptActions, splitSessionLogTurnWork, sessionLogAgentRunLabel, isNoGroupActivityTool, toolCallMetadata, toolCallConnectorSignIns, toolKind, } from '@kortix/sdk';
|
|
19
19
|
import { WarningIcon as AlertTriangle, CheckCircleIcon as CheckCircle, CheckIcon, CaretDownIcon as ChevronDown, ArrowSquareOutIcon as ExternalLink, StopCircleIcon, } from '@phosphor-icons/react';
|
|
20
20
|
import { AnimatePresence, m } from 'motion/react';
|
|
21
21
|
import { memo, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
@@ -49,7 +49,6 @@ import { showTurnBusyIndicator } from '@kortix/sdk';
|
|
|
49
49
|
import { SessionBusyIndicator } from '../status/session-busy-indicator.js';
|
|
50
50
|
import { useAnswerStreaming } from '../turn/answer-streaming.js';
|
|
51
51
|
import { SessionTurnMeta } from './session-turn-meta.js';
|
|
52
|
-
import { TurnShareButton } from './turn-share.js';
|
|
53
52
|
import { sessionTurnDurationMs, sessionTurnEndedAt, sessionTurnSpan, } from './session-turn-meta-rows.js';
|
|
54
53
|
import { Button } from '../../primitives/button.js';
|
|
55
54
|
import { Disclosure, DisclosureContent, DisclosureTrigger } from '../../primitives/disclosure.js';
|
|
@@ -71,7 +70,7 @@ import { extractKortixSystemMessages, extractSessionReport, stripKortixSystemTag
|
|
|
71
70
|
import { Copy } from '../../icons/copy.js';
|
|
72
71
|
import { extractGatewayErrorDetails, formatDuration, getPermissionForTool, getRetryInfo, getRetryMessage, shouldShowToolPart, } from '../../internal/session-types/index.js';
|
|
73
72
|
import { isAbortError, turnEndNotice, } from '@kortix/sdk';
|
|
74
|
-
import { isOptimisticSessionPrompt, useRuntimeReady, useSessionPrompts } from '@kortix/sdk/react';
|
|
73
|
+
import { isOptimisticSessionPrompt, useRuntimeReady, useSessionPrompts, useSessionUnsentPrompts } from '@kortix/sdk/react';
|
|
75
74
|
import { CodeBlockEndpoints, SandboxUrlDetector } from '../media/sandbox-url-detector.js';
|
|
76
75
|
import { HarnessSwitchMarker, RestoreNoteMarker, TurnFullText } from './session-history.js';
|
|
77
76
|
/** The agent whose mark stands in when a row does not name its agent. */
|
|
@@ -431,7 +430,11 @@ function isStepBlock(block) {
|
|
|
431
430
|
}
|
|
432
431
|
/** The queue tone of the turn's user bubble: interrupted, queued, held or
|
|
433
432
|
* sending — what the dimmed bubble and its status chip render. */
|
|
434
|
-
function useTurnQueueTone({ pending, pendingPrompt, interruptedBeforeRun, }) {
|
|
433
|
+
function useTurnQueueTone({ pending, pendingPrompt, interruptedBeforeRun, sessionId, projectSessionId, }) {
|
|
434
|
+
// A prompt sent while offline: its POST waits for the network, so it is not
|
|
435
|
+
// "sending" yet (finding 07). The SDK keys unsent sends by the project session
|
|
436
|
+
// (the id the prompt was posted to), not the runtime `ses_…` id of the turn.
|
|
437
|
+
const unsentIds = useSessionUnsentPrompts(projectSessionId ?? sessionId);
|
|
435
438
|
// A Stop ended the turn before a step opened under this message, or the
|
|
436
439
|
// prompt still waits for delivery. Both keep the queue tone on the bubble;
|
|
437
440
|
// only a delivery failure adds text.
|
|
@@ -444,9 +447,14 @@ function useTurnQueueTone({ pending, pendingPrompt, interruptedBeforeRun, }) {
|
|
|
444
447
|
: pendingPrompt?.reason === 'held'
|
|
445
448
|
? 'held'
|
|
446
449
|
: pendingPrompt &&
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
+
isOptimisticSessionPrompt(pendingPrompt) &&
|
|
451
|
+
// The SDK lists a held send by its wire message id, else its client id.
|
|
452
|
+
unsentIds.includes(pendingPrompt.message_id ?? pendingPrompt.client_message_id)
|
|
453
|
+
? 'unsent'
|
|
454
|
+
: pendingPrompt &&
|
|
455
|
+
(isOptimisticSessionPrompt(pendingPrompt) || pendingPrompt.state === 'delivering')
|
|
456
|
+
? 'sending'
|
|
457
|
+
: statusState;
|
|
450
458
|
return { queueState, statusState, queuedStatus };
|
|
451
459
|
}
|
|
452
460
|
/** Everything the turn's error row shows: the error text, whether it is an
|
|
@@ -1083,7 +1091,7 @@ function TurnUserBubble(props) {
|
|
|
1083
1091
|
? () => onRetryQueued(pendingPrompt.prompt_id)
|
|
1084
1092
|
: undefined, onRemove: pendingPrompt && onRemoveQueued && promptActions.removable
|
|
1085
1093
|
? () => onRemoveQueued(pendingPrompt.prompt_id)
|
|
1086
|
-
: undefined })) : queuedStatus === 'sending' || queuedStatus === 'queued' || queuedStatus === 'interrupted' ? (_jsx(QueuedPromptProgress, { state: queuedStatus })) : undefined }) })) }));
|
|
1094
|
+
: undefined })) : queuedStatus === 'sending' || queuedStatus === 'queued' || queuedStatus === 'interrupted' || queuedStatus === 'unsent' ? (_jsx(QueuedPromptProgress, { state: queuedStatus })) : undefined }) })) }));
|
|
1087
1095
|
}
|
|
1088
1096
|
/** One shared empty set: a live turn has no recovered calls yet. */
|
|
1089
1097
|
const NO_RECOVERED_CALLS = new Set();
|
|
@@ -1203,7 +1211,8 @@ function segmentRendersSomething(segment) {
|
|
|
1203
1211
|
/**
|
|
1204
1212
|
* The segments a messages-only thread (`TranscriptRows.messagesOnly`) draws:
|
|
1205
1213
|
* the agent's words and the deliverables it showed on purpose (`show`,
|
|
1206
|
-
* `image_gen`), plus a call that waits on the person's permission
|
|
1214
|
+
* `image_gen`), plus a call that waits on the person's permission or started a
|
|
1215
|
+
* connector sign-in (its Connect card). Never a
|
|
1207
1216
|
* burst (tools, thinking) or another standalone call (a sub-agent card).
|
|
1208
1217
|
* Settled, the interim sentences are work too: only the deliverables and the
|
|
1209
1218
|
* final text stay, the rule of the "Worked for" fold (`splitSessionLogTurnWork`).
|
|
@@ -1220,7 +1229,10 @@ export function messageOnlySegments(segments, options) {
|
|
|
1220
1229
|
return segment.block.text.trim() !== '';
|
|
1221
1230
|
if (segment.kind === 'show-group')
|
|
1222
1231
|
return true;
|
|
1223
|
-
return isNoGroupActivityTool(segment.block.name) ||
|
|
1232
|
+
return (isNoGroupActivityTool(segment.block.name) ||
|
|
1233
|
+
!!getPermissionForTool(options.permissions, segment.block.call_id) ||
|
|
1234
|
+
// The call that started a connector sign-in: its Connect card waits on the person.
|
|
1235
|
+
toolCallConnectorSignIns(segment.block).length > 0);
|
|
1224
1236
|
};
|
|
1225
1237
|
const split = options.working ? null : splitSessionLogTurnWork(visible, { working: false });
|
|
1226
1238
|
return (split ? [...split.hoisted, ...split.final] : visible).filter(kept);
|
|
@@ -1349,16 +1361,7 @@ function TurnFooter(props) {
|
|
|
1349
1361
|
const { turnEndedAt, turnDurationMs, costInfo } = meta;
|
|
1350
1362
|
return (_jsxs(_Fragment, { children: [_jsx(TurnBusyRow, { ...props, working: working, turnError: turnError, tHardcodedUi: tHardcodedUi, hasText: model.response.trim() !== '', openText: model.openText?.block.text }), turnErrorRow.text && !turn.autoRetry?.continued && (
|
|
1351
1363
|
// A space's thread (messages only): one calm line with Retry; a stop has its own "Stopped" line.
|
|
1352
|
-
props.quietBusy ? (turnErrorRow.isAbort ? null : (_jsx(TurnFailedLine, { projectId: projectId, projectSessionId: projectSessionId, turn: turn, errorText: turnErrorRow.text }))) : (_jsx(TurnErrorDisplay, { errorText: turnErrorRow.text, errorDetails: turnErrorRowDetails, errorRaw: turnErrorRaw, isAbort: turnErrorRow.isAbort, modelOptions: modelOptions }))), turnErrorRow.text && !turnErrorRow.isAbort && !turn.autoRetry?.continued && !!turn.autoRetry?.retries && (_jsx(TurnAutoRetryNote, { count: turn.autoRetry.retries })), !working && !turn.autoRetry?.continued && (stoppedBy || errors.turnErrorIsAbort) && _jsx(TurnStoppedBy, { name: stoppedBy ?? undefined }), !working && _jsx(TurnOutcomes, { turnKey: turn.id }), !working && !props.hideActionBar && hasCopyableResponse(response, answered.inlineContentParts) && (_jsx(TurnActionBar, { response: response, inlineContentParts: answered.inlineContentParts, turnEndedAt: turnEndedAt, turnDurationMs: turnDurationMs, costInfo: costInfo, servedModel: servedModel, tHardcodedUi: tHardcodedUi,
|
|
1353
|
-
// A continuation turn's id names a compaction marker, not a user
|
|
1354
|
-
// message, so it has no response of its own to share.
|
|
1355
|
-
share: turn.continues
|
|
1356
|
-
? undefined
|
|
1357
|
-
: {
|
|
1358
|
-
projectId,
|
|
1359
|
-
sessionId: projectSessionId,
|
|
1360
|
-
turnId: turn.id,
|
|
1361
|
-
} })), _jsx(ConnectProviderDialog, { open: connectProviderOpen, onOpenChange: onConnectProviderOpenChange, providers: providers })] }));
|
|
1364
|
+
props.quietBusy ? (turnErrorRow.isAbort ? null : (_jsx(TurnFailedLine, { projectId: projectId, projectSessionId: projectSessionId, turn: turn, errorText: turnErrorRow.text }))) : (_jsx(TurnErrorDisplay, { errorText: turnErrorRow.text, errorDetails: turnErrorRowDetails, errorRaw: turnErrorRaw, isAbort: turnErrorRow.isAbort, modelOptions: modelOptions }))), turnErrorRow.text && !turnErrorRow.isAbort && !turn.autoRetry?.continued && !!turn.autoRetry?.retries && (_jsx(TurnAutoRetryNote, { count: turn.autoRetry.retries })), !working && !turn.autoRetry?.continued && (stoppedBy || errors.turnErrorIsAbort) && _jsx(TurnStoppedBy, { name: stoppedBy ?? undefined }), !working && _jsx(TurnOutcomes, { turnKey: turn.id }), !working && !props.hideActionBar && hasCopyableResponse(response, answered.inlineContentParts) && (_jsx(TurnActionBar, { response: response, inlineContentParts: answered.inlineContentParts, turnEndedAt: turnEndedAt, turnDurationMs: turnDurationMs, costInfo: costInfo, servedModel: servedModel, tHardcodedUi: tHardcodedUi })), _jsx(ConnectProviderDialog, { open: connectProviderOpen, onOpenChange: onConnectProviderOpenChange, providers: providers })] }));
|
|
1362
1365
|
}
|
|
1363
1366
|
/**
|
|
1364
1367
|
* A failed turn in a messages-only thread: "Something went wrong · Retry".
|
|
@@ -1414,7 +1417,7 @@ function hasCopyableResponse(response, inlineContentParts) {
|
|
|
1414
1417
|
return true;
|
|
1415
1418
|
return !!inlineContentParts?.some((item) => item.type === 'text' && item.block.text.trim());
|
|
1416
1419
|
}
|
|
1417
|
-
function TurnActionBar({ response, inlineContentParts, turnEndedAt, turnDurationMs, costInfo, servedModel, tHardcodedUi, inToolbar = false,
|
|
1420
|
+
function TurnActionBar({ response, inlineContentParts, turnEndedAt, turnDurationMs, costInfo, servedModel, tHardcodedUi, inToolbar = false, }) {
|
|
1418
1421
|
const [copied, setCopied] = useState(false);
|
|
1419
1422
|
// ---- Copy response ----
|
|
1420
1423
|
const handleCopy = async () => {
|
|
@@ -1440,8 +1443,13 @@ function TurnActionBar({ response, inlineContentParts, turnEndedAt, turnDuration
|
|
|
1440
1443
|
// The browser refused the write; `copied` stays false.
|
|
1441
1444
|
}
|
|
1442
1445
|
};
|
|
1443
|
-
return (_jsxs("div", { className: cn('flex items-center gap-0.5',
|
|
1444
|
-
|
|
1446
|
+
return (_jsxs("div", { className: cn('flex items-center gap-0.5',
|
|
1447
|
+
// Under the answer, the first glyph sits on the text's left edge: each
|
|
1448
|
+
// icon is centred in a `size-7` button, so pull the row left by the
|
|
1449
|
+
// glyph's inset, (button − 1.05rem icon) / 2 ≈ 4.5px.
|
|
1450
|
+
!inToolbar && '-ml-[calc((var(--spacing)*7-1.05rem)/2)]', // audit:allow optical alignment: icon inset inside its hit area
|
|
1451
|
+
!inToolbar &&
|
|
1452
|
+
'duration-normal opacity-0 transition-opacity group-hover/turn:opacity-100 focus-within:opacity-100 has-[[data-state=open]]:opacity-100 max-md:opacity-100'), children: [response ? (_jsx(Button, { variant: "ghost", size: "icon-sm", onClick: handleCopy, "aria-label": copied ? 'Copied' : tHardcodedUi.raw('i18nComplete.textf0f755afea88'), className: "hit-area-3", children: _jsx("span", { className: "relative inline-flex shrink-0 items-center justify-center", children: _jsx(AnimatePresence, { initial: false, mode: "popLayout", children: _jsx(m.span, { initial: { scale: 0.25, opacity: 0, filter: 'blur(4px)' }, animate: { scale: 1, opacity: 1, filter: 'blur(0px)' }, exit: { scale: 0.25, opacity: 0, filter: 'blur(4px)' }, transition: { type: 'spring', duration: 0.3, bounce: 0 }, className: "absolute inset-0 inline-flex items-center justify-center", children: copied ? (_jsx(CheckIcon, { className: cn('text-muted-foreground', inToolbar ? 'size-3.5' : 'size-[1.05rem]') })) : (_jsx(Copy, { className: cn('text-muted-foreground', inToolbar ? 'size-3.5' : 'size-[1.05rem]') })) }, copied ? 'check' : 'copy') }) }) })) : null, _jsx(SessionTurnMeta, { endedAt: turnEndedAt, durationMs: turnDurationMs, cost: costInfo, served: servedModel,
|
|
1445
1453
|
// `icon-sm`, the same as the copy button beside it; in a row's
|
|
1446
1454
|
// toolbar its dots match the 14px icons of the toolbar.
|
|
1447
1455
|
className: cn('flex items-center justify-center', inToolbar && '[&_svg]:size-4!') })] }));
|
|
@@ -1469,7 +1477,7 @@ function SessionTurnImpl(props) {
|
|
|
1469
1477
|
// as every `panelMode` read site).
|
|
1470
1478
|
const conversationDensity = useUserPreferencesStore((s) => s.preferences.conversationDensity ?? 'normal');
|
|
1471
1479
|
const model = useTurnModelState({ turn, isWorkingTurn, sessionWorking, awaitingUser });
|
|
1472
|
-
const queueTone = useTurnQueueTone({ pending, pendingPrompt, interruptedBeforeRun });
|
|
1480
|
+
const queueTone = useTurnQueueTone({ pending, pendingPrompt, interruptedBeforeRun, sessionId, projectSessionId: props.projectSessionId });
|
|
1473
1481
|
const errors = useTurnErrorState({ turn, turnOutcome });
|
|
1474
1482
|
const answered = useAnsweredQuestionState({ turn, questions, sessionId, blocks: model.blocks, hasSteps: model.hasSteps });
|
|
1475
1483
|
const userContent = useTurnUserContent({ turn, commandMessages, commands });
|
|
@@ -1611,9 +1619,7 @@ function SessionTurnImpl(props) {
|
|
|
1611
1619
|
// A space's thread keys the colour on the user id, as the space's timeline does.
|
|
1612
1620
|
colorKey: userAuthor?.kind === 'person' ? userAuthor.userId : null, size: "lg" })), 'avatar'), name: wrap(userAuthor, sender ?? (spacePost ? userContent.peerMessage.from : personName || rows.unknownAuthor)), time: rowTime(userAt, locale), children: messagesOnly && spacePost ? (
|
|
1613
1621
|
// The agent's post as its own words, without the "Message from" frame.
|
|
1614
|
-
_jsx("p", { className: cn(MESSAGE_TEXT_CLASS, 'text-pretty whitespace-pre-wrap wrap-anywhere'), children: userContent.peerMessage.text })) : messagesOnly ? (_jsx(TurnUserBubble, { ...props, queueTone: queueTone, userContent: userContent })) : (_jsx(TurnUserBlock, { ...props, model: model, queueTone: queueTone, userContent: userContent })) })) : null, props.isFirstTurn ? afterFirstPrompt : null, showAnswer ? (_jsx(MessageRow, { className: "group/turn", avatar: wrap(agentAuthor, _jsx(AgentMark, { slug: rows.agentSlug ?? DEFAULT_AGENT_SLUG, size: 28, tile: 36, label: rows.agent }), 'avatar'), name: wrap(agentAuthor, rows.agent), time: rowTime(answerAt, locale), toolbar: model.working ? null : (_jsx(TurnActionBar, { inToolbar: true, response: model.response, inlineContentParts: answered.inlineContentParts, turnEndedAt: meta.turnEndedAt, turnDurationMs: meta.turnDurationMs, costInfo: meta.costInfo, servedModel: props.servedModel, tHardcodedUi: tHardcodedUi,
|
|
1615
|
-
? undefined
|
|
1616
|
-
: { projectId: props.projectId, sessionId: props.projectSessionId, turnId: turn.id } })), children: _jsxs("div", { className: "mt-0.5 space-y-2.5", children: [messagesOnly ? null : _jsx(TurnFallbackRows, { working: model.working, events: props.servedModel?.fallbacks }), _jsxs(GenuiTelemetryContext.Provider, { value: genuiTelemetry, children: [messagesOnly && !model.hasSteps && shownSegments.every((segment) => segment.kind === 'text') ? null : (_jsx(TurnToolBlocks, { ...props, model: model, segments: shownSegments, conversationDensity: conversationDensity,
|
|
1622
|
+
_jsx("p", { className: cn(MESSAGE_TEXT_CLASS, 'text-pretty whitespace-pre-wrap wrap-anywhere'), children: userContent.peerMessage.text })) : messagesOnly ? (_jsx(TurnUserBubble, { ...props, queueTone: queueTone, userContent: userContent })) : (_jsx(TurnUserBlock, { ...props, model: model, queueTone: queueTone, userContent: userContent })) })) : null, props.isFirstTurn ? afterFirstPrompt : null, showAnswer ? (_jsx(MessageRow, { className: "group/turn", avatar: wrap(agentAuthor, _jsx(AgentMark, { slug: rows.agentSlug ?? DEFAULT_AGENT_SLUG, size: 28, tile: 36, label: rows.agent }), 'avatar'), name: wrap(agentAuthor, rows.agent), time: rowTime(answerAt, locale), toolbar: model.working ? null : (_jsx(TurnActionBar, { inToolbar: true, response: model.response, inlineContentParts: answered.inlineContentParts, turnEndedAt: meta.turnEndedAt, turnDurationMs: meta.turnDurationMs, costInfo: meta.costInfo, servedModel: props.servedModel, tHardcodedUi: tHardcodedUi })), children: _jsxs("div", { className: "mt-0.5 space-y-2.5", children: [messagesOnly ? null : _jsx(TurnFallbackRows, { working: model.working, events: props.servedModel?.fallbacks }), _jsxs(GenuiTelemetryContext.Provider, { value: genuiTelemetry, children: [messagesOnly && !model.hasSteps && shownSegments.every((segment) => segment.kind === 'text') ? null : (_jsx(TurnToolBlocks, { ...props, model: model, segments: shownSegments, conversationDensity: conversationDensity,
|
|
1617
1623
|
// The segments are already the message's: nothing is left to fold.
|
|
1618
1624
|
fold: !messagesOnly && !answered.shouldUseInlineContent, durationMs: meta.turnDurationMs })), _jsx(TurnAssistantBlock, { ...props, model: model, answered: answered, userContent: userContent, tHardcodedUi: tHardcodedUi })] }), messagesOnly && !model.working && errors.turnErrorIsAbort && model.response.trim() === '' && shownSegments.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: tTurnRows('stopped') })) : null, _jsx(TurnFooter, { ...props, hideActionBar: true, quietBusy: messagesOnly, model: model, errors: errors, answered: answered, status: status, retry: retry, meta: meta, tHardcodedUi: tHardcodedUi, connectProviderOpen: connectProviderOpen, onConnectProviderOpenChange: setConnectProviderOpen }), messagesOnly && !model.working ? (_jsx(TurnMessageWork, { ...props, model: model, segments: segments, shown: shownSegments, userContent: userContent, conversationDensity: conversationDensity, front: rows.front === true })) : null] }) })) : null] }));
|
|
1619
1625
|
}
|
|
@@ -3,8 +3,8 @@ export declare function useElapsedLabel(sinceIso: string | null | undefined, for
|
|
|
3
3
|
/**
|
|
4
4
|
* The agent's busy line in a messages-only thread (`TranscriptRows.messagesOnly`):
|
|
5
5
|
* three dots that pulse one after another under the agent's name, the way a
|
|
6
|
-
* person's chat reads; "Kortix is typing…" is only its accessible label. It never names a tool or a step. Opacity only
|
|
7
|
-
*
|
|
6
|
+
* person's chat reads; "Kortix is typing…" is only its accessible label. It never names a tool or a step. Opacity only
|
|
7
|
+
* (`kortix-brand` motion.md); the "Reduce motion" switch holds the dots still.
|
|
8
8
|
* The offset between dots is a loader's wave, not an entrance stagger: it
|
|
9
9
|
* delays no content, and the three dots read as one moving thing.
|
|
10
10
|
*/
|
|
@@ -4,6 +4,7 @@ import { m } from 'motion/react';
|
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
5
|
import { useTranslations } from '../../i18n/index.js';
|
|
6
6
|
import { cn } from '../../lib/utils.js';
|
|
7
|
+
import { useReduceMotionActive } from '../../internal/hooks/use-reduced-motion.js';
|
|
7
8
|
/** The clock of a wait since `sinceIso` ("0:42"), ticking each second; null without a start. */
|
|
8
9
|
export function useElapsedLabel(sinceIso, format) {
|
|
9
10
|
const since = sinceIso ? Date.parse(sinceIso) : NaN;
|
|
@@ -22,13 +23,17 @@ const DOTS = [0, 1, 2];
|
|
|
22
23
|
/**
|
|
23
24
|
* The agent's busy line in a messages-only thread (`TranscriptRows.messagesOnly`):
|
|
24
25
|
* three dots that pulse one after another under the agent's name, the way a
|
|
25
|
-
* person's chat reads; "Kortix is typing…" is only its accessible label. It never names a tool or a step. Opacity only
|
|
26
|
-
*
|
|
26
|
+
* person's chat reads; "Kortix is typing…" is only its accessible label. It never names a tool or a step. Opacity only
|
|
27
|
+
* (`kortix-brand` motion.md); the "Reduce motion" switch holds the dots still.
|
|
27
28
|
* The offset between dots is a loader's wave, not an entrance stagger: it
|
|
28
29
|
* delays no content, and the three dots read as one moving thing.
|
|
29
30
|
*/
|
|
30
31
|
export function TypingIndicator({ name, className, detail, detailDelayMs = 0, }) {
|
|
31
32
|
const t = useTranslations('sessionUi.turn');
|
|
33
|
+
// An infinite Motion loop already running ignores `skipAnimations`, so the
|
|
34
|
+
// "Reduce motion" switch stops the dots here, held at a mid opacity. The OS
|
|
35
|
+
// setting alone keeps the pulse: it is opacity only (`kortix-brand` motion.md).
|
|
36
|
+
const reduceMotion = useReduceMotionActive();
|
|
32
37
|
const label = t('typing', { name });
|
|
33
38
|
const [late, setLate] = useState(detailDelayMs <= 0);
|
|
34
39
|
useEffect(() => {
|
|
@@ -40,7 +45,9 @@ export function TypingIndicator({ name, className, detail, detailDelayMs = 0, })
|
|
|
40
45
|
const shownDetail = detail && late ? detail : null;
|
|
41
46
|
return (
|
|
42
47
|
// Three dots under the name the row already shows: the label is for screen readers only.
|
|
43
|
-
_jsxs("div", { role: "status", "aria-live": "polite", "aria-label": label, "data-testid": "typing-indicator", className: cn('flex h-6 items-center', className), children: [_jsx("span", { "aria-hidden": true, className: "flex items-center gap-1", children: DOTS.map((dot) => (_jsx(m.span, { className: "bg-muted-foreground size-1 rounded-full", initial: { opacity: 0.3 }, animate: { opacity:
|
|
48
|
+
_jsxs("div", { role: "status", "aria-live": "polite", "aria-label": label, "data-testid": "typing-indicator", className: cn('flex h-6 items-center', className), children: [_jsx("span", { "aria-hidden": true, className: "flex items-center gap-1", children: DOTS.map((dot) => (_jsx(m.span, { className: "bg-muted-foreground size-1 rounded-full", initial: { opacity: 0.3 }, animate: reduceMotion ? { opacity: 0.6 } : { opacity: [0.3, 1, 0.3] }, transition: reduceMotion
|
|
49
|
+
? { duration: 0 }
|
|
50
|
+
: { duration: DOT_CYCLE_S, repeat: Infinity, ease: 'easeInOut', delay: (dot * DOT_CYCLE_S) / 3 } }, dot))) }), shownDetail ? (
|
|
44
51
|
// Plain text, no motion: it changes once a second while the clock runs.
|
|
45
52
|
_jsx("span", { className: "text-muted-foreground ml-2 text-xs tabular-nums", children: shownDetail })) : null] }));
|
|
46
53
|
}
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Button } from '../../primitives/button.js';
|
|
4
4
|
import { STATUS_TEXT } from '../../primitives/status.js';
|
|
5
5
|
import { QuestionPrompt } from '../prompts/question-prompt.js';
|
|
6
|
+
import { SessionConnectCard } from '../prompts/session-connect-card.js';
|
|
6
7
|
import { GenericTool } from './generic-tool.js';
|
|
7
8
|
import { BasicTool, BoundActivateContext, partOutcome, StalePendingContext, ToolActivateContext, ToolDurationContext, ToolNavigationContext, ToolOutcomeContext, ToolRunningContext, ToolSurfaceContext, TurnLiveContext, } from './shared/infrastructure.js';
|
|
8
9
|
import { ToolRegistry } from './shared/registry.js';
|
|
@@ -14,7 +15,7 @@ import { partError, partMetadata, partStreamingInput } from './shared/infrastruc
|
|
|
14
15
|
import { kortixCardTool, parseKortixToolResult } from './tools/kortix-tool-card.js';
|
|
15
16
|
import { isWorkflowTool, parseWorkflowRun } from './tools/workflow-run.js';
|
|
16
17
|
import { PERMISSION_LABELS, getChildSessionId, shouldShowToolPart, } from '../../internal/session-types/index.js';
|
|
17
|
-
import { sessionLogCallStatus, sessionLogOpenCall, toolKind } from '@kortix/sdk';
|
|
18
|
+
import { sessionLogCallStatus, sessionLogOpenCall, toolCallConnectorSignIns, toolKind, } from '@kortix/sdk';
|
|
18
19
|
import { useTranslations } from '../../i18n/index.js';
|
|
19
20
|
import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
20
21
|
function PermissionPromptInline({ permission, onReply }) {
|
|
@@ -70,6 +71,10 @@ function ToolPartRendererImpl({ call: given, sessionId, permission, question, on
|
|
|
70
71
|
// tool that threw as far as the reader is concerned, so it must look
|
|
71
72
|
// identical on the row too.
|
|
72
73
|
const outcome = useMemo(() => partOutcome(call), [call]);
|
|
74
|
+
// The connector sign-ins this call started (`kortix connectors connect`, the
|
|
75
|
+
// `kortix_connectors` tool): their Connect card draws under the row. A call
|
|
76
|
+
// that failed (an error, a shell exit other than 0) started none.
|
|
77
|
+
const signIns = useMemo(() => toolCallConnectorSignIns(call), [call]);
|
|
73
78
|
// The SDK's verdict on tools that never render (a todo read, context bookkeeping).
|
|
74
79
|
if (!shouldShowToolPart(call))
|
|
75
80
|
return null;
|
|
@@ -143,7 +148,7 @@ function ToolPartRendererImpl({ call: given, sessionId, permission, question, on
|
|
|
143
148
|
// whole class of call permanently closed and unopenable on the panel — the
|
|
144
149
|
// one surface where a single call IS the view.
|
|
145
150
|
_jsx(GenericTool, { call: call, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: isLocked }));
|
|
146
|
-
return (_jsx(ToolNavigationContext.Provider, { value: !disableNavigation, children: _jsx(ToolRunningContext.Provider, { value: isRunning, children: _jsx(ToolOutcomeContext.Provider, { value: outcome, children: _jsx(ToolDurationContext.Provider, { value: toolDurationMs, children: _jsx(StalePendingContext.Provider, { value: isStalePending, children: _jsx(BoundActivateContext.Provider, { value: boundActivate, children: _jsxs("div", { className: cn('relative', fillsPanel && 'h-full'), children: [toolElement, permission && onPermissionReply && (_jsx("div", { className: "mt-1.5", children: _jsx(PermissionPromptInline, { permission: permission, onReply: onPermissionReply }) })), question && onQuestionReply && onQuestionReject && (_jsx("div", { className: "mt-1.5", children: _jsx(QuestionPrompt, { request: question, onReply: onQuestionReply, onReject: onQuestionReject }) }))] }) }) }) }) }) }) }));
|
|
151
|
+
return (_jsx(ToolNavigationContext.Provider, { value: !disableNavigation, children: _jsx(ToolRunningContext.Provider, { value: isRunning, children: _jsx(ToolOutcomeContext.Provider, { value: outcome, children: _jsx(ToolDurationContext.Provider, { value: toolDurationMs, children: _jsx(StalePendingContext.Provider, { value: isStalePending, children: _jsx(BoundActivateContext.Provider, { value: boundActivate, children: _jsxs("div", { className: cn('relative', fillsPanel && 'h-full'), children: [toolElement, signIns.length > 0 && _jsx(SessionConnectCard, { calls: signIns, className: "mt-1.5" }), permission && onPermissionReply && (_jsx("div", { className: "mt-1.5", children: _jsx(PermissionPromptInline, { permission: permission, onReply: onPermissionReply }) })), question && onQuestionReply && onQuestionReject && (_jsx("div", { className: "mt-1.5", children: _jsx(QuestionPrompt, { request: question, onReply: onQuestionReply, onReject: onQuestionReject }) }))] }) }) }) }) }) }) }));
|
|
147
152
|
}
|
|
148
153
|
/**
|
|
149
154
|
* The tools whose rows are an agent's work: they open in place, never in the side panel.
|
|
@@ -15,7 +15,8 @@ import { UiLink } from '../../../providers/ui-provider.js';
|
|
|
15
15
|
import { ArrowRightIcon, ArrowSquareOutIcon, CalendarDotsIcon, CaretRightIcon, ChartBarIcon, ChatsCircleIcon, CheckIcon, GitPullRequestIcon, SunDimIcon, HandPointingIcon, LockKeyIcon, PlugIcon, RobotIcon, UsersIcon, WarningIcon, } from '@phosphor-icons/react';
|
|
16
16
|
import { useContext, useMemo } from 'react';
|
|
17
17
|
import { MULTI_AGENT_ICON, multiAgentBody, PeerSendRow, runningKey } from './multi-agent-tool-bodies.js';
|
|
18
|
-
import { parsePeerSend } from '@kortix/sdk';
|
|
18
|
+
import { parsePeerSend, toolCallConnectorSignIns } from '@kortix/sdk';
|
|
19
|
+
import { useSessionConnectRequests } from '../../prompts/session-connect-card.js';
|
|
19
20
|
import { KORTIX_PLATFORM_TOOLS, isReadAction, kortixCardTool, kortixPlatformTool, multiAgentTool, parseKortixToolResult, } from './kortix-tool-card.js';
|
|
20
21
|
const TOOL_META = {
|
|
21
22
|
kortix_agents: { icon: RobotIcon, object: 'agents' },
|
|
@@ -96,6 +97,10 @@ export function KortixActionTool(props) {
|
|
|
96
97
|
const settled = status === 'completed' || status === 'error';
|
|
97
98
|
const raw = status === 'error' ? (partError(call) ?? '') : partRawOutput(call);
|
|
98
99
|
const result = useMemo(() => (settled ? parseKortixToolResult(raw, call.name) : null), [settled, raw, call.name]);
|
|
100
|
+
// A `connect` in a session that finishes sign-ins: the Connect card under this
|
|
101
|
+
// row (`SessionConnectCard`) is the way in, so the raw provider link is not
|
|
102
|
+
// a second one.
|
|
103
|
+
const connectCardShown = useSessionConnectRequests() !== null && toolCallConnectorSignIns(call).length > 0;
|
|
99
104
|
if (!tool || (settled && !result)) {
|
|
100
105
|
return _jsx(GenericTool, { call: call, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked });
|
|
101
106
|
}
|
|
@@ -107,7 +112,10 @@ export function KortixActionTool(props) {
|
|
|
107
112
|
: tMulti(`running.${runningKey(multi)}`);
|
|
108
113
|
return (_jsx(BasicTool, { icon: icon, trigger: _jsx(CardTrigger, { title: title, live: running }), defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked }));
|
|
109
114
|
}
|
|
110
|
-
const {
|
|
115
|
+
const { error } = result;
|
|
116
|
+
const card = connectCardShown
|
|
117
|
+
? { ...result.card, links: result.card.links.filter((link) => !link.external) }
|
|
118
|
+
: result.card;
|
|
111
119
|
// A message to another agent is one plain row with the receiver's face, sent or not.
|
|
112
120
|
if (multi === 'send_message') {
|
|
113
121
|
const send = parsePeerSend(result.data);
|
|
@@ -8,7 +8,7 @@ import { SubAgentActivity, SubAgentStatusBanner, useSubAgentThread, } from '../s
|
|
|
8
8
|
import { useTranslations } from '../../../i18n/index.js';
|
|
9
9
|
import { cn } from '../../../lib/utils.js';
|
|
10
10
|
import { getChildSessionId, getToolInfo } from '../../../internal/session-types/index.js';
|
|
11
|
-
import {
|
|
11
|
+
import { agentDisplayName } from '../../../_vendor/kortix-shared.js';
|
|
12
12
|
import { CpuIcon as Cpu, ArrowSquareOutIcon as ExternalLink } from '@phosphor-icons/react';
|
|
13
13
|
import { useSessionIds } from '../../../providers/session-ids.js';
|
|
14
14
|
import { useUiLink } from '../../../providers/ui-provider.js';
|
|
@@ -23,8 +23,8 @@ export function SessionSpawnTool({ call, forceOpen }) {
|
|
|
23
23
|
const Link = useUiLink();
|
|
24
24
|
// Tool input is the model's JSON (`unknown` at runtime): read each field by
|
|
25
25
|
// type, so a non-string takes the absent-field fallback instead of throwing
|
|
26
|
-
// in `
|
|
27
|
-
const agentName =
|
|
26
|
+
// in `agentDisplayName` or `split` (KRTX-4511).
|
|
27
|
+
const agentName = agentDisplayName((typeof input.agent === 'string' && input.agent) || 'kortix');
|
|
28
28
|
const description = typeof input.description === 'string' ? input.description : '';
|
|
29
29
|
const projectName = typeof input.project === 'string' ? input.project : '';
|
|
30
30
|
const fullPrompt = typeof input.prompt === 'string' ? input.prompt : '';
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type AgentStopState } from './workflow-progress.js';
|
|
3
3
|
import { type WorkflowRun, type WorkflowRunAgent } from './workflow-run.js';
|
|
4
|
-
|
|
4
|
+
/** A working agent whose session log has not changed for this long reads "Quiet for N min". */
|
|
5
|
+
export declare const QUIET_AFTER_MS: number;
|
|
6
|
+
/** How long a working agent has written nothing, in ms, once that is {@link QUIET_AFTER_MS} or more; else null. */
|
|
7
|
+
export declare function quietForMs(agent: WorkflowRunAgent, now: number): number | null;
|
|
8
|
+
/** The working agents that have been quiet that long: the run header counts them. */
|
|
9
|
+
export declare function quietAgents(agents: readonly WorkflowRunAgent[], now: number): number;
|
|
10
|
+
export declare function WorkflowRunCard({ run, title, subtitle, meta, live, now, actions, chips, result, onOpen, stop, bare, }: {
|
|
5
11
|
run: WorkflowRun;
|
|
6
12
|
title: string;
|
|
7
13
|
subtitle?: string;
|
|
14
|
+
/** Inline after the subtitle, on its line: "· Spent N credits". Never in the actions, which must not squeeze the title. */
|
|
15
|
+
meta?: ReactNode;
|
|
8
16
|
live: boolean;
|
|
9
17
|
now: number;
|
|
18
|
+
/** The header alone, muted: a run that never ran (declined at its approval) has no rows. */
|
|
19
|
+
bare?: boolean;
|
|
10
20
|
/** The header's words on the right: Pause, Stop, Open run. */
|
|
11
21
|
actions?: ReactNode;
|
|
12
22
|
/** Warnings beside the title: "Large workflow", "Resumed". */
|
|
@@ -31,14 +31,29 @@ const ORDER = { failed: 0, running: 1, starting: 2, stopped: 3, done: 4 };
|
|
|
31
31
|
/** A run longer than this lists its first rows and a "Show all". */
|
|
32
32
|
const CAP_FROM = 25;
|
|
33
33
|
const CAP = 20;
|
|
34
|
-
|
|
34
|
+
/** A working agent whose session log has not changed for this long reads "Quiet for N min". */
|
|
35
|
+
export const QUIET_AFTER_MS = 2 * 60_000;
|
|
36
|
+
/** How long a working agent has written nothing, in ms, once that is {@link QUIET_AFTER_MS} or more; else null. */
|
|
37
|
+
export function quietForMs(agent, now) {
|
|
38
|
+
if ((agent.status !== 'running' && agent.status !== 'starting') || agent.quietSince === undefined)
|
|
39
|
+
return null;
|
|
40
|
+
const quiet = now - agent.quietSince;
|
|
41
|
+
return quiet >= QUIET_AFTER_MS ? quiet : null;
|
|
42
|
+
}
|
|
43
|
+
/** The working agents that have been quiet that long: the run header counts them. */
|
|
44
|
+
export function quietAgents(agents, now) {
|
|
45
|
+
return agents.filter((agent) => quietForMs(agent, now) !== null).length;
|
|
46
|
+
}
|
|
47
|
+
export function WorkflowRunCard({ run, title, subtitle, meta, live, now, actions, chips, result, onOpen, stop, bare = false, }) {
|
|
35
48
|
const t = useTranslations('tools.workflow');
|
|
36
49
|
const [showResult, setShowResult] = useState(false);
|
|
37
50
|
const resultId = useId();
|
|
38
51
|
const counts = countAgents(run.agents);
|
|
39
52
|
return (_jsxs("section", { "data-testid": "workflow-card", "aria-label": title,
|
|
40
53
|
// Flush with the reply's text column: the card is the turn's content, not a tool row's body.
|
|
41
|
-
className: "border-border mt-1.5 flex min-w-0 flex-col rounded-lg border text-xs", children: [_jsxs("header", { className:
|
|
54
|
+
className: "border-border mt-1.5 flex min-w-0 flex-col rounded-lg border text-xs", children: [_jsxs("header", { className: cn('border-border flex min-w-0 flex-wrap items-start gap-x-2.5 gap-y-1.5 px-4 py-3', !bare && 'border-b'), children: [_jsx("span", { className: "flex h-5 shrink-0 items-center", children: counts.total > 0 ? (_jsx(RunProgressRing, { size: 16, done: counts.done, failed: counts.failed, total: counts.total, ended: run.status === 'done' ? 'done' : run.status === 'stopped' ? 'stopped' : undefined })) : (_jsx(SessionStatusMark, { status: runGlyphStatus(run.status === 'running' ? 'starting' : run.status) })) }), _jsxs("div", { className: "flex min-w-0 flex-1 basis-64 flex-col gap-0.5", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-1.5", children: [_jsx("h3", { className: cn('min-w-0 truncate text-sm font-medium', bare ? 'text-muted-foreground' : 'text-foreground'), title: title, children: title }), chips] }), (subtitle || meta) && (_jsxs("p", { className: "text-muted-foreground flex min-w-0 items-center tabular-nums", children: [subtitle && (
|
|
55
|
+
// Progress outranks cost: the state keeps its width up to the line, the cost truncates first.
|
|
56
|
+
_jsx("span", { className: "max-w-full shrink-0 truncate", title: subtitle, children: subtitle })), meta] }))] }), (actions || result) && (_jsxs("div", { className: "-my-1 ml-auto flex shrink-0 items-center", children: [actions, result && (_jsxs("button", { type: "button", "aria-expanded": showResult, "aria-controls": resultId, onClick: () => setShowResult((open) => !open), className: "text-foreground hover:bg-muted/60 flex h-7 cursor-pointer items-center gap-1 rounded-md px-2 text-xs", children: [t('result'), _jsx(CaretDownIcon, { "aria-hidden": true, className: cn('size-3 transition-transform duration-(--duration-fast) motion-reduce:transition-none', showResult && 'rotate-180') })] }))] }))] }), result && showResult && (_jsx("div", { id: resultId, className: "border-border max-h-96 overflow-y-auto border-b px-4 py-3 text-sm", children: result })), !bare && _jsx(WorkflowRunRows, { run: run, live: live, now: now, onOpen: onOpen, stop: stop })] }));
|
|
42
57
|
}
|
|
43
58
|
/**
|
|
44
59
|
* A run's agents under their phases. Each phase is one row: its progress ring
|
|
@@ -81,7 +96,8 @@ function PhaseRow({ phase, agents, waits, defaultOpen, live, now, onOpen, stop,
|
|
|
81
96
|
const opens = agents.length > 0;
|
|
82
97
|
const pending = !opens && phase.status === 'pending';
|
|
83
98
|
// A closed phase still says it is at work: "4 running · 1 failed".
|
|
84
|
-
|
|
99
|
+
// An agent queued for a slot or held (`starting`, no session yet) is not running.
|
|
100
|
+
const running = agents.filter((agent) => agent.status === 'running' || (agent.status === 'starting' && !!agent.sessionId)).length;
|
|
85
101
|
const meta = waits ??
|
|
86
102
|
([running > 0 ? t('runningCount', { count: running }) : null, tally.failed > 0 ? t('failedSuffix', { count: tally.failed }) : null]
|
|
87
103
|
.filter(Boolean)
|
|
@@ -142,20 +158,28 @@ function AgentRow({ agent, live, now, onOpen, stop, trunk, }) {
|
|
|
142
158
|
const t = useTranslations('tools.workflow');
|
|
143
159
|
const working = agent.status === 'running' || agent.status === 'starting';
|
|
144
160
|
const elapsed = elapsedMs(agent, live && working, now);
|
|
161
|
+
const quiet = live ? quietForMs(agent, now) : null;
|
|
145
162
|
const state = agent.status === 'failed'
|
|
146
163
|
? t('didntFinish')
|
|
147
164
|
: agent.status === 'starting'
|
|
148
165
|
? t('status.starting')
|
|
149
166
|
: agent.status === 'stopped'
|
|
150
|
-
?
|
|
151
|
-
|
|
167
|
+
? // A person's Stop is their decision, never a failure.
|
|
168
|
+
agent.stoppedBy === 'person'
|
|
169
|
+
? t('stoppedByYou')
|
|
170
|
+
: t('status.stopped')
|
|
171
|
+
: quiet !== null
|
|
172
|
+
? t('quietFor', { minutes: Math.floor(quiet / 60_000) })
|
|
173
|
+
: null;
|
|
174
|
+
// A restart or a stall starts a new attempt in a new session, with its own clock: the row says which one.
|
|
175
|
+
const attempt = (agent.attempt ?? 1) > 1 ? t('attempt', { count: agent.attempt }) : null;
|
|
152
176
|
// Working and finished rows are one line: status, name, time. Only a failure says why.
|
|
153
177
|
const detail = agent.status === 'failed' ? (agent.summary ?? null) : null;
|
|
154
178
|
const canRetry = agent.status === 'failed' && live && !!agent.sessionId && !!stop.restart;
|
|
155
179
|
const retrying = !!agent.sessionId && stop.restart?.pending === agent.sessionId;
|
|
156
180
|
const stopping = !!agent.sessionId && stop.pending.has(agent.sessionId);
|
|
157
181
|
const tm = useTranslations('multiAgent.workflow');
|
|
158
|
-
const body = (_jsxs(_Fragment, { children: [_jsx("span", { className: "flex h-5 shrink-0 items-center", children: _jsx(SessionStatusMark, { status: runGlyphStatus(agent.status) }) }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5 text-left", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2.5", children: [_jsx("span", { className: cn('text-foreground min-w-0 flex-1 truncate text-sm', agent.status !== 'done' && 'font-medium'), title: agent.label, children: agent.label }), state && _jsx("span", { className: "text-muted-foreground shrink-0", children: state }), elapsed !== undefined && agent.status !== 'failed' && (_jsx("span", { className: "text-muted-foreground min-w-9 shrink-0 text-right tabular-nums", children: formatElapsed(elapsed) }))] }), detail && (_jsx("span", { className: "text-muted-foreground min-w-0 whitespace-normal wrap-anywhere", children: detail }))] })] }));
|
|
182
|
+
const body = (_jsxs(_Fragment, { children: [_jsx("span", { className: "flex h-5 shrink-0 items-center", children: _jsx(SessionStatusMark, { status: runGlyphStatus(agent.status) }) }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5 text-left", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2.5", children: [_jsx("span", { className: cn('text-foreground min-w-0 flex-1 truncate text-sm', agent.status !== 'done' && 'font-medium'), title: agent.label, children: agent.label }), attempt && _jsx("span", { className: "text-muted-foreground shrink-0", children: attempt }), state && _jsx("span", { className: "text-muted-foreground shrink-0", children: state }), elapsed !== undefined && agent.status !== 'failed' && (_jsx("span", { className: "text-muted-foreground min-w-9 shrink-0 text-right tabular-nums", children: formatElapsed(elapsed) }))] }), detail && (_jsx("span", { className: "text-muted-foreground min-w-0 whitespace-normal wrap-anywhere", children: detail }))] })] }));
|
|
159
183
|
const rowClass = cn('flex min-h-9 min-w-0 flex-1 items-start gap-2.5 rounded-md px-2.5 py-2', agent.sessionId && 'hover:bg-muted/40');
|
|
160
|
-
return (_jsxs("li", { className: cn('relative flex min-w-0 items-start', trunk && 'pl-3.5'), children: [trunk && _jsx(TrunkLines, { continues: trunk.continues }), agent.sessionId ? (_jsx("button", { type: "button", "data-workflow-row": true, "aria-label": [t('openAgent', { label: agent.label }), state ?? t(`status.${agent.status === 'done' ? 'done' : agent.status === 'running' ? 'running' : 'starting'}`), elapsed !== undefined && agent.status !== 'failed' ? formatElapsed(elapsed) : null].filter(Boolean).join(', '), onClick: () => onOpen(agent), className: cn(rowClass, 'cursor-pointer'), children: body })) : (_jsx("div", { className: rowClass, children: body })), live && working && !!agent.sessionId && stop.enabled && (_jsxs("span", { className: "flex shrink-0 items-center py-1.5", children: [stop.restart && (_jsx(Hint, { label: tm('restartHint'), side: "top", children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", "aria-label": tm('restartAgent', { label: agent.label }), disabled: retrying || stopping, "aria-busy": retrying, onClick: () => stop.restart?.run(agent), className: "text-muted-foreground hover:text-foreground", children: _jsx(ArrowClockwiseIcon, { className: "size-3" }) }) })), _jsx(Hint, { label: t('stopHint'), side: "top", children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", "aria-label": t('stopAgent', { label: agent.label }), disabled: stopping, "aria-busy": stopping, onClick: () => stop.stop(agent), className: "text-muted-foreground hover:text-foreground", children: _jsx(SquareIcon, { weight: "fill", className: "size-2.5" }) }) })] })), canRetry && (_jsx("button", { type: "button", "aria-label": t('retryAgent', { label: agent.label }), disabled: retrying, onClick: () => stop.restart?.run(agent), className: "text-foreground hover:bg-muted/60 my-1 flex h-7 shrink-0 cursor-pointer items-center rounded-md px-2 disabled:opacity-50", children: t('retryNow') }))] }));
|
|
184
|
+
return (_jsxs("li", { className: cn('relative flex min-w-0 items-start', trunk && 'pl-3.5'), children: [trunk && _jsx(TrunkLines, { continues: trunk.continues }), agent.sessionId ? (_jsx("button", { type: "button", "data-workflow-row": true, "aria-label": [t('openAgent', { label: agent.label }), state ?? t(`status.${agent.status === 'done' ? 'done' : agent.status === 'running' ? 'running' : 'starting'}`), attempt, elapsed !== undefined && agent.status !== 'failed' ? formatElapsed(elapsed) : null].filter(Boolean).join(', '), onClick: () => onOpen(agent), className: cn(rowClass, 'cursor-pointer'), children: body })) : (_jsx("div", { className: rowClass, children: body })), live && working && !!agent.sessionId && stop.enabled && (_jsxs("span", { className: "flex shrink-0 items-center py-1.5", children: [stop.restart && (_jsx(Hint, { label: tm('restartHint'), side: "top", children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", "aria-label": tm('restartAgent', { label: agent.label }), disabled: retrying || stopping, "aria-busy": retrying, onClick: () => stop.restart?.run(agent), className: "text-muted-foreground hover:text-foreground", children: _jsx(ArrowClockwiseIcon, { className: "size-3" }) }) })), _jsx(Hint, { label: t('stopHint'), side: "top", children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", "aria-label": t('stopAgent', { label: agent.label }), disabled: stopping, "aria-busy": stopping, onClick: () => stop.stop(agent), className: "text-muted-foreground hover:text-foreground", children: _jsx(SquareIcon, { weight: "fill", className: "size-2.5" }) }) })] })), canRetry && (_jsx("button", { type: "button", "aria-label": t('retryAgent', { label: agent.label }), disabled: retrying, onClick: () => stop.restart?.run(agent), className: "text-foreground hover:bg-muted/60 my-1 flex h-7 shrink-0 cursor-pointer items-center rounded-md px-2 disabled:opacity-50", children: t('retryNow') }))] }));
|
|
161
185
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SessionUsage } from '@kortix/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* What a workflow run cost so far, in USD, from the session usage tree
|
|
4
|
+
* (`GET …/sessions/:id/usage`): model calls and box time that Kortix billed.
|
|
5
|
+
*
|
|
6
|
+
* - A background run: its runner session and every agent session under it
|
|
7
|
+
* (`total`), which is the whole run.
|
|
8
|
+
* - A run in the calling session: only its agents' sessions and their
|
|
9
|
+
* descendants. The caller's own turns are not part of the run.
|
|
10
|
+
*
|
|
11
|
+
* Own-key (BYOK) model spend is not in it: Kortix did not bill it. Exported for tests.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runSpentUsd(usage: Pick<SessionUsage, 'total' | 'sessions'>, agentSessionIds?: readonly string[]): number;
|
|
14
|
+
/**
|
|
15
|
+
* "Spent N credits" for a workflow run card: the actual spend, never an
|
|
16
|
+
* estimate. Renders nothing until the read answers, and nothing for a run that
|
|
17
|
+
* has cost nothing yet. Refreshed every 30 s while the run works, and twice as
|
|
18
|
+
* it ends (at once, then 10 s later), so the final number is the final spend.
|
|
19
|
+
* Inline text for the card's status line: `separated` puts a " · " before it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function WorkflowRunCost({ projectId, rootSessionId, agentSessionIds, live, separated, }: {
|
|
22
|
+
projectId: string | undefined;
|
|
23
|
+
/** The runner of a background run, else the session that called `workflow`. */
|
|
24
|
+
rootSessionId: string | undefined;
|
|
25
|
+
/** A run in the calling session: its agents' session ids. Omit for a background run. */
|
|
26
|
+
agentSessionIds?: readonly string[];
|
|
27
|
+
live: boolean;
|
|
28
|
+
separated?: boolean;
|
|
29
|
+
}): import("react").JSX.Element | null;
|