@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,900 @@
|
|
|
1
|
+
import { listObjectsInfiniteOptions } from "@sixb/client/hooks"
|
|
2
|
+
import type { JsonValue } from "@sixb/core"
|
|
3
|
+
import { isFileRef } from "@sixb/core/blob-storage"
|
|
4
|
+
import { normalizeDecimalValue } from "@sixb/core/ontology"
|
|
5
|
+
import {
|
|
6
|
+
Combobox,
|
|
7
|
+
Input,
|
|
8
|
+
Label,
|
|
9
|
+
Select,
|
|
10
|
+
SelectContent,
|
|
11
|
+
SelectItem,
|
|
12
|
+
SelectTrigger,
|
|
13
|
+
SelectValue,
|
|
14
|
+
} from "@sixb/ui/components"
|
|
15
|
+
import { useInfiniteQuery } from "@tanstack/react-query"
|
|
16
|
+
import {
|
|
17
|
+
FileRefUploadField,
|
|
18
|
+
parseFileRefFormValue,
|
|
19
|
+
stringifyFileRefFormValue,
|
|
20
|
+
} from "../components/file-ref-upload-field"
|
|
21
|
+
import { SchemaChip } from "./schema-shape"
|
|
22
|
+
|
|
23
|
+
export type WorkflowInputFormValues = Record<string, string>
|
|
24
|
+
export type WorkflowInputFormErrors = Record<string, string>
|
|
25
|
+
|
|
26
|
+
const objectRefPageSize = 50
|
|
27
|
+
const keySeparator = "\u001f"
|
|
28
|
+
|
|
29
|
+
type FieldSpec = {
|
|
30
|
+
readonly schema: unknown
|
|
31
|
+
readonly required: boolean
|
|
32
|
+
readonly nullable: boolean
|
|
33
|
+
readonly description?: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function WorkflowRunInputFields({
|
|
37
|
+
fields,
|
|
38
|
+
values,
|
|
39
|
+
errors,
|
|
40
|
+
onChange,
|
|
41
|
+
onFileUploadPendingChange,
|
|
42
|
+
emptyLabel = "This workflow does not require any input.",
|
|
43
|
+
}: {
|
|
44
|
+
fields: Readonly<Record<string, unknown>>
|
|
45
|
+
values: WorkflowInputFormValues
|
|
46
|
+
errors: WorkflowInputFormErrors
|
|
47
|
+
onChange: (path: readonly string[], value: string) => void
|
|
48
|
+
onFileUploadPendingChange?: (key: string, pending: boolean) => void
|
|
49
|
+
emptyLabel?: string
|
|
50
|
+
}) {
|
|
51
|
+
const entries = Object.entries(fields)
|
|
52
|
+
if (entries.length === 0) {
|
|
53
|
+
return (
|
|
54
|
+
<div className="rounded-lg border border-border bg-muted/20 p-4 text-sm text-muted-foreground">
|
|
55
|
+
{emptyLabel}
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className="min-w-0 space-y-4">
|
|
62
|
+
{entries.map(([name, descriptor]) => (
|
|
63
|
+
<WorkflowInputField
|
|
64
|
+
key={name}
|
|
65
|
+
name={name}
|
|
66
|
+
path={[name]}
|
|
67
|
+
descriptor={descriptor}
|
|
68
|
+
defaultRequired={true}
|
|
69
|
+
values={values}
|
|
70
|
+
errors={errors}
|
|
71
|
+
onChange={onChange}
|
|
72
|
+
onFileUploadPendingChange={onFileUploadPendingChange}
|
|
73
|
+
/>
|
|
74
|
+
))}
|
|
75
|
+
</div>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function createInitialWorkflowInputFormValues(
|
|
80
|
+
fields: Readonly<Record<string, unknown>>,
|
|
81
|
+
initialValue: Readonly<Record<string, unknown>> = {}
|
|
82
|
+
): WorkflowInputFormValues {
|
|
83
|
+
const values: WorkflowInputFormValues = {}
|
|
84
|
+
for (const [name, descriptor] of Object.entries(fields)) {
|
|
85
|
+
collectInitialFormValues(
|
|
86
|
+
unwrapFieldDescriptor(descriptor, true),
|
|
87
|
+
[name],
|
|
88
|
+
values,
|
|
89
|
+
initialValue[name]
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
return values
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function buildWorkflowInput(
|
|
96
|
+
fields: Readonly<Record<string, unknown>>,
|
|
97
|
+
values: WorkflowInputFormValues
|
|
98
|
+
) {
|
|
99
|
+
const input: Record<string, JsonValue> = {}
|
|
100
|
+
const errors: WorkflowInputFormErrors = {}
|
|
101
|
+
|
|
102
|
+
for (const [name, descriptor] of Object.entries(fields)) {
|
|
103
|
+
const spec = unwrapFieldDescriptor(descriptor, true)
|
|
104
|
+
const parsed = parseFieldValue({ spec, path: [name], values, errors })
|
|
105
|
+
if (parsed.present) {
|
|
106
|
+
input[name] = parsed.value
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return { input, errors }
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function WorkflowInputField({
|
|
114
|
+
name,
|
|
115
|
+
path,
|
|
116
|
+
descriptor,
|
|
117
|
+
defaultRequired,
|
|
118
|
+
values,
|
|
119
|
+
errors,
|
|
120
|
+
onChange,
|
|
121
|
+
onFileUploadPendingChange,
|
|
122
|
+
}: {
|
|
123
|
+
name: string
|
|
124
|
+
path: readonly string[]
|
|
125
|
+
descriptor: unknown
|
|
126
|
+
defaultRequired: boolean
|
|
127
|
+
values: WorkflowInputFormValues
|
|
128
|
+
errors: WorkflowInputFormErrors
|
|
129
|
+
onChange: (path: readonly string[], value: string) => void
|
|
130
|
+
onFileUploadPendingChange?: (key: string, pending: boolean) => void
|
|
131
|
+
}) {
|
|
132
|
+
const spec = unwrapFieldDescriptor(descriptor, defaultRequired)
|
|
133
|
+
const key = pathKey(path)
|
|
134
|
+
const controlId = fieldControlId(path)
|
|
135
|
+
const error = errors[key]
|
|
136
|
+
const schema = resolveRenderableSchema(spec.schema)
|
|
137
|
+
|
|
138
|
+
if (isObjectSchema(schema)) {
|
|
139
|
+
const entries = Object.entries(schema.properties)
|
|
140
|
+
return (
|
|
141
|
+
<fieldset className="min-w-0 rounded-lg border border-border bg-muted/20 p-4">
|
|
142
|
+
<div className="mb-3 flex min-w-0 flex-wrap items-center gap-2">
|
|
143
|
+
<legend className="font-medium text-foreground">{name}</legend>
|
|
144
|
+
<SchemaChip schema={spec.schema} />
|
|
145
|
+
{spec.required ? <RequiredPill /> : <OptionalPill />}
|
|
146
|
+
</div>
|
|
147
|
+
{spec.description ? (
|
|
148
|
+
<p className="mb-3 text-sm text-muted-foreground">{spec.description}</p>
|
|
149
|
+
) : null}
|
|
150
|
+
{entries.length === 0 ? (
|
|
151
|
+
<p className="text-sm text-muted-foreground">No fields</p>
|
|
152
|
+
) : (
|
|
153
|
+
<div className="min-w-0 space-y-4">
|
|
154
|
+
{entries.map(([fieldName, fieldDescriptor]) => (
|
|
155
|
+
<WorkflowInputField
|
|
156
|
+
key={fieldName}
|
|
157
|
+
name={fieldName}
|
|
158
|
+
path={[...path, fieldName]}
|
|
159
|
+
descriptor={fieldDescriptor}
|
|
160
|
+
defaultRequired={false}
|
|
161
|
+
values={values}
|
|
162
|
+
errors={errors}
|
|
163
|
+
onChange={onChange}
|
|
164
|
+
onFileUploadPendingChange={onFileUploadPendingChange}
|
|
165
|
+
/>
|
|
166
|
+
))}
|
|
167
|
+
</div>
|
|
168
|
+
)}
|
|
169
|
+
{error ? <FieldError id={`${controlId}-error`} message={error} /> : null}
|
|
170
|
+
</fieldset>
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return (
|
|
175
|
+
<div className="min-w-0 space-y-2">
|
|
176
|
+
<div className="flex min-w-0 flex-wrap items-center gap-2">
|
|
177
|
+
<Label htmlFor={controlId} className="font-medium text-foreground">
|
|
178
|
+
{name}
|
|
179
|
+
</Label>
|
|
180
|
+
<SchemaChip schema={spec.schema} />
|
|
181
|
+
{spec.required ? <RequiredPill /> : <OptionalPill />}
|
|
182
|
+
</div>
|
|
183
|
+
{spec.description ? (
|
|
184
|
+
<p className="text-sm text-muted-foreground">{spec.description}</p>
|
|
185
|
+
) : null}
|
|
186
|
+
<WorkflowInputControl
|
|
187
|
+
id={controlId}
|
|
188
|
+
path={path}
|
|
189
|
+
spec={spec}
|
|
190
|
+
value={values[key] ?? ""}
|
|
191
|
+
errorId={error ? `${controlId}-error` : undefined}
|
|
192
|
+
onChange={onChange}
|
|
193
|
+
onFileUploadPendingChange={onFileUploadPendingChange}
|
|
194
|
+
/>
|
|
195
|
+
{error ? <FieldError id={`${controlId}-error`} message={error} /> : null}
|
|
196
|
+
</div>
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function WorkflowInputControl({
|
|
201
|
+
id,
|
|
202
|
+
path,
|
|
203
|
+
spec,
|
|
204
|
+
value,
|
|
205
|
+
errorId,
|
|
206
|
+
onChange,
|
|
207
|
+
onFileUploadPendingChange,
|
|
208
|
+
}: {
|
|
209
|
+
id: string
|
|
210
|
+
path: readonly string[]
|
|
211
|
+
spec: FieldSpec
|
|
212
|
+
value: string
|
|
213
|
+
errorId?: string
|
|
214
|
+
onChange: (path: readonly string[], value: string) => void
|
|
215
|
+
onFileUploadPendingChange?: (key: string, pending: boolean) => void
|
|
216
|
+
}) {
|
|
217
|
+
const schema = resolveRenderableSchema(spec.schema)
|
|
218
|
+
|
|
219
|
+
if (isObjectRefSchema(schema)) {
|
|
220
|
+
return (
|
|
221
|
+
<ObjectRefInput
|
|
222
|
+
path={path}
|
|
223
|
+
objectTypeId={schema.objectTypeId}
|
|
224
|
+
value={value}
|
|
225
|
+
errorId={errorId}
|
|
226
|
+
onChange={onChange}
|
|
227
|
+
/>
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (isEnumSchema(schema)) {
|
|
232
|
+
return (
|
|
233
|
+
<EnumInput schema={schema} path={path} value={value} errorId={errorId} onChange={onChange} />
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (schema === "boolean") {
|
|
238
|
+
return <BooleanInput path={path} value={value} errorId={errorId} onChange={onChange} />
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (schema === "fileRef") {
|
|
242
|
+
return (
|
|
243
|
+
<FileRefUploadField
|
|
244
|
+
id={id}
|
|
245
|
+
value={parseFileRefFormValue(value)}
|
|
246
|
+
onChange={(fileRef) => onChange(path, fileRef ? stringifyFileRefFormValue(fileRef) : "")}
|
|
247
|
+
errorId={errorId}
|
|
248
|
+
logicalPathPrefix={`workflow-input/${path.join("/")}`}
|
|
249
|
+
onPendingChange={(pending) => onFileUploadPendingChange?.(pathKey(path), pending)}
|
|
250
|
+
/>
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (isPrimitiveSchema(schema) && schema !== "fileRef") {
|
|
255
|
+
return (
|
|
256
|
+
<PrimitiveInput
|
|
257
|
+
id={id}
|
|
258
|
+
schema={schema}
|
|
259
|
+
path={path}
|
|
260
|
+
value={value}
|
|
261
|
+
errorId={errorId}
|
|
262
|
+
onChange={onChange}
|
|
263
|
+
/>
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return (
|
|
268
|
+
<JsonFieldInput
|
|
269
|
+
id={id}
|
|
270
|
+
path={path}
|
|
271
|
+
schema={schema}
|
|
272
|
+
value={value}
|
|
273
|
+
errorId={errorId}
|
|
274
|
+
onChange={onChange}
|
|
275
|
+
/>
|
|
276
|
+
)
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function ObjectRefInput({
|
|
280
|
+
path,
|
|
281
|
+
objectTypeId,
|
|
282
|
+
value,
|
|
283
|
+
errorId,
|
|
284
|
+
onChange,
|
|
285
|
+
}: {
|
|
286
|
+
path: readonly string[]
|
|
287
|
+
objectTypeId: string
|
|
288
|
+
value: string
|
|
289
|
+
errorId?: string
|
|
290
|
+
onChange: (path: readonly string[], value: string) => void
|
|
291
|
+
}) {
|
|
292
|
+
const objectsQuery = useInfiniteQuery(
|
|
293
|
+
listObjectsInfiniteOptions({
|
|
294
|
+
query: {
|
|
295
|
+
objectTypeId,
|
|
296
|
+
limit: String(objectRefPageSize),
|
|
297
|
+
orderBy: "updatedAt",
|
|
298
|
+
order: "desc",
|
|
299
|
+
},
|
|
300
|
+
})
|
|
301
|
+
)
|
|
302
|
+
const objects = objectsQuery.data?.pages.flatMap((page) => page.objects) ?? []
|
|
303
|
+
const disabled = objectsQuery.isLoading || objects.length === 0
|
|
304
|
+
|
|
305
|
+
return (
|
|
306
|
+
<div className="w-full min-w-0 space-y-2">
|
|
307
|
+
<Combobox
|
|
308
|
+
value={value}
|
|
309
|
+
disabled={disabled}
|
|
310
|
+
aria-describedby={errorId}
|
|
311
|
+
hasMore={objectsQuery.hasNextPage}
|
|
312
|
+
loadingMore={objectsQuery.isFetchingNextPage}
|
|
313
|
+
loadingLabel="Loading more objects..."
|
|
314
|
+
onLoadMore={() => void objectsQuery.fetchNextPage()}
|
|
315
|
+
options={objects.map((object) => ({
|
|
316
|
+
value: object.primaryId,
|
|
317
|
+
label: object.name || object.primaryId,
|
|
318
|
+
description: object.primaryId,
|
|
319
|
+
}))}
|
|
320
|
+
onValueChange={(next) => onChange(path, next)}
|
|
321
|
+
placeholder={
|
|
322
|
+
objectsQuery.isLoading ? `Loading ${objectTypeId} objects...` : `Select a ${objectTypeId}`
|
|
323
|
+
}
|
|
324
|
+
searchPlaceholder={`Search ${objectTypeId} objects...`}
|
|
325
|
+
emptyLabel={`No ${objectTypeId} objects found.`}
|
|
326
|
+
className="bg-background"
|
|
327
|
+
/>
|
|
328
|
+
{!objectsQuery.isLoading && objects.length === 0 ? (
|
|
329
|
+
<p className="text-xs text-muted-foreground">No {objectTypeId} objects are available.</p>
|
|
330
|
+
) : null}
|
|
331
|
+
</div>
|
|
332
|
+
)
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function EnumInput({
|
|
336
|
+
schema,
|
|
337
|
+
path,
|
|
338
|
+
value,
|
|
339
|
+
errorId,
|
|
340
|
+
onChange,
|
|
341
|
+
}: {
|
|
342
|
+
schema: EnumSchema
|
|
343
|
+
path: readonly string[]
|
|
344
|
+
value: string
|
|
345
|
+
errorId?: string
|
|
346
|
+
onChange: (path: readonly string[], value: string) => void
|
|
347
|
+
}) {
|
|
348
|
+
return (
|
|
349
|
+
<Select value={value} onValueChange={(next) => onChange(path, next)}>
|
|
350
|
+
<SelectTrigger aria-describedby={errorId} className="w-full min-w-0 bg-background">
|
|
351
|
+
<SelectValue placeholder="Choose a value" />
|
|
352
|
+
</SelectTrigger>
|
|
353
|
+
<SelectContent>
|
|
354
|
+
{schema.values.map((option) => (
|
|
355
|
+
<SelectItem key={String(option)} value={String(option)}>
|
|
356
|
+
{String(option)}
|
|
357
|
+
</SelectItem>
|
|
358
|
+
))}
|
|
359
|
+
</SelectContent>
|
|
360
|
+
</Select>
|
|
361
|
+
)
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
function BooleanInput({
|
|
365
|
+
path,
|
|
366
|
+
value,
|
|
367
|
+
errorId,
|
|
368
|
+
onChange,
|
|
369
|
+
}: {
|
|
370
|
+
path: readonly string[]
|
|
371
|
+
value: string
|
|
372
|
+
errorId?: string
|
|
373
|
+
onChange: (path: readonly string[], value: string) => void
|
|
374
|
+
}) {
|
|
375
|
+
return (
|
|
376
|
+
<Select value={value} onValueChange={(next) => onChange(path, next)}>
|
|
377
|
+
<SelectTrigger aria-describedby={errorId} className="w-full min-w-0 bg-background">
|
|
378
|
+
<SelectValue placeholder="Choose true or false" />
|
|
379
|
+
</SelectTrigger>
|
|
380
|
+
<SelectContent>
|
|
381
|
+
<SelectItem value="true">True</SelectItem>
|
|
382
|
+
<SelectItem value="false">False</SelectItem>
|
|
383
|
+
</SelectContent>
|
|
384
|
+
</Select>
|
|
385
|
+
)
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function PrimitiveInput({
|
|
389
|
+
id,
|
|
390
|
+
schema,
|
|
391
|
+
path,
|
|
392
|
+
value,
|
|
393
|
+
errorId,
|
|
394
|
+
onChange,
|
|
395
|
+
}: {
|
|
396
|
+
id: string
|
|
397
|
+
schema: PrimitiveSchema
|
|
398
|
+
path: readonly string[]
|
|
399
|
+
value: string
|
|
400
|
+
errorId?: string
|
|
401
|
+
onChange: (path: readonly string[], value: string) => void
|
|
402
|
+
}) {
|
|
403
|
+
return (
|
|
404
|
+
<Input
|
|
405
|
+
id={id}
|
|
406
|
+
type={inputTypeForPrimitive(schema)}
|
|
407
|
+
step={schema === "integer" ? "1" : schema === "double" ? "any" : undefined}
|
|
408
|
+
value={value}
|
|
409
|
+
onChange={(event) => onChange(path, event.target.value)}
|
|
410
|
+
placeholder={placeholderForPrimitive(schema)}
|
|
411
|
+
aria-describedby={errorId}
|
|
412
|
+
className="bg-background"
|
|
413
|
+
/>
|
|
414
|
+
)
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
function JsonFieldInput({
|
|
418
|
+
id,
|
|
419
|
+
path,
|
|
420
|
+
schema,
|
|
421
|
+
value,
|
|
422
|
+
errorId,
|
|
423
|
+
onChange,
|
|
424
|
+
}: {
|
|
425
|
+
id: string
|
|
426
|
+
path: readonly string[]
|
|
427
|
+
schema: unknown
|
|
428
|
+
value: string
|
|
429
|
+
errorId?: string
|
|
430
|
+
onChange: (path: readonly string[], value: string) => void
|
|
431
|
+
}) {
|
|
432
|
+
return (
|
|
433
|
+
<div className="w-full min-w-0 space-y-2">
|
|
434
|
+
<textarea
|
|
435
|
+
id={id}
|
|
436
|
+
value={value}
|
|
437
|
+
onChange={(event) => onChange(path, event.target.value)}
|
|
438
|
+
placeholder={defaultJsonForSchema(schema) || "{ ... }"}
|
|
439
|
+
spellCheck={false}
|
|
440
|
+
aria-describedby={errorId}
|
|
441
|
+
className="min-h-24 w-full min-w-0 resize-y rounded-md border border-input bg-background px-3 py-2 font-mono text-xs leading-relaxed text-foreground shadow-xs outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"
|
|
442
|
+
/>
|
|
443
|
+
<p className="text-xs text-muted-foreground">
|
|
444
|
+
This field uses a structured value. Enter only this field as JSON.
|
|
445
|
+
</p>
|
|
446
|
+
</div>
|
|
447
|
+
)
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function RequiredPill() {
|
|
451
|
+
return (
|
|
452
|
+
<span className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground">
|
|
453
|
+
Required
|
|
454
|
+
</span>
|
|
455
|
+
)
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function OptionalPill() {
|
|
459
|
+
return (
|
|
460
|
+
<span className="text-[11px] font-medium uppercase tracking-wide text-muted-foreground">
|
|
461
|
+
Optional
|
|
462
|
+
</span>
|
|
463
|
+
)
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
function FieldError({ id, message }: { id: string; message: string }) {
|
|
467
|
+
return (
|
|
468
|
+
<p id={id} className="text-sm text-destructive">
|
|
469
|
+
{message}
|
|
470
|
+
</p>
|
|
471
|
+
)
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function collectInitialFormValues(
|
|
475
|
+
spec: FieldSpec,
|
|
476
|
+
path: readonly string[],
|
|
477
|
+
values: WorkflowInputFormValues,
|
|
478
|
+
initialValue: unknown
|
|
479
|
+
): void {
|
|
480
|
+
const schema = resolveRenderableSchema(spec.schema)
|
|
481
|
+
const initialFormValue = initialFormValueForSchema(schema, initialValue)
|
|
482
|
+
if (initialFormValue !== null) {
|
|
483
|
+
values[pathKey(path)] = initialFormValue
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const defaultJson = defaultJsonForSchema(schema)
|
|
487
|
+
if (initialFormValue === null && spec.required && defaultJson) {
|
|
488
|
+
values[pathKey(path)] = defaultJson
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if (isObjectSchema(schema)) {
|
|
492
|
+
const initialObject = isRecord(initialValue) ? initialValue : {}
|
|
493
|
+
for (const [fieldName, fieldDescriptor] of Object.entries(schema.properties)) {
|
|
494
|
+
collectInitialFormValues(
|
|
495
|
+
unwrapFieldDescriptor(fieldDescriptor, false),
|
|
496
|
+
[...path, fieldName],
|
|
497
|
+
values,
|
|
498
|
+
initialObject[fieldName]
|
|
499
|
+
)
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
function parseFieldValue({
|
|
505
|
+
spec,
|
|
506
|
+
path,
|
|
507
|
+
values,
|
|
508
|
+
errors,
|
|
509
|
+
}: {
|
|
510
|
+
spec: FieldSpec
|
|
511
|
+
path: readonly string[]
|
|
512
|
+
values: WorkflowInputFormValues
|
|
513
|
+
errors: WorkflowInputFormErrors
|
|
514
|
+
}): { present: false } | { present: true; value: JsonValue } {
|
|
515
|
+
const schema = resolveRenderableSchema(spec.schema)
|
|
516
|
+
const key = pathKey(path)
|
|
517
|
+
const raw = values[key]
|
|
518
|
+
const trimmed = raw?.trim() ?? ""
|
|
519
|
+
|
|
520
|
+
if (isValueTypeRefSchema(schema) && !schema._resolved) {
|
|
521
|
+
return parseJsonField({ spec, path, values, errors })
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
if (isObjectRefSchema(schema)) {
|
|
525
|
+
if (!trimmed) return missingField(spec, path, errors)
|
|
526
|
+
return { present: true, value: { objectTypeId: schema.objectTypeId, primaryId: trimmed } }
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
if (isEnumSchema(schema)) {
|
|
530
|
+
if (!trimmed) return missingField(spec, path, errors)
|
|
531
|
+
const option = schema.values.find((candidate) => String(candidate) === trimmed)
|
|
532
|
+
if (option === undefined) {
|
|
533
|
+
errors[key] = `${fieldLabel(path)} must be one of the available values.`
|
|
534
|
+
return { present: false }
|
|
535
|
+
}
|
|
536
|
+
return { present: true, value: option }
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
if (schema === "boolean") {
|
|
540
|
+
if (trimmed !== "true" && trimmed !== "false") return missingField(spec, path, errors)
|
|
541
|
+
return { present: true, value: trimmed === "true" }
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
if (schema === "fileRef") {
|
|
545
|
+
if (!trimmed) return missingField(spec, path, errors)
|
|
546
|
+
|
|
547
|
+
try {
|
|
548
|
+
const parsed = JSON.parse(trimmed) as unknown
|
|
549
|
+
if (!isFileRef(parsed)) {
|
|
550
|
+
errors[key] = `${fieldLabel(path)} must be an uploaded file.`
|
|
551
|
+
return { present: false }
|
|
552
|
+
}
|
|
553
|
+
return { present: true, value: { ...parsed } }
|
|
554
|
+
} catch {
|
|
555
|
+
errors[key] = `${fieldLabel(path)} must be an uploaded file.`
|
|
556
|
+
return { present: false }
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
if (isPrimitiveSchema(schema) && schema !== "fileRef") {
|
|
561
|
+
if (!trimmed) return missingField(spec, path, errors)
|
|
562
|
+
|
|
563
|
+
if (schema === "integer") {
|
|
564
|
+
const parsed = Number(trimmed)
|
|
565
|
+
if (!Number.isInteger(parsed)) {
|
|
566
|
+
errors[key] = `${fieldLabel(path)} must be an integer.`
|
|
567
|
+
return { present: false }
|
|
568
|
+
}
|
|
569
|
+
return { present: true, value: parsed }
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
if (schema === "double") {
|
|
573
|
+
const parsed = Number(trimmed)
|
|
574
|
+
if (!Number.isFinite(parsed)) {
|
|
575
|
+
errors[key] = `${fieldLabel(path)} must be numeric.`
|
|
576
|
+
return { present: false }
|
|
577
|
+
}
|
|
578
|
+
return { present: true, value: parsed }
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
if (schema === "decimal") {
|
|
582
|
+
try {
|
|
583
|
+
return { present: true, value: normalizeDecimalValue(trimmed) }
|
|
584
|
+
} catch {
|
|
585
|
+
errors[key] = `${fieldLabel(path)} must be an exact decimal.`
|
|
586
|
+
return { present: false }
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// The field holds a user id; the input carries the reference.
|
|
591
|
+
if (schema === "userRef") return { present: true, value: { type: "user", id: trimmed } }
|
|
592
|
+
|
|
593
|
+
if (schema === "timestamp") {
|
|
594
|
+
const timestamp = new Date(trimmed)
|
|
595
|
+
if (Number.isNaN(timestamp.getTime())) {
|
|
596
|
+
errors[key] = `${fieldLabel(path)} must be a valid timestamp.`
|
|
597
|
+
return { present: false }
|
|
598
|
+
}
|
|
599
|
+
return { present: true, value: timestamp.toISOString() }
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
return { present: true, value: trimmed }
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
if (isObjectSchema(schema)) {
|
|
606
|
+
if (!spec.required && !hasAnyValueForPath(values, path)) {
|
|
607
|
+
return { present: false }
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
const objectValue: Record<string, JsonValue> = {}
|
|
611
|
+
let present = false
|
|
612
|
+
|
|
613
|
+
for (const [fieldName, fieldDescriptor] of Object.entries(schema.properties)) {
|
|
614
|
+
const fieldSpec = unwrapFieldDescriptor(fieldDescriptor, false)
|
|
615
|
+
const parsed = parseFieldValue({
|
|
616
|
+
spec: fieldSpec,
|
|
617
|
+
path: [...path, fieldName],
|
|
618
|
+
values,
|
|
619
|
+
errors,
|
|
620
|
+
})
|
|
621
|
+
if (parsed.present) {
|
|
622
|
+
objectValue[fieldName] = parsed.value
|
|
623
|
+
present = true
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
if (present || spec.required) return { present: true, value: objectValue }
|
|
628
|
+
return { present: false }
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
return parseJsonField({ spec, path, values, errors })
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
function parseJsonField({
|
|
635
|
+
spec,
|
|
636
|
+
path,
|
|
637
|
+
values,
|
|
638
|
+
errors,
|
|
639
|
+
}: {
|
|
640
|
+
spec: FieldSpec
|
|
641
|
+
path: readonly string[]
|
|
642
|
+
values: WorkflowInputFormValues
|
|
643
|
+
errors: WorkflowInputFormErrors
|
|
644
|
+
}): { present: false } | { present: true; value: JsonValue } {
|
|
645
|
+
const key = pathKey(path)
|
|
646
|
+
const raw = values[key]?.trim() ?? ""
|
|
647
|
+
if (!raw) return missingField(spec, path, errors)
|
|
648
|
+
|
|
649
|
+
try {
|
|
650
|
+
const value = JSON.parse(raw) as unknown
|
|
651
|
+
if (!isParsedJsonValue(value)) {
|
|
652
|
+
errors[key] = `${fieldLabel(path)} must be valid JSON.`
|
|
653
|
+
return { present: false }
|
|
654
|
+
}
|
|
655
|
+
return { present: true, value }
|
|
656
|
+
} catch (error) {
|
|
657
|
+
errors[key] = error instanceof Error ? error.message : `${fieldLabel(path)} must be valid JSON.`
|
|
658
|
+
return { present: false }
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
function isParsedJsonValue(value: unknown): value is JsonValue {
|
|
663
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return true
|
|
664
|
+
if (typeof value === "number") return Number.isFinite(value)
|
|
665
|
+
if (Array.isArray(value)) return value.every(isParsedJsonValue)
|
|
666
|
+
if (typeof value === "object") return Object.values(value).every(isParsedJsonValue)
|
|
667
|
+
return false
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
function missingField(
|
|
671
|
+
spec: FieldSpec,
|
|
672
|
+
path: readonly string[],
|
|
673
|
+
errors: WorkflowInputFormErrors
|
|
674
|
+
): { present: false } | { present: true; value: null } {
|
|
675
|
+
if (spec.nullable) return { present: true, value: null }
|
|
676
|
+
if (!spec.required) return { present: false }
|
|
677
|
+
errors[pathKey(path)] = `${fieldLabel(path)} is required.`
|
|
678
|
+
return { present: false }
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
function hasAnyValueForPath(values: WorkflowInputFormValues, path: readonly string[]): boolean {
|
|
682
|
+
const prefix = `${pathKey(path)}${keySeparator}`
|
|
683
|
+
for (const [key, value] of Object.entries(values)) {
|
|
684
|
+
if ((key === pathKey(path) || key.startsWith(prefix)) && value.trim()) {
|
|
685
|
+
return true
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
return false
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
function unwrapFieldDescriptor(value: unknown, defaultRequired: boolean): FieldSpec {
|
|
692
|
+
if (isRecord(value) && "schema" in value) {
|
|
693
|
+
return {
|
|
694
|
+
schema: value.schema,
|
|
695
|
+
required: typeof value.required === "boolean" ? value.required : defaultRequired,
|
|
696
|
+
nullable: value.nullable === true,
|
|
697
|
+
description: typeof value.description === "string" ? value.description : undefined,
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
return {
|
|
702
|
+
schema: value,
|
|
703
|
+
required: defaultRequired,
|
|
704
|
+
nullable: false,
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
function resolveRenderableSchema(schema: unknown): unknown {
|
|
709
|
+
if (isValueTypeRefSchema(schema) && schema._resolved) {
|
|
710
|
+
return schema._resolved
|
|
711
|
+
}
|
|
712
|
+
return schema
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
function defaultJsonForSchema(schema: unknown): string {
|
|
716
|
+
if (isArraySchema(schema)) return "[]"
|
|
717
|
+
if (isMapSchema(schema)) return "{}"
|
|
718
|
+
return ""
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
function initialFormValueForSchema(schema: unknown, value: unknown): string | null {
|
|
722
|
+
if (value === undefined || value === null || isObjectSchema(schema)) return null
|
|
723
|
+
|
|
724
|
+
if (isObjectRefSchema(schema)) {
|
|
725
|
+
if (typeof value === "string") return value
|
|
726
|
+
if (isRecord(value) && typeof value.primaryId === "string") return value.primaryId
|
|
727
|
+
return null
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
if (isEnumSchema(schema)) {
|
|
731
|
+
const matchingOption = schema.values.find((option) => String(option) === String(value))
|
|
732
|
+
return matchingOption === undefined ? null : String(matchingOption)
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
if (schema === "boolean") {
|
|
736
|
+
return typeof value === "boolean" ? String(value) : null
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
if (schema === "fileRef") {
|
|
740
|
+
return isFileRef(value) ? JSON.stringify(value) : null
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
if (schema === "userRef") {
|
|
744
|
+
return isRecord(value) && typeof value.id === "string" ? value.id : null
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
if (schema === "date" && typeof value === "string") {
|
|
748
|
+
return value.slice(0, 10)
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
if (schema === "timestamp" && typeof value === "string") {
|
|
752
|
+
return timestampInputValue(value)
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
if (isPrimitiveSchema(schema) && schema !== "fileRef") {
|
|
756
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
757
|
+
return String(value)
|
|
758
|
+
}
|
|
759
|
+
return null
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
try {
|
|
763
|
+
return JSON.stringify(value, null, 2)
|
|
764
|
+
} catch {
|
|
765
|
+
return null
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
function timestampInputValue(value: string): string {
|
|
770
|
+
const date = new Date(value)
|
|
771
|
+
if (Number.isNaN(date.getTime())) return value
|
|
772
|
+
|
|
773
|
+
// datetime-local inputs expect wall-clock time, so preserve the instant by displaying local time.
|
|
774
|
+
const offsetMs = date.getTimezoneOffset() * 60_000
|
|
775
|
+
return new Date(date.getTime() - offsetMs).toISOString().slice(0, 16)
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
function inputTypeForPrimitive(schema: PrimitiveSchema): string {
|
|
779
|
+
if (schema === "integer" || schema === "double") return "number"
|
|
780
|
+
if (schema === "date") return "date"
|
|
781
|
+
if (schema === "timestamp") return "datetime-local"
|
|
782
|
+
return "text"
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
function placeholderForPrimitive(schema: PrimitiveSchema): string {
|
|
786
|
+
if (schema === "uuid") return "00000000-0000-0000-0000-000000000000"
|
|
787
|
+
if (schema === "userRef") return "User ID"
|
|
788
|
+
if (schema === "date") return "YYYY-MM-DD"
|
|
789
|
+
if (schema === "timestamp") return "YYYY-MM-DDTHH:mm"
|
|
790
|
+
if (schema === "integer" || schema === "double" || schema === "decimal") return "0"
|
|
791
|
+
return "Enter a value"
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
export function workflowInputPathKey(path: readonly string[]): string {
|
|
795
|
+
return path.join(keySeparator)
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
function pathKey(path: readonly string[]): string {
|
|
799
|
+
return workflowInputPathKey(path)
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
function fieldLabel(path: readonly string[]): string {
|
|
803
|
+
return path.join(".")
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
function fieldControlId(path: readonly string[]): string {
|
|
807
|
+
return `workflow-input-${path.map((part) => part.replace(/[^a-zA-Z0-9_-]/g, "-")).join("-")}`
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
type PrimitiveSchema =
|
|
811
|
+
| "string"
|
|
812
|
+
| "integer"
|
|
813
|
+
| "double"
|
|
814
|
+
| "decimal"
|
|
815
|
+
| "boolean"
|
|
816
|
+
| "date"
|
|
817
|
+
| "timestamp"
|
|
818
|
+
| "uuid"
|
|
819
|
+
| "fileRef"
|
|
820
|
+
| "userRef"
|
|
821
|
+
|
|
822
|
+
type EnumSchema = {
|
|
823
|
+
readonly type: "enum"
|
|
824
|
+
readonly valueType: "string" | "integer"
|
|
825
|
+
readonly values: readonly (string | number)[]
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
type ObjectRefSchema = {
|
|
829
|
+
readonly type: "objectRef"
|
|
830
|
+
readonly objectTypeId: string
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
type ObjectSchema = {
|
|
834
|
+
readonly type: "object"
|
|
835
|
+
readonly properties: Readonly<Record<string, unknown>>
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
type ValueTypeRefSchema = {
|
|
839
|
+
readonly type: "valueTypeRef"
|
|
840
|
+
readonly valueTypeId: string
|
|
841
|
+
readonly _resolved?: unknown
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
type ArraySchema = {
|
|
845
|
+
readonly type: "array"
|
|
846
|
+
readonly items: unknown
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
type MapSchema = {
|
|
850
|
+
readonly type: "map"
|
|
851
|
+
readonly valueSchema: unknown
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
function isPrimitiveSchema(value: unknown): value is PrimitiveSchema {
|
|
855
|
+
return (
|
|
856
|
+
value === "string" ||
|
|
857
|
+
value === "integer" ||
|
|
858
|
+
value === "double" ||
|
|
859
|
+
value === "decimal" ||
|
|
860
|
+
value === "boolean" ||
|
|
861
|
+
value === "date" ||
|
|
862
|
+
value === "timestamp" ||
|
|
863
|
+
value === "uuid" ||
|
|
864
|
+
value === "fileRef" ||
|
|
865
|
+
value === "userRef"
|
|
866
|
+
)
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
function isObjectRefSchema(value: unknown): value is ObjectRefSchema {
|
|
870
|
+
return isRecord(value) && value.type === "objectRef" && typeof value.objectTypeId === "string"
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
function isEnumSchema(value: unknown): value is EnumSchema {
|
|
874
|
+
return (
|
|
875
|
+
isRecord(value) &&
|
|
876
|
+
value.type === "enum" &&
|
|
877
|
+
(value.valueType === "string" || value.valueType === "integer") &&
|
|
878
|
+
Array.isArray(value.values)
|
|
879
|
+
)
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
function isObjectSchema(value: unknown): value is ObjectSchema {
|
|
883
|
+
return isRecord(value) && value.type === "object" && isRecord(value.properties)
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
function isValueTypeRefSchema(value: unknown): value is ValueTypeRefSchema {
|
|
887
|
+
return isRecord(value) && value.type === "valueTypeRef" && typeof value.valueTypeId === "string"
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
function isArraySchema(value: unknown): value is ArraySchema {
|
|
891
|
+
return isRecord(value) && value.type === "array"
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
function isMapSchema(value: unknown): value is MapSchema {
|
|
895
|
+
return isRecord(value) && value.type === "map"
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
899
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
900
|
+
}
|