@deepseek-ai/dsh-client-ui-commands 0.1.3-alpha.2 → 0.1.5-alpha.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/lib/client.js +53 -27
- package/lib/types/client/contract.d.ts +2 -2
- package/lib/types/client/locales.d.ts +12 -0
- package/lib/types/client/service.d.ts +2 -0
- package/package.json +15 -15
package/lib/client.js
CHANGED
|
@@ -159,6 +159,43 @@ window.__ModuleLoader__.load({
|
|
|
159
159
|
return signal.reason instanceof Error ? signal.reason : /* @__PURE__ */ new Error("command directory wait aborted");
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
|
162
|
+
//#region lib/types/client/locales.js
|
|
163
|
+
/** `command` namespace dictionaries (the popupSelect shell's copy). */
|
|
164
|
+
/** Simplified Chinese dictionary (the key-set source of truth). */
|
|
165
|
+
const zh = {
|
|
166
|
+
"description.compact": "压缩以上对话内容",
|
|
167
|
+
"description.export": "将当前会话内容导出为 ZIP",
|
|
168
|
+
"description.feedback": "发送关于当前会话的反馈",
|
|
169
|
+
"description.goal": "设置或查看长期任务目标",
|
|
170
|
+
"description.permission": "切换权限预设(沙箱模式与审批策略)",
|
|
171
|
+
"description.plan": "进入或退出计划模式",
|
|
172
|
+
"search.placeholder": "搜索…",
|
|
173
|
+
"search.aria": "筛选选项",
|
|
174
|
+
"status.loading": "正在加载选项…",
|
|
175
|
+
"status.applying": "正在应用…",
|
|
176
|
+
"status.empty": "无选项",
|
|
177
|
+
"overlay.aria": "/{command} 选项",
|
|
178
|
+
"listbox.aria": "/{command} 匹配项",
|
|
179
|
+
"notice.attachmentsUnsupported": "/{command} 不接受附件,请先移除附件"
|
|
180
|
+
};
|
|
181
|
+
/** English dictionary, checked complete against the zh key set. */
|
|
182
|
+
const en = {
|
|
183
|
+
"description.compact": "Compact older conversation history",
|
|
184
|
+
"description.export": "Download this Session log as a ZIP archive",
|
|
185
|
+
"description.feedback": "record feedback about this session",
|
|
186
|
+
"description.goal": "set or view the goal for a long-running task",
|
|
187
|
+
"description.permission": "Switch the permission preset (sandbox mode + approval policy)",
|
|
188
|
+
"description.plan": "Enter or leave plan mode",
|
|
189
|
+
"search.placeholder": "Search…",
|
|
190
|
+
"search.aria": "Filter options",
|
|
191
|
+
"status.loading": "Loading options…",
|
|
192
|
+
"status.applying": "Applying…",
|
|
193
|
+
"status.empty": "No options",
|
|
194
|
+
"overlay.aria": "/{command} options",
|
|
195
|
+
"listbox.aria": "/{command} matches",
|
|
196
|
+
"notice.attachmentsUnsupported": "/{command} does not accept attachments; remove them first"
|
|
197
|
+
};
|
|
198
|
+
//#endregion
|
|
162
199
|
//#region lib/types/client/popup.js
|
|
163
200
|
/**
|
|
164
201
|
* Headless popupSelect shell state: one controller per client
|
|
@@ -444,6 +481,15 @@ window.__ModuleLoader__.load({
|
|
|
444
481
|
const separator = trimmed.search(/\s/u);
|
|
445
482
|
return (separator === -1 ? trimmed : trimmed.slice(0, separator)).slice(1);
|
|
446
483
|
}
|
|
484
|
+
/** Locale keys for the canonical first-party Host command descriptions. */
|
|
485
|
+
const HOST_DESCRIPTION_KEYS = new Map([
|
|
486
|
+
["compact", "description.compact"],
|
|
487
|
+
["export", "description.export"],
|
|
488
|
+
["feedback", "description.feedback"],
|
|
489
|
+
["goal", "description.goal"],
|
|
490
|
+
["permission", "description.permission"],
|
|
491
|
+
["plan", "description.plan"]
|
|
492
|
+
]);
|
|
447
493
|
/** Command surface: session-keyed directory + '/' source + contribution registry + per-session popups. */
|
|
448
494
|
var CommandUiRuntime = class extends _deepseek_ai_cordis.Service {
|
|
449
495
|
static inject = [
|
|
@@ -593,7 +639,7 @@ window.__ModuleLoader__.load({
|
|
|
593
639
|
seen.add(c.name);
|
|
594
640
|
rows.push({
|
|
595
641
|
name: c.name,
|
|
596
|
-
description: c
|
|
642
|
+
description: this.hostDescription(c),
|
|
597
643
|
...c.input !== void 0 ? { hint: c.input.hint } : {}
|
|
598
644
|
});
|
|
599
645
|
}
|
|
@@ -602,11 +648,16 @@ window.__ModuleLoader__.load({
|
|
|
602
648
|
if (seen.has(contribution.name)) throw new Error(`ui-commands: contribution /${contribution.name} collides with a host command`);
|
|
603
649
|
rows.push({
|
|
604
650
|
name: contribution.name,
|
|
605
|
-
description: contribution.description
|
|
651
|
+
description: contribution.description()
|
|
606
652
|
});
|
|
607
653
|
}
|
|
608
654
|
return (0, _deepseek_ai_dsh_client_ui_primitives.rankByName)(rows.filter((c) => req.position === "leading" || c.hint === void 0), req.query);
|
|
609
655
|
}
|
|
656
|
+
/** Translate exact built-in Host copy while preserving scoped or third-party descriptors verbatim. */
|
|
657
|
+
hostDescription(command) {
|
|
658
|
+
const key = HOST_DESCRIPTION_KEYS.get(command.name);
|
|
659
|
+
return key !== void 0 && command.description === en[key] ? this.t(key) : command.description;
|
|
660
|
+
}
|
|
610
661
|
/** Decision table, menu column: contribution/decorated-host → popup; host input → claim; host bare → detached execute. */
|
|
611
662
|
dispatch(pick) {
|
|
612
663
|
const name = pick.candidate.name;
|
|
@@ -1023,31 +1074,6 @@ window.__ModuleLoader__.load({
|
|
|
1023
1074
|
})] });
|
|
1024
1075
|
}
|
|
1025
1076
|
//#endregion
|
|
1026
|
-
//#region lib/types/client/locales.js
|
|
1027
|
-
/** `command` namespace dictionaries (the popupSelect shell's copy). */
|
|
1028
|
-
/** Simplified Chinese dictionary (the key-set source of truth). */
|
|
1029
|
-
const zh = {
|
|
1030
|
-
"search.placeholder": "搜索…",
|
|
1031
|
-
"search.aria": "筛选选项",
|
|
1032
|
-
"status.loading": "正在加载选项…",
|
|
1033
|
-
"status.applying": "正在应用…",
|
|
1034
|
-
"status.empty": "无选项",
|
|
1035
|
-
"overlay.aria": "/{command} 选项",
|
|
1036
|
-
"listbox.aria": "/{command} 匹配项",
|
|
1037
|
-
"notice.attachmentsUnsupported": "/{command} 不接受附件,请先移除附件"
|
|
1038
|
-
};
|
|
1039
|
-
/** English dictionary, checked complete against the zh key set. */
|
|
1040
|
-
const en = {
|
|
1041
|
-
"search.placeholder": "Search…",
|
|
1042
|
-
"search.aria": "Filter options",
|
|
1043
|
-
"status.loading": "Loading options…",
|
|
1044
|
-
"status.applying": "Applying…",
|
|
1045
|
-
"status.empty": "No options",
|
|
1046
|
-
"overlay.aria": "/{command} options",
|
|
1047
|
-
"listbox.aria": "/{command} matches",
|
|
1048
|
-
"notice.attachmentsUnsupported": "/{command} does not accept attachments; remove them first"
|
|
1049
|
-
};
|
|
1050
|
-
//#endregion
|
|
1051
1077
|
//#region lib/types/client/index.js
|
|
1052
1078
|
/** Dictionary namespace owned by this plugin. */
|
|
1053
1079
|
const NS = "command";
|
|
@@ -42,8 +42,8 @@ export type CommandUiSpec = {
|
|
|
42
42
|
export interface CommandContribution {
|
|
43
43
|
/** Command name without the leading slash (unique across contributions). */
|
|
44
44
|
readonly name: string;
|
|
45
|
-
/**
|
|
46
|
-
readonly description: string;
|
|
45
|
+
/** Resolve the localized menu row description when candidates are requested. */
|
|
46
|
+
readonly description: () => string;
|
|
47
47
|
/** Capability filter, called with a fresh projection per candidate pass. */
|
|
48
48
|
available(session: ClientSessionContext): boolean;
|
|
49
49
|
/** The command's UI behavior (this phase: popupSelect only). */
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/** `command` namespace dictionaries (the popupSelect shell's copy). */
|
|
2
2
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
|
3
3
|
export declare const zh: {
|
|
4
|
+
'description.compact': string;
|
|
5
|
+
'description.export': string;
|
|
6
|
+
'description.feedback': string;
|
|
7
|
+
'description.goal': string;
|
|
8
|
+
'description.permission': string;
|
|
9
|
+
'description.plan': string;
|
|
4
10
|
'search.placeholder': string;
|
|
5
11
|
'search.aria': string;
|
|
6
12
|
'status.loading': string;
|
|
@@ -14,6 +20,12 @@ export declare const zh: {
|
|
|
14
20
|
export type CommandKey = keyof typeof zh;
|
|
15
21
|
/** English dictionary, checked complete against the zh key set. */
|
|
16
22
|
export declare const en: {
|
|
23
|
+
'description.compact': string;
|
|
24
|
+
'description.export': string;
|
|
25
|
+
'description.feedback': string;
|
|
26
|
+
'description.goal': string;
|
|
27
|
+
'description.permission': string;
|
|
28
|
+
'description.plan': string;
|
|
17
29
|
'search.placeholder': string;
|
|
18
30
|
'search.aria': string;
|
|
19
31
|
'status.loading': string;
|
|
@@ -76,6 +76,8 @@ export declare class CommandUiRuntime extends Service implements CommandUiContra
|
|
|
76
76
|
bindComposerFocus(id: SessionId, focus: () => void): () => void;
|
|
77
77
|
/** Menu candidates: host catalog + contribution availability, then position filtering and the shared name ranking. */
|
|
78
78
|
private candidates;
|
|
79
|
+
/** Translate exact built-in Host copy while preserving scoped or third-party descriptors verbatim. */
|
|
80
|
+
private hostDescription;
|
|
79
81
|
/** Decision table, menu column: contribution/decorated-host → popup; host input → claim; host bare → detached execute. */
|
|
80
82
|
private dispatch;
|
|
81
83
|
/** Decision table, space column: hot-key sync check; only host leadingInput claims. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-commands",
|
|
3
3
|
"description": "Client command surface: global directory cache, '/' source, three command UI kinds, popupSelect registry",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -46,21 +46,21 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/react": "~18.3.1",
|
|
48
48
|
"react": "^18.2.0",
|
|
49
|
-
"@deepseek-ai/dsh-api-remotes": "^0.1.
|
|
50
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.
|
|
51
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.
|
|
52
|
-
"@deepseek-ai/dsh-client-test-runtime": "^0.1.
|
|
53
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.
|
|
54
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.
|
|
55
|
-
"@deepseek-ai/dsh-client-ui-input-trigger": "^0.1.
|
|
56
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.
|
|
49
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.5-alpha.1",
|
|
50
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.5-alpha.1",
|
|
51
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.5-alpha.1",
|
|
52
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.5-alpha.1",
|
|
53
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.5-alpha.1",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-alpha.1",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-input-trigger": "^0.1.5-alpha.1",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.5-alpha.1",
|
|
57
|
+
"@deepseek-ai/dsh-commands": "^0.1.5-alpha.1",
|
|
57
58
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
58
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.1.
|
|
59
|
-
"@deepseek-ai/dsh-client-store": "^0.1.
|
|
60
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
61
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.
|
|
62
|
-
"@deepseek-ai/dsh-client-ui-session": "^0.1.
|
|
63
|
-
"@deepseek-ai/dsh-commands": "^0.1.3-alpha.2"
|
|
59
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.1.5-alpha.1",
|
|
60
|
+
"@deepseek-ai/dsh-client-store": "^0.1.5-alpha.1",
|
|
61
|
+
"@deepseek-ai/dsh-session": "^0.1.5-alpha.1",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-alpha.1",
|
|
63
|
+
"@deepseek-ai/dsh-client-ui-session": "^0.1.5-alpha.1"
|
|
64
64
|
},
|
|
65
65
|
"files": [
|
|
66
66
|
"lib/index.js",
|