@lynn123411/dsh-chat-translate 3.3.0 → 3.4.0
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 +15 -6
- package/docs//351/205/215/347/275/256.md +5 -5
- package/lib/client.js +118 -106
- package/lib/client.js.map +3 -3
- package/lib/index.js +12 -7
- package/lib/index.js.map +3 -3
- package/lib/types/client/chat/assistant-step.d.ts +7 -7
- package/lib/types/client/chat/click-guard.d.ts +7 -7
- package/lib/types/client/chat/row-plan.d.ts +24 -19
- package/lib/types/client/chat/styles.d.ts +31 -47
- package/lib/types/client/chat/translate-store.d.ts +9 -6
- package/lib/types/client/locales.d.ts +13 -8
- package/lib/types/server/dispatcher.d.ts +2 -2
- package/package.json +13 -13
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.
|
|
1
|
+
// node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.6-alpha.1/node_modules/@deepseek-ai/cosmokit/lib/index.js
|
|
2
2
|
function isNullable(value) {
|
|
3
3
|
return value === null || value === void 0;
|
|
4
4
|
}
|
|
@@ -223,7 +223,7 @@ var Time;
|
|
|
223
223
|
Time2.template = template;
|
|
224
224
|
})(Time || (Time = {}));
|
|
225
225
|
|
|
226
|
-
// node_modules/.pnpm/@deepseek-ai+schemastery@3.18.
|
|
226
|
+
// node_modules/.pnpm/@deepseek-ai+schemastery@3.18.5-alpha.1/node_modules/@deepseek-ai/schemastery/lib/index.mjs
|
|
227
227
|
var kSchema = Symbol.for("schemastery");
|
|
228
228
|
var kValidationError = Symbol.for("ValidationError");
|
|
229
229
|
globalThis.__schemastery_index__ ??= 0;
|
|
@@ -977,12 +977,14 @@ var CredentialsReader = class {
|
|
|
977
977
|
import * as fs from "node:fs/promises";
|
|
978
978
|
import * as path from "node:path";
|
|
979
979
|
|
|
980
|
-
// node_modules/.pnpm/@deepseek-ai+dsh-home-paths@0.2.
|
|
980
|
+
// node_modules/.pnpm/@deepseek-ai+dsh-home-paths@0.2.1-alpha.2_@deepseek-ai+cordis@4.0.5-alpha.1/node_modules/@deepseek-ai/dsh-home-paths/lib/index.js
|
|
981
981
|
import { homedir } from "node:os";
|
|
982
982
|
import { basename, dirname, join, resolve as resolve2 } from "node:path";
|
|
983
983
|
var DSH_HOME_DIR_NAME = ".dsh";
|
|
984
984
|
var DEFAULT_DSH_HOME_DISPLAY = `~/${DSH_HOME_DIR_NAME}`;
|
|
985
985
|
var DSH_HOME_ENV = "DSH_HOME";
|
|
986
|
+
var AGENTS_HOME_DIR_NAME = ".agents";
|
|
987
|
+
var DEFAULT_AGENTS_HOME_DISPLAY = `~/${AGENTS_HOME_DIR_NAME}`;
|
|
986
988
|
function defaultDshHome() {
|
|
987
989
|
return join(homedir(), DSH_HOME_DIR_NAME);
|
|
988
990
|
}
|
|
@@ -991,9 +993,12 @@ function expandHomePath(path2) {
|
|
|
991
993
|
if (path2.startsWith("~/") || path2.startsWith("~\\")) return join(homedir(), path2.slice(2));
|
|
992
994
|
return path2;
|
|
993
995
|
}
|
|
996
|
+
function resolveRoot(configured, env, envName, fallback) {
|
|
997
|
+
const fromEnv = env[envName];
|
|
998
|
+
return resolve2(expandHomePath(configured ?? (fromEnv !== void 0 && fromEnv.trim().length > 0 ? fromEnv : fallback())));
|
|
999
|
+
}
|
|
994
1000
|
function resolveDshHome(configured, env = process.env) {
|
|
995
|
-
|
|
996
|
-
return resolve2(expandHomePath(configured ?? (fromEnv !== void 0 && fromEnv.trim().length > 0 ? fromEnv : defaultDshHome())));
|
|
1001
|
+
return resolveRoot(configured, env, DSH_HOME_ENV, defaultDshHome);
|
|
997
1002
|
}
|
|
998
1003
|
function dshHomePath(...segments) {
|
|
999
1004
|
return join(resolveDshHome(), ...segments);
|
|
@@ -1577,8 +1582,8 @@ var TranslationDispatcher = class {
|
|
|
1577
1582
|
*
|
|
1578
1583
|
* **形状问题不否决内容**:修不好的片段自动重掷一次;再修不好就照收模型的
|
|
1579
1584
|
* 译文(链接数不等时不回填,其余原样)——原文一键可回,可读的译文优先于
|
|
1580
|
-
*
|
|
1581
|
-
*
|
|
1585
|
+
* 形状完整。失败只剩通道伤一种:超时、断流、空返回,块保持原文并带一句
|
|
1586
|
+
* detail 供悬停报因,救活由用户的点击发起。
|
|
1582
1587
|
*
|
|
1583
1588
|
* 调用方传进来的每个块要么整块译出、要么整块保持原文:任一片段缺失都让该块
|
|
1584
1589
|
* 作废,避免半中半英的段落;失败块带 `detail` 一句技术细节。每行只跑首跑
|