@deepseek-harness-tui/dsh-tui 0.10.2 → 0.11.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 +171 -124
- package/bin/dsh-tui.js +748 -22
- package/cordis.patch.yml +38 -10
- package/cordis.yml +2 -0
- package/lib/types/adapter/channel/session-projection.d.ts.map +1 -1
- package/lib/types/adapter/channel/session-projection.js +2 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +4 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +5 -1
- package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -1
- package/lib/types/adapter/kernel/host-facade.js +1 -0
- package/lib/types/adapter/kernel/replay.d.ts.map +1 -1
- package/lib/types/adapter/kernel/replay.js +3 -0
- package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
- package/lib/types/adapter/kernel/runtime.js +2 -0
- package/lib/types/adapter/kernel/slices/workspace.d.ts.map +1 -1
- package/lib/types/adapter/kernel/slices/workspace.js +1 -0
- package/lib/types/adapter/ports/channel-ui.d.ts +22 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +66 -0
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-workspace.d.ts +23 -0
- package/lib/types/adapter/ports/channel-workspace.d.ts.map +1 -1
- package/lib/types/adapter/ports/workspace.d.ts +2 -0
- package/lib/types/adapter/ports/workspace.d.ts.map +1 -1
- package/lib/types/adapter/upstream/workspace-driver.d.ts.map +1 -1
- package/lib/types/adapter/upstream/workspace-driver.js +10 -2
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +1 -0
- package/lib/types/components/ContextBarView.d.ts +15 -7
- package/lib/types/components/ContextBarView.d.ts.map +1 -1
- package/lib/types/components/ContextBarView.js +26 -22
- package/lib/types/components/ImagePreviewOverlay.d.ts.map +1 -1
- package/lib/types/components/ImagePreviewOverlay.js +11 -5
- package/lib/types/components/Markdown.d.ts +11 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +20 -2
- package/lib/types/components/MermaidDiagram.d.ts +13 -0
- package/lib/types/components/MermaidDiagram.d.ts.map +1 -0
- package/lib/types/components/MermaidDiagram.js +61 -0
- package/lib/types/components/MessageList.d.ts +26 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +72 -7
- package/lib/types/components/PageMargin.d.ts +1 -1
- package/lib/types/components/PromptInput.d.ts +37 -1
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +243 -28
- package/lib/types/components/ScrollbarGutter.d.ts +20 -5
- package/lib/types/components/ScrollbarGutter.d.ts.map +1 -1
- package/lib/types/components/ScrollbarGutter.js +88 -10
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +30 -28
- package/lib/types/components/Tooltip.d.ts.map +1 -1
- package/lib/types/components/Tooltip.js +45 -7
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
- package/lib/types/components/messages/UserPromptMessage.js +5 -7
- package/lib/types/components/messages/useImageInspection.d.ts.map +1 -1
- package/lib/types/components/messages/useImageInspection.js +19 -9
- package/lib/types/components/promptDraftCache.d.ts +102 -0
- package/lib/types/components/promptDraftCache.d.ts.map +1 -0
- package/lib/types/components/promptDraftCache.js +76 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +17 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +40 -7
- package/lib/types/components/questions/QuestionMinimizedBar.d.ts +12 -0
- package/lib/types/components/questions/QuestionMinimizedBar.d.ts.map +1 -0
- package/lib/types/components/questions/QuestionMinimizedBar.js +43 -0
- package/lib/types/components/sessions/SessionListRow.d.ts +23 -1
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +52 -5
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +49 -0
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -0
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +50 -0
- package/lib/types/dsh-adapter/bundled-presets.d.ts +10 -0
- package/lib/types/dsh-adapter/bundled-presets.d.ts.map +1 -0
- package/lib/types/dsh-adapter/bundled-presets.js +80 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.js +3 -0
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +19 -2
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +52 -29
- package/lib/types/dsh-adapter/channel/binding.d.ts +19 -2
- package/lib/types/dsh-adapter/channel/binding.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding.js +78 -18
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +5 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +105 -6
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +8 -0
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +3 -2
- package/lib/types/dsh-adapter/channel/ide-selection.d.ts +58 -0
- package/lib/types/dsh-adapter/channel/ide-selection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/ide-selection.js +226 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +6 -1
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +9 -1
- package/lib/types/dsh-adapter/channel/local-actions.d.ts +3 -19
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +2 -1
- 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 +82 -6
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +49 -31
- package/lib/types/dsh-adapter/channel/projection.d.ts +4 -0
- package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection.js +29 -19
- package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/reports.js +4 -12
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +26 -2
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +1 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +10 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +2 -2
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +11 -2
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +291 -94
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +34 -16
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +19 -3
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +4 -3
- package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +1 -1
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +6 -12
- package/lib/types/dsh-adapter/channel/types.d.ts +6 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.js +41 -1
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +67 -6
- package/lib/types/dsh-adapter/compat/messages.d.ts +15 -0
- package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/messages.js +15 -0
- package/lib/types/dsh-adapter/compat/settings.d.ts +33 -0
- package/lib/types/dsh-adapter/compat/settings.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/settings.js +43 -0
- package/lib/types/dsh-adapter/compat/shell.d.ts +25 -0
- package/lib/types/dsh-adapter/compat/shell.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/shell.js +11 -0
- package/lib/types/dsh-adapter/contract.d.ts +4 -4
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +15 -6
- package/lib/types/dsh-adapter/ide-channel.d.ts +224 -0
- package/lib/types/dsh-adapter/ide-channel.d.ts.map +1 -0
- package/lib/types/dsh-adapter/ide-channel.js +556 -0
- package/lib/types/dsh-adapter/index.d.ts +18 -3
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +32 -5
- package/lib/types/dsh-adapter/plugin.d.ts +5 -2
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +173 -42
- package/lib/types/dsh-adapter/preset-resolution.d.ts +8 -0
- package/lib/types/dsh-adapter/preset-resolution.d.ts.map +1 -1
- package/lib/types/dsh-adapter/preset-resolution.js +10 -0
- package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts +53 -0
- package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-mount-heartbeat.js +100 -0
- package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessionTree.js +3 -2
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +6 -5
- package/lib/types/dsh-adapter/workspaces.d.ts +46 -3
- package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -1
- package/lib/types/dsh-adapter/workspaces.js +116 -0
- package/lib/types/effortPrefs.d.ts +15 -3
- package/lib/types/effortPrefs.d.ts.map +1 -1
- package/lib/types/effortPrefs.js +37 -3
- package/lib/types/homePrefs.d.ts +15 -0
- package/lib/types/homePrefs.d.ts.map +1 -0
- package/lib/types/homePrefs.js +53 -0
- package/lib/types/i18n.d.ts +257 -296
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +78 -84
- package/lib/types/ink/colorize.d.ts +10 -0
- package/lib/types/ink/colorize.d.ts.map +1 -1
- package/lib/types/ink/colorize.js +21 -0
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +12 -1
- package/lib/types/ink/dom.d.ts +1 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-copy-on-select.d.ts +5 -1
- package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-copy-on-select.js +15 -1
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +36 -1
- package/lib/types/ink/output.d.ts +10 -1
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +109 -17
- package/lib/types/ink/render-border.d.ts +6 -1
- package/lib/types/ink/render-border.d.ts.map +1 -1
- package/lib/types/ink/render-border.js +25 -9
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +48 -6
- package/lib/types/ink/renderer.d.ts +6 -0
- package/lib/types/ink/renderer.d.ts.map +1 -1
- package/lib/types/ink/renderer.js +2 -1
- package/lib/types/ink/selection.d.ts +60 -0
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +129 -0
- package/lib/types/ink/sixel-graphics.d.ts +19 -1
- package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
- package/lib/types/ink/sixel-graphics.js +124 -12
- package/lib/types/ink/terminal-image.d.ts +18 -1
- package/lib/types/ink/terminal-image.d.ts.map +1 -1
- package/lib/types/ink/terminal.d.ts +17 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +20 -1
- package/lib/types/screens/Chat.d.ts +17 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +284 -72
- package/lib/types/screens/SessionSupervisor.d.ts +84 -0
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -0
- package/lib/types/screens/SessionSupervisor.js +350 -0
- package/lib/types/screens/SessionTree.js +2 -2
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +32 -9
- package/lib/types/screens/StatusLine.d.ts +13 -0
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +36 -17
- package/lib/types/screens/StatusMetrics.d.ts +79 -22
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +153 -88
- package/lib/types/screens/sessionSupervisor/model.d.ts +83 -0
- package/lib/types/screens/sessionSupervisor/model.d.ts.map +1 -0
- package/lib/types/screens/sessionSupervisor/model.js +69 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +120 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +593 -0
- package/lib/types/sessionMounts.d.ts +272 -0
- package/lib/types/sessionMounts.d.ts.map +1 -0
- package/lib/types/sessionMounts.js +706 -0
- package/lib/types/sessions/format.d.ts.map +1 -1
- package/lib/types/sessions/format.js +4 -1
- package/lib/types/sessions/resumeFailure.d.ts +38 -0
- package/lib/types/sessions/resumeFailure.d.ts.map +1 -0
- package/lib/types/sessions/resumeFailure.js +58 -0
- package/lib/types/terminal-utils/mermaid.d.ts +44 -0
- package/lib/types/terminal-utils/mermaid.d.ts.map +1 -0
- package/lib/types/terminal-utils/mermaid.js +83 -0
- package/lib/types/tips.d.ts.map +1 -1
- package/lib/types/tips.js +175 -19
- package/lib/types/tuiDisplayPrefs.d.ts +7 -9
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +31 -28
- package/lib/types/update.d.ts +61 -0
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +194 -0
- package/lib/types/utils/imageResize.d.ts +90 -0
- package/lib/types/utils/imageResize.d.ts.map +1 -0
- package/lib/types/utils/imageResize.js +272 -0
- package/lib/types/utils/keymap.d.ts +5 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +23 -0
- package/lib/types/workspaces.d.ts +2 -1
- package/lib/types/workspaces.d.ts.map +1 -1
- package/lib/types/workspaces.js +1 -1
- package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +10 -10
- package/package.json +120 -103
- package/presets/liangshen/.dsh-tui-managed.json +1 -1
- package/presets/liangshen/agent.cordis.yml +15 -0
- package/lib/types/screens/AgentView.d.ts +0 -23
- package/lib/types/screens/AgentView.d.ts.map +0 -1
- package/lib/types/screens/AgentView.js +0 -546
- package/lib/types/screens/SessionBrowser.d.ts +0 -42
- package/lib/types/screens/SessionBrowser.d.ts.map +0 -1
- package/lib/types/screens/SessionBrowser.js +0 -911
|
@@ -6,6 +6,7 @@ import { readPersistedSession } from '../compat/persistence.js';
|
|
|
6
6
|
import { closeLiveForkTurn } from '../compat/liveSession.js';
|
|
7
7
|
import { composePreset, resolvePersistedPreset, runningPresetOf } from '../presets.js';
|
|
8
8
|
import { attachSessionToWorkspace } from '../workspace.js';
|
|
9
|
+
import { reserveNewSession } from '../../sessionMounts.js';
|
|
9
10
|
import { forkTarget, rewindTarget, turnUserText } from '../sessionTree.js';
|
|
10
11
|
async function waitForTurnEnd(session, fromSeq, timeoutMs) {
|
|
11
12
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -85,6 +86,9 @@ export function createTreeRewindAction(ctx, state, deps) {
|
|
|
85
86
|
if (target.closeTurn !== undefined && !closeAfterCreate) {
|
|
86
87
|
appendInterruptedTurnEnd(seed, target.closeTurn);
|
|
87
88
|
}
|
|
89
|
+
// Announce the id before the factory: the child's log is created here, and
|
|
90
|
+
// the publisher only learns the id from the registry on its next beat.
|
|
91
|
+
const { reservation } = await reserveNewSession(String(childId));
|
|
88
92
|
let handle;
|
|
89
93
|
try {
|
|
90
94
|
handle = await deps.binding.prepare(adoption, () => agents.create(liveSessionCreateOptions({
|
|
@@ -112,11 +116,13 @@ export function createTreeRewindAction(ctx, state, deps) {
|
|
|
112
116
|
})));
|
|
113
117
|
}
|
|
114
118
|
catch {
|
|
119
|
+
reservation.abandon();
|
|
115
120
|
deps.notify(t('rewind-create-failed'), { color: 'error' });
|
|
116
121
|
return null;
|
|
117
122
|
}
|
|
118
123
|
if (!deps.binding.isCurrent(adoption)) {
|
|
119
124
|
await deps.binding.abandon(handle);
|
|
125
|
+
reservation.abandon();
|
|
120
126
|
return null;
|
|
121
127
|
}
|
|
122
128
|
try {
|
|
@@ -127,12 +133,22 @@ export function createTreeRewindAction(ctx, state, deps) {
|
|
|
127
133
|
}
|
|
128
134
|
if (!deps.owner.current() || deps.binding.agent.session !== entrySession) {
|
|
129
135
|
await deps.binding.abandon(handle);
|
|
136
|
+
reservation.abandon();
|
|
130
137
|
deps.notify(t('rewind-session-changed'), { color: 'error' });
|
|
131
138
|
return null;
|
|
132
139
|
}
|
|
133
140
|
const replay = closeAfterCreate || mode === 'rewind' ? snapshotLiveSessionEvents(handle.agent.session) : seed;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
141
|
+
// `adoptForkedAgent` is the commit, and it THROWS when the adoption
|
|
142
|
+
// transaction revokes the candidate.
|
|
143
|
+
try {
|
|
144
|
+
const sourceSessionId = deps.adoptForkedAgent(handle, adoption, replay, composed.agentPreset, childId);
|
|
145
|
+
reservation.settle();
|
|
146
|
+
deps.notifySessionSwitched(mode === 'fork' ? 'fork' : 'rewind', String(childId), sourceSessionId);
|
|
147
|
+
return restoredText;
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
reservation.abandon();
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
137
153
|
};
|
|
138
154
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-host.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/settings-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"settings-host.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/settings-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAMvD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,GAAE,MAAM,IAAsB,GAAG,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,eAAe,GAAG,uBAAuB,CAAC,CAqT5K"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t } from '../../i18n.js';
|
|
2
2
|
import { isReservedCredentialRef } from '../credentialRefGuard.js';
|
|
3
|
+
import { settingsValue } from '../compat/settings.js';
|
|
3
4
|
export function createSettingsHosts(ctx, assertActive = () => undefined) {
|
|
4
5
|
let settingsHostResolved = false;
|
|
5
6
|
let settingsHostCache;
|
|
@@ -96,14 +97,14 @@ export function createSettingsHosts(ctx, assertActive = () => undefined) {
|
|
|
96
97
|
.map(entry => ({ provider: entry.provider, displayName: entry.displayName }));
|
|
97
98
|
},
|
|
98
99
|
routeExists(route) {
|
|
99
|
-
const section = settings
|
|
100
|
+
const section = settingsValue(settings, 'llm-pi-ai');
|
|
100
101
|
return section?.providers !== undefined && route in section.providers;
|
|
101
102
|
},
|
|
102
103
|
listRefUsers(ref, exceptRoute) {
|
|
103
104
|
// The RESOLVED merge (settings.get), not the user layer: a base
|
|
104
105
|
// provider or composition-base route naming this ref is invisible
|
|
105
106
|
// to listConfiguredProviders() but still consumes the credential.
|
|
106
|
-
const section = settings
|
|
107
|
+
const section = settingsValue(settings, 'llm-pi-ai');
|
|
107
108
|
const providers = section?.providers;
|
|
108
109
|
if (providers === undefined || typeof providers !== 'object' || providers === null)
|
|
109
110
|
return [];
|
|
@@ -131,7 +132,7 @@ export function createSettingsHosts(ctx, assertActive = () => undefined) {
|
|
|
131
132
|
// user layer legitimately exposes nothing to edit.
|
|
132
133
|
const section = (descriptor?.user !== undefined
|
|
133
134
|
? descriptor.user
|
|
134
|
-
: settings
|
|
135
|
+
: settingsValue(settings, 'llm-pi-ai'));
|
|
135
136
|
const providers = section?.providers;
|
|
136
137
|
if (providers === undefined || typeof providers !== 'object' || providers === null)
|
|
137
138
|
return [];
|
|
@@ -42,5 +42,5 @@ export declare function createInitialChannelView(options: ChannelLaunchOptions,
|
|
|
42
42
|
agentId: string;
|
|
43
43
|
mode: ChannelState['mode'];
|
|
44
44
|
cwdDescription: string;
|
|
45
|
-
}): Pick<ChannelState, 'effortLevels' | 'version' | 'rows' | 'status' | 'sessionTitle' | 'sessionColor' | 'agentId' | 'agentBindingGeneration' | 'model' | 'provider' | 'tokens' | 'cwd' | 'displayCwd' | 'gitBranch' | 'working' | 'cancelPending' | 'spinnerMode' | 'responseChars' | 'activeToolCount' | 'turnStart' | 'lastUserText' | 'notifications' | 'contextWindow' | 'reasoningEffort' | 'mode' | 'modeIndex' | 'workingActivity' | 'activityFrames' | 'configuredProvider' | 'configuredModel' | 'configuredPreset' | 'configuredActivityFrames' | 'configuredLang' | 'diffLayout' | 'thinkingFold' | 'toolBackground' | 'scrollGutter' | 'pageMargin' | 'foldTerminalCommand' | 'promptSessionLabel' | 'expandEditor' | 'smoothStreaming' | 'statusBar' | 'whale' | 'whaleIdle' | 'minimal' | 'activityEnabled' | 'contextBarEnabled' | 'agentPreset' | 'goal' | 'todos' | 'loadedContext' | 'pending' | 'commandList' | 'lastUsage' | 'tps' | 'tpsSamples' | 'contextSegments' | 'subagents' | 'backgroundJobs'>;
|
|
45
|
+
}): Pick<ChannelState, 'effortLevels' | 'version' | 'rows' | 'status' | 'sessionTitle' | 'sessionColor' | 'agentId' | 'agentBindingGeneration' | 'model' | 'provider' | 'tokens' | 'cwd' | 'displayCwd' | 'gitBranch' | 'working' | 'cancelPending' | 'spinnerMode' | 'responseChars' | 'activeToolCount' | 'turnStart' | 'lastUserText' | 'notifications' | 'contextWindow' | 'reasoningEffort' | 'mode' | 'modeIndex' | 'workingActivity' | 'activityFrames' | 'configuredProvider' | 'configuredModel' | 'configuredPreset' | 'configuredActivityFrames' | 'configuredLang' | 'diffLayout' | 'thinkingFold' | 'toolBackground' | 'scrollGutter' | 'pageMargin' | 'foldTerminalCommand' | 'promptSessionLabel' | 'expandEditor' | 'smoothStreaming' | 'statusBar' | 'whale' | 'whaleIdle' | 'minimal' | 'activityEnabled' | 'contextBarEnabled' | 'agentPreset' | 'goal' | 'todos' | 'loadedContext' | 'pending' | 'commandList' | 'lastUsage' | 'tps' | 'tpsSamples' | 'contextSegments' | 'subagents' | 'backgroundJobs' | 'selection'>;
|
|
46
46
|
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAA2F,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE5N,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,sFAAsF;AACtF,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IACzC,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACjC,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,YAAY,CAAC,EAAE,gBAAgB,CAAA;IAC/B,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IACpC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,S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AG,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,iBAAiB,GAAG,mBAAmB,GACzF,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,GAAG,SAAS,GAAG,aAAa,GAC9E,WAAW,GAAG,KAAK,GAAG,YAAY,GAAG,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,GAAG,WAAW,CACtG,CAuBA"}
|
|
@@ -7,7 +7,7 @@ import { normalizeActivityPreset } from '../../components/activityFrames.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export function createInitialChannelView(options, input) {
|
|
9
9
|
return {
|
|
10
|
-
effortLevels: undefined, version: 0, rows: [], status: 'starting', sessionTitle: '', sessionColor: '',
|
|
10
|
+
effortLevels: undefined, version: 0, rows: [], selection: undefined, status: 'starting', sessionTitle: '', sessionColor: '',
|
|
11
11
|
agentId: input.agentId, agentBindingGeneration: 0, model: options.model, provider: options.provider,
|
|
12
12
|
tokens: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, peak: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, idle: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 } },
|
|
13
13
|
cwd: options.cwd, displayCwd: input.cwdDescription, gitBranch: undefined, working: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAG5E,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC,eAAO,MAAM,oBAAoB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;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,EAAE,CA2BnF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { toolResultPayload } from '../compat/messages.js';
|
|
1
2
|
import { markChannelReadDirty } from '../../adapter/channel/read-view.js';
|
|
2
3
|
export const ARGS_PREVIEW_LIMIT = 160;
|
|
3
4
|
export const RESULT_PREVIEW_LIMIT = 240;
|
|
@@ -110,7 +111,7 @@ export function foldBack(rows, events, views) {
|
|
|
110
111
|
if (result !== undefined)
|
|
111
112
|
restoreToolResult(row, result);
|
|
112
113
|
row.tool.callView = views?.call(call.data.name, call.data.arguments);
|
|
113
|
-
row.tool.resultView = result !== undefined &&
|
|
114
|
+
row.tool.resultView = result !== undefined && row.tool.status === 'ok'
|
|
114
115
|
? views?.result(call.data.name, call.data.arguments, result.data)
|
|
115
116
|
: undefined;
|
|
116
117
|
row.folded = false;
|
|
@@ -174,10 +175,7 @@ export function restoreRowFromEvent(row, event) {
|
|
|
174
175
|
}
|
|
175
176
|
/** Render the durable tool-result payload, including provider error details. */
|
|
176
177
|
export function toolResultText(event) {
|
|
177
|
-
|
|
178
|
-
if (block === undefined || block.type !== 'tool-result')
|
|
179
|
-
return '';
|
|
180
|
-
return block.content.map(item => item.type === 'text' ? item.text : '').join('').trim();
|
|
178
|
+
return toolResultPayload(event.data.message).content.map(item => item.type === 'text' ? item.text : '').join('').trim();
|
|
181
179
|
}
|
|
182
180
|
/** Phase badge for the harness goal card — mirrors the panel's PhaseBadge. */
|
|
183
181
|
export const GOAL_RESULT_BADGE = {
|
|
@@ -199,10 +197,7 @@ export function harnessToolResultView(name, data) {
|
|
|
199
197
|
const isTodoTool = lower.includes('todo');
|
|
200
198
|
if (!isGoalTool && !isTodoTool)
|
|
201
199
|
return undefined;
|
|
202
|
-
const
|
|
203
|
-
if (block === undefined || block.type !== 'tool-result')
|
|
204
|
-
return undefined;
|
|
205
|
-
const text = block.content.map(item => item.type === 'text' ? item.text : '').join('').trim();
|
|
200
|
+
const text = toolResultPayload(data.message).content.map(item => item.type === 'text' ? item.text : '').join('').trim();
|
|
206
201
|
if (text === '' || !text.startsWith('{'))
|
|
207
202
|
return undefined;
|
|
208
203
|
let parsed;
|
|
@@ -248,7 +243,7 @@ export function harnessToolResultView(name, data) {
|
|
|
248
243
|
export function toolErrorText(event) {
|
|
249
244
|
const failure = event.data.error;
|
|
250
245
|
if (failure === undefined)
|
|
251
|
-
return '';
|
|
246
|
+
return toolResultPayload(event.data.message).isError ? toolResultText(event) : '';
|
|
252
247
|
const identity = `${failure.name}: ${failure.code}`;
|
|
253
248
|
const detail = toolResultText(event);
|
|
254
249
|
return detail === '' || detail === identity ? identity : `${identity} — ${detail}`;
|
|
@@ -257,8 +252,7 @@ export function toolErrorText(event) {
|
|
|
257
252
|
export function restoreToolResult(row, event) {
|
|
258
253
|
if (row.tool === undefined)
|
|
259
254
|
return;
|
|
260
|
-
|
|
261
|
-
if (failure !== undefined) {
|
|
255
|
+
if (event.data.error !== undefined || toolResultPayload(event.data.message).isError) {
|
|
262
256
|
row.tool.status = 'error';
|
|
263
257
|
row.tool.errorText = toolErrorText(event);
|
|
264
258
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChannelUi } from '../../adapter/ports/channel-ui.js';
|
|
2
2
|
import type { ChatRow, ToolCallView, ToolResultView, NotificationItem, TodoPanelItem, PendingMessage } from '../../adapter/ports/channel-view.js';
|
|
3
|
-
export type { ChatRow, ToolRow, ToolCallView, ToolFileDiff, ToolResultView, SubagentRow, JobRow, TokenUsage, TokenBucket, NotificationItem, ActivityStatus, ChannelGoal, TodoPanelItem, LoadedContext, LoadedContextEntry, LoadedContextFile, LoadedContextSkill, LoadedContextTool, PendingMessage, SubagentControl, JobControl, StagedImageInput, StagedImageHandle, ComposerImageRef, ComposerSubmission, ExternalCommandOutcome, TranscriptImage, ResumeResult, EffortOption, PermissionPresetSnapshot, PermissionPresetAvailability, PermissionPresetOption, PermissionPresetCurrent, PresetOption, SkillInfo, CredentialStatus, AgentViewRow, AgentViewStatus, AgentViewDispatchResult, BackgroundResult } from '../../adapter/ports/channel-view.js';
|
|
3
|
+
export type { ChatRow, ToolRow, ToolCallView, ToolFileDiff, ToolResultView, SubagentRow, JobRow, TokenUsage, TokenBucket, NotificationItem, ActivityStatus, ChannelGoal, TodoPanelItem, LoadedContext, LoadedContextEntry, LoadedContextFile, LoadedContextSkill, LoadedContextTool, PendingMessage, SubagentControl, JobControl, StagedImageInput, StagedImageAdjustment, StagedImageHandle, ComposerImageRef, ComposerSubmission, ExternalCommandOutcome, TranscriptImage, ResumeResult, EffortOption, PermissionPresetSnapshot, PermissionPresetAvailability, PermissionPresetOption, PermissionPresetCurrent, PresetOption, SkillInfo, CredentialStatus, AgentViewRow, AgentViewStatus, AgentViewDispatchResult, BackgroundResult } from '../../adapter/ports/channel-view.js';
|
|
4
4
|
import { type ContentBlock, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
5
5
|
import { type SessionEvent } from '@deepseek-ai/dsh-session';
|
|
6
6
|
import { type BackgroundJobState } from '../jobs.js';
|
|
@@ -134,6 +134,11 @@ export interface MentionAttachments {
|
|
|
134
134
|
readonly maxImageBytes: number;
|
|
135
135
|
readonly maxImagesPerMessage: number;
|
|
136
136
|
readonly maxMessageImageBytes: number;
|
|
137
|
+
/** Per-side intrinsic pixel cap (mirrored from the upstream store's
|
|
138
|
+
* ImageAttachmentLimits — used by the composer's ingress resample). */
|
|
139
|
+
readonly maxImageDimension: number;
|
|
140
|
+
/** Total-pixel cap ditto. */
|
|
141
|
+
readonly maxImagePixels: number;
|
|
137
142
|
readonly mediaTypes: readonly MentionImageMediaType[];
|
|
138
143
|
};
|
|
139
144
|
saveImage(input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/types.ts"],"names":[],"mappings":"AAA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,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TuiWorkspaceHost, TuiWorkspaceTarget } from '../workspaces.js';
|
|
1
|
+
import type { TuiWorkspaceEntry, TuiWorkspaceHost, TuiWorkspaceTarget } from '../workspaces.js';
|
|
2
2
|
import type { ChannelOwner } from './owner.js';
|
|
3
3
|
import type { NewSessionTarget } from './session-resume.js';
|
|
4
4
|
import type { ChannelState } from './types.js';
|
|
@@ -11,6 +11,9 @@ export declare function createWorkspaceActions(state: Pick<ChannelState, 'cwd' |
|
|
|
11
11
|
notify: ChannelState['notify'];
|
|
12
12
|
}): {
|
|
13
13
|
listWorkspaces: () => Promise<readonly TuiWorkspaceTarget[]>;
|
|
14
|
+
listWorkspaceRegistry: () => Promise<readonly TuiWorkspaceEntry[]>;
|
|
15
|
+
removeWorkspace: (path: string) => Promise<boolean>;
|
|
16
|
+
renameWorkspaceAt: (path: string, title: string) => Promise<boolean>;
|
|
14
17
|
resolveWorkspace: (uri: string) => Promise<TuiWorkspaceTarget | undefined>;
|
|
15
18
|
switchWorkspace: (target: TuiWorkspaceTarget) => Promise<boolean>;
|
|
16
19
|
renameWorkspace: (title: string) => Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/workspace-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"workspace-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/workspace-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,4GAA4G;AAC5G,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC,EACpE,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAA;IACzC,OAAO,EAAE,gBAAgB,CAAA;IACzB,UAAU,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACvD,gBAAgB,IAAI,IAAI,CAAA;IACxB,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;CAC/B;;iCAciC,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC;4BAElC,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;8BAgBvB,MAAM,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;4BA5BhD,MAAM;8BAuCE,kBAAkB,KAAG,OAAO,CAAC,OAAO,CAAC;6BAsBtC,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;;gCAakJ,MAAM,SAAS,MAAM;EACvO"}
|
|
@@ -5,6 +5,46 @@ export function createWorkspaceActions(state, deps) {
|
|
|
5
5
|
const { service, notify } = deps;
|
|
6
6
|
const listWorkspaces = () => service.list(state.cwd);
|
|
7
7
|
const resolveWorkspace = (uri) => service.resolve(uri, state.cwd);
|
|
8
|
+
/**
|
|
9
|
+
* The workspace home screen's sidebar: the durable ledger's own listing.
|
|
10
|
+
*
|
|
11
|
+
* `listWorkspaces()` cannot serve this — it merges provider targets, drops
|
|
12
|
+
* entries with no sessions, and appends the live cwd, so a registered-but-
|
|
13
|
+
* empty workspace would not be listed at all. This reads the registry
|
|
14
|
+
* directly and only adds what the ledger does not know: whether the
|
|
15
|
+
* directory still exists.
|
|
16
|
+
*/
|
|
17
|
+
const listWorkspaceRegistry = () => service.listRegistry();
|
|
18
|
+
/** Forget a registration. Sessions are untouched; removing the live workspace is refused. */
|
|
19
|
+
const removeWorkspace = async (path) => {
|
|
20
|
+
deps.owner.assertActive();
|
|
21
|
+
try {
|
|
22
|
+
const removed = await service.remove(path);
|
|
23
|
+
if (!removed) {
|
|
24
|
+
notify(t('workspace-remove-unknown', { target: path }), { color: 'warning', timeoutMs: 8000 });
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
notify(t('workspace-removed', { target: path }));
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
notify(t('workspace-remove-failed', { err: error instanceof Error ? error.message : String(error) }), { color: 'error', timeoutMs: 8000 });
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/** Rename the workspace at `path` (not necessarily the live one). */
|
|
36
|
+
const renameWorkspaceAt = async (path, title) => {
|
|
37
|
+
deps.owner.assertActive();
|
|
38
|
+
try {
|
|
39
|
+
const renamed = await service.rename(path, title);
|
|
40
|
+
notify(t('workspace-renamed', { title: renamed.label }));
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
notify(t('workspace-rename-failed', { err: error instanceof Error ? error.message : String(error) }), { color: 'error', timeoutMs: 8000 });
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
8
48
|
const switchWorkspace = async (target) => {
|
|
9
49
|
deps.owner.assertActive();
|
|
10
50
|
if (state.working) {
|
|
@@ -52,5 +92,5 @@ export function createWorkspaceActions(state, deps) {
|
|
|
52
92
|
return false;
|
|
53
93
|
}
|
|
54
94
|
};
|
|
55
|
-
return { listWorkspaces, resolveWorkspace, switchWorkspace, renameWorkspace, workspaceCommands: () => service.commands(), runWorkspaceCommand: (name, input) => service.runCommand(name, input, state.cwd) };
|
|
95
|
+
return { listWorkspaces, listWorkspaceRegistry, removeWorkspace, renameWorkspaceAt, resolveWorkspace, switchWorkspace, renameWorkspace, workspaceCommands: () => service.commands(), runWorkspaceCommand: (name, input) => service.runCommand(name, input, state.cwd) };
|
|
56
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/channel.ts"],"names":[],"mappings":"AAUA,OAAO,EAA4B,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/channel.ts"],"names":[],"mappings":"AAUA,OAAO,EAA4B,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AA4BxF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,KAAK,KAAK,EAAqE,MAAM,wBAAwB,CAAA;AAyCtH,OAAO,KAAK,EAAyE,YAAY,EAA8T,MAAM,oBAAoB,CAAA;AAgCzb,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAkBnD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,OAAO,EACZ,YAAY,EAAE,KAAK,EACnB,OAAO,EAAE,oBAAoB,GAC5B,YAAY,CAUd;AA26BD,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACryB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -32,6 +32,8 @@ import { createSkillCatalog } from './channel/skill-catalog.js';
|
|
|
32
32
|
import { createBackgroundCurrentAction } from './channel/background-action.js';
|
|
33
33
|
import { createSubagentProjection } from './channel/subagent-projection.js';
|
|
34
34
|
import { createChannelNotifications } from './channel/notifications.js';
|
|
35
|
+
import { createSelectionAttachments } from './channel/ide-selection.js';
|
|
36
|
+
import { IdeChannel, ideLockDir } from './ide-channel.js';
|
|
35
37
|
import { adapterRuntimeFor } from '../adapter/kernel/runtime-context.js';
|
|
36
38
|
import { readGrantStore } from '../adapter/standard/grants.js';
|
|
37
39
|
import { isCommandCompletionToken, LOCAL_COMMANDS } from '../commands.js';
|
|
@@ -43,6 +45,7 @@ import { createChannelEmitter } from './channel/emitter.js';
|
|
|
43
45
|
import { createInputActions } from './channel/input-actions.js';
|
|
44
46
|
import { createComposerImages } from './channel/composer-images.js';
|
|
45
47
|
import { snapshotLiveSessionEvents } from './compat/liveSession.js';
|
|
48
|
+
import { runForegroundShell } from './compat/shell.js';
|
|
46
49
|
import { createPermissionModeRoster } from './channel/mode-roster.js';
|
|
47
50
|
import { createPermissionModeActions } from './channel/mode-permission-actions.js';
|
|
48
51
|
import { mentionAttachments } from './channel/mentions.js';
|
|
@@ -233,8 +236,48 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
233
236
|
};
|
|
234
237
|
const bookkeeping = createContextBookkeeping(() => state, (text, options) => notify(text, options), percent => t('context-low-warning', { percent }), CONTEXT_WARNING_BUFFER_TOKENS);
|
|
235
238
|
const { warning: contextWarning, resetContextWarning, checkContextWarning, trackPending, untrackPending } = bookkeeping;
|
|
239
|
+
// IDE selection channel (AC-5): one IdeChannel per channel factory, started
|
|
240
|
+
// in the background against the session cwd — lock discovery needs it, env
|
|
241
|
+
// direct-connect does not but tolerates the extra hint. start() is fully
|
|
242
|
+
// non-throwing and self-degrading, so a missing IDE costs nothing and
|
|
243
|
+
// startup never waits on the loopback dial.
|
|
244
|
+
const ideChannel = new IdeChannel();
|
|
245
|
+
void ideChannel.start(process.env, ideLockDir(), options.cwd).catch(() => { });
|
|
246
|
+
let currentSelection;
|
|
247
|
+
ideChannel.onSelection(snapshot => {
|
|
248
|
+
// The channel already clears empty snapshots internally; mirror that here
|
|
249
|
+
// so consumption reads one consistent variable.
|
|
250
|
+
currentSelection = snapshot.isEmpty ? undefined : snapshot;
|
|
251
|
+
// Live prompt-footer badge: the projection must reach the screen BEFORE
|
|
252
|
+
// the user submits — emit() bumps `version` so the useSyncExternalStore
|
|
253
|
+
// tree re-renders with the new badge immediately.
|
|
254
|
+
state.selection = currentSelection;
|
|
255
|
+
state.emit();
|
|
256
|
+
});
|
|
257
|
+
/**
|
|
258
|
+
* Re-target the IDE selection link when the session's working directory
|
|
259
|
+
* changes (/resume adopts the persisted header cwd, /workspace switches to
|
|
260
|
+
* another directory, a background session is adopted): a selection made in
|
|
261
|
+
* the OLD workspace would otherwise stay projected — the badge shows it and
|
|
262
|
+
* the next submit attaches the wrong file — and the OLD link would keep
|
|
263
|
+
* pushing the old window's selections into the new workspace.
|
|
264
|
+
*
|
|
265
|
+
* rebind() drops the link and rediscovers against the new cwd (env-direct
|
|
266
|
+
* reconnects to the same spawned server; lock scan only ever returns
|
|
267
|
+
* candidates whose workspaceFolders cover the new cwd). Callers set
|
|
268
|
+
* state.cwd BEFORE this runs, so it reads the fresh value (maintainer
|
|
269
|
+
* review round 3: this used to only clear the cached selection and keep
|
|
270
|
+
* the stale connection alive).
|
|
271
|
+
*/
|
|
272
|
+
const resetIdeSelection = () => {
|
|
273
|
+
currentSelection = undefined;
|
|
274
|
+
state.selection = undefined;
|
|
275
|
+
state.emit();
|
|
276
|
+
void ideChannel.rebind(state.cwd).catch(() => { });
|
|
277
|
+
};
|
|
278
|
+
const selectionAttachments = createSelectionAttachments();
|
|
236
279
|
const composer = createComposerImages(ctx, owner, { generation: () => state.agentBindingGeneration });
|
|
237
|
-
const inputDelivery = createInputDelivery(ctx, owner, binding, () => state, (...args) => notify(...args), trackPending, untrackPending, composer);
|
|
280
|
+
const inputDelivery = createInputDelivery(ctx, owner, binding, () => state, (...args) => notify(...args), trackPending, untrackPending, composer, () => currentSelection, (messageId, info) => selectionAttachments.remember(messageId, info));
|
|
238
281
|
const { dispatchUserText, deliverUserText, retireAttachment, withDecisionPending, clearStagedImages } = inputDelivery;
|
|
239
282
|
/**
|
|
240
283
|
* The `tui/session-switch` decision event (pi's `session_before_switch`),
|
|
@@ -420,12 +463,20 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
420
463
|
},
|
|
421
464
|
releaseContributions() {
|
|
422
465
|
// Owner cleanup is exhaustive, but it can report an external cleanup
|
|
423
|
-
// failure. The
|
|
466
|
+
// failure. The emitter and the IDE loopback link are both OUTSIDE the
|
|
467
|
+
// owner and must still stop no matter which earlier step throws — a
|
|
468
|
+
// bare trailing ideChannel.stop() used to be skipped whenever
|
|
469
|
+
// owner.dispose() threw, leaking the socket (maintainer review round 3).
|
|
424
470
|
try {
|
|
425
471
|
owner.dispose();
|
|
426
472
|
}
|
|
427
473
|
finally {
|
|
428
|
-
|
|
474
|
+
try {
|
|
475
|
+
emitter.dispose();
|
|
476
|
+
}
|
|
477
|
+
finally {
|
|
478
|
+
ideChannel.stop();
|
|
479
|
+
}
|
|
429
480
|
}
|
|
430
481
|
},
|
|
431
482
|
traceEvents() {
|
|
@@ -555,6 +606,7 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
555
606
|
checkContextWarning, notify: (...args) => notify(...args),
|
|
556
607
|
tools: ctx.get('tools'), renderer: rendererRuntime,
|
|
557
608
|
attachments: () => ctx.get('attachments'),
|
|
609
|
+
selectionAttached: messageId => selectionAttachments.take(messageId),
|
|
558
610
|
});
|
|
559
611
|
localActions = createLocalActions({
|
|
560
612
|
ctx,
|
|
@@ -588,6 +640,7 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
588
640
|
initialEffort: options.effort,
|
|
589
641
|
agent: () => binding.agent,
|
|
590
642
|
notify,
|
|
643
|
+
checkContextWarning,
|
|
591
644
|
});
|
|
592
645
|
commandCompletions = createCommandCompletions({
|
|
593
646
|
state: () => state,
|
|
@@ -686,6 +739,7 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
686
739
|
refreshLoadedContext,
|
|
687
740
|
refreshSkillCommands,
|
|
688
741
|
clearStagedImages,
|
|
742
|
+
resetIdeSelection,
|
|
689
743
|
notifySessionSwitched,
|
|
690
744
|
notifyAgentView: agentView.notify,
|
|
691
745
|
});
|
|
@@ -698,6 +752,10 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
698
752
|
}, {
|
|
699
753
|
owner,
|
|
700
754
|
binding,
|
|
755
|
+
// `/resume` shares the live-adoption path with the session supervisor, so
|
|
756
|
+
// a target already running in this process is re-attached rather than
|
|
757
|
+
// resumed twice from its log (which would mount one log in two places).
|
|
758
|
+
adoptLive: target => adoptLiveAgent(target),
|
|
701
759
|
backgroundHandles,
|
|
702
760
|
rowIds,
|
|
703
761
|
resetProjector: () => projector.reset(),
|
|
@@ -712,6 +770,7 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
712
770
|
refreshLoadedContext,
|
|
713
771
|
refreshSkillCommands,
|
|
714
772
|
clearStagedImages,
|
|
773
|
+
resetIdeSelection,
|
|
715
774
|
settleCompaction: () => settleManualCompaction(),
|
|
716
775
|
sessionSwitchVetoed,
|
|
717
776
|
notify,
|
|
@@ -792,6 +851,9 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
792
851
|
resumeTo: resumeToAction,
|
|
793
852
|
newSession: newSessionAction,
|
|
794
853
|
listWorkspaces: workspaceActions.listWorkspaces,
|
|
854
|
+
listWorkspaceRegistry: workspaceActions.listWorkspaceRegistry,
|
|
855
|
+
removeWorkspace: workspaceActions.removeWorkspace,
|
|
856
|
+
renameWorkspaceAt: workspaceActions.renameWorkspaceAt,
|
|
795
857
|
resolveWorkspace: workspaceActions.resolveWorkspace,
|
|
796
858
|
switchWorkspace: workspaceActions.switchWorkspace,
|
|
797
859
|
renameWorkspace: workspaceActions.renameWorkspace,
|
|
@@ -901,12 +963,11 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
901
963
|
// flight refreshes the branch for the NEW cwd, so a late reply from the
|
|
902
964
|
// old workspace must be dropped (statusline staleness, issue #96 review).
|
|
903
965
|
const requestedCwd = state.cwd;
|
|
904
|
-
void bash
|
|
905
|
-
.run(bash.resolve({
|
|
966
|
+
void runForegroundShell(bash, {
|
|
906
967
|
command: 'git branch --show-current',
|
|
907
968
|
workdir: requestedCwd,
|
|
908
969
|
timeoutMs: 3000,
|
|
909
|
-
})
|
|
970
|
+
})
|
|
910
971
|
.then((result) => {
|
|
911
972
|
if (!owner.current() || state.cwd !== requestedCwd)
|
|
912
973
|
return;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ContentBlock } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
/** 0.1.7 puts tool output on the message; older logs wrap it in one block. */
|
|
3
|
+
export declare function toolResultPayload(message: {
|
|
4
|
+
readonly content?: readonly ContentBlock[];
|
|
5
|
+
readonly isError?: boolean;
|
|
6
|
+
} | undefined): {
|
|
7
|
+
content: readonly ContentBlock[];
|
|
8
|
+
isError: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** Preserve old checkpoints while recognizing the V4 producer-owned source. */
|
|
11
|
+
export declare function isCompactionCheckpointSource(source: {
|
|
12
|
+
kind: string;
|
|
13
|
+
plugin?: string;
|
|
14
|
+
}): boolean;
|
|
15
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/compat/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,SAAS,GAAG;IAAE,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAarE;AAED,+EAA+E;AAC/E,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAE/F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** 0.1.7 puts tool output on the message; older logs wrap it in one block. */
|
|
2
|
+
export function toolResultPayload(message) {
|
|
3
|
+
const first = message?.content?.[0];
|
|
4
|
+
if (first?.type === 'tool-result') {
|
|
5
|
+
return {
|
|
6
|
+
content: Array.isArray(first.content) ? first.content : [],
|
|
7
|
+
isError: first.isError === true,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return { content: message?.content ?? [], isError: message?.isError === true };
|
|
11
|
+
}
|
|
12
|
+
/** Preserve old checkpoints while recognizing the V4 producer-owned source. */
|
|
13
|
+
export function isCompactionCheckpointSource(source) {
|
|
14
|
+
return source.kind === 'compact-checkpoint' || (source.kind === 'plugin' && source.plugin === 'compact');
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type Schema from '@deepseek-ai/schemastery';
|
|
3
|
+
/** New Cordis configs wrap editable fields; old hosts pass plain values. */
|
|
4
|
+
export type RuntimeConfig<T> = {
|
|
5
|
+
[K in keyof T]: T[K] | {
|
|
6
|
+
get(): T[K];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
/** Declare only UI preferences as live fields, never the agent/session route. */
|
|
10
|
+
export declare function editableConfig<T>(schema: Schema<T>, keys: readonly (keyof T)[]): Schema<T, RuntimeConfig<T>>;
|
|
11
|
+
/** Snapshot at an operation boundary; retain the host refs for later updates. */
|
|
12
|
+
export declare function configValues<T extends object>(config: RuntimeConfig<T>): T;
|
|
13
|
+
interface SettingsScope<T> {
|
|
14
|
+
get(): T;
|
|
15
|
+
watch(callback: (next: T) => void): () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 0.1.7 owns settings in Config; older hosts still own registered scopes.
|
|
19
|
+
* Pass the Config owner's context, and dispose watch with the consumer's lifecycle.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createSettingsScope<T>(ctx: Context, service: unknown, ns: string, schema: Schema<T>, current: () => T): SettingsScope<T> & {
|
|
22
|
+
legacy: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** New settings forms expose values through describe(), not get(). */
|
|
25
|
+
export declare function settingsValue(settings: {
|
|
26
|
+
get?(ns: string): unknown;
|
|
27
|
+
describe(): readonly {
|
|
28
|
+
ns: string;
|
|
29
|
+
value?: unknown;
|
|
30
|
+
}[];
|
|
31
|
+
}, ns: string): unknown;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=sett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,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAA;IACzB,QAAQ,IAAI,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CACvD,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAEtB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Declare only UI preferences as live fields, never the agent/session route. */
|
|
2
|
+
export function editableConfig(schema, keys) {
|
|
3
|
+
for (const key of keys) {
|
|
4
|
+
const field = schema.dict?.[String(key)];
|
|
5
|
+
if (field !== undefined && typeof field.volatile === 'function')
|
|
6
|
+
schema.dict[String(key)] = field.volatile();
|
|
7
|
+
}
|
|
8
|
+
return schema;
|
|
9
|
+
}
|
|
10
|
+
/** Snapshot at an operation boundary; retain the host refs for later updates. */
|
|
11
|
+
export function configValues(config) {
|
|
12
|
+
return Object.fromEntries(Object.entries(config).map(([key, value]) => [
|
|
13
|
+
key,
|
|
14
|
+
value !== null && typeof value === 'object' && 'get' in value && typeof value.get === 'function'
|
|
15
|
+
? value.get()
|
|
16
|
+
: value,
|
|
17
|
+
]));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 0.1.7 owns settings in Config; older hosts still own registered scopes.
|
|
21
|
+
* Pass the Config owner's context, and dispose watch with the consumer's lifecycle.
|
|
22
|
+
*/
|
|
23
|
+
export function createSettingsScope(ctx, service, ns, schema, current) {
|
|
24
|
+
const settings = service;
|
|
25
|
+
if (typeof settings.register === 'function') {
|
|
26
|
+
const scope = settings.register(ns, schema);
|
|
27
|
+
return { legacy: true, get: () => scope.get(), watch: callback => scope.watch(callback) };
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
legacy: false,
|
|
31
|
+
get: current,
|
|
32
|
+
watch(callback) {
|
|
33
|
+
// The event is absent from the old framework's type map. Cordis owns
|
|
34
|
+
// listener disposal and emits it only to the updated plugin fiber.
|
|
35
|
+
const events = ctx;
|
|
36
|
+
return events.on('loader/volatile-update', () => callback(current()));
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** New settings forms expose values through describe(), not get(). */
|
|
41
|
+
export function settingsValue(settings, ns) {
|
|
42
|
+
return typeof settings.get === 'function' ? settings.get(ns) : settings.describe().find(row => row.ns === ns)?.value;
|
|
43
|
+
}
|