@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,769 @@
|
|
|
1
|
+
// Interpret the single `bash` tool into a human-friendly view. Sixb interactions go through a
|
|
2
|
+
// stable CLI command tree, so the UI only needs to tokenize one command and identify its group and
|
|
3
|
+
// operation. Plain shell commands and the initial skill read keep neutral fallbacks.
|
|
4
|
+
|
|
5
|
+
import { type AgentMessages, en } from "../i18n/en"
|
|
6
|
+
import { commandInvocation, executableName, lexShellCommand, type ShellSegment } from "./shell"
|
|
7
|
+
|
|
8
|
+
/** The bash tool input as authored by the agent. */
|
|
9
|
+
export interface BashInput {
|
|
10
|
+
readonly command: string
|
|
11
|
+
readonly cwd?: string
|
|
12
|
+
readonly timeoutMs?: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const CLI_COMMANDS = {
|
|
16
|
+
project: ["show"],
|
|
17
|
+
ontology: ["list", "get"],
|
|
18
|
+
objects: ["inspect", "list", "get", "search", "query", "count", "exists", "facets", "links"],
|
|
19
|
+
telemetry: ["latest", "history", "query"],
|
|
20
|
+
actions: ["list", "get", "request"],
|
|
21
|
+
"action-runs": ["list", "get"],
|
|
22
|
+
files: ["upload", "download"],
|
|
23
|
+
workflows: ["list", "get", "start"],
|
|
24
|
+
"workflow-runs": ["list", "get"],
|
|
25
|
+
api: ["get", "post"],
|
|
26
|
+
} as const
|
|
27
|
+
|
|
28
|
+
type CliGroup = keyof typeof CLI_COMMANDS
|
|
29
|
+
type CliCommandName = {
|
|
30
|
+
[Group in CliGroup]: `${Group}.${(typeof CLI_COMMANDS)[Group][number]}`
|
|
31
|
+
}[CliGroup]
|
|
32
|
+
|
|
33
|
+
type SixbCommandName =
|
|
34
|
+
| "help"
|
|
35
|
+
| "version"
|
|
36
|
+
| "doctor"
|
|
37
|
+
| "context"
|
|
38
|
+
| "objects.query-example"
|
|
39
|
+
| CliCommandName
|
|
40
|
+
| "unknown"
|
|
41
|
+
|
|
42
|
+
type AtomicBashIntent =
|
|
43
|
+
| {
|
|
44
|
+
readonly kind: "sixb"
|
|
45
|
+
readonly command: SixbCommandName
|
|
46
|
+
/** Arguments after the recognized command path. Quotes have been removed. */
|
|
47
|
+
readonly args: readonly string[]
|
|
48
|
+
}
|
|
49
|
+
| { readonly kind: "read-skill"; readonly skillName?: string; readonly reference?: string }
|
|
50
|
+
| { readonly kind: "generic"; readonly command: string }
|
|
51
|
+
|
|
52
|
+
/** What the agent was trying to do, derived from the command string. */
|
|
53
|
+
export type BashIntent =
|
|
54
|
+
| AtomicBashIntent
|
|
55
|
+
| {
|
|
56
|
+
readonly kind: "compound"
|
|
57
|
+
/** The most meaningful segment, used only to present this work in product language. */
|
|
58
|
+
readonly primary: AtomicBashIntent
|
|
59
|
+
readonly stepCount: number
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Parsed bash output, with stdout JSON-decoded when it looks like JSON. */
|
|
63
|
+
export interface ParsedBashOutput {
|
|
64
|
+
readonly ok: boolean
|
|
65
|
+
readonly exitCode: number
|
|
66
|
+
readonly stdout: string
|
|
67
|
+
readonly stderr: string
|
|
68
|
+
readonly durationMs: number
|
|
69
|
+
readonly truncated: boolean
|
|
70
|
+
/** Decoded stdout when it parsed as JSON, otherwise undefined. */
|
|
71
|
+
readonly json: unknown
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// --- Input/output coercion -------------------------------------------------
|
|
75
|
+
|
|
76
|
+
export function coerceBashInput(input: unknown): BashInput | null {
|
|
77
|
+
if (!isRecord(input) || typeof input.command !== "string") return null
|
|
78
|
+
return {
|
|
79
|
+
command: input.command,
|
|
80
|
+
cwd: typeof input.cwd === "string" ? input.cwd : undefined,
|
|
81
|
+
timeoutMs: typeof input.timeoutMs === "number" ? input.timeoutMs : undefined,
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function coerceBashOutput(output: unknown): ParsedBashOutput | null {
|
|
86
|
+
if (!isRecord(output)) return null
|
|
87
|
+
const stdout = typeof output.stdout === "string" ? output.stdout : ""
|
|
88
|
+
const stderr = typeof output.stderr === "string" ? output.stderr : ""
|
|
89
|
+
const exitCode = typeof output.exitCode === "number" ? output.exitCode : 0
|
|
90
|
+
return {
|
|
91
|
+
ok: exitCode === 0,
|
|
92
|
+
exitCode,
|
|
93
|
+
stdout,
|
|
94
|
+
stderr,
|
|
95
|
+
durationMs: typeof output.durationMs === "number" ? output.durationMs : 0,
|
|
96
|
+
truncated: output.stdoutTruncated === true || output.stderrTruncated === true,
|
|
97
|
+
json: exitCode === 0 ? tryParseJson(stdout) : undefined,
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// --- Command classification ------------------------------------------------
|
|
102
|
+
|
|
103
|
+
export function classifyCommand(command: string): BashIntent {
|
|
104
|
+
const segments = lexShellCommand(command)
|
|
105
|
+
if (!segments) return { kind: "generic", command: command.trim() }
|
|
106
|
+
if (segments.length > 1) {
|
|
107
|
+
return {
|
|
108
|
+
kind: "compound",
|
|
109
|
+
primary: selectCompoundPrimary(segments),
|
|
110
|
+
stepCount: segments.length,
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return classifyAtomicCommand(segments[0])
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function classifyAtomicCommand(segment: ShellSegment | undefined): AtomicBashIntent {
|
|
117
|
+
if (!segment) return { kind: "generic", command: "" }
|
|
118
|
+
const invocation = commandInvocation(segment.tokens)
|
|
119
|
+
const sixb = classifySixbCommand(invocation)
|
|
120
|
+
if (sixb) return sixb
|
|
121
|
+
const skill = classifySkillRead(segment, invocation)
|
|
122
|
+
if (skill) return skill
|
|
123
|
+
return { kind: "generic", command: segment.command }
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function selectCompoundPrimary(segments: readonly ShellSegment[]): AtomicBashIntent {
|
|
127
|
+
const fallbackIndex = segments.findIndex((segment) => segment.operatorBefore === "||")
|
|
128
|
+
const primaryBranch = fallbackIndex === -1 ? segments : segments.slice(0, fallbackIndex)
|
|
129
|
+
const intents = primaryBranch.map((segment) => classifyAtomicCommand(segment))
|
|
130
|
+
let selected = intents[0] ?? classifyAtomicCommand(segments[0])
|
|
131
|
+
let selectedPriority = compoundIntentPriority(selected)
|
|
132
|
+
|
|
133
|
+
for (const intent of intents.slice(1)) {
|
|
134
|
+
const priority = compoundIntentPriority(intent)
|
|
135
|
+
// Prefer the final operation when two segments are equally meaningful.
|
|
136
|
+
if (priority >= selectedPriority) {
|
|
137
|
+
selected = intent
|
|
138
|
+
selectedPriority = priority
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return selected
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function compoundIntentPriority(intent: AtomicBashIntent): number {
|
|
145
|
+
if (intent.kind === "sixb" || intent.kind === "read-skill") return 3
|
|
146
|
+
const category = genericCommandCategory(intent.command)
|
|
147
|
+
if (category.kind === "unknown") return isShellPlumbing(intent.command) ? -1 : 0
|
|
148
|
+
if (
|
|
149
|
+
category.kind === "inspect-files" ||
|
|
150
|
+
category.kind === "workspace-location" ||
|
|
151
|
+
category.kind === "read-file"
|
|
152
|
+
) {
|
|
153
|
+
return 1
|
|
154
|
+
}
|
|
155
|
+
return 2
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function isShellPlumbing(command: string): boolean {
|
|
159
|
+
const executable = directCommandExecutable(command)
|
|
160
|
+
return Boolean(
|
|
161
|
+
executable &&
|
|
162
|
+
["cd", "export", "set", "unset", "source", ".", "env", "jq", "true", "false"].includes(
|
|
163
|
+
executable
|
|
164
|
+
)
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function classifySixbCommand(
|
|
169
|
+
tokens: readonly string[]
|
|
170
|
+
): Extract<BashIntent, { kind: "sixb" }> | null {
|
|
171
|
+
if (executableName(tokens[0]) !== "sixb") return null
|
|
172
|
+
|
|
173
|
+
const cliArgs = tokens.slice(1)
|
|
174
|
+
if (cliArgs.length === 0 || isHelpToken(cliArgs[0])) {
|
|
175
|
+
return { kind: "sixb", command: "help", args: [] }
|
|
176
|
+
}
|
|
177
|
+
if (isHelpToken(cliArgs[1])) return { kind: "sixb", command: "help", args: [cliArgs[0]] }
|
|
178
|
+
if (isHelpToken(cliArgs[2])) {
|
|
179
|
+
return { kind: "sixb", command: "help", args: cliArgs.slice(0, 2) }
|
|
180
|
+
}
|
|
181
|
+
if (cliArgs[0] === "version" || cliArgs[0] === "--version") {
|
|
182
|
+
return { kind: "sixb", command: "version", args: cliArgs.slice(1) }
|
|
183
|
+
}
|
|
184
|
+
if (cliArgs[0] === "doctor" || cliArgs[0] === "context") {
|
|
185
|
+
return { kind: "sixb", command: cliArgs[0], args: cliArgs.slice(1) }
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const [group, operation, ...args] = cliArgs
|
|
189
|
+
if (!group || !operation) {
|
|
190
|
+
return { kind: "sixb", command: "help", args: group ? [group] : [] }
|
|
191
|
+
}
|
|
192
|
+
if (!isCliGroup(group) || !isCliOperation(group, operation)) {
|
|
193
|
+
return { kind: "sixb", command: "unknown", args: cliArgs }
|
|
194
|
+
}
|
|
195
|
+
if (group === "objects" && operation === "query" && optionValue(args, "--example")) {
|
|
196
|
+
return { kind: "sixb", command: "objects.query-example", args }
|
|
197
|
+
}
|
|
198
|
+
return { kind: "sixb", command: `${group}.${operation}` as CliCommandName, args }
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function isHelpToken(value: string | undefined): boolean {
|
|
202
|
+
return value === "--help" || value === "-h" || value === "help"
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function isCliGroup(value: string): value is CliGroup {
|
|
206
|
+
return Object.hasOwn(CLI_COMMANDS, value)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function isCliOperation<Group extends CliGroup>(
|
|
210
|
+
group: Group,
|
|
211
|
+
value: string
|
|
212
|
+
): value is (typeof CLI_COMMANDS)[Group][number] {
|
|
213
|
+
return (CLI_COMMANDS[group] as readonly string[]).includes(value)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const SKILL_READ_COMMANDS = new Set(["cat", "less", "bat", "head", "tail", "sed", "nl"])
|
|
217
|
+
|
|
218
|
+
function classifySkillRead(
|
|
219
|
+
segment: ShellSegment,
|
|
220
|
+
invocation: readonly string[]
|
|
221
|
+
): Extract<AtomicBashIntent, { kind: "read-skill" }> | null {
|
|
222
|
+
const looksLikeRead = SKILL_READ_COMMANDS.has(executableName(invocation[0]) ?? "")
|
|
223
|
+
const command = segment.command
|
|
224
|
+
const touchesSkill =
|
|
225
|
+
command.includes("SKILL.md") ||
|
|
226
|
+
command.includes("/skills/") ||
|
|
227
|
+
command.includes("SIXB_SKILLS_DIR") ||
|
|
228
|
+
command.includes("/references/")
|
|
229
|
+
if (!looksLikeRead || !touchesSkill) return null
|
|
230
|
+
|
|
231
|
+
const skillName = command.match(/(?:skills|SKILLS_DIR)\/([A-Za-z0-9._-]+)/)?.[1]
|
|
232
|
+
const reference = command.match(/references\/([A-Za-z0-9._-]+)/)?.[1]
|
|
233
|
+
return { kind: "read-skill", skillName, reference }
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// --- Friendly description --------------------------------------------------
|
|
237
|
+
|
|
238
|
+
export type BashIcon =
|
|
239
|
+
| "ontology"
|
|
240
|
+
| "objects"
|
|
241
|
+
| "object"
|
|
242
|
+
| "count"
|
|
243
|
+
| "facets"
|
|
244
|
+
| "telemetry"
|
|
245
|
+
| "actions"
|
|
246
|
+
| "project"
|
|
247
|
+
| "skill"
|
|
248
|
+
| "terminal"
|
|
249
|
+
|
|
250
|
+
interface BashDescription {
|
|
251
|
+
readonly icon: BashIcon
|
|
252
|
+
/** Past-tense headline once the command has run, e.g. "Explored the ontology". */
|
|
253
|
+
readonly title: string
|
|
254
|
+
/** Present-progressive headline while running, e.g. "Exploring the ontology". */
|
|
255
|
+
readonly runningTitle: string
|
|
256
|
+
/** Optional secondary line derived from the result, e.g. "8 object types". */
|
|
257
|
+
readonly detail?: string
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** A past-tense and a progressive headline, as the catalogs pair them. */
|
|
261
|
+
interface Headline<TArgs extends unknown[] = []> {
|
|
262
|
+
readonly title: string | ((...args: TArgs) => string)
|
|
263
|
+
readonly running: string | ((...args: TArgs) => string)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function describeBash(
|
|
267
|
+
intent: BashIntent,
|
|
268
|
+
parsed: ParsedBashOutput | null,
|
|
269
|
+
messages: AgentMessages = en
|
|
270
|
+
): BashDescription {
|
|
271
|
+
const m = messages.bash
|
|
272
|
+
if (intent.kind === "compound") {
|
|
273
|
+
const primary = describeBash(intent.primary, parsed, messages)
|
|
274
|
+
if (primary.runningTitle !== m.command.running) return primary
|
|
275
|
+
return icon("terminal", m.steps, intent.stepCount)
|
|
276
|
+
}
|
|
277
|
+
if (intent.kind === "sixb") return describeSixb(intent, parsed, messages)
|
|
278
|
+
if (intent.kind === "read-skill") {
|
|
279
|
+
if (intent.reference) return icon("skill", m.skillReference, referenceTitle(intent.reference))
|
|
280
|
+
if (intent.skillName) {
|
|
281
|
+
return icon("skill", m.skillGuide, humanize(intent.skillName.replace(/^sixb-/, "")))
|
|
282
|
+
}
|
|
283
|
+
return icon("skill", m.skill)
|
|
284
|
+
}
|
|
285
|
+
return describeGenericCommand(intent.command, m)
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
type GenericCommandCategory =
|
|
289
|
+
| { readonly kind: "write-file"; readonly fileKind: WrittenFileKind }
|
|
290
|
+
| {
|
|
291
|
+
readonly kind:
|
|
292
|
+
| "edit-files"
|
|
293
|
+
| "search-files"
|
|
294
|
+
| "run-tests"
|
|
295
|
+
| "create-folder"
|
|
296
|
+
| "copy-files"
|
|
297
|
+
| "move-files"
|
|
298
|
+
| "inspect-files"
|
|
299
|
+
| "workspace-location"
|
|
300
|
+
| "read-file"
|
|
301
|
+
| "unknown"
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function describeGenericCommand(command: string, m: AgentMessages["bash"]): BashDescription {
|
|
305
|
+
const category = genericCommandCategory(command)
|
|
306
|
+
switch (category.kind) {
|
|
307
|
+
case "write-file":
|
|
308
|
+
return icon("terminal", m.writeFile, m.fileKinds[category.fileKind])
|
|
309
|
+
case "edit-files":
|
|
310
|
+
return icon("terminal", m.editFiles)
|
|
311
|
+
case "search-files":
|
|
312
|
+
return icon("terminal", m.searchFiles)
|
|
313
|
+
case "run-tests":
|
|
314
|
+
return icon("terminal", m.runTests)
|
|
315
|
+
case "create-folder":
|
|
316
|
+
return icon("terminal", m.createFolder)
|
|
317
|
+
case "copy-files":
|
|
318
|
+
return icon("terminal", m.copyFiles)
|
|
319
|
+
case "move-files":
|
|
320
|
+
return icon("terminal", m.moveFiles)
|
|
321
|
+
case "inspect-files":
|
|
322
|
+
return icon("terminal", m.inspectFiles)
|
|
323
|
+
case "workspace-location":
|
|
324
|
+
return icon("terminal", m.workspaceLocation)
|
|
325
|
+
case "read-file":
|
|
326
|
+
return icon("terminal", m.readFile)
|
|
327
|
+
default:
|
|
328
|
+
return icon("terminal", m.command)
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function genericCommandCategory(command: string): GenericCommandCategory {
|
|
333
|
+
const firstLine = command.trim().split(/\r?\n/, 1)[0]?.trim() ?? ""
|
|
334
|
+
const segment = directCommandSegment(command)
|
|
335
|
+
const invocation = commandInvocation(segment?.tokens ?? [])
|
|
336
|
+
const fileKind = writtenFileKind(command, firstLine, segment, invocation)
|
|
337
|
+
if (fileKind) return { kind: "write-file", fileKind }
|
|
338
|
+
const executable = executableName(invocation[0]) ?? leadingExecutable(firstLine)
|
|
339
|
+
if (executable === "apply_patch") return { kind: "edit-files" }
|
|
340
|
+
if (executable === "rg" || executable === "grep") return { kind: "search-files" }
|
|
341
|
+
if (executable === "bun" && invocation[1] === "test") return { kind: "run-tests" }
|
|
342
|
+
if (executable === "mkdir") return { kind: "create-folder" }
|
|
343
|
+
if (executable === "cp") return { kind: "copy-files" }
|
|
344
|
+
if (executable === "mv") return { kind: "move-files" }
|
|
345
|
+
if (executable === "ls" || executable === "find") return { kind: "inspect-files" }
|
|
346
|
+
if (executable === "pwd") return { kind: "workspace-location" }
|
|
347
|
+
if (executable === "head" && headReadsFile(invocation)) return { kind: "read-file" }
|
|
348
|
+
return { kind: "unknown" }
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function headReadsFile(tokens: readonly string[]): boolean {
|
|
352
|
+
return tokens.slice(1).some((token) => !token.startsWith("-") && !/^\d+$/.test(token))
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function directCommandSegment(command: string): ShellSegment | undefined {
|
|
356
|
+
const segments = lexShellCommand(command)
|
|
357
|
+
return segments?.length === 1 ? segments[0] : undefined
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function directCommandExecutable(command: string): string | undefined {
|
|
361
|
+
const invocation = commandInvocation(directCommandSegment(command)?.tokens ?? [])
|
|
362
|
+
return executableName(invocation[0])
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function leadingExecutable(firstLine: string): string | undefined {
|
|
366
|
+
const match = firstLine.match(/^\s*(?:(?:[A-Za-z_][A-Za-z0-9_]*=[^\s]+)\s+)*([^\s;&|<>]+)/)
|
|
367
|
+
return executableName(match?.[1])
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
type WrittenFileKind = keyof AgentMessages["bash"]["fileKinds"]
|
|
371
|
+
|
|
372
|
+
function writtenFileKind(
|
|
373
|
+
command: string,
|
|
374
|
+
firstLine: string,
|
|
375
|
+
segment: ShellSegment | undefined,
|
|
376
|
+
invocation: readonly string[]
|
|
377
|
+
): WrittenFileKind | null {
|
|
378
|
+
const executable = executableName(invocation[0]) ?? leadingExecutable(firstLine)
|
|
379
|
+
if (!executable || !["cat", "tee", "printf", "echo"].includes(executable)) return null
|
|
380
|
+
|
|
381
|
+
const directTarget = segment?.outputRedirects?.at(-1)
|
|
382
|
+
const heredocTarget = command.includes("<<")
|
|
383
|
+
? firstLine.match(/(?:^|\s)>{1,2}\s*(?:"([^"]+)"|'([^']+)'|([^\s;&|]+))/)
|
|
384
|
+
: null
|
|
385
|
+
const target = (
|
|
386
|
+
directTarget ??
|
|
387
|
+
heredocTarget?.[1] ??
|
|
388
|
+
heredocTarget?.[2] ??
|
|
389
|
+
heredocTarget?.[3] ??
|
|
390
|
+
""
|
|
391
|
+
).toLowerCase()
|
|
392
|
+
if (!target) return null
|
|
393
|
+
if (/<!doctype\s+html|<html(?:\s|>)/i.test(command) || /\.html?$/.test(target)) {
|
|
394
|
+
return "html"
|
|
395
|
+
}
|
|
396
|
+
if (/\.json$/.test(target)) return "json"
|
|
397
|
+
if (/\.(?:md|mdx)$/.test(target)) return "markdown"
|
|
398
|
+
if (/\.(?:csv|tsv)$/.test(target)) return "data"
|
|
399
|
+
return "file"
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/** A stable one-line command preview. Multiline payloads stay folded behind the raw disclosure. */
|
|
403
|
+
export function commandPreview(command: string, max = 96, messages: AgentMessages = en): string {
|
|
404
|
+
const lines = command.trim().split(/\r?\n/)
|
|
405
|
+
const firstLine = truncateEnd(lines[0]?.trim() ?? "", max)
|
|
406
|
+
if (lines.length <= 1) return firstLine
|
|
407
|
+
return `${firstLine}\n${messages.bash.moreLines(lines.length - 1)}`
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function describeSixb(
|
|
411
|
+
intent: Extract<BashIntent, { kind: "sixb" }>,
|
|
412
|
+
parsed: ParsedBashOutput | null,
|
|
413
|
+
messages: AgentMessages
|
|
414
|
+
): BashDescription {
|
|
415
|
+
const m = messages.bash
|
|
416
|
+
const counts = m.counts
|
|
417
|
+
const type = commandObjectType(intent, parsed)
|
|
418
|
+
switch (intent.command) {
|
|
419
|
+
case "help":
|
|
420
|
+
return icon("skill", m.help, m.helpSubjects[helpSubject(intent.args)])
|
|
421
|
+
case "version":
|
|
422
|
+
return icon("terminal", m.version)
|
|
423
|
+
case "doctor":
|
|
424
|
+
return icon("terminal", m.doctor)
|
|
425
|
+
case "context":
|
|
426
|
+
return icon("project", m.runContext)
|
|
427
|
+
case "ontology.list":
|
|
428
|
+
return withDetail(
|
|
429
|
+
icon("ontology", m.ontology),
|
|
430
|
+
count(arrayLength(parsed?.json), counts.objectTypes)
|
|
431
|
+
)
|
|
432
|
+
case "ontology.get":
|
|
433
|
+
return icon("ontology", m.objectType, humanize(intent.args[0]))
|
|
434
|
+
case "objects.inspect":
|
|
435
|
+
return withDetail(
|
|
436
|
+
icon("object", m.inspectObject, intent.args[1] ?? ""),
|
|
437
|
+
graphDetail(parsed?.json, counts)
|
|
438
|
+
)
|
|
439
|
+
case "objects.list":
|
|
440
|
+
case "objects.get":
|
|
441
|
+
case "objects.search":
|
|
442
|
+
case "objects.query": {
|
|
443
|
+
const n = objectCount(parsed?.json)
|
|
444
|
+
const label = humanize(type)
|
|
445
|
+
return {
|
|
446
|
+
icon: "objects",
|
|
447
|
+
title: n === null ? m.queriedObjects : m.foundObjects(n, label),
|
|
448
|
+
runningTitle: m.lookingUp(label),
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
case "objects.query-example":
|
|
452
|
+
return icon("skill", m.queryExample)
|
|
453
|
+
case "objects.count": {
|
|
454
|
+
const value = numberField(parsed?.json, "count")
|
|
455
|
+
return withDetail(
|
|
456
|
+
icon("count", m.countObjects, humanize(type)),
|
|
457
|
+
value === null ? undefined : m.number(value)
|
|
458
|
+
)
|
|
459
|
+
}
|
|
460
|
+
case "objects.exists": {
|
|
461
|
+
const value = boolField(parsed?.json, "exists")
|
|
462
|
+
return withDetail(icon("count", m.exists), value === null ? undefined : value ? m.yes : m.no)
|
|
463
|
+
}
|
|
464
|
+
case "objects.facets":
|
|
465
|
+
return icon("facets", m.facets)
|
|
466
|
+
case "objects.links":
|
|
467
|
+
return withDetail(
|
|
468
|
+
icon("objects", m.links, intent.args[1] ?? ""),
|
|
469
|
+
count(nestedArrayLength(parsed?.json, "links"), counts.links)
|
|
470
|
+
)
|
|
471
|
+
case "telemetry.latest":
|
|
472
|
+
return withDetail(
|
|
473
|
+
icon("telemetry", m.latestTelemetry, humanize(intent.args[2])),
|
|
474
|
+
latestReading(parsed?.json, m)
|
|
475
|
+
)
|
|
476
|
+
case "telemetry.history":
|
|
477
|
+
return withDetail(
|
|
478
|
+
icon("telemetry", m.telemetryHistory, humanize(intent.args[2])),
|
|
479
|
+
count(arrayLength(parsed?.json), counts.points)
|
|
480
|
+
)
|
|
481
|
+
case "telemetry.query":
|
|
482
|
+
return withDetail(
|
|
483
|
+
icon("telemetry", m.telemetryQuery),
|
|
484
|
+
count(seriesCount(parsed?.json), counts.series)
|
|
485
|
+
)
|
|
486
|
+
case "actions.list":
|
|
487
|
+
return withDetail(
|
|
488
|
+
icon("actions", m.listActions),
|
|
489
|
+
count(arrayLength(parsed?.json), counts.actions)
|
|
490
|
+
)
|
|
491
|
+
case "actions.get":
|
|
492
|
+
return icon("actions", m.inspectAction, humanize(intent.args[0]))
|
|
493
|
+
case "actions.request": {
|
|
494
|
+
// The request answers with the finished run, so it reads like `action-runs get`.
|
|
495
|
+
const run = actionRunInfo(parsed?.json)
|
|
496
|
+
const action = humanize(intent.args[0])
|
|
497
|
+
return withDetail(
|
|
498
|
+
{
|
|
499
|
+
icon: "actions",
|
|
500
|
+
title: run.status ? actionRunTitle(run, m) : m.requestAction.title(action),
|
|
501
|
+
runningTitle: m.requestAction.running(action),
|
|
502
|
+
},
|
|
503
|
+
run.subjectLabel
|
|
504
|
+
)
|
|
505
|
+
}
|
|
506
|
+
case "action-runs.get": {
|
|
507
|
+
const run = actionRunInfo(parsed?.json)
|
|
508
|
+
return {
|
|
509
|
+
icon: "actions",
|
|
510
|
+
title: actionRunTitle(run, m),
|
|
511
|
+
runningTitle: m.actionRun.checking,
|
|
512
|
+
detail: run.subjectLabel,
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
case "action-runs.list":
|
|
516
|
+
return withDetail(
|
|
517
|
+
icon("actions", m.listActionRuns),
|
|
518
|
+
count(arrayLength(parsed?.json), counts.runs)
|
|
519
|
+
)
|
|
520
|
+
case "workflows.list":
|
|
521
|
+
return withDetail(
|
|
522
|
+
icon("actions", m.listWorkflows),
|
|
523
|
+
count(arrayLength(parsed?.json), counts.workflows)
|
|
524
|
+
)
|
|
525
|
+
case "workflows.get":
|
|
526
|
+
return icon("actions", m.inspectWorkflow, humanize(intent.args[0]))
|
|
527
|
+
case "workflows.start":
|
|
528
|
+
return withDetail(
|
|
529
|
+
icon("actions", m.startWorkflow, humanize(intent.args[0])),
|
|
530
|
+
runOutcome(parsed?.json, m)
|
|
531
|
+
)
|
|
532
|
+
case "workflow-runs.list":
|
|
533
|
+
return withDetail(
|
|
534
|
+
icon("actions", m.listWorkflowRuns),
|
|
535
|
+
count(arrayLength(parsed?.json), counts.runs)
|
|
536
|
+
)
|
|
537
|
+
case "workflow-runs.get":
|
|
538
|
+
return withDetail(icon("actions", m.workflowRun), runStatus(parsed?.json, m))
|
|
539
|
+
case "files.upload":
|
|
540
|
+
return withDetail(icon("object", m.upload), filePath(parsed?.json))
|
|
541
|
+
case "files.download":
|
|
542
|
+
return withDetail(icon("object", m.download), filePath(parsed?.json))
|
|
543
|
+
case "project.show":
|
|
544
|
+
return icon("project", m.project)
|
|
545
|
+
case "api.get":
|
|
546
|
+
case "api.post":
|
|
547
|
+
return withDetail(icon("terminal", m.api), intent.args[0])
|
|
548
|
+
default:
|
|
549
|
+
return withDetail(icon("terminal", m.sixbCommand), truncateMiddle(intent.args.join(" "), 64))
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
function helpSubject(args: readonly string[]): keyof AgentMessages["bash"]["helpSubjects"] {
|
|
554
|
+
const group = args.find((value) => !value.startsWith("-"))
|
|
555
|
+
switch (group) {
|
|
556
|
+
case "objects":
|
|
557
|
+
case "ontology":
|
|
558
|
+
case "telemetry":
|
|
559
|
+
case "actions":
|
|
560
|
+
case "workflows":
|
|
561
|
+
case "files":
|
|
562
|
+
case "project":
|
|
563
|
+
return group
|
|
564
|
+
default:
|
|
565
|
+
return "other"
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
function referenceTitle(reference: string): string {
|
|
570
|
+
return humanize(reference.replace(/\.md$/, "").replace(/-/g, " "))
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// --- Small helpers ---------------------------------------------------------
|
|
574
|
+
|
|
575
|
+
/** Resolve a catalog headline, passing `args` to its functions. */
|
|
576
|
+
function icon<TArgs extends unknown[]>(
|
|
577
|
+
iconName: BashIcon,
|
|
578
|
+
headline: Headline<TArgs>,
|
|
579
|
+
...args: TArgs
|
|
580
|
+
): BashDescription {
|
|
581
|
+
const text = (value: Headline<TArgs>["title"]) =>
|
|
582
|
+
typeof value === "string" ? value : value(...args)
|
|
583
|
+
return { icon: iconName, title: text(headline.title), runningTitle: text(headline.running) }
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function withDetail(description: BashDescription, detail: string | undefined): BashDescription {
|
|
587
|
+
return detail === undefined ? description : { ...description, detail }
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
function count(n: number | null, format: (n: number) => string): string | undefined {
|
|
591
|
+
return n === null ? undefined : format(n)
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/** camelCase / PascalCase / kebab / snake → space-separated lowercase words. */
|
|
595
|
+
export function humanize(value: string | undefined): string {
|
|
596
|
+
if (!value) return ""
|
|
597
|
+
return value
|
|
598
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
599
|
+
.replace(/[_-]+/g, " ")
|
|
600
|
+
.trim()
|
|
601
|
+
.toLowerCase()
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
function arrayLength(value: unknown): number | null {
|
|
605
|
+
return Array.isArray(value) ? value.length : null
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
function nestedArrayLength(value: unknown, field: string): number | null {
|
|
609
|
+
return isRecord(value) && Array.isArray(value[field]) ? value[field].length : null
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
function commandObjectType(
|
|
613
|
+
intent: Extract<BashIntent, { kind: "sixb" }>,
|
|
614
|
+
parsed: ParsedBashOutput | null
|
|
615
|
+
): string | undefined {
|
|
616
|
+
if (intent.command === "objects.list") return optionValue(intent.args, "--type")
|
|
617
|
+
if (intent.command === "objects.get" || intent.command === "objects.inspect") {
|
|
618
|
+
return intent.args[0]
|
|
619
|
+
}
|
|
620
|
+
return findObjectTypeId(parsed?.json)
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
function optionValue(args: readonly string[], option: string): string | undefined {
|
|
624
|
+
const index = args.indexOf(option)
|
|
625
|
+
return index === -1 ? undefined : args[index + 1]
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
function graphDetail(value: unknown, counts: AgentMessages["bash"]["counts"]): string | undefined {
|
|
629
|
+
if (!isRecord(value) || !isRecord(value.graph)) return undefined
|
|
630
|
+
const objectCount = numberField(value.graph, "objectCount")
|
|
631
|
+
const linkCount = numberField(value.graph, "linkCount")
|
|
632
|
+
const parts = [count(objectCount, counts.objects), count(linkCount, counts.links)].filter(Boolean)
|
|
633
|
+
return parts.join(" · ") || undefined
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/** A single latest telemetry point's value, e.g. "1,240 rpm". */
|
|
637
|
+
function latestReading(value: unknown, m: AgentMessages["bash"]): string | undefined {
|
|
638
|
+
if (!isRecord(value)) return undefined
|
|
639
|
+
const reading = value.value
|
|
640
|
+
const text =
|
|
641
|
+
typeof reading === "number"
|
|
642
|
+
? m.number(reading)
|
|
643
|
+
: typeof reading === "string" || typeof reading === "boolean"
|
|
644
|
+
? String(reading)
|
|
645
|
+
: undefined
|
|
646
|
+
if (text === undefined) return undefined
|
|
647
|
+
return typeof value.unit === "string" ? `${text} ${value.unit}` : text
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
function seriesCount(value: unknown): number | null {
|
|
651
|
+
return isRecord(value) && Array.isArray(value.series) ? value.series.length : null
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
function runOutcome(value: unknown, m: AgentMessages["bash"]): string | undefined {
|
|
655
|
+
if (!isRecord(value)) return undefined
|
|
656
|
+
if (typeof value.runId === "string" || typeof value.id === "string") return m.queued
|
|
657
|
+
return runStatus(value, m)
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/** A run status in words; statuses Sixb does not know yet are shown as they are. */
|
|
661
|
+
export function runStatus(value: unknown, m: AgentMessages["bash"] = en.bash): string | undefined {
|
|
662
|
+
if (!isRecord(value) || typeof value.status !== "string") return undefined
|
|
663
|
+
return Object.hasOwn(m.statuses, value.status)
|
|
664
|
+
? m.statuses[value.status as keyof typeof m.statuses]
|
|
665
|
+
: humanize(value.status)
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
function filePath(value: unknown): string | undefined {
|
|
669
|
+
if (!isRecord(value)) return undefined
|
|
670
|
+
for (const field of ["output", "logicalPath", "path"]) {
|
|
671
|
+
if (typeof value[field] === "string") return value[field]
|
|
672
|
+
}
|
|
673
|
+
return undefined
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/** An Action run is recorded once, when it ends. */
|
|
677
|
+
type ActionRunStatus = "succeeded" | "failed"
|
|
678
|
+
|
|
679
|
+
interface ActionRunInfo {
|
|
680
|
+
readonly actionId?: string
|
|
681
|
+
readonly status?: ActionRunStatus
|
|
682
|
+
readonly subjectLabel?: string
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
function actionRunInfo(value: unknown): ActionRunInfo {
|
|
686
|
+
if (!isRecord(value)) return {}
|
|
687
|
+
const status =
|
|
688
|
+
value.status === "succeeded" || value.status === "failed" ? value.status : undefined
|
|
689
|
+
const actionId = typeof value.actionId === "string" ? value.actionId : undefined
|
|
690
|
+
return { actionId, status, subjectLabel: subjectLabel(value.subject) }
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/** "customer cust-001" for an object subject, otherwise undefined. */
|
|
694
|
+
export function subjectLabel(subject: unknown): string | undefined {
|
|
695
|
+
if (!isRecord(subject) || subject.kind !== "object") return undefined
|
|
696
|
+
const objectTypeId =
|
|
697
|
+
typeof subject.objectTypeId === "string" ? humanize(subject.objectTypeId) : ""
|
|
698
|
+
const primaryId = typeof subject.primaryId === "string" ? subject.primaryId : ""
|
|
699
|
+
return [objectTypeId, primaryId].filter(Boolean).join(" ") || undefined
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
function actionRunTitle(run: ActionRunInfo, m: AgentMessages["bash"]): string {
|
|
703
|
+
if (!run.status) return m.actionRun.checked
|
|
704
|
+
return m.actionRun[run.status](humanize(run.actionId))
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export function capitalize(value: string): string {
|
|
708
|
+
return value ? value.charAt(0).toUpperCase() + value.slice(1) : value
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/** Count of returned objects across both the list and query response envelopes. */
|
|
712
|
+
export function objectCount(value: unknown): number | null {
|
|
713
|
+
if (Array.isArray(value)) return value.length
|
|
714
|
+
if (isRecord(value) && Array.isArray(value.objects)) return value.objects.length
|
|
715
|
+
return null
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
export function numberField(value: unknown, field: string): number | null {
|
|
719
|
+
return isRecord(value) && typeof value[field] === "number" ? value[field] : null
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
function boolField(value: unknown, field: string): boolean | null {
|
|
723
|
+
return isRecord(value) && typeof value[field] === "boolean" ? value[field] : null
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/** Recursively find the first `objectTypeId` string in a query payload. */
|
|
727
|
+
function findObjectTypeId(value: unknown): string | undefined {
|
|
728
|
+
if (Array.isArray(value)) {
|
|
729
|
+
for (const item of value) {
|
|
730
|
+
const found = findObjectTypeId(item)
|
|
731
|
+
if (found) return found
|
|
732
|
+
}
|
|
733
|
+
return undefined
|
|
734
|
+
}
|
|
735
|
+
if (isRecord(value)) {
|
|
736
|
+
if (typeof value.objectTypeId === "string") return value.objectTypeId
|
|
737
|
+
for (const key of Object.keys(value)) {
|
|
738
|
+
const found = findObjectTypeId(value[key])
|
|
739
|
+
if (found) return found
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
return undefined
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
function tryParseJson(text: string): unknown {
|
|
746
|
+
const trimmed = text.trim()
|
|
747
|
+
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return undefined
|
|
748
|
+
try {
|
|
749
|
+
return JSON.parse(trimmed)
|
|
750
|
+
} catch {
|
|
751
|
+
return undefined
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
function truncateMiddle(text: string, max: number): string {
|
|
756
|
+
if (text.length <= max) return text
|
|
757
|
+
const head = Math.ceil((max - 1) / 2)
|
|
758
|
+
const tail = Math.floor((max - 1) / 2)
|
|
759
|
+
return `${text.slice(0, head)}…${text.slice(text.length - tail)}`
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
function truncateEnd(text: string, max: number): string {
|
|
763
|
+
if (text.length <= max) return text
|
|
764
|
+
return `${text.slice(0, Math.max(0, max - 1)).trimEnd()}…`
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
export function isRecord(value: unknown): value is Record<string, unknown> {
|
|
768
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
769
|
+
}
|