dsh-opendesign-corouter 0.1.14 → 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/client.d.ts +11 -0
- package/lib/client.js +132 -4
- package/lib/config.d.ts +6 -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 +20 -1
- package/lib/generated/typert.remote-client.js +20 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +441 -33
- package/lib/index.js.map +4 -4
- package/lib/remote.d.ts +4 -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.14.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/client.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export interface FormValues {
|
|
|
31
31
|
requestTimeoutMs?: number;
|
|
32
32
|
streamIdleTimeoutMs?: number;
|
|
33
33
|
maxRequestImageBytes?: number;
|
|
34
|
+
turnReviewMaxContinuations?: number;
|
|
35
|
+
turnReviewNoProgressLimit?: number;
|
|
34
36
|
}
|
|
35
37
|
export interface FormSnapshot {
|
|
36
38
|
status: 'loading' | 'ready' | 'unavailable';
|
|
@@ -111,6 +113,15 @@ export declare function QuotaView({ quota, nextAutoRefreshAt, refreshIntervalSec
|
|
|
111
113
|
}, HTMLElement> | React.FunctionComponentElement<{
|
|
112
114
|
children?: React.ReactNode | undefined;
|
|
113
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>;
|
|
114
125
|
/** Whole-map model settings writer: absent entry means "inherit every default". */
|
|
115
126
|
export declare function writeModelSettings(map: ModelSettingsMap | undefined, id: string, next: ModelSettings | undefined): ModelSettingsMap;
|
|
116
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,
|
|
@@ -20029,6 +20030,10 @@ var MIN_REQUEST_IMAGE_BYTES = 1024 * 1024;
|
|
|
20029
20030
|
var DEFAULT_MAX_REQUEST_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
20030
20031
|
var MAX_REQUEST_IMAGE_BYTES = 100 * 1024 * 1024;
|
|
20031
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
|
+
|
|
20032
20037
|
// src/remote.ts
|
|
20033
20038
|
var MAX_REVISION = 256;
|
|
20034
20039
|
var MAX_JOB_ID = 128;
|
|
@@ -20218,7 +20223,9 @@ function parseStatusConfig(value) {
|
|
|
20218
20223
|
...value.requestTimeoutMs === void 0 ? {} : { requestTimeoutMs: positiveInteger(value.requestTimeoutMs, "\u8BF7\u6C42\u8D85\u65F6", 36e5, 1e3) },
|
|
20219
20224
|
...value.streamIdleTimeoutMs === void 0 ? {} : { streamIdleTimeoutMs: positiveInteger(value.streamIdleTimeoutMs, "\u6D41\u7A7A\u95F2\u8D85\u65F6", 18e5, 1e3) },
|
|
20220
20225
|
...value.quotaRefreshSeconds === void 0 ? {} : { quotaRefreshSeconds: positiveInteger(value.quotaRefreshSeconds, "\u81EA\u52A8\u5237\u65B0\u95F4\u9694", 3600, 5) },
|
|
20221
|
-
...value.maxRequestImageBytes === void 0 ? {} : { maxRequestImageBytes: positiveInteger(value.maxRequestImageBytes, "\u8BF7\u6C42\u56FE\u7247\u9884\u7B97", MAX_REQUEST_IMAGE_BYTES, MIN_REQUEST_IMAGE_BYTES) }
|
|
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) }
|
|
20222
20229
|
};
|
|
20223
20230
|
}
|
|
20224
20231
|
function parseStatus(value) {
|
|
@@ -20243,12 +20250,25 @@ function parseStatus(value) {
|
|
|
20243
20250
|
login: parseLoginState(value.login),
|
|
20244
20251
|
config: parseStatusConfig(value.config),
|
|
20245
20252
|
guardedTurns: count(value.guardedTurns, "\u5DF2\u62E6\u622A\u7A7A\u8F6E\u6570"),
|
|
20253
|
+
...value.turnMonitor === void 0 ? {} : { turnMonitor: parseTurnMonitor(value.turnMonitor) },
|
|
20246
20254
|
models: parsed,
|
|
20247
20255
|
...value.modelsSource === void 0 ? {} : { modelsSource: member(value.modelsSource, ["builtin", "openai"], "\u6A21\u578B\u76EE\u5F55\u6765\u6E90") },
|
|
20248
20256
|
...value.modelsUpdatedAt === void 0 ? {} : { modelsUpdatedAt: isoTime(value.modelsUpdatedAt, "\u6A21\u578B\u66F4\u65B0\u65F6\u95F4") },
|
|
20249
20257
|
...value.modelsError === void 0 ? {} : { modelsError: text(value.modelsError, "\u6A21\u578B\u66F4\u65B0\u63D0\u793A", MAX_MESSAGE) }
|
|
20250
20258
|
};
|
|
20251
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
|
+
}
|
|
20252
20272
|
function parseStartLoginRequest(value) {
|
|
20253
20273
|
if (!record2(value)) throw new Error("\u767B\u5F55\u8BF7\u6C42\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
20254
20274
|
return { expectedRevision: text(value.expectedRevision, "\u914D\u7F6E\u7248\u672C", MAX_REVISION) };
|
|
@@ -20351,6 +20371,12 @@ var MAX_REQUEST_TIMEOUT_MS = 36e5;
|
|
|
20351
20371
|
var DEFAULT_STREAM_IDLE_TIMEOUT_MS = 3e5;
|
|
20352
20372
|
var MIN_STREAM_IDLE_TIMEOUT_MS = 1e3;
|
|
20353
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;
|
|
20354
20380
|
var RPC_TIMEOUT_MS = 3e4;
|
|
20355
20381
|
var MAX_OUTPUT_TOKENS = 1e7;
|
|
20356
20382
|
var MAX_CONTEXT_WINDOW = 1e8;
|
|
@@ -20370,6 +20396,35 @@ var QUOTA_LABELS = {
|
|
|
20370
20396
|
"need-login": "\u9700\u8981\u767B\u5F55\u540E\u8BFB\u53D6\u989D\u5EA6",
|
|
20371
20397
|
error: "\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u989D\u5EA6"
|
|
20372
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
|
+
};
|
|
20373
20428
|
function installStyles() {
|
|
20374
20429
|
const style = document.createElement("style");
|
|
20375
20430
|
style.dataset.opendesignCorouter = "";
|
|
@@ -20396,6 +20451,7 @@ function installStyles() {
|
|
|
20396
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}
|
|
20397
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}
|
|
20398
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}
|
|
20399
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))}
|
|
20400
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}
|
|
20401
20457
|
.odc-settings{--odc-accent:var(--dsw-alias-brand-primary-new-colorprimary-new-color,#4176e6);max-width:720px;padding:16px;line-height:1.6}
|
|
@@ -20757,6 +20813,53 @@ function QuotaView({ quota, nextAutoRefreshAt, refreshIntervalSeconds, busy = fa
|
|
|
20757
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
|
|
20758
20814
|
);
|
|
20759
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
|
+
}
|
|
20760
20863
|
function writeModelSettings(map2, id, next) {
|
|
20761
20864
|
const out = { ...map2 ?? {} };
|
|
20762
20865
|
if (next === void 0) {
|
|
@@ -21412,6 +21515,8 @@ function Advanced({ status, formSnapshot, setFormField, pendingField }) {
|
|
|
21412
21515
|
const streamIdleTimeout = formSnapshot.value?.streamIdleTimeoutMs ?? status?.config.streamIdleTimeoutMs ?? DEFAULT_STREAM_IDLE_TIMEOUT_MS;
|
|
21413
21516
|
const refreshSeconds = formSnapshot.value?.quotaRefreshSeconds ?? status?.config.quotaRefreshSeconds ?? DEFAULT_QUOTA_REFRESH_SECONDS;
|
|
21414
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;
|
|
21415
21520
|
const selected = API_PROTOCOL_OPTIONS.find((option) => option.id === protocol);
|
|
21416
21521
|
const saveKeyRef = async () => {
|
|
21417
21522
|
const value = apiKeyEnv.trim();
|
|
@@ -21434,16 +21539,39 @@ function Advanced({ status, formSnapshot, setFormField, pendingField }) {
|
|
|
21434
21539
|
"section",
|
|
21435
21540
|
{ className: "odc-card" },
|
|
21436
21541
|
h("h3", null, "\u5F02\u5E38\u7ED3\u675F\u76D1\u63A7"),
|
|
21437
|
-
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"),
|
|
21438
21543
|
h("div", { style: { marginTop: 14 } }, h(Switch, {
|
|
21439
21544
|
checked: formSnapshot.value?.emptyTurnGuard ?? status?.config.emptyTurnGuard ?? true,
|
|
21440
21545
|
disabled: !writable || pendingField.includes("emptyTurnGuard"),
|
|
21441
21546
|
label: "\u542F\u7528\u5F02\u5E38\u7ED3\u675F\u76D1\u63A7",
|
|
21442
|
-
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`,
|
|
21443
21548
|
onChange: (checked) => {
|
|
21444
21549
|
void setFormField("emptyTurnGuard", checked);
|
|
21445
21550
|
}
|
|
21446
|
-
}))
|
|
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
|
+
})
|
|
21447
21575
|
),
|
|
21448
21576
|
h(
|
|
21449
21577
|
"section",
|
package/lib/config.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
13
13
|
modelSettings: Schema<NoInfer<import("@deepseek-ai/cosmokit").Dict<unknown, string>>, NoInfer<ModelSettingsMap>, "volatile-defined">;
|
|
14
14
|
useDesktopCredential: Schema<boolean, boolean, "volatile-defined">;
|
|
15
15
|
emptyTurnGuard: Schema<boolean, boolean, "volatile-defined">;
|
|
16
|
+
turnReviewMaxContinuations: Schema<number, number, "volatile-defined">;
|
|
17
|
+
turnReviewNoProgressLimit: Schema<number, number, "volatile-defined">;
|
|
16
18
|
quotaRefreshSeconds: Schema<number, number, "volatile-defined">;
|
|
17
19
|
requestTimeoutMs: Schema<number, number, "volatile-defined">;
|
|
18
20
|
streamIdleTimeoutMs: Schema<number, number, "volatile-defined">;
|
|
@@ -24,6 +26,8 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
24
26
|
modelSettings: Schema<NoInfer<import("@deepseek-ai/cosmokit").Dict<unknown, string>>, NoInfer<ModelSettingsMap>, "volatile-defined">;
|
|
25
27
|
useDesktopCredential: Schema<boolean, boolean, "volatile-defined">;
|
|
26
28
|
emptyTurnGuard: Schema<boolean, boolean, "volatile-defined">;
|
|
29
|
+
turnReviewMaxContinuations: Schema<number, number, "volatile-defined">;
|
|
30
|
+
turnReviewNoProgressLimit: Schema<number, number, "volatile-defined">;
|
|
27
31
|
quotaRefreshSeconds: Schema<number, number, "volatile-defined">;
|
|
28
32
|
requestTimeoutMs: Schema<number, number, "volatile-defined">;
|
|
29
33
|
streamIdleTimeoutMs: Schema<number, number, "volatile-defined">;
|
|
@@ -41,6 +45,8 @@ export interface RuntimeConfig {
|
|
|
41
45
|
modelSettings?: ModelSettingsMap;
|
|
42
46
|
quotaRefreshSeconds?: number;
|
|
43
47
|
maxRequestImageBytes?: number;
|
|
48
|
+
turnReviewMaxContinuations?: number;
|
|
49
|
+
turnReviewNoProgressLimit?: number;
|
|
44
50
|
}
|
|
45
51
|
export declare function assertBaseURL(raw: string): string;
|
|
46
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 {};
|
|
@@ -91,6 +91,10 @@ var MIN_REQUEST_IMAGE_BYTES = 1024 * 1024;
|
|
|
91
91
|
var DEFAULT_MAX_REQUEST_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
92
92
|
var MAX_REQUEST_IMAGE_BYTES = 100 * 1024 * 1024;
|
|
93
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
|
+
|
|
94
98
|
// src/remote.ts
|
|
95
99
|
var MAX_REVISION = 256;
|
|
96
100
|
var MAX_JOB_ID = 128;
|
|
@@ -280,7 +284,9 @@ function parseStatusConfig(value) {
|
|
|
280
284
|
...value.requestTimeoutMs === void 0 ? {} : { requestTimeoutMs: positiveInteger(value.requestTimeoutMs, "\u8BF7\u6C42\u8D85\u65F6", 36e5, 1e3) },
|
|
281
285
|
...value.streamIdleTimeoutMs === void 0 ? {} : { streamIdleTimeoutMs: positiveInteger(value.streamIdleTimeoutMs, "\u6D41\u7A7A\u95F2\u8D85\u65F6", 18e5, 1e3) },
|
|
282
286
|
...value.quotaRefreshSeconds === void 0 ? {} : { quotaRefreshSeconds: positiveInteger(value.quotaRefreshSeconds, "\u81EA\u52A8\u5237\u65B0\u95F4\u9694", 3600, 5) },
|
|
283
|
-
...value.maxRequestImageBytes === void 0 ? {} : { maxRequestImageBytes: positiveInteger(value.maxRequestImageBytes, "\u8BF7\u6C42\u56FE\u7247\u9884\u7B97", MAX_REQUEST_IMAGE_BYTES, MIN_REQUEST_IMAGE_BYTES) }
|
|
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) }
|
|
284
290
|
};
|
|
285
291
|
}
|
|
286
292
|
function parseStatus(value) {
|
|
@@ -305,12 +311,25 @@ function parseStatus(value) {
|
|
|
305
311
|
login: parseLoginState(value.login),
|
|
306
312
|
config: parseStatusConfig(value.config),
|
|
307
313
|
guardedTurns: count(value.guardedTurns, "\u5DF2\u62E6\u622A\u7A7A\u8F6E\u6570"),
|
|
314
|
+
...value.turnMonitor === void 0 ? {} : { turnMonitor: parseTurnMonitor(value.turnMonitor) },
|
|
308
315
|
models: parsed,
|
|
309
316
|
...value.modelsSource === void 0 ? {} : { modelsSource: member(value.modelsSource, ["builtin", "openai"], "\u6A21\u578B\u76EE\u5F55\u6765\u6E90") },
|
|
310
317
|
...value.modelsUpdatedAt === void 0 ? {} : { modelsUpdatedAt: isoTime(value.modelsUpdatedAt, "\u6A21\u578B\u66F4\u65B0\u65F6\u95F4") },
|
|
311
318
|
...value.modelsError === void 0 ? {} : { modelsError: text(value.modelsError, "\u6A21\u578B\u66F4\u65B0\u63D0\u793A", MAX_MESSAGE) }
|
|
312
319
|
};
|
|
313
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
|
+
}
|
|
314
333
|
function parseStartLoginRequest(value) {
|
|
315
334
|
if (!record(value)) throw new Error("\u767B\u5F55\u8BF7\u6C42\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
316
335
|
return { expectedRevision: text(value.expectedRevision, "\u914D\u7F6E\u7248\u672C", MAX_REVISION) };
|
|
@@ -91,6 +91,10 @@ var MIN_REQUEST_IMAGE_BYTES = 1024 * 1024;
|
|
|
91
91
|
var DEFAULT_MAX_REQUEST_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
92
92
|
var MAX_REQUEST_IMAGE_BYTES = 100 * 1024 * 1024;
|
|
93
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
|
+
|
|
94
98
|
// src/remote.ts
|
|
95
99
|
var MAX_REVISION = 256;
|
|
96
100
|
var MAX_JOB_ID = 128;
|
|
@@ -280,7 +284,9 @@ function parseStatusConfig(value) {
|
|
|
280
284
|
...value.requestTimeoutMs === void 0 ? {} : { requestTimeoutMs: positiveInteger(value.requestTimeoutMs, "\u8BF7\u6C42\u8D85\u65F6", 36e5, 1e3) },
|
|
281
285
|
...value.streamIdleTimeoutMs === void 0 ? {} : { streamIdleTimeoutMs: positiveInteger(value.streamIdleTimeoutMs, "\u6D41\u7A7A\u95F2\u8D85\u65F6", 18e5, 1e3) },
|
|
282
286
|
...value.quotaRefreshSeconds === void 0 ? {} : { quotaRefreshSeconds: positiveInteger(value.quotaRefreshSeconds, "\u81EA\u52A8\u5237\u65B0\u95F4\u9694", 3600, 5) },
|
|
283
|
-
...value.maxRequestImageBytes === void 0 ? {} : { maxRequestImageBytes: positiveInteger(value.maxRequestImageBytes, "\u8BF7\u6C42\u56FE\u7247\u9884\u7B97", MAX_REQUEST_IMAGE_BYTES, MIN_REQUEST_IMAGE_BYTES) }
|
|
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) }
|
|
284
290
|
};
|
|
285
291
|
}
|
|
286
292
|
function parseStatus(value) {
|
|
@@ -305,12 +311,25 @@ function parseStatus(value) {
|
|
|
305
311
|
login: parseLoginState(value.login),
|
|
306
312
|
config: parseStatusConfig(value.config),
|
|
307
313
|
guardedTurns: count(value.guardedTurns, "\u5DF2\u62E6\u622A\u7A7A\u8F6E\u6570"),
|
|
314
|
+
...value.turnMonitor === void 0 ? {} : { turnMonitor: parseTurnMonitor(value.turnMonitor) },
|
|
308
315
|
models: parsed,
|
|
309
316
|
...value.modelsSource === void 0 ? {} : { modelsSource: member(value.modelsSource, ["builtin", "openai"], "\u6A21\u578B\u76EE\u5F55\u6765\u6E90") },
|
|
310
317
|
...value.modelsUpdatedAt === void 0 ? {} : { modelsUpdatedAt: isoTime(value.modelsUpdatedAt, "\u6A21\u578B\u66F4\u65B0\u65F6\u95F4") },
|
|
311
318
|
...value.modelsError === void 0 ? {} : { modelsError: text(value.modelsError, "\u6A21\u578B\u66F4\u65B0\u63D0\u793A", MAX_MESSAGE) }
|
|
312
319
|
};
|
|
313
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
|
+
}
|
|
314
333
|
function parseStartLoginRequest(value) {
|
|
315
334
|
if (!record(value)) throw new Error("\u767B\u5F55\u8BF7\u6C42\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
316
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;
|