@deepseek-harness-tui/dsh-tui 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -13
- package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -0
- package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -0
- package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -0
- package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -0
- package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -0
- package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -0
- package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -0
- package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -0
- package/dsh-ecosystem-spec/registry/README.md +14 -0
- package/dsh-ecosystem-spec/registry/contracts/scene-v1alpha1.json +13 -0
- package/dsh-ecosystem-spec/registry/contracts/settings-section-v1alpha1.json +13 -0
- package/dsh-ecosystem-spec/registry/contracts/tui-channel-v1alpha1.json +30 -0
- package/dsh-ecosystem-spec/registry/contracts/workspace-provider-v1alpha1.json +6 -0
- package/{ecosystem-spec → dsh-ecosystem-spec}/registry/permissions-0.1.json +1 -1
- package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -0
- package/lib/types/command-trees.d.ts +2 -1
- package/lib/types/command-trees.d.ts.map +1 -1
- package/lib/types/command-trees.js +1 -1
- package/lib/types/components/LoadedContextPanel.d.ts +10 -5
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
- package/lib/types/components/LoadedContextPanel.js +18 -7
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +16 -7
- package/lib/types/components/Markdown.d.ts +13 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +15 -1
- package/lib/types/components/MessageList.d.ts +3 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +90 -9
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +26 -12
- package/lib/types/components/StreamingMarkdown.d.ts +2 -8
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +51 -9
- package/lib/types/components/activityFrames.d.ts +1 -1
- package/lib/types/components/activityFrames.d.ts.map +1 -1
- package/lib/types/components/activityFrames.js +4 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +5 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +26 -3
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +12 -1
- package/lib/types/dsh-adapter/channel.d.ts +31 -4
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +267 -102
- package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
- package/lib/types/dsh-adapter/childStderr.js +10 -0
- package/lib/types/dsh-adapter/command-attribution.d.ts.map +1 -1
- package/lib/types/dsh-adapter/command-attribution.js +2 -2
- package/lib/types/dsh-adapter/command-trees.d.ts +7 -1
- package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -1
- package/lib/types/dsh-adapter/command-trees.js +70 -20
- package/lib/types/dsh-adapter/component-identity.d.ts +5 -0
- package/lib/types/dsh-adapter/component-identity.d.ts.map +1 -1
- package/lib/types/dsh-adapter/component-identity.js +14 -14
- package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/decision-guard.js +10 -16
- package/lib/types/dsh-adapter/dialogs.d.ts +2 -3
- package/lib/types/dsh-adapter/dialogs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/dialogs.js +114 -60
- package/lib/types/dsh-adapter/effect-ledger.d.ts +0 -8
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +73 -53
- package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/extension-events.js +39 -1
- package/lib/types/dsh-adapter/grants.d.ts.map +1 -1
- package/lib/types/dsh-adapter/grants.js +43 -14
- package/lib/types/dsh-adapter/host-access.d.ts +37 -0
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-access.js +652 -0
- package/lib/types/dsh-adapter/host-descriptor.d.ts +2 -2
- package/lib/types/dsh-adapter/host-descriptor.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-descriptor.js +31 -8
- package/lib/types/dsh-adapter/index.d.ts +4 -0
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +1 -0
- package/lib/types/dsh-adapter/message-observer.d.ts +10 -15
- package/lib/types/dsh-adapter/message-observer.d.ts.map +1 -1
- package/lib/types/dsh-adapter/message-observer.js +114 -70
- package/lib/types/dsh-adapter/plugin-host.d.ts +39 -6
- package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-host.js +139 -44
- package/lib/types/dsh-adapter/plugin-storage.d.ts +0 -5
- package/lib/types/dsh-adapter/plugin-storage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-storage.js +48 -36
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +80 -16
- package/lib/types/dsh-adapter/promptDebug.d.ts +0 -6
- package/lib/types/dsh-adapter/promptDebug.d.ts.map +1 -1
- package/lib/types/dsh-adapter/promptDebug.js +13 -4
- package/lib/types/dsh-adapter/renderers.d.ts +6 -14
- package/lib/types/dsh-adapter/renderers.d.ts.map +1 -1
- package/lib/types/dsh-adapter/renderers.js +81 -46
- package/lib/types/dsh-adapter/scenes.d.ts +8 -4
- package/lib/types/dsh-adapter/scenes.d.ts.map +1 -1
- package/lib/types/dsh-adapter/scenes.js +136 -37
- package/lib/types/dsh-adapter/settings-sections.d.ts +7 -3
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +106 -26
- package/lib/types/dsh-adapter/shortcuts.d.ts +8 -10
- package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -1
- package/lib/types/dsh-adapter/shortcuts.js +108 -36
- package/lib/types/dsh-adapter/status.d.ts +6 -7
- package/lib/types/dsh-adapter/status.d.ts.map +1 -1
- package/lib/types/dsh-adapter/status.js +88 -22
- package/lib/types/dsh-adapter/workspaces.d.ts +16 -5
- package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -1
- package/lib/types/dsh-adapter/workspaces.js +287 -170
- package/lib/types/extensions.d.ts +10 -5
- package/lib/types/extensions.d.ts.map +1 -1
- package/lib/types/extensions.js +11 -5
- package/lib/types/force-production-react.d.ts +1 -0
- package/lib/types/force-production-react.d.ts.map +1 -0
- package/lib/types/force-production-react.js +12 -0
- package/lib/types/i18n.d.ts +14 -6
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +4 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/ink/components/App.d.ts +2 -0
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +4 -0
- package/lib/types/ink/ink.d.ts +20 -3
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +57 -5
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +128 -9
- package/lib/types/ink/output.d.ts +28 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +158 -12
- package/lib/types/ink/screen.d.ts +39 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +117 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +10 -2
- package/lib/types/ink/wrapAnsi.d.ts +1 -1
- package/lib/types/ink/wrapAnsi.d.ts.map +1 -1
- package/lib/types/ink/wrapAnsi.js +29 -2
- package/lib/types/plugin-host.d.ts +13 -11
- package/lib/types/plugin-host.d.ts.map +1 -1
- package/lib/types/plugin-host.js +16 -16
- package/lib/types/plugin-spec/registry.d.ts +2 -2
- package/lib/types/plugin-spec/registry.d.ts.map +1 -1
- package/lib/types/plugin-spec/registry.js +113 -18
- package/lib/types/plugin-spec/tui-extension.d.ts.map +1 -1
- package/lib/types/plugin-spec/tui-extension.js +2 -0
- package/lib/types/plugin-spec/validate.d.ts.map +1 -1
- package/lib/types/plugin-spec/validate.js +20 -1
- package/lib/types/scenes.d.ts +2 -1
- package/lib/types/scenes.d.ts.map +1 -1
- package/lib/types/scenes.js +1 -1
- package/lib/types/screens/Chat.d.ts +3 -3
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +38 -17
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
- package/lib/types/screens/SessionBrowser.js +10 -3
- package/lib/types/sessions/view.d.ts +3 -2
- package/lib/types/sessions/view.d.ts.map +1 -1
- package/lib/types/sessions/view.js +18 -0
- package/lib/types/settings-sections.d.ts +2 -1
- package/lib/types/settings-sections.d.ts.map +1 -1
- package/lib/types/settings-sections.js +1 -1
- package/lib/types/utils/execFileNoThrow.d.ts.map +1 -1
- package/lib/types/utils/execFileNoThrow.js +3 -0
- package/lib/types/workspaces.d.ts +2 -1
- package/lib/types/workspaces.d.ts.map +1 -1
- package/lib/types/workspaces.js +1 -1
- package/node_modules/@dsh-std/command/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/command/package.json +1 -1
- package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/connection/lib/memory.d.ts +1 -1
- package/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -1
- package/node_modules/@dsh-std/connection/lib/memory.js +1 -0
- package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/node_modules/@dsh-std/connection/package.json +1 -1
- package/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/core/package.json +1 -1
- package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -0
- package/node_modules/@dsh-std/manifest/package.json +1 -1
- package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/messages/package.json +1 -1
- package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -0
- package/node_modules/@dsh-std/presentation/README.md +2 -1
- package/node_modules/@dsh-std/presentation/README.zh.md +2 -1
- package/node_modules/@dsh-std/presentation/lib/callback.d.ts +2 -0
- package/node_modules/@dsh-std/presentation/lib/callback.js +179 -0
- package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -0
- package/node_modules/@dsh-std/presentation/lib/index.d.ts +44 -1
- package/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -1
- package/node_modules/@dsh-std/presentation/lib/index.js +6 -3
- package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/presentation/package.json +7 -3
- package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/storage/package.json +1 -1
- package/package.json +10 -5
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +2 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +2 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.d.ts +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js +179 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts +44 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js +6 -3
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +7 -3
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +1 -1
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +1 -1
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +1 -1
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +1 -1
- package/ecosystem-spec/registry/registry-0.15.json +0 -57
- /package/{ecosystem-spec → dsh-ecosystem-spec}/registry/contracts/decision-events-v1alpha1.json +0 -0
- /package/{ecosystem-spec → dsh-ecosystem-spec}/registry/host-descriptor.tui.example.json +0 -0
- /package/{ecosystem-spec → dsh-ecosystem-spec}/schemas/conformance-claim.schema.json +0 -0
- /package/{ecosystem-spec → dsh-ecosystem-spec}/schemas/effect-ledger-record.schema.json +0 -0
- /package/{ecosystem-spec → dsh-ecosystem-spec}/schemas/host-descriptor.schema.json +0 -0
|
@@ -7,211 +7,328 @@
|
|
|
7
7
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
8
|
import { basename, isAbsolute, resolve } from 'node:path';
|
|
9
9
|
import { Service } from '@deepseek-ai/cordis';
|
|
10
|
+
import { activationFiber, bindCallerEffect, compositionRoot, concreteService, requirePluginCaller } from './host-access.js';
|
|
10
11
|
export const name = 'dsh-tui-workspaces';
|
|
12
|
+
/** Bound every provider promise so one plugin cannot park workspace flows. */
|
|
13
|
+
export const WORKSPACE_PROVIDER_TIMEOUT_MS = 2000;
|
|
14
|
+
async function providerWithBudget(task, signal, timeoutMs = WORKSPACE_PROVIDER_TIMEOUT_MS) {
|
|
15
|
+
signal?.throwIfAborted();
|
|
16
|
+
let timer;
|
|
17
|
+
const work = Promise.resolve().then(task);
|
|
18
|
+
const timeout = new Promise(resolveTimeout => {
|
|
19
|
+
timer = setTimeout(() => resolveTimeout(undefined), timeoutMs);
|
|
20
|
+
});
|
|
21
|
+
try {
|
|
22
|
+
return await Promise.race([work, timeout]);
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
if (timer !== undefined)
|
|
26
|
+
clearTimeout(timer);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
11
29
|
/** Registry and local fallback shared by the TUI and workspace plugins. */
|
|
12
30
|
export class TuiWorkspaceRuntime extends Service {
|
|
13
|
-
providers = new Set();
|
|
14
|
-
providerWaiters = new Set();
|
|
15
31
|
constructor(ctx) {
|
|
16
32
|
super(ctx, 'tuiWorkspaces');
|
|
33
|
+
const runtime = this;
|
|
34
|
+
const state = {
|
|
35
|
+
hostContext: compositionRoot(ctx),
|
|
36
|
+
providers: new Set(),
|
|
37
|
+
providerOwners: new Map(),
|
|
38
|
+
providerWaiters: new Set(),
|
|
39
|
+
host: undefined,
|
|
40
|
+
};
|
|
41
|
+
state.host = Object.freeze({
|
|
42
|
+
list: (currentCwd, signal) => listWorkspaces(runtime, currentCwd, signal, undefined),
|
|
43
|
+
resolve: (reference, currentCwd, signal) => resolveWorkspace(runtime, reference, currentCwd ?? process.cwd(), signal, undefined),
|
|
44
|
+
describe: (cwd) => describeWorkspace(runtime, cwd, undefined),
|
|
45
|
+
commandShell: (cwd) => commandShellFor(runtime, cwd, undefined),
|
|
46
|
+
rename: (cwd, title) => renameWorkspace(runtime, cwd, title, undefined),
|
|
47
|
+
commands: () => workspaceCommands(runtime, undefined),
|
|
48
|
+
runCommand: (name, input, cwd, signal) => runWorkspaceCommand(runtime, name, input, cwd, signal, undefined),
|
|
49
|
+
});
|
|
50
|
+
workspaceStates.set(this, state);
|
|
17
51
|
}
|
|
18
52
|
register(provider) {
|
|
19
|
-
this.
|
|
53
|
+
const caller = requirePluginCaller(this.ctx, 'tuiWorkspaces.register', this);
|
|
54
|
+
const state = workspaceStateFor(this);
|
|
55
|
+
state.providers.add(provider);
|
|
56
|
+
const owner = activationFiber(caller);
|
|
57
|
+
if (owner === undefined) {
|
|
58
|
+
state.providers.delete(provider);
|
|
59
|
+
throw new Error('dsh-tui: tuiWorkspaces.register requires a live activation');
|
|
60
|
+
}
|
|
61
|
+
state.providerOwners.set(provider, owner);
|
|
20
62
|
this.notifyProviderWaiters();
|
|
21
|
-
|
|
22
|
-
|
|
63
|
+
const dispose = () => {
|
|
64
|
+
state.providers.delete(provider);
|
|
65
|
+
state.providerOwners.delete(provider);
|
|
23
66
|
this.notifyProviderWaiters();
|
|
24
67
|
};
|
|
68
|
+
bindCallerEffect(caller, dispose);
|
|
69
|
+
return dispose;
|
|
25
70
|
}
|
|
26
71
|
async list(currentCwd, signal) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
for (const provider of this.providers) {
|
|
30
|
-
try {
|
|
31
|
-
for (const target of await provider.list(signal))
|
|
32
|
-
targets.set(target.uri, this.withStoredTitle(target));
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
this.ctx.logger.warn(`dsh-tui: workspace provider list failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// The official registry is the durable catalog. Provider-owned aliases
|
|
39
|
-
// have already been added above with richer URI/badge metadata; remaining
|
|
40
|
-
// records are ordinary local workspaces.
|
|
41
|
-
for (const workspace of this.workspaceRegistry()?.list() ?? []) {
|
|
42
|
-
if ([...targets.values()].some(target => sameCwd(target.cwd, workspace.path)))
|
|
43
|
-
continue;
|
|
44
|
-
targets.set(localWorkspaceUri(workspace.path), {
|
|
45
|
-
...localWorkspaceTarget(workspace.path),
|
|
46
|
-
label: workspace.title,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
// The current local directory is always selectable, even in a bare TUI
|
|
50
|
-
// composition without dsh-workspace or another provider.
|
|
51
|
-
if (![...targets.values()].some(target => sameCwd(target.cwd, currentCwd))) {
|
|
52
|
-
const local = localWorkspaceTarget(currentCwd);
|
|
53
|
-
targets.set(local.uri, local);
|
|
54
|
-
}
|
|
55
|
-
return [...targets.values()].sort((left, right) => {
|
|
56
|
-
if (left.kind !== right.kind)
|
|
57
|
-
return left.kind === 'local' ? -1 : 1;
|
|
58
|
-
return left.label.localeCompare(right.label);
|
|
59
|
-
});
|
|
72
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.list');
|
|
73
|
+
return listWorkspaces(this, currentCwd, signal, owner);
|
|
60
74
|
}
|
|
61
75
|
/** Resolve a URI, briefly allowing concurrently mounted providers to register. */
|
|
62
76
|
async resolve(reference, currentCwd = process.cwd(), signal) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const deadline = Date.now() + 5000;
|
|
66
|
-
const scheme = uriScheme(reference);
|
|
67
|
-
if (scheme === undefined) {
|
|
68
|
-
const owner = [...this.providers].find((provider) => {
|
|
69
|
-
try {
|
|
70
|
-
return provider.describe(currentCwd) !== undefined;
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
if (owner !== undefined)
|
|
77
|
-
return owner.resolvePath?.(reference, currentCwd, signal);
|
|
78
|
-
return localWorkspaceTarget(resolve(currentCwd, reference));
|
|
79
|
-
}
|
|
80
|
-
const local = parseLocalWorkspaceReference(reference);
|
|
81
|
-
if (local !== undefined)
|
|
82
|
-
return local;
|
|
83
|
-
for (;;) {
|
|
84
|
-
signal?.throwIfAborted();
|
|
85
|
-
const owners = [...this.providers].filter(provider => provider.schemes.some(candidate => candidate.toLowerCase() === scheme));
|
|
86
|
-
for (const provider of owners) {
|
|
87
|
-
const target = await provider.resolve(reference, signal);
|
|
88
|
-
if (target !== undefined)
|
|
89
|
-
return target;
|
|
90
|
-
}
|
|
91
|
-
if (owners.length > 0)
|
|
92
|
-
return undefined;
|
|
93
|
-
if (Date.now() >= deadline)
|
|
94
|
-
return undefined;
|
|
95
|
-
await this.waitForProvider(Math.min(100, deadline - Date.now()), signal);
|
|
96
|
-
}
|
|
77
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.resolve');
|
|
78
|
+
return resolveWorkspace(this, reference, currentCwd, signal, owner);
|
|
97
79
|
}
|
|
98
80
|
describe(cwd) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
target = provider.describe(cwd);
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
this.ctx.logger.warn(`dsh-tui: workspace provider describe failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
if (target !== undefined)
|
|
109
|
-
return this.withStoredTitle(target);
|
|
110
|
-
}
|
|
111
|
-
return this.withStoredTitle(localWorkspaceTarget(cwd));
|
|
81
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.describe');
|
|
82
|
+
return describeWorkspace(this, cwd, owner);
|
|
112
83
|
}
|
|
113
84
|
async commandShell(cwd) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
85
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.commandShell');
|
|
86
|
+
return commandShellFor(this, cwd, owner);
|
|
87
|
+
}
|
|
88
|
+
async rename(cwd, title) {
|
|
89
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.rename');
|
|
90
|
+
return renameWorkspace(this, cwd, title, owner);
|
|
91
|
+
}
|
|
92
|
+
commands() {
|
|
93
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.commands');
|
|
94
|
+
return workspaceCommands(this, owner);
|
|
95
|
+
}
|
|
96
|
+
async runCommand(name, input, cwd, signal) {
|
|
97
|
+
const owner = workspaceCaller(this, 'tuiWorkspaces.runCommand');
|
|
98
|
+
return runWorkspaceCommand(this, name, input, cwd, signal, owner);
|
|
99
|
+
}
|
|
100
|
+
notifyProviderWaiters() {
|
|
101
|
+
const state = workspaceStateFor(this);
|
|
102
|
+
for (const waiter of state.providerWaiters)
|
|
103
|
+
waiter();
|
|
104
|
+
state.providerWaiters.clear();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const workspaceStates = new WeakMap();
|
|
108
|
+
function workspaceStateFor(runtime) {
|
|
109
|
+
const state = workspaceStates.get(concreteService(runtime));
|
|
110
|
+
if (state === undefined)
|
|
111
|
+
throw new Error('tuiWorkspaces host state is unavailable');
|
|
112
|
+
return state;
|
|
113
|
+
}
|
|
114
|
+
/** Resolve the host-only facade for channel/plugin bootstrap code. */
|
|
115
|
+
export function getHostWorkspaceRuntime(runtime) {
|
|
116
|
+
if (runtime === undefined)
|
|
117
|
+
return undefined;
|
|
118
|
+
try {
|
|
119
|
+
return workspaceStateFor(runtime).host;
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function workspaceCaller(runtime, capability) {
|
|
126
|
+
const caller = requirePluginCaller(runtimeContext(runtime), capability, runtime);
|
|
127
|
+
const owner = activationFiber(caller);
|
|
128
|
+
if (owner === undefined)
|
|
129
|
+
throw new Error(`dsh-tui: ${capability} requires a live activation`);
|
|
130
|
+
return owner;
|
|
131
|
+
}
|
|
132
|
+
function runtimeContext(runtime) {
|
|
133
|
+
return runtime.ctx;
|
|
134
|
+
}
|
|
135
|
+
function providersFor(state, owner) {
|
|
136
|
+
if (owner === undefined)
|
|
137
|
+
return [...state.providers];
|
|
138
|
+
return [...state.providers].filter(provider => state.providerOwners.get(provider) === owner);
|
|
139
|
+
}
|
|
140
|
+
async function listWorkspaces(runtime, currentCwd, signal, owner) {
|
|
141
|
+
signal?.throwIfAborted();
|
|
142
|
+
const state = workspaceStateFor(runtime);
|
|
143
|
+
const targets = new Map();
|
|
144
|
+
for (const provider of providersFor(state, owner)) {
|
|
145
|
+
try {
|
|
146
|
+
const listed = await providerWithBudget(() => provider.list(signal), signal);
|
|
147
|
+
if (listed === undefined)
|
|
121
148
|
continue;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
149
|
+
for (const target of listed)
|
|
150
|
+
targets.set(target.uri, withStoredTitle(runtime, target));
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
runtimeContext(runtime).logger.warn(`dsh-tui: workspace provider list failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
125
154
|
}
|
|
126
|
-
return undefined;
|
|
127
155
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
156
|
+
for (const workspace of workspaceRegistry(runtime)?.list() ?? []) {
|
|
157
|
+
if ([...targets.values()].some(target => sameCwd(target.cwd, workspace.path)))
|
|
158
|
+
continue;
|
|
159
|
+
targets.set(localWorkspaceUri(workspace.path), {
|
|
160
|
+
...localWorkspaceTarget(workspace.path),
|
|
161
|
+
label: workspace.title,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (![...targets.values()].some(target => sameCwd(target.cwd, currentCwd))) {
|
|
165
|
+
const local = localWorkspaceTarget(currentCwd);
|
|
166
|
+
targets.set(local.uri, local);
|
|
167
|
+
}
|
|
168
|
+
return [...targets.values()].sort((left, right) => {
|
|
169
|
+
if (left.kind !== right.kind)
|
|
170
|
+
return left.kind === 'local' ? -1 : 1;
|
|
171
|
+
return left.label.localeCompare(right.label);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async function resolveWorkspace(runtime, reference, currentCwd, signal, owner) {
|
|
175
|
+
const state = workspaceStateFor(runtime);
|
|
176
|
+
const providers = () => providersFor(state, owner);
|
|
177
|
+
if (isAbsolute(reference))
|
|
178
|
+
return localWorkspaceTarget(reference);
|
|
179
|
+
const deadline = Date.now() + 5000;
|
|
180
|
+
const scheme = uriScheme(reference);
|
|
181
|
+
if (scheme === undefined) {
|
|
182
|
+
const provider = providers().find(candidate => {
|
|
134
183
|
try {
|
|
135
|
-
|
|
184
|
+
return candidate.describe(currentCwd) !== undefined;
|
|
136
185
|
}
|
|
137
186
|
catch {
|
|
138
|
-
|
|
187
|
+
return false;
|
|
139
188
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
// failure notification instead of silently writing a local record.
|
|
146
|
-
const renamed = await provider.rename?.(cwd, normalizedTitle);
|
|
147
|
-
if (renamed !== undefined)
|
|
148
|
-
return this.withStoredTitle(renamed);
|
|
149
|
-
break;
|
|
189
|
+
});
|
|
190
|
+
if (provider !== undefined) {
|
|
191
|
+
return provider.resolvePath === undefined
|
|
192
|
+
? undefined
|
|
193
|
+
: providerWithBudget(() => provider.resolvePath(reference, currentCwd, signal), signal);
|
|
150
194
|
}
|
|
151
|
-
|
|
152
|
-
if (registry === undefined)
|
|
153
|
-
throw new Error('workspace registry is unavailable');
|
|
154
|
-
const workspace = registry.list().find(candidate => sameCwd(candidate.path, cwd))
|
|
155
|
-
?? await registry.create(cwd, normalizedTitle);
|
|
156
|
-
await workspace.setTitle(normalizedTitle);
|
|
157
|
-
return { ...this.describe(cwd), label: normalizedTitle };
|
|
195
|
+
return localWorkspaceTarget(resolve(currentCwd, reference));
|
|
158
196
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
197
|
+
const local = parseLocalWorkspaceReference(reference);
|
|
198
|
+
if (local !== undefined)
|
|
199
|
+
return local;
|
|
200
|
+
for (;;) {
|
|
201
|
+
signal?.throwIfAborted();
|
|
202
|
+
const owners = providers().filter(provider => provider.schemes.some(candidate => candidate.toLowerCase() === scheme));
|
|
203
|
+
for (const provider of owners) {
|
|
204
|
+
const target = await providerWithBudget(() => provider.resolve(reference, signal), signal, Math.max(1, deadline - Date.now()));
|
|
205
|
+
if (target !== undefined)
|
|
206
|
+
return target;
|
|
207
|
+
}
|
|
208
|
+
if (owners.length > 0)
|
|
209
|
+
return undefined;
|
|
210
|
+
if (Date.now() >= deadline)
|
|
211
|
+
return undefined;
|
|
212
|
+
await waitForProvider(runtime, Math.min(100, deadline - Date.now()), signal);
|
|
165
213
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
214
|
+
}
|
|
215
|
+
function describeWorkspace(runtime, cwd, owner) {
|
|
216
|
+
const state = workspaceStateFor(runtime);
|
|
217
|
+
for (const provider of providersFor(state, owner)) {
|
|
218
|
+
let target;
|
|
219
|
+
try {
|
|
220
|
+
target = provider.describe(cwd);
|
|
173
221
|
}
|
|
174
|
-
|
|
222
|
+
catch (error) {
|
|
223
|
+
runtimeContext(runtime).logger.warn(`dsh-tui: workspace provider describe failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (target !== undefined)
|
|
227
|
+
return withStoredTitle(runtime, target);
|
|
175
228
|
}
|
|
176
|
-
|
|
177
|
-
|
|
229
|
+
return withStoredTitle(runtime, localWorkspaceTarget(cwd));
|
|
230
|
+
}
|
|
231
|
+
async function commandShellFor(runtime, cwd, owner) {
|
|
232
|
+
const state = workspaceStateFor(runtime);
|
|
233
|
+
for (const provider of providersFor(state, owner)) {
|
|
234
|
+
let shell;
|
|
235
|
+
try {
|
|
236
|
+
shell = await providerWithBudget(() => provider.commandShell?.(cwd), undefined);
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
runtimeContext(runtime).logger.warn(`dsh-tui: workspace provider commandShell failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
if (shell !== undefined)
|
|
243
|
+
return shell;
|
|
178
244
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
245
|
+
return undefined;
|
|
246
|
+
}
|
|
247
|
+
async function renameWorkspace(runtime, cwd, title, owner) {
|
|
248
|
+
const normalizedTitle = title.trim();
|
|
249
|
+
if (normalizedTitle.length === 0)
|
|
250
|
+
throw new Error('workspace title must not be empty');
|
|
251
|
+
const state = workspaceStateFor(runtime);
|
|
252
|
+
let providerOwned = false;
|
|
253
|
+
for (const provider of providersFor(state, owner)) {
|
|
254
|
+
let owned = false;
|
|
255
|
+
try {
|
|
256
|
+
owned = provider.describe(cwd) !== undefined;
|
|
257
|
+
}
|
|
258
|
+
catch {
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
if (!owned)
|
|
262
|
+
continue;
|
|
263
|
+
providerOwned = true;
|
|
264
|
+
const renamed = await providerWithBudget(() => provider.rename?.(cwd, normalizedTitle), undefined);
|
|
265
|
+
if (renamed !== undefined)
|
|
266
|
+
return withStoredTitle(runtime, renamed);
|
|
267
|
+
break;
|
|
182
268
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
269
|
+
// A plugin may only mutate the durable title ledger for a workspace it
|
|
270
|
+
// owns. Host callers retain the historical local-registry behavior.
|
|
271
|
+
if (owner !== undefined && !providerOwned) {
|
|
272
|
+
throw new Error('workspace is not owned by the calling activation');
|
|
187
273
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
};
|
|
210
|
-
const timer = setTimeout(finish, timeoutMs);
|
|
211
|
-
this.providerWaiters.add(finish);
|
|
212
|
-
signal?.addEventListener('abort', abort, { once: true });
|
|
213
|
-
});
|
|
274
|
+
const registry = workspaceRegistry(runtime);
|
|
275
|
+
if (registry === undefined)
|
|
276
|
+
throw new Error('workspace registry is unavailable');
|
|
277
|
+
const workspace = registry.list().find(candidate => sameCwd(candidate.path, cwd))
|
|
278
|
+
?? await registry.create(cwd, normalizedTitle);
|
|
279
|
+
await workspace.setTitle(normalizedTitle);
|
|
280
|
+
return { ...describeWorkspace(runtime, cwd, owner), label: normalizedTitle };
|
|
281
|
+
}
|
|
282
|
+
function workspaceCommands(runtime, owner) {
|
|
283
|
+
return providersFor(workspaceStateFor(runtime), owner).flatMap(provider => provider.commands ?? []).map(command => ({
|
|
284
|
+
name: command.name,
|
|
285
|
+
aliases: command.aliases,
|
|
286
|
+
description: command.description,
|
|
287
|
+
}));
|
|
288
|
+
}
|
|
289
|
+
async function runWorkspaceCommand(runtime, name, input, cwd, signal, owner) {
|
|
290
|
+
const normalized = name.toLowerCase();
|
|
291
|
+
for (const provider of providersFor(workspaceStateFor(runtime), owner)) {
|
|
292
|
+
const command = provider.commands?.find(candidate => candidate.name.toLowerCase() === normalized
|
|
293
|
+
|| candidate.aliases?.some(alias => alias.toLowerCase() === normalized));
|
|
294
|
+
if (command !== undefined)
|
|
295
|
+
return providerWithBudget(() => command.run(input, { cwd }, signal), signal);
|
|
214
296
|
}
|
|
297
|
+
return undefined;
|
|
298
|
+
}
|
|
299
|
+
function workspaceRegistry(runtime) {
|
|
300
|
+
return workspaceStateFor(runtime).hostContext.get('workspaceRegistry');
|
|
301
|
+
}
|
|
302
|
+
function withStoredTitle(runtime, target) {
|
|
303
|
+
const workspace = workspaceRegistry(runtime)?.list().find(candidate => sameCwd(candidate.path, target.cwd));
|
|
304
|
+
return workspace === undefined ? target : { ...target, label: workspace.title };
|
|
305
|
+
}
|
|
306
|
+
function waitForProvider(runtime, timeoutMs, signal) {
|
|
307
|
+
if (timeoutMs <= 0)
|
|
308
|
+
return Promise.resolve();
|
|
309
|
+
return new Promise((resolveWait, reject) => {
|
|
310
|
+
let settled = false;
|
|
311
|
+
const finish = () => {
|
|
312
|
+
if (settled)
|
|
313
|
+
return;
|
|
314
|
+
settled = true;
|
|
315
|
+
clearTimeout(timer);
|
|
316
|
+
signal?.removeEventListener('abort', abort);
|
|
317
|
+
workspaceStateFor(runtime).providerWaiters.delete(finish);
|
|
318
|
+
resolveWait();
|
|
319
|
+
};
|
|
320
|
+
const abort = () => {
|
|
321
|
+
if (settled)
|
|
322
|
+
return;
|
|
323
|
+
settled = true;
|
|
324
|
+
clearTimeout(timer);
|
|
325
|
+
workspaceStateFor(runtime).providerWaiters.delete(finish);
|
|
326
|
+
reject(signal?.reason instanceof Error ? signal.reason : new Error('workspace resolution aborted'));
|
|
327
|
+
};
|
|
328
|
+
const timer = setTimeout(finish, timeoutMs);
|
|
329
|
+
workspaceStateFor(runtime).providerWaiters.add(finish);
|
|
330
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
331
|
+
});
|
|
215
332
|
}
|
|
216
333
|
/** Local-only fallback for direct embedders that call createChannel() without
|
|
217
334
|
* mounting the optional workspace registry/provider service. */
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export * from './dsh-adapter/extensions.js';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
2
|
+
export { DECISION_HANDLER_TIMEOUT_MS, DECISION_TOTAL_TIMEOUT_MS, normalizeCancelDecision, } from './dsh-adapter/extension-events.js';
|
|
3
|
+
export type { TuiDecisionContext, TuiInputEvent, TuiInputDecision, TuiRewindPromptEvent, TuiRewindMode, TuiRewindPromptDecision, TuiRewindDoneEvent, TuiSessionSwitchEvent, TuiSessionSwitchDecision, TuiSessionSwitchedEvent, TuiCompactEvent, TuiCompactDecision, } from './dsh-adapter/extension-events.js';
|
|
4
|
+
export { DIALOG_DEFAULT_TIMEOUT_MS, INPUT_CELLS, TuiDialogRuntime, TuiDialogStore, } from './dsh-adapter/dialogs.js';
|
|
5
|
+
export type { TuiDialogAnswer, TuiDialogBase, TuiDialogConfirmRequest, TuiDialogInputRequest, TuiDialogSelectOption, TuiDialogSelectRequest, TuiDialogSnapshot, } from './dsh-adapter/dialogs.js';
|
|
6
|
+
export { TuiStatusRuntime, TuiStatusStore } from './dsh-adapter/status.js';
|
|
7
|
+
export type { TuiStatusEntry } from './dsh-adapter/status.js';
|
|
8
|
+
export { matchShortcut, parseShortcutCombo, TuiShortcutRuntime } from './dsh-adapter/shortcuts.js';
|
|
9
|
+
export type { TuiShortcutKey, TuiShortcutOptions } from './dsh-adapter/shortcuts.js';
|
|
10
|
+
export { TuiRendererRuntime } from './dsh-adapter/renderers.js';
|
|
11
|
+
export type { TuiEntryRenderer, TuiEntryRenderResult } from './dsh-adapter/renderers.js';
|
|
7
12
|
export { DECISION_EVENT_PERMISSIONS } from './dsh-adapter/decision-guard.js';
|
|
8
13
|
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/extensions.ts"],"names":[],"mappings":"AAMA,cAAc,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/extensions.ts"],"names":[],"mappings":"AAMA,cAAc,6BAA6B,CAAA;AAI3C,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,mCAAmC,CAAA;AAC1C,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,GACnB,MAAM,mCAAmC,CAAA;AAI1C,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,gBAAgB,EAChB,cAAc,GACf,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC1E,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAClG,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAGxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA"}
|
package/lib/types/extensions.js
CHANGED
|
@@ -5,11 +5,17 @@
|
|
|
5
5
|
// applies the `declare module '@deepseek-ai/cordis'` augmentation for the
|
|
6
6
|
// decision events and the four service properties on Context.
|
|
7
7
|
export * from './dsh-adapter/extensions.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
8
|
+
// Decision dispatch is a host/channel operation. Export only the event
|
|
9
|
+
// vocabulary and safe normalizers; dispatching an arbitrary payload through
|
|
10
|
+
// this module would let a plugin trigger every other plugin's handlers.
|
|
11
|
+
export { DECISION_HANDLER_TIMEOUT_MS, DECISION_TOTAL_TIMEOUT_MS, normalizeCancelDecision, } from './dsh-adapter/extension-events.js';
|
|
12
|
+
// Keep host accessors out of the plugin-facing export. The implementation
|
|
13
|
+
// modules expose them only so the TUI host can wire Chat/channel; exporting
|
|
14
|
+
// them here would let a plugin recover the private queue/store/dispatcher.
|
|
15
|
+
export { DIALOG_DEFAULT_TIMEOUT_MS, INPUT_CELLS, TuiDialogRuntime, TuiDialogStore, } from './dsh-adapter/dialogs.js';
|
|
16
|
+
export { TuiStatusRuntime, TuiStatusStore } from './dsh-adapter/status.js';
|
|
17
|
+
export { matchShortcut, parseShortcutCombo, TuiShortcutRuntime } from './dsh-adapter/shortcuts.js';
|
|
18
|
+
export { TuiRendererRuntime } from './dsh-adapter/renderers.js';
|
|
13
19
|
// The D-7 permission vocabulary (which grant each decision event needs) is
|
|
14
20
|
// part of the plugin-facing contract too.
|
|
15
21
|
export { DECISION_EVENT_PERMISSIONS } from './dsh-adapter/decision-guard.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=force-production-react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"force-production-react.d.ts","sourceRoot":"","sources":["../../src/force-production-react.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* React-reconciler selects its dev/production build at require time from
|
|
4
|
+
* NODE_ENV; the dev build records one performance.measure() per render into
|
|
5
|
+
* an unbounded buffer — the 4 GB long-session OOM (b1e06d8). Every launcher
|
|
6
|
+
* forces production, but a direct `dsh --profile dsh-tui` boot loads this
|
|
7
|
+
* plugin without one and silently regressed to the dev build. This module
|
|
8
|
+
* must stay the FIRST import of the package entry so its body runs before
|
|
9
|
+
* any module in the plugin graph requires react. `??=` keeps an explicit
|
|
10
|
+
* environment choice (a debugging session) in control.
|
|
11
|
+
*/
|
|
12
|
+
process.env.NODE_ENV ??= 'production';
|
package/lib/types/i18n.d.ts
CHANGED
|
@@ -439,6 +439,14 @@ declare const dict: {
|
|
|
439
439
|
readonly zh: "已加载上下文";
|
|
440
440
|
readonly en: "Context loaded";
|
|
441
441
|
};
|
|
442
|
+
readonly 'context-panel-expand': {
|
|
443
|
+
readonly zh: "展开";
|
|
444
|
+
readonly en: "Expand";
|
|
445
|
+
};
|
|
446
|
+
readonly 'context-panel-collapse': {
|
|
447
|
+
readonly zh: "折叠";
|
|
448
|
+
readonly en: "Collapse";
|
|
449
|
+
};
|
|
442
450
|
readonly 'copied-chars': {
|
|
443
451
|
readonly zh: "已复制 {{n}} 个字符";
|
|
444
452
|
readonly en: "Copied {{n}} characters";
|
|
@@ -807,6 +815,10 @@ declare const dict: {
|
|
|
807
815
|
readonly zh: "镜像 registry 滞后:本次安装 v{{latest}};官方最新 v{{authoritative}},镜像同步后可再 /update。";
|
|
808
816
|
readonly en: "Mirror registry lag: installing v{{latest}} now; official latest is v{{authoritative}} — run /update again once the mirror syncs.";
|
|
809
817
|
};
|
|
818
|
+
readonly 'streaming-folded': {
|
|
819
|
+
readonly zh: "…(前 {{count}} 字符流式期间已折叠,落定后完整显示)";
|
|
820
|
+
readonly en: "…(first {{count}} chars folded while streaming; full text renders once the turn settles)";
|
|
821
|
+
};
|
|
810
822
|
readonly 'vim-not-implemented': {
|
|
811
823
|
readonly zh: "vim 模式暂未实现";
|
|
812
824
|
readonly en: "vim mode not implemented yet";
|
|
@@ -1315,10 +1327,6 @@ declare const dict: {
|
|
|
1315
1327
|
readonly zh: "无法读取会话列表 · {{err}}";
|
|
1316
1328
|
readonly en: "Could not read the session list · {{err}}";
|
|
1317
1329
|
};
|
|
1318
|
-
readonly 'session-resume-refused': {
|
|
1319
|
-
readonly zh: "无法恢复这个会话——原因已记录在对话里(模型正在工作时无法切换)";
|
|
1320
|
-
readonly en: "That session could not be resumed — the reason is in the conversation (switching is refused while the model is working)";
|
|
1321
|
-
};
|
|
1322
1330
|
readonly 'session-resume-failed': {
|
|
1323
1331
|
readonly zh: "恢复会话失败 · {{err}}";
|
|
1324
1332
|
readonly en: "Resuming the session failed · {{err}}";
|
|
@@ -1664,8 +1672,8 @@ declare const dict: {
|
|
|
1664
1672
|
readonly en: "Not parseable JSON: {{err}}";
|
|
1665
1673
|
};
|
|
1666
1674
|
readonly 'plugins-check-spec-unavailable': {
|
|
1667
|
-
readonly zh: "vendored 规范数据不可用(ecosystem-spec/),无法校验。";
|
|
1668
|
-
readonly en: "Vendored spec data unavailable (ecosystem-spec/); cannot validate.";
|
|
1675
|
+
readonly zh: "vendored 规范数据不可用(dsh-ecosystem-spec/),无法校验。";
|
|
1676
|
+
readonly en: "Vendored spec data unavailable (dsh-ecosystem-spec/); cannot validate.";
|
|
1669
1677
|
};
|
|
1670
1678
|
readonly 'plugins-check-schema-failed': {
|
|
1671
1679
|
readonly zh: "schema 校验失败:{{err}}";
|
package/lib/types/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAI9B,+DAA+D;AAC/D,eAAO,MAAM,KAAK,uBAAwB,CAAA;AAE1C,QAAA,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAI9B,+DAA+D;AAC/D,eAAO,MAAM,KAAK,uBAAwB,CAAA;AAE1C,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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