dsh-model-think-level 2.0.0 → 2.0.2
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/LICENSE +13 -0
- package/assets/NOTICE.md +15 -0
- package/assets/unified_bank.json +32910 -0
- package/lib/client/EffortEditor.d.ts +22 -15
- package/lib/client/FingerprintPane.d.ts +36 -0
- package/lib/client/capacity.d.ts +30 -0
- package/lib/client/fingerprint-client.d.ts +81 -0
- package/lib/client/fingerprint-runner.d.ts +61 -0
- package/lib/client/index.d.ts +6 -0
- package/lib/client/injection/create-key-seat.d.ts +4 -5
- package/lib/client/injection/editor-tab-bar.d.ts +2 -1
- package/lib/client/injection/editor-tabs.d.ts +11 -1
- package/lib/client/injection/key-reveal.d.ts +12 -0
- package/lib/client/injection/models-page-editor.d.ts +82 -1
- package/lib/client/injection/provider-card-slot.d.ts +3 -1
- package/lib/client/locales.d.ts +32 -0
- package/lib/client/ops.d.ts +4 -0
- package/lib/client/refresh-scheduler.d.ts +29 -0
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/types.d.ts +9 -0
- package/lib/client.js +674 -182
- package/lib/client.js.map +4 -4
- package/lib/constants.d.ts +11 -0
- package/lib/fingerprint/bank.d.ts +24 -0
- package/lib/fingerprint/challenges.d.ts +14 -0
- package/lib/fingerprint/core.d.ts +85 -0
- package/lib/fingerprint/eligibility.d.ts +8 -0
- package/lib/fingerprint/random.d.ts +4 -0
- package/lib/fingerprint/run.d.ts +110 -0
- package/lib/fingerprint/store.d.ts +31 -0
- package/lib/fingerprint/verdict.d.ts +64 -0
- package/lib/index.js +1012 -50
- package/lib/index.js.map +4 -4
- package/package.json +13 -5
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
* everything arrives through a plain props face, so it stays testable in
|
|
6
6
|
* isolation. The draft/intent rules live in the client/effort module.
|
|
7
7
|
*
|
|
8
|
-
* The
|
|
9
|
-
* default X" state, and the applied suggestion's provenance pill)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
8
|
+
* The shape is the design board's: one head line (the switch, the "declared N ·
|
|
9
|
+
* default X" state, and the applied suggestion's provenance pill) over a sunk
|
|
10
|
+
* panel with no outline of its own. Inside it, each decision is a section — a
|
|
11
|
+
* label row with its trailing action, the hint on its own line, and the control
|
|
12
|
+
* group under both: the level ladder as 28px chips, the armed levels' wire
|
|
13
|
+
* spellings folded behind a link into their own white sheet, then the default
|
|
14
|
+
* pick and the input modality side by side, then the two capacity fields. A
|
|
15
|
+
* hairline separates the declaration from the numbers. The only action is
|
|
16
|
+
* 放弃修改: the edits land with the official card's own Save, so this panel
|
|
17
|
+
* never grows a second commit button.
|
|
17
18
|
*/
|
|
18
19
|
import type { ReactNode } from 'react';
|
|
19
20
|
import type { CompatSuggestion, InputModalities, ReasoningEfforts } from '../knowledge.js';
|
|
@@ -68,13 +69,19 @@ export interface EffortEditorProps {
|
|
|
68
69
|
*/
|
|
69
70
|
staged?: boolean;
|
|
70
71
|
/**
|
|
71
|
-
* Whether the official Models page owns input types for this row
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* have no such control and keep the section.
|
|
72
|
+
* Whether the official Models page owns input types for this row. The
|
|
73
|
+
* injector now hides that official control and always shows this card's
|
|
74
|
+
* modality section, so the prop is kept only to document the old kernel
|
|
75
|
+
* split and is no longer read.
|
|
76
76
|
*/
|
|
77
77
|
officialInputTypes?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Report whether this card currently covers the official capacity and
|
|
80
|
+
* input-type chrome. The card exists only while the thinking switch is on;
|
|
81
|
+
* when it is off the row's own official controls have to come back, or a
|
|
82
|
+
* model that declares no reasoning would lose every way to edit its window.
|
|
83
|
+
*/
|
|
84
|
+
onCoverageChange?: (covered: boolean) => void;
|
|
78
85
|
/** The write seam (settings.mutate plus the suggestion engine). */
|
|
79
86
|
api: EffortEditorApi;
|
|
80
87
|
/** Read-only (settings document not writable). */
|
|
@@ -126,5 +133,5 @@ export declare function pendingWriteOf(parts: PendingWriteParts): PendingWrite;
|
|
|
126
133
|
* checkboxes, the modality toggle, the auto-adapt action, and the
|
|
127
134
|
* apply/reset actions that own both sections.
|
|
128
135
|
*/
|
|
129
|
-
export declare function EffortEditor({ route, routeApi, routeBaseURL, modelId, modelName, efforts: initialEfforts, effortsUnset, input: initialInput, compat: initialCompat, defaultEffort: initialDefaultEffort, index, staged, officialInputTypes, api, readOnly, t }: EffortEditorProps): ReactNode;
|
|
136
|
+
export declare function EffortEditor({ route, routeApi, routeBaseURL, modelId, modelName, efforts: initialEfforts, effortsUnset, input: initialInput, compat: initialCompat, defaultEffort: initialDefaultEffort, index, staged, officialInputTypes, onCoverageChange, api, readOnly, t }: EffortEditorProps): ReactNode;
|
|
130
137
|
export type { DraftLevels };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 指纹检测页签的面板:一家供应商的可检测模型清单、每行的状态徽章、逐行检测
|
|
3
|
+
* 与一键全测。
|
|
4
|
+
*
|
|
5
|
+
* 三条硬约束(m00702)在这里落成三件事:
|
|
6
|
+
* 1. **只认 GPT / Claude**:`isEligibleModel` 是唯一的闸,不在此列的模型连
|
|
7
|
+
* 行都不出现 —— 不给一个必然点不动的灰按钮。一个都没有就整页不显示。
|
|
8
|
+
* 2. **后台跑、不留进度**:没有浮层、没有 toast、没有遮罩、没有进度条。进
|
|
9
|
+
* 度只落在行徽章的 `检测中 · 2/3` 上;任务活在 `fingerprint-runner` 里,
|
|
10
|
+
* 这个组件只是订阅者,卸载时不中止任何东西。
|
|
11
|
+
* 3. **不进新增供应商卡片**:`isCreateProviderCard` 为真就整个渲染 null。
|
|
12
|
+
*
|
|
13
|
+
* 还有一条来自 m00883:指纹检测不与思考强度混在一行 —— 它有自己的页签、
|
|
14
|
+
* 自己的行、自己的结果卡,`.bre-model-grid` 一列都不动。
|
|
15
|
+
*
|
|
16
|
+
* @module dsh-model-think-level/client/FingerprintPane
|
|
17
|
+
*/
|
|
18
|
+
import { type ReactNode } from 'react';
|
|
19
|
+
import type { Translate } from '@deepseek-ai/dsh-client-ui-slots';
|
|
20
|
+
import type { ClientContext, RemoteApi } from './types.js';
|
|
21
|
+
export interface FingerprintPaneProps {
|
|
22
|
+
/** 供应商的设置键。 */
|
|
23
|
+
route: string;
|
|
24
|
+
/** 设置 Remote(外加可选的 scope 镜像)。 */
|
|
25
|
+
api: RemoteApi;
|
|
26
|
+
/** 插件自己的翻译函数。 */
|
|
27
|
+
t: Translate;
|
|
28
|
+
/** 客户端根上下文;用于订阅设置文档变化。可选,缺了就只在挂载时读一次。 */
|
|
29
|
+
ctx?: ClientContext;
|
|
30
|
+
/** 挂载点:判定是不是新增供应商卡片用。 */
|
|
31
|
+
host: {
|
|
32
|
+
readonly current: HTMLElement | null;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** 一家供应商的指纹检测面板。 */
|
|
36
|
+
export declare function FingerprintPane({ route, api, t, ctx, host }: FingerprintPaneProps): ReactNode;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capacity fields: the two token counts the official model row calls
|
|
3
|
+
* "context window" and "max output".
|
|
4
|
+
*
|
|
5
|
+
* The official inputs accept plain digits, but users write `1M` and `128K` —
|
|
6
|
+
* the catalogue itself shows those spellings — so one parser owns both the
|
|
7
|
+
* user's shorthand and the grouped digit string the form holds. The display
|
|
8
|
+
* side always groups the plain number: the value that reaches the official
|
|
9
|
+
* form is `1048576`, not `1M`, because that form's own parser only knows
|
|
10
|
+
* digits and its Save is what persists.
|
|
11
|
+
*
|
|
12
|
+
* @module dsh-model-think-level/client/capacity
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Parse a capacity field into a token count.
|
|
16
|
+
*
|
|
17
|
+
* Accepts thousands separators and a `K`/`M` suffix (case-insensitive), with
|
|
18
|
+
* or without spaces, e.g. `1M`, `128 K`, `1,048,576`. A blank or malformed
|
|
19
|
+
* value is `undefined`: the caller writes an empty official field, which is
|
|
20
|
+
* how a capacity goes back to inheriting the catalogue value.
|
|
21
|
+
* @param text - the field's text as typed.
|
|
22
|
+
* @returns the token count, or undefined when the text is blank/invalid.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseCapacity(text: string): number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* A capacity count as the field shows it when it is not being typed into.
|
|
27
|
+
* @param value - the token count, or undefined for a blank field.
|
|
28
|
+
* @returns the grouped digits, or an empty string.
|
|
29
|
+
*/
|
|
30
|
+
export declare function capacityText(value: number | undefined): string;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { FingerprintRecord } from '../fingerprint/verdict.js';
|
|
2
|
+
/**
|
|
3
|
+
* 银行摘要,**结构声明**:`fingerprint/bank.ts` 是 Node-only(它自己读
|
|
4
|
+
* `assets/unified_bank.json`),浏览器不能 import 它。所以这里只声明前端
|
|
5
|
+
* 真正读的两个字段,宿主以后加字段也不会打断激活 —— 与 `SlotRegistrarFace`
|
|
6
|
+
* 同一个理由。
|
|
7
|
+
*/
|
|
8
|
+
export interface FingerprintBankView {
|
|
9
|
+
/** 银行的构建时间戳;换银行 = 所有落盘结论作废。 */
|
|
10
|
+
builtAt?: string;
|
|
11
|
+
/** 建议的题数,写在按钮旁边当成本说明。 */
|
|
12
|
+
recommendedQueries?: number;
|
|
13
|
+
}
|
|
14
|
+
/** GET 的应答体。 */
|
|
15
|
+
export interface FingerprintSnapshot {
|
|
16
|
+
bank: FingerprintBankView;
|
|
17
|
+
records: FingerprintRecord[];
|
|
18
|
+
}
|
|
19
|
+
/** 一行流式应答。顺序是 `progress`×N 然后 `result` 或 `error`。 */
|
|
20
|
+
export type FingerprintLine = {
|
|
21
|
+
type: 'progress';
|
|
22
|
+
index: number;
|
|
23
|
+
ok: boolean;
|
|
24
|
+
error?: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'result';
|
|
27
|
+
record: FingerprintRecord;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'error';
|
|
30
|
+
error: string;
|
|
31
|
+
};
|
|
32
|
+
/** 一次检测的答案:要么是落盘的那条记录,要么是一句面向用户的原因。 */
|
|
33
|
+
export type FingerprintRunAnswer = {
|
|
34
|
+
ok: true;
|
|
35
|
+
record: FingerprintRecord;
|
|
36
|
+
} | {
|
|
37
|
+
ok: false;
|
|
38
|
+
error: string;
|
|
39
|
+
};
|
|
40
|
+
/** 一次进行中的检测:可中止,且一定会 settle。 */
|
|
41
|
+
export interface FingerprintRun {
|
|
42
|
+
done: Promise<FingerprintRunAnswer>;
|
|
43
|
+
abort(): void;
|
|
44
|
+
}
|
|
45
|
+
/** 传输层的失败:不是"模型没测出来",是"这一次根本没跑成"。 */
|
|
46
|
+
export type TransportAnswer<T> = {
|
|
47
|
+
ok: true;
|
|
48
|
+
data: T;
|
|
49
|
+
} | {
|
|
50
|
+
ok: false;
|
|
51
|
+
error: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 取某供应商已落盘的检测结论。
|
|
55
|
+
* @param route - 供应商的设置键。
|
|
56
|
+
* @returns 银行摘要 + 该供应商的记录;传输失败是一句原因。
|
|
57
|
+
*/
|
|
58
|
+
export declare function readFingerprints(route: string): Promise<TransportAnswer<FingerprintSnapshot>>;
|
|
59
|
+
/**
|
|
60
|
+
* 忘掉一个模型的检测结论。忘掉就是忘掉 —— 不留"上次测过"的痕迹,下次显示
|
|
61
|
+
* 回 `未检测`。
|
|
62
|
+
* @param route - 供应商的设置键。
|
|
63
|
+
* @param model - 模型 id。
|
|
64
|
+
*/
|
|
65
|
+
export declare function forgetFingerprint(route: string, model: string): Promise<TransportAnswer<undefined>>;
|
|
66
|
+
/**
|
|
67
|
+
* 跑一个模型的三题,流式收进度。
|
|
68
|
+
*
|
|
69
|
+
* 应答是 NDJSON:每题一行 `progress`,末尾一行 `result` 或 `error`。**解析
|
|
70
|
+
* 容忍整个响应一次性到达**(有的代理会缓冲),所以按换行切而不是按到达次序
|
|
71
|
+
* 猜;丢行也不会卡死,`done` 一定会 settle。
|
|
72
|
+
*
|
|
73
|
+
* 调用方 abort 是"不要这个结论了",不是"回滚":已经跑完的题不重跑,已经
|
|
74
|
+
* 落盘的结论不撤 —— 落盘是宿主在 `result` 行之前做的。
|
|
75
|
+
*
|
|
76
|
+
* @param route - 供应商的设置键。
|
|
77
|
+
* @param model - 模型 id。
|
|
78
|
+
* @param onLine - 每收到一行调一次;`result` 那行也走这里,方便面板统一记账。
|
|
79
|
+
* @returns 可中止的句柄。
|
|
80
|
+
*/
|
|
81
|
+
export declare function runFingerprint(route: string, model: string, onLine: (line: FingerprintLine) => void): FingerprintRun;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { FingerprintRecord } from '../fingerprint/verdict.js';
|
|
2
|
+
import { readFingerprints, type FingerprintLine } from './fingerprint-client.js';
|
|
3
|
+
/** 一个面板订阅到的、可安全渲染的快照(引用稳定,改了才换)。 */
|
|
4
|
+
export interface FingerprintRunnerState {
|
|
5
|
+
/** 正在跑的模型 → 已完成的题数。 */
|
|
6
|
+
readonly running: ReadonlyMap<string, number>;
|
|
7
|
+
/** 排队中的模型,按顺序。 */
|
|
8
|
+
readonly queued: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
export interface FingerprintRunner {
|
|
11
|
+
/** 当前快照。 */
|
|
12
|
+
getState(): FingerprintRunnerState;
|
|
13
|
+
/** 订阅状态变化;返回退订函数。 */
|
|
14
|
+
subscribe(listener: () => void): () => void;
|
|
15
|
+
/** 订阅"某个模型的结论落盘了";返回退订函数。 */
|
|
16
|
+
onRecord(listener: (record: FingerprintRecord) => void): () => void;
|
|
17
|
+
/**
|
|
18
|
+
* 订阅"这次检测根本没跑成"(500、断网、流断在半路)。与落盘的 `failed`
|
|
19
|
+
* 记录不同:那不是模型的结论,是一次没有结论的尝试,面板要把它说出来,
|
|
20
|
+
* 否则按钮转一圈就复位,用户看不出有没有真的测过。
|
|
21
|
+
*/
|
|
22
|
+
onFailure(listener: (model: string, error: string) => void): () => void;
|
|
23
|
+
/** 排队一个模型。已经在跑或已排队就什么都不做。 */
|
|
24
|
+
check(model: string): void;
|
|
25
|
+
/** 按顺序排队一批模型。 */
|
|
26
|
+
checkAll(models: readonly string[]): void;
|
|
27
|
+
/** 没有等待的或正在跑的检测。 */
|
|
28
|
+
idle(): boolean;
|
|
29
|
+
/** 中止整批:清队列、掐正在跑的。已落盘的不撤。 */
|
|
30
|
+
abort(): void;
|
|
31
|
+
/** 供应商被删掉 / 页面要走了:停干净并把自己忘掉。 */
|
|
32
|
+
dispose(): void;
|
|
33
|
+
}
|
|
34
|
+
/** 面板挂上来的传输缝,方便测试换成假的。 */
|
|
35
|
+
export interface FingerprintSender {
|
|
36
|
+
run(route: string, model: string, onLine: (line: FingerprintLine) => void): {
|
|
37
|
+
done: Promise<{
|
|
38
|
+
ok: true;
|
|
39
|
+
record: FingerprintRecord;
|
|
40
|
+
} | {
|
|
41
|
+
ok: false;
|
|
42
|
+
error: string;
|
|
43
|
+
}>;
|
|
44
|
+
abort(): void;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 取(或建)一个供应商的后台检测器。同一路由永远同一个实例,所以页签来回
|
|
49
|
+
* 挂载不会把队列弄丢。
|
|
50
|
+
* @param route - 供应商的设置键。
|
|
51
|
+
*/
|
|
52
|
+
export declare function fingerprintRunner(route: string): FingerprintRunner;
|
|
53
|
+
/**
|
|
54
|
+
* 测试接缝:给一条路由换上传输实现。传 undefined 恢复真实传输。
|
|
55
|
+
* @param route - 供应商的设置键。
|
|
56
|
+
* @param sender - 假的传输。
|
|
57
|
+
*/
|
|
58
|
+
export declare function setFingerprintSender(route: string, sender: FingerprintSender | undefined): void;
|
|
59
|
+
/** 页面要走了:把所有还在跑的掐掉。已落盘的不撤。 */
|
|
60
|
+
export declare function teardownFingerprintRunners(): void;
|
|
61
|
+
export { readFingerprints };
|
package/lib/client/index.d.ts
CHANGED
|
@@ -42,6 +42,12 @@
|
|
|
42
42
|
*/
|
|
43
43
|
import type { ClientContext } from './types.js';
|
|
44
44
|
import { STORE_NS } from '../constants.js';
|
|
45
|
+
/**
|
|
46
|
+
* Floor between two pushed-invalidation refreshes. The host's document
|
|
47
|
+
* notifications are its own, and some of them are echoes of work this plugin
|
|
48
|
+
* just did; without a floor the echo never lets the page settle.
|
|
49
|
+
*/
|
|
50
|
+
export declare const REFRESH_MIN_INTERVAL_MS = 200;
|
|
45
51
|
import { type BreKey } from './locales.ts';
|
|
46
52
|
/** Stable plugin id, matching the cordis.patch.yml row and the bundle id. */
|
|
47
53
|
export declare const name = "dsh-model-think-level";
|
|
@@ -6,11 +6,10 @@
|
|
|
6
6
|
* differences the create card forces. First, there is no route to key the
|
|
7
7
|
* list by — the id is being typed, and the drafts wait in the session ledger
|
|
8
8
|
* (`staged-keys`) for the route the card's own 保存 declares — so the list is
|
|
9
|
-
* the draft pane (`create-keys-pane`), not the host-backed one. Second,
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* draft row it becomes.
|
|
9
|
+
* the draft pane (`create-keys-pane`), not the host-backed one. Second, the
|
|
10
|
+
* official box keeps what the user typed into it: the create card is a FORM,
|
|
11
|
+
* and its own 保存 is what stores the provider's first key. The list below is
|
|
12
|
+
* for adding further keys, and lands once the route is declared.
|
|
14
13
|
*
|
|
15
14
|
* The field keeps the edit card's managed-field handover: `bre-key-managed`
|
|
16
15
|
* stands the official input down (the list below says the same thing once per
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The provider editor's segmented control
|
|
2
|
+
* The provider editor's segmented control
|
|
3
|
+
* (供应商配置 / 模型配置 / 指纹检测 / 高级配置).
|
|
3
4
|
*
|
|
4
5
|
* This is the bar the editor-tabs pass drives. It lives HERE, in the plugin's
|
|
5
6
|
* own React subtree, rather than being built by the pass and inserted into the
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
*
|
|
47
47
|
* @module dsh-model-think-level/client/injection/editor-tabs
|
|
48
48
|
*/
|
|
49
|
-
declare const TAB_IDS: readonly ["provider", "models", "advanced"];
|
|
49
|
+
declare const TAB_IDS: readonly ["provider", "models", "fingerprint", "advanced"];
|
|
50
50
|
/** A tab id, as both the bar and the card attribute spell it. */
|
|
51
51
|
export type EditorTabId = (typeof TAB_IDS)[number];
|
|
52
52
|
/** The tab ids, in display order, for the tab-bar component. */
|
|
@@ -75,6 +75,16 @@ export declare function createEditorTabsState(): EditorTabsState;
|
|
|
75
75
|
* other.
|
|
76
76
|
*/
|
|
77
77
|
export declare function editorCardOf(element: Element | null): HTMLElement | null;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the card a mount sits in is the one CREATING a provider.
|
|
80
|
+
*
|
|
81
|
+
* One rule for the two callers that need it — this pass (which refuses the
|
|
82
|
+
* fingerprint tab there) and the fingerprint pane (which refuses to render
|
|
83
|
+
* there at all). A card still choosing what to be must not offer to
|
|
84
|
+
* fingerprint what it is not yet, and the check is about the card, never about
|
|
85
|
+
* whether the draft happens to have an id typed in.
|
|
86
|
+
*/
|
|
87
|
+
export declare function isCreateProviderCard(element: Element | null): boolean;
|
|
78
88
|
/**
|
|
79
89
|
* The part of a card that presents its editor.
|
|
80
90
|
*
|
|
@@ -69,6 +69,18 @@ export interface KeyRevealDeps {
|
|
|
69
69
|
* how a takeover that has moved on (a provider whose key field is gone) drops
|
|
70
70
|
* the affordance it no longer needs.
|
|
71
71
|
*/
|
|
72
|
+
/**
|
|
73
|
+
* Mark a field's key input without giving it an eye.
|
|
74
|
+
*
|
|
75
|
+
* The official page already draws its own reveal button INSIDE the API-key box
|
|
76
|
+
* (`position: absolute; inset: 1px 1px 1px auto`) whenever the box holds text,
|
|
77
|
+
* so on the add-provider form — where there is no stored credential for an eye
|
|
78
|
+
* to fetch anyway — a second button hanging under the field was pure redundancy
|
|
79
|
+
* drawn twice (user item 9). The mark is still worth making: it is what keeps
|
|
80
|
+
* the input findable after the official toggle unmasks it, so the key list below
|
|
81
|
+
* survives the click.
|
|
82
|
+
*/
|
|
83
|
+
export declare function markKeyField(field: HTMLElement): void;
|
|
72
84
|
export declare function revealKeyField(field: HTMLElement, deps: KeyRevealDeps): void;
|
|
73
85
|
/** Undo {@link revealKeyField}: drop the button, the class, the marker, and
|
|
74
86
|
* re-mask the input, leaving the official field exactly as it was rendered. */
|
|
@@ -176,6 +176,10 @@ export interface EditorMountProps {
|
|
|
176
176
|
* DOM, never a kernel version.
|
|
177
177
|
*/
|
|
178
178
|
officialInputTypes?: boolean;
|
|
179
|
+
/** The card reports whether it still covers the official capacity and
|
|
180
|
+
* input-type fields: it does while its thinking switch is on, and steps
|
|
181
|
+
* aside when the switch turns the card off. */
|
|
182
|
+
onCoverageChange?: (covered: boolean) => void;
|
|
179
183
|
api: EffortEditorApi;
|
|
180
184
|
readOnly: boolean;
|
|
181
185
|
t: (key: string, params?: Record<string, string | number>) => string;
|
|
@@ -446,7 +450,18 @@ export declare function hideOfficialReasoning(container: HTMLElement): void;
|
|
|
446
450
|
*/
|
|
447
451
|
export declare function showOfficialReasoning(container: HTMLElement): void;
|
|
448
452
|
/**
|
|
449
|
-
*
|
|
453
|
+
* Stand the official context-window / max-output labels and the input-types
|
|
454
|
+
* fieldset down for a row whose editor renders those same decisions.
|
|
455
|
+
*
|
|
456
|
+
* Only DIRECT children of the disclosure are touched: the editor's own inputs
|
|
457
|
+
* (and its own modality pills) live inside `.bre-effort-slot`, which carries
|
|
458
|
+
* neither class stem. The marker attribute distinguishes this hide from one the
|
|
459
|
+
* host wrote itself, exactly like {@link hideOfficialReasoning}.
|
|
460
|
+
*/
|
|
461
|
+
export declare function hideOfficialCapacityChrome(container: HTMLElement): void;
|
|
462
|
+
/** Hand the official capacity/input-type chrome back when the editor goes. */
|
|
463
|
+
export declare function showOfficialCapacityChrome(container: HTMLElement): void;
|
|
464
|
+
/** The official input-types checkbox an image verdict belongs to, or undefined
|
|
450
465
|
* when this row ships no such control (a legacy kernel) — or ships one whose
|
|
451
466
|
* boxes cannot be told apart.
|
|
452
467
|
*
|
|
@@ -617,6 +632,72 @@ export interface ScreenModel {
|
|
|
617
632
|
export declare function adaptEveryModel(state: ScanState, deps: InjectorDeps, route: string, visibleRows?: readonly ScreenModel[]): Promise<AutoAdaptReport>;
|
|
618
633
|
/** Restore anchoring and remove every live re-pin window's frame and listeners. */
|
|
619
634
|
export declare function releaseModelListRepins(): void;
|
|
635
|
+
/**
|
|
636
|
+
* Hold one card's viewport position while its content changes height.
|
|
637
|
+
*
|
|
638
|
+
* Growing a card below the header makes the browser's scroll anchoring keep a
|
|
639
|
+
* node near the GROWING part visually stable, which walks the card's header —
|
|
640
|
+
* and everything above it — up the viewport. Suppressing anchoring for the
|
|
641
|
+
* duration and re-pinning the card's top every frame turns that into the card
|
|
642
|
+
* growing DOWNWARD instead.
|
|
643
|
+
*
|
|
644
|
+
* The card does not reach its final height at once, which is what a
|
|
645
|
+
* stability-bounded loop got wrong: the official React commit renders the
|
|
646
|
+
* disclosure container on the click, and this plugin's editor mounts a
|
|
647
|
+
* debounced scan later through an async render. Measured on the live page with
|
|
648
|
+
* the settings list scrolled to its end, the first change lands in the click's
|
|
649
|
+
* own frame and the second ~100ms later: a loop that stopped three stable
|
|
650
|
+
* frames after the click (~50ms) had already handed anchoring back, and the
|
|
651
|
+
* second change then walked the card 587px up the viewport.
|
|
652
|
+
*
|
|
653
|
+
* So the window is TIME-bounded, and a window that is still watching the card
|
|
654
|
+
* grow is pushed out to {@link REPIN_QUIET_MS} past the last change it saw — it
|
|
655
|
+
* releases when the growth STOPS, not when a fixed guess says it should have.
|
|
656
|
+
* {@link REPIN_MAX_MS} bounds that.
|
|
657
|
+
*
|
|
658
|
+
* The window stands down early on two conditions, both of which mean the
|
|
659
|
+
* measurement it is working from is no longer valid: the USER scrolled (their
|
|
660
|
+
* scroll must not be fought), or the card left the document (React replaced
|
|
661
|
+
* it — a detached box measures 0, and correcting against that would throw the
|
|
662
|
+
* view somewhere arbitrary).
|
|
663
|
+
*
|
|
664
|
+
* "The user scrolled" is read from their INPUT — a wheel, a touch, a pointer
|
|
665
|
+
* press or a scrolling key — and NOT from the scroll offset, which is the one
|
|
666
|
+
* thing the page itself also moves: the browser clamps it when a card above
|
|
667
|
+
* collapses, and this loop moves it on purpose. Watching the offset called
|
|
668
|
+
* every one of those a user scroll and abandoned the pin, which is exactly
|
|
669
|
+
* what opening a provider card needs: one official editor at a time means the
|
|
670
|
+
* card that was open closes in the same commit, the content above the clicked
|
|
671
|
+
* row shrinks by the closing editor's height, and the row has to be held where
|
|
672
|
+
* the user left it rather than walk off the top of the view.
|
|
673
|
+
*
|
|
674
|
+
* The correction itself adds the delta to the offset because the offset and the
|
|
675
|
+
* viewport are inverse: a card that has moved DOWN the screen (a positive
|
|
676
|
+
* delta) is brought back by scrolling DOWN the document, and one that has moved
|
|
677
|
+
* up by scrolling up. Subtracting it — as this did while the suppression was
|
|
678
|
+
* doing all the work and the delta was always 0 — drives the card the wrong way
|
|
679
|
+
* whenever the page really did move it.
|
|
680
|
+
*/
|
|
681
|
+
/**
|
|
682
|
+
* Let a growing card keep its place on screen without the browser buying the
|
|
683
|
+
* growth back.
|
|
684
|
+
*
|
|
685
|
+
* User item 1: opening 添加供应商 makes three things taller at once — the
|
|
686
|
+
* official page opens the first provider's editor above the new card, the
|
|
687
|
+
* create-card pass adds the tab bar, and the card's own key list lands a moment
|
|
688
|
+
* later. Scroll anchoring answers any of those by scrolling the page by the
|
|
689
|
+
* height that grew, which reads as the new card jumping and shoving the
|
|
690
|
+
* configured provider above it upward. Anchoring is switched off for a short
|
|
691
|
+
* window instead: no scroll write of ours, no compensation by the browser, and
|
|
692
|
+
* the card simply extends downward.
|
|
693
|
+
*
|
|
694
|
+
* Unlike {@link pinCardTop} this never writes a scroll offset — it only stops
|
|
695
|
+
* the browser from writing one — so it cannot fight a pin that is already
|
|
696
|
+
* running, and it releases itself on the same deadline a mount pin uses.
|
|
697
|
+
* @param node - an element whose ancestors' scroll containers should hold still.
|
|
698
|
+
* @param windowMs - how long to hold them still.
|
|
699
|
+
*/
|
|
700
|
+
export declare function suppressScrollAnchoring(node: HTMLElement, windowMs?: number): void;
|
|
620
701
|
/**
|
|
621
702
|
* Hand a viewport delta back to whichever container actually moved the card.
|
|
622
703
|
*
|
|
@@ -39,6 +39,8 @@ interface ProviderCardOccurrence {
|
|
|
39
39
|
export type ProviderCardSlotProps = ProviderCardOccurrence & {
|
|
40
40
|
api: RemoteApi;
|
|
41
41
|
t: Translate;
|
|
42
|
+
/** The client root, so the fingerprint pane can subscribe to document edits. */
|
|
43
|
+
ctx?: ClientContext;
|
|
42
44
|
};
|
|
43
45
|
/**
|
|
44
46
|
* The occurrence component: resolve this card's route, render the editor with
|
|
@@ -46,7 +48,7 @@ export type ProviderCardSlotProps = ProviderCardOccurrence & {
|
|
|
46
48
|
* itself with the official editor. Exported for its own tests (the registration
|
|
47
49
|
* below is the production path).
|
|
48
50
|
*/
|
|
49
|
-
export declare function ProviderCardSlot({ provider, api, t }: ProviderCardSlotProps): ReactNode;
|
|
51
|
+
export declare function ProviderCardSlot({ provider, api, t, ctx }: ProviderCardSlotProps): ReactNode;
|
|
50
52
|
/**
|
|
51
53
|
* Take the provider-card seat.
|
|
52
54
|
* @param ctx - client root context (its `slots` service registers the seat).
|
package/lib/client/locales.d.ts
CHANGED
|
@@ -33,11 +33,14 @@ export declare const en: {
|
|
|
33
33
|
contextWindowLabel: string;
|
|
34
34
|
maxTokensLabel: string;
|
|
35
35
|
capacityBlank: string;
|
|
36
|
+
capacityUnitsHint: string;
|
|
36
37
|
capacityRule: string;
|
|
37
38
|
tokensUnit: string;
|
|
38
39
|
inputModality: string;
|
|
39
40
|
modalityImage: string;
|
|
40
41
|
modalityInherit: string;
|
|
42
|
+
modalityDeclared: string;
|
|
43
|
+
capacityInherit: string;
|
|
41
44
|
clearDeclaration: string;
|
|
42
45
|
confidence_high: string;
|
|
43
46
|
confidence_medium: string;
|
|
@@ -49,6 +52,7 @@ export declare const en: {
|
|
|
49
52
|
wireValue: string;
|
|
50
53
|
wireShow: string;
|
|
51
54
|
wireHide: string;
|
|
55
|
+
wireHint: string;
|
|
52
56
|
reasoningDisabled: string;
|
|
53
57
|
bareHint: string;
|
|
54
58
|
defaultRiskDisabled: string;
|
|
@@ -74,6 +78,7 @@ export declare const en: {
|
|
|
74
78
|
tagVision: string;
|
|
75
79
|
tagThinking: string;
|
|
76
80
|
sliderNoCurrent: string;
|
|
81
|
+
sliderCommitSlow: string;
|
|
77
82
|
defaultEffortLabel: string;
|
|
78
83
|
defaultEffortUnset: string;
|
|
79
84
|
defaultEffortHint: string;
|
|
@@ -87,6 +92,32 @@ export declare const en: {
|
|
|
87
92
|
editorTabProvider: string;
|
|
88
93
|
editorTabModels: string;
|
|
89
94
|
editorTabAdvanced: string;
|
|
95
|
+
editorTabFingerprint: string;
|
|
96
|
+
fpTitle: string;
|
|
97
|
+
fpIntro: string;
|
|
98
|
+
fpCount: string;
|
|
99
|
+
fpSummary: string;
|
|
100
|
+
fpSummaryNone: string;
|
|
101
|
+
fpRunning: string;
|
|
102
|
+
fpDetectAll: string;
|
|
103
|
+
fpDetect: string;
|
|
104
|
+
fpRetest: string;
|
|
105
|
+
fpRetry: string;
|
|
106
|
+
fpCost: string;
|
|
107
|
+
fpForget: string;
|
|
108
|
+
fpStateUnchecked: string;
|
|
109
|
+
fpStateRunning: string;
|
|
110
|
+
fpStateIdentified: string;
|
|
111
|
+
fpStateDoubtful: string;
|
|
112
|
+
fpStateFailed: string;
|
|
113
|
+
fpQueued: string;
|
|
114
|
+
fpEvidence: string;
|
|
115
|
+
fpFamily: string;
|
|
116
|
+
fpCandidates: string;
|
|
117
|
+
fpClosedSet: string;
|
|
118
|
+
fpCheckedAt: string;
|
|
119
|
+
fpLoadFailed: string;
|
|
120
|
+
fpRunFailed: string;
|
|
90
121
|
keyRevealShow: string;
|
|
91
122
|
keyRevealHide: string;
|
|
92
123
|
keyRevealFailed: string;
|
|
@@ -160,6 +191,7 @@ export declare const en: {
|
|
|
160
191
|
headersSave: string;
|
|
161
192
|
headersCancel: string;
|
|
162
193
|
headersClear: string;
|
|
194
|
+
headersRemove: string;
|
|
163
195
|
headersSaved: string;
|
|
164
196
|
headersCleared: string;
|
|
165
197
|
headersReadOnly: string;
|
package/lib/client/ops.d.ts
CHANGED
|
@@ -52,6 +52,10 @@ export declare function nameOf(models: Record<string, unknown>[], modelId: strin
|
|
|
52
52
|
* must degrade to "no default", never poison the memory chain.
|
|
53
53
|
*/
|
|
54
54
|
export declare function defaultEffortOf(models: Record<string, unknown>[], modelId: string): string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Forget the cached listings (a settings change can move a route's endpoint).
|
|
57
|
+
*/
|
|
58
|
+
export declare function invalidateProbeCache(): void;
|
|
55
59
|
/**
|
|
56
60
|
* Build the write seam over a settings Remote face.
|
|
57
61
|
* @param api - the settings Remote methods.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded reaction to pushed invalidations.
|
|
3
|
+
*
|
|
4
|
+
* The settings host does not send one "the document changed" per change: it
|
|
5
|
+
* emits `settings/document-updated` per entry, and it emits again whenever a
|
|
6
|
+
* `describe()` observes the serialized document move. Anything a refresh does
|
|
7
|
+
* -- a scan's describe, an idle fill's write -- can therefore come back as
|
|
8
|
+
* another notification. A client that runs one refresh per notification has an
|
|
9
|
+
* unbounded feedback loop, and the renderer starves: opening the Models page
|
|
10
|
+
* froze the entire DSH exactly this way.
|
|
11
|
+
*
|
|
12
|
+
* This turns a burst into ONE refresh and caps the rate however chatty the host
|
|
13
|
+
* becomes. The cost is that a change is noticed at most a beat later; the gain
|
|
14
|
+
* is that the page always settles.
|
|
15
|
+
*/
|
|
16
|
+
/** The face the push handlers drive. */
|
|
17
|
+
export interface RefreshScheduler {
|
|
18
|
+
/** Ask for a refresh. Cheap, idempotent, and safe from inside a refresh. */
|
|
19
|
+
schedule: () => void;
|
|
20
|
+
/** Cancel any pending refresh and stop accepting new ones. */
|
|
21
|
+
dispose: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build a coalescing, rate-limited scheduler around one `refresh` unit of work.
|
|
25
|
+
* @param refresh - the work to run; called at most once per interval.
|
|
26
|
+
* @param minIntervalMs - floor between two runs.
|
|
27
|
+
* @returns the {@link RefreshScheduler} face.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createRefreshScheduler(refresh: () => void, minIntervalMs: number): RefreshScheduler;
|