@jingyi0605/codingns4dsh 0.2.1-beta.10 → 0.2.1-beta.12
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.en.md +7 -5
- package/README.md +12 -6
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +1 -1
- package/data/build/dist/bootstrap/index.d.ts +1 -1
- package/data/build/dist/client/bundle.js +9713 -7350
- package/data/build/dist/client/bundle.js.map +1 -1
- package/data/build/dist/client/cli-slots.d.ts +13 -3
- package/data/build/dist/client/cli-slots.d.ts.map +1 -1
- package/data/build/dist/client/cli-slots.js +93 -18
- package/data/build/dist/client/cli-slots.js.map +1 -1
- package/data/build/dist/client/client.assistant-configuration-view.js +4 -3
- package/data/build/dist/client/client.assistant-configuration-view.js.map +1 -1
- package/data/build/dist/client/client.moss-voice-output.js +415 -0
- package/data/build/dist/client/client.moss-voice-output.js.map +1 -0
- package/data/build/dist/client/client.native-workspace-store.js +4 -4
- package/data/build/dist/client/client.native-workspace-store.js.map +1 -1
- package/data/build/dist/client/client.primitives-adapter.js.map +1 -1
- package/data/build/dist/client/client.react-dom.js +0 -404
- package/data/build/dist/client/client.react-dom.js.map +1 -1
- package/data/build/dist/client/client.session-translation.js +105 -2
- package/data/build/dist/client/client.session-translation.js.map +1 -1
- package/data/build/dist/client/client.transport.js +103 -11
- package/data/build/dist/client/client.transport.js.map +1 -1
- package/data/build/dist/client/conversation-translation-settings.d.ts +10 -0
- package/data/build/dist/client/conversation-translation-settings.d.ts.map +1 -0
- package/data/build/dist/client/conversation-translation-settings.js +52 -0
- package/data/build/dist/client/conversation-translation-settings.js.map +1 -0
- package/data/build/dist/client/desktop-assistant.js +569 -450
- package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
- package/data/build/dist/client/features/cli-adapters.js +3 -1
- package/data/build/dist/client/features/cli-adapters.js.map +1 -1
- package/data/build/dist/client/features/session-translation.d.ts.map +1 -1
- package/data/build/dist/client/features/session-translation.js +49 -48
- package/data/build/dist/client/features/session-translation.js.map +1 -1
- package/data/build/dist/client/locales/panels.d.ts.map +1 -1
- package/data/build/dist/client/locales/panels.js +103 -11
- package/data/build/dist/client/locales/panels.js.map +1 -1
- package/data/build/dist/client/native-model-translation-menu.d.ts +6 -0
- package/data/build/dist/client/native-model-translation-menu.d.ts.map +1 -0
- package/data/build/dist/client/native-model-translation-menu.js +57 -0
- package/data/build/dist/client/native-model-translation-menu.js.map +1 -0
- package/data/build/dist/client/native-translation-default.d.ts +6 -0
- package/data/build/dist/client/native-translation-default.d.ts.map +1 -0
- package/data/build/dist/client/native-translation-default.js +30 -0
- package/data/build/dist/client/native-translation-default.js.map +1 -0
- package/data/build/dist/client/session-translation-chat.d.ts +23 -2
- package/data/build/dist/client/session-translation-chat.d.ts.map +1 -1
- package/data/build/dist/client/session-translation-chat.js +238 -72
- package/data/build/dist/client/session-translation-chat.js.map +1 -1
- package/data/build/dist/client/session-translation-interactions.d.ts +31 -0
- package/data/build/dist/client/session-translation-interactions.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-interactions.js +158 -0
- package/data/build/dist/client/session-translation-interactions.js.map +1 -0
- package/data/build/dist/client/session-translation-model-pool.d.ts +16 -0
- package/data/build/dist/client/session-translation-model-pool.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-model-pool.js +246 -0
- package/data/build/dist/client/session-translation-model-pool.js.map +1 -0
- package/data/build/dist/client/session-translation-pending-dom.d.ts +8 -0
- package/data/build/dist/client/session-translation-pending-dom.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-pending-dom.js +58 -0
- package/data/build/dist/client/session-translation-pending-dom.js.map +1 -0
- package/data/build/dist/client/session-translation-retry.d.ts +16 -0
- package/data/build/dist/client/session-translation-retry.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-retry.js +66 -0
- package/data/build/dist/client/session-translation-retry.js.map +1 -0
- package/data/build/dist/client/session-translation-rules.d.ts +13 -0
- package/data/build/dist/client/session-translation-rules.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-rules.js +58 -0
- package/data/build/dist/client/session-translation-rules.js.map +1 -0
- package/data/build/dist/client/style.css +276 -276
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts +30 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js +93 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts +12 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js +181 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts +19 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js +39 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +1 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +1 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts +20 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.js +65 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts +32 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js +90 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js +34 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.d.ts +21 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.js +11 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js +37 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js +45 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts +28 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js +31 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/matrix.js +12 -3
- package/data/build/dist/dsh-capabilities/matrix.js.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.js +26 -3
- package/data/build/dist/dsh-capabilities/routes.js.map +1 -1
- package/data/build/dist/dsh-capabilities/types.d.ts +1 -1
- package/data/build/dist/dsh-capabilities/types.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/types.js.map +1 -1
- package/data/build/dist/host/cli-adapters/antigravity-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts +4 -3
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/attachment-utils.js +9 -8
- package/data/build/dist/host/cli-adapters/attachment-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/driver.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js +28 -11
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.js +369 -70
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
- package/data/build/dist/host/cli-adapters/gemini-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.js +128 -40
- package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/kimi-driver.js +2 -2
- package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/mcode-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/mcode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js +2 -2
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.js +2 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.js +25 -16
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
- package/data/build/dist/host/cli-adapters/zcode-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.d.ts.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.js +2 -3
- package/data/build/dist/host/features/global-voice-rpc.js.map +1 -1
- package/data/build/dist/host/features/interaction-translation.d.ts +9 -0
- package/data/build/dist/host/features/interaction-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/interaction-translation.js +168 -0
- package/data/build/dist/host/features/interaction-translation.js.map +1 -0
- package/data/build/dist/host/features/peer-host.js +6 -6
- package/data/build/dist/host/features/peer-host.js.map +1 -1
- package/data/build/dist/host/features/session-prompt-translation.d.ts +10 -0
- package/data/build/dist/host/features/session-prompt-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/session-prompt-translation.js +197 -0
- package/data/build/dist/host/features/session-prompt-translation.js.map +1 -0
- package/data/build/dist/host/features/session-translation-protection.d.ts +16 -0
- package/data/build/dist/host/features/session-translation-protection.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-protection.js +183 -0
- package/data/build/dist/host/features/session-translation-protection.js.map +1 -0
- package/data/build/dist/host/features/session-translation-recovery.d.ts +20 -0
- package/data/build/dist/host/features/session-translation-recovery.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-recovery.js +122 -0
- package/data/build/dist/host/features/session-translation-recovery.js.map +1 -0
- package/data/build/dist/host/features/session-translation-runtime.d.ts +16 -0
- package/data/build/dist/host/features/session-translation-runtime.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-runtime.js +85 -0
- package/data/build/dist/host/features/session-translation-runtime.js.map +1 -0
- package/data/build/dist/host/features/session-translation-service.d.ts +14 -4
- package/data/build/dist/host/features/session-translation-service.d.ts.map +1 -1
- package/data/build/dist/host/features/session-translation-service.js +217 -211
- package/data/build/dist/host/features/session-translation-service.js.map +1 -1
- package/data/build/dist/host/features/session-translation.d.ts.map +1 -1
- package/data/build/dist/host/features/session-translation.js +5 -2
- package/data/build/dist/host/features/session-translation.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts +2 -2
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js +10 -9
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts +3 -3
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js +26 -14
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js.map +1 -1
- package/data/build/dist/host/native-session-bridge.d.ts +2 -1
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
- package/data/build/dist/host/native-session-bridge.js +7 -15
- package/data/build/dist/host/native-session-bridge.js.map +1 -1
- package/data/build/dist/host/rpc.d.ts.map +1 -1
- package/data/build/dist/host/rpc.js +14 -8
- package/data/build/dist/host/rpc.js.map +1 -1
- package/data/build/dist/host/settings.d.ts.map +1 -1
- package/data/build/dist/host/settings.js +10 -2
- package/data/build/dist/host/settings.js.map +1 -1
- package/data/build/dist/shared/attachment-prompts.d.ts +11 -0
- package/data/build/dist/shared/attachment-prompts.d.ts.map +1 -0
- package/data/build/dist/shared/attachment-prompts.js +17 -0
- package/data/build/dist/shared/attachment-prompts.js.map +1 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +8 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/errors.d.ts +2 -2
- package/data/build/dist/shared/contracts/interaction-presentation.d.ts +32 -0
- package/data/build/dist/shared/contracts/interaction-presentation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/interaction-presentation.js +2 -0
- package/data/build/dist/shared/contracts/interaction-presentation.js.map +1 -0
- package/data/build/dist/shared/contracts/interaction-translation.d.ts +53 -0
- package/data/build/dist/shared/contracts/interaction-translation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/interaction-translation.js +44 -0
- package/data/build/dist/shared/contracts/interaction-translation.js.map +1 -0
- package/data/build/dist/shared/contracts/session-translation.d.ts +75 -7
- package/data/build/dist/shared/contracts/session-translation.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/session-translation.js +132 -2
- package/data/build/dist/shared/contracts/session-translation.js.map +1 -1
- package/data/build/dist/shared/contracts/version.d.ts +4 -4
- package/data/build/dist/shared/contracts/version.js +3 -3
- package/data/build/dist/shared/index.d.ts +1 -1
- package/data/build/dist/shared/index.d.ts.map +1 -1
- package/data/build/dist/shared/index.js +1 -1
- package/data/build/dist/shared/index.js.map +1 -1
- package/data/build/dist/shared/translation-indicator.d.ts +26 -0
- package/data/build/dist/shared/translation-indicator.d.ts.map +1 -0
- package/data/build/dist/shared/translation-indicator.js +29 -0
- package/data/build/dist/shared/translation-indicator.js.map +1 -0
- package/package.json +35 -34
- package/profile/README.md +2 -2
- package/profile/package.json +3 -3
- package/profile/version.json +3 -3
- package/version.json +3 -3
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH 模型菜单尚无扩展插槽,通过原生触发器的 aria-controls 定位当前会话菜单。
|
|
3
|
+
* 只添加翻译行的 Portal 容器,原生模型选择、思考强度和菜单交互继续由 DSH 管理。
|
|
4
|
+
*/
|
|
5
|
+
export function watchNativeModelMenu(anchor, onTarget) {
|
|
6
|
+
const document = anchor.ownerDocument;
|
|
7
|
+
const view = document.defaultView;
|
|
8
|
+
const Observer = view?.MutationObserver;
|
|
9
|
+
if (Observer === undefined || document.body === null)
|
|
10
|
+
return () => undefined;
|
|
11
|
+
let target = null;
|
|
12
|
+
let trigger = null;
|
|
13
|
+
const resize = () => {
|
|
14
|
+
if (view !== null)
|
|
15
|
+
view.dispatchEvent(new view.Event('resize'));
|
|
16
|
+
};
|
|
17
|
+
const sizeObserver = view?.ResizeObserver === undefined ? undefined : new view.ResizeObserver(resize);
|
|
18
|
+
const closeOnEscape = (event) => {
|
|
19
|
+
if (event.key !== 'Escape')
|
|
20
|
+
return;
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
trigger?.click();
|
|
24
|
+
};
|
|
25
|
+
const scan = () => {
|
|
26
|
+
trigger = anchor.closest('[data-composer-card]')?.querySelector('[data-slot="conversation.input.model"] button[aria-haspopup="menu"]') ?? null;
|
|
27
|
+
const menuId = trigger?.getAttribute('aria-controls');
|
|
28
|
+
const menu = menuId === undefined || menuId === null ? null : document.getElementById(menuId);
|
|
29
|
+
// 模型列表和思考档位子菜单不放翻译行,避免干扰原生键盘导航与搜索。
|
|
30
|
+
const rootMenu = trigger?.getAttribute('aria-expanded') === 'true'
|
|
31
|
+
&& menu?.getAttribute('role') === 'menu'
|
|
32
|
+
&& menu.querySelector(':scope > [role="menuitem"]') !== null
|
|
33
|
+
? menu : null;
|
|
34
|
+
if (target !== null && target.parentElement === rootMenu && rootMenu !== null)
|
|
35
|
+
return;
|
|
36
|
+
sizeObserver?.disconnect();
|
|
37
|
+
target?.remove();
|
|
38
|
+
target = rootMenu === null ? null : document.createElement('div');
|
|
39
|
+
if (target !== null) {
|
|
40
|
+
target.dataset.codingnsNativeTranslation = '';
|
|
41
|
+
target.addEventListener('keydown', closeOnEscape);
|
|
42
|
+
rootMenu.prepend(target);
|
|
43
|
+
sizeObserver?.observe(target);
|
|
44
|
+
}
|
|
45
|
+
onTarget(target);
|
|
46
|
+
};
|
|
47
|
+
const observer = new Observer(scan);
|
|
48
|
+
observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['aria-controls', 'aria-expanded', 'role'] });
|
|
49
|
+
scan();
|
|
50
|
+
return () => {
|
|
51
|
+
observer.disconnect();
|
|
52
|
+
sizeObserver?.disconnect();
|
|
53
|
+
target?.remove();
|
|
54
|
+
resize();
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=native-model-translation-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-model-translation-menu.js","sourceRoot":"","sources":["../../../../src/client/native-model-translation-menu.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAmB,EAAE,QAA8C;IACtG,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAA;IACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,CAAA;IACjC,MAAM,QAAQ,GAAG,IAAI,EAAE,gBAAgB,CAAA;IACvC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,GAAG,EAAE,CAAC,SAAS,CAAA;IAC5E,IAAI,MAAM,GAAuB,IAAI,CAAA;IACrC,IAAI,OAAO,GAA6B,IAAI,CAAA;IAC5C,MAAM,MAAM,GAAG,GAAS,EAAE;QACxB,IAAI,IAAI,KAAK,IAAI;YAAE,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;IACjE,CAAC,CAAA;IACD,MA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AC,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACjE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,MAAM,CAAC,OAAO,CAAC,yBAAyB,GAAG,EAAE,CAAA;YAC7C,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;YACjD,QAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YACzB,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;QAC/B,CAAC;QACD,QAAQ,CAAC,MAAM,CAAC,CAAA;IAClB,CAAC,CAAA;IACD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAA;IACnC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;IAClJ,IAAI,EAAE,CAAA;IACN,OAAO,GAAG,EAAE;QACV,QAAQ,CAAC,UAAU,EAAE,CAAA;QACrB,YAAY,EAAE,UAAU,EAAE,CAAA;QAC1B,MAAM,EAAE,MAAM,EAAE,CAAA;QAChB,MAAM,EAAE,CAAA;IACV,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function setNativeTranslationDefaultReader(next: (() => boolean) | undefined): void;
|
|
2
|
+
/** undefined 表示功能模块未启用,不应向原生模型菜单添加开关。 */
|
|
3
|
+
export declare function readNativeTranslationDefault(): boolean | undefined;
|
|
4
|
+
export declare function subscribeNativeTranslationDefault(listener: () => void): () => void;
|
|
5
|
+
export declare function notifyNativeTranslationDefaultChanged(): void;
|
|
6
|
+
//# sourceMappingURL=native-translation-default.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-translation-default.d.ts","sourceRoot":"","sources":["../../../../src/client/native-translation-default.ts"],"names":[],"mappings":"AASA,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,CAGzF;AAED,yCAAyC;AACzC,wBAAgB,4BAA4B,IAAI,OAAO,GAAG,SAAS,CAMlE;AAED,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAGlF;AAED,wBAAgB,qCAAqC,IAAI,IAAI,CAE5D"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH 原生会话翻译开关的默认值读取器。
|
|
3
|
+
*
|
|
4
|
+
* 会话翻译功能模块在启动时注册读取器,模型菜单订阅变化;两个功能模块
|
|
5
|
+
* (`cliAdapters` 注册槽位、`sessionTranslation` 决定默认值)不互相引用。
|
|
6
|
+
*/
|
|
7
|
+
let reader;
|
|
8
|
+
const listeners = new Set();
|
|
9
|
+
export function setNativeTranslationDefaultReader(next) {
|
|
10
|
+
reader = next;
|
|
11
|
+
notifyNativeTranslationDefaultChanged();
|
|
12
|
+
}
|
|
13
|
+
/** undefined 表示功能模块未启用,不应向原生模型菜单添加开关。 */
|
|
14
|
+
export function readNativeTranslationDefault() {
|
|
15
|
+
try {
|
|
16
|
+
return reader === undefined ? undefined : reader() === true;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function subscribeNativeTranslationDefault(listener) {
|
|
23
|
+
listeners.add(listener);
|
|
24
|
+
return () => { listeners.delete(listener); };
|
|
25
|
+
}
|
|
26
|
+
export function notifyNativeTranslationDefaultChanged() {
|
|
27
|
+
for (const listener of listeners)
|
|
28
|
+
listener();
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=native-translation-default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-translation-default.js","sourceRoot":"","sources":["../../../../src/client/native-translation-default.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,IAAI,MAAmC,CAAA;AACvC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAA;AAEvC,MAAM,UAAU,iCAAiC,CAAC,IAAiC;IACjF,MAAM,GAAG,IAAI,CAAA;IACb,qCAAqC,EAAE,CAAA;AACzC,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,4BAA4B;IAC1C,IAAI,CAAC;QACH,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,IAAI,CAAA;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,QAAoB;IACpE,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACvB,OAAO,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA,CAAC,CAAC,CAAA;AAC7C,CAAC;AAED,MAAM,UAAU,qCAAqC;IACnD,KAAK,MAAM,QAAQ,IAAI,SAAS;QAAE,QAAQ,EAAE,CAAA;AAC9C,CAAC"}
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type { MarkdownLabels } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
import { type DshCapabilityRuntimeFacts } from '../dsh-capabilities/routes.js';
|
|
3
4
|
import type { CodingNsClientServices } from './features/types.js';
|
|
4
5
|
import type { CodingNsTranslator } from './locale.js';
|
|
5
|
-
import type { SessionTranslationRecord } from '../shared/contracts/session-translation.js';
|
|
6
|
+
import type { SessionTranslationOutputKind, SessionTranslationRecord, SessionTranslationPendingInput } from '../shared/contracts/session-translation.js';
|
|
7
|
+
interface TranslationActionProps {
|
|
8
|
+
readonly messageId: string;
|
|
9
|
+
readonly sessionId?: string | undefined;
|
|
10
|
+
readonly outputKind?: SessionTranslationOutputKind | undefined;
|
|
11
|
+
readonly inputFailure?: SessionTranslationPendingInput | undefined;
|
|
12
|
+
readonly onDecision?: (() => void) | undefined;
|
|
13
|
+
readonly messageRole?: 'user' | 'assistant';
|
|
14
|
+
readonly services: CodingNsClientServices;
|
|
15
|
+
readonly translationT: CodingNsTranslator;
|
|
16
|
+
/** Absent only for a pending submission in a translation-enabled session. */
|
|
17
|
+
readonly record?: SessionTranslationRecord | undefined;
|
|
18
|
+
readonly original?: string;
|
|
19
|
+
readonly popupAlign?: 'start' | 'end';
|
|
20
|
+
readonly inline?: boolean;
|
|
21
|
+
}
|
|
6
22
|
interface MarkdownTranslationLabels extends MarkdownLabels {
|
|
7
23
|
readonly code: MarkdownLabels['code'] & {
|
|
8
24
|
readonly toolbarLabels: NonNullable<MarkdownLabels['code']['toolbarLabels']>;
|
|
@@ -15,8 +31,13 @@ interface MarkdownTranslationLabels extends MarkdownLabels {
|
|
|
15
31
|
type TranslationFactorySlot = (name: string, props: Record<string, unknown>, options?: {
|
|
16
32
|
readonly fallback?: ReactNode;
|
|
17
33
|
}) => ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* 把翻译状态和查看原文的入口放回对应消息块,不占用 AI 回复底部的统一操作栏。
|
|
36
|
+
*/
|
|
37
|
+
export declare function TranslationAction(props: TranslationActionProps): ReactElement | null;
|
|
18
38
|
interface AssistantReasoningContentProps {
|
|
19
39
|
readonly messageId: string;
|
|
40
|
+
readonly sessionId?: string | undefined;
|
|
20
41
|
readonly services: CodingNsClientServices;
|
|
21
42
|
readonly translationT: CodingNsTranslator;
|
|
22
43
|
readonly text: string;
|
|
@@ -46,6 +67,6 @@ export declare function AssistantReasoningContent(props: AssistantReasoningConte
|
|
|
46
67
|
/**
|
|
47
68
|
* 注册两个有实际翻译记录的消息渲染器;DSH 的用户气泡内容仍由统一主题令牌控制。
|
|
48
69
|
*/
|
|
49
|
-
export declare function registerSessionTranslationChatUi(services: CodingNsClientServices): () => void;
|
|
70
|
+
export declare function registerSessionTranslationChatUi(services: CodingNsClientServices, facts?: DshCapabilityRuntimeFacts): () => void;
|
|
50
71
|
export {};
|
|
51
72
|
//# sourceMappingURL=session-translation-chat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-translation-chat.d.ts","sourceRoot":"","sources":["../../../../src/client/session-translation-chat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"session-translation-chat.d.ts","sourceRoot":"","sources":["../../../../src/client/session-translation-chat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAgBnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAA;AAE3E,OAAO,EAA+B,KAAK,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AAW3G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,EAAsF,4BAA4B,EAAE,wBAAwB,EAAE,8BAA8B,EAAoC,MAAM,4CAA4C,CAAA;AAgB9Q,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,4BAA4B,GAAG,SAAS,CAAA;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,8BAA8B,GAAG,SAAS,CAAA;IAClE,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAC9C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,WAA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