@sixb/app 0.1.10 → 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 +955 -2784
- package/dist/index.js.map +14 -13
- package/dist/locale-messages.d.ts +103 -0
- package/dist/locale-messages.d.ts.map +1 -0
- package/dist/locale.d.ts +111 -0
- package/dist/locale.d.ts.map +1 -0
- package/dist/locale.js +15 -0
- package/dist/{auth.js.map → locale.js.map} +1 -1
- 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 +29 -20
- 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 +187 -103
- package/src/createCustomApp.ts +155 -67
- package/src/index.ts +52 -16
- package/src/locale-messages.ts +181 -0
- package/src/locale.ts +23 -0
- 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/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-e1gj8c1a.js +0 -8
- package/dist/chunk-e1gj8c1a.js.map +0 -10
- package/src/browser.ts +0 -2
|
@@ -0,0 +1,1029 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ListObjectTypesResponse,
|
|
3
|
+
ObjectAction,
|
|
4
|
+
RelationshipEdge,
|
|
5
|
+
TelemetryHistory,
|
|
6
|
+
TelemetryProperty,
|
|
7
|
+
TelemetryUpdate,
|
|
8
|
+
} from "@sixb/client"
|
|
9
|
+
import {
|
|
10
|
+
decodeObjectId,
|
|
11
|
+
encodeObjectId,
|
|
12
|
+
objectIdAliases,
|
|
13
|
+
queryObjects,
|
|
14
|
+
telemetryUpdateKey,
|
|
15
|
+
toObjectSummary,
|
|
16
|
+
} from "@sixb/client"
|
|
17
|
+
import {
|
|
18
|
+
type GetTelemetryHistoryOptions,
|
|
19
|
+
getObjectOptions,
|
|
20
|
+
getProjectInfoOptions,
|
|
21
|
+
getTelemetryHistoryOptions,
|
|
22
|
+
listObjectTypesOptions,
|
|
23
|
+
listRelationshipsOptions,
|
|
24
|
+
objectQueryKeys,
|
|
25
|
+
} from "@sixb/client/hooks"
|
|
26
|
+
import {
|
|
27
|
+
Badge,
|
|
28
|
+
Button,
|
|
29
|
+
Calendar,
|
|
30
|
+
Card,
|
|
31
|
+
Popover,
|
|
32
|
+
PopoverContent,
|
|
33
|
+
PopoverTrigger,
|
|
34
|
+
ToggleGroup,
|
|
35
|
+
ToggleGroupItem,
|
|
36
|
+
} from "@sixb/ui/components"
|
|
37
|
+
import { useQuery } from "@tanstack/react-query"
|
|
38
|
+
import { Box, CalendarIcon } from "lucide-react"
|
|
39
|
+
import { Fragment, lazy, Suspense, useEffect, useMemo, useState } from "react"
|
|
40
|
+
import { Link, useParams } from "react-router-dom"
|
|
41
|
+
import { useSections } from "../../sections/sections"
|
|
42
|
+
import { objectHref, objectTypeHref } from "../routes"
|
|
43
|
+
import { PageFrame } from "../section-page"
|
|
44
|
+
import { Panel, PanelEmpty, useLoadFailure } from "../section-ui"
|
|
45
|
+
import {
|
|
46
|
+
fieldRecordSchema,
|
|
47
|
+
objectFileLinks,
|
|
48
|
+
useValueTypes,
|
|
49
|
+
ValuePanel,
|
|
50
|
+
valueSchema,
|
|
51
|
+
} from "../values"
|
|
52
|
+
import { ActionButton } from "./components/action-button"
|
|
53
|
+
import { LetterAvatar, LoadingState, Section } from "./components/common"
|
|
54
|
+
import { TelemetryGrid } from "./components/telemetry-grid"
|
|
55
|
+
import { TelemetryValue } from "./components/telemetry-value"
|
|
56
|
+
import { UsageBar } from "./components/usage-bar"
|
|
57
|
+
import { useObjectLiveUpdates } from "./hooks/object-live-updates"
|
|
58
|
+
import { useObjectTelemetryUpdates } from "./hooks/object-telemetry-updates"
|
|
59
|
+
import { humanizeIdentifier } from "./lib/labels"
|
|
60
|
+
import { getHistoryBounds, isSampleInBounds } from "./lib/telemetry-history"
|
|
61
|
+
import { formatRelativeTime } from "./lib/time"
|
|
62
|
+
|
|
63
|
+
// Loaded only when a numeric trend draws, so the charting library stays out of other pages.
|
|
64
|
+
const TelemetryChart = lazy(() =>
|
|
65
|
+
import("./components/telemetry-chart").then((module) => ({ default: module.TelemetryChart }))
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
const telemetryRanges = [
|
|
69
|
+
{ value: "5m", label: "5m" },
|
|
70
|
+
{ value: "1h", label: "1h" },
|
|
71
|
+
{ value: "24h", label: "24h" },
|
|
72
|
+
{ value: "7d", label: "7d" },
|
|
73
|
+
{ value: "custom", label: "Custom" },
|
|
74
|
+
] as const
|
|
75
|
+
|
|
76
|
+
type TelemetryRangeValue = (typeof telemetryRanges)[number]["value"]
|
|
77
|
+
|
|
78
|
+
const defaultTelemetryRange: TelemetryRangeValue = "7d"
|
|
79
|
+
|
|
80
|
+
function formatHistoryValue(value: string | number | boolean): string {
|
|
81
|
+
if (typeof value === "boolean") return value ? "True" : "False"
|
|
82
|
+
return String(value)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function qualityDotClass(quality?: "good" | "uncertain" | "bad"): string {
|
|
86
|
+
if (quality === "good") return "bg-emerald-500"
|
|
87
|
+
if (quality === "uncertain") return "bg-amber-500"
|
|
88
|
+
if (quality === "bad") return "bg-red-500"
|
|
89
|
+
return "bg-muted-foreground/40"
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function telemetryPropertyLabel(
|
|
93
|
+
propertyId: string,
|
|
94
|
+
property?: (TelemetryProperty & { name?: string }) | undefined
|
|
95
|
+
): string {
|
|
96
|
+
const explicitName =
|
|
97
|
+
typeof property?.name === "string" && property.name.length > 0 ? property.name : null
|
|
98
|
+
return humanizeIdentifier(explicitName ?? propertyId)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function isoTimestamp(date: Date): string {
|
|
102
|
+
return date.toISOString()
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function parseTimestamp(value: string): Date | null {
|
|
106
|
+
if (!value) return null
|
|
107
|
+
|
|
108
|
+
const date = new Date(value)
|
|
109
|
+
return Number.isNaN(date.getTime()) ? null : date
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function timestampIso(value: string): string | undefined {
|
|
113
|
+
return parseTimestamp(value)?.toISOString()
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function startOfLocalDay(date: Date): Date {
|
|
117
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function endOfLocalDay(date: Date): Date {
|
|
121
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function dateBoundaryIso(day: Date, boundary: "start" | "end"): string {
|
|
125
|
+
return isoTimestamp(boundary === "start" ? startOfLocalDay(day) : endOfLocalDay(day))
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function formatCustomDate(value: string): string {
|
|
129
|
+
const date = parseTimestamp(value)
|
|
130
|
+
if (!date) return "Select date"
|
|
131
|
+
|
|
132
|
+
return date.toLocaleDateString([], {
|
|
133
|
+
month: "short",
|
|
134
|
+
day: "numeric",
|
|
135
|
+
year: "numeric",
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function telemetryRangeLabel(range: TelemetryRangeValue, fromIso?: string, toIso?: string): string {
|
|
140
|
+
if (range === "5m") return "Last 5 minutes"
|
|
141
|
+
if (range === "1h") return "Last hour"
|
|
142
|
+
if (range === "24h") return "Last 24 hours"
|
|
143
|
+
if (range === "7d") return "Last 7 days"
|
|
144
|
+
|
|
145
|
+
const from = fromIso ? new Date(fromIso) : null
|
|
146
|
+
const to = toIso ? new Date(toIso) : null
|
|
147
|
+
if (from && to && !Number.isNaN(from.getTime()) && !Number.isNaN(to.getTime())) {
|
|
148
|
+
return `${from.toLocaleDateString([], {
|
|
149
|
+
month: "short",
|
|
150
|
+
day: "numeric",
|
|
151
|
+
year: "numeric",
|
|
152
|
+
})} to ${to.toLocaleDateString([], {
|
|
153
|
+
month: "short",
|
|
154
|
+
day: "numeric",
|
|
155
|
+
year: "numeric",
|
|
156
|
+
})}`
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return "Custom range"
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function telemetryRangeSentenceLabel(range: TelemetryRangeValue): string {
|
|
163
|
+
if (range === "5m") return "last 5 minutes"
|
|
164
|
+
if (range === "1h") return "last hour"
|
|
165
|
+
if (range === "24h") return "last 24 hours"
|
|
166
|
+
if (range === "7d") return "last 7 days"
|
|
167
|
+
return "selected range"
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function latestUpdateForProperty(
|
|
171
|
+
latestUpdates: Record<string, TelemetryUpdate>,
|
|
172
|
+
projectName: string,
|
|
173
|
+
objectIds: readonly string[],
|
|
174
|
+
propertyId: string
|
|
175
|
+
): TelemetryUpdate | null {
|
|
176
|
+
let latest: TelemetryUpdate | null = null
|
|
177
|
+
|
|
178
|
+
for (const objectId of objectIds) {
|
|
179
|
+
const update = latestUpdates[telemetryUpdateKey(projectName, objectId, propertyId)]
|
|
180
|
+
if (!update) continue
|
|
181
|
+
|
|
182
|
+
if (!latest || +new Date(update.timestamp) > +new Date(latest.timestamp)) {
|
|
183
|
+
latest = update
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return latest
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface ActionPresentation {
|
|
191
|
+
tone: "default" | "primary" | "danger"
|
|
192
|
+
featured: boolean
|
|
193
|
+
requireConfirm: boolean
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function getActionPresentation(actionId: string): ActionPresentation {
|
|
197
|
+
const id = actionId.toLowerCase()
|
|
198
|
+
const has = (pattern: RegExp) => pattern.test(id)
|
|
199
|
+
|
|
200
|
+
const dangerous =
|
|
201
|
+
has(/^(power[-_ ]?off|shutdown|restart|reboot|factory[-_ ]?reset|erase|delete|remove|kill)$/) ||
|
|
202
|
+
has(
|
|
203
|
+
/[-_ ](power[-_ ]?off|shutdown|restart|reboot|factory[-_ ]?reset|erase|delete|remove|kill)$/
|
|
204
|
+
)
|
|
205
|
+
if (dangerous) {
|
|
206
|
+
return { tone: "danger", featured: true, requireConfirm: true }
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const primary =
|
|
210
|
+
has(
|
|
211
|
+
/^(power[-_ ]?on|play|pause|resume|stop|launch|home|back|mute|unmute|volume[-_ ]?\w+|toggle[-_ ]?\w+)$/
|
|
212
|
+
) ||
|
|
213
|
+
has(
|
|
214
|
+
/[-_ ](power[-_ ]?on|play|pause|resume|stop|launch|home|back|mute|unmute|volume[-_ ]?\w+|toggle[-_ ]?\w+)$/
|
|
215
|
+
)
|
|
216
|
+
if (primary) {
|
|
217
|
+
return { tone: "primary", featured: true, requireConfirm: false }
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return { tone: "default", featured: false, requireConfirm: false }
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function getUsagePercent(
|
|
224
|
+
telemetry: Record<string, TelemetryProperty>,
|
|
225
|
+
objectClass: string
|
|
226
|
+
): number | null {
|
|
227
|
+
const type = objectClass
|
|
228
|
+
const usageMap: Record<string, () => number | null> = {
|
|
229
|
+
memory: () =>
|
|
230
|
+
telemetry.pressure?.currentValue != null ? Number(telemetry.pressure.currentValue) : null,
|
|
231
|
+
processor: () =>
|
|
232
|
+
telemetry.usage?.currentValue != null ? Number(telemetry.usage.currentValue) : null,
|
|
233
|
+
battery: () =>
|
|
234
|
+
telemetry.level?.currentValue != null ? Number(telemetry.level.currentValue) : null,
|
|
235
|
+
graphics: () =>
|
|
236
|
+
telemetry.usage?.currentValue != null ? Number(telemetry.usage.currentValue) : null,
|
|
237
|
+
gpu: () =>
|
|
238
|
+
telemetry.usage?.currentValue != null ? Number(telemetry.usage.currentValue) : null,
|
|
239
|
+
storage: () => {
|
|
240
|
+
const used = telemetry.used?.currentValue
|
|
241
|
+
const free = telemetry.free?.currentValue
|
|
242
|
+
return typeof used === "number" && typeof free === "number"
|
|
243
|
+
? (used / (used + free)) * 100
|
|
244
|
+
: null
|
|
245
|
+
},
|
|
246
|
+
}
|
|
247
|
+
for (const [key, getValue] of Object.entries(usageMap)) {
|
|
248
|
+
if (type.includes(key)) return getValue()
|
|
249
|
+
}
|
|
250
|
+
return null
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Any object's page, at `/objects/:objectTypeId/:primaryId`: its telemetry, live with its trend,
|
|
255
|
+
* its properties, the objects it links to, and its type's actions. It belongs to no section, so
|
|
256
|
+
* anyone whose grants let them read the object can open it.
|
|
257
|
+
*/
|
|
258
|
+
export function ObjectPage() {
|
|
259
|
+
const params = useParams()
|
|
260
|
+
const objectId =
|
|
261
|
+
params.objectTypeId && params.primaryId
|
|
262
|
+
? encodeObjectId(params.objectTypeId, params.primaryId)
|
|
263
|
+
: undefined
|
|
264
|
+
const projectName = useQuery({ ...getProjectInfoOptions(), retry: false }).data?.id ?? ""
|
|
265
|
+
const [selectedPropertyId, setSelectedPropertyId] = useState<string | null>(null)
|
|
266
|
+
const [trendDismissed, setTrendDismissed] = useState(false)
|
|
267
|
+
const [telemetryRange, setTelemetryRange] = useState<TelemetryRangeValue>(defaultTelemetryRange)
|
|
268
|
+
const [customFrom, setCustomFrom] = useState(() =>
|
|
269
|
+
isoTimestamp(startOfLocalDay(new Date(Date.now() - 7 * 86_400_000)))
|
|
270
|
+
)
|
|
271
|
+
const [customTo, setCustomTo] = useState(() => isoTimestamp(endOfLocalDay(new Date())))
|
|
272
|
+
useObjectLiveUpdates({ objectId, enabled: Boolean(projectName && objectId) })
|
|
273
|
+
const latestUpdates = useObjectTelemetryUpdates(projectName, objectId, {
|
|
274
|
+
enabled: Boolean(objectId),
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
useEffect(() => {
|
|
278
|
+
if (!objectId) return
|
|
279
|
+
setSelectedPropertyId(null)
|
|
280
|
+
setTrendDismissed(false)
|
|
281
|
+
}, [objectId])
|
|
282
|
+
|
|
283
|
+
const objectQuery = useQuery({
|
|
284
|
+
...getObjectOptions({ path: { objectId: objectId ?? "" } }),
|
|
285
|
+
enabled: !!objectId,
|
|
286
|
+
retry: false,
|
|
287
|
+
})
|
|
288
|
+
const object = objectQuery.data
|
|
289
|
+
const failure = useLoadFailure(objectQuery.error, { id: params.primaryId })
|
|
290
|
+
const typesOpen = useSections().some((section) => section.id === "ontology")
|
|
291
|
+
|
|
292
|
+
const objectTypes = useQuery({ ...listObjectTypesOptions(), retry: false }).data
|
|
293
|
+
const valueTypes = useValueTypes(noSchemas)
|
|
294
|
+
|
|
295
|
+
const { data: relationships = noRelationships } = useQuery({
|
|
296
|
+
...listRelationshipsOptions({ query: { objectId } }),
|
|
297
|
+
enabled: !!objectId,
|
|
298
|
+
retry: false,
|
|
299
|
+
})
|
|
300
|
+
const objectLookup = useRelatedObjects(relationships, objectTypes)
|
|
301
|
+
|
|
302
|
+
const liveObjectIdAliases = useMemo(() => {
|
|
303
|
+
const ids = [objectId, object?.id, object?.primaryId].filter(
|
|
304
|
+
(id): id is string => typeof id === "string" && id.length > 0
|
|
305
|
+
)
|
|
306
|
+
return Array.from(new Set(ids.flatMap((id) => objectIdAliases(id))))
|
|
307
|
+
}, [objectId, object?.id, object?.primaryId])
|
|
308
|
+
|
|
309
|
+
const liveObjectIdAliasSet = useMemo(() => new Set(liveObjectIdAliases), [liveObjectIdAliases])
|
|
310
|
+
|
|
311
|
+
const latestTelemetryUpdates = useMemo(() => {
|
|
312
|
+
if (liveObjectIdAliasSet.size === 0) return {}
|
|
313
|
+
|
|
314
|
+
const byProperty = new Map<string, TelemetryUpdate>()
|
|
315
|
+
for (const update of Object.values(latestUpdates)) {
|
|
316
|
+
if (update.projectName !== projectName) continue
|
|
317
|
+
if (!liveObjectIdAliasSet.has(update.objectId)) continue
|
|
318
|
+
|
|
319
|
+
const previous = byProperty.get(update.propertyId)
|
|
320
|
+
if (!previous || +new Date(update.timestamp) > +new Date(previous.timestamp)) {
|
|
321
|
+
byProperty.set(update.propertyId, update)
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return Object.fromEntries(
|
|
326
|
+
Array.from(byProperty.entries()).map(([propertyId, update]) => [
|
|
327
|
+
propertyId,
|
|
328
|
+
{ value: update.value, quality: update.quality },
|
|
329
|
+
])
|
|
330
|
+
)
|
|
331
|
+
}, [latestUpdates, projectName, liveObjectIdAliasSet])
|
|
332
|
+
|
|
333
|
+
const telemetryProperties = useMemo(
|
|
334
|
+
() => (object?.telemetry as Record<string, TelemetryProperty>) ?? {},
|
|
335
|
+
[object]
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
const telemetryWithLive = useMemo(() => {
|
|
339
|
+
const telemetryMap = (object?.telemetry || {}) as Record<string, TelemetryProperty>
|
|
340
|
+
return Object.fromEntries(
|
|
341
|
+
Object.entries(telemetryMap).map(([id, property]) => {
|
|
342
|
+
const live = latestTelemetryUpdates[id]
|
|
343
|
+
if (!live) return [id, property]
|
|
344
|
+
return [
|
|
345
|
+
id,
|
|
346
|
+
{ ...property, currentValue: live.value, quality: live.quality ?? property.quality },
|
|
347
|
+
]
|
|
348
|
+
})
|
|
349
|
+
) as Record<string, TelemetryProperty>
|
|
350
|
+
}, [object?.telemetry, latestTelemetryUpdates])
|
|
351
|
+
|
|
352
|
+
const numericPropertyIds = useMemo(() => {
|
|
353
|
+
return Object.keys(telemetryProperties).filter((propertyId) => {
|
|
354
|
+
const property = telemetryProperties[propertyId]
|
|
355
|
+
if (!property) return false
|
|
356
|
+
if (property.dataType === "number") return true
|
|
357
|
+
const live = latestTelemetryUpdates[propertyId]?.value
|
|
358
|
+
if (typeof live === "number") return true
|
|
359
|
+
return typeof property.currentValue === "number"
|
|
360
|
+
})
|
|
361
|
+
}, [telemetryProperties, latestTelemetryUpdates])
|
|
362
|
+
|
|
363
|
+
const defaultNumericPropertyId = useMemo(() => {
|
|
364
|
+
if (!objectId || numericPropertyIds.length === 0) return null
|
|
365
|
+
const recentNumericUpdate = Object.values(latestUpdates)
|
|
366
|
+
.filter(
|
|
367
|
+
(update) =>
|
|
368
|
+
update.projectName === projectName &&
|
|
369
|
+
liveObjectIdAliasSet.has(update.objectId) &&
|
|
370
|
+
numericPropertyIds.includes(update.propertyId)
|
|
371
|
+
)
|
|
372
|
+
.sort((left, right) => +new Date(right.timestamp) - +new Date(left.timestamp))[0]
|
|
373
|
+
if (recentNumericUpdate) return recentNumericUpdate.propertyId
|
|
374
|
+
return numericPropertyIds[0]
|
|
375
|
+
}, [objectId, numericPropertyIds, latestUpdates, projectName, liveObjectIdAliasSet])
|
|
376
|
+
|
|
377
|
+
useEffect(() => {
|
|
378
|
+
if (!object) return
|
|
379
|
+
if (trendDismissed) return
|
|
380
|
+
if (selectedPropertyId && telemetryProperties[selectedPropertyId]) return
|
|
381
|
+
if (defaultNumericPropertyId) {
|
|
382
|
+
setSelectedPropertyId(defaultNumericPropertyId)
|
|
383
|
+
}
|
|
384
|
+
}, [object, trendDismissed, selectedPropertyId, telemetryProperties, defaultNumericPropertyId])
|
|
385
|
+
|
|
386
|
+
const selectedPropertyUnit = selectedPropertyId
|
|
387
|
+
? telemetryProperties[selectedPropertyId]?.unit
|
|
388
|
+
: undefined
|
|
389
|
+
|
|
390
|
+
const selectedProperty = selectedPropertyId ? telemetryProperties[selectedPropertyId] : undefined
|
|
391
|
+
const selectedPropertyLabel = selectedPropertyId
|
|
392
|
+
? telemetryPropertyLabel(selectedPropertyId, selectedProperty)
|
|
393
|
+
: ""
|
|
394
|
+
const selectedPropertyLatestUpdate = selectedPropertyId
|
|
395
|
+
? latestUpdateForProperty(latestUpdates, projectName, liveObjectIdAliases, selectedPropertyId)
|
|
396
|
+
: null
|
|
397
|
+
const customFromIso = useMemo(() => timestampIso(customFrom), [customFrom])
|
|
398
|
+
const customToIso = useMemo(() => timestampIso(customTo), [customTo])
|
|
399
|
+
const telemetryHistoryEnabled =
|
|
400
|
+
telemetryRange !== "custom" || (customFromIso !== undefined && customToIso !== undefined)
|
|
401
|
+
const telemetryHistoryQuery = useMemo<GetTelemetryHistoryOptions["query"]>(() => {
|
|
402
|
+
if (telemetryRange === "custom") {
|
|
403
|
+
return {
|
|
404
|
+
from: customFromIso,
|
|
405
|
+
to: customToIso,
|
|
406
|
+
order: "asc",
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
return {
|
|
411
|
+
range: telemetryRange,
|
|
412
|
+
order: "asc",
|
|
413
|
+
}
|
|
414
|
+
}, [telemetryRange, customFromIso, customToIso])
|
|
415
|
+
const telemetryRangeLabelText = useMemo(
|
|
416
|
+
() => telemetryRangeLabel(telemetryRange, customFromIso, customToIso),
|
|
417
|
+
[telemetryRange, customFromIso, customToIso]
|
|
418
|
+
)
|
|
419
|
+
const telemetryRangeSampleLabel = telemetryRangeSentenceLabel(telemetryRange)
|
|
420
|
+
|
|
421
|
+
const selectedPropertyIsNumeric =
|
|
422
|
+
selectedPropertyId !== null && numericPropertyIds.includes(selectedPropertyId)
|
|
423
|
+
|
|
424
|
+
const {
|
|
425
|
+
data: selectedPropertyHistory,
|
|
426
|
+
isLoading: selectedPropertyHistoryLoading,
|
|
427
|
+
error: selectedPropertyHistoryError,
|
|
428
|
+
} = useQuery({
|
|
429
|
+
...getTelemetryHistoryOptions({
|
|
430
|
+
path: { projectName, objectId: objectId!, propertyId: selectedPropertyId! },
|
|
431
|
+
query: telemetryHistoryQuery,
|
|
432
|
+
}),
|
|
433
|
+
enabled:
|
|
434
|
+
!!projectName &&
|
|
435
|
+
!!objectId &&
|
|
436
|
+
!!selectedPropertyId &&
|
|
437
|
+
!selectedPropertyIsNumeric &&
|
|
438
|
+
telemetryHistoryEnabled,
|
|
439
|
+
})
|
|
440
|
+
|
|
441
|
+
const nonNumericHistory = useMemo(() => {
|
|
442
|
+
if (!selectedPropertyId || selectedPropertyIsNumeric) return null
|
|
443
|
+
|
|
444
|
+
const historySamples =
|
|
445
|
+
((selectedPropertyHistory as TelemetryHistory | undefined)?.data ?? []).filter(
|
|
446
|
+
(sample) => typeof sample.value !== "number"
|
|
447
|
+
) || []
|
|
448
|
+
|
|
449
|
+
const mergedSamples = [...historySamples]
|
|
450
|
+
if (selectedPropertyLatestUpdate && typeof selectedPropertyLatestUpdate.value !== "number") {
|
|
451
|
+
const latestSample = {
|
|
452
|
+
value: selectedPropertyLatestUpdate.value,
|
|
453
|
+
timestamp: selectedPropertyLatestUpdate.timestamp,
|
|
454
|
+
quality: selectedPropertyLatestUpdate.quality,
|
|
455
|
+
}
|
|
456
|
+
const bounds = getHistoryBounds(telemetryHistoryQuery)
|
|
457
|
+
const duplicate = mergedSamples.some(
|
|
458
|
+
(sample) =>
|
|
459
|
+
sample.timestamp === latestSample.timestamp && sample.value === latestSample.value
|
|
460
|
+
)
|
|
461
|
+
if (!duplicate && isSampleInBounds(latestSample, bounds)) mergedSamples.push(latestSample)
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
mergedSamples.sort((left, right) => +new Date(left.timestamp) - +new Date(right.timestamp))
|
|
465
|
+
|
|
466
|
+
const transitions: Array<{
|
|
467
|
+
value: string | boolean
|
|
468
|
+
timestamp: string
|
|
469
|
+
quality?: "good" | "uncertain" | "bad"
|
|
470
|
+
}> = []
|
|
471
|
+
for (const sample of mergedSamples) {
|
|
472
|
+
const nextValue = sample.value as string | boolean
|
|
473
|
+
const previous = transitions[transitions.length - 1]
|
|
474
|
+
if (!previous || previous.value !== nextValue) {
|
|
475
|
+
transitions.push({ value: nextValue, timestamp: sample.timestamp, quality: sample.quality })
|
|
476
|
+
continue
|
|
477
|
+
}
|
|
478
|
+
transitions[transitions.length - 1] = {
|
|
479
|
+
value: nextValue,
|
|
480
|
+
timestamp: sample.timestamp,
|
|
481
|
+
quality: sample.quality ?? previous.quality,
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
const frequencies = new Map<string, number>()
|
|
486
|
+
for (const sample of mergedSamples) {
|
|
487
|
+
const key = formatHistoryValue(sample.value as string | number | boolean)
|
|
488
|
+
frequencies.set(key, (frequencies.get(key) ?? 0) + 1)
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
return {
|
|
492
|
+
current: transitions[transitions.length - 1] ?? null,
|
|
493
|
+
transitions: [...transitions].reverse().slice(0, 8),
|
|
494
|
+
frequencies: Array.from(frequencies.entries())
|
|
495
|
+
.map(([value, count]) => ({ value, count }))
|
|
496
|
+
.sort((left, right) => right.count - left.count),
|
|
497
|
+
sampleCount: mergedSamples.length,
|
|
498
|
+
}
|
|
499
|
+
}, [
|
|
500
|
+
selectedPropertyId,
|
|
501
|
+
selectedPropertyIsNumeric,
|
|
502
|
+
selectedPropertyHistory,
|
|
503
|
+
selectedPropertyLatestUpdate,
|
|
504
|
+
telemetryHistoryQuery,
|
|
505
|
+
])
|
|
506
|
+
|
|
507
|
+
const actions = useMemo(() => {
|
|
508
|
+
const entries = Object.entries(
|
|
509
|
+
(object?.actions as Record<string, ObjectAction> | undefined) || {}
|
|
510
|
+
)
|
|
511
|
+
const featured: Array<{
|
|
512
|
+
actionId: string
|
|
513
|
+
action: ObjectAction
|
|
514
|
+
presentation: ActionPresentation
|
|
515
|
+
}> = []
|
|
516
|
+
const regular: Array<{
|
|
517
|
+
actionId: string
|
|
518
|
+
action: ObjectAction
|
|
519
|
+
presentation: ActionPresentation
|
|
520
|
+
}> = []
|
|
521
|
+
for (const [actionId, action] of entries) {
|
|
522
|
+
const presentation = getActionPresentation(actionId)
|
|
523
|
+
if (presentation.featured) {
|
|
524
|
+
featured.push({ actionId, action, presentation })
|
|
525
|
+
} else {
|
|
526
|
+
regular.push({ actionId, action, presentation })
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return { featured, regular, total: entries.length }
|
|
530
|
+
}, [object?.actions])
|
|
531
|
+
|
|
532
|
+
const outgoing = useMemo(
|
|
533
|
+
() => relationships.filter((r) => r.source === objectId),
|
|
534
|
+
[relationships, objectId]
|
|
535
|
+
)
|
|
536
|
+
const incoming = useMemo(
|
|
537
|
+
() => relationships.filter((r) => r.target === objectId),
|
|
538
|
+
[relationships, objectId]
|
|
539
|
+
)
|
|
540
|
+
|
|
541
|
+
const usagePercent = object ? getUsagePercent(telemetryWithLive, object.class) : null
|
|
542
|
+
|
|
543
|
+
if (!object) {
|
|
544
|
+
return (
|
|
545
|
+
<PageFrame
|
|
546
|
+
icon={<LetterAvatar label={params.primaryId ?? "?"} size="lg" />}
|
|
547
|
+
title={objectQuery.error ? failure.title : (params.primaryId ?? "")}
|
|
548
|
+
>
|
|
549
|
+
{objectQuery.error ? (
|
|
550
|
+
<Panel>
|
|
551
|
+
<PanelEmpty
|
|
552
|
+
tone="error"
|
|
553
|
+
icon={Box}
|
|
554
|
+
title={failure.title}
|
|
555
|
+
description={failure.description}
|
|
556
|
+
/>
|
|
557
|
+
</Panel>
|
|
558
|
+
) : (
|
|
559
|
+
<div className="flex items-center justify-center py-20">
|
|
560
|
+
<LoadingState label="Loading object..." />
|
|
561
|
+
</div>
|
|
562
|
+
)}
|
|
563
|
+
</PageFrame>
|
|
564
|
+
)
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
const properties = (object.properties ?? {}) as Record<string, unknown>
|
|
568
|
+
const objectType = objectTypes?.find((type) => type.id === object.objectTypeId)
|
|
569
|
+
const displayName = object.name
|
|
570
|
+
|
|
571
|
+
return (
|
|
572
|
+
<PageFrame
|
|
573
|
+
icon={<LetterAvatar label={displayName} size="lg" />}
|
|
574
|
+
title={displayName}
|
|
575
|
+
meta={
|
|
576
|
+
<>
|
|
577
|
+
{typesOpen ? (
|
|
578
|
+
<Link
|
|
579
|
+
to={objectTypeHref(object.objectTypeId)}
|
|
580
|
+
className="text-foreground underline-offset-2 hover:underline"
|
|
581
|
+
>
|
|
582
|
+
{humanizeIdentifier(object.class)}
|
|
583
|
+
</Link>
|
|
584
|
+
) : (
|
|
585
|
+
<span className="text-foreground">{humanizeIdentifier(object.class)}</span>
|
|
586
|
+
)}
|
|
587
|
+
<span aria-hidden="true" className="text-border">
|
|
588
|
+
·
|
|
589
|
+
</span>
|
|
590
|
+
<code className="font-mono text-xs">{object.primaryId}</code>
|
|
591
|
+
{object.updatedAt ? (
|
|
592
|
+
<>
|
|
593
|
+
<span aria-hidden="true" className="text-border">
|
|
594
|
+
·
|
|
595
|
+
</span>
|
|
596
|
+
<span>Updated {formatRelativeTime(object.updatedAt)}</span>
|
|
597
|
+
</>
|
|
598
|
+
) : null}
|
|
599
|
+
</>
|
|
600
|
+
}
|
|
601
|
+
>
|
|
602
|
+
{usagePercent !== null ? (
|
|
603
|
+
<div className="-mt-4 flex max-w-xs items-center gap-3">
|
|
604
|
+
<UsageBar value={usagePercent} size="sm" />
|
|
605
|
+
<span className="text-sm font-semibold tabular-nums text-foreground">
|
|
606
|
+
{usagePercent.toFixed(0)}%
|
|
607
|
+
</span>
|
|
608
|
+
</div>
|
|
609
|
+
) : null}
|
|
610
|
+
|
|
611
|
+
{Object.keys(telemetryWithLive).length > 0 ? (
|
|
612
|
+
<Section title="Telemetries" count={Object.keys(telemetryWithLive).length}>
|
|
613
|
+
<TelemetryGrid
|
|
614
|
+
telemetry={telemetryWithLive}
|
|
615
|
+
selectedPropertyId={selectedPropertyId}
|
|
616
|
+
onSelectProperty={(propertyId) => {
|
|
617
|
+
setTrendDismissed(false)
|
|
618
|
+
setSelectedPropertyId(propertyId)
|
|
619
|
+
}}
|
|
620
|
+
latestUpdates={latestTelemetryUpdates}
|
|
621
|
+
hideSingleGroupHeader
|
|
622
|
+
/>
|
|
623
|
+
</Section>
|
|
624
|
+
) : null}
|
|
625
|
+
|
|
626
|
+
{selectedPropertyId ? (
|
|
627
|
+
<Section title="Trend">
|
|
628
|
+
<div className="space-y-3">
|
|
629
|
+
<div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
|
|
630
|
+
<ToggleGroup
|
|
631
|
+
type="single"
|
|
632
|
+
value={telemetryRange}
|
|
633
|
+
onValueChange={(next) => {
|
|
634
|
+
if (next) setTelemetryRange(next as TelemetryRangeValue)
|
|
635
|
+
}}
|
|
636
|
+
variant="outline"
|
|
637
|
+
size="sm"
|
|
638
|
+
className="flex-wrap"
|
|
639
|
+
>
|
|
640
|
+
{telemetryRanges.map((range) => (
|
|
641
|
+
<ToggleGroupItem key={range.value} value={range.value}>
|
|
642
|
+
{range.label}
|
|
643
|
+
</ToggleGroupItem>
|
|
644
|
+
))}
|
|
645
|
+
</ToggleGroup>
|
|
646
|
+
{telemetryRange === "custom" ? (
|
|
647
|
+
<div className="grid gap-2 sm:grid-cols-2">
|
|
648
|
+
<TelemetryDatePicker
|
|
649
|
+
label="From"
|
|
650
|
+
boundary="start"
|
|
651
|
+
value={customFrom}
|
|
652
|
+
onChange={setCustomFrom}
|
|
653
|
+
/>
|
|
654
|
+
<TelemetryDatePicker
|
|
655
|
+
label="To"
|
|
656
|
+
boundary="end"
|
|
657
|
+
value={customTo}
|
|
658
|
+
onChange={setCustomTo}
|
|
659
|
+
/>
|
|
660
|
+
</div>
|
|
661
|
+
) : null}
|
|
662
|
+
</div>
|
|
663
|
+
{selectedPropertyIsNumeric ? (
|
|
664
|
+
<Suspense fallback={<LoadingState label="Drawing the chart..." />}>
|
|
665
|
+
<TelemetryChart
|
|
666
|
+
objectId={object.id}
|
|
667
|
+
propertyId={selectedPropertyId}
|
|
668
|
+
projectName={projectName}
|
|
669
|
+
propertyLabel={selectedPropertyLabel}
|
|
670
|
+
rangeLabel={telemetryRangeLabelText}
|
|
671
|
+
historyQuery={telemetryHistoryQuery}
|
|
672
|
+
historyEnabled={telemetryHistoryEnabled}
|
|
673
|
+
objectDisplayName={displayName}
|
|
674
|
+
unit={selectedPropertyUnit}
|
|
675
|
+
latestUpdate={selectedPropertyLatestUpdate}
|
|
676
|
+
onClose={() => {
|
|
677
|
+
setTrendDismissed(true)
|
|
678
|
+
setSelectedPropertyId(null)
|
|
679
|
+
}}
|
|
680
|
+
/>
|
|
681
|
+
</Suspense>
|
|
682
|
+
) : (
|
|
683
|
+
<Card className="overflow-hidden p-0">
|
|
684
|
+
<div className="space-y-3 border-b border-border px-4 py-4">
|
|
685
|
+
<div className="min-w-0">
|
|
686
|
+
<h3 className="text-[14px] font-semibold tracking-tight text-foreground sm:text-[15px]">
|
|
687
|
+
{selectedPropertyLabel}
|
|
688
|
+
</h3>
|
|
689
|
+
<p className="mt-0.5 text-[11px] text-muted-foreground">
|
|
690
|
+
{displayName} / {telemetryRangeLabelText}
|
|
691
|
+
</p>
|
|
692
|
+
</div>
|
|
693
|
+
{selectedPropertyHistoryLoading ? (
|
|
694
|
+
<LoadingState />
|
|
695
|
+
) : nonNumericHistory?.current ? (
|
|
696
|
+
<div className="flex flex-wrap items-center justify-between gap-4">
|
|
697
|
+
<TelemetryValue
|
|
698
|
+
value={nonNumericHistory.current.value}
|
|
699
|
+
quality={nonNumericHistory.current.quality}
|
|
700
|
+
size="lg"
|
|
701
|
+
/>
|
|
702
|
+
<div className="flex flex-wrap items-center gap-3 text-xs text-muted-foreground">
|
|
703
|
+
<span>
|
|
704
|
+
Changed {formatRelativeTime(nonNumericHistory.current.timestamp)}
|
|
705
|
+
</span>
|
|
706
|
+
<span className="text-border">|</span>
|
|
707
|
+
<span>
|
|
708
|
+
{nonNumericHistory.sampleCount} samples in {telemetryRangeSampleLabel}
|
|
709
|
+
</span>
|
|
710
|
+
</div>
|
|
711
|
+
</div>
|
|
712
|
+
) : (
|
|
713
|
+
<p className="text-sm text-muted-foreground">No history yet.</p>
|
|
714
|
+
)}
|
|
715
|
+
</div>
|
|
716
|
+
|
|
717
|
+
{selectedPropertyHistoryError ? (
|
|
718
|
+
<div className="px-4 py-3">
|
|
719
|
+
<p className="text-sm text-red-500">
|
|
720
|
+
Failed to load history: {String(selectedPropertyHistoryError)}
|
|
721
|
+
</p>
|
|
722
|
+
</div>
|
|
723
|
+
) : nonNumericHistory?.transitions.length ? (
|
|
724
|
+
<div className="max-h-56 divide-y divide-border/40 overflow-auto">
|
|
725
|
+
{nonNumericHistory.transitions.map((transition) => (
|
|
726
|
+
<div
|
|
727
|
+
key={`${transition.timestamp}:${String(transition.value)}`}
|
|
728
|
+
className="flex items-center justify-between gap-3 px-4 py-2.5"
|
|
729
|
+
>
|
|
730
|
+
<div className="flex min-w-0 items-center gap-2">
|
|
731
|
+
<span
|
|
732
|
+
className={`h-2 w-2 shrink-0 rounded-full ${qualityDotClass(
|
|
733
|
+
transition.quality
|
|
734
|
+
)}`}
|
|
735
|
+
/>
|
|
736
|
+
<span className="truncate text-sm font-medium text-foreground">
|
|
737
|
+
{formatHistoryValue(transition.value)}
|
|
738
|
+
</span>
|
|
739
|
+
</div>
|
|
740
|
+
<span className="shrink-0 text-xs tabular-nums text-muted-foreground">
|
|
741
|
+
{new Date(transition.timestamp).toLocaleTimeString([], {
|
|
742
|
+
hour: "2-digit",
|
|
743
|
+
minute: "2-digit",
|
|
744
|
+
second: "2-digit",
|
|
745
|
+
})}
|
|
746
|
+
</span>
|
|
747
|
+
</div>
|
|
748
|
+
))}
|
|
749
|
+
</div>
|
|
750
|
+
) : (
|
|
751
|
+
<div className="px-4 py-3">
|
|
752
|
+
<p className="text-sm text-muted-foreground">No state transitions recorded.</p>
|
|
753
|
+
</div>
|
|
754
|
+
)}
|
|
755
|
+
|
|
756
|
+
{nonNumericHistory && nonNumericHistory.frequencies.length > 1 ? (
|
|
757
|
+
<div className="border-t border-border px-4 py-3">
|
|
758
|
+
<div className="flex items-center gap-3">
|
|
759
|
+
<span className="shrink-0 text-[11px] uppercase tracking-wider text-muted-foreground">
|
|
760
|
+
Distribution
|
|
761
|
+
</span>
|
|
762
|
+
<div className="flex flex-wrap gap-1.5">
|
|
763
|
+
{nonNumericHistory.frequencies.map((entry) => (
|
|
764
|
+
<span
|
|
765
|
+
key={entry.value}
|
|
766
|
+
className="inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-foreground"
|
|
767
|
+
>
|
|
768
|
+
<span className="font-medium">{entry.value}</span>
|
|
769
|
+
<span className="text-muted-foreground">x{entry.count}</span>
|
|
770
|
+
</span>
|
|
771
|
+
))}
|
|
772
|
+
</div>
|
|
773
|
+
</div>
|
|
774
|
+
</div>
|
|
775
|
+
) : null}
|
|
776
|
+
</Card>
|
|
777
|
+
)}
|
|
778
|
+
</div>
|
|
779
|
+
</Section>
|
|
780
|
+
) : null}
|
|
781
|
+
|
|
782
|
+
{Object.keys(properties).length > 0 ? (
|
|
783
|
+
<Section title="Details">
|
|
784
|
+
{/* A property the type does not declare, or a type that could not be read, has no
|
|
785
|
+
schema and draws as an undescribed value. */}
|
|
786
|
+
<ValuePanel
|
|
787
|
+
title="Properties"
|
|
788
|
+
value={properties}
|
|
789
|
+
schema={
|
|
790
|
+
objectType
|
|
791
|
+
? valueSchema(
|
|
792
|
+
fieldRecordSchema(
|
|
793
|
+
Object.fromEntries(
|
|
794
|
+
objectType.properties.map((property) => [property.id, property.schema])
|
|
795
|
+
)
|
|
796
|
+
),
|
|
797
|
+
valueTypes
|
|
798
|
+
)
|
|
799
|
+
: undefined
|
|
800
|
+
}
|
|
801
|
+
labels={
|
|
802
|
+
objectType
|
|
803
|
+
? Object.fromEntries(
|
|
804
|
+
objectType.properties.map((property) => [
|
|
805
|
+
property.id,
|
|
806
|
+
humanizeIdentifier(property.name || property.id),
|
|
807
|
+
])
|
|
808
|
+
)
|
|
809
|
+
: undefined
|
|
810
|
+
}
|
|
811
|
+
fileLinks={objectFileLinks(object.objectTypeId, object.primaryId)}
|
|
812
|
+
/>
|
|
813
|
+
</Section>
|
|
814
|
+
) : null}
|
|
815
|
+
|
|
816
|
+
{outgoing.length > 0 || incoming.length > 0 ? (
|
|
817
|
+
<Section title="Links" count={outgoing.length + incoming.length}>
|
|
818
|
+
<LinksList outgoing={outgoing} incoming={incoming} objectLookup={objectLookup} />
|
|
819
|
+
</Section>
|
|
820
|
+
) : null}
|
|
821
|
+
|
|
822
|
+
{actions.total > 0 ? (
|
|
823
|
+
<Section title="Actions" count={actions.total}>
|
|
824
|
+
<div className="space-y-3">
|
|
825
|
+
{actions.featured.length > 0 ? (
|
|
826
|
+
<div className="grid gap-2 sm:grid-cols-2 lg:grid-cols-3">
|
|
827
|
+
{actions.featured.map(({ actionId, action, presentation }) => (
|
|
828
|
+
<ActionButton
|
|
829
|
+
key={actionId}
|
|
830
|
+
objectId={object.id}
|
|
831
|
+
actionId={actionId}
|
|
832
|
+
action={action}
|
|
833
|
+
tone={presentation.tone}
|
|
834
|
+
size="prominent"
|
|
835
|
+
requireConfirm={presentation.requireConfirm}
|
|
836
|
+
/>
|
|
837
|
+
))}
|
|
838
|
+
</div>
|
|
839
|
+
) : null}
|
|
840
|
+
{actions.regular.length > 0 ? (
|
|
841
|
+
<div className="flex flex-wrap gap-2">
|
|
842
|
+
{actions.regular.map(({ actionId, action, presentation }) => (
|
|
843
|
+
<ActionButton
|
|
844
|
+
key={actionId}
|
|
845
|
+
objectId={object.id}
|
|
846
|
+
actionId={actionId}
|
|
847
|
+
action={action}
|
|
848
|
+
tone={presentation.tone}
|
|
849
|
+
requireConfirm={presentation.requireConfirm}
|
|
850
|
+
/>
|
|
851
|
+
))}
|
|
852
|
+
</div>
|
|
853
|
+
) : null}
|
|
854
|
+
</div>
|
|
855
|
+
</Section>
|
|
856
|
+
) : null}
|
|
857
|
+
</PageFrame>
|
|
858
|
+
)
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
function TelemetryDatePicker({
|
|
862
|
+
label,
|
|
863
|
+
boundary,
|
|
864
|
+
value,
|
|
865
|
+
onChange,
|
|
866
|
+
}: {
|
|
867
|
+
label: string
|
|
868
|
+
boundary: "start" | "end"
|
|
869
|
+
value: string
|
|
870
|
+
onChange: (value: string) => void
|
|
871
|
+
}) {
|
|
872
|
+
const selectedDate = parseTimestamp(value) ?? new Date()
|
|
873
|
+
|
|
874
|
+
return (
|
|
875
|
+
<Popover>
|
|
876
|
+
<PopoverTrigger asChild>
|
|
877
|
+
<Button
|
|
878
|
+
type="button"
|
|
879
|
+
variant="outline"
|
|
880
|
+
size="sm"
|
|
881
|
+
className="h-8 justify-start gap-2 px-2.5 text-left font-normal sm:w-56"
|
|
882
|
+
>
|
|
883
|
+
<CalendarIcon className="h-3.5 w-3.5 text-muted-foreground" />
|
|
884
|
+
<span className="min-w-0 truncate">
|
|
885
|
+
{label} {formatCustomDate(value)}
|
|
886
|
+
</span>
|
|
887
|
+
</Button>
|
|
888
|
+
</PopoverTrigger>
|
|
889
|
+
<PopoverContent align="end" className="w-auto p-0">
|
|
890
|
+
<Calendar
|
|
891
|
+
mode="single"
|
|
892
|
+
selected={selectedDate}
|
|
893
|
+
onSelect={(day) => {
|
|
894
|
+
if (day) onChange(dateBoundaryIso(day, boundary))
|
|
895
|
+
}}
|
|
896
|
+
/>
|
|
897
|
+
</PopoverContent>
|
|
898
|
+
</Popover>
|
|
899
|
+
)
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
function LinksList({
|
|
903
|
+
outgoing,
|
|
904
|
+
incoming,
|
|
905
|
+
objectLookup,
|
|
906
|
+
}: {
|
|
907
|
+
outgoing: RelationshipEdge[]
|
|
908
|
+
incoming: RelationshipEdge[]
|
|
909
|
+
objectLookup: Readonly<Record<string, RelatedObject>>
|
|
910
|
+
}) {
|
|
911
|
+
const rows = useMemo(() => {
|
|
912
|
+
const linkRows = [
|
|
913
|
+
...outgoing.map((edge) => ({
|
|
914
|
+
key: `out:${edge.type}:${edge.target}`,
|
|
915
|
+
direction: "to" as const,
|
|
916
|
+
edge,
|
|
917
|
+
relatedId: edge.target,
|
|
918
|
+
})),
|
|
919
|
+
...incoming.map((edge) => ({
|
|
920
|
+
key: `in:${edge.type}:${edge.source}`,
|
|
921
|
+
direction: "from" as const,
|
|
922
|
+
edge,
|
|
923
|
+
relatedId: edge.source,
|
|
924
|
+
})),
|
|
925
|
+
]
|
|
926
|
+
|
|
927
|
+
return linkRows.sort((a, b) => {
|
|
928
|
+
if (a.direction !== b.direction) return a.direction === "to" ? -1 : 1
|
|
929
|
+
const typeCompare = a.edge.type.localeCompare(b.edge.type)
|
|
930
|
+
if (typeCompare !== 0) return typeCompare
|
|
931
|
+
const aName = objectLookup[a.relatedId]?.name ?? a.relatedId
|
|
932
|
+
const bName = objectLookup[b.relatedId]?.name ?? b.relatedId
|
|
933
|
+
return aName.localeCompare(bName)
|
|
934
|
+
})
|
|
935
|
+
}, [incoming, objectLookup, outgoing])
|
|
936
|
+
|
|
937
|
+
return (
|
|
938
|
+
<Card className="p-4 sm:p-5">
|
|
939
|
+
<dl className="grid grid-cols-[max-content_minmax(0,1fr)] items-baseline gap-x-6 gap-y-2.5 text-sm">
|
|
940
|
+
{rows.map((row) => {
|
|
941
|
+
const related = objectLookup[row.relatedId]
|
|
942
|
+
return (
|
|
943
|
+
<Fragment key={row.key}>
|
|
944
|
+
<dt className="flex items-baseline gap-1.5 text-xs text-muted-foreground">
|
|
945
|
+
<span>{humanizeIdentifier(row.edge.type)}</span>
|
|
946
|
+
<Badge
|
|
947
|
+
variant="secondary"
|
|
948
|
+
className="h-4 border-0 bg-muted px-1.5 text-[9px] font-medium text-muted-foreground"
|
|
949
|
+
>
|
|
950
|
+
{row.direction}
|
|
951
|
+
</Badge>
|
|
952
|
+
</dt>
|
|
953
|
+
<dd className="min-w-0 text-foreground">
|
|
954
|
+
<RelatedObjectLink objectId={row.relatedId} related={related} />
|
|
955
|
+
</dd>
|
|
956
|
+
</Fragment>
|
|
957
|
+
)
|
|
958
|
+
})}
|
|
959
|
+
</dl>
|
|
960
|
+
</Card>
|
|
961
|
+
)
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
function RelatedObjectLink({
|
|
965
|
+
objectId,
|
|
966
|
+
related,
|
|
967
|
+
}: {
|
|
968
|
+
objectId: string
|
|
969
|
+
related: RelatedObject | undefined
|
|
970
|
+
}) {
|
|
971
|
+
const ref = decodeObjectId(objectId)
|
|
972
|
+
return (
|
|
973
|
+
<Link
|
|
974
|
+
to={ref ? objectHref(ref.objectTypeId, ref.primaryId) : "#"}
|
|
975
|
+
className="inline-flex items-baseline gap-1.5 underline-offset-2 hover:underline"
|
|
976
|
+
title={objectId}
|
|
977
|
+
>
|
|
978
|
+
<span>{related?.name ?? ref?.primaryId ?? objectId}</span>
|
|
979
|
+
{ref ? (
|
|
980
|
+
<span className="text-xs text-muted-foreground">
|
|
981
|
+
{humanizeIdentifier(ref.objectTypeId)}
|
|
982
|
+
</span>
|
|
983
|
+
) : null}
|
|
984
|
+
</Link>
|
|
985
|
+
)
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
interface RelatedObject {
|
|
989
|
+
readonly name: string
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
const noRelationships: RelationshipEdge[] = []
|
|
993
|
+
const noSchemas: readonly unknown[] = []
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* The objects this one links to and from, by composite id, named as everywhere else. One query
|
|
997
|
+
* reads them all, whatever their types.
|
|
998
|
+
*/
|
|
999
|
+
function useRelatedObjects(
|
|
1000
|
+
relationships: readonly RelationshipEdge[],
|
|
1001
|
+
objectTypes: ListObjectTypesResponse = []
|
|
1002
|
+
): Readonly<Record<string, RelatedObject>> {
|
|
1003
|
+
const refs = useMemo(
|
|
1004
|
+
() =>
|
|
1005
|
+
[...new Set(relationships.flatMap((edge) => [edge.source, edge.target]))].flatMap((id) => {
|
|
1006
|
+
const ref = decodeObjectId(id)
|
|
1007
|
+
return ref ? [ref] : []
|
|
1008
|
+
}),
|
|
1009
|
+
[relationships]
|
|
1010
|
+
)
|
|
1011
|
+
const related = useQuery({
|
|
1012
|
+
// Under the object queries' key, so the live updates that refresh them refresh these names.
|
|
1013
|
+
queryKey: [...objectQueryKeys.all(), "related", refs],
|
|
1014
|
+
queryFn: async () =>
|
|
1015
|
+
(await queryObjects({ body: { query: { kind: "refs", refs } }, throwOnError: true })).data,
|
|
1016
|
+
enabled: refs.length > 0,
|
|
1017
|
+
retry: false,
|
|
1018
|
+
}).data
|
|
1019
|
+
return useMemo(() => {
|
|
1020
|
+
const lookup: Record<string, RelatedObject> = {}
|
|
1021
|
+
for (const row of related?.objects ?? []) {
|
|
1022
|
+
const type = objectTypes.find((candidate) => candidate.id === row.objectTypeId)
|
|
1023
|
+
lookup[encodeObjectId(row.objectTypeId, row.primaryId)] = {
|
|
1024
|
+
name: toObjectSummary(row, type).name,
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
return lookup
|
|
1028
|
+
}, [related, objectTypes])
|
|
1029
|
+
}
|