@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
|
@@ -15,6 +15,21 @@ const WEB_SETTINGS_PAGE = Object.freeze({
|
|
|
15
15
|
title: 'Search',
|
|
16
16
|
descriptions: Object.freeze({ zh: '搜索' }),
|
|
17
17
|
});
|
|
18
|
+
/** Credential-reference shape the credentials seam accepts (mirrors the host guard). */
|
|
19
|
+
const CREDENTIAL_REF = /^[A-Za-z_][A-Za-z0-9_]*$/u;
|
|
20
|
+
/** A credential-reference draft: a valid name, or a clear for an empty one. */
|
|
21
|
+
function credentialRefWrite(text) {
|
|
22
|
+
const ref = text.trim();
|
|
23
|
+
if (ref === '')
|
|
24
|
+
return { kind: 'clear' };
|
|
25
|
+
return CREDENTIAL_REF.test(ref) ? { kind: 'set', value: ref } : undefined;
|
|
26
|
+
}
|
|
27
|
+
/** The credential choices 0.2.2-rc.2 offers for each Search/Fetch capability. */
|
|
28
|
+
const BILLING_OPTIONS = [
|
|
29
|
+
{ value: 'auto', label: 'Auto', descriptions: { zh: '自动' } },
|
|
30
|
+
{ value: 'account', label: 'Account', descriptions: { zh: '账号' } },
|
|
31
|
+
{ value: 'api-key', label: 'API key', descriptions: { zh: 'API 密钥' } },
|
|
32
|
+
];
|
|
18
33
|
/** Forms over the host's web settings; provider selection remains owned by DSH. */
|
|
19
34
|
export function webSettingsSections(ctx, namespaces) {
|
|
20
35
|
const available = new Set(namespaces.map(view => view.ns));
|
|
@@ -32,21 +47,122 @@ export function webSettingsSections(ctx, namespaces) {
|
|
|
32
47
|
const ns = entry.options.id;
|
|
33
48
|
if (entry.fiber === undefined || !available.has(ns))
|
|
34
49
|
continue;
|
|
35
|
-
|
|
50
|
+
// Loader 1.1 retains the awaitable Fiber wrapper; its context still names
|
|
51
|
+
// the canonical owner, as on older Loaders that stored that owner directly.
|
|
52
|
+
const owner = concreteService(entry.fiber.ctx?.fiber ?? entry.fiber);
|
|
53
|
+
if (webOwner !== undefined && owner === concreteService(webOwner))
|
|
36
54
|
webNs = ns;
|
|
37
55
|
if (entry.fiber.runtime?.name === 'web-deepseek-api') {
|
|
38
56
|
apiNs = ns;
|
|
39
|
-
apiOwner =
|
|
57
|
+
apiOwner = owner;
|
|
40
58
|
}
|
|
41
59
|
if (entry.fiber.runtime?.name === 'web-search-deepseek') {
|
|
42
60
|
messagesNs = ns;
|
|
43
|
-
messagesOwner =
|
|
61
|
+
messagesOwner = owner;
|
|
44
62
|
}
|
|
45
63
|
}
|
|
46
64
|
// This section is introduced together with live provider selection in rc.2.
|
|
47
65
|
// Older hosts keep their existing search route without an ineffective picker.
|
|
48
66
|
if (apiNs === undefined)
|
|
49
67
|
return [];
|
|
68
|
+
const valueOf = (ns) => ns === undefined ? undefined : namespaces.find(view => view.ns === ns)?.value;
|
|
69
|
+
const webValue = valueOf(webNs);
|
|
70
|
+
const apiValue = valueOf(apiNs);
|
|
71
|
+
// 0.2.2-rc.2 replaced the shared `baseURL`/`apiKeyEnv` pair with per-capability
|
|
72
|
+
// endpoint and credential fields plus a billing choice; older hosts keep the
|
|
73
|
+
// pair. Follow the live Config shape so every host gets controls that apply.
|
|
74
|
+
const splitApi = getPath(apiValue, ['searchBilling']) !== undefined
|
|
75
|
+
|| getPath(apiValue, ['fetchBilling']) !== undefined;
|
|
76
|
+
/** A stored credential ref, when it is usable as a credentials-seam key. */
|
|
77
|
+
const credentialRefAt = (ns, path) => {
|
|
78
|
+
const value = getPath(valueOf(ns), path);
|
|
79
|
+
return typeof value === 'string' && CREDENTIAL_REF.test(value) ? value : undefined;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* The credential reference of the active DeepSeek API-key route. An unpinned
|
|
83
|
+
* Search/Fetch on rc.2 follows that route's origin and `apiKeyEnv` (the same
|
|
84
|
+
* directory the web provider resolves); only without the route does the
|
|
85
|
+
* provider fall back to DEEPSEEK_API_KEY.
|
|
86
|
+
*/
|
|
87
|
+
const officialRouteRef = () => {
|
|
88
|
+
const llm = ctx.get('llm');
|
|
89
|
+
let route;
|
|
90
|
+
try {
|
|
91
|
+
route = llm?.listConfigurableProviders?.().find(entry => entry.provider === 'deepseek-official');
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
if (route === undefined || route.settingsPath.length !== 0)
|
|
97
|
+
return undefined;
|
|
98
|
+
return credentialRefAt(route.settingsNs, ['apiKeyEnv']);
|
|
99
|
+
};
|
|
100
|
+
const sharedApiKeyRef = officialRouteRef() ?? 'DEEPSEEK_API_KEY';
|
|
101
|
+
/** A capability's own endpoint opts out of the model route's credential. */
|
|
102
|
+
const apiKeyRef = (capability) => {
|
|
103
|
+
const ownRef = credentialRefAt(apiNs, [`${capability}ApiKeyEnv`]);
|
|
104
|
+
if (ownRef !== undefined)
|
|
105
|
+
return ownRef;
|
|
106
|
+
const ownBaseURL = getPath(apiValue, [`${capability}BaseURL`]);
|
|
107
|
+
return typeof ownBaseURL === 'string' && ownBaseURL.length > 0
|
|
108
|
+
? 'DEEPSEEK_API_KEY'
|
|
109
|
+
: sharedApiKeyRef;
|
|
110
|
+
};
|
|
111
|
+
const store = ctx.get('credentials');
|
|
112
|
+
/** One write-only secret control over an exact Config owner and ref. */
|
|
113
|
+
const secretField = (options) => {
|
|
114
|
+
if (options.ns === undefined || options.owner === undefined || store === undefined)
|
|
115
|
+
return undefined;
|
|
116
|
+
const authorization = Object.freeze(new WebCredentialAuthorization());
|
|
117
|
+
webCredentialFields.set(authorization, {
|
|
118
|
+
store: concreteService(store), owner: options.owner, ns: options.ns, ref: options.ref,
|
|
119
|
+
// Two controls can name the same ref (Search and Fetch share
|
|
120
|
+
// DEEPSEEK_API_KEY); the slot keeps one stale control from validating
|
|
121
|
+
// the other capability's identical ref.
|
|
122
|
+
slot: options.path.join('.'),
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
path: options.path, label: options.label, descriptions: { zh: options.zh }, kind: 'text',
|
|
126
|
+
secret: { ref: options.ref, authorization },
|
|
127
|
+
hint: options.hint, hintDescriptions: { zh: options.hintZh },
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
// The Search key control follows the selected provider. With the rc.2 split
|
|
131
|
+
// fields a pinned `searchApiKeyEnv` names the store, otherwise the shared
|
|
132
|
+
// DEEPSEEK_API_KEY the provider falls back to; the legacy Messages route
|
|
133
|
+
// keeps its own `apiKeyEnv`.
|
|
134
|
+
const searchApi = getPath(webValue, ['searchProvider']) === 'deepseek-search-api';
|
|
135
|
+
const searchNs = searchApi ? apiNs : messagesNs ?? apiNs;
|
|
136
|
+
const searchOwner = searchApi ? apiOwner : messagesOwner ?? apiOwner;
|
|
137
|
+
const searchRef = searchApi && splitApi
|
|
138
|
+
? apiKeyRef('search')
|
|
139
|
+
: credentialRefAt(searchNs, ['apiKeyEnv']) ?? 'DEEPSEEK_API_KEY';
|
|
140
|
+
const pinnedSearch = searchApi && splitApi;
|
|
141
|
+
const searchKey = secretField({
|
|
142
|
+
path: pinnedSearch ? ['searchApiKey'] : ['apiKey'], label: 'API key', zh: 'API 密钥',
|
|
143
|
+
...(pinnedSearch
|
|
144
|
+
? {
|
|
145
|
+
hint: 'Paste the key for the pinned Search endpoint (its searchApiKeyEnv reference, or the shared DEEPSEEK_API_KEY). Saved keys are never displayed.',
|
|
146
|
+
hintZh: '粘贴固定搜索端点所用密钥(searchApiKeyEnv 引用,未设置时为共享的 DEEPSEEK_API_KEY),保存后不再显示原值。',
|
|
147
|
+
}
|
|
148
|
+
: {
|
|
149
|
+
hint: 'Paste a key for the selected search API (the active DeepSeek API-key route reference; DEEPSEEK_API_KEY when no route is configured). Saved keys are never displayed.',
|
|
150
|
+
hintZh: '粘贴当前搜索 API 的密钥(跟随当前 DeepSeek API 密钥路由的引用;没有该路由时为 DEEPSEEK_API_KEY),保存后不再显示原值。',
|
|
151
|
+
}),
|
|
152
|
+
ns: searchNs, owner: searchOwner, ref: searchRef,
|
|
153
|
+
});
|
|
154
|
+
// The Fetch API can pin its own key on rc.2; when it shares the Search ref,
|
|
155
|
+
// the one control above already writes it.
|
|
156
|
+
const fetchApi = splitApi && getPath(webValue, ['fetchProvider']) === 'deepseek-fetch-api';
|
|
157
|
+
const fetchRef = fetchApi ? apiKeyRef('fetch') : undefined;
|
|
158
|
+
const fetchKey = fetchRef === undefined || fetchRef === searchRef
|
|
159
|
+
? undefined
|
|
160
|
+
: secretField({
|
|
161
|
+
path: ['fetchApiKey'], label: 'Fetch API key', zh: '抓取 API 密钥',
|
|
162
|
+
hint: 'Paste the key for the Fetch endpoint (its fetchApiKeyEnv reference, or the active DeepSeek API-key route reference when it shares the Search key). Saved keys are never displayed.',
|
|
163
|
+
hintZh: '粘贴抓取端点所用密钥(fetchApiKeyEnv 引用;与搜索共用密钥时跟随当前路由引用),保存后不再显示原值。',
|
|
164
|
+
ns: apiNs, owner: apiOwner, ref: fetchRef,
|
|
165
|
+
});
|
|
50
166
|
const sections = [];
|
|
51
167
|
if (webNs !== undefined)
|
|
52
168
|
sections.push({
|
|
@@ -70,43 +186,75 @@ export function webSettingsSections(ctx, namespaces) {
|
|
|
70
186
|
{ value: 'http', label: 'HTTP' },
|
|
71
187
|
],
|
|
72
188
|
},
|
|
73
|
-
...(
|
|
74
|
-
|
|
75
|
-
const ns = searchApi ? apiNs : messagesNs ?? apiNs;
|
|
76
|
-
const owner = searchApi ? apiOwner : messagesOwner ?? apiOwner;
|
|
77
|
-
const ref = getPath(namespaces.find(view => view.ns === ns)?.value, ['apiKeyEnv']) ?? 'DEEPSEEK_API_KEY';
|
|
78
|
-
const store = ctx.get('credentials');
|
|
79
|
-
if (owner === undefined || store === undefined || typeof ref !== 'string' || !/^[A-Za-z_][A-Za-z0-9_]*$/u.test(ref))
|
|
80
|
-
return [];
|
|
81
|
-
const authorization = Object.freeze(new WebCredentialAuthorization());
|
|
82
|
-
const field = {
|
|
83
|
-
path: ['apiKey'], label: 'API key', descriptions: { zh: 'API 密钥' }, kind: 'text', secret: { ref, authorization },
|
|
84
|
-
hint: 'Paste a key for the selected search API. Saved keys are never displayed.',
|
|
85
|
-
hintDescriptions: { zh: '粘贴当前搜索 API 的密钥,保存后不再显示原值。' },
|
|
86
|
-
};
|
|
87
|
-
webCredentialFields.set(authorization, { store: concreteService(store), owner, ns, ref });
|
|
88
|
-
return [field];
|
|
89
|
-
})(),
|
|
189
|
+
...(searchKey === undefined ? [] : [searchKey]),
|
|
190
|
+
...(fetchKey === undefined ? [] : [fetchKey]),
|
|
90
191
|
],
|
|
91
192
|
});
|
|
193
|
+
const countField = {
|
|
194
|
+
path: ['count'], label: 'Search result count', descriptions: { zh: '搜索结果数' }, kind: 'number',
|
|
195
|
+
parse(text) {
|
|
196
|
+
if (text.trim() === '')
|
|
197
|
+
return { kind: 'clear' };
|
|
198
|
+
const value = Number(text);
|
|
199
|
+
return Number.isInteger(value) && value >= 1 && value <= 50 ? { kind: 'set', value } : undefined;
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
const sendOriginalQuestionField = {
|
|
203
|
+
path: ['sendOriginalQuestion'], label: 'Send original question', descriptions: { zh: '发送原始问题' }, kind: 'boolean',
|
|
204
|
+
hint: 'Send up to 128 characters of the latest user prompt with the search query.',
|
|
205
|
+
hintDescriptions: { zh: '搜索时附带最近一条用户提示,最多 128 个字符。' },
|
|
206
|
+
};
|
|
92
207
|
sections.push({
|
|
93
208
|
ns: apiNs, title: 'DeepSeek Search / Fetch API',
|
|
94
209
|
descriptions: { zh: 'DeepSeek 搜索 / 抓取 API' }, page: WEB_SETTINGS_PAGE,
|
|
95
|
-
fields:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
210
|
+
fields: splitApi
|
|
211
|
+
? [
|
|
212
|
+
countField,
|
|
213
|
+
sendOriginalQuestionField,
|
|
214
|
+
{
|
|
215
|
+
path: ['searchBaseURL'], label: 'Search API base URL', descriptions: { zh: '搜索 API 基础地址' }, kind: 'text',
|
|
216
|
+
hint: 'Optional Search endpoint including its path prefix; /search is appended. Pinning one takes Search off the conversation billing credential.',
|
|
217
|
+
hintDescriptions: { zh: '可选的搜索端点(含路径前缀,末尾自动追加 /search)。固定后搜索不再跟随会话的计费凭据。' },
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
path: ['searchApiKeyEnv'], label: 'Search API key reference', descriptions: { zh: '搜索 API 密钥引用' }, kind: 'text',
|
|
221
|
+
parse: credentialRefWrite,
|
|
222
|
+
hint: 'Credential reference the pinned Search endpoint uses; empty falls back to DEEPSEEK_API_KEY, or to the billing credential when no endpoint is pinned.',
|
|
223
|
+
hintDescriptions: { zh: '固定搜索端点使用的凭据引用;留空时回退 DEEPSEEK_API_KEY,未固定端点时改用计费凭据。' },
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
path: ['searchBilling'], label: 'Search billing', descriptions: { zh: '搜索计费凭据' }, kind: 'select',
|
|
227
|
+
options: BILLING_OPTIONS,
|
|
228
|
+
hint: 'Credential Search sends without its own endpoint/key. Auto follows the conversation.',
|
|
229
|
+
hintDescriptions: { zh: '搜索未固定自身端点/密钥时使用的凭据;自动跟随会话。' },
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
path: ['fetchBaseURL'], label: 'Fetch API base URL', descriptions: { zh: '抓取 API 基础地址' }, kind: 'text',
|
|
233
|
+
hint: 'Optional Fetch endpoint including its path prefix; /fetch is appended. Pinning one takes Fetch off the conversation billing credential.',
|
|
234
|
+
hintDescriptions: { zh: '可选的抓取端点(含路径前缀,末尾自动追加 /fetch)。固定后抓取不再跟随会话的计费凭据。' },
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
path: ['fetchApiKeyEnv'], label: 'Fetch API key reference', descriptions: { zh: '抓取 API 密钥引用' }, kind: 'text',
|
|
238
|
+
parse: credentialRefWrite,
|
|
239
|
+
hint: 'Credential reference the pinned Fetch endpoint uses; empty falls back to DEEPSEEK_API_KEY, or to the billing credential when no endpoint is pinned.',
|
|
240
|
+
hintDescriptions: { zh: '固定抓取端点使用的凭据引用;留空时回退 DEEPSEEK_API_KEY,未固定端点时改用计费凭据。' },
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
path: ['fetchBilling'], label: 'Fetch billing', descriptions: { zh: '抓取计费凭据' }, kind: 'select',
|
|
244
|
+
options: BILLING_OPTIONS,
|
|
245
|
+
hint: 'Credential Fetch sends without its own endpoint/key. Auto follows the conversation.',
|
|
246
|
+
hintDescriptions: { zh: '抓取未固定自身端点/密钥时使用的凭据;自动跟随会话。' },
|
|
247
|
+
},
|
|
248
|
+
]
|
|
249
|
+
: [
|
|
250
|
+
{
|
|
251
|
+
path: ['baseURL'], label: 'API base URL', descriptions: { zh: 'API 基础地址' }, kind: 'text',
|
|
252
|
+
hint: 'Include the path prefix, without /search or /fetch.',
|
|
253
|
+
hintDescriptions: { zh: '包含路径前缀,不含末尾的 /search 或 /fetch。' },
|
|
254
|
+
},
|
|
255
|
+
countField,
|
|
256
|
+
sendOriginalQuestionField,
|
|
257
|
+
],
|
|
110
258
|
});
|
|
111
259
|
if (messagesNs !== undefined)
|
|
112
260
|
sections.push({
|
|
@@ -173,7 +321,8 @@ export function createSettingsHosts(ctx, assertActive = () => undefined) {
|
|
|
173
321
|
const current = currentFields.flatMap(candidate => {
|
|
174
322
|
const binding = candidate.secret?.authorization === undefined ? undefined : webCredentialFields.get(candidate.secret.authorization);
|
|
175
323
|
return binding === undefined ? [] : [binding];
|
|
176
|
-
}).some(binding => binding.owner === authorized.owner && binding.ns === authorized.ns
|
|
324
|
+
}).some(binding => binding.owner === authorized.owner && binding.ns === authorized.ns
|
|
325
|
+
&& binding.ref === ref && binding.slot === authorized.slot);
|
|
177
326
|
if (!current || authorized.ref !== ref || authorized.store !== concreteService(store)) {
|
|
178
327
|
throw new Error(t('settings-web-key-changed'));
|
|
179
328
|
}
|
|
@@ -13,9 +13,15 @@ type ProjectionState = Pick<ChannelState, 'rows' | 'subagents' | 'subagentCost'
|
|
|
13
13
|
* cold resume and inbox admission, `interrupt` through its authority check.
|
|
14
14
|
*/
|
|
15
15
|
export interface SubagentsServiceView {
|
|
16
|
+
/** Exact live runtime owner; historical ancestry alone is not authority. */
|
|
17
|
+
rootOf?(agent: Agent): Agent;
|
|
16
18
|
interrupt?(target: string, reason: unknown): void;
|
|
17
19
|
/** Browser-authored prompt to a direct continuable child: resolves with
|
|
18
|
-
* the accepted message's inbox id.
|
|
20
|
+
* the accepted message's inbox id. The rc.2 host removed parentSessionId
|
|
21
|
+
* and mode from this request (the child's tree root is resolved from the
|
|
22
|
+
* Session); the extra fields are ignored there and still required by an
|
|
23
|
+
* older host, so they stay.
|
|
24
|
+
*/
|
|
19
25
|
prompt?(request: {
|
|
20
26
|
readonly requestId: string;
|
|
21
27
|
readonly parentSessionId: string;
|
|
@@ -30,8 +36,12 @@ export interface SubagentsServiceView {
|
|
|
30
36
|
readonly messageId: string;
|
|
31
37
|
}>;
|
|
32
38
|
/** Durable direct-child catalog read; no Agent is loaded, so the rows
|
|
33
|
-
* carry no liveness guarantee.
|
|
39
|
+
* carry no liveness guarantee. Removed in 0.2.2-rc.2 (use
|
|
40
|
+
* `listDescendants`); kept for older hosts. */
|
|
34
41
|
listChildren?(parentSessionId: string, signal?: AbortSignal): Promise<readonly SubagentCatalogEntryView[]>;
|
|
42
|
+
/** Recursive durable catalog walk, pre-order; the 0.2.2-rc.2 replacement
|
|
43
|
+
* for `listChildren` (direct children are the depth-1 rows). */
|
|
44
|
+
listDescendants?(rootSessionId: string, signal?: AbortSignal): Promise<readonly SubagentDescendantEntryView[]>;
|
|
35
45
|
}
|
|
36
46
|
/** One `listChildren` catalog row (SubagentCatalogEntry, structural). */
|
|
37
47
|
export interface SubagentCatalogEntryView {
|
|
@@ -39,7 +49,44 @@ export interface SubagentCatalogEntryView {
|
|
|
39
49
|
readonly createdAt: number;
|
|
40
50
|
readonly mode: 'one-shot' | 'continuable' | 'unknown';
|
|
41
51
|
readonly label?: string;
|
|
52
|
+
/** Sibling-unique path name from catalog payload v3 (`reviewer/checker`);
|
|
53
|
+
* absent on historical entries. */
|
|
54
|
+
readonly name?: string;
|
|
42
55
|
}
|
|
56
|
+
/** One `listDescendants` row (SubagentDescendantListEntry, structural). A
|
|
57
|
+
* diagnostic row reports an unreadable branch instead of a child. */
|
|
58
|
+
export interface SubagentDescendantEntryView {
|
|
59
|
+
readonly kind: 'child' | 'diagnostic';
|
|
60
|
+
readonly id: string;
|
|
61
|
+
readonly mode?: 'one-shot' | 'continuable' | 'external' | 'unknown';
|
|
62
|
+
readonly label?: string;
|
|
63
|
+
readonly name?: string;
|
|
64
|
+
readonly parentId?: string;
|
|
65
|
+
readonly depth?: number;
|
|
66
|
+
/** Slash-separated names from the requested root; absent when the child or
|
|
67
|
+
* an ancestor below the root has no name. */
|
|
68
|
+
readonly path?: string;
|
|
69
|
+
readonly activity?: 'running' | 'inactive';
|
|
70
|
+
}
|
|
71
|
+
/** One direct child of a parent session, normalized across the host service
|
|
72
|
+
* generations. 0.2.2-rc.2 removed the service's `listChildren` and kept the
|
|
73
|
+
* recursive `listDescendants`; that parent's direct children are its
|
|
74
|
+
* `parentId`-matching rows. */
|
|
75
|
+
export interface DirectChildView {
|
|
76
|
+
readonly id: string;
|
|
77
|
+
readonly mode: 'one-shot' | 'continuable' | 'external' | 'unknown';
|
|
78
|
+
readonly label?: string;
|
|
79
|
+
readonly name?: string;
|
|
80
|
+
/** Turn activity when the host states it (recursive rows only). */
|
|
81
|
+
readonly activity?: 'running' | 'inactive';
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Read one parent's direct children through whichever roster method the host
|
|
85
|
+
* service serves (shape probe, not version gate). Rejects when neither the
|
|
86
|
+
* legacy `listChildren` nor the rc.2 `listDescendants` exists, so a missing
|
|
87
|
+
* service is never mistaken for an empty roster.
|
|
88
|
+
*/
|
|
89
|
+
export declare function listDirectChildren(service: SubagentsServiceView | undefined, parentSessionId: string, signal?: AbortSignal): Promise<readonly DirectChildView[]>;
|
|
43
90
|
interface ProjectionDependencies {
|
|
44
91
|
rowIds: {
|
|
45
92
|
value: number;
|
|
@@ -95,13 +142,17 @@ export declare function createSubagentProjection(getState: () => ProjectionState
|
|
|
95
142
|
runId?: string;
|
|
96
143
|
provider: string;
|
|
97
144
|
local?: boolean;
|
|
98
|
-
}) => void>[0]
|
|
145
|
+
}) => void>[0] & {
|
|
146
|
+
parentSessionId?: string;
|
|
147
|
+
}, parent?: object | null): void;
|
|
99
148
|
onEnd(info: Parameters<(info: {
|
|
100
149
|
id: string;
|
|
101
150
|
runId?: string;
|
|
102
151
|
stopReason: string;
|
|
103
152
|
lastAssistantMessage?: unknown[];
|
|
104
|
-
}) => void>[0]
|
|
153
|
+
}) => void>[0] & {
|
|
154
|
+
parentSessionId?: string;
|
|
155
|
+
}, parent?: object | null): void;
|
|
105
156
|
onParentEvent: (event: unknown) => void;
|
|
106
157
|
bootstrapFromLog(events: readonly unknown[]): void;
|
|
107
158
|
syncNow: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-projection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/subagent-projection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAGzE,OAAO,EAAE,qBAAqB,EAAsB,MAAM,iBAAiB,CAAA;AAC3E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AC,CAAC,CAAC,GAAG;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,WAAW,MAAM,GAAG,IAAI;2BAC9E,OAAO;6BACL,SAAS,OAAO,EAAE;;;;kBAzFxB,KAAK,KAAG,IAAI;qBAIT,KAAK,KAAG,IAAI;kBA+FpB,KAAK;;;EAItB"}
|
|
@@ -17,6 +17,36 @@ function relayTextOf(source, content) {
|
|
|
17
17
|
* consuming a later delegation's title without retaining unbounded text.
|
|
18
18
|
*/
|
|
19
19
|
const MAX_PENDING_TASK_DESCRIPTIONS = 32;
|
|
20
|
+
/**
|
|
21
|
+
* Read one parent's direct children through whichever roster method the host
|
|
22
|
+
* service serves (shape probe, not version gate). Rejects when neither the
|
|
23
|
+
* legacy `listChildren` nor the rc.2 `listDescendants` exists, so a missing
|
|
24
|
+
* service is never mistaken for an empty roster.
|
|
25
|
+
*/
|
|
26
|
+
export async function listDirectChildren(service, parentSessionId, signal) {
|
|
27
|
+
if (service?.listChildren !== undefined) {
|
|
28
|
+
const rows = await service.listChildren(parentSessionId, signal);
|
|
29
|
+
return rows.map(row => ({
|
|
30
|
+
id: row.id,
|
|
31
|
+
mode: row.mode,
|
|
32
|
+
...(row.label === undefined ? {} : { label: row.label }),
|
|
33
|
+
...(row.name === undefined ? {} : { name: row.name }),
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
if (service?.listDescendants !== undefined) {
|
|
37
|
+
const rows = await service.listDescendants(parentSessionId, signal);
|
|
38
|
+
return rows.flatMap(row => row.kind !== 'child' || row.parentId !== parentSessionId
|
|
39
|
+
? []
|
|
40
|
+
: [{
|
|
41
|
+
id: row.id,
|
|
42
|
+
mode: row.mode ?? 'unknown',
|
|
43
|
+
...(row.label === undefined ? {} : { label: row.label }),
|
|
44
|
+
...((row.path ?? row.name) === undefined ? {} : { name: row.path ?? row.name }),
|
|
45
|
+
...(row.activity === undefined ? {} : { activity: row.activity }),
|
|
46
|
+
}]);
|
|
47
|
+
}
|
|
48
|
+
throw new Error('dsh-tui: the subagents continuation service is unavailable');
|
|
49
|
+
}
|
|
20
50
|
/**
|
|
21
51
|
* Keep each parked parent's reducer alive, including session links and the
|
|
22
52
|
* stream attempt/settlement cursor. A display snapshot cannot resume either
|
|
@@ -32,7 +62,31 @@ export function createSubagentProjection(getState, deps) {
|
|
|
32
62
|
let active = make();
|
|
33
63
|
let activeParent = deps.agent();
|
|
34
64
|
let restored = false;
|
|
35
|
-
const childProjection = (id, parent) => {
|
|
65
|
+
const childProjection = (id, parent, parentSessionId) => {
|
|
66
|
+
// rc.2 names the direct creator in the payload but dispatches on its
|
|
67
|
+
// exact live tree root. A durable id alone cannot authenticate a carrier
|
|
68
|
+
// from an older activation of that tree.
|
|
69
|
+
if (parentSessionId !== undefined) {
|
|
70
|
+
const service = deps.subagents();
|
|
71
|
+
const matches = (agent) => {
|
|
72
|
+
if (String(agent.session.id) !== parentSessionId || parent == null)
|
|
73
|
+
return false;
|
|
74
|
+
if (service?.rootOf === undefined)
|
|
75
|
+
return parent === agent;
|
|
76
|
+
try {
|
|
77
|
+
return service.rootOf(agent) === parent;
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
if (matches(activeParent))
|
|
84
|
+
return active;
|
|
85
|
+
for (const [agent, projection] of parked)
|
|
86
|
+
if (matches(agent))
|
|
87
|
+
return projection;
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
36
90
|
// A lifecycle carrier names the DIRECT delegating parent. Its visibility
|
|
37
91
|
// filter also admits ancestors, which is not evidence of ownership.
|
|
38
92
|
if (parent != null)
|
|
@@ -93,27 +147,32 @@ export function createSubagentProjection(getState, deps) {
|
|
|
93
147
|
};
|
|
94
148
|
/**
|
|
95
149
|
* The addressable roster: the parent's durable direct-child catalog,
|
|
96
|
-
* filtered to continuable children only. One-shot, unknown-mode
|
|
97
|
-
* diagnostic rows are not addressable (fail closed), and a missing
|
|
150
|
+
* filtered to continuable children only. One-shot, external, unknown-mode
|
|
151
|
+
* and diagnostic rows are not addressable (fail closed), and a missing
|
|
98
152
|
* continuation service rejects instead of answering an empty roster.
|
|
153
|
+
*
|
|
154
|
+
* The roster read is probed by shape, not version: 0.2.2-rc.2 removed the
|
|
155
|
+
* service's `listChildren` and kept only the recursive `listDescendants`
|
|
156
|
+
* (direct children = depth 1). Older hosts serve `listChildren` directly.
|
|
99
157
|
*/
|
|
100
158
|
const listTargets = async () => {
|
|
101
159
|
const service = deps.subagents();
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return entries
|
|
106
|
-
.filter(entry => entry.mode === 'continuable')
|
|
107
|
-
.map(entry => {
|
|
108
|
-
const status = active.store.get(entry.id)?.status;
|
|
160
|
+
const parentSessionId = String(deps.agent().session.id);
|
|
161
|
+
const identityOf = (id, info) => {
|
|
162
|
+
const status = active.store.get(id)?.status;
|
|
109
163
|
return {
|
|
110
|
-
agentId:
|
|
111
|
-
sessionId:
|
|
112
|
-
...(
|
|
164
|
+
agentId: id,
|
|
165
|
+
sessionId: id,
|
|
166
|
+
...(info.name === undefined ? {} : { name: info.name }),
|
|
167
|
+
...(info.label === undefined ? {} : { label: info.label }),
|
|
113
168
|
mode: 'continuable',
|
|
114
169
|
...(status === undefined ? {} : { status }),
|
|
115
170
|
};
|
|
116
|
-
}
|
|
171
|
+
};
|
|
172
|
+
const children = await listDirectChildren(service, parentSessionId);
|
|
173
|
+
return children
|
|
174
|
+
.filter(child => child.mode === 'continuable')
|
|
175
|
+
.map(child => identityOf(child.id, { name: child.name, label: child.label }));
|
|
117
176
|
};
|
|
118
177
|
return {
|
|
119
178
|
get store() { return active.store; },
|
|
@@ -156,8 +215,8 @@ export function createSubagentProjection(getState, deps) {
|
|
|
156
215
|
return true;
|
|
157
216
|
return active.onStreamFrame(agent, frame);
|
|
158
217
|
},
|
|
159
|
-
onStart(info, parent) { childProjection(info.id, parent)?.onStart(info); },
|
|
160
|
-
onEnd(info, parent) { childProjection(info.id, parent)?.onEnd(info); },
|
|
218
|
+
onStart(info, parent) { childProjection(info.id, parent, info.parentSessionId)?.onStart(info); },
|
|
219
|
+
onEnd(info, parent) { childProjection(info.id, parent, info.parentSessionId)?.onEnd(info); },
|
|
161
220
|
onParentEvent: (event) => active.onParentEvent(event),
|
|
162
221
|
bootstrapFromLog(events) {
|
|
163
222
|
// Live parked reducers already consumed this log. Re-folding historical
|
|
@@ -223,6 +282,7 @@ function createSessionSubagentProjection(getState, deps) {
|
|
|
223
282
|
}
|
|
224
283
|
const view = {
|
|
225
284
|
agentId: sub.agentId, runId: sub.runId, description: sub.description,
|
|
285
|
+
...(sub.name === undefined ? {} : { name: sub.name }),
|
|
226
286
|
...(sub.mode === undefined ? {} : { mode: sub.mode }),
|
|
227
287
|
provider: sub.provider, model: sub.model || 'default', effort: sub.effort,
|
|
228
288
|
status: sub.status, startedAt: sub.startedAt, completedAt: sub.completedAt,
|
|
@@ -380,6 +440,7 @@ function createSessionSubagentProjection(getState, deps) {
|
|
|
380
440
|
const running = child?.status === 'running';
|
|
381
441
|
store.onDiscovered(childId, {
|
|
382
442
|
label: info.label,
|
|
443
|
+
name: info.name,
|
|
383
444
|
childCreatedAt: info.childCreatedAt,
|
|
384
445
|
live: running,
|
|
385
446
|
provider: info.provider ?? child?.options?.provider,
|
|
@@ -448,8 +509,11 @@ function createSessionSubagentProjection(getState, deps) {
|
|
|
448
509
|
if (childId === undefined)
|
|
449
510
|
return;
|
|
450
511
|
const rawMode = typeof data.mode === 'string' ? data.mode : undefined;
|
|
512
|
+
const rawName = typeof data.name === 'string' && data.name !== '' ? data.name : undefined;
|
|
451
513
|
discover(childId, {
|
|
452
514
|
label: typeof data.label === 'string' ? data.label : undefined,
|
|
515
|
+
// v3 adds the sibling-unique (path) name; older payloads carry none.
|
|
516
|
+
name: rawName,
|
|
453
517
|
childCreatedAt: typeof data.childCreatedAt === 'number' ? data.childCreatedAt : eventTime(event),
|
|
454
518
|
// v0 rows carry no mode; v1 also retains 'unknown' children.
|
|
455
519
|
...(rawMode === 'one-shot' || rawMode === 'continuable' || rawMode === 'unknown' ? { mode: rawMode } : {}),
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
import { type SessionEvent } from '@deepseek-ai/dsh-session';
|
|
32
32
|
import type { SubagentTranscriptPage, SubagentTranscriptWindow } from '../../agent/capabilities.js';
|
|
33
33
|
import type { DshTranslator } from '../backend/translate.js';
|
|
34
|
-
import type
|
|
34
|
+
import { type SubagentsServiceView } from './subagent-projection.js';
|
|
35
35
|
/**
|
|
36
36
|
* One page window in source events. Claude pages by 400 SDK messages
|
|
37
37
|
* (`SUBAGENT_TRANSCRIPT_PAGE`) and the shared "load older" chunk is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-transcript.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/subagent-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAGnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"subagent-transcript.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/subagent-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAGnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAExF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WAAW,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;KAAE,CAAC,CAAA;IAC1I,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB;AAED,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACzC;AAED,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,OAAO,IAAI,sBAAsB,GAAG,SAAS,CAAA;IAC7C,yEAAyE;IACzE,SAAS,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAA;IACnD,6DAA6D;IAC7D,SAAS,IAAI,oBAAoB,GAAG,SAAS,CAAA;IAC7C,0EAA0E;IAC1E,WAAW,IAAI,sBAAsB,GAAG,SAAS,CAAA;IACjD,wEAAwE;IACxE,aAAa,IAAI,kBAAkB,GAAG,SAAS,CAAA;IAC/C,qEAAqE;IACrE,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAA;IACnE;;iCAE6B;IAC7B,gBAAgB,IAAI,aAAa,CAAA;IACjC,oEAAoE;IACpE,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CACnC;AAqDD;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CA6IxC"}
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
import { SESSION_FORMAT_VERSION } from '@deepseek-ai/dsh-session';
|
|
32
32
|
import { textOfBlocks } from '../../channel/projection.js';
|
|
33
33
|
import { toolErrorText } from './transcript.js';
|
|
34
|
+
import { listDirectChildren } from './subagent-projection.js';
|
|
34
35
|
/**
|
|
35
36
|
* One page window in source events. Claude pages by 400 SDK messages
|
|
36
37
|
* (`SUBAGENT_TRANSCRIPT_PAGE`) and the shared "load older" chunk is
|
|
@@ -113,15 +114,15 @@ export async function readChildTranscriptPage(deps, agentId, window) {
|
|
|
113
114
|
const signal = deps.ownerSignal;
|
|
114
115
|
signal?.throwIfAborted();
|
|
115
116
|
const service = deps.subagents();
|
|
116
|
-
if (service?.listChildren === undefined)
|
|
117
|
-
throw new Error('dsh-tui: the subagents continuation service is unavailable');
|
|
118
117
|
const persistence = deps.persistence();
|
|
119
118
|
if (persistence === undefined)
|
|
120
119
|
throw new Error('dsh-tui: session persistence is unavailable');
|
|
121
|
-
// 1. ownership: only a child this parent's own catalog names is opened
|
|
122
|
-
|
|
120
|
+
// 1. ownership: only a child this parent's own catalog names is opened
|
|
121
|
+
// (`listChildren` on an older host, `listDescendants` depth-1 rows on
|
|
122
|
+
// 0.2.2-rc.2 — see listDirectChildren).
|
|
123
|
+
const roster = await listDirectChildren(service, capture.sessionId, signal);
|
|
123
124
|
guard();
|
|
124
|
-
if (!
|
|
125
|
+
if (!roster.some(entry => String(entry.id) === agentId))
|
|
125
126
|
return null;
|
|
126
127
|
// 2. durability barrier for a still-live child (best effort; when it fails
|
|
127
128
|
// the read below sees whatever prefix is already persisted).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import stripAnsi from 'strip-ansi';
|
|
2
2
|
import { Lexer } from 'marked';
|
|
3
3
|
import { textOfBlocks } from '../../channel/projection.js';
|
|
4
|
-
import {
|
|
4
|
+
import { notificationText } from '../../ink/terminal-notification.js';
|
|
5
5
|
/** Notify once a successful live turn has settled with no automatic follow-up. */
|
|
6
6
|
export function createTaskCompletion(state, owner, notify) {
|
|
7
7
|
let generation = -1;
|
|
@@ -75,15 +75,7 @@ export function createTaskCompletion(state, owner, notify) {
|
|
|
75
75
|
}
|
|
76
76
|
/** Plain-text preview; notification daemons may interpret raw Markdown headings. */
|
|
77
77
|
function notificationPreview(text) {
|
|
78
|
-
|
|
79
|
-
const flat = plain.replace(/[\x00-\x1f\x7f-\x9f]/g, ' ').replace(/\s+/g, ' ').trim();
|
|
80
|
-
const graphemes = [];
|
|
81
|
-
for (const { segment } of getGraphemeSegmenter().segment(flat)) {
|
|
82
|
-
if (graphemes.length === 200)
|
|
83
|
-
return `${graphemes.slice(0, 199).join('')}…`;
|
|
84
|
-
graphemes.push(segment);
|
|
85
|
-
}
|
|
86
|
-
return graphemes.join('') || undefined;
|
|
78
|
+
return notificationText(markdownText(Lexer.lex(stripAnsi(text), { gfm: true }))) || undefined;
|
|
87
79
|
}
|
|
88
80
|
function isMarkdownToken(token, kind) {
|
|
89
81
|
return token.type === kind;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SessionEvent } from '@deepseek-ai/dsh-session';
|
|
2
2
|
import type { ChatRow, ToolResultView, ToolViewPresenter } from './types.js';
|
|
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 };
|
|
3
|
+
import { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, previewIndented, RESULT_PREVIEW_LIMIT, trimLocalRows } from '../../channel/transcript.js';
|
|
4
|
+
export { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, previewIndented, RESULT_PREVIEW_LIMIT, trimLocalRows };
|
|
5
5
|
/**
|
|
6
6
|
* Fold the oldest rows beyond the transcript window cap: drop each row's
|
|
7
7
|
* full-text fields (assistant/reasoning text, tool args/results) and keep
|
|
@@ -16,6 +16,7 @@ export declare function foldRows(rows: ChatRow[], cap: number, cursor?: {
|
|
|
16
16
|
rows: unknown;
|
|
17
17
|
index: number;
|
|
18
18
|
head?: unknown;
|
|
19
|
+
boundary?: unknown;
|
|
19
20
|
},
|
|
20
21
|
/** Rows the backend can restore (default: every foldable kind); any
|
|
21
22
|
* other row keeps its full text. */
|