@deepseek-harness-tui/dsh-tui 0.20.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/bin/dsh-tui.js +26 -8
- package/guide/dsh-tui-guide/claude-backend.en.md +6 -5
- package/guide/dsh-tui-guide/claude-backend.md +5 -5
- package/guide/dsh-tui-guide/configuration.en.md +1 -1
- package/guide/dsh-tui-guide/configuration.md +1 -1
- package/guide/dsh-tui-guide/getting-started.en.md +2 -2
- package/guide/dsh-tui-guide/getting-started.md +2 -2
- package/guide/dsh-tui-guide/migrate.en.md +5 -0
- package/guide/dsh-tui-guide/migrate.md +4 -0
- package/guide/dsh-tui-guide/plugins.en.md +17 -1
- package/guide/dsh-tui-guide/plugins.md +12 -1
- package/guide/dsh-tui-guide/user-guide.en.md +1 -1
- package/guide/dsh-tui-guide/user-guide.md +1 -1
- package/lib/settings.json +1 -1
- package/lib/types/adapter/kernel/host-facade.d.ts +3 -1
- package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -1
- package/lib/types/adapter/kernel/host-facade.js +6 -0
- package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
- package/lib/types/adapter/kernel/runtime.js +5 -0
- package/lib/types/adapter/kernel/slices/extensions.d.ts +1 -0
- package/lib/types/adapter/kernel/slices/extensions.d.ts.map +1 -1
- package/lib/types/adapter/kernel/slices/extensions.js +6 -1
- package/lib/types/adapter/kernel/slices/index.d.ts +1 -1
- package/lib/types/adapter/kernel/slices/index.d.ts.map +1 -1
- package/lib/types/adapter/kernel/slices/index.js +3 -2
- package/lib/types/adapter/ports/channel-catalog.d.ts +19 -0
- package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
- package/lib/types/adapter/ports/extensions.d.ts +9 -0
- package/lib/types/adapter/ports/extensions.d.ts.map +1 -1
- package/lib/types/adapter/ports/index.d.ts +1 -1
- package/lib/types/adapter/ports/index.d.ts.map +1 -1
- package/lib/types/adapter/upstream/extensions-driver.d.ts +4 -1
- package/lib/types/adapter/upstream/extensions-driver.d.ts.map +1 -1
- package/lib/types/adapter/upstream/extensions-driver.js +111 -1
- package/lib/types/adapter/upstream/index.d.ts +1 -1
- package/lib/types/adapter/upstream/index.d.ts.map +1 -1
- package/lib/types/adapter/upstream/index.js +1 -1
- package/lib/types/api.d.ts +1 -1
- package/lib/types/api.d.ts.map +1 -1
- package/lib/types/backends/claude/backend.d.ts.map +1 -1
- package/lib/types/backends/claude/backend.js +7 -2
- package/lib/types/components/FileSuggestions.d.ts +2 -2
- package/lib/types/components/FileSuggestions.d.ts.map +1 -1
- package/lib/types/components/FileSuggestions.js +25 -5
- package/lib/types/components/PromptInput.d.ts +7 -1
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +81 -23
- package/lib/types/dsh-adapter/childStderr.d.ts +1 -1
- package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
- package/lib/types/dsh-adapter/childStderr.js +5 -0
- package/lib/types/dsh-adapter/contract.d.ts +9 -5
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +11 -4
- package/lib/types/dsh-adapter/extensions.d.ts +3 -2
- package/lib/types/dsh-adapter/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/extensions.js +5 -2
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.js +1 -1
- package/lib/types/dsh-adapter/host-dsh.d.ts +4 -0
- package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-dsh.js +26 -0
- package/lib/types/dsh-adapter/mention-providers.d.ts +91 -0
- package/lib/types/dsh-adapter/mention-providers.d.ts.map +1 -0
- package/lib/types/dsh-adapter/mention-providers.js +214 -0
- package/lib/types/dsh-adapter/migrate/entry.d.ts +2 -0
- package/lib/types/dsh-adapter/migrate/entry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/entry.js +46 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +3 -0
- package/lib/types/extensions.d.ts +2 -0
- package/lib/types/extensions.d.ts.map +1 -1
- package/lib/types/extensions.js +4 -1
- package/lib/types/i18n.d.ts +6 -2
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +3 -1
- package/lib/types/screens/Chat.d.ts +4 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +2 -2
- package/lib/types/utils/fileSuggestions.d.ts +14 -3
- package/lib/types/utils/fileSuggestions.d.ts.map +1 -1
- package/lib/types/utils/fileSuggestions.js +33 -0
- package/package.json +114 -109
- package/tui-profile/feed/README.md +1 -1
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Primary validated upstream line (newest). */
|
|
2
|
-
export declare const UPSTREAM_VALIDATED_VERSION = "0.2.2-rc.
|
|
2
|
+
export declare const UPSTREAM_VALIDATED_VERSION = "0.2.2-rc.3";
|
|
3
3
|
/**
|
|
4
4
|
* The host CLI package whose installation `/update` aligns with the TUI.
|
|
5
5
|
* Re-exported here (the literal stays in host-contract.ts) so engine planning
|
|
@@ -15,10 +15,14 @@ export declare const UPSTREAM_HOST_PEER_PACKAGE: "@deepseek-ai/dsh-app-boot";
|
|
|
15
15
|
/**
|
|
16
16
|
* Explicitly supported upstream prerelease lines, oldest first.
|
|
17
17
|
*
|
|
18
|
-
* 0.2.2-rc.
|
|
18
|
+
* 0.2.2-rc.3 = primary continuous-CI line (a release-train bump: the
|
|
19
|
+
* published code is identical to rc.2 apart from the web-only
|
|
20
|
+
* deepseek-chat-import bundle and one Cordis API catalog entry, so the
|
|
21
|
+
* replica and patch surfaces are unchanged);
|
|
22
|
+
* 0.2.2-rc.2 = previous 0.2.2 prerelease (AgentTeam moved into dsh-base
|
|
19
23
|
* with a per-session switch and named subagents, account notifications
|
|
20
24
|
* replaced the bonus API, DeepSeek Search/Fetch split their settings);
|
|
21
|
-
* 0.2.2-rc.1 =
|
|
25
|
+
* 0.2.2-rc.1 = earlier 0.2.2 prerelease (the model-selection projection,
|
|
22
26
|
* Agent.model seam and PromptPresentation split land there); 0.2.1-rc.5 =
|
|
23
27
|
* previous family still source-checked where CI covers it; 0.2.1-rc.4/rc.3/rc.2 = earlier
|
|
24
28
|
* prereleases of the same family (published code compared with the primary);
|
|
@@ -36,14 +40,14 @@ export declare const UPSTREAM_HOST_PEER_PACKAGE: "@deepseek-ai/dsh-app-boot";
|
|
|
36
40
|
* The peer range in package.json is deliberately wider than this list: an
|
|
37
41
|
* install on an older or newer line is allowed but reports drift at boot.
|
|
38
42
|
*/
|
|
39
|
-
export declare const UPSTREAM_VALIDATED_VERSIONS: readonly ["0.1.0-rc.6", "0.1.0-rc.7", "0.1.0-rc.8", "0.1.1-rc.1", "0.1.1-rc.2", "0.1.2-alpha.3", "0.1.2-alpha.4", "0.1.2-alpha.5", "0.1.2-rc.1", "0.1.3-alpha.2", "0.1.5-alpha.1", "0.1.5-alpha.2", "0.1.5-rc.1", "0.1.7-rc.1", "0.1.7-rc.2", "0.2.0-rc.1", "0.2.0-rc.2", "0.2.1-rc.2", "0.2.1-rc.3", "0.2.1-rc.4", "0.2.1-rc.5", "0.2.2-rc.1", "0.2.2-rc.2"];
|
|
43
|
+
export declare const UPSTREAM_VALIDATED_VERSIONS: readonly ["0.1.0-rc.6", "0.1.0-rc.7", "0.1.0-rc.8", "0.1.1-rc.1", "0.1.1-rc.2", "0.1.2-alpha.3", "0.1.2-alpha.4", "0.1.2-alpha.5", "0.1.2-rc.1", "0.1.3-alpha.2", "0.1.5-alpha.1", "0.1.5-alpha.2", "0.1.5-rc.1", "0.1.7-rc.1", "0.1.7-rc.2", "0.2.0-rc.1", "0.2.0-rc.2", "0.2.1-rc.2", "0.2.1-rc.3", "0.2.1-rc.4", "0.2.1-rc.5", "0.2.2-rc.1", "0.2.2-rc.2", "0.2.2-rc.3"];
|
|
40
44
|
/**
|
|
41
45
|
* Framework packages version on their own lines; the contract validates
|
|
42
46
|
* their MAJOR (breaking surface), not the harness prerelease number.
|
|
43
47
|
*/
|
|
44
48
|
export declare const UPSTREAM_FRAMEWORK_MAJORS: Record<string, number>;
|
|
45
49
|
/** Official packages the adapter consumes at runtime or as types. */
|
|
46
|
-
export declare const UPSTREAM_BLESSED_PACKAGES: readonly ["@deepseek-ai/cordis", "@deepseek-ai/schemastery", "@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-preset-registry", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-ptc-runtime-node", "@deepseek-ai/dsh-commands", "@deepseek-ai/dsh-cordis-host-runner", "@deepseek-ai/dsh-deepseek-account", "@deepseek-ai/dsh-host-webserver", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-pi-ai", "@deepseek-ai/dsh-persona", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-storage", "@deepseek-ai/dsh-storage-domain", "@deepseek-ai/dsh-storage-json", "@deepseek-ai/dsh-workspace", "@deepseek-ai/dsh-web-app", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-terminal", "@deepseek-ai/dsh-terminal-bash", "@deepseek-ai/dsh-tool-ask-user", "@deepseek-ai/dsh-tool-bash-persistent", "@deepseek-ai/dsh-tool-cordis", "@deepseek-ai/dsh-tool-subagent", "@deepseek-ai/dsh-user-approval", "@deepseek-ai/dsh-user-questions", "@deepseek-ai/dsh-app-boot", "@deepseek-ai/dsh-cmdline", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-http-proxy", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-plugin-manager"];
|
|
50
|
+
export declare const UPSTREAM_BLESSED_PACKAGES: readonly ["@deepseek-ai/cordis", "@deepseek-ai/schemastery", "@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-preset-registry", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-ptc-runtime-node", "@deepseek-ai/dsh-commands", "@deepseek-ai/dsh-cordis-host-runner", "@deepseek-ai/dsh-deepseek-account", "@deepseek-ai/dsh-host-webserver", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-pi-ai", "@deepseek-ai/dsh-persona", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-session-persistence-jsonl", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-storage", "@deepseek-ai/dsh-storage-domain", "@deepseek-ai/dsh-storage-json", "@deepseek-ai/dsh-workspace", "@deepseek-ai/dsh-web-app", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-terminal", "@deepseek-ai/dsh-terminal-bash", "@deepseek-ai/dsh-tool-ask-user", "@deepseek-ai/dsh-tool-bash-persistent", "@deepseek-ai/dsh-tool-cordis", "@deepseek-ai/dsh-tool-subagent", "@deepseek-ai/dsh-user-approval", "@deepseek-ai/dsh-user-questions", "@deepseek-ai/dsh-app-boot", "@deepseek-ai/dsh-cmdline", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-http-proxy", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-plugin-manager"];
|
|
47
51
|
export interface UpstreamDriftEntry {
|
|
48
52
|
package: string;
|
|
49
53
|
installed: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/contract.ts"],"names":[],"mappings":"AAoBA,gDAAgD;AAChD,eAAO,MAAM,0BAA0B,eAAe,CAAA;AAEtD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,qBAAe,CAAA;AAUjD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,6BAA4B,CA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wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAE9F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,GAAG,SAAS,CAQ3D;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,GAAG,SAAS,CAM9D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAKnF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,iBAAiB,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAA+B,GAC5F,MAAM,EAAE,CAQV;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,iBAAiB,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAA+B,GAC5F,kBAAkB,EAAE,CAuBtB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEtE,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,iBAAiB,CAAA;IACvB,sFAAsF;IACtF,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,iBAAiB,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAA+B,GAC5F,oBAAoB,GAAG,SAAS,CA0BlC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Upstream compatibility contract.
|
|
3
3
|
*
|
|
4
4
|
* The TUI is validated against a set of upstream prerelease lines — the
|
|
5
|
-
* current primary (0.2.2-rc.
|
|
5
|
+
* current primary (0.2.2-rc.3) plus older lines kept in backward
|
|
6
6
|
* compatibility across the 0.2.0, 0.1.7, 0.1.5, 0.1.3, 0.1.2, 0.1.1 and 0.1.0
|
|
7
7
|
* release families.
|
|
8
8
|
* Every official package this adapter touches is blessed here; anything
|
|
@@ -18,7 +18,7 @@ import { dirname } from 'node:path';
|
|
|
18
18
|
import { fileURLToPath } from 'node:url';
|
|
19
19
|
import { ADAPTER_TYPE_PACKAGES, HOST_MODULES, HOST_PACKAGE, HOST_TYPE_PACKAGES } from './host-contract.js';
|
|
20
20
|
/** Primary validated upstream line (newest). */
|
|
21
|
-
export const UPSTREAM_VALIDATED_VERSION = '0.2.2-rc.
|
|
21
|
+
export const UPSTREAM_VALIDATED_VERSION = '0.2.2-rc.3';
|
|
22
22
|
/**
|
|
23
23
|
* The host CLI package whose installation `/update` aligns with the TUI.
|
|
24
24
|
* Re-exported here (the literal stays in host-contract.ts) so engine planning
|
|
@@ -41,10 +41,14 @@ export const UPSTREAM_HOST_PEER_PACKAGE = APP_BOOT_MODULE.specifier;
|
|
|
41
41
|
/**
|
|
42
42
|
* Explicitly supported upstream prerelease lines, oldest first.
|
|
43
43
|
*
|
|
44
|
-
* 0.2.2-rc.
|
|
44
|
+
* 0.2.2-rc.3 = primary continuous-CI line (a release-train bump: the
|
|
45
|
+
* published code is identical to rc.2 apart from the web-only
|
|
46
|
+
* deepseek-chat-import bundle and one Cordis API catalog entry, so the
|
|
47
|
+
* replica and patch surfaces are unchanged);
|
|
48
|
+
* 0.2.2-rc.2 = previous 0.2.2 prerelease (AgentTeam moved into dsh-base
|
|
45
49
|
* with a per-session switch and named subagents, account notifications
|
|
46
50
|
* replaced the bonus API, DeepSeek Search/Fetch split their settings);
|
|
47
|
-
* 0.2.2-rc.1 =
|
|
51
|
+
* 0.2.2-rc.1 = earlier 0.2.2 prerelease (the model-selection projection,
|
|
48
52
|
* Agent.model seam and PromptPresentation split land there); 0.2.1-rc.5 =
|
|
49
53
|
* previous family still source-checked where CI covers it; 0.2.1-rc.4/rc.3/rc.2 = earlier
|
|
50
54
|
* prereleases of the same family (published code compared with the primary);
|
|
@@ -86,6 +90,7 @@ export const UPSTREAM_VALIDATED_VERSIONS = [
|
|
|
86
90
|
'0.2.1-rc.5',
|
|
87
91
|
'0.2.2-rc.1',
|
|
88
92
|
'0.2.2-rc.2',
|
|
93
|
+
'0.2.2-rc.3',
|
|
89
94
|
];
|
|
90
95
|
/**
|
|
91
96
|
* Framework packages version on their own lines; the contract validates
|
|
@@ -113,6 +118,7 @@ export const UPSTREAM_BLESSED_PACKAGES = [
|
|
|
113
118
|
'@deepseek-ai/dsh-persona',
|
|
114
119
|
'@deepseek-ai/dsh-scope',
|
|
115
120
|
'@deepseek-ai/dsh-session',
|
|
121
|
+
'@deepseek-ai/dsh-session-persistence-jsonl',
|
|
116
122
|
'@deepseek-ai/dsh-settings',
|
|
117
123
|
'@deepseek-ai/dsh-skill',
|
|
118
124
|
'@deepseek-ai/dsh-storage',
|
|
@@ -144,6 +150,7 @@ const OPTIONAL_RUNTIME_PACKAGES = new Set([
|
|
|
144
150
|
'@deepseek-ai/dsh-deepseek-account',
|
|
145
151
|
'@deepseek-ai/dsh-host-webserver',
|
|
146
152
|
'@deepseek-ai/dsh-web-app',
|
|
153
|
+
'@deepseek-ai/dsh-session-persistence-jsonl',
|
|
147
154
|
// Never resolved from this package at run time: the standalone entry loads
|
|
148
155
|
// them from the installed dsh by realpath (./host-dsh.ts), and a profile
|
|
149
156
|
// has no copy of them (peers are not auto-installed there).
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - `ctx.tuiRenderers` — custom session-entry text renderers
|
|
14
14
|
* - `ctx.tuiToast` — transient fire-and-forget notifications
|
|
15
15
|
* - `ctx.tuiThemes` — runtime theme declarations (host-readable)
|
|
16
|
+
* - `ctx.tuiMentions` — plugin rows in the composer's `@` completion
|
|
16
17
|
*
|
|
17
18
|
* The decision-point events (`tui/input`, `tui/rewind-prompt`, …) need no
|
|
18
19
|
* separate service — they are fired by the channel and answered through the
|
|
@@ -27,8 +28,8 @@
|
|
|
27
28
|
*
|
|
28
29
|
* Every consumer (`channel.ts`, `Chat.tsx`) reads these with `ctx.get`
|
|
29
30
|
* softly: without this row the TUI degrades to no dialogs/status/shortcuts/
|
|
30
|
-
* renderers/themes, and plugin.ts logs the skew warning once
|
|
31
|
-
* launches.
|
|
31
|
+
* renderers/themes/plugin mentions, and plugin.ts logs the skew warning once
|
|
32
|
+
* for profile launches.
|
|
32
33
|
*/
|
|
33
34
|
import { Context } from '@deepseek-ai/cordis';
|
|
34
35
|
export declare const name = "dsh-tui-extensions";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/extensions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAY7C,eAAO,MAAM,IAAI,uBAAuB,CAAA;AAExC,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CASxC"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - `ctx.tuiRenderers` — custom session-entry text renderers
|
|
14
14
|
* - `ctx.tuiToast` — transient fire-and-forget notifications
|
|
15
15
|
* - `ctx.tuiThemes` — runtime theme declarations (host-readable)
|
|
16
|
+
* - `ctx.tuiMentions` — plugin rows in the composer's `@` completion
|
|
16
17
|
*
|
|
17
18
|
* The decision-point events (`tui/input`, `tui/rewind-prompt`, …) need no
|
|
18
19
|
* separate service — they are fired by the channel and answered through the
|
|
@@ -27,8 +28,8 @@
|
|
|
27
28
|
*
|
|
28
29
|
* Every consumer (`channel.ts`, `Chat.tsx`) reads these with `ctx.get`
|
|
29
30
|
* softly: without this row the TUI degrades to no dialogs/status/shortcuts/
|
|
30
|
-
* renderers/themes, and plugin.ts logs the skew warning once
|
|
31
|
-
* launches.
|
|
31
|
+
* renderers/themes/plugin mentions, and plugin.ts logs the skew warning once
|
|
32
|
+
* for profile launches.
|
|
32
33
|
*/
|
|
33
34
|
import TuiDialogRuntime from './dialogs.js';
|
|
34
35
|
import TuiStatusRuntime from './status.js';
|
|
@@ -36,6 +37,7 @@ import TuiShortcutRuntime from './shortcuts.js';
|
|
|
36
37
|
import TuiRendererRuntime from './renderers.js';
|
|
37
38
|
import TuiToastRuntime from './toast.js';
|
|
38
39
|
import TuiThemeRuntime from './themes.js';
|
|
40
|
+
import TuiMentionRuntime from './mention-providers.js';
|
|
39
41
|
import { installDecisionGuard } from './decision-guard.js';
|
|
40
42
|
import { readGrantStore } from '../adapter/standard/grants.js';
|
|
41
43
|
import { adapterRuntimeFor } from '../adapter/kernel/runtime-context.js';
|
|
@@ -48,4 +50,5 @@ export function apply(ctx) {
|
|
|
48
50
|
ctx.plugin(TuiRendererRuntime);
|
|
49
51
|
ctx.plugin(TuiToastRuntime);
|
|
50
52
|
ctx.plugin(TuiThemeRuntime);
|
|
53
|
+
ctx.plugin(TuiMentionRuntime);
|
|
51
54
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/** The host CLI package whose installation the entry loads. */
|
|
8
8
|
export declare const HOST_PACKAGE = "@deepseek-ai/dsh";
|
|
9
9
|
/** The host line the reproduced pieces were checked against (host-replica.snapshot.json). */
|
|
10
|
-
export declare const HOST_REPLICA_VERSION = "0.2.2-rc.
|
|
10
|
+
export declare const HOST_REPLICA_VERSION = "0.2.2-rc.3";
|
|
11
11
|
/** Where the entry resolves a host module from. */
|
|
12
12
|
export type HostModuleVia =
|
|
13
13
|
/** The host package's own `createRequire` (its nested node_modules). */
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/** The host CLI package whose installation the entry loads. */
|
|
8
8
|
export const HOST_PACKAGE = '@deepseek-ai/dsh';
|
|
9
9
|
/** The host line the reproduced pieces were checked against (host-replica.snapshot.json). */
|
|
10
|
-
export const HOST_REPLICA_VERSION = '0.2.2-rc.
|
|
10
|
+
export const HOST_REPLICA_VERSION = '0.2.2-rc.3';
|
|
11
11
|
/** The host modules the entry loads, all from one installation, in load order. */
|
|
12
12
|
export const HOST_MODULES = [
|
|
13
13
|
{ key: 'cordis', specifier: '@deepseek-ai/cordis', via: 'host', exports: ['Context'] },
|
|
@@ -95,6 +95,10 @@ export interface PrepareHostRootOptions {
|
|
|
95
95
|
/** Routes `ctx.appExit(code)` to the TUI's exit funnel; the bounded `shutdown` when unfilled or refused. */
|
|
96
96
|
readonly exitSeam?: ProcessExitSeam;
|
|
97
97
|
}
|
|
98
|
+
/** Install only package resolution for a child command, without composing or
|
|
99
|
+
* rewriting its profile. Even loadProfileDirectory can migrate the manifest,
|
|
100
|
+
* so use the resolver's supported synthetic profile instead. */
|
|
101
|
+
export declare function prepareHostModuleResolution(host: HostDsh, profileDir: string): Promise<Context>;
|
|
98
102
|
export declare function prepareHostRoot(host: HostDsh, options: PrepareHostRootOptions): Promise<HostRoot>;
|
|
99
103
|
/** A composition failure, with the startup report saved for it. */
|
|
100
104
|
export declare class HostComposeError extends Error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-dsh.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/host-dsh.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,KAAK,OAAO,MAAM,2BAA2B,CAAA;AACzD,OAAO,KAAK,KAAK,SAAS,MAAM,6BAA6B,CAAA;AAC7D,OAAO,KAAK,KAAK,OAAO,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,KAAK,SAAS,MAAM,6BAA6B,CAAA;AAG7D,OAAO,EAAE,YAAY,EAAgB,MAAM,oBAAoB,CAAA;AAE/D,OAAO,EAA+B,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAOrF,KAAK,IAAI,GAAG,CAAC,I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IACH,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,EAAE,MAAM,IAAI,CAAA;IACtC,uEAAuE;IACvE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,yBAAyB;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,4GAA4G;IAC5G,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAA;CACpC;AAED;;gEAEgE;AAChE,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBrG;AAuBD,wBAAsB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqJvG;AAED,mEAAmE;AACnE,qBAAa,gBAAiB,SAAQ,KAAK;IAE7B,QAAQ,CAAC,QAAQ,EAAE,OAAO;IADtC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;gBACf,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS;CAKpE"}
|
|
@@ -214,6 +214,32 @@ export async function loadHostDsh(packageDir = undefined) {
|
|
|
214
214
|
httpProxy: module('httpProxy'),
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
+
/** Install only package resolution for a child command, without composing or
|
|
218
|
+
* rewriting its profile. Even loadProfileDirectory can migrate the manifest,
|
|
219
|
+
* so use the resolver's supported synthetic profile instead. */
|
|
220
|
+
export async function prepareHostModuleResolution(host, profileDir) {
|
|
221
|
+
const profile = {
|
|
222
|
+
name: basename(profileDir),
|
|
223
|
+
dir: profileDir,
|
|
224
|
+
layers: [],
|
|
225
|
+
patchPath: join(profileDir, 'cordis.patch.yml'),
|
|
226
|
+
patches: [],
|
|
227
|
+
skippedBundles: [],
|
|
228
|
+
};
|
|
229
|
+
const resolution = await host.appBoot.createRuntimeResolution({
|
|
230
|
+
installAnchor: host.profileBoot.INSTALL_ANCHOR,
|
|
231
|
+
profile,
|
|
232
|
+
});
|
|
233
|
+
const ctx = new host.Context();
|
|
234
|
+
try {
|
|
235
|
+
await ctx.plugin(host.appBoot.PluginPackages, { resolution });
|
|
236
|
+
return ctx;
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
await ctx.fiber.dispose().catch(() => undefined);
|
|
240
|
+
throw error;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
217
243
|
/**
|
|
218
244
|
* Build the entry's root from the host's `cordis` and install the host's
|
|
219
245
|
* module resolution on it before any TUI module is imported, so the TUI and
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin `@`-mention providers (`ctx.tuiMentions`): optional plugins add rows
|
|
3
|
+
* to the composer's `@` completion popup next to the workspace files — a
|
|
4
|
+
* Blender bridge offering scene objects, an issue tracker offering tickets.
|
|
5
|
+
*
|
|
6
|
+
* The seam is completion-only. A chosen row replaces the typed `@query` with
|
|
7
|
+
* the provider's plain `insertText`; nothing is resolved or attached at submit
|
|
8
|
+
* time, so the file-mention expander never sees provider rows (an item whose
|
|
9
|
+
* `insertText` would itself parse as an `@` mention is dropped at ingress).
|
|
10
|
+
*
|
|
11
|
+
* Same split as the command-tree seam: a host-only facade the composer
|
|
12
|
+
* queries, plus a thin cordis service that validates untrusted registrations
|
|
13
|
+
* and binds each provider to its caller's activation, so a disposed or
|
|
14
|
+
* hot-reloaded plugin leaves no rows behind.
|
|
15
|
+
*
|
|
16
|
+
* Provider calls are untrusted and optional UI: every call gets its own
|
|
17
|
+
* AbortSignal (aborted when the query moves on or the call times out), late
|
|
18
|
+
* results are dropped, a throwing or rejecting provider contributes nothing,
|
|
19
|
+
* and the failure goes to the opt-in `DSH_TUI_DEBUG` log, never the screen.
|
|
20
|
+
*/
|
|
21
|
+
import { Context, Service } from '@deepseek-ai/cordis';
|
|
22
|
+
import type { ProvidedMentionCandidate } from '../adapter/ports/channel-catalog.js';
|
|
23
|
+
/** One completion row a provider offers for the current query. */
|
|
24
|
+
export interface TuiMentionItem {
|
|
25
|
+
/** Row text; single line, at most 80 cells after sanitization. */
|
|
26
|
+
readonly label: string;
|
|
27
|
+
/** Dim trailing hint (kind, location); at most 40 cells. */
|
|
28
|
+
readonly detail?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Plain single-line text that replaces the typed `@query` (the host adds
|
|
31
|
+
* the trailing space). At most 200 characters, and it must not contain an
|
|
32
|
+
* `@` mention token of its own — such an item is dropped.
|
|
33
|
+
*/
|
|
34
|
+
readonly insertText: string;
|
|
35
|
+
}
|
|
36
|
+
/** A plugin's `@` completion source. */
|
|
37
|
+
export interface TuiMentionProvider {
|
|
38
|
+
/** Unique provider id, `^[a-z][a-z0-9_-]*$`. */
|
|
39
|
+
readonly id: string;
|
|
40
|
+
/** Shown beside every row this provider contributes; at most 40 cells. */
|
|
41
|
+
readonly title: string;
|
|
42
|
+
/**
|
|
43
|
+
* Rows for `query` (the text after `@`, possibly empty). `signal` aborts
|
|
44
|
+
* when the user keeps typing or the call outlives its time budget; results
|
|
45
|
+
* that arrive after that are ignored.
|
|
46
|
+
*/
|
|
47
|
+
complete(query: string, signal: AbortSignal): readonly TuiMentionItem[] | Promise<readonly TuiMentionItem[]>;
|
|
48
|
+
}
|
|
49
|
+
/** Admission and per-call bounds, exported so docs and the battery agree. */
|
|
50
|
+
export declare const MENTION_PROVIDER_LIMITS: Readonly<{
|
|
51
|
+
/** Providers one plugin activation may hold at once. */
|
|
52
|
+
perActivation: 4;
|
|
53
|
+
/** Providers the whole host holds at once. */
|
|
54
|
+
total: 16;
|
|
55
|
+
/** Rows taken from one provider per query. */
|
|
56
|
+
itemsPerProvider: 50;
|
|
57
|
+
/** Per-call budget; a slower provider contributes nothing for that query. */
|
|
58
|
+
timeoutMs: 300;
|
|
59
|
+
titleCells: 40;
|
|
60
|
+
labelCells: 80;
|
|
61
|
+
detailCells: 40;
|
|
62
|
+
insertTextChars: 200;
|
|
63
|
+
}>;
|
|
64
|
+
/** Host-only access. Plugins see only `register` on the traceable service;
|
|
65
|
+
* the composer queries every provider through this facade. */
|
|
66
|
+
export interface TuiMentionHost {
|
|
67
|
+
register(provider: TuiMentionProvider): () => void;
|
|
68
|
+
/** Registered provider count; the composer skips the query at zero. */
|
|
69
|
+
size(): number;
|
|
70
|
+
/** Every provider's rows for `query`, in registration order. */
|
|
71
|
+
complete(query: string, signal: AbortSignal): Promise<readonly ProvidedMentionCandidate[]>;
|
|
72
|
+
}
|
|
73
|
+
declare module '@deepseek-ai/cordis' {
|
|
74
|
+
interface Context {
|
|
75
|
+
tuiMentions: TuiMentionRuntime;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export declare const name = "dsh-tui-mentions";
|
|
79
|
+
/**
|
|
80
|
+
* `ctx.tuiMentions` — plugin `@` completion providers. `register` throws on a
|
|
81
|
+
* malformed provider, a duplicate id or an exhausted budget (registration is
|
|
82
|
+
* a programming error, unlike a per-query failure, which only logs).
|
|
83
|
+
*/
|
|
84
|
+
export declare class TuiMentionRuntime extends Service {
|
|
85
|
+
constructor(ctx: Context);
|
|
86
|
+
register(provider: TuiMentionProvider): () => void;
|
|
87
|
+
}
|
|
88
|
+
/** Host-only facade accessor; not part of the package export map. */
|
|
89
|
+
export declare function getHostMentions(runtime: TuiMentionRuntime | undefined): TuiMentionHost | undefined;
|
|
90
|
+
export default TuiMentionRuntime;
|
|
91
|
+
//# sourceMappingURL=mention-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mention-providers.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/mention-providers.ts"],"names":[],"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B,CAAA;AAkBtC;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,OAAO;gBAChC,GAAG,EAAE,OAAO;IAkBxB,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,IAAI;CAYnD;AAqHD,qEAAqE;AACrE,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAOlG;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin `@`-mention providers (`ctx.tuiMentions`): optional plugins add rows
|
|
3
|
+
* to the composer's `@` completion popup next to the workspace files — a
|
|
4
|
+
* Blender bridge offering scene objects, an issue tracker offering tickets.
|
|
5
|
+
*
|
|
6
|
+
* The seam is completion-only. A chosen row replaces the typed `@query` with
|
|
7
|
+
* the provider's plain `insertText`; nothing is resolved or attached at submit
|
|
8
|
+
* time, so the file-mention expander never sees provider rows (an item whose
|
|
9
|
+
* `insertText` would itself parse as an `@` mention is dropped at ingress).
|
|
10
|
+
*
|
|
11
|
+
* Same split as the command-tree seam: a host-only facade the composer
|
|
12
|
+
* queries, plus a thin cordis service that validates untrusted registrations
|
|
13
|
+
* and binds each provider to its caller's activation, so a disposed or
|
|
14
|
+
* hot-reloaded plugin leaves no rows behind.
|
|
15
|
+
*
|
|
16
|
+
* Provider calls are untrusted and optional UI: every call gets its own
|
|
17
|
+
* AbortSignal (aborted when the query moves on or the call times out), late
|
|
18
|
+
* results are dropped, a throwing or rejecting provider contributes nothing,
|
|
19
|
+
* and the failure goes to the opt-in `DSH_TUI_DEBUG` log, never the screen.
|
|
20
|
+
*/
|
|
21
|
+
import { Service } from '@deepseek-ai/cordis';
|
|
22
|
+
import { extractMentions } from '../utils/mentions.js';
|
|
23
|
+
import { logForDebugging } from '../utils/debug.js';
|
|
24
|
+
import { cleanStatusFieldText } from './sanitize.js';
|
|
25
|
+
import { activationFiber, bindCallerEffect, compositionRoot, concreteService, requirePluginCaller } from './host-access.js';
|
|
26
|
+
import { adapterRuntimeFor } from '../adapter/kernel/runtime-context.js';
|
|
27
|
+
import { assertCapabilityShadowPolicy, } from '../adapter/kernel/runtime.js';
|
|
28
|
+
/** Admission and per-call bounds, exported so docs and the battery agree. */
|
|
29
|
+
export const MENTION_PROVIDER_LIMITS = Object.freeze({
|
|
30
|
+
/** Providers one plugin activation may hold at once. */
|
|
31
|
+
perActivation: 4,
|
|
32
|
+
/** Providers the whole host holds at once. */
|
|
33
|
+
total: 16,
|
|
34
|
+
/** Rows taken from one provider per query. */
|
|
35
|
+
itemsPerProvider: 50,
|
|
36
|
+
/** Per-call budget; a slower provider contributes nothing for that query. */
|
|
37
|
+
timeoutMs: 300,
|
|
38
|
+
titleCells: 40,
|
|
39
|
+
labelCells: 80,
|
|
40
|
+
detailCells: 40,
|
|
41
|
+
insertTextChars: 200,
|
|
42
|
+
});
|
|
43
|
+
const PROVIDER_ID = /^[a-z][a-z0-9_-]*$/u;
|
|
44
|
+
export const name = 'dsh-tui-mentions';
|
|
45
|
+
const mentionStates = new WeakMap();
|
|
46
|
+
/**
|
|
47
|
+
* `ctx.tuiMentions` — plugin `@` completion providers. `register` throws on a
|
|
48
|
+
* malformed provider, a duplicate id or an exhausted budget (registration is
|
|
49
|
+
* a programming error, unlike a per-query failure, which only logs).
|
|
50
|
+
*/
|
|
51
|
+
export class TuiMentionRuntime extends Service {
|
|
52
|
+
constructor(ctx) {
|
|
53
|
+
super(ctx, 'tuiMentions');
|
|
54
|
+
compositionRoot(ctx);
|
|
55
|
+
const runtime = this;
|
|
56
|
+
const state = { runtime: adapterRuntimeFor(ctx), providers: new Map(), host: undefined };
|
|
57
|
+
state.host = Object.freeze({
|
|
58
|
+
register: (provider) => {
|
|
59
|
+
const state = mentionStateFor(runtime);
|
|
60
|
+
const entry = admit(state, provider, undefined);
|
|
61
|
+
state.providers.set(entry.id, entry);
|
|
62
|
+
return () => release(state, entry);
|
|
63
|
+
},
|
|
64
|
+
size: () => mentionStateFor(runtime).providers.size,
|
|
65
|
+
complete: (query, signal) => completeAll(mentionStateFor(runtime), query, signal),
|
|
66
|
+
});
|
|
67
|
+
mentionStates.set(this, state);
|
|
68
|
+
}
|
|
69
|
+
register(provider) {
|
|
70
|
+
const state = mentionStateFor(this);
|
|
71
|
+
assertCapabilityShadowPolicy('host.mentions.register', state.runtime.mode, state.runtime.slices);
|
|
72
|
+
const caller = requirePluginCaller(this.ctx, 'tuiMentions.register', this);
|
|
73
|
+
const owner = activationFiber(caller);
|
|
74
|
+
if (owner === undefined)
|
|
75
|
+
throw new Error('dsh-tui: tuiMentions.register requires a live activation');
|
|
76
|
+
const entry = admit(state, provider, owner);
|
|
77
|
+
state.providers.set(entry.id, entry);
|
|
78
|
+
const dispose = () => release(state, entry);
|
|
79
|
+
bindCallerEffect(caller, dispose);
|
|
80
|
+
return dispose;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** Validate one registration against shape and budgets; throws on refusal. */
|
|
84
|
+
function admit(state, provider, owner) {
|
|
85
|
+
if (provider === null || typeof provider !== 'object')
|
|
86
|
+
throw new TypeError('tuiMentions.register expects a provider object');
|
|
87
|
+
const id = typeof provider.id === 'string' ? provider.id : '';
|
|
88
|
+
if (!PROVIDER_ID.test(id))
|
|
89
|
+
throw new TypeError(`invalid TUI mention provider id: ${String(provider.id)}`);
|
|
90
|
+
if (typeof provider.complete !== 'function')
|
|
91
|
+
throw new TypeError(`TUI mention provider "${id}" needs a complete() function`);
|
|
92
|
+
const title = cleanStatusFieldText(provider.title, MENTION_PROVIDER_LIMITS.titleCells);
|
|
93
|
+
if (title === '')
|
|
94
|
+
throw new TypeError(`TUI mention provider "${id}" needs a non-empty title`);
|
|
95
|
+
if (state.providers.has(id))
|
|
96
|
+
throw new Error(`TUI mention provider "${id}" is already registered`);
|
|
97
|
+
if (state.providers.size >= MENTION_PROVIDER_LIMITS.total) {
|
|
98
|
+
throw new Error(`TUI mention providers are capped at ${MENTION_PROVIDER_LIMITS.total}; "${id}" was refused`);
|
|
99
|
+
}
|
|
100
|
+
if (owner !== undefined) {
|
|
101
|
+
let held = 0;
|
|
102
|
+
for (const entry of state.providers.values())
|
|
103
|
+
if (entry.owner === owner)
|
|
104
|
+
held += 1;
|
|
105
|
+
if (held >= MENTION_PROVIDER_LIMITS.perActivation) {
|
|
106
|
+
throw new Error(`TUI mention providers are capped at ${MENTION_PROVIDER_LIMITS.perActivation} per plugin; "${id}" was refused`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { id, title, provider, owner };
|
|
110
|
+
}
|
|
111
|
+
function release(state, entry) {
|
|
112
|
+
if (state.providers.get(entry.id) === entry)
|
|
113
|
+
state.providers.delete(entry.id);
|
|
114
|
+
}
|
|
115
|
+
async function completeAll(state, query, signal) {
|
|
116
|
+
if (state.providers.size === 0 || signal.aborted)
|
|
117
|
+
return [];
|
|
118
|
+
const settled = await Promise.all([...state.providers.values()].map(entry => completeOne(entry, query, signal)));
|
|
119
|
+
return signal.aborted ? [] : settled.flat();
|
|
120
|
+
}
|
|
121
|
+
/** One provider call under its own signal and time budget. Never rejects. */
|
|
122
|
+
async function completeOne(entry, query, outer) {
|
|
123
|
+
const controller = new AbortController();
|
|
124
|
+
const abort = () => controller.abort();
|
|
125
|
+
outer.addEventListener('abort', abort, { once: true });
|
|
126
|
+
let timer;
|
|
127
|
+
try {
|
|
128
|
+
const timeout = new Promise(resolve => {
|
|
129
|
+
timer = setTimeout(() => {
|
|
130
|
+
controller.abort();
|
|
131
|
+
resolve(undefined);
|
|
132
|
+
}, MENTION_PROVIDER_LIMITS.timeoutMs);
|
|
133
|
+
});
|
|
134
|
+
// `then` turns a synchronous throw into a rejection the catch below sees.
|
|
135
|
+
const call = Promise.resolve().then(() => entry.provider.complete(query, controller.signal));
|
|
136
|
+
const result = await Promise.race([call, timeout]);
|
|
137
|
+
if (controller.signal.aborted) {
|
|
138
|
+
if (!outer.aborted)
|
|
139
|
+
logForDebugging('tuiMentions provider timed out', { id: entry.id, timeoutMs: MENTION_PROVIDER_LIMITS.timeoutMs });
|
|
140
|
+
return [];
|
|
141
|
+
}
|
|
142
|
+
return normalizeItems(entry, result);
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
if (!controller.signal.aborted) {
|
|
146
|
+
logForDebugging('tuiMentions provider failed', { id: entry.id, error: error instanceof Error ? error.message : String(error) });
|
|
147
|
+
}
|
|
148
|
+
return [];
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
clearTimeout(timer);
|
|
152
|
+
outer.removeEventListener('abort', abort);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/** Sanitize one provider's rows; malformed rows are skipped, not fatal. */
|
|
156
|
+
function normalizeItems(entry, result) {
|
|
157
|
+
if (!Array.isArray(result)) {
|
|
158
|
+
logForDebugging('tuiMentions provider returned a non-array', { id: entry.id });
|
|
159
|
+
return [];
|
|
160
|
+
}
|
|
161
|
+
const out = [];
|
|
162
|
+
const seen = new Set();
|
|
163
|
+
for (const raw of result.slice(0, MENTION_PROVIDER_LIMITS.itemsPerProvider)) {
|
|
164
|
+
try {
|
|
165
|
+
if (raw === null || typeof raw !== 'object')
|
|
166
|
+
continue;
|
|
167
|
+
const item = raw;
|
|
168
|
+
const label = cleanStatusFieldText(item.label, MENTION_PROVIDER_LIMITS.labelCells);
|
|
169
|
+
const insertText = cleanStatusFieldText(item.insertText, Number.POSITIVE_INFINITY);
|
|
170
|
+
if (label === '' || insertText === '')
|
|
171
|
+
continue;
|
|
172
|
+
if (insertText.length > MENTION_PROVIDER_LIMITS.insertTextChars)
|
|
173
|
+
continue;
|
|
174
|
+
if (extractMentions(insertText).length > 0)
|
|
175
|
+
continue;
|
|
176
|
+
const detail = item.detail === undefined ? '' : cleanStatusFieldText(item.detail, MENTION_PROVIDER_LIMITS.detailCells);
|
|
177
|
+
const id = `${entry.id}\u0000${label}\u0000${insertText}`;
|
|
178
|
+
if (seen.has(id))
|
|
179
|
+
continue;
|
|
180
|
+
seen.add(id);
|
|
181
|
+
out.push({
|
|
182
|
+
id,
|
|
183
|
+
kind: 'provided',
|
|
184
|
+
providerId: entry.id,
|
|
185
|
+
section: entry.title,
|
|
186
|
+
label,
|
|
187
|
+
...(detail === '' ? {} : { detail }),
|
|
188
|
+
insertText,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
// A throwing getter on one row must not cost the provider its others.
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
function mentionStateFor(runtime) {
|
|
198
|
+
const state = mentionStates.get(concreteService(runtime));
|
|
199
|
+
if (state === undefined)
|
|
200
|
+
throw new Error('tuiMentions host state is unavailable');
|
|
201
|
+
return state;
|
|
202
|
+
}
|
|
203
|
+
/** Host-only facade accessor; not part of the package export map. */
|
|
204
|
+
export function getHostMentions(runtime) {
|
|
205
|
+
if (runtime === undefined)
|
|
206
|
+
return undefined;
|
|
207
|
+
try {
|
|
208
|
+
return mentionStateFor(runtime).host;
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
return undefined;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
export default TuiMentionRuntime;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/migrate/entry.ts"],"names":[],"mappings":"AAYA,wBAAsB,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgC7F"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Child processes do not inherit the TUI's package resolution hooks. Install
|
|
3
|
+
* the host resolver before the first import of migration's framework peers.
|
|
4
|
+
*/
|
|
5
|
+
import { loadHostDsh, prepareHostModuleResolution } from '../host-dsh.js';
|
|
6
|
+
const reasonOf = (value) => value instanceof Error ? value.message : String(value);
|
|
7
|
+
/** Keep a directly written diagnostic on one line. */
|
|
8
|
+
const flat = (value) => reasonOf(value).replace(/[\x00-\x1f\x7f-\x9f]/g, ' ').replace(/\s+/g, ' ').trim();
|
|
9
|
+
export async function cliMigrate(argv, profileDir) {
|
|
10
|
+
let root;
|
|
11
|
+
let hostError;
|
|
12
|
+
try {
|
|
13
|
+
root = await prepareHostModuleResolution(await loadHostDsh(), profileDir);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
// Development installs and older hosts may already resolve their peers
|
|
17
|
+
// directly. Try that path once: a failed ESM import cannot be retried
|
|
18
|
+
// reliably because Node caches rejected module jobs.
|
|
19
|
+
hostError = error;
|
|
20
|
+
}
|
|
21
|
+
let failed = false;
|
|
22
|
+
let exitCode;
|
|
23
|
+
try {
|
|
24
|
+
const { cliMigrate: run } = await import('./cli.js');
|
|
25
|
+
exitCode = await run(argv);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
failed = true;
|
|
29
|
+
if (hostError === undefined)
|
|
30
|
+
throw error;
|
|
31
|
+
throw new Error(`${reasonOf(error)}; host module resolution: ${reasonOf(hostError)}`, { cause: error });
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
try {
|
|
35
|
+
await root?.fiber.dispose();
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
// The migration already ran: a cleanup failure must not turn a finished
|
|
39
|
+
// run into "could not run". Keep the original error on the failure path.
|
|
40
|
+
if (!failed) {
|
|
41
|
+
process.stderr.write(`dsh-tui: migrate finished; host module resolution cleanup failed: ${flat(error)}\n`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return exitCode;
|
|
46
|
+
}
|