@kortix/ui 0.14.19 → 0.15.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/README.md +1 -1
- package/dist/_vendor/kortix-shared.js +956 -73
- package/dist/_vendor/shared/artifact-annotations.d.ts +85 -607
- package/dist/_vendor/shared/artifact-comments.d.ts +53 -489
- package/dist/_vendor/shared/index.d.ts +0 -1
- package/dist/_vendor/shared/peer-message-prompt.d.ts +7 -1
- package/dist/_vendor/shared/project-glyphs.d.ts +103 -20
- package/dist/_vendor/shared/webhook-signing.d.ts +3 -1
- package/dist/access/access/access-dialog-share.d.ts +3 -28
- package/dist/access/access/access-dialog-share.js +3 -75
- package/dist/artifacts/artifact-frame.js +26 -2
- package/dist/artifacts/artifact-session.js +6 -2
- package/dist/artifacts/frame-policy.d.ts +2 -9
- package/dist/artifacts/frame-policy.js +2 -25
- package/dist/customize/agents/agents-page.js +1 -1
- package/dist/customize/agents/create-agent-modal.js +1 -1
- package/dist/customize/connectors/connector-filter.d.ts +2 -1
- package/dist/customize/connectors/connector-filter.js +2 -3
- package/dist/customize/connectors/connectors-page.js +15 -24
- package/dist/customize/connectors/detail/connector-status.d.ts +3 -24
- package/dist/customize/connectors/detail/connector-status.js +2 -42
- package/dist/customize/connectors/detail/use-connector-detail.d.ts +2 -6
- package/dist/customize/connectors/detail/use-connector-detail.js +3 -13
- package/dist/customize/connectors/install/install.d.ts +2 -6
- package/dist/customize/connectors/install/install.js +2 -16
- package/dist/customize/connectors/provider-label.d.ts +4 -17
- package/dist/customize/connectors/provider-label.js +4 -37
- package/dist/customize/providers/provider-connect.d.ts +6 -15
- package/dist/customize/providers/provider-connect.js +5 -36
- package/dist/customize/sections/connector-connection-form.d.ts +3 -7
- package/dist/customize/sections/connector-connection-form.js +2 -33
- package/dist/customize/sections/connector-oauth2-auto.d.ts +3 -33
- package/dist/customize/sections/connector-oauth2-auto.js +2 -64
- package/dist/customize/sections/gateway-view.d.ts +6 -5
- package/dist/customize/sections/gateway-view.js +31 -13
- package/dist/customize/sections/llm-provider/constants.d.ts +1 -2
- package/dist/customize/sections/llm-provider/constants.js +1 -2
- package/dist/customize/sections/llm-provider/utils.d.ts +1 -41
- package/dist/customize/sections/llm-provider/utils.js +1 -52
- package/dist/customize/sections/view/account-secret-resources-panel.js +4 -1
- package/dist/customize/sections/view/agent-editor-catalog.js +0 -5
- package/dist/customize/sections/view/channel-settings-patch.js +1 -1
- package/dist/customize/sections/view/channels-view.js +8 -8
- package/dist/customize/sections/view/connector-connections.d.ts +5 -85
- package/dist/customize/sections/view/connector-connections.js +5 -99
- package/dist/customize/sections/view/gateway/gateway-logs.d.ts +42 -3
- package/dist/customize/sections/view/gateway/gateway-logs.js +212 -15
- package/dist/customize/sections/view/gateway/gateway-overview.js +1 -1
- package/dist/customize/sections/view/gateway/gateway-routing.d.ts +3 -3
- package/dist/customize/sections/view/gateway/gateway-routing.js +81 -200
- package/dist/customize/sections/view/gateway/routing-parts.d.ts +101 -0
- package/dist/customize/sections/view/gateway/routing-parts.js +154 -0
- package/dist/customize/sections/view/gateway/routing-sentence-layout.d.ts +2 -0
- package/dist/customize/sections/view/gateway/routing-sentence-layout.js +82 -0
- package/dist/customize/sections/view/review-center-connected.js +17 -15
- package/dist/customize/sections/view/review-view.d.ts +7 -0
- package/dist/customize/sections/view/review-view.js +11 -0
- package/dist/customize/sections/view/secret-delivery.js +1 -1
- package/dist/customize/sections/view/secrets-view.js +1 -1
- package/dist/customize/sections/view/subscription-usage-tab.d.ts +14 -0
- package/dist/customize/sections/view/subscription-usage-tab.js +122 -0
- package/dist/customize/sections/view/subscription-usage.d.ts +34 -0
- package/dist/customize/sections/view/subscription-usage.js +98 -0
- package/dist/customize/settings/tabs/experimental-tab.js +3 -3
- package/dist/customize/settings/tabs/general-tab.js +65 -10
- package/dist/customize/shared/catalog/catalog-card.d.ts +9 -4
- package/dist/customize/shared/catalog/catalog-card.js +3 -3
- package/dist/customize/shared/channels-switch-dialog.d.ts +1 -1
- package/dist/customize/shared/channels-switch-dialog.js +1 -1
- package/dist/customize/shared/feature-gate-screen.js +1 -1
- package/dist/customize/triggers/schedule/post-to-field.d.ts +1 -1
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +1 -1
- package/dist/files/drives/conflict-marks.d.ts +28 -0
- package/dist/files/drives/conflict-marks.js +39 -0
- package/dist/files/drives/session-drives-chip.js +15 -10
- package/dist/files/viewer/index.d.ts +1 -1
- package/dist/files/viewer/index.js +1 -1
- package/dist/i18n/en.d.ts +451 -203
- package/dist/i18n/en.js +543 -295
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/account-hub/sections.d.ts +1 -1
- package/dist/internal/capture/use-capture-area.d.ts +5 -1
- package/dist/internal/capture/use-capture-area.js +16 -9
- package/dist/internal/goals/goal-meta.d.ts +50 -3
- package/dist/internal/goals/goal-meta.js +144 -9
- package/dist/internal/hooks/connectors/use-add-account.d.ts +3 -9
- package/dist/internal/hooks/connectors/use-add-account.js +3 -18
- package/dist/internal/hooks/connectors/use-connect-link.d.ts +3 -2
- package/dist/internal/hooks/connectors/use-connect-link.js +15 -24
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.d.ts +3 -56
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +3 -87
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +3 -2
- package/dist/internal/hooks/projects/use-new-project-session.js +4 -3
- package/dist/internal/hooks/projects/use-project-can-run.d.ts +7 -0
- package/dist/internal/hooks/projects/use-project-can-run.js +12 -5
- package/dist/internal/hooks/projects/use-restart-project-session.d.ts +0 -1
- package/dist/internal/hooks/projects/use-restart-project-session.js +0 -1
- package/dist/internal/layout/project-capability-nav.js +6 -2
- package/dist/internal/layout/project-page-header.d.ts +3 -1
- package/dist/internal/layout/project-page-header.js +2 -2
- package/dist/internal/lib/account-secret-access.d.ts +1 -41
- package/dist/internal/lib/account-secret-access.js +3 -46
- package/dist/internal/lib/browser-error-noise.d.ts +1 -1
- package/dist/internal/lib/browser-error-noise.js +1 -1
- package/dist/internal/lib/browser-noise/rules/expected-states.d.ts +2 -15
- package/dist/internal/lib/browser-noise/rules/expected-states.js +5 -55
- package/dist/internal/lib/capability-tab-routes.d.ts +3 -3
- package/dist/internal/lib/capability-tab-routes.js +11 -3
- package/dist/internal/lib/llm-providers.d.ts +4 -110
- package/dist/internal/lib/llm-providers.js +5 -102
- package/dist/internal/lib/navigation/message-link.d.ts +32 -0
- package/dist/internal/lib/navigation/message-link.js +51 -0
- package/dist/internal/lib/navigation/session-href.d.ts +11 -0
- package/dist/internal/lib/navigation/session-href.js +20 -0
- package/dist/internal/lib/navigation/session-spawn-urls.d.ts +17 -0
- package/dist/internal/lib/navigation/session-spawn-urls.js +26 -0
- package/dist/internal/lib/space-scope.d.ts +3 -3
- package/dist/internal/lib/space-scope.js +3 -3
- package/dist/internal/lib/use-project-feature-flags.js +7 -7
- package/dist/internal/lib/web-notifications.d.ts +1 -1
- package/dist/internal/lib/web-notifications.js +0 -3
- package/dist/internal/notifications/notification-bell.js +1 -3
- package/dist/internal/notifications/notification-rows.d.ts +2 -2
- package/dist/internal/notifications/notification-rows.js +2 -3
- package/dist/internal/session-types/index.d.ts +5 -7
- package/dist/internal/session-types/index.js +5 -7
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/active-space-store.js +1 -1
- package/dist/internal/stores/kortix-computer-store.d.ts +15 -0
- package/dist/internal/stores/kortix-computer-store.js +12 -0
- package/dist/lib/routes.d.ts +17 -7
- package/dist/lib/routes.js +18 -2
- package/dist/markdown/app-link-icons.d.ts +7 -0
- package/dist/markdown/app-link-icons.js +20 -0
- package/dist/markdown/app-links.d.ts +9 -0
- package/dist/markdown/app-links.js +112 -0
- package/dist/markdown/doc-editor/doc-attrs.d.ts +28 -0
- package/dist/markdown/doc-editor/doc-attrs.js +156 -0
- package/dist/markdown/doc-editor/doc-embed.d.ts +6 -0
- package/dist/markdown/doc-editor/doc-embed.js +26 -8
- package/dist/markdown/doc-editor/doc-extensions.d.ts +10 -0
- package/dist/markdown/doc-editor/doc-extensions.js +55 -8
- package/dist/markdown/doc-editor/doc-fidelity.d.ts +72 -0
- package/dist/markdown/doc-editor/doc-fidelity.js +135 -0
- package/dist/markdown/doc-editor/doc-node-view.d.ts +9 -0
- package/dist/markdown/doc-editor/doc-node-view.js +29 -0
- package/dist/markdown/doc-editor/markdown.d.ts +20 -0
- package/dist/markdown/doc-editor/markdown.js +455 -18
- package/dist/markdown/unified-markdown.d.ts +1 -1
- package/dist/markdown/unified-markdown.js +129 -10
- package/dist/primitives/emoji-picker.js +16 -100
- package/dist/primitives/emoji-tint.js +12 -12
- package/dist/primitives/entity-avatar.js +14 -9
- package/dist/primitives/glyph-face.d.ts +19 -12
- package/dist/primitives/glyph-face.js +59 -20
- package/dist/primitives/glyph-paths-source.d.ts +7 -0
- package/dist/primitives/glyph-paths-source.js +14 -6
- package/dist/primitives/glyph-paths.generated.d.ts +1 -1
- package/dist/primitives/glyph-paths.generated.js +947 -204
- package/dist/primitives/glyph-picker.d.ts +6 -10
- package/dist/primitives/glyph-picker.js +147 -98
- package/dist/primitives/glyph-registry.js +1604 -1
- package/dist/primitives/glyph-tint.d.ts +28 -3
- package/dist/primitives/glyph-tint.js +41 -83
- package/dist/primitives/kortix-glyphs.d.ts +32 -0
- package/dist/primitives/kortix-glyphs.js +157 -0
- package/dist/primitives/project-icon-picker.d.ts +8 -1
- package/dist/primitives/project-icon-picker.js +13 -5
- package/dist/primitives/user-avatar.d.ts +8 -1
- package/dist/primitives/user-avatar.js +2 -2
- package/dist/providers/ui-provider.d.ts +1 -8
- package/dist/session/actions/project-session-list-helpers.js +1 -1
- package/dist/session/agents/agent-model.js +4 -0
- package/dist/session/agents/agent-state-mark.d.ts +12 -7
- package/dist/session/agents/agent-state-mark.js +37 -15
- package/dist/session/agents/agent-strip.js +8 -2
- package/dist/session/agents/agent-surface.d.ts +81 -0
- package/dist/session/agents/agent-surface.js +97 -0
- package/dist/session/agents/held-messages.js +7 -4
- package/dist/session/agents/legacy-subagent-chat.js +1 -1
- package/dist/session/agents/session-peek.js +24 -12
- package/dist/session/agents/steer-session.d.ts +2 -0
- package/dist/session/agents/steer-session.js +3 -2
- package/dist/session/agents/subagent-dialog-content.d.ts +30 -1
- package/dist/session/agents/subagent-dialog-content.js +147 -33
- package/dist/session/agents/subagent-view.d.ts +15 -5
- package/dist/session/agents/subagent-view.js +28 -6
- package/dist/session/agents/tasks-panel.js +2 -12
- package/dist/session/agents/workflow-run-controls.d.ts +3 -1
- package/dist/session/agents/workflow-run-controls.js +12 -7
- package/dist/session/composer/ComposerCard.d.ts +7 -1
- package/dist/session/composer/ComposerCard.js +74 -9
- package/dist/session/composer/agent-selector.d.ts +16 -0
- package/dist/session/composer/agent-selector.js +19 -11
- package/dist/session/composer/chat-input/chat-input-control.d.ts +64 -0
- package/dist/session/composer/chat-input/chat-input-control.js +578 -0
- package/dist/session/composer/chat-input/chat-input-overrides.d.ts +76 -0
- package/dist/session/composer/chat-input/chat-input-overrides.js +40 -0
- package/dist/session/composer/chat-input/chat-input-panes.d.ts +56 -0
- package/dist/session/composer/chat-input/chat-input-panes.js +148 -0
- package/dist/session/composer/chat-input/chat-input-summary.d.ts +67 -0
- package/dist/session/composer/chat-input/chat-input-summary.js +67 -0
- package/dist/session/composer/chat-queue-lines.d.ts +20 -0
- package/dist/session/composer/chat-queue-lines.js +20 -0
- package/dist/session/composer/composer-chat-input.d.ts +8 -1
- package/dist/session/composer/composer-chat-input.js +12 -4
- package/dist/session/composer/composer-focus-context.d.ts +7 -0
- package/dist/session/composer/composer-focus-context.js +9 -0
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +3 -3
- package/dist/session/composer/composer-underbar.d.ts +10 -1
- package/dist/session/composer/composer-underbar.js +10 -2
- package/dist/session/composer/composer.d.ts +12 -0
- package/dist/session/composer/composer.js +55 -1
- package/dist/session/composer/editor/composer-editor.d.ts +10 -2
- package/dist/session/composer/editor/composer-editor.js +22 -6
- package/dist/session/composer/editor/first-visual-line.d.ts +2 -0
- package/dist/session/composer/editor/first-visual-line.js +9 -0
- package/dist/session/composer/editor/mention-node.js +2 -0
- package/dist/session/composer/editor/serialize.js +9 -1
- package/dist/session/composer/hooks/use-file-search.d.ts +1 -1
- package/dist/session/composer/hooks/use-file-search.js +1 -1
- package/dist/session/composer/menus/mention-controller.d.ts +3 -11
- package/dist/session/composer/menus/mention-controller.js +56 -16
- package/dist/session/composer/menus/mention-menu.d.ts +7 -2
- package/dist/session/composer/menus/mention-menu.js +17 -9
- package/dist/session/composer/menus/menu-items.d.ts +9 -0
- package/dist/session/composer/menus/space-mentions.d.ts +48 -0
- package/dist/session/composer/menus/space-mentions.js +83 -0
- package/dist/session/composer/prompt-history.d.ts +9 -0
- package/dist/session/composer/prompt-history.js +45 -0
- package/dist/session/composer/queue-projection.d.ts +2 -0
- package/dist/session/composer/queue-projection.js +1 -0
- package/dist/session/composer/queued-prompt-list.js +53 -4
- package/dist/session/composer/reasoning-effort-selector.d.ts +20 -0
- package/dist/session/composer/reasoning-effort-selector.js +3 -3
- package/dist/session/composer/types.d.ts +2 -1
- package/dist/session/header/session-site-header.js +7 -3
- package/dist/session/header/subagent-hover-card.d.ts +7 -4
- package/dist/session/header/subagent-hover-card.js +62 -11
- package/dist/session/list/session-status-mark.d.ts +42 -0
- package/dist/{workspace/sidebar → session/list}/session-status-mark.js +37 -2
- package/dist/session/models/model-selector.d.ts +7 -2
- package/dist/session/models/model-selector.js +39 -31
- package/dist/session/overrides/provider-secret-pool-editor.d.ts +11 -0
- package/dist/session/overrides/provider-secret-pool-editor.js +17 -0
- package/dist/session/overrides/session-overrides-control.d.ts +5 -0
- package/dist/session/overrides/session-overrides-toolbar.js +147 -7
- package/dist/session/panel/model-switch-event.d.ts +8 -0
- package/dist/session/panel/model-switch-event.js +19 -0
- package/dist/session/panel/session-audit-panel.js +3 -2
- package/dist/session/panel/session-desktop.js +5 -1
- package/dist/session/panel/session-panel-provider.js +1 -1
- package/dist/session/panel/shared/use-panel-handoffs.d.ts +2 -2
- package/dist/session/panel/shared/use-panel-handoffs.js +21 -2
- package/dist/session/prompts/ask-deck.d.ts +21 -0
- package/dist/session/prompts/ask-deck.js +253 -0
- package/dist/session/prompts/session-permission-prompt.d.ts +7 -1
- package/dist/session/prompts/session-permission-prompt.js +3 -3
- package/dist/session/status/session-load-state.d.ts +0 -1
- package/dist/session/status/session-load-state.js +2 -4
- package/dist/session/thread/message-parsing.d.ts +0 -1
- package/dist/session/thread/message-parsing.js +0 -1
- package/dist/session/thread/session-chat.d.ts +3 -1
- package/dist/session/thread/session-chat.js +459 -310
- package/dist/session/thread/session-context-metrics.d.ts +0 -1
- package/dist/session/thread/session-context-metrics.js +1 -1
- package/dist/session/thread/session-context-sub-sessions.js +3 -1
- package/dist/session/thread/show-work.d.ts +38 -0
- package/dist/session/thread/show-work.js +115 -0
- package/dist/session/thread/thread-boot-rows.d.ts +2 -1
- package/dist/session/thread/thread-boot-rows.js +7 -3
- package/dist/session/thread/transcript-rows.d.ts +36 -0
- package/dist/session/thread/transcript.d.ts +46 -2
- package/dist/session/thread/transcript.js +226 -34
- package/dist/session/thread/typing-indicator.d.ts +21 -0
- package/dist/session/thread/typing-indicator.js +46 -0
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +12 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +6 -0
- package/dist/session/tool/tool-part-renderer.d.ts +2 -0
- package/dist/session/tool/tool-part-renderer.js +16 -2
- package/dist/session/tool/tools/kortix-action-tool.js +8 -1
- package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +19 -0
- package/dist/session/tool/tools/multi-agent-tool-bodies.js +34 -13
- package/dist/session/tool/tools/session-spawn-urls.d.ts +1 -16
- package/dist/session/tool/tools/session-spawn-urls.js +4 -26
- package/dist/session/tool/tools/task-tool.d.ts +5 -18
- package/dist/session/tool/tools/task-tool.js +47 -86
- package/dist/session/tool/tools/workflow-progress.d.ts +14 -18
- package/dist/session/tool/tools/workflow-progress.js +24 -179
- package/dist/session/tool/tools/workflow-result-text.d.ts +15 -0
- package/dist/session/tool/tools/workflow-result-text.js +34 -0
- package/dist/session/tool/tools/workflow-run-card.d.ts +35 -0
- package/dist/session/tool/tools/workflow-run-card.js +157 -0
- package/dist/session/tool/tools/workflow-tool.js +45 -58
- package/dist/session/turn/activity-burst.d.ts +2 -2
- package/dist/session/turn/activity-burst.js +11 -5
- package/dist/session/turn/answered-question-step.d.ts +29 -0
- package/dist/session/turn/answered-question-step.js +48 -3
- package/dist/session/turn/notice-batch-group.d.ts +4 -4
- package/dist/session/turn/notice-batch-group.js +5 -8
- package/dist/session/turn/peer-message-row.d.ts +15 -0
- package/dist/session/turn/peer-message-row.js +38 -47
- package/dist/session/turn/subagent-notice-row.d.ts +16 -1
- package/dist/session/turn/subagent-notice-row.js +47 -35
- package/dist/session/turn/throttled-markdown.js +4 -1
- package/dist/session/turn/turn-work-accordion.d.ts +10 -3
- package/dist/session/turn/turn-work-accordion.js +18 -11
- package/dist/session/turn/user-message.js +16 -42
- package/dist/session/turn/voice-turn.d.ts +22 -0
- package/dist/session/turn/voice-turn.js +32 -0
- package/dist/session/voice/call-ring.d.ts +10 -0
- package/dist/session/voice/call-ring.js +52 -0
- package/dist/session/voice/use-voice-call.d.ts +4 -4
- package/dist/session/voice/use-voice-call.js +6 -9
- package/dist/session/voice/voice-call-card.d.ts +6 -0
- package/dist/session/voice/voice-call-card.js +113 -0
- package/dist/session/voice/voice-call-state.d.ts +3 -0
- package/dist/session/voice/voice-call-state.js +2 -1
- package/dist/session/voice/voice-call-store.d.ts +16 -6
- package/dist/session/voice/voice-call-store.js +5 -5
- package/dist/session/voice/voice-call.d.ts +4 -8
- package/dist/session/voice/voice-call.js +33 -36
- package/dist/styles/components.css +33 -0
- package/dist/styles/theme.css +26 -0
- package/dist/styles.css +1 -1
- package/dist/workspace/admin/project-admin-dashboard.d.ts +1 -1
- package/dist/workspace/admin/project-admin-dashboard.js +12 -9
- package/dist/workspace/index.d.ts +3 -2
- package/dist/workspace/index.js +2 -1
- package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
- package/dist/workspace/layout/use-project-home-send.js +5 -3
- package/dist/workspace/memory/company-memory-page.d.ts +1 -1
- package/dist/workspace/memory/company-memory-page.js +1 -1
- package/dist/workspace/new/use-creatable-accounts.js +13 -4
- package/dist/workspace/projects/modal/project-icon-field.js +49 -34
- package/dist/workspace/review/review-center.d.ts +4 -1
- package/dist/workspace/review/review-center.js +6 -3
- package/dist/workspace/sessions/project-sessions-helpers.js +1 -1
- package/dist/workspace/sessions/project-sessions-view.js +1 -1
- package/dist/workspace/sessions/session-row.js +6 -4
- package/dist/workspace/sessions/sessions-toolbar.d.ts +1 -1
- package/dist/workspace/sessions/sessions-toolbar.js +4 -4
- package/dist/workspace/sidebar/footer/project-memory-nav.d.ts +1 -1
- package/dist/workspace/sidebar/footer/project-memory-nav.js +1 -1
- package/dist/workspace/sidebar/project-nav-items.js +2 -5
- package/dist/workspace/sidebar/project-session-list.d.ts +7 -1
- package/dist/workspace/sidebar/project-session-list.js +63 -24
- package/dist/workspace/sidebar/project-sidebar.js +10 -7
- package/dist/workspace/sidebar/project-spaces-nav.d.ts +7 -3
- package/dist/workspace/sidebar/project-spaces-nav.js +77 -46
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +4 -2
- package/dist/workspace/sidebar/session-brief-hover-card.js +47 -28
- package/dist/workspace/sidebar/session-group-sections.js +12 -4
- package/dist/workspace/sidebar/sidebar-more-group.d.ts +13 -0
- package/dist/workspace/sidebar/sidebar-more-group.js +27 -0
- package/dist/workspace/space/space-blocks.d.ts +3 -1
- package/dist/workspace/space/space-blocks.js +4 -7
- package/dist/workspace/space/space-page.d.ts +4 -6
- package/dist/workspace/space/space-page.js +10 -24
- package/dist/workspace/space/space-tab-panels.d.ts +14 -1
- package/dist/workspace/space/space-tab-panels.js +12 -21
- package/dist/workspace/space/space-templates.d.ts +4 -5
- package/dist/workspace/space/space-templates.js +2 -7
- package/dist/workspace/space/use-space-filter.d.ts +1 -1
- package/dist/workspace/space/use-space-filter.js +1 -1
- package/dist/workspace/spaces/channels-onboarding.d.ts +2 -2
- package/dist/workspace/spaces/channels-onboarding.js +4 -3
- package/dist/workspace/spaces/create-channel-dialog.js +4 -2
- package/dist/workspace/spaces/principal-card.d.ts +71 -0
- package/dist/workspace/spaces/principal-card.js +246 -0
- package/dist/workspace/spaces/space-auto-open.d.ts +8 -0
- package/dist/workspace/spaces/space-auto-open.js +18 -0
- package/dist/workspace/spaces/space-avatar.d.ts +44 -0
- package/dist/workspace/spaces/space-avatar.js +41 -0
- package/dist/workspace/spaces/space-details-panel.d.ts +26 -0
- package/dist/workspace/spaces/space-details-panel.js +119 -0
- package/dist/workspace/spaces/space-identity.d.ts +49 -0
- package/dist/workspace/spaces/space-identity.js +104 -0
- package/dist/workspace/spaces/space-members.js +1 -1
- package/dist/workspace/spaces/space-mention-source.d.ts +12 -0
- package/dist/workspace/spaces/space-mention-source.js +78 -0
- package/dist/workspace/spaces/space-people.d.ts +29 -0
- package/dist/workspace/spaces/space-people.js +87 -0
- package/dist/workspace/spaces/space-roster.d.ts +3 -2
- package/dist/workspace/spaces/space-roster.js +7 -4
- package/dist/workspace/spaces/space-tab-list.d.ts +37 -0
- package/dist/workspace/spaces/space-tab-list.js +82 -0
- package/dist/workspace/spaces/space-tabs.d.ts +74 -0
- package/dist/workspace/spaces/space-tabs.js +199 -0
- package/dist/workspace/spaces/space-threads-tab.js +1 -1
- package/dist/workspace/spaces/space-timeline-view.js +126 -17
- package/dist/workspace/spaces/space-timeline.d.ts +44 -9
- package/dist/workspace/spaces/space-timeline.js +120 -12
- package/dist/workspace/spaces/space-view.d.ts +19 -12
- package/dist/workspace/spaces/space-view.js +201 -67
- package/dist/workspace/spaces/use-personal-space-name.d.ts +2 -0
- package/dist/workspace/spaces/use-personal-space-name.js +10 -0
- package/package.json +11 -7
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/custom-dashboard.md +2 -3
- package/skills/kortix-ui/references/modules.md +4 -4
- package/dist/_vendor/shared/room-prompt.d.ts +0 -66
- package/dist/session/voice/voice-call-bar.d.ts +0 -4
- package/dist/session/voice/voice-call-bar.js +0 -39
- package/dist/workspace/sidebar/footer/project-rooms-nav.d.ts +0 -9
- package/dist/workspace/sidebar/footer/project-rooms-nav.js +0 -32
- package/dist/workspace/sidebar/session-status-mark.d.ts +0 -19
- package/dist/workspace/space/space-room.d.ts +0 -20
- package/dist/workspace/space/space-room.js +0 -27
- /package/dist/{workspace/sidebar → session/list}/session-list-chrome.d.ts +0 -0
- /package/dist/{workspace/sidebar → session/list}/session-list-chrome.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { CaretDownIcon as ChevronDown, CaretUpIcon as ChevronUp, MagnifyingGlassIcon as Search, XIcon, ScrollIcon as ScrollText, } from '@phosphor-icons/react';
|
|
3
|
+
import { ArrowSquareOutIcon, CaretDownIcon as ChevronDown, CaretUpIcon as ChevronUp, FunnelSimpleIcon, MagnifyingGlassIcon as Search, XIcon, ScrollIcon as ScrollText, } from '@phosphor-icons/react';
|
|
4
4
|
import { useLocale, useTranslations } from '../../../../i18n/index.js';
|
|
5
5
|
import { useLocalizedUiCatalog } from '../../../../i18n/ui-catalog/use-localized-ui-catalog.js';
|
|
6
6
|
import { Fragment, forwardRef, useEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -16,7 +16,11 @@ import { SplitSheetBody, SplitSheetDescription, SplitSheetHeader, SplitSheetTitl
|
|
|
16
16
|
import { useModelsPageSheet } from '../../models-page-sheet.js';
|
|
17
17
|
import { Tabs, TabsContent, TabsListCompact, TabsTriggerCompact } from '../../../../primitives/tabs.js';
|
|
18
18
|
import { EmptyState } from '../../../../primitives/empty-state.js';
|
|
19
|
-
import {
|
|
19
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from '../../../../primitives/dropdown-menu.js';
|
|
20
|
+
import { CountBadge } from '../../../../primitives/count-badge.js';
|
|
21
|
+
import { UiLink as Link, useUiRouter } from '../../../../providers/ui-provider.js';
|
|
22
|
+
import { projectSessionMessageHref } from '../../../../internal/lib/navigation/session-href.js';
|
|
23
|
+
import { useGatewayLog, useGatewayLogFacets, useGatewayLogs } from '@kortix/sdk/react';
|
|
20
24
|
import { cn } from '../../../../internal/lib/utils.js';
|
|
21
25
|
import { formatUsdAsCredits } from '../../../../_vendor/kortix-shared.js';
|
|
22
26
|
import { CopyButton, displayModel } from './_shared.js';
|
|
@@ -106,13 +110,81 @@ export function logTitle(row) {
|
|
|
106
110
|
export function logMeta(parts) {
|
|
107
111
|
return parts.filter((p) => typeof p === 'string' && p.length > 0).join(' · ');
|
|
108
112
|
}
|
|
109
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* The search, applied to the LOADED rows while the server answers the same
|
|
115
|
+
* query: a model, provider or error code containing the text, or a request,
|
|
116
|
+
* session or message id equal to it. The route (`q`) matches the same way, so
|
|
117
|
+
* the list does not jump when the server's page lands.
|
|
118
|
+
*/
|
|
110
119
|
export function matchesLogQuery(row, query) {
|
|
111
|
-
const
|
|
120
|
+
const raw = query.trim();
|
|
121
|
+
const q = raw.toLowerCase();
|
|
112
122
|
if (!q)
|
|
113
123
|
return true;
|
|
124
|
+
if ([row.request_id, row.session_id, row.message_id, row.turn_id].includes(raw))
|
|
125
|
+
return true;
|
|
114
126
|
return [row.requested_model, row.resolved_model, row.provider, row.error_code].some((v) => typeof v === 'string' && v.toLowerCase().includes(q));
|
|
115
127
|
}
|
|
128
|
+
const WINDOW_MS = {
|
|
129
|
+
'15m': 15 * 60_000,
|
|
130
|
+
'1h': 60 * 60_000,
|
|
131
|
+
'24h': 24 * 60 * 60_000,
|
|
132
|
+
'7d': 7 * 24 * 60 * 60_000,
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Every key, set to nothing: the menu merges a change into the current state,
|
|
136
|
+
* so "Clear filters" has to name each filter to clear it.
|
|
137
|
+
*/
|
|
138
|
+
export const NO_LOG_FILTERS = {
|
|
139
|
+
window: 'any',
|
|
140
|
+
since: undefined,
|
|
141
|
+
sessionId: undefined,
|
|
142
|
+
sessionTitle: undefined,
|
|
143
|
+
model: undefined,
|
|
144
|
+
provider: undefined,
|
|
145
|
+
errorCode: undefined,
|
|
146
|
+
};
|
|
147
|
+
/** The menu's merge: a change applied over the current filters. */
|
|
148
|
+
export function mergeLogFilters(prev, next) {
|
|
149
|
+
return { ...prev, ...next };
|
|
150
|
+
}
|
|
151
|
+
/** The window as a `since` time, measured from `now`. */
|
|
152
|
+
export function windowSince(window, now = Date.now()) {
|
|
153
|
+
return window === 'any' ? undefined : new Date(now - WINDOW_MS[window]).toISOString();
|
|
154
|
+
}
|
|
155
|
+
/** The menu state as the server filters `useGatewayLogs` takes. */
|
|
156
|
+
export function serverLogFilters(filter, state, query) {
|
|
157
|
+
return {
|
|
158
|
+
...(filter === 'all' ? {} : { ok: filter === 'ok' }),
|
|
159
|
+
sessionId: state.sessionId,
|
|
160
|
+
model: state.model,
|
|
161
|
+
provider: state.provider,
|
|
162
|
+
errorCode: state.errorCode,
|
|
163
|
+
since: state.since,
|
|
164
|
+
q: query.trim() || undefined,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/** True when any menu filter is set. */
|
|
168
|
+
export function hasLogFilters(state) {
|
|
169
|
+
return state.window !== 'any' || !!(state.sessionId || state.model || state.provider || state.errorCode);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Where a request's session link lands: the exact message when kortixd named
|
|
173
|
+
* it, else the turn, else the turn that was running when the request started
|
|
174
|
+
* (`at`: the log is written when the request ENDS, `latency_ms` later).
|
|
175
|
+
* Null for a request from outside a session.
|
|
176
|
+
*/
|
|
177
|
+
export function logSessionHref(projectId, row) {
|
|
178
|
+
if (!row.session_id)
|
|
179
|
+
return null;
|
|
180
|
+
const end = new Date(row.created_at).getTime();
|
|
181
|
+
const at = Number.isFinite(end) ? end - Math.max(0, row.latency_ms || 0) : null;
|
|
182
|
+
return projectSessionMessageHref(projectId, row.session_id, {
|
|
183
|
+
messageId: row.message_id ?? row.turn_id ?? null,
|
|
184
|
+
at,
|
|
185
|
+
threadId: row.thread_id ?? null,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
116
188
|
/** Median latency of the given rows, in ms. `null` when there are none. */
|
|
117
189
|
export function medianLatency(rows) {
|
|
118
190
|
const values = rows
|
|
@@ -219,6 +291,7 @@ function StatusBadge({ ok, status, errorCode, }) {
|
|
|
219
291
|
*/
|
|
220
292
|
const LANE = {
|
|
221
293
|
// "12:55:01 am" at text-xs is ~76px; w-22 holds it on one line.
|
|
294
|
+
session: 'w-40 shrink-0 truncate @max-2xl/logs:hidden',
|
|
222
295
|
time: 'w-22 shrink-0 text-right whitespace-nowrap',
|
|
223
296
|
latency: 'w-14 shrink-0 text-right whitespace-nowrap @max-sm/logs:hidden',
|
|
224
297
|
tokens: 'w-16 shrink-0 text-right whitespace-nowrap @max-md/logs:hidden',
|
|
@@ -227,18 +300,36 @@ const LANE = {
|
|
|
227
300
|
/** The numeric columns, named once at the top instead of per row. */
|
|
228
301
|
function LogListHeader() {
|
|
229
302
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
230
|
-
|
|
303
|
+
const t = useTranslations('gatewayLogs');
|
|
304
|
+
return (_jsxs("div", { className: "text-muted-foreground border-border flex h-8 shrink-0 items-center gap-3 border-b px-3 text-xs", children: [_jsx("span", { className: "w-2 shrink-0" }), _jsx("span", { className: "min-w-0 flex-1", children: tI18nComplete.raw('text59f03d642b41') }), _jsx("span", { className: LANE.session, children: t('sessionColumn') }), _jsx("span", { className: LANE.time, children: tI18nComplete.raw('text33b93476cf59') }), _jsx("span", { className: LANE.latency, children: tI18nComplete.raw('texte0e7d293043c') }), _jsx("span", { className: LANE.tokens, children: tI18nComplete.raw('texta039dfb9628b') }), _jsx("span", { className: LANE.cost, children: tI18nComplete.raw('text0f046f7588f9') })] }));
|
|
231
305
|
}
|
|
232
306
|
/** The date, once per run of rows that share it — see `fmtClock`. */
|
|
233
307
|
function DayDivider({ iso }) {
|
|
234
308
|
return (_jsx("div", { className: "text-muted-foreground px-3 pt-3.5 pb-1.5 text-xs font-medium", children: fmtDay(iso) }));
|
|
235
309
|
}
|
|
236
|
-
|
|
310
|
+
/**
|
|
311
|
+
* The session a request came from, as a link to the message it produced.
|
|
312
|
+
* Plain text for a request with no session (a gateway key, a personal token).
|
|
313
|
+
*/
|
|
314
|
+
function SessionLink({ projectId, row, className, }) {
|
|
315
|
+
const t = useTranslations('gatewayLogs');
|
|
316
|
+
const href = logSessionHref(projectId, row);
|
|
317
|
+
if (!href)
|
|
318
|
+
return _jsx("span", { className: cn('text-muted-foreground truncate', className), children: "\u2014" });
|
|
319
|
+
const title = row.session_title?.trim() || t('untitledSession');
|
|
320
|
+
return (_jsx(Link, { href: href, title: t('openInSession'), onClick: (e) => e.stopPropagation(), className: cn('text-foreground hover:text-foreground truncate underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-none', className), children: title }));
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* One request. The row is a stretched button (open the detail) under a real
|
|
324
|
+
* link to the session, so the session is one click from the list, opens in a
|
|
325
|
+
* new tab with a modifier, and the markup never nests a link in a button.
|
|
326
|
+
*/
|
|
327
|
+
const LogRow = forwardRef(function LogRow({ projectId, row, focused, selected, onClick, onHover }, ref) {
|
|
237
328
|
// A failed call that never reached a model has no tokens and no cost; a dash
|
|
238
329
|
// says "nothing" instead of a 0 that reads like a measurement.
|
|
239
330
|
const empty = !row.ok && row.input_tokens + row.output_tokens === 0;
|
|
240
331
|
const locale = useLocale();
|
|
241
|
-
return (_jsxs("
|
|
332
|
+
return (_jsxs("div", { ref: ref, onMouseMove: onHover, "data-slot": "log-row", className: cn('relative flex h-10 w-full shrink-0 scroll-mt-10 items-center gap-3 rounded-md px-3 text-left text-xs', 'transition-[background-color] duration-(--duration-normal)', selected ? 'bg-muted' : focused ? 'bg-muted/60' : 'hover:bg-muted/60'), children: [_jsx("button", { type: "button", onClick: onClick, "aria-current": selected ? 'true' : undefined, "aria-label": `${logTitle(row)} · ${fmtTime(row.created_at)}`, className: "focus-visible:ring-ring absolute inset-0 rounded-md focus-visible:ring-2 focus-visible:outline-none" }), _jsx(StatusMark, { ok: row.ok, status: row.status }), _jsxs("span", { className: "pointer-events-none flex min-w-0 flex-1 items-baseline gap-2", children: [_jsx("span", { className: "text-foreground truncate font-medium", children: logTitle(row) }), row.provider ? (_jsx("span", { className: "text-muted-foreground shrink-0 truncate font-mono", children: row.provider })) : null, !row.ok ? (_jsx("span", { className: "text-destructive truncate font-mono", children: logMeta([row.status ? `${row.status}` : null, row.error_code]) })) : null] }), _jsx("span", { className: cn(LANE.session, 'relative'), children: _jsx(SessionLink, { projectId: projectId, row: row }) }), _jsx("span", { className: cn(LANE.time, 'text-muted-foreground pointer-events-none tabular-nums'), children: fmtClock(row.created_at) }), _jsx("span", { className: cn(LANE.latency, 'text-foreground pointer-events-none tabular-nums'), children: fmtLatency(row.latency_ms) }), _jsx("span", { className: cn(LANE.tokens, 'pointer-events-none tabular-nums', empty ? 'text-muted-foreground' : 'text-foreground'), children: empty ? '—' : (row.input_tokens + row.output_tokens).toLocaleString() }), _jsx("span", { className: cn(LANE.cost, 'pointer-events-none tabular-nums', empty ? 'text-muted-foreground' : 'text-foreground'), children: empty ? '—' : formatUsdAsCredits(row.total_cost, { locale }) })] }));
|
|
242
333
|
});
|
|
243
334
|
/**
|
|
244
335
|
* Who charged for this request, in the caller's own terms.
|
|
@@ -314,12 +405,30 @@ function hasPayload(value) {
|
|
|
314
405
|
function NavButton({ icon: Icon, label, disabled, onClick, }) {
|
|
315
406
|
return (_jsx(Hint, { label: label, children: _jsx("button", { type: "button", onClick: onClick, disabled: disabled, "aria-label": label, className: "text-muted-foreground hover:bg-muted hover:text-foreground flex size-6 items-center justify-center rounded-md transition-[background-color,color] duration-(--duration-normal) disabled:pointer-events-none disabled:opacity-30", children: _jsx(Icon, { className: "size-3.5" }) }) }));
|
|
316
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* Where the request came from, first in the pane: the session and the exact
|
|
410
|
+
* message, one click away. A request with no session (a gateway key, a
|
|
411
|
+
* personal token) says so instead of showing an empty link.
|
|
412
|
+
*/
|
|
413
|
+
function LogSessionBlock({ projectId, row, onFilterSession, }) {
|
|
414
|
+
const t = useTranslations('gatewayLogs');
|
|
415
|
+
const href = logSessionHref(projectId, row);
|
|
416
|
+
if (!row.session_id || !href) {
|
|
417
|
+
return (_jsx("div", { className: "ring-border text-muted-foreground rounded-md px-3.5 py-3 text-xs ring-1", children: row.key_id ? t('fromGatewayKey') : t('noSession') }));
|
|
418
|
+
}
|
|
419
|
+
const title = row.session_title?.trim() || t('untitledSession');
|
|
420
|
+
return (_jsxs("div", { className: "ring-border flex flex-col gap-2.5 rounded-md px-3.5 py-3 ring-1", "data-slot": "log-session", children: [_jsxs("div", { className: "flex min-w-0 items-center justify-between gap-3", children: [_jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [_jsx("span", { className: "text-muted-foreground text-xs", children: t('sessionColumn') }), _jsx("span", { className: "text-foreground truncate text-sm font-medium", children: title })] }), _jsx(Button, { asChild: true, size: "sm", variant: "secondary", className: "shrink-0 gap-1.5", children: _jsxs(Link, { href: href, children: [row.message_id || row.turn_id ? t('openMessage') : t('openInSession'), _jsx(ArrowSquareOutIcon, { className: "size-3.5" })] }) })] }), _jsxs("div", { className: "divide-border flex flex-col divide-y", children: [row.message_id ? _jsx(IdField, { label: t('messageLabel'), value: row.message_id }) : null, row.turn_id && row.turn_id !== row.message_id ? _jsx(IdField, { label: t('turnLabel'), value: row.turn_id }) : null, row.thread_id ? _jsx(IdField, { label: t('threadLabel'), value: row.thread_id }) : null, _jsx(IdField, { label: t('sessionIdLabel'), value: row.session_id })] }), !row.message_id && !row.turn_id ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('byTimeHint') })) : null, _jsxs(Button, { size: "sm", variant: "ghost", className: "text-muted-foreground -ml-2 h-7 self-start gap-1.5", onClick: () => onFilterSession(row.session_id, row.session_title ?? null), children: [_jsx(FunnelSimpleIcon, { className: "size-3.5" }), t('onlyThisSession')] })] }));
|
|
421
|
+
}
|
|
422
|
+
/** An id with Copy, monospaced, one line. */
|
|
423
|
+
function IdField({ label, value }) {
|
|
424
|
+
return (_jsxs("div", { className: "flex items-center justify-between gap-4 py-1.5 text-xs", children: [_jsx("span", { className: "text-muted-foreground shrink-0", children: label }), _jsxs("span", { className: "flex min-w-0 items-center gap-1", children: [_jsx("span", { className: "text-foreground truncate font-mono", children: value }), _jsx(CopyButton, { text: value, className: "size-5 shrink-0" })] })] }));
|
|
425
|
+
}
|
|
317
426
|
/**
|
|
318
427
|
* One request, in the split sheet beside the list. The list stays on screen,
|
|
319
428
|
* so ↑/↓ (or the arrows by the timestamp) step through requests while this
|
|
320
429
|
* pane follows.
|
|
321
430
|
*/
|
|
322
|
-
function GatewayLogDetail({ projectId, logId, index, total, onPrev, onNext, }) {
|
|
431
|
+
function GatewayLogDetail({ projectId, logId, index, total, onPrev, onNext, onFilterSession, }) {
|
|
323
432
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
324
433
|
const t = useTranslations('gatewayLogs');
|
|
325
434
|
const locale = useLocale();
|
|
@@ -333,7 +442,7 @@ function GatewayLogDetail({ projectId, logId, index, total, onPrev, onNext, }) {
|
|
|
333
442
|
: []),
|
|
334
443
|
].filter((p) => hasPayload(p.value))
|
|
335
444
|
: [];
|
|
336
|
-
return (_jsxs(_Fragment, { children: [_jsxs(SplitSheetHeader, { closeLabel: t('close'), className: "px-6 pt-5 pb-4", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(SplitSheetTitle, { className: "truncate text-base font-semibold", children: data ? logTitle(data) : '\u00a0' }), data ? _jsx(StatusBadge, { ok: data.ok, status: data.status, errorCode: data.error_code }) : null] }), _jsxs("div", { className: "flex min-w-0 items-center justify-between gap-2", children: [_jsx(SplitSheetDescription, { className: "min-w-0 truncate tabular-nums", children: data ? fmtTime(data.created_at) : null }), _jsxs("div", { className: "flex shrink-0 items-center gap-0.5", children: [_jsxs("span", { className: "text-muted-foreground mr-1 text-xs tabular-nums", children: [index + 1, " / ", total] }), _jsx(NavButton, { icon: ChevronUp, label: tI18nComplete.raw('text7de83ebed3ea'), disabled: index <= 0, onClick: onPrev }), _jsx(NavButton, { icon: ChevronDown, label: tI18nComplete.raw('text14a2f02e188f'), disabled: index >= total - 1, onClick: onNext })] })] }), data ? (_jsxs("div", { className: "text-muted-foreground flex min-w-0 items-center gap-1 text-xs", children: [_jsx("span", { className: "truncate font-mono", children: data.request_id }), _jsx(CopyButton, { text: data.request_id, className: "size-5 shrink-0" })] })) : null] }), _jsx(SplitSheetBody, { className: "flex flex-col gap-6 px-6 pt-5 pb-6", children: isLoading || !data ? (_jsxs("div", { className: "space-y-3", children: [_jsx(Skeleton, { className: "h-16 rounded-md" }), _jsx(Skeleton, { className: "h-40 rounded-md" })] })) : (_jsxs(_Fragment, { children: [data.error_message && (_jsxs("div", { className: "bg-destructive/10 flex flex-col gap-1 rounded-md px-3.5 py-3", children: [data.error_code ? (_jsx("div", { className: "text-destructive font-mono text-xs", children: data.error_code })) : null, _jsx("div", { className: "text-destructive text-xs wrap-break-word whitespace-pre-wrap", children: data.error_message })] })), _jsxs("div", { className: "ring-border divide-border flex divide-x rounded-md ring-1", children: [_jsx(StatCell, { label: tI18nComplete.raw('texte0e7d293043c'), value: fmtLatency(data.latency_ms) }), _jsx(StatCell, { label: tI18nComplete.raw('texta039dfb9628b'), value: (data.input_tokens + data.output_tokens).toLocaleString() }), _jsx(StatCell, { label: tI18nComplete.raw('text0f046f7588f9'), value: formatUsdAsCredits(data.total_cost, { locale }) }), data.kortix_cost > 0 && data.provider_cost > 0 && (_jsx(StatCell, { label: tI18nComplete.raw('text88548ef048ed'), value: formatUsdAsCredits(data.kortix_cost, { locale }) }))] }), _jsxs("div", { className: "divide-border flex flex-col divide-y", children: [_jsx(DetailField, { label: tI18nComplete.raw('textb36591f91a8c'), value: _jsx("span", { className: "font-mono", children: data.requested_model || '—' }) }), _jsx(DetailField, { label: tI18nComplete.raw('textac811767e2f7'), value: _jsx("span", { className: "font-mono", children: data.resolved_model || '—' }) }), _jsx(DetailField, { label: tI18nComplete.raw('text472590ae974d'), value: data.provider || '—' }), data.candidates_tried.length > 0 && (_jsx(DetailField, { label: tI18nComplete.raw('text8281b9f426fd'), value: _jsx("span", { className: "font-mono", children: data.candidates_tried.join(' → ') }) })), data.attempts > 1 && (_jsx(DetailField, { label: tI18nComplete.raw('text06e70139fcf5'), value: data.attempts })), _jsx(DetailField, { label: tI18nComplete.raw('texta039dfb9628b'), value: `${data.input_tokens.toLocaleString()} in · ${data.output_tokens.toLocaleString()} out` }), (data.cached_tokens > 0 || data.cache_write_tokens > 0) && (_jsx(DetailField, { label: tI18nComplete.raw('texta76ce82a9749'), value: `${data.cached_tokens.toLocaleString()} read · ${data.cache_write_tokens.toLocaleString()} write` })), _jsx(DetailField, { label: tI18nComplete.raw('texta951c5945635'), value: data.streaming ? 'yes' : 'no' }), _jsx(DetailField, { label: tI18nComplete.raw('text88b1dfafbd5f'), value: billedByLabel(data.billing_mode, data.provider) })] }), payloads.length > 0 ? (_jsxs(Tabs, { defaultValue: payloads[0].key, className: "gap-2", children: [_jsx(TabsListCompact, { className: "self-start", children: payloads.map((p) => (_jsx(TabsTriggerCompact, { value: p.key, children: p.label }, p.key))) }), payloads.map((p) => (_jsx(TabsContent, { value: p.key, children: _jsx(PayloadCode, { value: p.value }) }, p.key)))] })) : null] })) })] }));
|
|
445
|
+
return (_jsxs(_Fragment, { children: [_jsxs(SplitSheetHeader, { closeLabel: t('close'), className: "px-6 pt-5 pb-4", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(SplitSheetTitle, { className: "truncate text-base font-semibold", children: data ? logTitle(data) : '\u00a0' }), data ? _jsx(StatusBadge, { ok: data.ok, status: data.status, errorCode: data.error_code }) : null] }), _jsxs("div", { className: "flex min-w-0 items-center justify-between gap-2", children: [_jsx(SplitSheetDescription, { className: "min-w-0 truncate tabular-nums", children: data ? fmtTime(data.created_at) : null }), _jsxs("div", { className: "flex shrink-0 items-center gap-0.5", children: [_jsxs("span", { className: "text-muted-foreground mr-1 text-xs tabular-nums", children: [index + 1, " / ", total] }), _jsx(NavButton, { icon: ChevronUp, label: tI18nComplete.raw('text7de83ebed3ea'), disabled: index <= 0, onClick: onPrev }), _jsx(NavButton, { icon: ChevronDown, label: tI18nComplete.raw('text14a2f02e188f'), disabled: index >= total - 1, onClick: onNext })] })] }), data ? (_jsxs("div", { className: "text-muted-foreground flex min-w-0 items-center gap-1 text-xs", children: [_jsx("span", { className: "truncate font-mono", children: data.request_id }), _jsx(CopyButton, { text: data.request_id, className: "size-5 shrink-0" })] })) : null] }), _jsx(SplitSheetBody, { className: "flex flex-col gap-6 px-6 pt-5 pb-6", children: isLoading || !data ? (_jsxs("div", { className: "space-y-3", children: [_jsx(Skeleton, { className: "h-16 rounded-md" }), _jsx(Skeleton, { className: "h-40 rounded-md" })] })) : (_jsxs(_Fragment, { children: [data.error_message && (_jsxs("div", { className: "bg-destructive/10 flex flex-col gap-1 rounded-md px-3.5 py-3", children: [data.error_code ? (_jsx("div", { className: "text-destructive font-mono text-xs", children: data.error_code })) : null, _jsx("div", { className: "text-destructive text-xs wrap-break-word whitespace-pre-wrap", children: data.error_message })] })), _jsx(LogSessionBlock, { projectId: projectId, row: data, onFilterSession: onFilterSession }), _jsxs("div", { className: "ring-border divide-border flex divide-x rounded-md ring-1", children: [_jsx(StatCell, { label: tI18nComplete.raw('texte0e7d293043c'), value: fmtLatency(data.latency_ms) }), _jsx(StatCell, { label: tI18nComplete.raw('texta039dfb9628b'), value: (data.input_tokens + data.output_tokens).toLocaleString() }), _jsx(StatCell, { label: tI18nComplete.raw('text0f046f7588f9'), value: formatUsdAsCredits(data.total_cost, { locale }) }), data.kortix_cost > 0 && data.provider_cost > 0 && (_jsx(StatCell, { label: tI18nComplete.raw('text88548ef048ed'), value: formatUsdAsCredits(data.kortix_cost, { locale }) }))] }), _jsxs("div", { className: "divide-border flex flex-col divide-y", children: [_jsx(DetailField, { label: tI18nComplete.raw('textb36591f91a8c'), value: _jsx("span", { className: "font-mono", children: data.requested_model || '—' }) }), _jsx(DetailField, { label: tI18nComplete.raw('textac811767e2f7'), value: _jsx("span", { className: "font-mono", children: data.resolved_model || '—' }) }), _jsx(DetailField, { label: tI18nComplete.raw('text472590ae974d'), value: data.provider || '—' }), data.candidates_tried.length > 0 && (_jsx(DetailField, { label: tI18nComplete.raw('text8281b9f426fd'), value: _jsx("span", { className: "font-mono", children: data.candidates_tried.join(' → ') }) })), data.attempts > 1 && (_jsx(DetailField, { label: tI18nComplete.raw('text06e70139fcf5'), value: data.attempts })), _jsx(DetailField, { label: tI18nComplete.raw('texta039dfb9628b'), value: `${data.input_tokens.toLocaleString()} in · ${data.output_tokens.toLocaleString()} out` }), (data.cached_tokens > 0 || data.cache_write_tokens > 0) && (_jsx(DetailField, { label: tI18nComplete.raw('texta76ce82a9749'), value: `${data.cached_tokens.toLocaleString()} read · ${data.cache_write_tokens.toLocaleString()} write` })), _jsx(DetailField, { label: tI18nComplete.raw('texta951c5945635'), value: data.streaming ? 'yes' : 'no' }), _jsx(DetailField, { label: tI18nComplete.raw('text88b1dfafbd5f'), value: billedByLabel(data.billing_mode, data.provider) })] }), payloads.length > 0 ? (_jsxs(Tabs, { defaultValue: payloads[0].key, className: "gap-2", children: [_jsx(TabsListCompact, { className: "self-start", children: payloads.map((p) => (_jsx(TabsTriggerCompact, { value: p.key, children: p.label }, p.key))) }), payloads.map((p) => (_jsx(TabsContent, { value: p.key, children: _jsx(PayloadCode, { value: p.value }) }, p.key)))] })) : null] })) })] }));
|
|
337
446
|
}
|
|
338
447
|
/** Bars per histogram. */
|
|
339
448
|
const HISTOGRAM_BUCKETS = 48;
|
|
@@ -382,22 +491,94 @@ export function LogHistogram({ rows, live, onSelectRange, }) {
|
|
|
382
491
|
minute: '2-digit',
|
|
383
492
|
}) })] })] }));
|
|
384
493
|
}
|
|
494
|
+
const WINDOWS = ['any', '15m', '1h', '24h', '7d'];
|
|
495
|
+
const WINDOW_LABEL = {
|
|
496
|
+
any: 'windowAny',
|
|
497
|
+
'15m': 'window15m',
|
|
498
|
+
'1h': 'window1h',
|
|
499
|
+
'24h': 'window24h',
|
|
500
|
+
'7d': 'window7d',
|
|
501
|
+
};
|
|
502
|
+
/** One facet: a radio list of the values used in the window, the most-used first. */
|
|
503
|
+
function FacetSub({ label, value, options, onChange, empty, }) {
|
|
504
|
+
return (_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [_jsx("span", { className: "flex-1", children: label }), value ? _jsx("span", { className: "bg-foreground size-1.5 rounded-full", "aria-hidden": true }) : null] }), _jsx(DropdownMenuSubContent, { className: "max-h-80 w-72 overflow-y-auto", children: options.length === 0 ? (_jsx(DropdownMenuItem, { disabled: true, children: empty })) : (_jsx(DropdownMenuRadioGroup, { value: value ?? '', onValueChange: (next) => onChange(next === value ? undefined : next), children: options.map((option) => (_jsxs(DropdownMenuRadioItem, { value: option.value, onSelect: (e) => e.preventDefault(), children: [_jsx("span", { className: cn('min-w-0 flex-1 truncate', option.mono && 'font-mono'), children: option.label }), _jsx(CountBadge, { count: option.count, className: "ml-auto" })] }, option.value))) })) })] }));
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Time, session, model, provider and error code. Every option is a value the
|
|
508
|
+
* project actually used in the window (`GET …/gateway/logs/facets`), with its
|
|
509
|
+
* request count, so no pick leads to an empty list by guesswork.
|
|
510
|
+
*/
|
|
511
|
+
function LogFilterMenu({ projectId, value, onChange, }) {
|
|
512
|
+
const t = useTranslations('gatewayLogs');
|
|
513
|
+
const [open, setOpen] = useState(false);
|
|
514
|
+
const facetHours = value.window === '7d' ? 168 : 24;
|
|
515
|
+
const { data: facets } = useGatewayLogFacets(open ? projectId : undefined, facetHours);
|
|
516
|
+
const empty = facetHours === 168 ? t('facetEmptyWeek') : t('facetEmptyDay');
|
|
517
|
+
const active = [value.window !== 'any', value.sessionId, value.model, value.provider, value.errorCode].filter(Boolean).length;
|
|
518
|
+
return (_jsxs(DropdownMenu, { open: open, onOpenChange: setOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "sm", className: "h-8 shrink-0 gap-1.5", "data-slot": "log-filter-menu", children: [_jsx(FunnelSimpleIcon, { className: "size-3.5" }), t('filter'), active > 0 ? _jsx(CountBadge, { count: active }) : null] }) }), _jsxs(DropdownMenuContent, { align: "start", className: "w-52", children: [_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [_jsx("span", { className: "flex-1", children: t('filterTime') }), value.window !== 'any' ? _jsx("span", { className: "bg-foreground size-1.5 rounded-full", "aria-hidden": true }) : null] }), _jsx(DropdownMenuSubContent, { className: "w-48", children: _jsx(DropdownMenuRadioGroup, { value: value.window, onValueChange: (next) => {
|
|
519
|
+
const picked = next;
|
|
520
|
+
onChange({ window: picked, since: windowSince(picked) });
|
|
521
|
+
}, children: WINDOWS.map((w) => (_jsx(DropdownMenuRadioItem, { value: w, children: t(WINDOW_LABEL[w]) }, w))) }) })] }), _jsx(DropdownMenuSeparator, {}), _jsx(FacetSub, { label: t('sessionColumn'), value: value.sessionId, empty: empty, options: (facets?.sessions ?? []).map((session) => ({
|
|
522
|
+
value: session.session_id,
|
|
523
|
+
label: session.title?.trim() || t('untitledSession'),
|
|
524
|
+
count: session.count,
|
|
525
|
+
})), onChange: (sessionId) => onChange({
|
|
526
|
+
sessionId,
|
|
527
|
+
sessionTitle: facets?.sessions.find((session) => session.session_id === sessionId)?.title ?? null,
|
|
528
|
+
}) }), _jsx(FacetSub, { label: t('filterModel'), value: value.model, empty: empty, options: (facets?.models ?? []).map((m) => ({ value: m.value, label: displayModel(m.value), count: m.count })), onChange: (model) => onChange({ model }) }), _jsx(FacetSub, { label: t('filterProvider'), value: value.provider, empty: empty, options: (facets?.providers ?? []).map((p) => ({ value: p.value, label: p.value, count: p.count, mono: true })), onChange: (provider) => onChange({ provider }) }), _jsx(FacetSub, { label: t('filterError'), value: value.errorCode, empty: empty, options: (facets?.error_codes ?? []).map((e) => ({ value: e.value, label: e.value, count: e.count, mono: true })), onChange: (errorCode) => onChange({ errorCode }) }), active > 0 ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: () => onChange(NO_LOG_FILTERS), children: t('clearFilters') })] })) : null] })] }));
|
|
529
|
+
}
|
|
530
|
+
/** The active filters, each removable on its own. */
|
|
531
|
+
function LogFilterChips({ value, onChange, onClear, }) {
|
|
532
|
+
const t = useTranslations('gatewayLogs');
|
|
533
|
+
const chips = [];
|
|
534
|
+
if (value.window !== 'any')
|
|
535
|
+
chips.push({ key: 'window', label: t(WINDOW_LABEL[value.window]), clear: { window: 'any', since: undefined } });
|
|
536
|
+
if (value.sessionId) {
|
|
537
|
+
chips.push({
|
|
538
|
+
key: 'session',
|
|
539
|
+
label: `${t('sessionColumn')}: ${value.sessionTitle?.trim() || t('untitledSession')}`,
|
|
540
|
+
clear: { sessionId: undefined, sessionTitle: undefined },
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
if (value.model)
|
|
544
|
+
chips.push({ key: 'model', label: `${t('filterModel')}: ${displayModel(value.model)}`, clear: { model: undefined } });
|
|
545
|
+
if (value.provider)
|
|
546
|
+
chips.push({ key: 'provider', label: `${t('filterProvider')}: ${value.provider}`, clear: { provider: undefined } });
|
|
547
|
+
if (value.errorCode)
|
|
548
|
+
chips.push({ key: 'error', label: `${t('filterError')}: ${value.errorCode}`, clear: { errorCode: undefined } });
|
|
549
|
+
return (_jsxs("div", { className: "-mt-2 flex flex-wrap items-center gap-1.5", "data-slot": "log-filter-chips", children: [chips.map((chip) => (_jsxs(Button, { variant: "secondary", size: "sm", className: "h-7 max-w-80 gap-1.5", onClick: () => onChange(chip.clear), "aria-label": `${chip.label} ×`, children: [_jsx("span", { className: "truncate", children: chip.label }), _jsx(XIcon, { className: "size-3.5 shrink-0" })] }, chip.key))), chips.length > 1 ? (_jsx(Button, { variant: "ghost", size: "sm", className: "text-muted-foreground h-7", onClick: onClear, children: t('clearFilters') })) : null] }));
|
|
550
|
+
}
|
|
385
551
|
export function GatewayLogs({ projectId }) {
|
|
386
552
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
387
553
|
const filters = useLocalizedUiCatalog(FILTERS);
|
|
388
554
|
const [selectedLogId, setSelectedLogId] = useState(null);
|
|
389
555
|
const [filter, setFilter] = useState('all');
|
|
390
556
|
const [focused, setFocused] = useState(0);
|
|
391
|
-
const { data, isLoading, hasNextPage, isFetchingNextPage, fetchNextPage } = useGatewayLogs(projectId, filter === 'all' ? undefined : { ok: filter === 'ok' });
|
|
392
|
-
const t = useTranslations('gatewayLogs');
|
|
393
557
|
const [query, setQuery] = useState('');
|
|
558
|
+
// The server search waits for a pause in typing; the loaded rows narrow at once.
|
|
559
|
+
const [serverQuery, setServerQuery] = useState('');
|
|
560
|
+
useEffect(() => {
|
|
561
|
+
const timer = setTimeout(() => setServerQuery(query), 300);
|
|
562
|
+
return () => clearTimeout(timer);
|
|
563
|
+
}, [query]);
|
|
564
|
+
const [menuFilters, setMenuFilters] = useState(NO_LOG_FILTERS);
|
|
565
|
+
const { data, isLoading, isFetching, hasNextPage, isFetchingNextPage, fetchNextPage } = useGatewayLogs(projectId, serverLogFilters(filter, menuFilters, serverQuery));
|
|
566
|
+
const t = useTranslations('gatewayLogs');
|
|
394
567
|
const [range, setRange] = useState(null);
|
|
568
|
+
const updateFilters = (next) => {
|
|
569
|
+
setMenuFilters((prev) => mergeLogFilters(prev, next));
|
|
570
|
+
// A new filter is a new list: the cursor, the open request and a bar's range go with the old one.
|
|
571
|
+
setFocused(0);
|
|
572
|
+
setSelectedLogId(null);
|
|
573
|
+
setRange(null);
|
|
574
|
+
};
|
|
395
575
|
const allLogs = useMemo(() => data?.pages.flatMap((p) => p.logs) ?? [], [data]);
|
|
396
576
|
// The histogram draws the search matches; the list also honours a bar's range.
|
|
397
577
|
const searched = useMemo(() => allLogs.filter((row) => matchesLogQuery(row, query)), [allLogs, query]);
|
|
398
578
|
const logs = useMemo(() => searched.filter((row) => inLogRange(row, range)), [searched, range]);
|
|
399
579
|
// Polling is on only while the newest page is the only page — see the hook.
|
|
400
580
|
const isLive = (data?.pages.length ?? 1) <= 1;
|
|
581
|
+
const filtered = hasLogFilters(menuFilters);
|
|
401
582
|
// Clamp on read rather than in an effect: the live list shrinks under the
|
|
402
583
|
// cursor whenever a page drops rows, and an effect would render once with an
|
|
403
584
|
// out-of-range index before correcting it.
|
|
@@ -410,6 +591,13 @@ export function GatewayLogs({ projectId }) {
|
|
|
410
591
|
// control: ↑/↓ or j/k to move, ↵ to open, ↑/↓ to step through an open entry,
|
|
411
592
|
// Esc/← to go back.
|
|
412
593
|
const state = useRef({ logs, selectedLogId, focused: focusedIndex });
|
|
594
|
+
const router = useUiRouter();
|
|
595
|
+
const projectIdRef = useRef(projectId);
|
|
596
|
+
const openHrefRef = useRef((href) => router.push(href));
|
|
597
|
+
useEffect(() => {
|
|
598
|
+
projectIdRef.current = projectId;
|
|
599
|
+
openHrefRef.current = (href) => router.push(href);
|
|
600
|
+
});
|
|
413
601
|
useEffect(() => {
|
|
414
602
|
state.current = { logs, selectedLogId, focused: focusedIndex };
|
|
415
603
|
});
|
|
@@ -436,6 +624,15 @@ export function GatewayLogs({ projectId }) {
|
|
|
436
624
|
return;
|
|
437
625
|
const down = e.key === 'ArrowDown' || e.key === 'j';
|
|
438
626
|
const up = e.key === 'ArrowUp' || e.key === 'k';
|
|
627
|
+
if (e.key === 'o') {
|
|
628
|
+
const row = sel ? ls.find((l) => l.log_id === sel) : ls[fi];
|
|
629
|
+
const href = row ? logSessionHref(projectIdRef.current, row) : null;
|
|
630
|
+
if (href) {
|
|
631
|
+
e.preventDefault();
|
|
632
|
+
openHrefRef.current(href);
|
|
633
|
+
}
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
439
636
|
if (sel) {
|
|
440
637
|
const idx = ls.findIndex((l) => l.log_id === sel);
|
|
441
638
|
if (e.key === 'Escape' || e.key === 'ArrowLeft' || e.key === 'h') {
|
|
@@ -487,14 +684,14 @@ export function GatewayLogs({ projectId }) {
|
|
|
487
684
|
// Switching filter swaps the whole list, so the cursor goes
|
|
488
685
|
// back to the top with it — done here, not in an effect.
|
|
489
686
|
setFocused(0);
|
|
490
|
-
}, children: _jsx(TabsListCompact, { "aria-label": tI18nComplete.raw('text2dda16fbd512'), className: "h-8", children: filters.map((f) => (_jsxs(TabsTriggerCompact, { value: f.key, className: "gap-1.5", children: [f.label, counts[f.key] != null ? (_jsx("span", { className: "text-muted-foreground tabular-nums", children: counts[f.key].toLocaleString() })) : null] }, f.key))) }) }) }), _jsxs(InputGroupSearch, { className: "min-w-0 flex-1", children: [_jsx(InputGroupSearchIcon, { children: _jsx(Search, {}) }), _jsx(InputGroupSearchInput, { placeholder: t('searchPlaceholder'), value: query, onChange: (e) => {
|
|
687
|
+
}, children: _jsx(TabsListCompact, { "aria-label": tI18nComplete.raw('text2dda16fbd512'), className: "h-8", children: filters.map((f) => (_jsxs(TabsTriggerCompact, { value: f.key, className: "gap-1.5", children: [f.label, counts[f.key] != null ? (_jsx("span", { className: "text-muted-foreground tabular-nums", children: counts[f.key].toLocaleString() })) : null] }, f.key))) }) }) }), _jsx(LogFilterMenu, { projectId: projectId, value: menuFilters, onChange: updateFilters }), _jsxs(InputGroupSearch, { className: "min-w-0 flex-1", children: [_jsx(InputGroupSearchIcon, { children: _jsx(Search, {}) }), _jsx(InputGroupSearchInput, { placeholder: t('searchPlaceholder'), value: query, onChange: (e) => {
|
|
491
688
|
setQuery(e.target.value);
|
|
492
689
|
setFocused(0);
|
|
493
|
-
}, size: "xs" }), _jsx(InputGroupSearchClear, { onClick: () => setQuery('') })] }), range ? (_jsxs(Button, { variant: "secondary", size: "sm", className: "h-8 shrink-0 gap-1.5 tabular-nums", onClick: () => setRange(null), "aria-label": `${fmtRange(range)} ×`, children: [fmtRange(range), _jsx(XIcon, { className: "size-3.5" })] })) : null, isLive && (_jsxs("span", { className: "text-muted-foreground flex h-8 shrink-0 items-center gap-1.5 pr-1 pl-1.5 text-xs", children: [_jsx("span", { className: "bg-kortix-green size-1.5 animate-pulse rounded-full" }), tI18nComplete.raw('textb64ac05f17e6')] }))] }), searched.length > 0 ? (_jsx(LogHistogram, { rows: searched, live: isLive, onSelectRange: (next) => {
|
|
690
|
+
}, size: "xs" }), _jsx(InputGroupSearchClear, { onClick: () => setQuery('') })] }), range ? (_jsxs(Button, { variant: "secondary", size: "sm", className: "h-8 shrink-0 gap-1.5 tabular-nums", onClick: () => setRange(null), "aria-label": `${fmtRange(range)} ×`, children: [fmtRange(range), _jsx(XIcon, { className: "size-3.5" })] })) : null, isLive && (_jsxs("span", { className: "text-muted-foreground flex h-8 shrink-0 items-center gap-1.5 pr-1 pl-1.5 text-xs", children: [_jsx("span", { className: "bg-kortix-green size-1.5 animate-pulse rounded-full" }), tI18nComplete.raw('textb64ac05f17e6')] }))] }), filtered ? (_jsx(LogFilterChips, { value: menuFilters, onChange: updateFilters, onClear: () => updateFilters(NO_LOG_FILTERS) })) : null, searched.length > 0 ? (_jsx(LogHistogram, { rows: searched, live: isLive, onSelectRange: (next) => {
|
|
494
691
|
setRange(next);
|
|
495
692
|
setFocused(0);
|
|
496
|
-
} })) : null, _jsx("div", { className: "flex flex-col", children: isLoading && logs.length === 0 ? (_jsx("div", { className: "flex flex-col gap-1", children: Array.from({ length: 8 }).map((_, i) => (_jsx(Skeleton, { className: "h-10 rounded-md" }, i))) })) : logs.length === 0 && (query.trim() || range) ? (_jsx(EmptyState, { icon: ScrollText, size: "sm", title: t('noMatch', { query: query.trim() || (range ? fmtRange(range) : '') }) })) : logs.length === 0 ? (_jsx(EmptyState, { icon: ScrollText, size: "sm", title: EMPTY_COPY[filter], description: tI18nComplete.raw('text2aa9d672c950') })) : (_jsxs(_Fragment, { children: [_jsx(LogListHeader, {}), logs.map((row, i) => (_jsxs(Fragment, { children: [(i === 0 || !sameDay(logs[i - 1].created_at, row.created_at)) && (_jsx(DayDivider, { iso: row.created_at })), _jsx(LogRow, { ref: i === focusedIndex ? focusedRowRef : undefined, row: row, focused: i === focusedIndex, selected: row.log_id === selectedLogId, onHover: () => setFocused(i), onClick: () => {
|
|
693
|
+
} })) : null, _jsx("div", { className: "flex flex-col", children: isLoading && logs.length === 0 ? (_jsx("div", { className: "flex flex-col gap-1", children: Array.from({ length: 8 }).map((_, i) => (_jsx(Skeleton, { className: "h-10 rounded-md" }, i))) })) : logs.length === 0 && (query.trim() || range) && isFetching ? (_jsx("div", { className: "flex justify-center py-6", children: _jsx(Loading, { className: "size-4" }) })) : logs.length === 0 && (query.trim() || range) ? (_jsx(EmptyState, { icon: ScrollText, size: "sm", title: t('noMatch', { query: query.trim() || (range ? fmtRange(range) : '') }) })) : logs.length === 0 && filtered ? (_jsx(EmptyState, { icon: ScrollText, size: "sm", title: t('noFilterMatch') })) : logs.length === 0 ? (_jsx(EmptyState, { icon: ScrollText, size: "sm", title: EMPTY_COPY[filter], description: tI18nComplete.raw('text2aa9d672c950') })) : (_jsxs(_Fragment, { children: [_jsx(LogListHeader, {}), logs.map((row, i) => (_jsxs(Fragment, { children: [(i === 0 || !sameDay(logs[i - 1].created_at, row.created_at)) && (_jsx(DayDivider, { iso: row.created_at })), _jsx(LogRow, { ref: i === focusedIndex ? focusedRowRef : undefined, projectId: projectId, row: row, focused: i === focusedIndex, selected: row.log_id === selectedLogId, onHover: () => setFocused(i), onClick: () => {
|
|
497
694
|
setFocused(i);
|
|
498
695
|
setSelectedLogId(row.log_id);
|
|
499
|
-
} })] }, row.log_id))), hasNextPage && (_jsx("div", { className: "flex justify-center px-4 py-3", children: _jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", disabled: isFetchingNextPage, onClick: () => void fetchNextPage(), children: [isFetchingNextPage ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('textac318011a661')] }) }))] })) })] }), renderSheet(selectedLogId ? (_jsx(GatewayLogDetail, { projectId: projectId, logId: selectedLogId, index: selectedIndex, total: logs.length, onPrev: () => step(selectedIndex - 1), onNext: () => step(selectedIndex + 1) })) : null)] }));
|
|
696
|
+
} })] }, row.log_id))), hasNextPage && (_jsx("div", { className: "flex justify-center px-4 py-3", children: _jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", disabled: isFetchingNextPage, onClick: () => void fetchNextPage(), children: [isFetchingNextPage ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('textac318011a661')] }) }))] })) })] }), renderSheet(selectedLogId ? (_jsx(GatewayLogDetail, { projectId: projectId, logId: selectedLogId, index: selectedIndex, total: logs.length, onPrev: () => step(selectedIndex - 1), onNext: () => step(selectedIndex + 1), onFilterSession: (sessionId, title) => updateFilters({ sessionId, sessionTitle: title }) })) : null)] }));
|
|
500
697
|
}
|
|
@@ -88,7 +88,7 @@ export function GatewayOverview({ projectId, canWrite = false, }) {
|
|
|
88
88
|
if (!label)
|
|
89
89
|
continue;
|
|
90
90
|
m.set(s.session_id, label);
|
|
91
|
-
const runtimeSessionId = s.runtime_session_id
|
|
91
|
+
const runtimeSessionId = s.runtime_session_id;
|
|
92
92
|
if (runtimeSessionId)
|
|
93
93
|
m.set(runtimeSessionId, label);
|
|
94
94
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { GatewayProjectRoutingPolicy } from '@kortix/sdk';
|
|
2
|
-
|
|
2
|
+
import { type FallbackMode } from './routing-parts.js';
|
|
3
|
+
export { moveFallback } from './routing-parts.js';
|
|
4
|
+
export type { FallbackMode } from './routing-parts.js';
|
|
3
5
|
type ValidationDraft = Pick<GatewayProjectRoutingPolicy, 'defaultModel' | 'defaultFallback' | 'rules'>;
|
|
4
6
|
export declare function fallbackModeForPolicy(fallback: GatewayProjectRoutingPolicy['defaultFallback']): FallbackMode;
|
|
5
|
-
export declare function moveFallback(models: string[], index: number, delta: -1 | 1): string[];
|
|
6
7
|
export declare function validateRoutingDraft(draft: ValidationDraft, fallbackMode?: FallbackMode): string | null;
|
|
7
8
|
/**
|
|
8
9
|
* The deduped, order-stable set of model wire ids the routing draft
|
|
@@ -27,4 +28,3 @@ export declare function GatewayRouting({ projectId, canWrite, projectDefaultPend
|
|
|
27
28
|
canWrite: boolean;
|
|
28
29
|
projectDefaultPending: boolean;
|
|
29
30
|
}): import("react").JSX.Element;
|
|
30
|
-
export {};
|