@deepseek-harness-tui/dsh-tui 0.13.0 → 0.14.1
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 +85 -5
- package/assets/claude-girl/claude-girl-happy.png +0 -0
- package/assets/claude-girl/claude-girl.png +0 -0
- package/assets/codex-girl/codex-girl-happy.png +0 -0
- package/assets/codex-girl/codex-girl.png +0 -0
- package/bin/dsh-tui.js +104 -18
- package/cordis.patch.yml +2 -0
- package/cordis.yml +2 -0
- package/guide/dsh-tui-guide/SKILL.md +4 -2
- package/guide/dsh-tui-guide/claude-backend.en.md +203 -0
- package/guide/dsh-tui-guide/claude-backend.md +161 -0
- package/guide/dsh-tui-guide/codex-backend.en.md +297 -0
- package/guide/dsh-tui-guide/codex-backend.md +257 -0
- package/guide/dsh-tui-guide/configuration.en.md +9 -2
- package/guide/dsh-tui-guide/configuration.md +9 -2
- package/guide/dsh-tui-guide/interaction.en.md +169 -27
- package/guide/dsh-tui-guide/interaction.md +115 -17
- package/guide/dsh-tui-guide/themes.en.md +24 -2
- package/guide/dsh-tui-guide/themes.md +21 -2
- package/guide/dsh-tui-guide/user-guide.en.md +38 -23
- package/guide/dsh-tui-guide/user-guide.md +22 -11
- package/guide/dsh-tui-guide/vscode.en.md +1 -0
- package/guide/dsh-tui-guide/vscode.md +1 -0
- package/lib/settings.json +139 -6
- package/lib/types/adapter/channel/state.d.ts.map +1 -1
- package/lib/types/adapter/channel/state.js +1 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +17 -2
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +29 -0
- package/lib/types/adapter/channel/ui.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui.js +45 -5
- package/lib/types/adapter/ports/channel-catalog.d.ts +7 -0
- package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-display.d.ts +7 -1
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-session.d.ts +5 -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 +183 -6
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +477 -13
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/agent/backend.d.ts +168 -0
- package/lib/types/agent/backend.d.ts.map +1 -0
- package/lib/types/agent/backend.js +1 -0
- package/lib/types/agent/capabilities.d.ts +461 -0
- package/lib/types/agent/capabilities.d.ts.map +1 -0
- package/lib/types/agent/capabilities.js +1 -0
- package/lib/types/agent/events.d.ts +733 -0
- package/lib/types/agent/events.d.ts.map +1 -0
- package/lib/types/agent/events.js +2 -0
- package/lib/types/agent/index.d.ts +8 -0
- package/lib/types/agent/index.d.ts.map +1 -0
- package/lib/types/agent/index.js +7 -0
- package/lib/types/agent/messages.d.ts +52 -0
- package/lib/types/agent/messages.d.ts.map +1 -0
- package/lib/types/agent/messages.js +91 -0
- package/lib/types/agent/presentation.d.ts +29 -0
- package/lib/types/agent/presentation.d.ts.map +1 -0
- package/lib/types/agent/presentation.js +4 -0
- package/lib/types/agent/refs.d.ts +30 -0
- package/lib/types/agent/refs.d.ts.map +1 -0
- package/lib/types/agent/refs.js +39 -0
- package/lib/types/agent/session.d.ts +78 -0
- package/lib/types/agent/session.d.ts.map +1 -0
- package/lib/types/agent/session.js +1 -0
- package/lib/types/backends/claude/activity.d.ts +53 -0
- package/lib/types/backends/claude/activity.d.ts.map +1 -0
- package/lib/types/backends/claude/activity.js +103 -0
- package/lib/types/backends/claude/auth.d.ts +245 -0
- package/lib/types/backends/claude/auth.d.ts.map +1 -0
- package/lib/types/backends/claude/auth.js +503 -0
- package/lib/types/backends/claude/backend.d.ts +32 -0
- package/lib/types/backends/claude/backend.d.ts.map +1 -0
- package/lib/types/backends/claude/backend.js +296 -0
- package/lib/types/backends/claude/catalog.d.ts +17 -0
- package/lib/types/backends/claude/catalog.d.ts.map +1 -0
- package/lib/types/backends/claude/catalog.js +94 -0
- package/lib/types/backends/claude/channels.d.ts +63 -0
- package/lib/types/backends/claude/channels.d.ts.map +1 -0
- package/lib/types/backends/claude/channels.js +275 -0
- package/lib/types/backends/claude/contract.d.ts +37 -0
- package/lib/types/backends/claude/contract.d.ts.map +1 -0
- package/lib/types/backends/claude/contract.js +46 -0
- package/lib/types/backends/claude/controls.d.ts +134 -0
- package/lib/types/backends/claude/controls.d.ts.map +1 -0
- package/lib/types/backends/claude/controls.js +425 -0
- package/lib/types/backends/claude/dialogs.d.ts +62 -0
- package/lib/types/backends/claude/dialogs.d.ts.map +1 -0
- package/lib/types/backends/claude/dialogs.js +253 -0
- package/lib/types/backends/claude/flag-settings.d.ts +12 -0
- package/lib/types/backends/claude/flag-settings.d.ts.map +1 -0
- package/lib/types/backends/claude/flag-settings.js +49 -0
- package/lib/types/backends/claude/images.d.ts +49 -0
- package/lib/types/backends/claude/images.d.ts.map +1 -0
- package/lib/types/backends/claude/images.js +94 -0
- package/lib/types/backends/claude/index.d.ts +5 -0
- package/lib/types/backends/claude/index.d.ts.map +1 -0
- package/lib/types/backends/claude/index.js +4 -0
- package/lib/types/backends/claude/install.d.ts +15 -0
- package/lib/types/backends/claude/install.d.ts.map +1 -0
- package/lib/types/backends/claude/install.js +91 -0
- package/lib/types/backends/claude/modelEnv.d.ts +64 -0
- package/lib/types/backends/claude/modelEnv.d.ts.map +1 -0
- package/lib/types/backends/claude/modelEnv.js +199 -0
- package/lib/types/backends/claude/narrow.d.ts +10 -0
- package/lib/types/backends/claude/narrow.d.ts.map +1 -0
- package/lib/types/backends/claude/narrow.js +8 -0
- package/lib/types/backends/claude/older-history.d.ts +16 -0
- package/lib/types/backends/claude/older-history.d.ts.map +1 -0
- package/lib/types/backends/claude/older-history.js +101 -0
- package/lib/types/backends/claude/options.d.ts +181 -0
- package/lib/types/backends/claude/options.d.ts.map +1 -0
- package/lib/types/backends/claude/options.js +208 -0
- package/lib/types/backends/claude/permissions.d.ts +83 -0
- package/lib/types/backends/claude/permissions.d.ts.map +1 -0
- package/lib/types/backends/claude/permissions.js +331 -0
- package/lib/types/backends/claude/prefs.d.ts +55 -0
- package/lib/types/backends/claude/prefs.d.ts.map +1 -0
- package/lib/types/backends/claude/prefs.js +150 -0
- package/lib/types/backends/claude/process.d.ts +19 -0
- package/lib/types/backends/claude/process.d.ts.map +1 -0
- package/lib/types/backends/claude/process.js +156 -0
- package/lib/types/backends/claude/replay.d.ts +129 -0
- package/lib/types/backends/claude/replay.d.ts.map +1 -0
- package/lib/types/backends/claude/replay.js +505 -0
- package/lib/types/backends/claude/sdk-warnings.d.ts +23 -0
- package/lib/types/backends/claude/sdk-warnings.d.ts.map +1 -0
- package/lib/types/backends/claude/sdk-warnings.js +55 -0
- package/lib/types/backends/claude/sdk.d.ts +12 -0
- package/lib/types/backends/claude/sdk.d.ts.map +1 -0
- package/lib/types/backends/claude/sdk.js +34 -0
- package/lib/types/backends/claude/send-message.d.ts +54 -0
- package/lib/types/backends/claude/send-message.d.ts.map +1 -0
- package/lib/types/backends/claude/send-message.js +65 -0
- package/lib/types/backends/claude/session/auth.d.ts +47 -0
- package/lib/types/backends/claude/session/auth.d.ts.map +1 -0
- package/lib/types/backends/claude/session/auth.js +226 -0
- package/lib/types/backends/claude/session/channels.d.ts +82 -0
- package/lib/types/backends/claude/session/channels.d.ts.map +1 -0
- package/lib/types/backends/claude/session/channels.js +45 -0
- package/lib/types/backends/claude/session/input.d.ts +16 -0
- package/lib/types/backends/claude/session/input.d.ts.map +1 -0
- package/lib/types/backends/claude/session/input.js +64 -0
- package/lib/types/backends/claude/session/lifecycle.d.ts +6 -0
- package/lib/types/backends/claude/session/lifecycle.d.ts.map +1 -0
- package/lib/types/backends/claude/session/lifecycle.js +852 -0
- package/lib/types/backends/claude/session/store.d.ts +17 -0
- package/lib/types/backends/claude/session/store.d.ts.map +1 -0
- package/lib/types/backends/claude/session/store.js +122 -0
- package/lib/types/backends/claude/session/subagents.d.ts +13 -0
- package/lib/types/backends/claude/session/subagents.d.ts.map +1 -0
- package/lib/types/backends/claude/session/subagents.js +77 -0
- package/lib/types/backends/claude/session/types.d.ts +89 -0
- package/lib/types/backends/claude/session/types.d.ts.map +1 -0
- package/lib/types/backends/claude/session/types.js +1 -0
- package/lib/types/backends/claude/session.d.ts +4 -0
- package/lib/types/backends/claude/session.d.ts.map +1 -0
- package/lib/types/backends/claude/session.js +2 -0
- package/lib/types/backends/claude/side-query.d.ts +34 -0
- package/lib/types/backends/claude/side-query.d.ts.map +1 -0
- package/lib/types/backends/claude/side-query.js +116 -0
- package/lib/types/backends/claude/task-output.d.ts +13 -0
- package/lib/types/backends/claude/task-output.d.ts.map +1 -0
- package/lib/types/backends/claude/task-output.js +101 -0
- package/lib/types/backends/claude/tools.d.ts +45 -0
- package/lib/types/backends/claude/tools.d.ts.map +1 -0
- package/lib/types/backends/claude/tools.js +231 -0
- package/lib/types/backends/claude/transcript-file.d.ts +41 -0
- package/lib/types/backends/claude/transcript-file.d.ts.map +1 -0
- package/lib/types/backends/claude/transcript-file.js +195 -0
- package/lib/types/backends/claude/translate/attempts.d.ts +33 -0
- package/lib/types/backends/claude/translate/attempts.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/attempts.js +243 -0
- package/lib/types/backends/claude/translate/content.d.ts +33 -0
- package/lib/types/backends/claude/translate/content.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/content.js +91 -0
- package/lib/types/backends/claude/translate/core.d.ts +76 -0
- package/lib/types/backends/claude/translate/core.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/core.js +447 -0
- package/lib/types/backends/claude/translate/events.d.ts +9 -0
- package/lib/types/backends/claude/translate/events.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/events.js +77 -0
- package/lib/types/backends/claude/translate/lanes.d.ts +31 -0
- package/lib/types/backends/claude/translate/lanes.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/lanes.js +177 -0
- package/lib/types/backends/claude/translate/messages.d.ts +36 -0
- package/lib/types/backends/claude/translate/messages.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/messages.js +202 -0
- package/lib/types/backends/claude/translate/system.d.ts +40 -0
- package/lib/types/backends/claude/translate/system.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/system.js +399 -0
- package/lib/types/backends/claude/translate/tasks.d.ts +19 -0
- package/lib/types/backends/claude/translate/tasks.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/tasks.js +159 -0
- package/lib/types/backends/claude/translate/types.d.ts +114 -0
- package/lib/types/backends/claude/translate/types.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/types.js +1 -0
- package/lib/types/backends/claude/translate.d.ts +9 -0
- package/lib/types/backends/claude/translate.d.ts.map +1 -0
- package/lib/types/backends/claude/translate.js +6 -0
- package/lib/types/backends/codex/auth/external-tokens.d.ts +66 -0
- package/lib/types/backends/codex/auth/external-tokens.d.ts.map +1 -0
- package/lib/types/backends/codex/auth/external-tokens.js +325 -0
- package/lib/types/backends/codex/auth/route.d.ts +14 -0
- package/lib/types/backends/codex/auth/route.d.ts.map +1 -0
- package/lib/types/backends/codex/auth/route.js +52 -0
- package/lib/types/backends/codex/auth/status.d.ts +16 -0
- package/lib/types/backends/codex/auth/status.d.ts.map +1 -0
- package/lib/types/backends/codex/auth/status.js +115 -0
- package/lib/types/backends/codex/backend.d.ts +58 -0
- package/lib/types/backends/codex/backend.d.ts.map +1 -0
- package/lib/types/backends/codex/backend.js +201 -0
- package/lib/types/backends/codex/catalog.d.ts +17 -0
- package/lib/types/backends/codex/catalog.d.ts.map +1 -0
- package/lib/types/backends/codex/catalog.js +128 -0
- package/lib/types/backends/codex/channels.d.ts +59 -0
- package/lib/types/backends/codex/channels.d.ts.map +1 -0
- package/lib/types/backends/codex/channels.js +274 -0
- package/lib/types/backends/codex/contract.d.ts +46 -0
- package/lib/types/backends/codex/contract.d.ts.map +1 -0
- package/lib/types/backends/codex/contract.js +80 -0
- package/lib/types/backends/codex/detect.d.ts +14 -0
- package/lib/types/backends/codex/detect.d.ts.map +1 -0
- package/lib/types/backends/codex/detect.js +90 -0
- package/lib/types/backends/codex/index.d.ts +6 -0
- package/lib/types/backends/codex/index.d.ts.map +1 -0
- package/lib/types/backends/codex/index.js +5 -0
- package/lib/types/backends/codex/modes.d.ts +16 -0
- package/lib/types/backends/codex/modes.d.ts.map +1 -0
- package/lib/types/backends/codex/modes.js +49 -0
- package/lib/types/backends/codex/narrow.d.ts +20 -0
- package/lib/types/backends/codex/narrow.d.ts.map +1 -0
- package/lib/types/backends/codex/narrow.js +18 -0
- package/lib/types/backends/codex/prefs.d.ts +42 -0
- package/lib/types/backends/codex/prefs.d.ts.map +1 -0
- package/lib/types/backends/codex/prefs.js +124 -0
- package/lib/types/backends/codex/protocol/index.d.ts +149 -0
- package/lib/types/backends/codex/protocol/index.d.ts.map +1 -0
- package/lib/types/backends/codex/protocol/index.js +130 -0
- package/lib/types/backends/codex/rpc/binary.d.ts +35 -0
- package/lib/types/backends/codex/rpc/binary.d.ts.map +1 -0
- package/lib/types/backends/codex/rpc/binary.js +174 -0
- package/lib/types/backends/codex/rpc/client.d.ts +72 -0
- package/lib/types/backends/codex/rpc/client.d.ts.map +1 -0
- package/lib/types/backends/codex/rpc/client.js +214 -0
- package/lib/types/backends/codex/rpc/hub.d.ts +105 -0
- package/lib/types/backends/codex/rpc/hub.d.ts.map +1 -0
- package/lib/types/backends/codex/rpc/hub.js +532 -0
- package/lib/types/backends/codex/rpc/transport.d.ts +39 -0
- package/lib/types/backends/codex/rpc/transport.d.ts.map +1 -0
- package/lib/types/backends/codex/rpc/transport.js +212 -0
- package/lib/types/backends/codex/session/activity.d.ts +18 -0
- package/lib/types/backends/codex/session/activity.d.ts.map +1 -0
- package/lib/types/backends/codex/session/activity.js +108 -0
- package/lib/types/backends/codex/session/approvals.d.ts +39 -0
- package/lib/types/backends/codex/session/approvals.d.ts.map +1 -0
- package/lib/types/backends/codex/session/approvals.js +477 -0
- package/lib/types/backends/codex/session/commands.d.ts +37 -0
- package/lib/types/backends/codex/session/commands.d.ts.map +1 -0
- package/lib/types/backends/codex/session/commands.js +141 -0
- package/lib/types/backends/codex/session/controls.d.ts +37 -0
- package/lib/types/backends/codex/session/controls.d.ts.map +1 -0
- package/lib/types/backends/codex/session/controls.js +303 -0
- package/lib/types/backends/codex/session/goals.d.ts +25 -0
- package/lib/types/backends/codex/session/goals.d.ts.map +1 -0
- package/lib/types/backends/codex/session/goals.js +97 -0
- package/lib/types/backends/codex/session/history.d.ts +52 -0
- package/lib/types/backends/codex/session/history.d.ts.map +1 -0
- package/lib/types/backends/codex/session/history.js +196 -0
- package/lib/types/backends/codex/session/images.d.ts +17 -0
- package/lib/types/backends/codex/session/images.d.ts.map +1 -0
- package/lib/types/backends/codex/session/images.js +138 -0
- package/lib/types/backends/codex/session/input.d.ts +75 -0
- package/lib/types/backends/codex/session/input.d.ts.map +1 -0
- package/lib/types/backends/codex/session/input.js +294 -0
- package/lib/types/backends/codex/session/plan-review.d.ts +19 -0
- package/lib/types/backends/codex/session/plan-review.d.ts.map +1 -0
- package/lib/types/backends/codex/session/plan-review.js +48 -0
- package/lib/types/backends/codex/session/prompts.d.ts +7 -0
- package/lib/types/backends/codex/session/prompts.d.ts.map +1 -0
- package/lib/types/backends/codex/session/prompts.js +47 -0
- package/lib/types/backends/codex/session/session.d.ts +12 -0
- package/lib/types/backends/codex/session/session.d.ts.map +1 -0
- package/lib/types/backends/codex/session/session.js +871 -0
- package/lib/types/backends/codex/session/side-query.d.ts +25 -0
- package/lib/types/backends/codex/session/side-query.d.ts.map +1 -0
- package/lib/types/backends/codex/session/side-query.js +121 -0
- package/lib/types/backends/codex/session/state.d.ts +57 -0
- package/lib/types/backends/codex/session/state.d.ts.map +1 -0
- package/lib/types/backends/codex/session/state.js +1 -0
- package/lib/types/backends/codex/session/subagents.d.ts +28 -0
- package/lib/types/backends/codex/session/subagents.d.ts.map +1 -0
- package/lib/types/backends/codex/session/subagents.js +286 -0
- package/lib/types/backends/codex/session/tasks.d.ts +25 -0
- package/lib/types/backends/codex/session/tasks.d.ts.map +1 -0
- package/lib/types/backends/codex/session/tasks.js +207 -0
- package/lib/types/backends/codex/session/tool-output.d.ts +9 -0
- package/lib/types/backends/codex/session/tool-output.d.ts.map +1 -0
- package/lib/types/backends/codex/session/tool-output.js +29 -0
- package/lib/types/backends/codex/translate/commands.d.ts +30 -0
- package/lib/types/backends/codex/translate/commands.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/commands.js +103 -0
- package/lib/types/backends/codex/translate/events.d.ts +9 -0
- package/lib/types/backends/codex/translate/events.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/events.js +71 -0
- package/lib/types/backends/codex/translate/items.d.ts +112 -0
- package/lib/types/backends/codex/translate/items.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/items.js +375 -0
- package/lib/types/backends/codex/translate/live.d.ts +39 -0
- package/lib/types/backends/codex/translate/live.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/live.js +315 -0
- package/lib/types/backends/codex/translate/notices.d.ts +27 -0
- package/lib/types/backends/codex/translate/notices.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/notices.js +99 -0
- package/lib/types/backends/codex/translate/presentation.d.ts +49 -0
- package/lib/types/backends/codex/translate/presentation.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/presentation.js +237 -0
- package/lib/types/backends/codex/translate/replay.d.ts +18 -0
- package/lib/types/backends/codex/translate/replay.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/replay.js +33 -0
- package/lib/types/backends/codex/translate/usage.d.ts +29 -0
- package/lib/types/backends/codex/translate/usage.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/usage.js +65 -0
- package/lib/types/backends/shared/atomic-file.d.ts +4 -0
- package/lib/types/backends/shared/atomic-file.d.ts.map +1 -0
- package/lib/types/backends/shared/atomic-file.js +52 -0
- package/lib/types/backends/shared/channel-tokens.d.ts +29 -0
- package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -0
- package/lib/types/backends/shared/channel-tokens.js +161 -0
- package/lib/types/backends/shared/display-path.d.ts +3 -0
- package/lib/types/backends/shared/display-path.d.ts.map +1 -0
- package/lib/types/backends/shared/display-path.js +12 -0
- package/lib/types/branding.d.ts +92 -0
- package/lib/types/branding.d.ts.map +1 -0
- package/lib/types/branding.js +117 -0
- package/lib/types/channel/activity.d.ts +53 -0
- package/lib/types/channel/activity.d.ts.map +1 -0
- package/lib/types/channel/activity.js +955 -0
- package/lib/types/channel/capabilities.d.ts +24 -0
- package/lib/types/channel/capabilities.d.ts.map +1 -0
- package/lib/types/channel/capabilities.js +57 -0
- package/lib/types/channel/channel-slug.d.ts +9 -0
- package/lib/types/channel/channel-slug.d.ts.map +1 -0
- package/lib/types/channel/channel-slug.js +15 -0
- package/lib/types/channel/channel-wizard.d.ts +30 -0
- package/lib/types/channel/channel-wizard.d.ts.map +1 -0
- package/lib/types/channel/channel-wizard.js +226 -0
- package/lib/types/channel/elicitation.d.ts +135 -0
- package/lib/types/channel/elicitation.d.ts.map +1 -0
- package/lib/types/channel/elicitation.js +360 -0
- package/lib/types/channel/goal-command.d.ts +49 -0
- package/lib/types/channel/goal-command.d.ts.map +1 -0
- package/lib/types/channel/goal-command.js +72 -0
- package/lib/types/channel/history-restore.d.ts +16 -0
- package/lib/types/channel/history-restore.d.ts.map +1 -0
- package/lib/types/channel/history-restore.js +214 -0
- package/lib/types/channel/interaction.d.ts +38 -0
- package/lib/types/channel/interaction.d.ts.map +1 -0
- package/lib/types/channel/interaction.js +110 -0
- package/lib/types/channel/job-format.d.ts +6 -0
- package/lib/types/channel/job-format.d.ts.map +1 -0
- package/lib/types/channel/job-format.js +12 -0
- package/lib/types/channel/live-output.d.ts +35 -0
- package/lib/types/channel/live-output.d.ts.map +1 -0
- package/lib/types/channel/live-output.js +74 -0
- package/lib/types/channel/model-capabilities.d.ts +10 -0
- package/lib/types/channel/model-capabilities.d.ts.map +1 -0
- package/lib/types/channel/model-capabilities.js +51 -0
- package/lib/types/channel/permissions.d.ts +155 -0
- package/lib/types/channel/permissions.d.ts.map +1 -0
- package/lib/types/channel/permissions.js +188 -0
- package/lib/types/channel/projection.d.ts +110 -0
- package/lib/types/channel/projection.d.ts.map +1 -0
- package/lib/types/channel/projection.js +1521 -0
- package/lib/types/channel/question-record.d.ts +76 -0
- package/lib/types/channel/question-record.d.ts.map +1 -0
- package/lib/types/channel/question-record.js +109 -0
- package/lib/types/channel/questions.d.ts +204 -0
- package/lib/types/channel/questions.d.ts.map +1 -0
- package/lib/types/channel/questions.js +286 -0
- package/lib/types/channel/sanitize.d.ts +49 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -0
- package/lib/types/channel/sanitize.js +88 -0
- package/lib/types/channel/selection-record.d.ts +18 -0
- package/lib/types/channel/selection-record.d.ts.map +1 -0
- package/lib/types/channel/selection-record.js +45 -0
- package/lib/types/channel/side-prompts.d.ts +59 -0
- package/lib/types/channel/side-prompts.d.ts.map +1 -0
- package/lib/types/channel/side-prompts.js +127 -0
- package/lib/types/channel/transcript.d.ts +17 -0
- package/lib/types/channel/transcript.d.ts.map +1 -0
- package/lib/types/channel/transcript.js +19 -0
- package/lib/types/channel/usage.d.ts +48 -0
- package/lib/types/channel/usage.d.ts.map +1 -0
- package/lib/types/channel/usage.js +143 -0
- package/lib/types/commands.d.ts +147 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +196 -2
- package/lib/types/components/AgentMessageComposer.d.ts +50 -0
- package/lib/types/components/AgentMessageComposer.d.ts.map +1 -0
- package/lib/types/components/AgentMessageComposer.js +159 -0
- package/lib/types/components/BtwPanel.d.ts +13 -12
- package/lib/types/components/BtwPanel.d.ts.map +1 -1
- package/lib/types/components/BtwPanel.js +35 -24
- package/lib/types/components/ChannelPicker.d.ts +40 -0
- package/lib/types/components/ChannelPicker.d.ts.map +1 -0
- package/lib/types/components/ChannelPicker.js +26 -0
- package/lib/types/components/Chat/JobCard.d.ts +29 -31
- package/lib/types/components/Chat/JobCard.d.ts.map +1 -1
- package/lib/types/components/Chat/JobCard.js +31 -112
- package/lib/types/components/Chat/SubagentMessage.d.ts +4 -1
- package/lib/types/components/Chat/SubagentMessage.d.ts.map +1 -1
- package/lib/types/components/Chat/SubagentMessage.js +10 -3
- package/lib/types/components/ClaudeGirl.d.ts +27 -0
- package/lib/types/components/ClaudeGirl.d.ts.map +1 -0
- package/lib/types/components/ClaudeGirl.js +30 -0
- package/lib/types/components/CodeBlockFrame.d.ts +19 -0
- package/lib/types/components/CodeBlockFrame.d.ts.map +1 -0
- package/lib/types/components/CodeBlockFrame.js +138 -0
- package/lib/types/components/CommandSuggestions.d.ts +10 -1
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
- package/lib/types/components/CommandSuggestions.js +20 -3
- package/lib/types/components/ContextBarView.d.ts +2 -2
- package/lib/types/components/ContextBarView.d.ts.map +1 -1
- package/lib/types/components/ContextBarView.js +18 -8
- package/lib/types/components/EffortChargeGlyph.d.ts +1 -1
- package/lib/types/components/EffortChargeGlyph.d.ts.map +1 -1
- package/lib/types/components/EffortChargeGlyph.js +3 -4
- package/lib/types/components/EffortInputBorder.d.ts +1 -2
- package/lib/types/components/EffortInputBorder.d.ts.map +1 -1
- package/lib/types/components/EffortInputBorder.js +7 -4
- package/lib/types/components/EffortSlider.d.ts +5 -1
- package/lib/types/components/EffortSlider.d.ts.map +1 -1
- package/lib/types/components/EffortSlider.js +2 -2
- package/lib/types/components/EffortTierBadge.d.ts +1 -2
- package/lib/types/components/EffortTierBadge.d.ts.map +1 -1
- package/lib/types/components/EffortTierBadge.js +8 -5
- package/lib/types/components/GoalTodoPanel.d.ts +2 -1
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +11 -5
- package/lib/types/components/InlineMathParagraph.js +1 -1
- package/lib/types/components/JobsPanel.d.ts +8 -9
- package/lib/types/components/JobsPanel.d.ts.map +1 -1
- package/lib/types/components/JobsPanel.js +72 -13
- package/lib/types/components/KernelPicker.d.ts +28 -0
- package/lib/types/components/KernelPicker.d.ts.map +1 -0
- package/lib/types/components/KernelPicker.js +37 -0
- package/lib/types/components/LogoV2.d.ts +7 -1
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +120 -24
- package/lib/types/components/Markdown.d.ts +2 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +37 -8
- package/lib/types/components/MathBlock.d.ts.map +1 -1
- package/lib/types/components/MathBlock.js +3 -1
- package/lib/types/components/MermaidDiagram.d.ts.map +1 -1
- package/lib/types/components/MermaidDiagram.js +7 -5
- package/lib/types/components/MessageList.d.ts +21 -3
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +62 -42
- package/lib/types/components/ModePicker.d.ts +20 -0
- package/lib/types/components/ModePicker.d.ts.map +1 -0
- package/lib/types/components/ModePicker.js +17 -0
- package/lib/types/components/PromptInput.d.ts +2 -2
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +308 -55
- package/lib/types/components/SdkInstallWizard.d.ts +44 -0
- package/lib/types/components/SdkInstallWizard.d.ts.map +1 -0
- package/lib/types/components/SdkInstallWizard.js +18 -0
- package/lib/types/components/SearchBox.d.ts +7 -8
- package/lib/types/components/SearchBox.d.ts.map +1 -1
- package/lib/types/components/SearchBox.js +18 -9
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +113 -6
- package/lib/types/components/StarPrompt.d.ts.map +1 -1
- package/lib/types/components/StarPrompt.js +5 -3
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +6 -4
- package/lib/types/components/SubagentCard.d.ts +2 -1
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +25 -18
- package/lib/types/components/SubagentDashboard.d.ts +10 -6
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +32 -21
- package/lib/types/components/SubagentDetailScene.d.ts +16 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +196 -45
- package/lib/types/components/SyntaxText.d.ts.map +1 -1
- package/lib/types/components/SyntaxText.js +4 -1
- package/lib/types/components/TurnInterruptedRow.d.ts +3 -1
- package/lib/types/components/TurnInterruptedRow.d.ts.map +1 -1
- package/lib/types/components/TurnInterruptedRow.js +6 -3
- package/lib/types/components/TurnUsageRow.d.ts +24 -0
- package/lib/types/components/TurnUsageRow.d.ts.map +1 -0
- package/lib/types/components/TurnUsageRow.js +46 -0
- package/lib/types/components/WorkingSpinner.d.ts +2 -1
- package/lib/types/components/WorkingSpinner.d.ts.map +1 -1
- package/lib/types/components/WorkingSpinner.js +21 -4
- package/lib/types/components/approvals/ApprovalPanel.d.ts +36 -13
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +173 -25
- package/lib/types/components/claudeGirlSprite.d.ts +18 -0
- package/lib/types/components/claudeGirlSprite.d.ts.map +1 -0
- package/lib/types/components/claudeGirlSprite.js +48 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +46 -13
- package/lib/types/components/design-system/ThemedText.d.ts +3 -1
- package/lib/types/components/design-system/ThemedText.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemedText.js +2 -2
- package/lib/types/components/diffPatch.d.ts +55 -0
- package/lib/types/components/diffPatch.d.ts.map +1 -0
- package/lib/types/components/diffPatch.js +142 -0
- package/lib/types/components/kernelCatalog.d.ts +48 -0
- package/lib/types/components/kernelCatalog.d.ts.map +1 -0
- package/lib/types/components/kernelCatalog.js +53 -0
- package/lib/types/components/launchpadActions.d.ts +13 -6
- package/lib/types/components/launchpadActions.d.ts.map +1 -1
- package/lib/types/components/launchpadActions.js +26 -4
- package/lib/types/components/launchpadParams.d.ts +101 -0
- package/lib/types/components/launchpadParams.d.ts.map +1 -0
- package/lib/types/components/launchpadParams.js +171 -0
- package/lib/types/components/maidPortrait.d.ts +37 -5
- package/lib/types/components/maidPortrait.d.ts.map +1 -1
- package/lib/types/components/maidPortrait.js +73 -54
- package/lib/types/components/messages/AgentMessageFlow.d.ts +20 -0
- package/lib/types/components/messages/AgentMessageFlow.d.ts.map +1 -0
- package/lib/types/components/messages/AgentMessageFlow.js +37 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +6 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +29 -5
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +11 -2
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +289 -36
- package/lib/types/components/messages/TranscriptLeaves.d.ts +85 -0
- package/lib/types/components/messages/TranscriptLeaves.d.ts.map +1 -0
- package/lib/types/components/messages/TranscriptLeaves.js +74 -0
- package/lib/types/components/messages/agentTeam.d.ts +69 -0
- package/lib/types/components/messages/agentTeam.d.ts.map +1 -0
- package/lib/types/components/messages/agentTeam.js +53 -0
- package/lib/types/components/messages/liveOutputLines.d.ts +33 -0
- package/lib/types/components/messages/liveOutputLines.d.ts.map +1 -0
- package/lib/types/components/messages/liveOutputLines.js +100 -0
- package/lib/types/components/messages/subagentTranscript.d.ts +146 -0
- package/lib/types/components/messages/subagentTranscript.d.ts.map +1 -0
- package/lib/types/components/messages/subagentTranscript.js +304 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +16 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +76 -6
- package/lib/types/components/questions/PlanReviewPanel.d.ts +8 -3
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +11 -6
- package/lib/types/components/questions/ProviderModelEditor.d.ts +12 -0
- package/lib/types/components/questions/ProviderModelEditor.d.ts.map +1 -0
- package/lib/types/components/questions/ProviderModelEditor.js +266 -0
- package/lib/types/components/shimmer.d.ts +26 -0
- package/lib/types/components/shimmer.d.ts.map +1 -1
- package/lib/types/components/shimmer.js +26 -0
- package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/InfoPanel.js +13 -8
- package/lib/types/components/sidePanel/PanelBar.d.ts +0 -24
- package/lib/types/components/sidePanel/PanelBar.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelBar.js +55 -77
- package/lib/types/components/sidePanel/PanelStore.d.ts +3 -1
- package/lib/types/components/sidePanel/PanelStore.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelStore.js +8 -4
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts +3 -10
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelColumn.js +9 -12
- package/lib/types/components/sidePanel/TrajectoryPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/TrajectoryPanel.js +78 -14
- package/lib/types/components/sidePanel/agentViewStore.d.ts +20 -0
- package/lib/types/components/sidePanel/agentViewStore.d.ts.map +1 -0
- package/lib/types/components/sidePanel/agentViewStore.js +26 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +50 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.js +45 -0
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts +13 -0
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +147 -0
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +14 -0
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +131 -0
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts +30 -0
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/BtwThreadView.js +87 -0
- package/lib/types/components/sidePanel/btw/threads.d.ts +111 -0
- package/lib/types/components/sidePanel/btw/threads.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/threads.js +302 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +70 -30
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts +4 -46
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +19 -55
- package/lib/types/components/sidePanel/companion/mood.d.ts +32 -0
- package/lib/types/components/sidePanel/companion/mood.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/mood.js +44 -0
- package/lib/types/components/sidePanel/companion/skins.d.ts +34 -0
- package/lib/types/components/sidePanel/companion/skins.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/skins.js +203 -29
- package/lib/types/components/splashFonts.d.ts +17 -9
- package/lib/types/components/splashFonts.d.ts.map +1 -1
- package/lib/types/components/splashFonts.js +119 -15
- package/lib/types/components/splashLayout.d.ts.map +1 -1
- package/lib/types/components/splashLayout.js +3 -1
- package/lib/types/components/subagentDetailMemory.d.ts +17 -0
- package/lib/types/components/subagentDetailMemory.d.ts.map +1 -0
- package/lib/types/components/subagentDetailMemory.js +28 -0
- package/lib/types/components/trajectory/Inspector.d.ts.map +1 -1
- package/lib/types/components/trajectory/Inspector.js +9 -0
- package/lib/types/components/trajectory/Ledger.d.ts.map +1 -1
- package/lib/types/components/trajectory/Ledger.js +7 -1
- package/lib/types/components/trajectory/scope.d.ts +64 -0
- package/lib/types/components/trajectory/scope.d.ts.map +1 -0
- package/lib/types/components/trajectory/scope.js +88 -0
- package/lib/types/components/trajectory/useTrajectoryScope.d.ts +42 -0
- package/lib/types/components/trajectory/useTrajectoryScope.d.ts.map +1 -0
- package/lib/types/components/trajectory/useTrajectoryScope.js +86 -0
- package/lib/types/customTheme.d.ts +4 -6
- package/lib/types/customTheme.d.ts.map +1 -1
- package/lib/types/customTheme.js +6 -8
- package/lib/types/dsh-adapter/approvals.d.ts +18 -5
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
- package/lib/types/dsh-adapter/approvals.js +17 -4
- package/lib/types/dsh-adapter/backend/session.d.ts +64 -0
- package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend/session.js +291 -0
- package/lib/types/dsh-adapter/backend/translate.d.ts +58 -0
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend/translate.js +467 -0
- package/lib/types/dsh-adapter/backends.d.ts +49 -0
- package/lib/types/dsh-adapter/backends.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backends.js +124 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +16 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.js +109 -0
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +7 -5
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +19 -9
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +58 -135
- package/lib/types/dsh-adapter/channel/binding.d.ts +61 -14
- package/lib/types/dsh-adapter/channel/binding.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding.js +102 -35
- package/lib/types/dsh-adapter/channel/command-completions.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +33 -4
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/compaction.js +3 -2
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +5 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +4 -3
- package/lib/types/dsh-adapter/channel/core/actions.d.ts +39 -0
- package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/actions.js +152 -0
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +145 -0
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +289 -0
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +217 -0
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/compose.js +938 -0
- package/lib/types/dsh-adapter/channel/core/files.d.ts +57 -0
- package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/files.js +45 -0
- package/lib/types/dsh-adapter/channel/core/host.d.ts +55 -0
- package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/host.js +116 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +46 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.js +117 -0
- package/lib/types/dsh-adapter/channel/core/local-images.d.ts +20 -0
- package/lib/types/dsh-adapter/channel/core/local-images.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/local-images.js +147 -0
- package/lib/types/dsh-adapter/channel/core/reports.d.ts +12 -0
- package/lib/types/dsh-adapter/channel/core/reports.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/reports.js +77 -0
- package/lib/types/dsh-adapter/channel/core/session-controls.d.ts +39 -0
- package/lib/types/dsh-adapter/channel/core/session-controls.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/session-controls.js +219 -0
- package/lib/types/dsh-adapter/channel/core/session-switch.d.ts +174 -0
- package/lib/types/dsh-adapter/channel/core/session-switch.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/session-switch.js +390 -0
- package/lib/types/dsh-adapter/channel/core/sessions.d.ts +40 -0
- package/lib/types/dsh-adapter/channel/core/sessions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/sessions.js +268 -0
- package/lib/types/dsh-adapter/channel/decisions.d.ts +4 -3
- package/lib/types/dsh-adapter/channel/decisions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/decisions.js +4 -4
- package/lib/types/dsh-adapter/channel/emitter.d.ts +15 -2
- package/lib/types/dsh-adapter/channel/emitter.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/emitter.js +5 -3
- package/lib/types/dsh-adapter/channel/extensions.d.ts +36 -0
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/extensions.js +714 -0
- package/lib/types/dsh-adapter/channel/ide-selection.d.ts +1 -10
- package/lib/types/dsh-adapter/channel/ide-selection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/ide-selection.js +4 -46
- package/lib/types/dsh-adapter/channel/input-actions.d.ts +27 -4
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +240 -21
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +21 -5
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +65 -27
- package/lib/types/dsh-adapter/channel/local-actions.d.ts +10 -32
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +10 -78
- package/lib/types/dsh-adapter/channel/local-fs.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/local-fs.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/local-fs.js +46 -0
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +38 -5
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +9 -6
- package/lib/types/dsh-adapter/channel/preferences.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/preferences.js +16 -0
- package/lib/types/dsh-adapter/channel/projection.d.ts +16 -13
- package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection.js +38 -1143
- package/lib/types/dsh-adapter/channel/question-record.d.ts +3 -75
- package/lib/types/dsh-adapter/channel/question-record.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/question-record.js +3 -107
- package/lib/types/dsh-adapter/channel/session-activity.d.ts +9 -0
- package/lib/types/dsh-adapter/channel/session-activity.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-activity.js +42 -0
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts +4 -4
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-adoption.js +3 -1
- package/lib/types/dsh-adapter/channel/session-fork.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +2 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +7 -3
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +2 -9
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- 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 +4 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +5 -10
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +74 -113
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts +4 -4
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +7 -6
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +4 -4
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +8 -7
- package/lib/types/dsh-adapter/channel/settings-host.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +8 -0
- package/lib/types/dsh-adapter/channel/skill-catalog.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/skill-catalog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/skill-catalog.js +2 -2
- package/lib/types/dsh-adapter/channel/state.d.ts +72 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +7 -3
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +58 -3
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +153 -9
- package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts +114 -0
- package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/subagent-transcript.js +279 -0
- package/lib/types/dsh-adapter/channel/transcript.d.ts +7 -15
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +17 -21
- package/lib/types/dsh-adapter/channel/types.d.ts +16 -7
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/usage.d.ts +3 -23
- package/lib/types/dsh-adapter/channel/usage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/usage.js +5 -111
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.js +2 -1
- package/lib/types/dsh-adapter/channel.d.ts +17 -8
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +24 -1059
- package/lib/types/dsh-adapter/context-occupancy.d.ts +6 -1
- package/lib/types/dsh-adapter/context-occupancy.d.ts.map +1 -1
- package/lib/types/dsh-adapter/context-occupancy.js +6 -1
- package/lib/types/dsh-adapter/decision-guard.d.ts +24 -0
- package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/decision-guard.js +44 -0
- package/lib/types/dsh-adapter/extension-events.d.ts +4 -1
- package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/extension-events.js +22 -10
- package/lib/types/dsh-adapter/index.d.ts +41 -3
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +28 -1
- package/lib/types/dsh-adapter/jobs.d.ts +5 -3
- package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/jobs.js +53 -14
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts +1 -16
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts.map +1 -1
- package/lib/types/dsh-adapter/migrate/parse/jsonl.js +3 -29
- package/lib/types/dsh-adapter/oauth-credential-source.d.ts +34 -0
- package/lib/types/dsh-adapter/oauth-credential-source.d.ts.map +1 -0
- package/lib/types/dsh-adapter/oauth-credential-source.js +66 -0
- package/lib/types/dsh-adapter/plugin.d.ts +38 -2
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +546 -110
- package/lib/types/dsh-adapter/provider-model-capabilities.d.ts +10 -0
- package/lib/types/dsh-adapter/provider-model-capabilities.d.ts.map +1 -0
- package/lib/types/dsh-adapter/provider-model-capabilities.js +80 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts +8 -2
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +118 -52
- package/lib/types/dsh-adapter/questions.d.ts +29 -124
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +33 -267
- package/lib/types/dsh-adapter/recap.d.ts +3 -15
- package/lib/types/dsh-adapter/recap.d.ts.map +1 -1
- package/lib/types/dsh-adapter/recap.js +3 -46
- package/lib/types/dsh-adapter/sanitize.d.ts +4 -44
- package/lib/types/dsh-adapter/sanitize.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sanitize.js +4 -84
- package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts +3 -1
- package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts.map +1 -1
- package/lib/types/dsh-adapter/session-mount-heartbeat.js +4 -2
- package/lib/types/dsh-adapter/sessions/digest.d.ts +18 -3
- package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/digest.js +60 -27
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +6 -4
- package/lib/types/dsh-adapter/sessions/recovery.d.ts +2 -2
- package/lib/types/dsh-adapter/sessions/recovery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/recovery.js +23 -14
- package/lib/types/dsh-adapter/sessions/store.d.ts +2 -0
- package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/store.js +1 -0
- package/lib/types/dsh-adapter/sessions/types.d.ts +2 -0
- package/lib/types/dsh-adapter/sessions/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sideQuestion.js +3 -13
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +7 -0
- package/lib/types/dsh-adapter/themes.d.ts +1 -1
- package/lib/types/dsh-adapter/themes.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/agent-source.d.ts +84 -0
- package/lib/types/dsh-adapter/trajectory/agent-source.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/agent-source.js +601 -0
- package/lib/types/dsh-adapter/trajectory/guards.d.ts +31 -1
- package/lib/types/dsh-adapter/trajectory/guards.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/guards.js +28 -0
- package/lib/types/dsh-adapter/trajectory/index.d.ts +3 -1
- package/lib/types/dsh-adapter/trajectory/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/index.js +1 -0
- package/lib/types/dsh-adapter/trajectory/inspect.d.ts +7 -0
- package/lib/types/dsh-adapter/trajectory/inspect.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/inspect.js +70 -2
- package/lib/types/dsh-adapter/trajectory/projection.d.ts +4 -0
- package/lib/types/dsh-adapter/trajectory/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/projection.js +36 -0
- package/lib/types/dsh-adapter/trajectory/types.d.ts +13 -0
- package/lib/types/dsh-adapter/trajectory/types.d.ts.map +1 -1
- package/lib/types/effortPrefs.d.ts +7 -0
- package/lib/types/effortPrefs.d.ts.map +1 -1
- package/lib/types/effortPrefs.js +11 -2
- package/lib/types/handoffAck.d.ts +57 -0
- package/lib/types/handoffAck.d.ts.map +1 -0
- package/lib/types/handoffAck.js +154 -0
- package/lib/types/handoffEvents.d.ts +52 -0
- package/lib/types/handoffEvents.d.ts.map +1 -0
- package/lib/types/handoffEvents.js +128 -0
- package/lib/types/i18n.d.ts +3189 -68
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +855 -9
- package/lib/types/ink/colorize.d.ts.map +1 -1
- package/lib/types/ink/colorize.js +8 -2
- package/lib/types/ink/components/AlternateScreen.d.ts +12 -1
- package/lib/types/ink/components/AlternateScreen.d.ts.map +1 -1
- package/lib/types/ink/components/AlternateScreen.js +25 -4
- package/lib/types/ink/components/App.d.ts +5 -1
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +52 -5
- package/lib/types/ink/components/Image.d.ts +8 -1
- package/lib/types/ink/components/Image.d.ts.map +1 -1
- package/lib/types/ink/components/Image.js +2 -2
- package/lib/types/ink/components/Text.d.ts +8 -1
- package/lib/types/ink/components/Text.d.ts.map +1 -1
- package/lib/types/ink/components/Text.js +11 -1
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/dom.js +75 -3
- package/lib/types/ink/hooks/use-input.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-input.js +9 -4
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +8 -2
- package/lib/types/ink/kitty-graphics.d.ts +7 -2
- package/lib/types/ink/kitty-graphics.d.ts.map +1 -1
- package/lib/types/ink/kitty-graphics.js +15 -7
- package/lib/types/ink/node-cache.d.ts +15 -1
- package/lib/types/ink/node-cache.d.ts.map +1 -1
- package/lib/types/ink/node-cache.js +4 -1
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +2 -0
- package/lib/types/ink/parse-keypress.d.ts +13 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +438 -19
- package/lib/types/ink/reconciler.d.ts.map +1 -1
- package/lib/types/ink/reconciler.js +9 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +200 -4
- package/lib/types/ink/render-stats.d.ts +35 -0
- package/lib/types/ink/render-stats.d.ts.map +1 -0
- package/lib/types/ink/render-stats.js +53 -0
- package/lib/types/ink/sixel-codec.d.ts +11 -1
- package/lib/types/ink/sixel-codec.d.ts.map +1 -1
- package/lib/types/ink/sixel-codec.js +10 -3
- package/lib/types/ink/sixel-graphics.js +2 -2
- package/lib/types/ink/styles.d.ts +46 -0
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.d.ts +7 -0
- package/lib/types/ink/terminal-image.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.d.ts +1 -1
- package/lib/types/ink/terminal-querier.js +4 -4
- package/lib/types/ink/text-decoration.d.ts +49 -0
- package/lib/types/ink/text-decoration.d.ts.map +1 -0
- package/lib/types/ink/text-decoration.js +235 -0
- package/lib/types/ink/update-overflow-guard.d.ts +9 -0
- package/lib/types/ink/update-overflow-guard.d.ts.map +1 -1
- package/lib/types/ink/update-overflow-guard.js +41 -0
- package/lib/types/ink/wrap-text.d.ts.map +1 -1
- package/lib/types/ink/wrap-text.js +5 -1
- package/lib/types/kernelPrefs.d.ts +51 -0
- package/lib/types/kernelPrefs.d.ts.map +1 -0
- package/lib/types/kernelPrefs.js +126 -0
- package/lib/types/modelRecents.d.ts +10 -2
- package/lib/types/modelRecents.d.ts.map +1 -1
- package/lib/types/modelRecents.js +20 -7
- package/lib/types/screens/AgentTranscriptScene.d.ts +42 -0
- package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -0
- package/lib/types/screens/AgentTranscriptScene.js +269 -0
- package/lib/types/screens/Chat.d.ts +45 -7
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +625 -113
- package/lib/types/screens/Launchpad.d.ts +24 -7
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +147 -28
- package/lib/types/screens/SessionSupervisor.d.ts +3 -3
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +69 -5
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +211 -7
- package/lib/types/screens/StatusLine.d.ts +40 -1
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +131 -19
- package/lib/types/screens/StatusMetrics.d.ts +53 -17
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +141 -30
- package/lib/types/screens/TrajectoryScene.d.ts.map +1 -1
- package/lib/types/screens/TrajectoryScene.js +74 -12
- package/lib/types/screens/chat/backendCommands.d.ts +37 -0
- package/lib/types/screens/chat/backendCommands.d.ts.map +1 -0
- package/lib/types/screens/chat/backendCommands.js +51 -0
- package/lib/types/screens/chat/useBackendChannels.d.ts +20 -0
- package/lib/types/screens/chat/useBackendChannels.d.ts.map +1 -0
- package/lib/types/screens/chat/useBackendChannels.js +117 -0
- package/lib/types/screens/chat/useKernelPicker.d.ts +23 -0
- package/lib/types/screens/chat/useKernelPicker.d.ts.map +1 -0
- package/lib/types/screens/chat/useKernelPicker.js +72 -0
- package/lib/types/screens/chatOverlay.d.ts +32 -2
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/screens/chatOverlay.js +9 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useForeignSessions.js +5 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +14 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +97 -22
- package/lib/types/sessionHistory.d.ts +18 -1
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +46 -4
- package/lib/types/sessionPins.d.ts +7 -0
- package/lib/types/sessionPins.d.ts.map +1 -1
- package/lib/types/sessionPins.js +9 -0
- package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
- package/lib/types/sessions/resumeFailure.js +2 -1
- package/lib/types/settings/definitions.d.ts +74 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +50 -4
- package/lib/types/terminal-utils/hyperlink.d.ts +2 -2
- package/lib/types/terminal-utils/hyperlink.d.ts.map +1 -1
- package/lib/types/terminal-utils/hyperlink.js +21 -4
- package/lib/types/terminal-utils/markdown.d.ts +34 -6
- package/lib/types/terminal-utils/markdown.d.ts.map +1 -1
- package/lib/types/terminal-utils/markdown.js +257 -66
- package/lib/types/theme.d.ts +49 -8
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +514 -18
- package/lib/types/tips.js +2 -2
- package/lib/types/trajectory/effortIgnition.d.ts +25 -7
- package/lib/types/trajectory/effortIgnition.d.ts.map +1 -1
- package/lib/types/trajectory/effortIgnition.js +106 -34
- package/lib/types/trajectory/window.d.ts +26 -0
- package/lib/types/trajectory/window.d.ts.map +1 -0
- package/lib/types/trajectory/window.js +27 -0
- package/lib/types/tuiDisplayPrefs.d.ts +38 -1
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +45 -1
- package/lib/types/update.d.ts +88 -3
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +285 -18
- package/lib/types/utils/crashDetail.d.ts +56 -0
- package/lib/types/utils/crashDetail.d.ts.map +1 -0
- package/lib/types/utils/crashDetail.js +175 -0
- package/lib/types/utils/imageResize.d.ts +9 -23
- package/lib/types/utils/imageResize.d.ts.map +1 -1
- package/lib/types/utils/imageResize.js +24 -20
- package/lib/types/utils/inputPaste.d.ts +9 -8
- package/lib/types/utils/inputPaste.d.ts.map +1 -1
- package/lib/types/utils/inputPaste.js +53 -16
- package/lib/types/utils/jsonl.d.ts +24 -0
- package/lib/types/utils/jsonl.d.ts.map +1 -0
- package/lib/types/utils/jsonl.js +36 -0
- package/package.json +18 -2
|
@@ -0,0 +1,938 @@
|
|
|
1
|
+
import { markChannelReadDirty } from '../../../adapter/channel/read-view.js';
|
|
2
|
+
import { createActivityProjection } from '../../../channel/activity.js';
|
|
3
|
+
import { channelCapabilities } from '../../../channel/capabilities.js';
|
|
4
|
+
import { anchoredRow, prependHistoryRows, projectHistorySlice, restoreFoldedRows } from '../../../channel/history-restore.js';
|
|
5
|
+
import { t } from '../../../i18n.js';
|
|
6
|
+
import { WORKING_GATE_NOTICES } from '../../../commands.js';
|
|
7
|
+
import { logForDebugging } from '../../../utils/debug.js';
|
|
8
|
+
import { DEFAULT_SESSION_MODES } from '../../../sessionModes.js';
|
|
9
|
+
import { resolveContextOccupancy } from '../../context-occupancy.js';
|
|
10
|
+
import { IdeChannel, ideLockDir } from '../../ide-channel.js';
|
|
11
|
+
import { createChannelActionMethods, createChannelActionReadiness } from '../action-readiness.js';
|
|
12
|
+
import { createAttachedContextRegistry } from '../attached-context.js';
|
|
13
|
+
import { createChannelBinding } from '../binding.js';
|
|
14
|
+
import { channelCommands } from '../commands.js';
|
|
15
|
+
import { createComposerImages } from '../composer-images.js';
|
|
16
|
+
import { createContextBookkeeping } from '../context-bookkeeping.js';
|
|
17
|
+
import { createChannelEmitter } from '../emitter.js';
|
|
18
|
+
import { createSelectionAttachments } from '../ide-selection.js';
|
|
19
|
+
import { createInputActions } from '../input-actions.js';
|
|
20
|
+
import { createInputDelivery } from '../input-delivery.js';
|
|
21
|
+
import { createChannelNotifications } from '../notifications.js';
|
|
22
|
+
import { registerChannelOwner } from '../owner.js';
|
|
23
|
+
import { unavailablePermissionPresetSnapshot } from '../permissions.js';
|
|
24
|
+
import { createPreferences } from '../preferences.js';
|
|
25
|
+
import { createSettingsHosts } from '../settings-host.js';
|
|
26
|
+
import { createInitialChannelView } from '../state.js';
|
|
27
|
+
import { createCapabilityDelegates, installChannelActions } from './actions.js';
|
|
28
|
+
import { createBindingFeed } from './binding-feed.js';
|
|
29
|
+
import { createCoreFiles, NO_COMPLETION_CATALOG } from './files.js';
|
|
30
|
+
import { createGitBranchRefresher, resolveCoreHost, startHostSubscriptions } from './host.js';
|
|
31
|
+
import { createCoreLocalActions } from './local-actions.js';
|
|
32
|
+
import { createLocalImageStore } from './local-images.js';
|
|
33
|
+
import { createCoreReports } from './reports.js';
|
|
34
|
+
import { createSessionControls, localCommandsFor } from './session-controls.js';
|
|
35
|
+
import { createCoreSessionActions } from './sessions.js';
|
|
36
|
+
import { createWorkspaceActions } from '../workspace-actions.js';
|
|
37
|
+
import { createBackendOpener, createSessionSwitch, SESSION_MOUNT_LEDGER } from './session-switch.js';
|
|
38
|
+
import { createAgentTrajectorySource } from '../../trajectory/agent-source.js';
|
|
39
|
+
/** Token buffer below the context window at which the context-low warning fires. */
|
|
40
|
+
const CONTEXT_WARNING_BUFFER_TOKENS = 20_000;
|
|
41
|
+
/** No image may be staged (a session lost the capability mid-call). */
|
|
42
|
+
const NO_IMAGES = Object.freeze({ mediaTypes: Object.freeze([]), maxImageBytes: 0, maxImagesPerMessage: 0, maxMessageImageBytes: 0, maxImageDimension: 0, maxImagePixels: 0 });
|
|
43
|
+
/** The job registry feed is a DSH host service; nothing feeds it by default. */
|
|
44
|
+
const NO_JOB_FEED = { onOutputSeen: () => undefined, onStarted: () => undefined };
|
|
45
|
+
export function createCoreChannel(ctx, initialSession, options, owner) {
|
|
46
|
+
const rowIds = { value: 0 };
|
|
47
|
+
const binding = createChannelBinding(initialSession, owner);
|
|
48
|
+
// A session that owns its own lifetime (no host registry disposes it, i.e.
|
|
49
|
+
// any non-DSH backend) is closed when the channel releases. Registered
|
|
50
|
+
// first, so a throw anywhere later in construction still stops it. Replaced
|
|
51
|
+
// sessions are closed by the binding at adoption.
|
|
52
|
+
owner.own(() => { binding.releaseOwned(); });
|
|
53
|
+
const host = resolveCoreHost(ctx, owner);
|
|
54
|
+
let extension = {};
|
|
55
|
+
let started = false;
|
|
56
|
+
const emitter = createChannelEmitter(() => state, () => extension.flushDeferred?.() ?? false, {
|
|
57
|
+
// Folding drops a row's full text on the promise that `loadOlder`
|
|
58
|
+
// restores it; without a history slicer every row stays whole. A
|
|
59
|
+
// session's durable transcript restores only rows with a stable anchor.
|
|
60
|
+
fold: () => extension.loadOlder !== undefined || binding.session.capabilities.transcript !== undefined,
|
|
61
|
+
restorable: row => extension.loadOlder !== undefined || anchoredRow(row),
|
|
62
|
+
});
|
|
63
|
+
// The emitter exists before the complete state surface. Put it in the
|
|
64
|
+
// construction rollback funnel immediately; normal release remains
|
|
65
|
+
// idempotent through the same disposer.
|
|
66
|
+
owner.own(() => emitter.dispose());
|
|
67
|
+
const notify = (...args) => {
|
|
68
|
+
if (!owner.current())
|
|
69
|
+
return () => undefined;
|
|
70
|
+
return channelCommands(state).notify(...args);
|
|
71
|
+
};
|
|
72
|
+
/** The explicit failure every unbacked action reports. */
|
|
73
|
+
const unavailable = (name) => {
|
|
74
|
+
notify(t('capability-unavailable-backend', { name }), { color: 'warning', timeoutMs: 4000 });
|
|
75
|
+
};
|
|
76
|
+
const unavailableLines = (name) => [t('capability-unavailable-backend', { name })];
|
|
77
|
+
const guarded = async (name, fallback, run, current = () => owner.current()) => {
|
|
78
|
+
try {
|
|
79
|
+
return await run();
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (current())
|
|
83
|
+
notify(t('capability-failed', { name, err: error instanceof Error ? error.message : String(error) }), { color: 'error', timeoutMs: 8000 });
|
|
84
|
+
return fallback;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
// A backend host belongs to one session and binding generation. Its
|
|
88
|
+
// controls, reports and notices must not reach a replacement session.
|
|
89
|
+
const mcpFence = () => {
|
|
90
|
+
const capture = binding.capture();
|
|
91
|
+
return { session: capture.session, current: () => binding.isCurrent(capture) };
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Subagents and background jobs of a session no extension projects: fed by
|
|
95
|
+
* the shared projector in stream order. Output tails are read through the
|
|
96
|
+
* session's `tasks` capability while a card is watched.
|
|
97
|
+
*/
|
|
98
|
+
const activity = createActivityProjection(() => state, {
|
|
99
|
+
rowIds,
|
|
100
|
+
notify: (...args) => notify(...args),
|
|
101
|
+
emit: () => { if (owner.current())
|
|
102
|
+
state.emit(); },
|
|
103
|
+
readOutput: taskId => binding.session.capabilities.tasks?.readOutput?.(taskId),
|
|
104
|
+
});
|
|
105
|
+
owner.own(() => { activity.dispose(); });
|
|
106
|
+
const activityOwned = () => extension.ownsActivity !== true;
|
|
107
|
+
/**
|
|
108
|
+
* The core's own trajectory source: an incremental fold of the neutral
|
|
109
|
+
* AgentEvent stream into the raw-event vocabulary the trajectory
|
|
110
|
+
* projection consumes. Sessions without a durable DSH log (Claude today)
|
|
111
|
+
* use it, so they report 'empty'/'supported' instead of 'unsupported'.
|
|
112
|
+
* When an extension owns the trajectory (DSH: raw history) this fold stays
|
|
113
|
+
* inert, the same ownership rule as the activity projection above.
|
|
114
|
+
*/
|
|
115
|
+
const agentTrajectory = createAgentTrajectorySource();
|
|
116
|
+
const trajectoryOwned = () => extension.ownsTrajectory !== true;
|
|
117
|
+
/**
|
|
118
|
+
* The binding generation the view was last `/clear`ed in. `/clear` is
|
|
119
|
+
* view-only on every backend. Until another session is bound, history
|
|
120
|
+
* older than the cleared view must not come back through "load earlier"
|
|
121
|
+
* (rows folded after the clear still restore) and the divider is hidden.
|
|
122
|
+
*/
|
|
123
|
+
let clearedGeneration;
|
|
124
|
+
const viewCleared = () => clearedGeneration !== undefined && clearedGeneration === state.agentBindingGeneration;
|
|
125
|
+
/** "Load earlier" through the session's durable transcript: restore the
|
|
126
|
+
* folded rows first, then prepend the next older slice. */
|
|
127
|
+
const transcriptLoadOlder = () => {
|
|
128
|
+
const transcript = binding.session.capabilities.transcript;
|
|
129
|
+
if (transcript === undefined)
|
|
130
|
+
return 0;
|
|
131
|
+
const failed = (error) => {
|
|
132
|
+
notify(t('capability-failed', { name: 'load earlier', err: error instanceof Error ? error.message : String(error) }), { color: 'error', timeoutMs: 8000 });
|
|
133
|
+
return 0;
|
|
134
|
+
};
|
|
135
|
+
try {
|
|
136
|
+
if (state.rows.some(row => row.folded === true)) {
|
|
137
|
+
const record = transcript.record();
|
|
138
|
+
const restored = record === undefined ? 0 : restoreFoldedRows(state.rows, record);
|
|
139
|
+
if (restored > 0)
|
|
140
|
+
return restored;
|
|
141
|
+
}
|
|
142
|
+
if (viewCleared() || !transcript.hasOlder())
|
|
143
|
+
return 0;
|
|
144
|
+
return prependHistoryRows(state.rows, projectHistorySlice(transcript.older(), state.thinkingFold));
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
return failed(error);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const bookkeeping = createContextBookkeeping(() => state, (text, notifyOptions) => notify(text, notifyOptions), percent => t('context-low-warning', { percent }), CONTEXT_WARNING_BUFFER_TOKENS);
|
|
151
|
+
const { resetContextWarning, checkContextWarning, trackPending, untrackPending } = bookkeeping;
|
|
152
|
+
// IDE selection link: one IdeChannel per channel, started in the
|
|
153
|
+
// background against the session cwd (lock discovery needs it; env
|
|
154
|
+
// direct-connect does not). start() never throws and degrades on its
|
|
155
|
+
// own, so a missing IDE costs nothing and startup never waits on the
|
|
156
|
+
// loopback dial.
|
|
157
|
+
const ideChannel = new IdeChannel();
|
|
158
|
+
// The loopback link lives outside every other owner: own its stop at once
|
|
159
|
+
// so a construction failure past this line releases it (`stop` is
|
|
160
|
+
// idempotent; `releaseContributions` stops it again in its finally).
|
|
161
|
+
owner.own(() => { ideChannel.stop(); });
|
|
162
|
+
void ideChannel.start(process.env, ideLockDir(), options.cwd).catch(() => { });
|
|
163
|
+
let currentSelection;
|
|
164
|
+
ideChannel.onSelection(snapshot => {
|
|
165
|
+
// The channel already clears empty snapshots internally; mirror that here
|
|
166
|
+
// so consumption reads one consistent variable.
|
|
167
|
+
currentSelection = snapshot.isEmpty ? undefined : snapshot;
|
|
168
|
+
// Live prompt-footer badge: the selection must reach the screen before
|
|
169
|
+
// the user submits. emit() bumps `version` so the useSyncExternalStore
|
|
170
|
+
// tree re-renders with the new badge immediately.
|
|
171
|
+
state.selection = currentSelection;
|
|
172
|
+
state.emit();
|
|
173
|
+
});
|
|
174
|
+
/**
|
|
175
|
+
* Re-target the IDE selection link when the session's working directory
|
|
176
|
+
* changes (/resume, /workspace, /new, an adopted background session).
|
|
177
|
+
* Otherwise a selection from the old workspace stays visible (the badge
|
|
178
|
+
* shows it and the next submit attaches the wrong file) and the old link
|
|
179
|
+
* keeps pushing the old window's selections into the new one. rebind()
|
|
180
|
+
* drops the link and rediscovers against the new cwd. Callers set
|
|
181
|
+
* state.cwd before this runs, so it reads the fresh value.
|
|
182
|
+
*/
|
|
183
|
+
const resetIdeSelection = () => {
|
|
184
|
+
currentSelection = undefined;
|
|
185
|
+
state.selection = undefined;
|
|
186
|
+
state.emit();
|
|
187
|
+
void ideChannel.rebind(state.cwd).catch(() => { });
|
|
188
|
+
};
|
|
189
|
+
const selectionAttachments = createSelectionAttachments();
|
|
190
|
+
// "Send to Chat": staged panel contexts are session-scoped like the
|
|
191
|
+
// selection above. The registry writes through the live state, so every
|
|
192
|
+
// session-projection reset clears them with everything else, and the
|
|
193
|
+
// submit path takes them all in one step. Backend-neutral: the context is
|
|
194
|
+
// sent as one more text block of the submission.
|
|
195
|
+
const contextRegistry = createAttachedContextRegistry(() => state, () => state.emit());
|
|
196
|
+
/**
|
|
197
|
+
* Images for a session that takes them itself (the `images` capability):
|
|
198
|
+
* held in memory by the core (local-images.ts), under the bound session's
|
|
199
|
+
* limits; a DSH session keeps the attachments service.
|
|
200
|
+
*/
|
|
201
|
+
let localImageStore;
|
|
202
|
+
const localImages = () => {
|
|
203
|
+
if (binding.session.capabilities.images === undefined)
|
|
204
|
+
return undefined;
|
|
205
|
+
localImageStore ??= createLocalImageStore(() => binding.session.capabilities.images?.limits ?? NO_IMAGES);
|
|
206
|
+
return localImageStore;
|
|
207
|
+
};
|
|
208
|
+
const composer = createComposerImages(ctx, owner, { generation: () => state.agentBindingGeneration, localImages });
|
|
209
|
+
const files = createCoreFiles(ctx, {
|
|
210
|
+
owner,
|
|
211
|
+
binding,
|
|
212
|
+
state: () => state,
|
|
213
|
+
host,
|
|
214
|
+
localFallback: () => extension.localFs !== false,
|
|
215
|
+
// Read late: the session controls are built after the files.
|
|
216
|
+
mcpServers: () => controls.mcpServers(),
|
|
217
|
+
});
|
|
218
|
+
const inputDelivery = createInputDelivery(ctx, owner, binding, () => state, (...args) => notify(...args), trackPending, untrackPending, composer, () => currentSelection, (messageId, info) => selectionAttachments.remember(messageId, info), files.fallbackFs, localImages, () => contextRegistry.consume());
|
|
219
|
+
const { dispatchUserText, withDecisionPending, clearStagedImages } = inputDelivery;
|
|
220
|
+
/** Monotonic token: only the latest `interruptAndDeliver` re-queues, so a
|
|
221
|
+
* second interrupt while the abort settles cannot double-deliver. */
|
|
222
|
+
const inputConvergence = { interruptSeq: 0, cancelInFlight: false, cancelCause: undefined };
|
|
223
|
+
/**
|
|
224
|
+
* Monotonic counter for parent-mediated message intents. The intentId
|
|
225
|
+
* names the local submission only. It is never a durable message id, and
|
|
226
|
+
* the parent's own SendMessage call (whenever the model makes it) is
|
|
227
|
+
* matched by its call id, not by this.
|
|
228
|
+
*/
|
|
229
|
+
let agentMessageIntents = 0;
|
|
230
|
+
const messaging = binding.session.capabilities.subagents?.messaging;
|
|
231
|
+
const actionReadiness = createChannelActionReadiness();
|
|
232
|
+
const getReadyActions = () => {
|
|
233
|
+
owner.assertActive();
|
|
234
|
+
return actionReadiness.getReadyActions();
|
|
235
|
+
};
|
|
236
|
+
const actionMethods = createChannelActionMethods(getReadyActions);
|
|
237
|
+
const backendLabel = options.backendLabel ?? initialSession.ref.backendId;
|
|
238
|
+
const snapshotOf = (session) => channelCapabilities({
|
|
239
|
+
backendId: session.ref.backendId,
|
|
240
|
+
backendLabel,
|
|
241
|
+
capabilities: session.capabilities,
|
|
242
|
+
dsh: false,
|
|
243
|
+
resume: options.openSession !== undefined && options.sessionCatalog !== undefined,
|
|
244
|
+
deleteAction: options.sessionCatalog?.deleteAction,
|
|
245
|
+
});
|
|
246
|
+
const initialCapabilities = snapshotOf(initialSession);
|
|
247
|
+
/**
|
|
248
|
+
* `ChannelUi.capabilities()` for a session no extension describes: what the
|
|
249
|
+
* session itself serves, in the composition-fact vocabulary the UI routes
|
|
250
|
+
* `/compact` and `/plan` by. `/compact` is the channel's compact action
|
|
251
|
+
* (delegated to the session's `compact` capability); `/plan` has no
|
|
252
|
+
* registry route (a backend's plan mode is one of its native modes).
|
|
253
|
+
*/
|
|
254
|
+
const sessionAgentCapabilities = () => {
|
|
255
|
+
const caps = binding.session.capabilities;
|
|
256
|
+
const compact = caps.compact !== undefined;
|
|
257
|
+
return {
|
|
258
|
+
compact: compact ? { route: 'local' } : { route: 'none', reasonKey: 'capability-reason-no-compaction' },
|
|
259
|
+
plan: { route: 'none', reasonKey: 'capability-reason-no-plan-command' },
|
|
260
|
+
compaction: compact,
|
|
261
|
+
pruner: false,
|
|
262
|
+
questionTool: caps.questions !== undefined,
|
|
263
|
+
skills: false,
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
// Official occupancy source (absent in compositions without the token meter,
|
|
267
|
+
// and never holding a non-DSH session's id): `read` is a cached lookup, so
|
|
268
|
+
// the accessor on the state below stays cheap.
|
|
269
|
+
const contextPressure = options.contextPressure;
|
|
270
|
+
const state = {
|
|
271
|
+
...createInputActions(() => state, () => binding.session, owner, inputConvergence, composer, (text, placement, images) => dispatchUserText(text, placement, images), (command, includeInContext) => getReadyActions().runLocalCommand(command, includeInContext), sessionId => { extension.touchSession?.(sessionId); }),
|
|
272
|
+
subscribe: emitter.subscribe,
|
|
273
|
+
emit: emitter.emit,
|
|
274
|
+
emitStream: emitter.emitStream,
|
|
275
|
+
...createSettingsHosts(ctx, owner.assertActive),
|
|
276
|
+
...createPreferences(() => state),
|
|
277
|
+
/** Mount-owned settings namespace: the section registers under it, so this
|
|
278
|
+
* is the only ns whose section carries the TUI's user layer. */
|
|
279
|
+
settingsNamespace: options.settingsNs ?? 'dsh-tui',
|
|
280
|
+
// The open-time recap is an extension feature (DSH: one LLM call).
|
|
281
|
+
autoRecapOnOpen: false,
|
|
282
|
+
...createInitialChannelView(options, {
|
|
283
|
+
agentId: initialSession.ref.sessionId,
|
|
284
|
+
sessionId: initialSession.ref.sessionId,
|
|
285
|
+
// The unmarked base mode: backend-native modes are a capability.
|
|
286
|
+
mode: DEFAULT_SESSION_MODES[0],
|
|
287
|
+
cwdDescription: host.workspaceService.describe(options.cwd).description ?? options.cwd,
|
|
288
|
+
}),
|
|
289
|
+
// Deprecated pre-rename alias of `minimalUi`. An accessor is required here
|
|
290
|
+
// (a field set in createInitialChannelView would be copied by the spread
|
|
291
|
+
// into a stale data property). Read-only on purpose: the only supported
|
|
292
|
+
// write path is `setMinimalUi()` / its `setMinimal()` alias.
|
|
293
|
+
get minimal() {
|
|
294
|
+
return state.minimalUi;
|
|
295
|
+
},
|
|
296
|
+
/**
|
|
297
|
+
* Context occupancy is derived on read, not stored: the cached host
|
|
298
|
+
* projection value (a map lookup) combined with this channel's own
|
|
299
|
+
* fallback sample and capacity. An accessor avoids republishing it from
|
|
300
|
+
* every site that can move the window or the sample (replay, resume,
|
|
301
|
+
* model switch, reset).
|
|
302
|
+
*/
|
|
303
|
+
get contextOccupancy() {
|
|
304
|
+
return resolveContextOccupancy(contextPressure?.read(state.sessionId), state.lastUsage, state.contextWindow, feed.projector.contextUsage());
|
|
305
|
+
},
|
|
306
|
+
commandList: localCommandsFor(initialCapabilities.commands),
|
|
307
|
+
backendCapabilities: initialCapabilities,
|
|
308
|
+
capabilities: () => extension.agentCapabilities?.() ?? sessionAgentCapabilities(),
|
|
309
|
+
get sessionRef() {
|
|
310
|
+
const ref = binding.session.ref;
|
|
311
|
+
return { backendId: ref.backendId, sessionId: ref.sessionId };
|
|
312
|
+
},
|
|
313
|
+
costReport: undefined,
|
|
314
|
+
rateLimit: undefined,
|
|
315
|
+
get olderHistory() {
|
|
316
|
+
return extension.loadOlder === undefined && !viewCleared() && (binding.session.capabilities.transcript?.hasOlder() ?? false);
|
|
317
|
+
},
|
|
318
|
+
backendInit: () => {
|
|
319
|
+
const fence = mcpFence();
|
|
320
|
+
const init = fence.session.capabilities.init;
|
|
321
|
+
if (extension.delegates?.initWorkspace !== undefined || init === undefined)
|
|
322
|
+
return undefined;
|
|
323
|
+
return { run: () => guarded('init', false, async () => {
|
|
324
|
+
if (!fence.current())
|
|
325
|
+
return false;
|
|
326
|
+
await init.run();
|
|
327
|
+
return true;
|
|
328
|
+
}, fence.current) };
|
|
329
|
+
},
|
|
330
|
+
backendAuth: () => {
|
|
331
|
+
const fence = mcpFence();
|
|
332
|
+
const auth = fence.session.capabilities.auth;
|
|
333
|
+
if (auth === undefined)
|
|
334
|
+
return undefined;
|
|
335
|
+
const oauth = ctx.get('dshAuth')?.api;
|
|
336
|
+
const backend = state.backendCapabilities.backendLabel;
|
|
337
|
+
return { login: async (present) => {
|
|
338
|
+
const login = auth.login?.bind(auth);
|
|
339
|
+
if (login !== undefined) {
|
|
340
|
+
const loginOAuth = oauth === undefined || auth.oauthProvider === undefined ? undefined : async () => {
|
|
341
|
+
const outcome = await present(oauth, auth.oauthProvider);
|
|
342
|
+
return outcome === 'added' || outcome === 'updated';
|
|
343
|
+
};
|
|
344
|
+
await guarded('login', undefined, () => login(loginOAuth));
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
const lines = await auth.status().then(report => report.lines)
|
|
348
|
+
.catch((error) => [t('capability-failed', { name: 'login', err: error instanceof Error ? error.message : String(error) })]);
|
|
349
|
+
channelCommands(state).pushLocal('/login', [t('login-backend-heading', { backend }), ...lines, ...(oauth === undefined ? [t('login-backend-no-oauth')] : [])]);
|
|
350
|
+
if (oauth === undefined || auth.oauthProvider === undefined)
|
|
351
|
+
return;
|
|
352
|
+
const outcome = await present(oauth, auth.oauthProvider);
|
|
353
|
+
if (outcome !== 'added' && outcome !== 'signed-out')
|
|
354
|
+
return;
|
|
355
|
+
try {
|
|
356
|
+
await auth.reconnect();
|
|
357
|
+
notify(t('login-backend-reconnected', { backend }), { color: 'success' });
|
|
358
|
+
}
|
|
359
|
+
catch (error) {
|
|
360
|
+
notify(t('login-backend-reconnect-failed', { err: error instanceof Error ? error.message : String(error) }), { color: 'error', timeoutMs: 8000 });
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
logout: () => guarded('logout', false, async () => {
|
|
364
|
+
if (!fence.current())
|
|
365
|
+
return false;
|
|
366
|
+
if (oauth === undefined || auth.oauthProvider === undefined) {
|
|
367
|
+
notify(t('login-backend-no-oauth'), { color: 'warning' });
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
const removed = await oauth.logout(auth.oauthProvider);
|
|
371
|
+
if (fence.current())
|
|
372
|
+
notify(t(removed ? 'login-backend-oauth-removed' : 'login-backend-oauth-missing', { provider: auth.oauthProvider }), { color: removed ? 'success' : 'warning', timeoutMs: 8000 });
|
|
373
|
+
// Do not reconnect or call the native auth capability: a native
|
|
374
|
+
// login is not ours to erase; already-loaded tokens need a restart.
|
|
375
|
+
return removed;
|
|
376
|
+
}, fence.current), };
|
|
377
|
+
},
|
|
378
|
+
backendChannels: () => {
|
|
379
|
+
const fence = mcpFence();
|
|
380
|
+
const channels = fence.session.capabilities.channels;
|
|
381
|
+
if (channels === undefined)
|
|
382
|
+
return undefined;
|
|
383
|
+
const activeId = channels.activeId();
|
|
384
|
+
// Keep the connection before this host's writes: save may replace the
|
|
385
|
+
// active row under the same id before activate decides whether to restart.
|
|
386
|
+
const fingerprint = channels.list().find(option => option.id === activeId)?.connection?.fingerprint;
|
|
387
|
+
const restartFor = (option) => fingerprint !== option.connection?.fingerprint;
|
|
388
|
+
const write = (fallback, run) => {
|
|
389
|
+
if (!fence.current())
|
|
390
|
+
return fallback;
|
|
391
|
+
try {
|
|
392
|
+
return run();
|
|
393
|
+
}
|
|
394
|
+
catch (error) {
|
|
395
|
+
if (fence.current())
|
|
396
|
+
notify(t('capability-failed', { name: 'channel', err: error instanceof Error ? error.message : String(error) }), { color: 'error', timeoutMs: 8000 });
|
|
397
|
+
return fallback;
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
return {
|
|
401
|
+
snapshot: () => ({ channels: channels.list(), activeId: channels.activeId() }),
|
|
402
|
+
activate: id => {
|
|
403
|
+
if (!fence.current())
|
|
404
|
+
return { ok: false, restart: false };
|
|
405
|
+
const option = channels.list().find(option => option.id === id);
|
|
406
|
+
if (option === undefined) {
|
|
407
|
+
unavailable('channel');
|
|
408
|
+
return { ok: false, restart: false };
|
|
409
|
+
}
|
|
410
|
+
const restart = restartFor(option);
|
|
411
|
+
if (restart && state.working) {
|
|
412
|
+
notify(t(WORKING_GATE_NOTICES.channel), { color: 'warning' });
|
|
413
|
+
return { ok: false, restart };
|
|
414
|
+
}
|
|
415
|
+
channels.setActive(id);
|
|
416
|
+
try {
|
|
417
|
+
controls.refreshModelDisplay(fence.session);
|
|
418
|
+
state.emit();
|
|
419
|
+
}
|
|
420
|
+
catch (error) {
|
|
421
|
+
logForDebugging(`channel: model display refresh failed (${error instanceof Error ? error.message : String(error)})`);
|
|
422
|
+
}
|
|
423
|
+
return { ok: true, restart };
|
|
424
|
+
},
|
|
425
|
+
importFromSettings: () => write(undefined, () => {
|
|
426
|
+
const importingActiveId = channels.activeId();
|
|
427
|
+
const option = channels.importFromSettings();
|
|
428
|
+
return option === undefined ? undefined : { option, restart: option.id === importingActiveId && restartFor(option) };
|
|
429
|
+
}),
|
|
430
|
+
save: input => write(undefined, () => channels.save(input)),
|
|
431
|
+
remove: id => write(false, () => channels.remove(id)),
|
|
432
|
+
peekImport: () => {
|
|
433
|
+
try {
|
|
434
|
+
return channels.peekSettingsImport();
|
|
435
|
+
}
|
|
436
|
+
catch {
|
|
437
|
+
return undefined;
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
};
|
|
441
|
+
},
|
|
442
|
+
backendModes: () => {
|
|
443
|
+
const fence = mcpFence();
|
|
444
|
+
const modes = fence.session.capabilities.modes;
|
|
445
|
+
if (modes === undefined)
|
|
446
|
+
return undefined;
|
|
447
|
+
return {
|
|
448
|
+
snapshot: () => {
|
|
449
|
+
const list = modes.list();
|
|
450
|
+
return {
|
|
451
|
+
modes: list.map(mode => ({ id: mode.id, name: mode.label, ...(mode.description === undefined ? {} : { description: mode.description }) })),
|
|
452
|
+
currentIndex: list.findIndex(mode => mode.id === modes.current()),
|
|
453
|
+
};
|
|
454
|
+
},
|
|
455
|
+
set: id => guarded('mode', false, async () => {
|
|
456
|
+
if (!fence.current())
|
|
457
|
+
return false;
|
|
458
|
+
if (!modes.list().some(mode => mode.id === id)) {
|
|
459
|
+
unavailable('mode');
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
await modes.set(id);
|
|
463
|
+
return true;
|
|
464
|
+
}, fence.current),
|
|
465
|
+
};
|
|
466
|
+
},
|
|
467
|
+
backendMcp: () => {
|
|
468
|
+
const fence = mcpFence();
|
|
469
|
+
const mcp = fence.session.capabilities.mcp;
|
|
470
|
+
if (mcp?.reconnect === undefined || mcp.toggle === undefined)
|
|
471
|
+
return undefined;
|
|
472
|
+
const run = (name, key, action) => guarded('mcp', false, async () => {
|
|
473
|
+
if (!fence.current())
|
|
474
|
+
return false;
|
|
475
|
+
await action();
|
|
476
|
+
if (fence.current()) {
|
|
477
|
+
notify(t(key, { name }), { color: 'success' });
|
|
478
|
+
controls.mcpReport(fence.session, fence.current);
|
|
479
|
+
}
|
|
480
|
+
return true;
|
|
481
|
+
}, fence.current);
|
|
482
|
+
return {
|
|
483
|
+
reconnect: name => run(name, 'mcp-reconnected', () => mcp.reconnect(name)),
|
|
484
|
+
toggle: (name, enabled) => run(name, enabled ? 'mcp-enabled' : 'mcp-disabled', () => mcp.toggle(name, enabled)),
|
|
485
|
+
};
|
|
486
|
+
},
|
|
487
|
+
backendGoals: () => {
|
|
488
|
+
const fence = mcpFence();
|
|
489
|
+
const goals = fence.session.capabilities.goals;
|
|
490
|
+
if (goals === undefined)
|
|
491
|
+
return undefined;
|
|
492
|
+
// The capability only asks for the change: the goal itself arrives as
|
|
493
|
+
// `goal.change` (projected like every other session fact).
|
|
494
|
+
const run = (key, action) => guarded('goal', false, async () => {
|
|
495
|
+
if (!fence.current())
|
|
496
|
+
return false;
|
|
497
|
+
await action();
|
|
498
|
+
if (fence.current())
|
|
499
|
+
notify(t(key), { color: 'success' });
|
|
500
|
+
return true;
|
|
501
|
+
}, fence.current);
|
|
502
|
+
return {
|
|
503
|
+
set: (objective, options) => run('goal-backend-set', () => goals.set(objective, options?.tokenBudget === undefined ? undefined : { tokenBudget: options.tokenBudget })),
|
|
504
|
+
pause: () => run('goal-backend-paused', () => goals.pause()),
|
|
505
|
+
resume: () => run('goal-backend-resumed', () => goals.resume()),
|
|
506
|
+
clear: () => run('goal-backend-cleared', () => goals.clear()),
|
|
507
|
+
};
|
|
508
|
+
},
|
|
509
|
+
...actionMethods,
|
|
510
|
+
subagentControl: {
|
|
511
|
+
interrupt: agentId => {
|
|
512
|
+
const control = binding.session.capabilities.subagents;
|
|
513
|
+
if (control === undefined) {
|
|
514
|
+
unavailable('agents');
|
|
515
|
+
return false;
|
|
516
|
+
}
|
|
517
|
+
const subagent = activity.subagent(agentId);
|
|
518
|
+
if (subagent === undefined || (subagent.status !== 'running' && subagent.status !== 'starting'))
|
|
519
|
+
return false;
|
|
520
|
+
void control.interrupt(subagent.agentId).then(stopped => {
|
|
521
|
+
if (!stopped && owner.current())
|
|
522
|
+
notify(t('subagent-interrupt-failed', { id: subagent.agentId.slice(0, 8) }), { color: 'warning', timeoutMs: 6000 });
|
|
523
|
+
}, (error) => {
|
|
524
|
+
if (owner.current())
|
|
525
|
+
notify(t('capability-failed', { name: 'agents', err: error instanceof Error ? error.message : String(error) }), { color: 'error', timeoutMs: 8000 });
|
|
526
|
+
});
|
|
527
|
+
return true;
|
|
528
|
+
},
|
|
529
|
+
// The child transcript source exists only while the bound session's
|
|
530
|
+
// `subagents.history` capability does (Claude's store read; the DSH
|
|
531
|
+
// extension replaces this whole control with one backed by its own
|
|
532
|
+
// child transcript reader). The detail scene renders a Transcript page
|
|
533
|
+
// only when this method exists. A failed read resolves null, so the
|
|
534
|
+
// scene shows "unavailable" rather than an empty transcript.
|
|
535
|
+
...(binding.session.capabilities.subagents?.history === undefined ? {} : {
|
|
536
|
+
history: (agentId, window) => {
|
|
537
|
+
const history = binding.session.capabilities.subagents?.history;
|
|
538
|
+
if (history === undefined)
|
|
539
|
+
return Promise.resolve(null);
|
|
540
|
+
return history(agentId, window).catch(() => null);
|
|
541
|
+
},
|
|
542
|
+
}),
|
|
543
|
+
/** Parent-mediated messaging uses the session's submit pipeline. */
|
|
544
|
+
...(messaging === undefined ? {} : {
|
|
545
|
+
message: {
|
|
546
|
+
via: messaging,
|
|
547
|
+
steer: false,
|
|
548
|
+
listTargets: () => Promise.resolve(state.subagents.map(sub => ({
|
|
549
|
+
agentId: sub.agentId,
|
|
550
|
+
...(sub.sessionId === undefined ? {} : { sessionId: sub.sessionId }),
|
|
551
|
+
label: sub.description,
|
|
552
|
+
...(sub.mode === undefined ? {} : { mode: sub.mode }),
|
|
553
|
+
status: sub.status,
|
|
554
|
+
}))),
|
|
555
|
+
submit: (input) => {
|
|
556
|
+
const text = input.text.trim();
|
|
557
|
+
if (text === '')
|
|
558
|
+
return Promise.resolve({ ok: false, reason: 'failed', message: 'empty text' });
|
|
559
|
+
const name = input.targetName !== undefined && input.targetName.trim() !== '' ? input.targetName.trim() : input.targetId;
|
|
560
|
+
const tool = binding.session.capabilities.subagents?.messagingTool;
|
|
561
|
+
const envelope = tool === undefined ? t('agent-message-envelope', { name, id: input.targetId, text }) : t('agent-message-native-envelope', { tool, name, id: input.targetId, text });
|
|
562
|
+
const intentId = `agent-message-${(agentMessageIntents += 1)}`;
|
|
563
|
+
dispatchUserText(envelope, 'followup', [], undefined);
|
|
564
|
+
return Promise.resolve({ ok: true, intentId, state: 'issued' });
|
|
565
|
+
},
|
|
566
|
+
messages: () => activity.agentMessages(),
|
|
567
|
+
},
|
|
568
|
+
}),
|
|
569
|
+
},
|
|
570
|
+
jobControl: {
|
|
571
|
+
kill: id => {
|
|
572
|
+
const tasks = binding.session.capabilities.tasks;
|
|
573
|
+
if (tasks === undefined) {
|
|
574
|
+
unavailable('jobs');
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
const job = activity.job(id);
|
|
578
|
+
if (job === undefined || (job.status !== 'running' && job.status !== 'stopping'))
|
|
579
|
+
return false;
|
|
580
|
+
void tasks.stop(id).then(stopped => {
|
|
581
|
+
if (!stopped && owner.current())
|
|
582
|
+
notify(t('jobs-kill-failed', { id }), { color: 'error', timeoutMs: 6000 });
|
|
583
|
+
}, (error) => {
|
|
584
|
+
if (owner.current())
|
|
585
|
+
notify(t('capability-failed', { name: 'jobs', err: error instanceof Error ? error.message : String(error) }), { color: 'error', timeoutMs: 8000 });
|
|
586
|
+
});
|
|
587
|
+
return true;
|
|
588
|
+
},
|
|
589
|
+
watchOutput: id => activity.watchOutput(id),
|
|
590
|
+
},
|
|
591
|
+
stagedImageGeneration: composer.stagedImageGeneration,
|
|
592
|
+
stageImage: composer.stageImage,
|
|
593
|
+
stageComposerImage: composer.stageComposerImage,
|
|
594
|
+
hasStagedImage: composer.hasStagedImage,
|
|
595
|
+
discardStagedImage: composer.discardStagedImage,
|
|
596
|
+
stagedImage: composer.stagedImage,
|
|
597
|
+
stagedImageLimits: composer.stagedImageLimits,
|
|
598
|
+
// "Send to Chat" projection + actions (see `contextRegistry` above; its
|
|
599
|
+
// methods close over the registry's own state, so they carry no `this`).
|
|
600
|
+
attachedContexts: [],
|
|
601
|
+
attachContext: contextRegistry.attach,
|
|
602
|
+
detachContext: contextRegistry.detach,
|
|
603
|
+
// The core rewind prompt (capability-backed); the DSH extension
|
|
604
|
+
// replaces it with its plugin-decision prompt.
|
|
605
|
+
promptRewind: row => sessionActions.promptRewind(row),
|
|
606
|
+
buildSessionTree: () => {
|
|
607
|
+
unavailable('tree');
|
|
608
|
+
return Promise.resolve(null);
|
|
609
|
+
},
|
|
610
|
+
notify: createChannelNotifications(() => state, owner),
|
|
611
|
+
permissionPresets: () => unavailablePermissionPresetSnapshot(),
|
|
612
|
+
settingsSections: () => host.settingsSectionsRuntime?.list() ?? [],
|
|
613
|
+
subscribeSettingsSections: listener => emitter.subscribe(listener),
|
|
614
|
+
pluginScene: host.sceneRuntime?.active,
|
|
615
|
+
openPluginScene: id => host.sceneRuntime?.open(id) ?? false,
|
|
616
|
+
closePluginScene: () => { host.sceneRuntime?.close(); },
|
|
617
|
+
releaseContributions() {
|
|
618
|
+
// Owner cleanup is exhaustive, but it can report an external cleanup
|
|
619
|
+
// failure. The emitter and the IDE loopback link live outside the owner
|
|
620
|
+
// and must still stop whichever earlier step throws; a plain trailing
|
|
621
|
+
// ideChannel.stop() would be skipped when owner.dispose() throws and
|
|
622
|
+
// leak the socket.
|
|
623
|
+
try {
|
|
624
|
+
owner.dispose();
|
|
625
|
+
}
|
|
626
|
+
finally {
|
|
627
|
+
try {
|
|
628
|
+
emitter.dispose();
|
|
629
|
+
}
|
|
630
|
+
finally {
|
|
631
|
+
ideChannel.stop();
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
// The core trajectory uses the same raw-event port shape as each source.
|
|
636
|
+
traceEvents: () => agentTrajectory.events(),
|
|
637
|
+
// Per-agent lane drilldown from the same fold. When an extension owns the
|
|
638
|
+
// trajectory (DSH: raw history) the fold receives no events, so lanes()
|
|
639
|
+
// is empty and the scope filter is not offered; the raw DSH log has no
|
|
640
|
+
// lane attribution to filter by.
|
|
641
|
+
trajectoryLanes: () => agentTrajectory.lanes(),
|
|
642
|
+
trajectoryLaneEvents: (agentId, descendants) => descendants === true ? agentTrajectory.descendantEvents(agentId) : agentTrajectory.laneEvents(agentId),
|
|
643
|
+
// The source label: the core serves the trajectory from the neutral
|
|
644
|
+
// AgentEvent fold; the DSH extension overrides the label together with
|
|
645
|
+
// the source accessors.
|
|
646
|
+
trajectoryBackendLabel: () => t('trajectory-backend-agent-events'),
|
|
647
|
+
// Trajectory availability: the core mounts the neutral AgentEvent fold,
|
|
648
|
+
// so a session it serves alone reports 'empty' before the first mapped
|
|
649
|
+
// event and 'supported' after. 'unsupported' is only for a composition
|
|
650
|
+
// that mounted no source at all (decided from the composition, never by
|
|
651
|
+
// backendId). The DSH extension overrides both accessors with its raw
|
|
652
|
+
// history.
|
|
653
|
+
trajectorySource: () => (agentTrajectory.events().length === 0 ? 'empty' : 'supported'),
|
|
654
|
+
};
|
|
655
|
+
// Register the raw state before any extension can synchronously publish a
|
|
656
|
+
// callback. The renderer lease binds its external authority later, but this
|
|
657
|
+
// owner already makes teardown and construction failure fail closed.
|
|
658
|
+
registerChannelOwner(state, owner);
|
|
659
|
+
// The projection's change feed is the only thing that can move occupancy
|
|
660
|
+
// between session events (a compaction rewriting the surface, the prompt
|
|
661
|
+
// growing before the next request); republish so the footer, the status
|
|
662
|
+
// commands and the warning read the fresh value immediately. The store is
|
|
663
|
+
// host-wide and the emit is unconditional; the accessor already ignores
|
|
664
|
+
// another session's value.
|
|
665
|
+
if (contextPressure !== undefined) {
|
|
666
|
+
owner.own(contextPressure.subscribe(() => {
|
|
667
|
+
if (owner.current())
|
|
668
|
+
state.emit();
|
|
669
|
+
}));
|
|
670
|
+
}
|
|
671
|
+
const controls = createSessionControls({ state: () => state, backendLabel: () => state.backendCapabilities.backendLabel });
|
|
672
|
+
const feed = createBindingFeed(ctx, {
|
|
673
|
+
owner,
|
|
674
|
+
binding,
|
|
675
|
+
state,
|
|
676
|
+
options,
|
|
677
|
+
inputConvergence,
|
|
678
|
+
projection: {
|
|
679
|
+
rowIds, resetContextWarning,
|
|
680
|
+
jobs: NO_JOB_FEED,
|
|
681
|
+
activity: { apply: (event, replaying) => { if (activityOwned())
|
|
682
|
+
activity.apply(event, replaying); } },
|
|
683
|
+
trajectory: { observe: (event, replaying) => { if (trajectoryOwned())
|
|
684
|
+
agentTrajectory.observe(event, replaying); } },
|
|
685
|
+
checkContextWarning, notify: (...args) => notify(...args),
|
|
686
|
+
renderer: host.rendererRuntime,
|
|
687
|
+
selectionAttached: messageId => selectionAttachments.take(messageId),
|
|
688
|
+
},
|
|
689
|
+
resetTrajectory: () => { if (trajectoryOwned())
|
|
690
|
+
agentTrajectory.reset(); },
|
|
691
|
+
retireAttachment: inputDelivery.retireAttachment,
|
|
692
|
+
controls,
|
|
693
|
+
hooks: () => extension.bind ?? {},
|
|
694
|
+
onReset: event => { resetConversation(event); },
|
|
695
|
+
});
|
|
696
|
+
/**
|
|
697
|
+
* The backend reset the conversation in place (Claude `conversation_reset`:
|
|
698
|
+
* a plan-mode exit that clears the context, a fresh-session flow). The
|
|
699
|
+
* rows, subagent and job rosters, usage, cost and title all belonged to
|
|
700
|
+
* the discarded conversation, so they go as on a session switch and a
|
|
701
|
+
* notice row says why. Queued inputs stay (the backend still runs them).
|
|
702
|
+
* Unlike the TUI's own view-only `/clear`, this follows a reset the
|
|
703
|
+
* backend made.
|
|
704
|
+
*/
|
|
705
|
+
const resetConversation = (event) => {
|
|
706
|
+
state.rows.length = 0;
|
|
707
|
+
markChannelReadDirty(state.rows);
|
|
708
|
+
rowIds.value = 0;
|
|
709
|
+
feed.resetProjection();
|
|
710
|
+
extension.dropRows?.();
|
|
711
|
+
if (activityOwned())
|
|
712
|
+
activity.reset();
|
|
713
|
+
// The discarded conversation's trajectory goes with its rows: the fold
|
|
714
|
+
// restarts empty and the report goes back to 'empty'.
|
|
715
|
+
if (trajectoryOwned())
|
|
716
|
+
agentTrajectory.reset();
|
|
717
|
+
state.todos = [];
|
|
718
|
+
state.sessionTitle = '';
|
|
719
|
+
state.tokens = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, peak: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, idle: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 } };
|
|
720
|
+
state.mainCost = {};
|
|
721
|
+
state.subagentCost = [];
|
|
722
|
+
state.costReport = undefined;
|
|
723
|
+
state.lastUsage = undefined;
|
|
724
|
+
state.turnUsage = undefined;
|
|
725
|
+
state.contextSegments = { system: 0, prompt: 0, assistant: 0, thinking: 0, tools: 0 };
|
|
726
|
+
state.activeToolCount = 0;
|
|
727
|
+
state.responseChars = 0;
|
|
728
|
+
state.compaction = undefined;
|
|
729
|
+
resetContextWarning();
|
|
730
|
+
// The history before the reset is another conversation's: "load
|
|
731
|
+
// earlier" never brings it back above this view.
|
|
732
|
+
clearedGeneration = state.agentBindingGeneration;
|
|
733
|
+
const key = event.trigger === 'clear' ? 'conversation-reset-clear'
|
|
734
|
+
: event.trigger === 'plan_mode_exit' ? 'conversation-reset-plan'
|
|
735
|
+
: event.trigger === 'fresh_session' ? 'conversation-reset-fresh'
|
|
736
|
+
: 'conversation-reset';
|
|
737
|
+
state.rows.push({ id: rowIds.value++, kind: 'notice', text: t(key) });
|
|
738
|
+
state.emit();
|
|
739
|
+
};
|
|
740
|
+
/** `!!` commands on their way to the session (`/new` waits them out). */
|
|
741
|
+
const shellInputs = { started: 0, inFlight: 0 };
|
|
742
|
+
const sessionSwitch = createSessionSwitch(ctx, {
|
|
743
|
+
owner,
|
|
744
|
+
binding,
|
|
745
|
+
state: () => state,
|
|
746
|
+
notify,
|
|
747
|
+
withDecisionPending,
|
|
748
|
+
conversationKey: session => extension.conversationKey?.(session) ?? session,
|
|
749
|
+
describeWorkspace: cwd => host.workspaceService.describe(cwd),
|
|
750
|
+
resetIdeSelection,
|
|
751
|
+
clearStagedImages,
|
|
752
|
+
opener: () => extension.newSession ?? defaultOpeners?.create,
|
|
753
|
+
resumeOpener: () => extension.resumeSession ?? defaultOpeners?.resume,
|
|
754
|
+
activity: () => {
|
|
755
|
+
const fifo = inputDelivery.activity();
|
|
756
|
+
return {
|
|
757
|
+
inputs: fifo.dispatched + shellInputs.started,
|
|
758
|
+
unsettled: fifo.unsettled || shellInputs.inFlight > 0,
|
|
759
|
+
turnStarts: feed.router.turnStarts(),
|
|
760
|
+
...(fifo.parked !== undefined ? { parked: fifo.parked } : shellInputs.inFlight > 0 ? { parked: '!!' } : {}),
|
|
761
|
+
};
|
|
762
|
+
},
|
|
763
|
+
unavailable,
|
|
764
|
+
});
|
|
765
|
+
/** `/new` and `/resume` on a session no extension claims: the backend's
|
|
766
|
+
* own `open`. */
|
|
767
|
+
const defaultOpeners = options.openSession === undefined ? undefined : createBackendOpener({
|
|
768
|
+
open: options.openSession,
|
|
769
|
+
state,
|
|
770
|
+
rowIds,
|
|
771
|
+
resetProjection: feed.resetProjection,
|
|
772
|
+
resetActivity: () => { activity.reset(); },
|
|
773
|
+
snapshotOf,
|
|
774
|
+
resetControls: controls.reset,
|
|
775
|
+
bind: seed => feed.bind(seed),
|
|
776
|
+
bound: () => binding.session,
|
|
777
|
+
mounts: SESSION_MOUNT_LEDGER,
|
|
778
|
+
...(options.sessionPrefs === undefined ? {} : { touch: (sessionId) => options.sessionPrefs?.touch(sessionId) }),
|
|
779
|
+
notify,
|
|
780
|
+
});
|
|
781
|
+
/** The browser's catalog, `/resume`, `/fork` and the rewind (core). */
|
|
782
|
+
const sessionActions = createCoreSessionActions({
|
|
783
|
+
owner,
|
|
784
|
+
session: () => binding.session,
|
|
785
|
+
state: () => state,
|
|
786
|
+
notify,
|
|
787
|
+
unavailable,
|
|
788
|
+
catalog: options.sessionCatalog,
|
|
789
|
+
prefs: options.sessionPrefs,
|
|
790
|
+
resumeCommand: options.resumeCommand,
|
|
791
|
+
resume: (sessionId, kind) => sessionSwitch.resumeSession(sessionId, kind),
|
|
792
|
+
// `/resume` (the browser's open) also needs the catalog, the same rule
|
|
793
|
+
// as the capability snapshot; a rewind adopts its fork by `open` alone.
|
|
794
|
+
canOpen: options.openSession !== undefined && options.sessionCatalog !== undefined,
|
|
795
|
+
});
|
|
796
|
+
const local = createCoreLocalActions(ctx, {
|
|
797
|
+
owner,
|
|
798
|
+
binding,
|
|
799
|
+
state,
|
|
800
|
+
rowIds,
|
|
801
|
+
workspace: host.workspaceService,
|
|
802
|
+
resetProjection: feed.resetProjection,
|
|
803
|
+
notify,
|
|
804
|
+
unavailable,
|
|
805
|
+
dropRows: () => {
|
|
806
|
+
extension.dropRows?.();
|
|
807
|
+
if (activityOwned())
|
|
808
|
+
activity.dropRows();
|
|
809
|
+
},
|
|
810
|
+
loadOlder: () => extension.loadOlder ?? (binding.session.capabilities.transcript === undefined ? undefined : transcriptLoadOlder),
|
|
811
|
+
beginInput: () => {
|
|
812
|
+
shellInputs.started += 1;
|
|
813
|
+
shellInputs.inFlight += 1;
|
|
814
|
+
let ended = false;
|
|
815
|
+
return () => {
|
|
816
|
+
if (ended)
|
|
817
|
+
return;
|
|
818
|
+
ended = true;
|
|
819
|
+
shellInputs.inFlight -= 1;
|
|
820
|
+
};
|
|
821
|
+
},
|
|
822
|
+
});
|
|
823
|
+
const reports = createCoreReports({ owner, binding, state: () => state });
|
|
824
|
+
/** A fresh session in another directory (the session browser's new-session
|
|
825
|
+
* card, `/workspace`'s handoff): the core `/new` with a target. */
|
|
826
|
+
const workspaces = createWorkspaceActions(state, {
|
|
827
|
+
owner,
|
|
828
|
+
service: host.workspaceService,
|
|
829
|
+
newSession: target => sessionSwitch.newSession(target),
|
|
830
|
+
refreshGitBranch: () => refreshGitBranch(),
|
|
831
|
+
notify,
|
|
832
|
+
});
|
|
833
|
+
const refreshGitBranch = createGitBranchRefresher(ctx, {
|
|
834
|
+
owner,
|
|
835
|
+
state,
|
|
836
|
+
noteBranch: branch => { extension.noteBranch?.(branch); },
|
|
837
|
+
});
|
|
838
|
+
return {
|
|
839
|
+
state,
|
|
840
|
+
owner,
|
|
841
|
+
binding,
|
|
842
|
+
rowIds,
|
|
843
|
+
host,
|
|
844
|
+
notify,
|
|
845
|
+
unavailable,
|
|
846
|
+
bookkeeping,
|
|
847
|
+
composer,
|
|
848
|
+
input: inputDelivery,
|
|
849
|
+
inputConvergence,
|
|
850
|
+
feed,
|
|
851
|
+
sessionSwitch,
|
|
852
|
+
local,
|
|
853
|
+
files,
|
|
854
|
+
reports,
|
|
855
|
+
resetIdeSelection,
|
|
856
|
+
refreshGitBranch,
|
|
857
|
+
/** Merge an extension's contributions (before `start`). */
|
|
858
|
+
extend(next) {
|
|
859
|
+
if (started)
|
|
860
|
+
throw new Error('dsh-tui: Channel extensions must attach before the channel starts');
|
|
861
|
+
extension = {
|
|
862
|
+
...extension,
|
|
863
|
+
...next,
|
|
864
|
+
delegates: { ...extension.delegates, ...next.delegates },
|
|
865
|
+
};
|
|
866
|
+
},
|
|
867
|
+
/** Install the actions, start the runtime, bind the session. */
|
|
868
|
+
start() {
|
|
869
|
+
if (started)
|
|
870
|
+
throw new Error('dsh-tui: Channel already started');
|
|
871
|
+
started = true;
|
|
872
|
+
const core = {
|
|
873
|
+
commandCompletions: files.commandCompletions(extension.completions ?? NO_COMPLETION_CATALOG),
|
|
874
|
+
runLocalCommand: local.runLocalCommand,
|
|
875
|
+
loadOlder: local.loadOlder,
|
|
876
|
+
clear: () => {
|
|
877
|
+
local.clear();
|
|
878
|
+
clearedGeneration = state.agentBindingGeneration;
|
|
879
|
+
},
|
|
880
|
+
setActivityFrames: local.setActivityFrames,
|
|
881
|
+
pushLocal: local.pushLocal,
|
|
882
|
+
listFileCandidates: files.listFileCandidates,
|
|
883
|
+
listFiles: files.listFiles,
|
|
884
|
+
doctorInfo: reports.doctorInfo,
|
|
885
|
+
exportSession: reports.exportSession,
|
|
886
|
+
newSession: () => sessionSwitch.newSession(),
|
|
887
|
+
// `/agents` from the event-driven roster (the DSH extension serves its own).
|
|
888
|
+
mcpStatus: () => {
|
|
889
|
+
if (binding.session.capabilities.mcp === undefined)
|
|
890
|
+
return unavailableLines('mcp');
|
|
891
|
+
const fence = mcpFence();
|
|
892
|
+
return controls.mcpReport(fence.session, fence.current) ?? [t('backend-mcp-loading')];
|
|
893
|
+
},
|
|
894
|
+
listSubagents: () => Promise.resolve(binding.session.capabilities.subagents === undefined ? unavailableLines('agents') : activity.listLines()),
|
|
895
|
+
resolveWorkspace: workspaces.resolveWorkspace,
|
|
896
|
+
switchWorkspace: workspaces.switchWorkspace,
|
|
897
|
+
...sessionActions.delegates,
|
|
898
|
+
};
|
|
899
|
+
installChannelActions(actionReadiness, {
|
|
900
|
+
unavailable,
|
|
901
|
+
unavailableLines,
|
|
902
|
+
capability: createCapabilityDelegates({
|
|
903
|
+
owner,
|
|
904
|
+
session: () => binding.session,
|
|
905
|
+
state: () => state,
|
|
906
|
+
notify,
|
|
907
|
+
unavailable,
|
|
908
|
+
unavailableLines,
|
|
909
|
+
guarded,
|
|
910
|
+
}),
|
|
911
|
+
core,
|
|
912
|
+
extension: extension.delegates,
|
|
913
|
+
});
|
|
914
|
+
// Everything below can synchronously invoke external callbacks. It runs
|
|
915
|
+
// only after the owner is registered and the complete delegate surface
|
|
916
|
+
// is installed; the outer construction transaction rolls every step back.
|
|
917
|
+
extension.start?.before?.();
|
|
918
|
+
startHostSubscriptions(host, owner, state);
|
|
919
|
+
extension.start?.after?.();
|
|
920
|
+
// The startup session's history, read ahead of construction, paints
|
|
921
|
+
// before any live event (an extension owning the facts replays its own).
|
|
922
|
+
feed.bind(extension.bind?.ownsSessionFacts === true ? undefined : options.initialHistory);
|
|
923
|
+
// Cordis owns the Channel lifetime. Rebinding handles the common case;
|
|
924
|
+
// this effect closes the final timer and releases the DecisionEvents
|
|
925
|
+
// dispatch-topology marker when the Channel's context unloads.
|
|
926
|
+
const effect = ctx.effect;
|
|
927
|
+
effect?.call(ctx, () => () => {
|
|
928
|
+
// The context owns the complete Channel lifetime. Keep emitter and
|
|
929
|
+
// IDE-link teardown in the same finally funnel.
|
|
930
|
+
state.releaseContributions();
|
|
931
|
+
}, 'dsh-tui channel lifecycle');
|
|
932
|
+
refreshGitBranch();
|
|
933
|
+
if (extension.bind?.ownsSessionFacts !== true)
|
|
934
|
+
state.emit();
|
|
935
|
+
return state;
|
|
936
|
+
},
|
|
937
|
+
};
|
|
938
|
+
}
|