@xemahq/ui-kernel 0.9.2 → 0.11.0
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/dist/lib/biome-host/agent-validation.d.ts.map +1 -1
- package/dist/lib/biome-host/agent-validation.js +26 -13
- package/dist/lib/biome-host/agent-validation.js.map +1 -1
- package/dist/lib/biome-host/biome-registry.d.ts.map +1 -1
- package/dist/lib/biome-host/biome-registry.js +27 -10
- package/dist/lib/biome-host/biome-registry.js.map +1 -1
- package/dist/lib/biome-host/biome-scope-hooks.d.ts.map +1 -1
- package/dist/lib/biome-host/biome-scope-hooks.js +2 -1
- package/dist/lib/biome-host/biome-scope-hooks.js.map +1 -1
- package/dist/lib/biome-host/biome-scoped-query.d.ts.map +1 -1
- package/dist/lib/biome-host/biome-scoped-query.js +5 -3
- package/dist/lib/biome-host/biome-scoped-query.js.map +1 -1
- package/dist/lib/biome-host/frontend-biome.d.ts +1 -1
- package/dist/lib/biome-host/frontend-biome.d.ts.map +1 -1
- package/dist/lib/biome-host/host-bridge.d.ts +1 -1
- package/dist/lib/biome-host/host-bridge.d.ts.map +1 -1
- package/dist/lib/biome-host/host-bridge.js.map +1 -1
- package/dist/lib/biome-host/i18n-hooks.d.ts.map +1 -1
- package/dist/lib/biome-host/i18n-hooks.js.map +1 -1
- package/dist/lib/biome-host/index.d.ts +0 -1
- package/dist/lib/biome-host/index.d.ts.map +1 -1
- package/dist/lib/biome-host/index.js +0 -1
- package/dist/lib/biome-host/index.js.map +1 -1
- package/dist/lib/biome-host/realtime-hooks.d.ts.map +1 -1
- package/dist/lib/biome-host/realtime-hooks.js.map +1 -1
- package/dist/lib/biome-host/session-contributions.d.ts +10 -5
- package/dist/lib/biome-host/session-contributions.d.ts.map +1 -1
- package/dist/lib/biome-host/use-mutation-with-error-toast.d.ts.map +1 -1
- package/dist/lib/biome-host/use-mutation-with-error-toast.js +3 -2
- package/dist/lib/biome-host/use-mutation-with-error-toast.js.map +1 -1
- package/dist/lib/biome-host/use-page-state.d.ts.map +1 -1
- package/dist/lib/biome-host/use-page-state.js +19 -10
- package/dist/lib/biome-host/use-page-state.js.map +1 -1
- package/dist/lib/capabilities/capability-provider.d.ts +1 -1
- package/dist/lib/capabilities/capability-provider.d.ts.map +1 -1
- package/dist/lib/capabilities/capability-provider.js +2 -2
- package/dist/lib/capabilities/capability-provider.js.map +1 -1
- package/dist/lib/capabilities/use-capability.d.ts +1 -1
- package/dist/lib/capabilities/use-capability.d.ts.map +1 -1
- package/dist/lib/capabilities/use-capability.js +2 -1
- package/dist/lib/capabilities/use-capability.js.map +1 -1
- package/dist/lib/contribution-registry/contribution-registry.d.ts.map +1 -1
- package/dist/lib/contribution-registry/contribution-registry.js +2 -1
- package/dist/lib/contribution-registry/contribution-registry.js.map +1 -1
- package/dist/lib/system-bus/deeplink.d.ts.map +1 -1
- package/dist/lib/system-bus/deeplink.js +4 -2
- package/dist/lib/system-bus/deeplink.js.map +1 -1
- package/dist/lib/system-bus/host-ports.d.ts +2 -2
- package/dist/lib/system-bus/host-ports.d.ts.map +1 -1
- package/dist/lib/system-bus/intent-registry.d.ts.map +1 -1
- package/dist/lib/system-bus/intent-registry.js +6 -3
- package/dist/lib/system-bus/intent-registry.js.map +1 -1
- package/dist/lib/system-bus/intents.d.ts +1 -1
- package/dist/lib/system-bus/intents.d.ts.map +1 -1
- package/dist/lib/system-bus/palette.d.ts +1 -1
- package/dist/lib/system-bus/palette.d.ts.map +1 -1
- package/dist/lib/system-bus/system-bus-builder.d.ts.map +1 -1
- package/dist/lib/system-bus/system-bus-builder.js +1 -1
- package/dist/lib/system-bus/system-bus-builder.js.map +1 -1
- package/dist/lib/system-bus/windows.d.ts +1 -1
- package/dist/lib/system-bus/windows.d.ts.map +1 -1
- package/dist/offline/outbox.d.ts +1 -0
- package/dist/offline/outbox.d.ts.map +1 -1
- package/dist/offline/outbox.js +4 -1
- package/dist/offline/outbox.js.map +1 -1
- package/dist/offline/react-hooks.d.ts +1 -1
- package/dist/offline/react-hooks.d.ts.map +1 -1
- package/dist/offline/react-hooks.js.map +1 -1
- package/dist/org-db/components/DbResultTable.d.ts.map +1 -1
- package/dist/org-db/components/DbResultTable.js +15 -6
- package/dist/org-db/components/DbResultTable.js.map +1 -1
- package/dist/registry/lib/agent-validation-host.d.ts.map +1 -1
- package/dist/registry/lib/agent-validation-host.js +1 -1
- package/dist/registry/lib/agent-validation-host.js.map +1 -1
- package/dist/registry/lib/biome-slot.d.ts.map +1 -1
- package/dist/registry/lib/biome-slot.js +5 -3
- package/dist/registry/lib/biome-slot.js.map +1 -1
- package/dist/registry/lib/primitives/SessionEventCard.d.ts.map +1 -1
- package/dist/registry/lib/primitives/SessionEventCard.js +14 -2
- package/dist/registry/lib/primitives/SessionEventCard.js.map +1 -1
- package/dist/registry/lib/primitives/SessionEventTimeline.d.ts.map +1 -1
- package/dist/registry/lib/primitives/SessionEventTimeline.js +6 -3
- package/dist/registry/lib/primitives/SessionEventTimeline.js.map +1 -1
- package/dist/registry/lib/primitives/SessionTabbedDrawer.d.ts.map +1 -1
- package/dist/registry/lib/primitives/SessionTabbedDrawer.js +10 -5
- package/dist/registry/lib/primitives/SessionTabbedDrawer.js.map +1 -1
- package/dist/registry/lib/session-context-builder.d.ts +10 -2
- package/dist/registry/lib/session-context-builder.d.ts.map +1 -1
- package/dist/registry/lib/session-context-builder.js +14 -7
- package/dist/registry/lib/session-context-builder.js.map +1 -1
- package/dist/registry/lib/session-context-provider.d.ts +1 -1
- package/dist/registry/lib/session-context-provider.d.ts.map +1 -1
- package/dist/registry/lib/session-context-provider.js.map +1 -1
- package/dist/registry/lib/session-selectors.d.ts.map +1 -1
- package/dist/registry/lib/session-selectors.js +35 -20
- package/dist/registry/lib/session-selectors.js.map +1 -1
- package/dist/session/comments/CommentRail.d.ts.map +1 -1
- package/dist/session/comments/CommentRail.js.map +1 -1
- package/dist/session/shell/SessionWorkspaceShell.d.ts.map +1 -1
- package/dist/session/shell/SessionWorkspaceShell.js.map +1 -1
- package/dist/session-kit/approvals/ApprovalCard.d.ts.map +1 -1
- package/dist/session-kit/approvals/ApprovalCard.js +6 -2
- package/dist/session-kit/approvals/ApprovalCard.js.map +1 -1
- package/dist/session-kit/approvals/ApprovalsCenter.d.ts.map +1 -1
- package/dist/session-kit/approvals/ApprovalsCenter.js +6 -3
- package/dist/session-kit/approvals/ApprovalsCenter.js.map +1 -1
- package/dist/session-kit/combobox/Combobox.d.ts.map +1 -1
- package/dist/session-kit/combobox/Combobox.js +20 -6
- package/dist/session-kit/combobox/Combobox.js.map +1 -1
- package/dist/session-kit/display/MD.d.ts.map +1 -1
- package/dist/session-kit/display/MD.js +7 -4
- package/dist/session-kit/display/MD.js.map +1 -1
- package/dist/ui/branding/app-branding-provider.d.ts.map +1 -1
- package/dist/ui/branding/app-branding-provider.js.map +1 -1
- package/dist/ui/branding/sanitize.d.ts.map +1 -1
- package/dist/ui/branding/sanitize.js +12 -6
- package/dist/ui/branding/sanitize.js.map +1 -1
- package/dist/ui/capture/document-preview.d.ts +1 -1
- package/dist/ui/capture/document-preview.d.ts.map +1 -1
- package/dist/ui/capture/document-preview.js +8 -6
- package/dist/ui/capture/document-preview.js.map +1 -1
- package/dist/ui/capture/field-spec-to-zod.d.ts.map +1 -1
- package/dist/ui/capture/field-spec-to-zod.js +45 -16
- package/dist/ui/capture/field-spec-to-zod.js.map +1 -1
- package/dist/ui/capture/field-spec-validate.d.ts.map +1 -1
- package/dist/ui/capture/field-spec-validate.js +79 -38
- package/dist/ui/capture/field-spec-validate.js.map +1 -1
- package/dist/ui/capture/field-spec.d.ts.map +1 -1
- package/dist/ui/capture/field-spec.js +17 -6
- package/dist/ui/capture/field-spec.js.map +1 -1
- package/dist/ui/capture/schema-field-input.d.ts.map +1 -1
- package/dist/ui/capture/schema-field-input.js +23 -18
- package/dist/ui/capture/schema-field-input.js.map +1 -1
- package/dist/ui/capture/schema-form.d.ts +1 -1
- package/dist/ui/capture/schema-form.d.ts.map +1 -1
- package/dist/ui/capture/schema-form.js +7 -6
- package/dist/ui/capture/schema-form.js.map +1 -1
- package/dist/ui/capture/use-prefill.d.ts.map +1 -1
- package/dist/ui/capture/use-prefill.js +32 -14
- package/dist/ui/capture/use-prefill.js.map +1 -1
- package/dist/ui/capture/use-schema-validation.d.ts +1 -1
- package/dist/ui/capture/use-schema-validation.d.ts.map +1 -1
- package/dist/ui/capture/use-schema-validation.js +13 -8
- package/dist/ui/capture/use-schema-validation.js.map +1 -1
- package/dist/ui/capture/use-wizard.d.ts.map +1 -1
- package/dist/ui/capture/use-wizard.js +23 -8
- package/dist/ui/capture/use-wizard.js.map +1 -1
- package/dist/ui/capture/value-format.d.ts.map +1 -1
- package/dist/ui/capture/value-format.js +6 -3
- package/dist/ui/capture/value-format.js.map +1 -1
- package/dist/ui/capture/wizard.d.ts.map +1 -1
- package/dist/ui/capture/wizard.js +3 -3
- package/dist/ui/capture/wizard.js.map +1 -1
- package/dist/ui/charts/bar-chart.d.ts +1 -1
- package/dist/ui/charts/bar-chart.d.ts.map +1 -1
- package/dist/ui/charts/bar-chart.js +1 -1
- package/dist/ui/charts/bar-chart.js.map +1 -1
- package/dist/ui/charts/chart-frame.d.ts +2 -2
- package/dist/ui/charts/chart-frame.d.ts.map +1 -1
- package/dist/ui/charts/chart-frame.js +4 -3
- package/dist/ui/charts/chart-frame.js.map +1 -1
- package/dist/ui/charts/chart-utils.d.ts.map +1 -1
- package/dist/ui/charts/chart-utils.js +32 -14
- package/dist/ui/charts/chart-utils.js.map +1 -1
- package/dist/ui/charts/donut-chart.d.ts +1 -1
- package/dist/ui/charts/donut-chart.d.ts.map +1 -1
- package/dist/ui/charts/donut-chart.js +7 -3
- package/dist/ui/charts/donut-chart.js.map +1 -1
- package/dist/ui/charts/line-chart.d.ts +1 -1
- package/dist/ui/charts/line-chart.d.ts.map +1 -1
- package/dist/ui/charts/line-chart.js +7 -4
- package/dist/ui/charts/line-chart.js.map +1 -1
- package/dist/ui/charts/sparkline.d.ts +1 -1
- package/dist/ui/charts/sparkline.d.ts.map +1 -1
- package/dist/ui/charts/sparkline.js +10 -6
- package/dist/ui/charts/sparkline.js.map +1 -1
- package/dist/ui/chrome/AsyncBoundary.d.ts +2 -2
- package/dist/ui/chrome/AsyncBoundary.d.ts.map +1 -1
- package/dist/ui/chrome/AsyncBoundary.js +3 -3
- package/dist/ui/chrome/AsyncBoundary.js.map +1 -1
- package/dist/ui/chrome/EmptyState.d.ts +19 -8
- package/dist/ui/chrome/EmptyState.d.ts.map +1 -1
- package/dist/ui/chrome/EmptyState.js +6 -4
- package/dist/ui/chrome/EmptyState.js.map +1 -1
- package/dist/ui/chrome/RecordCardList.d.ts +19 -0
- package/dist/ui/chrome/RecordCardList.d.ts.map +1 -0
- package/dist/ui/chrome/RecordCardList.js +12 -0
- package/dist/ui/chrome/RecordCardList.js.map +1 -0
- package/dist/ui/chrome/page-shell.d.ts.map +1 -1
- package/dist/ui/chrome/page-shell.js +9 -3
- package/dist/ui/chrome/page-shell.js.map +1 -1
- package/dist/ui/chrome/status-badge.d.ts.map +1 -1
- package/dist/ui/chrome/status-badge.js +1 -1
- package/dist/ui/chrome/status-badge.js.map +1 -1
- package/dist/ui/design-tokens.d.ts +4 -6
- package/dist/ui/design-tokens.d.ts.map +1 -1
- package/dist/ui/design-tokens.js +17 -11
- package/dist/ui/design-tokens.js.map +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/primitives/async-combobox.d.ts.map +1 -1
- package/dist/ui/primitives/async-combobox.js +4 -2
- package/dist/ui/primitives/async-combobox.js.map +1 -1
- package/dist/ui/primitives/badge.d.ts +2 -2
- package/dist/ui/primitives/badge.d.ts.map +1 -1
- package/dist/ui/primitives/badge.js +3 -3
- package/dist/ui/primitives/badge.js.map +1 -1
- package/dist/ui/primitives/button.d.ts +2 -2
- package/dist/ui/primitives/button.d.ts.map +1 -1
- package/dist/ui/primitives/button.js +5 -5
- package/dist/ui/primitives/button.js.map +1 -1
- package/dist/ui/primitives/overflow-tabs.d.ts.map +1 -1
- package/dist/ui/primitives/overflow-tabs.js +19 -12
- package/dist/ui/primitives/overflow-tabs.js.map +1 -1
- package/dist/ui/primitives/preview-device-frame.js +8 -4
- package/dist/ui/primitives/preview-device-frame.js.map +1 -1
- package/dist/ui/primitives/tag-multi-select.d.ts.map +1 -1
- package/dist/ui/primitives/tag-multi-select.js +10 -5
- package/dist/ui/primitives/tag-multi-select.js.map +1 -1
- package/dist/ui/primitives/url-preview-chrome.d.ts.map +1 -1
- package/dist/ui/primitives/url-preview-chrome.js.map +1 -1
- package/dist/vista/GenericCatalogueSurface.d.ts.map +1 -1
- package/dist/vista/GenericCatalogueSurface.js +5 -3
- package/dist/vista/GenericCatalogueSurface.js.map +1 -1
- package/dist/vista/VistaPanel.d.ts.map +1 -1
- package/dist/vista/VistaPanel.js +8 -4
- package/dist/vista/VistaPanel.js.map +1 -1
- package/dist/vista/html/CustomUiFrame.d.ts.map +1 -1
- package/dist/vista/html/CustomUiFrame.js +2 -1
- package/dist/vista/html/CustomUiFrame.js.map +1 -1
- package/dist/vista/html/custom-ui-frame-bridge.d.ts.map +1 -1
- package/dist/vista/html/custom-ui-frame-bridge.js +6 -3
- package/dist/vista/html/custom-ui-frame-bridge.js.map +1 -1
- package/dist/vista/html/custom-ui-intents.d.ts.map +1 -1
- package/dist/vista/html/custom-ui-intents.js +13 -15
- package/dist/vista/html/custom-ui-intents.js.map +1 -1
- package/dist/vista/surface-catalogue.d.ts.map +1 -1
- package/dist/vista/surface-catalogue.js +6 -3
- package/dist/vista/surface-catalogue.js.map +1 -1
- package/dist/vista/surfaces/FormSurface.d.ts.map +1 -1
- package/dist/vista/surfaces/FormSurface.js +20 -7
- package/dist/vista/surfaces/FormSurface.js.map +1 -1
- package/dist/vista/surfaces/TableSurface.d.ts.map +1 -1
- package/dist/vista/surfaces/TableSurface.js +2 -1
- package/dist/vista/surfaces/TableSurface.js.map +1 -1
- package/dist/vista/surfaces/blob-surfaces.d.ts.map +1 -1
- package/dist/vista/surfaces/blob-surfaces.js +7 -2
- package/dist/vista/surfaces/blob-surfaces.js.map +1 -1
- package/dist/vista/surfaces/elicitation-transport.d.ts.map +1 -1
- package/dist/vista/surfaces/elicitation-transport.js +14 -7
- package/dist/vista/surfaces/elicitation-transport.js.map +1 -1
- package/dist/vista/surfaces/file-surface-utils.d.ts.map +1 -1
- package/dist/vista/surfaces/file-surface-utils.js +8 -4
- package/dist/vista/surfaces/file-surface-utils.js.map +1 -1
- package/dist/vista/surfaces/register-surfaces.js +2 -1
- package/dist/vista/surfaces/register-surfaces.js.map +1 -1
- package/dist/vista/surfaces/text-surfaces.d.ts +1 -1
- package/dist/vista/surfaces/text-surfaces.d.ts.map +1 -1
- package/dist/vista/surfaces/text-surfaces.js +13 -7
- package/dist/vista/surfaces/text-surfaces.js.map +1 -1
- package/dist/vista/use-vista-tabs.d.ts.map +1 -1
- package/dist/vista/use-vista-tabs.js +8 -4
- package/dist/vista/use-vista-tabs.js.map +1 -1
- package/dist/vista/vista-code-renderer.d.ts.map +1 -1
- package/dist/vista/vista-code-renderer.js.map +1 -1
- package/dist/vista/vista-file-source.d.ts.map +1 -1
- package/dist/vista/vista-file-source.js +9 -5
- package/dist/vista/vista-file-source.js.map +1 -1
- package/dist/vista/vista-form-host.d.ts.map +1 -1
- package/dist/vista/vista-form-host.js +1 -1
- package/dist/vista/vista-form-host.js.map +1 -1
- package/dist/vista/vista-model.d.ts.map +1 -1
- package/dist/vista/vista-model.js +5 -3
- package/dist/vista/vista-model.js.map +1 -1
- package/dist/vista/vista-open-context.d.ts.map +1 -1
- package/dist/vista/vista-open-context.js +1 -1
- package/dist/vista/vista-open-context.js.map +1 -1
- package/dist/vista/vista-payloads.d.ts.map +1 -1
- package/dist/vista/vista-payloads.js +127 -63
- package/dist/vista/vista-payloads.js.map +1 -1
- package/dist/vista/vista-tabs-manifest.d.ts.map +1 -1
- package/dist/vista/vista-tabs-manifest.js +18 -9
- package/dist/vista/vista-tabs-manifest.js.map +1 -1
- package/dist/vista/vista-tools.d.ts.map +1 -1
- package/dist/vista/vista-tools.js +12 -6
- package/dist/vista/vista-tools.js.map +1 -1
- package/package.json +3 -3
- package/src/lib/biome-host/agent-validation.ts +37 -13
- package/src/lib/biome-host/biome-registry.ts +48 -13
- package/src/lib/biome-host/biome-scope-hooks.ts +3 -1
- package/src/lib/biome-host/biome-scoped-query.ts +7 -6
- package/src/lib/biome-host/frontend-biome.ts +1 -1
- package/src/lib/biome-host/host-bridge.ts +5 -4
- package/src/lib/biome-host/i18n-hooks.ts +1 -0
- package/src/lib/biome-host/index.ts +0 -1
- package/src/lib/biome-host/realtime-hooks.ts +1 -0
- package/src/lib/biome-host/session-contributions.ts +22 -19
- package/src/lib/biome-host/use-mutation-with-error-toast.ts +4 -2
- package/src/lib/biome-host/use-page-state.ts +27 -10
- package/src/lib/capabilities/capability-provider.tsx +12 -5
- package/src/lib/capabilities/use-capability.ts +8 -4
- package/src/lib/contribution-registry/contribution-registry.ts +3 -1
- package/src/lib/system-bus/deeplink.ts +14 -4
- package/src/lib/system-bus/host-ports.ts +3 -7
- package/src/lib/system-bus/intent-registry.ts +12 -8
- package/src/lib/system-bus/intents.ts +6 -2
- package/src/lib/system-bus/palette.ts +2 -1
- package/src/lib/system-bus/system-bus-builder.ts +4 -2
- package/src/lib/system-bus/windows.ts +1 -1
- package/src/offline/outbox.test.ts +12 -3
- package/src/offline/outbox.ts +5 -1
- package/src/offline/react-hooks.ts +5 -2
- package/src/org-db/components/DbResultTable.tsx +48 -15
- package/src/registry/lib/agent-validation-host.ts +1 -2
- package/src/registry/lib/biome-slot.tsx +7 -4
- package/src/registry/lib/primitives/SessionEventCard.tsx +29 -5
- package/src/registry/lib/primitives/SessionEventTimeline.tsx +9 -3
- package/src/registry/lib/primitives/SessionTabbedDrawer.tsx +15 -5
- package/src/registry/lib/session-context-builder.ts +33 -17
- package/src/registry/lib/session-context-provider.tsx +1 -1
- package/src/registry/lib/session-selectors.ts +66 -27
- package/src/session/comments/CommentRail.tsx +2 -2
- package/src/session/shell/SessionWorkspaceShell.tsx +2 -2
- package/src/session-kit/approvals/ApprovalCard.tsx +7 -2
- package/src/session-kit/approvals/ApprovalsCenter.tsx +13 -4
- package/src/session-kit/combobox/Combobox.tsx +42 -11
- package/src/session-kit/display/MD.tsx +14 -5
- package/src/ui/branding/app-branding-provider.tsx +2 -3
- package/src/ui/branding/sanitize.ts +18 -6
- package/src/ui/capture/document-preview.tsx +84 -19
- package/src/ui/capture/field-spec-to-zod.ts +62 -14
- package/src/ui/capture/field-spec-validate.ts +132 -43
- package/src/ui/capture/field-spec.test.ts +2 -2
- package/src/ui/capture/field-spec.ts +41 -10
- package/src/ui/capture/schema-field-input.tsx +218 -38
- package/src/ui/capture/schema-form.tsx +54 -13
- package/src/ui/capture/use-prefill.ts +50 -17
- package/src/ui/capture/use-schema-validation.ts +45 -13
- package/src/ui/capture/use-wizard.ts +57 -11
- package/src/ui/capture/value-format.ts +14 -4
- package/src/ui/capture/wizard.tsx +9 -5
- package/src/ui/charts/bar-chart.tsx +8 -4
- package/src/ui/charts/chart-frame.tsx +18 -5
- package/src/ui/charts/chart-utils.ts +47 -15
- package/src/ui/charts/donut-chart.tsx +24 -6
- package/src/ui/charts/line-chart.tsx +34 -12
- package/src/ui/charts/sparkline.tsx +17 -9
- package/src/ui/chrome/AsyncBoundary.tsx +14 -6
- package/src/ui/chrome/EmptyState.tsx +116 -43
- package/src/ui/chrome/RecordCardList.tsx +98 -0
- package/src/ui/chrome/page-shell.tsx +32 -8
- package/src/ui/chrome/status-badge.tsx +8 -4
- package/src/ui/design-tokens.ts +39 -13
- package/src/ui/index.ts +5 -0
- package/src/ui/primitives/async-combobox.tsx +7 -3
- package/src/ui/primitives/badge.tsx +14 -5
- package/src/ui/primitives/button.tsx +13 -6
- package/src/ui/primitives/overflow-tabs.tsx +46 -16
- package/src/ui/primitives/preview-device-frame.tsx +12 -4
- package/src/ui/primitives/tag-multi-select.tsx +30 -9
- package/src/ui/primitives/url-preview-chrome.tsx +1 -0
- package/src/vista/GenericCatalogueSurface.tsx +7 -5
- package/src/vista/VistaPanel.tsx +12 -4
- package/src/vista/html/CustomUiFrame.spec.tsx +3 -1
- package/src/vista/html/CustomUiFrame.tsx +3 -1
- package/src/vista/html/custom-ui-frame-bridge.ts +9 -3
- package/src/vista/html/custom-ui-intents.spec.ts +3 -1
- package/src/vista/html/custom-ui-intents.ts +19 -15
- package/src/vista/surface-catalogue.ts +9 -3
- package/src/vista/surfaces/FormSurface.tsx +27 -10
- package/src/vista/surfaces/TableSurface.tsx +4 -3
- package/src/vista/surfaces/blob-surfaces.tsx +13 -3
- package/src/vista/surfaces/elicitation-transport.ts +21 -7
- package/src/vista/surfaces/file-surface-utils.ts +11 -4
- package/src/vista/surfaces/register-surfaces.tsx +3 -1
- package/src/vista/surfaces/text-surfaces.tsx +21 -8
- package/src/vista/use-vista-tabs.ts +12 -4
- package/src/vista/vista-code-renderer.tsx +6 -5
- package/src/vista/vista-file-source.tsx +15 -14
- package/src/vista/vista-form-host.tsx +3 -8
- package/src/vista/vista-model.ts +10 -3
- package/src/vista/vista-open-context.tsx +3 -8
- package/src/vista/vista-payloads.ts +186 -63
- package/src/vista/vista-tabs-manifest.ts +28 -13
- package/src/vista/vista-tools.ts +18 -6
- package/dist/lib/biome-host/session-profiles.d.ts +0 -18
- package/dist/lib/biome-host/session-profiles.d.ts.map +0 -1
- package/dist/lib/biome-host/session-profiles.js +0 -38
- package/dist/lib/biome-host/session-profiles.js.map +0 -1
- package/src/lib/biome-host/session-profiles.ts +0 -105
|
@@ -29,7 +29,9 @@ function asRecord(value: unknown): UnknownRecord | null {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function optionalString(value: unknown): string | undefined | null {
|
|
32
|
-
if (value === undefined)
|
|
32
|
+
if (value === undefined) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
33
35
|
return typeof value === 'string' ? value : null;
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -43,7 +45,9 @@ function exactlyOne(
|
|
|
43
45
|
): Readonly<{ a?: string; b?: string }> | null {
|
|
44
46
|
const left = typeof a === 'string' ? a : undefined;
|
|
45
47
|
const right = typeof b === 'string' ? b : undefined;
|
|
46
|
-
if ((left === undefined) === (right === undefined))
|
|
48
|
+
if ((left === undefined) === (right === undefined)) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
47
51
|
return left === undefined ? { b: right } : { a: left };
|
|
48
52
|
}
|
|
49
53
|
|
|
@@ -59,11 +63,17 @@ export interface VistaTextPayload {
|
|
|
59
63
|
|
|
60
64
|
export function validateTextPayload(raw: unknown): VistaTextPayload | null {
|
|
61
65
|
const record = asRecord(raw);
|
|
62
|
-
if (record === null)
|
|
66
|
+
if (record === null) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
63
69
|
const source = exactlyOne(record.content, record.path);
|
|
64
|
-
if (source === null)
|
|
70
|
+
if (source === null) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
65
73
|
const language = optionalString(record.language);
|
|
66
|
-
if (language === null)
|
|
74
|
+
if (language === null) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
67
77
|
const base: VistaTextPayload =
|
|
68
78
|
source.a === undefined ? { path: source.b } : { content: source.a };
|
|
69
79
|
return language === undefined ? base : { ...base, language };
|
|
@@ -83,21 +93,33 @@ export interface VistaBlobPayload {
|
|
|
83
93
|
|
|
84
94
|
export function validateBlobPayload(raw: unknown): VistaBlobPayload | null {
|
|
85
95
|
const record = asRecord(raw);
|
|
86
|
-
if (record === null)
|
|
96
|
+
if (record === null) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
87
99
|
const source = exactlyOne(record.url, record.path);
|
|
88
|
-
if (source === null)
|
|
100
|
+
if (source === null) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
89
103
|
const alt = optionalString(record.alt);
|
|
90
|
-
if (alt === null)
|
|
104
|
+
if (alt === null) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
91
107
|
const contentType = optionalString(record.contentType);
|
|
92
|
-
if (contentType === null)
|
|
108
|
+
if (contentType === null) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
93
111
|
const payload: {
|
|
94
112
|
url?: string;
|
|
95
113
|
path?: string;
|
|
96
114
|
alt?: string;
|
|
97
115
|
contentType?: string;
|
|
98
116
|
} = source.a === undefined ? { path: source.b } : { url: source.a };
|
|
99
|
-
if (alt !== undefined)
|
|
100
|
-
|
|
117
|
+
if (alt !== undefined) {
|
|
118
|
+
payload.alt = alt;
|
|
119
|
+
}
|
|
120
|
+
if (contentType !== undefined) {
|
|
121
|
+
payload.contentType = contentType;
|
|
122
|
+
}
|
|
101
123
|
return payload;
|
|
102
124
|
}
|
|
103
125
|
|
|
@@ -120,16 +142,24 @@ const PREVIEW_DEVICES: readonly PreviewDevice[] = [
|
|
|
120
142
|
|
|
121
143
|
export function validateUrlPayload(raw: unknown): VistaUrlPayload | null {
|
|
122
144
|
const record = asRecord(raw);
|
|
123
|
-
if (record === null)
|
|
124
|
-
|
|
145
|
+
if (record === null) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
if (typeof record.url !== 'string' || record.url.length === 0) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
125
151
|
const payload: { url: string; device?: PreviewDevice; reloadNonce?: number } =
|
|
126
152
|
{ url: record.url };
|
|
127
153
|
if (record.device !== undefined) {
|
|
128
|
-
if (!PREVIEW_DEVICES.includes(record.device as PreviewDevice))
|
|
154
|
+
if (!PREVIEW_DEVICES.includes(record.device as PreviewDevice)) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
129
157
|
payload.device = record.device as PreviewDevice;
|
|
130
158
|
}
|
|
131
159
|
if (record.reloadNonce !== undefined) {
|
|
132
|
-
if (typeof record.reloadNonce !== 'number')
|
|
160
|
+
if (typeof record.reloadNonce !== 'number') {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
133
163
|
payload.reloadNonce = record.reloadNonce;
|
|
134
164
|
}
|
|
135
165
|
return payload;
|
|
@@ -159,18 +189,30 @@ const SRI_TOKEN = /^sha384-[A-Za-z0-9+/]+={0,2}$/;
|
|
|
159
189
|
|
|
160
190
|
export function validateHtmlPayload(raw: unknown): VistaHtmlPayload | null {
|
|
161
191
|
const record = asRecord(raw);
|
|
162
|
-
if (record === null)
|
|
192
|
+
if (record === null) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
163
195
|
const hasDocument = typeof record.document === 'string';
|
|
164
196
|
const hasChunk = typeof record.compiledOutput === 'string';
|
|
165
|
-
if (hasDocument === hasChunk)
|
|
166
|
-
|
|
197
|
+
if (hasDocument === hasChunk) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
if (hasDocument) {
|
|
201
|
+
return { document: record.document as string };
|
|
202
|
+
}
|
|
167
203
|
// A compiled chunk WITHOUT a well-formed integrity token is rejected: the
|
|
168
204
|
// CSP hash source is what makes executing it safe, so there is no
|
|
169
205
|
// "run it unpinned" path.
|
|
170
|
-
if (
|
|
206
|
+
if (
|
|
207
|
+
typeof record.integrity !== 'string' ||
|
|
208
|
+
!SRI_TOKEN.test(record.integrity)
|
|
209
|
+
) {
|
|
171
210
|
return null;
|
|
211
|
+
}
|
|
172
212
|
const styleCss = optionalString(record.styleCss);
|
|
173
|
-
if (styleCss === null)
|
|
213
|
+
if (styleCss === null) {
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
174
216
|
const payload = {
|
|
175
217
|
compiledOutput: record.compiledOutput as string,
|
|
176
218
|
integrity: record.integrity,
|
|
@@ -185,8 +227,12 @@ export interface VistaJsonPayload {
|
|
|
185
227
|
|
|
186
228
|
export function validateJsonPayload(raw: unknown): VistaJsonPayload | null {
|
|
187
229
|
const record = asRecord(raw);
|
|
188
|
-
if (record === null)
|
|
189
|
-
|
|
230
|
+
if (record === null) {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
if (!('data' in record)) {
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
190
236
|
return { data: record.data };
|
|
191
237
|
}
|
|
192
238
|
|
|
@@ -198,11 +244,18 @@ export interface VistaTablePayload {
|
|
|
198
244
|
|
|
199
245
|
export function validateTablePayload(raw: unknown): VistaTablePayload | null {
|
|
200
246
|
const record = asRecord(raw);
|
|
201
|
-
if (record === null)
|
|
202
|
-
if (!Array.isArray(record.columns) || !Array.isArray(record.rows))
|
|
247
|
+
if (record === null) {
|
|
203
248
|
return null;
|
|
204
|
-
|
|
205
|
-
if (!record.
|
|
249
|
+
}
|
|
250
|
+
if (!Array.isArray(record.columns) || !Array.isArray(record.rows)) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
if (!record.columns.every((c) => typeof c === 'string')) {
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
if (!record.rows.every((r) => Array.isArray(r))) {
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
206
259
|
return {
|
|
207
260
|
columns: record.columns,
|
|
208
261
|
rows: record.rows as readonly (readonly unknown[])[],
|
|
@@ -242,22 +295,36 @@ const CHART_KINDS: readonly string[] = Object.values(VistaChartKind);
|
|
|
242
295
|
|
|
243
296
|
export function validateChartPayload(raw: unknown): VistaChartPayload | null {
|
|
244
297
|
const record = asRecord(raw);
|
|
245
|
-
if (record === null)
|
|
246
|
-
if (typeof record.kind !== 'string' || !CHART_KINDS.includes(record.kind))
|
|
298
|
+
if (record === null) {
|
|
247
299
|
return null;
|
|
248
|
-
|
|
300
|
+
}
|
|
301
|
+
if (typeof record.kind !== 'string' || !CHART_KINDS.includes(record.kind)) {
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
if (typeof record.title !== 'string' || record.title.length === 0) {
|
|
249
305
|
return null;
|
|
250
|
-
|
|
306
|
+
}
|
|
307
|
+
if (!Array.isArray(record.series) || record.series.length === 0) {
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
251
310
|
const series: VistaChartSeries[] = [];
|
|
252
311
|
for (const entry of record.series) {
|
|
253
312
|
const row = asRecord(entry);
|
|
254
|
-
if (row === null || typeof row.name !== 'string')
|
|
255
|
-
|
|
313
|
+
if (row === null || typeof row.name !== 'string') {
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
if (!Array.isArray(row.points)) {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
256
319
|
const points: VistaChartDatum[] = [];
|
|
257
320
|
for (const point of row.points) {
|
|
258
321
|
const p = asRecord(point);
|
|
259
|
-
if (p === null || typeof p.label !== 'string')
|
|
260
|
-
|
|
322
|
+
if (p === null || typeof p.label !== 'string') {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
if (typeof p.value !== 'number') {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
261
328
|
points.push({ label: p.label, value: p.value });
|
|
262
329
|
}
|
|
263
330
|
series.push({ name: row.name, points });
|
|
@@ -290,21 +357,31 @@ export interface VistaFilesPayload {
|
|
|
290
357
|
|
|
291
358
|
export function validateFilesPayload(raw: unknown): VistaFilesPayload | null {
|
|
292
359
|
const record = asRecord(raw);
|
|
293
|
-
if (record === null)
|
|
294
|
-
|
|
360
|
+
if (record === null) {
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
363
|
+
if (!Array.isArray(record.files)) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
295
366
|
const files: VistaFileEntry[] = [];
|
|
296
367
|
for (const entry of record.files) {
|
|
297
368
|
const row = asRecord(entry);
|
|
298
|
-
if (row === null || typeof row.path !== 'string')
|
|
369
|
+
if (row === null || typeof row.path !== 'string') {
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
299
372
|
const file: { path: string; add?: number; del?: number } = {
|
|
300
373
|
path: row.path,
|
|
301
374
|
};
|
|
302
375
|
if (row.add !== undefined) {
|
|
303
|
-
if (typeof row.add !== 'number')
|
|
376
|
+
if (typeof row.add !== 'number') {
|
|
377
|
+
return null;
|
|
378
|
+
}
|
|
304
379
|
file.add = row.add;
|
|
305
380
|
}
|
|
306
381
|
if (row.del !== undefined) {
|
|
307
|
-
if (typeof row.del !== 'number')
|
|
382
|
+
if (typeof row.del !== 'number') {
|
|
383
|
+
return null;
|
|
384
|
+
}
|
|
308
385
|
file.del = row.del;
|
|
309
386
|
}
|
|
310
387
|
files.push(file);
|
|
@@ -325,7 +402,9 @@ export function validateBiomeRoutePayload(
|
|
|
325
402
|
raw: unknown,
|
|
326
403
|
): VistaBiomeRoutePayload | null {
|
|
327
404
|
const record = asRecord(raw);
|
|
328
|
-
if (record === null)
|
|
405
|
+
if (record === null) {
|
|
406
|
+
return null;
|
|
407
|
+
}
|
|
329
408
|
return typeof record.deeplink === 'string' && record.deeplink.length > 0
|
|
330
409
|
? { deeplink: record.deeplink }
|
|
331
410
|
: null;
|
|
@@ -338,7 +417,9 @@ export interface VistaObjectPayload {
|
|
|
338
417
|
|
|
339
418
|
export function validateObjectPayload(raw: unknown): VistaObjectPayload | null {
|
|
340
419
|
const record = asRecord(raw);
|
|
341
|
-
if (record === null)
|
|
420
|
+
if (record === null) {
|
|
421
|
+
return null;
|
|
422
|
+
}
|
|
342
423
|
return typeof record.ref === 'string' && record.ref.length > 0
|
|
343
424
|
? { ref: record.ref }
|
|
344
425
|
: null;
|
|
@@ -354,14 +435,23 @@ export interface VistaGraphPayload {
|
|
|
354
435
|
|
|
355
436
|
export function validateGraphPayload(raw: unknown): VistaGraphPayload | null {
|
|
356
437
|
const record = asRecord(raw);
|
|
357
|
-
if (record === null)
|
|
438
|
+
if (record === null) {
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
358
441
|
const anchorRef = optionalString(record.anchorRef);
|
|
359
|
-
if (anchorRef === null)
|
|
360
|
-
if (record.depth !== undefined && typeof record.depth !== 'number')
|
|
442
|
+
if (anchorRef === null) {
|
|
361
443
|
return null;
|
|
444
|
+
}
|
|
445
|
+
if (record.depth !== undefined && typeof record.depth !== 'number') {
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
362
448
|
const payload: { anchorRef?: string; depth?: number } = {};
|
|
363
|
-
if (anchorRef !== undefined)
|
|
364
|
-
|
|
449
|
+
if (anchorRef !== undefined) {
|
|
450
|
+
payload.anchorRef = anchorRef;
|
|
451
|
+
}
|
|
452
|
+
if (record.depth !== undefined) {
|
|
453
|
+
payload.depth = record.depth;
|
|
454
|
+
}
|
|
365
455
|
return payload;
|
|
366
456
|
}
|
|
367
457
|
|
|
@@ -373,7 +463,9 @@ export interface VistaWebPayload {
|
|
|
373
463
|
|
|
374
464
|
export function validateWebPayload(raw: unknown): VistaWebPayload | null {
|
|
375
465
|
const record = asRecord(raw);
|
|
376
|
-
if (record === null)
|
|
466
|
+
if (record === null) {
|
|
467
|
+
return null;
|
|
468
|
+
}
|
|
377
469
|
return typeof record.href === 'string' && record.href.startsWith('/')
|
|
378
470
|
? { href: record.href }
|
|
379
471
|
: null;
|
|
@@ -436,31 +528,47 @@ export function isValidVistaFormRef(value: unknown): value is string {
|
|
|
436
528
|
|
|
437
529
|
export function validateFormPayload(raw: unknown): VistaFormPayload | null {
|
|
438
530
|
const record = asRecord(raw);
|
|
439
|
-
if (record === null)
|
|
531
|
+
if (record === null) {
|
|
532
|
+
return null;
|
|
533
|
+
}
|
|
440
534
|
// The service generates base64url refs. Keeping the accepted alphabet closed
|
|
441
535
|
// makes the ref safe as exactly one URL path segment; dot segments, slashes,
|
|
442
536
|
// percent escapes and Unicode lookalikes are all rejected.
|
|
443
537
|
if (!isValidVistaFormRef(record.ref)) {
|
|
444
538
|
return null;
|
|
445
539
|
}
|
|
446
|
-
if (typeof record.purpose !== 'string')
|
|
540
|
+
if (typeof record.purpose !== 'string') {
|
|
541
|
+
return null;
|
|
542
|
+
}
|
|
447
543
|
// Deliberately reject the old contract rather than silently ignoring its
|
|
448
544
|
// payload-selected network targets.
|
|
449
|
-
if ('submitUrl' in record || 'statusUrl' in record)
|
|
545
|
+
if ('submitUrl' in record || 'statusUrl' in record) {
|
|
546
|
+
return null;
|
|
547
|
+
}
|
|
450
548
|
|
|
451
549
|
const fields = validateCaptureFields(record.fields);
|
|
452
|
-
if (fields === null)
|
|
550
|
+
if (fields === null) {
|
|
551
|
+
return null;
|
|
552
|
+
}
|
|
453
553
|
|
|
454
554
|
const heading = optionalString(record.heading);
|
|
455
|
-
if (heading === null)
|
|
555
|
+
if (heading === null) {
|
|
556
|
+
return null;
|
|
557
|
+
}
|
|
456
558
|
const submitLabel = optionalString(record.submitLabel);
|
|
457
|
-
if (submitLabel === null)
|
|
559
|
+
if (submitLabel === null) {
|
|
560
|
+
return null;
|
|
561
|
+
}
|
|
458
562
|
|
|
459
563
|
let launch: VistaFormLaunch | undefined;
|
|
460
564
|
if (record.launch !== undefined) {
|
|
461
565
|
const raw_ = asRecord(record.launch);
|
|
462
|
-
if (raw_ === null)
|
|
463
|
-
|
|
566
|
+
if (raw_ === null) {
|
|
567
|
+
return null;
|
|
568
|
+
}
|
|
569
|
+
if ('url' in raw_) {
|
|
570
|
+
return null;
|
|
571
|
+
}
|
|
464
572
|
if (
|
|
465
573
|
typeof raw_.path !== 'string' ||
|
|
466
574
|
!raw_.path.startsWith('/') ||
|
|
@@ -469,9 +577,13 @@ export function validateFormPayload(raw: unknown): VistaFormPayload | null {
|
|
|
469
577
|
) {
|
|
470
578
|
return null;
|
|
471
579
|
}
|
|
472
|
-
if (typeof raw_.label !== 'string' || raw_.label.length === 0)
|
|
580
|
+
if (typeof raw_.label !== 'string' || raw_.label.length === 0) {
|
|
581
|
+
return null;
|
|
582
|
+
}
|
|
473
583
|
const hint = optionalString(raw_.hint);
|
|
474
|
-
if (hint === null)
|
|
584
|
+
if (hint === null) {
|
|
585
|
+
return null;
|
|
586
|
+
}
|
|
475
587
|
launch =
|
|
476
588
|
hint === undefined
|
|
477
589
|
? { path: raw_.path, label: raw_.label }
|
|
@@ -486,9 +598,15 @@ export function validateFormPayload(raw: unknown): VistaFormPayload | null {
|
|
|
486
598
|
submitLabel?: string;
|
|
487
599
|
launch?: VistaFormLaunch;
|
|
488
600
|
} = { ref: record.ref, purpose: record.purpose, fields };
|
|
489
|
-
if (heading !== undefined)
|
|
490
|
-
|
|
491
|
-
|
|
601
|
+
if (heading !== undefined) {
|
|
602
|
+
payload.heading = heading;
|
|
603
|
+
}
|
|
604
|
+
if (submitLabel !== undefined) {
|
|
605
|
+
payload.submitLabel = submitLabel;
|
|
606
|
+
}
|
|
607
|
+
if (launch !== undefined) {
|
|
608
|
+
payload.launch = launch;
|
|
609
|
+
}
|
|
492
610
|
return payload;
|
|
493
611
|
}
|
|
494
612
|
|
|
@@ -501,11 +619,16 @@ export interface VistaAppPayload {
|
|
|
501
619
|
|
|
502
620
|
export function validateAppPayload(raw: unknown): VistaAppPayload | null {
|
|
503
621
|
const record = asRecord(raw);
|
|
504
|
-
if (record === null)
|
|
505
|
-
|
|
622
|
+
if (record === null) {
|
|
623
|
+
return null;
|
|
624
|
+
}
|
|
625
|
+
if (typeof record.appId !== 'string' || record.appId.length === 0) {
|
|
506
626
|
return null;
|
|
627
|
+
}
|
|
507
628
|
const path = optionalString(record.path);
|
|
508
|
-
if (path === null)
|
|
629
|
+
if (path === null) {
|
|
630
|
+
return null;
|
|
631
|
+
}
|
|
509
632
|
return path === undefined
|
|
510
633
|
? { appId: record.appId }
|
|
511
634
|
: { appId: record.appId, path };
|
|
@@ -67,23 +67,30 @@ export interface VistaTabsManifestOptions {
|
|
|
67
67
|
readonly pathPrefix: string;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
function parseEntry(
|
|
71
|
-
entry
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (!entry || typeof entry !== 'object') return null;
|
|
70
|
+
function parseEntry(entry: unknown, pathPrefix: string): VistaTabSpec | null {
|
|
71
|
+
if (!entry || typeof entry !== 'object') {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
75
74
|
const record = entry as Record<string, unknown>;
|
|
76
|
-
if (typeof record.path !== 'string')
|
|
75
|
+
if (typeof record.path !== 'string') {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
77
78
|
// Containment: inside the artifact prefix, and no traversal out of it.
|
|
78
|
-
if (!record.path.startsWith(pathPrefix))
|
|
79
|
-
|
|
79
|
+
if (!record.path.startsWith(pathPrefix)) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
if (record.path.includes('..')) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
80
85
|
const kind =
|
|
81
86
|
typeof record.kind === 'string'
|
|
82
87
|
? (record.kind as SurfaceKind)
|
|
83
88
|
: surfaceKindForPath(record.path);
|
|
84
89
|
// `files` is UI-owned (the pinned file browser) and must never be declared by
|
|
85
90
|
// the agent — an out-of-set kind rejects the whole manifest.
|
|
86
|
-
if (!DECLARABLE_SURFACE_KINDS.includes(kind))
|
|
91
|
+
if (!DECLARABLE_SURFACE_KINDS.includes(kind)) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
87
94
|
const label = typeof record.label === 'string' ? record.label : undefined;
|
|
88
95
|
return label === undefined
|
|
89
96
|
? { path: record.path, kind }
|
|
@@ -105,14 +112,22 @@ export function parseVistaTabsManifest(
|
|
|
105
112
|
} catch {
|
|
106
113
|
return null;
|
|
107
114
|
}
|
|
108
|
-
if (!parsed || typeof parsed !== 'object')
|
|
115
|
+
if (!parsed || typeof parsed !== 'object') {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
109
118
|
const record = parsed as Record<string, unknown>;
|
|
110
|
-
if (record.version !== 1)
|
|
111
|
-
|
|
119
|
+
if (record.version !== 1) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
if (!Array.isArray(record.tabs)) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
112
125
|
const tabs: VistaTabSpec[] = [];
|
|
113
126
|
for (const entry of record.tabs) {
|
|
114
127
|
const tab = parseEntry(entry, pathPrefix);
|
|
115
|
-
if (tab === null)
|
|
128
|
+
if (tab === null) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
116
131
|
tabs.push(tab);
|
|
117
132
|
}
|
|
118
133
|
const selectedPath =
|
package/src/vista/vista-tools.ts
CHANGED
|
@@ -142,15 +142,21 @@ export function dispatchVistaTool(
|
|
|
142
142
|
switch (tool) {
|
|
143
143
|
case VistaToolName.Open: {
|
|
144
144
|
const parsed = VistaOpenArgsSchema.safeParse(args);
|
|
145
|
-
if (!parsed.success)
|
|
145
|
+
if (!parsed.success) {
|
|
146
|
+
return invalid(parsed.error);
|
|
147
|
+
}
|
|
146
148
|
return { ok: true, value: { tabId: controller.open(parsed.data) } };
|
|
147
149
|
}
|
|
148
150
|
case VistaToolName.Update: {
|
|
149
151
|
const parsed = VistaUpdateArgsSchema.safeParse(args);
|
|
150
|
-
if (!parsed.success)
|
|
152
|
+
if (!parsed.success) {
|
|
153
|
+
return invalid(parsed.error);
|
|
154
|
+
}
|
|
151
155
|
const { tabId, ...patch } = parsed.data;
|
|
152
156
|
const refusal = refusalFor(controller, tabId);
|
|
153
|
-
if (refusal !== null)
|
|
157
|
+
if (refusal !== null) {
|
|
158
|
+
return refusal;
|
|
159
|
+
}
|
|
154
160
|
if (!controller.update(tabId, patch)) {
|
|
155
161
|
// The tab is listed but not opened-tab-owned: it is a HOST tab, and a
|
|
156
162
|
// patch to it would be overwritten by the host's next reconcile.
|
|
@@ -164,10 +170,14 @@ export function dispatchVistaTool(
|
|
|
164
170
|
}
|
|
165
171
|
case VistaToolName.Close: {
|
|
166
172
|
const parsed = VistaCloseArgsSchema.safeParse(args);
|
|
167
|
-
if (!parsed.success)
|
|
173
|
+
if (!parsed.success) {
|
|
174
|
+
return invalid(parsed.error);
|
|
175
|
+
}
|
|
168
176
|
const { tabId } = parsed.data;
|
|
169
177
|
const refusal = refusalFor(controller, tabId);
|
|
170
|
-
if (refusal !== null)
|
|
178
|
+
if (refusal !== null) {
|
|
179
|
+
return refusal;
|
|
180
|
+
}
|
|
171
181
|
if (!controller.close(tabId)) {
|
|
172
182
|
return {
|
|
173
183
|
ok: false,
|
|
@@ -179,7 +189,9 @@ export function dispatchVistaTool(
|
|
|
179
189
|
}
|
|
180
190
|
case VistaToolName.List: {
|
|
181
191
|
const parsed = VistaListArgsSchema.safeParse(args ?? {});
|
|
182
|
-
if (!parsed.success)
|
|
192
|
+
if (!parsed.success) {
|
|
193
|
+
return invalid(parsed.error);
|
|
194
|
+
}
|
|
183
195
|
return { ok: true, value: { tabs: controller.list() } };
|
|
184
196
|
}
|
|
185
197
|
default:
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const SessionCapabilities: {
|
|
2
|
-
readonly HasGit: "hasGit";
|
|
3
|
-
readonly HasWorkspaceFiles: "hasWorkspaceFiles";
|
|
4
|
-
readonly SupportsKbPush: "supportsKbPush";
|
|
5
|
-
readonly HasArtifacts: "hasArtifacts";
|
|
6
|
-
readonly SupportsForking: "supportsForking";
|
|
7
|
-
readonly SupportsSharing: "supportsSharing";
|
|
8
|
-
};
|
|
9
|
-
export type SessionCapability = (typeof SessionCapabilities)[keyof typeof SessionCapabilities];
|
|
10
|
-
export interface SessionProfileDescriptor {
|
|
11
|
-
readonly key: string;
|
|
12
|
-
readonly biomeId: string;
|
|
13
|
-
readonly label: string;
|
|
14
|
-
readonly description?: string;
|
|
15
|
-
readonly capabilities: readonly string[];
|
|
16
|
-
}
|
|
17
|
-
export declare function useSessionProfileDescriptor(biomeId: string | undefined, profileKey: string | undefined): SessionProfileDescriptor;
|
|
18
|
-
//# sourceMappingURL=session-profiles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-profiles.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/session-profiles.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,mBAAmB;;;;;;;CAatB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,MAAM,WAAW,wBAAwB;IAKvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAcD,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,wBAAwB,CA2B1B"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { biomeRegistry, useBiomeRegistryRevision } from './biome-registry';
|
|
3
|
-
export const SessionCapabilities = {
|
|
4
|
-
HasGit: 'hasGit',
|
|
5
|
-
HasWorkspaceFiles: 'hasWorkspaceFiles',
|
|
6
|
-
SupportsKbPush: 'supportsKbPush',
|
|
7
|
-
HasArtifacts: 'hasArtifacts',
|
|
8
|
-
SupportsForking: 'supportsForking',
|
|
9
|
-
SupportsSharing: 'supportsSharing',
|
|
10
|
-
};
|
|
11
|
-
export function useSessionProfileDescriptor(biomeId, profileKey) {
|
|
12
|
-
const revision = useBiomeRegistryRevision();
|
|
13
|
-
return useMemo(() => {
|
|
14
|
-
const fallback = {
|
|
15
|
-
key: profileKey ?? 'unknown',
|
|
16
|
-
biomeId: biomeId ?? 'unknown',
|
|
17
|
-
label: profileKey ?? 'Unknown profile',
|
|
18
|
-
capabilities: [],
|
|
19
|
-
};
|
|
20
|
-
if (!profileKey)
|
|
21
|
-
return fallback;
|
|
22
|
-
let crossPluginMatch;
|
|
23
|
-
for (const biome of biomeRegistry.list()) {
|
|
24
|
-
for (const profile of biome.session?.profiles ?? []) {
|
|
25
|
-
if (profile.key !== profileKey)
|
|
26
|
-
continue;
|
|
27
|
-
if (biomeId !== null &&
|
|
28
|
-
biomeId !== undefined &&
|
|
29
|
-
profile.biomeId === biomeId) {
|
|
30
|
-
return profile;
|
|
31
|
-
}
|
|
32
|
-
crossPluginMatch ??= profile;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return crossPluginMatch ?? fallback;
|
|
36
|
-
}, [revision, biomeId, profileKey]);
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=session-profiles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-profiles.js","sourceRoot":"","sources":["../../../src/lib/biome-host/session-profiles.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAU3E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAEjC,MAAM,EAAE,QAAQ;IAEhB,iBAAiB,EAAE,mBAAmB;IAEtC,cAAc,EAAE,gBAAgB;IAEhC,YAAY,EAAE,cAAc;IAE5B,eAAe,EAAE,iBAAiB;IAElC,eAAe,EAAE,iBAAiB;CAC1B,CAAC;AAgCX,MAAM,UAAU,2BAA2B,CACzC,OAA2B,EAC3B,UAA8B;IAE9B,MAAM,QAAQ,GAAG,wBAAwB,EAAE,CAAC;IAC5C,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,QAAQ,GAA6B;YACzC,GAAG,EAAE,UAAU,IAAI,SAAS;YAC5B,OAAO,EAAE,OAAO,IAAI,SAAS;YAC7B,KAAK,EAAE,UAAU,IAAI,iBAAiB;YACtC,YAAY,EAAE,EAAE;SACjB,CAAC;QACF,IAAI,CAAC,UAAU;YAAE,OAAO,QAAQ,CAAC;QACjC,IAAI,gBAAsD,CAAC;QAC3D,KAAK,MAAM,KAAK,IAAI,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC;YACzC,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,CAAC;gBACpD,IAAI,OAAO,CAAC,GAAG,KAAK,UAAU;oBAAE,SAAS;gBACzC,IACE,OAAO,KAAK,IAAI;oBAChB,OAAO,KAAK,SAAS;oBACrB,OAAO,CAAC,OAAO,KAAK,OAAO,EAC3B,CAAC;oBACD,OAAO,OAAO,CAAC;gBACjB,CAAC;gBACD,gBAAgB,KAAK,OAAO,CAAC;YAC/B,CAAC;QACH,CAAC;QACD,OAAO,gBAAgB,IAAI,QAAQ,CAAC;IAEtC,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AACtC,CAAC"}
|