@sixb/app 0.1.11 → 0.1.12
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 +25 -19
- 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 +24 -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 +27 -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/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 +13 -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/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/document-preview/classify.d.ts +4 -0
- package/dist/agent/document-preview/classify.d.ts.map +1 -0
- package/dist/agent/document-preview/content-policy.d.ts +10 -0
- package/dist/agent/document-preview/content-policy.d.ts.map +1 -0
- package/dist/agent/document-preview/content.d.ts +26 -0
- package/dist/agent/document-preview/content.d.ts.map +1 -0
- package/dist/agent/document-preview/delimited.d.ts +19 -0
- package/dist/agent/document-preview/delimited.d.ts.map +1 -0
- package/dist/agent/document-preview/document-preview-root.d.ts +24 -0
- package/dist/agent/document-preview/document-preview-root.d.ts.map +1 -0
- package/dist/agent/document-preview/file-size.d.ts +3 -0
- package/dist/agent/document-preview/file-size.d.ts.map +1 -0
- package/dist/agent/document-preview/html.d.ts +9 -0
- package/dist/agent/document-preview/html.d.ts.map +1 -0
- package/dist/agent/document-preview/persistence.d.ts +6 -0
- package/dist/agent/document-preview/persistence.d.ts.map +1 -0
- package/dist/agent/document-preview/presentation.d.ts +3 -0
- package/dist/agent/document-preview/presentation.d.ts.map +1 -0
- package/dist/agent/document-preview/rendering.d.ts +14 -0
- package/dist/agent/document-preview/rendering.d.ts.map +1 -0
- package/dist/agent/document-preview/source.d.ts +13 -0
- package/dist/agent/document-preview/source.d.ts.map +1 -0
- package/dist/agent/document-preview/state.d.ts +27 -0
- package/dist/agent/document-preview/state.d.ts.map +1 -0
- package/dist/agent/document-preview/types.d.ts +33 -0
- package/dist/agent/document-preview/types.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 +338 -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 +589 -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 +1161 -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/react-router.d.ts +8 -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/agent/workspace.d.ts +11 -0
- package/dist/agent/workspace.d.ts.map +1 -0
- package/dist/chunk-3a99tmwg.js +176 -0
- package/dist/chunk-3a99tmwg.js.map +10 -0
- package/dist/chunk-48pkffj6.js +20 -0
- package/dist/chunk-48pkffj6.js.map +10 -0
- package/dist/chunk-6n5pdqp0.js +115 -0
- package/dist/chunk-6n5pdqp0.js.map +11 -0
- package/dist/chunk-j97e06rg.js +10668 -0
- package/dist/chunk-j97e06rg.js.map +80 -0
- package/dist/chunk-md3p7qdt.js +379 -0
- package/dist/chunk-md3p7qdt.js.map +10 -0
- package/dist/chunk-shmw3f8t.js +251 -0
- package/dist/chunk-shmw3f8t.js.map +10 -0
- package/dist/chunk-yvhzn4ye.js +98 -0
- package/dist/chunk-yvhzn4ye.js.map +10 -0
- package/dist/chunk-zcxrt24m.js +148 -0
- package/dist/chunk-zcxrt24m.js.map +10 -0
- package/dist/codegen.d.ts +6 -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 +33 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +958 -2890
- package/dist/index.js.map +14 -13
- package/dist/locale-messages.d.ts +72 -6
- package/dist/locale-messages.d.ts.map +1 -1
- package/dist/locale.d.ts +73 -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/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 +19 -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 +211 -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 +42 -0
- package/dist/pages.d.ts.map +1 -0
- package/dist/pages.js +23931 -0
- package/dist/pages.js.map +85 -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 +2983 -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 +24 -21
- package/src/agent/activity-label.ts +63 -0
- package/src/agent/agent-chat.tsx +237 -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 +79 -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/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 +137 -0
- package/src/agent/components/message-parts.tsx +280 -0
- package/src/agent/components/message-view.tsx +428 -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/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/document-preview/classify.ts +55 -0
- package/src/agent/document-preview/content-policy.ts +37 -0
- package/src/agent/document-preview/content.ts +82 -0
- package/src/agent/document-preview/delimited.ts +118 -0
- package/src/agent/document-preview/document-preview-root.tsx +1017 -0
- package/src/agent/document-preview/file-size.ts +26 -0
- package/src/agent/document-preview/html.ts +67 -0
- package/src/agent/document-preview/persistence.ts +115 -0
- package/src/agent/document-preview/presentation.ts +13 -0
- package/src/agent/document-preview/rendering.ts +48 -0
- package/src/agent/document-preview/source.ts +48 -0
- package/src/agent/document-preview/state.ts +77 -0
- package/src/agent/document-preview/types.ts +36 -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 +542 -0
- package/src/agent/i18n/fr.ts +574 -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/react-router.tsx +84 -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 +120 -0
- package/src/{agents.ts → agent/workspace.ts} +4 -19
- package/src/codegen.ts +61 -79
- package/src/createCustomApp.ts +155 -67
- package/src/index.ts +52 -16
- package/src/locale-messages.ts +121 -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/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 +48 -0
- package/src/pages/section-page.tsx +272 -0
- package/src/pages/section-ui.tsx +771 -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 +56 -0
- package/src/runtime.ts +0 -3
- package/src/sections/catalog.ts +181 -0
- package/src/sections/counts.ts +33 -0
- package/src/sections/sections.tsx +257 -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 +158 -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/browser.ts +0 -2
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
GetAiLimitStatusResponse,
|
|
3
|
+
GetAiLimitSubjectOptionsResponse,
|
|
4
|
+
ListAiLimitPoliciesResponse,
|
|
5
|
+
} from "@sixb/client"
|
|
6
|
+
import {
|
|
7
|
+
createAiLimitPolicyMutation,
|
|
8
|
+
deleteAiLimitPolicyMutation,
|
|
9
|
+
getAiLimitStatusOptions,
|
|
10
|
+
getAiLimitStatusQueryKey,
|
|
11
|
+
getAiLimitSubjectOptionsOptions,
|
|
12
|
+
listAiLimitPoliciesOptions,
|
|
13
|
+
listAiLimitPoliciesQueryKey,
|
|
14
|
+
updateAiLimitPolicyMutation,
|
|
15
|
+
} from "@sixb/client/hooks"
|
|
16
|
+
import {
|
|
17
|
+
AlertDialog,
|
|
18
|
+
AlertDialogAction,
|
|
19
|
+
AlertDialogCancel,
|
|
20
|
+
AlertDialogContent,
|
|
21
|
+
AlertDialogDescription,
|
|
22
|
+
AlertDialogFooter,
|
|
23
|
+
AlertDialogHeader,
|
|
24
|
+
AlertDialogTitle,
|
|
25
|
+
Button,
|
|
26
|
+
Combobox,
|
|
27
|
+
Dialog,
|
|
28
|
+
DialogContent,
|
|
29
|
+
DialogDescription,
|
|
30
|
+
DialogFooter,
|
|
31
|
+
DialogHeader,
|
|
32
|
+
DialogTitle,
|
|
33
|
+
DropdownMenu,
|
|
34
|
+
DropdownMenuContent,
|
|
35
|
+
DropdownMenuItem,
|
|
36
|
+
DropdownMenuSeparator,
|
|
37
|
+
DropdownMenuTrigger,
|
|
38
|
+
Input,
|
|
39
|
+
Switch,
|
|
40
|
+
} from "@sixb/ui/components"
|
|
41
|
+
import { useLocale } from "@sixb/ui/lib/i18n"
|
|
42
|
+
import { cn } from "@sixb/ui/lib/utils"
|
|
43
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
|
|
44
|
+
import { CircleGauge, Loader2, MoreHorizontal, Pencil, Plus, Trash2 } from "lucide-react"
|
|
45
|
+
import { type SubmitEvent, useState } from "react"
|
|
46
|
+
import { notify } from "../../section-page"
|
|
47
|
+
import {
|
|
48
|
+
apiErrorMessage,
|
|
49
|
+
Field,
|
|
50
|
+
PageSection,
|
|
51
|
+
Panel,
|
|
52
|
+
PanelEmpty,
|
|
53
|
+
PanelSkeleton,
|
|
54
|
+
Pill,
|
|
55
|
+
type Tone,
|
|
56
|
+
useLoadFailure,
|
|
57
|
+
} from "../../section-ui"
|
|
58
|
+
import {
|
|
59
|
+
formatLimitQuantity,
|
|
60
|
+
type LimitMeter,
|
|
61
|
+
type LimitQuantity,
|
|
62
|
+
type LimitSubjectType,
|
|
63
|
+
limitAmountInput,
|
|
64
|
+
limitSubjectChoices,
|
|
65
|
+
limitUsedPercent,
|
|
66
|
+
parseLimitAmount,
|
|
67
|
+
quantityIsPositive,
|
|
68
|
+
} from "./format"
|
|
69
|
+
import { useAiUsageMessages } from "./messages"
|
|
70
|
+
|
|
71
|
+
type LimitStatus = GetAiLimitStatusResponse["items"][number]
|
|
72
|
+
type LimitPolicy = ListAiLimitPoliciesResponse["items"][number]
|
|
73
|
+
type LimitSubject = LimitPolicy["subject"]
|
|
74
|
+
type SubjectOptions = GetAiLimitSubjectOptionsResponse
|
|
75
|
+
|
|
76
|
+
/** The query the page also refreshes: limits stay listed, disabled ones included. */
|
|
77
|
+
export const limitStatusQuery = { query: { includeDisabled: "true" as const } }
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* This month's limits on AI usage and how much of each is spent. Anyone who may observe AI usage
|
|
81
|
+
* sees them; anyone who may manage it adds, changes and removes them.
|
|
82
|
+
*/
|
|
83
|
+
export function AiLimits() {
|
|
84
|
+
const messages = useAiUsageMessages().limits
|
|
85
|
+
const locale = useLocale()
|
|
86
|
+
const queryClient = useQueryClient()
|
|
87
|
+
const statusQuery = useQuery({ ...getAiLimitStatusOptions(limitStatusQuery), retry: false })
|
|
88
|
+
const policyQuery = useQuery({ ...listAiLimitPoliciesOptions(limitStatusQuery), retry: false })
|
|
89
|
+
const [editing, setEditing] = useState<LimitPolicy | "new" | null>(null)
|
|
90
|
+
|
|
91
|
+
const refresh = () =>
|
|
92
|
+
Promise.all([
|
|
93
|
+
queryClient.invalidateQueries({ queryKey: getAiLimitStatusQueryKey(limitStatusQuery) }),
|
|
94
|
+
queryClient.invalidateQueries({ queryKey: listAiLimitPoliciesQueryKey(limitStatusQuery) }),
|
|
95
|
+
])
|
|
96
|
+
const create = useMutation({
|
|
97
|
+
...createAiLimitPolicyMutation(),
|
|
98
|
+
onSuccess: async () => {
|
|
99
|
+
setEditing(null)
|
|
100
|
+
notify.success(messages.created)
|
|
101
|
+
await refresh()
|
|
102
|
+
},
|
|
103
|
+
})
|
|
104
|
+
// The dialog shows its own save's failure; turning a limit on or off from its row toasts.
|
|
105
|
+
const update = useMutation({
|
|
106
|
+
...updateAiLimitPolicyMutation(),
|
|
107
|
+
onSuccess: async () => {
|
|
108
|
+
setEditing(null)
|
|
109
|
+
notify.success(messages.updated)
|
|
110
|
+
await refresh()
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
const toggle = useMutation({
|
|
114
|
+
...updateAiLimitPolicyMutation(),
|
|
115
|
+
onSuccess: async () => {
|
|
116
|
+
notify.success(messages.updated)
|
|
117
|
+
await refresh()
|
|
118
|
+
},
|
|
119
|
+
onError: (error) => notify.error(apiErrorMessage(error, messages.updateFailed)),
|
|
120
|
+
})
|
|
121
|
+
const openDialog = (policy: LimitPolicy | "new") => {
|
|
122
|
+
create.reset()
|
|
123
|
+
update.reset()
|
|
124
|
+
setEditing(policy)
|
|
125
|
+
}
|
|
126
|
+
const remove = useMutation({
|
|
127
|
+
...deleteAiLimitPolicyMutation(),
|
|
128
|
+
onSuccess: async () => {
|
|
129
|
+
notify.success(messages.deleted)
|
|
130
|
+
await refresh()
|
|
131
|
+
},
|
|
132
|
+
onError: (error) => notify.error(apiErrorMessage(error, messages.deleteFailed)),
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
const statuses = statusQuery.data?.items ?? []
|
|
136
|
+
const failure = useLoadFailure(policyQuery.error ?? statusQuery.error, {
|
|
137
|
+
denied: messages.denied,
|
|
138
|
+
fallback: messages.unavailable,
|
|
139
|
+
})
|
|
140
|
+
const canManage =
|
|
141
|
+
policyQuery.data?.capabilities.manage ?? statusQuery.data?.capabilities.manage ?? false
|
|
142
|
+
const subjectsQuery = useQuery({
|
|
143
|
+
...getAiLimitSubjectOptionsOptions(),
|
|
144
|
+
enabled: canManage,
|
|
145
|
+
retry: false,
|
|
146
|
+
})
|
|
147
|
+
const subjects = subjectsQuery.data
|
|
148
|
+
const statusById = new Map(statuses.map((status) => [status.policy.id, status]))
|
|
149
|
+
const policies = policyQuery.data?.items ?? statuses.map((status) => status.policy)
|
|
150
|
+
const active = policies.filter((policy) => policy.enabled).length
|
|
151
|
+
const busy = create.isPending || update.isPending || toggle.isPending || remove.isPending
|
|
152
|
+
const period = statuses[0]?.period
|
|
153
|
+
const utcDay = (value: string, year: boolean) =>
|
|
154
|
+
new Date(value).toLocaleDateString(locale, {
|
|
155
|
+
month: "short",
|
|
156
|
+
day: "numeric",
|
|
157
|
+
...(year ? { year: "numeric" } : {}),
|
|
158
|
+
timeZone: "UTC",
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<PageSection
|
|
163
|
+
title={messages.title}
|
|
164
|
+
description={
|
|
165
|
+
period
|
|
166
|
+
? messages.period(utcDay(period.start, false), utcDay(period.end, true), active)
|
|
167
|
+
: messages.resetsMonthly
|
|
168
|
+
}
|
|
169
|
+
action={
|
|
170
|
+
canManage ? (
|
|
171
|
+
<Button type="button" size="sm" variant="outline" onClick={() => openDialog("new")}>
|
|
172
|
+
<Plus />
|
|
173
|
+
{messages.add}
|
|
174
|
+
</Button>
|
|
175
|
+
) : null
|
|
176
|
+
}
|
|
177
|
+
>
|
|
178
|
+
<Panel>
|
|
179
|
+
{statusQuery.isPending && policyQuery.isPending ? (
|
|
180
|
+
<PanelSkeleton rows={2} />
|
|
181
|
+
) : !statusQuery.data && !policyQuery.data ? (
|
|
182
|
+
<PanelEmpty
|
|
183
|
+
tone="error"
|
|
184
|
+
icon={CircleGauge}
|
|
185
|
+
title={failure.title}
|
|
186
|
+
description={failure.description}
|
|
187
|
+
/>
|
|
188
|
+
) : policies.length === 0 ? (
|
|
189
|
+
<PanelEmpty icon={CircleGauge} title={messages.emptyTitle} description={messages.empty} />
|
|
190
|
+
) : (
|
|
191
|
+
policies.map((policy) => (
|
|
192
|
+
<LimitRow
|
|
193
|
+
key={policy.id}
|
|
194
|
+
policy={policy}
|
|
195
|
+
status={statusById.get(policy.id)}
|
|
196
|
+
subjects={subjects}
|
|
197
|
+
canManage={canManage}
|
|
198
|
+
busy={busy}
|
|
199
|
+
onEdit={() => openDialog(policy)}
|
|
200
|
+
onToggle={() =>
|
|
201
|
+
toggle.mutate({ path: { limitId: policy.id }, body: { enabled: !policy.enabled } })
|
|
202
|
+
}
|
|
203
|
+
onDelete={() => remove.mutate({ path: { limitId: policy.id } })}
|
|
204
|
+
/>
|
|
205
|
+
))
|
|
206
|
+
)}
|
|
207
|
+
</Panel>
|
|
208
|
+
|
|
209
|
+
{editing !== null ? (
|
|
210
|
+
<LimitDialog
|
|
211
|
+
key={editing === "new" ? "new" : editing.id}
|
|
212
|
+
policy={editing === "new" ? undefined : editing}
|
|
213
|
+
subjects={subjects}
|
|
214
|
+
subjectsError={subjectsQuery.error}
|
|
215
|
+
pending={create.isPending || update.isPending}
|
|
216
|
+
error={create.error ?? update.error}
|
|
217
|
+
onClose={() => setEditing(null)}
|
|
218
|
+
onCreate={(input) => create.mutate({ body: input })}
|
|
219
|
+
onUpdate={(limitId, input) => update.mutate({ path: { limitId }, body: input })}
|
|
220
|
+
/>
|
|
221
|
+
) : null}
|
|
222
|
+
</PageSection>
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function useSubjectLabel() {
|
|
227
|
+
const messages = useAiUsageMessages().limits
|
|
228
|
+
return (subject: LimitSubject, subjects: SubjectOptions | undefined): string => {
|
|
229
|
+
if (subject.type === "project") return messages.project
|
|
230
|
+
const choice = limitSubjectChoices(subjects, subject.type, messages.statuses).find(
|
|
231
|
+
(candidate) => candidate.value === subject.id
|
|
232
|
+
)
|
|
233
|
+
return choice?.label ?? messages[subject.type](subject.id)
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function LimitRow({
|
|
238
|
+
policy,
|
|
239
|
+
status,
|
|
240
|
+
subjects,
|
|
241
|
+
canManage,
|
|
242
|
+
busy,
|
|
243
|
+
onEdit,
|
|
244
|
+
onToggle,
|
|
245
|
+
onDelete,
|
|
246
|
+
}: {
|
|
247
|
+
readonly policy: LimitPolicy
|
|
248
|
+
/** Absent for someone who may manage limits but not observe usage. */
|
|
249
|
+
readonly status: LimitStatus | undefined
|
|
250
|
+
readonly subjects: SubjectOptions | undefined
|
|
251
|
+
readonly canManage: boolean
|
|
252
|
+
readonly busy: boolean
|
|
253
|
+
readonly onEdit: () => void
|
|
254
|
+
readonly onToggle: () => void
|
|
255
|
+
readonly onDelete: () => void
|
|
256
|
+
}) {
|
|
257
|
+
const messages = useAiUsageMessages().limits
|
|
258
|
+
const locale = useLocale()
|
|
259
|
+
const label = useSubjectLabel()(policy.subject, subjects)
|
|
260
|
+
const amount = (quantity: LimitQuantity) => formatLimitQuantity(quantity, messages.tokens, locale)
|
|
261
|
+
const consumption = status?.consumption
|
|
262
|
+
const percent = consumption
|
|
263
|
+
? limitUsedPercent({
|
|
264
|
+
limit: policy.limit,
|
|
265
|
+
actual: consumption.actual,
|
|
266
|
+
reserved: consumption.reserved,
|
|
267
|
+
unknown: consumption.unknown,
|
|
268
|
+
})
|
|
269
|
+
: 0
|
|
270
|
+
const unknown = consumption ? quantityIsPositive(consumption.unknown) : false
|
|
271
|
+
const spent =
|
|
272
|
+
consumption &&
|
|
273
|
+
(quantityIsPositive(consumption.actual) || quantityIsPositive(consumption.reserved) || unknown)
|
|
274
|
+
const percentText =
|
|
275
|
+
spent && percent < 0.01
|
|
276
|
+
? `<${(0.01).toLocaleString(locale)}%`
|
|
277
|
+
: `${percent.toLocaleString(locale, { maximumFractionDigits: 1 })}%`
|
|
278
|
+
const barTone = status?.exhausted
|
|
279
|
+
? "bg-red-500"
|
|
280
|
+
: status?.accountingStatus === "unavailable" || unknown || percent >= 80
|
|
281
|
+
? "bg-amber-500"
|
|
282
|
+
: "bg-[#007aff]"
|
|
283
|
+
const state: { readonly tone: Tone; readonly label: string } = !policy.enabled
|
|
284
|
+
? { tone: "muted", label: messages.disabled }
|
|
285
|
+
: status?.exhausted
|
|
286
|
+
? { tone: "error", label: messages.exhausted }
|
|
287
|
+
: status?.accountingStatus === "unavailable"
|
|
288
|
+
? { tone: "warn", label: messages.accountingUnavailable }
|
|
289
|
+
: { tone: "ok", label: messages.active }
|
|
290
|
+
|
|
291
|
+
return (
|
|
292
|
+
<div className="flex flex-col gap-3 px-5 py-4">
|
|
293
|
+
<div className="flex items-start gap-4">
|
|
294
|
+
<div className="min-w-0 flex-1">
|
|
295
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
296
|
+
<span className="truncate text-sm font-medium">{label}</span>
|
|
297
|
+
<Pill tone={state.tone}>{state.label}</Pill>
|
|
298
|
+
{status?.orphaned ? <Pill tone="muted">{messages.orphaned}</Pill> : null}
|
|
299
|
+
</div>
|
|
300
|
+
<p className="mt-0.5 text-[0.8125rem] text-muted-foreground">
|
|
301
|
+
{messages.meters[policy.limit.meter]}
|
|
302
|
+
</p>
|
|
303
|
+
</div>
|
|
304
|
+
{canManage ? (
|
|
305
|
+
<LimitActions
|
|
306
|
+
policy={policy}
|
|
307
|
+
label={label}
|
|
308
|
+
busy={busy}
|
|
309
|
+
onEdit={onEdit}
|
|
310
|
+
onToggle={onToggle}
|
|
311
|
+
onDelete={onDelete}
|
|
312
|
+
/>
|
|
313
|
+
) : null}
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
{status && consumption ? (
|
|
317
|
+
<div className="flex flex-col gap-2">
|
|
318
|
+
<div className="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 text-[0.8125rem]">
|
|
319
|
+
<span className="font-medium tabular-nums">
|
|
320
|
+
{amount(consumption.actual)}{" "}
|
|
321
|
+
<span className="font-normal text-muted-foreground">
|
|
322
|
+
{messages.of(amount(policy.limit))}
|
|
323
|
+
</span>
|
|
324
|
+
</span>
|
|
325
|
+
<span className="text-xs font-medium tabular-nums">{messages.used(percentText)}</span>
|
|
326
|
+
</div>
|
|
327
|
+
<div
|
|
328
|
+
role="progressbar"
|
|
329
|
+
aria-label={label}
|
|
330
|
+
aria-valuemin={0}
|
|
331
|
+
aria-valuemax={100}
|
|
332
|
+
aria-valuenow={percent}
|
|
333
|
+
aria-valuetext={messages.used(percentText)}
|
|
334
|
+
className="h-1.5 overflow-hidden rounded-full bg-muted"
|
|
335
|
+
>
|
|
336
|
+
<div
|
|
337
|
+
className={cn("h-full rounded-full transition-[width] duration-500", barTone)}
|
|
338
|
+
style={{ width: `${percent}%`, minWidth: percent > 0 ? 2 : undefined }}
|
|
339
|
+
/>
|
|
340
|
+
</div>
|
|
341
|
+
<div className="flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground">
|
|
342
|
+
<span>{messages.remaining(amount(consumption.remaining))}</span>
|
|
343
|
+
{quantityIsPositive(consumption.reserved) ? (
|
|
344
|
+
<span>{messages.reserved(amount(consumption.reserved))}</span>
|
|
345
|
+
) : null}
|
|
346
|
+
{unknown ? <span>{messages.heldUnknown(amount(consumption.unknown))}</span> : null}
|
|
347
|
+
<span>
|
|
348
|
+
{messages.resets(
|
|
349
|
+
new Date(status.period.resetAt).toLocaleString(locale, {
|
|
350
|
+
month: "short",
|
|
351
|
+
day: "numeric",
|
|
352
|
+
hour: "numeric",
|
|
353
|
+
minute: "2-digit",
|
|
354
|
+
timeZone: "UTC",
|
|
355
|
+
timeZoneName: "short",
|
|
356
|
+
})
|
|
357
|
+
)}
|
|
358
|
+
</span>
|
|
359
|
+
</div>
|
|
360
|
+
{status.accountingStatus === "unavailable" || unknown ? (
|
|
361
|
+
<p className="rounded-md bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200">
|
|
362
|
+
{status.accountingStatus === "unavailable"
|
|
363
|
+
? messages.accountingUnavailableNote
|
|
364
|
+
: messages.unknownNote}
|
|
365
|
+
</p>
|
|
366
|
+
) : null}
|
|
367
|
+
{status.orphaned ? (
|
|
368
|
+
<p className="rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground">
|
|
369
|
+
{messages.orphanedNote}
|
|
370
|
+
</p>
|
|
371
|
+
) : null}
|
|
372
|
+
</div>
|
|
373
|
+
) : (
|
|
374
|
+
<p className="text-[0.8125rem] text-muted-foreground">
|
|
375
|
+
<span className="font-medium text-foreground tabular-nums">
|
|
376
|
+
{messages.monthly(amount(policy.limit))}
|
|
377
|
+
</span>{" "}
|
|
378
|
+
· {messages.needsObserve}
|
|
379
|
+
</p>
|
|
380
|
+
)}
|
|
381
|
+
</div>
|
|
382
|
+
)
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function LimitActions({
|
|
386
|
+
policy,
|
|
387
|
+
label,
|
|
388
|
+
busy,
|
|
389
|
+
onEdit,
|
|
390
|
+
onToggle,
|
|
391
|
+
onDelete,
|
|
392
|
+
}: {
|
|
393
|
+
readonly policy: LimitPolicy
|
|
394
|
+
readonly label: string
|
|
395
|
+
readonly busy: boolean
|
|
396
|
+
readonly onEdit: () => void
|
|
397
|
+
readonly onToggle: () => void
|
|
398
|
+
readonly onDelete: () => void
|
|
399
|
+
}) {
|
|
400
|
+
const messages = useAiUsageMessages().limits
|
|
401
|
+
const [confirming, setConfirming] = useState(false)
|
|
402
|
+
return (
|
|
403
|
+
<>
|
|
404
|
+
<DropdownMenu>
|
|
405
|
+
<DropdownMenuTrigger asChild>
|
|
406
|
+
<Button
|
|
407
|
+
type="button"
|
|
408
|
+
variant="ghost"
|
|
409
|
+
size="icon-sm"
|
|
410
|
+
aria-label={messages.actions(label)}
|
|
411
|
+
disabled={busy}
|
|
412
|
+
>
|
|
413
|
+
<MoreHorizontal />
|
|
414
|
+
</Button>
|
|
415
|
+
</DropdownMenuTrigger>
|
|
416
|
+
<DropdownMenuContent align="end">
|
|
417
|
+
<DropdownMenuItem onSelect={onEdit}>
|
|
418
|
+
<Pencil />
|
|
419
|
+
{messages.edit}
|
|
420
|
+
</DropdownMenuItem>
|
|
421
|
+
<DropdownMenuItem onSelect={onToggle}>
|
|
422
|
+
{policy.enabled ? messages.disable : messages.enable}
|
|
423
|
+
</DropdownMenuItem>
|
|
424
|
+
<DropdownMenuSeparator />
|
|
425
|
+
<DropdownMenuItem variant="destructive" onSelect={() => setConfirming(true)}>
|
|
426
|
+
<Trash2 />
|
|
427
|
+
{messages.delete}
|
|
428
|
+
</DropdownMenuItem>
|
|
429
|
+
</DropdownMenuContent>
|
|
430
|
+
</DropdownMenu>
|
|
431
|
+
<AlertDialog open={confirming} onOpenChange={setConfirming}>
|
|
432
|
+
<AlertDialogContent>
|
|
433
|
+
<AlertDialogHeader>
|
|
434
|
+
<AlertDialogTitle>{messages.deleteTitle}</AlertDialogTitle>
|
|
435
|
+
<AlertDialogDescription>{messages.deleteDescription}</AlertDialogDescription>
|
|
436
|
+
</AlertDialogHeader>
|
|
437
|
+
<AlertDialogFooter>
|
|
438
|
+
<AlertDialogCancel>{messages.cancel}</AlertDialogCancel>
|
|
439
|
+
<AlertDialogAction variant="destructive" onClick={onDelete}>
|
|
440
|
+
{messages.delete}
|
|
441
|
+
</AlertDialogAction>
|
|
442
|
+
</AlertDialogFooter>
|
|
443
|
+
</AlertDialogContent>
|
|
444
|
+
</AlertDialog>
|
|
445
|
+
</>
|
|
446
|
+
)
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function subjectValue(subject: LimitSubject): string {
|
|
450
|
+
return subject.type === "project" ? "project" : `${subject.type}:${subject.id}`
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
function parseSubjectValue(value: string): LimitSubject {
|
|
454
|
+
if (value === "project") return { type: "project" }
|
|
455
|
+
const separator = value.indexOf(":")
|
|
456
|
+
const type = value.slice(0, separator)
|
|
457
|
+
const id = value.slice(separator + 1)
|
|
458
|
+
if (id && (type === "group" || type === "user" || type === "serviceAccount")) return { type, id }
|
|
459
|
+
throw new Error(`[SixbApp] Unknown AI limit subject: ${value}`)
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
function LimitDialog({
|
|
463
|
+
policy,
|
|
464
|
+
subjects,
|
|
465
|
+
subjectsError,
|
|
466
|
+
pending,
|
|
467
|
+
error,
|
|
468
|
+
onClose,
|
|
469
|
+
onCreate,
|
|
470
|
+
onUpdate,
|
|
471
|
+
}: {
|
|
472
|
+
/** The limit being edited; absent when adding one. */
|
|
473
|
+
readonly policy?: LimitPolicy
|
|
474
|
+
readonly subjects: SubjectOptions | undefined
|
|
475
|
+
readonly subjectsError: unknown
|
|
476
|
+
readonly pending: boolean
|
|
477
|
+
readonly error: unknown
|
|
478
|
+
readonly onClose: () => void
|
|
479
|
+
readonly onCreate: (input: {
|
|
480
|
+
subject: LimitSubject
|
|
481
|
+
limit: LimitQuantity
|
|
482
|
+
enabled: boolean
|
|
483
|
+
}) => void
|
|
484
|
+
readonly onUpdate: (limitId: string, input: { limit: LimitQuantity; enabled: boolean }) => void
|
|
485
|
+
}) {
|
|
486
|
+
const messages = useAiUsageMessages().limits
|
|
487
|
+
const label = useSubjectLabel()
|
|
488
|
+
const [subject, setSubject] = useState<LimitSubject>(policy?.subject ?? { type: "project" })
|
|
489
|
+
// A limit's subject and meter are what it is; editing changes only its amount and whether it
|
|
490
|
+
// is enforced.
|
|
491
|
+
const [meter, setMeter] = useState<LimitMeter>(policy?.limit.meter ?? "cost.catalogEstimated")
|
|
492
|
+
const [amount, setAmount] = useState(policy ? limitAmountInput(policy.limit) : "")
|
|
493
|
+
const [enabled, setEnabled] = useState(policy?.enabled ?? true)
|
|
494
|
+
const [invalid, setInvalid] = useState<keyof typeof messages.errors | null>(null)
|
|
495
|
+
const currency =
|
|
496
|
+
policy?.limit.meter === "cost.catalogEstimated" ? policy.limit.amount.currency : "USD"
|
|
497
|
+
|
|
498
|
+
const choices = [
|
|
499
|
+
{ value: "project", label: messages.project },
|
|
500
|
+
...(["group", "user", "serviceAccount"] as const satisfies readonly LimitSubjectType[]).flatMap(
|
|
501
|
+
(type) =>
|
|
502
|
+
limitSubjectChoices(subjects, type, messages.statuses).map((choice) => ({
|
|
503
|
+
value: subjectValue({ type, id: choice.value }),
|
|
504
|
+
label: choice.label,
|
|
505
|
+
description: [messages.subjectTypes[type], choice.description]
|
|
506
|
+
.filter(Boolean)
|
|
507
|
+
.join(" · "),
|
|
508
|
+
}))
|
|
509
|
+
),
|
|
510
|
+
]
|
|
511
|
+
if (!choices.some((choice) => choice.value === subjectValue(subject))) {
|
|
512
|
+
choices.push({ value: subjectValue(subject), label: label(subject, subjects) })
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const submit = (event: SubmitEvent<HTMLFormElement>) => {
|
|
516
|
+
event.preventDefault()
|
|
517
|
+
const parsed = parseLimitAmount(meter, amount, currency)
|
|
518
|
+
if (!parsed.ok) {
|
|
519
|
+
setInvalid(parsed.error)
|
|
520
|
+
return
|
|
521
|
+
}
|
|
522
|
+
if (policy) onUpdate(policy.id, { limit: parsed.quantity, enabled })
|
|
523
|
+
else onCreate({ subject, limit: parsed.quantity, enabled: true })
|
|
524
|
+
}
|
|
525
|
+
const failure = invalid
|
|
526
|
+
? messages.errors[invalid]
|
|
527
|
+
: error
|
|
528
|
+
? apiErrorMessage(error, policy ? messages.updateFailed : messages.createFailed)
|
|
529
|
+
: !policy && subjectsError
|
|
530
|
+
? apiErrorMessage(subjectsError, messages.subjectsFailed)
|
|
531
|
+
: null
|
|
532
|
+
|
|
533
|
+
return (
|
|
534
|
+
<Dialog open onOpenChange={(open) => (open ? undefined : onClose())}>
|
|
535
|
+
<DialogContent className="sm:max-w-lg">
|
|
536
|
+
<form onSubmit={submit} className="flex flex-col gap-5">
|
|
537
|
+
<DialogHeader>
|
|
538
|
+
<DialogTitle>{policy ? messages.dialogEdit : messages.dialogAdd}</DialogTitle>
|
|
539
|
+
<DialogDescription>{messages.dialogDescription}</DialogDescription>
|
|
540
|
+
</DialogHeader>
|
|
541
|
+
<Field
|
|
542
|
+
label={messages.appliesTo}
|
|
543
|
+
htmlFor="ai-limit-subject"
|
|
544
|
+
hint={messages.appliesToHint}
|
|
545
|
+
>
|
|
546
|
+
<Combobox
|
|
547
|
+
id="ai-limit-subject"
|
|
548
|
+
value={subjectValue(subject)}
|
|
549
|
+
options={choices}
|
|
550
|
+
onValueChange={(value) => {
|
|
551
|
+
setSubject(parseSubjectValue(value))
|
|
552
|
+
setInvalid(null)
|
|
553
|
+
}}
|
|
554
|
+
disabled={policy !== undefined}
|
|
555
|
+
searchPlaceholder={messages.searchSubjects}
|
|
556
|
+
emptyLabel={messages.noSubjects}
|
|
557
|
+
/>
|
|
558
|
+
</Field>
|
|
559
|
+
<div className="grid gap-4 sm:grid-cols-2">
|
|
560
|
+
<Field label={messages.meter}>
|
|
561
|
+
<div className="inline-flex w-full rounded-lg bg-muted/70 p-1 ring-1 ring-border/70">
|
|
562
|
+
{(["cost.catalogEstimated", "tokens.total"] as const).map((option) => (
|
|
563
|
+
<button
|
|
564
|
+
key={option}
|
|
565
|
+
type="button"
|
|
566
|
+
aria-pressed={meter === option}
|
|
567
|
+
disabled={policy !== undefined}
|
|
568
|
+
onClick={() => {
|
|
569
|
+
setMeter(option)
|
|
570
|
+
setAmount("")
|
|
571
|
+
setInvalid(null)
|
|
572
|
+
}}
|
|
573
|
+
className={cn(
|
|
574
|
+
"h-7 flex-1 rounded-md text-[0.8125rem] font-medium text-muted-foreground transition-colors disabled:cursor-not-allowed",
|
|
575
|
+
meter === option && "bg-background text-foreground ring-1 ring-border"
|
|
576
|
+
)}
|
|
577
|
+
>
|
|
578
|
+
{option === "tokens.total" ? messages.tokenMeter : messages.cost}
|
|
579
|
+
</button>
|
|
580
|
+
))}
|
|
581
|
+
</div>
|
|
582
|
+
</Field>
|
|
583
|
+
<Field
|
|
584
|
+
label={
|
|
585
|
+
meter === "tokens.total" ? messages.tokenAmount : messages.costAmount(currency)
|
|
586
|
+
}
|
|
587
|
+
htmlFor="ai-limit-amount"
|
|
588
|
+
>
|
|
589
|
+
<Input
|
|
590
|
+
id="ai-limit-amount"
|
|
591
|
+
inputMode={meter === "tokens.total" ? "numeric" : "decimal"}
|
|
592
|
+
placeholder={meter === "tokens.total" ? "1000000" : "100.00"}
|
|
593
|
+
value={amount}
|
|
594
|
+
onChange={(event) => {
|
|
595
|
+
setAmount(event.target.value)
|
|
596
|
+
setInvalid(null)
|
|
597
|
+
}}
|
|
598
|
+
/>
|
|
599
|
+
</Field>
|
|
600
|
+
</div>
|
|
601
|
+
{policy ? (
|
|
602
|
+
<label
|
|
603
|
+
htmlFor="ai-limit-enabled"
|
|
604
|
+
className="flex items-center justify-between gap-4 rounded-lg border border-border px-3 py-2.5"
|
|
605
|
+
>
|
|
606
|
+
<span>
|
|
607
|
+
<span className="block text-sm font-medium">{messages.enforce}</span>
|
|
608
|
+
<span className="block text-xs text-muted-foreground">{messages.enforceHint}</span>
|
|
609
|
+
</span>
|
|
610
|
+
<Switch id="ai-limit-enabled" checked={enabled} onCheckedChange={setEnabled} />
|
|
611
|
+
</label>
|
|
612
|
+
) : null}
|
|
613
|
+
{failure ? (
|
|
614
|
+
<p className="text-[0.8125rem] text-red-600 dark:text-red-400">{failure}</p>
|
|
615
|
+
) : null}
|
|
616
|
+
<DialogFooter>
|
|
617
|
+
<Button type="button" variant="outline" disabled={pending} onClick={onClose}>
|
|
618
|
+
{messages.cancel}
|
|
619
|
+
</Button>
|
|
620
|
+
<Button type="submit" disabled={pending}>
|
|
621
|
+
{pending ? <Loader2 className="animate-spin" /> : null}
|
|
622
|
+
{policy ? messages.save : messages.add}
|
|
623
|
+
</Button>
|
|
624
|
+
</DialogFooter>
|
|
625
|
+
</form>
|
|
626
|
+
</DialogContent>
|
|
627
|
+
</Dialog>
|
|
628
|
+
)
|
|
629
|
+
}
|