@askdkc/dsh-cli 0.13.4 → 0.14.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/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/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 +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/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/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/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/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 -8
- package/presets/liangshen/agent.cordis.yml +1 -1
- package/presets/liangshen/custom-bash.mjs +2 -2
|
@@ -10,7 +10,7 @@ const STATUS_CONFIG = {
|
|
|
10
10
|
loading: { icon: '…', color: undefined },
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* A status indicator icon with the dsh-
|
|
13
|
+
* A status indicator icon with the dsh-CLI color mapping: ✓ green / ✗ red /
|
|
14
14
|
* ⚠ amber / ℹ blue /
|
|
15
15
|
* ○ dim / … dim.
|
|
16
16
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TuiThemeHost } from '../../dsh-adapter/themes.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* DSH_CLI_THEME skips terminal detection (tests, debugging). Accepts a
|
|
5
5
|
* built-in, static JSON, or runtime plugin theme name; invalid
|
|
6
6
|
* values are warned and ignored by the caller, falling back to detection.
|
|
7
7
|
* Exported for /reload, which must respect the env override's precedence.
|
|
@@ -12,11 +12,11 @@ import { parseOscColor } from '../../ink/termio/osc.js';
|
|
|
12
12
|
import { logForDebugging } from '../../utils/debug.js';
|
|
13
13
|
/**
|
|
14
14
|
* Theme provider with terminal-background auto-detection. With no explicit
|
|
15
|
-
* `theme` prop, no
|
|
16
|
-
* (~/.dsh-
|
|
15
|
+
* `theme` prop, no DSH_CLI_THEME override and no persisted choice
|
|
16
|
+
* (~/.dsh-cli/theme.json), it queries the terminal's background color
|
|
17
17
|
* (OSC 11) before first paint and picks the Gentle Mist Blue `light` palette
|
|
18
18
|
* on light backgrounds, `dark` otherwise. Priority: explicit `theme` prop >
|
|
19
|
-
*
|
|
19
|
+
* DSH_CLI_THEME (built-in, static, or runtime plugin name) > persisted `/theme`
|
|
20
20
|
* choice > OSC 11 detection. An invalid forced name is warned and skipped, so
|
|
21
21
|
* detection still runs. Children render only after the theme settles, so
|
|
22
22
|
* the first frame already carries the final palette — no dark→light flash.
|
|
@@ -25,7 +25,7 @@ import { logForDebugging } from '../../utils/debug.js';
|
|
|
25
25
|
* setActiveThemeName() for non-React rendering (markdown inline code).
|
|
26
26
|
*
|
|
27
27
|
* The `auto` pseudo-theme turns that one-shot startup detection into a
|
|
28
|
-
* standing choice: `auto` is valid everywhere a theme name is (
|
|
28
|
+
* standing choice: `auto` is valid everywhere a theme name is (DSH_CLI_THEME,
|
|
29
29
|
* theme.json, /theme), defers first paint until detection settles like the
|
|
30
30
|
* unforced path, and re-queries OSC 11 on every runtime switch to `auto` —
|
|
31
31
|
* the detected base (light/dark) is mirrored via setAutoThemeBase() so
|
|
@@ -34,11 +34,11 @@ import { logForDebugging } from '../../utils/debug.js';
|
|
|
34
34
|
* system light/dark mode.
|
|
35
35
|
*
|
|
36
36
|
* The context also exposes setTheme() for the runtime `/theme` picker: it
|
|
37
|
-
* validates static or plugin names, persists the choice to ~/.dsh-
|
|
37
|
+
* validates static or plugin names, persists the choice to ~/.dsh-cli/theme.json
|
|
38
38
|
* and hot swaps the palette (and the module-level mirror) immediately. A
|
|
39
39
|
* disappearing plugin theme falls back safely without erasing the request.
|
|
40
40
|
*/
|
|
41
|
-
// Static user themes (~/.dsh-
|
|
41
|
+
// Static user themes (~/.dsh-cli/themes/<name>.json) resolve through this
|
|
42
42
|
// registry; the optional runtime host resolver is installed by the Cordis
|
|
43
43
|
// service. Together they serve every themed component and non-React rendering.
|
|
44
44
|
registerCustomThemeResolver(resolveCustomTheme);
|
|
@@ -48,13 +48,13 @@ const ThemeContext = createContext({
|
|
|
48
48
|
setTheme: () => false,
|
|
49
49
|
});
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* DSH_CLI_THEME skips terminal detection (tests, debugging). Accepts a
|
|
52
52
|
* built-in, static JSON, or runtime plugin theme name; invalid
|
|
53
53
|
* values are warned and ignored by the caller, falling back to detection.
|
|
54
54
|
* Exported for /reload, which must respect the env override's precedence.
|
|
55
55
|
*/
|
|
56
56
|
export function envThemeOverride() {
|
|
57
|
-
const v = process.env.
|
|
57
|
+
const v = process.env.DSH_CLI_THEME;
|
|
58
58
|
return v === undefined || v === '' ? undefined : v;
|
|
59
59
|
}
|
|
60
60
|
/** Detection round-trip is normally ~10ms locally; this only bounds pathological stalls. */
|
|
@@ -77,7 +77,7 @@ export function ThemeProvider({ children, theme, themeHost, }) {
|
|
|
77
77
|
return false;
|
|
78
78
|
if (isThemeAvailable(forced))
|
|
79
79
|
return true;
|
|
80
|
-
console.warn(`[dsh-
|
|
80
|
+
console.warn(`[dsh-cli] theme "${forced}" not found (built-ins: auto, light, dark, dark-ansi; static ~/.dsh-cli/themes/*.json; runtime plugin themes); falling back to auto-detection`);
|
|
81
81
|
return false;
|
|
82
82
|
});
|
|
83
83
|
// `auto` (like the unforced path) stays null until detection settles, so
|
|
@@ -188,11 +188,11 @@ export function ThemeProvider({ children, theme, themeHost, }) {
|
|
|
188
188
|
*/
|
|
189
189
|
const setTheme = React.useCallback((name) => {
|
|
190
190
|
if (!isThemeAvailable(name)) {
|
|
191
|
-
console.warn(`[dsh-
|
|
191
|
+
console.warn(`[dsh-cli] theme "${name}" not found`);
|
|
192
192
|
return false;
|
|
193
193
|
}
|
|
194
194
|
if (!writeThemePref(name)) {
|
|
195
|
-
console.warn('[dsh-
|
|
195
|
+
console.warn('[dsh-cli] failed to write ~/.dsh-cli/theme.json');
|
|
196
196
|
return false;
|
|
197
197
|
}
|
|
198
198
|
requestedThemeRef.current = name;
|
|
@@ -53,7 +53,7 @@ export type Props = BaseStylesWithoutColors & ThemedColorProps & {
|
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
55
|
* Theme-aware Box component that resolves theme color keys to raw colors
|
|
56
|
-
* in the dsh-
|
|
56
|
+
* in the dsh-CLI visual language.
|
|
57
57
|
*/
|
|
58
58
|
declare function ThemedBox({ borderColor, borderTopColor, borderBottomColor, borderLeftColor, borderRightColor, backgroundColor, occlusionColor, ...rest }: PropsWithChildren<Props>): React.ReactNode;
|
|
59
59
|
export default ThemedBox;
|
|
@@ -19,7 +19,7 @@ function resolveColor(color, theme) {
|
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Theme-aware Box component that resolves theme color keys to raw colors
|
|
22
|
-
* in the dsh-
|
|
22
|
+
* in the dsh-CLI visual language.
|
|
23
23
|
*/
|
|
24
24
|
function ThemedBox({ borderColor, borderTopColor, borderBottomColor, borderLeftColor, borderRightColor, backgroundColor, occlusionColor, ...rest }) {
|
|
25
25
|
const [themeName] = useTheme();
|
|
@@ -54,7 +54,7 @@ export type Props = {
|
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
56
|
* Theme-aware Text component that resolves theme color keys to raw colors
|
|
57
|
-
* in the dsh-
|
|
57
|
+
* in the dsh-CLI visual language). This lets components use
|
|
58
58
|
* `color="subtle"`-style theme keys consistently.
|
|
59
59
|
*/
|
|
60
60
|
export default function ThemedText({ color, backgroundColor, dimColor, bold, italic, underline, strikethrough, inverse, wrap, ref, children, }: Props): React.ReactNode;
|
|
@@ -24,7 +24,7 @@ function resolveColor(color, theme) {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Theme-aware Text component that resolves theme color keys to raw colors
|
|
27
|
-
* in the dsh-
|
|
27
|
+
* in the dsh-CLI visual language). This lets components use
|
|
28
28
|
* `color="subtle"`-style theme keys consistently.
|
|
29
29
|
*/
|
|
30
30
|
export default function ThemedText({ color, backgroundColor, dimColor = false, bold = false, italic = false, underline = false, strikethrough = false, inverse = false, wrap = 'wrap', ref, children, }) {
|
|
@@ -32,7 +32,7 @@ type Props = {
|
|
|
32
32
|
* text on click. The live leading mark is a rotating braille spinner
|
|
33
33
|
* (`⠋⠙⠹…`, Kimi Code style), settling back to the static anchor (`⚓`). When
|
|
34
34
|
* the channel records the reasoning duration, the label carries it
|
|
35
|
-
* (`⚓ Thinking · 12s …`) — dsh-
|
|
35
|
+
* (`⚓ Thinking · 12s …`) — dsh-cli's take on making thinking time visible in
|
|
36
36
|
* the transcript.
|
|
37
37
|
*/
|
|
38
38
|
export declare function AssistantThinkingMessage({ thinking, textFull, marginTopOnTurn, verbose, streaming, preview, durationMs, isSelected, onClick, }: Props): React.ReactNode;
|
|
@@ -23,7 +23,7 @@ const PREVIEW_ROWS = 3;
|
|
|
23
23
|
* text on click. The live leading mark is a rotating braille spinner
|
|
24
24
|
* (`⠋⠙⠹…`, Kimi Code style), settling back to the static anchor (`⚓`). When
|
|
25
25
|
* the channel records the reasoning duration, the label carries it
|
|
26
|
-
* (`⚓ Thinking · 12s …`) — dsh-
|
|
26
|
+
* (`⚓ Thinking · 12s …`) — dsh-cli's take on making thinking time visible in
|
|
27
27
|
* the transcript.
|
|
28
28
|
*/
|
|
29
29
|
export function AssistantThinkingMessage({ thinking, textFull, marginTopOnTurn, verbose, streaming = false, preview = false, durationMs, isSelected = false, onClick, }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ToolRow } from '../../dsh-adapter/channel.js';
|
|
3
|
-
import type { ToolBackground } from '../../
|
|
3
|
+
import type { ToolBackground } from '../../cliDisplayPrefs.js';
|
|
4
4
|
import type { Theme } from '../../theme.js';
|
|
5
5
|
import type { ClickEvent } from '../../ink/events/click-event.js';
|
|
6
6
|
type Props = {
|
|
@@ -40,13 +40,13 @@ type Props = {
|
|
|
40
40
|
*/
|
|
41
41
|
onOpenFile?: (path: string) => void;
|
|
42
42
|
/**
|
|
43
|
-
* Terminal-card header folding (settings `dsh-
|
|
43
|
+
* Terminal-card header folding (settings `dsh-cli.foldTerminalCommand`):
|
|
44
44
|
* collapsed cards keep the command title's first source line plus a
|
|
45
45
|
* `+N lines` hint; verbose/expanded cards render the full title.
|
|
46
46
|
*/
|
|
47
47
|
foldTerminalCommand?: boolean;
|
|
48
48
|
/**
|
|
49
|
-
* Smooth streaming reveal (settings `dsh-
|
|
49
|
+
* Smooth streaming reveal (settings `dsh-cli.smoothStreaming`): the card
|
|
50
50
|
* BODY (diff hunks / write content — model-authored prose, not tool
|
|
51
51
|
* output) paints through an even ~30fps line reveal when it first appears,
|
|
52
52
|
* instead of one jarring block. Only the pending CALL view animates; the
|
|
@@ -241,7 +241,7 @@ function clipHeaderArgs(args) {
|
|
|
241
241
|
* first line only.)
|
|
242
242
|
*
|
|
243
243
|
* Two independent folds:
|
|
244
|
-
* - `foldLines` (the `dsh-
|
|
244
|
+
* - `foldLines` (the `dsh-cli.foldTerminalCommand` setting): a multi-line
|
|
245
245
|
* script collapses to its first source line, reported as `+N lines`.
|
|
246
246
|
* - The long-line clip (always on — utils/fold-long-lines.ts): a command is
|
|
247
247
|
* frequently ONE enormous line (`python -c …`, a minified blob, a pasted
|
|
@@ -31,7 +31,7 @@ export async function exportOriginalImage(image, signal) {
|
|
|
31
31
|
throw new Error('Original image byte budget exceeded');
|
|
32
32
|
const extension = originalExtension(data);
|
|
33
33
|
const digest = createHash('sha256').update(data).digest('hex');
|
|
34
|
-
directory ??= mkdtemp(join(tmpdir(), 'dsh-
|
|
34
|
+
directory ??= mkdtemp(join(tmpdir(), 'dsh-cli-original-')).then(async (path) => {
|
|
35
35
|
await chmod(path, 0o700);
|
|
36
36
|
return path;
|
|
37
37
|
}).catch(error => { directory = undefined; throw error; });
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The questionnaire panel — ask-user-question UI for the
|
|
3
3
|
* DSH user-interaction seam. One question per panel (progress header, header
|
|
4
4
|
* chip, wrapped question text, optional detail, option list with focus
|
|
5
|
-
* pointer and multi-select checkmarks), styled in the dsh-
|
|
5
|
+
* pointer and multi-select checkmarks), styled in the dsh-cli mist-blue
|
|
6
6
|
* design language.
|
|
7
7
|
*
|
|
8
8
|
* The list's last row IS the free-text input (issue #9): no Tab, no mode
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
* The questionnaire panel — ask-user-question UI for the
|
|
4
4
|
* DSH user-interaction seam. One question per panel (progress header, header
|
|
5
5
|
* chip, wrapped question text, optional detail, option list with focus
|
|
6
|
-
* pointer and multi-select checkmarks), styled in the dsh-
|
|
6
|
+
* pointer and multi-select checkmarks), styled in the dsh-cli mist-blue
|
|
7
7
|
* design language.
|
|
8
8
|
*
|
|
9
9
|
* The list's last row IS the free-text input (issue #9): no Tab, no mode
|
|
@@ -13,7 +13,7 @@ export declare function getRevealVersion(): number;
|
|
|
13
13
|
/** Force-complete (and forget) a cursor: expanded card, replaced view, … */
|
|
14
14
|
export declare function snapReveal(key: string): void;
|
|
15
15
|
export type RevealReadOptions = {
|
|
16
|
-
/** Master switch (settings `dsh-
|
|
16
|
+
/** Master switch (settings `dsh-cli.smoothStreaming`); false = full text. */
|
|
17
17
|
enabled: boolean;
|
|
18
18
|
/**
|
|
19
19
|
* Whether this content arrived "just now" (live streaming row, freshly
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* roughly 1.5s; genuinely streaming text (small backlogs) paces at a steady
|
|
18
18
|
* per-frame rate. The reveal never runs ahead of what has arrived.
|
|
19
19
|
*
|
|
20
|
-
* ARCHITECTURE — module-level cursors, not component state. dsh-
|
|
20
|
+
* ARCHITECTURE — module-level cursors, not component state. dsh-cli's
|
|
21
21
|
* transcript virtualization feeds on MemoRow prop changes (flattened
|
|
22
22
|
* primitives) and re-measures mounted rows after every MessageList commit;
|
|
23
23
|
* a reveal living in child-component state would change row heights without
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* User-defined color themes for dsh-
|
|
2
|
+
* User-defined color themes for dsh-cli.
|
|
3
3
|
*
|
|
4
|
-
* A theme is a JSON file in `~/.dsh-
|
|
4
|
+
* A theme is a JSON file in `~/.dsh-cli/themes/<name>.json`:
|
|
5
5
|
*
|
|
6
6
|
* ```json
|
|
7
7
|
* { "name": "sakura", "displayName": "Sakura Pink", "base": "dark",
|
|
@@ -23,7 +23,7 @@ import { type Theme, type ThemeColorKey } from './theme.js';
|
|
|
23
23
|
/** The base palettes a user theme may overlay. */
|
|
24
24
|
export declare const THEME_BASE_NAMES: readonly ["light", "dark", "dark-ansi"];
|
|
25
25
|
export type ThemeBase = (typeof THEME_BASE_NAMES)[number];
|
|
26
|
-
/** The directory user theme files live in (~/.dsh-
|
|
26
|
+
/** The directory user theme files live in (~/.dsh-cli/themes). */
|
|
27
27
|
export declare const CUSTOM_THEME_DIR: string;
|
|
28
28
|
/** A validated user theme file. `colors` only carries accepted overrides. */
|
|
29
29
|
export type CustomThemeSpec = {
|
|
@@ -44,7 +44,7 @@ export declare function isThemeBase(value: unknown): value is ThemeBase;
|
|
|
44
44
|
export declare function isThemeKey(value: unknown): value is ThemeColorKey;
|
|
45
45
|
/**
|
|
46
46
|
* Whether a name is safe to use as a file name (no path separators or dot
|
|
47
|
-
* traversal). Theme names are user input from
|
|
47
|
+
* traversal). Theme names are user input from DSH_CLI_THEME and /theme, so
|
|
48
48
|
* they must never escape the themes directory.
|
|
49
49
|
*/
|
|
50
50
|
export declare function isSafeThemeName(name: string): boolean;
|
|
@@ -97,7 +97,7 @@ export declare function buildTheme(spec: CustomThemeSpec): Theme;
|
|
|
97
97
|
export declare function resolveCustomTheme(name: string): Theme | undefined;
|
|
98
98
|
/**
|
|
99
99
|
* Whether a name selects a usable theme: a built-in palette, the `auto`
|
|
100
|
-
* pseudo-theme, or a valid user theme file. Used for
|
|
100
|
+
* pseudo-theme, or a valid user theme file. Used for DSH_CLI_THEME /
|
|
101
101
|
* persisted-preference validation and the runtime /theme switch.
|
|
102
102
|
* @param name - Candidate theme name.
|
|
103
103
|
* @returns True when the theme resolves.
|
package/lib/types/customTheme.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* User-defined color themes for dsh-
|
|
2
|
+
* User-defined color themes for dsh-cli.
|
|
3
3
|
*
|
|
4
|
-
* A theme is a JSON file in `~/.dsh-
|
|
4
|
+
* A theme is a JSON file in `~/.dsh-cli/themes/<name>.json`:
|
|
5
5
|
*
|
|
6
6
|
* ```json
|
|
7
7
|
* { "name": "sakura", "displayName": "Sakura Pink", "base": "dark",
|
|
@@ -25,7 +25,7 @@ import { getTheme, AUTO_THEME_NAME, isThemeColorKey, normalizeThemeKey, isRetire
|
|
|
25
25
|
import { DATA_DIR } from './utils/paths.js';
|
|
26
26
|
/** The base palettes a user theme may overlay. */
|
|
27
27
|
export const THEME_BASE_NAMES = ['light', 'dark', 'dark-ansi'];
|
|
28
|
-
/** The directory user theme files live in (~/.dsh-
|
|
28
|
+
/** The directory user theme files live in (~/.dsh-cli/themes). */
|
|
29
29
|
export const CUSTOM_THEME_DIR = join(DATA_DIR, 'themes');
|
|
30
30
|
// #rgb / #rrggbb / #rrggbbaa
|
|
31
31
|
const HEX_RE = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
@@ -56,7 +56,7 @@ const ANSI_NAMES = new Set([
|
|
|
56
56
|
const cache = new Map();
|
|
57
57
|
/**
|
|
58
58
|
* `spec.name` → load key (file name), so a theme whose `name` field differs
|
|
59
|
-
* from its file name still resolves (
|
|
59
|
+
* from its file name still resolves (DSH_CLI_THEME, /theme, persistence all
|
|
60
60
|
* speak the display name). Filled lazily on the first name miss.
|
|
61
61
|
*/
|
|
62
62
|
const nameIndex = new Map();
|
|
@@ -71,7 +71,7 @@ export function isThemeKey(value) {
|
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* Whether a name is safe to use as a file name (no path separators or dot
|
|
74
|
-
* traversal). Theme names are user input from
|
|
74
|
+
* traversal). Theme names are user input from DSH_CLI_THEME and /theme, so
|
|
75
75
|
* they must never escape the themes directory.
|
|
76
76
|
*/
|
|
77
77
|
export function isSafeThemeName(name) {
|
|
@@ -103,7 +103,7 @@ export function isValidThemeColor(value) {
|
|
|
103
103
|
return ANSI_NAMES.has(value);
|
|
104
104
|
}
|
|
105
105
|
function warn(message) {
|
|
106
|
-
console.warn(`[dsh-
|
|
106
|
+
console.warn(`[dsh-cli] ${message}`);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Parse and validate a theme file's contents. Unknown keys and invalid
|
|
@@ -263,7 +263,7 @@ function indexCustomThemeNames() {
|
|
|
263
263
|
}
|
|
264
264
|
/**
|
|
265
265
|
* Whether a name selects a usable theme: a built-in palette, the `auto`
|
|
266
|
-
* pseudo-theme, or a valid user theme file. Used for
|
|
266
|
+
* pseudo-theme, or a valid user theme file. Used for DSH_CLI_THEME /
|
|
267
267
|
* persisted-preference validation and the runtime /theme switch.
|
|
268
268
|
* @param name - Candidate theme name.
|
|
269
269
|
* @returns True when the theme resolves.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* structural copy of the plugin's wire value, the same discipline the channel
|
|
21
21
|
* port already applies to the activity state: this app must not import the
|
|
22
22
|
* plugin's internals to display a line.
|
|
23
|
-
* @module dsh-
|
|
23
|
+
* @module dsh-cli/dsh-adapter/activity-store
|
|
24
24
|
*/
|
|
25
25
|
import type { Context } from '@deepseek-ai/cordis';
|
|
26
26
|
/** The projection key the activity plugin publishes. */
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* structural copy of the plugin's wire value, the same discipline the channel
|
|
21
21
|
* port already applies to the activity state: this app must not import the
|
|
22
22
|
* plugin's internals to display a line.
|
|
23
|
-
* @module dsh-
|
|
23
|
+
* @module dsh-cli/dsh-adapter/activity-store
|
|
24
24
|
*/
|
|
25
25
|
import React from 'react';
|
|
26
26
|
/** The projection key the activity plugin publishes. */
|
|
@@ -176,7 +176,7 @@ export class ActivityStore {
|
|
|
176
176
|
this.readFailures.set(sessionId, failures);
|
|
177
177
|
if (!this.warned.has(sessionId)) {
|
|
178
178
|
this.warned.add(sessionId);
|
|
179
|
-
this.warn?.(`dsh-
|
|
179
|
+
this.warn?.(`dsh-cli: working-activity projection read failed for session ${sessionId}: ${detail}`);
|
|
180
180
|
}
|
|
181
181
|
if (failures >= MAX_READ_FAILURES)
|
|
182
182
|
this.clear(sessionId);
|
|
@@ -296,7 +296,7 @@ export function attachActivityProjection(ctx, store) {
|
|
|
296
296
|
offStore();
|
|
297
297
|
stopTimer();
|
|
298
298
|
offFeed();
|
|
299
|
-
}, 'dsh-
|
|
299
|
+
}, 'dsh-cli activity projection feed');
|
|
300
300
|
}));
|
|
301
301
|
}
|
|
302
302
|
/**
|
|
@@ -18,14 +18,14 @@ function readPresetPatch(path) {
|
|
|
18
18
|
if (row.config.id === 'minimal') {
|
|
19
19
|
const persona = row.config.plugins.find((plugin) => plugin.id === 'persona');
|
|
20
20
|
if (persona?.config?.complete !== true || typeof persona.config.prefix !== 'string') {
|
|
21
|
-
throw new Error('dsh-
|
|
21
|
+
throw new Error('dsh-cli: bundled Minimal complete persona is missing');
|
|
22
22
|
}
|
|
23
23
|
persona.config.prefix += `\n\n${RESPONSE_LANGUAGE_POLICY}`;
|
|
24
24
|
}
|
|
25
25
|
return row.config;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
throw new Error(`dsh-
|
|
28
|
+
throw new Error(`dsh-cli: invalid upstream preset declaration: ${path}`);
|
|
29
29
|
}
|
|
30
30
|
/** Register shipped definitions with the current registry. Profile declarations
|
|
31
31
|
* own their seats even while activating; wait for a late registry through Cordis. */
|
|
@@ -74,12 +74,12 @@ export function createChannelActionReadiness() {
|
|
|
74
74
|
return {
|
|
75
75
|
install(next) {
|
|
76
76
|
if (delegates !== undefined)
|
|
77
|
-
throw new Error('dsh-
|
|
77
|
+
throw new Error('dsh-cli: Channel actions are already installed');
|
|
78
78
|
delegates = Object.freeze(next);
|
|
79
79
|
},
|
|
80
80
|
getReadyActions() {
|
|
81
81
|
if (delegates === undefined)
|
|
82
|
-
throw new Error('dsh-
|
|
82
|
+
throw new Error('dsh-cli: Channel actions are not installed');
|
|
83
83
|
return delegates;
|
|
84
84
|
},
|
|
85
85
|
};
|
|
@@ -296,7 +296,7 @@ export function createAgentViewProjection(ctx, deps) {
|
|
|
296
296
|
if (failures.length === 1)
|
|
297
297
|
throw failures[0];
|
|
298
298
|
if (failures.length > 1)
|
|
299
|
-
throw new AggregateError(failures, 'dsh-
|
|
299
|
+
throw new AggregateError(failures, 'dsh-cli: agent-view cleanup failed');
|
|
300
300
|
};
|
|
301
301
|
deps.owner.own(dispose);
|
|
302
302
|
return {
|
|
@@ -48,7 +48,7 @@ export function createBackgroundCurrentAction(ctx, state, options, deps) {
|
|
|
48
48
|
catch (error) {
|
|
49
49
|
// The workspace ledger is optional bookkeeping, but preserve the
|
|
50
50
|
// baseline stderr warning for operators diagnosing a degraded host.
|
|
51
|
-
ctx.logger.warn('dsh-
|
|
51
|
+
ctx.logger.warn('dsh-cli: background session attachment failed: %o', error);
|
|
52
52
|
}
|
|
53
53
|
// Do not adopt after attachment unless the exact captured foreground is
|
|
54
54
|
// still current. A replacement is not a license to target that newer
|
|
@@ -9,7 +9,7 @@ export function createBindingEvents(ctx, deps) {
|
|
|
9
9
|
const reconcileRetiredProjection = (status) => {
|
|
10
10
|
if (!deps.state.working)
|
|
11
11
|
return;
|
|
12
|
-
ctx.logger.warn(`dsh-
|
|
12
|
+
ctx.logger.warn(`dsh-cli: agent became ${status} while the channel still projected an open turn; releasing volatile UI gates`);
|
|
13
13
|
deps.inputConvergence.cancelInFlight = false;
|
|
14
14
|
deps.state.cancelPending = false;
|
|
15
15
|
deps.state.working = false;
|
|
@@ -90,7 +90,7 @@ export function createChannelBinding(initial, handle, owner) {
|
|
|
90
90
|
const assertPrepared = (candidate, capture) => {
|
|
91
91
|
if (pending.get(candidate) !== capture || !isCaptureCurrent(capture)) {
|
|
92
92
|
startClose(disposePending(candidate));
|
|
93
|
-
throw new Error('dsh-
|
|
93
|
+
throw new Error('dsh-cli: Channel binding changed before adoption');
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
const settlePrevious = (previous, disposition) => {
|
|
@@ -112,7 +112,7 @@ export function createChannelBinding(initial, handle, owner) {
|
|
|
112
112
|
// would publish a binding whose cleanup authority was contested.
|
|
113
113
|
handoff = undefined;
|
|
114
114
|
disposePending(candidate);
|
|
115
|
-
throw new Error('dsh-
|
|
115
|
+
throw new Error('dsh-cli: Channel binding handoff is already in progress');
|
|
116
116
|
}
|
|
117
117
|
assertPrepared(candidate, capture);
|
|
118
118
|
const token = Symbol('channel-binding-handoff');
|
|
@@ -124,13 +124,13 @@ export function createChannelBinding(initial, handle, owner) {
|
|
|
124
124
|
disposition = next;
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
|
-
throw new Error('dsh-
|
|
127
|
+
throw new Error('dsh-cli: Channel binding previous disposition changed');
|
|
128
128
|
};
|
|
129
129
|
let succeeded = false;
|
|
130
130
|
try {
|
|
131
131
|
const cleanupFailure = clearSubscriptions(() => {
|
|
132
132
|
if (handoff !== token || !isCaptureCurrent(capture) || pending.get(candidate) !== capture) {
|
|
133
|
-
throw new Error('dsh-
|
|
133
|
+
throw new Error('dsh-cli: Channel binding changed before adoption');
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
if (cleanupFailure !== undefined)
|
|
@@ -138,7 +138,7 @@ export function createChannelBinding(initial, handle, owner) {
|
|
|
138
138
|
// Unsubscription is external code: it can revoke the owner or attempt a
|
|
139
139
|
// rival adoption. Never write a candidate after either event.
|
|
140
140
|
if (handoff !== token)
|
|
141
|
-
throw new Error('dsh-
|
|
141
|
+
throw new Error('dsh-cli: Channel binding handoff was superseded');
|
|
142
142
|
assertPrepared(candidate, capture);
|
|
143
143
|
pending.delete(candidate);
|
|
144
144
|
currentAgent = candidate.agent;
|
|
@@ -148,7 +148,7 @@ export function createChannelBinding(initial, handle, owner) {
|
|
|
148
148
|
// Tail callbacks include notifier/listener code and therefore remain a
|
|
149
149
|
// synchronous reentrancy boundary even though they contain no await.
|
|
150
150
|
if (handoff !== token || !owner.current() || currentHandle !== candidate) {
|
|
151
|
-
throw new Error('dsh-
|
|
151
|
+
throw new Error('dsh-cli: Channel binding changed during adoption');
|
|
152
152
|
}
|
|
153
153
|
succeeded = true;
|
|
154
154
|
return result;
|
|
@@ -173,7 +173,7 @@ export function createChannelBinding(initial, handle, owner) {
|
|
|
173
173
|
owner.assertActive();
|
|
174
174
|
if (handoff !== undefined) {
|
|
175
175
|
handoff = undefined;
|
|
176
|
-
throw new Error('dsh-
|
|
176
|
+
throw new Error('dsh-cli: Channel binding handoff is already in progress');
|
|
177
177
|
}
|
|
178
178
|
const token = Symbol('channel-binding-handoff');
|
|
179
179
|
handoff = token;
|
|
@@ -184,24 +184,24 @@ export function createChannelBinding(initial, handle, owner) {
|
|
|
184
184
|
disposition = next;
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
|
-
throw new Error('dsh-
|
|
187
|
+
throw new Error('dsh-cli: Channel binding previous disposition changed');
|
|
188
188
|
};
|
|
189
189
|
let succeeded = false;
|
|
190
190
|
try {
|
|
191
191
|
const cleanupFailure = clearSubscriptions(() => {
|
|
192
192
|
if (handoff !== token || !owner.current())
|
|
193
|
-
throw new Error('dsh-
|
|
193
|
+
throw new Error('dsh-cli: Channel binding changed during adoption');
|
|
194
194
|
});
|
|
195
195
|
if (cleanupFailure !== undefined)
|
|
196
196
|
throw cleanupFailure;
|
|
197
197
|
if (handoff !== token || !owner.current())
|
|
198
|
-
throw new Error('dsh-
|
|
198
|
+
throw new Error('dsh-cli: Channel binding changed during adoption');
|
|
199
199
|
currentAgent = agent;
|
|
200
200
|
currentHandle = nextHandle;
|
|
201
201
|
generation += 1;
|
|
202
202
|
const result = tail(previous, decidePrevious);
|
|
203
203
|
if (handoff !== token || !owner.current() || currentAgent !== agent || currentHandle !== nextHandle) {
|
|
204
|
-
throw new Error('dsh-
|
|
204
|
+
throw new Error('dsh-cli: Channel binding changed during adoption');
|
|
205
205
|
}
|
|
206
206
|
succeeded = true;
|
|
207
207
|
return result;
|
|
@@ -236,18 +236,18 @@ export function createChannelBinding(initial, handle, owner) {
|
|
|
236
236
|
async prepare(capture, create) {
|
|
237
237
|
owner.assertActive();
|
|
238
238
|
if (!isCaptureCurrent(capture))
|
|
239
|
-
throw new Error('dsh-
|
|
239
|
+
throw new Error('dsh-cli: Channel binding changed before preparation');
|
|
240
240
|
const candidate = await create();
|
|
241
241
|
if (!isCaptureCurrent(capture)) {
|
|
242
242
|
await dispose(candidate);
|
|
243
|
-
throw new Error('dsh-
|
|
243
|
+
throw new Error('dsh-cli: Channel binding changed during preparation');
|
|
244
244
|
}
|
|
245
245
|
pending.set(candidate, capture);
|
|
246
246
|
// Owner disposal may synchronously occur through embedding hooks while
|
|
247
247
|
// ownership is registered; verify the pending entry itself as well.
|
|
248
248
|
if (!isCaptureCurrent(capture) || pending.get(candidate) !== capture) {
|
|
249
249
|
await disposePending(candidate);
|
|
250
|
-
throw new Error('dsh-
|
|
250
|
+
throw new Error('dsh-cli: Channel binding changed during preparation');
|
|
251
251
|
}
|
|
252
252
|
return candidate;
|
|
253
253
|
},
|
|
@@ -9,14 +9,14 @@ export function createExternalCommandInvoker(ctx, deps) {
|
|
|
9
9
|
// Derive identity from the effective definition, never the display name:
|
|
10
10
|
// scoped same-name handlers can have different verified owners.
|
|
11
11
|
const owner = commandOwner(ctx, definition);
|
|
12
|
-
const rootScope = owner?.commandId ?? (/^[a-z][a-z0-9]*(?:[.-][a-z0-9][a-z0-9-]*)+$/u.test(name) ? name : `dsh-
|
|
12
|
+
const rootScope = owner?.commandId ?? (/^[a-z][a-z0-9]*(?:[.-][a-z0-9][a-z0-9-]*)+$/u.test(name) ? name : `dsh-cli.${name.toLowerCase().replace(/[^a-z0-9-]+/gu, '-').replace(/^-+|-+$/gu, '') || 'command'}`);
|
|
13
13
|
if (!deps.allows({ componentId: 'root' }, 'commands.invoke', rootScope)) {
|
|
14
|
-
ctx.logger.warn('dsh-
|
|
14
|
+
ctx.logger.warn('dsh-cli: registry command invocation denied (commands.invoke revoked for "root" in the grants file)');
|
|
15
15
|
ctx.get('tuiEffectLedger')?.record({ operation: 'bind', resource: { kind: 'permission', id: `root:commands.invoke:${rootScope}` }, result: 'failed', errorCode: 'PERMISSION_NOT_GRANTED' }, ctx);
|
|
16
16
|
return t('command-invoke-denied');
|
|
17
17
|
}
|
|
18
18
|
if (owner !== undefined && !deps.allows({ componentId: owner.componentId, activationId: owner.activationId }, 'commands.invoke', owner.commandId)) {
|
|
19
|
-
ctx.logger.warn(`dsh-
|
|
19
|
+
ctx.logger.warn(`dsh-cli: registry command "/${name}" invocation denied — owner Component "${owner.componentId}" lost commands.invoke for "${owner.commandId}"`);
|
|
20
20
|
ctx.get('tuiEffectLedger')?.record({ operation: 'bind', resource: { kind: 'permission', id: `${owner.componentId}:commands.invoke:${owner.commandId}` }, result: 'failed', errorCode: 'PERMISSION_NOT_GRANTED' }, ctx);
|
|
21
21
|
return t('command-invoke-denied-owner', { name, owner: owner.componentId });
|
|
22
22
|
}
|
|
@@ -282,7 +282,7 @@ export function createInputDelivery(ctx, owner, binding, state, notify, trackPen
|
|
|
282
282
|
inputChain = inputChain.then(() => runUserTextDecision(text, placement, capturedImages, origin, attach)).catch((error) => {
|
|
283
283
|
// The chain must survive a failed decision: log, then continue with
|
|
284
284
|
// the next queued submission.
|
|
285
|
-
ctx.logger.warn('dsh-
|
|
285
|
+
ctx.logger.warn('dsh-cli: tui/input dispatch failed: %o', error);
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
288
|
/** Public companion for callers that own a line but not a draft (skill
|
|
@@ -16,7 +16,7 @@ export function createDetachedHandleFactory(owner) {
|
|
|
16
16
|
handle = await create();
|
|
17
17
|
if (!owner.current()) {
|
|
18
18
|
await release();
|
|
19
|
-
throw new Error('dsh-
|
|
19
|
+
throw new Error('dsh-cli: Channel lifetime has ended');
|
|
20
20
|
}
|
|
21
21
|
return {
|
|
22
22
|
handle,
|
|
@@ -65,7 +65,7 @@ export function createLocalActions(deps) {
|
|
|
65
65
|
try {
|
|
66
66
|
const children = await service.listChildren(binding.agent.session.id);
|
|
67
67
|
if (!current(capture))
|
|
68
|
-
throw new Error('dsh-
|
|
68
|
+
throw new Error('dsh-cli: Channel lifetime has ended');
|
|
69
69
|
if (children.length === 0)
|
|
70
70
|
return [t('subagent-none')];
|
|
71
71
|
return children.map(child => {
|
|
@@ -239,7 +239,7 @@ export function createModeActions(ctx, state, deps) {
|
|
|
239
239
|
if (runtime.mode === 'passive-shadow' || runtime.mode === 'replay-shadow')
|
|
240
240
|
return;
|
|
241
241
|
applyMode(restore.target, restore.capture).catch(error => {
|
|
242
|
-
ctx.logger.warn(`dsh-
|
|
242
|
+
ctx.logger.warn(`dsh-cli: plan-exit mode restore failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
243
243
|
});
|
|
244
244
|
});
|
|
245
245
|
};
|