@askdkc/dsh-cli 0.13.5 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{dsh-tui.js → dsh-cli.js} +27 -27
- package/cordis.patch.yml +32 -32
- package/cordis.yml +17 -17
- package/lib/types/activityPrefs.d.ts +2 -2
- package/lib/types/activityPrefs.js +2 -2
- package/lib/types/adapter/channel/actions.js +1 -1
- package/lib/types/adapter/channel/consumer.js +1 -1
- package/lib/types/adapter/channel/internal-token.js +1 -1
- package/lib/types/adapter/channel/plugins.js +1 -1
- package/lib/types/adapter/channel/session-projection.js +3 -3
- package/lib/types/adapter/channel/transcript.js +1 -1
- package/lib/types/adapter/channel/ui.js +3 -3
- package/lib/types/adapter/kernel/host-facade.d.ts +1 -1
- package/lib/types/adapter/kernel/host-facade.js +6 -6
- package/lib/types/adapter/kernel/host-probe-access.d.ts +1 -1
- package/lib/types/adapter/kernel/host-probe-access.js +6 -6
- package/lib/types/adapter/kernel/kernel-runtime.js +1 -1
- package/lib/types/adapter/kernel/legacy-facade.d.ts +1 -1
- package/lib/types/adapter/kernel/legacy-facade.js +1 -1
- package/lib/types/adapter/kernel/replay-isolation.js +1 -1
- package/lib/types/adapter/kernel/runtime.d.ts +1 -1
- package/lib/types/adapter/kernel/runtime.js +7 -7
- package/lib/types/adapter/ports/channel-display.d.ts +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +15 -15
- package/lib/types/adapter/standard/descriptor.d.ts +1 -1
- package/lib/types/adapter/standard/descriptor.js +2 -2
- package/lib/types/adapter/standard/registry.d.ts +1 -1
- package/lib/types/adapter/standard/registry.js +2 -2
- package/lib/types/adapter/standard/tui-extension.d.ts +2 -2
- package/lib/types/adapter/standard/tui-extension.js +3 -3
- package/lib/types/adapter/upstream/channel-driver.js +10 -10
- package/lib/types/adapter/upstream/decisions-driver.js +3 -3
- package/lib/types/adapter/upstream/extensions-driver.js +18 -18
- package/lib/types/adapter/upstream/host-descriptor-driver.js +4 -4
- package/lib/types/adapter/upstream/presentation-driver.js +5 -5
- package/lib/types/adapter/upstream/scenes-driver.js +4 -4
- package/lib/types/adapter/upstream/settings-driver.js +4 -4
- package/lib/types/adapter/upstream/workspace-driver.js +2 -2
- package/lib/types/bootstrap/state.d.ts +4 -4
- package/lib/types/bootstrap/state.js +4 -4
- package/lib/types/{tuiDisplayPrefs.d.ts → cliDisplayPrefs.d.ts} +1 -1
- package/lib/types/{tuiDisplayPrefs.d.ts.map → cliDisplayPrefs.d.ts.map} +1 -1
- package/lib/types/{tuiDisplayPrefs.js → cliDisplayPrefs.js} +1 -1
- package/lib/types/commands.js +7 -7
- package/lib/types/components/AutoRecapRow.d.ts +1 -1
- package/lib/types/components/AutoRecapRow.js +1 -1
- package/lib/types/components/HelpMenu.d.ts +1 -1
- package/lib/types/components/HelpMenu.js +1 -1
- package/lib/types/components/LogoV2.d.ts +2 -2
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +5 -19
- package/lib/types/components/MermaidDiagram.js +1 -1
- package/lib/types/components/MessageList.d.ts +2 -2
- package/lib/types/components/MessageList.js +1 -1
- package/lib/types/components/PageMargin.d.ts +3 -3
- package/lib/types/components/PageMargin.js +1 -1
- package/lib/types/components/PluginSceneBoundary.d.ts +1 -1
- package/lib/types/components/PluginSceneBoundary.js +1 -1
- package/lib/types/components/PromptInput.d.ts +1 -1
- package/lib/types/components/PromptInput.js +3 -3
- package/lib/types/components/ScrollbarGutter.d.ts +1 -1
- package/lib/types/components/ScrollbarGutter.js +1 -1
- package/lib/types/components/Select.d.ts +1 -1
- package/lib/types/components/Select.js +1 -1
- package/lib/types/components/SplitDiffView.d.ts +1 -1
- package/lib/types/components/ThemePicker.d.ts +1 -1
- package/lib/types/components/ThemePicker.js +1 -1
- package/lib/types/components/activityFrames.d.ts +1 -1
- package/lib/types/components/activityFrames.js +1 -1
- package/lib/types/components/design-system/Byline.d.ts +1 -1
- package/lib/types/components/design-system/Byline.js +1 -1
- package/lib/types/components/design-system/Divider.d.ts +1 -1
- package/lib/types/components/design-system/Divider.js +1 -1
- package/lib/types/components/design-system/StatusIcon.d.ts +1 -1
- package/lib/types/components/design-system/StatusIcon.js +1 -1
- package/lib/types/components/design-system/ThemeProvider.d.ts +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +11 -11
- package/lib/types/components/design-system/ThemedBox.d.ts +1 -1
- package/lib/types/components/design-system/ThemedBox.js +1 -1
- package/lib/types/components/design-system/ThemedText.d.ts +1 -1
- package/lib/types/components/design-system/ThemedText.js +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +3 -3
- package/lib/types/components/messages/AssistantToolUseMessage.js +1 -1
- package/lib/types/components/messages/originalImage.js +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +1 -1
- package/lib/types/components/smoothReveal.d.ts +1 -1
- package/lib/types/components/smoothReveal.js +1 -1
- package/lib/types/customTheme.d.ts +5 -5
- package/lib/types/customTheme.js +7 -7
- package/lib/types/dsh-adapter/activity-store.d.ts +1 -1
- package/lib/types/dsh-adapter/activity-store.js +3 -3
- package/lib/types/dsh-adapter/bundled-presets.js +2 -2
- package/lib/types/dsh-adapter/channel/action-readiness.js +2 -2
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +1 -1
- package/lib/types/dsh-adapter/channel/binding.js +14 -14
- package/lib/types/dsh-adapter/channel/external-commands.js +3 -3
- package/lib/types/dsh-adapter/channel/input-delivery.js +1 -1
- package/lib/types/dsh-adapter/channel/job-projection.js +1 -1
- package/lib/types/dsh-adapter/channel/lifetime-resources.js +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +1 -1
- package/lib/types/dsh-adapter/channel/mode-actions.js +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission.js +6 -6
- package/lib/types/dsh-adapter/channel/mode-roster.js +1 -1
- package/lib/types/dsh-adapter/channel/owner.js +2 -2
- package/lib/types/dsh-adapter/channel/preferences.js +1 -1
- package/lib/types/dsh-adapter/channel/projection.js +1 -1
- package/lib/types/dsh-adapter/channel/reports.js +3 -3
- package/lib/types/dsh-adapter/channel/session-fork.js +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +4 -4
- package/lib/types/dsh-adapter/channel/session-metadata.js +2 -2
- package/lib/types/dsh-adapter/channel/session-rewind.js +2 -2
- package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/state.js +1 -1
- package/lib/types/dsh-adapter/channel/types.d.ts +1 -1
- package/lib/types/dsh-adapter/channel-ui.js +2 -2
- package/lib/types/dsh-adapter/channel.js +9 -9
- package/lib/types/dsh-adapter/cli-registration.d.ts.map +1 -1
- package/lib/types/dsh-adapter/cli-registration.js +5 -4
- package/lib/types/dsh-adapter/command-trees.d.ts +1 -1
- package/lib/types/dsh-adapter/command-trees.js +2 -2
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +3 -3
- package/lib/types/dsh-adapter/compat/sessionLog.js +5 -5
- package/lib/types/dsh-adapter/compat/settings.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/settings.js +15 -7
- package/lib/types/dsh-adapter/contract.d.ts +1 -1
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +0 -1
- package/lib/types/dsh-adapter/decision-guard.d.ts +3 -3
- package/lib/types/dsh-adapter/decision-guard.js +6 -6
- package/lib/types/dsh-adapter/dialogs.d.ts +1 -1
- package/lib/types/dsh-adapter/dialogs.js +7 -7
- package/lib/types/dsh-adapter/effect-ledger.d.ts +2 -2
- package/lib/types/dsh-adapter/effect-ledger.js +5 -5
- package/lib/types/dsh-adapter/extension-events.js +10 -10
- package/lib/types/dsh-adapter/extensions.d.ts +3 -3
- package/lib/types/dsh-adapter/extensions.js +3 -3
- package/lib/types/dsh-adapter/host-access.js +11 -11
- package/lib/types/dsh-adapter/ide-channel.d.ts +6 -6
- package/lib/types/dsh-adapter/ide-channel.js +6 -6
- package/lib/types/dsh-adapter/index.d.ts +18 -18
- package/lib/types/dsh-adapter/index.js +5 -5
- package/lib/types/dsh-adapter/inject-channel.d.ts +4 -4
- package/lib/types/dsh-adapter/inject-channel.js +5 -5
- package/lib/types/dsh-adapter/invariant.d.ts +9 -2
- package/lib/types/dsh-adapter/invariant.d.ts.map +1 -1
- package/lib/types/dsh-adapter/invariant.js +1 -1
- package/lib/types/dsh-adapter/message-observer.d.ts +2 -2
- package/lib/types/dsh-adapter/message-observer.js +23 -23
- package/lib/types/dsh-adapter/migrate/adapters/scan.js +1 -1
- package/lib/types/dsh-adapter/migrate/bin-path.d.ts +1 -1
- package/lib/types/dsh-adapter/migrate/bin-path.js +4 -4
- package/lib/types/dsh-adapter/migrate/picker.d.ts +1 -1
- package/lib/types/dsh-adapter/migrate/picker.js +1 -1
- package/lib/types/dsh-adapter/migrate/uuid.js +1 -1
- package/lib/types/dsh-adapter/packaged-presets.js +1 -1
- package/lib/types/dsh-adapter/plugin-host.d.ts +2 -2
- package/lib/types/dsh-adapter/plugin-host.js +32 -32
- package/lib/types/dsh-adapter/plugin-storage.d.ts +3 -3
- package/lib/types/dsh-adapter/plugin-storage.js +5 -5
- package/lib/types/dsh-adapter/plugin.d.ts +4 -4
- package/lib/types/dsh-adapter/plugin.js +89 -89
- package/lib/types/dsh-adapter/preset-resolution.d.ts +1 -1
- package/lib/types/dsh-adapter/presets.js +1 -1
- package/lib/types/dsh-adapter/promptDebug.js +1 -1
- package/lib/types/dsh-adapter/questions.d.ts +1 -1
- package/lib/types/dsh-adapter/questions.js +1 -1
- package/lib/types/dsh-adapter/renderers.js +7 -7
- package/lib/types/dsh-adapter/scenes.d.ts +1 -1
- package/lib/types/dsh-adapter/scenes.js +6 -6
- package/lib/types/dsh-adapter/settings-sections.d.ts +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +5 -5
- package/lib/types/dsh-adapter/sharp.js +1 -1
- package/lib/types/dsh-adapter/shortcuts.js +9 -9
- package/lib/types/dsh-adapter/status.js +21 -21
- package/lib/types/dsh-adapter/themes.js +2 -2
- package/lib/types/dsh-adapter/toast.js +7 -7
- package/lib/types/dsh-adapter/types.d.ts +0 -1
- package/lib/types/dsh-adapter/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/workspaces.d.ts +1 -1
- package/lib/types/dsh-adapter/workspaces.js +6 -6
- package/lib/types/effortPrefs.d.ts +2 -2
- package/lib/types/effortPrefs.js +2 -2
- package/lib/types/force-production-react.js +1 -1
- package/lib/types/herdr.js +4 -4
- package/lib/types/homePrefs.js +1 -1
- package/lib/types/i18n.d.ts +54 -54
- package/lib/types/i18n.js +39 -39
- package/lib/types/ink/clearTerminal.d.ts +1 -1
- package/lib/types/ink/clearTerminal.js +1 -1
- package/lib/types/ink/colorize.js +1 -1
- package/lib/types/ink/components/App.d.ts +1 -1
- package/lib/types/ink/components/App.js +5 -5
- package/lib/types/ink/components/Text.d.ts +1 -1
- package/lib/types/ink/devtools.d.ts +1 -1
- package/lib/types/ink/dom.d.ts +1 -1
- package/lib/types/ink/dom.js +1 -1
- package/lib/types/ink/geometry-trace.js +4 -4
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +8 -19
- package/lib/types/ink/reconciler.d.ts +1 -1
- package/lib/types/ink/reconciler.d.ts.map +1 -1
- package/lib/types/ink/reconciler.js +6 -3
- package/lib/types/ink/render-to-screen.d.ts.map +1 -1
- package/lib/types/ink/render-to-screen.js +0 -5
- package/lib/types/ink/terminal.js +3 -3
- package/lib/types/ink/termio/osc.js +1 -1
- package/lib/types/ink/update-overflow-guard.js +2 -2
- package/lib/types/minimalMode.d.ts +2 -2
- package/lib/types/minimalMode.js +2 -2
- package/lib/types/modelGroups.d.ts +1 -1
- package/lib/types/modelGroups.js +1 -1
- package/lib/types/modelPrefs.d.ts +1 -1
- package/lib/types/modelPrefs.js +1 -1
- package/lib/types/modelRecents.d.ts +2 -2
- package/lib/types/modelRecents.js +2 -2
- package/lib/types/package-version.d.ts +3 -0
- package/lib/types/package-version.d.ts.map +1 -0
- package/lib/types/package-version.js +25 -0
- package/lib/types/presetPrefs.d.ts +1 -1
- package/lib/types/presetPrefs.js +1 -1
- package/lib/types/reload.d.ts +8 -8
- package/lib/types/reload.js +4 -4
- package/lib/types/screens/Chat.js +27 -27
- package/lib/types/screens/StatusLine.js +1 -1
- package/lib/types/screens/StatusMetrics.js +1 -1
- package/lib/types/sessionHistory.d.ts +3 -3
- package/lib/types/sessionHistory.js +7 -7
- package/lib/types/sessionModes.js +1 -1
- package/lib/types/sessionMounts.d.ts +1 -1
- package/lib/types/sessionMounts.js +1 -1
- package/lib/types/sessionPins.d.ts +1 -1
- package/lib/types/sessionPins.js +1 -1
- package/lib/types/terminal-utils/cliHighlight.d.ts +1 -1
- package/lib/types/terminal-utils/hash.d.ts +1 -1
- package/lib/types/terminal-utils/hash.js +1 -1
- package/lib/types/terminal-utils/mermaid.d.ts +1 -1
- package/lib/types/terminal-utils/syntaxTheme.js +1 -1
- package/lib/types/theme.d.ts +3 -3
- package/lib/types/theme.js +3 -3
- package/lib/types/themePrefs.d.ts +3 -3
- package/lib/types/themePrefs.js +3 -3
- package/lib/types/tips.js +4 -4
- package/lib/types/trajectory/effortIgnition.d.ts +1 -1
- package/lib/types/trajectoryPrefs.d.ts +1 -1
- package/lib/types/trajectoryPrefs.js +1 -1
- package/lib/types/ui.d.ts +1 -1
- package/lib/types/ui.js +1 -1
- package/lib/types/update.d.ts +25 -26
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +55 -73
- package/lib/types/utils/clipboard.js +1 -1
- package/lib/types/utils/credentials.js +2 -2
- package/lib/types/utils/debug.d.ts +3 -3
- package/lib/types/utils/debug.js +6 -6
- package/lib/types/utils/earlyInput.d.ts +1 -1
- package/lib/types/utils/earlyInput.js +1 -1
- package/lib/types/utils/externalEditor.js +1 -1
- package/lib/types/utils/fullscreen.d.ts +3 -3
- package/lib/types/utils/fullscreen.js +4 -4
- package/lib/types/utils/log.js +1 -1
- package/lib/types/utils/paths.d.ts +3 -3
- package/lib/types/utils/paths.js +4 -4
- package/lib/types/working-activity.js +1 -1
- package/node_modules/@askdkc/dsh-auth/dsh-plugin.json +1 -1
- package/node_modules/@askdkc/dsh-auth/lib/index.d.ts +2 -2
- package/node_modules/@askdkc/dsh-auth/lib/index.js +2 -2
- package/node_modules/@askdkc/dsh-auth/lib/pi-ai.d.ts +0 -2
- package/node_modules/@askdkc/dsh-auth/lib/pi-ai.js +0 -2
- package/node_modules/@askdkc/dsh-auth/lib/service.d.ts +1 -1
- package/node_modules/@askdkc/dsh-auth/lib/service.js +2 -2
- package/node_modules/dsh-working-activity/lib/client.js.map +1 -1
- package/node_modules/dsh-working-activity/lib/types/client/index.d.ts +1 -1
- package/node_modules/dsh-working-activity/lib/types/config.d.ts +2 -2
- package/node_modules/dsh-working-activity/lib/types/config.js +2 -2
- package/node_modules/dsh-working-activity/lib/types/frames.d.ts +1 -1
- package/node_modules/dsh-working-activity/lib/types/frames.js +1 -1
- package/node_modules/dsh-working-activity/lib/types/index.d.ts +1 -1
- package/node_modules/dsh-working-activity/lib/types/index.js +2 -2
- package/node_modules/dsh-working-activity/lib/types/invariant.d.ts +13 -1
- package/node_modules/dsh-working-activity/lib/types/lang.d.ts +5 -5
- package/node_modules/dsh-working-activity/lib/types/lang.js +8 -8
- package/node_modules/dsh-working-activity/lib/types/projection.d.ts +1 -1
- package/node_modules/dsh-working-activity/lib/types/projection.js +1 -1
- package/node_modules/dsh-working-activity/lib/types/status.d.ts +1 -1
- package/node_modules/dsh-working-activity/lib/types/status.js +1 -1
- package/node_modules/dsh-working-activity/package.json +0 -4
- package/node_modules/dsh-working-activity/src/client/index.ts +1 -1
- package/node_modules/dsh-working-activity/src/config.ts +2 -2
- package/node_modules/dsh-working-activity/src/frames.ts +1 -1
- package/node_modules/dsh-working-activity/src/index.ts +4 -4
- package/node_modules/dsh-working-activity/src/invariant.ts +10 -3
- package/node_modules/dsh-working-activity/src/lang.ts +8 -8
- package/node_modules/dsh-working-activity/src/projection.ts +1 -1
- package/node_modules/dsh-working-activity/src/status.ts +1 -1
- package/package.json +8 -13
- package/presets/liangshen/agent.cordis.yml +1 -1
- package/presets/liangshen/custom-bash.mjs +2 -2
|
@@ -113,13 +113,13 @@ export function createPermissionIdentity(ctx, deps) {
|
|
|
113
113
|
return true;
|
|
114
114
|
await new Promise(resolve => setTimeout(resolve, 50));
|
|
115
115
|
}
|
|
116
|
-
ctx.logger.warn(`dsh-
|
|
116
|
+
ctx.logger.warn(`dsh-cli: permission mode "${target}" was not confirmed by permissionPresets.current()/permission/preset`);
|
|
117
117
|
deps.notify(t('mode-permission-unconfirmed'), { color: 'warning' });
|
|
118
118
|
return false;
|
|
119
119
|
};
|
|
120
120
|
const apply = async (target) => {
|
|
121
121
|
if (!isCommandCompletionToken(target)) {
|
|
122
|
-
ctx.logger.warn(`dsh-
|
|
122
|
+
ctx.logger.warn(`dsh-cli: permission mode "${target}" skipped because its identity is not a safe command token`);
|
|
123
123
|
return false;
|
|
124
124
|
}
|
|
125
125
|
const agent = deps.agent();
|
|
@@ -149,13 +149,13 @@ export function createPermissionIdentity(ctx, deps) {
|
|
|
149
149
|
runtime.set(session, target);
|
|
150
150
|
}
|
|
151
151
|
catch (error) {
|
|
152
|
-
ctx.logger.warn(`dsh-
|
|
152
|
+
ctx.logger.warn(`dsh-cli: permission mode "${target}" could not be applied by the permissionPresets service: ${error instanceof Error ? error.message : String(error)}`);
|
|
153
153
|
deps.notify(t('mode-permission-invoke-failed'), { color: 'warning' });
|
|
154
154
|
return false;
|
|
155
155
|
}
|
|
156
156
|
return await confirmTarget(target, session, 2000);
|
|
157
157
|
}
|
|
158
|
-
ctx.logger.warn(`dsh-
|
|
158
|
+
ctx.logger.warn(`dsh-cli: permission mode "${target}" skipped because /permission is not registered`);
|
|
159
159
|
deps.notify(t('mode-permission-unregistered'), { color: 'warning' });
|
|
160
160
|
return false;
|
|
161
161
|
}
|
|
@@ -163,7 +163,7 @@ export function createPermissionIdentity(ctx, deps) {
|
|
|
163
163
|
if (session !== deps.agent().session)
|
|
164
164
|
return false;
|
|
165
165
|
if (result === undefined) {
|
|
166
|
-
ctx.logger.warn(`dsh-
|
|
166
|
+
ctx.logger.warn(`dsh-cli: permission mode "${target}" could not invoke /permission`);
|
|
167
167
|
deps.notify(t('mode-permission-invoke-failed'), { color: 'warning' });
|
|
168
168
|
return false;
|
|
169
169
|
}
|
|
@@ -188,7 +188,7 @@ export function createPermissionIdentity(ctx, deps) {
|
|
|
188
188
|
return true;
|
|
189
189
|
const canonical = canonicalForMode(spec, session);
|
|
190
190
|
if (canonical === undefined) {
|
|
191
|
-
ctx.logger.warn(`dsh-
|
|
191
|
+
ctx.logger.warn(`dsh-cli: static mode "${spec.id}" cannot safely clear permission identity "${current}"`);
|
|
192
192
|
deps.notify(t('mode-permission-no-canonical', { name: modeDisplayName(spec) }), { color: 'warning' });
|
|
193
193
|
return false;
|
|
194
194
|
}
|
|
@@ -46,7 +46,7 @@ export function warnOnceForPermissionEntry(warned, warn, target, value, reason)
|
|
|
46
46
|
if (warned.size >= 200)
|
|
47
47
|
warned.clear();
|
|
48
48
|
warned.add(key);
|
|
49
|
-
warn(`dsh-
|
|
49
|
+
warn(`dsh-cli: permission preset "${value}" skipped from Shift+Tab (${reason})`);
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Dynamic session-mode roster (main's `sessionModes` / `rebuildSessionModes`).
|
|
@@ -16,7 +16,7 @@ export function createChannelOwner() {
|
|
|
16
16
|
};
|
|
17
17
|
const assertActive = () => {
|
|
18
18
|
if (!current())
|
|
19
|
-
throw new Error('dsh-
|
|
19
|
+
throw new Error('dsh-cli: Channel lifetime has ended');
|
|
20
20
|
};
|
|
21
21
|
return {
|
|
22
22
|
current, assertActive,
|
|
@@ -57,7 +57,7 @@ export function createChannelOwner() {
|
|
|
57
57
|
if (failures.length === 1)
|
|
58
58
|
throw failures[0];
|
|
59
59
|
if (failures.length > 1)
|
|
60
|
-
throw new AggregateError(failures, 'dsh-
|
|
60
|
+
throw new AggregateError(failures, 'dsh-cli: Channel cleanup failed');
|
|
61
61
|
},
|
|
62
62
|
};
|
|
63
63
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setMinimalMode } from '../../minimalMode.js';
|
|
2
|
-
import { normalizePageMargin, normalizeScrollGutter, normalizeStatusBar, normalizeToolBackground } from '../../
|
|
2
|
+
import { normalizePageMargin, normalizeScrollGutter, normalizeStatusBar, normalizeToolBackground } from '../../cliDisplayPrefs.js';
|
|
3
3
|
export function createPreferences(getState) {
|
|
4
4
|
return {
|
|
5
5
|
setDiffLayout(layout) {
|
|
@@ -926,7 +926,7 @@ export function createChannelProjection(state, deps) {
|
|
|
926
926
|
deps.rowIds.value += 1;
|
|
927
927
|
break;
|
|
928
928
|
}
|
|
929
|
-
// `/color` accent (dsh-
|
|
929
|
+
// `/color` accent (dsh-cli plugin event, replayed on resume/rewind
|
|
930
930
|
// like session/title): last write wins, '' clears to the default.
|
|
931
931
|
if (event.type === 'session/color') {
|
|
932
932
|
const data = event.data;
|
|
@@ -95,7 +95,7 @@ export function createReportActions(ctx, deps) {
|
|
|
95
95
|
if (!current(capture))
|
|
96
96
|
return null;
|
|
97
97
|
try {
|
|
98
|
-
const target = join(deps.cwd(), `dsh-
|
|
98
|
+
const target = join(deps.cwd(), `dsh-cli-export-${Date.now()}.md`);
|
|
99
99
|
writeFileSync(target, parts.join('\n'), 'utf8');
|
|
100
100
|
return current(capture) ? target : null;
|
|
101
101
|
}
|
|
@@ -122,7 +122,7 @@ export function createReportActions(ctx, deps) {
|
|
|
122
122
|
const doctorInfo = () => {
|
|
123
123
|
const lines = [
|
|
124
124
|
`Node ${process.version} · ${process.platform} ${process.arch}`,
|
|
125
|
-
// Same predicate as the launcher's doctor (bin/dsh-
|
|
125
|
+
// Same predicate as the launcher's doctor (bin/dsh-cli.js): dsh resolves
|
|
126
126
|
// credential-store refs into the session at launch, so an environment-only
|
|
127
127
|
// check reports a working key as missing. The two doctors must not diverge.
|
|
128
128
|
t('doctor-api-key', {
|
|
@@ -137,7 +137,7 @@ export function createReportActions(ctx, deps) {
|
|
|
137
137
|
t('doctor-context-window', { window: deps.contextWindow() ?? t('doctor-unknown') }),
|
|
138
138
|
`${t('doctor-session', { id: deps.capture().agent.id })}${deps.sessionTitle() ? ` · ${deps.sessionTitle()}` : ''}`,
|
|
139
139
|
];
|
|
140
|
-
for (const candidate of [join(homeDir(), '.dsh-
|
|
140
|
+
for (const candidate of [join(homeDir(), '.dsh-cli/cordis.yml'), join(homeDir(), '.dsh/profiles/dsh-cli/cordis.patch.yml')]) {
|
|
141
141
|
lines.push(t('doctor-config', { candidate, state: existsSync(candidate) ? '✓' : t('doctor-config-missing') }));
|
|
142
142
|
}
|
|
143
143
|
for (const dir of sessionsRoots())
|
|
@@ -87,7 +87,7 @@ export function createForkSessionAction(ctx, state, deps) {
|
|
|
87
87
|
await detached.release();
|
|
88
88
|
}
|
|
89
89
|
catch (error) {
|
|
90
|
-
ctx.logger.warn('dsh-
|
|
90
|
+
ctx.logger.warn('dsh-cli: forked session dispose failed: %o', error);
|
|
91
91
|
}
|
|
92
92
|
try {
|
|
93
93
|
const sourceTitle = state.sessionTitle.trim();
|
|
@@ -6,11 +6,11 @@ import type { ChannelOwner } from './owner.js';
|
|
|
6
6
|
import type { CredentialStatus } from './types.js';
|
|
7
7
|
declare module '@deepseek-ai/dsh-llm' {
|
|
8
8
|
interface MessageSourceMap {
|
|
9
|
-
'dsh-
|
|
10
|
-
kind: 'dsh-
|
|
9
|
+
'dsh-cli-btw': {
|
|
10
|
+
kind: 'dsh-cli-btw';
|
|
11
11
|
};
|
|
12
|
-
'dsh-
|
|
13
|
-
kind: 'dsh-
|
|
12
|
+
'dsh-cli-recap': {
|
|
13
|
+
kind: 'dsh-cli-recap';
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -130,7 +130,7 @@ export function createSessionMetadataActions(ctx, deps) {
|
|
|
130
130
|
stream: llm.stream.bind(llm),
|
|
131
131
|
options: llmRequest(capture, [
|
|
132
132
|
...capture.agent.session.deriveMessages(),
|
|
133
|
-
createUserMessage({ content: [{ type: 'text', text: wrapSideQuestion(question) }], source: { kind: 'dsh-
|
|
133
|
+
createUserMessage({ content: [{ type: 'text', text: wrapSideQuestion(question) }], source: { kind: 'dsh-cli-btw' } }),
|
|
134
134
|
], true, signal),
|
|
135
135
|
// Do not let an old session append streamed UI facts after a switch.
|
|
136
136
|
onText: delta => { if (current(capture) && !options?.signal?.aborted)
|
|
@@ -154,7 +154,7 @@ export function createSessionMetadataActions(ctx, deps) {
|
|
|
154
154
|
const outcome = await runSideQuestion({
|
|
155
155
|
stream: llm.stream.bind(llm),
|
|
156
156
|
options: llmRequest(capture, [
|
|
157
|
-
createUserMessage({ content: [{ type: 'text', text: wrapRecapPrompt(activity) }], source: { kind: 'dsh-
|
|
157
|
+
createUserMessage({ content: [{ type: 'text', text: wrapRecapPrompt(activity) }], source: { kind: 'dsh-cli-recap' } }),
|
|
158
158
|
], false, signal),
|
|
159
159
|
onText: delta => { if (current(capture) && !options?.signal?.aborted)
|
|
160
160
|
options?.onText?.(delta); },
|
|
@@ -129,10 +129,10 @@ export function createRewindToAction(ctx, state, deps) {
|
|
|
129
129
|
}, normalizeRewindDoneSummary).then(summary => {
|
|
130
130
|
if (typeof summary === 'string')
|
|
131
131
|
deps.notify(summary, { timeoutMs: 6000 });
|
|
132
|
-
}).catch((error) => ctx.logger.warn('dsh-
|
|
132
|
+
}).catch((error) => ctx.logger.warn('dsh-cli: tui/rewind-done dispatch failed: %o', error));
|
|
133
133
|
}
|
|
134
134
|
catch (error) {
|
|
135
|
-
ctx.logger.warn('dsh-
|
|
135
|
+
ctx.logger.warn('dsh-cli: tui/rewind-done dispatch failed: %o', error);
|
|
136
136
|
}
|
|
137
137
|
deps.notifySessionSwitched('rewind', String(childId), sourceSessionId);
|
|
138
138
|
return row.text;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentHandle } from '@deepseek-ai/dsh-agent';
|
|
2
2
|
import type { SessionModeSpec } from '../../sessionModes.js';
|
|
3
|
-
import { type PageMarginSetting, type ScrollGutterMode, type StatusBarConfig, type ToolBackground } from '../../
|
|
3
|
+
import { type PageMarginSetting, type ScrollGutterMode, type StatusBarConfig, type ToolBackground } from '../../cliDisplayPrefs.js';
|
|
4
4
|
import type { ChannelState } from './types.js';
|
|
5
5
|
/** Launch configuration belongs to channel construction, not the composition root. */
|
|
6
6
|
export interface ChannelLaunchOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { terminalProgressLang } from 'dsh-working-activity/lang';
|
|
2
|
-
import { normalizePageMargin, normalizeScrollGutter, normalizeStatusBar, normalizeToolBackground } from '../../
|
|
2
|
+
import { normalizePageMargin, normalizeScrollGutter, normalizeStatusBar, normalizeToolBackground } from '../../cliDisplayPrefs.js';
|
|
3
3
|
import { normalizeActivityPreset } from '../../components/activityFrames.js';
|
|
4
4
|
/**
|
|
5
5
|
* Neutral observable fields only. Behaviour is assembled explicitly by the
|
|
@@ -19,7 +19,7 @@ export type ChannelImageBlock = Extract<ContentBlock, {
|
|
|
19
19
|
type: 'image';
|
|
20
20
|
}>;
|
|
21
21
|
export type ChannelImageMediaType = ChannelImageBlock['attachment']['mediaType'];
|
|
22
|
-
/** The dsh-tools registry seam dsh-
|
|
22
|
+
/** The dsh-tools registry seam dsh-cli reads presentations through. The
|
|
23
23
|
* registry lives on the host plane; `get` takes the live agent as the
|
|
24
24
|
* scope so a preset's own tool definitions resolve (dsh-host-apiproxy's
|
|
25
25
|
* presenter pattern). */
|
|
@@ -75,7 +75,7 @@ export function mountChannelUi(ctx, channel, pluginHost, mode) {
|
|
|
75
75
|
const ui = facade?.channel?.projection.ui;
|
|
76
76
|
if (ui === undefined) {
|
|
77
77
|
if (mounted !== undefined)
|
|
78
|
-
throw new Error('dsh-
|
|
78
|
+
throw new Error('dsh-cli: mounted HostFacade lost Channel UI');
|
|
79
79
|
return local;
|
|
80
80
|
}
|
|
81
81
|
const next = ui();
|
|
@@ -122,7 +122,7 @@ export function mountChannelUi(ctx, channel, pluginHost, mode) {
|
|
|
122
122
|
failures.push(error);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
throwCleanupFailures(failures, 'dsh-
|
|
125
|
+
throwCleanupFailures(failures, 'dsh-cli: Channel UI cleanup failed');
|
|
126
126
|
},
|
|
127
127
|
};
|
|
128
128
|
}
|
|
@@ -169,11 +169,11 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
169
169
|
// built-in local commands exist.
|
|
170
170
|
const commandService = ctx.get('commands');
|
|
171
171
|
// messages.observe broker (optional service, C-042): mounted by the
|
|
172
|
-
// dsh-
|
|
172
|
+
// dsh-cli-plugin-host row; absent the row, publish is a no-op and nothing
|
|
173
173
|
// else changes (soft degradation, #183).
|
|
174
174
|
const messageObserver = getHostMessageObserver(ctx.get('tuiMessageObserver'));
|
|
175
175
|
// Workspace registry runtime (optional service, issue #183): mounted by
|
|
176
|
-
// the bundle patch's dsh-
|
|
176
|
+
// the bundle patch's dsh-cli-workspaces row; absent the row (stale patch
|
|
177
177
|
// or a bare embedder), degrade to the local-only runtime. plugin.ts owns
|
|
178
178
|
// the degraded-boot warning for profile launches.
|
|
179
179
|
const workspaceService = getHostWorkspaceRuntime(ctx.get('tuiWorkspaces')) ?? createLocalWorkspaceRuntime();
|
|
@@ -185,13 +185,13 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
185
185
|
// so compute once and cache.
|
|
186
186
|
// Plugin scene runtime (optional service, same degradation rule as
|
|
187
187
|
// tuiWorkspaces/tuiCommandTrees): mounted by the bundle patch's
|
|
188
|
-
// dsh-
|
|
188
|
+
// dsh-cli-scenes row; absent the row, `pluginScene` simply stays undefined.
|
|
189
189
|
const sceneRuntime = getHostSceneRuntime(ctx.get('tuiScenes'));
|
|
190
190
|
// Falls back to the in-package local host when the composition's service
|
|
191
191
|
// row is unavailable (issue #557: the row can be disposed right after
|
|
192
192
|
// load in real compositions); the TUI's own section registers there.
|
|
193
193
|
const settingsSectionsRuntime = getHostSettingsSections(ctx.get('tuiSettingsSections')) ?? getLocalSettingsSectionsHost(ctx);
|
|
194
|
-
// Custom-entry text renderers (optional service, dsh-
|
|
194
|
+
// Custom-entry text renderers (optional service, dsh-cli-extensions row):
|
|
195
195
|
// absent the row, unknown plugin event types stay invisible in the
|
|
196
196
|
// transcript, exactly as before the seam existed.
|
|
197
197
|
const rendererRuntime = getHostRenderers(ctx.get('tuiRenderers'));
|
|
@@ -210,7 +210,7 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
210
210
|
? filteredConfiguredSessionModes
|
|
211
211
|
: DEFAULT_SESSION_MODES;
|
|
212
212
|
if (droppedModeIds.length > 0) {
|
|
213
|
-
ctx.logger.warn(`dsh-
|
|
213
|
+
ctx.logger.warn(`dsh-cli: session modes ${droppedModeIds.map(id => `"${id}"`).join(', ')} declare no plan/sandbox/approval/permission atom; dropped from the Shift+Tab cycle`);
|
|
214
214
|
}
|
|
215
215
|
// Runtime permission roster: third-party presets enter the Shift+Tab cycle
|
|
216
216
|
// after the configured/default modes, rebuilt from the live service snapshot.
|
|
@@ -313,13 +313,13 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
313
313
|
const notifySessionSwitched = (kind, sessionId, previousSessionId) => {
|
|
314
314
|
try {
|
|
315
315
|
void dispatchTuiNotification(ctx, 'tui/session-switched', { kind, sessionId, previousSessionId, cwd: state.cwd }).catch((error) => {
|
|
316
|
-
ctx.logger.warn('dsh-
|
|
316
|
+
ctx.logger.warn('dsh-cli: tui/session-switched listener failed: %o', error);
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
319
|
catch (error) {
|
|
320
320
|
// A bare embedder's context may lack the event bus entirely; the
|
|
321
321
|
// switch itself already succeeded, so this stays a log line.
|
|
322
|
-
ctx.logger.warn('dsh-
|
|
322
|
+
ctx.logger.warn('dsh-cli: tui/session-switched dispatch failed: %o', error);
|
|
323
323
|
}
|
|
324
324
|
};
|
|
325
325
|
/**
|
|
@@ -400,7 +400,7 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
400
400
|
const settings = ctx.get('settings');
|
|
401
401
|
if (settings === undefined)
|
|
402
402
|
return false;
|
|
403
|
-
const ns = settings.describe({ redactSecrets: true }).find(entry => entry.ns === 'dsh-
|
|
403
|
+
const ns = settings.describe({ redactSecrets: true }).find(entry => entry.ns === 'dsh-cli');
|
|
404
404
|
return ns?.value?.recapOnOpen !== false;
|
|
405
405
|
},
|
|
406
406
|
...createInitialChannelView(options, {
|
|
@@ -954,7 +954,7 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
954
954
|
// The context owns the complete Channel lifetime, not merely the skill
|
|
955
955
|
// command contribution. Keep emitter teardown in the same finally funnel.
|
|
956
956
|
state.releaseContributions();
|
|
957
|
-
}, 'dsh-
|
|
957
|
+
}, 'dsh-cli channel lifecycle');
|
|
958
958
|
// Statusline breadcrumb: current git branch of the session cwd (best-effort).
|
|
959
959
|
// Re-run when an agent swap adopts a different persisted cwd (/resume,
|
|
960
960
|
// issue #96) so the breadcrumb never shows the previous workspace's branch.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-registration.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/cli-registration.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE;QAAE,IAAI,IAAI,MAAM,CAAC;QAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CACjE;AAqFD,gGAAgG;AAChG,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,sBAA2B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"cli-registration.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/cli-registration.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE;QAAE,IAAI,IAAI,MAAM,CAAC;QAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CACjE;AAqFD,gGAAgG;AAChG,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,sBAA2B,GAAG,MAAM,CAiFhF"}
|
|
@@ -107,7 +107,7 @@ export function ensureCliRegistered(options = {}) {
|
|
|
107
107
|
const shell = options.shell ?? process.env.SHELL ?? '';
|
|
108
108
|
const pathValue = options.path ?? process.env.PATH ?? '';
|
|
109
109
|
const sourceRoot = harnessSourceRoot(options.cliEntry ?? process.argv[1])
|
|
110
|
-
?? configuredHarnessRoot(options.dshRoot ?? process.env.
|
|
110
|
+
?? configuredHarnessRoot(options.dshRoot ?? process.env.DSH_CLI_DSH_ROOT);
|
|
111
111
|
const binDir = platform === 'win32'
|
|
112
112
|
? join(options.localAppData ?? process.env.LOCALAPPDATA ?? join(home, 'AppData', 'Local'), 'dsh-cli', 'bin')
|
|
113
113
|
: join(home, '.local', 'bin');
|
|
@@ -122,6 +122,7 @@ export function ensureCliRegistered(options = {}) {
|
|
|
122
122
|
throw new Error(`dsh-cli profile package is missing or unreadable at ${profilePackage}`);
|
|
123
123
|
}
|
|
124
124
|
const currentCommand = pathValue.split(platform === 'win32' ? ';' : ':')
|
|
125
|
+
.filter(dir => dir.length > 0)
|
|
125
126
|
.map(dir => join(dir, platform === 'win32' ? 'dsh-cli.cmd' : 'dsh-cli'))
|
|
126
127
|
.find(candidate => candidate !== command && pathExists(candidate) && !candidate.includes(`${join('node_modules', '.bin')}`));
|
|
127
128
|
if (currentCommand !== undefined)
|
|
@@ -142,7 +143,7 @@ export function ensureCliRegistered(options = {}) {
|
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
try {
|
|
145
|
-
const target = join('profiles', 'dsh-cli', 'node_modules', '@askdkc', 'dsh-cli', 'bin', 'dsh-
|
|
146
|
+
const target = join('profiles', 'dsh-cli', 'node_modules', '@askdkc', 'dsh-cli', 'bin', 'dsh-cli.js');
|
|
146
147
|
const content = platform === 'win32'
|
|
147
148
|
? `@echo off\r\nrem dsh-cli managed launcher\r\nsetlocal DisableDelayedExpansion\r\nif not defined DSH_HOME set "DSH_HOME=${dshHome.replace(/%/g, '%%')}"\r\nnode "%DSH_HOME%\\${target.replace(/\//g, '\\')}" %*\r\nexit /b %ERRORLEVEL%\r\n`
|
|
148
149
|
: `#!/bin/sh\n${marker}\nDEFAULT_DSH_HOME=${quoted(dshHome)}\n: "\${DSH_HOME:=$DEFAULT_DSH_HOME}"\nexport DSH_HOME\nexec node "$DSH_HOME/${target}" "$@"\n`;
|
|
@@ -174,8 +175,8 @@ export function ensureCliRegistered(options = {}) {
|
|
|
174
175
|
? `contains -- ${quoted(binDir)} $PATH; or set -gx PATH ${quoted(binDir)} $PATH`
|
|
175
176
|
: `case ":$PATH:" in *:${quoted(binDir)}:*) ;; *) export PATH=${quoted(binDir)}:"$PATH" ;; esac`;
|
|
176
177
|
const sourceLine = sourceRoot === undefined ? '' : basename(shell) === 'fish'
|
|
177
|
-
? `\nset -q
|
|
178
|
-
: `\nif [ -z "\${
|
|
178
|
+
? `\nset -q DSH_CLI_DSH_ROOT; or set -gx DSH_CLI_DSH_ROOT ${quoted(sourceRoot)}`
|
|
179
|
+
: `\nif [ -z "\${DSH_CLI_DSH_ROOT:-}" ]; then export DSH_CLI_DSH_ROOT=${quoted(sourceRoot)}; fi`;
|
|
179
180
|
const line = pathLine + sourceLine;
|
|
180
181
|
for (const file of files)
|
|
181
182
|
updateShellFile(file, line);
|
|
@@ -21,7 +21,7 @@ declare module '@deepseek-ai/cordis' {
|
|
|
21
21
|
tuiCommandTrees: TuiCommandTreeRuntime;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
export declare const name = "dsh-
|
|
24
|
+
export declare const name = "dsh-cli-command-trees";
|
|
25
25
|
/** Small host-only registry; command execution remains owned by dsh-commands. */
|
|
26
26
|
export declare class TuiCommandTreeRuntime extends Service {
|
|
27
27
|
constructor(ctx: Context);
|
|
@@ -3,7 +3,7 @@ import { Service } from '@deepseek-ai/cordis';
|
|
|
3
3
|
import { activationFiber, bindCallerEffect, compositionRoot, concreteService, requirePluginCaller } from './host-access.js';
|
|
4
4
|
import { adapterRuntimeFor } from '../adapter/kernel/runtime-context.js';
|
|
5
5
|
import { assertCapabilityShadowPolicy, } from '../adapter/kernel/runtime.js';
|
|
6
|
-
export const name = 'dsh-
|
|
6
|
+
export const name = 'dsh-cli-command-trees';
|
|
7
7
|
/** Small host-only registry; command execution remains owned by dsh-commands. */
|
|
8
8
|
export class TuiCommandTreeRuntime extends Service {
|
|
9
9
|
constructor(ctx) {
|
|
@@ -37,7 +37,7 @@ export class TuiCommandTreeRuntime extends Service {
|
|
|
37
37
|
const state = commandTreeStateFor(this);
|
|
38
38
|
const owner = activationFiber(caller);
|
|
39
39
|
if (owner === undefined)
|
|
40
|
-
throw new Error('dsh-
|
|
40
|
+
throw new Error('dsh-cli: tuiCommandTrees.register requires a live activation');
|
|
41
41
|
const root = provider.root.trim().toLowerCase();
|
|
42
42
|
if (!/^[a-z][a-z0-9_-]*$/u.test(root))
|
|
43
43
|
throw new TypeError(`invalid TUI command-tree root: ${provider.root}`);
|
|
@@ -3,11 +3,11 @@ import type { SessionEvent } from '@deepseek-ai/dsh-session';
|
|
|
3
3
|
export declare const TUI_SESSION_EVENT_TYPES: readonly string[];
|
|
4
4
|
/**
|
|
5
5
|
* Session-log storage roots, in priority order, mirroring the persistence
|
|
6
|
-
* backend's `root` resolution: cordis.patch.yml sets `
|
|
6
|
+
* backend's `root` resolution: cordis.patch.yml sets `DSH_CLI_SESSION_ROOT ?? dshHomePath(
|
|
7
7
|
* 'sessions')` where dshHomePath is `$DSH_HOME ?? ~/.dsh`; the unpatched
|
|
8
|
-
* cordis.yml base falls back to ~/.dsh-
|
|
8
|
+
* cordis.yml base falls back to ~/.dsh-cli/sessions, kept here as the legacy
|
|
9
9
|
* last resort. Every candidate is scanned — the first hit wins, so an
|
|
10
|
-
* explicit
|
|
10
|
+
* explicit DSH_CLI_SESSION_ROOT always outranks the defaults.
|
|
11
11
|
*/
|
|
12
12
|
export declare function sessionsRoots(): string[];
|
|
13
13
|
/**
|
|
@@ -15,21 +15,21 @@ export const TUI_SESSION_EVENT_TYPES = ['session/color'];
|
|
|
15
15
|
const ZSTD_MAGIC = 0xfd2fb528;
|
|
16
16
|
/**
|
|
17
17
|
* Session-log storage roots, in priority order, mirroring the persistence
|
|
18
|
-
* backend's `root` resolution: cordis.patch.yml sets `
|
|
18
|
+
* backend's `root` resolution: cordis.patch.yml sets `DSH_CLI_SESSION_ROOT ?? dshHomePath(
|
|
19
19
|
* 'sessions')` where dshHomePath is `$DSH_HOME ?? ~/.dsh`; the unpatched
|
|
20
|
-
* cordis.yml base falls back to ~/.dsh-
|
|
20
|
+
* cordis.yml base falls back to ~/.dsh-cli/sessions, kept here as the legacy
|
|
21
21
|
* last resort. Every candidate is scanned — the first hit wins, so an
|
|
22
|
-
* explicit
|
|
22
|
+
* explicit DSH_CLI_SESSION_ROOT always outranks the defaults.
|
|
23
23
|
*/
|
|
24
24
|
export function sessionsRoots() {
|
|
25
25
|
const home = homeDir();
|
|
26
26
|
const roots = [];
|
|
27
|
-
const override = process.env.
|
|
27
|
+
const override = process.env.DSH_CLI_SESSION_ROOT;
|
|
28
28
|
if (override !== undefined && override.trim().length > 0)
|
|
29
29
|
roots.push(override);
|
|
30
30
|
const dshHome = process.env.DSH_HOME;
|
|
31
31
|
roots.push(join(dshHome !== undefined && dshHome.trim().length > 0 ? dshHome : join(home, '.dsh'), 'sessions'));
|
|
32
|
-
roots.push(join(home, '.dsh-
|
|
32
|
+
roots.push(join(home, '.dsh-cli', 'sessions'));
|
|
33
33
|
return [...new Set(roots)];
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/compat/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/compat/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAA;AAIlD,4EAA4E;AAC5E,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE;CAAE,CAAA;AAEzE,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAY5G;AAED,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAQ3F;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAO1E;AAED,UAAU,aAAa,CAAC,CAAC;IACvB,GAAG,IAAI,CAAC,CAAA;IACR,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAA;CAC/C;AAED,gEAAgE;AAChE,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAKvF;AAED,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,QAAQ,EAAE;IACtC,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"}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
+
const VOLATILE_REQUIRED = 'dsh-cli: profile-backed settings require Schemastery volatile Config support. Update DSH and reinstall the current profile dependencies before starting the TUI.';
|
|
1
2
|
/** Declare only UI preferences as live fields, never the agent/session route. */
|
|
2
3
|
export function editableConfig(schema, keys) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (
|
|
6
|
-
|
|
4
|
+
const fields = keys.map(String).filter(key => schema.dict?.[key] !== undefined);
|
|
5
|
+
for (const key of fields) {
|
|
6
|
+
if (typeof schema.dict[key]?.volatile !== 'function')
|
|
7
|
+
throw new Error(VOLATILE_REQUIRED);
|
|
7
8
|
}
|
|
9
|
+
// Stage conversions so a later rejection cannot partially rewrite Config.
|
|
10
|
+
const replacements = new Map();
|
|
11
|
+
for (const key of fields) {
|
|
12
|
+
replacements.set(key, (replacements.get(key) ?? schema.dict[key]).volatile());
|
|
13
|
+
}
|
|
14
|
+
for (const [key, field] of replacements)
|
|
15
|
+
schema.dict[key] = field;
|
|
8
16
|
return schema;
|
|
9
17
|
}
|
|
10
18
|
/** Settings forms use the Config owner's Loader ID, not the plugin name. */
|
|
11
19
|
export function resolveSettingsNamespace(ctx, schema) {
|
|
12
20
|
if (!Object.values(schema.dict ?? {}).some(field => field.meta.volatile === true)) {
|
|
13
|
-
throw new Error(
|
|
21
|
+
throw new Error(VOLATILE_REQUIRED);
|
|
14
22
|
}
|
|
15
23
|
const owner = ctx.fiber;
|
|
16
|
-
const ns = owner
|
|
24
|
+
const ns = owner?.entry?.options?.id;
|
|
17
25
|
if (!ns)
|
|
18
|
-
throw new Error('dsh-
|
|
26
|
+
throw new Error('dsh-cli: profile-backed settings require a Loader entry for the Config owner.');
|
|
19
27
|
return ns;
|
|
20
28
|
}
|
|
21
29
|
/** Snapshot at an operation boundary; retain the host refs for later updates. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Frameworks have independent, breaking major versions. */
|
|
2
2
|
export declare const UPSTREAM_FRAMEWORK_MAJORS: Record<string, number>;
|
|
3
3
|
/** Official packages the adapter consumes at runtime or as types. */
|
|
4
|
-
export declare const UPSTREAM_BLESSED_PACKAGES: readonly ["@deepseek-ai/cordis", "@deepseek-ai/schemastery", "@deepseek-ai/dsh-
|
|
4
|
+
export declare const UPSTREAM_BLESSED_PACKAGES: readonly ["@deepseek-ai/cordis", "@deepseek-ai/schemastery", "@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-preset-registry", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-ptc-runtime-node", "@deepseek-ai/dsh-commands", "@deepseek-ai/dsh-cordis-host-runner", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-pi-ai", "@deepseek-ai/dsh-persona", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-storage", "@deepseek-ai/dsh-storage-domain", "@deepseek-ai/dsh-storage-json", "@deepseek-ai/dsh-workspace", "@deepseek-ai/dsh-web-app", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-terminal", "@deepseek-ai/dsh-terminal-bash", "@deepseek-ai/dsh-tool-ask-user", "@deepseek-ai/dsh-tool-bash-persistent", "@deepseek-ai/dsh-tool-cordis", "@deepseek-ai/dsh-tool-subagent", "@deepseek-ai/dsh-user-approval", "@deepseek-ai/dsh-user-questions"];
|
|
5
5
|
export declare function installedUpstreamVersions(): Record<string, string | undefined>;
|
|
6
6
|
export interface UpstreamDependencyIssue {
|
|
7
7
|
package: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/contract.ts"],"names":[],"mappings":"AAIA,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAG5D,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/contract.ts"],"names":[],"mappings":"AAIA,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAG5D,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,yBAAyB,q6BA8B5B,CAAA;AAYV,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAqB9E;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAA;CACf;AAED,mFAAmF;AACnF,wBAAgB,wBAAwB,CACtC,iBAAiB,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAA+B,GAC5F,uBAAuB,EAAE,CAY3B"}
|
|
@@ -10,7 +10,6 @@ export const UPSTREAM_FRAMEWORK_MAJORS = {
|
|
|
10
10
|
export const UPSTREAM_BLESSED_PACKAGES = [
|
|
11
11
|
'@deepseek-ai/cordis',
|
|
12
12
|
'@deepseek-ai/schemastery',
|
|
13
|
-
'@deepseek-ai/dsh-invariants',
|
|
14
13
|
'@deepseek-ai/dsh-agent',
|
|
15
14
|
'@deepseek-ai/dsh-agent-instructions',
|
|
16
15
|
'@deepseek-ai/dsh-agent-preset-registry',
|
|
@@ -38,13 +38,13 @@ import { type AdapterRuntimeOptions } from '../adapter/kernel/runtime.js';
|
|
|
38
38
|
export { DECISION_EVENT_PERMISSIONS };
|
|
39
39
|
export { EXTENSION_GRANTS_FILE };
|
|
40
40
|
/** @deprecated Use GrantStore from `../adapter/standard/grants.js` (same shape, plus more).
|
|
41
|
-
* Long-term compatibility alias; owner: dsh-
|
|
41
|
+
* Long-term compatibility alias; owner: dsh-cli adapter. */
|
|
42
42
|
export type ExtensionGrants = GrantStore;
|
|
43
43
|
/** @deprecated Use parseGrantStore from `../adapter/standard/grants.js`.
|
|
44
|
-
* Long-term compatibility alias; owner: dsh-
|
|
44
|
+
* Long-term compatibility alias; owner: dsh-cli adapter. */
|
|
45
45
|
export declare const parseExtensionGrants: (text: string) => GrantStore;
|
|
46
46
|
/** @deprecated Use readGrantStore from `../adapter/standard/grants.js`.
|
|
47
|
-
* Long-term compatibility alias; owner: dsh-
|
|
47
|
+
* Long-term compatibility alias; owner: dsh-cli adapter. */
|
|
48
48
|
export declare const readExtensionGrants: (dir?: string) => GrantStore;
|
|
49
49
|
export interface DecisionHandlerMetadata {
|
|
50
50
|
componentId: string;
|
|
@@ -43,13 +43,13 @@ export { DECISION_EVENT_PERMISSIONS };
|
|
|
43
43
|
// These aliases are intentionally outside the P6 removal scope: they are a
|
|
44
44
|
// long-term compatibility surface for existing embedder/test code. They map
|
|
45
45
|
// directly to the canonical `../adapter/standard/grants.js` implementation.
|
|
46
|
-
// OWNER: dsh-
|
|
46
|
+
// OWNER: dsh-cli adapter. UNTIL: no scheduled removal.
|
|
47
47
|
export { EXTENSION_GRANTS_FILE };
|
|
48
48
|
/** @deprecated Use parseGrantStore from `../adapter/standard/grants.js`.
|
|
49
|
-
* Long-term compatibility alias; owner: dsh-
|
|
49
|
+
* Long-term compatibility alias; owner: dsh-cli adapter. */
|
|
50
50
|
export const parseExtensionGrants = parseGrantStore;
|
|
51
51
|
/** @deprecated Use readGrantStore from `../adapter/standard/grants.js`.
|
|
52
|
-
* Long-term compatibility alias; owner: dsh-
|
|
52
|
+
* Long-term compatibility alias; owner: dsh-cli adapter. */
|
|
53
53
|
export const readExtensionGrants = readGrantStore;
|
|
54
54
|
/**
|
|
55
55
|
* Install the D-7 gate: every subscription to a decision event is checked
|
|
@@ -205,7 +205,7 @@ export function registerDecisionHandler(pluginCtx, identity, event, listener, op
|
|
|
205
205
|
const currentlyGranted = permission === undefined || registry.grants.allows(principal, permission, scope);
|
|
206
206
|
if (!currentlyGranted) {
|
|
207
207
|
try {
|
|
208
|
-
pluginCtx.logger.warn(`dsh-
|
|
208
|
+
pluginCtx.logger.warn(`dsh-cli: ${event} registration denied for Component "${identity.componentId}" — grant ${permission}@${scope} is missing`);
|
|
209
209
|
}
|
|
210
210
|
catch { /* best effort */ }
|
|
211
211
|
return () => false;
|
|
@@ -443,7 +443,7 @@ export function installDecisionGuard(ctx, grants) {
|
|
|
443
443
|
}
|
|
444
444
|
catch (error) {
|
|
445
445
|
try {
|
|
446
|
-
this.logger.warn(`dsh-
|
|
446
|
+
this.logger.warn(`dsh-cli: ${name} subscription from Component "${identity.componentId}" denied — ` +
|
|
447
447
|
`${error instanceof Error ? error.message : String(error)}`);
|
|
448
448
|
}
|
|
449
449
|
catch { /* best effort */ }
|
|
@@ -451,7 +451,7 @@ export function installDecisionGuard(ctx, grants) {
|
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
const requiredGrant = permission === undefined ? '' : `; required grant ${permission}`;
|
|
454
|
-
ctx.logger.warn(`dsh-
|
|
454
|
+
ctx.logger.warn(`dsh-cli: ${name} direct subscription from Component "${pluginName}" denied${requiredGrant} — ` +
|
|
455
455
|
'use the mediated DecisionEvents activation surface; the listener was NOT registered');
|
|
456
456
|
// Truthy bail result: cordis skips the registration and hands this back
|
|
457
457
|
// as the caller's disposer — a no-op keeps the ctx.on contract intact.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Managed plugin dialogs — the pi `ctx.ui.select/confirm/input` seam for
|
|
3
|
-
* dsh-
|
|
3
|
+
* dsh-CLI. Plugins hand the HOST a declarative request; the TUI renders the
|
|
4
4
|
* dialog in its own chrome (next to the approval panel), owns the keyboard,
|
|
5
5
|
* and settles the plugin's promise with the user's answer. Plugins never
|
|
6
6
|
* touch the TTY themselves.
|