@askdkc/dsh-cli 0.13.5 → 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Effect ledger (C-060): an append-only JSONL journal of plugin-visible
|
|
3
|
-
* effects at `~/.dsh-
|
|
4
|
-
* dsh-
|
|
3
|
+
* effects at `~/.dsh-cli/effect-ledger.jsonl`, mounted by the
|
|
4
|
+
* dsh-cli-plugin-host row as `ctx.tuiEffectLedger`.
|
|
5
5
|
*
|
|
6
6
|
* Every record carries the lifecycle triple:
|
|
7
7
|
*
|
|
@@ -122,7 +122,7 @@ export class TuiEffectLedgerRuntime extends Service {
|
|
|
122
122
|
if (state.ledgerSchema === undefined) {
|
|
123
123
|
if (!state.schemaWarned) {
|
|
124
124
|
state.schemaWarned = true;
|
|
125
|
-
state.hostContext.logger.warn('dsh-
|
|
125
|
+
state.hostContext.logger.warn('dsh-cli: effect ledger schema unavailable - suppressing all ledger writes (fail-closed)');
|
|
126
126
|
}
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
@@ -161,7 +161,7 @@ export class TuiEffectLedgerRuntime extends Service {
|
|
|
161
161
|
check(record, state.ledgerSchema, state.ledgerSchema);
|
|
162
162
|
}
|
|
163
163
|
catch (error) {
|
|
164
|
-
state.hostContext.logger.warn(`dsh-
|
|
164
|
+
state.hostContext.logger.warn(`dsh-cli: effect ledger record dropped (schema: ${error instanceof Error ? error.message : String(error)})`);
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
167
|
mkdirSync(dirname(state.file), { recursive: true, mode: 0o700 });
|
|
@@ -169,7 +169,7 @@ export class TuiEffectLedgerRuntime extends Service {
|
|
|
169
169
|
state.sequence += 1;
|
|
170
170
|
}
|
|
171
171
|
catch (error) {
|
|
172
|
-
state.hostContext.logger.warn('dsh-
|
|
172
|
+
state.hostContext.logger.warn('dsh-cli: effect ledger write failed');
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
/** Kernel-ledger owner resolver: verified activation identity wins; host /
|
|
@@ -93,21 +93,21 @@ export async function dispatchTuiDecision(ctx, name, payload, normalize) {
|
|
|
93
93
|
// GrantStore applies parent-scope grants and narrow deny precedence, so
|
|
94
94
|
// an event-wide grant cannot bypass a revoked session.
|
|
95
95
|
&& !decisionRegistryOf(ctx).grants.allows(principal, permission, scope ?? handler.scope)) {
|
|
96
|
-
log(`dsh-
|
|
96
|
+
log(`dsh-cli: ${name} handler from Component "${handler.componentId}" skipped after grant revocation`);
|
|
97
97
|
continue;
|
|
98
98
|
}
|
|
99
99
|
const remaining = DECISION_TOTAL_TIMEOUT_MS - (Date.now() - started);
|
|
100
100
|
if (remaining <= 0) {
|
|
101
|
-
log(`dsh-
|
|
101
|
+
log(`dsh-cli: ${name} total decision budget exceeded; remaining handlers skipped`);
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
const bounded = await runBounded(() => handler.listener(freezeClone(payload)), Math.min(DECISION_HANDLER_TIMEOUT_MS, remaining));
|
|
105
105
|
if (bounded.kind === 'timeout') {
|
|
106
|
-
log(`dsh-
|
|
106
|
+
log(`dsh-cli: ${name} handler from Component "${handler.componentId}" exceeded ${DECISION_HANDLER_TIMEOUT_MS}ms; continuing`);
|
|
107
107
|
continue;
|
|
108
108
|
}
|
|
109
109
|
if (bounded.kind === 'error') {
|
|
110
|
-
log(`dsh-
|
|
110
|
+
log(`dsh-cli: ${name} listener failed; continuing with the next listener: %o`, bounded.error);
|
|
111
111
|
continue;
|
|
112
112
|
}
|
|
113
113
|
const result = bounded.value;
|
|
@@ -117,10 +117,10 @@ export async function dispatchTuiDecision(ctx, name, payload, normalize) {
|
|
|
117
117
|
// unhandled rejections at the fire-and-forget call sites.
|
|
118
118
|
let decision;
|
|
119
119
|
try {
|
|
120
|
-
decision = normalize(result, what => log(`dsh-
|
|
120
|
+
decision = normalize(result, what => log(`dsh-cli: ${name} listener returned ${what}; ignored`));
|
|
121
121
|
}
|
|
122
122
|
catch (error) {
|
|
123
|
-
log(`dsh-
|
|
123
|
+
log(`dsh-cli: ${name} listener returned a value that threw during validation; ignored: %o`, error);
|
|
124
124
|
continue;
|
|
125
125
|
}
|
|
126
126
|
if (decision !== undefined)
|
|
@@ -154,20 +154,20 @@ export async function dispatchTuiNotification(ctx, name, payload) {
|
|
|
154
154
|
const principal = { componentId: handler.componentId, activationId: handler.activationId };
|
|
155
155
|
if (permission !== undefined
|
|
156
156
|
&& !decisionRegistryOf(ctx).grants.allows(principal, permission, scope ?? handler.scope)) {
|
|
157
|
-
log(`dsh-
|
|
157
|
+
log(`dsh-cli: ${name} handler from Component "${handler.componentId}" skipped after grant revocation`);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
const remaining = DECISION_TOTAL_TIMEOUT_MS - (Date.now() - started);
|
|
161
161
|
if (remaining <= 0) {
|
|
162
|
-
log(`dsh-
|
|
162
|
+
log(`dsh-cli: ${name} total decision budget exceeded; handler skipped`);
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
165
|
const bounded = await runBounded(() => handler.listener(freezeClone(payload)), Math.min(DECISION_HANDLER_TIMEOUT_MS, remaining));
|
|
166
166
|
if (bounded.kind === 'timeout') {
|
|
167
|
-
log(`dsh-
|
|
167
|
+
log(`dsh-cli: ${name} handler from Component "${handler.componentId}" exceeded ${DECISION_HANDLER_TIMEOUT_MS}ms; continuing`);
|
|
168
168
|
}
|
|
169
169
|
else if (bounded.kind === 'error') {
|
|
170
|
-
log(`dsh-
|
|
170
|
+
log(`dsh-cli: ${name} listener failed; continuing with the other listeners: %o`, bounded.error);
|
|
171
171
|
}
|
|
172
172
|
}));
|
|
173
173
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The dsh-
|
|
2
|
+
* The dsh-cli-extensions row: mounts every plugin-facing UI seam service in
|
|
3
3
|
* one cordis plugin (one profile row, one patch-surface entry — see issue
|
|
4
4
|
* #183 for the cost of row/code skew, and #242 for the entry-level-only
|
|
5
5
|
* inject rule this row follows).
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* module's public surface (`./extensions` export). The Cordis `ctx.on` hook is
|
|
21
21
|
* only a compatibility facade and cannot bypass admission, scope or grant
|
|
22
22
|
* checks. Intercept-class events require an explicit grant in
|
|
23
|
-
* `~/.dsh-
|
|
23
|
+
* `~/.dsh-cli/extension-grants.json`, default deny. The channel installs the
|
|
24
24
|
* SAME hook (idempotent per cordis root, so exactly one installation lands):
|
|
25
25
|
* this row covers profiles launching without the channel, and the channel
|
|
26
26
|
* covers the skew path where THIS row is missing.
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
* launches.
|
|
32
32
|
*/
|
|
33
33
|
import { Context } from '@deepseek-ai/cordis';
|
|
34
|
-
export declare const name = "dsh-
|
|
34
|
+
export declare const name = "dsh-cli-extensions";
|
|
35
35
|
export declare function apply(ctx: Context): void;
|
|
36
36
|
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The dsh-
|
|
2
|
+
* The dsh-cli-extensions row: mounts every plugin-facing UI seam service in
|
|
3
3
|
* one cordis plugin (one profile row, one patch-surface entry — see issue
|
|
4
4
|
* #183 for the cost of row/code skew, and #242 for the entry-level-only
|
|
5
5
|
* inject rule this row follows).
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* module's public surface (`./extensions` export). The Cordis `ctx.on` hook is
|
|
21
21
|
* only a compatibility facade and cannot bypass admission, scope or grant
|
|
22
22
|
* checks. Intercept-class events require an explicit grant in
|
|
23
|
-
* `~/.dsh-
|
|
23
|
+
* `~/.dsh-cli/extension-grants.json`, default deny. The channel installs the
|
|
24
24
|
* SAME hook (idempotent per cordis root, so exactly one installation lands):
|
|
25
25
|
* this row covers profiles launching without the channel, and the channel
|
|
26
26
|
* covers the skew path where THIS row is missing.
|
|
@@ -39,7 +39,7 @@ import TuiThemeRuntime from './themes.js';
|
|
|
39
39
|
import { installDecisionGuard } from './decision-guard.js';
|
|
40
40
|
import { readGrantStore } from '../adapter/standard/grants.js';
|
|
41
41
|
import { adapterRuntimeFor } from '../adapter/kernel/runtime-context.js';
|
|
42
|
-
export const name = 'dsh-
|
|
42
|
+
export const name = 'dsh-cli-extensions';
|
|
43
43
|
export function apply(ctx) {
|
|
44
44
|
installDecisionGuard(ctx, readGrantStore(undefined, undefined, adapterRuntimeFor(ctx)));
|
|
45
45
|
ctx.plugin(TuiDialogRuntime);
|
|
@@ -184,7 +184,7 @@ function invalidateActivation(fiber) {
|
|
|
184
184
|
}
|
|
185
185
|
/** Carry an activation token through every async continuation created by a
|
|
186
186
|
* Cordis plugin callback. The fallback context/root walk covers compositions
|
|
187
|
-
* that do not mount a dsh-
|
|
187
|
+
* that do not mount a dsh-cli service and therefore have not been admitted to
|
|
188
188
|
* the host's canonical Fiber maps yet. */
|
|
189
189
|
function runActivation(fiber, execute, receiver, args) {
|
|
190
190
|
const context = canonicalContexts.get(fiber) ?? fiber.ctx;
|
|
@@ -305,7 +305,7 @@ export function withHostRootCapability(callback) {
|
|
|
305
305
|
}
|
|
306
306
|
function rejectRootCapability(root, capability) {
|
|
307
307
|
if (currentActivationIsPlugin(root)) {
|
|
308
|
-
throw new Error(`dsh-
|
|
308
|
+
throw new Error(`dsh-cli: ${capability} is unavailable from a plugin activation`);
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
function callContextOf(receiver) {
|
|
@@ -584,7 +584,7 @@ function assertLiveContext(ctx, capability) {
|
|
|
584
584
|
catch {
|
|
585
585
|
// Fall through to the stable public error below.
|
|
586
586
|
}
|
|
587
|
-
throw new Error(`dsh-
|
|
587
|
+
throw new Error(`dsh-cli: ${capability} requires a live Cordis activation context`);
|
|
588
588
|
}
|
|
589
589
|
/** Recover the composition root that owns a traceable service. Cordis stores
|
|
590
590
|
* the provider context on the concrete Service instance; callers may reach
|
|
@@ -605,21 +605,21 @@ export function serviceCompositionRoot(service) {
|
|
|
605
605
|
* context and thereby borrow its verified identity/lifecycle. */
|
|
606
606
|
export function assertCallerContext(caller, target, capability, service) {
|
|
607
607
|
if (!Context.is(caller) || !Context.is(target)) {
|
|
608
|
-
throw new Error(`dsh-
|
|
608
|
+
throw new Error(`dsh-cli: ${capability} requires a Cordis activation context`);
|
|
609
609
|
}
|
|
610
610
|
const callerFiber = assertLiveContext(caller, capability);
|
|
611
611
|
const targetFiber = assertLiveContext(target, capability);
|
|
612
612
|
const ownerRoot = service === undefined ? undefined : serviceCompositionRoot(service);
|
|
613
613
|
if (ownerRoot !== undefined
|
|
614
614
|
&& (compositionRoot(caller) !== ownerRoot || compositionRoot(target) !== ownerRoot)) {
|
|
615
|
-
throw new Error(`dsh-
|
|
615
|
+
throw new Error(`dsh-cli: ${capability} context belongs to a different composition`);
|
|
616
616
|
}
|
|
617
617
|
if (caller === target || callerFiber === targetFiber)
|
|
618
618
|
return;
|
|
619
619
|
const root = compositionRoot(caller);
|
|
620
620
|
if (caller === root || callerFiber === rootFibers.get(root))
|
|
621
621
|
return;
|
|
622
|
-
throw new Error(`dsh-
|
|
622
|
+
throw new Error(`dsh-cli: ${capability} context must be the calling activation`);
|
|
623
623
|
}
|
|
624
624
|
/**
|
|
625
625
|
* Resolve the caller for a plugin-owned effect. A plugin can read
|
|
@@ -630,23 +630,23 @@ export function assertCallerContext(caller, target, capability, service) {
|
|
|
630
630
|
*/
|
|
631
631
|
export function requirePluginCaller(caller, capability, service) {
|
|
632
632
|
if (!Context.is(caller)) {
|
|
633
|
-
throw new Error(`dsh-
|
|
633
|
+
throw new Error(`dsh-cli: ${capability} requires a Cordis activation context`);
|
|
634
634
|
}
|
|
635
635
|
try {
|
|
636
636
|
const callerFiber = assertLiveContext(caller, capability);
|
|
637
637
|
const root = compositionRoot(caller);
|
|
638
638
|
if (caller === root || callerFiber === rootFibers.get(root)) {
|
|
639
|
-
throw new Error(`dsh-
|
|
639
|
+
throw new Error(`dsh-cli: ${capability} requires a non-root calling activation`);
|
|
640
640
|
}
|
|
641
641
|
const ownerRoot = service === undefined ? undefined : serviceCompositionRoot(service);
|
|
642
642
|
if (ownerRoot !== undefined && compositionRoot(caller) !== ownerRoot) {
|
|
643
|
-
throw new Error(`dsh-
|
|
643
|
+
throw new Error(`dsh-cli: ${capability} context belongs to a different composition`);
|
|
644
644
|
}
|
|
645
645
|
return caller;
|
|
646
646
|
}
|
|
647
647
|
catch (error) {
|
|
648
|
-
if (error instanceof Error && error.message.startsWith('dsh-
|
|
648
|
+
if (error instanceof Error && error.message.startsWith('dsh-cli:'))
|
|
649
649
|
throw error;
|
|
650
|
-
throw new Error(`dsh-
|
|
650
|
+
throw new Error(`dsh-cli: ${capability} requires a live non-root calling activation`);
|
|
651
651
|
}
|
|
652
652
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* IDE selection channel (PR-B groundwork): the dsh-
|
|
2
|
+
* IDE selection channel (PR-B groundwork): the dsh-cli side of a loopback
|
|
3
3
|
* WebSocket link with a companion IDE extension (dsh-tui-vscode). The
|
|
4
4
|
* extension broadcasts caret-selection changes; the TUI consumes them to
|
|
5
5
|
* attach `<attached-file …>` blocks at submit time (ADR-001).
|
|
6
6
|
*
|
|
7
7
|
* Discovery has two paths (DESIGN D4):
|
|
8
|
-
* 1. env direct —
|
|
8
|
+
* 1. env direct — DSH_CLI_IDE_PORT + DSH_CLI_IDE_TOKEN, injected when the
|
|
9
9
|
* extension spawns this TUI itself;
|
|
10
|
-
* 2. lock scan — `~/.dsh-
|
|
10
|
+
* 2. lock scan — `~/.dsh-cli/ide/*.lock` files written by the extension
|
|
11
11
|
* ({port, token, workspaceFolders, pid}); locks whose workspaceFolders
|
|
12
12
|
* match the session cwd connect first.
|
|
13
13
|
*
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
* falls back to reading the file from disk for protocol-1 pushes.
|
|
34
34
|
*/
|
|
35
35
|
/** Env var carrying the extension's loopback WS port (spawn-injected). */
|
|
36
|
-
export declare const IDE_PORT_ENV = "
|
|
36
|
+
export declare const IDE_PORT_ENV = "DSH_CLI_IDE_PORT";
|
|
37
37
|
/** Env var carrying the extension's handshake token (spawn-injected). */
|
|
38
|
-
export declare const IDE_TOKEN_ENV = "
|
|
38
|
+
export declare const IDE_TOKEN_ENV = "DSH_CLI_IDE_TOKEN";
|
|
39
39
|
/** Wire protocol this client speaks; hello_ack carries the server's value. */
|
|
40
40
|
export declare const IDE_PROTOCOL_VERSION = 2;
|
|
41
|
-
/** Where the extension advertises its loopback server (`~/.dsh-
|
|
41
|
+
/** Where the extension advertises its loopback server (`~/.dsh-cli/ide`). */
|
|
42
42
|
export declare function ideLockDir(dataDir?: string): string;
|
|
43
43
|
/** Connection target resolved from the spawn environment. */
|
|
44
44
|
export type IdeChannelConfig = {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* IDE selection channel (PR-B groundwork): the dsh-
|
|
2
|
+
* IDE selection channel (PR-B groundwork): the dsh-cli side of a loopback
|
|
3
3
|
* WebSocket link with a companion IDE extension (dsh-tui-vscode). The
|
|
4
4
|
* extension broadcasts caret-selection changes; the TUI consumes them to
|
|
5
5
|
* attach `<attached-file …>` blocks at submit time (ADR-001).
|
|
6
6
|
*
|
|
7
7
|
* Discovery has two paths (DESIGN D4):
|
|
8
|
-
* 1. env direct —
|
|
8
|
+
* 1. env direct — DSH_CLI_IDE_PORT + DSH_CLI_IDE_TOKEN, injected when the
|
|
9
9
|
* extension spawns this TUI itself;
|
|
10
|
-
* 2. lock scan — `~/.dsh-
|
|
10
|
+
* 2. lock scan — `~/.dsh-cli/ide/*.lock` files written by the extension
|
|
11
11
|
* ({port, token, workspaceFolders, pid}); locks whose workspaceFolders
|
|
12
12
|
* match the session cwd connect first.
|
|
13
13
|
*
|
|
@@ -36,9 +36,9 @@ import { readdirSync, readFileSync } from 'node:fs';
|
|
|
36
36
|
import { join } from 'node:path';
|
|
37
37
|
import { DATA_DIR } from '../utils/paths.js';
|
|
38
38
|
/** Env var carrying the extension's loopback WS port (spawn-injected). */
|
|
39
|
-
export const IDE_PORT_ENV = '
|
|
39
|
+
export const IDE_PORT_ENV = 'DSH_CLI_IDE_PORT';
|
|
40
40
|
/** Env var carrying the extension's handshake token (spawn-injected). */
|
|
41
|
-
export const IDE_TOKEN_ENV = '
|
|
41
|
+
export const IDE_TOKEN_ENV = 'DSH_CLI_IDE_TOKEN';
|
|
42
42
|
/** Handshake frame the client must send as its very first message. */
|
|
43
43
|
const HELLO_METHOD = 'ide/hello';
|
|
44
44
|
/**
|
|
@@ -55,7 +55,7 @@ export const IDE_PROTOCOL_VERSION = 2;
|
|
|
55
55
|
const SELECTION_METHOD = 'selection_changed';
|
|
56
56
|
/** Total connection budget across all candidates, in milliseconds. */
|
|
57
57
|
const CONNECT_BUDGET_MS = 300;
|
|
58
|
-
/** Where the extension advertises its loopback server (`~/.dsh-
|
|
58
|
+
/** Where the extension advertises its loopback server (`~/.dsh-cli/ide`). */
|
|
59
59
|
export function ideLockDir(dataDir = DATA_DIR) {
|
|
60
60
|
return join(dataDir, 'ide');
|
|
61
61
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* dsh-
|
|
2
|
+
* dsh-cli plugin entry. The TUI implementation lives in `./plugin.ts` (its
|
|
3
3
|
* render path is JSX); this module owns the plugin surface (`name`/`inject`/
|
|
4
4
|
* `Config`/`apply`) at the package entry module and delegates
|
|
5
5
|
* `apply` through a dynamic import so entry-scanning tooling and the Loader
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
import type { Context } from '@deepseek-ai/cordis';
|
|
10
10
|
import Schema from '@deepseek-ai/schemastery';
|
|
11
11
|
import type { SessionModeSpec } from '../sessionModes.js';
|
|
12
|
-
import { type PageMarginSetting, type ScrollGutterMode, type StatusBarConfig, type ToolBackground } from '../
|
|
12
|
+
import { type PageMarginSetting, type ScrollGutterMode, type StatusBarConfig, type ToolBackground } from '../cliDisplayPrefs.js';
|
|
13
13
|
import { type ShortcutActionId } from '../utils/keymap.js';
|
|
14
14
|
import { type RuntimeConfig } from './compat/settings.js';
|
|
15
|
-
export declare const name = "dsh-
|
|
15
|
+
export declare const name = "dsh-cli";
|
|
16
16
|
export declare const inject: string[];
|
|
17
17
|
/**
|
|
18
|
-
* dsh-
|
|
18
|
+
* dsh-cli plugin configuration: session attachment, model route, working
|
|
19
19
|
* directory, and display preferences.
|
|
20
20
|
*/
|
|
21
21
|
export interface Config {
|
|
@@ -23,7 +23,7 @@ export interface Config {
|
|
|
23
23
|
sessionId?: string;
|
|
24
24
|
/** LLM provider route. The route resolves atomically (issue #67): when
|
|
25
25
|
* cordis.yml names BOTH `provider` and `model`, that pair wins; otherwise
|
|
26
|
-
* the `/model` choice persisted in `~/.dsh-
|
|
26
|
+
* the `/model` choice persisted in `~/.dsh-cli/model.json` wins whole;
|
|
27
27
|
* otherwise `agentDefaultModel` supplies the provider-neutral Harness
|
|
28
28
|
* default. A bare embedder without that service falls back to DeepSeek.
|
|
29
29
|
* A provider-only pin never half-overrides the persisted choice. */
|
|
@@ -55,7 +55,7 @@ export interface Config {
|
|
|
55
55
|
activity?: boolean;
|
|
56
56
|
/** Working-activity indicator preset (`moon8`/`moon`/`comet`/`dots`/…
|
|
57
57
|
* or `random`; see activityFrames.ts). When absent, the `/activity`
|
|
58
|
-
* choice persisted in `~/.dsh-
|
|
58
|
+
* choice persisted in `~/.dsh-cli/working-activity.json` wins, then the
|
|
59
59
|
* `moon8` default. */
|
|
60
60
|
activityFrames?: string;
|
|
61
61
|
/** Show the segmented context bar (the band under the input with the
|
|
@@ -70,14 +70,14 @@ export interface Config {
|
|
|
70
70
|
fullscreen?: boolean;
|
|
71
71
|
/** Allow terminal image previews when supported (default true). Saved
|
|
72
72
|
* /settings choices override this value after restart. The environment
|
|
73
|
-
* override
|
|
73
|
+
* override DSH_CLI_DISABLE_TERMINAL_IMAGES can always force previews off. */
|
|
74
74
|
terminalImages?: boolean;
|
|
75
|
-
/** UI language: `en` / `zh`. When absent, the `
|
|
76
|
-
* then the `/lang` choice persisted in `~/.dsh-
|
|
75
|
+
/** UI language: `en` / `zh`. When absent, the `DSH_CLI_LANG` env var wins,
|
|
76
|
+
* then the `/lang` choice persisted in `~/.dsh-cli/lang.json`, then the locale, falling back to `en`. */
|
|
77
77
|
lang?: string;
|
|
78
78
|
/** Agent preset id new sessions compose from (standard/ptc/minimal/
|
|
79
79
|
* cordis/… when the roster is mounted). When absent, the `/preset` choice
|
|
80
|
-
* persisted in `~/.dsh-
|
|
80
|
+
* persisted in `~/.dsh-cli/agent-preset.json` wins, then the roster
|
|
81
81
|
* default (`standard`). */
|
|
82
82
|
preset?: string;
|
|
83
83
|
/** Edit/Write diff presentation: `auto` picks side-by-side on wide
|
|
@@ -91,34 +91,34 @@ export interface Config {
|
|
|
91
91
|
/** Tool-card background strength; defaults to no added background. */
|
|
92
92
|
toolBackground?: ToolBackground;
|
|
93
93
|
/** What the fullscreen transcript's right gutter shows (settings
|
|
94
|
-
* `dsh-
|
|
94
|
+
* `dsh-cli.scrollGutter`): `timeline` turn rail (default), `scrollbar`
|
|
95
95
|
* proportional thumb, or `hidden`. */
|
|
96
96
|
scrollGutter?: ScrollGutterMode;
|
|
97
|
-
/** Root page inset (settings `dsh-
|
|
97
|
+
/** Root page inset (settings `dsh-cli.pageMargin`): a preset name
|
|
98
98
|
* (`none` / `slim` / `normal` (default) / `roomy`) or a custom `NxM`
|
|
99
99
|
* spec (columns per side × rows top/bottom) that insets the whole UI
|
|
100
100
|
* from the terminal edges. Terminals without their own viewport padding
|
|
101
101
|
* (bare WSL, tmux, SSH) otherwise hug the screen border. */
|
|
102
102
|
pageMargin?: PageMarginSetting;
|
|
103
|
-
/** Terminal-card header folding (settings `dsh-
|
|
103
|
+
/** Terminal-card header folding (settings `dsh-cli.foldTerminalCommand`):
|
|
104
104
|
* `true` collapses a multi-line command title to its first line plus a
|
|
105
105
|
* `+N lines` hint; Ctrl+O / clicking the card expands it. Default off —
|
|
106
106
|
* the full title keeps rendering. */
|
|
107
107
|
foldTerminalCommand?: boolean;
|
|
108
108
|
/** Show the session name as a chip on the prompt top border's right side
|
|
109
|
-
* (settings `dsh-
|
|
109
|
+
* (settings `dsh-cli.promptSessionLabel`); off by default. */
|
|
110
110
|
promptSessionLabel?: boolean;
|
|
111
|
-
/** Fullscreen draft editor (settings `dsh-
|
|
111
|
+
/** Fullscreen draft editor (settings `dsh-cli.expandEditor`): the ⛶
|
|
112
112
|
* affordance in the input row and the expandEditor shortcut (default
|
|
113
113
|
* Ctrl+Shift+E) expand the draft into a whole-screen editor. On by
|
|
114
114
|
* default; off removes both entry points. */
|
|
115
115
|
expandEditor?: boolean;
|
|
116
|
-
/** Smooth streaming reveal (settings `dsh-
|
|
116
|
+
/** Smooth streaming reveal (settings `dsh-cli.smoothStreaming`): live
|
|
117
117
|
* assistant text, expanded thinking, and tool call bodies paint through
|
|
118
118
|
* a ~30fps reveal instead of jumping per provider burst — bursty or
|
|
119
119
|
* one-shot deliveries read as an even flow. On by default. */
|
|
120
120
|
smoothStreaming?: boolean;
|
|
121
|
-
/** Mermaid diagrams (settings `dsh-
|
|
121
|
+
/** Mermaid diagrams (settings `dsh-cli.mermaidDiagrams`): ```mermaid
|
|
122
122
|
* fences in replies render as Unicode box-drawing art — flowcharts,
|
|
123
123
|
* sequence/state/class/ER diagrams, pie, mindmap, timeline, gitGraph —
|
|
124
124
|
* laid out in-process, no browser or image protocol. A diagram wider
|
|
@@ -144,7 +144,7 @@ export declare const Config: Schema<Config, RuntimeConfig<Config>>;
|
|
|
144
144
|
* Start the interactive TUI front door, delegating to the JSX implementation
|
|
145
145
|
* in `./plugin.ts` (see its module doc for the full contract).
|
|
146
146
|
* @param ctx - the plugin context.
|
|
147
|
-
* @param config - the validated dsh-
|
|
147
|
+
* @param config - the validated dsh-cli configuration.
|
|
148
148
|
* @returns a promise settling when the Loader entry has scheduled its runtime.
|
|
149
149
|
*/
|
|
150
150
|
export declare function apply(ctx: Context, config: RuntimeConfig<Config>): Promise<void>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Schema from '@deepseek-ai/schemastery';
|
|
2
|
-
import { DEFAULT_STATUS_BAR, normalizePageMargin } from '../
|
|
2
|
+
import { DEFAULT_STATUS_BAR, normalizePageMargin } from '../cliDisplayPrefs.js';
|
|
3
3
|
import { SHORTCUT_ACTIONS } from '../utils/keymap.js';
|
|
4
4
|
import { editableConfig } from './compat/settings.js';
|
|
5
|
-
export const name = 'dsh-
|
|
5
|
+
export const name = 'dsh-cli';
|
|
6
6
|
// `tuiWorkspaces` must stay OUT of this code-level inject (issue #183): the
|
|
7
7
|
// dsh CLI resolves the bundle's cordis.patch.yml from the FIRST copy of this
|
|
8
8
|
// package found from its own install anchor (typically the global launcher),
|
|
9
9
|
// while the Loader imports the plugin module from the profile's copy. When
|
|
10
|
-
// the two copies skew, the patch may predate the dsh-
|
|
10
|
+
// the two copies skew, the patch may predate the dsh-cli-workspaces row — a
|
|
11
11
|
// hard inject here then deadlocks the whole tree at boot ("pending (waiting
|
|
12
12
|
// for service: tuiWorkspaces)"). The bundle patch keeps tuiWorkspaces in the
|
|
13
13
|
// row-level inject purely as an ordering guarantee when the row exists; when
|
|
@@ -88,7 +88,7 @@ export const Config = editableConfig(Schema.object({
|
|
|
88
88
|
* Start the interactive TUI front door, delegating to the JSX implementation
|
|
89
89
|
* in `./plugin.ts` (see its module doc for the full contract).
|
|
90
90
|
* @param ctx - the plugin context.
|
|
91
|
-
* @param config - the validated dsh-
|
|
91
|
+
* @param config - the validated dsh-cli configuration.
|
|
92
92
|
* @returns a promise settling when the Loader entry has scheduled its runtime.
|
|
93
93
|
*/
|
|
94
94
|
export async function apply(ctx, config) {
|
|
@@ -103,7 +103,7 @@ export async function apply(ctx, config) {
|
|
|
103
103
|
if (disposed)
|
|
104
104
|
return;
|
|
105
105
|
return ctx.plugin({
|
|
106
|
-
name: 'dsh-
|
|
106
|
+
name: 'dsh-cli-runtime',
|
|
107
107
|
apply: (runtimeCtx) => tuiApply(runtimeCtx, config, ctx),
|
|
108
108
|
});
|
|
109
109
|
}).catch(error => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External injection channel — lets an out-of-process editor integration
|
|
3
3
|
* (e.g. the `dsh.nvim` Neovim plugin) push text into the running TUI's
|
|
4
|
-
* prompt input and, optionally, submit it. This is dsh-
|
|
4
|
+
* prompt input and, optionally, submit it. This is dsh-CLI's answer to
|
|
5
5
|
* OpenCode's `POST /tui/publish` (`tui.prompt.append` / `tui.command.execute`),
|
|
6
6
|
* but over a per-session local socket instead of an HTTP port: no port
|
|
7
7
|
* allocation, no auth surface, and the endpoint is torn down with the
|
|
8
8
|
* session.
|
|
9
9
|
*
|
|
10
|
-
* Transport: a Unix domain socket at `~/.dsh-
|
|
11
|
-
* (a named pipe `\\.\pipe\dsh-
|
|
12
|
-
* it the server maintains a discovery file `~/.dsh-
|
|
10
|
+
* Transport: a Unix domain socket at `~/.dsh-cli/inject/<sessionId>.sock`
|
|
11
|
+
* (a named pipe `\\.\pipe\dsh-cli-inject-<sessionId>` on Windows). Alongside
|
|
12
|
+
* it the server maintains a discovery file `~/.dsh-cli/inject/servers.json`
|
|
13
13
|
* listing every live session (`pid`, `sessionId`, `cwd`, `socketPath`) so a
|
|
14
14
|
* client can pick the instance whose `cwd` overlaps the editor's project —
|
|
15
15
|
* the same cwd-matching OpenCode's server discovery does.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External injection channel — lets an out-of-process editor integration
|
|
3
3
|
* (e.g. the `dsh.nvim` Neovim plugin) push text into the running TUI's
|
|
4
|
-
* prompt input and, optionally, submit it. This is dsh-
|
|
4
|
+
* prompt input and, optionally, submit it. This is dsh-CLI's answer to
|
|
5
5
|
* OpenCode's `POST /tui/publish` (`tui.prompt.append` / `tui.command.execute`),
|
|
6
6
|
* but over a per-session local socket instead of an HTTP port: no port
|
|
7
7
|
* allocation, no auth surface, and the endpoint is torn down with the
|
|
8
8
|
* session.
|
|
9
9
|
*
|
|
10
|
-
* Transport: a Unix domain socket at `~/.dsh-
|
|
11
|
-
* (a named pipe `\\.\pipe\dsh-
|
|
12
|
-
* it the server maintains a discovery file `~/.dsh-
|
|
10
|
+
* Transport: a Unix domain socket at `~/.dsh-cli/inject/<sessionId>.sock`
|
|
11
|
+
* (a named pipe `\\.\pipe\dsh-cli-inject-<sessionId>` on Windows). Alongside
|
|
12
|
+
* it the server maintains a discovery file `~/.dsh-cli/inject/servers.json`
|
|
13
13
|
* listing every live session (`pid`, `sessionId`, `cwd`, `socketPath`) so a
|
|
14
14
|
* client can pick the instance whose `cwd` overlaps the editor's project —
|
|
15
15
|
* the same cwd-matching OpenCode's server discovery does.
|
|
@@ -39,7 +39,7 @@ export const SERVERS_FILE = join(INJECT_DIR, 'servers.json');
|
|
|
39
39
|
*/
|
|
40
40
|
export function socketPathFor(sessionId) {
|
|
41
41
|
if (process.platform === 'win32') {
|
|
42
|
-
return `\\\\.\\pipe\\dsh-
|
|
42
|
+
return `\\\\.\\pipe\\dsh-cli-inject-${sessionId}`;
|
|
43
43
|
}
|
|
44
44
|
return join(INJECT_DIR, `${sessionId}.sock`);
|
|
45
45
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Context } from '@deepseek-ai/cordis';
|
|
10
10
|
/** Cordis companion plugin name. */
|
|
11
|
-
export declare const name = "dsh-
|
|
11
|
+
export declare const name = "dsh-cli-invariant";
|
|
12
12
|
/** Service required before the companion can reserve package ownership. */
|
|
13
13
|
export declare const inject: string[];
|
|
14
14
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
const PACKAGE_NAME = '@askdkc/dsh-cli';
|
|
10
10
|
/** Cordis companion plugin name. */
|
|
11
|
-
export const name = 'dsh-
|
|
11
|
+
export const name = 'dsh-cli-invariant';
|
|
12
12
|
/** Service required before the companion can reserve package ownership. */
|
|
13
13
|
export const inject = ['invariants'];
|
|
14
14
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* messages.observe contract surface (C-042,
|
|
3
3
|
* `messages.dsh/v1alpha1#MessageObserver`): the host event broker, mounted
|
|
4
|
-
* by the dsh-
|
|
4
|
+
* by the dsh-cli-plugin-host row as `ctx.tuiMessageObserver`.
|
|
5
5
|
*
|
|
6
6
|
* Mapping (deliberately narrow):
|
|
7
7
|
*
|
|
@@ -128,7 +128,7 @@ export declare class TuiMessageObserverRuntime extends Service {
|
|
|
128
128
|
/**
|
|
129
129
|
* @deprecated Use `validateEnvelope` instead.
|
|
130
130
|
* Compatibility alias retained as a long-term face for existing
|
|
131
|
-
* embedders/tests. OWNER: dsh-
|
|
131
|
+
* embedders/tests. OWNER: dsh-cli adapter. UNTIL: no scheduled removal.
|
|
132
132
|
*/
|
|
133
133
|
envelopeSchema?: Record<string, unknown>;
|
|
134
134
|
});
|