@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
|
@@ -14,7 +14,7 @@ import { cn } from '../../lib/utils.js';
|
|
|
14
14
|
import { AgentStateMark } from './agent-state-mark.js';
|
|
15
15
|
import { SubagentDialog } from './subagent-view.js';
|
|
16
16
|
import { ArrowUpRightIcon, CaretUpIcon, SquareIcon } from '@phosphor-icons/react';
|
|
17
|
-
import { useMemo, useState } from 'react';
|
|
17
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
18
18
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
19
19
|
import { stopProjectSession } from '@kortix/sdk';
|
|
20
20
|
import { qk, useFeatureFlag, useNow, useSessionChildren, useSessionWorkflows, useTeamTasks, useTeammates, } from '@kortix/sdk/react';
|
|
@@ -23,7 +23,7 @@ import { RunProgressRing } from '../tool/tools/workflow-progress.js';
|
|
|
23
23
|
import { WorkflowRunRows } from '../tool/tools/workflow-run-card.js';
|
|
24
24
|
import { isActive, lineSummary, shortElapsed, stripGroups, } from './agent-model.js';
|
|
25
25
|
import { TasksPanel } from './tasks-panel.js';
|
|
26
|
-
import { isLargeRun, LargeRunBadge, useLiveWorkflowRun, useRestartAgent, WorkflowRunControls, } from './workflow-run-controls.js';
|
|
26
|
+
import { isLargeRun, LargeRunBadge, useLiveWorkflowRun, useRestartAgent, useStopAgent, WorkflowRunControls, } from './workflow-run-controls.js';
|
|
27
27
|
/**
|
|
28
28
|
* The agents line: one muted control in the composer's under-row, right of the
|
|
29
29
|
* agent picker (Claude Code's agent panel, folded to one line).
|
|
@@ -37,8 +37,10 @@ import { isLargeRun, LargeRunBadge, useLiveWorkflowRun, useRestartAgent, Workflo
|
|
|
37
37
|
* started nothing, and it never holds the composer: the agents run in their own
|
|
38
38
|
* sessions, and the person keeps talking to this one.
|
|
39
39
|
*/
|
|
40
|
-
/** How often the child list polls while the
|
|
40
|
+
/** How often the child list polls while the session works. */
|
|
41
41
|
const CHILDREN_POLL_MS = 5_000;
|
|
42
|
+
/** An idle session starts no agent: its children poll every 30 s. */
|
|
43
|
+
const IDLE_CHILDREN_POLL_MS = 30_000;
|
|
42
44
|
/** A finished workflow run stays listed this long after it ended. */
|
|
43
45
|
const RECENT_RUN_MS = 60 * 60_000;
|
|
44
46
|
/** The popover lists at most this many runs. */
|
|
@@ -169,9 +171,10 @@ function WorkflowLineRow({ projectId, sessionId, run: listed, onOpen, }) {
|
|
|
169
171
|
const { run, controlSessionId } = useLiveWorkflowRun(projectId, sessionId, listed);
|
|
170
172
|
const now = useNow(1_000, open && run?.status === 'running');
|
|
171
173
|
const restart = useRestartAgent(projectId, controlSessionId, run);
|
|
174
|
+
const stopWorkflowAgent = useStopAgent(projectId, controlSessionId, run);
|
|
172
175
|
const queryClient = useQueryClient();
|
|
173
176
|
const stopAgent = useMutation({
|
|
174
|
-
mutationFn: (agent) =>
|
|
177
|
+
mutationFn: (agent) => stopWorkflowAgent(agent),
|
|
175
178
|
onSuccess: () => projectId && queryClient.invalidateQueries({ queryKey: qk.project.sessionsScope(projectId) }),
|
|
176
179
|
onError: (error) => errorToast(t('stopFailed'), { description: error instanceof Error ? error.message : undefined }),
|
|
177
180
|
});
|
|
@@ -180,7 +183,7 @@ function WorkflowLineRow({ projectId, sessionId, run: listed, onOpen, }) {
|
|
|
180
183
|
const counts = countAgents(run.agents);
|
|
181
184
|
const progress = counts.total > 0 ? t('runProgress', { done: counts.done, total: counts.total }) : undefined;
|
|
182
185
|
const line = (run.status === 'running'
|
|
183
|
-
? [run.paused ? tw('
|
|
186
|
+
? [run.paused ? tw('holding') : run.background ? t('runBackground') : t('runRunning'), progress]
|
|
184
187
|
: [progress])
|
|
185
188
|
.filter(Boolean)
|
|
186
189
|
.join(' · ');
|
|
@@ -195,23 +198,50 @@ function WorkflowLineRow({ projectId, sessionId, run: listed, onOpen, }) {
|
|
|
195
198
|
return (_jsxs("li", { "data-testid": "agents-line-row", "data-workflow-run": run.runId, children: [_jsxs("div", { className: "group/row hover:bg-hover focus-within:bg-hover flex min-w-0 items-center gap-1 rounded-sm", children: [_jsxs("button", { type: "button", "aria-expanded": open, onClick: () => setOpen((value) => !value), className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 py-1.5 pl-2 text-left text-xs outline-none", children: [_jsx(RunProgressRing, { done: counts.done, failed: counts.failed, total: Math.max(counts.total, 1), ended: run.status === 'done' ? 'done' : run.status === 'stopped' ? 'stopped' : undefined }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex min-w-0 items-baseline gap-2", children: [_jsx("span", { className: "text-foreground min-w-0 truncate font-medium", title: title, children: title }), _jsx("span", { className: "text-muted-foreground shrink-0", children: t(`state.${RUN_STATE[run.status]}`) })] }), line && _jsx("p", { className: "text-muted-foreground truncate tabular-nums", children: line })] })] }), isLargeRun(run) && _jsx(LargeRunBadge, {}), _jsxs("div", { className: cn(ROW_ACTIONS, 'pr-1'), children: [run.background && (_jsx(Hint, { label: t('openRun'), side: "top", children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", "aria-label": t('openRun'), onClick: () => onOpen({ sessionId: run.background.sessionId, title }), className: "text-muted-foreground hover:text-foreground", children: _jsx(ArrowUpRightIcon, { className: "size-3.5 shrink-0" }) }) })), _jsx(WorkflowRunControls, { projectId: projectId, controlSessionId: live ? controlSessionId : undefined, ownerSessionId: sessionId, run: run })] })] }), open && run.agents.length > 0 && (_jsx("div", { className: "pl-5", children: _jsx(WorkflowRunRows, { run: run, live: live, now: now, onOpen: (agent) => agent.sessionId && onOpen({ sessionId: agent.sessionId, title: agent.label }), stop: stop }) })), open && run.agents.length === 0 && (_jsx(Badge, { variant: "muted", size: "sm", className: "ml-7", children: t('runNoAgents') }))] }));
|
|
196
199
|
}
|
|
197
200
|
/**
|
|
198
|
-
* The agents of one session, read live: its children
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
+
* The agents of one session, read live: its children, its teammates and team
|
|
202
|
+
* tasks (flag `agent_teams`) and its workflow runs; and the stop of one agent.
|
|
203
|
+
* The lists poll every 5 s while the session works (`live`) and every 30 s
|
|
204
|
+
* while it is idle.
|
|
201
205
|
*/
|
|
202
|
-
export function useAgentsLine(projectId, sessionId) {
|
|
206
|
+
export function useAgentsLine(projectId, sessionId, { live = false } = {}) {
|
|
203
207
|
const t = useTranslations('multiAgent.strip');
|
|
204
208
|
const pid = projectId ?? '';
|
|
205
209
|
const sid = sessionId ?? '';
|
|
206
210
|
const ready = !!projectId && !!sessionId;
|
|
207
211
|
const teams = useFeatureFlag(projectId, 'agent_teams').enabled;
|
|
208
|
-
|
|
212
|
+
// A child or teammate can keep working after the lead's turn ends: the lists
|
|
213
|
+
// stay at 5 s while any of them works.
|
|
214
|
+
const [agentsActive, setAgentsActive] = useState(false);
|
|
215
|
+
const fast = live || agentsActive;
|
|
216
|
+
const childList = useSessionChildren(pid, sid, {
|
|
217
|
+
enabled: ready,
|
|
218
|
+
refetchInterval: fast ? CHILDREN_POLL_MS : IDLE_CHILDREN_POLL_MS,
|
|
219
|
+
limit: 50,
|
|
220
|
+
});
|
|
209
221
|
const children = childList.sessions;
|
|
210
|
-
const { data: teammates, dataUpdatedAt: teammatesAt } = useTeammates(projectId, sessionId, {
|
|
211
|
-
|
|
212
|
-
|
|
222
|
+
const { data: teammates, dataUpdatedAt: teammatesAt } = useTeammates(projectId, sessionId, {
|
|
223
|
+
enabled: ready && teams,
|
|
224
|
+
live: fast,
|
|
225
|
+
});
|
|
226
|
+
const { data: tasks } = useTeamTasks(projectId, sessionId, { enabled: ready && teams, live: fast });
|
|
227
|
+
const { data: runData, dataUpdatedAt: runsAt } = useSessionWorkflows(projectId, sessionId, { enabled: ready, live: fast });
|
|
213
228
|
const [stopping, setStopping] = useState(() => new Set());
|
|
214
229
|
const queryClient = useQueryClient();
|
|
230
|
+
// A turn that ends may have started an agent or a run in its last seconds:
|
|
231
|
+
// read the lists once now instead of waiting for the next idle poll.
|
|
232
|
+
const wasLive = useRef(live);
|
|
233
|
+
useEffect(() => {
|
|
234
|
+
if (wasLive.current && !live && ready) {
|
|
235
|
+
void queryClient.invalidateQueries({ queryKey: qk.project.sessionChildren(pid, sid) });
|
|
236
|
+
void queryClient.invalidateQueries({ queryKey: qk.project.sessionAgents(pid, sid) });
|
|
237
|
+
// Each child's own row (the colleague row in the chat reads it): exact, so
|
|
238
|
+
// its multi-agent reads nested under the same key are not refetched too.
|
|
239
|
+
for (const child of children) {
|
|
240
|
+
void queryClient.invalidateQueries({ queryKey: qk.project.session(pid, child.session_id), exact: true });
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
wasLive.current = live;
|
|
244
|
+
}, [live, ready, pid, sid, queryClient, children]);
|
|
215
245
|
const stopMutation = useMutation({
|
|
216
246
|
mutationFn: (row) => stopProjectSession(pid, row.sessionId),
|
|
217
247
|
onSettled: (_data, _error, row) => {
|
|
@@ -234,6 +264,10 @@ export function useAgentsLine(projectId, sessionId) {
|
|
|
234
264
|
exclude: runSessionIds(runs),
|
|
235
265
|
now,
|
|
236
266
|
}), [sid, children, teammates, runs, now]);
|
|
267
|
+
const anyActive = [...groups.agents, ...groups.team].some((row) => row.state === 'working');
|
|
268
|
+
// Adjusted during render (React's derived-state pattern): the lists read it next render.
|
|
269
|
+
if (anyActive !== agentsActive)
|
|
270
|
+
setAgentsActive(anyActive);
|
|
237
271
|
const leadsTeam = teams && ((teammates?.length ?? 0) > 0 || (tasks?.length ?? 0) > 0);
|
|
238
272
|
return {
|
|
239
273
|
ready,
|
|
@@ -253,8 +287,8 @@ export function useAgentsLine(projectId, sessionId) {
|
|
|
253
287
|
* (`SessionChatInputProps.underbarSlot`). Nothing renders while the session
|
|
254
288
|
* started no agent and no workflow run.
|
|
255
289
|
*/
|
|
256
|
-
export function AgentsLine({ projectId, sessionId, compact = false, }) {
|
|
257
|
-
const line = useAgentsLine(projectId, sessionId);
|
|
290
|
+
export function AgentsLine({ projectId, sessionId, compact = false, live = false, }) {
|
|
291
|
+
const line = useAgentsLine(projectId, sessionId, { live });
|
|
258
292
|
const [open, setOpen] = useState(null);
|
|
259
293
|
if (!line.ready)
|
|
260
294
|
return null;
|
|
@@ -21,9 +21,13 @@ export declare function HeldMessageList({ messages, approve, deny, }: {
|
|
|
21
21
|
approve: PeerMessagesQuery['approve'];
|
|
22
22
|
deny: PeerMessagesQuery['deny'];
|
|
23
23
|
}): import("react").JSX.Element | null;
|
|
24
|
-
/**
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* A session's held messages, read on their own (for a host without the agent
|
|
26
|
+
* strip). They poll every 5 s while the session works (`live`), every 30 s idle.
|
|
27
|
+
*/
|
|
28
|
+
export declare function HeldMessages({ projectId, sessionId, live, }: {
|
|
26
29
|
projectId: string | undefined;
|
|
27
30
|
sessionId: string | undefined;
|
|
31
|
+
live?: boolean;
|
|
28
32
|
}): import("react").JSX.Element;
|
|
29
33
|
export {};
|
|
@@ -26,8 +26,11 @@ export function HeldMessageList({ messages, approve, deny, }) {
|
|
|
26
26
|
const fail = (key) => (error) => errorToast(t(key), { description: error instanceof Error ? error.message : undefined });
|
|
27
27
|
return (_jsx("div", { "aria-label": t('label'), role: "group", className: "space-y-1.5", children: held.map((message) => (_jsx(HeldMessageCard, { message: message, pending: pendingFor(message.id), onApprove: () => approve.mutate(message.id, { onError: fail('approveFailed') }), onDeny: () => deny.mutate(message.id, { onError: fail('denyFailed') }) }, message.id))) }));
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
/**
|
|
30
|
+
* A session's held messages, read on their own (for a host without the agent
|
|
31
|
+
* strip). They poll every 5 s while the session works (`live`), every 30 s idle.
|
|
32
|
+
*/
|
|
33
|
+
export function HeldMessages({ projectId, sessionId, live = false, }) {
|
|
34
|
+
const { data, approve, deny } = usePeerMessages(projectId, sessionId, 'in', { live });
|
|
32
35
|
return _jsx(HeldMessageList, { messages: data, approve: approve, deny: deny });
|
|
33
36
|
}
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import { type WorkflowRun, type WorkflowRunAgent } from '../tool/tools/workflow-run.js';
|
|
2
2
|
/**
|
|
3
3
|
* One workflow run's controls, for the run card in the chat and the strip's
|
|
4
|
-
* "Workflows" group: Claude Code's `/workflows` keys as buttons.
|
|
5
|
-
* resume (`p`), stop the run (`x`), save its script as a workflow
|
|
6
|
-
* per agent row, restart (`r`). Every control goes to the box that
|
|
7
|
-
* run: the session that called `workflow`, or a background run's
|
|
4
|
+
* "Workflows" group: Claude Code's `/workflows` keys as buttons. Hold new
|
|
5
|
+
* agents or resume (`p`), stop the run (`x`), save its script as a workflow
|
|
6
|
+
* (`s`), and, per agent row, restart (`r`). Every control goes to the box that
|
|
7
|
+
* runs the run: the session that called `workflow`, or a background run's
|
|
8
|
+
* runner.
|
|
9
|
+
*
|
|
10
|
+
* The run's `pause` holds only the agents the script has not started: agents
|
|
11
|
+
* already working go on. So the control says "Hold new agents", and it shows
|
|
12
|
+
* only while the script can still start one (or the run is held, to resume
|
|
13
|
+
* it). Before the run exists (its approval is open) there is nothing to hold
|
|
14
|
+
* or stop: no control shows.
|
|
8
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* No run exists yet: its approval question is open, or no agent started and
|
|
18
|
+
* no runner took it (a box older than `awaitingApproval`).
|
|
19
|
+
*/
|
|
20
|
+
export declare function runNotStarted(run: Pick<WorkflowRun, 'status' | 'awaitingApproval' | 'agents' | 'background' | 'paused'>): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The script can still start an agent: one is queued for a slot (`starting`, no session yet),
|
|
23
|
+
* a phase it declared has not started, or it is under its cap.
|
|
24
|
+
*/
|
|
25
|
+
export declare function runCanStartAgents(run: Pick<WorkflowRun, 'phases' | 'agents' | 'maxAgents'>): boolean;
|
|
9
26
|
/** A run's large-run warning: more agents than Claude Code's "Large workflow" threshold, or the run says so. */
|
|
10
27
|
export declare function isLargeRun(run: Pick<WorkflowRun, 'agents' | 'large' | 'maxAgents'>): boolean;
|
|
11
28
|
/** The file name a run saves as: its saved name, else its title in kebab case. */
|
|
@@ -35,6 +52,12 @@ export interface WorkflowRunControlsProps {
|
|
|
35
52
|
run: WorkflowRun;
|
|
36
53
|
}
|
|
37
54
|
export declare function WorkflowRunControls({ projectId, controlSessionId, ownerSessionId, run, appearance }: WorkflowRunControlsProps): import("react").JSX.Element | null;
|
|
55
|
+
/**
|
|
56
|
+
* Stop one agent as the person's stop: the run's `stop_agent` control, so the runner records
|
|
57
|
+
* "Stopped by you" and goes on. A box older than that control (or a run the control cannot
|
|
58
|
+
* reach) gets the old path: stop the agent's session, which the run reads as a stop.
|
|
59
|
+
*/
|
|
60
|
+
export declare function useStopAgent(projectId: string | undefined, controlSessionId: string | undefined, run: Pick<WorkflowRun, 'runId' | 'status'> | null): (agent: Pick<WorkflowRunAgent, "sessionId">) => Promise<void>;
|
|
38
61
|
/** `restart_agent` for one agent row of a run, on the box that runs it. */
|
|
39
62
|
export declare function useRestartAgent(projectId: string | undefined, controlSessionId: string | undefined, run: WorkflowRun | null): {
|
|
40
63
|
enabled: boolean;
|
|
@@ -9,17 +9,40 @@ import { errorToast, successToast } from '../../primitives/toast.js';
|
|
|
9
9
|
import { useTranslations } from '../../i18n/index.js';
|
|
10
10
|
import { FloppyDiskIcon, PauseIcon, PlayIcon, SquareIcon, WarningIcon } from '@phosphor-icons/react';
|
|
11
11
|
import { useMemo } from 'react';
|
|
12
|
-
import { WORKFLOW_LARGE_AGENT_COUNT } from '@kortix/sdk';
|
|
12
|
+
import { stopProjectSession, WORKFLOW_LARGE_AGENT_COUNT } from '@kortix/sdk';
|
|
13
13
|
import { useSessionWorkflows } from '@kortix/sdk/react';
|
|
14
14
|
import { parseWorkflowRun } from '../tool/tools/workflow-run.js';
|
|
15
15
|
import { useSessionPromptSend } from './session-prompt.js';
|
|
16
16
|
/**
|
|
17
17
|
* One workflow run's controls, for the run card in the chat and the strip's
|
|
18
|
-
* "Workflows" group: Claude Code's `/workflows` keys as buttons.
|
|
19
|
-
* resume (`p`), stop the run (`x`), save its script as a workflow
|
|
20
|
-
* per agent row, restart (`r`). Every control goes to the box that
|
|
21
|
-
* run: the session that called `workflow`, or a background run's
|
|
18
|
+
* "Workflows" group: Claude Code's `/workflows` keys as buttons. Hold new
|
|
19
|
+
* agents or resume (`p`), stop the run (`x`), save its script as a workflow
|
|
20
|
+
* (`s`), and, per agent row, restart (`r`). Every control goes to the box that
|
|
21
|
+
* runs the run: the session that called `workflow`, or a background run's
|
|
22
|
+
* runner.
|
|
23
|
+
*
|
|
24
|
+
* The run's `pause` holds only the agents the script has not started: agents
|
|
25
|
+
* already working go on. So the control says "Hold new agents", and it shows
|
|
26
|
+
* only while the script can still start one (or the run is held, to resume
|
|
27
|
+
* it). Before the run exists (its approval is open) there is nothing to hold
|
|
28
|
+
* or stop: no control shows.
|
|
22
29
|
*/
|
|
30
|
+
/**
|
|
31
|
+
* No run exists yet: its approval question is open, or no agent started and
|
|
32
|
+
* no runner took it (a box older than `awaitingApproval`).
|
|
33
|
+
*/
|
|
34
|
+
export function runNotStarted(run) {
|
|
35
|
+
return run.status === 'running' && (run.awaitingApproval === true || (run.agents.length === 0 && !run.background && !run.paused));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The script can still start an agent: one is queued for a slot (`starting`, no session yet),
|
|
39
|
+
* a phase it declared has not started, or it is under its cap.
|
|
40
|
+
*/
|
|
41
|
+
export function runCanStartAgents(run) {
|
|
42
|
+
return (run.agents.some((agent) => agent.status === 'starting' && !agent.sessionId) ||
|
|
43
|
+
run.phases.some((phase) => phase.status === 'pending') ||
|
|
44
|
+
run.agents.length < (run.maxAgents ?? Number.POSITIVE_INFINITY));
|
|
45
|
+
}
|
|
23
46
|
/** A run's large-run warning: more agents than Claude Code's "Large workflow" threshold, or the run says so. */
|
|
24
47
|
export function isLargeRun(run) {
|
|
25
48
|
return run.large === true || run.agents.length > WORKFLOW_LARGE_AGENT_COUNT;
|
|
@@ -43,7 +66,13 @@ export function workflowFileName(run) {
|
|
|
43
66
|
*/
|
|
44
67
|
export function useLiveWorkflowRun(projectId, sessionId, run) {
|
|
45
68
|
const runner = run?.background?.sessionId;
|
|
46
|
-
|
|
69
|
+
// A run the card knows ended reads its runner at the idle rate; once the runner lists
|
|
70
|
+
// every run as ended, the read stops (`useSessionWorkflows`).
|
|
71
|
+
const ended = !!run?.status && run.status !== 'running';
|
|
72
|
+
const { data } = useSessionWorkflows(projectId, runner, {
|
|
73
|
+
enabled: !!projectId && !!runner,
|
|
74
|
+
...(ended ? { live: false } : {}),
|
|
75
|
+
});
|
|
47
76
|
const live = useMemo(() => {
|
|
48
77
|
if (!run || !runner || !data)
|
|
49
78
|
return null;
|
|
@@ -61,7 +90,7 @@ export function useLiveWorkflowRun(projectId, sessionId, run) {
|
|
|
61
90
|
/** The prompt "Save" sends to the session that owns the run. */
|
|
62
91
|
export function useSaveWorkflowPrompt() {
|
|
63
92
|
const t = useTranslations('multiAgent.workflow');
|
|
64
|
-
return (run) => t('savePrompt', { title: run.title || run.name || run.runId, runId: run.runId, file:
|
|
93
|
+
return (run) => t('savePrompt', { title: run.title || run.name || run.runId, runId: run.runId, file: `workflows/${workflowFileName(run)}.js` });
|
|
65
94
|
}
|
|
66
95
|
export function LargeRunBadge() {
|
|
67
96
|
const t = useTranslations('multiAgent.workflow');
|
|
@@ -76,7 +105,9 @@ export function WorkflowRunControls({ projectId, controlSessionId, ownerSessionI
|
|
|
76
105
|
const send = useSessionPromptSend(ownerSessionId);
|
|
77
106
|
const savePrompt = useSaveWorkflowPrompt();
|
|
78
107
|
const running = run.status === 'running';
|
|
79
|
-
const canControl = !!projectId && !!controlSessionId && !!run.runId && running;
|
|
108
|
+
const canControl = !!projectId && !!controlSessionId && !!run.runId && running && !runNotStarted(run);
|
|
109
|
+
// Hold is about agents still to start: none left, nothing to hold (a held run keeps Resume).
|
|
110
|
+
const canHold = canControl && (run.paused === true || runCanStartAgents(run));
|
|
80
111
|
const pending = control.isPending ? control.variables?.body.action : undefined;
|
|
81
112
|
const act = (action) => control.mutate({ runId: run.runId, body: { action } }, {
|
|
82
113
|
onError: (error) => errorToast(t(`failed.${action}`), { description: error instanceof Error ? error.message : undefined }),
|
|
@@ -93,10 +124,10 @@ export function WorkflowRunControls({ projectId, controlSessionId, ownerSessionI
|
|
|
93
124
|
}
|
|
94
125
|
};
|
|
95
126
|
const buttons = [
|
|
96
|
-
|
|
127
|
+
canHold && (_jsx(Hint, { label: run.paused ? t('resumeHint') : t('holdHint'), side: "top", children: _jsx(Button, { type: "button", variant: "ghost", size: text ? 'xs' : 'icon-xs', className: text ? textClass : undefined, "aria-label": run.paused ? t('resume') : t('hold'), disabled: !!pending, onClick: (event) => {
|
|
97
128
|
event.stopPropagation();
|
|
98
129
|
act(run.paused ? 'resume' : 'pause');
|
|
99
|
-
}, children: pending === 'pause' || pending === 'resume' ? (_jsx(Loading, { className: "size-3 shrink-0" })) : text ? (run.paused ? t('resumeShort') : t('
|
|
130
|
+
}, children: pending === 'pause' || pending === 'resume' ? (_jsx(Loading, { className: "size-3 shrink-0" })) : text ? (run.paused ? t('resumeShort') : t('holdShort')) : run.paused ? (_jsx(PlayIcon, { weight: "fill", className: "size-3 shrink-0" })) : (_jsx(PauseIcon, { weight: "fill", className: "size-3 shrink-0" })) }) }, "pause")),
|
|
100
131
|
canControl && (_jsx(Hint, { label: t('stopHint'), side: "top", children: _jsx(Button, { type: "button", variant: "ghost", size: text ? 'xs' : 'icon-xs', className: text ? textClass : undefined, "aria-label": t('stop'), disabled: !!pending, onClick: (event) => {
|
|
101
132
|
event.stopPropagation();
|
|
102
133
|
act('stop');
|
|
@@ -113,6 +144,28 @@ export function WorkflowRunControls({ projectId, controlSessionId, ownerSessionI
|
|
|
113
144
|
return _jsx(_Fragment, { children: buttons });
|
|
114
145
|
return buttons.length === 1 ? _jsx(_Fragment, { children: buttons }) : _jsx(ButtonGroup, { children: buttons });
|
|
115
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Stop one agent as the person's stop: the run's `stop_agent` control, so the runner records
|
|
149
|
+
* "Stopped by you" and goes on. A box older than that control (or a run the control cannot
|
|
150
|
+
* reach) gets the old path: stop the agent's session, which the run reads as a stop.
|
|
151
|
+
*/
|
|
152
|
+
export function useStopAgent(projectId, controlSessionId, run) {
|
|
153
|
+
const { control } = useSessionWorkflows(projectId, controlSessionId, { enabled: false });
|
|
154
|
+
return async (agent) => {
|
|
155
|
+
if (!projectId || !agent.sessionId)
|
|
156
|
+
return;
|
|
157
|
+
if (controlSessionId && run?.runId && run.status === 'running') {
|
|
158
|
+
try {
|
|
159
|
+
await control.mutateAsync({ runId: run.runId, body: { action: 'stop_agent', session_id: agent.sessionId } });
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
// Fall through: stopping the session still stops the agent.
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
await stopProjectSession(projectId, agent.sessionId);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
116
169
|
/** `restart_agent` for one agent row of a run, on the box that runs it. */
|
|
117
170
|
export function useRestartAgent(projectId, controlSessionId, run) {
|
|
118
171
|
const t = useTranslations('multiAgent.workflow');
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { cn } from '../../lib/utils.js';
|
|
4
4
|
import { WarningIcon } from '@phosphor-icons/react';
|
|
5
5
|
import { lazy, Suspense, useContext, useMemo, useRef } from 'react';
|
|
6
|
+
import { useToastClearance } from '../../primitives/toast-clearance.js';
|
|
6
7
|
import { SpaceMentionContext } from './menus/space-mentions.js';
|
|
7
8
|
import { useFeatureFlag } from '@kortix/sdk/react';
|
|
8
9
|
import { ModelConnectionLayoutContext } from '../models/model-connection-layout.js';
|
|
@@ -14,6 +15,7 @@ import { shouldFocusEditorFromPadding } from './composer-logic.js';
|
|
|
14
15
|
import { ComposerToolbar } from './composer-toolbar.js';
|
|
15
16
|
import { ComposerUnderbar } from './composer-underbar.js';
|
|
16
17
|
import { ChatInputOverridesProvider } from './chat-input/chat-input-overrides.js';
|
|
18
|
+
import { resolveProgramAgent } from './agent-selector.js';
|
|
17
19
|
import { useUiHostConfig } from '../../providers/ui-provider.js';
|
|
18
20
|
/** What the attach picker offers when the host names no list. */
|
|
19
21
|
const DEFAULT_ATTACH_ACCEPT = 'image/*,.pdf,.txt,.md,.json,.csv,.xml,.yaml,.yml,.toml,.js,.ts,.jsx,.tsx,.py,.rb,.go,.rs,.java,.c,.cpp,.h,.css,.html,.vue,.svelte,.log,.sql,.zip,.tar,.gz,.rar';
|
|
@@ -28,6 +30,8 @@ export function ComposerCard({ tHardcodedUi, isDragOver, handleDragEnter, handle
|
|
|
28
30
|
agents = EMPTY_AGENTS, commands = EMPTY_COMMANDS, slashFiles = EMPTY_SLASH_FILES, models = EMPTY_MODELS, notice = null, disabled = false, lockForQuestion = false, lockForApproval = false, questionButtonLabel = null, questionActive = false, submitLabel = null, questionCanAct = true, escCount = 0, isBusy = false, isSending = false, onStop, stopDisabled = false, canStop = true, modelsLoading = false, modelRequired = false, onModelChange, modelDefaultControls, inheritedModel, providers, variants = EMPTY_VARIANTS, selectedVariant = null, onVariantChange, projectId, toolbarSlot, underbarSlot, rewind, selectedAgent = null, onAgentChange, noAccessibleAgents = false, agentLocked = false, onContextClick, messages, underbarPlacement = 'below', agentPickerCompact = false, slashMenuPlacement = 'above', cardClassName, call, }) {
|
|
29
31
|
const connectionsAbove = useContext(ModelConnectionLayoutContext) === 'above';
|
|
30
32
|
const cardRef = useRef(null);
|
|
33
|
+
// A composer docked at the window bottom keeps toasts above its Send/Stop button.
|
|
34
|
+
useToastClearance(cardRef, slashMenuPlacement === 'above');
|
|
31
35
|
const { attachAccept, modelPickerEnabled } = useUiHostConfig();
|
|
32
36
|
const inlineUnderbar = underbarPlacement === 'inline';
|
|
33
37
|
/*
|
|
@@ -41,6 +45,8 @@ agents = EMPTY_AGENTS, commands = EMPTY_COMMANDS, slashFiles = EMPTY_SLASH_FILES
|
|
|
41
45
|
// Inside a space the `@` menu is its people and agents (`menus/space-mentions.ts`).
|
|
42
46
|
const spaceMentions = useContext(SpaceMentionContext);
|
|
43
47
|
const chatInputOpen = agentMenuOpen || modelMenuOpen || reasoningMenuOpen;
|
|
48
|
+
// A program agent (`run` in kortix.yaml) has no model: its listing names provider `program`.
|
|
49
|
+
const programAgent = resolveProgramAgent(primaryAgents, selectedAgent);
|
|
44
50
|
const chatInput = useMemo(() => {
|
|
45
51
|
if (!chatInputEnabled)
|
|
46
52
|
return undefined;
|
|
@@ -118,7 +124,7 @@ agents = EMPTY_AGENTS, commands = EMPTY_COMMANDS, slashFiles = EMPTY_SLASH_FILES
|
|
|
118
124
|
// the div and immediately fights the caret we are placing.
|
|
119
125
|
e.preventDefault();
|
|
120
126
|
editorRef.current?.focus();
|
|
121
|
-
}, children: [_jsx(AnimatedComposerPlaceholder, { placeholder: editorPlaceholder, active: animatePlaceholder }), _jsx(Suspense, { fallback: _jsx(ComposerEditorFallback, {}), children: _jsx(ComposerEditorLazy, { ref: setEditorRef, placeholder: animatePlaceholder ? '' : editorPlaceholder, disabled: editorDisabled, onSubmit: handleSubmit, onArrowUpAtStart: handleArrowUpAtStart, onArrowDownAtEnd: handleArrowDownAtEnd, onEmptyChange: setIsEmpty, onDocChange: handleDocChange, agents: agents, sessions: allSessions ?? [], currentSessionId: sessionId, spaceMentions: spaceMentions, commands: commands, actions: slashActions, files: slashFiles, onSelectAction: handleSelectAction, slashDockSelector: `#${dockId}`, onMenuOpenChange: setMenuOpen }) })] }), _jsx("input", { ref: fileInputRef, type: "file", accept: attachAccept ?? DEFAULT_ATTACH_ACCEPT, multiple: true, className: "hidden", onChange: handleFileSelect }), _jsx(ComposerToolbar, { leading: inlineUnderbar ? (_jsx(ComposerUnderbar, { variant: "inline", agentPickerCompact: agentPickerCompact, onAttachClick: handleAttachClick, agents: primaryAgents, selectedAgent: selectedAgent, onAgentChange: onAgentChange, agentMenuOpen: agentMenuOpen, onAgentMenuOpenChange: setAgentMenuOpen, noAccessibleAgents: noAccessibleAgents, agentLocked: agentLocked, messages: messages, models: models, selectedModel: availableSelectedModel, onContextClick: onContextClick, agentsSlot: underbarSlot, chatInput: chatInput })) : null, pickersInChatInput: chatInputEnabled, modelsLoading: modelsLoading, models: models, selectedModel: availableSelectedModel, onModelChange: onModelChange, modelDefaultControls: modelDefaultControls, providers: providers, modelRequired: modelRequired, modelMenuOpen: modelMenuOpen, onModelMenuOpenChange: setModelMenuOpen, reasoningMenuOpen: reasoningMenuOpen, onReasoningMenuOpenChange: setReasoningMenuOpen, variants: variants, selectedVariant: selectedVariant, onVariantChange: onVariantChange, projectId: projectId,
|
|
127
|
+
}, children: [_jsx(AnimatedComposerPlaceholder, { placeholder: editorPlaceholder, active: animatePlaceholder }), _jsx(Suspense, { fallback: _jsx(ComposerEditorFallback, {}), children: _jsx(ComposerEditorLazy, { ref: setEditorRef, placeholder: animatePlaceholder ? '' : editorPlaceholder, disabled: editorDisabled, onSubmit: handleSubmit, onArrowUpAtStart: handleArrowUpAtStart, onArrowDownAtEnd: handleArrowDownAtEnd, onEmptyChange: setIsEmpty, onDocChange: handleDocChange, agents: agents, sessions: allSessions ?? [], currentSessionId: sessionId, spaceMentions: spaceMentions, commands: commands, actions: slashActions, files: slashFiles, onSelectAction: handleSelectAction, slashDockSelector: `#${dockId}`, onMenuOpenChange: setMenuOpen }) })] }), _jsx("input", { ref: fileInputRef, type: "file", accept: attachAccept ?? DEFAULT_ATTACH_ACCEPT, multiple: true, className: "hidden", onChange: handleFileSelect }), _jsx(ComposerToolbar, { noModel: programAgent, leading: inlineUnderbar ? (_jsx(ComposerUnderbar, { variant: "inline", agentPickerCompact: agentPickerCompact, onAttachClick: handleAttachClick, agents: primaryAgents, selectedAgent: selectedAgent, onAgentChange: onAgentChange, agentMenuOpen: agentMenuOpen, onAgentMenuOpenChange: setAgentMenuOpen, noAccessibleAgents: noAccessibleAgents, agentLocked: agentLocked, messages: messages, models: models, selectedModel: availableSelectedModel, onContextClick: onContextClick, agentsSlot: underbarSlot, chatInput: chatInput })) : null, pickersInChatInput: chatInputEnabled, modelsLoading: modelsLoading, models: models, selectedModel: availableSelectedModel, onModelChange: onModelChange, modelDefaultControls: modelDefaultControls, providers: providers, modelRequired: modelRequired, modelMenuOpen: modelMenuOpen, onModelMenuOpenChange: setModelMenuOpen, reasoningMenuOpen: reasoningMenuOpen, onReasoningMenuOpenChange: setReasoningMenuOpen, variants: variants, selectedVariant: selectedVariant, onVariantChange: onVariantChange, projectId: projectId,
|
|
122
128
|
// Inline placement has no under-row, so the slot (the session
|
|
123
129
|
// overrides gear, meta indicator) rides the toolbar itself. With
|
|
124
130
|
// the 'below' placement the ComposerUnderbar further down renders
|
|
@@ -14,6 +14,8 @@ export declare const FeaturedAgentsContext: import("react").Context<{
|
|
|
14
14
|
* else the first selectable agent. One rule for the trigger and the chat composer.
|
|
15
15
|
*/
|
|
16
16
|
export declare function resolveDisplayedAgentName(primaryAgents: Agent[], selectedAgent: string | null): string;
|
|
17
|
+
/** Is the displayed agent a program agent (`run`)? Its runtime listing names provider `program`: it has no model to pick. */
|
|
18
|
+
export declare function resolveProgramAgent(primaryAgents: Agent[], selectedAgent: string | null): boolean;
|
|
17
19
|
/** The label `AgentSelector` shows for a selection (null = nothing picked). Other surfaces that name the agent reuse it. */
|
|
18
20
|
export declare function agentDisplayLabel(agents: Agent[], selectedAgent: string | null): string;
|
|
19
21
|
/**
|
|
@@ -7,7 +7,8 @@ import { useTranslations } from '../../i18n/index.js';
|
|
|
7
7
|
import { useUiHostConfig } from '../../providers/ui-provider.js';
|
|
8
8
|
import { cn } from '../../lib/utils.js';
|
|
9
9
|
import { TRIGGER_CARET_CLASS, triggerVariants } from '../../primitives/trigger-variants.js';
|
|
10
|
-
import {
|
|
10
|
+
import { agentDisplayName, isMyKortixAgentName } from '../../_vendor/kortix-shared.js';
|
|
11
|
+
import { InlineCodeText } from '../../markdown/inline-code-text.js';
|
|
11
12
|
import { CaretDownIcon, CheckIcon } from '@phosphor-icons/react';
|
|
12
13
|
import { AgentMark } from '../../internal/components/agent-mark.js';
|
|
13
14
|
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
@@ -36,12 +37,17 @@ export function resolveDisplayedAgentName(primaryAgents, selectedAgent) {
|
|
|
36
37
|
const current = primaryAgents.find((a) => a.name === selectedAgent);
|
|
37
38
|
return current?.name ?? selectedAgent ?? primaryAgents[0]?.name;
|
|
38
39
|
}
|
|
40
|
+
/** Is the displayed agent a program agent (`run`)? Its runtime listing names provider `program`: it has no model to pick. */
|
|
41
|
+
export function resolveProgramAgent(primaryAgents, selectedAgent) {
|
|
42
|
+
const name = resolveDisplayedAgentName(primaryAgents, selectedAgent);
|
|
43
|
+
return primaryAgents.find((a) => a.name === name)?.model?.providerID === 'program';
|
|
44
|
+
}
|
|
39
45
|
/** The label `AgentSelector` shows for a selection (null = nothing picked). Other surfaces that name the agent reuse it. */
|
|
40
46
|
export function agentDisplayLabel(agents, selectedAgent) {
|
|
41
47
|
const name = resolveDisplayedAgentName(composerSelectableAgents(agents), selectedAgent);
|
|
42
48
|
if (!name)
|
|
43
49
|
return 'Agent';
|
|
44
|
-
return
|
|
50
|
+
return agentDisplayName(name, agents.find((a) => a.name === name)?.title);
|
|
45
51
|
}
|
|
46
52
|
/**
|
|
47
53
|
* The agents a composer picker offers and the name it shows for each. One
|
|
@@ -57,7 +63,7 @@ export function useComposerAgentChoices(agents) {
|
|
|
57
63
|
return agents.filter((a) => offeredNames.has(a.name));
|
|
58
64
|
}, [agents, offeredAgents]);
|
|
59
65
|
const primaryAgents = useMemo(() => composerSelectableAgents(offered), [offered]);
|
|
60
|
-
const label = useCallback((name) => agentLabels?.[name] ?? (
|
|
66
|
+
const label = useCallback((name) => agentLabels?.[name] ?? agentDisplayName(name, agents.find((a) => a.name === name)?.title), [agentLabels, agents]);
|
|
61
67
|
return { offered, primaryAgents, label, agentLabels };
|
|
62
68
|
}
|
|
63
69
|
export function AgentSelector({ agents, selectedAgent, onSelect, disabled = false, triggerLabelClassName, unavailableHint, open: controlledOpen, onOpenChange, compact = false, appearance = 'chip', }) {
|
|
@@ -82,6 +88,7 @@ export function AgentSelector({ agents, selectedAgent, onSelect, disabled = fals
|
|
|
82
88
|
return primaryAgents;
|
|
83
89
|
return primaryAgents.filter((a) => a.name.toLowerCase().includes(q) ||
|
|
84
90
|
(agentLabels?.[a.name] ?? '').toLowerCase().includes(q) ||
|
|
91
|
+
(a.title ?? '').toLowerCase().includes(q) ||
|
|
85
92
|
(a.description || '').toLowerCase().includes(q));
|
|
86
93
|
}, [primaryAgents, search, agentLabels]);
|
|
87
94
|
const filteredMeta = useMemo(() => filteredPrimary.filter((a) => isMyKortixAgentName(a.name)), [filteredPrimary]);
|
|
@@ -133,7 +140,7 @@ export function AgentSelector({ agents, selectedAgent, onSelect, disabled = fals
|
|
|
133
140
|
className: cn('items-start gap-2 py-2', isSelected && 'bg-primary/[0.06]'), onSelect: () => {
|
|
134
141
|
onSelect(agent.name);
|
|
135
142
|
setOpen(false);
|
|
136
|
-
}, children: [agent.description || meta ? (_jsx(AgentMark, { slug: agent.name, size: 28, tile: 36 })) : (_jsx(AgentMark, { slug: agent.name, size: 14 })), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground block truncate text-sm font-medium", children: label(agent.name) }), meta ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('myKortixRoutes') })) : agent.description ? (_jsx("p", { className: "text-muted-foreground line-clamp-2 text-xs text-pretty", children: agent.description })) : null] }), isSelected && (
|
|
143
|
+
}, children: [agent.description || meta ? (_jsx(AgentMark, { slug: agent.name, size: 28, tile: 36 })) : (_jsx(AgentMark, { slug: agent.name, size: 14 })), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground block truncate text-sm font-medium", children: label(agent.name) }), meta ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('myKortixRoutes') })) : agent.description ? (_jsx("p", { className: "text-muted-foreground line-clamp-2 text-xs text-pretty", children: _jsx(InlineCodeText, { text: agent.description }) })) : null] }), isSelected && (
|
|
137
144
|
// `mt-0.5` optically centres the 16px check against the first line
|
|
138
145
|
// rather than the top edge of the text box.
|
|
139
146
|
_jsx(CheckIcon, { className: "text-foreground mt-0.5 size-4 shrink-0" }))] }, agent.name));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from '../../lib/utils.js';
|
|
4
|
-
import { AnimatePresence, m
|
|
4
|
+
import { AnimatePresence, m } from 'motion/react';
|
|
5
|
+
import { useReducedMotion } from '../../internal/hooks/use-reduced-motion.js';
|
|
5
6
|
import { useTranslations } from '../../i18n/index.js';
|
|
6
7
|
import { useUiHostConfig } from '../../providers/ui-provider.js';
|
|
7
8
|
import { useEffect, useMemo, useState } from 'react';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* as the lifted-surface fill, `text-xs` for the name. The badge is the design
|
|
17
17
|
* system's `Badge` at `size="xs"`, uppercase — the note at the badge says why.
|
|
18
18
|
*/
|
|
19
|
-
import type
|
|
19
|
+
import { type ReactNode } from 'react';
|
|
20
20
|
/** The square every attachment is. `size-28` (~103px on the 0.23rem scale) —
|
|
21
21
|
* Jay's call, 2026-09-06: the 88px square read as cramped beside the name. */
|
|
22
22
|
export declare const TILE_SURFACE = "border-border bg-popover relative block size-28 shrink-0 overflow-hidden rounded-md border text-left";
|
|
@@ -26,7 +26,7 @@ export declare const TILE_SURFACE = "border-border bg-popover relative block siz
|
|
|
26
26
|
*/
|
|
27
27
|
export declare const TILE_INTERACTIVE = "hover:bg-accent cursor-pointer transition-colors duration-fast active:scale-[0.96]";
|
|
28
28
|
/** The five tile rules live once in `@kortix/shared/session/attachment-tile`. */
|
|
29
|
-
export { LONG_NAME_THRESHOLD, NAME_TAIL_CHARS, attachmentExtension, isPreviewableImage, splitFilenameForTile, } from '../../_vendor/shared/session/attachment-tile.js';
|
|
29
|
+
export { LONG_NAME_THRESHOLD, NAME_TAIL_CHARS, attachmentExtension, filenameBreakSegments, isPreviewableImage, splitFilenameForTile, } from '../../_vendor/shared/session/attachment-tile.js';
|
|
30
30
|
/** A tile previews the head of the paste only: the clamp shows four lines, and the DOM need not hold 100 kB. */
|
|
31
31
|
export declare const PASTE_PREVIEW_CHARS = 400;
|
|
32
32
|
export interface AttachmentTileProps {
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* THE attachment tile — one component for the composer preview, the sent
|
|
5
|
+
* message, the boot stand-in and the queued row, so a file can never look one
|
|
6
|
+
* way while it is being attached and another the moment it is sent.
|
|
7
|
+
*
|
|
8
|
+
* The shape (2026-09-06, from Jay's reference): a square. A named file shows
|
|
9
|
+
* its name top-left over two lines and its extension as a badge bottom-left.
|
|
10
|
+
* An image IS the picture, edge to edge, with the same badge over its corner.
|
|
11
|
+
* No icon: the extension badge says what the file is, and the name says which
|
|
12
|
+
* one. There is no rows-vs-tiles mode and no second rectangle shape — the
|
|
13
|
+
* earlier 120px "file rectangle" beside 80px "image squares" gave every
|
|
14
|
+
* message a ragged right edge.
|
|
15
|
+
*
|
|
16
|
+
* Every value is a token (`kortix-brand`): `size-24` on the 0.23rem
|
|
17
|
+
* scale (~88px), `rounded-md`, the one `border-border` hairline, `bg-popover`
|
|
18
|
+
* as the lifted-surface fill, `text-xs` for the name. The badge is the design
|
|
19
|
+
* system's `Badge` at `size="xs"`, uppercase — the note at the badge says why.
|
|
20
|
+
*/
|
|
21
|
+
import { Fragment } from 'react';
|
|
3
22
|
import { Badge } from '../../primitives/badge.js';
|
|
4
23
|
import { Close } from '../../icons/close.js';
|
|
5
24
|
import { cn } from '../../lib/utils.js';
|
|
6
|
-
import { attachmentExtension, isPreviewableImage, splitFilenameForTile, } from '../../_vendor/kortix-shared.js';
|
|
25
|
+
import { attachmentExtension, filenameBreakSegments, isPreviewableImage, splitFilenameForTile, } from '../../_vendor/kortix-shared.js';
|
|
7
26
|
/** The square every attachment is. `size-28` (~103px on the 0.23rem scale) —
|
|
8
27
|
* Jay's call, 2026-09-06: the 88px square read as cramped beside the name. */
|
|
9
28
|
export const TILE_SURFACE = 'border-border bg-popover relative block size-28 shrink-0 overflow-hidden rounded-md border text-left';
|
|
@@ -13,7 +32,7 @@ export const TILE_SURFACE = 'border-border bg-popover relative block size-28 shr
|
|
|
13
32
|
*/
|
|
14
33
|
export const TILE_INTERACTIVE = 'hover:bg-accent cursor-pointer transition-colors duration-fast active:scale-[0.96]';
|
|
15
34
|
/** The five tile rules live once in `@kortix/shared/session/attachment-tile`. */
|
|
16
|
-
export { LONG_NAME_THRESHOLD, NAME_TAIL_CHARS, attachmentExtension, isPreviewableImage, splitFilenameForTile, } from '../../_vendor/kortix-shared.js';
|
|
35
|
+
export { LONG_NAME_THRESHOLD, NAME_TAIL_CHARS, attachmentExtension, filenameBreakSegments, isPreviewableImage, splitFilenameForTile, } from '../../_vendor/kortix-shared.js';
|
|
17
36
|
/** A tile previews the head of the paste only: the clamp shows four lines, and the DOM need not hold 100 kB. */
|
|
18
37
|
export const PASTE_PREVIEW_CHARS = 400;
|
|
19
38
|
/**
|
|
@@ -48,7 +67,10 @@ export function AttachmentTile({ filename, mime, imageSrc, corner, overlay, onOp
|
|
|
48
67
|
// A picture is the whole tile: no badge over it. The image says what it is
|
|
49
68
|
// better than `png` could, and a chip on a photo's corner is clutter.
|
|
50
69
|
const picture = imageSrc && isPreviewableImage(filename, mime) ? imageSrc : null;
|
|
51
|
-
const body = picture ? (_jsxs(_Fragment, { children: [_jsx("img", { src: picture, alt: filename, className: "size-full object-cover", draggable: false }), corner && _jsx("span", { className: "absolute right-2 bottom-2 flex", children: corner })] })) : preview !== undefined ? (_jsxs(_Fragment, { children: [_jsxs("span", { className: "flex size-full flex-col justify-between gap-1 px-2.5 pt-2 pb-2.5", children: [_jsx("span", { className: "text-muted-foreground first-line:text-foreground min-h-0 min-w-0 flex-1 overflow-hidden mask-b-from-60% mask-b-to-88% text-[11px] leading-tight break-words whitespace-pre-wrap first-line:font-medium before:float-right before:h-3 before:w-3.5", children: preview }), _jsxs("span", { className: "flex items-end justify-between gap-1", children: [badge, corner && _jsx("span", { className: "flex shrink-0", children: corner })] })] }), _jsx("span", { "aria-hidden": true, className: cn('bg-muted border-border absolute -top-px -right-px size-5 rounded-bl-sm border-b border-l', onOpen && 'group-hover/paste:bg-popover duration-fast transition-colors') })] })) : (_jsx(_Fragment, { children: _jsxs("span", { className: "flex size-full flex-col justify-between gap-1 p-2", children: [split ? (_jsxs("span", { className: "text-foreground min-w-0 text-xs leading-tight font-medium", children: [_jsx("span", { className: "block truncate", children: split.head }), _jsx("span", { className: "block truncate", children: split.tail })] })) : (
|
|
70
|
+
const body = picture ? (_jsxs(_Fragment, { children: [_jsx("img", { src: picture, alt: filename, className: "size-full object-cover", draggable: false }), corner && _jsx("span", { className: "absolute right-2 bottom-2 flex", children: corner })] })) : preview !== undefined ? (_jsxs(_Fragment, { children: [_jsxs("span", { className: "flex size-full flex-col justify-between gap-1 px-2.5 pt-2 pb-2.5", children: [_jsx("span", { className: "text-muted-foreground first-line:text-foreground min-h-0 min-w-0 flex-1 overflow-hidden mask-b-from-60% mask-b-to-88% text-[11px] leading-tight break-words whitespace-pre-wrap first-line:font-medium before:float-right before:h-3 before:w-3.5", children: preview }), _jsxs("span", { className: "flex items-end justify-between gap-1", children: [badge, corner && _jsx("span", { className: "flex shrink-0", children: corner })] })] }), _jsx("span", { "aria-hidden": true, className: cn('bg-muted border-border absolute -top-px -right-px size-5 rounded-bl-sm border-b border-l', onOpen && 'group-hover/paste:bg-popover duration-fast transition-colors') })] })) : (_jsx(_Fragment, { children: _jsxs("span", { className: "flex size-full flex-col justify-between gap-1 p-2", children: [split ? (_jsxs("span", { className: "text-foreground min-w-0 text-xs leading-tight font-medium", children: [_jsx("span", { className: "block truncate", children: split.head }), _jsx("span", { className: "block truncate", children: split.tail })] })) : (
|
|
71
|
+
// Breaks only at `-`, `_`, a space or before the extension (`<wbr>`);
|
|
72
|
+
// `break-words` splits a piece only when it alone is wider than the tile.
|
|
73
|
+
_jsx("span", { className: "text-foreground line-clamp-2 min-w-0 text-xs leading-tight font-medium break-words", children: filenameBreakSegments(filename).map((segment, index) => (_jsxs(Fragment, { children: [index > 0 && _jsx("wbr", {}), segment] }, index))) })), _jsxs("span", { className: "flex items-end justify-between gap-1", children: [badge ?? _jsx("span", {}), corner && _jsx("span", { className: "flex shrink-0", children: corner })] })] }) }));
|
|
52
74
|
if (onOpen) {
|
|
53
75
|
return (_jsx("button", { type: "button", title: tileTitle, "aria-label": preview !== undefined ? tileTitle : undefined, onClick: (event) => {
|
|
54
76
|
event.stopPropagation();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProjectSpace } from '@kortix/sdk';
|
|
1
|
+
import type { ProjectConfigSummary, ProjectSpace } from '@kortix/sdk';
|
|
2
2
|
import type { Agent } from '@kortix/sdk/react';
|
|
3
3
|
/**
|
|
4
4
|
* Which agent the composer will actually run, given the roster the server is
|
|
@@ -65,6 +65,15 @@ export interface ComposerAgentResolution {
|
|
|
65
65
|
* empty picker, and must not read as "we have an agent to run".
|
|
66
66
|
*/
|
|
67
67
|
export declare function composerSelectableAgents(agents: Agent[] | undefined): Agent[];
|
|
68
|
+
/**
|
|
69
|
+
* The agent a new chat starts on when the person has picked none in this
|
|
70
|
+
* workspace. With `builtin_agents.my_kortix` on it is My Kortix, the agent
|
|
71
|
+
* people talk to; else kortix.yaml `default_agent`.
|
|
72
|
+
*
|
|
73
|
+
* Chat only. `default_agent` itself is unchanged: it stays the agent a trigger,
|
|
74
|
+
* a channel or an API call that names none runs, which is what the server runs.
|
|
75
|
+
*/
|
|
76
|
+
export declare function chatStartAgent(config: Pick<ProjectConfigSummary, 'default_agent' | 'builtin_agents'> | null | undefined): string | null;
|
|
68
77
|
/**
|
|
69
78
|
* The agents anyone who posts in this channel may run, granted or not (the
|
|
70
79
|
* server's `channelAgentNames`): the channel's agents,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { composerSelectableAgents as sdkComposerSelectableAgents } from '@kortix/sdk';
|
|
2
|
+
import { MY_KORTIX_AGENT_NAME } from '../../_vendor/kortix-shared.js';
|
|
2
3
|
/**
|
|
3
4
|
* Which agent the composer will actually run, given the roster the server is
|
|
4
5
|
* willing to hand this user.
|
|
@@ -44,9 +45,22 @@ export const NO_AGENT_ACCESS_MESSAGE = 'No agents available to you — ask a man
|
|
|
44
45
|
* empty picker, and must not read as "we have an agent to run".
|
|
45
46
|
*/
|
|
46
47
|
export function composerSelectableAgents(agents) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
return sdkComposerSelectableAgents(agents);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The agent a new chat starts on when the person has picked none in this
|
|
52
|
+
* workspace. With `builtin_agents.my_kortix` on it is My Kortix, the agent
|
|
53
|
+
* people talk to; else kortix.yaml `default_agent`.
|
|
54
|
+
*
|
|
55
|
+
* Chat only. `default_agent` itself is unchanged: it stays the agent a trigger,
|
|
56
|
+
* a channel or an API call that names none runs, which is what the server runs.
|
|
57
|
+
*/
|
|
58
|
+
export function chatStartAgent(config) {
|
|
59
|
+
if (!config)
|
|
60
|
+
return null;
|
|
61
|
+
if (config.builtin_agents?.my_kortix)
|
|
62
|
+
return MY_KORTIX_AGENT_NAME;
|
|
63
|
+
return config.default_agent ?? null;
|
|
50
64
|
}
|
|
51
65
|
/**
|
|
52
66
|
* The agents anyone who posts in this channel may run, granted or not (the
|
|
@@ -67,6 +67,7 @@ export declare function ComposerChatInput({ onSend, onCommand, sessionId, projec
|
|
|
67
67
|
id: number;
|
|
68
68
|
files?: AttachedFile[];
|
|
69
69
|
mode?: 'replace' | 'merge';
|
|
70
|
+
restoreDraft?: boolean;
|
|
70
71
|
options?: SessionPromptOverrides | null;
|
|
71
72
|
submit?: boolean | 'when-ready';
|
|
72
73
|
} | null;
|