dsh-opendesign-corouter 0.1.12 → 0.1.13
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 +1 -1
- package/lib/catalog.d.ts +4 -3
- package/lib/client.d.ts +4 -1
- package/lib/client.js +144 -49
- package/lib/device-auth.d.ts +1 -1
- package/lib/index.js +30 -29
- package/lib/index.js.map +2 -2
- 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.13.tgz
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
`web` 只是示例,请替换为目标 Profile。Desktop 使用桌面安装器提供的 `dsh` 入口;独立公共 CLI 不能代管保留的 `desktop` Profile。安装后的启用与重载按目标 DSH 的管理流程进行。
|
package/lib/catalog.d.ts
CHANGED
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
* - `plan` 原有 12 款的 contextWindow / maxOutputTokens 与原模态
|
|
10
10
|
* 来自 Go 侧 `dsh-opendesign-go` 0.1.9 的 MODEL_DEFAULTS(同一 `amr-link` endpoint 部署资料),
|
|
11
11
|
* 作为部署参考,尚无官网能力数值的独立佐证;图片模态按最新证据单独核验。
|
|
12
|
-
* -
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* - 其余上下文窗口采用厂商公开资料或明确标注的暂定参考,逐型号来源见
|
|
13
|
+
* docs/model-context.md;CoRouter 实际限制未验证,可以通过模型设置覆盖。
|
|
14
|
+
* - `gpt-6.1-terra` 的 maxOutputTokens / inputModalities 取自厂商型号文档;
|
|
15
|
+
* 仅补充其他型号的上下文,不改变最大输出默认值。
|
|
15
16
|
* - 客户端桌面安装(Open Design 0.26.1)不内联 CoRouter 目录;其
|
|
16
17
|
* `vela model preset --format json` 只有 11 个旧预设 id(见 docs/client-evidence.md),
|
|
17
18
|
* 与本表不同代,故不用于本目录。
|
package/lib/client.d.ts
CHANGED
|
@@ -122,6 +122,8 @@ export declare function modelSettingsEntry(map: ModelSettingsMap | undefined, id
|
|
|
122
122
|
export declare function modelEnabled(model: StatusModel, settings: ModelSettings | undefined, authoritative?: boolean): boolean;
|
|
123
123
|
/** Manual image policy wins; automatic mode only treats an explicit catalog image modality as confirmed. */
|
|
124
124
|
export declare function modelImageInput(model: StatusModel, settings: ModelSettings | undefined): boolean;
|
|
125
|
+
/** Enabled rows come first without changing the catalog's order within either state. */
|
|
126
|
+
export declare function sortModelsByEnabled(models: readonly StatusModel[], settingsMap: ModelSettingsMap, authoritative: boolean): StatusModel[];
|
|
125
127
|
export interface NumberInputSpec {
|
|
126
128
|
label: string;
|
|
127
129
|
min: number;
|
|
@@ -172,12 +174,13 @@ export interface ModelRowProps {
|
|
|
172
174
|
authoritative: boolean;
|
|
173
175
|
writable: boolean;
|
|
174
176
|
pending: boolean;
|
|
177
|
+
disabledReason?: string | undefined;
|
|
175
178
|
protocol?: ApiProtocol;
|
|
176
179
|
price?: PriceCatalog['models'][number] | undefined;
|
|
177
180
|
priceKnown?: boolean | undefined;
|
|
178
181
|
onCommit: (next: ModelSettings | undefined) => Promise<boolean>;
|
|
179
182
|
}
|
|
180
|
-
export declare function ModelRow({ model, settings, authoritative, writable, pending, protocol, price, priceKnown, onCommit }: ModelRowProps): React.DetailedReactHTMLElement<{
|
|
183
|
+
export declare function ModelRow({ model, settings, authoritative, writable, pending, disabledReason, protocol, price, priceKnown, onCommit }: ModelRowProps): React.DetailedReactHTMLElement<{
|
|
181
184
|
className: string;
|
|
182
185
|
}, HTMLElement>;
|
|
183
186
|
export interface ModelsProps {
|
package/lib/client.js
CHANGED
|
@@ -56,6 +56,7 @@ __export(client_exports, {
|
|
|
56
56
|
protocolEndpoint: () => protocolEndpoint,
|
|
57
57
|
quotaAutoRefresh: () => quotaAutoRefresh,
|
|
58
58
|
quotaStatusView: () => quotaStatusView,
|
|
59
|
+
sortModelsByEnabled: () => sortModelsByEnabled,
|
|
59
60
|
tabAfter: () => tabAfter,
|
|
60
61
|
writeModelSettings: () => writeModelSettings
|
|
61
62
|
});
|
|
@@ -20381,8 +20382,9 @@ function installStyles() {
|
|
|
20381
20382
|
.odc-notice{padding:9px 11px;border-radius:8px;background:var(--dsw-alias-bg-layer-2,transparent);font-size:12px;line-height:1.6}.odc-notice[data-kind=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))}
|
|
20382
20383
|
.odc-model-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}.odc-model-list{display:grid;gap:6px;margin:10px 0 0;padding:0;list-style:none}.odc-model-item{padding:9px 10px;border-radius:8px;background:var(--dsw-alias-bg-layer-2,transparent);min-width:0}.odc-model-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;flex-wrap:wrap}.odc-model-switch{min-width:0;flex:1 1 190px}.odc-model-item strong,.odc-model-item code{display:block;overflow-wrap:anywhere}.odc-model-item strong{font-size:12px;font-weight:600}.odc-model-item code{margin-top:2px;color:var(--dsw-alias-label-secondary,inherit);font-size:11px}.odc-model-meta{margin-top:6px!important;color:var(--dsw-alias-label-secondary,inherit);font-size:11px;overflow-wrap:anywhere}.odc-model-count{color:var(--dsw-alias-label-secondary,inherit);font-size:11px;font-weight:400}.odc-chip{display:inline-flex;align-items:center;padding:1px 7px;border:1px solid var(--dsw-alias-border-l3,transparent);border-radius:999px;color:var(--dsw-alias-label-secondary,inherit);font-size:10px;line-height:1.6}
|
|
20383
20384
|
.odc-model-details{margin-top:8px}.odc-model-details>summary{cursor:pointer;color:var(--dsw-alias-label-secondary,inherit);font-size:11px;line-height:1.7}.odc-model-editor{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 10px;margin-top:8px}
|
|
20384
|
-
.odc-model-image{display:flex;align-items:center;gap:
|
|
20385
|
+
.odc-model-image{display:flex;align-items:center;gap:2px 8px;flex-wrap:wrap;margin-top:3px;min-width:0}.odc-image-toggle{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:28px;padding:2px 2px 2px 0;color:var(--dsw-alias-label-primary,inherit);font-size:12px;font-weight:550;cursor:pointer}.odc-image-toggle input{appearance:auto;width:16px;height:16px;flex:none;margin:0;cursor:inherit;accent-color:var(--dsw-alias-brand-primary,Highlight)}.odc-image-toggle:has(input:disabled){cursor:not-allowed;opacity:.6}.odc-image-state{min-width:0;color:var(--dsw-alias-label-secondary,inherit);font-size:12px;line-height:1.5;overflow-wrap:anywhere}.odc-image-reset{min-height:28px;padding:2px 7px;border:1px solid var(--dsw-alias-border-l3,CanvasText);border-radius:6px;background:transparent;color:var(--dsw-alias-label-secondary,inherit);font:inherit;font-size:12px;cursor:pointer}.odc-image-reset:hover:not(:disabled){border-color:var(--dsw-alias-brand-primary,Highlight);color:var(--dsw-alias-label-primary,inherit)}.odc-image-reset:disabled{opacity:.55;cursor:not-allowed}
|
|
20385
20386
|
.odc-field{display:grid;gap:6px;margin-top:14px}.odc-field-compact{margin-top:8px}.odc-field label,.odc-switch-text{font-size:12px;font-weight:550}.odc-input{width:100%;min-width:0;min-height:34px;padding:7px 9px;border:1px solid var(--dsw-alias-border-l3,transparent);border-radius:8px;background:var(--dsw-alias-bg-layer-2,transparent);color:var(--dsw-alias-label-primary,inherit);font:inherit;font-size:12px}.odc-field-compact .odc-input{min-height:30px;padding:5px 8px;font-size:11px}.odc-input::placeholder{color:var(--dsw-alias-label-secondary,inherit);opacity:1}.odc-input:disabled{opacity:.55}
|
|
20387
|
+
.odc-effort{min-width:0}.odc-effort-head{display:flex;align-items:center;justify-content:space-between;gap:6px 10px;flex-wrap:wrap}.odc-effort-label{font-size:12px;font-weight:550}.odc-effort-value{min-width:0;margin:0;font-size:12px;overflow-wrap:anywhere}.odc-effort-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
|
|
20386
20388
|
.odc-input option{background:var(--dsw-alias-bg-layer-2,Canvas);color:var(--dsw-alias-label-primary,CanvasText)}
|
|
20387
20389
|
.odc-input,.odc-button:not(.odc-button-primary),.odc-tab[aria-selected=true]{border-color:var(--dsw-alias-border-l3,CanvasText);border-color:color-mix(in srgb,var(--dsw-alias-label-primary,CanvasText) 55%,var(--dsw-alias-bg-layer-2,Canvas))}
|
|
20388
20390
|
.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,7 +20399,7 @@ function installStyles() {
|
|
|
20397
20399
|
.odc-quota-panel{display:grid;gap:8px;min-width:0}.odc-quota-panel>.odc-card-head{margin:0}.odc-quota-status{--odc-state:var(--odc-accent);display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--odc-state) 28%,transparent);border-radius:10px;background:color-mix(in srgb,var(--odc-state) 10%,transparent);font-size:13px;font-weight:600}.odc-quota-status[data-tone=good]{--odc-state:var(--dsw-alias-state-success-primary,Highlight)}.odc-quota-status[data-tone=warn]{--odc-state:var(--dsw-alias-state-warn-primary,Highlight)}.odc-quota-status[data-tone=critical]{--odc-state:var(--dsw-alias-state-error-primary,Highlight)}.odc-state-mark{display:grid;place-items:center;width:28px;height:28px;border:1px solid color-mix(in srgb,var(--odc-state) 65%,transparent);border-radius:8px;flex:none;font-size:15px;font-weight:700}.odc-state-copy{display:grid;gap:1px;min-width:0}.odc-state-copy .odc-hint{font-weight:400}
|
|
20398
20400
|
.odc-window{--odc-window-color:var(--dsw-alias-label-secondary,CanvasText);gap:5px;margin:0;padding:10px 12px;border:0;border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-label-primary,CanvasText) 5%,transparent)}.odc-window[data-tone=good]{--odc-window-color:color-mix(in srgb,var(--dsw-alias-state-success-primary,Highlight) 70%,var(--dsw-alias-label-primary,CanvasText))}.odc-window[data-tone=warn]{--odc-window-color:color-mix(in srgb,var(--dsw-alias-state-warn-primary,Highlight) 70%,var(--dsw-alias-label-primary,CanvasText))}.odc-window[data-tone=critical]{--odc-window-color:var(--dsw-alias-state-error-primary,Highlight)}.odc-window-remaining strong{font-size:18px}.odc-window progress{appearance:none;height:7px;border:0;border-radius:999px;overflow:hidden;background:color-mix(in srgb,var(--dsw-alias-label-primary,CanvasText) 18%,transparent);accent-color:var(--odc-window-color)}.odc-window progress::-webkit-progress-bar{background:color-mix(in srgb,var(--dsw-alias-label-primary,CanvasText) 18%,transparent);border-radius:999px}.odc-window progress::-webkit-progress-value{background:var(--odc-window-color);border-radius:999px}
|
|
20399
20401
|
.odc-window-usage{display:block;margin:0;color:var(--dsw-alias-label-secondary,inherit);font-size:12px;overflow-wrap:anywhere}.odc-window-bottom{display:flex;align-items:baseline;justify-content:space-between;gap:4px 12px;flex-wrap:wrap}.odc-window-reset{display:flex;align-items:baseline;justify-content:flex-start;flex-wrap:wrap;gap:4px 6px;padding:0;border:0}.odc-window-details>summary{min-height:28px;padding:4px 0}.odc-window-details[open]{flex-basis:100%}.odc-window-details dl>div{display:flex;justify-content:space-between;gap:12px}
|
|
20400
|
-
@media(forced-colors:active){.odc-window progress{appearance:auto;accent-color:Highlight;forced-color-adjust:auto}.odc-window progress::-webkit-progress-value{background:Highlight}}
|
|
20402
|
+
@media(forced-colors:active){.odc-window progress{appearance:auto;accent-color:Highlight;forced-color-adjust:auto}.odc-window progress::-webkit-progress-value{background:Highlight}.odc-image-toggle input{forced-color-adjust:auto}.odc-image-reset{border-color:ButtonText;background:ButtonFace;color:ButtonText}}
|
|
20401
20403
|
.odc-balance-list,.odc-timing{display:grid;gap:0;margin:0}.odc-balance-row,.odc-timing-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-balance-row:first-child,.odc-timing-row:first-child{border-top:0}.odc-balance-row>div,.odc-timing-row>div{min-width:0}.odc-balance-row dt,.odc-timing-row dt{font-size:12px;font-weight:600}.odc-balance-row dd,.odc-timing-row dd{margin:0;min-width:0;text-align:right}.odc-balance-row .odc-metric-value{font-size:13px}.odc-timing-row .odc-metric-text{font-size:13px;white-space:nowrap}.odc-timing-row .odc-hint{display:block}.odc-timing{padding:4px 14px}
|
|
20402
20404
|
.odc-model-item{background:transparent;border:1px solid var(--dsw-alias-border-l4,transparent)}.odc-model-item:has(details[open]){border-color:color-mix(in srgb,var(--odc-accent) 55%,transparent);background:color-mix(in srgb,var(--odc-accent) 5%,transparent)}
|
|
20403
20405
|
.odc-price-summary{margin:5px 0 0!important;font-size:12px;color:var(--dsw-alias-label-secondary,inherit);overflow-wrap:anywhere}.odc-pricing-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}.odc-price-tier{padding:8px 0;border-top:1px solid var(--dsw-alias-border-l4,transparent)}.odc-price-tier dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px;margin:6px 0 0}.odc-price-tier dl>div{display:flex;justify-content:space-between;gap:8px}.odc-price-tier dt{color:var(--dsw-alias-label-secondary,inherit)}.odc-price-tier dd{margin:0;font-variant-numeric:tabular-nums}
|
|
@@ -20779,6 +20781,9 @@ function modelImageInput(model, settings) {
|
|
|
20779
20781
|
if (settings?.imageInput !== void 0) return settings.imageInput;
|
|
20780
20782
|
return model.inputModalities === void 0 ? true : model.inputModalities.includes("image");
|
|
20781
20783
|
}
|
|
20784
|
+
function sortModelsByEnabled(models, settingsMap, authoritative) {
|
|
20785
|
+
return models.map((model, index) => ({ model, index, enabled: modelEnabled(model, settingsMap[model.id], authoritative) })).sort((a, b) => Number(b.enabled) - Number(a.enabled) || a.index - b.index).map(({ model }) => model);
|
|
20786
|
+
}
|
|
20782
20787
|
function imageInputSource(model, settings) {
|
|
20783
20788
|
if (settings.imageInput !== void 0) return settings.imageInput ? "\u624B\u52A8 \xB7 \u5F00\u542F" : "\u624B\u52A8 \xB7 \u5173\u95ED";
|
|
20784
20789
|
if (model.inputModalities === void 0) return "\u81EA\u52A8 \xB7 \u672A\u77E5\uFF0C\u5C1D\u8BD5\u53D1\u9001";
|
|
@@ -20910,40 +20915,118 @@ function OptionalNumberField({ id, field, value, disabled, restricted = false, i
|
|
|
20910
20915
|
}, error62 ?? (restricted ? field === "temperature" ? "Messages \u4EC5\u63A5\u53D7 1\uFF1B\u5EFA\u8BAE\u7559\u7A7A\uFF0C\u4E14\u52FF\u540C\u65F6\u8BBE\u7F6E Top P\u3002" : "Messages \u4EC5\u63A5\u53D7 0.99\uFF1B\u5EFA\u8BAE\u7559\u7A7A\uFF0C\u4E14\u52FF\u540C\u65F6\u8BBE\u7F6E\u6E29\u5EA6\u3002" : maxOutputLimit !== void 0 ? `Messages \u6700\u5927\u8F93\u51FA ${maxOutputLimit}\uFF1B\u7559\u7A7A\u7EE7\u627F\u9ED8\u8BA4\u3002` : spec.hint))
|
|
20911
20916
|
);
|
|
20912
20917
|
}
|
|
20913
|
-
function EffortField({ id, model, value, disabled,
|
|
20918
|
+
function EffortField({ id, model, value, disabled, pending, disabledReason, onSave }) {
|
|
20914
20919
|
const mounted = useMounted();
|
|
20920
|
+
const [editing, setEditing] = React.useState(false);
|
|
20921
|
+
const [draft, setDraft] = React.useState(value ?? "");
|
|
20922
|
+
const [baseValue, setBaseValue] = React.useState(value);
|
|
20923
|
+
const [saving, setSaving] = React.useState(false);
|
|
20915
20924
|
const [error62, setError] = React.useState(void 0);
|
|
20916
20925
|
const listed = model.reasoningEfforts ?? [];
|
|
20917
20926
|
const invalidDefault = value !== void 0 && !listed.includes(value);
|
|
20918
|
-
const
|
|
20927
|
+
const invalidDraft = editing && draft !== "" && !listed.includes(draft);
|
|
20928
|
+
const options = [...listed];
|
|
20929
|
+
for (const effort of [value, draft]) {
|
|
20930
|
+
if (effort !== void 0 && effort !== "" && !options.includes(effort)) options.push(effort);
|
|
20931
|
+
}
|
|
20919
20932
|
const unavailable = listed.length === 0;
|
|
20933
|
+
const busy = saving || pending;
|
|
20934
|
+
const reason = busy ? "\u6B63\u5728\u4FDD\u5B58\u6A21\u578B\u8BBE\u7F6E\uFF0C\u5B8C\u6210\u540E\u53EF\u7EE7\u7EED\u7F16\u8F91\u3002" : disabled ? `${disabledReason ?? "\u914D\u7F6E\u4E0D\u53EF\u5199"}\uFF0C\u65E0\u6CD5\u7F16\u8F91\u3002` : void 0;
|
|
20935
|
+
const externallyChanged = editing && value !== baseValue && !(saving && value === draft);
|
|
20936
|
+
const hint = reason ?? (editing ? externallyChanged ? "\u914D\u7F6E\u5DF2\u4ECE\u5176\u4ED6\u4F4D\u7F6E\u66F4\u65B0\uFF1B\u53D6\u6D88\u53EF\u67E5\u770B\u6700\u65B0\u503C\uFF0C\u4FDD\u5B58\u5C06\u4F7F\u7528\u5F53\u524D\u8349\u7A3F\u3002" : invalidDraft ? "\u5F53\u524D\u8349\u7A3F\u4E0D\u9002\u7528\u4E8E\u6B64\u6A21\u578B\u6216\u534F\u8BAE\uFF0C\u8BF7\u9009\u62E9\u5176\u4ED6\u6863\u4F4D\u6216\u7EE7\u627F\u9ED8\u8BA4\u3002" : "\u9009\u62E9\u201C\u7EE7\u627F\u9ED8\u8BA4\u201D\u4F1A\u5220\u9664\u5DF2\u4FDD\u5B58\u6863\u4F4D\uFF1B\u4FDD\u5B58\u524D\u4EC5\u4FEE\u6539\u672C\u5730\u8349\u7A3F\u3002" : invalidDefault ? "\u5DF2\u4FDD\u5B58\u7684\u6863\u4F4D\u4E0D\u9002\u7528\u4E8E\u5F53\u524D\u6A21\u578B\u6216\u534F\u8BAE\uFF0C\u53EF\u7F16\u8F91\u540E\u9009\u62E9\u5176\u4ED6\u6863\u4F4D\u6216\u7EE7\u627F\u9ED8\u8BA4\u3002" : unavailable ? "\u5F53\u524D\u6A21\u578B\u6216\u534F\u8BAE\u672A\u63D0\u4F9B\u53EF\u8C03\u6574\u7684\u601D\u8003\u6863\u4F4D\u3002" : "\u672A\u8BBE\u7F6E\u65F6\u4F7F\u7528\u670D\u52A1\u7AEF\u9ED8\u8BA4\u6863\u4F4D\u3002");
|
|
20937
|
+
const cancel = () => {
|
|
20938
|
+
if (saving) return;
|
|
20939
|
+
setEditing(false);
|
|
20940
|
+
setError(void 0);
|
|
20941
|
+
};
|
|
20942
|
+
const save = async () => {
|
|
20943
|
+
if (disabled || pending || saving || invalidDraft) return;
|
|
20944
|
+
if (draft === (value ?? "")) {
|
|
20945
|
+
setEditing(false);
|
|
20946
|
+
setError(void 0);
|
|
20947
|
+
return;
|
|
20948
|
+
}
|
|
20949
|
+
setSaving(true);
|
|
20950
|
+
setError(void 0);
|
|
20951
|
+
try {
|
|
20952
|
+
const saved = await onSave(draft);
|
|
20953
|
+
if (!mounted.current) return;
|
|
20954
|
+
if (saved) {
|
|
20955
|
+
setEditing(false);
|
|
20956
|
+
setError(void 0);
|
|
20957
|
+
} else setError("\u8BBE\u7F6E\u672A\u4FDD\u5B58\uFF0C\u5DF2\u4FDD\u7559\u5F53\u524D\u8349\u7A3F\uFF0C\u8BF7\u91CD\u8BD5\u3002");
|
|
20958
|
+
} catch {
|
|
20959
|
+
if (mounted.current) setError("\u8BBE\u7F6E\u672A\u4FDD\u5B58\uFF0C\u5DF2\u4FDD\u7559\u5F53\u524D\u8349\u7A3F\uFF0C\u8BF7\u91CD\u8BD5\u3002");
|
|
20960
|
+
} finally {
|
|
20961
|
+
if (mounted.current) setSaving(false);
|
|
20962
|
+
}
|
|
20963
|
+
};
|
|
20920
20964
|
return h(
|
|
20921
20965
|
"div",
|
|
20922
|
-
{
|
|
20923
|
-
|
|
20924
|
-
|
|
20925
|
-
|
|
20926
|
-
|
|
20927
|
-
|
|
20928
|
-
|
|
20929
|
-
|
|
20930
|
-
|
|
20931
|
-
|
|
20932
|
-
|
|
20933
|
-
|
|
20934
|
-
|
|
20935
|
-
|
|
20936
|
-
|
|
20937
|
-
|
|
20938
|
-
|
|
20939
|
-
|
|
20940
|
-
|
|
20941
|
-
|
|
20966
|
+
{
|
|
20967
|
+
className: "odc-field odc-field-compact odc-effort",
|
|
20968
|
+
"data-mode": editing ? "editing" : "summary",
|
|
20969
|
+
onKeyDown: (event) => {
|
|
20970
|
+
if (event.key !== "Escape" || !editing || saving) return;
|
|
20971
|
+
event.preventDefault();
|
|
20972
|
+
cancel();
|
|
20973
|
+
}
|
|
20974
|
+
},
|
|
20975
|
+
editing ? h(
|
|
20976
|
+
React.Fragment,
|
|
20977
|
+
null,
|
|
20978
|
+
h("label", { htmlFor: id }, "\u9ED8\u8BA4\u601D\u8003\u6DF1\u5EA6"),
|
|
20979
|
+
h("select", {
|
|
20980
|
+
id,
|
|
20981
|
+
className: "odc-input",
|
|
20982
|
+
value: draft,
|
|
20983
|
+
disabled: busy || disabled,
|
|
20984
|
+
"aria-describedby": `${id}-hint${error62 === void 0 ? "" : ` ${id}-error`}`,
|
|
20985
|
+
"aria-invalid": invalidDraft || error62 !== void 0,
|
|
20986
|
+
onChange: (event) => {
|
|
20987
|
+
setDraft(event.target.value);
|
|
20988
|
+
setError(void 0);
|
|
20989
|
+
}
|
|
20990
|
+
}, [
|
|
20991
|
+
h("option", { key: "", value: "" }, "\u7EE7\u627F\u9ED8\u8BA4"),
|
|
20992
|
+
...options.map((effort) => h("option", { key: effort, value: effort, disabled: !listed.includes(effort) }, listed.includes(effort) ? effort : `${effort}\uFF08\u5F53\u524D\u4E0D\u53EF\u7528\uFF09`))
|
|
20993
|
+
]),
|
|
20994
|
+
h(
|
|
20995
|
+
"div",
|
|
20996
|
+
{ className: "odc-effort-actions" },
|
|
20997
|
+
h("button", { className: "odc-button odc-button-small odc-button-primary", type: "button", disabled: busy || disabled || invalidDraft, "aria-label": "\u4FDD\u5B58\u9ED8\u8BA4\u601D\u8003\u6DF1\u5EA6", onClick: () => {
|
|
20998
|
+
void save();
|
|
20999
|
+
} }, saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58"),
|
|
21000
|
+
h("button", { className: "odc-button odc-button-small", type: "button", disabled: saving, "aria-label": "\u53D6\u6D88\u7F16\u8F91\u9ED8\u8BA4\u601D\u8003\u6DF1\u5EA6", onClick: cancel }, "\u53D6\u6D88")
|
|
21001
|
+
)
|
|
21002
|
+
) : h(
|
|
21003
|
+
React.Fragment,
|
|
21004
|
+
null,
|
|
21005
|
+
h(
|
|
21006
|
+
"div",
|
|
21007
|
+
{ className: "odc-effort-head" },
|
|
21008
|
+
h("span", { className: "odc-effort-label" }, "\u9ED8\u8BA4\u601D\u8003\u6DF1\u5EA6"),
|
|
21009
|
+
h("button", {
|
|
21010
|
+
className: "odc-button odc-button-small",
|
|
21011
|
+
type: "button",
|
|
21012
|
+
disabled: busy || disabled || unavailable && value === void 0,
|
|
21013
|
+
"aria-label": "\u7F16\u8F91\u9ED8\u8BA4\u601D\u8003\u6DF1\u5EA6",
|
|
21014
|
+
"aria-describedby": `${id}-hint`,
|
|
21015
|
+
onClick: () => {
|
|
21016
|
+
setDraft(value ?? "");
|
|
21017
|
+
setBaseValue(value);
|
|
21018
|
+
setError(void 0);
|
|
21019
|
+
setEditing(true);
|
|
21020
|
+
}
|
|
21021
|
+
}, "\u7F16\u8F91")
|
|
21022
|
+
),
|
|
21023
|
+
h("p", { className: "odc-effort-value" }, invalidDefault ? `${value}\uFF08\u5F53\u524D\u4E0D\u53EF\u7528\uFF09` : value ?? "\u7EE7\u627F\u9ED8\u8BA4")
|
|
21024
|
+
),
|
|
20942
21025
|
h("small", {
|
|
20943
|
-
className:
|
|
20944
|
-
id: `${id}-hint
|
|
20945
|
-
|
|
20946
|
-
|
|
21026
|
+
className: "odc-hint",
|
|
21027
|
+
id: `${id}-hint`
|
|
21028
|
+
}, hint),
|
|
21029
|
+
error62 === void 0 ? null : h("small", { className: "odc-hint odc-field-error", id: `${id}-error`, role: "alert" }, error62)
|
|
20947
21030
|
);
|
|
20948
21031
|
}
|
|
20949
21032
|
var PRICE_SITE = "https://corouter.open-design.ai/zh/models/";
|
|
@@ -20962,7 +21045,7 @@ function PriceDetails({ tiers }) {
|
|
|
20962
21045
|
h("dl", null, [["\u8F93\u5165", tier.input], ["\u8F93\u51FA", tier.output], ["\u7F13\u5B58\u8BFB\u53D6", tier.cacheRead], ["\u7F13\u5B58\u5199\u5165", tier.cacheWrite]].map(([label, value]) => h("div", { key: label }, h("dt", null, label), h("dd", null, priceAmount(value, tier.currency)))))
|
|
20963
21046
|
)));
|
|
20964
21047
|
}
|
|
20965
|
-
function ModelRow({ model, settings, authoritative, writable, pending, protocol = "chat-completions", price, priceKnown = false, onCommit }) {
|
|
21048
|
+
function ModelRow({ model, settings, authoritative, writable, pending, disabledReason, protocol = "chat-completions", price, priceKnown = false, onCommit }) {
|
|
20966
21049
|
const id = React.useId();
|
|
20967
21050
|
const mounted = useMounted();
|
|
20968
21051
|
const [error62, setError] = React.useState(void 0);
|
|
@@ -21056,19 +21139,25 @@ function ModelRow({ model, settings, authoritative, writable, pending, protocol
|
|
|
21056
21139
|
h(
|
|
21057
21140
|
"div",
|
|
21058
21141
|
{ className: "odc-model-image" },
|
|
21059
|
-
h(
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
|
|
21065
|
-
|
|
21066
|
-
|
|
21067
|
-
|
|
21068
|
-
|
|
21069
|
-
|
|
21142
|
+
h(
|
|
21143
|
+
"label",
|
|
21144
|
+
{ className: "odc-image-toggle" },
|
|
21145
|
+
h("input", {
|
|
21146
|
+
type: "checkbox",
|
|
21147
|
+
checked: imageInput,
|
|
21148
|
+
disabled: !writable || pending,
|
|
21149
|
+
"aria-label": `${model.name} \u56FE\u7247\u8F93\u5165`,
|
|
21150
|
+
"aria-describedby": `${id}-image-state`,
|
|
21151
|
+
onChange: (event) => {
|
|
21152
|
+
setError(void 0);
|
|
21153
|
+
void commit({ ...settings, imageInput: event.target.checked });
|
|
21154
|
+
}
|
|
21155
|
+
}),
|
|
21156
|
+
h("span", null, "\u56FE\u7247\u8F93\u5165")
|
|
21157
|
+
),
|
|
21158
|
+
h("small", { className: "odc-image-state", id: `${id}-image-state` }, imageInputSource(model, settings) + imageDisabledReason),
|
|
21070
21159
|
imageInputManual ? h("button", {
|
|
21071
|
-
className: "odc-
|
|
21160
|
+
className: "odc-image-reset",
|
|
21072
21161
|
type: "button",
|
|
21073
21162
|
disabled: !writable || pending,
|
|
21074
21163
|
"aria-label": `${model.name} \u6062\u590D\u56FE\u7247\u8F93\u5165\u81EA\u52A8`,
|
|
@@ -21083,6 +21172,8 @@ function ModelRow({ model, settings, authoritative, writable, pending, protocol
|
|
|
21083
21172
|
{ className: "odc-model-details" },
|
|
21084
21173
|
h("summary", { "aria-label": `${model.name} \u53C2\u6570\u8BBE\u7F6E${price === void 0 ? "" : "\u4E0E\u4EF7\u683C"}` }, `${price === void 0 ? "\u53C2\u6570\u8BBE\u7F6E" : "\u53C2\u6570\u4E0E\u4EF7\u683C"} \xB7 ${hasOverrides ? "\u5DF2\u81EA\u5B9A\u4E49" : "\u4F7F\u7528\u9ED8\u8BA4\u503C"}`),
|
|
21085
21174
|
h("p", { className: "odc-model-meta" }, facts),
|
|
21175
|
+
model.id === "claude-opus-5.5" && model.contextWindow === 1e6 ? h("p", { className: "odc-hint" }, "\u4E0A\u4E0B\u6587 1,000,000 \u4E3A\u5382\u5546\u53C2\u8003\uFF0C\u7F51\u5173\u5B9E\u9645\u5BB9\u91CF\u672A\u9A8C\u8BC1\uFF1B\u53EF\u901A\u8FC7\u4E0A\u4E0B\u6587\u9884\u7B97\u8986\u76D6\u3002") : null,
|
|
21176
|
+
model.id === "muse-wonder" && model.contextWindow === 1048576 ? h("p", { className: "odc-hint" }, "\u4E0A\u4E0B\u6587 1,048,576 \u4E3A\u6682\u5B9A\u53C2\u8003\uFF0C\u7F51\u5173\u578B\u53F7\u6620\u5C04\u53CA\u5B9E\u9645\u5BB9\u91CF\u672A\u9A8C\u8BC1\uFF1B\u53EF\u901A\u8FC7\u4E0A\u4E0B\u6587\u9884\u7B97\u8986\u76D6\u3002") : null,
|
|
21086
21177
|
samplingRestricted && model.id === "claude-opus-4.8" ? h("p", { className: "odc-hint" }, "\u5382\u5546\u9ED8\u8BA4\u5173\u95ED\u601D\u8003\uFF0C\u9009\u62E9\u601D\u8003\u6DF1\u5EA6\u53EF\u542F\u7528\u81EA\u9002\u5E94\u601D\u8003\uFF1B\u7F51\u5173\u5B9E\u9645\u884C\u4E3A\u53EF\u80FD\u4E0D\u540C\u3002") : null,
|
|
21087
21178
|
samplingRestricted && model.maxOutputTokens === void 0 && settings.maxTokens === void 0 ? h("p", { className: "odc-hint" }, "Messages \u9ED8\u8BA4\u6700\u5927\u8F93\u51FA 4096\uFF1B\u8F83\u9AD8\u601D\u8003\u6DF1\u5EA6\u53EF\u80FD\u9700\u8981\u589E\u5927\u3002") : null,
|
|
21088
21179
|
price === void 0 ? null : h(PriceDetails, { tiers: price.tiers }),
|
|
@@ -21106,13 +21197,15 @@ function ModelRow({ model, settings, authoritative, writable, pending, protocol
|
|
|
21106
21197
|
id: `${id}-effort`,
|
|
21107
21198
|
model,
|
|
21108
21199
|
value: settings.reasoningEffort,
|
|
21109
|
-
disabled: !writable
|
|
21110
|
-
|
|
21200
|
+
disabled: !writable,
|
|
21201
|
+
pending,
|
|
21202
|
+
disabledReason,
|
|
21203
|
+
onSave: async (value) => {
|
|
21111
21204
|
const next = { ...settings };
|
|
21112
21205
|
if (value === "") delete next.reasoningEffort;
|
|
21113
21206
|
else next.reasoningEffort = value;
|
|
21114
21207
|
setError(void 0);
|
|
21115
|
-
return
|
|
21208
|
+
return onCommit(next);
|
|
21116
21209
|
}
|
|
21117
21210
|
})
|
|
21118
21211
|
)
|
|
@@ -21120,12 +21213,12 @@ function ModelRow({ model, settings, authoritative, writable, pending, protocol
|
|
|
21120
21213
|
error62 !== void 0 ? h("p", { className: "odc-hint odc-field-error", role: "alert" }, error62) : null
|
|
21121
21214
|
);
|
|
21122
21215
|
}
|
|
21123
|
-
function ModelGroup({ title, group, models, settingsMap, authoritative, writable, pending, protocol, onCommit, prices }) {
|
|
21216
|
+
function ModelGroup({ title, group, models, settingsMap, authoritative, writable, pending, disabledReason, protocol, onCommit, prices }) {
|
|
21124
21217
|
const [query, setQuery] = React.useState("");
|
|
21125
21218
|
const [expanded, setExpanded] = React.useState(false);
|
|
21126
21219
|
const id = React.useId();
|
|
21127
21220
|
const normalized = query.trim().toLocaleLowerCase();
|
|
21128
|
-
const groupModels = models.filter((model) => model.group === group);
|
|
21221
|
+
const groupModels = sortModelsByEnabled(models.filter((model) => model.group === group), settingsMap, authoritative);
|
|
21129
21222
|
const filtered = groupModels.filter((model) => normalized === "" || `${model.name} ${model.id}`.toLocaleLowerCase().includes(normalized));
|
|
21130
21223
|
const visible = normalized !== "" || expanded ? filtered : filtered.slice(0, 6);
|
|
21131
21224
|
const enabledCount = groupModels.filter((model) => modelEnabled(model, settingsMap[model.id], authoritative)).length;
|
|
@@ -21154,6 +21247,7 @@ function ModelGroup({ title, group, models, settingsMap, authoritative, writable
|
|
|
21154
21247
|
authoritative,
|
|
21155
21248
|
writable,
|
|
21156
21249
|
pending,
|
|
21250
|
+
disabledReason,
|
|
21157
21251
|
protocol,
|
|
21158
21252
|
price: prices?.models.find((entry) => entry.id === model.id),
|
|
21159
21253
|
priceKnown: prices !== void 0 && (prices.state !== "error" || prices.stale),
|
|
@@ -21174,6 +21268,7 @@ function Models({ status, formSnapshot, setFormField, pendingField, onRefreshMod
|
|
|
21174
21268
|
const settingsMap = formReady ? formSnapshot.value?.modelSettings ?? {} : status?.config.modelSettings ?? {};
|
|
21175
21269
|
const authoritative = formReady || status?.config.modelSettings !== void 0;
|
|
21176
21270
|
const writable = formSnapshot.status === "ready" && formSnapshot.value !== void 0 && formSnapshot.writable;
|
|
21271
|
+
const disabledReason = formSnapshot.status === "loading" ? "\u6B63\u5728\u8F7D\u5165\u914D\u7F6E" : formSnapshot.status === "unavailable" ? "\u914D\u7F6E\u6682\u4E0D\u53EF\u7528" : !formSnapshot.writable ? "\u5F53\u524D\u8BBE\u7F6E\u4E3A\u53EA\u8BFB" : "\u914D\u7F6E\u4E0D\u53EF\u5199";
|
|
21177
21272
|
const pending = pendingField.includes("modelSettings");
|
|
21178
21273
|
const latestSettings = React.useRef(settingsMap);
|
|
21179
21274
|
React.useEffect(() => {
|
|
@@ -21206,7 +21301,7 @@ function Models({ status, formSnapshot, setFormField, pendingField, onRefreshMod
|
|
|
21206
21301
|
"div",
|
|
21207
21302
|
null,
|
|
21208
21303
|
h("h3", null, "\u53EF\u7528\u6A21\u578B"),
|
|
21209
|
-
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")
|
|
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\u5BB9\u91CF\u4E3A\u76EE\u5F55\u53C2\u8003\uFF0C\u7F51\u5173\u9650\u5236\u53EF\u80FD\u4E0D\u540C\uFF0C\u53EF\u5728\u6A21\u578B\u8BBE\u7F6E\u4E2D\u8986\u76D6\u3002")
|
|
21210
21305
|
),
|
|
21211
21306
|
h(
|
|
21212
21307
|
"div",
|
|
@@ -21239,8 +21334,8 @@ function Models({ status, formSnapshot, setFormField, pendingField, onRefreshMod
|
|
|
21239
21334
|
models.length === 0 ? h("p", { className: "odc-hint", role: "status" }, "\u6682\u65E0\u53EF\u7528\u6A21\u578B\uFF1B\u53EF\u5237\u65B0\u6A21\u578B\u5217\u8868\u540E\u91CD\u8BD5\u3002") : h(
|
|
21240
21335
|
"div",
|
|
21241
21336
|
{ className: "odc-model-groups" },
|
|
21242
|
-
h(ModelGroup, { title: "\u5957\u9910\u8D60\u9001\u6A21\u578B", group: "plan", models, settingsMap, authoritative, writable, pending, protocol, onCommit: commit, prices }),
|
|
21243
|
-
h(ModelGroup, { title: "\u4ED8\u8D39\u6A21\u578B", group: "paid", models, settingsMap, authoritative, writable, pending, protocol, onCommit: commit, prices })
|
|
21337
|
+
h(ModelGroup, { title: "\u5957\u9910\u8D60\u9001\u6A21\u578B", group: "plan", models, settingsMap, authoritative, writable, pending, disabledReason, protocol, onCommit: commit, prices }),
|
|
21338
|
+
h(ModelGroup, { title: "\u4ED8\u8D39\u6A21\u578B", group: "paid", models, settingsMap, authoritative, writable, pending, disabledReason, protocol, onCommit: commit, prices })
|
|
21244
21339
|
)
|
|
21245
21340
|
);
|
|
21246
21341
|
}
|
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.13";
|
|
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/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var EFFORTS_GROK = [...EFFORTS_LEVELS, "xhigh"];
|
|
|
75
75
|
var EFFORTS_MUSE = ["minimal", ...EFFORTS_REASONING];
|
|
76
76
|
var MODELS = [
|
|
77
77
|
// ── OpenAI(8) ─────────────────────────────────────────────
|
|
78
|
-
{ id: "gpt-6.1-sol", name: "GPT-6.1 Sol", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
78
|
+
{ id: "gpt-6.1-sol", name: "GPT-6.1 Sol", group: "paid", contextWindow: 105e4, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
79
79
|
{
|
|
80
80
|
id: "gpt-6.1-terra",
|
|
81
81
|
name: "GPT-6.1 Terra",
|
|
@@ -85,7 +85,7 @@ var MODELS = [
|
|
|
85
85
|
inputModalities: TEXT_AND_IMAGE,
|
|
86
86
|
reasoningEfforts: EFFORTS_OPENAI
|
|
87
87
|
},
|
|
88
|
-
{ id: "gpt-6-astra", name: "GPT-6 Astra", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
88
|
+
{ id: "gpt-6-astra", name: "GPT-6 Astra", group: "paid", contextWindow: 105e4, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
89
89
|
{
|
|
90
90
|
id: "gpt-6-luna",
|
|
91
91
|
name: "GPT-6 Luna",
|
|
@@ -95,18 +95,18 @@ var MODELS = [
|
|
|
95
95
|
inputModalities: TEXT_AND_IMAGE,
|
|
96
96
|
reasoningEfforts: EFFORTS_OPENAI
|
|
97
97
|
},
|
|
98
|
-
{ id: "gpt-6-sol", name: "GPT-6 Sol", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_OPENAI },
|
|
99
|
-
{ id: "gpt-5.6-luna", name: "GPT-5.6 Luna", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_OPENAI },
|
|
100
|
-
{ id: "gpt-5.6-sol", name: "GPT-5.6 Sol", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_OPENAI },
|
|
101
|
-
{ id: "gpt-5.6-terra", name: "GPT-5.6 Terra", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_OPENAI },
|
|
98
|
+
{ id: "gpt-6-sol", name: "GPT-6 Sol", group: "paid", contextWindow: 105e4, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_OPENAI },
|
|
99
|
+
{ id: "gpt-5.6-luna", name: "GPT-5.6 Luna", group: "paid", contextWindow: 105e4, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_OPENAI },
|
|
100
|
+
{ id: "gpt-5.6-sol", name: "GPT-5.6 Sol", group: "paid", contextWindow: 105e4, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_OPENAI },
|
|
101
|
+
{ id: "gpt-5.6-terra", name: "GPT-5.6 Terra", group: "paid", contextWindow: 105e4, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_OPENAI },
|
|
102
102
|
// ── Anthropic(8) ──────────────────────────────────────────
|
|
103
|
-
{ id: "claude-fable-5.1", name: "Claude Fable 5.1", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
104
|
-
{ id: "claude-fable-5", name: "Claude Fable 5", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
105
|
-
{ id: "claude-opus-5.5", name: "Claude Opus 5.5", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
106
|
-
{ id: "claude-opus-5", name: "Claude Opus 5", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
107
|
-
{ id: "claude-opus-4.8", name: "Claude Opus 4.8", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
108
|
-
{ id: "claude-sonnet-5.5", name: "Claude Sonnet 5.5", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
109
|
-
{ id: "claude-sonnet-5", name: "Claude Sonnet 5", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
103
|
+
{ id: "claude-fable-5.1", name: "Claude Fable 5.1", group: "paid", contextWindow: 1e6, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
104
|
+
{ id: "claude-fable-5", name: "Claude Fable 5", group: "paid", contextWindow: 1e6, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
105
|
+
{ id: "claude-opus-5.5", name: "Claude Opus 5.5", group: "paid", contextWindow: 1e6, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
106
|
+
{ id: "claude-opus-5", name: "Claude Opus 5", group: "paid", contextWindow: 1e6, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
107
|
+
{ id: "claude-opus-4.8", name: "Claude Opus 4.8", group: "paid", contextWindow: 1e6, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
108
|
+
{ id: "claude-sonnet-5.5", name: "Claude Sonnet 5.5", group: "paid", contextWindow: 1e6, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
109
|
+
{ id: "claude-sonnet-5", name: "Claude Sonnet 5", group: "paid", contextWindow: 1e6, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
110
110
|
{
|
|
111
111
|
id: "claude-haiku-5.5",
|
|
112
112
|
name: "Claude Haiku 5.5",
|
|
@@ -171,7 +171,7 @@ var MODELS = [
|
|
|
171
171
|
inputModalities: TEXT_AND_IMAGE,
|
|
172
172
|
reasoningEfforts: EFFORTS_LOW_HIGH
|
|
173
173
|
},
|
|
174
|
-
{ id: "glm-5.2", name: "GLM-5.2", group: "paid", inputModalities: TEXT_ONLY, reasoningEfforts: EFFORTS_GLM52 },
|
|
174
|
+
{ id: "glm-5.2", name: "GLM-5.2", group: "paid", contextWindow: 1e6, inputModalities: TEXT_ONLY, reasoningEfforts: EFFORTS_GLM52 },
|
|
175
175
|
// ── Moonshot(3) ───────────────────────────────────────────
|
|
176
176
|
{
|
|
177
177
|
id: "kimi-k2.7-code",
|
|
@@ -182,16 +182,16 @@ var MODELS = [
|
|
|
182
182
|
inputModalities: TEXT_AND_IMAGE,
|
|
183
183
|
reasoningEfforts: []
|
|
184
184
|
},
|
|
185
|
-
{ id: "kimi-k3", name: "Kimi K3", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LOW_HIGH },
|
|
186
|
-
{ id: "kimi-k3.1-pro", name: "Kimi K3.1 Pro", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LOW_HIGH },
|
|
185
|
+
{ id: "kimi-k3", name: "Kimi K3", group: "paid", contextWindow: 1048576, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LOW_HIGH },
|
|
186
|
+
{ id: "kimi-k3.1-pro", name: "Kimi K3.1 Pro", group: "paid", contextWindow: 1048576, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LOW_HIGH },
|
|
187
187
|
// ── Google(3) ─────────────────────────────────────────────
|
|
188
|
-
{ id: "gemini-4-argon", name: "Gemini 4 Argon", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LEVELS },
|
|
189
|
-
{ id: "gemini-3.8-flash", name: "Gemini 3.8 Flash", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LEVELS },
|
|
190
|
-
{ id: "gemini-3.7-flash", name: "Gemini 3.7 Flash", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LEVELS },
|
|
188
|
+
{ id: "gemini-4-argon", name: "Gemini 4 Argon", group: "paid", contextWindow: 1048576, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LEVELS },
|
|
189
|
+
{ id: "gemini-3.8-flash", name: "Gemini 3.8 Flash", group: "paid", contextWindow: 1048576, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LEVELS },
|
|
190
|
+
{ id: "gemini-3.7-flash", name: "Gemini 3.7 Flash", group: "paid", contextWindow: 1048576, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LEVELS },
|
|
191
191
|
// ── xAI(3) ────────────────────────────────────────────────
|
|
192
|
-
{ id: "grok-4.7", name: "Grok 4.7", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_GROK },
|
|
193
|
-
{ id: "grok-4.6", name: "Grok 4.6", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_GROK },
|
|
194
|
-
{ id: "grok-4.5", name: "Grok 4.5", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LEVELS },
|
|
192
|
+
{ id: "grok-4.7", name: "Grok 4.7", group: "paid", contextWindow: 5e5, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_GROK },
|
|
193
|
+
{ id: "grok-4.6", name: "Grok 4.6", group: "paid", contextWindow: 5e5, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_GROK },
|
|
194
|
+
{ id: "grok-4.5", name: "Grok 4.5", group: "paid", contextWindow: 5e5, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_LEVELS },
|
|
195
195
|
// ── Xiaomi(2) ─────────────────────────────────────────────
|
|
196
196
|
{
|
|
197
197
|
id: "mimo-v2.6-pro",
|
|
@@ -222,11 +222,11 @@ var MODELS = [
|
|
|
222
222
|
reasoningEfforts: ["none", "high"]
|
|
223
223
|
},
|
|
224
224
|
// ── Alibaba(1) ────────────────────────────────────────────
|
|
225
|
-
{ id: "qwen3.7-max", name: "Qwen3.7 Max", group: "paid", inputModalities: TEXT_ONLY, reasoningEfforts: [] },
|
|
225
|
+
{ id: "qwen3.7-max", name: "Qwen3.7 Max", group: "paid", contextWindow: 1e6, inputModalities: TEXT_ONLY, reasoningEfforts: [] },
|
|
226
226
|
// Official API additions; display labels for undocumented entries are local formatting.
|
|
227
|
-
{ id: "minimax-m3.1-flash", name: "MiniMax M3.1 Flash", group: "plan", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
228
|
-
{ id: "muse-spark-1.3", name: "Muse Spark 1.3", group: "paid", inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_MUSE },
|
|
229
|
-
{ id: "muse-wonder", name: "Muse Wonder", group: "paid" }
|
|
227
|
+
{ id: "minimax-m3.1-flash", name: "MiniMax M3.1 Flash", group: "plan", contextWindow: 1e6, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_REASONING },
|
|
228
|
+
{ id: "muse-spark-1.3", name: "Muse Spark 1.3", group: "paid", contextWindow: 1048576, inputModalities: TEXT_AND_IMAGE, reasoningEfforts: EFFORTS_MUSE },
|
|
229
|
+
{ id: "muse-wonder", name: "Muse Wonder", group: "paid", contextWindow: 1048576 }
|
|
230
230
|
];
|
|
231
231
|
var BY_ID = new Map(MODELS.map((model) => [model.id, model]));
|
|
232
232
|
function findModel(id) {
|
|
@@ -1950,7 +1950,7 @@ function metadata(provider, row, config) {
|
|
|
1950
1950
|
id: row.id,
|
|
1951
1951
|
name: row.name,
|
|
1952
1952
|
...row.inputModalities ? { inputModalities: row.inputModalities } : {},
|
|
1953
|
-
...row.contextWindow === void 0 ? {} : { context: { contextWindow: row.contextWindow
|
|
1953
|
+
...row.contextWindow === void 0 ? {} : { context: { contextWindow: row.contextWindow } },
|
|
1954
1954
|
...reserve === void 0 ? {} : { defaultMaxTokens: reserve },
|
|
1955
1955
|
...efforts?.length ? { reasoning: {
|
|
1956
1956
|
efforts: efforts.map((id) => ({ id: ReasoningEffortId(id), name: { none: "\u5173\u95ED", minimal: "\u6700\u4F4E", low: "\u4F4E", medium: "\u4E2D", high: "\u9AD8", xhigh: "\u8F83\u9AD8", ultra: "\u6781\u9AD8", max: "\u6700\u9AD8" }[id] ?? id })),
|
|
@@ -2176,7 +2176,8 @@ var CoRouterAdapter = class extends LlmAdapter {
|
|
|
2176
2176
|
} catch (error) {
|
|
2177
2177
|
if (options.signal?.aborted || this.#lifetime.signal.aborted) signal.throwIfAborted();
|
|
2178
2178
|
if (signal.aborted) throw new LlmError11("CoRouter \u8BF7\u6C42\u8D85\u8FC7\u603B\u8D85\u65F6", "TIMEOUT");
|
|
2179
|
-
|
|
2179
|
+
const retryOpusMessages = protocolId === "messages" && row.group === "paid" && row.id === "claude-opus-5.5";
|
|
2180
|
+
if ((monitor || retryOpusMessages) && !tracker.sawToolCall && error instanceof PrematureEndError) throw new LlmError11(error.message, "TRANSPORT");
|
|
2180
2181
|
if (monitor && !tracker.sawToolCall && error instanceof LlmError11 && error.code === "EMPTY_RESPONSE") {
|
|
2181
2182
|
reportEmptyTurn();
|
|
2182
2183
|
throw new LlmError11(error.message, OPENDESIGN_EOT);
|
|
@@ -2969,7 +2970,7 @@ import { randomUUID as randomUUID2 } from "node:crypto";
|
|
|
2969
2970
|
|
|
2970
2971
|
// src/device-auth.ts
|
|
2971
2972
|
var DEVICE_AUTH_ENDPOINT = "https://amr-api.open-design.ai/api/v1/cli/device-authorizations";
|
|
2972
|
-
var DEVICE_AUTH_PLUGIN_VERSION = "0.1.
|
|
2973
|
+
var DEVICE_AUTH_PLUGIN_VERSION = "0.1.13";
|
|
2973
2974
|
var DEVICE_REQUEST_TIMEOUT_MS = 2e4;
|
|
2974
2975
|
var DEVICE_RESPONSE_MAX_BYTES = 65536;
|
|
2975
2976
|
var DEVICE_POLL_MIN_MS = 1e3;
|