@lynn123411/dsh-chat-translate 1.2.3 → 1.2.5
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/docs//351/205/215/347/275/256.md +2 -2
- package/lib/client.js +12 -1
- package/lib/client.js.map +2 -2
- package/lib/index.js +13 -17
- package/lib/index.js.map +3 -3
- package/lib/types/client/translate/viewport-observer.d.ts +6 -0
- package/lib/types/server/config.d.ts +6 -2
- package/lib/types/server/credentials.d.ts +7 -1
- package/lib/types/server/types.d.ts +0 -12
- package/package.json +5 -4
|
@@ -16,6 +16,12 @@ export interface ViewportObserverOptions {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class StreamDebounceViewportObserver {
|
|
18
18
|
private intersectionObserver;
|
|
19
|
+
/**
|
|
20
|
+
* Pending per-element streaming debounce timers. A Map (not a WeakMap)
|
|
21
|
+
* because disconnect() must enumerate and clear every pending timer: a
|
|
22
|
+
* WeakMap cannot be iterated, so a debounce armed just before the switch was
|
|
23
|
+
* turned off would still fire registerForViewport() afterwards.
|
|
24
|
+
*/
|
|
19
25
|
private streamingTimers;
|
|
20
26
|
private pendingQueue;
|
|
21
27
|
private batchFlushTimer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginConfig
|
|
1
|
+
import type { PluginConfig } from './types.ts';
|
|
2
2
|
import type { CredentialsReader } from './credentials.ts';
|
|
3
3
|
/** Hard cap for the translation concurrency pool. */
|
|
4
4
|
export declare const MAX_CONCURRENCY = 100;
|
|
@@ -37,12 +37,16 @@ export declare class ConfigManager {
|
|
|
37
37
|
getConfig(): PluginConfig;
|
|
38
38
|
/** Whether the AI channel has every required piece: baseUrl, model and key. */
|
|
39
39
|
isAiConfigured(): boolean;
|
|
40
|
-
getMaskedConfig(): MaskedPluginConfig;
|
|
41
40
|
onConfigChange(listener: (config: PluginConfig) => void): () => void;
|
|
42
41
|
/**
|
|
43
42
|
* Merge a partial update into the settings namespace. Values are sanitized
|
|
44
43
|
* here (bounds, trimming) so the schema's own constraints act as a second
|
|
45
44
|
* line of defence rather than the only one.
|
|
45
|
+
*
|
|
46
|
+
* @internal Test-only. No production path calls this: the host writes the
|
|
47
|
+
* settings namespace from the browser through the DSH settings service, and
|
|
48
|
+
* this facade is only driven by `scripts/test-*.mjs` (regression suite).
|
|
49
|
+
* Kept (with this marker) so those tests keep exercising the sanitizer.
|
|
46
50
|
*/
|
|
47
51
|
updateConfig(partial: Partial<PluginConfig>): Promise<PluginConfig>;
|
|
48
52
|
}
|
|
@@ -45,7 +45,13 @@ export declare class CredentialsReader implements KeyReader {
|
|
|
45
45
|
refresh(): Promise<void>;
|
|
46
46
|
/** Synchronous cached read — the hot translation path stays sync. */
|
|
47
47
|
getApiKey(): string;
|
|
48
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Status-only view of the ref (plaintext never crosses the wire).
|
|
50
|
+
*
|
|
51
|
+
* @internal Test-only. The settings UI reads key status through the
|
|
52
|
+
* `credentials` Remote API with its own client-side shape, so nothing in
|
|
53
|
+
* `src/` calls this host-side method; only `scripts/test-*.mjs` do.
|
|
54
|
+
*/
|
|
49
55
|
describe(): Promise<{
|
|
50
56
|
configured: boolean;
|
|
51
57
|
writable: boolean;
|
|
@@ -9,18 +9,6 @@ export interface PluginConfig {
|
|
|
9
9
|
model: string;
|
|
10
10
|
targetLang: string;
|
|
11
11
|
}
|
|
12
|
-
export interface MaskedPluginConfig {
|
|
13
|
-
enabled: boolean;
|
|
14
|
-
concurrency: number;
|
|
15
|
-
timeoutMs: number;
|
|
16
|
-
aiTimeoutMs: number;
|
|
17
|
-
aiEnabled: boolean;
|
|
18
|
-
bingEnabled: boolean;
|
|
19
|
-
baseUrl: string;
|
|
20
|
-
model: string;
|
|
21
|
-
targetLang: string;
|
|
22
|
-
aiConfigured: boolean;
|
|
23
|
-
}
|
|
24
12
|
export interface TranslateItemResult {
|
|
25
13
|
original: string;
|
|
26
14
|
translated: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynn123411/dsh-chat-translate",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "Tool-call & think-summary translation with dual AI (OpenAI-compatible) + Bing channels for the DeepSeek Harness Web UI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "lynn123411",
|
|
@@ -66,6 +66,8 @@
|
|
|
66
66
|
"node": "^22.19 || >=24"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.5-rc.1",
|
|
70
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
69
71
|
"@eslint/js": "^9.30.0",
|
|
70
72
|
"@types/node": "^22.19.0",
|
|
71
73
|
"@types/react": "^19.2.18",
|
|
@@ -73,8 +75,7 @@
|
|
|
73
75
|
"jsdom": "^26.1.0",
|
|
74
76
|
"typescript": "^6.0.0"
|
|
75
77
|
},
|
|
76
|
-
"
|
|
77
|
-
"@deepseek-ai/dsh-home-paths": "0.1.
|
|
78
|
-
"@deepseek-ai/schemastery": "^3.18.2"
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.5-rc.1"
|
|
79
80
|
}
|
|
80
81
|
}
|