@deepseek-ai/dsh-experimental-translator 0.2.1-alpha.2 → 0.2.1-alpha.3

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.i18n.yaml CHANGED
@@ -18,8 +18,8 @@
18
18
  en: a8a0b2481c0966c3
19
19
  zh: aedb4a655c2c96c2
20
20
  /deepseek-ai-dsh-experimental-translator/understand-the-implementation:
21
- en: 8fa99924e5a2993e
22
- zh: 269b0e9546109251
21
+ en: 26bdde8357a1bb43
22
+ zh: 727c36c494dc644a
23
23
  /deepseek-ai-dsh-experimental-translator/further-exploration:
24
24
  en: 17792a9fe5429633
25
25
  zh: b51e5e3c30b0e14d
package/README.md CHANGED
@@ -64,7 +64,7 @@ Storage reads validate translation payloads and request/result references. Only
64
64
 
65
65
  `TranslationError.code` distinguishes input limits, HTTP failures, response limits, invalid provider responses, transport failures, missing durable Sessions, storage failures, unavailable native routes, and the service's `TRANSLATION_TIMEOUT` deadline. `TRANSLATION_SESSION_INACTIVE` rejects an uncached inactive Session before any provider call. Diagnostics include no submitted text or provider error body. `translate()` always returns a Promise and rejects admission or provider failures. Caller cancellation and service disposal preserve their original abort reasons, including caller-owned timeout reasons. Queued cancellation rejects promptly; unloading aborts accepted requests and waits for their underlying storage and network work to settle. Input limits apply in both `resolve()` and `translate()`.
66
66
 
67
- `TRANSLATION_UNAVAILABLE` rejects a missing active built-in owner or registered route, unconfigured credentials, absent exact `deepseek-flash` catalog membership, an owner/model-list/official credential-reference change before dispatch, provider withdrawal, or a prepared call whose reasoning effort is not `off`. Eligibility and thinking checks run before dispatch, with eligibility checked again after request durability. A native `finish` with reason `error` maps to `TRANSLATION_REQUEST_FAILED`; a missing or other non-`stop` finish maps to `TRANSLATION_INVALID_RESPONSE`.
67
+ `TRANSLATION_UNAVAILABLE` rejects a missing active built-in owner or registered route, unconfigured credentials, absent exact `deepseek-flash` catalog membership, an owner, model-configuration (Official `models` or Account `modelOverrides`), or Official credential-reference change before dispatch, provider withdrawal, or a prepared call whose reasoning effort is not `off`. Eligibility and thinking checks run before dispatch, with eligibility checked again after request durability. A native `finish` with reason `error` maps to `TRANSLATION_REQUEST_FAILED`; a missing or other non-`stop` finish maps to `TRANSLATION_INVALID_RESPONSE`.
68
68
 
69
69
  </details>
70
70
 
package/README.zh.md CHANGED
@@ -64,7 +64,7 @@ Google 接收使用 `gtx` 客户端的表单 POST 请求;Bing 通过 Microsoft
64
64
 
65
65
  `TranslationError.code` 区分输入限制、HTTP 失败、响应限制、无效提供方响应、传输失败、缺少持久 Session、存储失败、不可用的原生路由以及服务自身的 `TRANSLATION_TIMEOUT` 超时。未激活 Session 缓存未命中时,在调用任何提供方之前以 `TRANSLATION_SESSION_INACTIVE` 拒绝。诊断不包含提交的文本或提供者错误正文。`translate()` 始终返回 Promise,准入或提供者失败都会使其拒绝。调用者取消和服务卸载保留原始中止原因,包括调用者自身的超时原因。排队期间取消会立即返回拒绝;卸载会取消已接纳的请求,并等待底层存储和网络工作结束。`resolve()` 和 `translate()` 都执行输入限制。
66
66
 
67
- `TRANSLATION_UNAVAILABLE` 拒绝缺失的活跃内置所有者或已注册路由、未配置的凭据、目录中不存在精确的 `deepseek-flash`、派发前所有者/模型列表/官方凭据引用变化、提供方卸载,以及准备后的调用推理强度不是 `off` 的情况。资格与思考检查在派发前执行,请求持久化之后会再次检查资格。原生 `finish` 的原因为 `error` 时映射为 `TRANSLATION_REQUEST_FAILED`;缺失 finish 或其他非 `stop` 原因映射为 `TRANSLATION_INVALID_RESPONSE`。
67
+ `TRANSLATION_UNAVAILABLE` 拒绝缺失的活跃内置所有者或已注册路由、未配置的凭据、目录中不存在精确的 `deepseek-flash`、派发前所有者、模型配置(官方路由的 `models` 或账号路由的 `modelOverrides`)或官方凭据引用变化、提供方卸载,以及准备后的调用推理强度不是 `off` 的情况。资格与思考检查在派发前执行,请求持久化之后会再次检查资格。原生 `finish` 的原因为 `error` 时映射为 `TRANSLATION_REQUEST_FAILED`;缺失 finish 或其他非 `stop` 原因映射为 `TRANSLATION_INVALID_RESPONSE`。
68
68
 
69
69
  </details>
70
70
 
package/lib/index.js CHANGED
@@ -547,6 +547,9 @@ const OWNER_PACKAGES = {
547
547
  "deepseek-account": "@deepseek-ai/dsh-llm-deepseek-account",
548
548
  "deepseek-official": "@deepseek-ai/dsh-llm-deepseek-api-key"
549
549
  };
550
+ function modelConfigOf(owner) {
551
+ return owner.provider === "deepseek-account" ? owner.config.modelOverrides.get() : owner.config.models.get();
552
+ }
550
553
  /**
551
554
  * Identify fixed native translation semantics without inspecting credentials or a model catalog.
552
555
  * @param config - independent translation output-token limit.
@@ -606,14 +609,14 @@ function nativeOwner(ctx, provider) {
606
609
  }
607
610
  function unchanged(ctx, provider, previous) {
608
611
  const current = nativeOwner(ctx, provider);
609
- if (current === void 0 || current.fiber !== previous.fiber || current.config.models.get() !== previous.models || current.provider === "deepseek-official" && current.config.apiKeyEnv.get() !== previous.apiKeyRef) return void 0;
612
+ if (current === void 0 || current.fiber !== previous.fiber || modelConfigOf(current) !== previous.modelConfig || current.provider === "deepseek-official" && current.config.apiKeyEnv.get() !== previous.apiKeyRef) return void 0;
610
613
  return current;
611
614
  }
612
615
  async function eligible(ctx, provider, signal, track) {
613
616
  signal.throwIfAborted();
614
617
  const owner = nativeOwner(ctx, provider);
615
618
  if (owner === void 0) return void 0;
616
- const models = owner.config.models.get();
619
+ const modelConfig = modelConfigOf(owner);
617
620
  const apiKeyRef = owner.provider === "deepseek-official" ? owner.config.apiKeyEnv.get() : void 0;
618
621
  if (apiKeyRef !== void 0) {
619
622
  const credentials = ctx.get("credentials");
@@ -626,7 +629,7 @@ async function eligible(ctx, provider, signal, track) {
626
629
  if (!catalog.some((model) => model.id === MODEL)) return void 0;
627
630
  const accepted = {
628
631
  ...owner,
629
- models,
632
+ modelConfig,
630
633
  ...apiKeyRef === void 0 ? {} : { apiKeyRef }
631
634
  };
632
635
  return unchanged(ctx, provider, accepted) === void 0 ? void 0 : accepted;
@@ -59,6 +59,9 @@ import { TranslationError } from "./error.js";
59
59
  const MODEL = 'deepseek-flash';
60
60
  const OWNER_PACKAGES = { 'deepseek-account': '@deepseek-ai/dsh-llm-deepseek-account',
61
61
  'deepseek-official': '@deepseek-ai/dsh-llm-deepseek-api-key' };
62
+ function modelConfigOf(owner) {
63
+ return owner.provider === 'deepseek-account' ? owner.config.modelOverrides.get() : owner.config.models.get();
64
+ }
62
65
  /**
63
66
  * Identify fixed native translation semantics without inspecting credentials or a model catalog.
64
67
  * @param config - independent translation output-token limit.
@@ -108,7 +111,7 @@ function nativeOwner(ctx, provider) {
108
111
  function unchanged(ctx, provider, previous) {
109
112
  const current = nativeOwner(ctx, provider);
110
113
  if (current === undefined || current.fiber !== previous.fiber
111
- || current.config.models.get() !== previous.models
114
+ || modelConfigOf(current) !== previous.modelConfig
112
115
  || (current.provider === 'deepseek-official' && current.config.apiKeyEnv.get() !== previous.apiKeyRef))
113
116
  return undefined;
114
117
  return current;
@@ -118,7 +121,7 @@ async function eligible(ctx, provider, signal, track) {
118
121
  const owner = nativeOwner(ctx, provider);
119
122
  if (owner === undefined)
120
123
  return undefined;
121
- const models = owner.config.models.get();
124
+ const modelConfig = modelConfigOf(owner);
122
125
  const apiKeyRef = owner.provider === 'deepseek-official' ? owner.config.apiKeyEnv.get() : undefined;
123
126
  if (apiKeyRef !== undefined) {
124
127
  const credentials = ctx.get('credentials');
@@ -133,7 +136,7 @@ async function eligible(ctx, provider, signal, track) {
133
136
  signal.throwIfAborted();
134
137
  if (!catalog.some(model => model.id === MODEL))
135
138
  return undefined;
136
- const accepted = { ...owner, models, ...apiKeyRef === undefined ? {} : { apiKeyRef } };
139
+ const accepted = { ...owner, modelConfig, ...apiKeyRef === undefined ? {} : { apiKeyRef } };
137
140
  return unchanged(ctx, provider, accepted) === undefined ? undefined : accepted;
138
141
  }
139
142
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-experimental-translator",
3
3
  "description": "Machine translation with reusable Session results",
4
- "version": "0.2.1-alpha.2",
4
+ "version": "0.2.1-alpha.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -32,37 +32,37 @@
32
32
  ],
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@deepseek-ai/schemastery": "~3.18.5-alpha.1"
35
+ "@deepseek-ai/schemastery": "~3.18.5-alpha.2"
36
36
  },
37
37
  "peerDependencies": {
38
- "@deepseek-ai/cordis": "~4.0.5-alpha.1",
39
- "@deepseek-ai/dsh-timeout": "0.2.1-alpha.2",
40
- "@deepseek-ai/dsh-util-values": "0.2.1-alpha.2",
41
- "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
42
- "@deepseek-ai/dsh-session-persistence": "0.2.1-alpha.2",
43
- "@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.1",
44
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
45
- "@deepseek-ai/dsh-credentials": "0.2.1-alpha.2",
46
- "@deepseek-ai/dsh-launch-environment": "0.2.1-alpha.2"
38
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2",
39
+ "@deepseek-ai/dsh-timeout": "0.2.1-alpha.3",
40
+ "@deepseek-ai/dsh-util-values": "0.2.1-alpha.3",
41
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.3",
42
+ "@deepseek-ai/dsh-session-persistence": "0.2.1-alpha.3",
43
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.2",
44
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
45
+ "@deepseek-ai/dsh-credentials": "0.2.1-alpha.3",
46
+ "@deepseek-ai/dsh-launch-environment": "0.2.1-alpha.3"
47
47
  },
48
48
  "devDependencies": {
49
- "@deepseek-ai/cordis": "~4.0.5-alpha.1",
50
- "@deepseek-ai/dsh-app-boot": "0.2.1-alpha.2",
51
- "@deepseek-ai/dsh-timeout": "0.2.1-alpha.2",
52
- "@deepseek-ai/dsh-util-values": "0.2.1-alpha.2",
53
- "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
54
- "@deepseek-ai/dsh-session-persistence": "0.2.1-alpha.2",
55
- "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-alpha.2",
56
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
57
- "@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.1",
58
- "@deepseek-ai/dsh-credentials": "0.2.1-alpha.2",
59
- "@deepseek-ai/dsh-launch-environment": "0.2.1-alpha.2",
60
- "@deepseek-ai/dsh-llm-deepseek": "0.2.1-alpha.2",
61
- "@deepseek-ai/dsh-llm-deepseek-api-key": "0.2.1-alpha.2",
62
- "@deepseek-ai/dsh-llm-deepseek-account": "0.2.1-alpha.2",
63
- "@deepseek-ai/dsh-deepseek-account": "0.2.1-alpha.2",
64
- "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.2.1-alpha.2",
65
- "@deepseek-ai/dsh-session-log-deepseek": "0.2.1-alpha.2",
66
- "@deepseek-ai/dsh-session-query-sqlite": "0.2.1-alpha.2"
49
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2",
50
+ "@deepseek-ai/dsh-app-boot": "0.2.1-alpha.3",
51
+ "@deepseek-ai/dsh-timeout": "0.2.1-alpha.3",
52
+ "@deepseek-ai/dsh-util-values": "0.2.1-alpha.3",
53
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.3",
54
+ "@deepseek-ai/dsh-session-persistence": "0.2.1-alpha.3",
55
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-alpha.3",
56
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
57
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.2",
58
+ "@deepseek-ai/dsh-credentials": "0.2.1-alpha.3",
59
+ "@deepseek-ai/dsh-launch-environment": "0.2.1-alpha.3",
60
+ "@deepseek-ai/dsh-llm-deepseek": "0.2.1-alpha.3",
61
+ "@deepseek-ai/dsh-llm-deepseek-api-key": "0.2.1-alpha.3",
62
+ "@deepseek-ai/dsh-llm-deepseek-account": "0.2.1-alpha.3",
63
+ "@deepseek-ai/dsh-deepseek-account": "0.2.1-alpha.3",
64
+ "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.2.1-alpha.3",
65
+ "@deepseek-ai/dsh-session-log-deepseek": "0.2.1-alpha.3",
66
+ "@deepseek-ai/dsh-session-query-sqlite": "0.2.1-alpha.3"
67
67
  }
68
68
  }