@dmh2002/dsh-connect-qoder 0.0.0-stage → 0.4.0
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/CHANGELOG.md +428 -0
- package/LICENSE +21 -0
- package/README.en.md +266 -0
- package/README.md +265 -2
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/cordis.patch.yml +12 -0
- package/docs/DESIGN.md +153 -0
- package/docs/PAT.md +181 -0
- package/docs/assets/dsh-connect-qoder-composer-credits.png +0 -0
- package/docs/assets/dsh-connect-qoder-model-management.png +0 -0
- package/docs/assets/dsh-connect-qoder-model-picker.png +0 -0
- package/docs/assets/dsh-connect-qoder-usage-card.png +0 -0
- package/icons/dsh-connect-qoder-128.png +0 -0
- package/icons/dsh-connect-qoder-64.png +0 -0
- package/lib/bin.d.ts +26 -0
- package/lib/bin.js +219 -0
- package/lib/client.js +4872 -0
- package/lib/host-heartbeat-BNuj6Lt_.js +1985 -0
- package/lib/index.d.ts +126 -0
- package/lib/index.js +3093 -0
- package/lib/status-paths-w2WDUPVS.js +218 -0
- package/lib/transfer-CUNaVvmi.js +172 -0
- package/package.json +135 -4
- package/screenshots.json +6 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
//#region src/upstream.d.ts
|
|
4
|
+
type QoderRegion = 'cn' | 'global';
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/catalog.d.ts
|
|
7
|
+
interface QoderModelInfo {
|
|
8
|
+
key: string;
|
|
9
|
+
displayName: string;
|
|
10
|
+
/** 积分倍率(模型名内嵌 `· xN.NN`)。 */
|
|
11
|
+
priceFactor: number;
|
|
12
|
+
/** 原生输入窗口(由 context_config 首档或 max_input_tokens 决定)。 */
|
|
13
|
+
contextWindow: number;
|
|
14
|
+
maxOutputTokens: number;
|
|
15
|
+
supportsImages: boolean;
|
|
16
|
+
supportsThinking: boolean;
|
|
17
|
+
/** 可完全关闭思考(thinking_config.disabled 存在)。 */
|
|
18
|
+
canDisableThinking: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 上游声明的思考强度档位(`thinking_config.enabled.efforts` 的键,按强度
|
|
21
|
+
* 升序)。不存在时该模型没有可选档位,卡片不渲染这一项。
|
|
22
|
+
*
|
|
23
|
+
* 实测 Qoder 的档位名不统一:Qwen 系用 `low / medium / xhigh`,DeepSeek/GLM
|
|
24
|
+
* 用 `low / high / max`——所以只做展示,不做跨模型比较。上游给出的键序也不
|
|
25
|
+
* 可靠(JSON 里可能先出现 `xhigh`),必须按语义排序后再显示。
|
|
26
|
+
*/
|
|
27
|
+
thinkingEfforts?: string[];
|
|
28
|
+
/** 上游标为默认的档位(`efforts[x].is_default`)。 */
|
|
29
|
+
defaultThinkingEffort?: string;
|
|
30
|
+
isDefault: boolean;
|
|
31
|
+
isFree: boolean;
|
|
32
|
+
isNew: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 网关声明可用的上下文档位(`context_config` 各项的 token_count,升序)。
|
|
35
|
+
* 不存在时无档位可选,卡片不渲染预算选择器。
|
|
36
|
+
*/
|
|
37
|
+
contextTiers?: number[];
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/status-paths.d.ts
|
|
41
|
+
/**
|
|
42
|
+
* The project's public repository.
|
|
43
|
+
*
|
|
44
|
+
* Lives here rather than beside one component because TWO sections link to it
|
|
45
|
+
* — the model section and the account pool — and a second copy of a URL is a
|
|
46
|
+
* second thing to forget when it moves. Node-free and side-effect free, so it
|
|
47
|
+
* costs nothing on the Host side either.
|
|
48
|
+
*/
|
|
49
|
+
declare const QODER_GITHUB_URL = "https://github.com/dingminhua/dsh-connect-qoder";
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/version.d.ts
|
|
52
|
+
/**
|
|
53
|
+
* Package version, injected at build time by `tsdown.config.ts`.
|
|
54
|
+
*
|
|
55
|
+
* 参考:dsh-connect-workbuddy(MIT)——版本由构建期 define 注入,而非
|
|
56
|
+
* 运行时读 package.json(发布包只含 lib/,不含可解析的 package.json 路径)。
|
|
57
|
+
*
|
|
58
|
+
* @module dsh-connect-qoder/version
|
|
59
|
+
*/
|
|
60
|
+
/** The npm package version this build was produced from. */
|
|
61
|
+
declare const QODER_CONNECT_VERSION: string;
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/index.d.ts
|
|
64
|
+
declare const name = "dsh-connect-qoder";
|
|
65
|
+
/** The model registry and settings service required before providers register. */
|
|
66
|
+
declare const inject: string[];
|
|
67
|
+
/** The namespace the HOST actually serves this plugin under (workbuddy probe). */
|
|
68
|
+
declare function settingsNamespaceOf(ctx: unknown): string;
|
|
69
|
+
declare function asVolatile<T>(schema: z<T>): z<T>;
|
|
70
|
+
/** Unwrap a schemastery volatile's reactive `.get()` into a plain snapshot. */
|
|
71
|
+
declare function unwrapVolatile<T>(value: T): T;
|
|
72
|
+
interface Config {
|
|
73
|
+
regions: Record<string, unknown>;
|
|
74
|
+
}
|
|
75
|
+
declare const Config: z<Config>;
|
|
76
|
+
/**
|
|
77
|
+
* 一份目录是否**声明了**思考档位。
|
|
78
|
+
*
|
|
79
|
+
* 「一个模型都没有档位」有两种完全不同的含义,必须分开:
|
|
80
|
+
* 1. 上游当前没声明(`thinkingEfforts` 字段缺席或为空)—— 那它是「上游没
|
|
81
|
+
* 档位」的诚实答案;
|
|
82
|
+
* 2. 这份目录来自一次没拉到档位的时刻 —— 本机实测 14 个 cn 模型的
|
|
83
|
+
* `thinkingEfforts` 全是 `[]`,是旧 schema 把字段剥掉时的产物。用它当答案,
|
|
84
|
+
* 卡片就不渲染档位选择器(用户实拍「思考强度有时候有、有时候没有」:点一次
|
|
85
|
+
* 「从 Qoder 刷新」就有,重启后就没)。
|
|
86
|
+
*
|
|
87
|
+
* 两种情况从数据上分不开(空数组与缺席都判「没声明」),要不要重拉由**目录的
|
|
88
|
+
* 来源**决定:调用方只在「本进程还没成功拉到实时目录」时才据此触发重拉(见
|
|
89
|
+
* displayModels)—— 实时目录没档位是上游的诚实答案,重拉多少次都一样。
|
|
90
|
+
*
|
|
91
|
+
* 判据用 `length > 0` 而不是「字段在不在」:旧 schema 留下的是**空数组**而不是
|
|
92
|
+
* 缺席,所以「字段在」恰恰不能作为「声明过」的证据。
|
|
93
|
+
*/
|
|
94
|
+
declare function catalogSnapshotDeclaresEfforts(models: readonly {
|
|
95
|
+
thinkingEfforts?: readonly string[];
|
|
96
|
+
}[]): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* 「手上的目录能不能当档位答案」——**判据与动作打包在一起**。
|
|
99
|
+
*
|
|
100
|
+
* 拆开成两个函数(判据一个、调用处自己判)会留下一条没被测试覆盖的接线:把调用处
|
|
101
|
+
* 变异掉,单测仍然全绿(第一版就是这么自我欺骗的)。这里让规则自己执行动作并
|
|
102
|
+
* 返回结论,于是「动作有没有真的发生」也能被断言。
|
|
103
|
+
*
|
|
104
|
+
* 检测到「一个档位都没声明」时**不改动要服务的模型列表**:模型不能从卡片上
|
|
105
|
+
* 消失,缺的只是档位 —— 后台拉回来之后的下一次读取自然补上。返回 `stale`
|
|
106
|
+
* 标记这次调用有没有触发过拉取。
|
|
107
|
+
*/
|
|
108
|
+
declare function serveSavedCatalog(models: readonly QoderModelInfo[], onStale: () => void): {
|
|
109
|
+
models: readonly QoderModelInfo[];
|
|
110
|
+
stale: boolean;
|
|
111
|
+
};
|
|
112
|
+
/** 某区域的配置状态(缺省返回空对象)。 */
|
|
113
|
+
declare function regionStateOf(config: {
|
|
114
|
+
regions?: Record<string, unknown> | null;
|
|
115
|
+
}, region: QoderRegion): Record<string, unknown>;
|
|
116
|
+
/** 某区域是否启用(opt-out)。 */
|
|
117
|
+
declare function regionEnabled(config: {
|
|
118
|
+
regions?: Record<string, unknown> | null;
|
|
119
|
+
}, region: QoderRegion): boolean;
|
|
120
|
+
/** 某区域是否配置了凭据(设置 PAT 或环境变量其一)。 */
|
|
121
|
+
declare function regionHasCredential(config: {
|
|
122
|
+
regions?: Record<string, unknown> | null;
|
|
123
|
+
}, region: QoderRegion): boolean;
|
|
124
|
+
declare function apply(ctx: Context, config: Config): void;
|
|
125
|
+
//#endregion
|
|
126
|
+
export { Config, QODER_CONNECT_VERSION, QODER_GITHUB_URL, apply, asVolatile, catalogSnapshotDeclaresEfforts, inject, name, regionEnabled, regionHasCredential, regionStateOf, serveSavedCatalog, settingsNamespaceOf, unwrapVolatile };
|