@sixb/app 0.1.11 → 0.1.13
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/LICENSE +2 -0
- package/README.md +27 -26
- package/assets/connector-icons/README.md +29 -0
- package/assets/connector-icons/ace-iot.ico +0 -0
- package/assets/connector-icons/companycam.png +0 -0
- package/assets/connector-icons/exa.png +0 -0
- package/assets/connector-icons/github.svg +1 -0
- package/assets/connector-icons/google.ico +0 -0
- package/assets/connector-icons/googleads.svg +29 -0
- package/assets/connector-icons/linkedin.svg +1 -0
- package/assets/connector-icons/mercury.svg +1 -0
- package/assets/connector-icons/meta.svg +1 -0
- package/assets/connector-icons/microsoft.ico +0 -0
- package/assets/connector-icons/notion.svg +1 -0
- package/assets/connector-icons/pandadoc.png +0 -0
- package/assets/connector-icons/pennylane.ico +0 -0
- package/assets/connector-icons/pipedrive.png +0 -0
- package/assets/connector-icons/plaud.png +0 -0
- package/assets/connector-icons/quickbooks.svg +1 -0
- package/assets/connector-icons/stripe.svg +1 -0
- package/assets/connector-icons/teamleader.ico +0 -0
- package/assets/connector-icons/tiktok.svg +1 -0
- package/assets/connector-icons/unipile.png +0 -0
- package/dist/agent/activity-label.d.ts +5 -0
- package/dist/agent/activity-label.d.ts.map +1 -0
- package/dist/agent/agent-chat.d.ts +25 -0
- package/dist/agent/agent-chat.d.ts.map +1 -0
- package/dist/agent/agent-context-provider.d.ts +9 -0
- package/dist/agent/agent-context-provider.d.ts.map +1 -0
- package/dist/agent/agent-execution-trace.d.ts +9 -0
- package/dist/agent/agent-execution-trace.d.ts.map +1 -0
- package/dist/agent/agent-panel.d.ts +24 -0
- package/dist/agent/agent-panel.d.ts.map +1 -0
- package/dist/agent/agent-surface-state.d.ts +22 -0
- package/dist/agent/agent-surface-state.d.ts.map +1 -0
- package/dist/agent/agent-surface.d.ts +46 -0
- package/dist/agent/agent-surface.d.ts.map +1 -0
- package/dist/agent/agents-page.d.ts +4 -0
- package/dist/agent/agents-page.d.ts.map +1 -0
- package/dist/agent/artifact-card.d.ts +9 -0
- package/dist/agent/artifact-card.d.ts.map +1 -0
- package/dist/agent/artifact-panel-state.d.ts +16 -0
- package/dist/agent/artifact-panel-state.d.ts.map +1 -0
- package/dist/agent/artifact-panel.d.ts +38 -0
- package/dist/agent/artifact-panel.d.ts.map +1 -0
- package/dist/agent/bash/bash-tool-view.d.ts +17 -0
- package/dist/agent/bash/bash-tool-view.d.ts.map +1 -0
- package/dist/agent/bash/data.d.ts +35 -0
- package/dist/agent/bash/data.d.ts.map +1 -0
- package/dist/agent/bash/interpret.d.ts +84 -0
- package/dist/agent/bash/interpret.d.ts.map +1 -0
- package/dist/agent/bash/renderers.d.ts +31 -0
- package/dist/agent/bash/renderers.d.ts.map +1 -0
- package/dist/agent/bash/shell.d.ts +16 -0
- package/dist/agent/bash/shell.d.ts.map +1 -0
- package/dist/agent/components/activity-status.d.ts +13 -0
- package/dist/agent/components/activity-status.d.ts.map +1 -0
- package/dist/agent/components/agent-thread-switcher.d.ts +16 -0
- package/dist/agent/components/agent-thread-switcher.d.ts.map +1 -0
- package/dist/agent/components/composer.d.ts +47 -0
- package/dist/agent/components/composer.d.ts.map +1 -0
- package/dist/agent/components/context-chips.d.ts +7 -0
- package/dist/agent/components/context-chips.d.ts.map +1 -0
- package/dist/agent/components/context-picker.d.ts +16 -0
- package/dist/agent/components/context-picker.d.ts.map +1 -0
- package/dist/agent/components/conversation-panel.d.ts +82 -0
- package/dist/agent/components/conversation-panel.d.ts.map +1 -0
- package/dist/agent/components/file-attachment-card.d.ts +8 -0
- package/dist/agent/components/file-attachment-card.d.ts.map +1 -0
- package/dist/agent/components/message-parts.d.ts +14 -0
- package/dist/agent/components/message-parts.d.ts.map +1 -0
- package/dist/agent/components/message-view.d.ts +58 -0
- package/dist/agent/components/message-view.d.ts.map +1 -0
- package/dist/agent/components/model-controls.d.ts +20 -0
- package/dist/agent/components/model-controls.d.ts.map +1 -0
- package/dist/agent/components/model-picker-row.d.ts +8 -0
- package/dist/agent/components/model-picker-row.d.ts.map +1 -0
- package/dist/agent/components/provider-logo.d.ts +6 -0
- package/dist/agent/components/provider-logo.d.ts.map +1 -0
- package/dist/agent/components/provider-logos.d.ts +3 -0
- package/dist/agent/components/provider-logos.d.ts.map +1 -0
- package/dist/agent/components/reasoning-effort-slider.d.ts +11 -0
- package/dist/agent/components/reasoning-effort-slider.d.ts.map +1 -0
- package/dist/agent/components/sandbox-recovery.d.ts +6 -0
- package/dist/agent/components/sandbox-recovery.d.ts.map +1 -0
- package/dist/agent/components/thread-artifacts-menu.d.ts +8 -0
- package/dist/agent/components/thread-artifacts-menu.d.ts.map +1 -0
- package/dist/agent/components/transcript.d.ts +36 -0
- package/dist/agent/components/transcript.d.ts.map +1 -0
- package/dist/agent/components/web-fetch-tool-view.d.ts +5 -0
- package/dist/agent/components/web-fetch-tool-view.d.ts.map +1 -0
- package/dist/agent/components/web-search-tool-view.d.ts +5 -0
- package/dist/agent/components/web-search-tool-view.d.ts.map +1 -0
- package/dist/agent/components/web-sources.d.ts +9 -0
- package/dist/agent/components/web-sources.d.ts.map +1 -0
- package/dist/agent/format.d.ts +12 -0
- package/dist/agent/format.d.ts.map +1 -0
- package/dist/agent/hooks/use-agent-conversation.d.ts +337 -0
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -0
- package/dist/agent/hooks/use-thread-stream.d.ts +22 -0
- package/dist/agent/hooks/use-thread-stream.d.ts.map +1 -0
- package/dist/agent/i18n/en.d.ts +550 -0
- package/dist/agent/i18n/en.d.ts.map +1 -0
- package/dist/agent/i18n/fr.d.ts +4 -0
- package/dist/agent/i18n/fr.d.ts.map +1 -0
- package/dist/agent/i18n/index.d.ts +1079 -0
- package/dist/agent/i18n/index.d.ts.map +1 -0
- package/dist/agent/live-run.d.ts +48 -0
- package/dist/agent/live-run.d.ts.map +1 -0
- package/dist/agent/model-selection.d.ts +33 -0
- package/dist/agent/model-selection.d.ts.map +1 -0
- package/dist/agent/object-context-title.d.ts +22 -0
- package/dist/agent/object-context-title.d.ts.map +1 -0
- package/dist/agent/parts.d.ts +42 -0
- package/dist/agent/parts.d.ts.map +1 -0
- package/dist/agent/publish-artifact/interpret.d.ts +32 -0
- package/dist/agent/publish-artifact/interpret.d.ts.map +1 -0
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts +9 -0
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts.map +1 -0
- package/dist/agent/publish-artifact/use-live-publishes.d.ts +10 -0
- package/dist/agent/publish-artifact/use-live-publishes.d.ts.map +1 -0
- package/dist/agent/react-router.d.ts +7 -0
- package/dist/agent/react-router.d.ts.map +1 -0
- package/dist/agent/read/interpret.d.ts +24 -0
- package/dist/agent/read/interpret.d.ts.map +1 -0
- package/dist/agent/read/read-tool-view.d.ts +5 -0
- package/dist/agent/read/read-tool-view.d.ts.map +1 -0
- package/dist/agent/requester-settings.d.ts +15 -0
- package/dist/agent/requester-settings.d.ts.map +1 -0
- package/dist/agent/run-presentation.d.ts +70 -0
- package/dist/agent/run-presentation.d.ts.map +1 -0
- package/dist/agent/thread-navigation.d.ts +5 -0
- package/dist/agent/thread-navigation.d.ts.map +1 -0
- package/dist/agent/types.d.ts +22 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/utils/context-display.d.ts +5 -0
- package/dist/agent/utils/context-display.d.ts.map +1 -0
- package/dist/agent/utils/context-mention.d.ts +12 -0
- package/dist/agent/utils/context-mention.d.ts.map +1 -0
- package/dist/agent/utils/web-fetch.d.ts +4 -0
- package/dist/agent/utils/web-fetch.d.ts.map +1 -0
- package/dist/agent/utils/web-search.d.ts +20 -0
- package/dist/agent/utils/web-search.d.ts.map +1 -0
- package/dist/agent/view-file/interpret.d.ts +9 -0
- package/dist/agent/view-file/interpret.d.ts.map +1 -0
- package/dist/agent/view-file/view-file-tool-view.d.ts +9 -0
- package/dist/agent/view-file/view-file-tool-view.d.ts.map +1 -0
- package/dist/artifacts/artifact-page.d.ts +7 -0
- package/dist/artifacts/artifact-page.d.ts.map +1 -0
- package/dist/artifacts/card-details.d.ts +15 -0
- package/dist/artifacts/card-details.d.ts.map +1 -0
- package/dist/artifacts/card-preview.d.ts +59 -0
- package/dist/artifacts/card-preview.d.ts.map +1 -0
- package/dist/artifacts/copy-feedback.d.ts +6 -0
- package/dist/artifacts/copy-feedback.d.ts.map +1 -0
- package/dist/artifacts/file-size.d.ts +11 -0
- package/dist/artifacts/file-size.d.ts.map +1 -0
- package/dist/artifacts/file-source.d.ts +45 -0
- package/dist/artifacts/file-source.d.ts.map +1 -0
- package/dist/artifacts/file-view.d.ts +9 -0
- package/dist/artifacts/file-view.d.ts.map +1 -0
- package/dist/artifacts/frame.d.ts +45 -0
- package/dist/artifacts/frame.d.ts.map +1 -0
- package/dist/artifacts/gallery.d.ts +6 -0
- package/dist/artifacts/gallery.d.ts.map +1 -0
- package/dist/artifacts/kind-icon.d.ts +8 -0
- package/dist/artifacts/kind-icon.d.ts.map +1 -0
- package/dist/artifacts/markdown-tree.d.ts +22 -0
- package/dist/artifacts/markdown-tree.d.ts.map +1 -0
- package/dist/artifacts/messages.d.ts +301 -0
- package/dist/artifacts/messages.d.ts.map +1 -0
- package/dist/artifacts/queries.d.ts +21 -0
- package/dist/artifacts/queries.d.ts.map +1 -0
- package/dist/artifacts/references/embed-tree.d.ts +17 -0
- package/dist/artifacts/references/embed-tree.d.ts.map +1 -0
- package/dist/artifacts/references/references.d.ts +50 -0
- package/dist/artifacts/references/references.d.ts.map +1 -0
- package/dist/artifacts/renderers/document-tree.d.ts +11 -0
- package/dist/artifacts/renderers/document-tree.d.ts.map +1 -0
- package/dist/artifacts/renderers/document.d.ts +17 -0
- package/dist/artifacts/renderers/document.d.ts.map +1 -0
- package/dist/artifacts/renderers/file.d.ts +10 -0
- package/dist/artifacts/renderers/file.d.ts.map +1 -0
- package/dist/artifacts/renderers/notice.d.ts +12 -0
- package/dist/artifacts/renderers/notice.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/chart-data.d.ts +33 -0
- package/dist/artifacts/renderers/sheet/chart-data.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/chart.d.ts +15 -0
- package/dist/artifacts/renderers/sheet/chart.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/format.d.ts +35 -0
- package/dist/artifacts/renderers/sheet/format.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/grid.d.ts +25 -0
- package/dist/artifacts/renderers/sheet/grid.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/mini-chart.d.ts +7 -0
- package/dist/artifacts/renderers/sheet/mini-chart.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/model.d.ts +29 -0
- package/dist/artifacts/renderers/sheet/model.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/selection.d.ts +42 -0
- package/dist/artifacts/renderers/sheet/selection.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/sheet.d.ts +17 -0
- package/dist/artifacts/renderers/sheet/sheet.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/virtual.d.ts +13 -0
- package/dist/artifacts/renderers/sheet/virtual.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/workbook.d.ts +24 -0
- package/dist/artifacts/renderers/sheet/workbook.d.ts.map +1 -0
- package/dist/artifacts/renderers/slides/navigation.d.ts +17 -0
- package/dist/artifacts/renderers/slides/navigation.d.ts.map +1 -0
- package/dist/artifacts/renderers/slides/slides.d.ts +14 -0
- package/dist/artifacts/renderers/slides/slides.d.ts.map +1 -0
- package/dist/artifacts/target.d.ts +29 -0
- package/dist/artifacts/target.d.ts.map +1 -0
- package/dist/artifacts/theme.d.ts +18 -0
- package/dist/artifacts/theme.d.ts.map +1 -0
- package/dist/artifacts/viewer.d.ts +19 -0
- package/dist/artifacts/viewer.d.ts.map +1 -0
- package/dist/chunk-3schcf10.js +251 -0
- package/dist/chunk-3schcf10.js.map +10 -0
- package/dist/chunk-6n5pdqp0.js +115 -0
- package/dist/chunk-6n5pdqp0.js.map +11 -0
- package/dist/chunk-c7gy61rx.js +276 -0
- package/dist/chunk-c7gy61rx.js.map +10 -0
- package/dist/chunk-g3f4cm8x.js +20 -0
- package/dist/chunk-g3f4cm8x.js.map +10 -0
- package/dist/chunk-gn3k23q5.js +149 -0
- package/dist/chunk-gn3k23q5.js.map +10 -0
- package/dist/chunk-md3p7qdt.js +379 -0
- package/dist/chunk-md3p7qdt.js.map +10 -0
- package/dist/chunk-ng0hdnrq.js +183 -0
- package/dist/chunk-ng0hdnrq.js.map +10 -0
- package/dist/chunk-xxpdn63v.js +15018 -0
- package/dist/chunk-xxpdn63v.js.map +105 -0
- package/dist/chunk-yvhzn4ye.js +98 -0
- package/dist/chunk-yvhzn4ye.js.map +10 -0
- package/dist/codegen.d.ts +8 -4
- package/dist/codegen.d.ts.map +1 -1
- package/dist/createCustomApp.d.ts +14 -7
- package/dist/createCustomApp.d.ts.map +1 -1
- package/dist/index.d.ts +31 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +962 -2891
- package/dist/index.js.map +14 -13
- package/dist/locale-messages.d.ts +74 -6
- package/dist/locale-messages.d.ts.map +1 -1
- package/dist/locale.d.ts +75 -8
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +10 -19
- package/dist/locale.js.map +3 -4
- package/dist/metadata.d.ts.map +1 -1
- package/dist/pages/data/connectors.d.ts +5 -0
- package/dist/pages/data/connectors.d.ts.map +1 -0
- package/dist/pages/data/datasets.d.ts +30 -0
- package/dist/pages/data/datasets.d.ts.map +1 -0
- package/dist/pages/data/live-updates.d.ts +13 -0
- package/dist/pages/data/live-updates.d.ts.map +1 -0
- package/dist/pages/data/messages.d.ts +354 -0
- package/dist/pages/data/messages.d.ts.map +1 -0
- package/dist/pages/data/pipeline-canvas.d.ts +34 -0
- package/dist/pages/data/pipeline-canvas.d.ts.map +1 -0
- package/dist/pages/data/pipelines.d.ts +9 -0
- package/dist/pages/data/pipelines.d.ts.map +1 -0
- package/dist/pages/data/projections.d.ts +10 -0
- package/dist/pages/data/projections.d.ts.map +1 -0
- package/dist/pages/data/schema.d.ts +20 -0
- package/dist/pages/data/schema.d.ts.map +1 -0
- package/dist/pages/data/shared.d.ts +13 -0
- package/dist/pages/data/shared.d.ts.map +1 -0
- package/dist/pages/data/sync-button.d.ts +15 -0
- package/dist/pages/data/sync-button.d.ts.map +1 -0
- package/dist/pages/data/syncs.d.ts +5 -0
- package/dist/pages/data/syncs.d.ts.map +1 -0
- package/dist/pages/home.d.ts +6 -0
- package/dist/pages/home.d.ts.map +1 -0
- package/dist/pages/mosaic.d.ts +5 -0
- package/dist/pages/mosaic.d.ts.map +1 -0
- package/dist/pages/observability/action-run.d.ts +19 -0
- package/dist/pages/observability/action-run.d.ts.map +1 -0
- package/dist/pages/observability/activity/calendar.d.ts +9 -0
- package/dist/pages/observability/activity/calendar.d.ts.map +1 -0
- package/dist/pages/observability/activity/connections.d.ts +7 -0
- package/dist/pages/observability/activity/connections.d.ts.map +1 -0
- package/dist/pages/observability/activity/format.d.ts +11 -0
- package/dist/pages/observability/activity/format.d.ts.map +1 -0
- package/dist/pages/observability/activity/messages.d.ts +231 -0
- package/dist/pages/observability/activity/messages.d.ts.map +1 -0
- package/dist/pages/observability/activity/meta-items.d.ts +10 -0
- package/dist/pages/observability/activity/meta-items.d.ts.map +1 -0
- package/dist/pages/observability/activity/page.d.ts +6 -0
- package/dist/pages/observability/activity/page.d.ts.map +1 -0
- package/dist/pages/observability/activity/period.d.ts +31 -0
- package/dist/pages/observability/activity/period.d.ts.map +1 -0
- package/dist/pages/observability/activity/steps.d.ts +44 -0
- package/dist/pages/observability/activity/steps.d.ts.map +1 -0
- package/dist/pages/observability/activity/timeline.d.ts +36 -0
- package/dist/pages/observability/activity/timeline.d.ts.map +1 -0
- package/dist/pages/observability/activity/users.d.ts +18 -0
- package/dist/pages/observability/activity/users.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/calls.d.ts +27 -0
- package/dist/pages/observability/ai-usage/calls.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/charts.d.ts +23 -0
- package/dist/pages/observability/ai-usage/charts.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/format.d.ts +101 -0
- package/dist/pages/observability/ai-usage/format.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/limits.d.ts +12 -0
- package/dist/pages/observability/ai-usage/limits.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/messages.d.ts +431 -0
- package/dist/pages/observability/ai-usage/messages.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/page.d.ts +6 -0
- package/dist/pages/observability/ai-usage/page.d.ts.map +1 -0
- package/dist/pages/observability/live-updates.d.ts +3 -0
- package/dist/pages/observability/live-updates.d.ts.map +1 -0
- package/dist/pages/observability/logs.d.ts +11 -0
- package/dist/pages/observability/logs.d.ts.map +1 -0
- package/dist/pages/observability/messages.d.ts +329 -0
- package/dist/pages/observability/messages.d.ts.map +1 -0
- package/dist/pages/observability/runs.d.ts +7 -0
- package/dist/pages/observability/runs.d.ts.map +1 -0
- package/dist/pages/observability/workflow-run.d.ts +6 -0
- package/dist/pages/observability/workflow-run.d.ts.map +1 -0
- package/dist/pages/ontology/actions.d.ts +3 -0
- package/dist/pages/ontology/actions.d.ts.map +1 -0
- package/dist/pages/ontology/components/action-button.d.ts +12 -0
- package/dist/pages/ontology/components/action-button.d.ts.map +1 -0
- package/dist/pages/ontology/components/action-param-null-control.d.ts +7 -0
- package/dist/pages/ontology/components/action-param-null-control.d.ts.map +1 -0
- package/dist/pages/ontology/components/collection-toolbar.d.ts +21 -0
- package/dist/pages/ontology/components/collection-toolbar.d.ts.map +1 -0
- package/dist/pages/ontology/components/common.d.ts +16 -0
- package/dist/pages/ontology/components/common.d.ts.map +1 -0
- package/dist/pages/ontology/components/file-ref-upload-field.d.ts +13 -0
- package/dist/pages/ontology/components/file-ref-upload-field.d.ts.map +1 -0
- package/dist/pages/ontology/components/object-filter-popover.d.ts +9 -0
- package/dist/pages/ontology/components/object-filter-popover.d.ts.map +1 -0
- package/dist/pages/ontology/components/object-icon.d.ts +7 -0
- package/dist/pages/ontology/components/object-icon.d.ts.map +1 -0
- package/dist/pages/ontology/components/object-query-bar.d.ts +21 -0
- package/dist/pages/ontology/components/object-query-bar.d.ts.map +1 -0
- package/dist/pages/ontology/components/telemetry-chart.d.ts +18 -0
- package/dist/pages/ontology/components/telemetry-chart.d.ts.map +1 -0
- package/dist/pages/ontology/components/telemetry-grid.d.ts +19 -0
- package/dist/pages/ontology/components/telemetry-grid.d.ts.map +1 -0
- package/dist/pages/ontology/components/telemetry-tile.d.ts +18 -0
- package/dist/pages/ontology/components/telemetry-tile.d.ts.map +1 -0
- package/dist/pages/ontology/components/telemetry-value.d.ts +10 -0
- package/dist/pages/ontology/components/telemetry-value.d.ts.map +1 -0
- package/dist/pages/ontology/components/usage-bar.d.ts +12 -0
- package/dist/pages/ontology/components/usage-bar.d.ts.map +1 -0
- package/dist/pages/ontology/graph.d.ts +6 -0
- package/dist/pages/ontology/graph.d.ts.map +1 -0
- package/dist/pages/ontology/hooks/object-live-updates.d.ts +5 -0
- package/dist/pages/ontology/hooks/object-live-updates.d.ts.map +1 -0
- package/dist/pages/ontology/hooks/object-telemetry-updates.d.ts +8 -0
- package/dist/pages/ontology/hooks/object-telemetry-updates.d.ts.map +1 -0
- package/dist/pages/ontology/hooks/object-type-counts.d.ts +5 -0
- package/dist/pages/ontology/hooks/object-type-counts.d.ts.map +1 -0
- package/dist/pages/ontology/hooks/rule-live-updates.d.ts +9 -0
- package/dist/pages/ontology/hooks/rule-live-updates.d.ts.map +1 -0
- package/dist/pages/ontology/hooks/workflow-live-updates.d.ts +6 -0
- package/dist/pages/ontology/hooks/workflow-live-updates.d.ts.map +1 -0
- package/dist/pages/ontology/lib/action-params.d.ts +55 -0
- package/dist/pages/ontology/lib/action-params.d.ts.map +1 -0
- package/dist/pages/ontology/lib/format-value.d.ts +3 -0
- package/dist/pages/ontology/lib/format-value.d.ts.map +1 -0
- package/dist/pages/ontology/lib/labels.d.ts +3 -0
- package/dist/pages/ontology/lib/labels.d.ts.map +1 -0
- package/dist/pages/ontology/lib/live-update-keys.d.ts +15 -0
- package/dist/pages/ontology/lib/live-update-keys.d.ts.map +1 -0
- package/dist/pages/ontology/lib/object-query.d.ts +72 -0
- package/dist/pages/ontology/lib/object-query.d.ts.map +1 -0
- package/dist/pages/ontology/lib/ontology-graph-layout.d.ts +68 -0
- package/dist/pages/ontology/lib/ontology-graph-layout.d.ts.map +1 -0
- package/dist/pages/ontology/lib/ontology-graph-links.d.ts +4 -0
- package/dist/pages/ontology/lib/ontology-graph-links.d.ts.map +1 -0
- package/dist/pages/ontology/lib/telemetry-history.d.ts +10 -0
- package/dist/pages/ontology/lib/telemetry-history.d.ts.map +1 -0
- package/dist/pages/ontology/lib/time.d.ts +3 -0
- package/dist/pages/ontology/lib/time.d.ts.map +1 -0
- package/dist/pages/ontology/lib/user-preferences.d.ts +8 -0
- package/dist/pages/ontology/lib/user-preferences.d.ts.map +1 -0
- package/dist/pages/ontology/object-page.d.ts +7 -0
- package/dist/pages/ontology/object-page.d.ts.map +1 -0
- package/dist/pages/ontology/object-type.d.ts +3 -0
- package/dist/pages/ontology/object-type.d.ts.map +1 -0
- package/dist/pages/ontology/object-types.d.ts +7 -0
- package/dist/pages/ontology/object-types.d.ts.map +1 -0
- package/dist/pages/ontology/objects.d.ts +6 -0
- package/dist/pages/ontology/objects.d.ts.map +1 -0
- package/dist/pages/ontology/rules.d.ts +32 -0
- package/dist/pages/ontology/rules.d.ts.map +1 -0
- package/dist/pages/ontology/workflow.d.ts +6 -0
- package/dist/pages/ontology/workflow.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/agent-execution-panel.d.ts +17 -0
- package/dist/pages/ontology/workflows/agent-execution-panel.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/intervention-panel.d.ts +5 -0
- package/dist/pages/ontology/workflows/intervention-panel.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/node-execution-panel.d.ts +11 -0
- package/dist/pages/ontology/workflows/node-execution-panel.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/request-run-dialog.d.ts +5 -0
- package/dist/pages/ontology/workflows/request-run-dialog.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/run-debug-section.d.ts +11 -0
- package/dist/pages/ontology/workflows/run-debug-section.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/run-input-form.d.ts +18 -0
- package/dist/pages/ontology/workflows/run-input-form.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/run-progress.d.ts +15 -0
- package/dist/pages/ontology/workflows/run-progress.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/schema-shape.d.ts +10 -0
- package/dist/pages/ontology/workflows/schema-shape.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/status-badge.d.ts +5 -0
- package/dist/pages/ontology/workflows/status-badge.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/utils.d.ts +29 -0
- package/dist/pages/ontology/workflows/utils.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/workflow-card.d.ts +5 -0
- package/dist/pages/ontology/workflows/workflow-card.d.ts.map +1 -0
- package/dist/pages/ontology/workflows.d.ts +3 -0
- package/dist/pages/ontology/workflows.d.ts.map +1 -0
- package/dist/pages/routes.d.ts +26 -0
- package/dist/pages/routes.d.ts.map +1 -0
- package/dist/pages/section-page.d.ts +91 -0
- package/dist/pages/section-page.d.ts.map +1 -0
- package/dist/pages/section-ui.d.ts +212 -0
- package/dist/pages/section-ui.d.ts.map +1 -0
- package/dist/pages/settings/controls.d.ts +94 -0
- package/dist/pages/settings/controls.d.ts.map +1 -0
- package/dist/pages/settings/developers.d.ts +3 -0
- package/dist/pages/settings/developers.d.ts.map +1 -0
- package/dist/pages/settings/members.d.ts +3 -0
- package/dist/pages/settings/members.d.ts.map +1 -0
- package/dist/pages/settings/messages.d.ts +538 -0
- package/dist/pages/settings/messages.d.ts.map +1 -0
- package/dist/pages/settings/personal.d.ts +6 -0
- package/dist/pages/settings/personal.d.ts.map +1 -0
- package/dist/pages/settings/service-accounts.d.ts +3 -0
- package/dist/pages/settings/service-accounts.d.ts.map +1 -0
- package/dist/pages/settings/sessions.d.ts +3 -0
- package/dist/pages/settings/sessions.d.ts.map +1 -0
- package/dist/pages/values.d.ts +77 -0
- package/dist/pages/values.d.ts.map +1 -0
- package/dist/pages.d.ts +45 -0
- package/dist/pages.d.ts.map +1 -0
- package/dist/pages.js +26029 -0
- package/dist/pages.js.map +98 -0
- package/dist/runtime.d.ts +0 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/sections/catalog.d.ts +37 -0
- package/dist/sections/catalog.d.ts.map +1 -0
- package/dist/sections/counts.d.ts +7 -0
- package/dist/sections/counts.d.ts.map +1 -0
- package/dist/sections/sections.d.ts +67 -0
- package/dist/sections/sections.d.ts.map +1 -0
- package/dist/server.d.ts +8 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +3036 -0
- package/dist/server.js.map +19 -0
- package/dist/session.d.ts +18 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/shell/agent-dock.d.ts +7 -0
- package/dist/shell/agent-dock.d.ts.map +1 -0
- package/dist/shell/app-shell.d.ts +42 -0
- package/dist/shell/app-shell.d.ts.map +1 -0
- package/dist/shell/brand.d.ts +15 -0
- package/dist/shell/brand.d.ts.map +1 -0
- package/dist/shell/nav-items.d.ts +34 -0
- package/dist/shell/nav-items.d.ts.map +1 -0
- package/dist/shell/search-command.d.ts +12 -0
- package/dist/shell/search-command.d.ts.map +1 -0
- package/dist/shell/section-nav.d.ts +13 -0
- package/dist/shell/section-nav.d.ts.map +1 -0
- package/dist/shell/user-menu.d.ts +25 -0
- package/dist/shell/user-menu.d.ts.map +1 -0
- package/dist/tailwind.d.ts +4 -4
- package/dist/tailwind.d.ts.map +1 -1
- package/package.json +22 -21
- package/src/agent/activity-label.ts +70 -0
- package/src/agent/agent-chat.tsx +248 -0
- package/src/agent/agent-context-provider.tsx +92 -0
- package/src/agent/agent-execution-trace.tsx +316 -0
- package/src/agent/agent-panel.tsx +74 -0
- package/src/agent/agent-surface-state.ts +113 -0
- package/src/agent/agent-surface.tsx +363 -0
- package/src/agent/agent.css +231 -0
- package/src/agent/agents-page.ts +7 -0
- package/src/agent/artifact-card.tsx +190 -0
- package/src/agent/artifact-panel-state.ts +38 -0
- package/src/agent/artifact-panel.tsx +320 -0
- package/src/agent/bash/bash-tool-view.tsx +288 -0
- package/src/agent/bash/data.ts +137 -0
- package/src/agent/bash/interpret.ts +769 -0
- package/src/agent/bash/renderers.tsx +503 -0
- package/src/agent/bash/shell.ts +195 -0
- package/src/agent/components/activity-status.tsx +86 -0
- package/src/agent/components/agent-thread-switcher.tsx +346 -0
- package/src/agent/components/composer.tsx +870 -0
- package/src/agent/components/context-chips.tsx +63 -0
- package/src/agent/components/context-picker.tsx +88 -0
- package/src/agent/components/conversation-panel.tsx +352 -0
- package/src/agent/components/file-attachment-card.tsx +136 -0
- package/src/agent/components/message-parts.tsx +305 -0
- package/src/agent/components/message-view.tsx +422 -0
- package/src/agent/components/model-controls.tsx +204 -0
- package/src/agent/components/model-picker-row.tsx +136 -0
- package/src/agent/components/provider-logo.tsx +31 -0
- package/src/agent/components/provider-logos.ts +24 -0
- package/src/agent/components/reasoning-effort-slider.tsx +121 -0
- package/src/agent/components/sandbox-recovery.tsx +49 -0
- package/src/agent/components/thread-artifacts-menu.tsx +77 -0
- package/src/agent/components/transcript.tsx +239 -0
- package/src/agent/components/web-fetch-tool-view.tsx +69 -0
- package/src/agent/components/web-search-tool-view.tsx +37 -0
- package/src/agent/components/web-sources.tsx +159 -0
- package/src/agent/format.ts +60 -0
- package/src/agent/hooks/use-agent-conversation.ts +536 -0
- package/src/agent/hooks/use-thread-stream.ts +121 -0
- package/src/agent/i18n/en.ts +500 -0
- package/src/agent/i18n/fr.ts +530 -0
- package/src/agent/i18n/index.ts +14 -0
- package/src/agent/live-run.ts +257 -0
- package/src/agent/model-selection.ts +88 -0
- package/src/agent/object-context-title.ts +57 -0
- package/src/agent/parts.ts +119 -0
- package/src/agent/publish-artifact/interpret.ts +110 -0
- package/src/agent/publish-artifact/publish-artifact-tool-view.tsx +62 -0
- package/src/agent/publish-artifact/use-live-publishes.ts +45 -0
- package/src/agent/react-router.tsx +103 -0
- package/src/agent/read/interpret.ts +101 -0
- package/src/agent/read/read-tool-view.tsx +92 -0
- package/src/agent/requester-settings.ts +55 -0
- package/src/agent/run-presentation.ts +211 -0
- package/src/agent/thread-navigation.ts +11 -0
- package/src/agent/types.ts +37 -0
- package/src/agent/utils/context-display.ts +72 -0
- package/src/agent/utils/context-mention.ts +28 -0
- package/src/agent/utils/web-fetch.ts +20 -0
- package/src/agent/utils/web-search.ts +106 -0
- package/src/agent/view-file/interpret.ts +22 -0
- package/src/agent/view-file/view-file-tool-view.tsx +123 -0
- package/src/artifacts/artifact-page.tsx +61 -0
- package/src/artifacts/artifacts.css +172 -0
- package/src/artifacts/card-details.ts +92 -0
- package/src/artifacts/card-preview.tsx +612 -0
- package/src/artifacts/copy-feedback.ts +25 -0
- package/src/artifacts/file-size.ts +24 -0
- package/src/artifacts/file-source.ts +109 -0
- package/src/artifacts/file-view.ts +57 -0
- package/src/artifacts/frame.tsx +288 -0
- package/src/artifacts/gallery.tsx +405 -0
- package/src/artifacts/kind-icon.tsx +23 -0
- package/src/artifacts/markdown-tree.ts +32 -0
- package/src/artifacts/messages.ts +317 -0
- package/src/artifacts/queries.ts +85 -0
- package/src/artifacts/references/embed-tree.ts +86 -0
- package/src/artifacts/references/references.tsx +739 -0
- package/src/artifacts/renderers/document-tree.ts +157 -0
- package/src/artifacts/renderers/document.tsx +334 -0
- package/src/artifacts/renderers/file.tsx +160 -0
- package/src/artifacts/renderers/notice.tsx +38 -0
- package/src/artifacts/renderers/sheet/chart-data.ts +73 -0
- package/src/artifacts/renderers/sheet/chart.tsx +288 -0
- package/src/artifacts/renderers/sheet/format.ts +142 -0
- package/src/artifacts/renderers/sheet/grid.tsx +709 -0
- package/src/artifacts/renderers/sheet/mini-chart.tsx +241 -0
- package/src/artifacts/renderers/sheet/model.ts +136 -0
- package/src/artifacts/renderers/sheet/selection.ts +152 -0
- package/src/artifacts/renderers/sheet/sheet.tsx +471 -0
- package/src/artifacts/renderers/sheet/virtual.ts +49 -0
- package/src/artifacts/renderers/sheet/workbook.ts +57 -0
- package/src/artifacts/renderers/slides/navigation.ts +38 -0
- package/src/artifacts/renderers/slides/slides.tsx +441 -0
- package/src/artifacts/target.ts +76 -0
- package/src/artifacts/theme.ts +29 -0
- package/src/artifacts/viewer.tsx +476 -0
- package/src/build.ts +13 -2
- package/src/codegen.ts +98 -80
- package/src/createCustomApp.ts +175 -67
- package/src/index.ts +47 -16
- package/src/locale-messages.ts +128 -12
- package/src/locale.ts +1 -2
- package/src/metadata.ts +35 -1
- package/src/pages/canvas.css +43 -0
- package/src/pages/data/connectors.tsx +317 -0
- package/src/pages/data/datasets.tsx +731 -0
- package/src/pages/data/live-updates.ts +71 -0
- package/src/pages/data/messages.ts +349 -0
- package/src/pages/data/pipeline-canvas.tsx +288 -0
- package/src/pages/data/pipelines.tsx +710 -0
- package/src/pages/data/projections.tsx +482 -0
- package/src/pages/data/schema.tsx +62 -0
- package/src/pages/data/shared.tsx +78 -0
- package/src/pages/data/sync-button.tsx +103 -0
- package/src/pages/data/syncs.tsx +326 -0
- package/src/pages/home.tsx +64 -0
- package/src/pages/mosaic.tsx +97 -0
- package/src/pages/observability/action-run.tsx +229 -0
- package/src/pages/observability/activity/calendar.tsx +239 -0
- package/src/pages/observability/activity/connections.tsx +144 -0
- package/src/pages/observability/activity/format.ts +49 -0
- package/src/pages/observability/activity/messages.ts +255 -0
- package/src/pages/observability/activity/meta-items.tsx +23 -0
- package/src/pages/observability/activity/page.tsx +605 -0
- package/src/pages/observability/activity/period.ts +63 -0
- package/src/pages/observability/activity/steps.ts +102 -0
- package/src/pages/observability/activity/timeline.tsx +411 -0
- package/src/pages/observability/activity/users.tsx +133 -0
- package/src/pages/observability/ai-usage/calls.tsx +541 -0
- package/src/pages/observability/ai-usage/charts.tsx +126 -0
- package/src/pages/observability/ai-usage/format.ts +276 -0
- package/src/pages/observability/ai-usage/limits.tsx +629 -0
- package/src/pages/observability/ai-usage/messages.ts +446 -0
- package/src/pages/observability/ai-usage/page.tsx +814 -0
- package/src/pages/observability/live-updates.ts +19 -0
- package/src/pages/observability/logs.tsx +617 -0
- package/src/pages/observability/messages.ts +336 -0
- package/src/pages/observability/runs.tsx +732 -0
- package/src/pages/observability/workflow-run.tsx +323 -0
- package/src/pages/ontology/actions.tsx +749 -0
- package/src/pages/ontology/components/action-button.tsx +355 -0
- package/src/pages/ontology/components/action-param-null-control.tsx +35 -0
- package/src/pages/ontology/components/collection-toolbar.tsx +61 -0
- package/src/pages/ontology/components/common.tsx +60 -0
- package/src/pages/ontology/components/file-ref-upload-field.tsx +279 -0
- package/src/pages/ontology/components/object-filter-popover.tsx +311 -0
- package/src/pages/ontology/components/object-icon.tsx +133 -0
- package/src/pages/ontology/components/object-query-bar.tsx +217 -0
- package/src/pages/ontology/components/telemetry-chart.tsx +392 -0
- package/src/pages/ontology/components/telemetry-grid.tsx +137 -0
- package/src/pages/ontology/components/telemetry-tile.tsx +164 -0
- package/src/pages/ontology/components/telemetry-value.tsx +91 -0
- package/src/pages/ontology/components/usage-bar.tsx +64 -0
- package/src/pages/ontology/graph.tsx +1283 -0
- package/src/pages/ontology/hooks/object-live-updates.ts +53 -0
- package/src/pages/ontology/hooks/object-telemetry-updates.ts +45 -0
- package/src/pages/ontology/hooks/object-type-counts.ts +27 -0
- package/src/pages/ontology/hooks/rule-live-updates.ts +28 -0
- package/src/pages/ontology/hooks/workflow-live-updates.ts +20 -0
- package/src/pages/ontology/lib/action-params.ts +231 -0
- package/src/pages/ontology/lib/format-value.ts +34 -0
- package/src/pages/ontology/lib/labels.ts +50 -0
- package/src/pages/ontology/lib/live-update-keys.ts +62 -0
- package/src/pages/ontology/lib/object-query.ts +372 -0
- package/src/pages/ontology/lib/ontology-graph-layout.ts +1004 -0
- package/src/pages/ontology/lib/ontology-graph-links.ts +15 -0
- package/src/pages/ontology/lib/telemetry-history.ts +56 -0
- package/src/pages/ontology/lib/time.ts +23 -0
- package/src/pages/ontology/lib/user-preferences.ts +52 -0
- package/src/pages/ontology/object-page.tsx +1029 -0
- package/src/pages/ontology/object-type.tsx +910 -0
- package/src/pages/ontology/object-types.tsx +240 -0
- package/src/pages/ontology/objects.tsx +938 -0
- package/src/pages/ontology/rules.tsx +805 -0
- package/src/pages/ontology/workflow.tsx +1485 -0
- package/src/pages/ontology/workflows/agent-execution-panel.tsx +340 -0
- package/src/pages/ontology/workflows/intervention-panel.tsx +261 -0
- package/src/pages/ontology/workflows/node-execution-panel.tsx +86 -0
- package/src/pages/ontology/workflows/request-run-dialog.tsx +197 -0
- package/src/pages/ontology/workflows/run-debug-section.tsx +54 -0
- package/src/pages/ontology/workflows/run-input-form.tsx +900 -0
- package/src/pages/ontology/workflows/run-progress.tsx +83 -0
- package/src/pages/ontology/workflows/schema-shape.tsx +206 -0
- package/src/pages/ontology/workflows/status-badge.tsx +15 -0
- package/src/pages/ontology/workflows/utils.ts +107 -0
- package/src/pages/ontology/workflows/workflow-card.tsx +48 -0
- package/src/pages/ontology/workflows.tsx +143 -0
- package/src/pages/routes.ts +63 -0
- package/src/pages/section-page.tsx +272 -0
- package/src/pages/section-ui.tsx +773 -0
- package/src/pages/settings/controls.tsx +721 -0
- package/src/pages/settings/developers.tsx +163 -0
- package/src/pages/settings/members.tsx +1018 -0
- package/src/pages/settings/messages.ts +551 -0
- package/src/pages/settings/personal.tsx +97 -0
- package/src/pages/settings/service-accounts.tsx +623 -0
- package/src/pages/settings/sessions.tsx +183 -0
- package/src/pages/values.tsx +700 -0
- package/src/pages.ts +59 -0
- package/src/runtime.ts +0 -3
- package/src/sections/catalog.ts +182 -0
- package/src/sections/counts.ts +33 -0
- package/src/sections/sections.tsx +259 -0
- package/src/server.ts +19 -0
- package/src/session.ts +29 -0
- package/src/shell/agent-dock.tsx +32 -0
- package/src/shell/app-shell.tsx +142 -0
- package/src/shell/brand.tsx +47 -0
- package/src/shell/nav-items.tsx +136 -0
- package/src/shell/search-command.tsx +160 -0
- package/src/shell/section-nav.tsx +61 -0
- package/src/shell/user-menu.tsx +206 -0
- package/src/tailwind.ts +4 -4
- package/dist/agents.d.ts +0 -11
- package/dist/agents.d.ts.map +0 -1
- package/dist/agents.js +0 -41
- package/dist/agents.js.map +0 -10
- package/dist/auth.js +0 -3
- package/dist/auth.js.map +0 -9
- package/dist/browser.d.ts +0 -3
- package/dist/browser.d.ts.map +0 -1
- package/dist/browser.js +0 -9
- package/dist/browser.js.map +0 -9
- package/dist/chunk-cftmy40z.js +0 -70
- package/dist/chunk-cftmy40z.js.map +0 -10
- package/dist/chunk-e1gj8c1a.js +0 -8
- package/dist/chunk-e1gj8c1a.js.map +0 -10
- package/src/agents.ts +0 -48
- package/src/browser.ts +0 -2
|
@@ -0,0 +1,814 @@
|
|
|
1
|
+
import { isSixbApiError } from "@sixb/client"
|
|
2
|
+
import {
|
|
3
|
+
getAiAccountingOverviewOptions,
|
|
4
|
+
getAiLimitStatusQueryKey,
|
|
5
|
+
listAiModelCallGroupsOptions,
|
|
6
|
+
} from "@sixb/client/hooks"
|
|
7
|
+
import {
|
|
8
|
+
Button,
|
|
9
|
+
MiniSparkline,
|
|
10
|
+
Select,
|
|
11
|
+
SelectContent,
|
|
12
|
+
SelectItem,
|
|
13
|
+
SelectTrigger,
|
|
14
|
+
SelectValue,
|
|
15
|
+
} from "@sixb/ui/components"
|
|
16
|
+
import { useLocale } from "@sixb/ui/lib/i18n"
|
|
17
|
+
import { cn } from "@sixb/ui/lib/utils"
|
|
18
|
+
import { useQuery, useQueryClient } from "@tanstack/react-query"
|
|
19
|
+
import { ChartNoAxesCombined, Loader2, RefreshCw, TriangleAlert } from "lucide-react"
|
|
20
|
+
import { lazy, type ReactNode, Suspense, useMemo, useState } from "react"
|
|
21
|
+
import { SectionPage } from "../../section-page"
|
|
22
|
+
import { PageSection, Panel, PanelEmpty, PanelSkeleton, useLoadFailure } from "../../section-ui"
|
|
23
|
+
import { type CallFilters, callsPageSize, ModelCalls } from "./calls"
|
|
24
|
+
import {
|
|
25
|
+
amountFor,
|
|
26
|
+
bucketFor,
|
|
27
|
+
currenciesOf,
|
|
28
|
+
formatChartMoney,
|
|
29
|
+
formatCompact,
|
|
30
|
+
formatMoney,
|
|
31
|
+
formatPercent,
|
|
32
|
+
nanosToNumber,
|
|
33
|
+
type Overview,
|
|
34
|
+
periodTokens,
|
|
35
|
+
type RangePreset,
|
|
36
|
+
rangePresets,
|
|
37
|
+
reportingCoverage,
|
|
38
|
+
type UsageField,
|
|
39
|
+
usageShare,
|
|
40
|
+
} from "./format"
|
|
41
|
+
import { AiLimits, limitStatusQuery } from "./limits"
|
|
42
|
+
import { useAiUsageMessages } from "./messages"
|
|
43
|
+
|
|
44
|
+
const TimeSeries = lazy(() => import("./charts"))
|
|
45
|
+
|
|
46
|
+
type Valuation = "rated" | "unpriceable" | "unvalued"
|
|
47
|
+
const valuations: readonly Valuation[] = ["rated", "unpriceable", "unvalued"]
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Observability › AI usage: this month's limits, then what models were called in a range — cost,
|
|
51
|
+
* tokens and how complete the accounting is — and every call behind it.
|
|
52
|
+
*/
|
|
53
|
+
export function ObservabilityAiUsagePage() {
|
|
54
|
+
const messages = useAiUsageMessages()
|
|
55
|
+
const locale = useLocale()
|
|
56
|
+
const queryClient = useQueryClient()
|
|
57
|
+
const [preset, setPreset] = useState<RangePreset>("7d")
|
|
58
|
+
// The range ends when it was chosen; Refresh moves it to now.
|
|
59
|
+
const [end, setEnd] = useState(() => new Date())
|
|
60
|
+
const [providerId, setProviderId] = useState<string>()
|
|
61
|
+
const [modelId, setModelId] = useState<string>()
|
|
62
|
+
const [chosenCurrency, setCurrency] = useState<string>()
|
|
63
|
+
const [valuation, setValuation] = useState<Valuation>()
|
|
64
|
+
const [offset, setOffset] = useState(0)
|
|
65
|
+
|
|
66
|
+
const range = useMemo(() => {
|
|
67
|
+
const span = rangePresets.find((entry) => entry.id === preset)?.ms ?? rangePresets[1].ms
|
|
68
|
+
return { from: new Date(end.getTime() - span).toISOString(), to: end.toISOString() }
|
|
69
|
+
}, [preset, end])
|
|
70
|
+
const bucket = bucketFor(range)
|
|
71
|
+
// The unfiltered overview also lists every provider and model, so the filters can offer them.
|
|
72
|
+
const allQuery = useQuery({
|
|
73
|
+
...getAiAccountingOverviewOptions({ query: { ...range, bucket } }),
|
|
74
|
+
retry: false,
|
|
75
|
+
})
|
|
76
|
+
const filtered = providerId !== undefined || modelId !== undefined
|
|
77
|
+
const filteredQuery = useQuery({
|
|
78
|
+
...getAiAccountingOverviewOptions({ query: { ...range, bucket, providerId, modelId } }),
|
|
79
|
+
enabled: filtered,
|
|
80
|
+
retry: false,
|
|
81
|
+
})
|
|
82
|
+
const overview = filtered ? filteredQuery.data : allQuery.data
|
|
83
|
+
const callFilters: CallFilters = { ...range, providerId, modelId, valuationStatus: valuation }
|
|
84
|
+
const callsQuery = useQuery({
|
|
85
|
+
...listAiModelCallGroupsOptions({
|
|
86
|
+
query: { ...callFilters, limit: String(callsPageSize), offset: String(offset) },
|
|
87
|
+
}),
|
|
88
|
+
retry: false,
|
|
89
|
+
})
|
|
90
|
+
const currencies = useMemo(() => currenciesOf(overview), [overview])
|
|
91
|
+
const currency =
|
|
92
|
+
chosenCurrency && currencies.includes(chosenCurrency)
|
|
93
|
+
? chosenCurrency
|
|
94
|
+
: currencies.includes("USD")
|
|
95
|
+
? "USD"
|
|
96
|
+
: currencies[0]
|
|
97
|
+
|
|
98
|
+
const refresh = () => {
|
|
99
|
+
void queryClient.invalidateQueries({ queryKey: getAiLimitStatusQueryKey(limitStatusQuery) })
|
|
100
|
+
setEnd(new Date())
|
|
101
|
+
}
|
|
102
|
+
const changeFilter = (apply: () => void) => {
|
|
103
|
+
apply()
|
|
104
|
+
setOffset(0)
|
|
105
|
+
}
|
|
106
|
+
const loading = allQuery.isPending || (filtered && filteredQuery.isPending)
|
|
107
|
+
const error = allQuery.error ?? filteredQuery.error
|
|
108
|
+
const failure = useLoadFailure(error, { denied: messages.denied, fallback: messages.unavailable })
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<SectionPage
|
|
112
|
+
section="observability"
|
|
113
|
+
page="ai-usage"
|
|
114
|
+
width="wide"
|
|
115
|
+
title={messages.title}
|
|
116
|
+
description={messages.description}
|
|
117
|
+
actions={
|
|
118
|
+
<>
|
|
119
|
+
<div className="inline-flex rounded-lg bg-muted/70 p-0.5 ring-1 ring-border/70">
|
|
120
|
+
{rangePresets.map((entry) => (
|
|
121
|
+
<button
|
|
122
|
+
key={entry.id}
|
|
123
|
+
type="button"
|
|
124
|
+
aria-pressed={preset === entry.id}
|
|
125
|
+
onClick={() => {
|
|
126
|
+
setPreset(entry.id)
|
|
127
|
+
setEnd(new Date())
|
|
128
|
+
setOffset(0)
|
|
129
|
+
}}
|
|
130
|
+
className={cn(
|
|
131
|
+
"h-7 rounded-md px-2.5 text-[0.8125rem] font-medium text-muted-foreground transition-colors hover:text-foreground",
|
|
132
|
+
preset === entry.id && "bg-background text-foreground ring-1 ring-border"
|
|
133
|
+
)}
|
|
134
|
+
>
|
|
135
|
+
{messages.ranges[entry.id]}
|
|
136
|
+
</button>
|
|
137
|
+
))}
|
|
138
|
+
</div>
|
|
139
|
+
<Button
|
|
140
|
+
type="button"
|
|
141
|
+
variant="outline"
|
|
142
|
+
size="icon-sm"
|
|
143
|
+
onClick={refresh}
|
|
144
|
+
aria-label={messages.refresh}
|
|
145
|
+
>
|
|
146
|
+
<RefreshCw />
|
|
147
|
+
</Button>
|
|
148
|
+
</>
|
|
149
|
+
}
|
|
150
|
+
>
|
|
151
|
+
<AiLimits />
|
|
152
|
+
|
|
153
|
+
<PageSection
|
|
154
|
+
title={messages.usageTitle}
|
|
155
|
+
description={messages.usageDescription}
|
|
156
|
+
action={
|
|
157
|
+
<div className="flex flex-wrap justify-end gap-2">
|
|
158
|
+
<FilterSelect
|
|
159
|
+
name={messages.providerFilter}
|
|
160
|
+
all={messages.allProviders}
|
|
161
|
+
value={providerId}
|
|
162
|
+
options={[...new Set((allQuery.data?.models ?? []).map((model) => model.providerId))]}
|
|
163
|
+
onChange={(value) =>
|
|
164
|
+
changeFilter(() => {
|
|
165
|
+
setProviderId(value)
|
|
166
|
+
const keepsModel = allQuery.data?.models.some(
|
|
167
|
+
(model) => model.modelId === modelId && (!value || model.providerId === value)
|
|
168
|
+
)
|
|
169
|
+
if (!keepsModel) setModelId(undefined)
|
|
170
|
+
})
|
|
171
|
+
}
|
|
172
|
+
/>
|
|
173
|
+
<FilterSelect
|
|
174
|
+
name={messages.modelFilter}
|
|
175
|
+
all={messages.allModels}
|
|
176
|
+
value={modelId}
|
|
177
|
+
options={(allQuery.data?.models ?? [])
|
|
178
|
+
.filter((model) => !providerId || model.providerId === providerId)
|
|
179
|
+
.map((model) => model.modelId)}
|
|
180
|
+
onChange={(value) => changeFilter(() => setModelId(value))}
|
|
181
|
+
/>
|
|
182
|
+
{currencies.length > 1 ? (
|
|
183
|
+
<FilterSelect
|
|
184
|
+
name={messages.currency}
|
|
185
|
+
all={messages.currency}
|
|
186
|
+
value={currency}
|
|
187
|
+
options={currencies}
|
|
188
|
+
required
|
|
189
|
+
onChange={setCurrency}
|
|
190
|
+
/>
|
|
191
|
+
) : null}
|
|
192
|
+
</div>
|
|
193
|
+
}
|
|
194
|
+
>
|
|
195
|
+
{loading ? (
|
|
196
|
+
<Panel>
|
|
197
|
+
<PanelSkeleton rows={4} />
|
|
198
|
+
</Panel>
|
|
199
|
+
) : error || !overview ? (
|
|
200
|
+
<Panel>
|
|
201
|
+
<PanelEmpty
|
|
202
|
+
tone="error"
|
|
203
|
+
icon={TriangleAlert}
|
|
204
|
+
title={failure.title}
|
|
205
|
+
description={failure.description}
|
|
206
|
+
action={
|
|
207
|
+
<Button type="button" variant="outline" size="sm" onClick={refresh}>
|
|
208
|
+
{messages.retry}
|
|
209
|
+
</Button>
|
|
210
|
+
}
|
|
211
|
+
/>
|
|
212
|
+
</Panel>
|
|
213
|
+
) : overview.totals.modelCallCount === 0 ? (
|
|
214
|
+
<Panel>
|
|
215
|
+
<PanelEmpty
|
|
216
|
+
icon={ChartNoAxesCombined}
|
|
217
|
+
title={messages.emptyTitle}
|
|
218
|
+
description={messages.empty}
|
|
219
|
+
/>
|
|
220
|
+
</Panel>
|
|
221
|
+
) : (
|
|
222
|
+
<Usage
|
|
223
|
+
overview={overview}
|
|
224
|
+
currency={currency}
|
|
225
|
+
locale={locale}
|
|
226
|
+
onReview={(status) => {
|
|
227
|
+
changeFilter(() => setValuation(status))
|
|
228
|
+
document.getElementById("ai-model-calls")?.scrollIntoView({ behavior: "smooth" })
|
|
229
|
+
}}
|
|
230
|
+
/>
|
|
231
|
+
)}
|
|
232
|
+
</PageSection>
|
|
233
|
+
|
|
234
|
+
{/* Someone who may manage limits but not see usage gets the limits alone. */}
|
|
235
|
+
{isSixbApiError(error) && error.status === 403 ? null : (
|
|
236
|
+
<ModelCalls
|
|
237
|
+
key={JSON.stringify({ ...callFilters, offset })}
|
|
238
|
+
data={callsQuery.data}
|
|
239
|
+
filters={callFilters}
|
|
240
|
+
loading={callsQuery.isPending}
|
|
241
|
+
error={callsQuery.isError}
|
|
242
|
+
onRetry={() => void callsQuery.refetch()}
|
|
243
|
+
offset={offset}
|
|
244
|
+
onPrevious={() => setOffset((value) => Math.max(0, value - callsPageSize))}
|
|
245
|
+
onNext={() => setOffset((value) => value + callsPageSize)}
|
|
246
|
+
filterControl={
|
|
247
|
+
<FilterSelect
|
|
248
|
+
name={messages.calls.valuationFilter}
|
|
249
|
+
all={messages.calls.allValuations}
|
|
250
|
+
value={valuation}
|
|
251
|
+
options={valuations}
|
|
252
|
+
label={(value) => messages.calls.valuations[value]}
|
|
253
|
+
onChange={(value) => changeFilter(() => setValuation(value))}
|
|
254
|
+
/>
|
|
255
|
+
}
|
|
256
|
+
/>
|
|
257
|
+
)}
|
|
258
|
+
</SectionPage>
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function Usage({
|
|
263
|
+
overview,
|
|
264
|
+
currency,
|
|
265
|
+
locale,
|
|
266
|
+
onReview,
|
|
267
|
+
}: {
|
|
268
|
+
readonly overview: Overview
|
|
269
|
+
readonly currency: string | undefined
|
|
270
|
+
readonly locale: string
|
|
271
|
+
readonly onReview: (status: "unpriceable" | "unvalued") => void
|
|
272
|
+
}) {
|
|
273
|
+
const messages = useAiUsageMessages()
|
|
274
|
+
const totals = overview.totals
|
|
275
|
+
const count = (value: number) => value.toLocaleString(locale)
|
|
276
|
+
const reporting = useReporting()
|
|
277
|
+
const rated = totals.costs.ratedCallCount
|
|
278
|
+
const coverage = totals.modelCallCount === 0 ? 0 : (rated / totals.modelCallCount) * 100
|
|
279
|
+
const money = (value: number) => formatChartMoney(value, currency, locale)
|
|
280
|
+
const selected = amountFor(totals.costs.amounts, currency)
|
|
281
|
+
const costSeries = overview.series.map((period) => {
|
|
282
|
+
const amount = amountFor(period.costs.amounts, currency)
|
|
283
|
+
// An empty period cost nothing; a period whose calls have no cost is unknown.
|
|
284
|
+
return {
|
|
285
|
+
at: period.start,
|
|
286
|
+
cost: amount
|
|
287
|
+
? nanosToNumber(amount.amountNanos)
|
|
288
|
+
: period.modelCallCount === 0
|
|
289
|
+
? 0
|
|
290
|
+
: undefined,
|
|
291
|
+
}
|
|
292
|
+
})
|
|
293
|
+
const tokenSeries = overview.series.map((period) => ({
|
|
294
|
+
at: period.start,
|
|
295
|
+
input: periodTokens(period, "inputTokens"),
|
|
296
|
+
output: periodTokens(period, "outputTokens"),
|
|
297
|
+
}))
|
|
298
|
+
const xLabel = (value: string) => {
|
|
299
|
+
const date = new Date(value)
|
|
300
|
+
return overview.bucket === "hour"
|
|
301
|
+
? date.toLocaleTimeString(locale, { hour: "numeric" })
|
|
302
|
+
: date.toLocaleDateString(locale, { month: "short", day: "numeric", timeZone: "UTC" })
|
|
303
|
+
}
|
|
304
|
+
const ranked = <T,>(
|
|
305
|
+
entries: readonly T[],
|
|
306
|
+
amounts: (entry: T) => readonly { currency: string; amountNanos: string }[],
|
|
307
|
+
key: (entry: T) => string,
|
|
308
|
+
label: (entry: T) => string
|
|
309
|
+
) =>
|
|
310
|
+
entries
|
|
311
|
+
.flatMap((entry) => {
|
|
312
|
+
const amount = amountFor(amounts(entry), currency)
|
|
313
|
+
return amount
|
|
314
|
+
? [{ key: key(entry), label: label(entry), value: nanosToNumber(amount.amountNanos) }]
|
|
315
|
+
: []
|
|
316
|
+
})
|
|
317
|
+
.sort((left, right) => right.value - left.value)
|
|
318
|
+
.slice(0, 8)
|
|
319
|
+
const byModel = ranked(
|
|
320
|
+
overview.models,
|
|
321
|
+
(model) => model.costs.amounts,
|
|
322
|
+
(model) => `${model.providerId}/${model.modelId}`,
|
|
323
|
+
(model) => model.modelId
|
|
324
|
+
)
|
|
325
|
+
const byAgent = ranked(
|
|
326
|
+
overview.agents,
|
|
327
|
+
(agent) => agent.costs.amounts,
|
|
328
|
+
(agent) => (agent.kind === "agent" ? "agent" : `${agent.workflowId}/${agent.agentStepId}`),
|
|
329
|
+
(agent) =>
|
|
330
|
+
agent.kind === "agent" ? messages.charts.agent : `${agent.workflowId} · ${agent.agentStepId}`
|
|
331
|
+
)
|
|
332
|
+
const byWorkflow = ranked(
|
|
333
|
+
overview.workflows,
|
|
334
|
+
(workflow) => workflow.costs.amounts,
|
|
335
|
+
(workflow) => workflow.workflowId,
|
|
336
|
+
(workflow) => workflow.workflowId
|
|
337
|
+
)
|
|
338
|
+
const withoutCost = totals.costs.unpriceableCallCount + totals.costs.unvaluedCallCount
|
|
339
|
+
const reviewStatus = totals.costs.unpriceableCallCount > 0 ? "unpriceable" : "unvalued"
|
|
340
|
+
const reviewCount =
|
|
341
|
+
reviewStatus === "unpriceable"
|
|
342
|
+
? totals.costs.unpriceableCallCount
|
|
343
|
+
: totals.costs.unvaluedCallCount
|
|
344
|
+
const audio = totals.usage.audioDurationMs
|
|
345
|
+
|
|
346
|
+
return (
|
|
347
|
+
<div className="flex flex-col gap-4">
|
|
348
|
+
<div
|
|
349
|
+
className={cn(
|
|
350
|
+
"grid gap-3 sm:grid-cols-2",
|
|
351
|
+
audio === undefined ? "xl:grid-cols-4" : "xl:grid-cols-5"
|
|
352
|
+
)}
|
|
353
|
+
>
|
|
354
|
+
<Metric
|
|
355
|
+
label={messages.metrics.cost}
|
|
356
|
+
value={
|
|
357
|
+
selected ? formatChartMoney(nanosToNumber(selected.amountNanos), currency, locale) : "—"
|
|
358
|
+
}
|
|
359
|
+
exact={selected ? formatMoney(selected, locale) : undefined}
|
|
360
|
+
detail={currency ? messages.metrics.costIn(currency) : messages.metrics.noCost}
|
|
361
|
+
spark={
|
|
362
|
+
costSeries.every((point) => point.cost !== undefined)
|
|
363
|
+
? costSeries.map((point) => ({ timestamp: point.at, value: point.cost ?? 0 }))
|
|
364
|
+
: undefined
|
|
365
|
+
}
|
|
366
|
+
/>
|
|
367
|
+
<Metric
|
|
368
|
+
label={messages.metrics.tokens}
|
|
369
|
+
value={formatCompact(totals.usage.totalTokens, locale)}
|
|
370
|
+
detail={reporting(totals)}
|
|
371
|
+
spark={
|
|
372
|
+
overview.series.every((period) => periodTokens(period, "totalTokens") !== undefined)
|
|
373
|
+
? overview.series.map((period) => ({
|
|
374
|
+
timestamp: period.start,
|
|
375
|
+
value: periodTokens(period, "totalTokens") ?? 0,
|
|
376
|
+
}))
|
|
377
|
+
: undefined
|
|
378
|
+
}
|
|
379
|
+
/>
|
|
380
|
+
<Metric
|
|
381
|
+
label={messages.metrics.calls}
|
|
382
|
+
value={count(totals.modelCallCount)}
|
|
383
|
+
detail={messages.metrics.callsDetail(
|
|
384
|
+
overview.models.length,
|
|
385
|
+
new Set(overview.models.map((model) => model.providerId)).size
|
|
386
|
+
)}
|
|
387
|
+
/>
|
|
388
|
+
<Metric
|
|
389
|
+
label={messages.metrics.coverage}
|
|
390
|
+
value={formatPercent(coverage, locale)}
|
|
391
|
+
detail={messages.metrics.coverageDetail(count(rated), count(totals.modelCallCount))}
|
|
392
|
+
/>
|
|
393
|
+
{audio === undefined ? null : (
|
|
394
|
+
<Metric
|
|
395
|
+
label={messages.metrics.audio}
|
|
396
|
+
value={messages.metrics.seconds(
|
|
397
|
+
(audio / 1000).toLocaleString(locale, { maximumFractionDigits: 3 })
|
|
398
|
+
)}
|
|
399
|
+
detail={messages.metrics.audioDetail(
|
|
400
|
+
totals.usageCoverage.fieldCallCounts.audioDurationMs,
|
|
401
|
+
count(totals.usageCoverage.fieldCallCounts.audioDurationMs)
|
|
402
|
+
)}
|
|
403
|
+
/>
|
|
404
|
+
)}
|
|
405
|
+
</div>
|
|
406
|
+
|
|
407
|
+
{totals.usage.reportingStatus !== "complete" || coverage < 100 ? (
|
|
408
|
+
<div className="flex flex-col gap-3 rounded-xl border border-amber-500/25 bg-amber-500/5 px-4 py-3 text-[0.8125rem] sm:flex-row sm:items-center">
|
|
409
|
+
<div className="flex min-w-0 flex-1 items-start gap-3">
|
|
410
|
+
<TriangleAlert className="mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-400" />
|
|
411
|
+
<div>
|
|
412
|
+
<p className="font-medium">{messages.partialTitle}</p>
|
|
413
|
+
<p className="mt-0.5 text-muted-foreground">
|
|
414
|
+
{[
|
|
415
|
+
totals.usage.reportingStatus !== "complete"
|
|
416
|
+
? messages.partialTokens(reporting(totals))
|
|
417
|
+
: null,
|
|
418
|
+
coverage < 100 ? messages.partialCost(withoutCost, count(withoutCost)) : null,
|
|
419
|
+
]
|
|
420
|
+
.filter(Boolean)
|
|
421
|
+
.join(". ")}
|
|
422
|
+
.
|
|
423
|
+
</p>
|
|
424
|
+
</div>
|
|
425
|
+
</div>
|
|
426
|
+
{reviewCount > 0 ? (
|
|
427
|
+
<Button
|
|
428
|
+
type="button"
|
|
429
|
+
variant="outline"
|
|
430
|
+
size="sm"
|
|
431
|
+
onClick={() => onReview(reviewStatus)}
|
|
432
|
+
>
|
|
433
|
+
{messages.review(reviewCount)}
|
|
434
|
+
</Button>
|
|
435
|
+
) : null}
|
|
436
|
+
</div>
|
|
437
|
+
) : null}
|
|
438
|
+
|
|
439
|
+
{/* Cards in a row share its height, so a short one leaves no gap below it. */}
|
|
440
|
+
<div className="grid gap-4 xl:grid-cols-3">
|
|
441
|
+
<Card
|
|
442
|
+
className="xl:col-span-2"
|
|
443
|
+
title={messages.charts.costOverTime}
|
|
444
|
+
description={
|
|
445
|
+
currency ? messages.charts.costOverTimeIn(currency) : messages.charts.noCostRange
|
|
446
|
+
}
|
|
447
|
+
>
|
|
448
|
+
<Chart
|
|
449
|
+
data={selected ? costSeries : []}
|
|
450
|
+
xKey="at"
|
|
451
|
+
yAxisWidth={68}
|
|
452
|
+
showLegend={false}
|
|
453
|
+
series={[{ key: "cost", label: messages.charts.cost, color: "var(--chart-1)" }]}
|
|
454
|
+
xFormatter={xLabel}
|
|
455
|
+
valueFormatter={money}
|
|
456
|
+
emptyLabel={messages.charts.noCost}
|
|
457
|
+
ariaLabel={messages.charts.costOverTime}
|
|
458
|
+
/>
|
|
459
|
+
</Card>
|
|
460
|
+
<Card
|
|
461
|
+
title={messages.charts.costByModel}
|
|
462
|
+
description={messages.charts.costByModelDescription}
|
|
463
|
+
>
|
|
464
|
+
<Breakdown data={byModel} format={money} empty={messages.charts.noCost} />
|
|
465
|
+
</Card>
|
|
466
|
+
<Card
|
|
467
|
+
className="xl:col-span-2"
|
|
468
|
+
title={messages.charts.tokens}
|
|
469
|
+
description={messages.charts.tokensDescription(reporting(totals))}
|
|
470
|
+
>
|
|
471
|
+
<Chart
|
|
472
|
+
data={tokenSeries}
|
|
473
|
+
xKey="at"
|
|
474
|
+
series={[
|
|
475
|
+
{
|
|
476
|
+
key: "input",
|
|
477
|
+
label: messages.charts.input,
|
|
478
|
+
color: "var(--chart-1)",
|
|
479
|
+
stackId: "tokens",
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
key: "output",
|
|
483
|
+
label: messages.charts.output,
|
|
484
|
+
color: "var(--chart-3)",
|
|
485
|
+
stackId: "tokens",
|
|
486
|
+
},
|
|
487
|
+
]}
|
|
488
|
+
xFormatter={xLabel}
|
|
489
|
+
valueFormatter={(value) => formatCompact(value, locale)}
|
|
490
|
+
tooltipLabel={(value) => {
|
|
491
|
+
const period = overview.series.find((entry) => entry.start === value)
|
|
492
|
+
return (
|
|
493
|
+
<span className="block max-w-56 whitespace-normal">
|
|
494
|
+
{xLabel(value)}
|
|
495
|
+
{period ? <span className="mt-1 block">{reporting(period)}</span> : null}
|
|
496
|
+
</span>
|
|
497
|
+
)
|
|
498
|
+
}}
|
|
499
|
+
emptyLabel={messages.charts.noTokens}
|
|
500
|
+
ariaLabel={messages.charts.tokens}
|
|
501
|
+
/>
|
|
502
|
+
</Card>
|
|
503
|
+
<Insights overview={overview} coverage={coverage} locale={locale} />
|
|
504
|
+
</div>
|
|
505
|
+
|
|
506
|
+
{byAgent.length > 1 || byWorkflow.length > 1 ? (
|
|
507
|
+
<div className="grid gap-4 xl:grid-cols-2">
|
|
508
|
+
{byAgent.length > 1 ? (
|
|
509
|
+
<Card title={messages.charts.costByAgent} description={messages.charts.highest}>
|
|
510
|
+
<Breakdown data={byAgent} format={money} empty={messages.charts.noCost} />
|
|
511
|
+
</Card>
|
|
512
|
+
) : null}
|
|
513
|
+
{byWorkflow.length > 1 ? (
|
|
514
|
+
<Card title={messages.charts.costByWorkflow} description={messages.charts.highest}>
|
|
515
|
+
<Breakdown data={byWorkflow} format={money} empty={messages.charts.noCost} />
|
|
516
|
+
</Card>
|
|
517
|
+
) : null}
|
|
518
|
+
</div>
|
|
519
|
+
) : null}
|
|
520
|
+
</div>
|
|
521
|
+
)
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/** "Partial — complete usage reported for 84 of 87 calls", for a whole range or one meter. */
|
|
525
|
+
function useReporting() {
|
|
526
|
+
const messages = useAiUsageMessages().reporting
|
|
527
|
+
const locale = useLocale()
|
|
528
|
+
return (aggregate: Overview["totals"], field?: UsageField): string => {
|
|
529
|
+
if (aggregate.modelCallCount === 0) return messages.none
|
|
530
|
+
const { status, count } = reportingCoverage(aggregate, field)
|
|
531
|
+
const counts = [
|
|
532
|
+
count.toLocaleString(locale),
|
|
533
|
+
aggregate.modelCallCount.toLocaleString(locale),
|
|
534
|
+
] as const
|
|
535
|
+
return field ? messages.field(...counts) : messages[status](...counts)
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
function Insights({
|
|
540
|
+
overview,
|
|
541
|
+
coverage,
|
|
542
|
+
locale,
|
|
543
|
+
}: {
|
|
544
|
+
readonly overview: Overview
|
|
545
|
+
readonly coverage: number
|
|
546
|
+
readonly locale: string
|
|
547
|
+
}) {
|
|
548
|
+
const messages = useAiUsageMessages().insights
|
|
549
|
+
const reporting = useReporting()
|
|
550
|
+
const totals = overview.totals
|
|
551
|
+
const breakdown = (
|
|
552
|
+
[
|
|
553
|
+
{
|
|
554
|
+
key: "rated",
|
|
555
|
+
label: messages.rated,
|
|
556
|
+
value: totals.costs.ratedCallCount,
|
|
557
|
+
dot: "bg-foreground",
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
key: "unpriceable",
|
|
561
|
+
label: messages.unpriceable,
|
|
562
|
+
value: totals.costs.unpriceableCallCount,
|
|
563
|
+
dot: "bg-amber-500",
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
key: "unvalued",
|
|
567
|
+
label: messages.unvalued,
|
|
568
|
+
value: totals.costs.unvaluedCallCount,
|
|
569
|
+
dot: "bg-muted-foreground/40",
|
|
570
|
+
},
|
|
571
|
+
] as const
|
|
572
|
+
).filter((entry) => entry.value > 0)
|
|
573
|
+
return (
|
|
574
|
+
<Card className="h-full" title={messages.title} description={messages.description}>
|
|
575
|
+
<div className="flex flex-col gap-5">
|
|
576
|
+
<div className="grid grid-cols-2 gap-x-6 gap-y-4">
|
|
577
|
+
<Insight
|
|
578
|
+
label={messages.cacheHitRate}
|
|
579
|
+
value={formatPercent(usageShare(totals, "cacheReadInputTokens", "inputTokens"), locale)}
|
|
580
|
+
/>
|
|
581
|
+
<Insight
|
|
582
|
+
label={messages.cachedInput}
|
|
583
|
+
value={formatCompact(totals.usage.cacheReadInputTokens, locale)}
|
|
584
|
+
detail={reporting(totals, "cacheReadInputTokens")}
|
|
585
|
+
/>
|
|
586
|
+
<Insight
|
|
587
|
+
label={messages.reasoningShare}
|
|
588
|
+
value={formatPercent(
|
|
589
|
+
usageShare(totals, "reasoningOutputTokens", "outputTokens"),
|
|
590
|
+
locale
|
|
591
|
+
)}
|
|
592
|
+
/>
|
|
593
|
+
<Insight
|
|
594
|
+
label={messages.reasoningTokens}
|
|
595
|
+
value={formatCompact(totals.usage.reasoningOutputTokens, locale)}
|
|
596
|
+
detail={reporting(totals, "reasoningOutputTokens")}
|
|
597
|
+
/>
|
|
598
|
+
</div>
|
|
599
|
+
<div className="border-t border-border pt-4">
|
|
600
|
+
<div className="mb-2 flex items-baseline justify-between gap-4">
|
|
601
|
+
<p className="text-[0.8125rem] font-medium">{messages.valuation}</p>
|
|
602
|
+
<p className="font-mono text-[0.8125rem] font-medium tabular-nums">
|
|
603
|
+
{formatPercent(coverage, locale)}
|
|
604
|
+
</p>
|
|
605
|
+
</div>
|
|
606
|
+
<div className="flex h-2 overflow-hidden rounded-full bg-muted">
|
|
607
|
+
{breakdown.map((entry) => (
|
|
608
|
+
<div
|
|
609
|
+
key={entry.key}
|
|
610
|
+
className={entry.dot}
|
|
611
|
+
style={{
|
|
612
|
+
width: `${totals.modelCallCount === 0 ? 0 : (entry.value / totals.modelCallCount) * 100}%`,
|
|
613
|
+
}}
|
|
614
|
+
/>
|
|
615
|
+
))}
|
|
616
|
+
</div>
|
|
617
|
+
<div className="mt-3 grid gap-2 sm:grid-cols-2">
|
|
618
|
+
{breakdown.map((entry) => (
|
|
619
|
+
<div key={entry.key} className="flex items-center justify-between gap-3 text-xs">
|
|
620
|
+
<span className="flex min-w-0 items-center gap-2 text-muted-foreground">
|
|
621
|
+
<span className={cn("size-2 shrink-0 rounded-full", entry.dot)} />
|
|
622
|
+
<span className="truncate">{entry.label}</span>
|
|
623
|
+
</span>
|
|
624
|
+
<span className="font-mono tabular-nums">{entry.value.toLocaleString(locale)}</span>
|
|
625
|
+
</div>
|
|
626
|
+
))}
|
|
627
|
+
</div>
|
|
628
|
+
</div>
|
|
629
|
+
</div>
|
|
630
|
+
</Card>
|
|
631
|
+
)
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
function Insight({
|
|
635
|
+
label,
|
|
636
|
+
value,
|
|
637
|
+
detail,
|
|
638
|
+
}: {
|
|
639
|
+
readonly label: string
|
|
640
|
+
readonly value: string
|
|
641
|
+
readonly detail?: string
|
|
642
|
+
}) {
|
|
643
|
+
return (
|
|
644
|
+
<div>
|
|
645
|
+
<p className="text-xs text-muted-foreground">{label}</p>
|
|
646
|
+
<p className="mt-1 text-lg font-semibold tracking-tight tabular-nums">{value}</p>
|
|
647
|
+
{detail ? <p className="mt-1 text-xs text-muted-foreground">{detail}</p> : null}
|
|
648
|
+
</div>
|
|
649
|
+
)
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
function Metric({
|
|
653
|
+
label,
|
|
654
|
+
value,
|
|
655
|
+
exact,
|
|
656
|
+
detail,
|
|
657
|
+
spark,
|
|
658
|
+
}: {
|
|
659
|
+
readonly label: string
|
|
660
|
+
readonly value: string
|
|
661
|
+
/** The value in full, on hover, when `value` is rounded. */
|
|
662
|
+
readonly exact?: string
|
|
663
|
+
readonly detail: string
|
|
664
|
+
readonly spark?: readonly { readonly timestamp: string; readonly value: number }[]
|
|
665
|
+
}) {
|
|
666
|
+
return (
|
|
667
|
+
<div className="flex min-w-0 flex-col rounded-xl border border-border bg-card px-4 py-3.5 shadow-[0_1px_2px_0_rgb(0_0_0/0.04)]">
|
|
668
|
+
<p className="truncate text-xs text-muted-foreground">{label}</p>
|
|
669
|
+
<div className="mt-1.5 flex min-w-0 items-center justify-between gap-3">
|
|
670
|
+
<div className="truncate text-2xl font-semibold tracking-tight tabular-nums" title={exact}>
|
|
671
|
+
{value}
|
|
672
|
+
</div>
|
|
673
|
+
{spark && spark.length > 1 ? (
|
|
674
|
+
<MiniSparkline data={[...spark]} width={72} height={28} className="shrink-0" />
|
|
675
|
+
) : null}
|
|
676
|
+
</div>
|
|
677
|
+
<p className="mt-1 text-xs text-muted-foreground">{detail}</p>
|
|
678
|
+
</div>
|
|
679
|
+
)
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
function Card({
|
|
683
|
+
title,
|
|
684
|
+
description,
|
|
685
|
+
className,
|
|
686
|
+
children,
|
|
687
|
+
}: {
|
|
688
|
+
readonly title: string
|
|
689
|
+
readonly description: string
|
|
690
|
+
readonly className?: string
|
|
691
|
+
readonly children: ReactNode
|
|
692
|
+
}) {
|
|
693
|
+
return (
|
|
694
|
+
<section
|
|
695
|
+
className={cn(
|
|
696
|
+
"flex min-w-0 flex-col rounded-xl border border-border bg-card px-5 py-4 shadow-[0_1px_2px_0_rgb(0_0_0/0.04)]",
|
|
697
|
+
className
|
|
698
|
+
)}
|
|
699
|
+
>
|
|
700
|
+
<h3 className="text-sm font-semibold">{title}</h3>
|
|
701
|
+
<p className="mt-0.5 mb-4 text-xs text-muted-foreground">{description}</p>
|
|
702
|
+
{/* A chart grows into the height its row gives the card. */}
|
|
703
|
+
<div className="flex min-h-0 flex-1 flex-col">{children}</div>
|
|
704
|
+
</section>
|
|
705
|
+
)
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
function Chart(props: Parameters<typeof TimeSeries>[0]) {
|
|
709
|
+
const messages = useAiUsageMessages().charts
|
|
710
|
+
return (
|
|
711
|
+
<Suspense
|
|
712
|
+
fallback={
|
|
713
|
+
<div
|
|
714
|
+
className="flex flex-1 items-center justify-center text-[0.8125rem] text-muted-foreground"
|
|
715
|
+
style={{ minHeight: props.height ?? 260 }}
|
|
716
|
+
>
|
|
717
|
+
<Loader2 className="mr-2 size-4 animate-spin" />
|
|
718
|
+
{messages.loading}
|
|
719
|
+
</div>
|
|
720
|
+
}
|
|
721
|
+
>
|
|
722
|
+
<TimeSeries {...props} />
|
|
723
|
+
</Suspense>
|
|
724
|
+
)
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
function Breakdown({
|
|
728
|
+
data,
|
|
729
|
+
format,
|
|
730
|
+
empty,
|
|
731
|
+
}: {
|
|
732
|
+
readonly data: readonly { readonly key: string; readonly label: string; readonly value: number }[]
|
|
733
|
+
readonly format: (value: number) => string
|
|
734
|
+
readonly empty: string
|
|
735
|
+
}) {
|
|
736
|
+
if (data.length === 0) {
|
|
737
|
+
return (
|
|
738
|
+
<div className="flex min-h-32 items-center justify-center rounded-lg border border-dashed border-border text-[0.8125rem] text-muted-foreground">
|
|
739
|
+
{empty}
|
|
740
|
+
</div>
|
|
741
|
+
)
|
|
742
|
+
}
|
|
743
|
+
const maximum = Math.max(...data.map((entry) => entry.value), 0)
|
|
744
|
+
return (
|
|
745
|
+
<div className="flex flex-col gap-3.5">
|
|
746
|
+
{data.map((entry) => (
|
|
747
|
+
<div key={entry.key}>
|
|
748
|
+
<div className="mb-1.5 flex items-start justify-between gap-4 text-[0.8125rem]">
|
|
749
|
+
<span className="min-w-0 break-words text-muted-foreground">{entry.label}</span>
|
|
750
|
+
<span className="shrink-0 font-mono font-medium tabular-nums">
|
|
751
|
+
{format(entry.value)}
|
|
752
|
+
</span>
|
|
753
|
+
</div>
|
|
754
|
+
<div className="h-2 overflow-hidden rounded-full bg-muted">
|
|
755
|
+
<div
|
|
756
|
+
className="h-full rounded-full bg-[var(--chart-2)]"
|
|
757
|
+
style={{
|
|
758
|
+
width:
|
|
759
|
+
entry.value > 0
|
|
760
|
+
? `${Math.max(maximum === 0 ? 0 : (entry.value / maximum) * 100, 0.75)}%`
|
|
761
|
+
: 0,
|
|
762
|
+
}}
|
|
763
|
+
/>
|
|
764
|
+
</div>
|
|
765
|
+
</div>
|
|
766
|
+
))}
|
|
767
|
+
</div>
|
|
768
|
+
)
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
function FilterSelect<T extends string>({
|
|
772
|
+
name,
|
|
773
|
+
all,
|
|
774
|
+
value,
|
|
775
|
+
options,
|
|
776
|
+
label = (option) => option,
|
|
777
|
+
required = false,
|
|
778
|
+
onChange,
|
|
779
|
+
}: {
|
|
780
|
+
/** What the select chooses, for assistive technology. */
|
|
781
|
+
readonly name: string
|
|
782
|
+
/** The choice that clears the filter. */
|
|
783
|
+
readonly all: string
|
|
784
|
+
readonly value: T | undefined
|
|
785
|
+
readonly options: readonly T[]
|
|
786
|
+
readonly label?: (option: T) => string
|
|
787
|
+
/** Some value is always chosen, so there is no "all". */
|
|
788
|
+
readonly required?: boolean
|
|
789
|
+
readonly onChange: (value: T | undefined) => void
|
|
790
|
+
}) {
|
|
791
|
+
const allValue = "__all__"
|
|
792
|
+
return (
|
|
793
|
+
<Select
|
|
794
|
+
value={value ?? allValue}
|
|
795
|
+
onValueChange={(next) => onChange(options.find((option) => option === next))}
|
|
796
|
+
>
|
|
797
|
+
<SelectTrigger size="sm" className="h-8 min-w-36 text-[0.8125rem]" aria-label={name}>
|
|
798
|
+
<SelectValue />
|
|
799
|
+
</SelectTrigger>
|
|
800
|
+
<SelectContent position="popper" align="end">
|
|
801
|
+
{required ? null : (
|
|
802
|
+
<SelectItem value={allValue} className="text-[0.8125rem]">
|
|
803
|
+
{all}
|
|
804
|
+
</SelectItem>
|
|
805
|
+
)}
|
|
806
|
+
{[...new Set(options)].map((option) => (
|
|
807
|
+
<SelectItem key={option} value={option} className="text-[0.8125rem]">
|
|
808
|
+
{label(option)}
|
|
809
|
+
</SelectItem>
|
|
810
|
+
))}
|
|
811
|
+
</SelectContent>
|
|
812
|
+
</Select>
|
|
813
|
+
)
|
|
814
|
+
}
|