@jini-ai/ui 0.7.3-next.1 → 0.7.3-next.3
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/CHANGELOG.md +9 -0
- package/README.md +3 -3
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/mount-renderer.d.ts +33 -0
- package/dist/browser/mount-renderer.js +14 -0
- package/dist/browser/useDismissibleDropdown.d.ts +50 -0
- package/dist/browser/useDismissibleDropdown.js +49 -0
- package/dist/core.d.ts +4 -4
- package/dist/core.js +4 -1
- package/dist/features/admin-widgets/components/InfoTip.js +5 -5
- package/dist/features/admin-widgets/components/InfoTip.rules.d.ts +1 -1
- package/dist/features/admin-widgets/components/InfoTip.rules.js +1 -1
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +3 -3
- package/dist/features/admin-widgets/components/Select/Select.js +7 -7
- package/dist/features/app-shell/SiteToast.d.ts +24 -0
- package/dist/features/app-shell/SiteToast.js +9 -0
- package/dist/features/app-shell/copyable-details.d.ts +12 -0
- package/dist/features/app-shell/copyable-details.js +17 -0
- package/dist/features/app-shell/expanded-mode.d.ts +76 -0
- package/dist/features/app-shell/expanded-mode.js +70 -0
- package/dist/features/app-shell/index.d.ts +8 -0
- package/dist/features/app-shell/index.js +8 -0
- package/dist/features/app-shell/use-delete-confirmation.hooks.d.ts +48 -0
- package/dist/features/app-shell/use-delete-confirmation.hooks.js +57 -0
- package/dist/features/app-shell/use-expanded-mode.hooks.d.ts +19 -0
- package/dist/features/app-shell/use-expanded-mode.hooks.js +39 -0
- package/dist/features/app-shell/use-site-toast.hooks.d.ts +56 -0
- package/dist/features/app-shell/use-site-toast.hooks.js +44 -0
- package/dist/features/app-shell/use-theme-preference.hooks.d.ts +30 -0
- package/dist/features/app-shell/use-theme-preference.hooks.js +42 -0
- package/dist/features/app-version/use-app-version.d.ts +53 -0
- package/dist/features/app-version/use-app-version.js +42 -0
- package/dist/features/asset-grid/react/components/AssetGrid.d.ts +1 -1
- package/dist/features/asset-grid/react/components/AssetGrid.js +1 -1
- package/dist/features/asset-grid/react/components/DeleteConfirmDialog.d.ts +1 -1
- package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +1 -1
- package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.d.ts +2 -2
- package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.js +1 -1
- package/dist/features/asset-tree-browser/react/components/FilePreviewPane.d.ts +1 -1
- package/dist/features/browser-chrome/react/components/BrowserViewportControls.d.ts +1 -1
- package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +1 -1
- package/dist/features/charts/catalog-manifests.js +1 -1
- package/dist/features/charts/contract.d.ts +1 -1
- package/dist/features/charts/contract.js +1 -1
- package/dist/features/charts/registry.js +1 -1
- package/dist/features/charts/table.js +4 -4
- package/dist/features/charts/wire.d.ts +1 -1
- package/dist/features/charts/wire.js +1 -1
- package/dist/features/command-palette/index.d.ts +1 -0
- package/dist/features/command-palette/index.js +1 -0
- package/dist/features/command-palette/react/components/CommandPalette.d.ts +9 -9
- package/dist/features/command-palette/react/components/CommandPalette.hooks.js +28 -1
- package/dist/features/command-palette/react/components/CommandPalette.js +3 -5
- package/dist/features/connectors/ConnectorsBrowser.d.ts +1 -1
- package/dist/features/connectors/ConnectorsBrowser.js +2 -2
- package/dist/features/connectors/components/ConnectorCard.hooks.js +2 -2
- package/dist/features/connectors/components/ConnectorCard.js +4 -4
- package/dist/features/connectors/components/ConnectorDetailDrawer.d.ts +1 -1
- package/dist/features/connectors/components/ConnectorDetailDrawer.js +7 -7
- package/dist/features/connectors/components/ConnectorGrid.js +1 -1
- package/dist/features/connectors/components/ConnectorLogo.js +1 -1
- package/dist/features/connectors/components/ConnectorSearchBar.js +1 -1
- package/dist/features/connectors/components/ProviderTabBar.js +1 -1
- package/dist/features/execution/claude/env-fields.d.ts +1 -1
- package/dist/features/execution/codex/env-fields.d.ts +1 -1
- package/dist/features/execution/constants.d.ts +2 -2
- package/dist/features/execution/constants.js +1 -1
- package/dist/features/execution/dependencies.d.ts +2 -3
- package/dist/features/execution/http-adapter.d.ts +2 -3
- package/dist/features/execution/index.d.ts +0 -2
- package/dist/features/execution/react/components/AgentCliEnvFields.d.ts +1 -1
- package/dist/features/execution/react/components/AgentDiagnosticRow.d.ts +1 -1
- package/dist/features/execution/react/components/AgentDiagnosticRow.js +3 -1
- package/dist/features/execution/react/components/ByokProviderForm.d.ts +10 -2
- package/dist/features/execution/react/components/ByokProviderForm.hooks.d.ts +2 -2
- package/dist/features/execution/react/components/ByokProviderForm.js +15 -4
- package/dist/features/execution/react/components/ExecutionTab.d.ts +2 -3
- package/dist/features/execution/react/components/ExecutionTab.hooks.d.ts +14 -4
- package/dist/features/execution/react/components/ExecutionTab.hooks.js +66 -9
- package/dist/features/execution/react/components/ExecutionTab.js +27 -10
- package/dist/features/execution/react/components/LocalCliAgentCard.d.ts +4 -4
- package/dist/features/execution/react/components/LocalCliAgentList.d.ts +4 -4
- package/dist/features/execution/react/components/LocalCliAgentList.hooks.d.ts +3 -3
- package/dist/features/execution/react/components/LocalCliAgentSettings.d.ts +2 -2
- package/dist/features/execution/react/components/ProviderChipGroup.d.ts +1 -1
- package/dist/features/execution/react/components/SearchableModelSelect.d.ts +1 -1
- package/dist/features/execution/react/hooks/use-byok-field-validation.hooks.d.ts +2 -2
- package/dist/features/execution/react/hooks/use-execution-credential.hooks.d.ts +1 -1
- package/dist/features/execution/react/hooks/useExecutionTab.d.ts +2 -3
- package/dist/features/execution/react/hooks/useLocalCliAgentCard.d.ts +4 -4
- package/dist/features/execution/react/hooks/useLocalCliAgentList.d.ts +4 -4
- package/dist/features/execution/react/hooks/useReasoningControl.d.ts +3 -3
- package/dist/features/execution/rules.d.ts +6 -6
- package/dist/features/execution/rules.js +1 -1
- package/dist/features/external-mcp/react/components/ExternalMcpTab.js +4 -4
- package/dist/features/file-dropzone/react/components/FileDropzone.d.ts +1 -1
- package/dist/features/file-dropzone/react/components/FileDropzone.js +1 -1
- package/dist/features/find/find-bar-state.d.ts +58 -0
- package/dist/features/find/find-bar-state.js +45 -0
- package/dist/features/find/find-focus-clock.d.ts +19 -0
- package/dist/features/find/find-focus-clock.js +9 -0
- package/dist/features/find/find-input-focus.d.ts +88 -0
- package/dist/features/find/find-input-focus.js +88 -0
- package/dist/features/find/find-target.d.ts +141 -0
- package/dist/features/find/find-target.js +160 -0
- package/dist/features/find/index.d.ts +10 -0
- package/dist/features/find/index.js +10 -0
- package/dist/features/find/use-find-bar-effects.hooks.d.ts +14 -0
- package/dist/features/find/use-find-bar-effects.hooks.js +92 -0
- package/dist/features/find/use-find-bar-state.hooks.d.ts +43 -0
- package/dist/features/find/use-find-bar-state.hooks.js +49 -0
- package/dist/features/find/use-find-focus-reclaim.hooks.d.ts +21 -0
- package/dist/features/find/use-find-focus-reclaim.hooks.js +64 -0
- package/dist/features/find/use-find-input-binding.hooks.d.ts +18 -0
- package/dist/features/find/use-find-input-binding.hooks.js +76 -0
- package/dist/features/find-bar/FindBar.d.ts +41 -0
- package/dist/features/find-bar/FindBar.js +31 -0
- package/dist/features/find-bar/index.d.ts +2 -0
- package/dist/features/find-bar/index.js +2 -0
- package/dist/features/folder-path-drop/index.d.ts +3 -1
- package/dist/features/folder-path-drop/index.js +1 -0
- package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.d.ts +50 -0
- package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.js +50 -0
- package/dist/features/folder-path-drop/types.d.ts +14 -0
- package/dist/features/i18n/context.d.ts +1 -1
- package/dist/features/i18n/context.js +1 -1
- package/dist/features/iframe-pool/react/dom-sync.d.ts +13 -3
- package/dist/features/iframe-pool/react/dom-sync.js +7 -7
- package/dist/features/import-handoff/use-import-handoff.d.ts +38 -0
- package/dist/features/import-handoff/use-import-handoff.js +40 -0
- package/dist/features/integrations/rules.js +39 -41
- package/dist/features/interactive-ui/interactive-ui.css +1 -1
- package/dist/features/interactive-ui/providers/native/data-table.js +1 -1
- package/dist/features/interactive-ui/providers/native/data-table.manifest.d.ts +1 -1
- package/dist/features/interactive-ui/providers/native/data-table.manifest.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/action-button.manifest.d.ts +1 -1
- package/dist/features/interactive-ui/providers/shadcn/action-button.manifest.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/checkbox-field.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/checkbox-field.manifest.d.ts +1 -1
- package/dist/features/interactive-ui/providers/shadcn/checkbox-field.manifest.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/content-card.manifest.d.ts +1 -1
- package/dist/features/interactive-ui/providers/shadcn/content-card.manifest.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/data-table.js +3 -3
- package/dist/features/interactive-ui/providers/shadcn/data-table.manifest.d.ts +1 -1
- package/dist/features/interactive-ui/providers/shadcn/data-table.manifest.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/radio-group-field.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/radio-group-field.manifest.d.ts +1 -1
- package/dist/features/interactive-ui/providers/shadcn/radio-group-field.manifest.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/select-field.manifest.d.ts +1 -1
- package/dist/features/interactive-ui/providers/shadcn/select-field.manifest.js +1 -1
- package/dist/features/interactive-ui/providers/shadcn/text-input-field.manifest.d.ts +1 -1
- package/dist/features/interactive-ui/providers/shadcn/text-input-field.manifest.js +1 -1
- package/dist/features/interactive-ui/types.d.ts +1 -1
- package/dist/features/live-views/index.d.ts +6 -0
- package/dist/features/live-views/index.js +6 -0
- package/dist/features/live-views/use-live-views.d.ts +31 -0
- package/dist/features/live-views/use-live-views.js +88 -0
- package/dist/features/live-views/use-site-view-preference.d.ts +33 -0
- package/dist/features/live-views/use-site-view-preference.js +32 -0
- package/dist/features/live-views/use-webview-load-failure.d.ts +90 -0
- package/dist/features/live-views/use-webview-load-failure.js +122 -0
- package/dist/features/mcp-ui/credential-card.d.ts +1 -0
- package/dist/features/mcp-ui/credential-card.js +1 -1
- package/dist/features/mcp-ui/surfaces/tool-approval.d.ts +10 -0
- package/dist/features/mcp-ui/surfaces/tool-approval.js +15 -0
- package/dist/features/media-providers/dependencies.d.ts +7 -1
- package/dist/features/media-providers/dependencies.js +43 -0
- package/dist/features/media-providers/index.d.ts +2 -2
- package/dist/features/media-providers/index.js +1 -1
- package/dist/features/media-providers/ports.d.ts +39 -5
- package/dist/features/media-providers/react/components/MediaProvidersTab.d.ts +4 -3
- package/dist/features/media-providers/react/components/MediaProvidersTab.js +1 -1
- package/dist/features/media-providers/react/hooks/useMediaProvidersTab.d.ts +3 -2
- package/dist/features/media-providers/react/hooks/useMediaProvidersTab.js +41 -3
- package/dist/features/memory/react/components/MemoryConnectedPanel.js +2 -2
- package/dist/features/memory/react/components/MemoryEntryCard.js +1 -1
- package/dist/features/memory/react/components/MemoryHooksPanel.js +2 -2
- package/dist/features/memory/react/components/MemoryList.js +2 -2
- package/dist/features/memory/react/components/MemorySettingsPanel.js +2 -2
- package/dist/features/memory/react/components/MemorySuggestionPanel.js +1 -1
- package/dist/features/memory/react/hooks/useMemoryConnectors.hooks.js +3 -3
- package/dist/features/memory/react/hooks/useMemoryConnectors.rules.d.ts +4 -1
- package/dist/features/memory/react/hooks/useMemoryConnectors.rules.js +1 -1
- package/dist/features/memory/react/render-markdown.js +1 -1
- package/dist/features/nav-availability/nav-availability.d.ts +18 -0
- package/dist/features/nav-availability/nav-availability.js +12 -0
- package/dist/features/number-stepper/NumberStepper.d.ts +39 -0
- package/dist/features/number-stepper/NumberStepper.js +16 -0
- package/dist/features/number-stepper/index.d.ts +5 -0
- package/dist/features/number-stepper/index.js +5 -0
- package/dist/features/number-stepper/number-stepper.d.ts +34 -0
- package/dist/features/number-stepper/number-stepper.js +32 -0
- package/dist/features/number-stepper/use-number-stepper.hooks.d.ts +20 -0
- package/dist/features/number-stepper/use-number-stepper.hooks.js +29 -0
- package/dist/features/number-stepper/use-optimistic-number-setting.hooks.d.ts +36 -0
- package/dist/features/number-stepper/use-optimistic-number-setting.hooks.js +25 -0
- package/dist/features/panel-kit/ErrorNotice.js +8 -1
- package/dist/features/panel-kit/helpers/standing-draft-local-backup.d.ts +1 -1
- package/dist/features/panel-kit/helpers/standing-draft-recovery-message.d.ts +1 -1
- package/dist/features/panel-kit/hooks/use-standing-draft-autosave.hooks.d.ts +1 -37
- package/dist/features/panel-kit/hooks/use-standing-draft-recovery.hooks.d.ts +2 -1
- package/dist/features/panel-kit/hooks/use-standing-draft-state.hooks.d.ts +2 -1
- package/dist/features/panel-kit/hooks/use-standing-draft-writes.hooks.d.ts +2 -1
- package/dist/features/panel-kit/index.d.ts +2 -1
- package/dist/features/privacy/react/components/PrivacyTab.d.ts +1 -1
- package/dist/features/privacy/react/components/PrivacyTab.js +1 -1
- package/dist/features/progress-card/components/ProgressCard.d.ts +1 -1
- package/dist/features/progress-card/components/ProgressCard.js +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceBoard.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.js +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceCardParts.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceCardParts.js +7 -2
- package/dist/features/resource-dashboard/react/components/ResourceRowListView.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceRowListView.js +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.js +1 -1
- package/dist/features/resource-dashboard/react/components/StatusPill.d.ts +1 -1
- package/dist/features/resource-dashboard/react/components/StatusPill.js +1 -1
- package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +6 -1
- package/dist/features/resource-monitor/ResourceTable.d.ts +67 -0
- package/dist/features/resource-monitor/ResourceTable.js +25 -0
- package/dist/features/resource-monitor/index.d.ts +4 -0
- package/dist/features/resource-monitor/index.js +4 -0
- package/dist/features/resource-monitor/resource-stop.d.ts +16 -0
- package/dist/features/resource-monitor/resource-stop.js +11 -0
- package/dist/features/resource-monitor/use-resource-readings.hooks.d.ts +44 -0
- package/dist/features/resource-monitor/use-resource-readings.hooks.js +91 -0
- package/dist/features/settings/dialog/styles/settings-dialog.css +251 -251
- package/dist/features/site-card/index.d.ts +4 -1
- package/dist/features/site-card/index.js +3 -0
- package/dist/features/site-card/use-created-site-return.hooks.d.ts +36 -0
- package/dist/features/site-card/use-created-site-return.hooks.js +43 -0
- package/dist/features/site-card/use-site-card-preview.hooks.d.ts +39 -0
- package/dist/features/site-card/use-site-card-preview.hooks.js +31 -0
- package/dist/features/site-card/use-site-list-prefs.hooks.d.ts +29 -8
- package/dist/features/site-card/use-site-list-prefs.hooks.js +56 -9
- package/dist/features/site-card/use-site-preview.hooks.d.ts +67 -0
- package/dist/features/site-card/use-site-preview.hooks.js +94 -0
- package/dist/features/sketch-editor/react/components/SketchEditor.d.ts +2 -2
- package/dist/features/sketch-editor/react/components/SketchEditor.js +1 -1
- package/dist/features/skills/react/components/SkillRow.js +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigAddForm.js +2 -2
- package/dist/features/source-config-list/react/components/SourceConfigField.js +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigItemCard.js +5 -5
- package/dist/features/source-config-list/react/components/SourceConfigList.d.ts +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigList.js +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigListView.js +3 -3
- package/dist/features/source-config-list/react/components/SourceConfigTestControl.d.ts +1 -1
- package/dist/features/source-config-list/react/components/SourceConfigTestControl.js +1 -1
- package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.d.ts +1 -1
- package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.js +1 -1
- package/dist/features/tab-strip/react/components/TabBar.js +2 -2
- package/dist/features/tab-strip/react/components/TabStrip.d.ts +1 -1
- package/dist/features/tab-strip/react/components/TabStrip.js +1 -1
- package/dist/features/tab-strip/scrollable.js +0 -2
- package/dist/features/tabbed-dialog/react/components/TabbedDialog.d.ts +1 -1
- package/dist/features/tabbed-dialog/react/components/TabbedDialog.js +1 -1
- package/dist/features/version-manager/react/components/VersionManagerModal.d.ts +1 -1
- package/dist/features/version-manager/react/components/VersionManagerModal.js +1 -1
- package/dist/features/viewer-shell/react/components/CommentSidePanel.d.ts +2 -2
- package/dist/features/viewer-shell/react/components/CommentSidePanel.js +1 -1
- package/dist/features/viewer-shell/react/components/MarkdownSplitPane.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/MarkdownSplitPane.js +1 -1
- package/dist/features/viewer-shell/react/components/SegmentedToggle.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/SegmentedToggle.js +1 -1
- package/dist/features/viewer-shell/react/components/ViewportSwitcher.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +1 -1
- package/dist/features/viewer-shell/react/components/ViewportToggleGroup.d.ts +1 -1
- package/dist/features/viewer-shell/react/components/ViewportToggleGroup.js +1 -1
- package/dist/features/zoom/use-zoom.d.ts +141 -0
- package/dist/features/zoom/use-zoom.js +204 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/react/components/ComponentKitPreview.d.ts +1 -1
- package/dist/react/components/ComponentKitPreview.js +1 -1
- package/dist/react/components/CustomSelect.js +1 -1
- package/dist/react/components/ExportDiagnosticsButton.d.ts +6 -2
- package/dist/react/components/ExportDiagnosticsButton.js +3 -3
- package/dist/react/components/FileImportPanel.js +1 -1
- package/dist/react/components/IconFrame.d.ts +15 -0
- package/dist/react/components/IconFrame.js +11 -0
- package/dist/react/components/ImportChoice.js +1 -1
- package/dist/react/components/Notice.js +1 -1
- package/dist/react/components/OnboardingDropdown.js +1 -1
- package/dist/react/components/PaletteTweaks.js +1 -1
- package/dist/react/components/TooltipLayer.d.ts +13 -3
- package/dist/react/components/TooltipLayer.js +12 -12
- package/dist/react/mcp-ui/host-message-source.d.ts +3 -1
- package/dist/react/mcp-ui/host-message-source.js +1 -1
- package/dist/react/testing.js +3 -1
- package/dist/renderers/annotation-canvas/rules.js +30 -27
- package/dist/renderers/react/components/ArtifactView.js +1 -1
- package/dist/renderers/renderers/markdown.d.ts +3 -1
- package/dist/renderers/renderers/markdown.js +2 -2
- package/dist/styles/admin.css +54 -54
- package/dist/utils/zip.js +43 -36
- package/package.json +70 -13
- package/dist/features/execution/ports.d.ts +0 -71
- package/dist/features/execution/ports.js +0 -2
- package/dist/features/execution/types.d.ts +0 -472
- package/dist/features/execution/types.js +0 -2
- package/dist/react/components/CustomSelectMarkup.d.ts +0 -27
- package/dist/react/components/CustomSelectMarkup.js +0 -35
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import type { ExecutionConfig, ExecutionMode, ProviderPreset } from '
|
|
2
|
-
|
|
1
|
+
import type { ByokConfig, ExecutionConfig, ExecutionMode, ExecutionPort, ProviderPreset } from '@jini-ai/core/contracts/execution';
|
|
2
|
+
type DiscoveryEndpoint = Pick<ByokConfig, 'providerId' | 'protocol' | 'baseUrl'>;
|
|
3
|
+
type CommitBaseUrl = ({ endpoint }: {
|
|
4
|
+
readonly endpoint: DiscoveryEndpoint;
|
|
5
|
+
}, _optional?: Record<string, never>) => void;
|
|
6
|
+
type IsBaseUrlApproved = ({ endpoint }: {
|
|
7
|
+
readonly endpoint: DiscoveryEndpoint;
|
|
8
|
+
}, _optional?: Record<string, never>) => boolean;
|
|
3
9
|
/** Wire execution state and preserve the existing model-discovery triggers. */
|
|
4
10
|
export declare function useExecutionTabView({ config, onConfigChange, port, presets, autoDetect, canDiscoverModels, describeProbeError }: {
|
|
5
11
|
config: ExecutionConfig;
|
|
@@ -9,17 +15,20 @@ export declare function useExecutionTabView({ config, onConfigChange, port, pres
|
|
|
9
15
|
autoDetect: boolean;
|
|
10
16
|
canDiscoverModels: boolean;
|
|
11
17
|
describeProbeError: ((error: unknown) => string) | undefined;
|
|
12
|
-
},
|
|
18
|
+
}, _optional?: {}): {
|
|
13
19
|
tab: import("../hooks/useExecutionTab.js").UseExecutionTabResult;
|
|
14
20
|
selectedPreset: ProviderPreset | null;
|
|
15
21
|
setMode: (mode: ExecutionMode) => void;
|
|
22
|
+
commitBaseUrl: CommitBaseUrl;
|
|
23
|
+
isBaseUrlApproved: IsBaseUrlApproved;
|
|
16
24
|
};
|
|
17
25
|
/** Derive BYOK chip state and apply the selected preset through the existing rules. */
|
|
18
|
-
export declare function useByokPane({ config, onConfigChange, presets, selectedPreset }: {
|
|
26
|
+
export declare function useByokPane({ config, onConfigChange, presets, selectedPreset, commitBaseUrl }: {
|
|
19
27
|
config: ExecutionConfig;
|
|
20
28
|
onConfigChange: (config: ExecutionConfig) => void;
|
|
21
29
|
presets: readonly ProviderPreset[];
|
|
22
30
|
selectedPreset: ProviderPreset | null;
|
|
31
|
+
commitBaseUrl: CommitBaseUrl;
|
|
23
32
|
}, _options?: {}): {
|
|
24
33
|
protocols: readonly ProviderPreset[];
|
|
25
34
|
gateways: readonly ProviderPreset[];
|
|
@@ -27,4 +36,5 @@ export declare function useByokPane({ config, onConfigChange, presets, selectedP
|
|
|
27
36
|
selectPreset: (preset: ProviderPreset) => void;
|
|
28
37
|
selectedPresetId: string | null;
|
|
29
38
|
};
|
|
39
|
+
export {};
|
|
30
40
|
//# sourceMappingURL=ExecutionTab.hooks.d.ts.map
|
|
@@ -1,8 +1,48 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { groupPresets, isProviderConfigured, nextConfigForModeChange, nextConfigForPresetSelect, resolveSelectedPreset } from '../../rules.js';
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { groupPresets, isProviderConfigured, isValidApiBaseUrl, nextConfigForModeChange, nextConfigForPresetSelect, resolveSelectedPreset } from '../../rules.js';
|
|
3
3
|
import { useExecutionTab } from '../hooks/useExecutionTab.js';
|
|
4
|
+
/** One approval slot per provider/protocol pair; JSON keeps `null` (Custom) distinct from any id. */
|
|
5
|
+
function endpointPairKey({ providerId, protocol }, _optional = {}) {
|
|
6
|
+
return JSON.stringify([providerId, protocol]);
|
|
7
|
+
}
|
|
8
|
+
/** The trimmed URL discovery may be approved for, or `null` when it is not a complete, allowed URL. */
|
|
9
|
+
function approvableBaseUrl({ baseUrl }, _optional = {}) {
|
|
10
|
+
const trimmed = baseUrl.trim();
|
|
11
|
+
return trimmed && isValidApiBaseUrl({ raw: trimmed }) ? trimmed : null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* B216: model discovery sends the provider key to the Base URL, so it may only go to a URL the
|
|
15
|
+
* operator explicitly committed (blur, Enter, a preset's own default, Test connection). A parseable
|
|
16
|
+
* URL and a pause do not establish intent: `https://api.ex` parses, and people pause mid-word. And
|
|
17
|
+
* preset selection can carry a draft across identities, so approval belongs to the exact provider,
|
|
18
|
+
* protocol and URL — never to "the identity changed". Holds URLs only; a key never enters this state.
|
|
19
|
+
*/
|
|
20
|
+
function useEndpointApproval({ initial }, _optional = {}) {
|
|
21
|
+
// Seeding exception: the host's initial endpoint is the one the server already uses for runs, so
|
|
22
|
+
// approving it adds no new egress — even when an autosaving host persisted a half-typed value
|
|
23
|
+
// before a reload. Read once on mount only: never from `savedByProviderId`, never from a later
|
|
24
|
+
// prop rerender, either of which would turn an unreviewed URL into an approved one.
|
|
25
|
+
const [approved, setApproved] = useState(() => {
|
|
26
|
+
const seed = approvableBaseUrl(initial);
|
|
27
|
+
return new Map(seed === null ? [] : [[endpointPairKey(initial), seed]]);
|
|
28
|
+
});
|
|
29
|
+
const isBaseUrlApproved = useCallback(({ endpoint }) => {
|
|
30
|
+
const trimmed = endpoint.baseUrl.trim();
|
|
31
|
+
// Blank is the host's own default endpoint for every pair, not an operator-supplied destination.
|
|
32
|
+
return !trimmed || approved.get(endpointPairKey(endpoint)) === trimmed;
|
|
33
|
+
}, [approved]);
|
|
34
|
+
const commitBaseUrl = useCallback(({ endpoint }) => {
|
|
35
|
+
const url = approvableBaseUrl(endpoint);
|
|
36
|
+
if (url === null)
|
|
37
|
+
return;
|
|
38
|
+
const key = endpointPairKey(endpoint);
|
|
39
|
+
// Same pair and URL keeps the same Map, so React bails out and no discovery is re-scheduled.
|
|
40
|
+
setApproved((current) => (current.get(key) === url ? current : new Map(current).set(key, url)));
|
|
41
|
+
}, []);
|
|
42
|
+
return { isBaseUrlApproved, commitBaseUrl };
|
|
43
|
+
}
|
|
4
44
|
/** Wire execution state and preserve the existing model-discovery triggers. */
|
|
5
|
-
export function useExecutionTabView({ config, onConfigChange, port, presets, autoDetect, canDiscoverModels, describeProbeError },
|
|
45
|
+
export function useExecutionTabView({ config, onConfigChange, port, presets, autoDetect, canDiscoverModels, describeProbeError }, _optional = {}) {
|
|
6
46
|
const tab = useExecutionTab({
|
|
7
47
|
port,
|
|
8
48
|
autoDetect: autoDetect && config.mode === 'local-cli',
|
|
@@ -18,7 +58,7 @@ export function useExecutionTabView({ config, onConfigChange, port, presets, aut
|
|
|
18
58
|
*/
|
|
19
59
|
const hasApiKey = config.byok.apiKey.trim().length > 0;
|
|
20
60
|
// Re-discover models whenever the selected endpoint changes (preset pick,
|
|
21
|
-
// manual protocol switch, or a
|
|
61
|
+
// manual protocol switch, or a Base URL the operator committed), and
|
|
22
62
|
// once a key first becomes available (`hasApiKey`).
|
|
23
63
|
//
|
|
24
64
|
// Still deliberately NOT keyed on `apiKey`'s VALUE or on `model` — refetching
|
|
@@ -38,11 +78,19 @@ export function useExecutionTabView({ config, onConfigChange, port, presets, aut
|
|
|
38
78
|
//
|
|
39
79
|
// `canDiscoverModels` is read here but is deliberately not a dependency — see that prop's doc for why
|
|
40
80
|
// its turning `true` on its own must never probe.
|
|
81
|
+
//
|
|
82
|
+
// Keyed on the APPROVED Base URL, never the typed one (B216): see `useEndpointApproval`. `null`
|
|
83
|
+
// while the current pair and URL are unapproved; the trimmed URL (blank for the host default)
|
|
84
|
+
// otherwise — and that trimmed value, not the raw input, is what the probe receives.
|
|
85
|
+
const { isBaseUrlApproved, commitBaseUrl } = useEndpointApproval({ initial: config.byok });
|
|
86
|
+
const approvedBaseUrl = isBaseUrlApproved({ endpoint: config.byok }) ? config.byok.baseUrl.trim() : null;
|
|
41
87
|
useEffect(() => {
|
|
42
88
|
if (config.mode !== 'byok' || typeof port.listModels !== 'function' || !canDiscoverModels)
|
|
43
89
|
return;
|
|
44
|
-
|
|
45
|
-
|
|
90
|
+
if (approvedBaseUrl === null)
|
|
91
|
+
return;
|
|
92
|
+
loadModels({ ...config.byok, baseUrl: approvedBaseUrl });
|
|
93
|
+
}, [config.mode, port, loadModels, config.byok.protocol, approvedBaseUrl, config.byok.providerId, hasApiKey]);
|
|
46
94
|
// All a turn to "cannot discover" does: drop the current result and any response still in flight —
|
|
47
95
|
// e.g. one started before the host learned that its stored key belongs to another endpoint.
|
|
48
96
|
useEffect(() => {
|
|
@@ -55,13 +103,22 @@ export function useExecutionTabView({ config, onConfigChange, port, presets, aut
|
|
|
55
103
|
const setMode = (mode) => {
|
|
56
104
|
onConfigChange(nextConfigForModeChange({ config, mode }));
|
|
57
105
|
};
|
|
58
|
-
return { tab, selectedPreset, setMode };
|
|
106
|
+
return { tab, selectedPreset, setMode, commitBaseUrl, isBaseUrlApproved };
|
|
59
107
|
}
|
|
60
108
|
/** Derive BYOK chip state and apply the selected preset through the existing rules. */
|
|
61
|
-
export function useByokPane({ config, onConfigChange, presets, selectedPreset }, _options = {}) {
|
|
109
|
+
export function useByokPane({ config, onConfigChange, presets, selectedPreset, commitBaseUrl }, _options = {}) {
|
|
62
110
|
const { protocols, gateways } = groupPresets({ presets });
|
|
63
111
|
const configuredPresetIds = new Set(presets.filter((preset) => isProviderConfigured({ config: config.byok, preset })).map((preset) => preset.id));
|
|
64
|
-
const selectPreset = (preset) =>
|
|
112
|
+
const selectPreset = (preset) => {
|
|
113
|
+
const next = nextConfigForPresetSelect({ config: config.byok, preset });
|
|
114
|
+
// A deliberate pick of a preset's OWN default endpoint is the operator choosing that endpoint.
|
|
115
|
+
// A carried Custom draft or a restored saved non-default URL is not; it stays unapproved unless
|
|
116
|
+
// that exact pair and URL were already approved.
|
|
117
|
+
if (!preset.custom && next.baseUrl.trim() === (preset.baseUrl ?? '').trim()) {
|
|
118
|
+
commitBaseUrl({ endpoint: { providerId: next.providerId, protocol: next.protocol, baseUrl: next.baseUrl } });
|
|
119
|
+
}
|
|
120
|
+
onConfigChange({ ...config, byok: next });
|
|
121
|
+
};
|
|
65
122
|
const selectedPresetId = selectedPreset?.id ?? null;
|
|
66
123
|
return { protocols, gateways, configuredPresetIds, selectPreset, selectedPresetId };
|
|
67
124
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { agentHandleProps, agentSubHandle } from '@jini-ai/core/agent-handles';
|
|
3
3
|
import { useT } from '../../../i18n/index.js';
|
|
4
4
|
import { DEFAULT_AGENT_CLI_ENV_FIELDS } from '../../constants.js';
|
|
5
|
-
import { nextConfigForAgentCliEnvChange, nextConfigForAgentModel, nextConfigForAgentReasoning, nextConfigForAgentSelect, selectedAgentModel, } from '../../rules.js';
|
|
5
|
+
import { isValidApiBaseUrl, nextConfigForAgentCliEnvChange, nextConfigForAgentModel, nextConfigForAgentReasoning, nextConfigForAgentSelect, selectedAgentModel, } from '../../rules.js';
|
|
6
6
|
import { useByokPane, useExecutionTabView } from './ExecutionTab.hooks.js';
|
|
7
7
|
import { ByokProviderForm } from './ByokProviderForm.js';
|
|
8
8
|
import { LocalCliAgentList } from './LocalCliAgentList.js';
|
|
@@ -21,12 +21,12 @@ import { ProviderChipGroup } from './ProviderChipGroup.js';
|
|
|
21
21
|
*/
|
|
22
22
|
export function ExecutionTab({ config, onConfigChange, port, presets = [], cliEnvFields = DEFAULT_AGENT_CLI_ENV_FIELDS, localCliUnavailableReason, renderAgentIcon, localCliScopeLabel, autoDetect = true, ariaLabel, apiKeyFooter, formFooter, apiKeyStoredExternally, apiKeyPlaceholder, canDiscoverModels = true, describeProbeError, agentHandle, useTHook = useT, useExecutionTabViewHook = useExecutionTabView, }) {
|
|
23
23
|
const t = useTHook();
|
|
24
|
-
const { tab, selectedPreset, setMode } = useExecutionTabViewHook({ config, onConfigChange, port, presets, autoDetect, canDiscoverModels, describeProbeError });
|
|
24
|
+
const { tab, selectedPreset, setMode, commitBaseUrl, isBaseUrlApproved } = useExecutionTabViewHook({ config, onConfigChange, port, presets, autoDetect, canDiscoverModels, describeProbeError });
|
|
25
25
|
const modes = [
|
|
26
26
|
{ id: 'local-cli', title: t('Local CLI'), meta: t('Run an agent installed on this machine') },
|
|
27
27
|
{ id: 'byok', title: t('BYOK'), meta: t('Use your own API credentials') },
|
|
28
28
|
];
|
|
29
|
-
return (_jsxs("div", { className: "jini-settings-execution", "aria-label": ariaLabel ?? t('Execution mode'), children: [_jsx(ExecutionModeSwitch, { modes: modes, activeMode: config.mode, localCliUnavailableReason: localCliUnavailableReason, onSelect: setMode, agentHandle: agentHandle }), config.mode === 'local-cli' ? (_jsx(LocalCliPane, { config: config, onConfigChange: onConfigChange, tab: tab, cliEnvFields: cliEnvFields, renderAgentIcon: renderAgentIcon, localCliScopeLabel: localCliScopeLabel, agentHandle: agentHandle })) : (_jsx(ByokPane, { config: config, onConfigChange: onConfigChange, presets: presets, selectedPreset: selectedPreset, tab: tab, canDiscoverModels: canDiscoverModels, canListModels: typeof port.listModels === 'function', formProps: { apiKeyFooter, formFooter, apiKeyStoredExternally, apiKeyPlaceholder }, agentHandle: agentHandle }))] }));
|
|
29
|
+
return (_jsxs("div", { className: "jini-settings-execution", "aria-label": ariaLabel ?? t('Execution mode'), children: [_jsx(ExecutionModeSwitch, { modes: modes, activeMode: config.mode, localCliUnavailableReason: localCliUnavailableReason, onSelect: setMode, agentHandle: agentHandle }), config.mode === 'local-cli' ? (_jsx(LocalCliPane, { config: config, onConfigChange: onConfigChange, tab: tab, cliEnvFields: cliEnvFields, renderAgentIcon: renderAgentIcon, localCliScopeLabel: localCliScopeLabel, agentHandle: agentHandle })) : (_jsx(ByokPane, { config: config, onConfigChange: onConfigChange, presets: presets, selectedPreset: selectedPreset, tab: tab, canDiscoverModels: canDiscoverModels, canListModels: typeof port.listModels === 'function', approval: { commitBaseUrl, isBaseUrlApproved }, formProps: { apiKeyFooter, formFooter, apiKeyStoredExternally, apiKeyPlaceholder }, agentHandle: agentHandle }))] }));
|
|
30
30
|
}
|
|
31
31
|
/** The Local CLI ↔ BYOK segmented control. Local CLI is disabled, with the host's reason as its
|
|
32
32
|
* tooltip and caption, while the host says it is unavailable. */
|
|
@@ -39,9 +39,9 @@ function ExecutionModeSwitch({ modes, activeMode, localCliUnavailableReason, onS
|
|
|
39
39
|
}) }));
|
|
40
40
|
}
|
|
41
41
|
/** The BYOK half of the tab: protocol and gateway chip rows over the credential card. */
|
|
42
|
-
function ByokPane({ config, onConfigChange, presets, selectedPreset, tab, canDiscoverModels, canListModels, formProps, agentHandle, useTHook = useT, useByokPaneHook = useByokPane, }) {
|
|
42
|
+
function ByokPane({ config, onConfigChange, presets, selectedPreset, tab, canDiscoverModels, canListModels, approval, formProps, agentHandle, useTHook = useT, useByokPaneHook = useByokPane, }) {
|
|
43
43
|
const t = useTHook();
|
|
44
|
-
const { protocols, gateways, configuredPresetIds, selectPreset, selectedPresetId } = useByokPaneHook({ config, onConfigChange, presets, selectedPreset });
|
|
44
|
+
const { protocols, gateways, configuredPresetIds, selectPreset, selectedPresetId } = useByokPaneHook({ config, onConfigChange, presets, selectedPreset, commitBaseUrl: approval.commitBaseUrl });
|
|
45
45
|
return (_jsxs("section", { className: "jini-settings-section jini-settings-byok", children: [_jsx(ProviderChipGroup, { label: t('Protocols'), presets: protocols, selectedPresetId: selectedPresetId, configuredPresetIds: configuredPresetIds, onSelect: selectPreset, configuredLabel: t('Configured'), unsetLabel: t('Not configured'), ...subHandleProps(agentHandle, 'protocol') }), _jsx(ProviderChipGroup, { label: t('Gateways'), presets: gateways, selectedPresetId: selectedPresetId, configuredPresetIds: configuredPresetIds, onSelect: selectPreset, configuredLabel: t('Configured'), unsetLabel: t('Not configured'), ...subHandleProps(agentHandle, 'gateway') }), _jsx(ByokProviderForm, { config: config.byok, onConfigChange: (byok) => onConfigChange({ ...config, byok }), preset: selectedPreset, ...subHandleProps(agentHandle, 'byok'),
|
|
46
46
|
// The WHOLE catalog, not the `protocols`/`gateways` halves the chip rows take: the card
|
|
47
47
|
// only reads it to recognise a pasted key as some other row's, and a key pasted from a
|
|
@@ -53,11 +53,28 @@ function ByokPane({ config, onConfigChange, presets, selectedPreset, tab, canDis
|
|
|
53
53
|
// from before this key existed (or from any earlier transient
|
|
54
54
|
// failure) would otherwise never clear, even once Test Connection
|
|
55
55
|
// itself goes green with the same config.
|
|
56
|
-
onTestConnection: () => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
onTestConnection: () => testEndpoint({ byok: config.byok, tab, approval, canDiscover: canDiscoverModels && canListModels }),
|
|
57
|
+
// Typing only patches the displayed config; blur or Enter is the operator committing the
|
|
58
|
+
// endpoint for the CURRENT provider/protocol pair.
|
|
59
|
+
onBaseUrlCommit: ({ baseUrl }) => approval.commitBaseUrl({ endpoint: { providerId: config.byok.providerId, protocol: config.byok.protocol, baseUrl } }), ...(formProps.apiKeyFooter !== undefined ? { apiKeyFooter: formProps.apiKeyFooter } : {}), ...(formProps.formFooter !== undefined ? { formFooter: formProps.formFooter } : {}), ...(formProps.apiKeyStoredExternally !== undefined ? { apiKeyStoredExternally: formProps.apiKeyStoredExternally } : {}), ...(formProps.apiKeyPlaceholder !== undefined ? { apiKeyPlaceholder: formProps.apiKeyPlaceholder } : {}) })] }));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Test connection is an explicit commit of the endpoint it tests. An incomplete or disallowed URL
|
|
63
|
+
* goes to neither probe (the key would travel with it). Approval is read BEFORE committing: a newly
|
|
64
|
+
* approved endpoint is discovered by the tab's automatic discovery effect, so calling `loadModels`
|
|
65
|
+
* here too would probe it twice; an already approved one gets this explicit discovery retry, which
|
|
66
|
+
* is what clears a stale "could not load live models" error once the connection itself goes green.
|
|
67
|
+
*/
|
|
68
|
+
function testEndpoint({ byok, tab, approval, canDiscover }, _optional = {}) {
|
|
69
|
+
const trimmed = byok.baseUrl.trim();
|
|
70
|
+
if (trimmed && !isValidApiBaseUrl({ raw: trimmed }))
|
|
71
|
+
return;
|
|
72
|
+
const endpoint = { providerId: byok.providerId, protocol: byok.protocol, baseUrl: trimmed };
|
|
73
|
+
const wasApproved = approval.isBaseUrlApproved({ endpoint });
|
|
74
|
+
approval.commitBaseUrl({ endpoint });
|
|
75
|
+
tab.testConnection({ ...byok, baseUrl: trimmed });
|
|
76
|
+
if (wasApproved && canDiscover)
|
|
77
|
+
tab.loadModels({ ...byok, baseUrl: trimmed });
|
|
61
78
|
}
|
|
62
79
|
/** The Local CLI half of the tab: detected agents, wired to the config's next-state rules. */
|
|
63
80
|
function LocalCliPane({ config, onConfigChange, tab, cliEnvFields, renderAgentIcon, localCliScopeLabel, agentHandle }) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { useT } from '../../../i18n/index.js';
|
|
3
|
-
import type { AgentCliEnvFieldSpec, AgentTestState,
|
|
3
|
+
import type { AgentCliEnvFieldSpec, AgentTestState, ExecutionCardAgent, LocalCliConfig } from '@jini-ai/core/contracts/execution';
|
|
4
4
|
import { useLocalCliAgentCard } from '../hooks/useLocalCliAgentCard.js';
|
|
5
5
|
export interface LocalCliAgentCardProps {
|
|
6
|
-
agent:
|
|
6
|
+
agent: ExecutionCardAgent;
|
|
7
7
|
config: LocalCliConfig;
|
|
8
8
|
selected: boolean;
|
|
9
9
|
onSelect: (agentId: string) => void;
|
|
@@ -15,8 +15,8 @@ export interface LocalCliAgentCardProps {
|
|
|
15
15
|
cliEnvFields: readonly AgentCliEnvFieldSpec[];
|
|
16
16
|
/** Rendered in the card's icon slot. A host passes its own vendor marks;
|
|
17
17
|
* without one the card falls back to a monogram rather than a gap. */
|
|
18
|
-
renderIcon?: ((agent:
|
|
19
|
-
onTest?: ((agent:
|
|
18
|
+
renderIcon?: ((agent: ExecutionCardAgent) => ReactNode) | undefined;
|
|
19
|
+
onTest?: ((agent: ExecutionCardAgent) => void) | undefined;
|
|
20
20
|
agentTest: AgentTestState;
|
|
21
21
|
/** Wired straight into `AgentDiagnosticRow`'s `{kind:'rescan'}` fix action —
|
|
22
22
|
* the same rescan the list's own header button triggers. Omitted hides
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { useT } from '../../../i18n/index.js';
|
|
3
|
-
import type { AgentCliEnvFieldSpec, AgentScanState, AgentTestState,
|
|
3
|
+
import type { AgentCliEnvFieldSpec, AgentScanState, AgentTestState, ExecutionCardAgent, LocalCliConfig } from '@jini-ai/core/contracts/execution';
|
|
4
4
|
import { useLocalCliAgentCards } from './LocalCliAgentList.hooks.js';
|
|
5
5
|
import { useLocalCliAgentList } from '../hooks/useLocalCliAgentList.js';
|
|
6
6
|
export interface LocalCliAgentListProps {
|
|
7
|
-
agents: readonly
|
|
7
|
+
agents: readonly ExecutionCardAgent[];
|
|
8
8
|
config: LocalCliConfig;
|
|
9
9
|
scan: AgentScanState;
|
|
10
10
|
onSelect: (agentId: string) => void;
|
|
@@ -13,9 +13,9 @@ export interface LocalCliAgentListProps {
|
|
|
13
13
|
onEnvChange: (agentId: string, envKey: string, value: string) => void;
|
|
14
14
|
cliEnvFields: readonly AgentCliEnvFieldSpec[];
|
|
15
15
|
onRescan?: (() => void) | undefined;
|
|
16
|
-
onTest?: ((agent:
|
|
16
|
+
onTest?: ((agent: ExecutionCardAgent) => void) | undefined;
|
|
17
17
|
agentTest: AgentTestState;
|
|
18
|
-
renderAgentIcon?: ((agent:
|
|
18
|
+
renderAgentIcon?: ((agent: ExecutionCardAgent) => ReactNode) | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Where detection ran, in the host's own words — "on this machine" for a
|
|
21
21
|
* desktop app, "on the server" for a deployed one.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { LocalCliAgentListProps } from './LocalCliAgentList.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExecutionCardAgent } from '@jini-ai/core/contracts/execution';
|
|
3
3
|
type CardInput = {
|
|
4
4
|
[K in 'agents' | 'config' | 'onSelect' | 'onModelChange' | 'onReasoningChange' | 'onEnvChange' | 'cliEnvFields' | 'onRescan' | 'onTest' | 'agentTest' | 'renderAgentIcon' | 'agentHandle']: LocalCliAgentListProps[K];
|
|
5
5
|
};
|
|
6
6
|
/** Render each agent with its own stable handle and the host's shared actions. */
|
|
7
7
|
export declare function useLocalCliAgentCards({ agents, config, onSelect, onModelChange, onReasoningChange, onEnvChange, cliEnvFields, onRescan, onTest, agentTest, renderAgentIcon, agentHandle }: CardInput, _options?: {}): {
|
|
8
|
-
installed:
|
|
9
|
-
renderCard: (agent:
|
|
8
|
+
installed: ExecutionCardAgent[];
|
|
9
|
+
renderCard: (agent: ExecutionCardAgent) => import("react").JSX.Element;
|
|
10
10
|
};
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=LocalCliAgentList.hooks.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AgentCliEnvFieldSpec,
|
|
1
|
+
import type { AgentCliEnvFieldSpec, ExecutionCardAgent, LocalCliConfig } from '@jini-ai/core/contracts/execution';
|
|
2
2
|
import type { UseLocalCliAgentCardResult } from '../hooks/useLocalCliAgentCard.js';
|
|
3
3
|
export interface LocalCliAgentSettingsProps {
|
|
4
|
-
agent:
|
|
4
|
+
agent: ExecutionCardAgent;
|
|
5
5
|
config: LocalCliConfig;
|
|
6
6
|
card: UseLocalCliAgentCardResult;
|
|
7
7
|
cliEnvFields: readonly AgentCliEnvFieldSpec[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useAgentHandle, type AgentControlProps } from '../../../../react/hooks/useAgentHandle.js';
|
|
2
|
-
import type { AgentModelOption } from '
|
|
2
|
+
import type { AgentModelOption } from '@jini-ai/core/contracts/execution';
|
|
3
3
|
import { useSearchableModelSelect } from './SearchableModelSelect.hooks.js';
|
|
4
4
|
export interface SearchableModelSelectAdditionalOption {
|
|
5
5
|
value: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ByokConfig, ProviderPreset } from '
|
|
1
|
+
import type { ByokConfig, ProviderPreset } from '@jini-ai/core/contracts/execution';
|
|
2
2
|
type Field = 'apiKey' | 'baseUrl' | 'model';
|
|
3
3
|
/** Keeps required-field gates immediate while optionally waiting for blur to paint errors.
|
|
4
4
|
* Stored keys satisfy only the key requirement; touching one provider never marks another.
|
|
@@ -11,7 +11,7 @@ export declare function useByokFieldValidation(required: {
|
|
|
11
11
|
}, optional?: {
|
|
12
12
|
deferMissingFeedback?: boolean;
|
|
13
13
|
}): {
|
|
14
|
-
missing: Set<import("
|
|
14
|
+
missing: Set<import("@jini-ai/core/contracts/execution").ByokRequiredField>;
|
|
15
15
|
baseUrlInvalid: boolean;
|
|
16
16
|
isMissing: ({ field }: {
|
|
17
17
|
field: Field;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ByokConfig } from "
|
|
1
|
+
import type { ByokConfig } from "@jini-ai/core/contracts/execution";
|
|
2
2
|
import type { SettingsSliceRefreshPort } from "../../../panel-kit/hooks/settings-slice.helpers.js";
|
|
3
3
|
/** The metadata read by this controller. Hosts retain any additional write-only view fields. */
|
|
4
4
|
export interface ExecutionCredentialView {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ExecutionPort } from '
|
|
2
|
-
import type { AgentScanState, AgentTestState, ByokConfig, ConnectionTestState, DetectedAgent, ModelDiscoveryState } from '../../types.js';
|
|
1
|
+
import type { AgentScanState, AgentTestState, ByokConfig, ConnectionTestState, ExecutionCardAgent, ExecutionPort, ModelDiscoveryState } from '@jini-ai/core/contracts/execution';
|
|
3
2
|
export interface UseExecutionTabOptions {
|
|
4
3
|
port: ExecutionPort;
|
|
5
4
|
/** Skips the mount-time detection call — useful when the host already has
|
|
@@ -19,7 +18,7 @@ export interface UseExecutionTabOptions {
|
|
|
19
18
|
describeProbeError?: (error: unknown) => string;
|
|
20
19
|
}
|
|
21
20
|
export interface UseExecutionTabResult {
|
|
22
|
-
agents: readonly
|
|
21
|
+
agents: readonly ExecutionCardAgent[];
|
|
23
22
|
scan: AgentScanState;
|
|
24
23
|
connectionTest: ConnectionTestState;
|
|
25
24
|
/** Result of the most recent `loadModels` call. `{status:'idle'}` until one
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { agentExecutableRepairState } from '../../rules.js';
|
|
2
|
-
import type { AgentCliEnvFieldSpec, AgentTestState,
|
|
2
|
+
import type { AgentCliEnvFieldSpec, AgentTestState, ExecutionCardAgent, LocalCliConfig } from '@jini-ai/core/contracts/execution';
|
|
3
3
|
import { type UseReasoningControlResult } from './useReasoningControl.js';
|
|
4
4
|
type Translate = (key: string) => string;
|
|
5
5
|
export interface UseLocalCliAgentCardInput {
|
|
6
|
-
agent:
|
|
6
|
+
agent: ExecutionCardAgent;
|
|
7
7
|
config: LocalCliConfig;
|
|
8
8
|
agentTest: AgentTestState;
|
|
9
9
|
cliEnvFields: readonly AgentCliEnvFieldSpec[];
|
|
@@ -11,7 +11,7 @@ export interface UseLocalCliAgentCardInput {
|
|
|
11
11
|
onReasoningChange: (agentId: string, reasoning: string) => void;
|
|
12
12
|
onRescan?: (() => void) | undefined;
|
|
13
13
|
/** Only its presence matters here: a Test button alone is enough to show the settings strip. */
|
|
14
|
-
onTest?: ((agent:
|
|
14
|
+
onTest?: ((agent: ExecutionCardAgent) => void) | undefined;
|
|
15
15
|
t: Translate;
|
|
16
16
|
}
|
|
17
17
|
export interface UseLocalCliAgentCardResult {
|
|
@@ -20,7 +20,7 @@ export interface UseLocalCliAgentCardResult {
|
|
|
20
20
|
* as an empty bordered box for a CLI with no models, effort, Test or env fields. */
|
|
21
21
|
hasSettings: boolean;
|
|
22
22
|
/** `agent.modelsSource`, passed through for the badge's modifier class. */
|
|
23
|
-
source:
|
|
23
|
+
source: ExecutionCardAgent['modelsSource'];
|
|
24
24
|
sourceLabel: string;
|
|
25
25
|
sourceHint: string;
|
|
26
26
|
testing: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExecutionCardAgent } from '@jini-ai/core/contracts/execution';
|
|
2
2
|
export interface UseLocalCliAgentListResult {
|
|
3
3
|
/** Installed CLIs plus the current pick: always rendered. */
|
|
4
|
-
visible:
|
|
4
|
+
visible: ExecutionCardAgent[];
|
|
5
5
|
/** Not-installed CLIs: rendered only while `showCollapsed`. */
|
|
6
|
-
collapsed:
|
|
6
|
+
collapsed: ExecutionCardAgent[];
|
|
7
7
|
showCollapsed: boolean;
|
|
8
8
|
toggleCollapsed: () => void;
|
|
9
9
|
}
|
|
@@ -13,7 +13,7 @@ export interface UseLocalCliAgentListResult {
|
|
|
13
13
|
* off-screen. See `partitionAgentsByInstalled` for what stays visible.
|
|
14
14
|
*/
|
|
15
15
|
export declare function useLocalCliAgentList({ agents, selectedAgentId }: {
|
|
16
|
-
agents: readonly
|
|
16
|
+
agents: readonly ExecutionCardAgent[];
|
|
17
17
|
selectedAgentId: string | null;
|
|
18
18
|
}): UseLocalCliAgentListResult;
|
|
19
19
|
//# sourceMappingURL=useLocalCliAgentList.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AgentModelOption,
|
|
1
|
+
import type { AgentModelOption, ExecutionCardAgent, LocalCliConfig, ReasoningModelGroup } from '@jini-ai/core/contracts/execution';
|
|
2
2
|
export interface UseReasoningControlOptions {
|
|
3
|
-
agent:
|
|
3
|
+
agent: ExecutionCardAgent;
|
|
4
4
|
config: LocalCliConfig;
|
|
5
5
|
explicitCustomMode?: boolean | undefined;
|
|
6
6
|
/**
|
|
@@ -83,5 +83,5 @@ export interface UseReasoningControlResult {
|
|
|
83
83
|
* and effort levels derived from the agent's model catalog via `reasoningModelGroups`.
|
|
84
84
|
*/
|
|
85
85
|
export declare function useReasoningControl(options: UseReasoningControlOptions): UseReasoningControlResult;
|
|
86
|
-
export declare function useReasoningControl(agent:
|
|
86
|
+
export declare function useReasoningControl(agent: ExecutionCardAgent, config: LocalCliConfig, explicitCustomMode?: boolean): UseReasoningControlResult;
|
|
87
87
|
//# sourceMappingURL=useReasoningControl.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentCliEnvFieldSpec, AgentDiagnostic, AgentExecutableRepair, AgentExecutableSource, AgentModelOption, ApiKeyWarning, ByokConfig, ByokProviderCredentials, ByokRequiredField,
|
|
1
|
+
import type { AgentCliEnvFieldSpec, AgentDiagnostic, AgentExecutableRepair, AgentExecutableSource, AgentModelOption, ApiKeyWarning, ByokConfig, ByokProviderCredentials, ByokRequiredField, ExecutionCardAgent, ExecutionConfig, ExecutionMode, LocalCliConfig, ProviderPreset, ReasoningModelGroup } from '@jini-ai/core/contracts/execution';
|
|
2
2
|
/**
|
|
3
3
|
* Pure decision logic for the execution tab. Everything here is total and
|
|
4
4
|
* side-effect free so the React layer stays a thin renderer — same split the
|
|
@@ -216,7 +216,7 @@ export interface AgentMetaLabels {
|
|
|
216
216
|
* binary path, so the card stays one line without discarding either.
|
|
217
217
|
*/
|
|
218
218
|
export declare function agentMetaLabel({ agent, labels }: {
|
|
219
|
-
agent:
|
|
219
|
+
agent: ExecutionCardAgent;
|
|
220
220
|
labels: AgentMetaLabels;
|
|
221
221
|
}, _optional?: Record<string, never>): {
|
|
222
222
|
text: string;
|
|
@@ -227,7 +227,7 @@ export declare function agentMetaLabel({ agent, labels }: {
|
|
|
227
227
|
* reported, else nothing. */
|
|
228
228
|
export declare function selectedAgentModel({ config, agent }: {
|
|
229
229
|
config: LocalCliConfig;
|
|
230
|
-
agent:
|
|
230
|
+
agent: ExecutionCardAgent;
|
|
231
231
|
}, _optional?: Record<string, never>): string;
|
|
232
232
|
/** Human label for the model an agent will run, for the collapsed summary line
|
|
233
233
|
* on unselected cards. Falls back to the raw id when the host reported a
|
|
@@ -235,7 +235,7 @@ export declare function selectedAgentModel({ config, agent }: {
|
|
|
235
235
|
* choice is still the choice, and hiding it would misreport what will run. */
|
|
236
236
|
export declare function agentModelSummary({ config, agent }: {
|
|
237
237
|
config: LocalCliConfig;
|
|
238
|
-
agent:
|
|
238
|
+
agent: ExecutionCardAgent;
|
|
239
239
|
}, _optional?: Record<string, never>): string;
|
|
240
240
|
/** Picking an agent card. Re-picking the selected agent is a no-op rather than
|
|
241
241
|
* a deselect — the origin had no "no agent" affordance once one was chosen,
|
|
@@ -259,7 +259,7 @@ export declare function nextConfigForAgentModel({ config, agentId, model }: {
|
|
|
259
259
|
* pick from a second, independent list. */
|
|
260
260
|
export declare function selectedAgentReasoning({ config, agent }: {
|
|
261
261
|
config: LocalCliConfig;
|
|
262
|
-
agent:
|
|
262
|
+
agent: ExecutionCardAgent;
|
|
263
263
|
}, _optional?: Record<string, never>): string;
|
|
264
264
|
/** Recording a per-agent reasoning-effort pick. Keyed by agent id for the
|
|
265
265
|
* same cross-contamination reason as `nextConfigForAgentModel`. */
|
|
@@ -368,7 +368,7 @@ export declare function filterAgentModelOptions({ options, query, selectedValue
|
|
|
368
368
|
export declare function agentDiagnosticTooltip(diagnostic: AgentDiagnostic): string;
|
|
369
369
|
/**
|
|
370
370
|
* Splits a model id into its base and its reasoning-effort suffix, for a runtime that encodes
|
|
371
|
-
* effort inside the id (`
|
|
371
|
+
* effort inside the id (`ExecutionCardAgent.reasoningInModelId`).
|
|
372
372
|
*
|
|
373
373
|
* Only a trailing `-<token>` whose token appears in `levelIds` is a level. Everything else stays
|
|
374
374
|
* part of the base id — which is the whole point: `claude-opus-4-6-thinking` ends in `-thinking`,
|
|
@@ -546,7 +546,7 @@ export function agentDiagnosticTooltip(diagnostic) {
|
|
|
546
546
|
}
|
|
547
547
|
/**
|
|
548
548
|
* Splits a model id into its base and its reasoning-effort suffix, for a runtime that encodes
|
|
549
|
-
* effort inside the id (`
|
|
549
|
+
* effort inside the id (`ExecutionCardAgent.reasoningInModelId`).
|
|
550
550
|
*
|
|
551
551
|
* Only a trailing `-<token>` whose token appears in `levelIds` is a level. Everything else stays
|
|
552
552
|
* part of the base id — which is the whole point: `claude-opus-4-6-thinking` ends in `-thinking`,
|
|
@@ -50,21 +50,21 @@ export function ExternalMcpTab({ dependencies, fieldSpecs = MCP_SOURCE_FIELD_SPE
|
|
|
50
50
|
// text — showing both would just be two banners saying overlapping things.
|
|
51
51
|
const banner = list.error ?? connectionError;
|
|
52
52
|
const draftTestResultProps = list.testResults[DRAFT_TEST_SCOPE] ? { testResult: list.testResults[DRAFT_TEST_SCOPE] } : {};
|
|
53
|
-
return (_jsxs("section", { className: "external-mcp-tab", children: [_jsxs("div", { className: "external-mcp-head", children: [_jsxs("div", { children: [_jsx("h3", { children: t('External MCP servers') }), _jsx("p", { className: "external-mcp-subtitle", children: t('Third-party tools for your coding agent.') })] }), _jsxs("button", { type: "button", className: "external-mcp-add-button", onClick: () => setFormOpen((open) => !open), "aria-expanded": formOpen, children: [_jsx(Icon, { name: "plus", size: 14 }), _jsx("span", { children: t('Add server') })] })] }), banner ? (_jsx("div", { className: "external-mcp-banner", role: "alert", children: t(banner) })) : null, formOpen ? (_jsx(SourceConfigAddForm, { fieldSpecs: fieldSpecs, values: addForm.values, validation: addForm.validation, submitAttempted: addForm.submitAttempted, submitting: addForm.submitting, submitError: addForm.submitError, onFieldChange: addForm.setField, onTrustChange: addForm.setTrust, onSubmit: () => void addForm.submit(), canTest: list.capabilities.canTest, testing: list.isPending(DRAFT_TEST_SCOPE, 'test'), ...draftTestResultProps, onTest: () => void list.test(undefined, addForm.values), addLabel: "Add server" })) : null, list.loading ? (_jsx("div", { className: "source-config-list-loading", role: "status", children: t('Loading…') })) : (_jsx(ExternalMcpSources, { list: list, fieldSpecs: fieldSpecs, trustOptions: trustOptions })), _jsx(ExternalMcpFooter, { saveStatusLabel: saveStatusLabel, configPath: configPath })] }));
|
|
53
|
+
return (_jsxs("section", { className: "jini-ui-external-mcp-tab", children: [_jsxs("div", { className: "jini-ui-external-mcp-head", children: [_jsxs("div", { children: [_jsx("h3", { children: t('External MCP servers') }), _jsx("p", { className: "jini-ui-external-mcp-subtitle", children: t('Third-party tools for your coding agent.') })] }), _jsxs("button", { type: "button", className: "jini-ui-external-mcp-add-button", onClick: () => setFormOpen((open) => !open), "aria-expanded": formOpen, children: [_jsx(Icon, { name: "plus", size: 14 }), _jsx("span", { children: t('Add server') })] })] }), banner ? (_jsx("div", { className: "jini-ui-external-mcp-banner", role: "alert", children: t(banner) })) : null, formOpen ? (_jsx(SourceConfigAddForm, { fieldSpecs: fieldSpecs, values: addForm.values, validation: addForm.validation, submitAttempted: addForm.submitAttempted, submitting: addForm.submitting, submitError: addForm.submitError, onFieldChange: addForm.setField, onTrustChange: addForm.setTrust, onSubmit: () => void addForm.submit(), canTest: list.capabilities.canTest, testing: list.isPending(DRAFT_TEST_SCOPE, 'test'), ...draftTestResultProps, onTest: () => void list.test(undefined, addForm.values), addLabel: "Add server" })) : null, list.loading ? (_jsx("div", { className: "jini-ui-source-config-list-loading", role: "status", children: t('Loading…') })) : (_jsx(ExternalMcpSources, { list: list, fieldSpecs: fieldSpecs, trustOptions: trustOptions })), _jsx(ExternalMcpFooter, { saveStatusLabel: saveStatusLabel, configPath: configPath })] }));
|
|
54
54
|
}
|
|
55
55
|
/** The configured servers, or the empty-state hint when there are none yet. */
|
|
56
56
|
function ExternalMcpSources({ list, fieldSpecs, trustOptions, useTHook = useT, }) {
|
|
57
57
|
const t = useTHook();
|
|
58
58
|
if (list.sources.length === 0) {
|
|
59
|
-
return (_jsxs("div", { className: "external-mcp-empty", children: [_jsx("p", { className: "external-mcp-empty-title", children: t('No MCP servers configured.') }), _jsx("p", { className: "external-mcp-empty-hint", children: t('Click "Add server" to get started — pick a template or set up a custom stdio / HTTP server.') })] }));
|
|
59
|
+
return (_jsxs("div", { className: "jini-ui-external-mcp-empty", children: [_jsx("p", { className: "jini-ui-external-mcp-empty-title", children: t('No MCP servers configured.') }), _jsx("p", { className: "jini-ui-external-mcp-empty-hint", children: t('Click "Add server" to get started — pick a template or set up a custom stdio / HTTP server.') })] }));
|
|
60
60
|
}
|
|
61
|
-
return (_jsx("div", { className: "source-config-list-items", children: list.sources.map((source) => (_jsx(SourceConfigItemCard, { source: source, fieldSpecs: fieldSpecs, ...(trustOptions ? { trustOptions } : {}), capabilities: list.capabilities, removing: list.isPending(source.id, 'remove'), refreshing: list.isPending(source.id, 'refresh'), settingTrust: list.isPending(source.id, 'trust'), testing: list.isPending(source.id, 'test'), updating: list.isPending(source.id, 'update'), onRefresh: () => void list.refresh(source.id), onRemove: () => void list.remove(source.id), onTrustChange: (trust) => void list.setTrust(source.id, trust), onTest: () => void list.test(source.id), onUpdate: (patch) => void list.update(source.id, patch), ...(list.testResults[source.id] ? { testResult: list.testResults[source.id] } : {}) }, source.id))) }));
|
|
61
|
+
return (_jsx("div", { className: "jini-ui-source-config-list-items", children: list.sources.map((source) => (_jsx(SourceConfigItemCard, { source: source, fieldSpecs: fieldSpecs, ...(trustOptions ? { trustOptions } : {}), capabilities: list.capabilities, removing: list.isPending(source.id, 'remove'), refreshing: list.isPending(source.id, 'refresh'), settingTrust: list.isPending(source.id, 'trust'), testing: list.isPending(source.id, 'test'), updating: list.isPending(source.id, 'update'), onRefresh: () => void list.refresh(source.id), onRemove: () => void list.remove(source.id), onTrustChange: (trust) => void list.setTrust(source.id, trust), onTest: () => void list.test(source.id), onUpdate: (patch) => void list.update(source.id, patch), ...(list.testResults[source.id] ? { testResult: list.testResults[source.id] } : {}) }, source.id))) }));
|
|
62
62
|
}
|
|
63
63
|
/** Renders the save-status footer as one unit; a path alone does not show it. */
|
|
64
64
|
function ExternalMcpFooter({ saveStatusLabel, configPath, useTHook = useT }) {
|
|
65
65
|
const t = useTHook();
|
|
66
66
|
if (!saveStatusLabel)
|
|
67
67
|
return null;
|
|
68
|
-
return (_jsxs("div", { className: "external-mcp-footer", children: [_jsx("span", { className: "external-mcp-save-pill", children: t(saveStatusLabel) }), configPath ? (_jsxs("span", { className: "external-mcp-stored-at", children: [t('Stored at'), " ", _jsx("code", { children: configPath })] })) : null] }));
|
|
68
|
+
return (_jsxs("div", { className: "jini-ui-external-mcp-footer", children: [_jsx("span", { className: "jini-ui-external-mcp-save-pill", children: t(saveStatusLabel) }), configPath ? (_jsxs("span", { className: "jini-ui-external-mcp-stored-at", children: [t('Stored at'), " ", _jsx("code", { children: configPath })] })) : null] }));
|
|
69
69
|
}
|
|
70
70
|
//# sourceMappingURL=ExternalMcpTab.js.map
|
|
@@ -58,7 +58,7 @@ export type FileDropzoneHooks = typeof defaultFileDropzoneHooks;
|
|
|
58
58
|
* file-dialog cancel-vs-still-loading detection heuristic and a plain
|
|
59
59
|
* staged-names list). Both are the same underlying interaction — native
|
|
60
60
|
* drag/drop + click-to-browse resolving to a flat `File[]` — configured
|
|
61
|
-
* differently; see `
|
|
61
|
+
* differently; see `070311a07^:packages/ui/source-map.md` (section "features/file-dropzone/") for the full writeup.
|
|
62
62
|
*/
|
|
63
63
|
export declare function FileDropzone({ label, prompt, helper, accept, directory, enablePaste, files, onRemove, names, onRemoveName, onFiles, onZoneClick, onError, onProcessingStart, onBrowseFolder, secondaryAction, useFileDropzone: useFileDropzoneHook, useFileDropzonePreviews: useFileDropzonePreviewsHook, hooks, }: FileDropzoneProps): import("react").JSX.Element;
|
|
64
64
|
//# sourceMappingURL=FileDropzone.d.ts.map
|
|
@@ -34,7 +34,7 @@ function FileDropzoneBrowseFolder({ onBrowseFolder, t }) {
|
|
|
34
34
|
* file-dialog cancel-vs-still-loading detection heuristic and a plain
|
|
35
35
|
* staged-names list). Both are the same underlying interaction — native
|
|
36
36
|
* drag/drop + click-to-browse resolving to a flat `File[]` — configured
|
|
37
|
-
* differently; see `
|
|
37
|
+
* differently; see `070311a07^:packages/ui/source-map.md` (section "features/file-dropzone/") for the full writeup.
|
|
38
38
|
*/
|
|
39
39
|
export function FileDropzone({ label, prompt, helper, accept, directory, enablePaste = false, files, onRemove, names, onRemoveName, onFiles, onZoneClick, onError, onProcessingStart, onBrowseFolder, secondaryAction, useFileDropzone: useFileDropzoneHook = useFileDropzone, useFileDropzonePreviews: useFileDropzonePreviewsHook = useFileDropzonePreviews, hooks = defaultFileDropzoneHooks, }) {
|
|
40
40
|
const t = hooks.useT();
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { FindInPageResult } from '@jini-ai/core/contracts/find-in-page';
|
|
2
|
+
export interface FindBarState {
|
|
3
|
+
readonly open: boolean;
|
|
4
|
+
readonly query: string;
|
|
5
|
+
readonly result: FindInPageResult | null;
|
|
6
|
+
/** Bumped on every `toggle`, including a repeat Cmd+F while already open — see
|
|
7
|
+
* `useFindBarEffects`'s focus effect, which keys on this rather than on `open` so a second Cmd+F
|
|
8
|
+
* still refocuses. */
|
|
9
|
+
readonly focusNonce: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const initialFindBarState: FindBarState;
|
|
12
|
+
export type FindBarAction = {
|
|
13
|
+
type: 'toggle';
|
|
14
|
+
} | {
|
|
15
|
+
type: 'set-query';
|
|
16
|
+
query: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'result';
|
|
19
|
+
result: FindInPageResult;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'close';
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @complexity O(1).
|
|
25
|
+
*/
|
|
26
|
+
export declare function findBarReducer(state: FindBarState, action: FindBarAction): FindBarState;
|
|
27
|
+
/**
|
|
28
|
+
* Whether a bar that is currently `open` should close because the visible surface just changed
|
|
29
|
+
* (a different tab, or the host's own screen <-> a tab) — never for a re-render that left
|
|
30
|
+
* `activeGuestId` the same, and never while already closed (nothing open to reset).
|
|
31
|
+
*
|
|
32
|
+
* Extracted as a plain decision, not inlined in the effect that calls it, for the same reason
|
|
33
|
+
* every other routing choice in this folder is a function: the DECISION has to be testable on its
|
|
34
|
+
* own, without rendering the hook that applies it.
|
|
35
|
+
*
|
|
36
|
+
* @complexity O(1).
|
|
37
|
+
*/
|
|
38
|
+
export declare function shouldCloseOnGuestChange({ previousGuestId, activeGuestId, open }: {
|
|
39
|
+
previousGuestId: string | null;
|
|
40
|
+
activeGuestId: string | null;
|
|
41
|
+
open: boolean;
|
|
42
|
+
}, _options?: Record<string, never>): boolean;
|
|
43
|
+
/** The host's counter copy: the zero-match text and the `"<ordinal> of <total>"` phrasing. */
|
|
44
|
+
export interface FindMatchCountLabels {
|
|
45
|
+
readonly noResults: string;
|
|
46
|
+
readonly matchOf: (input: {
|
|
47
|
+
ordinal: number;
|
|
48
|
+
total: number;
|
|
49
|
+
}) => string;
|
|
50
|
+
}
|
|
51
|
+
/** The bar's own counter text: the host's `matchOf` phrasing, or its `noResults` text once a query has
|
|
52
|
+
* actually returned zero matches — never shown for an empty query, which has no `result` yet
|
|
53
|
+
* (see `findBarReducer`'s `set-query`). @complexity O(1). */
|
|
54
|
+
export declare function formatFindMatchCount({ result, labels }: {
|
|
55
|
+
result: FindInPageResult | null;
|
|
56
|
+
labels: FindMatchCountLabels;
|
|
57
|
+
}, _options?: Record<string, never>): string;
|
|
58
|
+
//# sourceMappingURL=find-bar-state.d.ts.map
|