@deepseek-harness-tui/dsh-tui 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -59
- package/bin/dsh-tui.js +46 -3
- package/cordis.patch.yml +5 -3
- package/cordis.yml +3 -2
- package/guide/dsh-tui-guide/codex-backend.en.md +2 -2
- package/guide/dsh-tui-guide/codex-backend.md +2 -2
- package/guide/dsh-tui-guide/configuration.en.md +7 -2
- package/guide/dsh-tui-guide/configuration.md +7 -2
- package/guide/dsh-tui-guide/getting-started.en.md +168 -4
- package/guide/dsh-tui-guide/getting-started.md +121 -14
- package/guide/dsh-tui-guide/interaction.en.md +11 -10
- package/guide/dsh-tui-guide/interaction.md +5 -4
- package/guide/dsh-tui-guide/user-guide.en.md +12 -6
- package/guide/dsh-tui-guide/user-guide.md +12 -6
- package/lib/settings.json +24 -8
- package/lib/types/adapter/ports/channel-ui.d.ts +10 -7
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +67 -8
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/agent/events.d.ts +14 -5
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/agent/session.d.ts +5 -0
- package/lib/types/agent/session.d.ts.map +1 -1
- package/lib/types/backends/claude/tools.d.ts.map +1 -1
- package/lib/types/backends/claude/tools.js +8 -3
- package/lib/types/backends/claude/translate/core.d.ts +2 -2
- package/lib/types/backends/claude/translate/core.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/core.js +10 -6
- package/lib/types/backends/codex/session/commands.d.ts +2 -0
- package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
- package/lib/types/backends/codex/session/commands.js +8 -4
- package/lib/types/backends/codex/session/input.d.ts +11 -7
- package/lib/types/backends/codex/session/input.d.ts.map +1 -1
- package/lib/types/backends/codex/session/input.js +68 -15
- package/lib/types/backends/codex/session/session.d.ts.map +1 -1
- package/lib/types/backends/codex/session/session.js +2 -3
- package/lib/types/backends/codex/translate/presentation.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/presentation.js +5 -2
- package/lib/types/channel/interaction.d.ts.map +1 -1
- package/lib/types/channel/interaction.js +1 -0
- package/lib/types/channel/permissions.d.ts +15 -0
- package/lib/types/channel/permissions.d.ts.map +1 -1
- package/lib/types/channel/permissions.js +28 -0
- package/lib/types/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +89 -11
- package/lib/types/channel/questions.d.ts +45 -3
- package/lib/types/channel/questions.d.ts.map +1 -1
- package/lib/types/channel/questions.js +43 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +8 -4
- package/lib/types/channel/subagent-failure.d.ts +49 -0
- package/lib/types/channel/subagent-failure.d.ts.map +1 -0
- package/lib/types/channel/subagent-failure.js +59 -0
- package/lib/types/channel/transcript.d.ts +17 -0
- package/lib/types/channel/transcript.d.ts.map +1 -1
- package/lib/types/channel/transcript.js +35 -0
- package/lib/types/commands.js +2 -2
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +14 -10
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +61 -6
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +3 -2
- package/lib/types/components/StarPrompt.d.ts +5 -3
- package/lib/types/components/StarPrompt.d.ts.map +1 -1
- package/lib/types/components/StarPrompt.js +56 -6
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +1 -1
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +9 -2
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +126 -25
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -8
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +7 -4
- package/lib/types/components/questions/PlanReviewPanel.d.ts +3 -6
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/revealScope.d.ts +15 -0
- package/lib/types/components/revealScope.d.ts.map +1 -0
- package/lib/types/components/revealScope.js +17 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +34 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +108 -7
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +1 -1
- package/lib/types/components/smoothReveal.d.ts +36 -6
- package/lib/types/components/smoothReveal.d.ts.map +1 -1
- package/lib/types/components/smoothReveal.js +92 -21
- package/lib/types/components/teamRoster.d.ts +6 -3
- package/lib/types/components/teamRoster.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +4 -14
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +26 -17
- package/lib/types/dsh-adapter/approvals.d.ts +19 -0
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
- package/lib/types/dsh-adapter/approvals.js +17 -1
- package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/session.js +12 -0
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +21 -4
- package/lib/types/dsh-adapter/channel/attached-context.d.ts +15 -2
- package/lib/types/dsh-adapter/channel/attached-context.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/attached-context.js +26 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +43 -2
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +2 -6
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +7 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +2 -6
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +3 -26
- package/lib/types/dsh-adapter/channel/emitter.js +1 -1
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +15 -4
- package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +34 -10
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +3 -7
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +14 -5
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +7 -3
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +26 -9
- package/lib/types/dsh-adapter/channel/model-selection.d.ts +27 -2
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-selection.js +81 -37
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection-helpers.js +4 -2
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +6 -2
- 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 -4
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +185 -36
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +55 -4
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +80 -16
- package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-transcript.js +6 -5
- package/lib/types/dsh-adapter/channel/task-completion.js +2 -10
- package/lib/types/dsh-adapter/channel/transcript.d.ts +3 -2
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +13 -4
- package/lib/types/dsh-adapter/channel/types.d.ts +11 -2
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/compaction-previews.d.ts +11 -0
- package/lib/types/dsh-adapter/compat/compaction-previews.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/compaction-previews.js +38 -0
- package/lib/types/dsh-adapter/compat/messages.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/messages.js +2 -2
- package/lib/types/dsh-adapter/contract.d.ts +29 -3
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +48 -5
- package/lib/types/dsh-adapter/experimental-bundles.d.ts +5 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/experimental-bundles.js +0 -2
- package/lib/types/dsh-adapter/fresh-agent.d.ts +1 -1
- package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
- package/lib/types/dsh-adapter/fresh-agent.js +60 -11
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +60 -11
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-contract.js +5 -3
- package/lib/types/dsh-adapter/host-dsh.d.ts +2 -8
- package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-dsh.js +30 -6
- package/lib/types/dsh-adapter/host-entry.js +4 -0
- package/lib/types/dsh-adapter/index.d.ts +9 -1
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +5 -0
- package/lib/types/dsh-adapter/oauth/account-notifications.d.ts +73 -0
- package/lib/types/dsh-adapter/oauth/account-notifications.d.ts.map +1 -0
- package/lib/types/dsh-adapter/oauth/account-notifications.js +250 -0
- package/lib/types/dsh-adapter/oauth/bonus.d.ts +34 -9
- package/lib/types/dsh-adapter/oauth/bonus.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/bonus.js +47 -5
- package/lib/types/dsh-adapter/oauth/deepseek.d.ts +7 -2
- package/lib/types/dsh-adapter/oauth/deepseek.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/deepseek.js +6 -1
- package/lib/types/dsh-adapter/oauth/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/index.js +44 -0
- package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/profiles.js +14 -1
- package/lib/types/dsh-adapter/oauth/service.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/service.js +5 -6
- package/lib/types/dsh-adapter/plugin-manage.d.ts +6 -4
- package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-manage.js +3 -2
- package/lib/types/dsh-adapter/plugin.d.ts +237 -6
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +751 -67
- package/lib/types/dsh-adapter/presets.d.ts +38 -11
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +46 -17
- package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
- package/lib/types/dsh-adapter/process-exit.js +1 -1
- package/lib/types/dsh-adapter/questions.d.ts +3 -4
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +1 -1
- package/lib/types/dsh-adapter/session-list-metadata.js +2 -2
- package/lib/types/dsh-adapter/session-projection-store.d.ts +1 -1
- package/lib/types/dsh-adapter/session-projection-store.d.ts.map +1 -1
- package/lib/types/dsh-adapter/session-projection-store.js +30 -23
- package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessionTree.js +4 -1
- package/lib/types/dsh-adapter/subagents.d.ts +6 -0
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +32 -3
- package/lib/types/dsh-adapter/team-mode.d.ts +46 -27
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-mode.js +157 -29
- package/lib/types/dsh-adapter/team-roster.d.ts +53 -18
- package/lib/types/dsh-adapter/team-roster.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-roster.js +206 -39
- package/lib/types/dsh-adapter/team-tools.d.ts +25 -12
- package/lib/types/dsh-adapter/team-tools.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-tools.js +81 -26
- package/lib/types/dsh-adapter/tool-scope.d.ts +24 -0
- package/lib/types/dsh-adapter/tool-scope.d.ts.map +1 -0
- package/lib/types/dsh-adapter/tool-scope.js +127 -0
- package/lib/types/dsh-adapter/types.d.ts +2 -1
- package/lib/types/dsh-adapter/types.d.ts.map +1 -1
- package/lib/types/heldInputs.d.ts +55 -16
- package/lib/types/heldInputs.d.ts.map +1 -1
- package/lib/types/heldInputs.js +277 -41
- package/lib/types/i18n.d.ts +292 -20
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +89 -13
- package/lib/types/ink/components/App.d.ts +2 -0
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +8 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/dom.js +13 -3
- package/lib/types/ink/events/input-event.d.ts.map +1 -1
- package/lib/types/ink/events/input-event.js +7 -6
- package/lib/types/ink/flush-tick.d.ts +6 -0
- package/lib/types/ink/flush-tick.d.ts.map +1 -1
- package/lib/types/ink/flush-tick.js +31 -0
- package/lib/types/ink/hit-test.d.ts +2 -0
- package/lib/types/ink/hit-test.d.ts.map +1 -1
- package/lib/types/ink/hit-test.js +10 -0
- package/lib/types/ink/hooks/use-program-status.d.ts +1 -1
- package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-program-status.js +3 -2
- package/lib/types/ink/hooks/use-terminal-title.d.ts +15 -0
- package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-terminal-title.js +23 -3
- package/lib/types/ink/ink.d.ts +1 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +7 -4
- package/lib/types/ink/jumpback-state.d.ts +33 -0
- package/lib/types/ink/jumpback-state.d.ts.map +1 -0
- package/lib/types/ink/jumpback-state.js +51 -0
- package/lib/types/ink/jumpback.d.ts +78 -0
- package/lib/types/ink/jumpback.d.ts.map +1 -0
- package/lib/types/ink/jumpback.js +515 -0
- package/lib/types/ink/log-update.js +37 -14
- package/lib/types/ink/notify-helper/activate.cs +836 -0
- package/lib/types/ink/notify-helper/compile.d.ts +30 -0
- package/lib/types/ink/notify-helper/compile.d.ts.map +1 -0
- package/lib/types/ink/notify-helper/compile.js +235 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +25 -0
- package/lib/types/ink/terminal-notification-windows.d.ts +8 -4
- package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification-windows.js +14 -21
- package/lib/types/ink/terminal-notification.d.ts +31 -2
- package/lib/types/ink/terminal-notification.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification.js +51 -0
- package/lib/types/ink/terminal.d.ts +15 -3
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +38 -9
- package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.js +1 -1
- package/lib/types/screens/Chat.d.ts +4 -3
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +81 -11
- package/lib/types/screens/SessionSupervisor.d.ts +3 -6
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +5 -8
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +1 -2
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +2 -2
- package/lib/types/screens/sessionSupervisor/model.d.ts +1 -1
- package/lib/types/screens/sessionSupervisor/model.js +1 -1
- package/lib/types/sessionMounts.d.ts +12 -5
- package/lib/types/sessionMounts.d.ts.map +1 -1
- package/lib/types/sessionMounts.js +33 -6
- package/lib/types/settings/definitions.d.ts +12 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +15 -7
- package/lib/types/update.d.ts +412 -20
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +2094 -193
- package/lib/types/updateHost.d.ts +198 -0
- package/lib/types/updateHost.d.ts.map +1 -0
- package/lib/types/updateHost.js +608 -0
- package/lib/types/utils/processName.d.ts +16 -0
- package/lib/types/utils/processName.d.ts.map +1 -0
- package/lib/types/utils/processName.js +27 -0
- package/package.json +114 -111
- package/presets/liangshen/agent.cordis.yml +4 -0
- package/tui-profile/feed/README.md +1 -1
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -12,18 +12,48 @@ export declare function subscribeReveal(listener: () => void): () => void;
|
|
|
12
12
|
export declare function getRevealVersion(): number;
|
|
13
13
|
/** Force-complete (and forget) a cursor: expanded card, replaced view, … */
|
|
14
14
|
export declare function snapReveal(key: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Key for `key` inside `scope`. Every Chat root owns its reveal memory: ids
|
|
17
|
+
* restart at 0 inside a root, so a sibling root's rebind must not clear (or
|
|
18
|
+
* inherit) another root's completed keys. `undefined` keeps the bare key —
|
|
19
|
+
* single-root scripts, tests, and any caller outside a Chat provider.
|
|
20
|
+
*/
|
|
21
|
+
export declare function scopeRevealKey(scope: string | undefined, key: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Session boundary (agent switch, `/resume`, rewind adopt): row ids restart
|
|
24
|
+
* at 0, so a key from the previous session (`a12`) names a different row in
|
|
25
|
+
* the new one. Drop both the completed memory and any in-flight cursors —
|
|
26
|
+
* replayed rows read with `active: false` and paint complete anyway, while
|
|
27
|
+
* the new session's live rows must be free to animate from scratch. The
|
|
28
|
+
* scheduler, listeners and version store stay intact: the mounted tree keeps
|
|
29
|
+
* subscribing, and clearing both cursor tables stops the timer synchronously.
|
|
30
|
+
*
|
|
31
|
+
* Known residue: a backend `conversation_reset` also restarts row ids, but it
|
|
32
|
+
* is a channel-layer event that never crosses into the UI — that path keeps
|
|
33
|
+
* its stale keys, so the first rows after such a reset paint without a
|
|
34
|
+
* reveal. The old 2048 FIFO used to heal this by accident once a session had
|
|
35
|
+
* revealed past the cap; with no eviction it is permanent until the agent
|
|
36
|
+
* changes. Covering it needs a row-id-regression signal from the channel;
|
|
37
|
+
* tracked in #1795.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resetRevealSession(scope: string): void;
|
|
15
40
|
export type RevealReadOptions = {
|
|
16
41
|
/** Master switch (settings `dsh-tui.smoothStreaming`); false = full text. */
|
|
17
42
|
enabled: boolean;
|
|
18
43
|
/**
|
|
19
44
|
* Whether this content arrived "just now" (live streaming row, freshly
|
|
20
45
|
* settled row, live-created tool card). The FIRST read with active=true
|
|
21
|
-
* creates the cursor at zero — that is what turns a one-shot
|
|
22
|
-
*
|
|
23
|
-
* (history / replayed content)
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
46
|
+
* creates the cursor at zero — that is what turns a one-shot non-streaming
|
|
47
|
+
* delivery into a smooth paint. A first TEXT read with active=false
|
|
48
|
+
* (history / replayed content) paints the whole text and registers a
|
|
49
|
+
* caught-up cursor (revealed == text.length, no timer), so replaying a
|
|
50
|
+
* transcript typewrites nothing while a later live continuation of the same
|
|
51
|
+
* row starts at the painted length instead of zero. The count reader
|
|
52
|
+
* (`revealLinesOf`) has no such cursor: an inactive read just returns the
|
|
53
|
+
* total, and the next active read starts a fresh cursor. `active` decides
|
|
54
|
+
* where a new cursor starts, not whether one exists; settling mid-reveal
|
|
55
|
+
* deliberately keeps revealing (the "non-streaming becomes streaming"
|
|
56
|
+
* contract).
|
|
27
57
|
*/
|
|
28
58
|
active: boolean;
|
|
29
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smoothReveal.d.ts","sourceRoot":"","sources":["../../../src/components/smoothReveal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smoothReveal.d.ts","sourceRoot":"","sources":["../../../src/components/smoothReveal.ts"],"names":[],"mappings":"AA6CA,oEAAoE;AACpE,eAAO,MAAM,eAAe,QAAY,CAA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ACzE,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C"}
|
|
@@ -25,8 +25,11 @@
|
|
|
25
25
|
* never notice (stale cached heights → blank bands). Instead the cursors
|
|
26
26
|
* live here keyed by row identity, the READS happen during render (they feed
|
|
27
27
|
* the same flattened `text` prop the streaming path already uses), and the
|
|
28
|
-
* WRITES happen
|
|
29
|
-
* MessageList subscribes to via useSyncExternalStore
|
|
28
|
+
* WRITES happen in two places: the scheduler tick, which bumps a version
|
|
29
|
+
* that MessageList subscribes to via useSyncExternalStore; and the first
|
|
30
|
+
* history read of a row, which registers a caught-up cursor (see
|
|
31
|
+
* RevealReadOptions.active) so a later live continuation of that row does
|
|
32
|
+
* not restart it. A reveal therefore
|
|
30
33
|
* rides the exact same update pipeline as an arriving chunk: prop change →
|
|
31
34
|
* memo miss → re-render → post-commit measurement. Render-phase reads are
|
|
32
35
|
* idempotent and safe to re-run (a discarded concurrent render at worst
|
|
@@ -72,23 +75,42 @@ const countCursors = new Map();
|
|
|
72
75
|
* Keys whose reveal has COMPLETED (caught up, snapped, or replaced). A
|
|
73
76
|
* completed key must not re-create a cursor on a later active read — the
|
|
74
77
|
* content is already fully on screen, and re-revealing would blank it and
|
|
75
|
-
* typewrite again.
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* row
|
|
78
|
+
* typewrite again.
|
|
79
|
+
*
|
|
80
|
+
* Deliberately UNBOUNDED. The 2048-entry FIFO this replaced dropped the
|
|
81
|
+
* oldest half, which turns "already painted once" back into "never painted".
|
|
82
|
+
* Its premise — that a forgotten row re-paints full through the
|
|
83
|
+
* `active: false` path — does not hold: `fresh` is set when a live turn
|
|
84
|
+
* settles and is never cleared, so a remounted row keeps claiming
|
|
85
|
+
* liveliness and gets typewritten again from its first character (#1787).
|
|
86
|
+
* Long sessions were exactly the case that overflowed.
|
|
87
|
+
*
|
|
88
|
+
* Growth follows the session, not time: at most a few short keys per row
|
|
89
|
+
* (`a{id}`, `r{id}`, `tool:{callId}`, `tool:{callId}:split`), on rows that
|
|
90
|
+
* stay resident — `foldRows` never drops a row, and the projection's
|
|
91
|
+
* merge/replace paths are the only removers (their ids are never reused, so
|
|
92
|
+
* the leftover keys cost memory but cannot collide). It is every RENDERED
|
|
93
|
+
* row, not only the ones that revealed: a history read registers a caught-up
|
|
94
|
+
* text cursor, and the next tick retires it into `completedReveals`.
|
|
95
|
+
* Measured on V8: 50k `a{id}` keys ≈ 2.4 MB, 50k `tool:{callId}:split`
|
|
96
|
+
* keys ≈ 12.3 MB — second-order next to the ChatRow objects the same
|
|
97
|
+
* session already holds. The contributor guide's long-session memory rule
|
|
98
|
+
* asks for a measured alternative before removing a cache bound; the
|
|
99
|
+
* measurement is above, and the alternative does not exist while `fresh`
|
|
100
|
+
* is never cleared: any count-based bound re-opens #1787 (an evicted
|
|
101
|
+
* off-screen row re-reads as active and typewrites once it scrolls back).
|
|
102
|
+
*
|
|
103
|
+
* It also grows on the render path, which the same guide warns about under
|
|
104
|
+
* its unbounded render-phase collection rule. The distinction from the
|
|
105
|
+
* neighbouring `HEIGHTS_CACHE_MAX` FIFO in MessageList is what an eviction
|
|
106
|
+
* costs there: a forgotten height only mis-estimates geometry and falls
|
|
107
|
+
* back to `DEFAULT_ROW_HEIGHT`, while a forgotten key re-typewrites the
|
|
108
|
+
* row — the exact report this comment exists for. Making `fresh`
|
|
109
|
+
* transactional would lift the constraint; that is a projection change,
|
|
110
|
+
* tracked in #1795.
|
|
80
111
|
*/
|
|
81
112
|
const completedReveals = new Set();
|
|
82
|
-
const COMPLETED_REVEALS_MAX = 2048;
|
|
83
113
|
function markRevealCompleted(key) {
|
|
84
|
-
if (completedReveals.size >= COMPLETED_REVEALS_MAX) {
|
|
85
|
-
let drop = COMPLETED_REVEALS_MAX / 2;
|
|
86
|
-
for (const old of completedReveals) {
|
|
87
|
-
if (drop-- <= 0)
|
|
88
|
-
break;
|
|
89
|
-
completedReveals.delete(old);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
114
|
completedReveals.add(key);
|
|
93
115
|
}
|
|
94
116
|
// ---------------------------------------------------------------------------
|
|
@@ -180,6 +202,51 @@ export function snapReveal(key) {
|
|
|
180
202
|
if (textCursors.delete(key) || countCursors.delete(key))
|
|
181
203
|
markRevealCompleted(key);
|
|
182
204
|
}
|
|
205
|
+
/** Scope separator: NUL never appears in a row id or a call id, so a scoped
|
|
206
|
+
* key stays unambiguous and one root clears its own entries by prefix. */
|
|
207
|
+
const REVEAL_SCOPE_SEPARATOR = '\u0000';
|
|
208
|
+
/**
|
|
209
|
+
* Key for `key` inside `scope`. Every Chat root owns its reveal memory: ids
|
|
210
|
+
* restart at 0 inside a root, so a sibling root's rebind must not clear (or
|
|
211
|
+
* inherit) another root's completed keys. `undefined` keeps the bare key —
|
|
212
|
+
* single-root scripts, tests, and any caller outside a Chat provider.
|
|
213
|
+
*/
|
|
214
|
+
export function scopeRevealKey(scope, key) {
|
|
215
|
+
return scope === undefined ? key : `${scope}${REVEAL_SCOPE_SEPARATOR}${key}`;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Session boundary (agent switch, `/resume`, rewind adopt): row ids restart
|
|
219
|
+
* at 0, so a key from the previous session (`a12`) names a different row in
|
|
220
|
+
* the new one. Drop both the completed memory and any in-flight cursors —
|
|
221
|
+
* replayed rows read with `active: false` and paint complete anyway, while
|
|
222
|
+
* the new session's live rows must be free to animate from scratch. The
|
|
223
|
+
* scheduler, listeners and version store stay intact: the mounted tree keeps
|
|
224
|
+
* subscribing, and clearing both cursor tables stops the timer synchronously.
|
|
225
|
+
*
|
|
226
|
+
* Known residue: a backend `conversation_reset` also restarts row ids, but it
|
|
227
|
+
* is a channel-layer event that never crosses into the UI — that path keeps
|
|
228
|
+
* its stale keys, so the first rows after such a reset paint without a
|
|
229
|
+
* reveal. The old 2048 FIFO used to heal this by accident once a session had
|
|
230
|
+
* revealed past the cap; with no eviction it is permanent until the agent
|
|
231
|
+
* changes. Covering it needs a row-id-regression signal from the channel;
|
|
232
|
+
* tracked in #1795.
|
|
233
|
+
*/
|
|
234
|
+
export function resetRevealSession(scope) {
|
|
235
|
+
const prefix = `${scope}${REVEAL_SCOPE_SEPARATOR}`;
|
|
236
|
+
for (const key of [...textCursors.keys()]) {
|
|
237
|
+
if (key.startsWith(prefix))
|
|
238
|
+
textCursors.delete(key);
|
|
239
|
+
}
|
|
240
|
+
for (const key of [...countCursors.keys()]) {
|
|
241
|
+
if (key.startsWith(prefix))
|
|
242
|
+
countCursors.delete(key);
|
|
243
|
+
}
|
|
244
|
+
for (const key of [...completedReveals]) {
|
|
245
|
+
if (key.startsWith(prefix))
|
|
246
|
+
completedReveals.delete(key);
|
|
247
|
+
}
|
|
248
|
+
stopRevealTimerIfIdle();
|
|
249
|
+
}
|
|
183
250
|
/**
|
|
184
251
|
* Revealed length of `text` for `key` — the cursor logic of
|
|
185
252
|
* {@link revealTextOf} without the slice allocation (layout signatures read
|
|
@@ -201,8 +268,15 @@ export function revealLengthOf(key, text, options) {
|
|
|
201
268
|
// again.
|
|
202
269
|
if (completedReveals.has(key))
|
|
203
270
|
return text.length;
|
|
204
|
-
if (!options.active)
|
|
271
|
+
if (!options.active) {
|
|
272
|
+
// Painted as history (a settled live row, a replayed row). Remember
|
|
273
|
+
// that the whole text is already on screen: a live continuation reuses
|
|
274
|
+
// this key, and without the caught-up cursor it would fall into the
|
|
275
|
+
// active branch below, create `revealed: 0` and typewrite the row
|
|
276
|
+
// again from its first character. Already complete, so no timer.
|
|
277
|
+
textCursors.set(key, { text, revealed: text.length });
|
|
205
278
|
return text.length;
|
|
279
|
+
}
|
|
206
280
|
textCursors.set(key, { text, revealed: 0 });
|
|
207
281
|
ensureRevealTimer();
|
|
208
282
|
return 0;
|
|
@@ -292,11 +366,8 @@ export function resetRevealForTest() {
|
|
|
292
366
|
textCursors.clear();
|
|
293
367
|
countCursors.clear();
|
|
294
368
|
completedReveals.clear();
|
|
369
|
+
stopRevealTimerIfIdle();
|
|
295
370
|
revealListeners.clear();
|
|
296
|
-
if (revealTimer !== undefined) {
|
|
297
|
-
clearInterval(revealTimer);
|
|
298
|
-
revealTimer = undefined;
|
|
299
|
-
}
|
|
300
371
|
revealVersionValue = 0;
|
|
301
372
|
}
|
|
302
373
|
/** Whether the shared scheduler currently runs (refcount assertions). */
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent Teams in the agents surfaces (issue #1241, phase 2): fold the
|
|
3
3
|
* session's `TeamView` and its subagent rows into what the dashboard
|
|
4
|
-
* renders.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* renders. Both upstream shapes arrive as the same `TeamView`: a legacy
|
|
5
|
+
* roster wire's durable members, or the `0.2.2-rc.2` selection wire's Lead
|
|
6
|
+
* plus named subagents composed in `team-roster.ts`. A teammate is a
|
|
7
|
+
* continuable subagent of the Lead whose row id is the member id, so the two
|
|
8
|
+
* join by id; neither side overwrites the other's state (see
|
|
9
|
+
* `teamMemberStatus`). Pure: no I/O, no backend import.
|
|
7
10
|
*/
|
|
8
11
|
import type { TeamMember, TeamTask, TeamView } from '../adapter/ports/channel-view.js';
|
|
9
12
|
import type { SubagentState } from '../dsh-adapter/subagents.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teamRoster.d.ts","sourceRoot":"","sources":["../../../src/components/teamRoster.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"teamRoster.d.ts","sourceRoot":"","sources":["../../../src/components/teamRoster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAEhE;;8CAE8C;AAC9C,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;A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wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAEzD"}
|
|
@@ -4,22 +4,12 @@ import type { ContextMenuEvent } from '../../ink/events/context-menu-event.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* One workspace in the home screen's left rail.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* (`.../a/work` and `.../b/work`), and the ledger allows duplicate titles, so
|
|
11
|
-
* the path is the only thing that tells them apart.
|
|
12
|
-
*
|
|
13
|
-
* Widths are resolved here rather than left to flexbox for the same reason the
|
|
14
|
-
* session rows resolve them: a row must be exactly two lines at every terminal
|
|
15
|
-
* width, and a wrapped row destroys the alignment a list is scanned by.
|
|
7
|
+
* A single name-and-count line at every terminal width. The selected
|
|
8
|
+
* workspace path lives above the panes, where it has the full screen width
|
|
9
|
+
* instead of repeating a truncated path under every name.
|
|
16
10
|
*/
|
|
17
|
-
export declare function HomeWorkspaceRow({ title,
|
|
11
|
+
export declare function HomeWorkspaceRow({ title, sessionCount, historyOnly, present, selected, focused, declareCursor, width, onSelect, onMenu, }: {
|
|
18
12
|
title: string;
|
|
19
|
-
/** Canonical directory path recorded in the ledger. */
|
|
20
|
-
path: string;
|
|
21
|
-
/** Home directory, for collapsing the path to `~`. */
|
|
22
|
-
home: string;
|
|
23
13
|
sessionCount: number;
|
|
24
14
|
/** Derived from session history, without a workspace registration. */
|
|
25
15
|
historyOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomeWorkspaceRow.d.ts","sourceRoot":"","sources":["../../../../src/components/workspaces/HomeWorkspaceRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;
|
|
1
|
+
{"version":3,"file":"HomeWorkspaceRow.d.ts","sourceRoot":"","sources":["../../../../src/components/workspaces/HomeWorkspaceRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAK9E;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,YAAY,EACZ,WAAmB,EACnB,OAAO,EACP,QAAQ,EACR,OAAO,EACP,aAAqB,EACrB,KAAK,EACL,QAAQ,EACR,MAAM,GACP,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,sEAAsE;IACtE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0DAA0D;IAC1D,OAAO,EAAE,OAAO,CAAA;IAChB,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,uBAAuB;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,QAAQ,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IAClC,mDAAmD;IACnD,MAAM,CAAC,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAA;CACvC,GAAG,KAAK,CAAC,SAAS,CAoDlB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,KAAK,EACL,MAAM,GACP,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;CACjC,GAAG,KAAK,CAAC,SAAS,CAoBlB"}
|
|
@@ -2,40 +2,49 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Box, Text } from '../../ui.js';
|
|
4
4
|
import { t } from '../../i18n.js';
|
|
5
|
-
import {
|
|
5
|
+
import { stringWidth } from '../../ink/stringWidth.js';
|
|
6
|
+
import { spreadRow, truncateWidth } from '../../sessions/format.js';
|
|
6
7
|
import { useDeclaredCursor, useNativeCursor } from '../../ink/hooks/use-declared-cursor.js';
|
|
7
8
|
/**
|
|
8
9
|
* One workspace in the home screen's left rail.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* (`.../a/work` and `.../b/work`), and the ledger allows duplicate titles, so
|
|
14
|
-
* the path is the only thing that tells them apart.
|
|
15
|
-
*
|
|
16
|
-
* Widths are resolved here rather than left to flexbox for the same reason the
|
|
17
|
-
* session rows resolve them: a row must be exactly two lines at every terminal
|
|
18
|
-
* width, and a wrapped row destroys the alignment a list is scanned by.
|
|
11
|
+
* A single name-and-count line at every terminal width. The selected
|
|
12
|
+
* workspace path lives above the panes, where it has the full screen width
|
|
13
|
+
* instead of repeating a truncated path under every name.
|
|
19
14
|
*/
|
|
20
|
-
export function HomeWorkspaceRow({ title,
|
|
15
|
+
export function HomeWorkspaceRow({ title, sessionCount, historyOnly = false, present, selected, focused, declareCursor = false, width, onSelect, onMenu, }) {
|
|
21
16
|
const [hovered, setHovered] = useState(false);
|
|
22
17
|
const nativeCursor = useNativeCursor();
|
|
23
18
|
const cursorRef = useDeclaredCursor({ line: 0, column: 0, active: focused && declareCursor, visible: nativeCursor, hideOnIdle: true });
|
|
24
19
|
const body = Math.max(8, width - 4);
|
|
25
20
|
// The pane already labels the count; keep the rail's badge numeric and use
|
|
26
21
|
// its selected ring rather than a second check mark for the same state.
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
22
|
+
const count = String(sessionCount);
|
|
23
|
+
const ring = selected ? '▣' : '▢';
|
|
24
|
+
const history = t('supervisor-history-only');
|
|
25
|
+
const shortHistory = t('supervisor-history-only-short');
|
|
26
|
+
const missingBadge = `${t('home-workspace-missing')} · ${count}`;
|
|
27
|
+
const compactMissingBadge = `${t('home-workspace-missing')} ${count}`;
|
|
28
|
+
// Reserve room for the ring, an identifiable name and (where needed) the
|
|
29
|
+
// history marker. Fall back to a warning glyph if the text cannot fit.
|
|
30
|
+
const minimumName = stringWidth(`${ring} ${historyOnly ? `${shortHistory} ` : ''}界…`);
|
|
31
|
+
const fits = (value) => stringWidth(value) + 1 + minimumName <= body;
|
|
32
|
+
const badge = present ? count : fits(missingBadge) ? missingBadge : fits(compactMissingBadge) ? compactMissingBadge : `! ${count}`;
|
|
33
|
+
const nameWidth = Math.max(0, body - stringWidth(badge) - 1);
|
|
34
|
+
const fullName = `${ring} ${historyOnly ? `${history} · ${title}` : title}`;
|
|
35
|
+
// Shorten the history prefix when needed, preserving both the label and
|
|
36
|
+
// the beginning of the project name rather than truncating either away.
|
|
37
|
+
const name = historyOnly && stringWidth(fullName) > nameWidth ? `${ring} ${shortHistory} ${title}` : fullName;
|
|
38
|
+
const headingName = truncateWidth(name, nameWidth);
|
|
39
|
+
const heading = spreadRow(headingName, badge, body);
|
|
31
40
|
// The cursor (green) outranks the selection ring (green); both outrank the
|
|
32
41
|
// idle colour. Blue is not part of this ladder at all — see the background.
|
|
33
42
|
const headingColor = (focused || selected) ? 'success' : present ? 'text' : 'inactive';
|
|
34
|
-
return (
|
|
43
|
+
return (_jsx(Box, { flexDirection: "column", flexShrink: 0, paddingX: 1, onClick: onSelect, onContextMenu: onMenu, onMouseEnter: onSelect === undefined && onMenu === undefined ? undefined : () => setHovered(true), onMouseLeave: onSelect === undefined && onMenu === undefined ? undefined : () => setHovered(false),
|
|
35
44
|
// Hover is the BLUE prompt — pointer feedback and nothing else, so it
|
|
36
45
|
// never marks the focused or the selected row. Selection itself is green
|
|
37
46
|
// in the text, which is why this row draws no box while selected.
|
|
38
|
-
backgroundColor: hovered && !focused ? 'userMessageBackgroundHover' : undefined, children:
|
|
47
|
+
backgroundColor: hovered && !focused ? 'userMessageBackgroundHover' : undefined, children: _jsxs(Box, { ref: cursorRef, height: 1, flexShrink: 0, overflow: "hidden", children: [_jsx(Text, { color: focused ? 'success' : 'subtle', children: focused ? '❯ ' : ' ' }), _jsx(Text, { color: headingColor, bold: focused || selected, children: heading.left }), _jsx(Text, { dimColor: !focused, children: `${' '.repeat(heading.gap)}${heading.right}` })] }) }));
|
|
39
48
|
}
|
|
40
49
|
/**
|
|
41
50
|
* The `+` row that opens the directory picker.
|
|
@@ -64,6 +64,15 @@ export interface ApprovalSnapshot extends PermissionPanelSnapshot {
|
|
|
64
64
|
export declare function bindApprovalStore(ctx: Parameters<typeof compositionRoot>[0], store: ApprovalStore): void;
|
|
65
65
|
/** Host-only lookup used by the presentation Port bridge. */
|
|
66
66
|
export declare function getApprovalStore(ctx: Parameters<typeof compositionRoot>[0]): ApprovalStore | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* The ask's reason in the UI language. Requests may carry a localized
|
|
69
|
+
* `displayReason: { en, zh }` next to the English audit `reason` (DSH's
|
|
70
|
+
* auto-review asks do); older request types lack the field, so it is read
|
|
71
|
+
* structurally.
|
|
72
|
+
* @param req - The pending approval request.
|
|
73
|
+
* @returns The localized reason, else `req.reason`.
|
|
74
|
+
*/
|
|
75
|
+
export declare function reasonOf(req: ApprovalRequest): string | undefined;
|
|
67
76
|
/**
|
|
68
77
|
* Approval store: parks asks from the harness's approval seam, surfaces
|
|
69
78
|
* one at a time to the TUI, and settles each ask when the user decides or
|
|
@@ -129,6 +138,16 @@ export declare class ApprovalStore implements PermissionPanelSource {
|
|
|
129
138
|
* @returns One id per asking agent, or an empty array when none waits.
|
|
130
139
|
*/
|
|
131
140
|
pendingAgentIds(): readonly string[];
|
|
141
|
+
/**
|
|
142
|
+
* Whether this exact request object is still parked (active or queued). A
|
|
143
|
+
* notification queued before the native transport dispatches uses it to drop
|
|
144
|
+
* a toast whose approval was answered in the meantime; object identity is the
|
|
145
|
+
* only per-ask identity the protocol carries (the request has no id of its
|
|
146
|
+
* own and a null callId is legal).
|
|
147
|
+
* @param request - The request object handed to {@link park}.
|
|
148
|
+
* @returns True while that ask is still waiting for a decision.
|
|
149
|
+
*/
|
|
150
|
+
hasParkedRequest(request: ApprovalRequest): boolean;
|
|
132
151
|
/**
|
|
133
152
|
* The first parked ask's detail for one agent — the agent view's row
|
|
134
153
|
* summary while it needs input (the question it is blocked on).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/approvals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAG5D,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC3B,MAAM,2BAA2B,CAAA;AAElC;oDACoD;AACpD,MAAM,WAAW,gBAAiB,SAAQ,uBAAuB;IAC/D,wEAAwE;IACxE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,oEAAoE;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAA;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,E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pC;;;;;;;;OAQG;IACH,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO;IAOnD;;;;;;OAMG;IACH,kBAAkB,CAChB,OAAO,EAAE,MAAM,GACd,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS;IAUzG,OAAO,CAAC,IAAI;IAIZ;iFAC6E;IAC7E,OAAO,CAAC,cAAc;IAStB;;iDAE6C;IAC7C,OAAO,CAAC,iBAAiB;IAYzB,gEAAgE;IAChE,OAAO,CAAC,eAAe;IAOvB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,qBAAqB;IAY7B;;;;;;;;;;;;;;OAcG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;IAc5D;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;;;;;;;OAQG;IACH,IAAI,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IA4DpD;;;kCAG8B;IAC9B,OAAO,CAAC,SAAS;IAUjB;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,QAAQ,CAAC,EAAE,uBAAuB,GAAG,IAAI;IAajF;;;;OAIG;IACH,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAazC;;;OAGG;IACH,OAAO,CAAC,YAAY;IAKpB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,mBAAmB;CAsB5B"}
|
|
@@ -44,7 +44,7 @@ const COMMAND_CLIP = 500;
|
|
|
44
44
|
* @param req - The pending approval request.
|
|
45
45
|
* @returns The localized reason, else `req.reason`.
|
|
46
46
|
*/
|
|
47
|
-
function reasonOf(req) {
|
|
47
|
+
export function reasonOf(req) {
|
|
48
48
|
const display = req.displayReason;
|
|
49
49
|
if (display !== null && typeof display === 'object') {
|
|
50
50
|
const byLang = display;
|
|
@@ -217,6 +217,22 @@ export class ApprovalStore {
|
|
|
217
217
|
}
|
|
218
218
|
return ids;
|
|
219
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Whether this exact request object is still parked (active or queued). A
|
|
222
|
+
* notification queued before the native transport dispatches uses it to drop
|
|
223
|
+
* a toast whose approval was answered in the meantime; object identity is the
|
|
224
|
+
* only per-ask identity the protocol carries (the request has no id of its
|
|
225
|
+
* own and a null callId is legal).
|
|
226
|
+
* @param request - The request object handed to {@link park}.
|
|
227
|
+
* @returns True while that ask is still waiting for a decision.
|
|
228
|
+
*/
|
|
229
|
+
hasParkedRequest(request) {
|
|
230
|
+
for (const ask of this.active === undefined ? this.queue : [this.active, ...this.queue]) {
|
|
231
|
+
if (ask.request === request)
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
220
236
|
/**
|
|
221
237
|
* The first parked ask's detail for one agent — the agent view's row
|
|
222
238
|
* summary while it needs input (the question it is blocked on).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/backend/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAA+B,MAAM,uBAAuB,CAAA;AACpF,OAAO,KAAK,EAAc,YAAY,EAAoD,MAAM,wBAAwB,CAAA;AAKxH,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAExE,OAAO,QAAQ,6BAA6B,CAAC;IAC3C,UAAU,SAAS;QACjB,8CAA8C;QAC9C,QAAQ,C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AK,IAAI,YAAY,CAIpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,YAAY,CA8RjJ;AAED;2EAC2E;AAC3E,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CAI9D"}
|
|
@@ -239,6 +239,18 @@ export function createDshSession(ctx, target, options = {}) {
|
|
|
239
239
|
const onEvent = (event) => {
|
|
240
240
|
if (!active)
|
|
241
241
|
return;
|
|
242
|
+
if (event.type === 'request/context') {
|
|
243
|
+
// A prepared step can still report A after the next route became B.
|
|
244
|
+
// Keep that record in raw history, but do not publish its capacity
|
|
245
|
+
// into B's live view (or warn on it before a later reconciliation).
|
|
246
|
+
const route = event.data;
|
|
247
|
+
const model = agent.model;
|
|
248
|
+
const selected = typeof model?.current === 'function' ? model.current() : undefined;
|
|
249
|
+
if (selected !== undefined && typeof route.provider === 'string' && route.provider !== '' &&
|
|
250
|
+
typeof route.model === 'string' && route.model !== '' &&
|
|
251
|
+
(route.provider !== selected.provider || route.model !== selected.model))
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
242
254
|
// Legacy per-token chunks arrive as session events; they wake the
|
|
243
255
|
// renderer frame-coalesced like live stream frames.
|
|
244
256
|
listener(translator.translateEvent(event), event.type === 'assistant/chunk' ? FRAME : SYNC);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/backend/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,0BAA0B,CAAA;AAC/F,OAAO,EAAa,KAAK,UAAU,EAAqB,KAA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AG,SAAS;8BAgBhD,MAAM,WAAW,MAAM,QAAQ,YAAY,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,KAAG,cAAc,GAAG,SAAS;EA0UjI;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
|
|
@@ -2,6 +2,7 @@ import { NO_EVENTS } from '../../agent/events.js';
|
|
|
2
2
|
import { isPeakHour } from '../../deepseekPricing.js';
|
|
3
3
|
import { BACKGROUND_START_ACK, isSubagentToolName, parseJobOutputId, todoPanelItems, toolCommandOf } from '../channel/projection-helpers.js';
|
|
4
4
|
import { harnessToolResultView, prepareReplayEvents, toolErrorText } from '../channel/transcript.js';
|
|
5
|
+
import { CompactionPreviews } from '../compat/compaction-previews.js';
|
|
5
6
|
import { isCompactionCheckpointSource, toolResultPayload } from '../compat/messages.js';
|
|
6
7
|
import { transcriptImagesOf } from '../transcript-images.js';
|
|
7
8
|
import { isTeamToolName, TEAM_SPAWN_TOOL, teamMessageOf, teamToolCallView, teamToolResultView } from '../team-tools.js';
|
|
@@ -124,8 +125,13 @@ const usageDelta = (usage) => usage === undefined
|
|
|
124
125
|
/** DSH turn-close reasons; the ones without a shared name keep their label. */
|
|
125
126
|
const turnEndReason = (reason) => {
|
|
126
127
|
switch (reason.kind) {
|
|
127
|
-
case 'completed':
|
|
128
128
|
case 'aborted':
|
|
129
|
+
// Older durable logs may lack the nested cancel cause. Only the
|
|
130
|
+
// session's own teardown changes how the turn reads.
|
|
131
|
+
return reason.reason?.kind === 'disposed'
|
|
132
|
+
? { kind: 'aborted', cause: 'disposed' }
|
|
133
|
+
: { kind: 'aborted' };
|
|
134
|
+
case 'completed':
|
|
129
135
|
case 'interrupted':
|
|
130
136
|
case 'blocked':
|
|
131
137
|
return { kind: reason.kind };
|
|
@@ -155,6 +161,7 @@ export function createDshTranslator(deps) {
|
|
|
155
161
|
let lastStreamRevision = -1;
|
|
156
162
|
/** Whether this session's first human prompt has been translated. */
|
|
157
163
|
let promptSeen = false;
|
|
164
|
+
const compactionPreviews = new CompactionPreviews();
|
|
158
165
|
/**
|
|
159
166
|
* Open calls by callId until their result: what the result's presenter,
|
|
160
167
|
* images and task feeds need. `card: false` = question-presented (the
|
|
@@ -243,10 +250,15 @@ export function createDshTranslator(deps) {
|
|
|
243
250
|
// compat(dsh 0.2.0, log): a 0.2.0 mailbox delivery reads as the relay it became.
|
|
244
251
|
const data = teamMailboxAsRelay(event.data);
|
|
245
252
|
const base = { id: data.id, anchor: String(event.seq), seq: event.seq, time: event.time, blocks: data.content };
|
|
246
|
-
//
|
|
253
|
+
// Full and partial checkpoints render as folded summaries rather than
|
|
247
254
|
// disappearing with the other injected context.
|
|
248
255
|
if (isCompactionCheckpointSource(data.source)) {
|
|
249
|
-
|
|
256
|
+
const compactPreview = compactionPreviews.take(data.source);
|
|
257
|
+
return [{
|
|
258
|
+
type: 'user.message', ...base, source: 'compaction', text: textOf(data.content),
|
|
259
|
+
...(compactPreview === undefined ? {} : { compactPreview }),
|
|
260
|
+
...(data.source.kind === 'spine-checkpoint' ? { compactionScope: 'partial' } : {}),
|
|
261
|
+
}];
|
|
250
262
|
}
|
|
251
263
|
// Same-session goal domain: goal-sourced messages are the round driver's
|
|
252
264
|
// continuation prompts (positive rounds advance the counter); some hosts
|
|
@@ -342,6 +354,7 @@ export function createDshTranslator(deps) {
|
|
|
342
354
|
};
|
|
343
355
|
/** Translate one durable session event (live or as part of a replay). */
|
|
344
356
|
const translateEvent = (event) => {
|
|
357
|
+
compactionPreviews.observe(event);
|
|
345
358
|
const type = event.type;
|
|
346
359
|
// Top-level `goal/change` events are how the goal service records durable
|
|
347
360
|
// goal mutations (create/edit/pause/resume/complete/block/clear) —
|
|
@@ -387,7 +400,9 @@ export function createDshTranslator(deps) {
|
|
|
387
400
|
openCalls.set(callId, { name: data.name, args: data.arguments, card: false });
|
|
388
401
|
return [{ ...base, presentation: QUESTION }];
|
|
389
402
|
}
|
|
390
|
-
// The delegation tools render as the live subagent card
|
|
403
|
+
// The delegation tools render as the live subagent card (a
|
|
404
|
+
// historical `spawn_teammate` call included: rc.2 removed the tool,
|
|
405
|
+
// but older logs still hold it and its result is not a card).
|
|
391
406
|
if (isSubagentToolName(data.name)) {
|
|
392
407
|
if (data.name === TEAM_SPAWN_TOOL)
|
|
393
408
|
unwrittenSpawns.set(callId, base);
|
|
@@ -526,6 +541,7 @@ export function createDshTranslator(deps) {
|
|
|
526
541
|
const translateReplay = (events) => {
|
|
527
542
|
lastStreamRevision = -1;
|
|
528
543
|
promptSeen = false;
|
|
544
|
+
compactionPreviews.clear();
|
|
529
545
|
const out = [];
|
|
530
546
|
for (const event of prepareReplayEvents(events)) {
|
|
531
547
|
for (const translated of translateEvent(event))
|
|
@@ -537,6 +553,7 @@ export function createDshTranslator(deps) {
|
|
|
537
553
|
const reset = () => {
|
|
538
554
|
lastStreamRevision = -1;
|
|
539
555
|
promptSeen = false;
|
|
556
|
+
compactionPreviews.clear();
|
|
540
557
|
openCalls.clear();
|
|
541
558
|
unwrittenSpawns.clear();
|
|
542
559
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { AttachedContext } from '../../adapter/ports/channel-view.js';
|
|
2
2
|
import type { MentionExpansion } from './types.js';
|
|
3
3
|
/** What a panel hands to {@link AttachedContextRegistry.attach}: the staged
|
|
4
|
-
* projection minus the fields the channel derives itself (id/chars
|
|
5
|
-
export type AttachedContextInput = Pick<AttachedContext, 'source' | 'sourceId' | 'title' | 'content'
|
|
4
|
+
* projection minus the fields the channel derives itself (id/chars). */
|
|
5
|
+
export type AttachedContextInput = Pick<AttachedContext, 'source' | 'sourceId' | 'title' | 'content'> & {
|
|
6
|
+
/** Set by a caller that already capped this body (a retracted row's snapshot
|
|
7
|
+
* re-staged by the composer): the flag must ride along instead of being
|
|
8
|
+
* re-derived from a body that now fills the cap exactly. */
|
|
9
|
+
readonly truncated?: boolean;
|
|
10
|
+
};
|
|
6
11
|
/**
|
|
7
12
|
* Cell the registry writes through — the live ChannelState. The list is
|
|
8
13
|
* REPLACED on every change (never mutated in place), which is both what the
|
|
@@ -28,6 +33,14 @@ export declare function buildAttachedContextBlock(context: AttachedContext): str
|
|
|
28
33
|
* for. Returns how many blocks were appended (telemetry/assertions).
|
|
29
34
|
*/
|
|
30
35
|
export declare function appendAttachedContextBlocks(blocks: MentionExpansion['blocks'], contexts: readonly AttachedContext[]): number;
|
|
36
|
+
/**
|
|
37
|
+
* Snapshot-first merge: a dock re-send keeps the contexts its row saved and
|
|
38
|
+
* still carries anything staged while the row sat in the dock. The live chips
|
|
39
|
+
* were already taken by `captureOrigin()`, so dropping them here would lose
|
|
40
|
+
* them for good. A duplicate key is the same panel staged again: the newer
|
|
41
|
+
* staged snapshot replaces the saved one (the user just edited it).
|
|
42
|
+
*/
|
|
43
|
+
export declare function mergeAttachedContexts(saved: readonly AttachedContext[], staged: readonly AttachedContext[]): readonly AttachedContext[];
|
|
31
44
|
/** The ChannelState-facing surface (projection writes + the two actions). */
|
|
32
45
|
export interface AttachedContextRegistry {
|
|
33
46
|
/** Stage (or re-stage) one panel context; see the REPLACE note below. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attached-context.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/attached-context.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;
|
|
1
|
+
{"version":3,"file":"attached-context.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/attached-context.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;yEACyE;AACzE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,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