zidane-ui 9.1.14 → 9.1.17
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/adapters/browser-keybindings-host.d.ts +10 -2
- package/dist/adapters/browser-keybindings-host.js +40 -2
- package/dist/adapters/index.d.ts +3 -2
- package/dist/adapters/index.js +3 -2
- package/dist/adapters/server-custom-frame.d.ts +22 -0
- package/dist/adapters/server-custom-frame.js +163 -0
- package/dist/adapters/server-extensions-host.js +1 -1
- package/dist/adapters/server-host.js +8 -3
- package/dist/adapters/server-machines-host.js +3 -2
- package/dist/adapters/server-settings-host.js +1 -1
- package/dist/adapters/server-views-host.d.ts +24 -0
- package/dist/adapters/server-views-host.js +78 -0
- package/dist/app/AppHostProvider.d.ts +4 -1
- package/dist/app/AppHostProvider.js +11 -5
- package/dist/app/ModalProvider.js +2 -2
- package/dist/app/NoticeStack.js +1 -1
- package/dist/app/headless/app-host.d.ts +3 -0
- package/dist/app/useConfirm.js +1 -1
- package/dist/appearance/AppearanceProvider.js +3 -3
- package/dist/appearance/headless/index.js +1 -1
- package/dist/approvals/ApprovalBar.js +27 -15
- package/dist/approvals/ApprovalShell.js +1 -1
- package/dist/approvals/ApprovalsProvider.js +1 -1
- package/dist/approvals/FileEditApproval.js +1 -1
- package/dist/approvals/HunkPreviews.js +2 -2
- package/dist/approvals/SafelistPanel.js +2 -2
- package/dist/approvals/headless/index.js +2 -2
- package/dist/approvals/headless/labels.d.ts +3 -0
- package/dist/approvals/headless/labels.js +3 -0
- package/dist/chat/ChatProvider.js +1 -1
- package/dist/chat/DaemonOrb.js +1 -1
- package/dist/chat/HostBadge.js +1 -1
- package/dist/chat/HostTranscript.js +1 -1
- package/dist/chat/PdfPreview.js +1 -1
- package/dist/chat/RunEstimateChip.js +1 -1
- package/dist/chat/SessionFilterMenu.js +2 -2
- package/dist/chat/SessionList.js +1 -1
- package/dist/chat/SessionListRow.js +2 -2
- package/dist/chat/SessionStreamsProvider.d.ts +3 -1
- package/dist/chat/SessionStreamsProvider.js +6 -2
- package/dist/chat/StatusDot.js +1 -1
- package/dist/chat/TextPreview.js +1 -1
- package/dist/chat/Throbber.js +1 -1
- package/dist/chat/Transcript.d.ts +1 -1
- package/dist/chat/Transcript.js +96 -27
- package/dist/chat/composer/AgentPicker.js +1 -1
- package/dist/chat/composer/AgentPickerDialog.js +1 -1
- package/dist/chat/composer/ApprovalDock.js +1 -1
- package/dist/chat/composer/AttachmentTiles.js +2 -2
- package/dist/chat/composer/Composer.js +2 -3
- package/dist/chat/composer/ComposerBadges.js +2 -2
- package/dist/chat/composer/ComposerControls.js +1 -1
- package/dist/chat/composer/ComposerEditor.js +2 -2
- package/dist/chat/composer/ComposerHostProvider.js +1 -1
- package/dist/chat/composer/ComposerShell.js +1 -1
- package/dist/chat/composer/ContextBreakdown.js +23 -23
- package/dist/chat/composer/ConversationBadges.js +2 -2
- package/dist/chat/composer/DraftPickers.d.ts +38 -0
- package/dist/chat/composer/DraftPickers.js +72 -0
- package/dist/chat/composer/EffortPickerDialog.js +1 -1
- package/dist/chat/composer/HostComposer.js +2 -2
- package/dist/chat/composer/HostContextOrb.js +2 -2
- package/dist/chat/composer/HostModelChainList.js +1 -1
- package/dist/chat/composer/HostPickers.js +1 -1
- package/dist/chat/composer/ImageModelList.js +1 -1
- package/dist/chat/composer/ModelChainList.js +1 -1
- package/dist/chat/composer/ModelChainParts.js +1 -1
- package/dist/chat/composer/ModelChainRow.js +1 -1
- package/dist/chat/composer/ModelChainRows.js +1 -1
- package/dist/chat/composer/ModelOptionsPicker.js +1 -1
- package/dist/chat/composer/ModelPicker.js +2 -2
- package/dist/chat/composer/ModelPickerDialog.js +1 -1
- package/dist/chat/composer/ModelProviderPills.js +1 -1
- package/dist/chat/composer/PickerPill.js +1 -1
- package/dist/chat/composer/ProjectMenu.js +1 -1
- package/dist/chat/composer/PromptHistoryProvider.js +1 -1
- package/dist/chat/composer/RunStatusChip.js +1 -1
- package/dist/chat/composer/attachment-ingest.js +4 -2
- package/dist/chat/composer/heif.d.ts +12 -0
- package/dist/chat/composer/heif.js +115 -0
- package/dist/chat/composer/index.d.ts +5 -3
- package/dist/chat/composer/index.js +4 -2
- package/dist/chat/composer/suggestions.js +1 -1
- package/dist/chat/composer/use-composer-stores.d.ts +3 -1
- package/dist/chat/composer/use-composer-stores.js +8 -3
- package/dist/chat/composer/use-draft-target.d.ts +5 -0
- package/dist/chat/composer/use-draft-target.js +11 -9
- package/dist/chat/composer/use-new-chats-default.d.ts +25 -0
- package/dist/chat/composer/use-new-chats-default.js +32 -0
- package/dist/chat/composer/use-run-meter.js +1 -1
- package/dist/chat/composer/use-send-prompt.d.ts +11 -1
- package/dist/chat/composer/use-send-prompt.js +6 -4
- package/dist/chat/headless/composer/index.js +2 -2
- package/dist/chat/headless/composer/labels-editor.d.ts +0 -2
- package/dist/chat/headless/composer/labels-editor.js +0 -2
- package/dist/chat/headless/host.d.ts +9 -0
- package/dist/chat/headless/index.d.ts +5 -4
- package/dist/chat/headless/index.js +16 -14
- package/dist/chat/headless/labels.d.ts +82 -3
- package/dist/chat/headless/labels.js +13 -5
- package/dist/chat/headless/notifications.d.ts +2 -0
- package/dist/chat/headless/notifications.js +1 -0
- package/dist/chat/headless/prompt-origin.d.ts +53 -2
- package/dist/chat/headless/prompt-origin.js +55 -5
- package/dist/chat/headless/session-list.d.ts +79 -2
- package/dist/chat/headless/sidebar/labels.d.ts +81 -4
- package/dist/chat/headless/transcript/batch.d.ts +12 -1
- package/dist/chat/headless/transcript/batch.js +47 -1
- package/dist/chat/headless/transcript/collapse.js +11 -0
- package/dist/chat/headless/transcript/fold.js +23 -7
- package/dist/chat/headless/transcript/index.d.ts +3 -3
- package/dist/chat/headless/transcript/index.js +2 -2
- package/dist/chat/headless/transcript/rows.d.ts +31 -2
- package/dist/chat/headless/transcript/select-stops.js +4 -0
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/headless/turn-labels.d.ts +2 -0
- package/dist/chat/headless/turn-labels.js +2 -0
- package/dist/chat/index.d.ts +10 -5
- package/dist/chat/index.js +9 -4
- package/dist/chat/interactions/HostInteractions.js +1 -1
- package/dist/chat/interactions/InboxPanel.js +2 -2
- package/dist/chat/interactions/PlanCard.js +4 -4
- package/dist/chat/interactions/QuestionField.js +2 -2
- package/dist/chat/interactions/QuestionForm.js +1 -1
- package/dist/chat/interactions/SecretInput.js +1 -1
- package/dist/chat/interactions/card-ui.js +1 -1
- package/dist/chat/rich-composer/MentionList.js +1 -1
- package/dist/chat/rich-composer/RichComposer.js +2 -8
- package/dist/chat/rich-composer/composer-extensions.d.ts +0 -2
- package/dist/chat/rich-composer/composer-extensions.js +2 -2
- package/dist/chat/rich-composer/use-composer-editor.d.ts +0 -2
- package/dist/chat/rich-composer/use-composer-editor.js +1 -2
- package/dist/chat/sidebar/MainSessionRow.js +1 -1
- package/dist/chat/sidebar/ProjectIcon.js +3 -3
- package/dist/chat/sidebar/SessionSidebar.js +2 -2
- package/dist/chat/sidebar/SidebarDecoration.js +2 -2
- package/dist/chat/sidebar/SidebarFilterMenu.js +1 -1
- package/dist/chat/sidebar/SidebarFooter.js +1 -1
- package/dist/chat/sidebar/SidebarFrame.js +2 -2
- package/dist/chat/sidebar/SidebarGroupHeader.js +3 -3
- package/dist/chat/sidebar/SidebarHostProvider.js +1 -1
- package/dist/chat/sidebar/SidebarRowView.js +1 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +6 -6
- package/dist/chat/sidebar/SpaceSwitcher.js +1 -1
- package/dist/chat/sidebar/SpacesSection.js +2 -2
- package/dist/chat/sidebar/sidebar-live.js +3 -3
- package/dist/chat/transcript/AnsiText.js +4 -4
- package/dist/chat/transcript/AuthFailureCard.js +2 -2
- package/dist/chat/transcript/BadgeMenu.js +1 -1
- package/dist/chat/transcript/CardMarkdown.js +1 -1
- package/dist/chat/transcript/ChipCards.js +1 -1
- package/dist/chat/transcript/CodemodeScript.js +11 -6
- package/dist/chat/transcript/DiffLines.js +1 -1
- package/dist/chat/transcript/EarlierHistory.js +1 -1
- package/dist/chat/transcript/EditDiffBlock.js +1 -1
- package/dist/chat/transcript/FileChip.js +5 -5
- package/dist/chat/transcript/ImageGenerationBlock.js +1 -1
- package/dist/chat/transcript/LazyRow.js +1 -1
- package/dist/chat/transcript/LiveOutput.js +1 -1
- package/dist/chat/transcript/MermaidDiagram.d.ts +68 -2
- package/dist/chat/transcript/MermaidDiagram.js +344 -32
- package/dist/chat/transcript/PromptEcho.js +1 -1
- package/dist/chat/transcript/ProseMarkdown.js +1 -1
- package/dist/chat/transcript/ReferenceText.js +8 -8
- package/dist/chat/transcript/SelectCursor.js +1 -1
- package/dist/chat/transcript/SelectTurnProvider.js +1 -1
- package/dist/chat/transcript/SubagentBlock.js +1 -1
- package/dist/chat/transcript/TranscriptRow.js +20 -5
- package/dist/chat/transcript/TranscriptSearch.js +1 -1
- package/dist/chat/transcript/TurnMenu.js +1 -1
- package/dist/chat/transcript/actions.js +1 -1
- package/dist/chat/transcript/diagrams-scope.d.ts +4 -0
- package/dist/chat/transcript/diagrams-scope.js +11 -0
- package/dist/chat/transcript/extension-renderers.js +1 -1
- package/dist/chat/transcript/fold-attachments.js +1 -1
- package/dist/chat/transcript/fold-status.js +1 -1
- package/dist/chat/transcript/fold-worker.js +1 -1
- package/dist/chat/transcript/fold.js +5 -5
- package/dist/chat/transcript/frame.js +1 -1
- package/dist/chat/transcript/index.d.ts +5 -2
- package/dist/chat/transcript/index.js +5 -2
- package/dist/chat/transcript/markdown.js +95 -14
- package/dist/chat/transcript/messages.js +19 -10
- package/dist/chat/transcript/notices.js +2 -2
- package/dist/chat/transcript/prompt-lines.js +5 -5
- package/dist/chat/transcript/prompt.js +2 -2
- package/dist/chat/transcript/prose.js +1 -1
- package/dist/chat/transcript/renderer-slots.js +1 -1
- package/dist/chat/transcript/renderers.js +3 -3
- package/dist/chat/transcript/row-estimate.js +5 -1
- package/dist/chat/transcript/run-rows.js +2 -2
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +5 -5
- package/dist/chat/transcript/tasks.d.ts +35 -0
- package/dist/chat/transcript/tasks.js +100 -0
- package/dist/chat/transcript/tool-batch.js +2 -2
- package/dist/chat/transcript/tool-media.js +1 -1
- package/dist/chat/transcript/tool-parts.js +1 -1
- package/dist/chat/transcript/tool-row.js +8 -8
- package/dist/chat/transcript/turn-commands.d.ts +15 -1
- package/dist/chat/transcript/turn-commands.js +43 -4
- package/dist/chat/transcript/use-host-turn-menu.d.ts +25 -0
- package/dist/chat/transcript/use-host-turn-menu.js +57 -0
- package/dist/chat/transcript/use-transcript-rows.js +2 -2
- package/dist/chat/transcript/useStickToBottom.js +1 -1
- package/dist/chat/transcript/useTranscriptSearch.js +1 -1
- package/dist/chat/transcript/user-bash.js +1 -1
- package/dist/chat/transcript/view-scope.d.ts +163 -0
- package/dist/chat/transcript/view-scope.js +224 -0
- package/dist/chat/transcript-options.d.ts +1 -1
- package/dist/chat/transcript-options.js +4 -1
- package/dist/code/CodeHighlightProvider.js +1 -1
- package/dist/code/HighlightedCode.js +1 -1
- package/dist/code/editor/CodeCompletion.js +3 -3
- package/dist/code/editor/CodeEditor.js +1 -1
- package/dist/code/editor/CodeHover.js +1 -1
- package/dist/code/editor/DiffView.js +1 -1
- package/dist/code/editor/EditorColumn.js +1 -1
- package/dist/code/editor/FileIcon.js +1 -1
- package/dist/code/editor/FileTree.js +1 -1
- package/dist/code/editor/FileView.js +1 -1
- package/dist/code/editor/HighlightWorkers.js +2 -2
- package/dist/code/editor/LanguageEditor.js +1 -1
- package/dist/code/editor/environment.js +1 -1
- package/dist/code/editor/find/FindBar.js +1 -1
- package/dist/components/Accordion.d.ts +30 -0
- package/dist/components/Accordion.js +96 -0
- package/dist/components/Breadcrumb.js +1 -1
- package/dist/components/Breakdown.d.ts +82 -0
- package/dist/components/Breakdown.js +212 -0
- package/dist/components/BrowserChrome.js +1 -1
- package/dist/components/BrowserSignIn.js +4 -4
- package/dist/components/Callout.d.ts +29 -0
- package/dist/components/Callout.js +60 -0
- package/dist/components/Checklist.d.ts +53 -0
- package/dist/components/Checklist.js +189 -0
- package/dist/components/ChoiceCards.d.ts +7 -1
- package/dist/components/ChoiceCards.js +11 -7
- package/dist/components/CodeFrame.js +1 -1
- package/dist/components/Compare.d.ts +65 -0
- package/dist/components/Compare.js +242 -0
- package/dist/components/ConfirmDialog.js +1 -1
- package/dist/components/CopyButton.js +1 -1
- package/dist/components/EditableTitle.js +1 -1
- package/dist/components/ErrorBoundary.js +1 -1
- package/dist/components/Form.d.ts +3 -1
- package/dist/components/Form.js +2 -1
- package/dist/components/HowItWorks.js +2 -2
- package/dist/components/IconButton.js +2 -2
- package/dist/components/KeyValue.d.ts +37 -0
- package/dist/components/KeyValue.js +43 -0
- package/dist/components/Lightbox.js +2 -2
- package/dist/components/Menu.js +2 -2
- package/dist/components/Overlay.js +2 -2
- package/dist/components/Progress.d.ts +55 -0
- package/dist/components/Progress.js +94 -0
- package/dist/components/ReorderTabs.js +1 -1
- package/dist/components/RowActionsMenu.js +3 -3
- package/dist/components/RowMenuButton.d.ts +24 -0
- package/dist/components/RowMenuButton.js +42 -0
- package/dist/components/Segmented.js +1 -1
- package/dist/components/Stat.d.ts +105 -0
- package/dist/components/Stat.js +131 -0
- package/dist/components/StepFrame.js +1 -1
- package/dist/components/Steps.d.ts +38 -0
- package/dist/components/Steps.js +49 -0
- package/dist/components/Surface.d.ts +1 -1
- package/dist/components/Surface.js +1 -1
- package/dist/components/SwatchPicker.js +1 -1
- package/dist/components/Table.d.ts +123 -0
- package/dist/components/Table.js +437 -0
- package/dist/components/Tabs.d.ts +41 -0
- package/dist/components/Tabs.js +103 -0
- package/dist/components/ToggleCard.js +3 -3
- package/dist/components/Tooltip.js +2 -2
- package/dist/components/ZidaneMark.js +1 -1
- package/dist/components/ZoomableImage.js +1 -1
- package/dist/components/charts/AreaChart.d.ts +24 -0
- package/dist/components/charts/AreaChart.js +210 -0
- package/dist/components/charts/BarChart.d.ts +112 -0
- package/dist/components/charts/BarChart.js +686 -0
- package/dist/components/charts/LineChart.d.ts +34 -0
- package/dist/components/charts/LineChart.js +299 -0
- package/dist/components/charts/ScatterChart.d.ts +83 -0
- package/dist/components/charts/ScatterChart.js +702 -0
- package/dist/components/charts/Sparkline.d.ts +31 -0
- package/dist/components/charts/Sparkline.js +82 -0
- package/dist/components/charts/Trend.d.ts +86 -0
- package/dist/components/charts/Trend.js +233 -0
- package/dist/components/charts/frame.d.ts +225 -0
- package/dist/components/charts/frame.js +475 -0
- package/dist/components/charts/index.d.ts +10 -0
- package/dist/components/charts/index.js +9 -0
- package/dist/components/charts/interact.d.ts +89 -0
- package/dist/components/charts/interact.js +296 -0
- package/dist/components/charts/measure.d.ts +29 -0
- package/dist/components/charts/measure.js +79 -0
- package/dist/components/charts/xy.d.ts +230 -0
- package/dist/components/charts/xy.js +488 -0
- package/dist/components/charts/zoom-reset.d.ts +7 -0
- package/dist/components/charts/zoom-reset.js +23 -0
- package/dist/components/floating/FloatingSurface.js +1 -1
- package/dist/components/floating/HoverCard.js +2 -2
- package/dist/components/floating/Popover.js +2 -2
- package/dist/components/lazy-part.d.ts +17 -0
- package/dist/components/lazy-part.js +33 -0
- package/dist/components/numbers.d.ts +74 -0
- package/dist/components/numbers.js +157 -0
- package/dist/components/palette/PaletteList.js +5 -5
- package/dist/components/palette/PalettePanel.js +2 -2
- package/dist/core.css +517 -3
- package/dist/dist/index-BUHcyEqA.d.ts +1 -0
- package/dist/dist/{index-C6rzc-tt.d.ts → index-CGCMyhB3.d.ts} +182 -126
- package/dist/dist/index.d.ts +5 -5
- package/dist/dist/sandbox-Cib3Qf4t.d.ts +2 -0
- package/dist/dist/{timeout-Cz9dRF8Q.d.ts → timeout-Cyx3VGPz.d.ts} +1 -1
- package/dist/extensions/ExtensionComponent.js +6 -5
- package/dist/extensions/ExtensionDialogHost.js +1 -1
- package/dist/extensions/ExtensionRenderer.js +1 -1
- package/dist/extensions/ExtensionScreen.js +1 -1
- package/dist/extensions/ExtensionSettingsPage.js +2 -2
- package/dist/extensions/ExtensionSettingsSection.js +2 -2
- package/dist/extensions/ExtensionSettingsSidebar.js +2 -2
- package/dist/extensions/ExtensionSlot.js +2 -2
- package/dist/extensions/ExtensionWebview.js +1 -1
- package/dist/extensions/ExtensionsProvider.js +1 -1
- package/dist/extensions/headless/fixture-host.js +1 -1
- package/dist/extensions/headless/index.d.ts +2 -2
- package/dist/extensions/headless/index.js +4 -4
- package/dist/extensions/headless/wire.d.ts +5 -1
- package/dist/extensions/headless/wire.js +2 -1
- package/dist/extensions/hooks.js +1 -1
- package/dist/extensions/links.js +1 -1
- package/dist/files/CodeViewer.js +1 -1
- package/dist/files/DiffFileViewer.js +1 -1
- package/dist/files/DiffsTab.js +2 -2
- package/dist/files/EditorColumn.js +63 -29
- package/dist/files/EditorEnvironmentRoot.js +1 -1
- package/dist/files/FilePreview.d.ts +24 -0
- package/dist/files/FilePreview.js +283 -0
- package/dist/files/FilesProvider.js +1 -1
- package/dist/files/FilesTab.js +2 -2
- package/dist/files/MediaDiff.js +2 -2
- package/dist/files/MediaView.js +1 -1
- package/dist/files/ReviewDraft.js +1 -1
- package/dist/files/ReviewableDiff.js +2 -2
- package/dist/files/SearchPanel.js +2 -2
- package/dist/files/TreeColumn.js +2 -2
- package/dist/files/file-actions.js +1 -0
- package/dist/files/headless/labels.d.ts +5 -0
- package/dist/files/headless/labels.js +5 -0
- package/dist/files/headless/preview.d.ts +44 -0
- package/dist/files/headless/preview.js +103 -0
- package/dist/files/lazy-tabs.js +1 -1
- package/dist/files/useCodeReview.js +1 -1
- package/dist/files/useEntryActions.js +1 -1
- package/dist/files/useLsp.js +1 -1
- package/dist/files/useOpenFiles.d.ts +2 -0
- package/dist/files/useOpenFiles.js +15 -1
- package/dist/git/BranchMenu.js +8 -8
- package/dist/git/GitBar.js +1 -1
- package/dist/git/GitProvider.js +1 -1
- package/dist/git/ImportRepoDialog.js +1 -1
- package/dist/git/MoveSessionDialog.js +3 -3
- package/dist/git/RemoteFolderPicker.js +5 -5
- package/dist/git/SyncChip.js +1 -1
- package/dist/git/WherePicker.d.ts +2 -0
- package/dist/git/WherePicker.js +16 -13
- package/dist/git/headless/index.js +1 -1
- package/dist/git/index.d.ts +1 -1
- package/dist/git/index.js +1 -1
- package/dist/git/useEnvironmentChoices.js +1 -1
- package/dist/hooks/useDisplayPath.js +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +16 -3
- package/dist/keybindings/KeyCommands.js +2 -2
- package/dist/keybindings/KeybindingsProvider.js +5 -3
- package/dist/keybindings/headless/host.d.ts +5 -0
- package/dist/keybindings/headless/index.js +2 -2
- package/dist/keybindings/headless/overrides.d.ts +2 -1
- package/dist/keybindings/headless/overrides.js +3 -2
- package/dist/keybindings/testing/contract.js +1 -0
- package/dist/labels.d.ts +97 -0
- package/dist/labels.js +104 -1
- package/dist/machines/AddMachineDialog.js +3 -3
- package/dist/machines/AddServerForm.js +1 -1
- package/dist/machines/DaemonMenu.js +3 -3
- package/dist/machines/HostCapabilities.js +5 -5
- package/dist/machines/HostIcon.d.ts +21 -0
- package/dist/machines/HostIcon.js +19 -0
- package/dist/machines/HostSignIn.js +1 -1
- package/dist/machines/HostSyncPanel.js +2 -2
- package/dist/machines/HostsSection.d.ts +27 -1
- package/dist/machines/HostsSection.js +60 -46
- package/dist/machines/MachinesProvider.js +1 -1
- package/dist/machines/ServerCard.d.ts +1 -2
- package/dist/machines/ServerCard.js +4 -9
- package/dist/machines/ServerMachinesPanel.js +161 -196
- package/dist/machines/ServerUpdatePanel.js +94 -111
- package/dist/machines/ShareThisComputerForm.js +1 -1
- package/dist/machines/SyncAccounts.js +1 -1
- package/dist/machines/SyncMarker.js +2 -2
- package/dist/machines/SyncOutcomeBadge.js +1 -1
- package/dist/machines/TokensPanel.js +225 -124
- package/dist/machines/headless/fixture-host.js +1 -1
- package/dist/machines/headless/index.d.ts +2 -1
- package/dist/machines/headless/index.js +4 -3
- package/dist/machines/headless/labels.d.ts +22 -0
- package/dist/machines/headless/labels.js +25 -0
- package/dist/machines/headless/update-store.d.ts +29 -0
- package/dist/machines/headless/update-store.js +83 -0
- package/dist/machines/index.d.ts +5 -3
- package/dist/machines/index.js +5 -3
- package/dist/machines/server-update.d.ts +23 -0
- package/dist/machines/server-update.js +106 -0
- package/dist/motion/grow.js +1 -1
- package/dist/motion/provider.js +1 -1
- package/dist/motion/roll.js +2 -2
- package/dist/motion/size.js +1 -1
- package/dist/motion/springs.js +1 -1
- package/dist/motion/swap.js +1 -1
- package/dist/motion/title-text.js +2 -2
- package/dist/onboarding/OnboardingFlow.js +1 -1
- package/dist/onboarding/OnboardingProvider.js +1 -1
- package/dist/onboarding/conversation.js +1 -1
- package/dist/onboarding/demos/features.js +1 -1
- package/dist/onboarding/demos/tour.js +1 -1
- package/dist/onboarding/headless/labels.d.ts +74 -0
- package/dist/onboarding/skills/SkillSourceBrowser.js +1 -1
- package/dist/onboarding/skills/parts.js +1 -1
- package/dist/onboarding/sources/SourceBrowser.js +4 -4
- package/dist/onboarding/steps/ConnectStep.js +1 -1
- package/dist/onboarding/steps/ConnectorsStep.js +2 -2
- package/dist/onboarding/steps/ConversationStep.js +2 -2
- package/dist/onboarding/steps/FeatureExample.js +2 -2
- package/dist/onboarding/steps/ImportStep.js +2 -2
- package/dist/onboarding/steps/LookStep.js +1 -1
- package/dist/onboarding/steps/ReadyStep.js +2 -2
- package/dist/onboarding/steps/connect/KeyForm.js +1 -1
- package/dist/onboarding/steps/connect/ProviderPanel.js +1 -1
- package/dist/onboarding/steps/connect/ProviderReady.js +2 -2
- package/dist/palette/CommandPalette.d.ts +3 -1
- package/dist/palette/CommandPalette.js +11 -3
- package/dist/palette/PaletteDialog.js +25 -2
- package/dist/palette/PaletteProvider.js +1 -1
- package/dist/palette/PaletteRows.js +5 -5
- package/dist/palette/app-sources.js +1 -1
- package/dist/palette/headless/index.d.ts +2 -2
- package/dist/palette/headless/index.js +2 -2
- package/dist/palette/headless/labels.d.ts +2 -0
- package/dist/palette/headless/labels.js +2 -0
- package/dist/palette/headless/sources.d.ts +26 -2
- package/dist/palette/headless/sources.js +40 -1
- package/dist/session/ArtifactsPanel.js +3 -3
- package/dist/session/DiffFileTree.js +1 -1
- package/dist/session/PlanTracker.js +2 -2
- package/dist/session/ProjectHome.js +4 -4
- package/dist/session/ProviderUsageProvider.js +2 -2
- package/dist/session/QueueTab.js +6 -6
- package/dist/session/RemindersPanel.js +3 -3
- package/dist/session/RunningWorkDialog.js +3 -2
- package/dist/session/SecretsPanel.js +2 -2
- package/dist/session/SessionCacheFacts.js +56 -57
- package/dist/session/SessionDetailsDialog.js +29 -17
- package/dist/session/SessionHeader.js +1 -1
- package/dist/session/SessionProvider.js +1 -1
- package/dist/session/SessionShell.js +2 -2
- package/dist/session/SideChat.js +1 -1
- package/dist/session/StepStatusIcon.js +1 -1
- package/dist/session/TurnDetailsDialog.js +1 -1
- package/dist/session/UsagePanel.js +9 -5
- package/dist/session/WelcomeScreen.js +1 -1
- package/dist/session/headless/host.d.ts +1 -1
- package/dist/session/headless/index.js +1 -1
- package/dist/session/headless/labels.d.ts +1 -0
- package/dist/session/headless/labels.js +4 -2
- package/dist/settings/SettingsFooter.d.ts +51 -0
- package/dist/settings/SettingsFooter.js +91 -0
- package/dist/settings/SettingsHeadingText.js +1 -1
- package/dist/settings/SettingsNav.js +1 -1
- package/dist/settings/SettingsProvider.js +1 -1
- package/dist/settings/SettingsRestricted.js +2 -2
- package/dist/settings/SettingsRowsPage.js +2 -2
- package/dist/settings/SettingsShell.js +3 -3
- package/dist/settings/headless/app-update.d.ts +27 -0
- package/dist/settings/headless/app-update.js +0 -0
- package/dist/settings/headless/catalog.js +61 -1
- package/dist/settings/headless/fixture-accounts.js +7 -0
- package/dist/settings/headless/index.d.ts +2 -1
- package/dist/settings/headless/index.js +3 -3
- package/dist/settings/headless/labels.d.ts +13 -0
- package/dist/settings/headless/labels.js +16 -1
- package/dist/settings/headless/layout.js +30 -12
- package/dist/settings/headless/mcp.d.ts +4 -0
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.d.ts +3 -1
- package/dist/settings/index.js +11 -9
- package/dist/settings/section.js +1 -1
- package/dist/settings/sections/appearance/AppearanceSection.js +3 -3
- package/dist/settings/sections/claude-import/ClaudeImportDialog.js +3 -3
- package/dist/settings/sections/descriptors.js +4 -4
- package/dist/settings/sections/editor/EditorSection.js +3 -3
- package/dist/settings/sections/enabled-list/EnabledListSection.js +1 -1
- package/dist/settings/sections/environments/EnvironmentsSection.js +5 -5
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +2 -2
- package/dist/settings/sections/extensions/CreateExtensionDialog.js +2 -2
- package/dist/settings/sections/extensions/ExtensionConfigRows.js +2 -2
- package/dist/settings/sections/extensions/ExtensionOptionsSection.js +2 -2
- package/dist/settings/sections/extensions/ExtensionPicksBar.js +1 -1
- package/dist/settings/sections/extensions/ExtensionSourceBrowser.js +1 -1
- package/dist/settings/sections/extensions/ExtensionsSection.js +3 -3
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +5 -5
- package/dist/settings/sections/index.js +8 -8
- package/dist/settings/sections/instructions/InstructionsSection.js +4 -4
- package/dist/settings/sections/keybindings/KeybindingsSection.js +2 -2
- package/dist/settings/sections/logs/LogsSection.js +1 -1
- package/dist/settings/sections/mcp/McpAddForm.js +48 -22
- package/dist/settings/sections/mcp/McpSection.js +15 -3
- package/dist/settings/sections/mcp/McpServerRow.d.ts +3 -1
- package/dist/settings/sections/mcp/McpServerRow.js +105 -11
- package/dist/settings/sections/mcp/labels.d.ts +18 -0
- package/dist/settings/sections/mcp/labels.js +18 -0
- package/dist/settings/sections/models/AgentDefaults.js +4 -4
- package/dist/settings/sections/models/ModelListPicker.js +1 -1
- package/dist/settings/sections/models/ModelPickField.js +1 -1
- package/dist/settings/sections/models/ModelRows.js +2 -2
- package/dist/settings/sections/models/model-test.js +1 -1
- package/dist/settings/sections/performance/PerfSparkline.js +1 -1
- package/dist/settings/sections/performance/PerformanceSection.js +14 -14
- package/dist/settings/sections/plugins/PluginsSection.js +1 -1
- package/dist/settings/sections/providers/CredentialSources.js +3 -3
- package/dist/settings/sections/providers/ProvidersSection.js +2 -2
- package/dist/settings/sections/providers/ServerProvidersSection.js +2 -2
- package/dist/settings/sections/providers/ServerSignIn.js +2 -2
- package/dist/settings/sections/shared/catalog.js +3 -3
- package/dist/settings/sections/skills/SkillList.js +5 -5
- package/dist/settings/sections/skills/SkillsSection.js +3 -3
- package/dist/settings/server-app.d.ts +41 -0
- package/dist/settings/server-app.js +155 -0
- package/dist/settings/testing/accounts.contract.d.ts +1 -1
- package/dist/settings/testing/accounts.contract.js +10 -1
- package/dist/styles.css +686 -30
- package/dist/terminal/HostTerminalSurface.js +6 -5
- package/dist/terminal/TerminalDrawer.js +2 -2
- package/dist/terminal/TerminalPanel.js +3 -3
- package/dist/terminal/TerminalProvider.d.ts +13 -2
- package/dist/terminal/TerminalProvider.js +15 -7
- package/dist/terminal/TerminalSurface.d.ts +3 -1
- package/dist/terminal/TerminalSurface.js +5 -4
- package/dist/terminal/assets.d.ts +10 -0
- package/dist/terminal/assets.js +23 -0
- package/dist/terminal/fonts/LICENSE +21 -0
- package/dist/terminal/fonts/SymbolsNerdFontMono-Regular.woff2 +0 -0
- package/dist/terminal/ghostty.d.ts +3 -1
- package/dist/terminal/ghostty.js +25 -4
- package/dist/terminal/index.d.ts +2 -2
- package/dist/theme/derive.d.ts +3 -2
- package/dist/theme/derive.js +3 -2
- package/dist/uno.js +2 -1
- package/dist/url-imports.d.ts +6 -0
- package/dist/views/BoolMark.d.ts +15 -0
- package/dist/views/BoolMark.js +28 -0
- package/dist/views/SvgImage.d.ts +19 -0
- package/dist/views/SvgImage.js +89 -0
- package/dist/views/TranscriptViews.d.ts +31 -0
- package/dist/views/TranscriptViews.js +59 -0
- package/dist/views/ViewAutoRefresh.d.ts +23 -0
- package/dist/views/ViewAutoRefresh.js +73 -0
- package/dist/views/ViewBlock.d.ts +40 -0
- package/dist/views/ViewBlock.js +482 -0
- package/dist/views/ViewCharts.d.ts +20 -0
- package/dist/views/ViewCharts.js +331 -0
- package/dist/views/ViewControls.d.ts +49 -0
- package/dist/views/ViewControls.js +208 -0
- package/dist/views/ViewCustom.d.ts +40 -0
- package/dist/views/ViewCustom.js +354 -0
- package/dist/views/ViewExpanded.d.ts +32 -0
- package/dist/views/ViewExpanded.js +107 -0
- package/dist/views/ViewExtension.d.ts +21 -0
- package/dist/views/ViewExtension.js +125 -0
- package/dist/views/ViewInputs.d.ts +24 -0
- package/dist/views/ViewInputs.js +561 -0
- package/dist/views/ViewMcpApp.d.ts +26 -0
- package/dist/views/ViewMcpApp.js +569 -0
- package/dist/views/ViewNodes.d.ts +92 -0
- package/dist/views/ViewNodes.js +1073 -0
- package/dist/views/ViewPreviewPage.d.ts +42 -0
- package/dist/views/ViewPreviewPage.js +214 -0
- package/dist/views/ViewTables.d.ts +15 -0
- package/dist/views/ViewTables.js +305 -0
- package/dist/views/ViewsProvider.d.ts +32 -0
- package/dist/views/ViewsProvider.js +50 -0
- package/dist/views/badge-tone.d.ts +20 -0
- package/dist/views/badge-tone.js +100 -0
- package/dist/views/expanded.d.ts +7 -0
- package/dist/views/expanded.js +14 -0
- package/dist/views/format.d.ts +18 -0
- package/dist/views/format.js +37 -0
- package/dist/views/headless/answers.d.ts +50 -0
- package/dist/views/headless/answers.js +85 -0
- package/dist/views/headless/custom-slots.d.ts +35 -0
- package/dist/views/headless/custom-slots.js +59 -0
- package/dist/views/headless/download.d.ts +10 -0
- package/dist/views/headless/download.js +26 -0
- package/dist/views/headless/frame-name.d.ts +17 -0
- package/dist/views/headless/frame-name.js +24 -0
- package/dist/views/headless/host.d.ts +197 -0
- package/dist/views/headless/host.js +0 -0
- package/dist/views/headless/index.d.ts +13 -0
- package/dist/views/headless/index.js +12 -0
- package/dist/views/headless/labels.d.ts +144 -0
- package/dist/views/headless/labels.js +147 -0
- package/dist/views/headless/live.d.ts +12 -0
- package/dist/views/headless/live.js +50 -0
- package/dist/views/headless/lru.d.ts +31 -0
- package/dist/views/headless/lru.js +62 -0
- package/dist/views/headless/mcp-app-bridge.d.ts +128 -0
- package/dist/views/headless/mcp-app-bridge.js +330 -0
- package/dist/views/headless/placement.d.ts +98 -0
- package/dist/views/headless/placement.js +227 -0
- package/dist/views/headless/records.d.ts +53 -0
- package/dist/views/headless/records.js +114 -0
- package/dist/views/headless/refs.d.ts +10 -0
- package/dist/views/headless/refs.js +13 -0
- package/dist/views/headless/safe.d.ts +35 -0
- package/dist/views/headless/safe.js +58 -0
- package/dist/views/headless/store.d.ts +54 -0
- package/dist/views/headless/store.js +228 -0
- package/dist/views/headless/streaming.d.ts +43 -0
- package/dist/views/headless/streaming.js +136 -0
- package/dist/views/headless/view-state.d.ts +20 -0
- package/dist/views/headless/view-state.js +55 -0
- package/dist/views/index.d.ts +2 -0
- package/dist/views/index.js +1 -0
- package/dist/views/input-preview.d.ts +5 -0
- package/dist/views/input-preview.js +11 -0
- package/dist/views/preview-style.d.ts +10 -0
- package/dist/views/preview-style.js +262 -0
- package/dist/views/preview.d.ts +2 -0
- package/dist/views/preview.js +1 -0
- package/dist/views/testing/contract.d.ts +50 -0
- package/dist/views/testing/contract.js +266 -0
- package/dist/views/testing/fixture-host.d.ts +29 -0
- package/dist/views/testing/fixture-host.js +77 -0
- package/dist/views/testing/index.d.ts +2 -0
- package/dist/views/testing/index.js +1 -0
- package/dist/views/theme-watch.d.ts +28 -0
- package/dist/views/theme-watch.js +65 -0
- package/dist/views/trusted.d.ts +17 -0
- package/dist/views/trusted.js +17 -0
- package/dist/views/viewport.d.ts +30 -0
- package/dist/views/viewport.js +87 -0
- package/dist/workspace/LayoutBudget.js +1 -1
- package/dist/workspace/PanelContentView.js +2 -2
- package/dist/workspace/PanelGroups.js +1 -1
- package/dist/workspace/PanelHome.js +1 -1
- package/dist/workspace/PanelItems.js +2 -2
- package/dist/workspace/PanelStrip.js +2 -2
- package/dist/workspace/PanelToolbar.js +2 -2
- package/dist/workspace/SidePanel.js +4 -4
- package/dist/workspace/TabParking.js +2 -2
- package/dist/workspace/WorkspaceProvider.js +2 -2
- package/dist/workspace/dnd/parking.js +2 -2
- package/dist/workspace/extension-tabs.js +3 -3
- package/dist/workspace/headless/index.js +1 -1
- package/package.json +49 -2
- package/src/styles/components.css +421 -0
- package/src/styles/files.css +15 -0
- package/src/styles/primitives.css +10 -0
- package/src/styles/tokens.css +20 -1
- package/src/styles/transcript.css +174 -18
- package/dist/dist/index-f-XWIoYo.d.ts +0 -1
- package/dist/dist/sandbox-B4OW6oNx.d.ts +0 -2
- /package/dist/dist/{types-2HrgolQz.d.ts → types-CgfAUN48.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeybindingsHost } from "../keybindings/headless/host.js";
|
|
1
|
+
import { KeyOverrides, KeybindingsHost } from "../keybindings/headless/host.js";
|
|
2
2
|
import "../keybindings/headless/index.js";
|
|
3
3
|
//#region src/adapters/browser-keybindings-host.d.ts
|
|
4
4
|
/** Options of {@link createBrowserKeybindingsHost}. */
|
|
@@ -7,7 +7,15 @@ interface BrowserKeybindingsHostOptions {
|
|
|
7
7
|
storage?: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
|
|
8
8
|
/** The key. Default: `zg:keybindings:v1`. */
|
|
9
9
|
key?: string;
|
|
10
|
+
/** The defaults over the catalog's. Default: `browserKeybindingDefaults()` for this platform. */
|
|
11
|
+
defaults?: KeyOverrides;
|
|
10
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* The chords a browser page receives, for the actions whose catalog chord it doesn't.
|
|
15
|
+
*
|
|
16
|
+
* @param mac - A Mac's browser. Default: this page's platform.
|
|
17
|
+
*/
|
|
18
|
+
declare function browserKeybindingDefaults(mac?: boolean): KeyOverrides;
|
|
11
19
|
/**
|
|
12
20
|
* Creates a {@link KeybindingsHost} over the browser's storage: the overrides and `save`.
|
|
13
21
|
*
|
|
@@ -15,4 +23,4 @@ interface BrowserKeybindingsHostOptions {
|
|
|
15
23
|
*/
|
|
16
24
|
declare function createBrowserKeybindingsHost(options?: BrowserKeybindingsHostOptions): KeybindingsHost;
|
|
17
25
|
//#endregion
|
|
18
|
-
export { BrowserKeybindingsHostOptions, createBrowserKeybindingsHost };
|
|
26
|
+
export { BrowserKeybindingsHostOptions, browserKeybindingDefaults, createBrowserKeybindingsHost };
|
|
@@ -5,9 +5,46 @@ import { createKeybindingOverrides } from "../keybindings/headless/overrides.js"
|
|
|
5
5
|
* `localStorage`: the web app's. zidane-server keeps no keybindings (the
|
|
6
6
|
* protocol leaves them client-local, and `~/.zidane/keybindings.json` is the
|
|
7
7
|
* desktop app's), so the overrides live in the page's storage as one JSON map.
|
|
8
|
+
*
|
|
9
|
+
* A browser keeps some chords for itself (Ctrl+W, Ctrl+N and Ctrl+T off a
|
|
10
|
+
* Mac, ⌘N and ⌘W on one), and off a Mac there is no ⌘ key: the host's
|
|
11
|
+
* `defaults` (`browserKeybindingDefaults`) give those actions chords a page
|
|
12
|
+
* receives.
|
|
8
13
|
*/
|
|
9
14
|
/** The key the overrides live under by default. */
|
|
10
15
|
const KEYBINDINGS_KEY = "zg:keybindings:v1";
|
|
16
|
+
/** On a Mac, a browser keeps ⌘N and ⌘W: the Ctrl chords stay. */
|
|
17
|
+
const MAC_BROWSER_DEFAULTS = {
|
|
18
|
+
newSession: "ctrl+n",
|
|
19
|
+
closeTab: "ctrl+w"
|
|
20
|
+
};
|
|
21
|
+
/** Off a Mac there is no ⌘, and the browser keeps Ctrl+W, Ctrl+N and Ctrl+T. */
|
|
22
|
+
const OTHER_BROWSER_DEFAULTS = {
|
|
23
|
+
openSettings: "ctrl+,",
|
|
24
|
+
openPalette: "ctrl+k",
|
|
25
|
+
cancelToolCall: "alt+k",
|
|
26
|
+
newSession: "alt+n",
|
|
27
|
+
openTodos: "alt+t",
|
|
28
|
+
closeTab: "alt+w",
|
|
29
|
+
cycleAgent: "alt+shift+i",
|
|
30
|
+
toggleSidebar: "ctrl+b",
|
|
31
|
+
navigateBack: "alt+left",
|
|
32
|
+
navigateForward: "alt+right",
|
|
33
|
+
tabNext: "ctrl+alt+right",
|
|
34
|
+
tabPrev: "ctrl+alt+left",
|
|
35
|
+
toggleTerminal: "ctrl+`"
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The chords a browser page receives, for the actions whose catalog chord it doesn't.
|
|
39
|
+
*
|
|
40
|
+
* @param mac - A Mac's browser. Default: this page's platform.
|
|
41
|
+
*/
|
|
42
|
+
function browserKeybindingDefaults(mac = isMacPlatform()) {
|
|
43
|
+
return mac ? MAC_BROWSER_DEFAULTS : OTHER_BROWSER_DEFAULTS;
|
|
44
|
+
}
|
|
45
|
+
function isMacPlatform() {
|
|
46
|
+
return typeof navigator !== "undefined" && navigator.platform.toLowerCase().includes("mac");
|
|
47
|
+
}
|
|
11
48
|
const pageStorage = {
|
|
12
49
|
getItem: (key) => localStorage.getItem(key),
|
|
13
50
|
setItem: (key, value) => localStorage.setItem(key, value),
|
|
@@ -19,13 +56,14 @@ const pageStorage = {
|
|
|
19
56
|
* @param options - The storage and the key.
|
|
20
57
|
*/
|
|
21
58
|
function createBrowserKeybindingsHost(options = {}) {
|
|
22
|
-
const { storage = pageStorage, key = KEYBINDINGS_KEY } = options;
|
|
59
|
+
const { storage = pageStorage, key = KEYBINDINGS_KEY, defaults = browserKeybindingDefaults() } = options;
|
|
23
60
|
const state = createKeybindingOverrides(async () => {
|
|
24
61
|
const raw = storage.getItem(key);
|
|
25
62
|
return raw === null ? void 0 : JSON.parse(raw);
|
|
26
63
|
});
|
|
27
64
|
return {
|
|
28
65
|
...state,
|
|
66
|
+
defaults,
|
|
29
67
|
async save(overrides) {
|
|
30
68
|
try {
|
|
31
69
|
if (Object.keys(overrides).length === 0) storage.removeItem(key);
|
|
@@ -37,4 +75,4 @@ function createBrowserKeybindingsHost(options = {}) {
|
|
|
37
75
|
};
|
|
38
76
|
}
|
|
39
77
|
//#endregion
|
|
40
|
-
export { createBrowserKeybindingsHost };
|
|
78
|
+
export { browserKeybindingDefaults, createBrowserKeybindingsHost };
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BrowserAppearanceHostOptions, createBrowserAppearanceHost } from "./browser-appearance-host.js";
|
|
2
|
-
import { BrowserKeybindingsHostOptions, createBrowserKeybindingsHost } from "./browser-keybindings-host.js";
|
|
2
|
+
import { BrowserKeybindingsHostOptions, browserKeybindingDefaults, createBrowserKeybindingsHost } from "./browser-keybindings-host.js";
|
|
3
3
|
import { BrowserWorkspaceHostOptions, createBrowserWorkspaceHost } from "./browser-workspace-host.js";
|
|
4
4
|
import { EXTENSION_HOST_MODULES_GLOBAL, ExtensionHostModule, ExtensionHostModuleSources, ExtensionHostModules, ExtensionModuleLinkError, ExtensionModuleLoad, ExtensionModuleLoadError, LinkedExtensionModule, ServerExtensionBundle, ServerExtensionBundleLookup, ServerExtensionModuleLoader, ServerExtensionModuleLoaderOptions, ServerWebviewSources, ServerWebviewSourcesOptions, createServerExtensionModuleLoader, createServerWebviewSources, installExtensionHostModules, linkExtensionModule } from "./extension-modules.js";
|
|
5
5
|
import { RunContext, RunFn, RunHost, RunHostOptions, createRunHost } from "./run-host.js";
|
|
@@ -21,9 +21,10 @@ import { SERVER_MACHINES_HOST_ID, ServerMachinesHost, ServerMachinesHostOptions,
|
|
|
21
21
|
import { ServerOnboardingHost, ServerOnboardingHostOptions, createServerOnboardingHost } from "./server-onboarding-host.js";
|
|
22
22
|
import { ServerSettingsHost, ServerSettingsHostOptions, createServerSettingsHost } from "./server-settings-host.js";
|
|
23
23
|
import { ServerSidebarHostOptions, createServerSidebarHost } from "./server-sidebar-host.js";
|
|
24
|
+
import { ServerViewsHostOptions, createServerViewsHost } from "./server-views-host.js";
|
|
24
25
|
import { ExtensionFlowStepHandler, ExtensionsClientAnnounce, ServerExtensionAssetsAccess, ServerExtensionCommandWire, ServerExtensionCommands, ServerExtensionDialogs, ServerExtensionsHost, ServerExtensionsHostOptions, createServerExtensionsHost } from "./server-extensions-host.js";
|
|
25
26
|
import { applyLiveEvent, closeThinkingSegment, finishLive } from "../chat/headless/streams/live-events.js";
|
|
26
27
|
import { LiveState, LiveStateOptions, LiveTranscript, createLiveState } from "./live.js";
|
|
27
28
|
import "./live-events.js";
|
|
28
29
|
import { StreamPacer, StreamPacerOptions, createStreamPacer } from "./stream-pacer.js";
|
|
29
|
-
export { AnswerBody, BrowserAppearanceHostOptions, BrowserKeybindingsHostOptions, BrowserWorkspaceHostOptions, EXTENSION_HOST_MODULES_GLOBAL, ExtensionFlowStepHandler, ExtensionHostModule, ExtensionHostModuleSources, ExtensionHostModules, ExtensionModuleLinkError, ExtensionModuleLoad, ExtensionModuleLoadError, ExtensionsClientAnnounce, FromWorker, HydrateResponse, LinkedExtensionModule, LiveState, LiveStateOptions, LiveTranscript, MessageEndpoint, RunContext, RunFn, RunHost, RunHostOptions, SERVER_AUTH_CHECK_PATH, SERVER_MACHINES_HOST_ID, SSE_HISTORY_RECORDS_VERSION, SSE_PROTOCOL_HEADER, SSE_PROTOCOL_VERSION, SendBody, ServerApprovalsHostOptions, ServerCallError, type ServerClient, type ServerClientOptions, type ServerClientState, ServerComposerHost, ServerComposerHostOptions, ServerConnectionError, ServerExtensionAssetsAccess, ServerExtensionBundle, ServerExtensionBundleLookup, ServerExtensionCommandWire, ServerExtensionCommands, ServerExtensionDialogs, ServerExtensionModuleLoader, ServerExtensionModuleLoaderOptions, ServerExtensionsHost, ServerExtensionsHostOptions, ServerFilesHostOptions, ServerGitHostOptions, ServerHost, ServerHostOptions, ServerMachinesHost, ServerMachinesHostOptions, ServerOnboardingHost, ServerOnboardingHostOptions, ServerPaletteHost, ServerPaletteHostOptions, type ServerRefusal, ServerSessionHost, ServerSessionHostOptions, ServerSettingsHost, ServerSettingsHostOptions, ServerSidebarHostOptions, ServerTerminalHostOptions, ServerWebviewSources, ServerWebviewSourcesOptions, SseHost, SseHostOptions, SseParser, SseRecord, StreamPacer, StreamPacerOptions, StreamRecord, ToWorker, WORKER_PROTOCOL_VERSION, WorkerHostOptions, WorkerRunInput, applyLiveEvent, attachmentsFromPreviews, closeThinkingSegment, createBrowserAppearanceHost, createBrowserKeybindingsHost, createBrowserWorkspaceHost, createLiveState, createRunHost, createServerApprovalsHost, createServerClient, createServerComposerHost, createServerExtensionModuleLoader, createServerExtensionsHost, createServerFilesHost, createServerGitHost, createServerHost, createServerMachinesHost, createServerOnboardingHost, createServerPaletteHost, createServerSessionHost, createServerSettingsHost, createServerSidebarHost, createServerTerminalHost, createServerWebviewSources, createSseHost, createSseParser, createStreamPacer, createWorkerHost, decodeFromWorker, decodeToWorker, encodeSseRecord, exposeRunHost, finishLive, formatCursor, installExtensionHostModules, linkExtensionModule, parseCursor, toChatModelProviders, toChatSession, toSidebarListSession };
|
|
30
|
+
export { AnswerBody, BrowserAppearanceHostOptions, BrowserKeybindingsHostOptions, BrowserWorkspaceHostOptions, EXTENSION_HOST_MODULES_GLOBAL, ExtensionFlowStepHandler, ExtensionHostModule, ExtensionHostModuleSources, ExtensionHostModules, ExtensionModuleLinkError, ExtensionModuleLoad, ExtensionModuleLoadError, ExtensionsClientAnnounce, FromWorker, HydrateResponse, LinkedExtensionModule, LiveState, LiveStateOptions, LiveTranscript, MessageEndpoint, RunContext, RunFn, RunHost, RunHostOptions, SERVER_AUTH_CHECK_PATH, SERVER_MACHINES_HOST_ID, SSE_HISTORY_RECORDS_VERSION, SSE_PROTOCOL_HEADER, SSE_PROTOCOL_VERSION, SendBody, ServerApprovalsHostOptions, ServerCallError, type ServerClient, type ServerClientOptions, type ServerClientState, ServerComposerHost, ServerComposerHostOptions, ServerConnectionError, ServerExtensionAssetsAccess, ServerExtensionBundle, ServerExtensionBundleLookup, ServerExtensionCommandWire, ServerExtensionCommands, ServerExtensionDialogs, ServerExtensionModuleLoader, ServerExtensionModuleLoaderOptions, ServerExtensionsHost, ServerExtensionsHostOptions, ServerFilesHostOptions, ServerGitHostOptions, ServerHost, ServerHostOptions, ServerMachinesHost, ServerMachinesHostOptions, ServerOnboardingHost, ServerOnboardingHostOptions, ServerPaletteHost, ServerPaletteHostOptions, type ServerRefusal, ServerSessionHost, ServerSessionHostOptions, ServerSettingsHost, ServerSettingsHostOptions, ServerSidebarHostOptions, ServerTerminalHostOptions, ServerViewsHostOptions, ServerWebviewSources, ServerWebviewSourcesOptions, SseHost, SseHostOptions, SseParser, SseRecord, StreamPacer, StreamPacerOptions, StreamRecord, ToWorker, WORKER_PROTOCOL_VERSION, WorkerHostOptions, WorkerRunInput, applyLiveEvent, attachmentsFromPreviews, browserKeybindingDefaults, closeThinkingSegment, createBrowserAppearanceHost, createBrowserKeybindingsHost, createBrowserWorkspaceHost, createLiveState, createRunHost, createServerApprovalsHost, createServerClient, createServerComposerHost, createServerExtensionModuleLoader, createServerExtensionsHost, createServerFilesHost, createServerGitHost, createServerHost, createServerMachinesHost, createServerOnboardingHost, createServerPaletteHost, createServerSessionHost, createServerSettingsHost, createServerSidebarHost, createServerTerminalHost, createServerViewsHost, createServerWebviewSources, createSseHost, createSseParser, createStreamPacer, createWorkerHost, decodeFromWorker, decodeToWorker, encodeSseRecord, exposeRunHost, finishLive, formatCursor, installExtensionHostModules, linkExtensionModule, parseCursor, toChatModelProviders, toChatSession, toSidebarListSession };
|
package/dist/adapters/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createBrowserAppearanceHost } from "./browser-appearance-host.js";
|
|
2
|
-
import { createBrowserKeybindingsHost } from "./browser-keybindings-host.js";
|
|
2
|
+
import { browserKeybindingDefaults, createBrowserKeybindingsHost } from "./browser-keybindings-host.js";
|
|
3
3
|
import { createBrowserWorkspaceHost } from "./browser-workspace-host.js";
|
|
4
4
|
import { EXTENSION_HOST_MODULES_GLOBAL, ExtensionModuleLinkError, ExtensionModuleLoadError, createServerExtensionModuleLoader, createServerWebviewSources, installExtensionHostModules, linkExtensionModule } from "./extension-modules.js";
|
|
5
5
|
import { applyLiveEvent, closeThinkingSegment, finishLive } from "../chat/headless/streams/live-events.js";
|
|
@@ -23,6 +23,7 @@ import { SERVER_MACHINES_HOST_ID, createServerMachinesHost } from "./server-mach
|
|
|
23
23
|
import { createServerOnboardingHost } from "./server-onboarding-host.js";
|
|
24
24
|
import { createServerSettingsHost } from "./server-settings-host.js";
|
|
25
25
|
import { createServerSidebarHost } from "./server-sidebar-host.js";
|
|
26
|
+
import { createServerViewsHost } from "./server-views-host.js";
|
|
26
27
|
import { createServerExtensionsHost } from "./server-extensions-host.js";
|
|
27
28
|
import { createStreamPacer } from "./stream-pacer.js";
|
|
28
|
-
export { EXTENSION_HOST_MODULES_GLOBAL, ExtensionModuleLinkError, ExtensionModuleLoadError, SERVER_AUTH_CHECK_PATH, SERVER_MACHINES_HOST_ID, SSE_HISTORY_RECORDS_VERSION, SSE_PROTOCOL_HEADER, SSE_PROTOCOL_VERSION, ServerCallError, ServerConnectionError, WORKER_PROTOCOL_VERSION, applyLiveEvent, attachmentsFromPreviews, closeThinkingSegment, createBrowserAppearanceHost, createBrowserKeybindingsHost, createBrowserWorkspaceHost, createLiveState, createRunHost, createServerApprovalsHost, createServerClient, createServerComposerHost, createServerExtensionModuleLoader, createServerExtensionsHost, createServerFilesHost, createServerGitHost, createServerHost, createServerMachinesHost, createServerOnboardingHost, createServerPaletteHost, createServerSessionHost, createServerSettingsHost, createServerSidebarHost, createServerTerminalHost, createServerWebviewSources, createSseHost, createSseParser, createStreamPacer, createWorkerHost, decodeFromWorker, decodeToWorker, encodeSseRecord, exposeRunHost, finishLive, formatCursor, installExtensionHostModules, linkExtensionModule, parseCursor, toChatModelProviders, toChatSession, toSidebarListSession };
|
|
29
|
+
export { EXTENSION_HOST_MODULES_GLOBAL, ExtensionModuleLinkError, ExtensionModuleLoadError, SERVER_AUTH_CHECK_PATH, SERVER_MACHINES_HOST_ID, SSE_HISTORY_RECORDS_VERSION, SSE_PROTOCOL_HEADER, SSE_PROTOCOL_VERSION, ServerCallError, ServerConnectionError, WORKER_PROTOCOL_VERSION, applyLiveEvent, attachmentsFromPreviews, browserKeybindingDefaults, closeThinkingSegment, createBrowserAppearanceHost, createBrowserKeybindingsHost, createBrowserWorkspaceHost, createLiveState, createRunHost, createServerApprovalsHost, createServerClient, createServerComposerHost, createServerExtensionModuleLoader, createServerExtensionsHost, createServerFilesHost, createServerGitHost, createServerHost, createServerMachinesHost, createServerOnboardingHost, createServerPaletteHost, createServerSessionHost, createServerSettingsHost, createServerSidebarHost, createServerTerminalHost, createServerViewsHost, createServerWebviewSources, createSseHost, createSseParser, createStreamPacer, createWorkerHost, decodeFromWorker, decodeToWorker, encodeSseRecord, exposeRunHost, finishLive, formatCursor, installExtensionHostModules, linkExtensionModule, parseCursor, toChatModelProviders, toChatSession, toSidebarListSession };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CustomFrame, CustomFrameRequest } from "../views/headless/host.js";
|
|
2
|
+
//#region src/adapters/server-custom-frame.d.ts
|
|
3
|
+
/** Where Custom pages are minted. */
|
|
4
|
+
interface ServerCustomFramesOptions {
|
|
5
|
+
/** The server's origin, `https://zidane.example`. */
|
|
6
|
+
origin: string;
|
|
7
|
+
/** The client token. Absent: a server with auth off. */
|
|
8
|
+
token?: string;
|
|
9
|
+
/** Default `fetch`. */
|
|
10
|
+
fetch?: typeof fetch;
|
|
11
|
+
}
|
|
12
|
+
/** The iframe's `sandbox` attribute. Never `allow-same-origin`. */
|
|
13
|
+
declare const CUSTOM_IFRAME_SANDBOX = "allow-scripts";
|
|
14
|
+
/**
|
|
15
|
+
* Mints one Custom page and builds its iframe.
|
|
16
|
+
*
|
|
17
|
+
* @param options - The server's origin and token.
|
|
18
|
+
* @param request - The node, the theme.
|
|
19
|
+
*/
|
|
20
|
+
declare function createServerCustomFrame(options: ServerCustomFramesOptions, request: CustomFrameRequest): Promise<CustomFrame>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { CUSTOM_IFRAME_SANDBOX, ServerCustomFramesOptions, createServerCustomFrame };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { MCP_APP_PERMISSIONS, SERVER_VIEWS_CUSTOM_PATH, customDataMessage, customThemeMessage, mcpAppAllowAttribute, parseCustomFrameMessage, parseMcpAppRpc } from "zidane/chat/pure";
|
|
2
|
+
//#region src/adapters/server-custom-frame.ts
|
|
3
|
+
/**
|
|
4
|
+
* Custom frames on zidane-server (docs/VIEWS.md, Custom code): the server
|
|
5
|
+
* mints the page of one `<Custom>` node under a short-lived ticket
|
|
6
|
+
* (`POST /zidane/views/custom`, with the token), and an iframe with
|
|
7
|
+
* `sandbox="allow-scripts"` loads it (never `srcdoc`, never
|
|
8
|
+
* `allow-same-origin`). The page's response carries the `sandbox` CSP.
|
|
9
|
+
* Only messages from this iframe's window, with the opaque origin and the
|
|
10
|
+
* page's channel, reach the listener. A link, an image or a chord counts
|
|
11
|
+
* only while this window has user activation (a click or a key press in the
|
|
12
|
+
* page gives it one), so a page cannot send them on its own. A theme change
|
|
13
|
+
* and new data go the other way: the page's bridge takes
|
|
14
|
+
* `customThemeMessage` and `customDataMessage` from this window only.
|
|
15
|
+
* Sent before the page has loaded, the latest of each waits for its load:
|
|
16
|
+
* a message posted to a page still loading is lost.
|
|
17
|
+
*/
|
|
18
|
+
/** The iframe's `sandbox` attribute. Never `allow-same-origin`. */
|
|
19
|
+
const CUSTOM_IFRAME_SANDBOX = "allow-scripts";
|
|
20
|
+
/** Whether a message needs a real click or key press: it opens something, or runs a shortcut. */
|
|
21
|
+
const needsActivation = (message) => message.kind === "open-link" || message.kind === "image" || message.kind === "key";
|
|
22
|
+
/** Whether this window has user activation now. A browser without the API: true (the page's bridge checked). */
|
|
23
|
+
function activated() {
|
|
24
|
+
const activation = navigator.userActivation;
|
|
25
|
+
return activation ? activation.isActive : true;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Mints one Custom page and builds its iframe.
|
|
29
|
+
*
|
|
30
|
+
* @param options - The server's origin and token.
|
|
31
|
+
* @param request - The node, the theme.
|
|
32
|
+
*/
|
|
33
|
+
async function createServerCustomFrame(options, request) {
|
|
34
|
+
const response = await (options.fetch ?? ((input, init) => fetch(input, init)))(`${options.origin}${SERVER_VIEWS_CUSTOM_PATH}`, {
|
|
35
|
+
method: "POST",
|
|
36
|
+
credentials: "omit",
|
|
37
|
+
headers: {
|
|
38
|
+
"content-type": "application/json",
|
|
39
|
+
...options.token ? { authorization: `Bearer ${options.token}` } : {}
|
|
40
|
+
},
|
|
41
|
+
body: JSON.stringify({
|
|
42
|
+
sessionId: request.sessionId,
|
|
43
|
+
id: request.viewId,
|
|
44
|
+
path: [...request.path],
|
|
45
|
+
original: request.original,
|
|
46
|
+
theme: request.theme,
|
|
47
|
+
...request.state ? { state: request.state } : {},
|
|
48
|
+
...request.permissions && request.permissions.length > 0 ? { permissions: [...request.permissions] } : {}
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
if (!response.ok) throw new Error(`The server answered ${response.status} for the custom part.`);
|
|
52
|
+
const minted = await response.json();
|
|
53
|
+
const { url, channel } = minted;
|
|
54
|
+
if (typeof url !== "string" || !url.startsWith(`${SERVER_VIEWS_CUSTOM_PATH}/`) || typeof channel !== "string") throw new Error("The server answered with no page.");
|
|
55
|
+
if (minted.kind === "mcp-app") return mcpAppFrame(`${options.origin}${url}`, minted.permissions);
|
|
56
|
+
const iframe = document.createElement("iframe");
|
|
57
|
+
iframe.setAttribute("sandbox", CUSTOM_IFRAME_SANDBOX);
|
|
58
|
+
iframe.setAttribute("referrerpolicy", "no-referrer");
|
|
59
|
+
iframe.setAttribute("allow", "");
|
|
60
|
+
iframe.setAttribute("loading", "eager");
|
|
61
|
+
iframe.src = `${options.origin}${url}`;
|
|
62
|
+
let loaded = false;
|
|
63
|
+
const waiting = {};
|
|
64
|
+
const post = (message) => iframe.contentWindow?.postMessage(message, "*");
|
|
65
|
+
const onLoad = () => {
|
|
66
|
+
loaded = true;
|
|
67
|
+
if (waiting.theme !== void 0) post(waiting.theme);
|
|
68
|
+
if (waiting.data !== void 0) post(waiting.data);
|
|
69
|
+
delete waiting.theme;
|
|
70
|
+
delete waiting.data;
|
|
71
|
+
};
|
|
72
|
+
iframe.addEventListener("load", onLoad);
|
|
73
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
74
|
+
const onMessage = (event) => {
|
|
75
|
+
if (event.source === null || event.source !== iframe.contentWindow || event.origin !== "null") return;
|
|
76
|
+
const message = parseCustomFrameMessage(event.data, channel);
|
|
77
|
+
if (!message || needsActivation(message) && !activated()) return;
|
|
78
|
+
for (const listener of [...listeners]) listener(message);
|
|
79
|
+
};
|
|
80
|
+
window.addEventListener("message", onMessage);
|
|
81
|
+
let disposed = false;
|
|
82
|
+
return {
|
|
83
|
+
element: iframe,
|
|
84
|
+
listen(onEvent) {
|
|
85
|
+
listeners.add(onEvent);
|
|
86
|
+
return () => listeners.delete(onEvent);
|
|
87
|
+
},
|
|
88
|
+
setTheme(theme) {
|
|
89
|
+
if (disposed) return;
|
|
90
|
+
const message = customThemeMessage(channel, theme);
|
|
91
|
+
if (loaded) post(message);
|
|
92
|
+
else waiting.theme = message;
|
|
93
|
+
},
|
|
94
|
+
setData(data) {
|
|
95
|
+
const message = customDataMessage(channel, data);
|
|
96
|
+
if (disposed || !message) return;
|
|
97
|
+
if (loaded) post(message);
|
|
98
|
+
else waiting.data = message;
|
|
99
|
+
},
|
|
100
|
+
dispose() {
|
|
101
|
+
if (disposed) return;
|
|
102
|
+
disposed = true;
|
|
103
|
+
window.removeEventListener("message", onMessage);
|
|
104
|
+
iframe.removeEventListener("load", onLoad);
|
|
105
|
+
listeners.clear();
|
|
106
|
+
iframe.removeAttribute("src");
|
|
107
|
+
iframe.remove();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* An MCP app's iframe (docs/VIEWS.md, MCP Apps): the same sandbox as a
|
|
113
|
+
* Custom page, plus the permissions the person allowed in its `allow`
|
|
114
|
+
* attribute. The app speaks JSON-RPC with `postMessage` objects: only
|
|
115
|
+
* messages from this iframe's window and the sandbox's opaque origin, each
|
|
116
|
+
* checked for its shape and size, reach the listener, marked with whether
|
|
117
|
+
* this window has user activation now.
|
|
118
|
+
*/
|
|
119
|
+
function mcpAppFrame(src, rawPermissions) {
|
|
120
|
+
const permissions = Array.isArray(rawPermissions) ? MCP_APP_PERMISSIONS.filter((name) => rawPermissions.includes(name)) : [];
|
|
121
|
+
const iframe = document.createElement("iframe");
|
|
122
|
+
iframe.setAttribute("sandbox", CUSTOM_IFRAME_SANDBOX);
|
|
123
|
+
iframe.setAttribute("referrerpolicy", "no-referrer");
|
|
124
|
+
iframe.setAttribute("allow", mcpAppAllowAttribute(permissions));
|
|
125
|
+
iframe.setAttribute("loading", "eager");
|
|
126
|
+
iframe.src = src;
|
|
127
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
128
|
+
const onMessage = (event) => {
|
|
129
|
+
if (event.source === null || event.source !== iframe.contentWindow || event.origin !== "null") return;
|
|
130
|
+
const message = parseMcpAppRpc(event.data);
|
|
131
|
+
if (!message) return;
|
|
132
|
+
const active = activated();
|
|
133
|
+
for (const listener of [...listeners]) listener({
|
|
134
|
+
kind: "rpc",
|
|
135
|
+
message,
|
|
136
|
+
active
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
window.addEventListener("message", onMessage);
|
|
140
|
+
let disposed = false;
|
|
141
|
+
return {
|
|
142
|
+
element: iframe,
|
|
143
|
+
kind: "mcp-app",
|
|
144
|
+
permissions,
|
|
145
|
+
listen(onEvent) {
|
|
146
|
+
listeners.add(onEvent);
|
|
147
|
+
return () => listeners.delete(onEvent);
|
|
148
|
+
},
|
|
149
|
+
postRpc(message) {
|
|
150
|
+
if (!disposed) iframe.contentWindow?.postMessage(message, "*");
|
|
151
|
+
},
|
|
152
|
+
dispose() {
|
|
153
|
+
if (disposed) return;
|
|
154
|
+
disposed = true;
|
|
155
|
+
window.removeEventListener("message", onMessage);
|
|
156
|
+
listeners.clear();
|
|
157
|
+
iframe.removeAttribute("src");
|
|
158
|
+
iframe.remove();
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
export { CUSTOM_IFRAME_SANDBOX, createServerCustomFrame };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { writable } from "../chat/headless/store.js";
|
|
2
|
-
import { ExtensionsHostError } from "../extensions/headless/host.js";
|
|
3
2
|
import { createServerWebviewSources } from "./extension-modules.js";
|
|
4
3
|
import { createDialogQueue } from "../extensions/headless/dialog-queue.js";
|
|
5
4
|
import { createUiEffectChannel } from "../extensions/headless/effect-channel.js";
|
|
5
|
+
import { ExtensionsHostError } from "../extensions/headless/host.js";
|
|
6
6
|
import { EXTENSION_TOKENS } from "../extensions/headless/wire.js";
|
|
7
7
|
import { ServerCallError, ServerConnectionError, createExtensionsClient } from "zidane/ipc/browser";
|
|
8
8
|
//#region src/adapters/server-extensions-host.ts
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { writable } from "../chat/headless/store.js";
|
|
2
|
+
import { promptOriginWire } from "../chat/headless/prompt-origin.js";
|
|
2
3
|
import { createLiveState } from "./live.js";
|
|
3
4
|
import { createServerClient } from "./server-client.js";
|
|
4
5
|
import { wireOriginal } from "../chat/headless/send-flow.js";
|
|
@@ -491,7 +492,7 @@ function createServerHost(options) {
|
|
|
491
492
|
} } : {}
|
|
492
493
|
},
|
|
493
494
|
transcript: (sessionId) => state.readable(sessionId, { loadEarlier: () => void loadEarlier(sessionId) }),
|
|
494
|
-
async send({ sessionId, prompt, attachments, model, thinking, activatedSkills, echo, keepDraft, delivery }) {
|
|
495
|
+
async send({ sessionId, prompt, attachments, model, thinking, activatedSkills, echo, keepDraft, delivery, origin, literal }) {
|
|
495
496
|
if (echo !== false && !delivery) state.echoPrompt(sessionId, prompt, attachments?.map(({ original: _original, ...a }) => a));
|
|
496
497
|
await applyChoice(sessionId, model, thinking);
|
|
497
498
|
const uploads = (attachments ?? []).flatMap((a) => {
|
|
@@ -512,7 +513,9 @@ function createServerHost(options) {
|
|
|
512
513
|
requestId: crypto.randomUUID(),
|
|
513
514
|
...activatedSkills?.length ? { activatedSkills: [...activatedSkills] } : {},
|
|
514
515
|
...uploads.length ? { attachments: uploads } : {},
|
|
515
|
-
...keepDraft ? { keepDraft: true } : {}
|
|
516
|
+
...keepDraft ? { keepDraft: true } : {},
|
|
517
|
+
...origin ? { origin: promptOriginWire(origin) } : {},
|
|
518
|
+
...literal ? { literal: true } : {}
|
|
516
519
|
});
|
|
517
520
|
return;
|
|
518
521
|
}
|
|
@@ -522,7 +525,9 @@ function createServerHost(options) {
|
|
|
522
525
|
requestId: crypto.randomUUID(),
|
|
523
526
|
...activatedSkills?.length ? { activatedSkills: [...activatedSkills] } : {},
|
|
524
527
|
...uploads.length ? { attachments: uploads } : {},
|
|
525
|
-
...keepDraft ? { keepDraft: true } : {}
|
|
528
|
+
...keepDraft ? { keepDraft: true } : {},
|
|
529
|
+
...origin ? { origin: promptOriginWire(origin) } : {},
|
|
530
|
+
...literal ? { literal: true } : {}
|
|
526
531
|
});
|
|
527
532
|
},
|
|
528
533
|
async providerReady() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { machinesError } from "../machines/headless/host.js";
|
|
2
|
-
import { createMachineLists, createOnlineMachines, lazyReadable } from "../machines/headless/stores.js";
|
|
3
1
|
import { closableClient } from "./closable-client.js";
|
|
2
|
+
import { machinesError } from "../machines/headless/host.js";
|
|
4
3
|
import { createPresenceStore } from "../machines/headless/presence.js";
|
|
4
|
+
import { createMachineLists, createOnlineMachines, lazyReadable } from "../machines/headless/stores.js";
|
|
5
5
|
import { createHostSyncReads } from "../machines/headless/sync.js";
|
|
6
6
|
import { serverOAuthFlow } from "./server-oauth-flow.js";
|
|
7
7
|
import { formatJoinString } from "zidane/ipc/browser";
|
|
@@ -72,6 +72,7 @@ function createServerMachinesHost(options) {
|
|
|
72
72
|
kind: "server",
|
|
73
73
|
name: hello?.hostName ?? fallbackName,
|
|
74
74
|
status,
|
|
75
|
+
...serverUrl ? { url: serverUrl } : {},
|
|
75
76
|
...error ? { error } : {},
|
|
76
77
|
...hello?.appVersion ? { serverVersion: hello.appVersion } : {},
|
|
77
78
|
...hello?.startedAt ? { startedAt: hello.startedAt } : {},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { writable } from "../chat/headless/store.js";
|
|
2
|
-
import { DEFAULT_SETTINGS } from "../settings/headless/catalog.js";
|
|
3
2
|
import { closableClient } from "./closable-client.js";
|
|
3
|
+
import { DEFAULT_SETTINGS } from "../settings/headless/catalog.js";
|
|
4
4
|
import { serverSettingsSections } from "./server-settings-sections.js";
|
|
5
5
|
import { serverSettingsAccounts } from "./server-settings-accounts.js";
|
|
6
6
|
import { serverSettingsModels } from "./server-settings-models.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ViewsHost } from "../views/headless/host.js";
|
|
2
|
+
import { ServerCustomFramesOptions } from "./server-custom-frame.js";
|
|
3
|
+
import { ServerClient } from "zidane/ipc/browser";
|
|
4
|
+
//#region src/adapters/server-views-host.d.ts
|
|
5
|
+
/** Options for {@link createServerViewsHost}. */
|
|
6
|
+
interface ServerViewsHostOptions {
|
|
7
|
+
/** The client to speak through, shared with the chat host (`createServerHost(…).client`). */
|
|
8
|
+
client: ServerClient;
|
|
9
|
+
/**
|
|
10
|
+
* Where Custom pages are minted: the server's origin and the token
|
|
11
|
+
* (`POST /zidane/views/custom`). Absent, or a server without
|
|
12
|
+
* `views.reportProblem`: `<Custom>` shows its title and alt text.
|
|
13
|
+
*/
|
|
14
|
+
customFrames?: ServerCustomFramesOptions;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a {@link ViewsHost} over a zidane-server client. It listens to the
|
|
18
|
+
* client only while something reads it.
|
|
19
|
+
*
|
|
20
|
+
* @param options - The client to speak through.
|
|
21
|
+
*/
|
|
22
|
+
declare function createServerViewsHost(options: ServerViewsHostOptions): ViewsHost;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ServerViewsHostOptions, createServerViewsHost };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { downloadInBrowser } from "../views/headless/download.js";
|
|
2
|
+
import { createViewsHost } from "../views/headless/store.js";
|
|
3
|
+
import { createServerCustomFrame } from "./server-custom-frame.js";
|
|
4
|
+
//#region src/adapters/server-views-host.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates a {@link ViewsHost} over a zidane-server client. It listens to the
|
|
7
|
+
* client only while something reads it.
|
|
8
|
+
*
|
|
9
|
+
* @param options - The client to speak through.
|
|
10
|
+
*/
|
|
11
|
+
function createServerViewsHost(options) {
|
|
12
|
+
const { client, customFrames } = options;
|
|
13
|
+
const customCode = client.can("views.reportProblem");
|
|
14
|
+
return createViewsHost({
|
|
15
|
+
...customCode && customFrames ? { customFrame: (request) => createServerCustomFrame(customFrames, request) } : {},
|
|
16
|
+
...customCode ? { reportProblem: (sessionId, id, problem, path) => client.call("views.reportProblem", {
|
|
17
|
+
sessionId,
|
|
18
|
+
id,
|
|
19
|
+
problem,
|
|
20
|
+
...path ? { path } : {}
|
|
21
|
+
}) } : {},
|
|
22
|
+
...client.can("views.meta") ? { meta: (sessionId) => client.call("views.meta", { sessionId }) } : {},
|
|
23
|
+
...client.can("views.get") ? { get: (sessionId, ids) => client.call("views.get", {
|
|
24
|
+
sessionId,
|
|
25
|
+
ids
|
|
26
|
+
}) } : {},
|
|
27
|
+
...client.can("views.setHeights") ? { setHeights: (sessionId, id, heights) => client.call("views.setHeights", {
|
|
28
|
+
sessionId,
|
|
29
|
+
id,
|
|
30
|
+
heights: [...heights]
|
|
31
|
+
}) } : {},
|
|
32
|
+
...client.can("views.refresh") ? { refresh: (sessionId, id) => client.call("views.refresh", {
|
|
33
|
+
sessionId,
|
|
34
|
+
id
|
|
35
|
+
}) } : {},
|
|
36
|
+
...client.can("views.resolve") ? {
|
|
37
|
+
resolve: (sessionId, nodes) => client.call("views.resolve", {
|
|
38
|
+
sessionId,
|
|
39
|
+
nodes
|
|
40
|
+
}),
|
|
41
|
+
onData: (listener) => client.onSignal((signal) => {
|
|
42
|
+
if (signal.kind === "views:data") listener(signal.components);
|
|
43
|
+
})
|
|
44
|
+
} : {},
|
|
45
|
+
...client.can("views.runAction") ? { runAction: (sessionId, id, path, original) => client.call("views.runAction", {
|
|
46
|
+
sessionId,
|
|
47
|
+
id,
|
|
48
|
+
path,
|
|
49
|
+
...original ? { original: true } : {}
|
|
50
|
+
}) } : {},
|
|
51
|
+
...client.can("views.appRequest") ? {
|
|
52
|
+
appRequest: (sessionId, id, method, params) => client.call("views.appRequest", {
|
|
53
|
+
sessionId,
|
|
54
|
+
id,
|
|
55
|
+
method,
|
|
56
|
+
params
|
|
57
|
+
}),
|
|
58
|
+
downloadFile: downloadInBrowser
|
|
59
|
+
} : {},
|
|
60
|
+
...client.can("views.image") ? { image: (sessionId, source) => client.call("views.image", {
|
|
61
|
+
sessionId,
|
|
62
|
+
source
|
|
63
|
+
}) } : {},
|
|
64
|
+
...client.can("views.setState") ? { setState: (sessionId, viewId, state) => client.call("views.setState", {
|
|
65
|
+
sessionId,
|
|
66
|
+
viewId,
|
|
67
|
+
state
|
|
68
|
+
}) } : {},
|
|
69
|
+
...client.can("views.meta") ? { onChanged: (listener) => client.onSignal((signal) => {
|
|
70
|
+
if (signal.kind === "views:changed") listener({
|
|
71
|
+
sessionId: signal.sessionId,
|
|
72
|
+
ids: signal.ids
|
|
73
|
+
});
|
|
74
|
+
}) } : {}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { createServerViewsHost };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChatLabels } from "../chat/headless/labels.js";
|
|
2
2
|
import { ExtensionModuleLoader } from "../extensions/ExtensionComponent.js";
|
|
3
|
+
import { TerminalAssets } from "../terminal/TerminalProvider.js";
|
|
3
4
|
import { AppHost } from "./headless/app-host.js";
|
|
4
5
|
import { ReactNode } from "react";
|
|
5
6
|
//#region src/app/AppHostProvider.d.ts
|
|
@@ -11,6 +12,8 @@ interface AppHostProviderProps {
|
|
|
11
12
|
chatLabels?: Partial<ChatLabels>;
|
|
12
13
|
/** Loads an extension's `ui.tsx` module for the extension components (`ExtensionsProvider`'s `loadModule`). Absent: extension items draw their data. */
|
|
13
14
|
loadExtensionModule?: ExtensionModuleLoader;
|
|
15
|
+
/** The files a terminal loads (`zidane-ui/terminal/assets` in a Vite app), passed to `TerminalProvider`. */
|
|
16
|
+
terminalAssets?: TerminalAssets;
|
|
14
17
|
/** The app's components. */
|
|
15
18
|
children: ReactNode;
|
|
16
19
|
}
|
|
@@ -19,7 +22,7 @@ interface AppHostProviderProps {
|
|
|
19
22
|
*
|
|
20
23
|
* @param props - Provider props: the `host`, optional `chatLabels`, and the `children` to render.
|
|
21
24
|
*/
|
|
22
|
-
declare function AppHostProvider({ host, chatLabels, loadExtensionModule, children: app }: AppHostProviderProps): import("react").JSX.Element;
|
|
25
|
+
declare function AppHostProvider({ host, chatLabels, loadExtensionModule, terminalAssets, children: app }: AppHostProviderProps): import("react").JSX.Element;
|
|
23
26
|
/** Returns the {@link AppHost} from the nearest {@link AppHostProvider}. Throws when called outside one. */
|
|
24
27
|
declare function useAppHost(): AppHost;
|
|
25
28
|
//#endregion
|
|
@@ -15,9 +15,10 @@ import { PaletteProvider } from "../palette/PaletteProvider.js";
|
|
|
15
15
|
import { SessionProvider } from "../session/SessionProvider.js";
|
|
16
16
|
import { SettingsProvider } from "../settings/SettingsProvider.js";
|
|
17
17
|
import { TerminalProvider } from "../terminal/TerminalProvider.js";
|
|
18
|
+
import { ViewsProvider } from "../views/ViewsProvider.js";
|
|
18
19
|
import { WorkspaceHostProvider } from "../workspace/WorkspaceProvider.js";
|
|
19
|
-
import { jsx } from "react/jsx-runtime";
|
|
20
20
|
import { createContext, useContext } from "react";
|
|
21
|
+
import { jsx } from "react/jsx-runtime";
|
|
21
22
|
//#region src/app/AppHostProvider.tsx
|
|
22
23
|
/**
|
|
23
24
|
* Puts an `AppHost` in context, and each area's host in its own provider, so
|
|
@@ -30,7 +31,7 @@ import { createContext, useContext } from "react";
|
|
|
30
31
|
* Today that is `ChatProvider` when `host.chat` is present,
|
|
31
32
|
* `SessionProvider` when `host.session` is, `ApprovalsProvider` when
|
|
32
33
|
* `host.approvals` is, `ExtensionsProvider` when `host.extensions` is, `FilesProvider` when `host.files` is, `GitProvider` when `host.git` is, `MachinesProvider` when `host.machines` is, `SettingsProvider` when `host.settings` is, `TerminalProvider` when `host.terminal` is, `KeybindingsProvider` when `host.keybindings` is and
|
|
33
|
-
* `AppearanceProvider` when `host.appearance` is, and always a `KeyCommandsProvider` (the key command
|
|
34
|
+
* `AppearanceProvider` when `host.appearance` is, `ViewsProvider` when `host.views` is, and always a `KeyCommandsProvider` (the key command
|
|
34
35
|
* registry: register shortcuts with `useKeyCommands`) and a `NoticeStackProvider` (`useNotify`). `host.workspace` goes in
|
|
35
36
|
* context for each `WorkspaceProvider` below (`WorkspaceHostProvider`), and
|
|
36
37
|
* `host.onboarding` for each `OnboardingProvider` below (`OnboardingHostProvider`), `host.composer`
|
|
@@ -44,7 +45,7 @@ const AppHostContext = createContext(null);
|
|
|
44
45
|
*
|
|
45
46
|
* @param props - Provider props: the `host`, optional `chatLabels`, and the `children` to render.
|
|
46
47
|
*/
|
|
47
|
-
function AppHostProvider({ host, chatLabels, loadExtensionModule, children: app }) {
|
|
48
|
+
function AppHostProvider({ host, chatLabels, loadExtensionModule, terminalAssets, children: app }) {
|
|
48
49
|
const onboarding = host.onboarding ? /* @__PURE__ */ jsx(OnboardingHostProvider, {
|
|
49
50
|
host: host.onboarding,
|
|
50
51
|
children: app
|
|
@@ -57,10 +58,15 @@ function AppHostProvider({ host, chatLabels, loadExtensionModule, children: app
|
|
|
57
58
|
host: host.sidebar,
|
|
58
59
|
children: composer
|
|
59
60
|
}) : composer;
|
|
60
|
-
const
|
|
61
|
-
host: host.
|
|
61
|
+
const views = host.views ? /* @__PURE__ */ jsx(ViewsProvider, {
|
|
62
|
+
host: host.views,
|
|
62
63
|
children: sidebar
|
|
63
64
|
}) : sidebar;
|
|
65
|
+
const terminal = host.terminal ? /* @__PURE__ */ jsx(TerminalProvider, {
|
|
66
|
+
host: host.terminal,
|
|
67
|
+
...terminalAssets,
|
|
68
|
+
children: views
|
|
69
|
+
}) : views;
|
|
64
70
|
const workspace = host.workspace ? /* @__PURE__ */ jsx(WorkspaceHostProvider, {
|
|
65
71
|
host: host.workspace,
|
|
66
72
|
children: terminal
|
|
@@ -5,8 +5,8 @@ import { buttonClass } from "../components/button.js";
|
|
|
5
5
|
import { ErrorBoundary, ErrorDetails } from "../components/ErrorBoundary.js";
|
|
6
6
|
import { Keycap } from "../components/Keycap.js";
|
|
7
7
|
import { useAppearanceState } from "../appearance/AppearanceProvider.js";
|
|
8
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { AnimatePresence, motion, useIsPresent } from "motion/react";
|
|
11
11
|
//#region src/app/ModalProvider.tsx
|
|
12
12
|
/**
|
|
@@ -481,7 +481,7 @@ function ScreenShell({ title, description, lead, screenLabel, onClose, aside, as
|
|
|
481
481
|
className: "shrink-0 px-3 pb-2",
|
|
482
482
|
children: aside.search
|
|
483
483
|
}),
|
|
484
|
-
narrowPane === "aside" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
484
|
+
narrowPane === "aside" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
485
485
|
className: "flex-1 min-h-0 flex flex-col px-2 pt-1",
|
|
486
486
|
children: aside.nav
|
|
487
487
|
}), asideFooter && /* @__PURE__ */ jsx("div", {
|
package/dist/app/NoticeStack.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useLabels } from "../labels.js";
|
|
2
2
|
import { IconButton } from "../components/IconButton.js";
|
|
3
3
|
import { Notice } from "../components/Notice.js";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { createContext, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/app/NoticeStack.tsx
|
|
7
7
|
/**
|
|
8
8
|
* The app's transient notices: what an action that has no surface of its own
|
|
@@ -14,6 +14,7 @@ import { OnboardingHost } from "../../onboarding/headless/host.js";
|
|
|
14
14
|
import { MachinesHost } from "../../machines/headless/host.js";
|
|
15
15
|
import { SettingsHost } from "../../settings/headless/host.js";
|
|
16
16
|
import { SidebarHost } from "../../chat/headless/sidebar/host.js";
|
|
17
|
+
import { ViewsHost } from "../../views/headless/host.js";
|
|
17
18
|
//#region src/app/headless/app-host.d.ts
|
|
18
19
|
/** Every area's host an app offers. An area whose host is absent is not shown. */
|
|
19
20
|
interface AppHost {
|
|
@@ -47,6 +48,8 @@ interface AppHost {
|
|
|
47
48
|
sidebar?: SidebarHost;
|
|
48
49
|
/** The terminals: listing, opening and viewing them per scope. Absent: no terminal drawer or tab. */
|
|
49
50
|
terminal?: TerminalHost;
|
|
51
|
+
/** The stored views of each session (docs/VIEWS.md): their meta, trees, heights and refresh. Absent: a view fence shows its source. */
|
|
52
|
+
views?: ViewsHost;
|
|
50
53
|
/** Where the side panel's layouts live, and the extension panels. Absent: layouts last as long as the page, no extension panels. */
|
|
51
54
|
workspace?: WorkspaceHost;
|
|
52
55
|
}
|
package/dist/app/useConfirm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CONFIRM_TITLE_ID, ConfirmDialog } from "../components/ConfirmDialog.js";
|
|
2
2
|
import { useModal, useOptionalModal } from "./ModalProvider.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { useCallback } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/app/useConfirm.tsx
|
|
6
6
|
/**
|
|
7
7
|
* The in-app replacement for `window.confirm()`: the design system's ConfirmDialog
|