@kortix/ui 0.15.10 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_vendor/kortix-shared.js +769 -76
- package/dist/_vendor/shared/app-config.d.ts +6 -30
- package/dist/_vendor/shared/channel-descriptors.d.ts +0 -34
- package/dist/_vendor/shared/channel-header.d.ts +2 -1
- package/dist/_vendor/shared/connector-sections.d.ts +0 -25
- package/dist/_vendor/shared/file-tags.d.ts +2 -1
- package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
- package/dist/_vendor/shared/pasted-content.d.ts +0 -4
- package/dist/_vendor/shared/pixel-mark.d.ts +0 -17
- package/dist/_vendor/shared/project-glyphs.d.ts +0 -1
- package/dist/_vendor/shared/session/attachment-tile.d.ts +8 -0
- package/dist/_vendor/shared/workspace-settings.d.ts +3 -0
- package/dist/access/access/copy-row.d.ts +7 -1
- package/dist/access/access/copy-row.js +2 -2
- package/dist/animated-copy-icon.js +2 -1
- package/dist/browser/sandbox-browser-chrome.d.ts +2 -1
- package/dist/browser/sandbox-browser-chrome.js +1 -1
- package/dist/customize/agents/agent-cover-card.d.ts +1 -1
- package/dist/customize/agents/agent-cover-card.js +10 -2
- package/dist/customize/agents/agent-filter.js +3 -1
- package/dist/customize/agents/agent-model-view.d.ts +11 -1
- package/dist/customize/agents/agent-model-view.js +12 -1
- package/dist/customize/agents/agent-overview.d.ts +10 -0
- package/dist/customize/agents/agent-overview.js +5 -4
- package/dist/customize/agents/agent-page-chrome.d.ts +5 -6
- package/dist/customize/agents/agent-page-chrome.js +16 -13
- package/dist/customize/agents/agent-page.js +25 -34
- package/dist/customize/agents/agent-tabs.d.ts +3 -0
- package/dist/customize/agents/agent-tabs.js +3 -0
- package/dist/customize/agents/agents-page.js +3 -3
- package/dist/customize/agents/create-agent-modal.d.ts +9 -0
- package/dist/customize/agents/create-agent-modal.js +21 -3
- package/dist/customize/agents/use-default-agent.js +2 -2
- package/dist/customize/connectors/connector-identity.d.ts +11 -2
- package/dist/customize/connectors/connector-identity.js +16 -4
- package/dist/customize/connectors/connectors-page.js +10 -6
- package/dist/customize/connectors/detail/app-page.js +2 -2
- package/dist/customize/connectors/detail/connector-triggers.js +1 -1
- package/dist/customize/connectors/install/install-dialog.d.ts +2 -0
- package/dist/customize/connectors/install/install-dialog.js +6 -1
- package/dist/customize/connectors/use-agent-access.d.ts +2 -0
- package/dist/customize/evals/eval-compare-view.d.ts +10 -0
- package/dist/customize/evals/eval-compare-view.js +68 -0
- package/dist/customize/evals/eval-dataset-view.d.ts +20 -0
- package/dist/customize/evals/eval-dataset-view.js +81 -0
- package/dist/customize/evals/eval-datasets-page.d.ts +25 -0
- package/dist/customize/evals/eval-datasets-page.js +91 -0
- package/dist/customize/evals/eval-job-view.d.ts +12 -0
- package/dist/customize/evals/eval-job-view.js +360 -0
- package/dist/customize/evals/eval-jobs-page.d.ts +4 -0
- package/dist/customize/evals/eval-jobs-page.js +69 -0
- package/dist/customize/evals/eval-meta.d.ts +97 -0
- package/dist/customize/evals/eval-meta.js +228 -0
- package/dist/customize/evals/eval-task-view.d.ts +13 -0
- package/dist/customize/evals/eval-task-view.js +123 -0
- package/dist/customize/evals/eval-tasks-page.d.ts +8 -0
- package/dist/customize/evals/eval-tasks-page.js +56 -0
- package/dist/customize/evals/eval-ui.d.ts +97 -0
- package/dist/customize/evals/eval-ui.js +153 -0
- package/dist/customize/evals/evals-page.d.ts +10 -0
- package/dist/customize/evals/evals-page.js +56 -0
- package/dist/customize/evals/run-eval-modal.d.ts +28 -0
- package/dist/customize/evals/run-eval-modal.js +167 -0
- package/dist/customize/project-settings/project-admin-sections.d.ts +3 -2
- package/dist/customize/project-settings/project-admin-sections.js +6 -1
- package/dist/customize/providers/provider-connect.d.ts +13 -0
- package/dist/customize/providers/provider-connect.js +29 -5
- package/dist/customize/providers/provider-sheet.js +5 -4
- package/dist/customize/sections/component/teams-byo-wizard.js +4 -1
- package/dist/customize/sections/view/gateway/gateway-overview.d.ts +5 -0
- package/dist/customize/sections/view/gateway/gateway-overview.js +32 -6
- package/dist/customize/sections/view/gateway/routing-parts.d.ts +6 -0
- package/dist/customize/sections/view/gateway/routing-parts.js +21 -13
- package/dist/customize/sections/view/git-view.d.ts +19 -1
- package/dist/customize/sections/view/git-view.js +7 -3
- package/dist/customize/sections/view/manifest-issue-list.d.ts +16 -0
- package/dist/customize/sections/view/manifest-issue-list.js +41 -0
- package/dist/customize/sections/view/manifest-issues-row.d.ts +24 -0
- package/dist/customize/sections/view/manifest-issues-row.js +39 -0
- package/dist/customize/sections/view/sandbox-provider-coverage.d.ts +7 -1
- package/dist/customize/sections/view/sandbox-provider-coverage.js +7 -5
- package/dist/customize/sections/view/secrets-view.d.ts +13 -0
- package/dist/customize/sections/view/secrets-view.js +10 -6
- package/dist/customize/sections/view/subscription-usage.d.ts +2 -7
- package/dist/customize/sections/view/subscription-usage.js +4 -8
- package/dist/customize/settings/settings-tab-header.js +12 -3
- package/dist/customize/settings/tabs/experimental-tab.d.ts +16 -5
- package/dist/customize/settings/tabs/experimental-tab.js +36 -11
- package/dist/customize/settings/tabs/general-tab.js +1 -1
- package/dist/customize/settings/tabs/sandbox-tab.d.ts +10 -0
- package/dist/customize/settings/tabs/sandbox-tab.js +27 -4
- package/dist/customize/settings/tabs/snapshots-tab.d.ts +31 -0
- package/dist/customize/settings/tabs/snapshots-tab.js +61 -5
- package/dist/customize/settings/tabs/workspace-keys.js +6 -3
- package/dist/customize/shared/capability-page-shell.js +9 -1
- package/dist/customize/shared/catalog/catalog-card.d.ts +1 -1
- package/dist/customize/shared/catalog/catalog-card.js +15 -5
- package/dist/customize/shared/customize-tab-bar.js +1 -1
- package/dist/customize/shared/new-entity-menu.d.ts +1 -1
- package/dist/customize/shared/new-entity-menu.js +38 -1
- package/dist/customize/triggers/runtime-triggers.d.ts +4 -0
- package/dist/customize/triggers/runtime-triggers.js +33 -3
- package/dist/customize/triggers/schedule/event-trigger-copy.js +1 -1
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +5 -4
- package/dist/customize/triggers/schedule/then-fields.d.ts +5 -1
- package/dist/customize/triggers/schedule/then-fields.js +23 -3
- package/dist/customize/triggers/schedule/trigger-callouts.js +1 -1
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +27 -0
- package/dist/customize/triggers/schedule/trigger-composer-logic.js +51 -5
- package/dist/customize/triggers/schedule/trigger-composer.js +19 -13
- package/dist/customize/triggers/schedule/trigger-edit-logic.js +25 -5
- package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -3
- package/dist/customize/triggers/schedule/trigger-filter.js +7 -6
- package/dist/customize/triggers/schedule/trigger-readonly.js +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -1
- package/dist/customize/triggers/schedule/when-event.js +1 -1
- package/dist/customize/triggers/schedule/when-schedule.d.ts +5 -1
- package/dist/customize/triggers/schedule/when-schedule.js +16 -1
- package/dist/customize/triggers/schedule-view.js +6 -3
- package/dist/files/project/components/drive-explorer.js +33 -70
- package/dist/files/project/components/drive-grid-view.d.ts +2 -31
- package/dist/files/project/components/drive-grid-view.js +12 -22
- package/dist/files/project/components/drive-list-view.d.ts +3 -30
- package/dist/files/project/components/drive-list-view.js +8 -18
- package/dist/files/project/components/drive-selection-bar.d.ts +4 -5
- package/dist/files/project/components/drive-selection-bar.js +13 -20
- package/dist/files/project/components/explorer-listing.d.ts +48 -0
- package/dist/files/project/components/explorer-listing.js +64 -0
- package/dist/files/project/components/file-explorer-page.js +7 -204
- package/dist/files/project/components/file-thumbnail.js +3 -1
- package/dist/files/project/components/manifest-issue-mark.d.ts +9 -0
- package/dist/files/project/components/manifest-issue-mark.js +26 -0
- package/dist/files/project/hooks/use-change-requests.d.ts +10 -0
- package/dist/files/project/hooks/use-change-requests.js +17 -0
- package/dist/files/project/manifest-annotations.d.ts +16 -0
- package/dist/files/project/manifest-annotations.js +19 -0
- package/dist/files/project/store/version-store.d.ts +1 -1
- package/dist/files/project/upload-batch.d.ts +20 -0
- package/dist/files/project/upload-batch.js +20 -0
- package/dist/files/runtime/hooks/use-binary-blob.js +3 -2
- package/dist/files/runtime/hooks/use-file-content.js +3 -2
- package/dist/files/runtime/hooks/use-file-list.js +1 -2
- package/dist/files/runtime/hooks/use-file-mutations.js +69 -6
- package/dist/files/runtime/hooks/use-file-refresh.d.ts +4 -0
- package/dist/files/runtime/hooks/use-file-refresh.js +6 -0
- package/dist/files/tree/components/file-tree-item.js +1 -4
- package/dist/files/viewer/file-annotations.d.ts +18 -0
- package/dist/files/viewer/file-annotations.js +21 -0
- package/dist/files/viewer/file-content-renderer.js +1 -1
- package/dist/files/viewer/file-viewer.js +2 -1
- package/dist/files/viewer/index.d.ts +1 -0
- package/dist/files/viewer/index.js +1 -0
- package/dist/files/viewer/use-file-content-state.js +8 -1
- package/dist/i18n/en.d.ts +544 -46
- package/dist/i18n/en.js +593 -95
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -4
- package/dist/icons/caret-right-solid.d.ts +11 -0
- package/dist/icons/caret-right-solid.js +15 -0
- package/dist/internal/auth/auth-art.d.ts +12 -0
- package/dist/internal/auth/auth-art.js +118 -0
- package/dist/internal/auth/auth-card-shell.d.ts +14 -10
- package/dist/internal/auth/auth-card-shell.js +20 -31
- package/dist/internal/auth/auth-consent.d.ts +3 -1
- package/dist/internal/auth/auth-consent.js +2 -2
- package/dist/internal/auth/auth-primitives.d.ts +26 -1
- package/dist/internal/auth/auth-primitives.js +37 -8
- package/dist/internal/connector-logo/connector-logo.d.ts +2 -1
- package/dist/internal/connector-logo/connector-logo.js +11 -2
- package/dist/internal/files/file-read-retry.d.ts +18 -2
- package/dist/internal/files/file-read-retry.js +42 -4
- package/dist/internal/hooks/projects/use-new-project-session.js +5 -10
- package/dist/internal/hooks/use-auto-scroll-physics.d.ts +1 -1
- package/dist/internal/hooks/use-auto-scroll-physics.js +2 -10
- package/dist/internal/hooks/use-reduced-motion.d.ts +4 -0
- package/dist/internal/hooks/use-reduced-motion.js +12 -0
- package/dist/internal/hooks/use-save-shortcut.d.ts +8 -0
- package/dist/internal/hooks/use-save-shortcut.js +28 -0
- package/dist/internal/layout/connect-mcp-modal.d.ts +1 -1
- package/dist/internal/layout/connect-mcp-modal.js +9 -4
- package/dist/internal/layout/panel-chrome.d.ts +28 -0
- package/dist/internal/layout/panel-chrome.js +27 -0
- package/dist/internal/layout/project-page-header.js +5 -1
- package/dist/internal/layout/project-settings-nav.d.ts +17 -0
- package/dist/internal/layout/project-settings-nav.js +24 -0
- package/dist/internal/lib/browser-noise/rules/webview.js +16 -0
- package/dist/internal/lib/capability-tab-routes.d.ts +8 -0
- package/dist/internal/lib/capability-tab-routes.js +11 -0
- package/dist/internal/lib/manifest-health.d.ts +25 -1
- package/dist/internal/lib/manifest-health.js +56 -0
- package/dist/internal/lib/project-preamble.js +1 -1
- package/dist/internal/lib/web-notifications.d.ts +1 -1
- package/dist/internal/lib/web-notifications.js +3 -0
- package/dist/internal/notifications/notification-inbox.js +2 -1
- package/dist/internal/notifications/notification-rows.d.ts +1 -1
- package/dist/internal/notifications/notification-rows.js +15 -1
- package/dist/internal/selection/selection-bar.d.ts +2 -8
- package/dist/internal/selection/selection-bar.js +15 -38
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/browser-recents-store.d.ts +1 -1
- package/dist/internal/stores/composer-prefill-store.d.ts +7 -0
- package/dist/internal/stores/composer-prefill-store.js +1 -0
- package/dist/internal/stores/current-account-store.d.ts +1 -1
- package/dist/internal/stores/first-chat-store.d.ts +1 -1
- package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
- package/dist/internal/stores/session-browser-store.d.ts +1 -1
- package/dist/internal/stores/session-expanded-store.d.ts +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/session-history-view-store.d.ts +1 -1
- package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
- package/dist/internal/stores/sound-store.d.ts +1 -1
- package/dist/internal/stores/tab-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +9 -1
- package/dist/internal/stores/user-preferences-store.js +2 -0
- package/dist/internal/stores/web-notification-store.d.ts +1 -1
- package/dist/lib/base-ui-compat.js +28 -1
- package/dist/lib/dotmatrix-hooks.d.ts +1 -0
- package/dist/lib/dotmatrix-hooks.js +3 -13
- package/dist/lib/reduced-motion.d.ts +10 -0
- package/dist/lib/reduced-motion.js +104 -0
- package/dist/lib/routes.d.ts +9 -0
- package/dist/lib/routes.js +7 -4
- package/dist/markdown/artifact-link.d.ts +11 -0
- package/dist/markdown/artifact-link.js +62 -0
- package/dist/markdown/code/index.d.ts +1 -1
- package/dist/markdown/code/index.js +1 -1
- package/dist/markdown/code/inline-code.d.ts +1 -1
- package/dist/markdown/code/inline-code.js +1 -1
- package/dist/markdown/genui/components/map-canvas.js +2 -1
- package/dist/markdown/index.d.ts +3 -1
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/{code/inline-chip.js → inline-chip.js} +2 -2
- package/dist/markdown/inline-code-text.d.ts +34 -0
- package/dist/markdown/inline-code-text.js +68 -0
- package/dist/markdown/setup-links/approval-decision.js +3 -3
- package/dist/markdown/soft-breaks.d.ts +21 -0
- package/dist/markdown/soft-breaks.js +33 -0
- package/dist/markdown/unified-markdown.d.ts +9 -1
- package/dist/markdown/unified-markdown.js +31 -9
- package/dist/primitives/action-bar.d.ts +50 -0
- package/dist/primitives/action-bar.js +87 -0
- package/dist/primitives/calendar.js +4 -2
- package/dist/primitives/inline-meta.js +2 -2
- package/dist/primitives/kortix-loader.js +2 -1
- package/dist/primitives/modal.d.ts +1 -1
- package/dist/primitives/paper-wallpaper-shaders.d.ts +1 -0
- package/dist/primitives/paper-wallpaper-shaders.js +6 -0
- package/dist/primitives/resizable.d.ts +1 -1
- package/dist/primitives/resize-seam.d.ts +3 -2
- package/dist/primitives/resize-seam.js +4 -3
- package/dist/primitives/settings-section-header.d.ts +30 -1
- package/dist/primitives/settings-section-header.js +37 -0
- package/dist/primitives/sliding-tab-indicator.js +2 -1
- package/dist/primitives/switch.js +15 -8
- package/dist/primitives/text-shimmer.js +6 -0
- package/dist/primitives/toast-clearance.d.ts +52 -0
- package/dist/primitives/toast-clearance.js +116 -0
- package/dist/primitives/toast.d.ts +3 -1
- package/dist/primitives/toast.js +2 -0
- package/dist/primitives/typed-title.js +1 -1
- package/dist/primitives/wallpaper-shaders.js +1 -1
- package/dist/session/actions/project-session-list-helpers.d.ts +16 -0
- package/dist/session/actions/project-session-list-helpers.js +18 -0
- package/dist/session/actions/session-label.js +2 -2
- package/dist/session/agents/agent-model.d.ts +1 -0
- package/dist/session/agents/agent-model.js +2 -1
- package/dist/session/agents/agent-strip.d.ts +10 -5
- package/dist/session/agents/agent-strip.js +49 -15
- package/dist/session/agents/held-messages.d.ts +6 -2
- package/dist/session/agents/held-messages.js +6 -3
- package/dist/session/agents/workflow-run-controls.d.ts +27 -4
- package/dist/session/agents/workflow-run-controls.js +63 -10
- package/dist/session/composer/ComposerCard.js +7 -1
- package/dist/session/composer/agent-selector.d.ts +2 -0
- package/dist/session/composer/agent-selector.js +11 -4
- package/dist/session/composer/animated-placeholder.js +2 -1
- package/dist/session/composer/attachment-tile.d.ts +2 -2
- package/dist/session/composer/attachment-tile.js +25 -3
- package/dist/session/composer/composer-agent-access.d.ts +10 -1
- package/dist/session/composer/composer-agent-access.js +18 -4
- package/dist/session/composer/composer-chat-input.d.ts +1 -0
- package/dist/session/composer/composer-chat-input.js +7 -2
- package/dist/session/composer/composer-logic.d.ts +7 -0
- package/dist/session/composer/composer-logic.js +18 -0
- package/dist/session/composer/composer-reset.d.ts +8 -14
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +3 -3
- package/dist/session/composer/composer.d.ts +9 -2
- package/dist/session/composer/composer.js +24 -9
- package/dist/session/composer/editor/composer-editor.js +6 -4
- package/dist/session/composer/hooks/use-file-search.d.ts +12 -2
- package/dist/session/composer/hooks/use-file-search.js +71 -7
- package/dist/session/composer/menus/menu-items.js +6 -2
- package/dist/session/composer/menus/menu-shell.d.ts +3 -1
- package/dist/session/composer/menus/menu-shell.js +2 -2
- package/dist/session/composer/menus/slash-menu.d.ts +7 -0
- package/dist/session/composer/menus/slash-menu.js +48 -1
- package/dist/session/composer/use-instant-session-send.js +7 -1
- package/dist/session/header/session-reminders-indicator.js +3 -2
- package/dist/session/header/session-site-header.d.ts +3 -1
- package/dist/session/header/session-site-header.js +27 -8
- package/dist/session/media/sandbox-url-detector.js +1 -1
- package/dist/session/models/connect-model-step.d.ts +29 -0
- package/dist/session/models/connect-model-step.js +50 -0
- package/dist/session/models/model-connection-gate.js +2 -1
- package/dist/session/models/model-selector.js +1 -1
- package/dist/session/models/subscription-switcher.d.ts +7 -0
- package/dist/session/models/subscription-switcher.js +52 -10
- package/dist/session/models/subscription-windows.d.ts +2 -0
- package/dist/session/models/subscription-windows.js +2 -0
- package/dist/session/models/use-workspace-model-gate.d.ts +11 -0
- package/dist/session/models/use-workspace-model-gate.js +62 -0
- package/dist/session/models/workspace-model-gate.d.ts +46 -0
- package/dist/session/models/workspace-model-gate.js +66 -0
- package/dist/session/outcomes/session-outcomes-provider.js +14 -7
- package/dist/session/panel/action-panel.js +8 -19
- package/dist/session/panel/easy/app-preview.d.ts +4 -1
- package/dist/session/panel/easy/app-preview.js +95 -33
- package/dist/session/panel/easy/apps-card.js +6 -11
- package/dist/session/panel/easy/change-requests-card.js +1 -1
- package/dist/session/panel/easy/changes-card.d.ts +14 -0
- package/dist/session/panel/easy/changes-card.js +60 -0
- package/dist/session/panel/easy/context-card.d.ts +5 -1
- package/dist/session/panel/easy/context-card.js +13 -28
- package/dist/session/panel/easy/context-meter.d.ts +18 -0
- package/dist/session/panel/easy/context-meter.js +73 -0
- package/dist/session/panel/easy/detail-view.d.ts +1 -1
- package/dist/session/panel/easy/detail-view.js +24 -21
- package/dist/session/panel/easy/easy-panel.js +7 -5
- package/dist/session/panel/easy/file-preview.js +3 -1
- package/dist/session/panel/easy/frame-history.d.ts +91 -0
- package/dist/session/panel/easy/frame-history.js +198 -0
- package/dist/session/panel/easy/outputs-card.d.ts +10 -0
- package/dist/session/panel/easy/outputs-card.js +28 -31
- package/dist/session/panel/easy/panel-card.d.ts +1 -3
- package/dist/session/panel/easy/panel-card.js +24 -8
- package/dist/session/panel/easy/plan-card.js +2 -2
- package/dist/session/panel/easy/step-icon.d.ts +4 -1
- package/dist/session/panel/easy/step-icon.js +2 -2
- package/dist/session/panel/session-action-panel-column.d.ts +5 -0
- package/dist/session/panel/session-action-panel-column.js +198 -101
- package/dist/session/panel/session-desktop.js +5 -1
- package/dist/session/panel/session-diff-viewer.d.ts +3 -1
- package/dist/session/panel/session-diff-viewer.js +7 -4
- package/dist/session/panel/session-panel-provider.js +29 -5
- package/dist/session/panel/shared/derive-panels.js +64 -4
- package/dist/session/prompts/session-connect-card.d.ts +63 -0
- package/dist/session/prompts/{session-connect-prompt.js → session-connect-card.js} +53 -42
- package/dist/session/status/session-busy-indicator.js +2 -1
- package/dist/session/status/session-error-banner.js +1 -1
- package/dist/session/thread/chat-minimap.js +2 -1
- package/dist/session/thread/session-body.js +4 -1
- package/dist/session/thread/session-chat.js +311 -300
- package/dist/session/thread/session-turn-meta-rows.d.ts +13 -5
- package/dist/session/thread/session-turn-meta-rows.js +33 -5
- package/dist/session/thread/transcript.d.ts +3 -3
- package/dist/session/thread/transcript.js +33 -27
- package/dist/session/thread/typing-indicator.d.ts +2 -2
- package/dist/session/thread/typing-indicator.js +10 -3
- package/dist/session/tool/tool-part-renderer.js +7 -2
- package/dist/session/tool/tools/kortix-action-tool.js +10 -2
- package/dist/session/tool/tools/session-spawn-tool.js +3 -3
- package/dist/session/tool/tools/workflow-run-card.d.ts +11 -1
- package/dist/session/tool/tools/workflow-run-card.js +31 -7
- package/dist/session/tool/tools/workflow-run-cost.d.ts +29 -0
- package/dist/session/tool/tools/workflow-run-cost.js +75 -0
- package/dist/session/tool/tools/workflow-tool.d.ts +1 -1
- package/dist/session/tool/tools/workflow-tool.js +40 -15
- package/dist/session/turn/peer-message-row.js +1 -1
- package/dist/session/turn/queued-prompt-bubbles.d.ts +3 -2
- package/dist/session/turn/queued-prompt-bubbles.js +1 -1
- package/dist/session/turn/throttled-markdown.js +1 -1
- package/dist/session/turn/turn-viewport.d.ts +66 -10
- package/dist/session/turn/turn-viewport.js +92 -12
- package/dist/session/turn/user-message.js +7 -5
- package/dist/styles/theme.css +68 -0
- package/dist/styles.css +1 -1
- package/dist/terminal/pty-terminal.js +1 -1
- package/dist/terminal/session-terminal-connect-bar.js +2 -1
- package/dist/test-utils/intl.d.ts +544 -46
- package/dist/workspace/admin/project-admin-dashboard.js +23 -11
- package/dist/workspace/admin/settings-search-landing.js +2 -1
- package/dist/workspace/calendar/calendar-dates.d.ts +31 -0
- package/dist/workspace/calendar/calendar-dates.js +64 -0
- package/dist/workspace/calendar/calendar-new-item.d.ts +11 -0
- package/dist/workspace/calendar/calendar-new-item.js +47 -0
- package/dist/workspace/calendar/calendar-page.d.ts +3 -0
- package/dist/workspace/calendar/calendar-page.js +177 -0
- package/dist/workspace/calendar/calendar-panel.d.ts +13 -0
- package/dist/workspace/calendar/calendar-panel.js +103 -0
- package/dist/workspace/calendar/calendar-people.d.ts +52 -0
- package/dist/workspace/calendar/calendar-people.js +117 -0
- package/dist/workspace/calendar/calendar-scheduled.d.ts +29 -0
- package/dist/workspace/calendar/calendar-scheduled.js +118 -0
- package/dist/workspace/calendar/calendar-views.d.ts +32 -0
- package/dist/workspace/calendar/calendar-views.js +124 -0
- package/dist/workspace/calendar/calendar-when.d.ts +14 -0
- package/dist/workspace/calendar/calendar-when.js +81 -0
- package/dist/workspace/calendar/mention-textarea.d.ts +19 -0
- package/dist/workspace/calendar/mention-textarea.js +84 -0
- package/dist/workspace/home/access-requests-bell.js +2 -1
- package/dist/workspace/home/existing-repo-setup-prompt.d.ts +5 -8
- package/dist/workspace/home/existing-repo-setup-prompt.js +16 -42
- package/dist/workspace/home/no-agent-home.d.ts +3 -1
- package/dist/workspace/home/no-agent-home.js +2 -2
- package/dist/workspace/inbox/workspace-inbox.d.ts +1 -1
- package/dist/workspace/inbox/workspace-inbox.js +1 -1
- package/dist/workspace/layout/project-files-view.js +2 -1
- package/dist/workspace/layout/project-home.js +16 -9
- package/dist/workspace/memory/memory-page-list.js +1 -1
- package/dist/workspace/new/workspace-handoff.js +2 -1
- package/dist/workspace/projects/modal/project-icon-field.js +2 -1
- package/dist/workspace/session-workspace.js +13 -12
- package/dist/workspace/setup/setup-steps.d.ts +43 -0
- package/dist/workspace/setup/setup-steps.js +38 -0
- package/dist/workspace/setup/workspace-setup-page.d.ts +10 -0
- package/dist/workspace/setup/workspace-setup-page.js +124 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +5 -1
- package/dist/workspace/sidebar/footer/project-calendar-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-calendar-nav.js +31 -0
- package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +14 -6
- package/dist/workspace/sidebar/footer/project-chrome-nav.js +37 -25
- package/dist/workspace/sidebar/footer/project-computer-nav.d.ts +17 -9
- package/dist/workspace/sidebar/footer/project-computer-nav.js +36 -26
- package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-download-app-nav.js +25 -13
- package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-inbox-nav.js +29 -0
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +3 -13
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +6 -48
- package/dist/workspace/sidebar/footer/project-mcp-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-mcp-nav.js +31 -13
- package/dist/workspace/sidebar/footer/project-phone-app-nav.d.ts +10 -0
- package/dist/workspace/sidebar/footer/project-phone-app-nav.js +61 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +21 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.js +33 -0
- package/dist/workspace/sidebar/footer/promo-card.d.ts +41 -0
- package/dist/workspace/sidebar/footer/promo-card.js +47 -0
- package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
- package/dist/workspace/sidebar/project-nav-items.js +12 -4
- package/dist/workspace/sidebar/project-session-list.js +58 -26
- package/dist/workspace/sidebar/project-sidebar.js +2 -5
- package/dist/workspace/sidebar/project-spaces-nav.js +2 -1
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +24 -0
- package/dist/workspace/sidebar/session-brief-hover-card.js +4 -3
- package/dist/workspace/sidebar/session-group-sections.d.ts +26 -7
- package/dist/workspace/sidebar/session-group-sections.js +121 -41
- package/dist/workspace/sidebar/session-grouping.d.ts +1 -1
- package/dist/workspace/sidebar/session-grouping.js +1 -1
- package/dist/workspace/sidebar/sidebar-drill.js +6 -0
- package/dist/workspace/sidebar/sidebar-more-group.js +3 -2
- package/dist/workspace/sidebar/use-workspace-list.d.ts +7 -0
- package/dist/workspace/sidebar/use-workspace-list.js +11 -1
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +14 -0
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +46 -2
- package/dist/workspace/space/space-tab-panels.js +1 -1
- package/dist/workspace/spaces/space-details-panel.js +2 -2
- package/dist/workspace/spaces/space-timeline.js +2 -2
- package/dist/workspace/spaces/space-triggers.js +2 -2
- package/dist/workspace/spaces/space-view.js +11 -5
- package/package.json +79 -10
- package/skills/kortix-ui/SKILL.md +2 -2
- package/skills/kortix-ui/references/modules.md +5 -3
- package/dist/session/prompts/session-connect-prompt.d.ts +0 -40
- package/dist/session/thread/turn-share.d.ts +0 -16
- package/dist/session/thread/turn-share.js +0 -161
- package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +0 -11
- package/dist/workspace/sidebar/footer/promo-nav-row.js +0 -7
- /package/dist/markdown/{code/inline-chip.d.ts → inline-chip.d.ts} +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowDownIcon, ArrowUpIcon, CaretRightIcon, InfoIcon, LinkSimpleIcon, } from '@phosphor-icons/react';
|
|
4
|
+
import { Fragment } from 'react';
|
|
5
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
6
|
+
import { cn } from '../../internal/lib/utils.js';
|
|
7
|
+
import { CopyButton } from '../../markdown/copy-button.js';
|
|
8
|
+
import { Button } from '../../primitives/button.js';
|
|
9
|
+
import { Checkbox } from '../../primitives/checkbox.js';
|
|
10
|
+
import { HoverCard, HoverCardContent, HoverCardTrigger } from '../../primitives/hover-card.js';
|
|
11
|
+
import { LocalTime } from '../../primitives/local-time.js';
|
|
12
|
+
import { StatusBadge } from '../../primitives/status.js';
|
|
13
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '../../primitives/table.js';
|
|
14
|
+
import { errorToast, successToast } from '../../primitives/toast.js';
|
|
15
|
+
import { UiLink as Link, useUiRouter, useUiSearchParams, useUiShallowNavigate, } from '../../providers/ui-provider.js';
|
|
16
|
+
import { agentLabel, duration, evalDatasetHref, evalJobHref, evalJobScore, isOpenJob, jobSource, passInterval, percent, ranked, usd, } from './eval-meta.js';
|
|
17
|
+
/** The frame of a list or a matrix: the one the `Table` primitive draws, so every block matches. */
|
|
18
|
+
export const EVAL_FRAME = 'border-border bg-popover overflow-hidden rounded-md border';
|
|
19
|
+
/** A job's time: day and minute, in the viewer's zone. */
|
|
20
|
+
export const EVAL_TIME = {
|
|
21
|
+
month: 'short',
|
|
22
|
+
day: 'numeric',
|
|
23
|
+
hour: '2-digit',
|
|
24
|
+
minute: '2-digit',
|
|
25
|
+
};
|
|
26
|
+
/** The tone of a job's status: green when every trial ended clean, orange with errors. */
|
|
27
|
+
export function jobTone(job) {
|
|
28
|
+
if (job.status === 'completed')
|
|
29
|
+
return job.stats.n_errored ? 'warning' : 'success';
|
|
30
|
+
if (job.status === 'cancelled')
|
|
31
|
+
return 'neutral';
|
|
32
|
+
return 'info';
|
|
33
|
+
}
|
|
34
|
+
/** The `i` beside a title: one explanation, on hover and on focus. */
|
|
35
|
+
export function InfoHint({ text }) {
|
|
36
|
+
return (_jsxs(HoverCard, { openDelay: 150, children: [_jsx(HoverCardTrigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": text, className: "text-muted-foreground hover:text-foreground focus-visible:text-foreground inline-flex", children: _jsx(InfoIcon, { className: "size-3.5" }) }) }), _jsx(HoverCardContent, { className: "text-muted-foreground w-72 text-xs", children: text })] }));
|
|
37
|
+
}
|
|
38
|
+
export function SectionTitle({ title, info, action, }) {
|
|
39
|
+
return (_jsxs("div", { className: "flex min-h-7 items-center justify-between gap-3", children: [_jsxs("h2", { className: "text-foreground flex items-center gap-1.5 text-sm font-medium", children: [title, info ? _jsx(InfoHint, { text: info }) : null] }), action] }));
|
|
40
|
+
}
|
|
41
|
+
/** The page below a section of the Evals group: a scroll column with the breadcrumb on top. */
|
|
42
|
+
export function EvalDetailPage({ crumbs, children, wide = false, }) {
|
|
43
|
+
return (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: cn('mx-auto flex w-full flex-col gap-6 px-4 pt-5 pb-20 md:px-8', wide ? 'max-w-6xl' : 'max-w-5xl'), children: [_jsx(EvalBreadcrumb, { crumbs: crumbs }), children] }) }));
|
|
44
|
+
}
|
|
45
|
+
export function EvalBreadcrumb({ crumbs }) {
|
|
46
|
+
const t = useTranslations('evals');
|
|
47
|
+
return (_jsx("nav", { "aria-label": t('breadcrumb'), "data-testid": "evals-breadcrumb", children: _jsx("ol", { className: "text-muted-foreground flex min-w-0 flex-wrap items-center gap-1 text-xs", children: crumbs.map((crumb, i) => (_jsxs(Fragment, { children: [i > 0 ? _jsx(CaretRightIcon, { className: "size-3 shrink-0", "aria-hidden": true }) : null, _jsx("li", { className: "min-w-0 truncate", children: crumb.href ? (_jsx(Link, { href: crumb.href, className: "hover:text-foreground transition-colors", children: crumb.label })) : (_jsx("span", { className: "text-foreground", "aria-current": "page", children: crumb.label })) })] }, `${crumb.label}-${i}`))) }) }));
|
|
48
|
+
}
|
|
49
|
+
/** The title of a dataset, a task or a job: monospace, the name copied with one click. */
|
|
50
|
+
export function EvalTitle({ name, badge, description, }) {
|
|
51
|
+
const t = useTranslations('evals');
|
|
52
|
+
return (_jsxs("div", { className: "flex min-w-64 flex-1 flex-col gap-1.5", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsx("h1", { className: "text-foreground min-w-0 font-mono text-lg font-medium wrap-break-word", children: name }), _jsx(CopyButton, { code: name, label: t('copyName'), size: "sm" }), badge] }), description ? (_jsx("div", { className: "text-muted-foreground text-sm text-pretty", children: description })) : null] }));
|
|
53
|
+
}
|
|
54
|
+
/** Copies the page's link. */
|
|
55
|
+
export function ShareButton() {
|
|
56
|
+
const t = useTranslations('evals');
|
|
57
|
+
return (_jsxs(Button, { size: "sm", variant: "outline", className: "gap-1.5", onClick: () => navigator.clipboard.writeText(window.location.href).then(() => successToast(t('linkCopied')), () => errorToast(t('copyFailed'))), "data-testid": "evals-share", children: [_jsx(LinkSimpleIcon, { className: "size-3.5", "aria-hidden": true }), t('share')] }));
|
|
58
|
+
}
|
|
59
|
+
/** One shell command with a copy button: how to run the same thing from the Kortix CLI. */
|
|
60
|
+
export function RunCommand({ command }) {
|
|
61
|
+
const t = useTranslations('evals');
|
|
62
|
+
return (_jsxs("div", { className: cn(EVAL_FRAME, 'flex items-center gap-2 py-1.5 pr-1.5 pl-3'), "data-testid": "evals-run-command", children: [_jsx("span", { className: "text-muted-foreground font-mono text-xs select-none", "aria-hidden": true, children: "$" }), _jsx("code", { className: "text-foreground min-w-0 flex-1 truncate font-mono text-xs", title: command, children: command }), _jsx(CopyButton, { code: command, label: t('copyCommand'), size: "sm" })] }));
|
|
63
|
+
}
|
|
64
|
+
/** A score with its 95% interval: `82.5% ± 6.1`. */
|
|
65
|
+
export function ScoreValue({ rate, n }) {
|
|
66
|
+
const t = useTranslations('evals');
|
|
67
|
+
const interval = passInterval(rate, n);
|
|
68
|
+
return (_jsxs("span", { className: "inline-flex items-baseline justify-end gap-1 tabular-nums", children: [_jsx("span", { className: "text-foreground font-medium", children: percent(rate) }), interval ? (_jsx("span", { className: "text-muted-foreground text-xs", title: t('intervalHint', { n }), "aria-label": t('intervalLabel', { points: Math.round(interval * 1000) / 10 }), children: `± ${Math.round(interval * 1000) / 10}` })) : null] }));
|
|
69
|
+
}
|
|
70
|
+
/** A change in points, with an arrow: green up, red down. */
|
|
71
|
+
export function Change({ value }) {
|
|
72
|
+
const t = useTranslations('evals');
|
|
73
|
+
if (value === null)
|
|
74
|
+
return _jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
75
|
+
const points = Math.round(value * 1000) / 10;
|
|
76
|
+
if (points === 0)
|
|
77
|
+
return _jsx("span", { className: "text-muted-foreground tabular-nums", children: "\u00B10" });
|
|
78
|
+
const up = points > 0;
|
|
79
|
+
const Arrow = up ? ArrowUpIcon : ArrowDownIcon;
|
|
80
|
+
return (_jsxs("span", { className: "text-foreground inline-flex items-center justify-end gap-1 tabular-nums", "aria-label": t(up ? 'changeUp' : 'changeDown', { points: Math.abs(points) }), children: [_jsx(Arrow, { weight: "bold", className: `size-3 ${up ? 'text-kortix-green' : 'text-kortix-red'}`, "aria-hidden": true }), Math.abs(points)] }));
|
|
81
|
+
}
|
|
82
|
+
/** Trial counts of a job: the done share as a bar, errors in orange. */
|
|
83
|
+
export function JobProgress({ job, className }) {
|
|
84
|
+
const s = job.stats;
|
|
85
|
+
const total = Math.max(1, s.n_total_trials);
|
|
86
|
+
const clean = s.n_completed;
|
|
87
|
+
const pct = (n) => `${(n / total) * 100}%`;
|
|
88
|
+
return (_jsxs("div", { className: cn('bg-muted flex h-1.5 w-full overflow-hidden rounded-full', className), "aria-hidden": true, children: [_jsx("span", { className: "bg-foreground/70 h-full", style: { width: pct(clean) } }), _jsx("span", { className: "bg-kortix-orange h-full", style: { width: pct(s.n_errored) } }), _jsx("span", { className: "bg-muted-foreground/40 h-full", style: { width: pct(s.n_cancelled) } }), _jsx("span", { className: "bg-kortix-blue h-full", style: { width: pct(s.n_running) } })] }));
|
|
89
|
+
}
|
|
90
|
+
/** `12/40 · 2 errors`: ended trials over all, with the errors. */
|
|
91
|
+
export function trialCount(job) {
|
|
92
|
+
const s = job.stats;
|
|
93
|
+
return `${s.n_completed + s.n_errored + s.n_cancelled}/${s.n_total_trials}`;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The jobs table of the Overview, a dataset's Jobs tab and the Jobs page. With
|
|
97
|
+
* `selected`, each row has a checkbox (Compare picks two or more).
|
|
98
|
+
*/
|
|
99
|
+
export function JobsTable({ projectId, jobs, selected, onSelect, showDataset = true, }) {
|
|
100
|
+
const t = useTranslations('evals');
|
|
101
|
+
const router = useUiRouter();
|
|
102
|
+
const selectable = !!selected && !!onSelect;
|
|
103
|
+
return (_jsxs(Table, { "data-testid": "evals-jobs-table", children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [selectable ? _jsx(TableHead, { className: "w-8" }) : null, _jsx(TableHead, { children: t('colJob') }), _jsx(TableHead, { children: t('colStatus') }), _jsx(TableHead, { className: "hidden w-40 sm:table-cell", children: t('colTrials') }), _jsx(TableHead, { className: "text-right", children: t('colScore') }), _jsx(TableHead, { className: "hidden text-right lg:table-cell", children: t('colCost') }), _jsx(TableHead, { className: "hidden text-right md:table-cell", children: t('colStarted') }), _jsx(TableHead, { className: "hidden text-right xl:table-cell", children: t('colDuration') })] }) }), _jsx(TableBody, { children: jobs.map((job) => {
|
|
104
|
+
const score = evalJobScore(job);
|
|
105
|
+
const href = evalJobHref(projectId, job.job_id);
|
|
106
|
+
const s = job.stats;
|
|
107
|
+
const checked = selected?.has(job.job_id) ?? false;
|
|
108
|
+
return (_jsxs(TableRow, { className: "hover:bg-hover cursor-pointer", "data-state": checked ? 'selected' : undefined, onClick: () => router.push(href), "data-testid": "evals-job-row", children: [selectable ? (_jsx(TableCell, { className: "w-8", onClick: (e) => e.stopPropagation(), children: _jsx(Checkbox, { checked: checked, onCheckedChange: (on) => onSelect(job.job_id, on === true), "aria-label": t('selectJob', { job: job.job_name }), "data-testid": "evals-job-select" }) })) : null, _jsxs(TableCell, { className: "max-w-72", children: [_jsx(Link, { href: href, className: "text-foreground block truncate font-medium", onClick: (e) => e.stopPropagation(), children: job.job_name }), _jsx("span", { className: "text-muted-foreground block truncate text-xs", children: [showDataset ? jobSource(job) : null, score ? agentLabel(score.agent, score.model) : null]
|
|
109
|
+
.filter(Boolean)
|
|
110
|
+
.join(' · ') })] }), _jsx(TableCell, { children: _jsx(StatusBadge, { tone: jobTone(job), children: t(`status.${job.status}`) }) }), _jsx(TableCell, { className: "hidden w-40 sm:table-cell", children: _jsxs("span", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-muted-foreground text-xs tabular-nums", children: s.n_errored
|
|
111
|
+
? t('trialsWithErrors', { count: trialCount(job), errors: s.n_errored })
|
|
112
|
+
: trialCount(job) }), isOpenJob(job) ? _jsx(JobProgress, { job: job }) : null] }) }), _jsx(TableCell, { className: "text-right", children: _jsx(ScoreValue, { rate: score?.passAt1 ?? score?.mean, n: score?.validTrials ?? 0 }) }), _jsx(TableCell, { className: "text-muted-foreground hidden text-right tabular-nums lg:table-cell", children: usd(s.usage?.cost_usd) }), _jsx(TableCell, { className: "text-muted-foreground hidden text-right md:table-cell", children: _jsx(LocalTime, { value: job.started_at ?? job.created_at, options: EVAL_TIME }) }), _jsx(TableCell, { className: "text-muted-foreground hidden text-right tabular-nums xl:table-cell", children: duration(job.started_at, job.finished_at) })] }, job.job_id));
|
|
113
|
+
}) })] }));
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The leaderboard: one row per dataset × agent × model, ranked by score with
|
|
117
|
+
* ties sharing a rank, the score's 95% interval, and the change since the job
|
|
118
|
+
* before. A row opens its latest job.
|
|
119
|
+
*/
|
|
120
|
+
export function LeaderboardTable({ projectId, rows, showDataset = true, }) {
|
|
121
|
+
const t = useTranslations('evals');
|
|
122
|
+
const router = useUiRouter();
|
|
123
|
+
// Rank within each dataset: scores of two datasets are not comparable.
|
|
124
|
+
const boards = new Map();
|
|
125
|
+
for (const row of rows)
|
|
126
|
+
boards.set(row.suite, [...(boards.get(row.suite) ?? []), row]);
|
|
127
|
+
const list = [...boards.values()].flatMap((board) => ranked(board));
|
|
128
|
+
return (_jsxs(Table, { "data-testid": "evals-leaderboard", children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "w-10 text-right", children: "#" }), showDataset ? _jsx(TableHead, { children: t('colDataset') }) : null, _jsx(TableHead, { children: t('colAgent') }), _jsx(TableHead, { className: "text-right", children: _jsxs("span", { className: "inline-flex items-center gap-1", children: [t('colScore'), _jsx(InfoHint, { text: t('scoreColumnInfo') })] }) }), _jsx(TableHead, { className: "text-right", children: t('colChange') }), _jsx(TableHead, { className: "hidden text-right sm:table-cell", children: t('colRuns') }), _jsx(TableHead, { className: "hidden text-right md:table-cell", children: t('colLast') })] }) }), _jsx(TableBody, { children: list.map((row) => (_jsxs(TableRow, { className: "hover:bg-hover cursor-pointer", onClick: () => router.push(evalJobHref(projectId, row.lastJob.job_id)), "data-testid": "evals-leaderboard-row", children: [_jsx(TableCell, { className: "text-muted-foreground w-10 text-right tabular-nums", children: row.rank }), showDataset ? (_jsx(TableCell, { className: "max-w-64 truncate font-mono text-xs", title: row.suite, children: row.dataset ? (_jsx(Link, { href: evalDatasetHref(projectId, row.dataset, 'leaderboard'), className: "text-foreground hover:underline", onClick: (e) => e.stopPropagation(), children: row.suite })) : (row.suite) })) : null, _jsx(TableCell, { className: "max-w-64 truncate font-medium", children: agentLabel(row.agent, row.model) }), _jsx(TableCell, { className: "text-right", children: _jsx(ScoreValue, { rate: row.passAt1, n: row.n }) }), _jsx(TableCell, { className: "text-right", children: _jsx(Change, { value: row.change }) }), _jsx(TableCell, { className: "text-muted-foreground hidden text-right tabular-nums sm:table-cell", children: row.jobs }), _jsx(TableCell, { className: "text-muted-foreground hidden text-right md:table-cell", children: _jsx(LocalTime, { value: row.lastJob.finished_at ?? row.lastJob.created_at, options: EVAL_TIME }) })] }, `${row.suite}-${row.agent}-${row.model}`))) })] }));
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* A tab kept in the URL (`?tab=`), so a copied link opens the same tab. The
|
|
132
|
+
* first of `tabs` is the default and is left out of the URL.
|
|
133
|
+
*/
|
|
134
|
+
export function useUrlTab(tabs) {
|
|
135
|
+
const params = useUiSearchParams();
|
|
136
|
+
const navigate = useUiShallowNavigate();
|
|
137
|
+
const raw = params.get('tab');
|
|
138
|
+
const current = tabs.find((tab) => tab === raw) ?? tabs[0];
|
|
139
|
+
const set = (tab) => {
|
|
140
|
+
const next = new URLSearchParams(params.toString());
|
|
141
|
+
if (tab === tabs[0])
|
|
142
|
+
next.delete('tab');
|
|
143
|
+
else
|
|
144
|
+
next.set('tab', tab);
|
|
145
|
+
const query = next.toString();
|
|
146
|
+
navigate(`${window.location.pathname}${query ? `?${query}` : ''}`, { replace: true });
|
|
147
|
+
};
|
|
148
|
+
return [current, set];
|
|
149
|
+
}
|
|
150
|
+
/** A short line under a tab's table: `Displaying 12 of 40 tasks`. */
|
|
151
|
+
export function ListFooter({ children }) {
|
|
152
|
+
return _jsx("p", { className: "text-muted-foreground text-xs tabular-nums", children: children });
|
|
153
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { EVAL_FRAME, EVAL_TIME, InfoHint, jobTone } from './eval-ui.js';
|
|
2
|
+
/**
|
|
3
|
+
* Customize → Evals → Overview: the jobs running now, the leaderboard (each
|
|
4
|
+
* dataset × agent × model: its latest score, its 95% interval and the change
|
|
5
|
+
* since the job before) and the newest jobs. Re-reads every 5 seconds while a
|
|
6
|
+
* job runs.
|
|
7
|
+
*/
|
|
8
|
+
export declare function EvalsPage({ projectId }: {
|
|
9
|
+
projectId: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useWorkspaceEvalJobs, useWorkspaceEvalSuites } from '@kortix/sdk/react';
|
|
4
|
+
import { ChartBarIcon, PlayIcon } from '@phosphor-icons/react';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
7
|
+
import { Button } from '../../primitives/button.js';
|
|
8
|
+
import { EmptyArt } from '../../primitives/empty-art.js';
|
|
9
|
+
import { EmptyState } from '../../primitives/empty-state.js';
|
|
10
|
+
import { ErrorState } from '../../primitives/error-state.js';
|
|
11
|
+
import { Skeleton } from '../../primitives/skeleton.js';
|
|
12
|
+
import { UiLink as Link } from '../../providers/ui-provider.js';
|
|
13
|
+
import { CapabilityPageShell } from '../shared/capability-page-shell.js';
|
|
14
|
+
import { agentLabel, evalDatasetsHref, evalJobHref, evalJobScore, evalJobsHref, isOpenJob, jobSource, leaderboard, } from './eval-meta.js';
|
|
15
|
+
import { EVAL_FRAME, InfoHint, JobProgress, JobsTable, LeaderboardTable, RunCommand, SectionTitle, trialCount, } from './eval-ui.js';
|
|
16
|
+
import { RunEvalModal } from './run-eval-modal.js';
|
|
17
|
+
// The page's shared pieces moved to eval-ui.tsx; the job view and older imports still read them here.
|
|
18
|
+
export { EVAL_FRAME, EVAL_TIME, InfoHint, jobTone } from './eval-ui.js';
|
|
19
|
+
/** Jobs the Overview lists under the leaderboard; the Jobs page lists every one. */
|
|
20
|
+
const RECENT = 5;
|
|
21
|
+
/**
|
|
22
|
+
* Customize → Evals → Overview: the jobs running now, the leaderboard (each
|
|
23
|
+
* dataset × agent × model: its latest score, its 95% interval and the change
|
|
24
|
+
* since the job before) and the newest jobs. Re-reads every 5 seconds while a
|
|
25
|
+
* job runs.
|
|
26
|
+
*/
|
|
27
|
+
export function EvalsPage({ projectId }) {
|
|
28
|
+
const t = useTranslations('evals');
|
|
29
|
+
const suites = useWorkspaceEvalSuites(projectId);
|
|
30
|
+
const jobs = useWorkspaceEvalJobs(projectId);
|
|
31
|
+
// `false`: closed. A target: the modal opens on it. `null`: the first one.
|
|
32
|
+
const [running, setRunning] = useState(false);
|
|
33
|
+
const list = jobs.data ?? [];
|
|
34
|
+
const board = leaderboard(list);
|
|
35
|
+
const open = list.filter(isOpenJob);
|
|
36
|
+
const suiteList = suites.data ?? [];
|
|
37
|
+
const loading = suites.isLoading || jobs.isLoading;
|
|
38
|
+
return (_jsxs(CapabilityPageShell, { title: t('title'), description: t('description'), titleAddon: _jsx(InfoHint, { text: t('titleInfo') }), action: loading ? undefined : (_jsxs(Button, { size: "sm", className: "gap-1.5", onClick: () => setRunning(null), "data-testid": "evals-run", children: [_jsx(PlayIcon, { weight: "fill", className: "size-3.5 shrink-0", "aria-hidden": true }), t('newJob')] })), children: [_jsx(RunEvalModal, { projectId: projectId, suites: suiteList, target: running || null, open: running !== false, onOpenChange: (next) => !next && setRunning(false) }), suites.isError && jobs.isError ? (_jsx(ErrorState, { size: "sm", title: t('loadError'), action: _jsx(Button, { size: "sm", variant: "outline", onClick: () => void Promise.all([suites.refetch(), jobs.refetch()]), children: t('retry') }) })) : loading ? (_jsx("div", { className: "flex flex-col gap-2", "aria-busy": true, children: [0, 1, 2, 3].map((i) => (_jsx(Skeleton, { className: "h-12 w-full rounded-md" }, i))) })) : list.length === 0 ? (_jsx(GetStarted, { hasSuites: suiteList.length > 0, projectId: projectId, onRun: () => setRunning(suiteList[0]?.config
|
|
39
|
+
? { kind: 'suite', name: suiteList[0].name }
|
|
40
|
+
: { kind: 'dataset', name: 'kortix/my-kortix' }) })) : (_jsxs("div", { className: "flex flex-col gap-8", children: [open.length ? _jsx(RunningNow, { projectId: projectId, jobs: open }) : null, _jsxs("section", { className: "flex flex-col gap-3", "aria-label": t('leaderboard'), children: [_jsx(SectionTitle, { title: t('leaderboard'), info: t('leaderboardInfo') }), board.length ? (_jsx(LeaderboardTable, { projectId: projectId, rows: board })) : (_jsx("div", { className: `${EVAL_FRAME} text-muted-foreground px-4 py-6 text-center text-sm`, children: t('noLeaderboard') }))] }), _jsxs("section", { className: "flex flex-col gap-3", "aria-label": t('recentJobs'), children: [_jsx(SectionTitle, { title: t('recentJobs'), action: _jsx(Button, { asChild: true, size: "xs", variant: "ghost", children: _jsx(Link, { href: evalJobsHref(projectId), children: t('allJobs', { count: jobs.total }) }) }) }), _jsx(JobsTable, { projectId: projectId, jobs: list.slice(0, RECENT) })] })] }))] }));
|
|
41
|
+
}
|
|
42
|
+
/** The jobs that have not ended, each with its progress bar. */
|
|
43
|
+
function RunningNow({ projectId, jobs }) {
|
|
44
|
+
const t = useTranslations('evals');
|
|
45
|
+
return (_jsxs("section", { className: "flex flex-col gap-3", "aria-label": t('runningNow'), "data-testid": "evals-running", children: [_jsx(SectionTitle, { title: t('runningNow') }), _jsx("ul", { className: `${EVAL_FRAME} divide-border divide-y`, children: jobs.map((job) => {
|
|
46
|
+
const score = evalJobScore(job);
|
|
47
|
+
return (_jsx("li", { children: _jsxs(Link, { href: evalJobHref(projectId, job.job_id), className: "hover:bg-hover flex items-center gap-4 px-4 py-3 transition-colors", children: [_jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [_jsx("span", { className: "text-foreground truncate text-sm font-medium", children: job.job_name }), _jsx("span", { className: "text-muted-foreground truncate text-xs", children: [jobSource(job), score ? agentLabel(score.agent, score.model) : null]
|
|
48
|
+
.filter(Boolean)
|
|
49
|
+
.join(' · ') })] }), _jsxs("span", { className: "flex w-32 shrink-0 flex-col items-end gap-1 sm:w-48", children: [_jsx("span", { className: "text-muted-foreground text-xs tabular-nums", children: t('finishedOf', { count: trialCount(job) }) }), _jsx(JobProgress, { job: job })] })] }) }, job.job_id));
|
|
50
|
+
}) })] }));
|
|
51
|
+
}
|
|
52
|
+
/** No job yet: the three ways to start, the first one a click away. */
|
|
53
|
+
function GetStarted({ projectId, hasSuites, onRun, }) {
|
|
54
|
+
const t = useTranslations('evals');
|
|
55
|
+
return (_jsxs("div", { className: "flex flex-col gap-6", "data-testid": "evals-empty", children: [_jsx(EmptyState, { media: _jsx(EmptyArt, { icon: ChartBarIcon }), title: t('noJobsTitle'), description: t('noJobsDescription'), action: _jsxs("div", { className: "flex flex-wrap items-center justify-center gap-2", children: [_jsx(Button, { size: "sm", onClick: onRun, children: hasSuites ? t('runFirstSuite') : t('runBuiltin') }), _jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: evalDatasetsHref(projectId), children: t('browseDatasets') }) })] }) }), _jsxs("div", { className: "mx-auto flex w-full max-w-xl flex-col gap-2", children: [_jsx("p", { className: "text-muted-foreground text-xs", children: t('startFromCli') }), _jsx(RunCommand, { command: "kortix evals run --dataset kortix/my-kortix --agent <agent>" }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('startFromYaml') }), _jsx("pre", { className: `${EVAL_FRAME} text-foreground overflow-x-auto p-3 font-mono text-xs`, children: 'evals:\n smoke:\n agents: [worker]\n tasks: [{ path: evals/smoke }]' })] })] }));
|
|
56
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { WorkspaceEvalSuite } from '@kortix/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* What a job runs: a suite of kortix.yaml, or a dataset by name (built-in or
|
|
4
|
+
* Harbor registry). `tasks` keeps only those tasks (a task page runs one).
|
|
5
|
+
*/
|
|
6
|
+
export type RunTarget = {
|
|
7
|
+
kind: 'suite';
|
|
8
|
+
name: string;
|
|
9
|
+
tasks?: string[];
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'dataset';
|
|
12
|
+
name: string;
|
|
13
|
+
version?: string | null;
|
|
14
|
+
tasks?: string[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Run an eval: pick a suite or a built-in dataset, an agent, optionally a
|
|
18
|
+
* model, attempts and how many trials run at once. Empty fields keep the
|
|
19
|
+
* suite's own. A started job opens its page.
|
|
20
|
+
*/
|
|
21
|
+
export declare function RunEvalModal({ projectId, suites, target: initial, open, onOpenChange, }: {
|
|
22
|
+
projectId: string;
|
|
23
|
+
suites: WorkspaceEvalSuite[];
|
|
24
|
+
/** The target to preselect; null: the first suite, else the first built-in dataset. */
|
|
25
|
+
target: RunTarget | null;
|
|
26
|
+
open: boolean;
|
|
27
|
+
onOpenChange: (open: boolean) => void;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useVisibleAgents, useWorkspaceEvalActions, useWorkspaceEvalDatasets, } from '@kortix/sdk/react';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
6
|
+
import { Alert, AlertDescription, AlertTitle } from '../../primitives/alert.js';
|
|
7
|
+
import { Button } from '../../primitives/button.js';
|
|
8
|
+
import { Field, FieldDescription, FieldLabel } from '../../primitives/field.js';
|
|
9
|
+
import { Input } from '../../primitives/input.js';
|
|
10
|
+
import Loading from '../../primitives/loading.js';
|
|
11
|
+
import { Modal, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalTitle, } from '../../primitives/modal.js';
|
|
12
|
+
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue, } from '../../primitives/select.js';
|
|
13
|
+
import { successToast } from '../../primitives/toast.js';
|
|
14
|
+
import { useUiRouter } from '../../providers/ui-provider.js';
|
|
15
|
+
import { evalJobHref } from './eval-meta.js';
|
|
16
|
+
const AS_SUITE = '__suite__';
|
|
17
|
+
const key = (target) => `${target.kind}:${target.name}`;
|
|
18
|
+
const parse = (value) => {
|
|
19
|
+
const at = value.indexOf(':');
|
|
20
|
+
const kind = value.slice(0, at);
|
|
21
|
+
return kind === 'suite' || kind === 'dataset' ? { kind, name: value.slice(at + 1) } : null;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Run an eval: pick a suite or a built-in dataset, an agent, optionally a
|
|
25
|
+
* model, attempts and how many trials run at once. Empty fields keep the
|
|
26
|
+
* suite's own. A started job opens its page.
|
|
27
|
+
*/
|
|
28
|
+
export function RunEvalModal({ projectId, suites, target: initial, open, onOpenChange, }) {
|
|
29
|
+
const t = useTranslations('evals');
|
|
30
|
+
const router = useUiRouter();
|
|
31
|
+
const actions = useWorkspaceEvalActions(projectId);
|
|
32
|
+
const { start } = actions;
|
|
33
|
+
const datasets = useWorkspaceEvalDatasets(open ? projectId : null);
|
|
34
|
+
const agents = useVisibleAgents({ projectId });
|
|
35
|
+
const runnable = suites.filter((s) => s.config);
|
|
36
|
+
const catalog = datasets.data?.datasets ?? [];
|
|
37
|
+
const builtins = catalog.filter((d) => d.kind === 'builtin');
|
|
38
|
+
// A registry dataset opened from its page is a choice too, beside the built-ins.
|
|
39
|
+
const extra = initial?.kind === 'dataset' && !builtins.some((d) => d.name === initial.name)
|
|
40
|
+
? [initial.name]
|
|
41
|
+
: [];
|
|
42
|
+
const [target, setTarget] = useState('');
|
|
43
|
+
const [agent, setAgent] = useState(AS_SUITE);
|
|
44
|
+
const [model, setModel] = useState('');
|
|
45
|
+
const [attempts, setAttempts] = useState('');
|
|
46
|
+
const [concurrency, setConcurrency] = useState('');
|
|
47
|
+
// Each open starts from the target it was opened for.
|
|
48
|
+
const [wasOpen, setWasOpen] = useState(open);
|
|
49
|
+
if (open !== wasOpen) {
|
|
50
|
+
setWasOpen(open);
|
|
51
|
+
if (open) {
|
|
52
|
+
const first = initial ?? (runnable[0] ? { kind: 'suite', name: runnable[0].name } : null);
|
|
53
|
+
setTarget(first ? key(first) : '');
|
|
54
|
+
setAgent(first?.kind === 'suite' ? AS_SUITE : '');
|
|
55
|
+
setModel('');
|
|
56
|
+
setAttempts('');
|
|
57
|
+
setConcurrency('');
|
|
58
|
+
start.reset();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// No suite to preselect: the first built-in dataset, once the list loads.
|
|
62
|
+
if (open && !target && builtins[0])
|
|
63
|
+
setTarget(`dataset:${builtins[0].name}`);
|
|
64
|
+
const chosen = parse(target);
|
|
65
|
+
const suite = chosen?.kind === 'suite' ? runnable.find((s) => s.name === chosen.name) : undefined;
|
|
66
|
+
// The version and the task filter belong to the target the modal opened on.
|
|
67
|
+
const sameAsInitial = !!chosen && !!initial && chosen.kind === initial.kind && chosen.name === initial.name;
|
|
68
|
+
const version = sameAsInitial && initial?.kind === 'dataset' ? (initial.version ?? null) : null;
|
|
69
|
+
const onlyTasks = sameAsInitial ? (initial?.tasks ?? []) : [];
|
|
70
|
+
const agentNames = [
|
|
71
|
+
...new Set([
|
|
72
|
+
...(suite?.config?.agents ?? []).map((a) => a.name),
|
|
73
|
+
...agents.map((a) => a.name),
|
|
74
|
+
'oracle',
|
|
75
|
+
'nop',
|
|
76
|
+
]),
|
|
77
|
+
];
|
|
78
|
+
const needsAgent = chosen?.kind === 'dataset' && (!agent || agent === AS_SUITE);
|
|
79
|
+
const ready = !!chosen && (chosen.kind === 'dataset' || !!suite) && !needsAgent && !start.isPending;
|
|
80
|
+
const request = () => {
|
|
81
|
+
if (!chosen)
|
|
82
|
+
return null;
|
|
83
|
+
const config = {};
|
|
84
|
+
const modelName = model.trim();
|
|
85
|
+
if (agent && agent !== AS_SUITE)
|
|
86
|
+
config.agents = [{ name: agent, ...(modelName ? { model_name: modelName } : {}) }];
|
|
87
|
+
else if (modelName && suite?.config)
|
|
88
|
+
config.agents = suite.config.agents.map((a) => ({
|
|
89
|
+
...a,
|
|
90
|
+
model_name: modelName,
|
|
91
|
+
}));
|
|
92
|
+
if (Number(attempts) >= 1)
|
|
93
|
+
config.n_attempts = Math.floor(Number(attempts));
|
|
94
|
+
if (Number(concurrency) >= 1)
|
|
95
|
+
config.n_concurrent_trials = Math.floor(Number(concurrency));
|
|
96
|
+
const filter = onlyTasks.length ? { task_names: onlyTasks } : {};
|
|
97
|
+
if (chosen.kind === 'dataset') {
|
|
98
|
+
config.datasets = [{ name: chosen.name, ...(version ? { version } : {}), ...filter }];
|
|
99
|
+
config.tasks = [];
|
|
100
|
+
}
|
|
101
|
+
else if (onlyTasks.length && suite?.config) {
|
|
102
|
+
config.tasks = suite.config.tasks.map((source) => ({ ...source, ...filter }));
|
|
103
|
+
config.datasets = suite.config.datasets.map((source) => ({ ...source, ...filter }));
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
...(chosen.kind === 'suite' ? { suite: chosen.name } : {}),
|
|
107
|
+
...(Object.keys(config).length ? { config } : {}),
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
const planInput = ready ? JSON.stringify(request()) : '';
|
|
111
|
+
// The dry run: what Start would queue, re-read 400 ms after the form stops changing.
|
|
112
|
+
const { plan } = actions;
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (!open || !planInput)
|
|
115
|
+
return;
|
|
116
|
+
const timer = setTimeout(() => plan.mutate(JSON.parse(planInput)), 400);
|
|
117
|
+
return () => clearTimeout(timer);
|
|
118
|
+
// `plan` is a new object each render; the input is the key.
|
|
119
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
120
|
+
}, [open, planInput]);
|
|
121
|
+
const submit = () => {
|
|
122
|
+
const input = request();
|
|
123
|
+
if (!input)
|
|
124
|
+
return;
|
|
125
|
+
start.mutate(input, {
|
|
126
|
+
onSuccess: (job) => {
|
|
127
|
+
successToast(t('started', { job: job.job_name }));
|
|
128
|
+
onOpenChange(false);
|
|
129
|
+
router.push(evalJobHref(projectId, job.job_id));
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
// The API's `422 eval_invalid` names every problem in `violations`.
|
|
134
|
+
// A dry run that the API refuses (`422`) shows its violations before Start is pressed.
|
|
135
|
+
const planRefused = plan.error instanceof Error && plan.error.status === 422 && ready
|
|
136
|
+
? plan.error
|
|
137
|
+
: null;
|
|
138
|
+
const error = start.error instanceof Error ? start.error : planRefused;
|
|
139
|
+
const body = error?.data;
|
|
140
|
+
const violations = Array.isArray(body?.violations)
|
|
141
|
+
? body.violations.filter((v) => typeof v === 'string')
|
|
142
|
+
: [];
|
|
143
|
+
return (_jsx(Modal, { open: open, onOpenChange: (next) => !start.isPending && onOpenChange(next), children: _jsxs(ModalContent, { variant: "base", showCloseButton: !start.isPending, className: "sm:max-w-lg", "data-testid": "evals-run-modal", children: [_jsxs(ModalHeader, { className: "pr-14", children: [_jsx(ModalTitle, { children: t('runTitle') }), _jsx(ModalDescription, { className: "text-pretty", children: t('runDescription') })] }), _jsxs("form", { className: "flex flex-col gap-4 px-5 pb-2", onSubmit: (e) => {
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
if (ready)
|
|
146
|
+
submit();
|
|
147
|
+
}, children: [_jsxs(Field, { children: [_jsx(FieldLabel, { children: t('whatToRun') }), _jsxs(Select, { value: target, onValueChange: (value) => {
|
|
148
|
+
setTarget(value);
|
|
149
|
+
setAgent(parse(value)?.kind === 'suite' ? AS_SUITE : '');
|
|
150
|
+
}, children: [_jsx(SelectTrigger, { "aria-label": t('whatToRun'), "data-testid": "evals-run-target", children: _jsx(SelectValue, { placeholder: t('pickTarget') }) }), _jsxs(SelectContent, { children: [runnable.length ? (_jsxs(SelectGroup, { children: [_jsx(SelectLabel, { children: t('suitesGroup') }), runnable.map((s) => (_jsx(SelectItem, { value: `suite:${s.name}`, children: s.name }, s.name)))] })) : null, builtins.length ? (_jsxs(SelectGroup, { children: [_jsx(SelectLabel, { children: t('builtinGroup') }), builtins.map((d) => (_jsx(SelectItem, { value: `dataset:${d.name}`, children: d.name }, d.name)))] })) : null, extra.length ? (_jsxs(SelectGroup, { children: [_jsx(SelectLabel, { children: t('registryGroup') }), extra.map((name) => (_jsx(SelectItem, { value: `dataset:${name}`, children: name }, name)))] })) : null] })] }), chosen?.kind === 'dataset' || onlyTasks.length || version ? (_jsx(FieldDescription, { children: [
|
|
151
|
+
chosen?.kind === 'dataset'
|
|
152
|
+
? catalog.find((d) => d.name === chosen.name)?.description
|
|
153
|
+
: null,
|
|
154
|
+
version ? t('runVersion', { version }) : null,
|
|
155
|
+
onlyTasks.length === 1
|
|
156
|
+
? t('runOneTask', { task: onlyTasks[0] })
|
|
157
|
+
: onlyTasks.length
|
|
158
|
+
? t('runSomeTasks', { count: onlyTasks.length })
|
|
159
|
+
: null,
|
|
160
|
+
]
|
|
161
|
+
.filter(Boolean)
|
|
162
|
+
.join(' · ') })) : null] }), _jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsxs(Field, { children: [_jsx(FieldLabel, { children: t('agent') }), _jsxs(Select, { value: agent, onValueChange: setAgent, children: [_jsx(SelectTrigger, { "aria-label": t('agent'), "data-testid": "evals-run-agent", children: _jsx(SelectValue, { placeholder: t('pickAgent') }) }), _jsxs(SelectContent, { children: [chosen?.kind === 'suite' ? (_jsx(SelectItem, { value: AS_SUITE, children: t('agentDefault') })) : null, agentNames.map((name) => (_jsx(SelectItem, { value: name, children: name === 'oracle' ? t('agentOracle') : name === 'nop' ? t('agentNop') : name }, name)))] })] })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { children: t('model') }), _jsx(Input, { value: model, onChange: (e) => setModel(e.target.value), placeholder: t('modelPlaceholder'), "aria-label": t('model') })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { children: t('attempts') }), _jsx(Input, { type: "number", inputMode: "numeric", min: 1, max: 100, value: attempts, onChange: (e) => setAttempts(e.target.value), placeholder: String(suite?.config?.n_attempts ?? 1), "aria-label": t('attempts'), "data-testid": "evals-run-attempts" })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { children: t('concurrency') }), _jsx(Input, { type: "number", inputMode: "numeric", min: 1, max: 32, value: concurrency, onChange: (e) => setConcurrency(e.target.value), placeholder: String(suite?.config?.n_concurrent_trials ?? 4), "aria-label": t('concurrency') })] })] }), ready && !error && plan.data && !plan.isError ? (_jsxs("p", { className: "text-muted-foreground text-xs tabular-nums", "data-testid": "evals-run-plan", children: [t('planLine', {
|
|
163
|
+
trials: plan.data.n_trials,
|
|
164
|
+
tasks: plan.data.n_tasks,
|
|
165
|
+
agents: plan.data.agents.length,
|
|
166
|
+
}), plan.data.warnings.length ? ` · ${plan.data.warnings.join(' ')}` : ''] })) : null, error ? (_jsxs(Alert, { variant: "destructive", "data-testid": "evals-run-error", children: [_jsx(AlertTitle, { children: t('startFailed') }), _jsx(AlertDescription, { children: violations.length ? (_jsx("ul", { className: "list-disc space-y-0.5 pl-4", children: violations.map((line) => (_jsx("li", { className: "wrap-break-word", children: line }, line))) })) : (_jsx("span", { className: "wrap-break-word", children: error.message })) })] })) : null, _jsx("button", { type: "submit", hidden: true, "aria-hidden": true, tabIndex: -1 })] }), _jsxs(ModalFooter, { children: [_jsx(Button, { variant: "ghost", onClick: () => onOpenChange(false), disabled: start.isPending, children: t('close') }), _jsxs(Button, { onClick: submit, disabled: !ready, "aria-busy": start.isPending, className: "gap-1.5", "data-testid": "evals-run-start", children: [start.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, t('start')] })] })] }) }));
|
|
167
|
+
}
|
|
@@ -15,6 +15,7 @@ import { type ProjectSettingsSectionKey } from './project-settings-sections.js';
|
|
|
15
15
|
* Security (MFA, session policy, key policy, oversight), Branding, Git,
|
|
16
16
|
* Sandbox, Feature flags, API keys, Capture (while Capture is on).
|
|
17
17
|
* 2. **Library** — the global variant of each library page.
|
|
18
|
+
* **Evals** (flag `evals`) — Overview, Datasets, Tasks, Jobs.
|
|
18
19
|
* 3. **People** — Members (one roster, one role per person), Groups, Roles,
|
|
19
20
|
* Identity, Audit log.
|
|
20
21
|
* 4. **Billing** — Plan, Usage.
|
|
@@ -24,7 +25,7 @@ import { type ProjectSettingsSectionKey } from './project-settings-sections.js';
|
|
|
24
25
|
* rename it in the registry, which keeps the old id as an alias.
|
|
25
26
|
*/
|
|
26
27
|
export type ProjectAdminSectionKey = WorkspaceSettingsSection;
|
|
27
|
-
export type ProjectAdminResourceKey = Extract<WorkspaceSettingsSection, 'agents' | 'connectors' | 'skills' | 'triggers' | 'models' | 'secrets' | 'apps' | 'drives' | 'repo'>;
|
|
28
|
+
export type ProjectAdminResourceKey = Extract<WorkspaceSettingsSection, 'agents' | 'connectors' | 'skills' | 'triggers' | 'evals' | 'eval-datasets' | 'eval-tasks' | 'eval-jobs' | 'models' | 'secrets' | 'apps' | 'drives' | 'repo'>;
|
|
28
29
|
/**
|
|
29
30
|
* The Settings sections this page lists. Review is not one: it is its own
|
|
30
31
|
* standalone surface, and `projectSettingsSections` never lists it.
|
|
@@ -72,7 +73,7 @@ export interface ProjectAdminResource {
|
|
|
72
73
|
* The flag the row needs. Repo is a library only with `drives` on; with it
|
|
73
74
|
* off, the sidebar's Files row is the repo browser (`projectNavRows`).
|
|
74
75
|
*/
|
|
75
|
-
flag?: 'drives';
|
|
76
|
+
flag?: 'drives' | 'evals';
|
|
76
77
|
/**
|
|
77
78
|
* The row opens on its capability alone, without Settings access. Agents:
|
|
78
79
|
* a member who may read the agents browsed them under Customize before
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppWindowIcon, BookOpenTextIcon, CpuIcon, FoldersIcon, HardDrivesIcon, KeyIcon, PlugsConnectedIcon, RobotIcon, TimerIcon, } from '@phosphor-icons/react';
|
|
1
|
+
import { AppWindowIcon, ChartBarIcon, DatabaseIcon, ListChecksIcon, PlayCircleIcon, BookOpenTextIcon, CpuIcon, FoldersIcon, HardDrivesIcon, KeyIcon, PlugsConnectedIcon, RobotIcon, TimerIcon, } from '@phosphor-icons/react';
|
|
2
2
|
import { WORKSPACE_SETTINGS_GROUPS as REGISTRY_GROUPS, parseWorkspaceSettingsSection, } from '../../_vendor/kortix-shared.js';
|
|
3
3
|
import { adminPath } from '../../lib/routes.js';
|
|
4
4
|
/** The rail, in order. Each row still follows its own visibility rule. */
|
|
@@ -75,6 +75,11 @@ export const PROJECT_ADMIN_RESOURCES = [
|
|
|
75
75
|
// Triggers: kortix.yaml triggers and runtime triggers (loops) on one page.
|
|
76
76
|
// The key stays `triggers`: it is the URL segment, and live links name it.
|
|
77
77
|
{ key: 'triggers', icon: TimerIcon, capability: 'triggers', host: false },
|
|
78
|
+
// Evals (flag `evals`): every member reads scores; starting a job needs project.session.start (the API's rule).
|
|
79
|
+
{ key: 'evals', icon: ChartBarIcon, capability: null, host: false, flag: 'evals', memberOpen: true },
|
|
80
|
+
{ key: 'eval-datasets', icon: DatabaseIcon, capability: null, host: false, flag: 'evals', memberOpen: true },
|
|
81
|
+
{ key: 'eval-tasks', icon: ListChecksIcon, capability: null, host: false, flag: 'evals', memberOpen: true },
|
|
82
|
+
{ key: 'eval-jobs', icon: PlayCircleIcon, capability: null, host: false, flag: 'evals', memberOpen: true },
|
|
78
83
|
{ key: 'models', icon: CpuIcon, capability: 'models', host: false },
|
|
79
84
|
{ key: 'repo', icon: FoldersIcon, capability: 'files', host: false, flag: 'drives' },
|
|
80
85
|
];
|
|
@@ -82,6 +82,19 @@ export declare function ProviderConnectView({ inUse, available, totalCount, hidd
|
|
|
82
82
|
* surfaces tell one story (KRTX-1482).
|
|
83
83
|
*/
|
|
84
84
|
export declare function useManagedProvider(projectId: string | null): LlmProviderEntry;
|
|
85
|
+
/**
|
|
86
|
+
* Every provider id with a usable credential: the project's own connections
|
|
87
|
+
* plus the usable pooled (account-level) ones. Ids stay raw, so a ChatGPT
|
|
88
|
+
* login is `codex` here and `connectedVia` can still say "signIn".
|
|
89
|
+
*/
|
|
90
|
+
export declare function providerConnectionIds(connectedIds: Iterable<string | null | undefined>, pooledProviderIds: Iterable<string | null | undefined>): ReadonlySet<string>;
|
|
91
|
+
/**
|
|
92
|
+
* True when a provider ROW is connected. A subscription login connects the
|
|
93
|
+
* row it belongs to under its own id (`codex` → OpenAI, `claude-agent` →
|
|
94
|
+
* Anthropic, `SUBSCRIPTION_ROW`), whether the project holds it or the
|
|
95
|
+
* account shares it. The usage meter maps through the same table.
|
|
96
|
+
*/
|
|
97
|
+
export declare function providerRowConnected(rowId: string, ids: ReadonlySet<string>): boolean;
|
|
85
98
|
/** Provider ids that hold a usable pooled (account-level) key for this project. */
|
|
86
99
|
export declare function usePooledProviderIds(projectId: string, enabled: boolean): {
|
|
87
100
|
accountId: string | undefined;
|
|
@@ -150,6 +150,32 @@ export function useManagedProvider(projectId) {
|
|
|
150
150
|
};
|
|
151
151
|
}, [pickerCatalog, tAccess]);
|
|
152
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Every provider id with a usable credential: the project's own connections
|
|
155
|
+
* plus the usable pooled (account-level) ones. Ids stay raw, so a ChatGPT
|
|
156
|
+
* login is `codex` here and `connectedVia` can still say "signIn".
|
|
157
|
+
*/
|
|
158
|
+
export function providerConnectionIds(connectedIds, pooledProviderIds) {
|
|
159
|
+
const ids = new Set();
|
|
160
|
+
for (const id of [...connectedIds, ...pooledProviderIds])
|
|
161
|
+
if (id)
|
|
162
|
+
ids.add(id);
|
|
163
|
+
return ids;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* True when a provider ROW is connected. A subscription login connects the
|
|
167
|
+
* row it belongs to under its own id (`codex` → OpenAI, `claude-agent` →
|
|
168
|
+
* Anthropic, `SUBSCRIPTION_ROW`), whether the project holds it or the
|
|
169
|
+
* account shares it. The usage meter maps through the same table.
|
|
170
|
+
*/
|
|
171
|
+
export function providerRowConnected(rowId, ids) {
|
|
172
|
+
if (ids.has(rowId))
|
|
173
|
+
return true;
|
|
174
|
+
for (const id of ids)
|
|
175
|
+
if (SUBSCRIPTION_ROW[id] === rowId)
|
|
176
|
+
return true;
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
153
179
|
/** Provider ids that hold a usable pooled (account-level) key for this project. */
|
|
154
180
|
export function usePooledProviderIds(projectId, enabled) {
|
|
155
181
|
const project = useQuery({
|
|
@@ -214,6 +240,7 @@ export function ProviderConnect({ projectId, enabled = true, selectedId, onSelec
|
|
|
214
240
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
215
241
|
], [access.data?.enforced, managedProvider, catalogRevision]);
|
|
216
242
|
const { inUse, available } = useMemo(() => {
|
|
243
|
+
const ids = providerConnectionIds(connectedIds, pooled.pooledProviderIds);
|
|
217
244
|
const ordered = orderProviderRows({
|
|
218
245
|
providers: searchable,
|
|
219
246
|
firstClassIds: ['kortix', ...FIRST_CLASS_PROVIDER_IDS],
|
|
@@ -231,13 +258,10 @@ export function ProviderConnect({ projectId, enabled = true, selectedId, onSelec
|
|
|
231
258
|
hint: entry.hint,
|
|
232
259
|
status: method === 'included'
|
|
233
260
|
? entry.models.length > 0 ? 'included' : 'none'
|
|
234
|
-
:
|
|
235
|
-
pooled.pooledProviderIds.has(entry.id) ||
|
|
236
|
-
// A ChatGPT sign-in connects OpenAI as provider `codex`.
|
|
237
|
-
(entry.id === 'openai' && connectedIds.has('codex'))
|
|
261
|
+
: providerRowConnected(entry.id, ids)
|
|
238
262
|
? 'connected'
|
|
239
263
|
: 'none',
|
|
240
|
-
via: connectedVia(entry.id,
|
|
264
|
+
via: connectedVia(entry.id, ids),
|
|
241
265
|
disabled: disabledProviders.has(entry.id),
|
|
242
266
|
usage: usageByRow.get(entry.id) ?? null,
|
|
243
267
|
};
|
|
@@ -38,7 +38,7 @@ import { ClaudeCodeStep } from '../sections/llm-provider/claude-code-step.js';
|
|
|
38
38
|
export { ClaudeCodeStep };
|
|
39
39
|
import { SplitSheetBody, SplitSheetDescription, SplitSheetFooter, SplitSheetHeader, SplitSheetTitle, } from '../../primitives/split-sheet.js';
|
|
40
40
|
import { errorToast, successToast } from '../../primitives/toast.js';
|
|
41
|
-
import { ProviderLogoStatus, connectedVia, providerMethod, supportsPooledProviderKey, useManagedProvider, usePooledProviderIds, useProviderMeta, } from './provider-connect.js';
|
|
41
|
+
import { ProviderLogoStatus, connectedVia, providerConnectionIds, providerMethod, providerRowConnected, supportsPooledProviderKey, useManagedProvider, usePooledProviderIds, useProviderMeta, } from './provider-connect.js';
|
|
42
42
|
import { ChatGptSubscriptionConnect, useSubscriptionSignIn, } from '../sections/llm-provider/chatgpt-subscription-connect.js';
|
|
43
43
|
import { useConnectedProviders } from '../sections/llm-provider/use-connected-providers.js';
|
|
44
44
|
import { envVarPlaceholder, formatTokenCount, prettyFieldLabel, providerDisconnectPlan, } from '../sections/llm-provider/utils.js';
|
|
@@ -272,12 +272,13 @@ export function ProviderSheet({ projectId, providerId, canWrite, enabled = true,
|
|
|
272
272
|
if (!entry)
|
|
273
273
|
return null;
|
|
274
274
|
const method = providerMethod(entry);
|
|
275
|
-
|
|
275
|
+
// Project connections plus account-shared ones: a shared ChatGPT login
|
|
276
|
+
// (`codex`) connects OpenAI, and the header says how.
|
|
277
|
+
const connectedIdSet = providerConnectionIds(connectedProviders.map((provider) => provider.id), pooled.pooledProviderIds);
|
|
276
278
|
const keyConnected = connectedProviders.some((provider) => provider.id === entry.id);
|
|
277
|
-
const subscriptionConnected = connectedProviders.some((provider) => provider.id === (entry.id === 'openai' ? 'codex' : entry.id));
|
|
278
279
|
const status = method === 'included'
|
|
279
280
|
? 'included'
|
|
280
|
-
:
|
|
281
|
+
: providerRowConnected(entry.id, connectedIdSet)
|
|
281
282
|
? 'connected'
|
|
282
283
|
: 'none';
|
|
283
284
|
const accessData = access.data;
|
|
@@ -79,7 +79,10 @@ export function TeamsByoWizard({ projectId, mode, open, onOpenChange, }) {
|
|
|
79
79
|
const [tenantId, setTenantId] = useState('');
|
|
80
80
|
const [error, setError] = useState(null);
|
|
81
81
|
const connect = useConnectTeams();
|
|
82
|
-
|
|
82
|
+
// The wizard stays mounted while closed. Fetch the manifest only on step 3:
|
|
83
|
+
// before connect stores the app id the route answers 409, and an eager
|
|
84
|
+
// fetch put that 409 (plus its retries) on every channels page load.
|
|
85
|
+
const manifest = useTeamsManifest(open && step === 3 ? projectId : null);
|
|
83
86
|
const endpoint = byoMessagingEndpoint(mode?.messagingEndpoint, projectId);
|
|
84
87
|
const steps = [
|
|
85
88
|
{ step: 1, title: tI18nComplete.raw('text7f1b55a356b0') },
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { GatewayModelStat } from '@kortix/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* An LLM usage estimate in US dollars, to 2 decimals. A value above zero that
|
|
4
|
+
* rounds to $0.00 reads "<$0.01", so a small estimate never looks like none.
|
|
5
|
+
*/
|
|
6
|
+
export declare function usd2(value: number, locale?: string): string;
|
|
2
7
|
/**
|
|
3
8
|
* Top models by spend, with everything past the first few folded into one
|
|
4
9
|
* "everything else" row so the list always adds up to the window's spend.
|