dsh-opendesign-corouter 0.1.13 → 0.1.15
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 +3 -3
- package/lib/catalog.d.ts +3 -3
- package/lib/client.d.ts +12 -0
- package/lib/client.js +158 -6
- package/lib/config.d.ts +10 -0
- package/lib/device-auth.d.ts +1 -1
- package/lib/empty-turn.d.ts +0 -5
- package/lib/eot-recovery.d.ts +3 -2
- package/lib/generated/typert.host.js +26 -1
- package/lib/generated/typert.remote-client.js +26 -1
- package/lib/image-budget.d.ts +4 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +491 -38
- package/lib/index.js.map +4 -4
- package/lib/model-discovery.d.ts +1 -1
- package/lib/remote.d.ts +5 -0
- package/lib/turn-monitor-status.d.ts +16 -0
- package/lib/turn-monitor.d.ts +99 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ dsh plugin --profile web add dsh-opendesign-corouter
|
|
|
32
32
|
也可打开 [Actions → CI](https://github.com/KouzakiUmi/dsh-opendesign-corouter/actions/workflows/ci.yml),从成功构建下载 **`dsh-opendesign-corouter-build`** artifact。登录 GitHub 后解压 ZIP,取得 `.tgz` 与 `.sha256`,再安装本地包:
|
|
33
33
|
|
|
34
34
|
```console
|
|
35
|
-
dsh plugin --profile web add /absolute/path/to/dsh-opendesign-corouter-0.1.
|
|
35
|
+
dsh plugin --profile web add /absolute/path/to/dsh-opendesign-corouter-0.1.15.tgz
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
`web` 只是示例,请替换为目标 Profile。Desktop 使用桌面安装器提供的 `dsh` 入口;独立公共 CLI 不能代管保留的 `desktop` Profile。安装后的启用与重载按目标 DSH 的管理流程进行。
|
|
@@ -83,9 +83,9 @@ dsh plugin --profile web add /absolute/path/to/dsh-opendesign-corouter-0.1.13.tg
|
|
|
83
83
|
|
|
84
84
|
### DeepSeek V4.1 Flash 异常结束检测
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
独立开关,默认开启。协议保护参考 [dsh-empty-turn-guard](https://github.com/FYTXY/dsh-empty-turn-guard),仅将“stop 且没有工具调用、回答为空或只剩协议残留”标成异常 EOT。包含正常正文的操作前言保留为成功响应,转由 Agent 结束检查点进行结构化收尾,不再按句式重发原请求。
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
异常 EOT 在同一步骤内持续重试,直到成功或取消;其他错误遵循宿主策略。任务收尾核验则有界:默认最多追加 3 步,连续 2 次没有新成功工具结果时停止,可在高级页调整。模型报告完成、等待用户、等待后台工作、阻塞或继续执行;做过工具工作时,完成声明需引用成功结果。已有未完成 Goal、后台等待、取消与截断保留原有控制。首次收尾核验通常增加一次模型步骤,引用校验不等于独立证明全部任务要求已满足。[两层机制、计数与验证边界](docs/empty-turn-evidence.md)
|
|
89
89
|
|
|
90
90
|
## 使用前先知道
|
|
91
91
|
|
package/lib/catalog.d.ts
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
* - group:官网首页套餐卡 `https://corouter.open-design.ai/zh/` 的
|
|
8
8
|
* `data-model-module="design-plan"` 12 款归 `plan`;其余在售对话模型归 `paid`。
|
|
9
9
|
* - `plan` 原有 12 款的 contextWindow / maxOutputTokens 与原模态
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* 来自同网关客户端 `dsh-opendesign-go` 0.1.9 的 MODEL_DEFAULTS;该表标为厂商资料,
|
|
11
|
+
* 不能当作网关实测上限。图片模态按最新证据单独核验。
|
|
12
12
|
* - 其余上下文窗口采用厂商公开资料或明确标注的暂定参考,逐型号来源见
|
|
13
13
|
* docs/model-context.md;CoRouter 实际限制未验证,可以通过模型设置覆盖。
|
|
14
14
|
* - `gpt-6.1-terra` 的 maxOutputTokens / inputModalities 取自厂商型号文档;
|
|
15
|
-
*
|
|
15
|
+
* 其余型号仅补充上下文参考,不新增目录最大输出能力字段。
|
|
16
16
|
* - 客户端桌面安装(Open Design 0.26.1)不内联 CoRouter 目录;其
|
|
17
17
|
* `vela model preset --format json` 只有 11 个旧预设 id(见 docs/client-evidence.md),
|
|
18
18
|
* 与本表不同代,故不用于本目录。
|
package/lib/client.d.ts
CHANGED
|
@@ -30,6 +30,9 @@ export interface FormValues {
|
|
|
30
30
|
quotaRefreshSeconds?: number;
|
|
31
31
|
requestTimeoutMs?: number;
|
|
32
32
|
streamIdleTimeoutMs?: number;
|
|
33
|
+
maxRequestImageBytes?: number;
|
|
34
|
+
turnReviewMaxContinuations?: number;
|
|
35
|
+
turnReviewNoProgressLimit?: number;
|
|
33
36
|
}
|
|
34
37
|
export interface FormSnapshot {
|
|
35
38
|
status: 'loading' | 'ready' | 'unavailable';
|
|
@@ -110,6 +113,15 @@ export declare function QuotaView({ quota, nextAutoRefreshAt, refreshIntervalSec
|
|
|
110
113
|
}, HTMLElement> | React.FunctionComponentElement<{
|
|
111
114
|
children?: React.ReactNode | undefined;
|
|
112
115
|
}>;
|
|
116
|
+
/** 异常结束监控卡片:协议拦截与新监控计数分列,未知值保持未知,不补零;计数均从插件加载起累计。 */
|
|
117
|
+
export declare function TurnMonitorView({ turnMonitor, guardedTurns, enabled }: {
|
|
118
|
+
turnMonitor?: Status['turnMonitor'];
|
|
119
|
+
guardedTurns?: number | undefined;
|
|
120
|
+
enabled?: boolean | undefined;
|
|
121
|
+
}): React.DetailedReactHTMLElement<{
|
|
122
|
+
className: string;
|
|
123
|
+
'aria-label': string;
|
|
124
|
+
}, HTMLElement>;
|
|
113
125
|
/** Whole-map model settings writer: absent entry means "inherit every default". */
|
|
114
126
|
export declare function writeModelSettings(map: ModelSettingsMap | undefined, id: string, next: ModelSettings | undefined): ModelSettingsMap;
|
|
115
127
|
/** One model's explicit settings; unknown ids read as "no overrides". */
|
package/lib/client.js
CHANGED
|
@@ -38,6 +38,7 @@ __export(client_exports, {
|
|
|
38
38
|
Overview: () => Overview,
|
|
39
39
|
QuotaView: () => QuotaView,
|
|
40
40
|
SettingsPage: () => SettingsPage,
|
|
41
|
+
TurnMonitorView: () => TurnMonitorView,
|
|
41
42
|
apply: () => apply,
|
|
42
43
|
formatRefreshCountdown: () => formatRefreshCountdown,
|
|
43
44
|
formatRelativeDeadline: () => formatRelativeDeadline,
|
|
@@ -20024,6 +20025,15 @@ function parseModelSettingsMap(value) {
|
|
|
20024
20025
|
return out;
|
|
20025
20026
|
}
|
|
20026
20027
|
|
|
20028
|
+
// src/image-budget.ts
|
|
20029
|
+
var MIN_REQUEST_IMAGE_BYTES = 1024 * 1024;
|
|
20030
|
+
var DEFAULT_MAX_REQUEST_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
20031
|
+
var MAX_REQUEST_IMAGE_BYTES = 100 * 1024 * 1024;
|
|
20032
|
+
|
|
20033
|
+
// src/turn-monitor-status.ts
|
|
20034
|
+
var REVIEW_DECISIONS = ["continued", "completed", "waiting-user", "waiting-work", "blocked", "limited", "skipped", "unverified"];
|
|
20035
|
+
var REVIEW_REASONS = ["missing-outcome", "pending-action", "reported-complete", "needs-user", "work-running", "reported-blocked", "continuation-limit", "no-progress", "goal-owned", "service-unavailable", "cancelled", "truncated", "request-failed", "disabled", "superseded", "invalid-evidence", "tool-concluded"];
|
|
20036
|
+
|
|
20027
20037
|
// src/remote.ts
|
|
20028
20038
|
var MAX_REVISION = 256;
|
|
20029
20039
|
var MAX_JOB_ID = 128;
|
|
@@ -20212,7 +20222,10 @@ function parseStatusConfig(value) {
|
|
|
20212
20222
|
...value.modelSettings === void 0 ? {} : { modelSettings: parseModelSettingsMap(value.modelSettings) },
|
|
20213
20223
|
...value.requestTimeoutMs === void 0 ? {} : { requestTimeoutMs: positiveInteger(value.requestTimeoutMs, "\u8BF7\u6C42\u8D85\u65F6", 36e5, 1e3) },
|
|
20214
20224
|
...value.streamIdleTimeoutMs === void 0 ? {} : { streamIdleTimeoutMs: positiveInteger(value.streamIdleTimeoutMs, "\u6D41\u7A7A\u95F2\u8D85\u65F6", 18e5, 1e3) },
|
|
20215
|
-
...value.quotaRefreshSeconds === void 0 ? {} : { quotaRefreshSeconds: positiveInteger(value.quotaRefreshSeconds, "\u81EA\u52A8\u5237\u65B0\u95F4\u9694", 3600, 5) }
|
|
20225
|
+
...value.quotaRefreshSeconds === void 0 ? {} : { quotaRefreshSeconds: positiveInteger(value.quotaRefreshSeconds, "\u81EA\u52A8\u5237\u65B0\u95F4\u9694", 3600, 5) },
|
|
20226
|
+
...value.maxRequestImageBytes === void 0 ? {} : { maxRequestImageBytes: positiveInteger(value.maxRequestImageBytes, "\u8BF7\u6C42\u56FE\u7247\u9884\u7B97", MAX_REQUEST_IMAGE_BYTES, MIN_REQUEST_IMAGE_BYTES) },
|
|
20227
|
+
...value.turnReviewMaxContinuations === void 0 ? {} : { turnReviewMaxContinuations: positiveInteger(value.turnReviewMaxContinuations, "\u6536\u5C3E\u7EED\u529E\u6B21\u6570", 10) },
|
|
20228
|
+
...value.turnReviewNoProgressLimit === void 0 ? {} : { turnReviewNoProgressLimit: positiveInteger(value.turnReviewNoProgressLimit, "\u65E0\u8FDB\u5C55\u6B21\u6570", 5) }
|
|
20216
20229
|
};
|
|
20217
20230
|
}
|
|
20218
20231
|
function parseStatus(value) {
|
|
@@ -20237,12 +20250,25 @@ function parseStatus(value) {
|
|
|
20237
20250
|
login: parseLoginState(value.login),
|
|
20238
20251
|
config: parseStatusConfig(value.config),
|
|
20239
20252
|
guardedTurns: count(value.guardedTurns, "\u5DF2\u62E6\u622A\u7A7A\u8F6E\u6570"),
|
|
20253
|
+
...value.turnMonitor === void 0 ? {} : { turnMonitor: parseTurnMonitor(value.turnMonitor) },
|
|
20240
20254
|
models: parsed,
|
|
20241
20255
|
...value.modelsSource === void 0 ? {} : { modelsSource: member(value.modelsSource, ["builtin", "openai"], "\u6A21\u578B\u76EE\u5F55\u6765\u6E90") },
|
|
20242
20256
|
...value.modelsUpdatedAt === void 0 ? {} : { modelsUpdatedAt: isoTime(value.modelsUpdatedAt, "\u6A21\u578B\u66F4\u65B0\u65F6\u95F4") },
|
|
20243
20257
|
...value.modelsError === void 0 ? {} : { modelsError: text(value.modelsError, "\u6A21\u578B\u66F4\u65B0\u63D0\u793A", MAX_MESSAGE) }
|
|
20244
20258
|
};
|
|
20245
20259
|
}
|
|
20260
|
+
function parseTurnMonitor(value) {
|
|
20261
|
+
if (!record2(value)) throw new Error("\u7ED3\u675F\u6838\u9A8C\u72B6\u6001\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
20262
|
+
const last = value.last;
|
|
20263
|
+
if (last !== void 0 && !record2(last)) throw new Error("\u6700\u8FD1\u7ED3\u675F\u6838\u9A8C\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
20264
|
+
return {
|
|
20265
|
+
available: flag(value.available, "\u6536\u5C3E\u6838\u9A8C\u662F\u5426\u53EF\u7528"),
|
|
20266
|
+
checks: count(value.checks, "\u6536\u5C3E\u6838\u9A8C\u6B21\u6570"),
|
|
20267
|
+
continuations: count(value.continuations, "\u4EFB\u52A1\u7EED\u529E\u6B21\u6570"),
|
|
20268
|
+
requestRetries: count(value.requestRetries, "\u8BF7\u6C42\u91CD\u8BD5\u6B21\u6570"),
|
|
20269
|
+
...record2(last) ? { last: { at: isoTime(last.at, "\u6536\u5C3E\u6838\u9A8C\u65F6\u95F4"), decision: member(last.decision, REVIEW_DECISIONS, "\u6536\u5C3E\u6838\u9A8C\u51B3\u5B9A"), reason: member(last.reason, REVIEW_REASONS, "\u6536\u5C3E\u6838\u9A8C\u539F\u56E0") } } : {}
|
|
20270
|
+
};
|
|
20271
|
+
}
|
|
20246
20272
|
function parseStartLoginRequest(value) {
|
|
20247
20273
|
if (!record2(value)) throw new Error("\u767B\u5F55\u8BF7\u6C42\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
20248
20274
|
return { expectedRevision: text(value.expectedRevision, "\u914D\u7F6E\u7248\u672C", MAX_REVISION) };
|
|
@@ -20345,6 +20371,12 @@ var MAX_REQUEST_TIMEOUT_MS = 36e5;
|
|
|
20345
20371
|
var DEFAULT_STREAM_IDLE_TIMEOUT_MS = 3e5;
|
|
20346
20372
|
var MIN_STREAM_IDLE_TIMEOUT_MS = 1e3;
|
|
20347
20373
|
var MAX_STREAM_IDLE_TIMEOUT_MS = 18e5;
|
|
20374
|
+
var DEFAULT_TURN_REVIEW_MAX_CONTINUATIONS = 3;
|
|
20375
|
+
var MIN_TURN_REVIEW_MAX_CONTINUATIONS = 1;
|
|
20376
|
+
var MAX_TURN_REVIEW_MAX_CONTINUATIONS = 10;
|
|
20377
|
+
var DEFAULT_TURN_REVIEW_NO_PROGRESS_LIMIT = 2;
|
|
20378
|
+
var MIN_TURN_REVIEW_NO_PROGRESS_LIMIT = 1;
|
|
20379
|
+
var MAX_TURN_REVIEW_NO_PROGRESS_LIMIT = 5;
|
|
20348
20380
|
var RPC_TIMEOUT_MS = 3e4;
|
|
20349
20381
|
var MAX_OUTPUT_TOKENS = 1e7;
|
|
20350
20382
|
var MAX_CONTEXT_WINDOW = 1e8;
|
|
@@ -20364,6 +20396,35 @@ var QUOTA_LABELS = {
|
|
|
20364
20396
|
"need-login": "\u9700\u8981\u767B\u5F55\u540E\u8BFB\u53D6\u989D\u5EA6",
|
|
20365
20397
|
error: "\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u989D\u5EA6"
|
|
20366
20398
|
};
|
|
20399
|
+
var REVIEW_DECISION_LABELS = {
|
|
20400
|
+
continued: "\u5DF2\u7EED\u529E",
|
|
20401
|
+
completed: "\u5DF2\u5B8C\u6210",
|
|
20402
|
+
"waiting-user": "\u7B49\u5F85\u7528\u6237",
|
|
20403
|
+
"waiting-work": "\u7B49\u5F85\u6267\u884C",
|
|
20404
|
+
blocked: "\u53D7\u963B",
|
|
20405
|
+
limited: "\u8FBE\u5230\u4E0A\u9650",
|
|
20406
|
+
skipped: "\u672A\u6838\u9A8C",
|
|
20407
|
+
unverified: "\u65E0\u6CD5\u786E\u8BA4"
|
|
20408
|
+
};
|
|
20409
|
+
var REVIEW_REASON_LABELS = {
|
|
20410
|
+
"missing-outcome": "\u5C1A\u672A\u62A5\u544A\u6536\u5C3E\u72B6\u6001",
|
|
20411
|
+
"pending-action": "\u5C1A\u6709\u5F85\u6267\u884C\u4E8B\u9879",
|
|
20412
|
+
"reported-complete": "\u5DF2\u62A5\u544A\u5B8C\u6210",
|
|
20413
|
+
"needs-user": "\u9700\u8981\u7528\u6237\u8865\u5145",
|
|
20414
|
+
"work-running": "\u4EFB\u52A1\u4ECD\u5728\u8FDB\u884C",
|
|
20415
|
+
"reported-blocked": "\u5DF2\u62A5\u544A\u963B\u585E",
|
|
20416
|
+
"continuation-limit": "\u8FBE\u5230\u7EED\u529E\u4E0A\u9650",
|
|
20417
|
+
"no-progress": "\u65E0\u8FDB\u5C55",
|
|
20418
|
+
"goal-owned": "\u7531\u73B0\u6709\u76EE\u6807\u72B6\u6001\u63A7\u5236",
|
|
20419
|
+
"service-unavailable": "\u670D\u52A1\u6682\u4E0D\u53EF\u7528",
|
|
20420
|
+
cancelled: "\u5DF2\u53D6\u6D88",
|
|
20421
|
+
truncated: "\u56DE\u7B54\u88AB\u622A\u65AD",
|
|
20422
|
+
"request-failed": "\u8BF7\u6C42\u5931\u8D25",
|
|
20423
|
+
disabled: "\u76D1\u63A7\u672A\u542F\u7528",
|
|
20424
|
+
superseded: "\u88AB\u65B0\u4EFB\u52A1\u53D6\u4EE3",
|
|
20425
|
+
"invalid-evidence": "\u8BC1\u636E\u4E0D\u53EF\u7528",
|
|
20426
|
+
"tool-concluded": "\u5DE5\u5177\u5DF2\u7ED3\u675F\u672C\u8F6E"
|
|
20427
|
+
};
|
|
20367
20428
|
function installStyles() {
|
|
20368
20429
|
const style = document.createElement("style");
|
|
20369
20430
|
style.dataset.opendesignCorouter = "";
|
|
@@ -20390,6 +20451,7 @@ function installStyles() {
|
|
|
20390
20451
|
.odc-switch{display:flex;align-items:center;gap:12px;min-height:44px;padding:6px 2px;cursor:pointer}.odc-switch input{appearance:auto;width:20px;height:20px;flex:none;margin:0;cursor:inherit;accent-color:var(--dsw-alias-brand-primary,Highlight)}.odc-switch>span{display:grid;gap:4px;min-width:0}.odc-switch:has(input:disabled){cursor:not-allowed;opacity:.6}.odc-divider{height:1px;border:0;background:var(--dsw-alias-border-l4,transparent);margin:2px 0}.odc-link{color:var(--dsw-alias-brand-primary,inherit);text-underline-offset:3px}
|
|
20391
20452
|
.odc-readonly{display:grid;gap:10px;margin-top:14px;padding:10px 12px;border-radius:8px;background:var(--dsw-alias-bg-layer-2,transparent)}.odc-code{display:block;min-width:0;color:var(--dsw-alias-label-primary,inherit);font-family:ui-monospace,'Cascadia Mono',Consolas,monospace;font-size:11px;line-height:1.6;overflow-wrap:anywhere}
|
|
20392
20453
|
.odc-timing{padding:12px 0;border-top:1px solid var(--dsw-alias-border-l4,transparent)}.odc-timing .odc-metric{min-height:0}.odc-settings>.odc-notice{margin-bottom:14px}.odc-model-details>summary{min-height:32px;padding:6px 0}
|
|
20454
|
+
.odc-turn-monitor{display:grid;gap:0;margin:12px 0 0}.odc-turn-monitor>div:first-child{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:0 0 6px}.odc-turn-monitor>div:first-child dt{font-size:12px;font-weight:600}.odc-turn-monitor-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;min-width:0;min-height:0;padding:6px 0;border-top:1px solid var(--dsw-alias-border-l4,transparent)}.odc-turn-monitor-row dt{font-size:12px;font-weight:600;color:var(--dsw-alias-label-secondary,inherit);min-width:0}.odc-turn-monitor-row dd{margin:0;min-width:0;text-align:right}.odc-turn-monitor-row .odc-metric-value{font-size:13px;font-variant-numeric:tabular-nums}.odc-turn-monitor-last dd{display:grid;gap:3px;justify-items:end}.odc-turn-monitor-verdict{font-size:12px;font-weight:600;overflow-wrap:anywhere;text-align:right}.odc-turn-monitor-last time{font-size:11px;font-variant-numeric:tabular-nums}
|
|
20393
20455
|
.odc-field-error{color:var(--dsw-alias-state-error-primary,inherit);color:color-mix(in srgb,var(--dsw-alias-state-error-primary,CanvasText) 85%,var(--dsw-alias-label-primary,CanvasText))}
|
|
20394
20456
|
.odc-model-groups{align-items:start}.odc-label,.odc-hint,.odc-meta,.odc-window dt,.odc-quota-footer dt,.odc-quota-footer dd,.odc-window-details>summary,.odc-model-details>summary,.odc-model-item code,.odc-model-meta,.odc-model-count,.odc-code{font-size:12px}.odc-field-compact .odc-input,.odc-button-small{font-size:12px}.odc-button-small{min-height:32px}.odc-chip{font-size:11px}
|
|
20395
20457
|
.odc-settings{--odc-accent:var(--dsw-alias-brand-primary-new-colorprimary-new-color,#4176e6);max-width:720px;padding:16px;line-height:1.6}
|
|
@@ -20751,6 +20813,53 @@ function QuotaView({ quota, nextAutoRefreshAt, refreshIntervalSeconds, busy = fa
|
|
|
20751
20813
|
quota.note !== void 0 ? h("p", { className: "odc-notice", "data-kind": quota.state === "error" ? "error" : "status", role: quota.state === "error" ? "alert" : "status" }, quota.note) : null
|
|
20752
20814
|
);
|
|
20753
20815
|
}
|
|
20816
|
+
function TurnMonitorView({ turnMonitor, guardedTurns, enabled = true }) {
|
|
20817
|
+
const metrics = [
|
|
20818
|
+
{ label: "\u7A7A\u54CD\u5E94\uFF0F\u6B8B\u7559\u62E6\u622A", hint: "\u7A7A\u56DE\u7B54\u6216\u534F\u8BAE\u6807\u8BB0\u6B8B\u7559\u7684\u62E6\u622A\u6B21\u6570\uFF0C\u4ECE\u63D2\u4EF6\u52A0\u8F7D\u8D77\u7D2F\u8BA1", value: guardedTurns === void 0 ? "\u2014" : String(guardedTurns) },
|
|
20819
|
+
{ label: "\u8BF7\u6C42\u91CD\u8BD5", hint: "\u672C\u63D2\u4EF6\u7A7A\u54CD\u5E94\u9519\u8BEF\u6062\u590D\u4E2D\u5DF2\u5F00\u59CB\u7684\u91CD\u8BD5\u6B21\u6570\uFF0C\u4ECE\u63D2\u4EF6\u52A0\u8F7D\u8D77\u7D2F\u8BA1", value: turnMonitor === void 0 ? "\u2014" : String(turnMonitor.requestRetries) },
|
|
20820
|
+
{ label: "\u7ED3\u675F\u6838\u9A8C", hint: "\u4EFB\u52A1\u6536\u5C3E\u7684\u6709\u754C\u6838\u9A8C\u6B21\u6570\uFF0C\u4ECE\u63D2\u4EF6\u52A0\u8F7D\u8D77\u7D2F\u8BA1", value: turnMonitor === void 0 ? "\u2014" : String(turnMonitor.checks) },
|
|
20821
|
+
{ label: "\u4EFB\u52A1\u7EED\u529E", hint: "\u7ED3\u675F\u68C0\u67E5\u70B9\u8FFD\u52A0\u7684\u6838\u9A8C\u6216\u4EFB\u52A1\u6B65\u9AA4\u6B21\u6570\uFF0C\u4ECE\u63D2\u4EF6\u52A0\u8F7D\u8D77\u7D2F\u8BA1", value: turnMonitor === void 0 ? "\u2014" : String(turnMonitor.continuations) }
|
|
20822
|
+
];
|
|
20823
|
+
const last = turnMonitor?.last;
|
|
20824
|
+
const lastAt = last === void 0 || !Number.isFinite(Date.parse(last.at)) ? void 0 : last.at;
|
|
20825
|
+
const lastDecision = last === void 0 ? void 0 : REVIEW_DECISION_LABELS[last.decision];
|
|
20826
|
+
const lastReason = last === void 0 ? void 0 : REVIEW_REASON_LABELS[last.reason];
|
|
20827
|
+
return h(
|
|
20828
|
+
"dl",
|
|
20829
|
+
{ className: "odc-card odc-turn-monitor", "aria-label": "\u5F02\u5E38\u7ED3\u675F\u76D1\u63A7" },
|
|
20830
|
+
h(
|
|
20831
|
+
"div",
|
|
20832
|
+
null,
|
|
20833
|
+
h("dt", null, "\u76D1\u63A7\u6307\u6807"),
|
|
20834
|
+
h(
|
|
20835
|
+
"span",
|
|
20836
|
+
{ className: "odc-hint", role: "status" },
|
|
20837
|
+
!enabled ? "\u76D1\u63A7\u5DF2\u5173\u95ED\uFF1B\u4EE5\u4E0B\u4E3A\u672C\u6B21\u52A0\u8F7D\u7684\u7D2F\u8BA1\u8BB0\u5F55\u3002" : turnMonitor === void 0 ? guardedTurns === void 0 ? "\u6682\u65E0\u76D1\u63A7\u6570\u636E" : "\u4EC5\u534F\u8BAE\u62E6\u622A\u8BA1\u6570\u53EF\u7528" : turnMonitor.available ? `\u6536\u5C3E\u6838\u9A8C\u53EF\u7528\uFF0C\u5DF2\u6838\u9A8C ${turnMonitor.checks} \u6B21\u3002` : "\u4EC5\u534F\u8BAE\u4FDD\u62A4\u53EF\u7528\uFF1B\u6536\u5C3E\u6838\u9A8C\u672A\u542F\u7528\u3002"
|
|
20838
|
+
)
|
|
20839
|
+
),
|
|
20840
|
+
metrics.map((metric) => h(
|
|
20841
|
+
"div",
|
|
20842
|
+
{ className: "odc-turn-monitor-row", key: metric.label },
|
|
20843
|
+
h("dt", { title: metric.hint }, metric.label),
|
|
20844
|
+
h("dd", null, h("strong", { className: "odc-metric-value" }, metric.value))
|
|
20845
|
+
)),
|
|
20846
|
+
h(
|
|
20847
|
+
"div",
|
|
20848
|
+
{ className: "odc-turn-monitor-row odc-turn-monitor-last", key: "last" },
|
|
20849
|
+
h("dt", null, "\u6700\u8FD1\u51B3\u5B9A"),
|
|
20850
|
+
h(
|
|
20851
|
+
"dd",
|
|
20852
|
+
null,
|
|
20853
|
+
lastDecision === void 0 || lastReason === void 0 || lastAt === void 0 ? h("span", { className: "odc-hint" }, "\u2014") : h(
|
|
20854
|
+
React.Fragment,
|
|
20855
|
+
null,
|
|
20856
|
+
h("span", { className: "odc-turn-monitor-verdict" }, `${lastDecision} \xB7 ${lastReason}`),
|
|
20857
|
+
h("time", { className: "odc-hint", dateTime: lastAt, title: `\u6700\u8FD1\u51B3\u5B9A\u65F6\u95F4\uFF1A${formatTime(lastAt)}`, "aria-label": `\u6700\u8FD1\u51B3\u5B9A\uFF1A${lastDecision}\uFF0C\u539F\u56E0\uFF1A${lastReason}\uFF0C\u65F6\u95F4\uFF1A${formatTime(lastAt)}` }, formatTime(lastAt))
|
|
20858
|
+
)
|
|
20859
|
+
)
|
|
20860
|
+
)
|
|
20861
|
+
);
|
|
20862
|
+
}
|
|
20754
20863
|
function writeModelSettings(map2, id, next) {
|
|
20755
20864
|
const out = { ...map2 ?? {} };
|
|
20756
20865
|
if (next === void 0) {
|
|
@@ -21080,7 +21189,7 @@ function ModelRow({ model, settings, authoritative, writable, pending, disabledR
|
|
|
21080
21189
|
return false;
|
|
21081
21190
|
}
|
|
21082
21191
|
}
|
|
21083
|
-
const output2 = next.maxTokens
|
|
21192
|
+
const output2 = next.maxTokens;
|
|
21084
21193
|
const context = next.contextWindow ?? model.contextWindow;
|
|
21085
21194
|
if (output2 !== void 0 && context !== void 0 && output2 >= context) {
|
|
21086
21195
|
setError("\u6700\u5927\u8F93\u51FA\u5FC5\u987B\u5C0F\u4E8E\u4E0A\u4E0B\u6587\u9884\u7B97\uFF1B\u8BF7\u5148\u589E\u5927\u4E0A\u4E0B\u6587\u9884\u7B97\u6216\u51CF\u5C0F\u6700\u5927\u8F93\u51FA\u3002");
|
|
@@ -21301,7 +21410,7 @@ function Models({ status, formSnapshot, setFormField, pendingField, onRefreshMod
|
|
|
21301
21410
|
"div",
|
|
21302
21411
|
null,
|
|
21303
21412
|
h("h3", null, "\u53EF\u7528\u6A21\u578B"),
|
|
21304
|
-
h("p", { className: "odc-hint" }, "\u6309\u5206\u7EC4\u641C\u7D22\u6A21\u578B\uFF0C\u8BBE\u7F6E\u542F\u7528\u72B6\u6001\u4E0E\u9ED8\u8BA4\u53C2\u6570\u3002\u4E0A\u4E0B\u6587\
|
|
21413
|
+
h("p", { className: "odc-hint" }, "\u6309\u5206\u7EC4\u641C\u7D22\u6A21\u578B\uFF0C\u8BBE\u7F6E\u542F\u7528\u72B6\u6001\u4E0E\u9ED8\u8BA4\u53C2\u6570\u3002\u4E0A\u4E0B\u6587\u4E3A\u53C2\u8003\u9884\u7B97\uFF1B\u5237\u65B0\u540E\u4F1A\u91C7\u7528\u7F51\u5173\u62A5\u544A\u7684\u8F83\u5C0F\u7A97\u53E3\uFF0C\u5B9E\u9645\u9650\u5236\u53EF\u80FD\u4E0D\u540C\uFF0C\u53EF\u5728\u6A21\u578B\u8BBE\u7F6E\u4E2D\u8986\u76D6\u3002")
|
|
21305
21414
|
),
|
|
21306
21415
|
h(
|
|
21307
21416
|
"div",
|
|
@@ -21405,6 +21514,9 @@ function Advanced({ status, formSnapshot, setFormField, pendingField }) {
|
|
|
21405
21514
|
const requestTimeout = formSnapshot.value?.requestTimeoutMs ?? status?.config.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
|
|
21406
21515
|
const streamIdleTimeout = formSnapshot.value?.streamIdleTimeoutMs ?? status?.config.streamIdleTimeoutMs ?? DEFAULT_STREAM_IDLE_TIMEOUT_MS;
|
|
21407
21516
|
const refreshSeconds = formSnapshot.value?.quotaRefreshSeconds ?? status?.config.quotaRefreshSeconds ?? DEFAULT_QUOTA_REFRESH_SECONDS;
|
|
21517
|
+
const imageBudget = formSnapshot.value?.maxRequestImageBytes ?? status?.config.maxRequestImageBytes ?? DEFAULT_MAX_REQUEST_IMAGE_BYTES;
|
|
21518
|
+
const turnContinuations = formSnapshot.value?.turnReviewMaxContinuations ?? status?.config.turnReviewMaxContinuations ?? DEFAULT_TURN_REVIEW_MAX_CONTINUATIONS;
|
|
21519
|
+
const turnNoProgress = formSnapshot.value?.turnReviewNoProgressLimit ?? status?.config.turnReviewNoProgressLimit ?? DEFAULT_TURN_REVIEW_NO_PROGRESS_LIMIT;
|
|
21408
21520
|
const selected = API_PROTOCOL_OPTIONS.find((option) => option.id === protocol);
|
|
21409
21521
|
const saveKeyRef = async () => {
|
|
21410
21522
|
const value = apiKeyEnv.trim();
|
|
@@ -21427,16 +21539,39 @@ function Advanced({ status, formSnapshot, setFormField, pendingField }) {
|
|
|
21427
21539
|
"section",
|
|
21428
21540
|
{ className: "odc-card" },
|
|
21429
21541
|
h("h3", null, "\u5F02\u5E38\u7ED3\u675F\u76D1\u63A7"),
|
|
21430
|
-
h("p", { className: "odc-hint" }, "\u68C0\u6D4B DeepSeek V4.1 Flash \u5DE5\u5177\u5BF9\u8BDD\u4E2D\u7684\u7A7A\u56DE\u7B54\u3001\u534F\u8BAE\u6807\u8BB0\u6B8B\u7559\u6216\u8BF4\u660E\u4E0B\u4E00\u6B65\u540E\u672A\u6267\u884C\u7684\u63D0\u524D\u7ED3\u675F\u3002
|
|
21542
|
+
h("p", { className: "odc-hint" }, "\u68C0\u6D4B DeepSeek V4.1 Flash \u5DE5\u5177\u5BF9\u8BDD\u4E2D\u7684\u7A7A\u56DE\u7B54\u3001\u534F\u8BAE\u6807\u8BB0\u6B8B\u7559\u6216\u8BF4\u660E\u4E0B\u4E00\u6B65\u540E\u672A\u6267\u884C\u7684\u63D0\u524D\u7ED3\u675F\u3002"),
|
|
21431
21543
|
h("div", { style: { marginTop: 14 } }, h(Switch, {
|
|
21432
21544
|
checked: formSnapshot.value?.emptyTurnGuard ?? status?.config.emptyTurnGuard ?? true,
|
|
21433
21545
|
disabled: !writable || pendingField.includes("emptyTurnGuard"),
|
|
21434
21546
|
label: "\u542F\u7528\u5F02\u5E38\u7ED3\u675F\u76D1\u63A7",
|
|
21435
|
-
hint: `\u5DF2\
|
|
21547
|
+
hint: `\u5DF2\u7D2F\u8BA1 ${status?.guardedTurns ?? "\u2014"} \u6B21\u7A7A\u54CD\u5E94\u6216\u6B8B\u7559\u62E6\u622A\u3002\u534F\u8BAE\u7A7A\u54CD\u5E94\u6062\u590D\u6301\u7EED\u5230\u6210\u529F\u6216\u53D6\u6D88\uFF1B\u6536\u5C3E\u6838\u9A8C\u6709\u754C\uFF0C\u53EF\u80FD\u989D\u5916\u6D88\u8017\u989D\u5EA6\u3002`,
|
|
21436
21548
|
onChange: (checked) => {
|
|
21437
21549
|
void setFormField("emptyTurnGuard", checked);
|
|
21438
21550
|
}
|
|
21439
|
-
}))
|
|
21551
|
+
})),
|
|
21552
|
+
h(TurnMonitorView, { turnMonitor: status?.turnMonitor, guardedTurns: status?.guardedTurns, enabled: formSnapshot.value?.emptyTurnGuard ?? status?.config.emptyTurnGuard ?? true }),
|
|
21553
|
+
h(NumberField, {
|
|
21554
|
+
id: "odc-turn-continuations",
|
|
21555
|
+
label: "\u6536\u5C3E\u6838\u9A8C\u6700\u5927\u7EED\u529E\u6B21\u6570",
|
|
21556
|
+
hint: `\u6838\u9A8C\u672A\u5B8C\u6210\u65F6\u6700\u591A\u81EA\u52A8\u7EED\u529E\u7684\u6B21\u6570\uFF0C${MIN_TURN_REVIEW_MAX_CONTINUATIONS}\u2013${MAX_TURN_REVIEW_MAX_CONTINUATIONS}\uFF1B\u9ED8\u8BA4 ${DEFAULT_TURN_REVIEW_MAX_CONTINUATIONS} \u6B21\u3002`,
|
|
21557
|
+
value: turnContinuations,
|
|
21558
|
+
min: MIN_TURN_REVIEW_MAX_CONTINUATIONS,
|
|
21559
|
+
max: MAX_TURN_REVIEW_MAX_CONTINUATIONS,
|
|
21560
|
+
integer: true,
|
|
21561
|
+
disabled: !writable || pendingField.includes("turnReviewMaxContinuations"),
|
|
21562
|
+
onCommit: (value) => setFormField("turnReviewMaxContinuations", value)
|
|
21563
|
+
}),
|
|
21564
|
+
h(NumberField, {
|
|
21565
|
+
id: "odc-turn-no-progress",
|
|
21566
|
+
label: "\u65E0\u8FDB\u5C55\u505C\u6B62\u4E0A\u9650",
|
|
21567
|
+
hint: `\u8FDE\u7EED\u65E0\u8FDB\u5C55\u7684\u6838\u9A8C\u8FBE\u5230\u8BE5\u6B21\u6570\u5373\u505C\u6B62\u7EED\u529E\uFF0C${MIN_TURN_REVIEW_NO_PROGRESS_LIMIT}\u2013${MAX_TURN_REVIEW_NO_PROGRESS_LIMIT}\uFF1B\u9ED8\u8BA4 ${DEFAULT_TURN_REVIEW_NO_PROGRESS_LIMIT} \u6B21\u3002`,
|
|
21568
|
+
value: turnNoProgress,
|
|
21569
|
+
min: MIN_TURN_REVIEW_NO_PROGRESS_LIMIT,
|
|
21570
|
+
max: MAX_TURN_REVIEW_NO_PROGRESS_LIMIT,
|
|
21571
|
+
integer: true,
|
|
21572
|
+
disabled: !writable || pendingField.includes("turnReviewNoProgressLimit"),
|
|
21573
|
+
onCommit: (value) => setFormField("turnReviewNoProgressLimit", value)
|
|
21574
|
+
})
|
|
21440
21575
|
),
|
|
21441
21576
|
h(
|
|
21442
21577
|
"section",
|
|
@@ -21506,6 +21641,23 @@ function Advanced({ status, formSnapshot, setFormField, pendingField }) {
|
|
|
21506
21641
|
),
|
|
21507
21642
|
h(NoticeView, { notice: keyNotice })
|
|
21508
21643
|
),
|
|
21644
|
+
h(
|
|
21645
|
+
"section",
|
|
21646
|
+
{ className: "odc-card" },
|
|
21647
|
+
h("h3", null, "\u56FE\u7247\u8BF7\u6C42\u9884\u7B97"),
|
|
21648
|
+
h("p", { className: "odc-hint" }, "\u5386\u53F2\u56FE\u7247\u8D85\u51FA\u9884\u7B97\u65F6\uFF0C\u7531\u5BBF\u4E3B\u5C06\u6700\u65E7\u56FE\u7247\u66FF\u6362\u4E3A\u5360\u4F4D\u7B26\u5E76\u91CD\u8BD5\uFF1B\u539F\u9644\u4EF6\u4FDD\u7559\u3002\u6458\u8981\u8BF7\u6C42\u4E5F\u4F7F\u7528\u6B64\u9884\u7B97\u3002"),
|
|
21649
|
+
h(NumberField, {
|
|
21650
|
+
id: "odc-image-budget",
|
|
21651
|
+
label: "\u5355\u6B21\u8BF7\u6C42\u56FE\u7247\u9884\u7B97\uFF08MiB\uFF09",
|
|
21652
|
+
hint: "1\u2013100 MiB\uFF1B\u7F51\u5173\u9650\u5236\u8F83\u4F4E\u65F6\u53EF\u8C03\u5C0F\u3002",
|
|
21653
|
+
value: imageBudget / (1024 * 1024),
|
|
21654
|
+
min: MIN_REQUEST_IMAGE_BYTES / (1024 * 1024),
|
|
21655
|
+
max: MAX_REQUEST_IMAGE_BYTES / (1024 * 1024),
|
|
21656
|
+
integer: false,
|
|
21657
|
+
disabled: !writable || pendingField.includes("maxRequestImageBytes"),
|
|
21658
|
+
onCommit: (value) => setFormField("maxRequestImageBytes", Math.round(value * 1024 * 1024))
|
|
21659
|
+
})
|
|
21660
|
+
),
|
|
21509
21661
|
h(
|
|
21510
21662
|
"section",
|
|
21511
21663
|
{ className: "odc-card" },
|
package/lib/config.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Schema from '@deepseek-ai/schemastery';
|
|
2
2
|
import { type ApiProtocol } from './protocol-options.js';
|
|
3
3
|
import { type ModelSettingsMap } from './model-settings.js';
|
|
4
|
+
export { DEFAULT_MAX_REQUEST_IMAGE_BYTES } from './image-budget.js';
|
|
4
5
|
export declare const SETTINGS_NS = "llm-opendesign-corouter";
|
|
5
6
|
export declare const PLAN_PROVIDER = "opendesign-corouter-plan";
|
|
6
7
|
export declare const PAID_PROVIDER = "opendesign-corouter-paid";
|
|
@@ -12,9 +13,12 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
12
13
|
modelSettings: Schema<NoInfer<import("@deepseek-ai/cosmokit").Dict<unknown, string>>, NoInfer<ModelSettingsMap>, "volatile-defined">;
|
|
13
14
|
useDesktopCredential: Schema<boolean, boolean, "volatile-defined">;
|
|
14
15
|
emptyTurnGuard: Schema<boolean, boolean, "volatile-defined">;
|
|
16
|
+
turnReviewMaxContinuations: Schema<number, number, "volatile-defined">;
|
|
17
|
+
turnReviewNoProgressLimit: Schema<number, number, "volatile-defined">;
|
|
15
18
|
quotaRefreshSeconds: Schema<number, number, "volatile-defined">;
|
|
16
19
|
requestTimeoutMs: Schema<number, number, "volatile-defined">;
|
|
17
20
|
streamIdleTimeoutMs: Schema<number, number, "volatile-defined">;
|
|
21
|
+
maxRequestImageBytes: Schema<number, number, "volatile-defined">;
|
|
18
22
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
19
23
|
apiKeyEnv: Schema<string, string, "volatile-defined">;
|
|
20
24
|
baseURL: Schema<string, string, "volatile-defined">;
|
|
@@ -22,9 +26,12 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
22
26
|
modelSettings: Schema<NoInfer<import("@deepseek-ai/cosmokit").Dict<unknown, string>>, NoInfer<ModelSettingsMap>, "volatile-defined">;
|
|
23
27
|
useDesktopCredential: Schema<boolean, boolean, "volatile-defined">;
|
|
24
28
|
emptyTurnGuard: Schema<boolean, boolean, "volatile-defined">;
|
|
29
|
+
turnReviewMaxContinuations: Schema<number, number, "volatile-defined">;
|
|
30
|
+
turnReviewNoProgressLimit: Schema<number, number, "volatile-defined">;
|
|
25
31
|
quotaRefreshSeconds: Schema<number, number, "volatile-defined">;
|
|
26
32
|
requestTimeoutMs: Schema<number, number, "volatile-defined">;
|
|
27
33
|
streamIdleTimeoutMs: Schema<number, number, "volatile-defined">;
|
|
34
|
+
maxRequestImageBytes: Schema<number, number, "volatile-defined">;
|
|
28
35
|
}>>, "plain">;
|
|
29
36
|
export type LiveConfig = ReturnType<typeof Config>;
|
|
30
37
|
export interface RuntimeConfig {
|
|
@@ -37,6 +44,9 @@ export interface RuntimeConfig {
|
|
|
37
44
|
apiProtocol?: ApiProtocol;
|
|
38
45
|
modelSettings?: ModelSettingsMap;
|
|
39
46
|
quotaRefreshSeconds?: number;
|
|
47
|
+
maxRequestImageBytes?: number;
|
|
48
|
+
turnReviewMaxContinuations?: number;
|
|
49
|
+
turnReviewNoProgressLimit?: number;
|
|
40
50
|
}
|
|
41
51
|
export declare function assertBaseURL(raw: string): string;
|
|
42
52
|
export declare function readConfig(config: LiveConfig): RuntimeConfig;
|
package/lib/device-auth.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export interface DeviceTokens {
|
|
|
3
3
|
runtimeKey: string;
|
|
4
4
|
}
|
|
5
5
|
export declare const DEVICE_AUTH_ENDPOINT = "https://amr-api.open-design.ai/api/v1/cli/device-authorizations";
|
|
6
|
-
export declare const DEVICE_AUTH_PLUGIN_VERSION = "0.1.
|
|
6
|
+
export declare const DEVICE_AUTH_PLUGIN_VERSION = "0.1.15";
|
|
7
7
|
export declare const DEVICE_REQUEST_TIMEOUT_MS = 20000;
|
|
8
8
|
/** One bounded launch step of the temporary activation window. */
|
|
9
9
|
export declare const DEVICE_OPEN_TIMEOUT_MS = 30000;
|
package/lib/empty-turn.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type FinishReason, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
2
2
|
/** Failure message a rewritten empty turn carries. */
|
|
3
3
|
export declare const EMPTY_TURN_MESSAGE = "OpenDesign\uFF1A\u6A21\u578B\u672A\u4EA7\u751F\u53EF\u7528\u56DE\u7B54\u6216\u6709\u6548\u5DE5\u5177\u8C03\u7528";
|
|
4
|
-
export declare const INCOMPLETE_TURN_MESSAGE = "OpenDesign\uFF1A\u6A21\u578B\u505C\u5728\u64CD\u4F5C\u8BF4\u660E\uFF0C\u672A\u7EE7\u7EED\u53D1\u8D77\u5DE5\u5177\u8C03\u7528";
|
|
5
4
|
/**
|
|
6
5
|
* Remove protocol residue from one assembled channel.
|
|
7
6
|
* @param text - concatenated text or reasoning content.
|
|
@@ -14,8 +13,6 @@ export declare function stripProtocolResidue(text: string): string;
|
|
|
14
13
|
* @returns true for absent, blank, or residue-only content.
|
|
15
14
|
*/
|
|
16
15
|
export declare function isResidueOnly(text: string | undefined): boolean;
|
|
17
|
-
/** Recognize a short action promise, optionally after a concise progress update. */
|
|
18
|
-
export declare function isPendingActionTurn(text: string | undefined): boolean;
|
|
19
16
|
/** Stream facts one attempt produced, as the adapter accumulated them. */
|
|
20
17
|
export interface EmptyTurnInput {
|
|
21
18
|
/** Whether any tool-call block was opened or streamed during this attempt. */
|
|
@@ -32,8 +29,6 @@ export interface EmptyTurnEvidence {
|
|
|
32
29
|
readonly reasoningLength: number;
|
|
33
30
|
/** True when the visible text channel is empty once protocol residue is removed. */
|
|
34
31
|
readonly markupOnly: boolean;
|
|
35
|
-
/** True for a narrowly recognized pending-action statement. */
|
|
36
|
-
readonly pendingAction: boolean;
|
|
37
32
|
}
|
|
38
33
|
/**
|
|
39
34
|
* Whether this finish is the empty turn the guard exists for.
|
package/lib/eot-recovery.d.ts
CHANGED
|
@@ -24,10 +24,11 @@ export declare class EotRecovery {
|
|
|
24
24
|
#private;
|
|
25
25
|
readonly enabled: () => boolean;
|
|
26
26
|
readonly wait: typeof cancellableDelay;
|
|
27
|
-
|
|
27
|
+
readonly onRetry?: (() => void) | undefined;
|
|
28
|
+
constructor(enabled: () => boolean, wait?: typeof cancellableDelay, onRetry?: (() => void) | undefined);
|
|
28
29
|
readonly handle: RecoveryListener;
|
|
29
30
|
dispose(): Promise<void>;
|
|
30
31
|
}
|
|
31
32
|
/** Register against the host's documented scoped recovery waterfall. */
|
|
32
|
-
export declare function installEotRecovery(ctx: Context, enabled: () => boolean): void;
|
|
33
|
+
export declare function installEotRecovery(ctx: Context, enabled: () => boolean, onRetry?: () => void): void;
|
|
33
34
|
export {};
|
|
@@ -86,6 +86,15 @@ function parseModelSettingsMap(value) {
|
|
|
86
86
|
return out;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
// src/image-budget.ts
|
|
90
|
+
var MIN_REQUEST_IMAGE_BYTES = 1024 * 1024;
|
|
91
|
+
var DEFAULT_MAX_REQUEST_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
92
|
+
var MAX_REQUEST_IMAGE_BYTES = 100 * 1024 * 1024;
|
|
93
|
+
|
|
94
|
+
// src/turn-monitor-status.ts
|
|
95
|
+
var REVIEW_DECISIONS = ["continued", "completed", "waiting-user", "waiting-work", "blocked", "limited", "skipped", "unverified"];
|
|
96
|
+
var REVIEW_REASONS = ["missing-outcome", "pending-action", "reported-complete", "needs-user", "work-running", "reported-blocked", "continuation-limit", "no-progress", "goal-owned", "service-unavailable", "cancelled", "truncated", "request-failed", "disabled", "superseded", "invalid-evidence", "tool-concluded"];
|
|
97
|
+
|
|
89
98
|
// src/remote.ts
|
|
90
99
|
var MAX_REVISION = 256;
|
|
91
100
|
var MAX_JOB_ID = 128;
|
|
@@ -274,7 +283,10 @@ function parseStatusConfig(value) {
|
|
|
274
283
|
...value.modelSettings === void 0 ? {} : { modelSettings: parseModelSettingsMap(value.modelSettings) },
|
|
275
284
|
...value.requestTimeoutMs === void 0 ? {} : { requestTimeoutMs: positiveInteger(value.requestTimeoutMs, "\u8BF7\u6C42\u8D85\u65F6", 36e5, 1e3) },
|
|
276
285
|
...value.streamIdleTimeoutMs === void 0 ? {} : { streamIdleTimeoutMs: positiveInteger(value.streamIdleTimeoutMs, "\u6D41\u7A7A\u95F2\u8D85\u65F6", 18e5, 1e3) },
|
|
277
|
-
...value.quotaRefreshSeconds === void 0 ? {} : { quotaRefreshSeconds: positiveInteger(value.quotaRefreshSeconds, "\u81EA\u52A8\u5237\u65B0\u95F4\u9694", 3600, 5) }
|
|
286
|
+
...value.quotaRefreshSeconds === void 0 ? {} : { quotaRefreshSeconds: positiveInteger(value.quotaRefreshSeconds, "\u81EA\u52A8\u5237\u65B0\u95F4\u9694", 3600, 5) },
|
|
287
|
+
...value.maxRequestImageBytes === void 0 ? {} : { maxRequestImageBytes: positiveInteger(value.maxRequestImageBytes, "\u8BF7\u6C42\u56FE\u7247\u9884\u7B97", MAX_REQUEST_IMAGE_BYTES, MIN_REQUEST_IMAGE_BYTES) },
|
|
288
|
+
...value.turnReviewMaxContinuations === void 0 ? {} : { turnReviewMaxContinuations: positiveInteger(value.turnReviewMaxContinuations, "\u6536\u5C3E\u7EED\u529E\u6B21\u6570", 10) },
|
|
289
|
+
...value.turnReviewNoProgressLimit === void 0 ? {} : { turnReviewNoProgressLimit: positiveInteger(value.turnReviewNoProgressLimit, "\u65E0\u8FDB\u5C55\u6B21\u6570", 5) }
|
|
278
290
|
};
|
|
279
291
|
}
|
|
280
292
|
function parseStatus(value) {
|
|
@@ -299,12 +311,25 @@ function parseStatus(value) {
|
|
|
299
311
|
login: parseLoginState(value.login),
|
|
300
312
|
config: parseStatusConfig(value.config),
|
|
301
313
|
guardedTurns: count(value.guardedTurns, "\u5DF2\u62E6\u622A\u7A7A\u8F6E\u6570"),
|
|
314
|
+
...value.turnMonitor === void 0 ? {} : { turnMonitor: parseTurnMonitor(value.turnMonitor) },
|
|
302
315
|
models: parsed,
|
|
303
316
|
...value.modelsSource === void 0 ? {} : { modelsSource: member(value.modelsSource, ["builtin", "openai"], "\u6A21\u578B\u76EE\u5F55\u6765\u6E90") },
|
|
304
317
|
...value.modelsUpdatedAt === void 0 ? {} : { modelsUpdatedAt: isoTime(value.modelsUpdatedAt, "\u6A21\u578B\u66F4\u65B0\u65F6\u95F4") },
|
|
305
318
|
...value.modelsError === void 0 ? {} : { modelsError: text(value.modelsError, "\u6A21\u578B\u66F4\u65B0\u63D0\u793A", MAX_MESSAGE) }
|
|
306
319
|
};
|
|
307
320
|
}
|
|
321
|
+
function parseTurnMonitor(value) {
|
|
322
|
+
if (!record(value)) throw new Error("\u7ED3\u675F\u6838\u9A8C\u72B6\u6001\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
323
|
+
const last = value.last;
|
|
324
|
+
if (last !== void 0 && !record(last)) throw new Error("\u6700\u8FD1\u7ED3\u675F\u6838\u9A8C\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
325
|
+
return {
|
|
326
|
+
available: flag(value.available, "\u6536\u5C3E\u6838\u9A8C\u662F\u5426\u53EF\u7528"),
|
|
327
|
+
checks: count(value.checks, "\u6536\u5C3E\u6838\u9A8C\u6B21\u6570"),
|
|
328
|
+
continuations: count(value.continuations, "\u4EFB\u52A1\u7EED\u529E\u6B21\u6570"),
|
|
329
|
+
requestRetries: count(value.requestRetries, "\u8BF7\u6C42\u91CD\u8BD5\u6B21\u6570"),
|
|
330
|
+
...record(last) ? { last: { at: isoTime(last.at, "\u6536\u5C3E\u6838\u9A8C\u65F6\u95F4"), decision: member(last.decision, REVIEW_DECISIONS, "\u6536\u5C3E\u6838\u9A8C\u51B3\u5B9A"), reason: member(last.reason, REVIEW_REASONS, "\u6536\u5C3E\u6838\u9A8C\u539F\u56E0") } } : {}
|
|
331
|
+
};
|
|
332
|
+
}
|
|
308
333
|
function parseStartLoginRequest(value) {
|
|
309
334
|
if (!record(value)) throw new Error("\u767B\u5F55\u8BF7\u6C42\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
310
335
|
return { expectedRevision: text(value.expectedRevision, "\u914D\u7F6E\u7248\u672C", MAX_REVISION) };
|
|
@@ -86,6 +86,15 @@ function parseModelSettingsMap(value) {
|
|
|
86
86
|
return out;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
// src/image-budget.ts
|
|
90
|
+
var MIN_REQUEST_IMAGE_BYTES = 1024 * 1024;
|
|
91
|
+
var DEFAULT_MAX_REQUEST_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
92
|
+
var MAX_REQUEST_IMAGE_BYTES = 100 * 1024 * 1024;
|
|
93
|
+
|
|
94
|
+
// src/turn-monitor-status.ts
|
|
95
|
+
var REVIEW_DECISIONS = ["continued", "completed", "waiting-user", "waiting-work", "blocked", "limited", "skipped", "unverified"];
|
|
96
|
+
var REVIEW_REASONS = ["missing-outcome", "pending-action", "reported-complete", "needs-user", "work-running", "reported-blocked", "continuation-limit", "no-progress", "goal-owned", "service-unavailable", "cancelled", "truncated", "request-failed", "disabled", "superseded", "invalid-evidence", "tool-concluded"];
|
|
97
|
+
|
|
89
98
|
// src/remote.ts
|
|
90
99
|
var MAX_REVISION = 256;
|
|
91
100
|
var MAX_JOB_ID = 128;
|
|
@@ -274,7 +283,10 @@ function parseStatusConfig(value) {
|
|
|
274
283
|
...value.modelSettings === void 0 ? {} : { modelSettings: parseModelSettingsMap(value.modelSettings) },
|
|
275
284
|
...value.requestTimeoutMs === void 0 ? {} : { requestTimeoutMs: positiveInteger(value.requestTimeoutMs, "\u8BF7\u6C42\u8D85\u65F6", 36e5, 1e3) },
|
|
276
285
|
...value.streamIdleTimeoutMs === void 0 ? {} : { streamIdleTimeoutMs: positiveInteger(value.streamIdleTimeoutMs, "\u6D41\u7A7A\u95F2\u8D85\u65F6", 18e5, 1e3) },
|
|
277
|
-
...value.quotaRefreshSeconds === void 0 ? {} : { quotaRefreshSeconds: positiveInteger(value.quotaRefreshSeconds, "\u81EA\u52A8\u5237\u65B0\u95F4\u9694", 3600, 5) }
|
|
286
|
+
...value.quotaRefreshSeconds === void 0 ? {} : { quotaRefreshSeconds: positiveInteger(value.quotaRefreshSeconds, "\u81EA\u52A8\u5237\u65B0\u95F4\u9694", 3600, 5) },
|
|
287
|
+
...value.maxRequestImageBytes === void 0 ? {} : { maxRequestImageBytes: positiveInteger(value.maxRequestImageBytes, "\u8BF7\u6C42\u56FE\u7247\u9884\u7B97", MAX_REQUEST_IMAGE_BYTES, MIN_REQUEST_IMAGE_BYTES) },
|
|
288
|
+
...value.turnReviewMaxContinuations === void 0 ? {} : { turnReviewMaxContinuations: positiveInteger(value.turnReviewMaxContinuations, "\u6536\u5C3E\u7EED\u529E\u6B21\u6570", 10) },
|
|
289
|
+
...value.turnReviewNoProgressLimit === void 0 ? {} : { turnReviewNoProgressLimit: positiveInteger(value.turnReviewNoProgressLimit, "\u65E0\u8FDB\u5C55\u6B21\u6570", 5) }
|
|
278
290
|
};
|
|
279
291
|
}
|
|
280
292
|
function parseStatus(value) {
|
|
@@ -299,12 +311,25 @@ function parseStatus(value) {
|
|
|
299
311
|
login: parseLoginState(value.login),
|
|
300
312
|
config: parseStatusConfig(value.config),
|
|
301
313
|
guardedTurns: count(value.guardedTurns, "\u5DF2\u62E6\u622A\u7A7A\u8F6E\u6570"),
|
|
314
|
+
...value.turnMonitor === void 0 ? {} : { turnMonitor: parseTurnMonitor(value.turnMonitor) },
|
|
302
315
|
models: parsed,
|
|
303
316
|
...value.modelsSource === void 0 ? {} : { modelsSource: member(value.modelsSource, ["builtin", "openai"], "\u6A21\u578B\u76EE\u5F55\u6765\u6E90") },
|
|
304
317
|
...value.modelsUpdatedAt === void 0 ? {} : { modelsUpdatedAt: isoTime(value.modelsUpdatedAt, "\u6A21\u578B\u66F4\u65B0\u65F6\u95F4") },
|
|
305
318
|
...value.modelsError === void 0 ? {} : { modelsError: text(value.modelsError, "\u6A21\u578B\u66F4\u65B0\u63D0\u793A", MAX_MESSAGE) }
|
|
306
319
|
};
|
|
307
320
|
}
|
|
321
|
+
function parseTurnMonitor(value) {
|
|
322
|
+
if (!record(value)) throw new Error("\u7ED3\u675F\u6838\u9A8C\u72B6\u6001\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
323
|
+
const last = value.last;
|
|
324
|
+
if (last !== void 0 && !record(last)) throw new Error("\u6700\u8FD1\u7ED3\u675F\u6838\u9A8C\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
325
|
+
return {
|
|
326
|
+
available: flag(value.available, "\u6536\u5C3E\u6838\u9A8C\u662F\u5426\u53EF\u7528"),
|
|
327
|
+
checks: count(value.checks, "\u6536\u5C3E\u6838\u9A8C\u6B21\u6570"),
|
|
328
|
+
continuations: count(value.continuations, "\u4EFB\u52A1\u7EED\u529E\u6B21\u6570"),
|
|
329
|
+
requestRetries: count(value.requestRetries, "\u8BF7\u6C42\u91CD\u8BD5\u6B21\u6570"),
|
|
330
|
+
...record(last) ? { last: { at: isoTime(last.at, "\u6536\u5C3E\u6838\u9A8C\u65F6\u95F4"), decision: member(last.decision, REVIEW_DECISIONS, "\u6536\u5C3E\u6838\u9A8C\u51B3\u5B9A"), reason: member(last.reason, REVIEW_REASONS, "\u6536\u5C3E\u6838\u9A8C\u539F\u56E0") } } : {}
|
|
331
|
+
};
|
|
332
|
+
}
|
|
308
333
|
function parseStartLoginRequest(value) {
|
|
309
334
|
if (!record(value)) throw new Error("\u767B\u5F55\u8BF7\u6C42\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
310
335
|
return { expectedRevision: text(value.expectedRevision, "\u914D\u7F6E\u7248\u672C", MAX_REVISION) };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import type { TurnMonitorStatus } from './turn-monitor-status.js';
|
|
3
4
|
import { fetchModelCatalog } from './model-discovery.js';
|
|
4
5
|
import { fetchPricingSnapshot } from './pricing.js';
|
|
5
6
|
import type { CatalogModel } from './catalog.js';
|
|
@@ -41,6 +42,7 @@ export declare class OpenDesignCoRouterService extends TypertRemoteService {
|
|
|
41
42
|
private _quotaPending;
|
|
42
43
|
private _quotaController;
|
|
43
44
|
guardedTurns: number;
|
|
45
|
+
turnMonitorStatus: (() => TurnMonitorStatus) | undefined;
|
|
44
46
|
private _models;
|
|
45
47
|
private _modelsUpdatedAt;
|
|
46
48
|
private _modelsError;
|