@deepseek-harness-tui/dsh-tui 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -14
- package/bin/dsh-tui.js +200 -34
- package/cordis.patch.yml +16 -52
- package/cordis.yml +6 -2
- package/guide/dsh-tui-guide/claude-backend.en.md +44 -7
- package/guide/dsh-tui-guide/claude-backend.md +28 -6
- package/guide/dsh-tui-guide/codex-backend.en.md +34 -7
- package/guide/dsh-tui-guide/codex-backend.md +17 -2
- package/guide/dsh-tui-guide/configuration.en.md +129 -16
- package/guide/dsh-tui-guide/configuration.md +110 -14
- package/guide/dsh-tui-guide/interaction.en.md +57 -24
- package/guide/dsh-tui-guide/interaction.md +42 -19
- package/guide/dsh-tui-guide/plugins.en.md +36 -3
- package/guide/dsh-tui-guide/plugins.md +21 -2
- package/guide/dsh-tui-guide/themes.en.md +23 -14
- package/guide/dsh-tui-guide/themes.md +19 -12
- package/guide/dsh-tui-guide/user-guide.en.md +51 -20
- package/guide/dsh-tui-guide/user-guide.md +41 -21
- package/lib/settings.json +103 -9
- package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +3 -0
- package/lib/types/adapter/channel/ui.d.ts +2 -0
- package/lib/types/adapter/channel/ui.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui.js +6 -2
- package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
- package/lib/types/adapter/kernel/runtime.js +2 -0
- package/lib/types/adapter/ports/channel-settings.d.ts +9 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +50 -12
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +21 -0
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/spec/backend-capabilities.d.ts +22 -0
- package/lib/types/adapter/spec/backend-capabilities.d.ts.map +1 -0
- package/lib/types/adapter/spec/backend-capabilities.js +49 -0
- package/lib/types/adapter/spec/protocol-constants.d.ts.map +1 -1
- package/lib/types/adapter/spec/protocol-constants.js +10 -3
- package/lib/types/adapter/spec/tui-contributions.d.ts +3 -0
- package/lib/types/adapter/spec/tui-contributions.d.ts.map +1 -1
- package/lib/types/adapter/spec/tui-contributions.js +7 -0
- package/lib/types/adapter/standard/registry.d.ts +6 -0
- package/lib/types/adapter/standard/registry.d.ts.map +1 -1
- package/lib/types/adapter/standard/registry.js +65 -15
- package/lib/types/adapter/standard/tui-extension.d.ts.map +1 -1
- package/lib/types/adapter/standard/tui-extension.js +7 -1
- package/lib/types/adapter/standard/types.d.ts +10 -1
- package/lib/types/adapter/standard/types.d.ts.map +1 -1
- package/lib/types/adapter/upstream/host-descriptor-driver.d.ts.map +1 -1
- package/lib/types/adapter/upstream/host-descriptor-driver.js +52 -0
- package/lib/types/agent/backend-manifest.d.ts +152 -0
- package/lib/types/agent/backend-manifest.d.ts.map +1 -0
- package/lib/types/agent/backend-manifest.js +14 -0
- package/lib/types/agent/backend.d.ts +71 -5
- package/lib/types/agent/backend.d.ts.map +1 -1
- package/lib/types/agent/capabilities.d.ts +6 -0
- package/lib/types/agent/capabilities.d.ts.map +1 -1
- package/lib/types/agent/index.d.ts +2 -0
- package/lib/types/agent/index.d.ts.map +1 -1
- package/lib/types/agent/refs.d.ts +11 -1
- package/lib/types/agent/refs.d.ts.map +1 -1
- package/lib/types/agent/starting-session.d.ts +4 -0
- package/lib/types/agent/starting-session.d.ts.map +1 -0
- package/lib/types/agent/starting-session.js +19 -0
- package/lib/types/backends/claude/activity.d.ts +1 -1
- package/lib/types/backends/claude/activity.d.ts.map +1 -1
- package/lib/types/backends/claude/activity.js +5 -5
- package/lib/types/backends/claude/auth.d.ts.map +1 -1
- package/lib/types/backends/claude/auth.js +10 -3
- package/lib/types/backends/claude/backend.d.ts.map +1 -1
- package/lib/types/backends/claude/backend.js +103 -29
- package/lib/types/backends/claude/catalog.d.ts +2 -1
- package/lib/types/backends/claude/catalog.d.ts.map +1 -1
- package/lib/types/backends/claude/catalog.js +15 -5
- package/lib/types/backends/claude/channels.d.ts +5 -3
- package/lib/types/backends/claude/channels.d.ts.map +1 -1
- package/lib/types/backends/claude/channels.js +5 -4
- package/lib/types/backends/claude/contract.d.ts +4 -0
- package/lib/types/backends/claude/contract.d.ts.map +1 -1
- package/lib/types/backends/claude/contract.js +4 -0
- package/lib/types/backends/claude/controls.d.ts +4 -0
- package/lib/types/backends/claude/controls.d.ts.map +1 -1
- package/lib/types/backends/claude/controls.js +34 -42
- package/lib/types/backends/claude/dialogs.d.ts +8 -2
- package/lib/types/backends/claude/dialogs.d.ts.map +1 -1
- package/lib/types/backends/claude/dialogs.js +24 -16
- package/lib/types/backends/claude/images.d.ts +1 -1
- package/lib/types/backends/claude/images.d.ts.map +1 -1
- package/lib/types/backends/claude/images.js +7 -7
- package/lib/types/backends/claude/manifest.d.ts +21 -0
- package/lib/types/backends/claude/manifest.d.ts.map +1 -0
- package/lib/types/backends/claude/manifest.js +29 -0
- package/lib/types/backends/claude/older-history.js +2 -2
- package/lib/types/backends/claude/permissions.js +11 -11
- package/lib/types/backends/claude/prefs.d.ts +4 -2
- package/lib/types/backends/claude/prefs.d.ts.map +1 -1
- package/lib/types/backends/claude/prefs.js +4 -3
- package/lib/types/backends/claude/process.d.ts +16 -4
- package/lib/types/backends/claude/process.d.ts.map +1 -1
- package/lib/types/backends/claude/process.js +100 -37
- package/lib/types/backends/claude/send-message.d.ts +1 -1
- package/lib/types/backends/claude/send-message.d.ts.map +1 -1
- package/lib/types/backends/claude/session/auth.js +22 -22
- package/lib/types/backends/claude/session/channels.d.ts +4 -0
- package/lib/types/backends/claude/session/channels.d.ts.map +1 -1
- package/lib/types/backends/claude/session/channels.js +5 -3
- package/lib/types/backends/claude/session/lifecycle.d.ts.map +1 -1
- package/lib/types/backends/claude/session/lifecycle.js +31 -23
- package/lib/types/backends/claude/session/store.js +8 -8
- package/lib/types/backends/claude/session/subagents.js +2 -2
- package/lib/types/backends/claude/session/types.d.ts +7 -0
- package/lib/types/backends/claude/session/types.d.ts.map +1 -1
- package/lib/types/backends/claude/side-query.js +3 -3
- package/lib/types/backends/claude/task-output.js +5 -5
- package/lib/types/backends/claude/text.d.ts +778 -0
- package/lib/types/backends/claude/text.d.ts.map +1 -0
- package/lib/types/backends/claude/text.js +298 -0
- package/lib/types/backends/claude/transcript-file.d.ts +1 -1
- package/lib/types/backends/claude/transcript-file.d.ts.map +1 -1
- package/lib/types/backends/claude/transcript-file.js +4 -4
- package/lib/types/backends/claude/translate/attempts.js +2 -2
- package/lib/types/backends/claude/translate/core.js +3 -3
- package/lib/types/backends/claude/translate/messages.js +4 -4
- package/lib/types/backends/claude/translate/system.js +14 -14
- package/lib/types/backends/claude/translate/tasks.js +2 -2
- package/lib/types/backends/claude/translate/types.d.ts +1 -1
- package/lib/types/backends/claude/translate/types.d.ts.map +1 -1
- package/lib/types/backends/codex/auth/external-tokens.js +16 -16
- package/lib/types/backends/codex/auth/status.js +14 -14
- package/lib/types/backends/codex/backend.d.ts +4 -19
- package/lib/types/backends/codex/backend.d.ts.map +1 -1
- package/lib/types/backends/codex/backend.js +118 -25
- package/lib/types/backends/codex/catalog.d.ts +2 -1
- package/lib/types/backends/codex/catalog.d.ts.map +1 -1
- package/lib/types/backends/codex/catalog.js +63 -18
- package/lib/types/backends/codex/channels.d.ts +6 -3
- package/lib/types/backends/codex/channels.d.ts.map +1 -1
- package/lib/types/backends/codex/channels.js +15 -13
- package/lib/types/backends/codex/detect.d.ts.map +1 -1
- package/lib/types/backends/codex/detect.js +9 -6
- package/lib/types/backends/codex/manifest.d.ts +30 -0
- package/lib/types/backends/codex/manifest.d.ts.map +1 -0
- package/lib/types/backends/codex/manifest.js +23 -0
- package/lib/types/backends/codex/prefs.d.ts +4 -2
- package/lib/types/backends/codex/prefs.d.ts.map +1 -1
- package/lib/types/backends/codex/prefs.js +4 -3
- package/lib/types/backends/codex/rpc/hub.js +2 -2
- package/lib/types/backends/codex/session/activity.d.ts +1 -1
- package/lib/types/backends/codex/session/activity.d.ts.map +1 -1
- package/lib/types/backends/codex/session/activity.js +13 -13
- package/lib/types/backends/codex/session/approvals.js +30 -30
- package/lib/types/backends/codex/session/commands.d.ts +8 -2
- package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
- package/lib/types/backends/codex/session/commands.js +71 -23
- package/lib/types/backends/codex/session/controls.d.ts +1 -1
- package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
- package/lib/types/backends/codex/session/controls.js +21 -16
- package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
- package/lib/types/backends/codex/session/goals.js +3 -3
- package/lib/types/backends/codex/session/history.js +2 -2
- package/lib/types/backends/codex/session/images.js +8 -8
- package/lib/types/backends/codex/session/input.d.ts +6 -2
- package/lib/types/backends/codex/session/input.d.ts.map +1 -1
- package/lib/types/backends/codex/session/input.js +55 -13
- package/lib/types/backends/codex/session/plan-review.js +6 -6
- package/lib/types/backends/codex/session/session.d.ts.map +1 -1
- package/lib/types/backends/codex/session/session.js +66 -34
- package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
- package/lib/types/backends/codex/session/side-query.js +27 -9
- package/lib/types/backends/codex/session/state.d.ts +6 -1
- package/lib/types/backends/codex/session/state.d.ts.map +1 -1
- package/lib/types/backends/codex/session/subagents.js +5 -5
- package/lib/types/backends/codex/session/tasks.js +4 -4
- package/lib/types/backends/codex/text.d.ts +933 -0
- package/lib/types/backends/codex/text.d.ts.map +1 -0
- package/lib/types/backends/codex/text.js +313 -0
- package/lib/types/backends/codex/translate/items.js +4 -4
- package/lib/types/backends/codex/translate/live.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/live.js +11 -8
- package/lib/types/backends/codex/translate/notices.js +10 -10
- package/lib/types/backends/shared/channel-slug.d.ts +4 -0
- package/lib/types/backends/shared/channel-slug.d.ts.map +1 -0
- package/lib/types/backends/shared/channel-slug.js +25 -0
- package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
- package/lib/types/backends/shared/channel-tokens.js +30 -23
- package/lib/types/{channel → backends/shared}/elicitation.d.ts +78 -21
- package/lib/types/backends/shared/elicitation.d.ts.map +1 -0
- package/lib/types/{channel → backends/shared}/elicitation.js +64 -66
- package/lib/types/backends/shared/image-size.d.ts +33 -0
- package/lib/types/backends/shared/image-size.d.ts.map +1 -0
- package/lib/types/backends/shared/image-size.js +134 -0
- package/lib/types/{utils → backends/shared}/jsonl.d.ts +5 -1
- package/lib/types/backends/shared/jsonl.d.ts.map +1 -0
- package/lib/types/{utils → backends/shared}/jsonl.js +5 -1
- package/lib/types/backends/shared/localized-text.d.ts +30 -0
- package/lib/types/backends/shared/localized-text.d.ts.map +1 -0
- package/lib/types/backends/shared/localized-text.js +24 -0
- package/lib/types/backends/shared/platform-text.d.ts +88 -0
- package/lib/types/backends/shared/platform-text.d.ts.map +1 -0
- package/lib/types/backends/shared/platform-text.js +33 -0
- package/lib/types/branding.d.ts +13 -0
- package/lib/types/branding.d.ts.map +1 -1
- package/lib/types/branding.js +18 -0
- package/lib/types/channel/channel-slug.d.ts +3 -1
- package/lib/types/channel/channel-slug.d.ts.map +1 -1
- package/lib/types/channel/channel-slug.js +3 -1
- package/lib/types/channel/sanitize.d.ts +7 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +9 -0
- package/lib/types/channel/usage.d.ts.map +1 -1
- package/lib/types/channel/usage.js +5 -0
- package/lib/types/commands.d.ts +5 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +47 -8
- package/lib/types/components/AgentMessageComposer.d.ts.map +1 -1
- package/lib/types/components/AgentMessageComposer.js +3 -2
- package/lib/types/components/BtwPanel.d.ts.map +1 -1
- package/lib/types/components/BtwPanel.js +4 -2
- package/lib/types/components/Chat/JobCard.js +3 -3
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
- package/lib/types/components/CommandSuggestions.js +20 -6
- package/lib/types/components/ContextBarView.d.ts +5 -1
- package/lib/types/components/ContextBarView.d.ts.map +1 -1
- package/lib/types/components/ContextBarView.js +6 -3
- package/lib/types/components/ExtensionDialog.d.ts.map +1 -1
- package/lib/types/components/ExtensionDialog.js +2 -3
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +14 -3
- package/lib/types/components/InlineMathParagraph.js +1 -1
- package/lib/types/components/KernelPicker.d.ts.map +1 -1
- package/lib/types/components/KernelPicker.js +1 -1
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +9 -6
- package/lib/types/components/MarkdownTable.d.ts.map +1 -1
- package/lib/types/components/MarkdownTable.js +4 -3
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +18 -5
- package/lib/types/components/ModelPicker.d.ts +24 -31
- package/lib/types/components/ModelPicker.d.ts.map +1 -1
- package/lib/types/components/ModelPicker.js +115 -40
- package/lib/types/components/PromptEditor.d.ts +3 -3
- package/lib/types/components/PromptInput.d.ts +21 -3
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +58 -118
- package/lib/types/components/SdkInstallWizard.d.ts +3 -1
- package/lib/types/components/SdkInstallWizard.d.ts.map +1 -1
- package/lib/types/components/SdkInstallWizard.js +8 -1
- package/lib/types/components/SearchBox.d.ts +13 -15
- package/lib/types/components/SearchBox.d.ts.map +1 -1
- package/lib/types/components/SearchBox.js +58 -27
- package/lib/types/components/ThemePicker.d.ts +1 -1
- package/lib/types/components/ThemePicker.d.ts.map +1 -1
- package/lib/types/components/ThemePicker.js +14 -11
- package/lib/types/components/Tooltip.js +1 -1
- package/lib/types/components/WorkingSpinner.js +1 -1
- package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -1
- package/lib/types/components/WorkspaceFlowPicker.js +4 -3
- package/lib/types/components/composerImageTokens.d.ts +24 -0
- package/lib/types/components/composerImageTokens.d.ts.map +1 -0
- package/lib/types/components/composerImageTokens.js +37 -0
- package/lib/types/components/design-system/InputCaret.d.ts +7 -0
- package/lib/types/components/design-system/InputCaret.d.ts.map +1 -0
- package/lib/types/components/design-system/InputCaret.js +9 -0
- package/lib/types/components/design-system/ListItem.d.ts +13 -2
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
- package/lib/types/components/design-system/ListItem.js +11 -5
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +6 -8
- package/lib/types/components/kernelCatalog.d.ts +55 -11
- package/lib/types/components/kernelCatalog.d.ts.map +1 -1
- package/lib/types/components/kernelCatalog.js +42 -23
- package/lib/types/components/launchpadActions.d.ts +4 -0
- package/lib/types/components/launchpadActions.d.ts.map +1 -1
- package/lib/types/components/launchpadActions.js +5 -4
- package/lib/types/components/launchpadLayout.d.ts.map +1 -1
- package/lib/types/components/launchpadLayout.js +2 -2
- package/lib/types/components/messages/UserPromptMessage.d.ts +4 -3
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
- package/lib/types/components/messages/UserPromptMessage.js +4 -3
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +8 -3
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +4 -3
- package/lib/types/components/questions/ProviderModelEditor.d.ts.map +1 -1
- package/lib/types/components/questions/ProviderModelEditor.js +3 -13
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -1
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
- package/lib/types/components/sessions/ForeignSessionRow.js +5 -2
- package/lib/types/components/sessions/SessionListRow.d.ts +3 -1
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +5 -2
- package/lib/types/components/sidePanel/PanelBar.d.ts +1 -0
- package/lib/types/components/sidePanel/PanelBar.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelBar.js +21 -17
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts +1 -1
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelColumn.js +2 -1
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts +6 -4
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelLayout.js +33 -7
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +4 -2
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +12 -4
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +59 -15
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +4 -2
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadView.js +12 -6
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -2
- package/lib/types/components/sidePanel/types.d.ts +1 -1
- package/lib/types/components/sidePanel/types.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.d.ts +2 -0
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +11 -1
- package/lib/types/components/splashFonts.d.ts +24 -1
- package/lib/types/components/splashFonts.d.ts.map +1 -1
- package/lib/types/components/splashFonts.js +40 -5
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +3 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +5 -2
- package/lib/types/dsh-adapter/admission-loader.d.ts +20 -0
- package/lib/types/dsh-adapter/admission-loader.d.ts.map +1 -0
- package/lib/types/dsh-adapter/admission-loader.js +256 -0
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +3 -0
- package/lib/types/dsh-adapter/backend-admission.d.ts +64 -0
- package/lib/types/dsh-adapter/backend-admission.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-admission.js +34 -0
- package/lib/types/dsh-adapter/backend-contribution.d.ts +26 -0
- package/lib/types/dsh-adapter/backend-contribution.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-contribution.js +37 -0
- package/lib/types/dsh-adapter/backend-registry.d.ts +136 -0
- package/lib/types/dsh-adapter/backend-registry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend-registry.js +285 -0
- package/lib/types/dsh-adapter/backends.d.ts +67 -24
- package/lib/types/dsh-adapter/backends.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backends.generated.d.ts +12 -0
- package/lib/types/dsh-adapter/backends.generated.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backends.generated.js +6 -0
- package/lib/types/dsh-adapter/backends.js +92 -46
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +2 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.js +9 -3
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +2 -2
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +8 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +16 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +18 -46
- package/lib/types/dsh-adapter/channel/channel-host.d.ts +45 -0
- package/lib/types/dsh-adapter/channel/channel-host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/channel-host.js +1 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts +5 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +16 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +4 -2
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +36 -5
- package/lib/types/dsh-adapter/channel/cordis-host.d.ts +14 -0
- package/lib/types/dsh-adapter/channel/cordis-host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/cordis-host.js +35 -0
- package/lib/types/dsh-adapter/channel/core/actions.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.js +15 -6
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +7 -3
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +3 -0
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +12 -28
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +318 -117
- package/lib/types/dsh-adapter/channel/core/files.d.ts +7 -2
- package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/files.js +1 -0
- package/lib/types/dsh-adapter/channel/core/host.d.ts +12 -6
- package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/host.js +69 -35
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +5 -3
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +5 -2
- package/lib/types/dsh-adapter/channel/core/session-controls.js +2 -2
- package/lib/types/dsh-adapter/channel/core/session-switch.d.ts +7 -4
- package/lib/types/dsh-adapter/channel/core/session-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/session-switch.js +8 -4
- package/lib/types/dsh-adapter/channel/core/sessions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/core/sessions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/sessions.js +75 -16
- package/lib/types/dsh-adapter/channel/extensions.d.ts +4 -3
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +41 -22
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +14 -5
- package/lib/types/dsh-adapter/channel/job-projection.d.ts +4 -0
- package/lib/types/dsh-adapter/channel/job-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/job-projection.js +205 -24
- package/lib/types/dsh-adapter/channel/mentions.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.js +138 -8
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +40 -28
- package/lib/types/dsh-adapter/channel/model-selection.d.ts +17 -0
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/model-selection.js +109 -0
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +12 -21
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +39 -102
- package/lib/types/dsh-adapter/channel/projection.js +1 -1
- package/lib/types/dsh-adapter/channel/reports.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/reports.js +11 -3
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +33 -20
- package/lib/types/dsh-adapter/channel/session-listing.d.ts +20 -0
- package/lib/types/dsh-adapter/channel/session-listing.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-listing.js +51 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +3 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +56 -27
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +15 -8
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +38 -24
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +38 -24
- package/lib/types/dsh-adapter/channel/settings-host.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +1 -0
- package/lib/types/dsh-adapter/channel/state.d.ts +37 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +14 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +66 -6
- package/lib/types/dsh-adapter/channel/task-completion.d.ts +6 -0
- package/lib/types/dsh-adapter/channel/task-completion.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/task-completion.js +114 -0
- package/lib/types/dsh-adapter/channel/transcript.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +1 -1
- package/lib/types/dsh-adapter/channel/upstream-retry.d.ts +81 -0
- package/lib/types/dsh-adapter/channel/upstream-retry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/upstream-retry.js +138 -0
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.js +9 -8
- package/lib/types/dsh-adapter/channel-ui.d.ts +3 -1
- package/lib/types/dsh-adapter/channel-ui.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel-ui.js +4 -2
- package/lib/types/dsh-adapter/channel.d.ts +2 -2
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +19 -5
- package/lib/types/dsh-adapter/context-occupancy.d.ts +81 -4
- package/lib/types/dsh-adapter/context-occupancy.d.ts.map +1 -1
- package/lib/types/dsh-adapter/context-occupancy.js +108 -17
- package/lib/types/dsh-adapter/contract.d.ts +1 -1
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +15 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts +36 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -0
- package/lib/types/dsh-adapter/entry-slot.js +28 -0
- package/lib/types/dsh-adapter/fresh-agent.d.ts +22 -0
- package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -0
- package/lib/types/dsh-adapter/fresh-agent.js +221 -0
- package/lib/types/dsh-adapter/host-access.d.ts +16 -1
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +53 -2
- package/lib/types/dsh-adapter/host-contract.d.ts +103 -0
- package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-contract.js +76 -0
- package/lib/types/dsh-adapter/host-dsh.d.ts +106 -0
- package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-dsh.js +466 -0
- package/lib/types/dsh-adapter/host-entry.d.ts +9 -0
- package/lib/types/dsh-adapter/host-entry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-entry.js +228 -0
- package/lib/types/dsh-adapter/index.d.ts +55 -18
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +59 -7
- package/lib/types/dsh-adapter/install/executors.d.ts +44 -0
- package/lib/types/dsh-adapter/install/executors.d.ts.map +1 -0
- package/lib/types/dsh-adapter/install/executors.js +15 -0
- package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts +3 -0
- package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts.map +1 -0
- package/lib/types/dsh-adapter/install/pnpm-profile-add.js +150 -0
- package/lib/types/dsh-adapter/jobs.d.ts +7 -0
- package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/jobs.js +13 -0
- package/lib/types/dsh-adapter/lite-profile.d.ts +50 -0
- package/lib/types/dsh-adapter/lite-profile.d.ts.map +1 -0
- package/lib/types/dsh-adapter/lite-profile.js +49 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts +1 -1
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts.map +1 -1
- package/lib/types/dsh-adapter/migrate/parse/jsonl.js +4 -3
- package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/profiles.js +5 -1
- package/lib/types/dsh-adapter/panels.d.ts +7 -0
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/panels.js +35 -2
- package/lib/types/dsh-adapter/plugin-completions.d.ts +32 -0
- package/lib/types/dsh-adapter/plugin-completions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-completions.js +80 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts +21 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-declaration.js +53 -0
- package/lib/types/dsh-adapter/plugin-host.d.ts +13 -2
- package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-host.js +34 -8
- package/lib/types/dsh-adapter/plugin-manager.d.ts +68 -0
- package/lib/types/dsh-adapter/plugin-manager.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-manager.js +51 -0
- package/lib/types/dsh-adapter/plugin.d.ts +50 -1
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +870 -233
- package/lib/types/dsh-adapter/plugins-info.d.ts +44 -8
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +354 -34
- package/lib/types/dsh-adapter/process-exit.d.ts +43 -0
- package/lib/types/dsh-adapter/process-exit.d.ts.map +1 -0
- package/lib/types/dsh-adapter/process-exit.js +60 -0
- package/lib/types/dsh-adapter/root-dispose.d.ts +18 -0
- package/lib/types/dsh-adapter/root-dispose.d.ts.map +1 -0
- package/lib/types/dsh-adapter/root-dispose.js +28 -0
- package/lib/types/dsh-adapter/session-list-metadata.d.ts +20 -0
- package/lib/types/dsh-adapter/session-list-metadata.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-list-metadata.js +56 -0
- package/lib/types/dsh-adapter/session-seed.d.ts +11 -0
- package/lib/types/dsh-adapter/session-seed.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-seed.js +47 -0
- package/lib/types/dsh-adapter/sessions/list.d.ts +3 -1
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +11 -5
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts +0 -2
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/snapshot.js +7 -70
- package/lib/types/dsh-adapter/startup-args.d.ts +2 -0
- package/lib/types/dsh-adapter/startup-args.d.ts.map +1 -1
- package/lib/types/dsh-adapter/startup-args.js +5 -0
- package/lib/types/dsh-adapter/subagents.d.ts +33 -1
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +110 -8
- package/lib/types/dsh-adapter/tui-settings.d.ts +57 -0
- package/lib/types/dsh-adapter/tui-settings.d.ts.map +1 -0
- package/lib/types/dsh-adapter/tui-settings.js +199 -0
- package/lib/types/effortPrefs.d.ts +6 -3
- package/lib/types/effortPrefs.d.ts.map +1 -1
- package/lib/types/effortPrefs.js +7 -4
- package/lib/types/hostEntryRoute.d.ts +18 -0
- package/lib/types/hostEntryRoute.d.ts.map +1 -0
- package/lib/types/hostEntryRoute.js +57 -0
- package/lib/types/i18n.d.ts +363 -1432
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +155 -385
- package/lib/types/ink/components/AlternateScreen.js +2 -2
- package/lib/types/ink/components/App.d.ts +1 -0
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +16 -4
- package/lib/types/ink/components/CursorDeclarationContext.d.ts +9 -0
- package/lib/types/ink/components/CursorDeclarationContext.d.ts.map +1 -1
- package/lib/types/ink/components/CursorDeclarationContext.js +2 -0
- package/lib/types/ink/hooks/use-copy-on-select.d.ts +2 -2
- package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-copy-on-select.js +13 -7
- package/lib/types/ink/hooks/use-declared-cursor.d.ts +11 -3
- package/lib/types/ink/hooks/use-declared-cursor.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-declared-cursor.js +30 -10
- package/lib/types/ink/ink.d.ts +22 -17
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +151 -40
- package/lib/types/ink/kitty-graphics.d.ts +2 -0
- package/lib/types/ink/kitty-graphics.d.ts.map +1 -1
- package/lib/types/ink/kitty-graphics.js +6 -1
- package/lib/types/ink/node-cache.d.ts +2 -1
- package/lib/types/ink/node-cache.d.ts.map +1 -1
- package/lib/types/ink/output.d.ts +10 -4
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +14 -10
- package/lib/types/ink/render-node-to-output.d.ts +5 -2
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +27 -9
- package/lib/types/ink/renderer.d.ts +1 -0
- package/lib/types/ink/renderer.d.ts.map +1 -1
- package/lib/types/ink/renderer.js +4 -3
- package/lib/types/ink/root.d.ts +4 -1
- package/lib/types/ink/root.d.ts.map +1 -1
- package/lib/types/ink/screen.d.ts +4 -2
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/selection.d.ts +10 -1
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +94 -25
- package/lib/types/ink/stdin-handoff.d.ts +11 -0
- package/lib/types/ink/stdin-handoff.d.ts.map +1 -0
- package/lib/types/ink/stdin-handoff.js +20 -0
- package/lib/types/ink/styles.d.ts +2 -1
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.d.ts +6 -4
- package/lib/types/ink/terminal-image.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.js +16 -39
- package/lib/types/ink/terminal-notification.d.ts +8 -0
- package/lib/types/ink/terminal-notification.d.ts.map +1 -0
- package/lib/types/ink/terminal-notification.js +83 -0
- package/lib/types/ink/terminal.d.ts +9 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +34 -1
- package/lib/types/ink/termio/csi.d.ts +11 -0
- package/lib/types/ink/termio/csi.d.ts.map +1 -1
- package/lib/types/ink/termio/csi.js +13 -0
- package/lib/types/ink/update-overflow-guard.d.ts +6 -0
- package/lib/types/ink/update-overflow-guard.d.ts.map +1 -1
- package/lib/types/ink/update-overflow-guard.js +17 -0
- package/lib/types/ink/wrap-text.d.ts +6 -0
- package/lib/types/ink/wrap-text.d.ts.map +1 -1
- package/lib/types/ink/wrap-text.js +17 -0
- package/lib/types/kernelPrefs.d.ts +129 -16
- package/lib/types/kernelPrefs.d.ts.map +1 -1
- package/lib/types/kernelPrefs.js +98 -35
- package/lib/types/math/inline-layout.d.ts +2 -0
- package/lib/types/math/inline-layout.d.ts.map +1 -1
- package/lib/types/math/inline-layout.js +5 -27
- package/lib/types/modelGroups.d.ts +15 -27
- package/lib/types/modelGroups.d.ts.map +1 -1
- package/lib/types/modelGroups.js +17 -31
- package/lib/types/modelPrefs.d.ts +5 -4
- package/lib/types/modelPrefs.d.ts.map +1 -1
- package/lib/types/modelPrefs.js +5 -4
- package/lib/types/modelRoute.d.ts +23 -9
- package/lib/types/modelRoute.d.ts.map +1 -1
- package/lib/types/modelRoute.js +25 -11
- package/lib/types/permissionPrefs.d.ts +34 -0
- package/lib/types/permissionPrefs.d.ts.map +1 -0
- package/lib/types/permissionPrefs.js +61 -0
- package/lib/types/plugin-host.d.ts +1 -0
- package/lib/types/plugin-host.d.ts.map +1 -1
- package/lib/types/presetPrefs.d.ts +17 -3
- package/lib/types/presetPrefs.d.ts.map +1 -1
- package/lib/types/presetPrefs.js +20 -3
- package/lib/types/reload.d.ts +6 -10
- package/lib/types/reload.d.ts.map +1 -1
- package/lib/types/reload.js +14 -14
- package/lib/types/screens/Chat.d.ts +22 -15
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +442 -272
- package/lib/types/screens/Launchpad.d.ts +27 -17
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +241 -78
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +53 -12
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +6 -0
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +24 -7
- package/lib/types/screens/StatusMetrics.d.ts +46 -1
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +72 -0
- package/lib/types/screens/chat/useKernelPicker.d.ts +8 -4
- package/lib/types/screens/chat/useKernelPicker.d.ts.map +1 -1
- package/lib/types/screens/chat/useKernelPicker.js +61 -21
- package/lib/types/screens/chat/useModelPicker.d.ts +42 -0
- package/lib/types/screens/chat/useModelPicker.d.ts.map +1 -0
- package/lib/types/screens/chat/useModelPicker.js +182 -0
- package/lib/types/screens/chatOverlay.d.ts +11 -4
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/screens/chatOverlay.js +0 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +4 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +26 -5
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +51 -29
- package/lib/types/sessionHistory.d.ts +5 -0
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +5 -0
- package/lib/types/sessions/listSnapshot.d.ts +6 -0
- package/lib/types/sessions/listSnapshot.d.ts.map +1 -0
- package/lib/types/sessions/listSnapshot.js +67 -0
- package/lib/types/settings/definitions.d.ts +50 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +42 -8
- package/lib/types/terminal-utils/cjk-emphasis.d.ts +28 -0
- package/lib/types/terminal-utils/cjk-emphasis.d.ts.map +1 -0
- package/lib/types/terminal-utils/cjk-emphasis.js +31 -0
- package/lib/types/terminal-utils/markdown.d.ts +3 -1
- package/lib/types/terminal-utils/markdown.d.ts.map +1 -1
- package/lib/types/terminal-utils/markdown.js +7 -2
- package/lib/types/theme.d.ts +29 -12
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +310 -23
- package/lib/types/themeCatalog.d.ts.map +1 -1
- package/lib/types/themeCatalog.js +21 -2
- package/lib/types/tips.js +4 -4
- package/lib/types/tuiSettingsFile.d.ts +56 -0
- package/lib/types/tuiSettingsFile.d.ts.map +1 -0
- package/lib/types/tuiSettingsFile.js +206 -0
- package/lib/types/ui.d.ts +2 -0
- package/lib/types/ui.d.ts.map +1 -1
- package/lib/types/ui.js +2 -0
- package/lib/types/update.d.ts +72 -26
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +131 -43
- package/lib/types/utils/bmp.d.ts +7 -0
- package/lib/types/utils/bmp.d.ts.map +1 -1
- package/lib/types/utils/bmp.js +27 -0
- package/lib/types/utils/bootTrace.d.ts +2 -0
- package/lib/types/utils/bootTrace.d.ts.map +1 -0
- package/lib/types/utils/bootTrace.js +20 -0
- package/lib/types/utils/clipboard.d.ts.map +1 -1
- package/lib/types/utils/clipboard.js +11 -3
- package/lib/types/utils/credentials.d.ts +14 -2
- package/lib/types/utils/credentials.d.ts.map +1 -1
- package/lib/types/utils/credentials.js +34 -11
- package/lib/types/utils/imageResize.d.ts +10 -20
- package/lib/types/utils/imageResize.d.ts.map +1 -1
- package/lib/types/utils/imageResize.js +61 -134
- package/lib/types/utils/inputPaste.d.ts +2 -2
- package/lib/types/utils/inputPaste.js +2 -2
- package/lib/types/utils/pastedImagePath.d.ts +5 -0
- package/lib/types/utils/pastedImagePath.d.ts.map +1 -1
- package/lib/types/utils/pastedImagePath.js +33 -0
- package/package.json +36 -6
- package/presets/winbash.mjs +716 -0
- package/tui-profile/protocols/profile-definitions.d.ts +1 -0
- package/tui-profile/protocols/profile-definitions.js +14 -0
- package/tui-profile/protocols/tui-contributions.d.ts +55 -0
- package/tui-profile/protocols/tui-contributions.js +141 -0
- package/tui-profile/registry/contracts/backend-v1alpha1.json +13 -0
- package/tui-profile/registry/registry-0.15.json +12 -0
- package/lib/types/backends/claude/install.d.ts +0 -15
- package/lib/types/backends/claude/install.d.ts.map +0 -1
- package/lib/types/backends/claude/install.js +0 -91
- package/lib/types/channel/elicitation.d.ts.map +0 -1
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts +0 -42
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts.map +0 -1
- package/lib/types/dsh-adapter/channel/session-lineage.js +0 -51
- package/lib/types/utils/jsonl.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* /
|
|
3
|
-
* diagnostics): assembles the lines behind the `/
|
|
2
|
+
* /plugin diagnostics surface (C-070 trust disclosure + C-030 negotiation
|
|
3
|
+
* diagnostics): assembles the lines behind the `/plugin` command.
|
|
4
4
|
*
|
|
5
5
|
* Sections (overview):
|
|
6
6
|
*
|
|
@@ -11,19 +11,30 @@
|
|
|
11
11
|
* (coordinates + generation), including drift-dropped contracts.
|
|
12
12
|
* 3. GRANT MATRIX — plugins × the registered permissions. The plugin set is
|
|
13
13
|
* the union of FOOTPRINTS ONLY: keys of the grants file, pluginIds seen
|
|
14
|
-
* in the effect ledger, and storage namespaces on disk
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* in the effect ledger, and storage namespaces on disk. The header says so
|
|
15
|
+
* honestly. (The profile's own bundles and rows are a different question
|
|
16
|
+
* and come from the host plugin service, below — this matrix stays the
|
|
17
|
+
* footprint view it has always been.)
|
|
17
18
|
* 4. LEDGER TAIL — the last 5 effect-ledger records.
|
|
19
|
+
* 5. BUNDLES AND ROWS — what the profile composes, from `ctx.pluginManager`
|
|
20
|
+
* (`./plugin-manager.ts`): official installation-supplied bundles first,
|
|
21
|
+
* then the profile's own, each with gate 1's tag from its declaration
|
|
22
|
+
* (`./plugin-declaration.ts`), plus the loader entries no patch row can
|
|
23
|
+
* address. Absent service → every line above is unchanged and one line
|
|
24
|
+
* says why the half is missing.
|
|
18
25
|
*
|
|
19
|
-
* `/
|
|
26
|
+
* `/plugin check <path>` uses the parser and projection from the pinned
|
|
20
27
|
* @dsh-std/manifest revision, then evaluates every public/private protocol
|
|
21
28
|
* through one ProtocolCatalog. Manifests and on-disk files are UNTRUSTED input:
|
|
22
29
|
* every derived line passes cleanScalarText before it reaches the
|
|
23
|
-
* transcript
|
|
30
|
+
* transcript, and any credential they quote — a URL field, the spec a person
|
|
31
|
+
* typed, text the service hands back — is redacted first (`redactUrl`/
|
|
32
|
+
* `redactText`).
|
|
24
33
|
*/
|
|
25
34
|
import type { GrantStore } from '../adapter/standard/grants.js';
|
|
26
35
|
import type { HostDescriptorBuild } from '../adapter/standard/descriptor.js';
|
|
36
|
+
import { type PluginDeclaration } from './plugin-declaration.js';
|
|
37
|
+
import { type PluginManagerView } from './plugin-manager.js';
|
|
27
38
|
/** How many plugins the matrix shows before an overflow note. */
|
|
28
39
|
export declare const PLUGINS_MATRIX_MAX_ROWS = 20;
|
|
29
40
|
/** How many ledger records the tail section shows. */
|
|
@@ -33,11 +44,36 @@ export interface PluginsInfoDeps {
|
|
|
33
44
|
grants: GrantStore;
|
|
34
45
|
/** The plugin-host row's descriptor build; undefined → row not mounted. */
|
|
35
46
|
host?: HostDescriptorBuild;
|
|
47
|
+
/** A package's declaration, resolved from the running composition. */
|
|
48
|
+
declaration?: (packageName: string) => PluginDeclaration | undefined;
|
|
36
49
|
/** Test overrides; default under DATA_DIR. */
|
|
37
50
|
dataDir?: string;
|
|
38
51
|
ledgerFile?: string;
|
|
39
52
|
storageDir?: string;
|
|
40
53
|
}
|
|
41
|
-
/**
|
|
54
|
+
/** Which form of the command the raw argument text asks for. */
|
|
55
|
+
export type PluginArgs = {
|
|
56
|
+
readonly kind: 'overview';
|
|
57
|
+
} | {
|
|
58
|
+
readonly kind: 'list';
|
|
59
|
+
} | {
|
|
60
|
+
readonly kind: 'check';
|
|
61
|
+
readonly path: string;
|
|
62
|
+
} | {
|
|
63
|
+
readonly kind: 'info';
|
|
64
|
+
readonly spec: string;
|
|
65
|
+
} | {
|
|
66
|
+
readonly kind: 'registries';
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: 'unknown';
|
|
69
|
+
readonly sub: string;
|
|
70
|
+
};
|
|
71
|
+
/** Route `/plugin`'s argument text: one parser, so both halves of the report agree. */
|
|
72
|
+
export declare function parsePluginArgs(args: string): PluginArgs;
|
|
73
|
+
/** The `/plugin` overview lines (banner always first). */
|
|
42
74
|
export declare function pluginsInfoLines(args: string, deps: PluginsInfoDeps): string[];
|
|
75
|
+
/** The service-backed half of the report (empty for a form that needs no service). */
|
|
76
|
+
export declare function pluginServiceLines(args: string, deps: PluginsInfoDeps, manager: PluginManagerView | undefined): Promise<string[]>;
|
|
77
|
+
/** `/plugin`: the diagnostics half plus the profile's own bundles and rows. */
|
|
78
|
+
export declare function pluginReport(args: string, deps: PluginsInfoDeps, manager: PluginManagerView | undefined): Promise<string[]>;
|
|
43
79
|
//# sourceMappingURL=plugins-info.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins-info.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/plugins-info.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plugins-info.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/plugins-info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAYH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AAC5E,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AACpF,OAAO,EAAqC,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAI/F,iEAAiE;AACjE,eAAO,MAAM,uBAAuB,KAAK,CAAA;AACzC,sDAAsD;AACtD,eAAO,MAAM,mBAAmB,IAAI,CAAA;AAIpC,MAAM,WAAW,eAAe;IAC9B,0EAA0E;IAC1E,MAAM,EAAE,UAAU,CAAA;IAClB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,mBAAmB,CAAA;IAC1B,sEAAsE;IACtE,WAAW,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,iBAAiB,GAAG,SAAS,CAAA;IACpE,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAmOD,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAC/B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD,uFAAuF;AACvF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CASxD;AAED,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,MAAM,EAAE,CA8F9E;AAyMD,sFAAsF;AACtF,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACrC,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBnB;AAED,+EAA+E;AAC/E,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACrC,OAAO,CAAC,MAAM,EAAE,CAAC,CAEnB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* /
|
|
3
|
-
* diagnostics): assembles the lines behind the `/
|
|
2
|
+
* /plugin diagnostics surface (C-070 trust disclosure + C-030 negotiation
|
|
3
|
+
* diagnostics): assembles the lines behind the `/plugin` command.
|
|
4
4
|
*
|
|
5
5
|
* Sections (overview):
|
|
6
6
|
*
|
|
@@ -11,16 +11,25 @@
|
|
|
11
11
|
* (coordinates + generation), including drift-dropped contracts.
|
|
12
12
|
* 3. GRANT MATRIX — plugins × the registered permissions. The plugin set is
|
|
13
13
|
* the union of FOOTPRINTS ONLY: keys of the grants file, pluginIds seen
|
|
14
|
-
* in the effect ledger, and storage namespaces on disk
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* in the effect ledger, and storage namespaces on disk. The header says so
|
|
15
|
+
* honestly. (The profile's own bundles and rows are a different question
|
|
16
|
+
* and come from the host plugin service, below — this matrix stays the
|
|
17
|
+
* footprint view it has always been.)
|
|
17
18
|
* 4. LEDGER TAIL — the last 5 effect-ledger records.
|
|
19
|
+
* 5. BUNDLES AND ROWS — what the profile composes, from `ctx.pluginManager`
|
|
20
|
+
* (`./plugin-manager.ts`): official installation-supplied bundles first,
|
|
21
|
+
* then the profile's own, each with gate 1's tag from its declaration
|
|
22
|
+
* (`./plugin-declaration.ts`), plus the loader entries no patch row can
|
|
23
|
+
* address. Absent service → every line above is unchanged and one line
|
|
24
|
+
* says why the half is missing.
|
|
18
25
|
*
|
|
19
|
-
* `/
|
|
26
|
+
* `/plugin check <path>` uses the parser and projection from the pinned
|
|
20
27
|
* @dsh-std/manifest revision, then evaluates every public/private protocol
|
|
21
28
|
* through one ProtocolCatalog. Manifests and on-disk files are UNTRUSTED input:
|
|
22
29
|
* every derived line passes cleanScalarText before it reaches the
|
|
23
|
-
* transcript
|
|
30
|
+
* transcript, and any credential they quote — a URL field, the spec a person
|
|
31
|
+
* typed, text the service hands back — is redacted first (`redactUrl`/
|
|
32
|
+
* `redactText`).
|
|
24
33
|
*/
|
|
25
34
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
26
35
|
import { join, resolve } from 'node:path';
|
|
@@ -30,6 +39,8 @@ import { t } from '../i18n.js';
|
|
|
30
39
|
import { loadSpecData } from '../adapter/standard/registry.js';
|
|
31
40
|
import { createContractIndex, validatePlugin, negotiate } from '../adapter/standard/admission.js';
|
|
32
41
|
import { cleanScalarText } from './sanitize.js';
|
|
42
|
+
import { isCompositionOwned } from './plugin-declaration.js';
|
|
43
|
+
import { extraBundles, localizedPluginText } from './plugin-manager.js';
|
|
33
44
|
import { PLUGIN_STORAGE_DIR } from './plugin-storage.js';
|
|
34
45
|
import { EFFECT_LEDGER_FILE } from './effect-ledger.js';
|
|
35
46
|
/** How many plugins the matrix shows before an overflow note. */
|
|
@@ -38,7 +49,62 @@ export const PLUGINS_MATRIX_MAX_ROWS = 20;
|
|
|
38
49
|
export const PLUGINS_LEDGER_TAIL = 5;
|
|
39
50
|
/** Per-line cell cap for file-derived content. */
|
|
40
51
|
const LINE_CELLS = 200;
|
|
41
|
-
|
|
52
|
+
/** Query parameters that are a secret on their own: a credential needs no
|
|
53
|
+
* userinfo (`https://registry.example.com/?token=…`). */
|
|
54
|
+
const CREDENTIAL_QUERY_KEY = /^(?:token|access_token|auth|authorization|password|passwd|pwd|_auth|_authtoken|apikey|api_key|key|secret)$/i;
|
|
55
|
+
/**
|
|
56
|
+
* A URL with any credentials removed: npm and pnpm accept
|
|
57
|
+
* `https://user:token@registry/…` and `?token=…`, and this report is a
|
|
58
|
+
* transcript — neither may reach the screen or its scrollback. Host and path
|
|
59
|
+
* stay readable, so the person still recognizes which registry answered. A
|
|
60
|
+
* value that is not a URL at all (pnpm accepts odd ones) passes through
|
|
61
|
+
* unchanged.
|
|
62
|
+
*/
|
|
63
|
+
function redactUrl(value) {
|
|
64
|
+
let url;
|
|
65
|
+
try {
|
|
66
|
+
url = new URL(value);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
// Userinfo goes with the whole query: a URL that authenticates there often
|
|
72
|
+
// pairs it with a token in the query.
|
|
73
|
+
if (url.password !== '' || url.username !== '')
|
|
74
|
+
return `${url.origin}${url.pathname}`;
|
|
75
|
+
let dropped = false;
|
|
76
|
+
for (const key of [...url.searchParams.keys()]) {
|
|
77
|
+
if (CREDENTIAL_QUERY_KEY.test(key)) {
|
|
78
|
+
url.searchParams.delete(key);
|
|
79
|
+
dropped = true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return dropped ? `${url.origin}${url.pathname}${url.search}` : value;
|
|
83
|
+
}
|
|
84
|
+
/** A URL-shaped run inside free text: the spec a person typed, and the same
|
|
85
|
+
* URL quoted back in a refusal reason or a thrown error. */
|
|
86
|
+
const URL_IN_TEXT = /[a-z][a-z0-9+.-]*:\/\/[^\s]+/giu;
|
|
87
|
+
/** What the parser refuses — a styled (ANSI) URL, an odd host — still loses its
|
|
88
|
+
* userinfo, so the one value it cannot read is not the gap a secret leaves by. */
|
|
89
|
+
const USERINFO_AT_START = /^([a-z][a-z0-9+.-]*:\/\/)[^/?#@\s]*@/iu;
|
|
90
|
+
/**
|
|
91
|
+
* Free text with every URL it quotes redacted. The three paths that print text
|
|
92
|
+
* rather than a URL field — an accepted spec the upstream left unnamed, a
|
|
93
|
+
* refusal reason, an exception message — all funnel through here.
|
|
94
|
+
*/
|
|
95
|
+
function redactText(value) {
|
|
96
|
+
if (!value.includes('://'))
|
|
97
|
+
return value;
|
|
98
|
+
return value.replace(URL_IN_TEXT, match => {
|
|
99
|
+
const redacted = redactUrl(match);
|
|
100
|
+
return redacted === match ? match.replace(USERINFO_AT_START, '$1') : redacted;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/** One report cell: credentials redacted first, then sanitized, then capped —
|
|
104
|
+
* truncation comes last, or a cut URL keeps the head of its own secret. */
|
|
105
|
+
const cell = (value) => cleanScalarText(redactText(String(value ?? '')), LINE_CELLS);
|
|
106
|
+
/** One URL field as a report cell: credentials stripped, then capped. */
|
|
107
|
+
const urlCell = (value) => cell(redactUrl(value));
|
|
42
108
|
/** Parse the ledger file tolerantly (skip corrupt lines, never throw). */
|
|
43
109
|
function readLedgerRecords(file) {
|
|
44
110
|
let text;
|
|
@@ -104,7 +170,7 @@ function footprintPlugins(deps, dataDir, ledgerFile, storageDir) {
|
|
|
104
170
|
void deps;
|
|
105
171
|
return [...found].sort();
|
|
106
172
|
}
|
|
107
|
-
/** `/
|
|
173
|
+
/** `/plugin check <path>`: official parse/projection + profile validation + negotiation. */
|
|
108
174
|
function checkManifestLines(pathArg, deps) {
|
|
109
175
|
const lines = [];
|
|
110
176
|
const target = resolve(pathArg);
|
|
@@ -160,7 +226,7 @@ function checkManifestLines(pathArg, deps) {
|
|
|
160
226
|
.map(request => ({
|
|
161
227
|
name: request.name,
|
|
162
228
|
scope: request.scope,
|
|
163
|
-
// `/
|
|
229
|
+
// `/plugin check` has no live activation instance. Passing an
|
|
164
230
|
// activation-less principal makes GrantStore fail closed when policy
|
|
165
231
|
// contains activation-scoped rules instead of treating them as global.
|
|
166
232
|
granted: deps.grants.allows({ componentId: manifest.id }, request.name, request.scope),
|
|
@@ -181,48 +247,73 @@ function checkManifestLines(pathArg, deps) {
|
|
|
181
247
|
}
|
|
182
248
|
return lines;
|
|
183
249
|
}
|
|
184
|
-
|
|
250
|
+
/** The five-state vocabulary as one cell (shared by `check` and the list tags). */
|
|
251
|
+
function stateText(decision) {
|
|
185
252
|
switch (decision.decision) {
|
|
186
253
|
case 'compatible':
|
|
187
|
-
return
|
|
254
|
+
return 'compatible';
|
|
188
255
|
case 'compatible_degraded':
|
|
189
|
-
return
|
|
190
|
-
state: `compatible_degraded (missingOptional: ${cell(decision.missingOptional.join(', '))})`,
|
|
191
|
-
})];
|
|
256
|
+
return `compatible_degraded (missingOptional: ${cell(decision.missingOptional.join(', '))})`;
|
|
192
257
|
case 'waiting_authorization':
|
|
193
|
-
return
|
|
194
|
-
state: `waiting_authorization (${cell(decision.reasonCode)}: ${cell(decision.deniedPermissions.join(', '))})`,
|
|
195
|
-
})];
|
|
258
|
+
return `waiting_authorization (${cell(decision.reasonCode)}: ${cell(decision.deniedPermissions.join(', '))})`;
|
|
196
259
|
case 'rejected': {
|
|
197
260
|
const detail = decision.missingRequired !== undefined
|
|
198
261
|
? `${cell(decision.reasonCode)}: ${cell(decision.missingRequired.join(', '))}`
|
|
199
262
|
: `${cell(decision.reasonCode)}: facet ${cell(decision.facetApiVersion)} vs host [${cell((decision.hostFacetApiVersions ?? []).join(', '))}]`;
|
|
200
|
-
return
|
|
263
|
+
return `rejected (${detail})`;
|
|
201
264
|
}
|
|
202
265
|
case 'unknown':
|
|
203
|
-
return
|
|
204
|
-
state: `unknown (${cell(decision.reasonCode)}: ${cell(decision.unknownContracts.join(', '))})`,
|
|
205
|
-
})];
|
|
266
|
+
return `unknown (${cell(decision.reasonCode)}: ${cell(decision.unknownContracts.join(', '))})`;
|
|
206
267
|
}
|
|
207
268
|
}
|
|
208
|
-
|
|
269
|
+
function decisionLines(decision) {
|
|
270
|
+
return [t('plugins-check-state', { state: stateText(decision) })];
|
|
271
|
+
}
|
|
272
|
+
/** Route `/plugin`'s argument text: one parser, so both halves of the report agree. */
|
|
273
|
+
export function parsePluginArgs(args) {
|
|
274
|
+
const trimmed = args.trim();
|
|
275
|
+
if (trimmed === '')
|
|
276
|
+
return { kind: 'overview' };
|
|
277
|
+
const [sub, ...rest] = trimmed.split(/\s+/);
|
|
278
|
+
if (sub === 'list')
|
|
279
|
+
return { kind: 'list' };
|
|
280
|
+
if (sub === 'check')
|
|
281
|
+
return { kind: 'check', path: rest.join(' ') };
|
|
282
|
+
if (sub === 'info')
|
|
283
|
+
return { kind: 'info', spec: rest.join(' ') };
|
|
284
|
+
if (sub === 'registries')
|
|
285
|
+
return { kind: 'registries' };
|
|
286
|
+
return { kind: 'unknown', sub: sub ?? '' };
|
|
287
|
+
}
|
|
288
|
+
/** The `/plugin` overview lines (banner always first). */
|
|
209
289
|
export function pluginsInfoLines(args, deps) {
|
|
210
290
|
const lines = [t('plugins-trust-banner')];
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const pathArg = rest.join(' ');
|
|
216
|
-
if (pathArg === '') {
|
|
217
|
-
lines.push(t('plugins-check-usage'));
|
|
218
|
-
return lines;
|
|
219
|
-
}
|
|
220
|
-
lines.push(...checkManifestLines(pathArg, deps));
|
|
291
|
+
const parsed = parsePluginArgs(args);
|
|
292
|
+
if (parsed.kind === 'check') {
|
|
293
|
+
if (parsed.path === '') {
|
|
294
|
+
lines.push(t('plugins-check-usage'));
|
|
221
295
|
return lines;
|
|
222
296
|
}
|
|
223
|
-
lines.push(
|
|
297
|
+
lines.push(...checkManifestLines(parsed.path, deps));
|
|
298
|
+
return lines;
|
|
299
|
+
}
|
|
300
|
+
if (parsed.kind === 'unknown') {
|
|
301
|
+
lines.push(t('plugins-unknown-subcommand', { sub: cell(parsed.sub) }));
|
|
224
302
|
return lines;
|
|
225
303
|
}
|
|
304
|
+
// `list` is the short form: the trust banner and what the profile added, no
|
|
305
|
+
// diagnostics. Its data comes from the service half below.
|
|
306
|
+
if (parsed.kind === 'list')
|
|
307
|
+
return lines;
|
|
308
|
+
// `info <spec>` names what it is looking for, so a bare one is a usage error
|
|
309
|
+
// the sync half can already answer; both service forms render below.
|
|
310
|
+
if (parsed.kind === 'info') {
|
|
311
|
+
if (parsed.spec === '')
|
|
312
|
+
lines.push(t('plugins-info-usage'));
|
|
313
|
+
return lines;
|
|
314
|
+
}
|
|
315
|
+
if (parsed.kind === 'registries')
|
|
316
|
+
return lines;
|
|
226
317
|
const dataDir = deps.dataDir ?? DATA_DIR;
|
|
227
318
|
const ledgerFile = deps.ledgerFile ?? EFFECT_LEDGER_FILE;
|
|
228
319
|
const storageDir = deps.storageDir ?? join(dataDir, PLUGIN_STORAGE_DIR);
|
|
@@ -291,3 +382,232 @@ export function pluginsInfoLines(args, deps) {
|
|
|
291
382
|
}
|
|
292
383
|
return lines;
|
|
293
384
|
}
|
|
385
|
+
/** Evaluate a package's declaration exactly as `check <path>` does. */
|
|
386
|
+
function declarationVerdict(deps, packageName) {
|
|
387
|
+
const declaration = deps.declaration?.(packageName);
|
|
388
|
+
if (declaration === undefined)
|
|
389
|
+
return { kind: 'undeclared' };
|
|
390
|
+
const data = loadSpecData();
|
|
391
|
+
if (data === undefined)
|
|
392
|
+
return { kind: 'invalid', error: t('plugins-check-spec-unavailable') };
|
|
393
|
+
let manifest;
|
|
394
|
+
try {
|
|
395
|
+
manifest = parseManifest(declaration.source, { source: declaration.path });
|
|
396
|
+
projectManifest(manifest);
|
|
397
|
+
}
|
|
398
|
+
catch (error) {
|
|
399
|
+
return { kind: 'invalid', error: cell(error instanceof Error ? error.message : String(error)) };
|
|
400
|
+
}
|
|
401
|
+
const index = createContractIndex(data.registry, data.permissions);
|
|
402
|
+
try {
|
|
403
|
+
validatePlugin(index, manifest);
|
|
404
|
+
}
|
|
405
|
+
catch (error) {
|
|
406
|
+
return { kind: 'invalid', error: cell(error instanceof Error ? error.message : String(error)) };
|
|
407
|
+
}
|
|
408
|
+
const host = deps.host;
|
|
409
|
+
if (host === undefined)
|
|
410
|
+
return { kind: 'invalid', error: t('plugins-check-host-unavailable') };
|
|
411
|
+
const granted = manifest.permissions.map(request => ({
|
|
412
|
+
name: request.name,
|
|
413
|
+
scope: request.scope,
|
|
414
|
+
granted: deps.grants.allows({ componentId: manifest.id }, request.name, request.scope),
|
|
415
|
+
}));
|
|
416
|
+
return { kind: 'decided', decision: negotiate(index, manifest, host.descriptor, granted) };
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* The gate-1 tag for one listed package, or `undefined` when it needs none.
|
|
420
|
+
* The composition's own rows are not plugins a person installed, so an absent
|
|
421
|
+
* declaration there is the normal state rather than a finding.
|
|
422
|
+
*/
|
|
423
|
+
function declarationTag(deps, packageName) {
|
|
424
|
+
const verdict = declarationVerdict(deps, packageName);
|
|
425
|
+
switch (verdict.kind) {
|
|
426
|
+
case 'undeclared':
|
|
427
|
+
return isCompositionOwned(packageName) ? undefined : t('plugins-tag-undeclared');
|
|
428
|
+
case 'invalid':
|
|
429
|
+
return t('plugins-tag-invalid', { err: verdict.error });
|
|
430
|
+
case 'decided':
|
|
431
|
+
return t('plugins-tag-declared', { state: stateText(verdict.decision) });
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Display title of one loader entry: its own localized title, else the module
|
|
436
|
+
* specifier it was loaded as (`./plugin-manager.ts` reads the field, which
|
|
437
|
+
* `PluginInventoryEntry.meta` only carries after the 0.1.5 line — contract.ts:
|
|
438
|
+
* additions must degrade gracefully on the older lines).
|
|
439
|
+
*/
|
|
440
|
+
function pluginRowTitle(plugin) {
|
|
441
|
+
return cell(localizedPluginText(plugin, plugin.moduleName));
|
|
442
|
+
}
|
|
443
|
+
/** One bundle row: what the profile holds, how it is controlled, what it says. */
|
|
444
|
+
function bundleLine(deps, bundle, options = {}) {
|
|
445
|
+
const flags = [bundle.enabled ? t('plugins-bundle-on') : t('plugins-bundle-off')];
|
|
446
|
+
if (!bundle.removable)
|
|
447
|
+
flags.push(t('plugins-bundle-kept'));
|
|
448
|
+
if (bundle.readOnlyReason !== undefined)
|
|
449
|
+
flags.push(t('plugins-bundle-locked', { reason: cell(bundle.readOnlyReason) }));
|
|
450
|
+
if (bundle.error !== undefined)
|
|
451
|
+
flags.push(t('plugins-bundle-problem', { code: cell(bundle.error.code) }));
|
|
452
|
+
const tag = declarationTag(deps, bundle.name);
|
|
453
|
+
if (tag !== undefined)
|
|
454
|
+
flags.push(tag);
|
|
455
|
+
const title = cell(localizedPluginText(bundle, bundle.name));
|
|
456
|
+
const version = bundle.version === undefined ? '' : ` ${cell(bundle.version)}`;
|
|
457
|
+
// The row/override counts are detail: `/plugin info <name>` carries them, and
|
|
458
|
+
// the short list drops them (`options.rows: false`).
|
|
459
|
+
const tail = options.rows === false
|
|
460
|
+
? ''
|
|
461
|
+
: ` · ${t('plugins-bundle-rows', { rows: String(bundle.rows.length), overrides: String(bundle.overrides.length) })}`;
|
|
462
|
+
return ` ${title}${version} · ${flags.join(' · ')}${tail}`;
|
|
463
|
+
}
|
|
464
|
+
/** Whether a listed set needs the "no declaration" legend (composition rows never do). */
|
|
465
|
+
function needsDeclarationLegend(deps, bundles) {
|
|
466
|
+
return bundles.some(bundle => !isCompositionOwned(bundle.name) && deps.declaration?.(bundle.name) === undefined);
|
|
467
|
+
}
|
|
468
|
+
/** `/plugin list`: the plugins this profile added, one line each. */
|
|
469
|
+
function listLines(deps, bundles) {
|
|
470
|
+
const extras = extraBundles(bundles);
|
|
471
|
+
if (extras.length === 0)
|
|
472
|
+
return [t('plugins-list-empty')];
|
|
473
|
+
const lines = [t('plugins-list-header', { count: String(extras.length) })];
|
|
474
|
+
for (const bundle of extras)
|
|
475
|
+
lines.push(bundleLine(deps, bundle, { rows: false }));
|
|
476
|
+
// The tag is explained once per report, next to the rows it qualifies: this
|
|
477
|
+
// surface is a transcript, so there is nothing to click open (C-3).
|
|
478
|
+
if (needsDeclarationLegend(deps, extras))
|
|
479
|
+
lines.push(t('plugins-tag-undeclared-hint'));
|
|
480
|
+
lines.push(t('plugins-list-hint'));
|
|
481
|
+
return lines;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Official (installation-supplied) bundles first, then the profile's own. The
|
|
485
|
+
* split is `installed` — the field that answers "do this profile's own
|
|
486
|
+
* dependencies hold the package" — and not `optional`, which is narrower
|
|
487
|
+
* (only the launcher's `OPTIONAL_BUNDLES`): an installation-supplied bundle no
|
|
488
|
+
* shipped template preselects is `installed: false, optional: false` and would
|
|
489
|
+
* land under the profile's own name.
|
|
490
|
+
*/
|
|
491
|
+
function bundleSectionLines(deps, bundles) {
|
|
492
|
+
if (bundles.length === 0)
|
|
493
|
+
return [t('plugins-bundles-empty')];
|
|
494
|
+
const lines = [t('plugins-bundles-header')];
|
|
495
|
+
const group = (label, group) => {
|
|
496
|
+
if (group.length === 0)
|
|
497
|
+
return;
|
|
498
|
+
lines.push(` ${label}:`);
|
|
499
|
+
for (const bundle of group)
|
|
500
|
+
lines.push(bundleLine(deps, bundle));
|
|
501
|
+
};
|
|
502
|
+
group(t('plugins-bundles-official'), bundles.filter(bundle => !bundle.installed));
|
|
503
|
+
group(t('plugins-bundles-installed'), bundles.filter(bundle => bundle.installed));
|
|
504
|
+
if (needsDeclarationLegend(deps, bundles))
|
|
505
|
+
lines.push(t('plugins-tag-undeclared-hint'));
|
|
506
|
+
return lines;
|
|
507
|
+
}
|
|
508
|
+
/** Loader entries the profile cannot address through a patch row. */
|
|
509
|
+
function pluginRowLines(plugins) {
|
|
510
|
+
const unaddressable = plugins.filter(plugin => !('patchId' in plugin));
|
|
511
|
+
if (unaddressable.length === 0)
|
|
512
|
+
return [];
|
|
513
|
+
return [
|
|
514
|
+
t('plugins-rows-header'),
|
|
515
|
+
...unaddressable.map(plugin => {
|
|
516
|
+
const reason = plugin.readOnlyReason === undefined ? '' : cell(plugin.readOnlyReason);
|
|
517
|
+
return ` ${pluginRowTitle(plugin)} · ${reason} · ${cell(plugin.entryId)}`;
|
|
518
|
+
}),
|
|
519
|
+
];
|
|
520
|
+
}
|
|
521
|
+
/** Everything a listed installed bundle carries, in full. */
|
|
522
|
+
function installedBundleLines(deps, bundle) {
|
|
523
|
+
const lines = [t('plugins-info-bundle', { name: cell(bundle.name) }), bundleLine(deps, bundle)];
|
|
524
|
+
if (bundle.rows.length > 0) {
|
|
525
|
+
lines.push(t('plugins-info-rows-label'));
|
|
526
|
+
for (const row of bundle.rows) {
|
|
527
|
+
const entry = row.entryId === undefined ? '' : ` · ${cell(row.entryId)}`;
|
|
528
|
+
lines.push(` ${cell(row.rowId)} → ${cell(row.moduleName)}${entry}`);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (bundle.overrides.length > 0) {
|
|
532
|
+
lines.push(t('plugins-info-overrides-label', { list: cell(bundle.overrides.join(', ')) }));
|
|
533
|
+
}
|
|
534
|
+
if (bundle.error !== undefined) {
|
|
535
|
+
const diagnostic = bundle.error.diagnostic === undefined ? '' : ` — ${cell(bundle.error.diagnostic)}`;
|
|
536
|
+
lines.push(t('plugins-info-problem', { code: cell(bundle.error.code), diagnostic }));
|
|
537
|
+
}
|
|
538
|
+
return lines;
|
|
539
|
+
}
|
|
540
|
+
/** What an installation spec names, before anything installs it. */
|
|
541
|
+
function inspectionLines(spec, inspection) {
|
|
542
|
+
if (inspection.status === 'refused') {
|
|
543
|
+
return [t('plugins-info-inspect-refused', { problem: cell(inspection.problem), reason: cell(inspection.reason) })];
|
|
544
|
+
}
|
|
545
|
+
const lines = [t('plugins-info-inspect-accepted', {
|
|
546
|
+
name: cell(inspection.name ?? spec),
|
|
547
|
+
version: cell(inspection.version ?? ''),
|
|
548
|
+
kind: cell(inspection.kind),
|
|
549
|
+
bundle: inspection.bundle === null ? '?' : String(inspection.bundle),
|
|
550
|
+
registry: urlCell(inspection.registry ?? ''),
|
|
551
|
+
})];
|
|
552
|
+
if (inspection.description !== undefined) {
|
|
553
|
+
lines.push(t('plugins-info-inspect-description', { description: cell(inspection.description) }));
|
|
554
|
+
}
|
|
555
|
+
if (inspection.host !== undefined)
|
|
556
|
+
lines.push(t('plugins-info-inspect-host', { host: urlCell(inspection.host) }));
|
|
557
|
+
return lines;
|
|
558
|
+
}
|
|
559
|
+
/** `/plugin info <spec>`: the installed bundle when one matches, else inspect. */
|
|
560
|
+
async function infoLines(deps, manager, spec) {
|
|
561
|
+
const installed = (await manager.listBundles()).find(bundle => bundle.name === spec);
|
|
562
|
+
if (installed !== undefined)
|
|
563
|
+
return installedBundleLines(deps, installed);
|
|
564
|
+
return inspectionLines(spec, await manager.inspect(spec));
|
|
565
|
+
}
|
|
566
|
+
/** `/plugin registries`: the registries an installation asks, in order. */
|
|
567
|
+
function registriesLines(registries) {
|
|
568
|
+
const none = t('plugins-info-registries-none');
|
|
569
|
+
const asCell = (value) => value === null ? none : urlCell(value);
|
|
570
|
+
// Redact per entry, then cap: the list is a comma-joined string, which no
|
|
571
|
+
// single-URL pass could read.
|
|
572
|
+
const fallbacks = registries.fallbackRegistries.length === 0
|
|
573
|
+
? none
|
|
574
|
+
: cell(registries.fallbackRegistries.map(value => value === null ? 'null' : redactUrl(value)).join(', '));
|
|
575
|
+
return [
|
|
576
|
+
t('plugins-info-registries-header'),
|
|
577
|
+
t('plugins-info-registries-first', { registry: asCell(registries.registry) }),
|
|
578
|
+
t('plugins-info-registries-fallbacks', { list: fallbacks }),
|
|
579
|
+
t('plugins-info-registries-resolved', { registry: asCell(registries.resolved) }),
|
|
580
|
+
];
|
|
581
|
+
}
|
|
582
|
+
/** The service-backed half of the report (empty for a form that needs no service). */
|
|
583
|
+
export async function pluginServiceLines(args, deps, manager) {
|
|
584
|
+
const parsed = parsePluginArgs(args);
|
|
585
|
+
if (parsed.kind === 'check' || parsed.kind === 'unknown')
|
|
586
|
+
return [];
|
|
587
|
+
if (parsed.kind === 'info' && parsed.spec === '')
|
|
588
|
+
return [];
|
|
589
|
+
if (manager === undefined)
|
|
590
|
+
return [t('plugins-service-unavailable')];
|
|
591
|
+
// The service belongs to the host: a refusal or a crash there must not take
|
|
592
|
+
// the diagnostics half down with it. Every call funnels into one line, so a
|
|
593
|
+
// rejected promise still leaves a readable report instead of an unhandled
|
|
594
|
+
// rejection and an empty screen.
|
|
595
|
+
try {
|
|
596
|
+
if (parsed.kind === 'list')
|
|
597
|
+
return listLines(deps, await manager.listBundles());
|
|
598
|
+
if (parsed.kind === 'registries')
|
|
599
|
+
return registriesLines(await manager.registries());
|
|
600
|
+
if (parsed.kind === 'info')
|
|
601
|
+
return await infoLines(deps, manager, parsed.spec);
|
|
602
|
+
const bundles = await manager.listBundles();
|
|
603
|
+
const plugins = await manager.listPlugins();
|
|
604
|
+
return [...bundleSectionLines(deps, bundles), ...pluginRowLines(plugins)];
|
|
605
|
+
}
|
|
606
|
+
catch (error) {
|
|
607
|
+
return [t('plugins-service-error', { err: cell(error instanceof Error ? error.message : String(error)) })];
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
/** `/plugin`: the diagnostics half plus the profile's own bundles and rows. */
|
|
611
|
+
export async function pluginReport(args, deps, manager) {
|
|
612
|
+
return [...pluginsInfoLines(args, deps), ...await pluginServiceLines(args, deps, manager)];
|
|
613
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signals and exit in this package's entry go through the TUI's exit funnel
|
|
3
|
+
* (./plugin.ts) when it is up, else the entry disposes the root, bounded. A
|
|
4
|
+
* termination signal ends the process by that signal, not `runProfile`'s 0 /
|
|
5
|
+
* 130 (the launcher reads non-zero as a crash, 0 hides it from `timeout`,
|
|
6
|
+
* tmux and service managers); a second signal forces the exit at once.
|
|
7
|
+
*/
|
|
8
|
+
export type TerminationSignal = 'SIGTERM' | 'SIGHUP' | 'SIGINT';
|
|
9
|
+
export declare const TERMINATION_SIGNALS: readonly TerminationSignal[];
|
|
10
|
+
export type ExitRequest = {
|
|
11
|
+
readonly kind: 'signal';
|
|
12
|
+
readonly signal: TerminationSignal;
|
|
13
|
+
}
|
|
14
|
+
/** `ctx.appExit(code)` (dsh-cmdline): a plugin asked the app to exit. */
|
|
15
|
+
| {
|
|
16
|
+
readonly kind: 'code';
|
|
17
|
+
readonly code: number;
|
|
18
|
+
};
|
|
19
|
+
/** The owner's answer. `exiting` / `pending` (already in flight) arm the backstop;
|
|
20
|
+
* `supervising` (a replacement that may run for hours) does not; `refused`
|
|
21
|
+
* makes the entry dispose the root itself. */
|
|
22
|
+
export type ExitRequestAnswer = 'exiting' | 'pending' | 'supervising' | 'refused';
|
|
23
|
+
export interface ProcessExitSeam {
|
|
24
|
+
request?: (request: ExitRequest) => ExitRequestAnswer;
|
|
25
|
+
}
|
|
26
|
+
/** dsh `profile-boot` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.0-rc.2): the dispose bound. */
|
|
27
|
+
export declare const PROCESS_SHUTDOWN_TIMEOUT_MS = 5000;
|
|
28
|
+
/**
|
|
29
|
+
* End the process by `signal`. Only the entry's own listeners come off, so the
|
|
30
|
+
* renderer's signal-exit hook still restores the terminal; a foreign listener
|
|
31
|
+
* would keep the process alive, so after a short grace every listener goes.
|
|
32
|
+
*/
|
|
33
|
+
export declare function dieBySignal(signal: TerminationSignal): void;
|
|
34
|
+
export interface EntrySignalOptions {
|
|
35
|
+
readonly seam: ProcessExitSeam;
|
|
36
|
+
/** Dispose the root without the funnel (no owner, or it refused). */
|
|
37
|
+
readonly disposeRoot: () => Promise<unknown>;
|
|
38
|
+
/** restart.log / debug breadcrumb; must not write to the terminal. */
|
|
39
|
+
readonly log?: (event: string, data?: Record<string, unknown>) => void;
|
|
40
|
+
}
|
|
41
|
+
/** Once per process. */
|
|
42
|
+
export declare function installEntrySignals(options: EntrySignalOptions): void;
|
|
43
|
+
//# sourceMappingURL=process-exit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-exit.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/process-exit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAC/D,eAAO,MAAM,mBAAmB,EAAE,SAAS,iBAAiB,EAAoC,CAAA;AAEhG,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;CAAE;AACjE,yEAAyE;GACvE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpD;;+CAE+C;AAC/C,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;AAEjF,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,iBAAiB,CAAA;CACtD;AAED,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,OAAO,CAAA;AAQ/C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAQ3D;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;IAC9B,qEAAqE;IACrE,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IAC5C,sEAAsE;IACtE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;CACvE;AAED,wBAAwB;AACxB,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CA4BrE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signals and exit in this package's entry go through the TUI's exit funnel
|
|
3
|
+
* (./plugin.ts) when it is up, else the entry disposes the root, bounded. A
|
|
4
|
+
* termination signal ends the process by that signal, not `runProfile`'s 0 /
|
|
5
|
+
* 130 (the launcher reads non-zero as a crash, 0 hides it from `timeout`,
|
|
6
|
+
* tmux and service managers); a second signal forces the exit at once.
|
|
7
|
+
*/
|
|
8
|
+
export const TERMINATION_SIGNALS = ['SIGTERM', 'SIGHUP', 'SIGINT'];
|
|
9
|
+
/** dsh `profile-boot` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.0-rc.2): the dispose bound. */
|
|
10
|
+
export const PROCESS_SHUTDOWN_TIMEOUT_MS = 5000;
|
|
11
|
+
/** Last-resort bound for a funnel exit: outlasts its terminal cleanup plus the dispose bound. */
|
|
12
|
+
const BACKSTOP_MS = PROCESS_SHUTDOWN_TIMEOUT_MS + 2000;
|
|
13
|
+
/** How long a re-raised signal may be held by foreign listeners before they go. */
|
|
14
|
+
const RERAISE_GRACE_MS = 500;
|
|
15
|
+
const installed = new Map();
|
|
16
|
+
/**
|
|
17
|
+
* End the process by `signal`. Only the entry's own listeners come off, so the
|
|
18
|
+
* renderer's signal-exit hook still restores the terminal; a foreign listener
|
|
19
|
+
* would keep the process alive, so after a short grace every listener goes.
|
|
20
|
+
*/
|
|
21
|
+
export function dieBySignal(signal) {
|
|
22
|
+
for (const [name, listener] of installed)
|
|
23
|
+
process.removeListener(name, listener);
|
|
24
|
+
installed.clear();
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
process.removeAllListeners(signal);
|
|
27
|
+
process.kill(process.pid, signal);
|
|
28
|
+
}, RERAISE_GRACE_MS);
|
|
29
|
+
process.kill(process.pid, signal);
|
|
30
|
+
}
|
|
31
|
+
/** Once per process. */
|
|
32
|
+
export function installEntrySignals(options) {
|
|
33
|
+
let first;
|
|
34
|
+
const onSignal = (signal) => {
|
|
35
|
+
if (first !== undefined) {
|
|
36
|
+
options.log?.('signal: second signal, forcing the exit', { first, signal });
|
|
37
|
+
dieBySignal(signal);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
first = signal;
|
|
41
|
+
const answer = options.seam.request?.({ kind: 'signal', signal }) ?? 'refused';
|
|
42
|
+
options.log?.('signal: received', { signal, answer });
|
|
43
|
+
if (answer === 'supervising') {
|
|
44
|
+
// The replacement decides; a second signal still forces this process.
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
options.log?.('signal: backstop reached, forcing the exit', { signal });
|
|
49
|
+
dieBySignal(signal);
|
|
50
|
+
}, answer === 'refused' ? PROCESS_SHUTDOWN_TIMEOUT_MS : BACKSTOP_MS);
|
|
51
|
+
if (answer === 'refused') {
|
|
52
|
+
void options.disposeRoot().then(() => { dieBySignal(signal); }, () => { dieBySignal(signal); });
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
for (const signal of TERMINATION_SIGNALS) {
|
|
56
|
+
const listener = () => { onSignal(signal); };
|
|
57
|
+
installed.set(signal, listener);
|
|
58
|
+
process.on(signal, listener);
|
|
59
|
+
}
|
|
60
|
+
}
|