@jayyuen66/dsh-dir-prep-organize 0.1.0 → 0.1.1
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 +7 -0
- package/README.md +24 -123
- package/README.zh-CN.md +112 -0
- package/THIRD_PARTY_NOTICES.md +52 -0
- package/client.js +43 -22
- package/host.js +261 -735
- package/package.json +65 -33
- package/templates.data.mjs +687 -0
- package/types/host.d.ts +392 -0
- package/types/src/client-entry.d.ts +87 -0
- package/types/src/default-templates.generated.d.ts +3 -0
- package/types/src/group-labels.generated.d.ts +2 -0
- package/types/src/host-messages.d.ts +96 -0
- package/types/src/templates.d.ts +72 -0
- package/types/src/ui-messages.d.ts +199 -0
- package/agents/integrations/README.md +0 -174
- package/agents/integrations/aider/README.md +0 -38
- package/agents/integrations/antigravity/README.md +0 -49
- package/agents/integrations/claude-code/README.md +0 -31
- package/agents/integrations/cursor/README.md +0 -55
- package/agents/integrations/gemini-cli/README.md +0 -40
- package/agents/integrations/github-copilot/README.md +0 -32
- package/agents/integrations/mcp-memory/README.md +0 -79
- package/agents/integrations/mcp-memory/backend-architect-with-memory.md +0 -247
- package/agents/integrations/mcp-memory/setup.sh +0 -74
- package/agents/integrations/openclaw/README.md +0 -34
- package/agents/integrations/opencode/README.md +0 -62
- package/agents/integrations/trae/README.md +0 -108
- package/agents/integrations/windsurf/README.md +0 -26
package/types/host.d.ts
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import Schema from "@deepseek-ai/schemastery";
|
|
3
|
+
import type { Context, Volatile } from "@deepseek-ai/cordis";
|
|
4
|
+
import type { AgentDefaultModelConfig } from "@deepseek-ai/dsh-agent-default-model";
|
|
5
|
+
import type { FileSystem } from "@deepseek-ai/dsh-fs";
|
|
6
|
+
import type { GenerateOptions, LlmRuntime, Message, StreamChunk } from "@deepseek-ai/dsh-llm";
|
|
7
|
+
import type { SessionHeader, SessionId } from "@deepseek-ai/dsh-session";
|
|
8
|
+
import type { HostMessages } from "./src/host-messages.js";
|
|
9
|
+
import type { TemplateEntry } from "./src/templates.js";
|
|
10
|
+
/**
|
|
11
|
+
* 从 import 到的模块命名空间里取出内置精选模板表;形状不对就抛。
|
|
12
|
+
*
|
|
13
|
+
* 说明符是变量 ⇒ import() 的返回类型退化成 any,所以这一步必须自己验形状:产物发错、发旧、
|
|
14
|
+
* 或被别的构建覆盖,症状都会是「模板下拉空着」,而带原因的报错比一张空列表好定位得多。
|
|
15
|
+
* 提成纯函数是为了能脱离磁盘与模块缓存单测它——产物 URL 一旦被加载过就进了 Node 的 ESM
|
|
16
|
+
* 缓存,改磁盘上的内容对后续 import 是无效的。
|
|
17
|
+
*
|
|
18
|
+
* @param raw - import 得到的模块命名空间
|
|
19
|
+
* @returns 内置精选模板表
|
|
20
|
+
*/
|
|
21
|
+
export declare function defaultTemplatesFrom(raw: unknown): readonly TemplateEntry[];
|
|
22
|
+
/**
|
|
23
|
+
* 内置精选模板表(85 条):按需载入,永不静态导入。
|
|
24
|
+
*
|
|
25
|
+
* 静态导入会让这 85 条模板随宿主载入插件一起进内存,而它们只有一个消费者——default-templates
|
|
26
|
+
* 端点,而客户端本来就是首次打开下拉时才拉这一发。两边都按需,才是同一件事的同一口径。
|
|
27
|
+
*
|
|
28
|
+
* @returns 内置精选模板表
|
|
29
|
+
*/
|
|
30
|
+
export declare function loadDefaultTemplates(): Promise<readonly TemplateEntry[]>;
|
|
31
|
+
/**
|
|
32
|
+
* 把一个部署来的数夹进 `[min, max]`,非有限值回落到 `fallback`。
|
|
33
|
+
*
|
|
34
|
+
* 为什么单独要一个函数:`Math.min(Math.max(NaN, 1), MAX)` 的结果是 `NaN`——两个 clamp
|
|
35
|
+
* 都会把 NaN 原样放过去,于是「看起来夹过了」的代码对最危险的那个输入恰好无效。
|
|
36
|
+
*
|
|
37
|
+
* @param value - 待夹的数(可能非有限)
|
|
38
|
+
* @param min - 下界(含)
|
|
39
|
+
* @param max - 上界(含)
|
|
40
|
+
* @param fallback - `value` 非有限时用的默认值
|
|
41
|
+
* @returns `[min, max]` 区间内的整数
|
|
42
|
+
*/
|
|
43
|
+
export declare function clampInt(value: number, min: number, max: number, fallback: number): number;
|
|
44
|
+
/** 目标的官方形状直接 re-export(`targetKey` 就此是官方 `FsTargetKey` 品牌,不再降级成 string)。 */
|
|
45
|
+
export type { FsDirEntry, FsTarget } from "@deepseek-ai/dsh-fs";
|
|
46
|
+
/**
|
|
47
|
+
* 官方 `FileSystem`(installed @deepseek-ai/dsh-fs/lib/types/index.d.ts:61,cordis `Service`
|
|
48
|
+
* 子类 → 名义比较)的方法面投影:本包只用 `resolve`(:94) / `listDir`(:208) / `readText`(:162)。
|
|
49
|
+
* 旧镜像漏抄了官方那三位的可选 `signal?: AbortSignal` 形参(抄本里没有的形参在 TS 里
|
|
50
|
+
* 是"少收一个参数",调用点不会报错,但真实宿主多一档取消语义);投影之后它回到官方形状。
|
|
51
|
+
*/
|
|
52
|
+
export type FsService = Pick<FileSystem, "resolve" | "listDir" | "readText" | "contains">;
|
|
53
|
+
/**
|
|
54
|
+
* 本包从会话消息史的读取面 = **官方 `Message` 的键名投影**(installed
|
|
55
|
+
* @deepseek-ai/dsh-llm/lib/types/message.d.ts:124-133 `MessageBase` 与各变体的 `role`),
|
|
56
|
+
* 三位各自取到"本包能凭运行时守卫负责的那一档":
|
|
57
|
+
* - `role` 就此是官方 `Message['role']` 的字面量联合(上游加/改角色即在此编译不过,
|
|
58
|
+
* 下面 `role === "user" || role === "assistant"` 的判定跟着动)。
|
|
59
|
+
* - `content` 官方是 `readonly ContentBlock[]`(message.d.ts:128),但本包的职责是
|
|
60
|
+
* **逐块自证**:只认 `type==='text'` 且 `text` 是字符串的块(`isTextBlock`),其余
|
|
61
|
+
* (tool-call / reasoning / image / 宿主新版本才有的块)一律跳过。这里留 `unknown`
|
|
62
|
+
* 不是"抹平官方形状",而是本包**不假设交付**:`Array.isArray(msg.content)` 那道判据
|
|
63
|
+
* 断言的正是"交来的可能根本不是数组",test/host.test.ts 的「坏形状」用例钉的就是
|
|
64
|
+
* 非数组 content(字符串)与数组里的裸字符串/null 项。把值域收成官方联合等于宣称
|
|
65
|
+
* "块形状可信",那几条用例便无法表达,而为了过类型删用例是本仓红线。
|
|
66
|
+
* - `source.kind` 官方是 `MessageSourceMap` 的值联合(installed message.d.ts:101-108 只有
|
|
67
|
+
* `user`/`model`/`tool`/`system-prompt`,宿主安装里另有 `model-selection` 一枚由
|
|
68
|
+
* dsh-agent 自己 merge)。**本包要读的恰是这张表里没有的 kind**:真人过滤之外的
|
|
69
|
+
* `agent-instructions` / `skill-catalog` / `memory-recall-step` / `plugin:<name>` 全是
|
|
70
|
+
* 别的插件在自己模块里 merge 进来的 producer kind,不在本包的编译程序里。收成官方闭合联合
|
|
71
|
+
* 只有两条路:要么在测试里伪造宿主声明(type theater),要么把"过滤注入"这几条用例删掉
|
|
72
|
+
* ——两条都不接受,故 kind 留 `string`。真人的判据仍是官方那两枚值(`"user"`/`"model"`),
|
|
73
|
+
* 写成 `source?.kind === "user"` 而不是比字符串常量表。
|
|
74
|
+
* 键名一个都不重述:官方给 `MessageBase` 换名,这里立刻红。
|
|
75
|
+
*/
|
|
76
|
+
export interface DerivedMessageView {
|
|
77
|
+
readonly role?: Message["role"];
|
|
78
|
+
readonly content?: unknown;
|
|
79
|
+
readonly source?: {
|
|
80
|
+
readonly kind?: string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 本包读到的会话面 = 官方 `Session` 两位成员的**边界投影**(installed
|
|
85
|
+
* @deepseek-ai/dsh-session/lib/types/index.d.ts:`readonly header: SessionHeader` :118、
|
|
86
|
+
* `deriveMessages(): Message[]` :292)。
|
|
87
|
+
* 键名一律借自官方(`header` 借 `Session`、`cwd` 借 `SessionHeader`,installed
|
|
88
|
+
* @deepseek-ai/dsh-llm 域内 types.d.ts:69 `readonly cwd?: string`),值域收成"本包真的读的那位
|
|
89
|
+
* + 可缺失":官方把 header/deriveMessages 记成必选成员,但那句承诺说的是宿主自己 `new`
|
|
90
|
+
* 出来的 Session;跨进程递来的会话是否具备某位只能运行时判(见 `extractSessionConversation`
|
|
91
|
+
* 的 `typeof session.deriveMessages !== "function"` 与 `cwdOfSession` 的 `typeof === "string"`
|
|
92
|
+
* 守卫)。官方类型说宿主**承诺**什么,守卫说**交付**什么,两者并存。
|
|
93
|
+
*/
|
|
94
|
+
export interface SessionLike {
|
|
95
|
+
readonly header?: Partial<Pick<SessionHeader, "cwd">>;
|
|
96
|
+
readonly deriveMessages?: () => readonly DerivedMessageView[];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* `Context.sessions`(官方 `SessionStore`,installed @deepseek-ai/dsh-session/lib/types/
|
|
100
|
+
* index.d.ts:26-28)的 `get` 一位(:436 `get(id: SessionId): Session | undefined`)在本包的
|
|
101
|
+
* 读法:入参就此是官方品牌的 `SessionId`(边界上递来的是裸 string,构造口只有文件头那枚
|
|
102
|
+
* `brandString<SessionId>`),返回值域换成上面的 `SessionLike` 投影——直接取官方返回的整枚
|
|
103
|
+
* `Session` 类会把名义类一路渗进本包(`private log`/`surfaceManager`,:105-107),那三道运行时
|
|
104
|
+
* 守卫当场在编译器眼里变成死代码,而它们挡的是真实输入。返回 `undefined` 与官方一致。
|
|
105
|
+
* 口径同 danger-guard/host.ts 的 `GuardExecution`(借键名、值域换投影)。
|
|
106
|
+
*/
|
|
107
|
+
export interface SessionsService {
|
|
108
|
+
get: (id: SessionId) => SessionLike | undefined;
|
|
109
|
+
}
|
|
110
|
+
/** `ReasoningEffortId` 取官方真品牌(`Branded<'ReasoningEffortId'>`,以 dsh-brand 的
|
|
111
|
+
* `unique symbol` 为键)。原先本地重述成 `string & { effortBrand: ... }` 是**假品牌**:
|
|
112
|
+
* 键不同名即不同型,宿主真值塞不进来、任何带该属性的字符串反倒能通过,注释里那句
|
|
113
|
+
* 「转换点为 0」并不成立。取官方类型后模型选择与 stream 入参两侧共用同一真值。 */
|
|
114
|
+
export type { ReasoningEffortId } from "@deepseek-ai/dsh-llm";
|
|
115
|
+
/** 默认模型选择直接取官方成员的返回形状(`AgentDefaultModelConfig.currentSelection()`
|
|
116
|
+
* 的返回类型,installed @deepseek-ai/dsh-agent-default-model/lib/types/index.d.ts:41)。
|
|
117
|
+
* 旧镜像自己抄了 `{ provider, model, reasoningEffort? }` 三位——其中 `reasoningEffort` 是
|
|
118
|
+
* `ReasoningEffortId` 品牌(本文件上面已按官方 re-export),抄本一旦与官方漂开,
|
|
119
|
+
* 品牌值塞不进 stream 入参就是静默丢字段。取 ReturnType 之后本包不再裁定它的形状。 */
|
|
120
|
+
export type ModelSelection = ReturnType<AgentDefaultModelConfig["currentSelection"]>;
|
|
121
|
+
/** 官方 `AgentDefaultModelConfig`(同文件 :24,cordis `Service` 子类 → 名义比较)的
|
|
122
|
+
* 方法面投影:本包只 `currentSelection()`(:41),不写回(`saveSelection` :48 归 composer)。 */
|
|
123
|
+
export type AgentDefaultModel = Pick<AgentDefaultModelConfig, "currentSelection">;
|
|
124
|
+
/** 文本块与 request-only user 输入均取官方声明:`TextBlock` 与 `RequestUserInput`
|
|
125
|
+
* (后者的 `content` 真值是 `UserMessage["content"]` 全块集,`id`/`source` 是
|
|
126
|
+
* `?: never`——本包只发单条 user 文本消息,形状由官方约束而不是自己抄一半)。 */
|
|
127
|
+
export type { RequestUserInput, TextBlock } from "@deepseek-ai/dsh-llm";
|
|
128
|
+
/** 流块与终态取官方判别联合(`switch (chunk.type)` 即收窄载荷,不再把 `type` 写成
|
|
129
|
+
* 裸 `string` + 全可选成员)。 */
|
|
130
|
+
export type { FinishReason, StreamChunk } from "@deepseek-ai/dsh-llm";
|
|
131
|
+
/** stream 入参:官方 `GenerateOptions` 的本包用到的子集。此前这里在 `Pick` 之外**另加**
|
|
132
|
+
* 了一枚 `signal?: AbortSignal`,注释写着"本包附加的取消位"——官方其实**就有**这一位
|
|
133
|
+
* (installed @deepseek-ai/dsh-llm/lib/types/types.d.ts:494),另写一次等于凭空多出一个
|
|
134
|
+
* 与官方并行的形状声明;现在连同 `signal` 一起 `Pick`,一处来源。 */
|
|
135
|
+
export type LlmStreamOptions = Pick<GenerateOptions, "provider" | "model" | "reasoningEffort" | "messages" | "system" | "signal">;
|
|
136
|
+
/** 官方 `LlmRuntime`(`Context.llm` 的类型,installed @deepseek-ai/dsh-llm/lib/types/
|
|
137
|
+
* index.d.ts:29-31)的方法面投影:本包只 `stream`。旧镜像把返回抄成
|
|
138
|
+
* `AsyncIterable<StreamChunk>`——官方那一位的真实返回域由成员自己交出,重述一次就多一处
|
|
139
|
+
* 会漂移的判决(`stream` 在 installed index.d.ts 上有数枚同名成员,本包用的是 runtime 那枚)。 */
|
|
140
|
+
export type LlmService = Pick<LlmRuntime, "stream">;
|
|
141
|
+
export interface DirEntry {
|
|
142
|
+
name: string;
|
|
143
|
+
isDir: boolean;
|
|
144
|
+
sizeBytes: number;
|
|
145
|
+
/** 关键文本文件首段摘要;非关键文件/目录为 undefined。 */
|
|
146
|
+
snippet: string | undefined;
|
|
147
|
+
}
|
|
148
|
+
/** 静默丢数据的记账(审计修复:原先"读失败即 undefined、超限即忽略"完全没有
|
|
149
|
+
* 回执,界面与 host 都显示成功)。dir context 与 import 两端点共用此形状。 */
|
|
150
|
+
export interface SkipCounts {
|
|
151
|
+
/** 字节超限、整份跳过的文件数。 */
|
|
152
|
+
tooLarge: number;
|
|
153
|
+
/** 读取失败(含 EMFILE / 权限 / 非 UTF-8)的文件数。 */
|
|
154
|
+
unreadable: number;
|
|
155
|
+
/** 只在更深一层、被扫描深度限制造漏掉的 .md 数(仅导入端点用)。 */
|
|
156
|
+
deeper: number;
|
|
157
|
+
/** 读到了但解析不出角色 name(非角色文件)而被跳过的文件数(仅导入端点用)。 */
|
|
158
|
+
unnamed: number;
|
|
159
|
+
}
|
|
160
|
+
export interface CollectResult {
|
|
161
|
+
cwd: string;
|
|
162
|
+
entries: DirEntry[];
|
|
163
|
+
/** 有任一文件被跳过即为 true(不再硬编码 false)。 */
|
|
164
|
+
truncated: boolean;
|
|
165
|
+
skipped: SkipCounts;
|
|
166
|
+
error?: string;
|
|
167
|
+
}
|
|
168
|
+
/** host 路由实际用的收集函数:fs 服务 → DirEntry[](含关键文件全文摘要)。
|
|
169
|
+
* 条目数不设上限(用户拍板),但单文件按 MAX_SNIPPET_BYTES 整份跳过、
|
|
170
|
+
* 读取按 READ_CONCURRENCY 有界并发;跳过项计入 skipped 并让 truncated 反映事实。
|
|
171
|
+
* 回执文案取自注入的字典(纯函数不读设置)。 */
|
|
172
|
+
export interface DirScanLimits {
|
|
173
|
+
/** 单文件摘要字节上限(超出整份跳过)。 */
|
|
174
|
+
maxSnippetBytes: number;
|
|
175
|
+
/** 有界并发读取度。 */
|
|
176
|
+
readConcurrency: number;
|
|
177
|
+
/** 单次收集的全部摘要的字节总量上限。 */
|
|
178
|
+
maxTotalBytes?: number;
|
|
179
|
+
}
|
|
180
|
+
/** 路由层实际用的 limits 全集。 */
|
|
181
|
+
type RouteLimits = DirScanLimits & {
|
|
182
|
+
organizeTimeoutMs: number;
|
|
183
|
+
importBodyMaxBytes: number;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* 部署值的唯一收口:把会致命的几个数夹进安全区间,再交给路由。
|
|
187
|
+
*
|
|
188
|
+
* 为什么放在这里而不是各消费点:`limitsOf()` 是全部五个路由读 limits 的**唯一入口**
|
|
189
|
+
* (context/organize/importAgent 都经它),一处收口就不会漏掉将来新增的路由;而散在
|
|
190
|
+
* 各消费点夹,哪天新增一个调用点就等于新增一个漏洞。
|
|
191
|
+
*
|
|
192
|
+
* 夹哪两个、为什么:
|
|
193
|
+
* - `readConcurrency` → `[1, 64]`。**下界 0 是致命的**:`mapBounded` 拿到 0 会无限
|
|
194
|
+
* 自递归直到 OOM,**整个 DSH 宿主进程被带走**,而不只是这一次请求失败(见 mapBounded
|
|
195
|
+
* 的注释)。schema 的 `natural()` 下界恰好是 0 且无上界,两个方向都得夹。
|
|
196
|
+
* - `organizeTimeoutMs` → `[1, 2^31-1]`。上界超了会被 `setTimeout` 静默夹成 1 ms,
|
|
197
|
+
* 「调大超时」变成「立刻失败」。
|
|
198
|
+
*
|
|
199
|
+
* 另外两个(`maxSnippetBytes`/`importBodyMaxBytes`)**故意不夹**:schema 已经挡住
|
|
200
|
+
* NaN/±Infinity/负数/小数,唯一还能配出来的越界值 `0` 各自有确定且已记账的行为
|
|
201
|
+
* (前者「全跳过且计 tooLarge」,后者「413」),那是用户的显式意图,不该被悄悄改写。
|
|
202
|
+
*
|
|
203
|
+
* @param limits - 未经夹位的部署值
|
|
204
|
+
* @returns 两项关键值已夹位、其余原样透传的新对象
|
|
205
|
+
*/
|
|
206
|
+
export declare function sanitizeLimits(limits: RouteLimits): RouteLimits;
|
|
207
|
+
export declare function collectDirContext(fs: Pick<FsService, "resolve" | "listDir" | "readText">, cwd: string | undefined, messages: HostMessages, limits?: DirScanLimits): Promise<CollectResult>;
|
|
208
|
+
export interface ImportResult {
|
|
209
|
+
entries: TemplateEntry[];
|
|
210
|
+
truncated: boolean;
|
|
211
|
+
skipped: SkipCounts;
|
|
212
|
+
error?: string;
|
|
213
|
+
}
|
|
214
|
+
export declare function importPathError(requested: string, cwd: string | undefined, allowRoots: readonly string[], messages: HostMessages): string | undefined;
|
|
215
|
+
/** 收集导入模板条目(纯逻辑,注入假 fs 可测;单文件/目录两路)。
|
|
216
|
+
* 目录路径扫描两层(顶层 *.md + 一层子目录 *.md),排序固定保证确定性;
|
|
217
|
+
* 第三层不扫描但**清点**(deeper 计数),读失败/超限/非角色同样计数回报,
|
|
218
|
+
* truncated 反映"确实有东西没进来",不再硬编码 false。
|
|
219
|
+
* skipPolicy 用于内置角色库自检(AGENTS_DIR 是策略里的允许根,用户输入路径正常
|
|
220
|
+
* 不需要它;保留这个开关只为让"内置全量导入"不依赖安装位置是否命中隐藏段判断)。
|
|
221
|
+
* allowRoots = 设置 importAllowRoots 登记的额外允许目录(由路由注入)。 */
|
|
222
|
+
export declare function collectAgentTemplates(fs: Pick<FsService, "resolve" | "listDir" | "readText" | "contains">, requested: string, cwd: string | undefined, messages: HostMessages, opts?: {
|
|
223
|
+
skipPolicy?: boolean;
|
|
224
|
+
allowRoots?: readonly string[];
|
|
225
|
+
limits?: DirScanLimits;
|
|
226
|
+
}): Promise<ImportResult>;
|
|
227
|
+
export interface OrganizeInput {
|
|
228
|
+
prompt: string;
|
|
229
|
+
cwd: string;
|
|
230
|
+
entriesSummary?: string;
|
|
231
|
+
/** 会话最近对话文本(user/assistant 交替,host 侧从 deriveMessages 提取)。 */
|
|
232
|
+
recentTurns?: string;
|
|
233
|
+
/** 参考角色上下文(提炼自模板正文;可选)。提供时整理以其角色视角重写需求。 */
|
|
234
|
+
roleText?: string;
|
|
235
|
+
model?: ModelSelection;
|
|
236
|
+
}
|
|
237
|
+
/** 构造 system 提示(导出供测试)。规则正文与各段标题全部取自注入的字典——
|
|
238
|
+
* 面向模型的 prompt 也随官方 locale 偏好切语言,zh 输出与迁移前逐字一致。 */
|
|
239
|
+
export declare function buildOrganizeSystem(input: Omit<OrganizeInput, "prompt">, messages: HostMessages): string;
|
|
240
|
+
/**
|
|
241
|
+
* user 消息 = 草稿 + 围栏起来的不可信数据块。
|
|
242
|
+
*
|
|
243
|
+
* 围栏用**成对的定界标记**而不是缩进或横线:模型侧最容易被无视的是「看起来像普通内容」
|
|
244
|
+
* 的标记,而 `</data>` 这种成对标签既显眼、又难以由数据自身伪造(数据里出现的
|
|
245
|
+
* `</data>` 会被当作提前闭合,后续内容重新落回指令位——所以围栏内容仍按纯文本处理,
|
|
246
|
+
* 不做任何解析或转义)。
|
|
247
|
+
*
|
|
248
|
+
* @param prompt - 真正的用户草稿
|
|
249
|
+
* @param input - 其余上下文(摘要/历史/角色)
|
|
250
|
+
* @param messages - 注入的字典
|
|
251
|
+
* @returns 交给模型的那条 user 文本
|
|
252
|
+
*/
|
|
253
|
+
export declare function buildOrganizeUser(prompt: string, input: Omit<OrganizeInput, "prompt">, messages: HostMessages): string;
|
|
254
|
+
/**
|
|
255
|
+
* 会话最近真人对话提取(deriveMessages → "user:/assistant:" 文本串)。
|
|
256
|
+
* 不设条数/字符上限(用户拍板不截断:上下文完整性优先,模型
|
|
257
|
+
* context 超限由模型报错提示用户自行处理)。
|
|
258
|
+
*
|
|
259
|
+
* 注入过滤(隐藏 bug 复查 实测确认:真实会话 log 里 user 角色
|
|
260
|
+
* 混有大量框架注入——agent-instructions / skill-catalog / 插件自己的
|
|
261
|
+
* `plugin:<条目 id>`(本体系即 plugin:auto-recall / -step / -subagent),
|
|
262
|
+
* 这些都不带 source.kind==='user',内容也不该进指代解析):
|
|
263
|
+
* - role==='user' 且 source.kind==='user' → 真人输入,保留
|
|
264
|
+
* - role==='assistant' 且 source.kind==='model' → 模型回复,保留
|
|
265
|
+
* - 其余(注入类 user 消息 / tool-result 消息 / 空消息)全部跳过——
|
|
266
|
+
* 注入内容会污染指代解析、把记忆库全文带给 LLM。
|
|
267
|
+
* - 每条消息只取 text block(tool-call/reasoning/image 块跳过)。 */
|
|
268
|
+
export declare function extractRecentTurns(messages: readonly DerivedMessageView[]): string;
|
|
269
|
+
/** 流式聚合 text-delta 为完整文本;终态非 stop 视为失败(失败文本取自注入字典)。 */
|
|
270
|
+
export declare function drainStreamToText(stream: AsyncIterable<StreamChunk>, messages: HostMessages): Promise<string>;
|
|
271
|
+
/** 整理入口(host 路由调用;导出供测试注入假 stream)。失败文案与 system 提示都来自
|
|
272
|
+
* 注入的字典,本函数不读设置。 */
|
|
273
|
+
export declare function runOrganize(llm: LlmService, input: OrganizeInput, messages: HostMessages, timeoutMs?: number, callerSignal?: AbortSignal): Promise<{
|
|
274
|
+
content: string;
|
|
275
|
+
}>;
|
|
276
|
+
/** settings 命名空间与 loader 行 config 共用同一 schema(单源,防漂移)。
|
|
277
|
+
* 值名退避为 configSchema:避免与同名 interface Config 触发 no-redeclare;
|
|
278
|
+
* 外部仍以 `Config` 名导入(export as),公开 API 不变。
|
|
279
|
+
* 写入校验由 dsh-settings 在持久化前按此 schema 完成;两个字段都必须 `.volatile()`
|
|
280
|
+
* ——没有任何 volatile 字段的条目会被宿主 describe() 整条跳过
|
|
281
|
+
* (packages/settings/settings/src/index.ts:308-309),设置卡读不到、写入则抛
|
|
282
|
+
* `has no volatile fields`(:386)。
|
|
283
|
+
*
|
|
284
|
+
* 旧 `settings.register(ns, Config, { base })` 的 base 底座取消,逐字段落到 `.default(...)`:
|
|
285
|
+
* - importAllowRoots:`.default([])`。**空表是策略不是缺省占位**——登记目录是用户的
|
|
286
|
+
* 显式信任动作,除会话 cwd 与内置角色库外默认不放行任何绝对路径(fail-closed,
|
|
287
|
+
* 见 importPathError);
|
|
288
|
+
* - templates:**标 volatile、不给默认**。内置精选集(scripts/gen-defaults.mjs 从
|
|
289
|
+
* agents/ 角色库生成的 src/default-templates.generated.ts,~640 KB)由 **host 半**
|
|
290
|
+
* 持有、经 default-templates 端点按需下发,client 拉到后作回落:⚠ 不给默认**不等于**读回 undefined——schemastery 对 array 字段把缺失
|
|
291
|
+
* 值 cast 成 `[]`(实测 `configSchema["~standard"].validate({})` 之后 `templates` 引用
|
|
292
|
+
* `.get() === []`),宿主 describe() 又只丢 undefined 位(index.ts:141-147 projectForm),
|
|
293
|
+
* 所以「未设置」递到客户端看到的就是一张空表。回落判据因此落在 client 半
|
|
294
|
+
* (client-entry.ts 的 `fromSettings`:空表按未设置处理),设置卡「恢复默认」=
|
|
295
|
+
* `unset("templates")` 且复读空值按已回落处理,故「缺失」「空表」「内置」三者同义。
|
|
296
|
+
* 写成 `.default(...)` 会让宿主每次 describe() 都重新序列化这 640 KB(index.ts:313 对
|
|
297
|
+
* `JSON.stringify([uid, schema.toJSON(), entry.options.config])` 取指纹,schema.ts:24
|
|
298
|
+
* 的 plainSchema 保留 meta.default),所以内置集不进 schema、由 host 半端点按需下发;而既然空表就是
|
|
299
|
+
* 「未设置」的运行时形状,回落判据仍由 client 半出。 */
|
|
300
|
+
declare const configShape: {
|
|
301
|
+
templates: Schema<NoInfer<({
|
|
302
|
+
id?: string | null;
|
|
303
|
+
name?: string | null;
|
|
304
|
+
description?: string | null;
|
|
305
|
+
text?: string | null;
|
|
306
|
+
group?: string | null;
|
|
307
|
+
emoji?: string | null;
|
|
308
|
+
} & import("@deepseek-ai/cosmokit").Dict)[]>, NoInfer<Schemastery.ObjectT<NoInfer<{
|
|
309
|
+
id: Schema<string, string, "plain">;
|
|
310
|
+
name: Schema<string, string, "plain">;
|
|
311
|
+
description: Schema<string, string, "defined">;
|
|
312
|
+
text: Schema<string, string, "plain">;
|
|
313
|
+
group: Schema<string, string, "defined">;
|
|
314
|
+
emoji: Schema<string, string, "defined">;
|
|
315
|
+
}>>[]>, "volatile">;
|
|
316
|
+
importAllowRoots: Schema<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
|
|
317
|
+
organizeTimeoutMs: Schema<number, number, "volatile-defined">;
|
|
318
|
+
maxSnippetBytes: Schema<number, number, "defined">;
|
|
319
|
+
readConcurrency: Schema<number, number, "defined">;
|
|
320
|
+
importBodyMaxBytes: Schema<number, number, "defined">;
|
|
321
|
+
};
|
|
322
|
+
declare const configSchema: ReturnType<typeof Schema.object<typeof configShape>>;
|
|
323
|
+
/** cordis 校验过 configSchema 后交进 apply 的那份配置:volatile 字段以 Volatile 引用
|
|
324
|
+
* 形态进来,读当前值一律 `.get()`(改设置不必重挂载插件)。
|
|
325
|
+
* ⚠ templates 的形参写 `| undefined` 只是留口:实测**未设置时 `.get()` 给的是 `[]`**
|
|
326
|
+
* (schemastery 对 array 的 cast,见上方 configSchema 注释),而 host 半从不读这一位
|
|
327
|
+
* (它只把 schema 交给设置卡),回落由 client 半判。 */
|
|
328
|
+
export interface Config {
|
|
329
|
+
templates: Volatile<TemplateEntry[] | undefined>;
|
|
330
|
+
importAllowRoots: Volatile<string[]>;
|
|
331
|
+
/** LLM 整理中止时限(volatile:客户端经 configForms 快照同源读取)。 */
|
|
332
|
+
organizeTimeoutMs: Volatile<number>;
|
|
333
|
+
/** 关键文件摘要的单文件字节上限(超出整份跳过)。 */
|
|
334
|
+
maxSnippetBytes: number;
|
|
335
|
+
/** 目录扫描/读取的有界并发度。 */
|
|
336
|
+
readConcurrency: number;
|
|
337
|
+
/** organize/import POST body 的物理字节上限(内存防爆纵深防御)。 */
|
|
338
|
+
importBodyMaxBytes: number;
|
|
339
|
+
}
|
|
340
|
+
export { configSchema as Config };
|
|
341
|
+
/** volatile 引用读出的值 → importAllowRoots 字符串列表(纯函数,测试锁死)。
|
|
342
|
+
* 引用背后可能是存量脏配置:非数组一律空表(fail-closed),非字符串/纯空白项逐个
|
|
343
|
+
* 丢弃——绝不能把非字符串塞进路径校验,也不能让空串变成"允许 process.cwd()"。 */
|
|
344
|
+
export declare function importAllowRootsOf(raw: unknown): string[];
|
|
345
|
+
/** 注入的服务面:webServer + settings 为硬依赖(cordis 等两者就绪才 apply)。
|
|
346
|
+
* 0.1.7 起命名空间是隐式的(= 本条目在 cordis.patch.yml 里的裸 id,可编辑字段取自
|
|
347
|
+
* 导出的 Config),所以 settings 不再是「注册的前提」而是「页面策略(configure)与
|
|
348
|
+
* 跨命名空间读(describe)」的载体;设置页只派发「host 已 serve 的命名空间 ∩
|
|
349
|
+
* settings.plugin.item 卡」(dsh-client-ui-settings-plugins 源码语义),configure 必须
|
|
350
|
+
* 发生在 apply 期,故仍硬注入。sessions/fs/llm/agentDefaultModel 仍可选读。 */
|
|
351
|
+
export declare const inject: string[];
|
|
352
|
+
/** 路由处理器的可测提取:apply 用 ctx.get 的惰性 getter 调用(服务可能在
|
|
353
|
+
* 路由注册后才就绪),测试直接注入静态假服务 + 假 req/res 驱动。
|
|
354
|
+
* csrf 为 per-apply 令牌:context/model GET 下发,organize POST 回填校验。 */
|
|
355
|
+
export interface RouteDeps {
|
|
356
|
+
sessions?: () => SessionsService | undefined;
|
|
357
|
+
fs?: () => FsService | undefined;
|
|
358
|
+
llm?: () => LlmService | undefined;
|
|
359
|
+
agentDefaultModel?: () => AgentDefaultModel | undefined;
|
|
360
|
+
/** 设置里登记的额外导入允许根(每次请求现读,改设置无需重启)。 */
|
|
361
|
+
importAllowRoots?: () => readonly string[];
|
|
362
|
+
/** 部署值(Config 化):整理超时 / 摘要字节上限 / 读取并发。
|
|
363
|
+
* 缺省回落原模块常量(与 schema .default 同值)——测试与旧调用方不必逐一改。 */
|
|
364
|
+
limits?: () => RouteLimits;
|
|
365
|
+
/** 内置精选模板表的取数口。缺省走按需 import 产物;测试替掉它即可覆盖载入失败那条回执,
|
|
366
|
+
* 而不必去改磁盘上那份产物(它的 URL 一旦被加载过就进了 Node 的 ESM 缓存,改了也没用)。 */
|
|
367
|
+
loadDefaultTemplates?: () => Promise<readonly TemplateEntry[]>;
|
|
368
|
+
}
|
|
369
|
+
/** 路由 handler 形状(本包自己的路由表投影)。官方 `WebRoute["handler"]` 的返回是
|
|
370
|
+
* `void | Promise<void>`(installed `@deepseek-ai/dsh-host-webserver/lib/types/index.d.ts:38`),
|
|
371
|
+
* dispatcher 侧写成 `await route.handler(req, res)`(installed lib/index.js:235)——
|
|
372
|
+
* await 对同步返回同样成立,而外层 `handle` 本身是 async,故同步抛与 reject 在调用方
|
|
373
|
+
* 观察上等价:**没有调用方依赖 handler 返回 promise**。于是投影按实现拆成两枚,
|
|
374
|
+
* 让 createRouteHandlers 的返回值继续自证——确有 await 的三枚是 AsyncRouteHandler,
|
|
375
|
+
* 纯同步的两枚是 SyncRouteHandler,不再为凑类型套假 async。 */
|
|
376
|
+
export type SyncRouteHandler = (req: IncomingMessage, res: ServerResponse) => void;
|
|
377
|
+
export type AsyncRouteHandler = (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
378
|
+
/** 回执字典的现读 getter:每个请求取一次,用户在「设置 → 常规」改语言后下一个请求即
|
|
379
|
+
* 切文案(不重启、不加插件自己的 locale 设置项;与 importAllowRoots 的现读同构)。 */
|
|
380
|
+
export type MessagesOf = () => HostMessages;
|
|
381
|
+
export declare function createRouteHandlers(deps: RouteDeps, csrf: string, messagesOf: MessagesOf, servingNonLoopback?: boolean): {
|
|
382
|
+
defaults: AsyncRouteHandler;
|
|
383
|
+
context: AsyncRouteHandler;
|
|
384
|
+
model: SyncRouteHandler;
|
|
385
|
+
organize: AsyncRouteHandler;
|
|
386
|
+
importAgent: AsyncRouteHandler;
|
|
387
|
+
};
|
|
388
|
+
/** host apply:登记设置页策略 + 四个 webServer 路由(全在 effect 内,卸载即注销)。
|
|
389
|
+
* 0.1.7 起模板设置是**隐式注册**的(导出的 Config + 字段上的 .volatile()),本函数
|
|
390
|
+
* 不再向 settings 注册任何东西;配置值由 cordis 校验并填过默认后按 volatile 引用交进来
|
|
391
|
+
* (第二参数 config),读当前值一律 `.get()`。 */
|
|
392
|
+
export declare function apply(ctx: Context, config: Config): void;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { TemplateEntry } from "./templates.js";
|
|
2
|
+
import type { LocaleNs, Translate } from "./ui-messages.js";
|
|
3
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
4
|
+
import type { BuiltInLocaleId } from "@deepseek-ai/dsh-client-locale/client";
|
|
5
|
+
import type { InputActions, InputState } from "@deepseek-ai/dsh-client-ui-conversation/client";
|
|
6
|
+
import type { SlotRegistry } from "@deepseek-ai/dsh-client-ui-renderer/client";
|
|
7
|
+
import type { LocaleDictOf } from "@deepseek-ai/dsh-client-ui-slots";
|
|
8
|
+
import type { ConfigForm } from "@deepseek-ai/dsh-client-ui-settings/client";
|
|
9
|
+
declare const NS: LocaleNs;
|
|
10
|
+
export interface DirEntryView {
|
|
11
|
+
name: string;
|
|
12
|
+
isDir: boolean;
|
|
13
|
+
sizeBytes: number;
|
|
14
|
+
snippet?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ContextResponse {
|
|
17
|
+
ok: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
csrf?: string;
|
|
20
|
+
cwd?: string;
|
|
21
|
+
truncated?: boolean;
|
|
22
|
+
entries?: DirEntryView[];
|
|
23
|
+
}
|
|
24
|
+
export interface ImportSkips {
|
|
25
|
+
tooLarge: number;
|
|
26
|
+
unreadable: number;
|
|
27
|
+
deeper: number;
|
|
28
|
+
unnamed: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function formatImportSkips(t: Translate, skips: ImportSkips | undefined): string;
|
|
31
|
+
export declare function formatContextSummary(resp: ContextResponse): string;
|
|
32
|
+
export type BuiltinPhase = "idle" | "loading" | "ready" | "error";
|
|
33
|
+
export interface BuiltinState {
|
|
34
|
+
phase: BuiltinPhase;
|
|
35
|
+
list: readonly TemplateEntry[];
|
|
36
|
+
error: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function builtinTemplatesSnapshot(): BuiltinState;
|
|
39
|
+
export declare function loadBuiltinTemplates(): Promise<BuiltinState>;
|
|
40
|
+
export declare function subscribeBuiltinTemplates(listener: () => void): () => void;
|
|
41
|
+
export declare function resetBuiltinTemplates(): void;
|
|
42
|
+
export type EntryForm = ConfigForm<Record<string, unknown>>;
|
|
43
|
+
export interface TemplatesSnapshot {
|
|
44
|
+
templates: readonly TemplateEntry[];
|
|
45
|
+
fromSettings: boolean;
|
|
46
|
+
builtinPhase: BuiltinPhase;
|
|
47
|
+
builtinError: string;
|
|
48
|
+
allowRoots: readonly string[];
|
|
49
|
+
ready: boolean;
|
|
50
|
+
writable: boolean;
|
|
51
|
+
organizeTimeoutMs: number | undefined;
|
|
52
|
+
}
|
|
53
|
+
export interface PersistedView {
|
|
54
|
+
ready: boolean;
|
|
55
|
+
revision: number;
|
|
56
|
+
templates: readonly TemplateEntry[];
|
|
57
|
+
allowRoots: readonly string[];
|
|
58
|
+
}
|
|
59
|
+
export declare function rawOrganizeTimeoutMsOf(value: Record<string, unknown>): number | undefined;
|
|
60
|
+
export declare function persistError(t: Translate, persisted: Pick<PersistedView, "ready" | "revision" | "templates">, expected: readonly TemplateEntry[], action: string, opts?: {
|
|
61
|
+
treatEmptyAsReverted?: boolean;
|
|
62
|
+
}): string | undefined;
|
|
63
|
+
export declare function rootsPersistError(t: Translate, persisted: Pick<PersistedView, "ready" | "revision" | "allowRoots">, expected: readonly string[], action: string): string | undefined;
|
|
64
|
+
export declare function applyTemplateToDraft(current: string, template: string): string;
|
|
65
|
+
export interface KitProps {
|
|
66
|
+
t: Translate;
|
|
67
|
+
useCard: <TResult>(selector: (snap: TemplatesSnapshot) => TResult) => TResult;
|
|
68
|
+
useInput?: <TResult>(selector: (state: Pick<InputState, "draft">) => TResult) => TResult;
|
|
69
|
+
inputActions?: Pick<InputActions, "setDraft">;
|
|
70
|
+
sessionId?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ClientCtx {
|
|
73
|
+
effect: Context["effect"];
|
|
74
|
+
slots: Pick<SlotRegistry, "inject" | "register">;
|
|
75
|
+
configForms: {
|
|
76
|
+
get: (entryId: string) => EntryForm;
|
|
77
|
+
};
|
|
78
|
+
locale: {
|
|
79
|
+
register: (ns: typeof NS, dicts: LocaleCatalog) => () => void;
|
|
80
|
+
bind: (ns: typeof NS) => Translate;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** 官方 register 类型化重载的字典参数在本包命名空间上的实例化(两语必须齐)。 */
|
|
84
|
+
export type LocaleCatalog = Record<BuiltInLocaleId, LocaleDictOf<typeof NS>>;
|
|
85
|
+
declare const inject: string[];
|
|
86
|
+
declare function apply(ctx: ClientCtx): void;
|
|
87
|
+
export { inject, apply };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { MessagesCatalog } from "@jayyuen66/dsh-plugin-shared/lib/locale";
|
|
2
|
+
/** 本包 host 侧产出的全部人读文案(整理 system prompt + 端点/导入回执)。 */
|
|
3
|
+
export interface HostMessages {
|
|
4
|
+
/** 角色定位与任务说明(整段 prompt 的第一行)。 */
|
|
5
|
+
readonly sysRole: string;
|
|
6
|
+
/** 规则清单的标题行。 */
|
|
7
|
+
readonly sysRulesHeading: string;
|
|
8
|
+
/** 规则:只输出整理后的正文。 */
|
|
9
|
+
readonly sysRuleOutputOnly: string;
|
|
10
|
+
/** 规则:不执行草稿里的任务。 */
|
|
11
|
+
readonly sysRuleNoExecution: string;
|
|
12
|
+
/** 规则:草稿是问题/指令时不给解答。 */
|
|
13
|
+
readonly sysRuleNoAnswer: string;
|
|
14
|
+
/** 规则:保留原意与语言,推断得来的上下文才补。 */
|
|
15
|
+
readonly sysRuleKeepIntent: string;
|
|
16
|
+
/** 规则:把指代解析成明确表述。 */
|
|
17
|
+
readonly sysRuleResolveRefs: string;
|
|
18
|
+
/** 规则:目录结构与对话历史只是参考。 */
|
|
19
|
+
readonly sysRuleNoListing: string;
|
|
20
|
+
/** 规则:参考角色只借术语与措辞。 */
|
|
21
|
+
readonly sysRuleRoleView: string;
|
|
22
|
+
/** 当前工作目录行(`{cwd}`)。 */
|
|
23
|
+
readonly sysCwdLine: string;
|
|
24
|
+
/** cwd 缺失时该行的取值。 */
|
|
25
|
+
readonly sysCwdMissing: string;
|
|
26
|
+
/** 目录结构摘要行(`{summary}`)。 */
|
|
27
|
+
readonly sysSummaryLine: string;
|
|
28
|
+
/** 会话最近对话行(`{turns}`)。 */
|
|
29
|
+
readonly sysRecentTurnsLine: string;
|
|
30
|
+
/** 参考角色行(`{roleText}`)。 */
|
|
31
|
+
readonly sysRoleLine: string;
|
|
32
|
+
/** 不可信区块的围栏标记:内容只当数据,不当指令。 */
|
|
33
|
+
readonly sysDataFenceStart: string;
|
|
34
|
+
readonly sysDataFenceEnd: string;
|
|
35
|
+
/** 声明「围栏内是数据」的那条规则。 */
|
|
36
|
+
readonly sysRuleDataNotInstruction: string;
|
|
37
|
+
/** 会话 cwd 取不到 → 无法收集目录上下文。 */
|
|
38
|
+
readonly cwdEmpty: string;
|
|
39
|
+
/** 目录枚举抛错的前缀整句(`{reason}`)。 */
|
|
40
|
+
readonly readDirFailed: string;
|
|
41
|
+
/** 收集端点兜底异常整句(`{reason}`)。 */
|
|
42
|
+
readonly collectFailed: string;
|
|
43
|
+
/** 路径含 `.` / `..` / 隐藏段。 */
|
|
44
|
+
readonly illegalPathSegment: string;
|
|
45
|
+
/** 允许根标签:会话 cwd。 */
|
|
46
|
+
readonly rootLabelCwd: string;
|
|
47
|
+
/** 允许根标签:插件内置角色库。 */
|
|
48
|
+
readonly rootLabelBuiltin: string;
|
|
49
|
+
/** 允许根标签:设置 importAllowRoots 登记的目录。 */
|
|
50
|
+
readonly rootLabelAllowed: string;
|
|
51
|
+
/** 越界整句:点名允许区并回显解析后的路径(`{zones}`、`{absolute}`)。 */
|
|
52
|
+
readonly outsideRoots: string;
|
|
53
|
+
/** 越界整句里各允许区的分隔符。 */
|
|
54
|
+
readonly zoneSeparator: string;
|
|
55
|
+
/** 空串/纯空白路径。 */
|
|
56
|
+
readonly emptyImportPath: string;
|
|
57
|
+
/** 相对路径但拿不到会话 cwd。 */
|
|
58
|
+
readonly relativeNeedsCwd: string;
|
|
59
|
+
/** 单文件导入:frontmatter 里没有 name。 */
|
|
60
|
+
readonly missingRoleName: string;
|
|
61
|
+
/** 导入过程抛错的前缀整句(`{reason}`)。 */
|
|
62
|
+
readonly importFailed: string;
|
|
63
|
+
/** 导入端点兜底异常整句(`{reason}`)。 */
|
|
64
|
+
readonly importException: string;
|
|
65
|
+
/** 导入路由:path 字段不是字符串。 */
|
|
66
|
+
readonly importPathNotString: string;
|
|
67
|
+
/** 导入路由:path 只含空白字符。 */
|
|
68
|
+
readonly importPathBlank: string;
|
|
69
|
+
/** 模型流里没有 finish 块。 */
|
|
70
|
+
readonly missingFinishChunk: string;
|
|
71
|
+
/** 终态非 stop(`{reason}`)。 */
|
|
72
|
+
readonly streamNotFinished: string;
|
|
73
|
+
/** 终态带 failure 信息时的 `{reason}` 形状(`{kind}`、`{message}`)。 */
|
|
74
|
+
readonly failureReason: string;
|
|
75
|
+
/** 草稿为空。 */
|
|
76
|
+
readonly emptyPrompt: string;
|
|
77
|
+
/** 没有可用的模型选择。 */
|
|
78
|
+
readonly noModelSelected: string;
|
|
79
|
+
/** 模型返回空白。 */
|
|
80
|
+
readonly emptyOrganizeResult: string;
|
|
81
|
+
/** 请求体读到了但不是 JSON。 */
|
|
82
|
+
readonly invalidJsonBody: string;
|
|
83
|
+
/** fs 服务未就绪。 */
|
|
84
|
+
readonly fsUnavailable: string;
|
|
85
|
+
/** sessions 里查不到该会话。 */
|
|
86
|
+
readonly cwdUnknown: string;
|
|
87
|
+
/** agentDefaultModel 服务未就绪。 */
|
|
88
|
+
readonly modelServiceUnavailable: string;
|
|
89
|
+
/** 读当前默认模型失败的前缀整句(`{reason}`)。 */
|
|
90
|
+
readonly readModelFailed: string;
|
|
91
|
+
/** llm 服务未就绪。 */
|
|
92
|
+
readonly llmUnavailable: string;
|
|
93
|
+
/** 整理端点兜底异常整句(`{reason}`)。 */
|
|
94
|
+
readonly organizeFailed: string;
|
|
95
|
+
}
|
|
96
|
+
export declare const HOST_MESSAGES: MessagesCatalog<HostMessages>;
|