dsh-opendesign-corouter 0.1.15 → 0.1.17
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 +7 -3
- package/lib/client-config-writes.d.ts +36 -0
- package/lib/client-context-quick.d.ts +35 -0
- package/lib/client.d.ts +29 -6
- package/lib/client.js +1042 -446
- package/lib/config.d.ts +7 -0
- package/lib/context-budget.d.ts +23 -0
- package/lib/device-auth.d.ts +1 -1
- package/lib/generated/typert.host.js +9 -1
- package/lib/generated/typert.remote-client.js +9 -1
- package/lib/index.d.ts +12 -0
- package/lib/index.js +168 -16
- package/lib/index.js.map +4 -4
- package/lib/model-catalog-snapshot.d.ts +22 -0
- package/lib/model-settings.d.ts +7 -4
- package/lib/remote.d.ts +2 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -55,7 +55,11 @@ dsh plugin --profile web add /absolute/path/to/dsh-opendesign-corouter-0.1.15.tg
|
|
|
55
55
|
| `opendesign-corouter-plan` | 13 | Core / Design Plan 附赠通道,含预检确认覆盖的 MiniMax M3.1 Flash |
|
|
56
56
|
| `opendesign-corouter-paid` | 26 | Plan 套餐模型及其他钱包付费模型 |
|
|
57
57
|
|
|
58
|
-
上表为内置目录。模型页可通过当前配置网关的 OpenAI 兼容 `/models` 接口刷新目录,逐个启用或停用模型、控制图片输入,并配置温度、top-p
|
|
58
|
+
上表为内置目录。模型页可通过当前配置网关的 OpenAI 兼容 `/models` 接口刷新目录,逐个启用或停用模型、控制图片输入,并配置温度、top-p、默认输出上限、上下文窗口档位及思考深度。高级参数默认折叠,图片输入可手动覆盖或恢复自动。未知模态保持未知并尝试发送图片;实际支持情况由网关决定。[图片能力证据](docs/model-capabilities.md)。
|
|
59
|
+
|
|
60
|
+
上下文窗口按 **默认 272K / 扩展 500K / 最大 872K** 三个互斥档位选择,均为输入与输出合计的工作总窗口;有效窗口取档位与该模型已知参考中的较小值,超过参考的档位不可选。输出仍在这段窗口内预留,自动预留最多为总窗口的 1/4 且不超过模型输出上限。[窗口与档位口径](docs/model-context.md)
|
|
61
|
+
|
|
62
|
+
聊天窗口的模型选择框旁有上下文快捷按钮,当前会话使用本插件模型时出现,显示该模型生效的总窗口,点开可直接切三档。它与设置页写的是同一份全局模型默认,同一模型的其他会话会同步生效。
|
|
59
63
|
|
|
60
64
|
推理协议可选 **OpenAI Chat Completions、OpenAI Responses、Anthropic Messages**。模型发现始终使用当前网关的 OpenAI 兼容 `/models` 接口,不随推理协议切换。
|
|
61
65
|
|
|
@@ -83,9 +87,9 @@ dsh plugin --profile web add /absolute/path/to/dsh-opendesign-corouter-0.1.15.tg
|
|
|
83
87
|
|
|
84
88
|
### DeepSeek V4.1 Flash 异常结束检测
|
|
85
89
|
|
|
86
|
-
|
|
90
|
+
两者都只作用于本插件 Plan Provider 的 DeepSeek V4.1 Flash 工具对话,其它模型和 Provider 不受影响。协议保护是独立开关,默认开启;结束回合核验是另一个开关,默认关闭。协议保护参考 [dsh-empty-turn-guard](https://github.com/FYTXY/dsh-empty-turn-guard),仅将“stop 且没有工具调用、回答为空或只剩协议残留”标成异常 EOT。包含正常正文的操作前言保留为成功响应,不再按句式重发原请求。
|
|
87
91
|
|
|
88
|
-
异常 EOT
|
|
92
|
+
异常 EOT 在同一步骤内持续重试,直到成功或取消;其他错误遵循宿主策略。开启结束回合核验后,Agent 结束时会追加有界核验:默认最多 3 步,连续 2 次没有新成功工具结果时停止,可在高级页调整。模型报告完成、等待用户、等待后台工作、阻塞或继续执行;做过工具工作时,完成声明需引用成功结果。已有未完成 Goal、后台等待、取消与截断保留原有控制。首次收尾核验通常增加一次模型步骤,引用校验不等于独立证明全部任务要求已满足。[两层机制、计数与验证边界](docs/empty-turn-evidence.md)
|
|
89
93
|
|
|
90
94
|
## 使用前先知道
|
|
91
95
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared configuration write coordinator.
|
|
3
|
+
*
|
|
4
|
+
* The settings page and the new-chat quick buttons write into the same Host namespace. Each
|
|
5
|
+
* surface keeps its own pending overlay, so one surface's write can overwrite the value the other
|
|
6
|
+
* surface just prepared. This module owns one coordinator per namespace form: every write is
|
|
7
|
+
* serialized, every pending field is tracked, and both surfaces read the same pending snapshot.
|
|
8
|
+
*
|
|
9
|
+
* The coordinator talks to the Host configuration form only: it projects the value a caller
|
|
10
|
+
* wants to save, hands the write to the form, and hands the value back to the form snapshot once
|
|
11
|
+
* the write is done.
|
|
12
|
+
*/
|
|
13
|
+
import type { ConfigForm, FormValues } from './client.js';
|
|
14
|
+
export interface ConfigWriteSnapshot {
|
|
15
|
+
/** Fields with a queued or running write; consumers disable their controls for these fields. */
|
|
16
|
+
pendingFields: readonly string[];
|
|
17
|
+
/** Values of the pending writes, projected for the UI while a write runs. */
|
|
18
|
+
pendingValues: Partial<FormValues>;
|
|
19
|
+
}
|
|
20
|
+
export interface ConfigWrites {
|
|
21
|
+
/** Stable snapshot object, usable as a `useSyncExternalStore` source. */
|
|
22
|
+
getSnapshot(): ConfigWriteSnapshot;
|
|
23
|
+
subscribe(listener: () => void): () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Queue one field write.
|
|
26
|
+
*
|
|
27
|
+
* `baseValue` is the value the caller saw while rendering; it is the baseline for the
|
|
28
|
+
* `modelSettings` diff. Returns false when the namespace is not writable, when the same field
|
|
29
|
+
* already has a pending write, or when the Host rejects the write.
|
|
30
|
+
*/
|
|
31
|
+
set(field: string, value: unknown, baseValue?: unknown): Promise<boolean>;
|
|
32
|
+
/** Stop the coordinator: queued writes never start and subscribers are released. */
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
/** One coordinator per underlying form; the same form always yields the same instance. */
|
|
36
|
+
export declare function configWritesFor(form: ConfigForm): ConfigWrites;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ConfigForm, RpcCaller } from './client.js';
|
|
3
|
+
/** Minimal projection of the Core 0.2.1 per-session model directory. */
|
|
4
|
+
export interface QuickDirectorySnapshot {
|
|
5
|
+
current: {
|
|
6
|
+
provider: string;
|
|
7
|
+
model: string;
|
|
8
|
+
} | null;
|
|
9
|
+
pending: {
|
|
10
|
+
provider: string;
|
|
11
|
+
model: string;
|
|
12
|
+
} | null;
|
|
13
|
+
status: 'idle' | 'loading' | 'ready' | 'selecting' | 'error';
|
|
14
|
+
groups: readonly unknown[];
|
|
15
|
+
routable?: boolean | null;
|
|
16
|
+
}
|
|
17
|
+
export interface QuickDirectoryStore {
|
|
18
|
+
getSnapshot(): QuickDirectorySnapshot;
|
|
19
|
+
subscribe(listener: () => void): () => void;
|
|
20
|
+
}
|
|
21
|
+
export interface ModelDirectoryService {
|
|
22
|
+
directoryFor(sessionId: string): {
|
|
23
|
+
store: QuickDirectoryStore;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface ContextQuickProps {
|
|
27
|
+
directory: QuickDirectoryStore;
|
|
28
|
+
form: ConfigForm;
|
|
29
|
+
caller: RpcCaller;
|
|
30
|
+
}
|
|
31
|
+
export declare function isCoRouterProvider(provider: string): boolean;
|
|
32
|
+
export declare function quickWindowLabel(tokens: number): string;
|
|
33
|
+
export declare const QUICK_CONTEXT_CSS = "\n.odc-quick{display:inline-flex;color:var(--dsw-alias-label-primary,CanvasText);font:12px/1.5 system-ui,sans-serif}\n.odc-quick-trigger{display:inline-flex;align-items:center;gap:4px;min-height:30px;padding:3px 7px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--dsw-alias-label-secondary,CanvasText);font:inherit;font-variant-numeric:tabular-nums;cursor:pointer}\n.odc-quick-trigger:hover,.odc-quick-trigger[aria-expanded=true]{background:var(--dsw-alias-bg-layer-2,Canvas);color:var(--dsw-alias-label-primary,CanvasText)}\n/* Off-viewport until the first position() call: a popover that paints at the static\n position would sit at the top-left corner and swallow outside clicks. */\n.odc-quick-panel{position:fixed;inset:auto;left:-9999px;top:-9999px;margin:0;box-sizing:border-box;width:min(320px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:14px;border:1px solid var(--dsw-alias-border-l3,CanvasText);border-radius:10px;background:var(--dsw-alias-bg-layer-1,Canvas);color:var(--dsw-alias-label-primary,CanvasText);box-shadow:var(--dsw-shadow-lv2,0 4px 20px #0002);font:12px/1.6 system-ui,sans-serif;color-scheme:light}\nbody[data-ds-dark-theme] .odc-quick-panel{color-scheme:dark}\n.odc-quick-panel:popover-open{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}.odc-quick-panel h3,.odc-quick-panel p{margin:0;min-width:0}.odc-quick-panel h3{font-size:14px}.odc-quick-panel small{font-size:12px;min-width:0;overflow-wrap:anywhere;color:var(--dsw-alias-label-secondary,CanvasText)}\n.odc-quick-options{display:grid;gap:6px;margin:0;padding:0;border:0;min-width:0}.odc-quick-options legend{margin-bottom:4px}.odc-quick-option{display:flex;align-items:center;gap:8px;min-height:38px;min-width:0;padding:6px 8px;border:1px solid var(--dsw-alias-border-l3,CanvasText);border-radius:7px;cursor:pointer}.odc-quick-option:has(input:checked){border-color:var(--dsw-alias-brand-primary,Highlight)}.odc-quick-option:has(input:disabled){cursor:not-allowed;opacity:.65}.odc-quick-option input{accent-color:var(--dsw-alias-brand-primary,Highlight);flex:none}.odc-quick-option span{display:grid;min-width:0;overflow-wrap:anywhere}\n.odc-quick-error{color:var(--dsw-alias-state-error-primary,CanvasText);color:color-mix(in srgb,var(--dsw-alias-state-error-primary,CanvasText) 85%,var(--dsw-alias-label-primary,CanvasText))}.odc-quick :focus-visible{outline:2px solid var(--dsw-alias-brand-primary,Highlight);outline-offset:2px}\n@media(forced-colors:active){.odc-quick-trigger,.odc-quick-option,.odc-quick-panel{border-color:ButtonText}.odc-quick-option:has(input:checked){border-color:Highlight}.odc-quick-option input{forced-color-adjust:auto}}\n";
|
|
34
|
+
/** The slot belongs to a Session; saving changes the selected model's shared default. */
|
|
35
|
+
export declare function ContextQuickSwitch({ directory, form, caller }: ContextQuickProps): React.ReactElement | null;
|
package/lib/client.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { type LoginState, type Status, type StatusModel, type PriceCatalog } fro
|
|
|
5
5
|
import type { QuotaSnapshot, QuotaWindow } from './quota.js';
|
|
6
6
|
import { type ApiProtocol } from './protocol-options.js';
|
|
7
7
|
import type { ModelSettings, ModelSettingsMap } from './model-settings.js';
|
|
8
|
+
import { type ContextWindowPresetId } from './context-budget.js';
|
|
9
|
+
import { type ModelDirectoryService } from './client-context-quick.js';
|
|
8
10
|
declare const TABS: readonly [{
|
|
9
11
|
readonly id: "overview";
|
|
10
12
|
readonly label: "概览";
|
|
@@ -22,6 +24,7 @@ type TabId = typeof TABS[number]['id'];
|
|
|
22
24
|
export type RpcCaller = <T>(method: keyof CoRouterRemote, request?: unknown) => Promise<T>;
|
|
23
25
|
export interface FormValues {
|
|
24
26
|
emptyTurnGuard?: boolean;
|
|
27
|
+
turnCompletionReview?: boolean;
|
|
25
28
|
useDesktopCredential?: boolean;
|
|
26
29
|
baseURL?: string;
|
|
27
30
|
apiKeyEnv?: string;
|
|
@@ -48,14 +51,14 @@ export interface ConfigForms {
|
|
|
48
51
|
get(namespace: string): ConfigForm;
|
|
49
52
|
}
|
|
50
53
|
export interface SlotDescriptor<P> {
|
|
51
|
-
name: 'settings.section';
|
|
54
|
+
name: 'settings.section' | 'conversation.input.right';
|
|
52
55
|
id: string;
|
|
53
56
|
order: number;
|
|
54
|
-
label
|
|
55
|
-
inject: () => P;
|
|
57
|
+
label?: () => string;
|
|
58
|
+
inject: (sessionId: string) => P;
|
|
56
59
|
}
|
|
57
60
|
export interface Slots {
|
|
58
|
-
inject(name: 'settings.section', register: () => void | (() => void)): void | (() => void);
|
|
61
|
+
inject(name: 'settings.section' | 'conversation.input.right', register: () => void | (() => void)): void | (() => void);
|
|
59
62
|
register<P>(descriptor: SlotDescriptor<P>, component: React.ComponentType<P>): void | (() => void);
|
|
60
63
|
}
|
|
61
64
|
export interface ClientContext {
|
|
@@ -74,6 +77,12 @@ export interface ConfigScope {
|
|
|
74
77
|
configForms: ConfigForms;
|
|
75
78
|
slots: Slots;
|
|
76
79
|
effect(effect: () => void | (() => void), label?: string): void;
|
|
80
|
+
inject(services: ['modelDirectories'], apply: (ctx: ModelDirectoryScope) => void): void;
|
|
81
|
+
}
|
|
82
|
+
export interface ModelDirectoryScope {
|
|
83
|
+
slots: Slots;
|
|
84
|
+
modelDirectories: ModelDirectoryService;
|
|
85
|
+
effect(effect: () => void | (() => void), label?: string): void;
|
|
77
86
|
}
|
|
78
87
|
export interface SettingsProps {
|
|
79
88
|
caller: RpcCaller;
|
|
@@ -114,10 +123,11 @@ export declare function QuotaView({ quota, nextAutoRefreshAt, refreshIntervalSec
|
|
|
114
123
|
children?: React.ReactNode | undefined;
|
|
115
124
|
}>;
|
|
116
125
|
/** 异常结束监控卡片:协议拦截与新监控计数分列,未知值保持未知,不补零;计数均从插件加载起累计。 */
|
|
117
|
-
export declare function TurnMonitorView({ turnMonitor, guardedTurns, enabled }: {
|
|
126
|
+
export declare function TurnMonitorView({ turnMonitor, guardedTurns, enabled, reviewEnabled }: {
|
|
118
127
|
turnMonitor?: Status['turnMonitor'];
|
|
119
128
|
guardedTurns?: number | undefined;
|
|
120
129
|
enabled?: boolean | undefined;
|
|
130
|
+
reviewEnabled?: boolean | undefined;
|
|
121
131
|
}): React.DetailedReactHTMLElement<{
|
|
122
132
|
className: string;
|
|
123
133
|
'aria-label': string;
|
|
@@ -179,6 +189,19 @@ export interface OverviewProps {
|
|
|
179
189
|
export declare function Overview({ status, busy, onRefresh, nextAutoRefreshAt, refreshIntervalSeconds, onConnection }: OverviewProps): React.FunctionComponentElement<{
|
|
180
190
|
children?: React.ReactNode | undefined;
|
|
181
191
|
}>;
|
|
192
|
+
/**
|
|
193
|
+
* The tier a saved override represents. A legacy number keeps its own meaning: even a
|
|
194
|
+
* number that equals a tier's token count is a custom window, never a tier.
|
|
195
|
+
*/
|
|
196
|
+
export declare function selectedContextTier(settings: ModelSettings): ContextWindowPresetId | undefined;
|
|
197
|
+
/** A tier above the known reference cannot be selected; the default tier is clamped instead. */
|
|
198
|
+
export declare function contextTierAvailable(tier: ContextWindowPresetId, reference: number | undefined): boolean;
|
|
199
|
+
/** The working window a tier would produce for this model. */
|
|
200
|
+
export declare function contextTierWindow(tier: ContextWindowPresetId, reference: number | undefined): number;
|
|
201
|
+
/** An explicit output limit that does not fit the effective working window. */
|
|
202
|
+
export declare function contextCapacityConflict(reference: number | undefined, next: ModelSettings): string | undefined;
|
|
203
|
+
/** A tier change that would break an explicit output limit; the saved tier stays unchanged. */
|
|
204
|
+
export declare function contextTierConflict(reference: number | undefined, tier: ContextWindowPresetId, output: number | undefined): string | undefined;
|
|
182
205
|
export interface ModelRowProps {
|
|
183
206
|
model: StatusModel;
|
|
184
207
|
settings: ModelSettings;
|
|
@@ -198,7 +221,7 @@ export declare function ModelRow({ model, settings, authoritative, writable, pen
|
|
|
198
221
|
export interface ModelsProps {
|
|
199
222
|
status: Status | undefined;
|
|
200
223
|
formSnapshot: FormSnapshot;
|
|
201
|
-
setFormField: (field: string, value: unknown) => Promise<boolean>;
|
|
224
|
+
setFormField: (field: string, value: unknown, baseValue?: unknown) => Promise<boolean>;
|
|
202
225
|
pendingField: readonly string[];
|
|
203
226
|
onRefreshModels: () => void;
|
|
204
227
|
refreshingModels: boolean;
|