@deepseek-harness-tui/dsh-tui 0.16.1 → 0.18.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 +213 -34
- package/assets/plugin-icon.svg +13 -0
- package/assets/windows-installer.cs +308 -0
- package/assets/windows-installer.ps1 +17 -0
- package/bin/dsh-tui.js +64 -5
- package/cli/adapters/dsh/index.mjs +111 -0
- package/cli/adapters/dsh/locate.mjs +73 -0
- package/cli/adapters/dsh/management-plugin.mjs +111 -0
- package/cli/args.mjs +154 -0
- package/cli/contracts.d.ts +48 -0
- package/cli/engine.mjs +92 -0
- package/cli/entry.mjs +48 -0
- package/cli/process.mjs +118 -0
- package/cli/protocol.mjs +23 -0
- package/cli/schema-v1.json +33 -0
- package/cordis.patch.yml +3 -1
- package/cordis.yml +3 -1
- package/guide/dsh-tui-guide/SKILL.md +1 -0
- package/guide/dsh-tui-guide/cli.en.md +114 -0
- package/guide/dsh-tui-guide/cli.md +114 -0
- package/guide/dsh-tui-guide/configuration.en.md +7 -5
- package/guide/dsh-tui-guide/configuration.md +7 -5
- package/guide/dsh-tui-guide/getting-started.en.md +33 -3
- package/guide/dsh-tui-guide/getting-started.md +23 -2
- package/guide/dsh-tui-guide/interaction.en.md +50 -17
- package/guide/dsh-tui-guide/interaction.md +35 -13
- package/guide/dsh-tui-guide/plugins.en.md +63 -11
- package/guide/dsh-tui-guide/plugins.md +41 -7
- package/guide/dsh-tui-guide/user-guide.en.md +55 -34
- package/guide/dsh-tui-guide/user-guide.md +45 -28
- package/lib/settings.json +85 -42
- package/lib/types/adapter/channel/plugins.d.ts.map +1 -1
- package/lib/types/adapter/channel/plugins.js +8 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +2 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +4 -0
- package/lib/types/adapter/ports/channel-display.d.ts +10 -0
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-session.d.ts +2 -0
- package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +22 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +11 -1
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +7 -0
- package/lib/types/adapter/ports/channel.d.ts.map +1 -1
- package/lib/types/adapter/standard/grants.d.ts +60 -0
- package/lib/types/adapter/standard/grants.d.ts.map +1 -1
- package/lib/types/adapter/standard/grants.js +74 -0
- package/lib/types/agent/capabilities.d.ts +2 -0
- package/lib/types/agent/capabilities.d.ts.map +1 -1
- package/lib/types/agent/events.d.ts +15 -1
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/api.d.ts +2 -2
- package/lib/types/api.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/events.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/events.js +2 -1
- package/lib/types/backends/codex/auth/status.js +1 -1
- package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
- package/lib/types/backends/codex/session/controls.js +6 -5
- package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
- package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/events.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/events.js +3 -1
- package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
- package/lib/types/backends/shared/channel-tokens.js +9 -8
- package/lib/types/channel/history-restore.d.ts.map +1 -1
- package/lib/types/channel/history-restore.js +2 -0
- package/lib/types/channel/interaction.d.ts.map +1 -1
- package/lib/types/channel/interaction.js +1 -0
- package/lib/types/channel/projection.d.ts +1 -1
- package/lib/types/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +19 -4
- package/lib/types/channel/questions.d.ts +2 -0
- package/lib/types/channel/questions.d.ts.map +1 -1
- package/lib/types/channel/sanitize.d.ts +14 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +55 -0
- package/lib/types/channel/working-directory.d.ts +9 -0
- package/lib/types/channel/working-directory.d.ts.map +1 -0
- package/lib/types/channel/working-directory.js +7 -0
- package/lib/types/commands.d.ts +8 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +14 -5
- package/lib/types/components/ChatTitle.d.ts +7 -0
- package/lib/types/components/ChatTitle.d.ts.map +1 -0
- package/lib/types/components/ChatTitle.js +15 -0
- package/lib/types/components/CodeBlockFrame.d.ts.map +1 -1
- package/lib/types/components/CodeBlockFrame.js +10 -5
- package/lib/types/components/CompactionStatusRow.d.ts.map +1 -1
- package/lib/types/components/CompactionStatusRow.js +24 -3
- package/lib/types/components/GoalTodoPanel.d.ts +73 -6
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +165 -17
- package/lib/types/components/Markdown.d.ts +9 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +5 -4
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +20 -14
- package/lib/types/components/PluginGrantList.d.ts +45 -0
- package/lib/types/components/PluginGrantList.d.ts.map +1 -0
- package/lib/types/components/PluginGrantList.js +126 -0
- package/lib/types/components/PluginInstallPane.d.ts.map +1 -1
- package/lib/types/components/PluginInstallPane.js +35 -6
- package/lib/types/components/PluginManagePane.d.ts.map +1 -1
- package/lib/types/components/PluginManagePane.js +65 -8
- package/lib/types/components/PromptInput.d.ts +13 -5
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +190 -108
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +232 -22
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +10 -0
- package/lib/types/components/SubagentDetailScene.d.ts +3 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +17 -1
- package/lib/types/components/Whale.d.ts.map +1 -1
- package/lib/types/components/Whale.js +8 -5
- package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +93 -11
- package/lib/types/components/bigfont.d.ts.map +1 -1
- package/lib/types/components/bigfont.js +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +24 -11
- package/lib/types/components/onboardingModel.d.ts +2 -2
- package/lib/types/components/onboardingModel.js +3 -3
- package/lib/types/components/onboardingProviderPlan.d.ts +110 -0
- package/lib/types/components/onboardingProviderPlan.d.ts.map +1 -0
- package/lib/types/components/onboardingProviderPlan.js +78 -0
- package/lib/types/components/previewRows.d.ts +19 -0
- package/lib/types/components/previewRows.d.ts.map +1 -0
- package/lib/types/components/previewRows.js +46 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +75 -10
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -9
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
- package/lib/types/components/sessions/ForeignSessionRow.js +6 -10
- package/lib/types/components/sessions/SessionListRow.d.ts +4 -9
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +18 -10
- package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/InfoPanel.js +4 -3
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelLayout.js +5 -5
- package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/WorkspacePanel.js +19 -7
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +7 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +16 -0
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +8 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +7 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +8 -1
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts +30 -0
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.js +94 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +36 -18
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -1
- package/lib/types/components/sidePanel/panelMarkdown.d.ts +32 -0
- package/lib/types/components/sidePanel/panelMarkdown.d.ts.map +1 -0
- package/lib/types/components/sidePanel/panelMarkdown.js +45 -0
- package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/pluginPanelAdapter.js +6 -1
- package/lib/types/components/sidePanel/subagentFailureRead.d.ts +21 -0
- package/lib/types/components/sidePanel/subagentFailureRead.d.ts.map +1 -0
- package/lib/types/components/sidePanel/subagentFailureRead.js +66 -0
- package/lib/types/components/sidePanel/types.d.ts +2 -0
- package/lib/types/components/sidePanel/types.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +39 -7
- package/lib/types/components/trajectory/MiniWake.d.ts +2 -2
- package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
- package/lib/types/components/trajectory/MiniWake.js +7 -3
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +4 -7
- package/lib/types/dsh-adapter/backend/session.d.ts +7 -1
- package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/session.js +62 -6
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +18 -4
- package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +3 -1
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +18 -1
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +6 -8
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +11 -1
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +121 -113
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-mentions.js +38 -17
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +9 -5
- package/lib/types/dsh-adapter/channel/core/actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.js +23 -2
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +10 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +48 -3
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +5 -2
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +7 -0
- package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/files.js +2 -1
- package/lib/types/dsh-adapter/channel/core/host.d.ts +14 -10
- package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/host.js +192 -13
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +32 -3
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +31 -5
- package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +34 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +5 -2
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +31 -4
- package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mentions.js +21 -7
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +7 -1
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-selection.js +6 -4
- package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/paths.js +11 -9
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +1 -0
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +6 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +15 -2
- package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +7 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +56 -36
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +3 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +3 -1
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +10 -3
- package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +2 -2
- package/lib/types/dsh-adapter/channel/types.d.ts +13 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/liveSession.d.ts +3 -3
- package/lib/types/dsh-adapter/compat/liveSession.js +3 -3
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +17 -1
- package/lib/types/dsh-adapter/contract.d.ts +7 -5
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +10 -5
- package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +1 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts +6 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
- package/lib/types/dsh-adapter/experimental-bundles.d.ts +29 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
- package/lib/types/dsh-adapter/experimental-bundles.js +15 -0
- package/lib/types/dsh-adapter/grant-file.d.ts +70 -0
- package/lib/types/dsh-adapter/grant-file.d.ts.map +1 -0
- package/lib/types/dsh-adapter/grant-file.js +178 -0
- package/lib/types/dsh-adapter/host-access.d.ts +4 -0
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +54 -4
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.js +2 -2
- package/lib/types/dsh-adapter/host-dsh.js +3 -3
- package/lib/types/dsh-adapter/index.d.ts +8 -4
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +17 -12
- package/lib/types/dsh-adapter/panels.d.ts +28 -8
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/panels.js +11 -56
- package/lib/types/dsh-adapter/plugin-declaration.d.ts +28 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-declaration.js +43 -1
- package/lib/types/dsh-adapter/plugin-install.d.ts +28 -1
- package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-install.js +160 -13
- package/lib/types/dsh-adapter/plugin-manage.d.ts +53 -10
- package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-manage.js +240 -51
- package/lib/types/dsh-adapter/plugin.d.ts +81 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +378 -84
- package/lib/types/dsh-adapter/plugins-info.d.ts +6 -7
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +99 -31
- package/lib/types/dsh-adapter/presets.d.ts +19 -6
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +69 -12
- package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
- package/lib/types/dsh-adapter/process-exit.js +1 -1
- package/lib/types/dsh-adapter/providerWizard.d.ts +2 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +11 -5
- package/lib/types/dsh-adapter/row-attachment.d.ts +30 -0
- package/lib/types/dsh-adapter/row-attachment.d.ts.map +1 -0
- package/lib/types/dsh-adapter/row-attachment.js +29 -0
- package/lib/types/dsh-adapter/session-tools.d.ts +34 -0
- package/lib/types/dsh-adapter/session-tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-tools.js +39 -0
- package/lib/types/dsh-adapter/settings-sections.d.ts +18 -1
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +73 -0
- package/lib/types/dsh-adapter/status.d.ts +88 -1
- package/lib/types/dsh-adapter/status.d.ts.map +1 -1
- package/lib/types/dsh-adapter/status.js +318 -3
- package/lib/types/dsh-adapter/team-mode.d.ts +42 -33
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-mode.js +76 -112
- package/lib/types/dsh-adapter/worktree-tool.d.ts +27 -0
- package/lib/types/dsh-adapter/worktree-tool.d.ts.map +1 -0
- package/lib/types/dsh-adapter/worktree-tool.js +87 -0
- package/lib/types/extensions.d.ts +1 -1
- package/lib/types/extensions.d.ts.map +1 -1
- package/lib/types/force-production-react.js +3 -3
- package/lib/types/heldInputs.d.ts +36 -0
- package/lib/types/heldInputs.d.ts.map +1 -0
- package/lib/types/heldInputs.js +173 -0
- package/lib/types/i18n.d.ts +543 -73
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +265 -46
- package/lib/types/ink/colorize.d.ts +7 -1
- package/lib/types/ink/colorize.d.ts.map +1 -1
- package/lib/types/ink/colorize.js +29 -8
- package/lib/types/ink/components/App.d.ts +2 -1
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +10 -3
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +1 -0
- package/lib/types/ink/dom.d.ts +1 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-program-status.d.ts +78 -0
- package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-program-status.js +96 -0
- package/lib/types/ink/ink.d.ts +13 -4
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +119 -25
- package/lib/types/ink/output.d.ts +17 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +85 -2
- package/lib/types/ink/parse-keypress.d.ts +1 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +5 -4
- package/lib/types/ink/render-node-to-output.d.ts +2 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +79 -10
- package/lib/types/ink/root.d.ts +8 -0
- package/lib/types/ink/root.d.ts.map +1 -1
- package/lib/types/ink/root.js +12 -3
- package/lib/types/ink/screen.d.ts +11 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +44 -0
- package/lib/types/ink/selection.d.ts +7 -2
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +187 -44
- package/lib/types/ink/shutdown-input.d.ts +15 -0
- package/lib/types/ink/shutdown-input.d.ts.map +1 -0
- package/lib/types/ink/shutdown-input.js +28 -0
- package/lib/types/ink/sixel-cursor-heal.d.ts +21 -0
- package/lib/types/ink/sixel-cursor-heal.d.ts.map +1 -0
- package/lib/types/ink/sixel-cursor-heal.js +62 -0
- package/lib/types/ink/sixel-graphics.d.ts +6 -0
- package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
- package/lib/types/ink/sixel-graphics.js +18 -0
- package/lib/types/ink/styles.d.ts +8 -1
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification-windows.d.ts +195 -0
- package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -0
- package/lib/types/ink/terminal-notification-windows.js +433 -0
- package/lib/types/ink/terminal-notification.d.ts +3 -1
- package/lib/types/ink/terminal-notification.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification.js +4 -1
- package/lib/types/ink/terminal-querier.d.ts +9 -1
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +32 -1
- package/lib/types/ink/terminal.d.ts +23 -2
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +32 -2
- package/lib/types/ink/termio/osc.d.ts +2 -1
- package/lib/types/ink/termio/osc.d.ts.map +1 -1
- package/lib/types/ink/termio/osc.js +37 -8
- package/lib/types/ink/termio/osc7501.d.ts +102 -0
- package/lib/types/ink/termio/osc7501.d.ts.map +1 -0
- package/lib/types/ink/termio/osc7501.js +229 -0
- package/lib/types/ink/termio/tokenize.js +5 -7
- package/lib/types/onboardingDraft.d.ts +143 -0
- package/lib/types/onboardingDraft.d.ts.map +1 -0
- package/lib/types/onboardingDraft.js +71 -0
- package/lib/types/panels.d.ts +1 -1
- package/lib/types/panels.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.d.ts +3 -1
- package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.js +5 -1
- package/lib/types/screens/Chat.d.ts +6 -6
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +394 -141
- package/lib/types/screens/Launchpad.d.ts +8 -2
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +32 -12
- package/lib/types/screens/Onboarding.d.ts +22 -3
- package/lib/types/screens/Onboarding.d.ts.map +1 -1
- package/lib/types/screens/Onboarding.js +606 -36
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +31 -21
- package/lib/types/screens/Settings.d.ts +5 -1
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +528 -51
- package/lib/types/screens/StatusLine.d.ts +9 -3
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +91 -15
- package/lib/types/screens/StatusMetrics.d.ts +2 -11
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +20 -14
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +1 -1
- 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 +13 -21
- package/lib/types/sessionMounts.d.ts +14 -0
- package/lib/types/sessionMounts.d.ts.map +1 -1
- package/lib/types/sessionMounts.js +20 -9
- package/lib/types/sessions/format.d.ts +39 -0
- package/lib/types/sessions/format.d.ts.map +1 -1
- package/lib/types/sessions/format.js +83 -0
- package/lib/types/sessions/resumeFailure.d.ts +4 -0
- package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
- package/lib/types/sessions/resumeFailure.js +12 -4
- package/lib/types/sessions/workspaceCounts.d.ts +6 -0
- package/lib/types/sessions/workspaceCounts.d.ts.map +1 -0
- package/lib/types/sessions/workspaceCounts.js +24 -0
- package/lib/types/settings/definitions.d.ts +24 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +40 -15
- package/lib/types/tips.js +2 -2
- package/lib/types/tuiDisplayPrefs.d.ts +113 -5
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +276 -14
- package/lib/types/update.d.ts +15 -14
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +163 -115
- package/lib/types/updateProcess.d.ts +28 -0
- package/lib/types/updateProcess.d.ts.map +1 -0
- package/lib/types/updateProcess.js +135 -0
- package/lib/types/utils/inputWordBoundary.d.ts +5 -0
- package/lib/types/utils/inputWordBoundary.d.ts.map +1 -0
- package/lib/types/utils/inputWordBoundary.js +18 -0
- package/lib/types/utils/keymap.d.ts +1 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +6 -1
- package/lib/types/utils/paths.d.ts +15 -0
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +25 -0
- package/lib/types/windowsInstaller.d.ts +4 -0
- package/lib/types/windowsInstaller.d.ts.map +1 -0
- package/lib/types/windowsInstaller.js +237 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +130 -111
- package/presets/liangshen/custom-bash.mjs +13 -1
- package/presets/liangshen/instruction-hint.mjs +4 -1
- package/presets/liangshen/skill-search.mjs +14 -2
- package/presets/winbash.mjs +16 -4
- package/tui-profile/feed/README.md +17 -8
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { attachInteraction } from '../../../channel/interaction.js';
|
|
2
2
|
import { createChannelProjection } from '../../../channel/projection.js';
|
|
3
|
+
import { t } from '../../../i18n.js';
|
|
3
4
|
import { logForDebugging } from '../../../utils/debug.js';
|
|
4
5
|
import { createTaskCompletion } from '../task-completion.js';
|
|
5
6
|
/**
|
|
@@ -20,11 +21,39 @@ export function createSessionBatchRouter(deps) {
|
|
|
20
21
|
deps.projector.settleStreaming();
|
|
21
22
|
deps.projector.updateSpinnerMode();
|
|
22
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Hold previews no backend will run any more (#1651): the backend dropped
|
|
26
|
+
* them on its own (`ids`), or the session ended (`'all'`), possibly after
|
|
27
|
+
* its drop notices could no longer arrive. They join the dock, which never
|
|
28
|
+
* re-sends by itself, and stay across the switch to the next session.
|
|
29
|
+
*/
|
|
30
|
+
const holdOrphans = (ids) => {
|
|
31
|
+
let held = 0;
|
|
32
|
+
let changed = false;
|
|
33
|
+
deps.state.pending = deps.state.pending.map(item => {
|
|
34
|
+
if (item.orphaned === true || (ids !== 'all' && !ids.has(item.id)))
|
|
35
|
+
return item;
|
|
36
|
+
changed = true;
|
|
37
|
+
if (item.docked !== true)
|
|
38
|
+
held += 1;
|
|
39
|
+
return { ...item, docked: true, orphaned: true };
|
|
40
|
+
});
|
|
41
|
+
if (!changed)
|
|
42
|
+
return;
|
|
43
|
+
if (held > 0)
|
|
44
|
+
deps.notify?.(t('input-orphans-held', { count: held }), { color: 'warning', timeoutMs: 8000 });
|
|
45
|
+
deps.state.emit();
|
|
46
|
+
};
|
|
23
47
|
/** `session.status` as the backend reports it. */
|
|
24
48
|
const applyStatus = (status) => {
|
|
25
49
|
if (status === 'disposed') {
|
|
26
50
|
deps.state.status = 'disposed';
|
|
27
51
|
reconcileRetiredProjection('disposed');
|
|
52
|
+
// An automatic compaction's `compaction.end` will not come any more
|
|
53
|
+
// (#1651). A manual one is the transaction's: it retires its own row.
|
|
54
|
+
if (deps.state.compaction !== undefined && deps.ownsCompactionProgress?.() !== true)
|
|
55
|
+
deps.state.compaction = undefined;
|
|
56
|
+
holdOrphans('all');
|
|
28
57
|
deps.state.emit();
|
|
29
58
|
return;
|
|
30
59
|
}
|
|
@@ -42,8 +71,10 @@ export function createSessionBatchRouter(deps) {
|
|
|
42
71
|
* delete the context before it is ever injected.
|
|
43
72
|
*/
|
|
44
73
|
const applyPending = (event) => {
|
|
45
|
-
for (const messageId of event.discarded ?? [])
|
|
74
|
+
for (const messageId of [...event.discarded ?? [], ...event.dropped ?? []])
|
|
46
75
|
deps.retireAttachment?.(messageId);
|
|
76
|
+
if (event.dropped !== undefined && event.dropped.length > 0)
|
|
77
|
+
holdOrphans(new Set(event.dropped));
|
|
47
78
|
// A discard of a docked preview only drops the backend copy. The dock
|
|
48
79
|
// (where an interrupt parks inputs on the channel side) owns the row, so
|
|
49
80
|
// it stays until sent (`deliverDocked`) or retracted. A claim always
|
|
@@ -59,6 +90,7 @@ export function createSessionBatchRouter(deps) {
|
|
|
59
90
|
/** Monotonic count of live turns that started on a bound session (`/new`
|
|
60
91
|
* compares it across its open: a whole turn may come and go meanwhile). */
|
|
61
92
|
let turnStarts = 0;
|
|
93
|
+
let turnEnds = 0;
|
|
62
94
|
const route = (batch, meta, current) => {
|
|
63
95
|
// The generation fence covers the whole batch, whatever it carries. A
|
|
64
96
|
// callback retained past a rebind (an in-flight dispatch, a compaction
|
|
@@ -74,6 +106,10 @@ export function createSessionBatchRouter(deps) {
|
|
|
74
106
|
if (!meta.replay)
|
|
75
107
|
turnStarts += 1;
|
|
76
108
|
break;
|
|
109
|
+
case 'turn.end':
|
|
110
|
+
if (!meta.replay)
|
|
111
|
+
turnEnds += 1;
|
|
112
|
+
break;
|
|
77
113
|
case 'session.status':
|
|
78
114
|
applyStatus(event.status);
|
|
79
115
|
break;
|
|
@@ -129,7 +165,7 @@ export function createSessionBatchRouter(deps) {
|
|
|
129
165
|
deps.state.emit();
|
|
130
166
|
deps.taskCompletion?.(events, meta, current);
|
|
131
167
|
};
|
|
132
|
-
return { route, reconcileRetiredProjection, turnStarts: () => turnStarts };
|
|
168
|
+
return { route, reconcileRetiredProjection, turnStarts: () => turnStarts, turnEnds: () => turnEnds };
|
|
133
169
|
}
|
|
134
170
|
/**
|
|
135
171
|
* The bind that follows the bound session: shared by the channel feed below
|
|
@@ -151,6 +187,7 @@ export function createSessionBinder(deps) {
|
|
|
151
187
|
try {
|
|
152
188
|
state.agentBindingGeneration = binding.bind();
|
|
153
189
|
deps.resetTrajectory?.();
|
|
190
|
+
deps.rebound?.();
|
|
154
191
|
hooks.onGeneration?.();
|
|
155
192
|
inputConvergence.cancelInFlight = false;
|
|
156
193
|
inputConvergence.interruptSeq += 1;
|
|
@@ -212,6 +249,7 @@ export function createBindingFeed(ctx, deps) {
|
|
|
212
249
|
projector,
|
|
213
250
|
inputConvergence,
|
|
214
251
|
retireAttachment: deps.retireAttachment,
|
|
252
|
+
notify: deps.projection.notify,
|
|
215
253
|
ownsCompactionProgress: () => deps.hooks().ownsCompactionProgress?.() ?? false,
|
|
216
254
|
...(deps.onReset === undefined ? {} : { onReset: deps.onReset }),
|
|
217
255
|
warn: message => ctx.logger.warn(message),
|
|
@@ -265,6 +303,7 @@ export function createBindingFeed(ctx, deps) {
|
|
|
265
303
|
route: router.route,
|
|
266
304
|
hooks: deps.hooks,
|
|
267
305
|
...(deps.resetTrajectory === undefined ? {} : { resetTrajectory: deps.resetTrajectory }),
|
|
306
|
+
...(deps.rebound === undefined ? {} : { rebound: deps.rebound }),
|
|
268
307
|
interaction: deps.options.interaction,
|
|
269
308
|
facts: {
|
|
270
309
|
observe: controls.observe,
|
|
@@ -277,10 +316,16 @@ export function createBindingFeed(ctx, deps) {
|
|
|
277
316
|
},
|
|
278
317
|
},
|
|
279
318
|
});
|
|
319
|
+
let endsBeforeBind = 0;
|
|
280
320
|
return {
|
|
281
321
|
projector,
|
|
282
322
|
router,
|
|
283
|
-
|
|
323
|
+
liveTurnEnds: () => router.turnEnds() - endsBeforeBind,
|
|
324
|
+
bind(seed) {
|
|
325
|
+
// Capture before subscribe can synchronously deliver an entire live turn.
|
|
326
|
+
endsBeforeBind = router.turnEnds();
|
|
327
|
+
binder.bind(seed);
|
|
328
|
+
},
|
|
284
329
|
resetProjection,
|
|
285
330
|
/** Install the backend's job-registry feed and pricing policy (before start). */
|
|
286
331
|
configureProjection(update) {
|
|
@@ -115,7 +115,7 @@ export declare function createCoreChannel(ctx: ChannelHost, initialSession: Agen
|
|
|
115
115
|
text: string;
|
|
116
116
|
images?: readonly import("../types.js").ComposerImageRef[];
|
|
117
117
|
}, placement: import("../types.js").PendingMessage["placement"]) => void;
|
|
118
|
-
untrackPending: (messageId: string) => void;
|
|
118
|
+
untrackPending: (messageId: string, hold?: boolean) => void;
|
|
119
119
|
};
|
|
120
120
|
composer: import("../composer-images.js").ComposerImages;
|
|
121
121
|
input: {
|
|
@@ -156,8 +156,10 @@ export declare function createCoreChannel(ctx: ChannelHost, initialSession: Agen
|
|
|
156
156
|
route: (batch: readonly AgentEvent[], meta: import("../../../agent/events.js").AgentEventMeta, current: () => boolean) => void;
|
|
157
157
|
reconcileRetiredProjection: (status: "idle" | "disposed") => void;
|
|
158
158
|
turnStarts: () => number;
|
|
159
|
+
turnEnds: () => number;
|
|
159
160
|
};
|
|
160
|
-
|
|
161
|
+
liveTurnEnds: () => number;
|
|
162
|
+
bind(seed?: readonly AgentEvent[]): void;
|
|
161
163
|
resetProjection: () => void;
|
|
162
164
|
configureProjection(update: Partial<Pick<import("../../../channel/projection.js").ChannelProjectionDeps, "jobs" | "pricingWindow">>): void;
|
|
163
165
|
};
|
|
@@ -172,6 +174,7 @@ export declare function createCoreChannel(ctx: ChannelHost, initialSession: Agen
|
|
|
172
174
|
clear(): void;
|
|
173
175
|
pushLocal(title: string, lines: readonly string[], options?: {
|
|
174
176
|
readonly lineLimit?: number;
|
|
177
|
+
readonly preserveWhitespace?: boolean;
|
|
175
178
|
}): void;
|
|
176
179
|
setActivityFrames: (name: string) => boolean;
|
|
177
180
|
runLocalCommand(command: string, includeInContext: boolean): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/compose.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AAGvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAW7D,OAAO,EAA4D,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAQ9H,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAG/E,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAIrE,OAAO,EAA8C,KAAK,oBAAoB,EAAuB,MAAM,aAAa,CAAA;AACxH,OAAO,KAAK,EAAE,YAAY,EAA0B,MAAM,aAAa,CAAA;AAEvE,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAA0C,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC3F,OAAO,EAAqE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAA;AAO5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAkE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAYrJ;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;+EAC2E;IAC3E,eAAe,CAAC,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAAA;IAC/C;4EACwE;IACxE,aAAa,CAAC,IAAI,OAAO,CAAA;IACzB;;;4CAGwC;IACxC,SAAS,CAAC,IAAI,MAAM,CAAA;IACpB;;sDAEkD;IAClD,QAAQ,CAAC,YAAY,CA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;EA4BxB"}
|
|
@@ -234,6 +234,7 @@ export function createCoreChannel(ctx, initialSession, options, owner) {
|
|
|
234
234
|
generation: () => state.agentBindingGeneration,
|
|
235
235
|
sessionId: () => state.agentId,
|
|
236
236
|
localImages,
|
|
237
|
+
retainedStageIds: () => new Set(state.pending.filter(item => item.orphaned === true).flatMap(item => item.images.map(image => image.stageId))),
|
|
237
238
|
});
|
|
238
239
|
const files = createCoreFiles(ctx, {
|
|
239
240
|
owner,
|
|
@@ -419,6 +420,7 @@ export function createCoreChannel(ctx, initialSession, options, owner) {
|
|
|
419
420
|
const ref = binding.session.ref;
|
|
420
421
|
return { backendId: ref.backendId, sessionId: ref.sessionId };
|
|
421
422
|
},
|
|
423
|
+
get liveTurnEnds() { return feed.liveTurnEnds(); },
|
|
422
424
|
costReport: undefined,
|
|
423
425
|
rateLimit: undefined,
|
|
424
426
|
get olderHistory() {
|
|
@@ -746,6 +748,10 @@ export function createCoreChannel(ctx, initialSession, options, owner) {
|
|
|
746
748
|
},
|
|
747
749
|
resetTrajectory: () => { if (trajectoryOwned())
|
|
748
750
|
agentTrajectory.reset(); },
|
|
751
|
+
// The image store follows the swap now, while the held rows that keep
|
|
752
|
+
// their images are still listed (#1651): delivering or editing one
|
|
753
|
+
// later must not be what notices the swap.
|
|
754
|
+
rebound: () => { composer.stagedImageGeneration(); },
|
|
749
755
|
retireAttachment: inputDelivery.retireAttachment,
|
|
750
756
|
controls,
|
|
751
757
|
hooks: () => extension.bind ?? {},
|
|
@@ -780,6 +786,7 @@ export function createCoreChannel(ctx, initialSession, options, owner) {
|
|
|
780
786
|
state.costReport = undefined;
|
|
781
787
|
state.lastUsage = undefined;
|
|
782
788
|
state.turnUsage = undefined;
|
|
789
|
+
state.turnOutcome = undefined;
|
|
783
790
|
state.contextSegments = { system: 0, prompt: 0, assistant: 0, thinking: 0, tools: 0 };
|
|
784
791
|
state.activeToolCount = 0;
|
|
785
792
|
state.responseChars = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/files.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAKnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/files.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAKnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,IAAI,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACnG,KAAK,EAAE;QACL,cAAc,IAAI,IAAI,CAAA;QACtB,UAAU,IAAI,SAAS,qBAAqB,EAAE,CAAA;QAC9C,iBAAiB,IAAI,IAAI,CAAA;QACzB,aAAa,IAAI,SAAS;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,OAAO,CAAA;SAAE,EAAE,CAAA;QACpG,gBAAgB,IAAI,IAAI,CAAA;KACzB,CAAA;IACD,kFAAkF;IAClF,MAAM,CAAC,EAAE;QACP,eAAe,IAAI,IAAI,CAAA;QACvB,WAAW,IAAI,SAAS,qBAAqB,EAAE,CAAA;KAChD,CAAA;CACF;AAED,mEAAmE;AACnE,eAAO,MAAM,qBAAqB,EAAE,iBASnC,CAAA;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE;IACxD,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAA;IAC/C,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,WAAW,CAAC,CAAA;IACtD,KAAK,EAAE,MAAM,YAAY,CAAA;IACzB,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,cAAc,CAAC,CAAA;IAClD,sEAAsE;IACtE,aAAa,IAAI,OAAO,CAAA;IACxB,gEAAgE;IAChE,UAAU,CAAC,IAAI,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;CAC7C;sBAIwB,SAAS,GAAG,SAAS;;cA9CY,CAAC;YAAmB,CAAC;;;IA2D3E,qEAAqE;gCACzC,iBAAiB,GAAG,YAAY,CAAC,oBAAoB,CAAC;EAYrF"}
|
|
@@ -2,6 +2,7 @@ import { createCommandCompletions } from '../command-completions.js';
|
|
|
2
2
|
import { createFileActions } from '../file-actions.js';
|
|
3
3
|
import { createLocalFs } from '../local-fs.js';
|
|
4
4
|
import { mentionFs } from '../mentions.js';
|
|
5
|
+
import { sessionWorkingDirectory } from '../../../channel/working-directory.js';
|
|
5
6
|
/** No argument catalogs: the tree offers its static nodes only. */
|
|
6
7
|
export const NO_COMPLETION_CATALOG = {
|
|
7
8
|
workspaceCommands: () => [],
|
|
@@ -23,7 +24,7 @@ export function createCoreFiles(ctx, deps) {
|
|
|
23
24
|
owner: deps.owner,
|
|
24
25
|
capture: () => deps.binding.capture(),
|
|
25
26
|
current: capture => deps.binding.isCurrent(capture),
|
|
26
|
-
cwd: () => deps.state()
|
|
27
|
+
cwd: () => sessionWorkingDirectory(deps.state()),
|
|
27
28
|
fs,
|
|
28
29
|
});
|
|
29
30
|
return {
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host seams every channel composition reads: the optional Cordis service
|
|
3
|
-
* rows (themes, workspaces, command trees, scenes, settings sections,
|
|
4
|
-
* custom-entry renderers), the default-deny decision gate with its
|
|
5
|
-
* dispatch-topology marker, the runtime subscriptions that re-render on host
|
|
6
|
-
* changes, and the git-branch breadcrumb. Each lookup degrades when its row
|
|
7
|
-
* is not mounted, whatever backend serves the session.
|
|
8
|
-
*/
|
|
9
1
|
import type { AdapterRuntimeOptions } from '../../../adapter/kernel/runtime.js';
|
|
10
2
|
import { readGrantStore } from '../../../adapter/standard/grants.js';
|
|
11
3
|
import { getHostCommandTrees } from '../../command-trees.js';
|
|
@@ -50,10 +42,22 @@ export declare function startHostSubscriptions(host: Pick<CoreHost, 'settingsSec
|
|
|
50
42
|
* (best-effort, through the host `shell` service). Re-run when an adoption
|
|
51
43
|
* lands on a different cwd (/resume, /workspace, issue #96) so the
|
|
52
44
|
* breadcrumb never shows the previous workspace's branch.
|
|
45
|
+
*
|
|
46
|
+
* Adoption is not the only way the branch changes: a checkout in another
|
|
47
|
+
* terminal has to be seen through the workspace's own `.git/HEAD`, whose text
|
|
48
|
+
* is re-probed when it changes. Polling rather than `fs.watch` follows the
|
|
49
|
+
* grant store (a watcher can outlive a replaced inode, and `gitdir:`
|
|
50
|
+
* indirection, network mounts and watch limits each need their own fallback);
|
|
51
|
+
* the text is the signature, not the mtime, because timestamp granularity
|
|
52
|
+
* differs per filesystem while HEAD is well under 100 bytes.
|
|
53
|
+
*
|
|
54
|
+
* Where the host shell runs elsewhere (remote or sandboxed workspace), this
|
|
55
|
+
* process's `.git` is not the workspace's: with no HEAD to anchor on the poll
|
|
56
|
+
* stays quiet instead of clearing a value it cannot verify.
|
|
53
57
|
*/
|
|
54
58
|
export declare function createGitBranchRefresher(ctx: ServiceLookup, deps: {
|
|
55
|
-
owner: Pick<ChannelOwner, 'current'>;
|
|
56
|
-
state: Pick<ChannelState, 'cwd' | 'gitBranch' | 'emit'>;
|
|
59
|
+
owner: Pick<ChannelOwner, 'current' | 'own'>;
|
|
60
|
+
state: Pick<ChannelState, 'cwd' | 'workingDirectory' | 'gitBranch' | 'emit'>;
|
|
57
61
|
/** Record the resolved branch against the bound session (the session
|
|
58
62
|
* browser's branch column); absent = nothing records it. */
|
|
59
63
|
noteBranch?(branch: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/host.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AAEpE,OAAO,EAAE,mBAAmB,EAA8B,MAAM,wBAAwB,CAAA;AAGxF,OAAO,EAAE,gBAAgB,EAA2B,MAAM,oBAAoB,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAwB,MAAM,iBAAiB,CAAA;AAC3E,OAAO,EAAE,uBAAuB,EAAmC,MAAM,4BAA4B,CAAA;AACrG,OAAO,EAAE,aAAa,EAAwB,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAA4B,MAAM,qBAAqB,CAAA;AACpH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA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C,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE;IACjE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,CAAC,CAAA;IAC5C,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,kBAAkB,GAAG,WAAW,GAAG,MAAM,CAAC,CAAA;IAC5E;iEAC6D;IAC7D,UAAU,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC,GAAG,MAAM,IAAI,CA8Hb"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host seams every channel composition reads: the optional Cordis service
|
|
3
|
+
* rows (themes, workspaces, command trees, scenes, settings sections,
|
|
4
|
+
* custom-entry renderers), the default-deny decision gate with its
|
|
5
|
+
* dispatch-topology marker, the runtime subscriptions that re-render on host
|
|
6
|
+
* changes, and the git-branch breadcrumb. Each lookup degrades when its row
|
|
7
|
+
* is not mounted, whatever backend serves the session.
|
|
8
|
+
*/
|
|
9
|
+
import { readlink, realpath, stat } from 'node:fs/promises';
|
|
10
|
+
import { dirname, join, resolve } from 'node:path';
|
|
1
11
|
import { readGrantStore } from '../../../adapter/standard/grants.js';
|
|
12
|
+
import { readBoundedRegularFile } from '../../../utils/pastedImagePath.js';
|
|
2
13
|
import { getHostCommandTrees } from '../../command-trees.js';
|
|
3
14
|
import { runForegroundShell } from '../../compat/shell.js';
|
|
4
15
|
import { getHostGrantStore } from '../../host-grants.js';
|
|
@@ -7,6 +18,7 @@ import { getHostSceneRuntime } from '../../scenes.js';
|
|
|
7
18
|
import { getHostSettingsSections } from '../../settings-sections.js';
|
|
8
19
|
import { getHostThemes } from '../../themes.js';
|
|
9
20
|
import { createLocalWorkspaceRuntime, getHostWorkspaceRuntime } from '../../workspaces.js';
|
|
21
|
+
import { sessionWorkingDirectory } from '../../../channel/working-directory.js';
|
|
10
22
|
/**
|
|
11
23
|
* Resolve the host seams and install the decision gate. The topology marker
|
|
12
24
|
* is effectful state, so it is owned at acquisition: a later construction
|
|
@@ -109,42 +121,209 @@ export function startHostSubscriptions(host, owner, state, services) {
|
|
|
109
121
|
if (unwatch !== undefined)
|
|
110
122
|
owner.own(unwatch);
|
|
111
123
|
}
|
|
124
|
+
/** How often the workspace HEAD is read for a signature change. */
|
|
125
|
+
const BRANCH_HEAD_POLL_MS = 1000;
|
|
126
|
+
/** Ample room for long UTF-8 refs/gitdir paths without unbounded control-file reads. */
|
|
127
|
+
const GIT_METADATA_MAX_BYTES = 128 * 1024;
|
|
128
|
+
/**
|
|
129
|
+
* The `HEAD` file of the repository containing `cwd` (a linked worktree or a
|
|
130
|
+
* submodule points at its git dir through a `gitdir:` line in `.git`), or
|
|
131
|
+
* undefined when this process cannot see one. Reached from the timer path, so
|
|
132
|
+
* it answers rather than throws: a missing or malformed `.git` lands on
|
|
133
|
+
* undefined and leaves the poll silent.
|
|
134
|
+
*/
|
|
135
|
+
async function gitHeadPath(cwd) {
|
|
136
|
+
try {
|
|
137
|
+
let dir = await realpath(cwd);
|
|
138
|
+
for (;;) {
|
|
139
|
+
const dotGit = join(dir, '.git');
|
|
140
|
+
const entry = await stat(dotGit).catch((error) => {
|
|
141
|
+
if (error.code === 'ENOENT' || error.code === 'ENOTDIR')
|
|
142
|
+
return undefined;
|
|
143
|
+
throw error;
|
|
144
|
+
});
|
|
145
|
+
if (entry?.isDirectory())
|
|
146
|
+
return join(dotGit, 'HEAD');
|
|
147
|
+
if (entry?.isFile()) {
|
|
148
|
+
const target = /^gitdir:\s*(.+)$/m.exec(await readGitMetadata(dotGit) ?? '')?.[1];
|
|
149
|
+
// Git records the target relative to the directory holding `.git`.
|
|
150
|
+
if (target === undefined)
|
|
151
|
+
return undefined;
|
|
152
|
+
return join(resolve(dirname(dotGit), target.trim()), 'HEAD');
|
|
153
|
+
}
|
|
154
|
+
if (entry !== undefined)
|
|
155
|
+
return undefined;
|
|
156
|
+
const parent = dirname(dir);
|
|
157
|
+
if (parent === dir)
|
|
158
|
+
return undefined;
|
|
159
|
+
dir = parent;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/** Small, regular Git control files only; unreadable metadata stays best-effort. */
|
|
167
|
+
async function readGitMetadata(path) {
|
|
168
|
+
if (path === undefined)
|
|
169
|
+
return undefined;
|
|
170
|
+
try {
|
|
171
|
+
return Buffer.from(await readBoundedRegularFile(path, GIT_METADATA_MAX_BYTES)).toString('utf8');
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
112
177
|
/**
|
|
113
178
|
* Statusline breadcrumb: the current git branch of the session cwd
|
|
114
179
|
* (best-effort, through the host `shell` service). Re-run when an adoption
|
|
115
180
|
* lands on a different cwd (/resume, /workspace, issue #96) so the
|
|
116
181
|
* breadcrumb never shows the previous workspace's branch.
|
|
182
|
+
*
|
|
183
|
+
* Adoption is not the only way the branch changes: a checkout in another
|
|
184
|
+
* terminal has to be seen through the workspace's own `.git/HEAD`, whose text
|
|
185
|
+
* is re-probed when it changes. Polling rather than `fs.watch` follows the
|
|
186
|
+
* grant store (a watcher can outlive a replaced inode, and `gitdir:`
|
|
187
|
+
* indirection, network mounts and watch limits each need their own fallback);
|
|
188
|
+
* the text is the signature, not the mtime, because timestamp granularity
|
|
189
|
+
* differs per filesystem while HEAD is well under 100 bytes.
|
|
190
|
+
*
|
|
191
|
+
* Where the host shell runs elsewhere (remote or sandboxed workspace), this
|
|
192
|
+
* process's `.git` is not the workspace's: with no HEAD to anchor on the poll
|
|
193
|
+
* stays quiet instead of clearing a value it cannot verify.
|
|
117
194
|
*/
|
|
118
195
|
export function createGitBranchRefresher(ctx, deps) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
196
|
+
const { state } = deps;
|
|
197
|
+
/** The HEAD text the last probe was issued against. */
|
|
198
|
+
let signature;
|
|
199
|
+
/** Retry the same HEAD after transient failure, backing off to 30 seconds. */
|
|
200
|
+
let retryAfter;
|
|
201
|
+
let retryDelayMs = 0;
|
|
202
|
+
const retry = () => {
|
|
203
|
+
retryDelayMs = Math.min(retryDelayMs * 2 || BRANCH_HEAD_POLL_MS, 30_000);
|
|
204
|
+
retryAfter = performance.now() + retryDelayMs;
|
|
205
|
+
};
|
|
206
|
+
/** Tickets handed out to probes; only the newest holder may publish. */
|
|
207
|
+
let issued = 0;
|
|
208
|
+
/** Slow filesystem reads never accumulate more than one periodic sample. */
|
|
209
|
+
let polling = false;
|
|
210
|
+
const probe = async (clearFirst) => {
|
|
211
|
+
// Adoption clears first so a switch never shows the previous workspace's
|
|
212
|
+
// branch; a poll keeps the value, so an unrelated redraw during the round
|
|
213
|
+
// trip cannot paint a gap.
|
|
214
|
+
if (clearFirst) {
|
|
215
|
+
state.gitBranch = undefined;
|
|
216
|
+
signature = undefined;
|
|
217
|
+
retryAfter = undefined;
|
|
218
|
+
retryDelayMs = 0;
|
|
219
|
+
issued += 1;
|
|
220
|
+
}
|
|
221
|
+
const requestedCwd = sessionWorkingDirectory(state);
|
|
222
|
+
const readTicket = issued;
|
|
223
|
+
// Resolve on every sample: git init and a retargeted .git file can change
|
|
224
|
+
// the repository without changing cwd. Async reads leave the UI runnable.
|
|
225
|
+
const headPath = await gitHeadPath(requestedCwd);
|
|
226
|
+
// core.preferSymlinkRefs stores the symbolic ref in the HEAD link itself.
|
|
227
|
+
const link = headPath === undefined ? undefined : await readlink(headPath).catch(() => undefined);
|
|
228
|
+
const observed = link?.startsWith('refs/')
|
|
229
|
+
? `ref: ${link}`
|
|
230
|
+
: (await readGitMetadata(headPath))?.trim();
|
|
231
|
+
if (readTicket !== issued || !deps.owner.current() || sessionWorkingDirectory(state) !== requestedCwd)
|
|
232
|
+
return;
|
|
233
|
+
if (!clearFirst) {
|
|
234
|
+
if (observed === undefined) {
|
|
235
|
+
// A previously visible HEAD disappeared. Invalidate pending replies;
|
|
236
|
+
// a workspace whose HEAD was never readable keeps its shell-only value.
|
|
237
|
+
if (signature === undefined)
|
|
238
|
+
return;
|
|
239
|
+
signature = undefined;
|
|
240
|
+
retryAfter = undefined;
|
|
241
|
+
retryDelayMs = 0;
|
|
242
|
+
issued += 1;
|
|
243
|
+
if (state.gitBranch === undefined)
|
|
244
|
+
return;
|
|
245
|
+
state.gitBranch = undefined;
|
|
246
|
+
state.emit();
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (observed === signature && (retryAfter === undefined || performance.now() < retryAfter))
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
// Baseline at issue time: a checkout landing while the shell runs still
|
|
253
|
+
// differs from it and triggers the next tick.
|
|
254
|
+
if (observed !== signature)
|
|
255
|
+
retryDelayMs = 0;
|
|
256
|
+
signature = observed;
|
|
257
|
+
retryAfter = undefined;
|
|
122
258
|
const shell = ctx.get('shell');
|
|
123
|
-
if (!shell)
|
|
259
|
+
if (!shell) {
|
|
260
|
+
// A missing service must not leave an older HEAD's ticket current.
|
|
261
|
+
issued += 1;
|
|
262
|
+
retry();
|
|
124
263
|
return;
|
|
264
|
+
}
|
|
125
265
|
// Capture the requested cwd: a /resume landing while this query is in
|
|
126
266
|
// flight refreshes the branch for the new cwd, so a late reply from the
|
|
127
267
|
// old workspace must be dropped (stale statusline, issue #96).
|
|
128
|
-
|
|
268
|
+
// Two probes can be in flight (the shell does not serialize them); only
|
|
269
|
+
// the newest one speaks for the workspace.
|
|
270
|
+
const ticket = clearFirst ? readTicket : ++issued;
|
|
129
271
|
void runForegroundShell(shell, {
|
|
130
272
|
command: 'git branch --show-current',
|
|
131
273
|
workdir: requestedCwd,
|
|
132
274
|
timeoutMs: 3000,
|
|
133
275
|
})
|
|
134
276
|
.then((result) => {
|
|
135
|
-
|
|
277
|
+
// A newer probe already speaks for the workspace and its baseline
|
|
278
|
+
// matches HEAD, so nothing would re-probe after this slower reply.
|
|
279
|
+
if (ticket !== issued)
|
|
280
|
+
return;
|
|
281
|
+
if (!deps.owner.current() || sessionWorkingDirectory(state) !== requestedCwd)
|
|
282
|
+
return;
|
|
283
|
+
// A timed-out probe reports whatever it captured, often nothing: that
|
|
284
|
+
// is not "no branch". Retain the value and retry this HEAD.
|
|
285
|
+
if (result.timedOut) {
|
|
286
|
+
retry();
|
|
136
287
|
return;
|
|
288
|
+
}
|
|
137
289
|
const branch = result.stdout.text.trim();
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
290
|
+
// A B -> C -> B checkout can return C while both polls saw B. Compare
|
|
291
|
+
// the shell reply to the symbolic HEAD, not just two equal snapshots.
|
|
292
|
+
const expectedBranch = observed?.startsWith('ref:')
|
|
293
|
+
? /^ref:\s+refs\/heads\/(.+)$/.exec(observed)?.[1]
|
|
294
|
+
: observed === undefined ? undefined : ''; // A detached HEAD has no branch.
|
|
295
|
+
if (expectedBranch !== undefined && branch !== expectedBranch) {
|
|
296
|
+
retry();
|
|
297
|
+
return;
|
|
142
298
|
}
|
|
299
|
+
retryDelayMs = 0;
|
|
300
|
+
// A detached HEAD (or a cwd outside any repository) answers nothing:
|
|
301
|
+
// clear it, which is also what a cold start would show.
|
|
302
|
+
const next = branch === '' ? undefined : branch;
|
|
303
|
+
if (next === state.gitBranch)
|
|
304
|
+
return;
|
|
305
|
+
state.gitBranch = next;
|
|
306
|
+
// The session index records branches, never the absence of one.
|
|
307
|
+
if (next !== undefined)
|
|
308
|
+
deps.noteBranch?.(next);
|
|
309
|
+
state.emit();
|
|
143
310
|
})
|
|
144
311
|
.catch(() => {
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
|
|
312
|
+
// Only the current probe may request a retry; an older rejection must
|
|
313
|
+
// not invalidate a successful newer result.
|
|
314
|
+
if (ticket === issued && deps.owner.current() && sessionWorkingDirectory(state) === requestedCwd)
|
|
315
|
+
retry();
|
|
148
316
|
});
|
|
149
317
|
};
|
|
318
|
+
const timer = setInterval(() => {
|
|
319
|
+
if (!deps.owner.current() || polling)
|
|
320
|
+
return;
|
|
321
|
+
polling = true;
|
|
322
|
+
// Only the filesystem sample is single-flight: a slow shell reply must
|
|
323
|
+
// not prevent a later tick from noticing another checkout or removal.
|
|
324
|
+
void probe(false).finally(() => { polling = false; });
|
|
325
|
+
}, BRANCH_HEAD_POLL_MS);
|
|
326
|
+
timer.unref?.();
|
|
327
|
+
deps.owner.own(() => clearInterval(timer));
|
|
328
|
+
return () => { void probe(true); };
|
|
150
329
|
}
|
|
@@ -35,6 +35,7 @@ export declare function createCoreLocalActions(ctx: ServiceLookup, deps: {
|
|
|
35
35
|
clear(): void;
|
|
36
36
|
pushLocal(title: string, lines: readonly string[], options?: {
|
|
37
37
|
readonly lineLimit?: number;
|
|
38
|
+
readonly preserveWhitespace?: boolean;
|
|
38
39
|
}): void;
|
|
39
40
|
setActivityFrames: (name: string) => boolean;
|
|
40
41
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-actions.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/local-actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"local-actions.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/local-actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ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BAAsB,CAAC,CAAA"}
|
|
@@ -4,7 +4,8 @@ import { writeActivityFrames } from '../../../activityPrefs.js';
|
|
|
4
4
|
import { isPresetName, normalizeActivityPreset } from '../../../components/activityFrames.js';
|
|
5
5
|
import { t } from '../../../i18n.js';
|
|
6
6
|
import { runForegroundShell } from '../../compat/shell.js';
|
|
7
|
-
import { LOCAL_OUTPUT_LIMIT, preview } from '../transcript.js';
|
|
7
|
+
import { LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview } from '../transcript.js';
|
|
8
|
+
import { sessionWorkingDirectory } from '../../../channel/working-directory.js';
|
|
8
9
|
/** `/activity frames <name>`: validate, persist, re-render. */
|
|
9
10
|
export function setActivityFrames(state, notify, name) {
|
|
10
11
|
// A retired preset id normalizes to the current default, so the
|
|
@@ -28,6 +29,18 @@ export function setActivityFrames(state, notify, name) {
|
|
|
28
29
|
notify(t('activity-indicator-switched', { name: preset }));
|
|
29
30
|
return true;
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* One report line that keeps its shape: blank rows stay blank and leading
|
|
34
|
+
* indentation survives; a stray newline still cannot become a second row.
|
|
35
|
+
*/
|
|
36
|
+
function previewIndented(text, limit) {
|
|
37
|
+
const line = text.replace(/[\r\n]+/gu, ' ').replace(/\s+$/u, '');
|
|
38
|
+
// A truly empty Text node measures as zero height; one no-break space keeps
|
|
39
|
+
// the blank row the report asked for without painting anything.
|
|
40
|
+
if (line === '')
|
|
41
|
+
return '\u00a0';
|
|
42
|
+
return line.length <= limit ? line : `${line.slice(0, limit)}…`;
|
|
43
|
+
}
|
|
31
44
|
export function createCoreLocalActions(ctx, deps) {
|
|
32
45
|
const { owner, binding, state, rowIds, notify } = deps;
|
|
33
46
|
return {
|
|
@@ -55,9 +68,25 @@ export function createCoreLocalActions(ctx, deps) {
|
|
|
55
68
|
// A report whose line IS the payload (the /goal objective) raises the
|
|
56
69
|
// budget; every other report keeps the shared 240-cell preview.
|
|
57
70
|
const limit = options?.lineLimit ?? LOCAL_OUTPUT_LIMIT;
|
|
71
|
+
const render = options?.preserveWhitespace ? previewIndented : preview;
|
|
72
|
+
// Local reports cannot be restored from backend history. Retain whole
|
|
73
|
+
// recent blocks within the existing row budget, without folding facts.
|
|
74
|
+
let count = state.rows.reduce((sum, row) => sum + Number(row.kind === 'local' || row.kind === 'local-output'), lines.length + 1);
|
|
75
|
+
for (let i = 0; count > MAX_ROWS && i < state.rows.length;) {
|
|
76
|
+
if (state.rows[i].kind !== 'local' && state.rows[i].kind !== 'local-output') {
|
|
77
|
+
i++;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
let end = i + 1;
|
|
81
|
+
while (state.rows[end]?.kind === 'local-output')
|
|
82
|
+
end++;
|
|
83
|
+
count -= end - i;
|
|
84
|
+
state.rows.splice(i, end - i);
|
|
85
|
+
markChannelReadDirty(state.rows);
|
|
86
|
+
}
|
|
58
87
|
state.rows.push({ id: rowIds.value++, kind: 'local', text: title });
|
|
59
88
|
for (const line of lines)
|
|
60
|
-
state.rows.push({ id: rowIds.value++, kind: 'local-output', text:
|
|
89
|
+
state.rows.push({ id: rowIds.value++, kind: 'local-output', text: render(line, limit) });
|
|
61
90
|
state.emit();
|
|
62
91
|
},
|
|
63
92
|
setActivityFrames: (name) => setActivityFrames(state, notify, name),
|
|
@@ -81,7 +110,7 @@ export function createCoreLocalActions(ctx, deps) {
|
|
|
81
110
|
async function runLocal(command, includeInContext) {
|
|
82
111
|
const capture = binding.capture();
|
|
83
112
|
const current = () => owner.current() && binding.isCurrent(capture);
|
|
84
|
-
const cwd = state
|
|
113
|
+
const cwd = sessionWorkingDirectory(state);
|
|
85
114
|
const target = deps.workspace.describe(cwd);
|
|
86
115
|
state.rows.push({ id: rowIds.value++, kind: 'local', text: command, executionTarget: target.kind === 'local' ? target.badge : `${target.badge} · ${target.label}` });
|
|
87
116
|
state.emit();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAyB5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AA4BpD,OAAO,EAAqB,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAsBzE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,OAAO,EACZ,aAAa,EAAE,SAAS,EACxB,OAAO,EAAE,oBAAoB,GAC5B,IAAI,CAmxBN"}
|