@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,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH child transcript source (docs/dsh-child-transcript.md): the DSH
|
|
3
|
+
* implementation of the backend-neutral `SubagentControl.history` contract,
|
|
4
|
+
* next to Claude's on-disk child lane. Reads one direct child's own durable
|
|
5
|
+
* session log through the public persistence range API only
|
|
6
|
+
* (`ctx.sessionPersistence.open(id, 'read')` + `SessionHandle.read(offset,
|
|
7
|
+
* length)`) and translates the page through a throwaway DSH translator into
|
|
8
|
+
* the shared leaf vocabulary. The deprecated Session snapshot-events API and
|
|
9
|
+
* the raw session-log file readers are not used.
|
|
10
|
+
*
|
|
11
|
+
* Read shape (every step bounded and fenced):
|
|
12
|
+
* 1. ownership: the parent-owned `subagents.listChildren(parentId)` roster
|
|
13
|
+
* must name the child; a UI-supplied id is never opened on its own;
|
|
14
|
+
* 2. durability: when the agents registry still holds the child's exact
|
|
15
|
+
* live Session, the public `ctx.sessions.flush(session)` barrier runs
|
|
16
|
+
* first (no whenIdle wait, no Agent create/resume); a failed or timed-out
|
|
17
|
+
* flush falls back to whatever prefix is already persisted;
|
|
18
|
+
* 3. windows: the child's own events are `[inheritedEventCount, total)`;
|
|
19
|
+
* the fork-inherited prefix is never paged (a seeded header without its
|
|
20
|
+
* exact cut fails closed). `total` comes from `stat().eventCount` when
|
|
21
|
+
* the host states it, else from bounded single-event tail probes of the
|
|
22
|
+
* public range reader (never an unbounded whole-log read + slice);
|
|
23
|
+
* 4. translation: a fresh translator instance per call; only the leaf
|
|
24
|
+
* kinds (`assistant.message` / `tool.call` / `tool.result`) survive,
|
|
25
|
+
* each stamped with the child lane's `parentCallId`, so the shared
|
|
26
|
+
* fold/page/merge pipeline consumes them exactly like Claude's;
|
|
27
|
+
* 5. fences: the binding capture (session + generation) is re-checked after
|
|
28
|
+
* every await; a parent that moved on discards the page. The handle is
|
|
29
|
+
* closed exactly once on every path.
|
|
30
|
+
*/
|
|
31
|
+
import { SESSION_FORMAT_VERSION } from '@deepseek-ai/dsh-session';
|
|
32
|
+
import { textOfBlocks } from '../../channel/projection.js';
|
|
33
|
+
import { toolErrorText } from './transcript.js';
|
|
34
|
+
/**
|
|
35
|
+
* One page window in source events. Claude pages by 400 SDK messages
|
|
36
|
+
* (`SUBAGENT_TRANSCRIPT_PAGE`) and the shared "load older" chunk is
|
|
37
|
+
* `TRANSCRIPT_OLDER_CHUNK = 400`, so DSH pages by 400 SessionEvents and the
|
|
38
|
+
* neutral cursor stays one unit wide for both backends.
|
|
39
|
+
*/
|
|
40
|
+
export const CHILD_TRANSCRIPT_PAGE_EVENTS = 400;
|
|
41
|
+
/** Span ceiling for the exponential probe (2^24 ≈ 16.7M events). */
|
|
42
|
+
const PROBE_SPAN_MAX = 2 ** 24;
|
|
43
|
+
/**
|
|
44
|
+
* Tail-probe budget when `stat()` states no `eventCount` (the pinned JSONL
|
|
45
|
+
* backend does not): exponential-then-binary single-event probes locate the
|
|
46
|
+
* log end. Every probe reads exactly one event; the count is capped so a
|
|
47
|
+
* pathological log degrades to "unavailable" instead of scanning. The worst
|
|
48
|
+
* log under the span ceiling takes 24 exponential hits, one miss and 24
|
|
49
|
+
* bisection steps.
|
|
50
|
+
*/
|
|
51
|
+
const PROBE_LIMIT = 2 * Math.log2(PROBE_SPAN_MAX) + 1;
|
|
52
|
+
const staleError = () => new Error('dsh-tui: the channel binding changed before the child transcript was read');
|
|
53
|
+
const optionalCount = (value) => typeof value === 'number' && Number.isSafeInteger(value) && value >= 0 ? value : undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Locate the log end with bounded single-event probes of the public range
|
|
56
|
+
* reader, never an unbounded whole-log read: an event at `offset` proves the
|
|
57
|
+
* log is longer; exponential steps find an empty
|
|
58
|
+
* offset, binary search closes on the exact end. `known` must be an offset
|
|
59
|
+
* whose event exists (the inherited cut boundary was just verified).
|
|
60
|
+
*/
|
|
61
|
+
async function probeLogEnd(handle, known, guard, signal) {
|
|
62
|
+
const eventAt = async (offset) => {
|
|
63
|
+
guard();
|
|
64
|
+
signal?.throwIfAborted();
|
|
65
|
+
const { events } = await handle.read(offset, 1, signal === undefined ? undefined : { signal });
|
|
66
|
+
return events.length > 0;
|
|
67
|
+
};
|
|
68
|
+
let probes = 0;
|
|
69
|
+
const step = async (offset) => {
|
|
70
|
+
if (probes >= PROBE_LIMIT)
|
|
71
|
+
throw new Error('dsh-tui: the child transcript log exceeds the bounded tail-probe budget');
|
|
72
|
+
probes += 1;
|
|
73
|
+
return eventAt(offset);
|
|
74
|
+
};
|
|
75
|
+
let present = known;
|
|
76
|
+
let span = 1;
|
|
77
|
+
let absent;
|
|
78
|
+
while (absent === undefined) {
|
|
79
|
+
const candidate = present + span;
|
|
80
|
+
if (await step(candidate)) {
|
|
81
|
+
present = candidate;
|
|
82
|
+
span *= 2;
|
|
83
|
+
if (span > PROBE_SPAN_MAX)
|
|
84
|
+
throw new Error('dsh-tui: the child transcript log exceeds the bounded tail-probe budget');
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
absent = candidate;
|
|
88
|
+
}
|
|
89
|
+
while (absent - present > 1) {
|
|
90
|
+
const middle = Math.floor((present + absent) / 2);
|
|
91
|
+
if (await step(middle))
|
|
92
|
+
present = middle;
|
|
93
|
+
else
|
|
94
|
+
absent = middle;
|
|
95
|
+
}
|
|
96
|
+
return absent;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Read one child transcript page: the newest window, or the
|
|
100
|
+
* `window`-addressed older slice, of the child's own durable events. Null =
|
|
101
|
+
* the parent's catalog holds no such direct child; a rejection = the read
|
|
102
|
+
* failed (the transcript view shows "unavailable", never a fabricated empty
|
|
103
|
+
* page).
|
|
104
|
+
*/
|
|
105
|
+
export async function readChildTranscriptPage(deps, agentId, window) {
|
|
106
|
+
const capture = deps.capture();
|
|
107
|
+
if (capture === undefined)
|
|
108
|
+
throw new Error('dsh-tui: the bound session is not a DSH session');
|
|
109
|
+
const guard = () => {
|
|
110
|
+
if (!deps.isCurrent(capture))
|
|
111
|
+
throw staleError();
|
|
112
|
+
};
|
|
113
|
+
const signal = deps.ownerSignal;
|
|
114
|
+
signal?.throwIfAborted();
|
|
115
|
+
const service = deps.subagents();
|
|
116
|
+
if (service?.listChildren === undefined)
|
|
117
|
+
throw new Error('dsh-tui: the subagents continuation service is unavailable');
|
|
118
|
+
const persistence = deps.persistence();
|
|
119
|
+
if (persistence === undefined)
|
|
120
|
+
throw new Error('dsh-tui: session persistence is unavailable');
|
|
121
|
+
// 1. ownership: only a child this parent's own catalog names is opened.
|
|
122
|
+
const roster = await service.listChildren(capture.sessionId, signal);
|
|
123
|
+
guard();
|
|
124
|
+
if (!Array.from(roster ?? []).some(entry => entry?.id === agentId))
|
|
125
|
+
return null;
|
|
126
|
+
// 2. durability barrier for a still-live child (best effort; when it fails
|
|
127
|
+
// the read below sees whatever prefix is already persisted).
|
|
128
|
+
try {
|
|
129
|
+
const live = deps.lookupChild(agentId)?.session;
|
|
130
|
+
const flush = live === undefined || live === null ? undefined : deps.sessionsStore()?.flush(live);
|
|
131
|
+
if (flush !== undefined) {
|
|
132
|
+
let timer;
|
|
133
|
+
const completed = await Promise.race([
|
|
134
|
+
flush.then(() => true, () => true),
|
|
135
|
+
new Promise(resolve => { timer = setTimeout(() => resolve(false), 2_000); }),
|
|
136
|
+
]);
|
|
137
|
+
if (!completed)
|
|
138
|
+
process.stderr.write('dsh-tui: child transcript flush timed out after 2000ms\n');
|
|
139
|
+
if (timer !== undefined)
|
|
140
|
+
clearTimeout(timer);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch { /* best effort: the read below returns what is on disk */ }
|
|
144
|
+
guard();
|
|
145
|
+
// 3. cheap length when the host states it; otherwise bounded tail probes.
|
|
146
|
+
let statCount;
|
|
147
|
+
try {
|
|
148
|
+
statCount = optionalCount((await persistence.stat?.(agentId, signal === undefined ? undefined : { signal }))?.eventCount);
|
|
149
|
+
}
|
|
150
|
+
catch { /* stat is an optimization: open/read report the real failures */ }
|
|
151
|
+
guard();
|
|
152
|
+
const handle = await persistence.open(agentId, 'read', signal === undefined ? undefined : { signal });
|
|
153
|
+
try {
|
|
154
|
+
guard();
|
|
155
|
+
const header = handle.header ?? {};
|
|
156
|
+
if (String(header.id ?? '') !== agentId)
|
|
157
|
+
throw new Error('dsh-tui: the stored child session id does not match the catalog id');
|
|
158
|
+
if (header.version !== SESSION_FORMAT_VERSION)
|
|
159
|
+
throw new Error('dsh-tui: the stored child session format is not supported');
|
|
160
|
+
const statedParent = header.parentSession;
|
|
161
|
+
if (statedParent !== undefined && statedParent !== null && String(statedParent) !== capture.sessionId) {
|
|
162
|
+
throw new Error('dsh-tui: the stored child session belongs to another parent');
|
|
163
|
+
}
|
|
164
|
+
// The fork-inherited prefix is part of the stored log but not the child's
|
|
165
|
+
// own history: page from the exact cut only. A seeded header that does
|
|
166
|
+
// not state its cut fails closed; zero is never assumed.
|
|
167
|
+
const cut = header.isSeeded === true
|
|
168
|
+
? optionalCount(handle.inheritedEventCount)
|
|
169
|
+
: Math.max(0, optionalCount(handle.inheritedEventCount) ?? 0);
|
|
170
|
+
if (cut === undefined)
|
|
171
|
+
throw new Error('dsh-tui: the seeded child log does not state its inherited cut');
|
|
172
|
+
// The log's total length: `stat().eventCount` when the host states one,
|
|
173
|
+
// re-verified by a single one-event probe at that offset, because appends
|
|
174
|
+
// since the stat must not hide the newest page (a grown log falls into
|
|
175
|
+
// the bounded tail probe). Without a usable count the probe path verifies
|
|
176
|
+
// the inherited boundary first: the stored log always contains the prefix,
|
|
177
|
+
// so an empty event at `cut - 1` is corruption, not an empty child.
|
|
178
|
+
let total;
|
|
179
|
+
if (statCount !== undefined && statCount >= cut) {
|
|
180
|
+
guard();
|
|
181
|
+
signal?.throwIfAborted();
|
|
182
|
+
const freshness = await handle.read(statCount, 1, signal === undefined ? undefined : { signal });
|
|
183
|
+
total = freshness.events.length > 0 ? await probeLogEnd(handle, statCount, guard, signal) : statCount;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
if (cut > 0) {
|
|
187
|
+
guard();
|
|
188
|
+
signal?.throwIfAborted();
|
|
189
|
+
const boundary = await handle.read(cut - 1, 1, signal === undefined ? undefined : { signal });
|
|
190
|
+
if (boundary.events.length === 0)
|
|
191
|
+
throw new Error('dsh-tui: the stored child log is shorter than its inherited cut');
|
|
192
|
+
}
|
|
193
|
+
guard();
|
|
194
|
+
signal?.throwIfAborted();
|
|
195
|
+
const ownStart = await handle.read(cut, 1, signal === undefined ? undefined : { signal });
|
|
196
|
+
total = ownStart.events.length > 0 ? await probeLogEnd(handle, cut, guard, signal) : cut;
|
|
197
|
+
}
|
|
198
|
+
guard();
|
|
199
|
+
const own = Math.max(0, total - cut);
|
|
200
|
+
let start;
|
|
201
|
+
let length;
|
|
202
|
+
if (window === undefined) {
|
|
203
|
+
length = Math.min(CHILD_TRANSCRIPT_PAGE_EVENTS, own);
|
|
204
|
+
start = cut + own - length;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
// An older slice: `count` own events ending just before `skipFromStart`
|
|
208
|
+
// (the pagination bookkeeping of the page already shown).
|
|
209
|
+
const skip = Math.max(0, Math.min(window.skipFromStart, own));
|
|
210
|
+
length = Math.max(0, Math.min(window.count, skip));
|
|
211
|
+
start = cut + skip - length;
|
|
212
|
+
}
|
|
213
|
+
const events = length === 0 ? [] : (await handle.read(start, length, signal === undefined ? undefined : { signal })).events;
|
|
214
|
+
guard();
|
|
215
|
+
// 4. one throwaway translator per call; only leaf events survive, each
|
|
216
|
+
// forced onto the child lane so the shared fold consumes them exactly
|
|
217
|
+
// like Claude's replayClaudeSubagentLane output. Nothing here runs the
|
|
218
|
+
// channel projector, so no todo/job/goal side effects can fire.
|
|
219
|
+
const translator = deps.createTranslator();
|
|
220
|
+
const lane = [];
|
|
221
|
+
const uuids = [];
|
|
222
|
+
const pageCalls = new Set();
|
|
223
|
+
for (const event of events) {
|
|
224
|
+
const messageId = durableMessageId(event);
|
|
225
|
+
if (messageId !== undefined)
|
|
226
|
+
uuids.push(messageId);
|
|
227
|
+
for (const translated of translator.translateEvent(event)) {
|
|
228
|
+
if (translated.type === 'tool.call')
|
|
229
|
+
pageCalls.add(translated.callId);
|
|
230
|
+
if (translated.type === 'tool.result' && !pageCalls.has(translated.callId)) {
|
|
231
|
+
// Its call sits on an older page, so the translator never saw it
|
|
232
|
+
// and left the body out. Keep the body, so whoever pairs this result
|
|
233
|
+
// with the call from that page has what the card shows.
|
|
234
|
+
lane.push({ ...orphanResult(translated, event), parentCallId: agentId });
|
|
235
|
+
}
|
|
236
|
+
else if (translated.type === 'assistant.message' || translated.type === 'tool.call' || translated.type === 'tool.result') {
|
|
237
|
+
lane.push({ ...translated, parentCallId: agentId });
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const skippedFromStart = Math.max(0, start - cut);
|
|
242
|
+
return {
|
|
243
|
+
events: lane,
|
|
244
|
+
// The parent is a verified fact (roster + stored lineage), never inferred.
|
|
245
|
+
parentAgentId: capture.sessionId,
|
|
246
|
+
uuids,
|
|
247
|
+
hasOlder: skippedFromStart > 0,
|
|
248
|
+
skippedFromStart,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
finally {
|
|
252
|
+
// Close exactly once on every path; a read handle's close failure must
|
|
253
|
+
// not discard a page that was already read.
|
|
254
|
+
await handle.close().catch(() => undefined);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/** A result whose call was not on the page, with the body a paired card shows. */
|
|
258
|
+
function orphanResult(result, event) {
|
|
259
|
+
return result.isError
|
|
260
|
+
? { ...result, text: '', errorText: toolErrorText(event) }
|
|
261
|
+
: { ...result, text: textOfBlocks(result.content) };
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* The durable message ids that exist on the DSH wire (the `user/message`
|
|
265
|
+
* payload id and the `assistant/message` API message id), verbatim. Missing
|
|
266
|
+
* ids stay missing; nothing fabricates a UUID.
|
|
267
|
+
*/
|
|
268
|
+
function durableMessageId(event) {
|
|
269
|
+
const type = event.type;
|
|
270
|
+
if (type === 'user/message') {
|
|
271
|
+
const id = event.data?.id;
|
|
272
|
+
return typeof id === 'string' && id !== '' ? id : undefined;
|
|
273
|
+
}
|
|
274
|
+
if (type === 'assistant/message') {
|
|
275
|
+
const id = event.data?.message?.id;
|
|
276
|
+
return typeof id === 'string' && id !== '' ? id : undefined;
|
|
277
|
+
}
|
|
278
|
+
return undefined;
|
|
279
|
+
}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import { type SessionEvent } from '@deepseek-ai/dsh-session';
|
|
2
2
|
import type { ChatRow, ToolResultView, ToolViewPresenter } from './types.js';
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
/** Local `!`-command output cap (mirrors the result preview limit). */
|
|
6
|
-
export declare const LOCAL_OUTPUT_LIMIT = 240;
|
|
7
|
-
/**
|
|
8
|
-
* In-memory transcript window cap. Older rows beyond this count are FOLDED:
|
|
9
|
-
* their full-text fields (assistant/reasoning text, tool args/results) are
|
|
10
|
-
* dropped and only the preview/status metadata kept, so a long merge/deploy
|
|
11
|
-
* turn cannot grow the TUI's RAM without bound. The session log remains the
|
|
12
|
-
* complete source of truth (`/export` reads it, `/resume` replays it); the
|
|
13
|
-
* folded row keeps its kind/id so scrolling and selection stay stable.
|
|
14
|
-
*/
|
|
15
|
-
export declare const MAX_ROWS = 600;
|
|
16
|
-
export declare function preview(text: string, limit: number): string;
|
|
3
|
+
import { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, RESULT_PREVIEW_LIMIT } from '../../channel/transcript.js';
|
|
4
|
+
export { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, RESULT_PREVIEW_LIMIT };
|
|
17
5
|
/**
|
|
18
6
|
* Fold the oldest rows beyond the transcript window cap: drop each row's
|
|
19
7
|
* full-text fields (assistant/reasoning text, tool args/results) and keep
|
|
@@ -27,7 +15,11 @@ export declare function preview(text: string, limit: number): string;
|
|
|
27
15
|
export declare function foldRows(rows: ChatRow[], cap: number, cursor?: {
|
|
28
16
|
rows: unknown;
|
|
29
17
|
index: number;
|
|
30
|
-
|
|
18
|
+
head?: unknown;
|
|
19
|
+
},
|
|
20
|
+
/** Rows the backend can restore (default: every foldable kind); any
|
|
21
|
+
* other row keeps its full text. */
|
|
22
|
+
restorable?: (row: ChatRow) => boolean): number;
|
|
31
23
|
/**
|
|
32
24
|
* Restore folded rows from the session log, newest folded batch first.
|
|
33
25
|
* Rebuilds each folded row's full text from its source events and clears
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE5E,OAAO,EAAE,kBA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AAO,EAAE,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,IAAI,CAUxF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,EAAE,CA2BnF"}
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { toolResultPayload } from '../compat/messages.js';
|
|
2
2
|
import { markChannelReadDirty } from '../../adapter/channel/read-view.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
/**
|
|
8
|
-
* In-memory transcript window cap. Older rows beyond this count are FOLDED:
|
|
9
|
-
* their full-text fields (assistant/reasoning text, tool args/results) are
|
|
10
|
-
* dropped and only the preview/status metadata kept, so a long merge/deploy
|
|
11
|
-
* turn cannot grow the TUI's RAM without bound. The session log remains the
|
|
12
|
-
* complete source of truth (`/export` reads it, `/resume` replays it); the
|
|
13
|
-
* folded row keeps its kind/id so scrolling and selection stay stable.
|
|
14
|
-
*/
|
|
15
|
-
export const MAX_ROWS = 600;
|
|
16
|
-
export function preview(text, limit) {
|
|
17
|
-
const flat = text.replace(/\s+/g, ' ').trim();
|
|
18
|
-
return flat.length <= limit ? flat : `${flat.slice(0, limit)}…`;
|
|
19
|
-
}
|
|
3
|
+
import { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, RESULT_PREVIEW_LIMIT } from '../../channel/transcript.js';
|
|
4
|
+
// Limits and the preview helper are backend-neutral (src/channel/transcript.ts);
|
|
5
|
+
// re-exported here for the existing importers.
|
|
6
|
+
export { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, RESULT_PREVIEW_LIMIT };
|
|
20
7
|
/**
|
|
21
8
|
* Fold the oldest rows beyond the transcript window cap: drop each row's
|
|
22
9
|
* full-text fields (assistant/reasoning text, tool args/results) and keep
|
|
@@ -27,7 +14,10 @@ export function preview(text, limit) {
|
|
|
27
14
|
* a loadOlder() restore is not instantly undone. Returns the number of rows
|
|
28
15
|
* folded.
|
|
29
16
|
*/
|
|
30
|
-
export function foldRows(rows, cap, cursor
|
|
17
|
+
export function foldRows(rows, cap, cursor,
|
|
18
|
+
/** Rows the backend can restore (default: every foldable kind); any
|
|
19
|
+
* other row keeps its full text. */
|
|
20
|
+
restorable) {
|
|
31
21
|
const excess = rows.length - cap;
|
|
32
22
|
if (excess <= 0) {
|
|
33
23
|
if (cursor !== undefined)
|
|
@@ -38,10 +28,14 @@ export function foldRows(rows, cap, cursor) {
|
|
|
38
28
|
// folded/restored exemptions are permanent, so everything below a cursor
|
|
39
29
|
// over the SAME array identity needs no re-inspection. emit/emitStream
|
|
40
30
|
// fold on every frame during streaming — a full rescan of a long window
|
|
41
|
-
// there was the O(rows) per-frame term of long-session streaming.
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
// there was the O(rows) per-frame term of long-session streaming. Rows
|
|
32
|
+
// prepended ahead of the window (older history) shift every index: a new
|
|
33
|
+
// head restarts the pass.
|
|
34
|
+
const from = cursor === undefined ? 0 : cursor.rows === rows && cursor.head === rows[0] ? cursor.index : 0;
|
|
35
|
+
if (cursor !== undefined) {
|
|
44
36
|
cursor.rows = rows;
|
|
37
|
+
cursor.head = rows[0];
|
|
38
|
+
}
|
|
45
39
|
if (excess <= from)
|
|
46
40
|
return 0;
|
|
47
41
|
let folded = 0;
|
|
@@ -50,6 +44,8 @@ export function foldRows(rows, cap, cursor) {
|
|
|
50
44
|
continue;
|
|
51
45
|
if (row.kind !== 'user' && row.kind !== 'assistant' && row.kind !== 'reasoning' && row.kind !== 'tool')
|
|
52
46
|
continue;
|
|
47
|
+
if (restorable !== undefined && !restorable(row))
|
|
48
|
+
continue;
|
|
53
49
|
row.folded = true;
|
|
54
50
|
folded += 1;
|
|
55
51
|
if (row.kind === 'tool' && row.tool) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChannelUi } from '../../adapter/ports/channel-ui.js';
|
|
2
|
-
import type { ChatRow, ToolCallView, ToolResultView, NotificationItem, TodoPanelItem, PendingMessage } from '../../adapter/ports/channel-view.js';
|
|
3
|
-
export type { ChatRow, ToolRow, ToolCallView, ToolFileDiff, ToolResultView, SubagentRow, JobGroupRow, JobRow, TokenUsage, TokenBucket, CostTokenBuckets, SessionCostByModel, SubagentCostEntry, NotificationItem, ChannelGoal, TodoPanelItem, LoadedContext, LoadedContextEntry, LoadedContextFile, LoadedContextSkill, LoadedContextTool, PendingMessage, SubagentControl, JobControl, StagedImageInput, StagedImageAdjustment, StagedImageHandle, ComposerImageRef, ComposerSubmission, ExternalCommandOutcome, TranscriptImage, ResumeResult, EffortOption, PermissionPresetSnapshot, PermissionPresetAvailability, PermissionPresetOption, PermissionPresetCurrent, PresetOption, SkillInfo, CredentialStatus, AgentViewRow, AgentViewStatus, AgentViewDispatchResult, BackgroundResult } from '../../adapter/ports/channel-view.js';
|
|
2
|
+
import type { RawTrajEvent, ChatRow, ToolCallView, ToolResultView, NotificationItem, TodoPanelItem, PendingMessage, TrajectorySource } from '../../adapter/ports/channel-view.js';
|
|
3
|
+
export type { ChatRow, ToolRow, ToolCallView, ToolFileDiff, ToolResultView, SubagentRow, JobGroupRow, JobRow, TokenUsage, TokenBucket, CostTokenBuckets, SessionCostByModel, SubagentCostEntry, NotificationItem, ChannelGoal, TodoPanelItem, LoadedContext, LoadedContextEntry, LoadedContextFile, LoadedContextSkill, LoadedContextTool, PendingMessage, SubagentControl, SubagentTranscriptView, JobControl, StagedImageInput, StagedImageAdjustment, StagedImageHandle, ComposerImageRef, ComposerSubmission, ExternalCommandOutcome, TranscriptImage, ResumeResult, EffortOption, PermissionPresetSnapshot, PermissionPresetAvailability, PermissionPresetOption, PermissionPresetCurrent, PresetOption, SkillInfo, CredentialStatus, AgentViewRow, AgentViewStatus, AgentViewDispatchResult, BackgroundResult, BackendModeOption, BackendChannelOption, TrajectorySource } from '../../adapter/ports/channel-view.js';
|
|
4
4
|
import { type ContentBlock, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
5
5
|
import { type SessionEvent } from '@deepseek-ai/dsh-session';
|
|
6
6
|
import { type BackgroundJobState } from '../jobs.js';
|
|
@@ -12,7 +12,7 @@ export type SideQuestionLlm = {
|
|
|
12
12
|
};
|
|
13
13
|
export type PermissionPresetService = {
|
|
14
14
|
names?: unknown;
|
|
15
|
-
current?: (events: readonly
|
|
15
|
+
current?: (events: readonly RawTrajEvent[]) => unknown;
|
|
16
16
|
optionOf?: (name: string) => unknown;
|
|
17
17
|
};
|
|
18
18
|
export type ChannelImageBlock = Extract<ContentBlock, {
|
|
@@ -36,16 +36,23 @@ export interface ToolViewPresenter {
|
|
|
36
36
|
result(name: string, rawArgs: string, data: SessionEvent<'tool/result'>['data']): ToolResultView | undefined;
|
|
37
37
|
}
|
|
38
38
|
/** Raw host implementation; the renderer receives ChannelUi instead. */
|
|
39
|
-
export interface Channel extends Omit<ChannelUi, 'pluginScene' | 'traceEvents'> {
|
|
39
|
+
export interface Channel extends Omit<ChannelUi, 'pluginScene' | 'traceEvents' | 'trajectorySource' | 'trajectoryLaneEvents'> {
|
|
40
40
|
readonly pluginScene: TuiSceneDescriptor | undefined;
|
|
41
|
-
traceEvents(): readonly
|
|
41
|
+
traceEvents(): readonly RawTrajEvent[];
|
|
42
|
+
/** The mounted trajectory source's three-state report (see ChannelUi). */
|
|
43
|
+
trajectorySource(): TrajectorySource;
|
|
44
|
+
/** Lane drilldown reads (see ChannelUi). */
|
|
45
|
+
trajectoryLanes(): readonly import('../../adapter/ports/channel-view.js').TrajectoryLane[];
|
|
46
|
+
trajectoryLaneEvents(agentId: string, descendants?: boolean): readonly RawTrajEvent[];
|
|
47
|
+
/** Localized mounted-source label (see ChannelUi). */
|
|
48
|
+
trajectoryBackendLabel(): string;
|
|
42
49
|
releaseContributions(): void;
|
|
43
50
|
}
|
|
44
51
|
type MutableChannelView = {
|
|
45
52
|
-readonly [K in keyof ChannelUi]: ChannelUi[K];
|
|
46
53
|
};
|
|
47
54
|
/** Internal writable store; command signatures are owned once by ChannelUi. */
|
|
48
|
-
export interface ChannelState extends Omit<MutableChannelView, 'rows' | 'notifications' | 'todos' | 'pending' | 'tpsSamples' | 'subagents' | 'backgroundJobs' | 'pluginScene' | 'traceEvents'> {
|
|
55
|
+
export interface ChannelState extends Omit<MutableChannelView, 'rows' | 'notifications' | 'todos' | 'pending' | 'tpsSamples' | 'subagents' | 'backgroundJobs' | 'pluginScene' | 'traceEvents' | 'trajectorySource'> {
|
|
49
56
|
rows: ChatRow[];
|
|
50
57
|
notifications: NotificationItem[];
|
|
51
58
|
/** Per-turn tps samples (sparkline history), oldest first. */
|
|
@@ -87,7 +94,9 @@ export interface ChannelState extends Omit<MutableChannelView, 'rows' | 'notific
|
|
|
87
94
|
/** See {@link Channel.releaseContributions}. */
|
|
88
95
|
releaseContributions(): void;
|
|
89
96
|
/** Live session event log (see the public Channel type, `/trace`). */
|
|
90
|
-
traceEvents(): readonly
|
|
97
|
+
traceEvents(): readonly RawTrajEvent[];
|
|
98
|
+
/** The mounted trajectory source's three-state report (see ChannelUi). */
|
|
99
|
+
trajectorySource(): TrajectorySource;
|
|
91
100
|
}
|
|
92
101
|
export type FileSuggestionFs = {
|
|
93
102
|
resolve(path: string): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,OAAO,EAAW,YAAY,EAAgB,cAAc,EAAsH,gBAAgB,EAAe,aAAa,EAA+F,cAAc,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAA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CAAA;IAC/B,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAA;KAAE,CAAA;CAC/C;AAED,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,MAAM,EAAE,YAAY,EAAE,CAAA;IACtB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB"}
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
import { type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export declare function emptyTokenUsage(): TokenUsage;
|
|
5
|
-
/**
|
|
6
|
-
* Context-bar token estimate for model-visible text: a per-code-point weighted
|
|
7
|
-
* count by script class (see the rates above), rounded up.
|
|
8
|
-
*
|
|
9
|
-
* Pure and deterministic: non-negative, zero only for the empty string, and
|
|
10
|
-
* monotonic — appending characters never lowers the result. A single call on
|
|
11
|
-
* pure ASCII input is exactly the old `ceil(length / 4)` (there is an explicit
|
|
12
|
-
* fast path), so per-message English numbers are unchanged; note that a caller
|
|
13
|
-
* which used to sum characters and round once now rounds per call, so summing
|
|
14
|
-
* this estimator over messages can differ from the legacy total by at most one
|
|
15
|
-
* token per call (ASCII-only sums included). ANSI escapes are NOT stripped: they
|
|
16
|
-
* are ASCII, and the provider tokenizes the literal message bytes rather than
|
|
17
|
-
* the rendered cells.
|
|
18
|
-
*
|
|
19
|
-
* @param text - Model-visible text (a prompt, an assistant block, a tool
|
|
20
|
-
* result); widths are irrelevant here, this counts characters, not cells.
|
|
21
|
-
* @returns The estimated token count (0 for empty input).
|
|
22
|
-
*/
|
|
23
|
-
export declare function estimateTokens(text: string): number;
|
|
2
|
+
import { emptyTokenUsage, estimateTokens } from '../../channel/usage.js';
|
|
3
|
+
export { emptyTokenUsage, estimateTokens };
|
|
24
4
|
/** Whether one stream chunk advances the first-token/decode boundary. */
|
|
25
5
|
export declare function isTokenDelta(chunk: StreamChunk): boolean;
|
|
26
6
|
/** Character payload of one token-bearing stream delta for the live fallback. */
|
|
27
7
|
export declare function tokenDeltaChars(chunk: StreamChunk): number;
|
|
28
|
-
/**
|
|
8
|
+
/** DSH-shaped (`outputTokens`) output count when usable; durable imports may predate strict validation. */
|
|
29
9
|
export declare function usageOutputTokens(usage: unknown): number | undefined;
|
|
30
10
|
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAIxE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,CAAA;AAE1C,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAUxD;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAU1D;AAED,2GAA2G;AAC3G,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAMpE"}
|
|
@@ -1,113 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
output: 0,
|
|
6
|
-
cacheRead: 0,
|
|
7
|
-
cacheWrite: 0,
|
|
8
|
-
peak: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
9
|
-
idle: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
/*
|
|
13
|
-
* Script-class rates for the context bar's local token estimate.
|
|
14
|
-
*
|
|
15
|
-
* pi-nano-context's original `text.length / 4` is an English heuristic: BPE
|
|
16
|
-
* vocabularies pack roughly four ASCII characters into one token, but CJK text
|
|
17
|
-
* runs ~1–1.5 characters per token (one ideograph is one or two tokens), so the
|
|
18
|
-
* English rate under-counted Chinese/Korean/Japanese sessions by ~3x — the
|
|
19
|
-
* segmented bar, its hover breakdown and everything derived from these numbers
|
|
20
|
-
* were squeezed flat against the real occupancy reading (issue #1170).
|
|
21
|
-
*
|
|
22
|
-
* These are ESTIMATES, not metering: no tokenizer is consulted, and the guess
|
|
23
|
-
* cannot see the provider vocabulary, the request envelope (role markers, tool
|
|
24
|
-
* JSON, image blocks) or a cached prefix that the next request will not resend
|
|
25
|
-
* in full. The authoritative occupancy is the harness `contextPressure`
|
|
26
|
-
* projection (`projectedTokens ?? pressureTokens`, see
|
|
27
|
-
* `dsh-adapter/context-occupancy.ts`); these numbers only describe what the
|
|
28
|
-
* segmented bar is made of and must never be summed into that total.
|
|
29
|
-
*/
|
|
30
|
-
/** ASCII, including control bytes and ANSI escapes: ~4 characters per token. */
|
|
31
|
-
const CHARS_PER_TOKEN_ASCII = 4;
|
|
32
|
-
/** CJK ideographs, kana, Hangul, Bopomofo, Yi, CJK punctuation and full-width
|
|
33
|
-
* forms: ~1.4 characters per token (the midpoint of the measured 1–1.5 band). */
|
|
34
|
-
const CHARS_PER_TOKEN_CJK = 1.4;
|
|
35
|
-
/** Everything else — accented Latin, Cyrillic, Greek, Arabic, Hebrew, Thai,
|
|
36
|
-
* Devanagari, emoji — deliberately conservative at 2 characters per token:
|
|
37
|
-
* denser scripts (Thai, Devanagari) and multi-token emoji clusters still come
|
|
38
|
-
* out low, while lighter ones are over-counted rather than under-counted. */
|
|
39
|
-
const CHARS_PER_TOKEN_OTHER = 2;
|
|
40
|
-
/** Cheapest possible "does this text need script classification at all" test. */
|
|
41
|
-
const NON_ASCII_RE = /[^\x00-\x7f]/;
|
|
42
|
-
/**
|
|
43
|
-
* Whether one code point belongs to a script BPE vocabularies pack at roughly
|
|
44
|
-
* one token per character or two. Emoji are deliberately excluded (they land in
|
|
45
|
-
* the `OTHER` rate): they are not East Asian wide *text*, and a ZWJ cluster is
|
|
46
|
-
* several code points the tokenizer may charge several tokens for.
|
|
47
|
-
*/
|
|
48
|
-
function isDenseScript(codePoint) {
|
|
49
|
-
return ((codePoint >= 0x1100 && codePoint <= 0x11ff) // Hangul Jamo
|
|
50
|
-
|| (codePoint >= 0x2e80 && codePoint <= 0x303f) // CJK radicals … CJK symbols and punctuation
|
|
51
|
-
|| (codePoint >= 0x3040 && codePoint <= 0x33ff) // kana, Bopomofo, Hangul compat jamo, enclosed/compat CJK
|
|
52
|
-
|| (codePoint >= 0x3400 && codePoint <= 0x4dbf) // CJK unified ideographs extension A
|
|
53
|
-
|| (codePoint >= 0x4e00 && codePoint <= 0x9fff) // CJK unified ideographs
|
|
54
|
-
|| (codePoint >= 0xa000 && codePoint <= 0xa4cf) // Yi syllables and radicals
|
|
55
|
-
|| (codePoint >= 0xa960 && codePoint <= 0xa97f) // Hangul Jamo Extended-A
|
|
56
|
-
|| (codePoint >= 0xac00 && codePoint <= 0xd7af) // Hangul syllables
|
|
57
|
-
|| (codePoint >= 0xd7b0 && codePoint <= 0xd7ff) // Hangul Jamo Extended-B
|
|
58
|
-
|| (codePoint >= 0xf900 && codePoint <= 0xfaff) // CJK compatibility ideographs
|
|
59
|
-
|| (codePoint >= 0xfe30 && codePoint <= 0xfe4f) // CJK compatibility forms
|
|
60
|
-
|| (codePoint >= 0xfe50 && codePoint <= 0xfe6f) // small form variants (CJK punctuation variants)
|
|
61
|
-
|| (codePoint >= 0xff00 && codePoint <= 0xff60) // full-width forms
|
|
62
|
-
|| (codePoint >= 0xff61 && codePoint <= 0xffdc) // half-width kana, half-width Hangul, half-width CJK punctuation
|
|
63
|
-
|| (codePoint >= 0xffe0 && codePoint <= 0xffe6) // full-width signs
|
|
64
|
-
|| (codePoint >= 0x1f200 && codePoint <= 0x1f2ff) // enclosed ideographic supplement
|
|
65
|
-
|| (codePoint >= 0x20000 && codePoint <= 0x3fffd) // CJK extensions B–G
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Context-bar token estimate for model-visible text: a per-code-point weighted
|
|
70
|
-
* count by script class (see the rates above), rounded up.
|
|
71
|
-
*
|
|
72
|
-
* Pure and deterministic: non-negative, zero only for the empty string, and
|
|
73
|
-
* monotonic — appending characters never lowers the result. A single call on
|
|
74
|
-
* pure ASCII input is exactly the old `ceil(length / 4)` (there is an explicit
|
|
75
|
-
* fast path), so per-message English numbers are unchanged; note that a caller
|
|
76
|
-
* which used to sum characters and round once now rounds per call, so summing
|
|
77
|
-
* this estimator over messages can differ from the legacy total by at most one
|
|
78
|
-
* token per call (ASCII-only sums included). ANSI escapes are NOT stripped: they
|
|
79
|
-
* are ASCII, and the provider tokenizes the literal message bytes rather than
|
|
80
|
-
* the rendered cells.
|
|
81
|
-
*
|
|
82
|
-
* @param text - Model-visible text (a prompt, an assistant block, a tool
|
|
83
|
-
* result); widths are irrelevant here, this counts characters, not cells.
|
|
84
|
-
* @returns The estimated token count (0 for empty input).
|
|
85
|
-
*/
|
|
86
|
-
export function estimateTokens(text) {
|
|
87
|
-
if (text === '')
|
|
88
|
-
return 0;
|
|
89
|
-
// Fast path: ASCII-only text is exactly the legacy rate, and the regex scan
|
|
90
|
-
// keeps the overwhelmingly common English case cheaper than a code-point walk.
|
|
91
|
-
if (!NON_ASCII_RE.test(text))
|
|
92
|
-
return Math.ceil(text.length / CHARS_PER_TOKEN_ASCII);
|
|
93
|
-
let ascii = 0;
|
|
94
|
-
let dense = 0;
|
|
95
|
-
let other = 0;
|
|
96
|
-
for (const character of text) {
|
|
97
|
-
// `for…of` walks code points, so a surrogate pair (emoji, CJK extension B+)
|
|
98
|
-
// counts once instead of twice.
|
|
99
|
-
const codePoint = character.codePointAt(0) ?? 0;
|
|
100
|
-
if (codePoint < 0x80)
|
|
101
|
-
ascii += 1;
|
|
102
|
-
else if (isDenseScript(codePoint))
|
|
103
|
-
dense += 1;
|
|
104
|
-
else
|
|
105
|
-
other += 1;
|
|
106
|
-
}
|
|
107
|
-
return Math.ceil(ascii / CHARS_PER_TOKEN_ASCII
|
|
108
|
-
+ dense / CHARS_PER_TOKEN_CJK
|
|
109
|
-
+ other / CHARS_PER_TOKEN_OTHER);
|
|
110
|
-
}
|
|
1
|
+
import { emptyTokenUsage, estimateTokens } from '../../channel/usage.js';
|
|
2
|
+
// The neutral helpers live with the shared projector (src/channel/usage.ts);
|
|
3
|
+
// re-exported here for the existing importers.
|
|
4
|
+
export { emptyTokenUsage, estimateTokens };
|
|
111
5
|
/** Whether one stream chunk advances the first-token/decode boundary. */
|
|
112
6
|
export function isTokenDelta(chunk) {
|
|
113
7
|
switch (chunk.type) {
|
|
@@ -132,7 +26,7 @@ export function tokenDeltaChars(chunk) {
|
|
|
132
26
|
return 0;
|
|
133
27
|
}
|
|
134
28
|
}
|
|
135
|
-
/**
|
|
29
|
+
/** DSH-shaped (`outputTokens`) output count when usable; durable imports may predate strict validation. */
|
|
136
30
|
export function usageOutputTokens(usage) {
|
|
137
31
|
if (typeof usage !== 'object' || usage === null)
|
|
138
32
|
return undefined;
|