@cold777/dsh-takeover 0.0.0-stage → 0.1.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 +133 -0
- package/LICENSE +21 -0
- package/README.en.md +111 -0
- package/README.md +110 -2
- package/assets/icon.svg +22 -0
- package/cordis.patch.yml +9 -0
- package/cordis.yml +5 -0
- package/lib/client.js +3544 -0
- package/lib/dist-Dk2MQOZJ.js +2090 -0
- package/lib/index.d.ts +788 -0
- package/lib/index.js +4472 -0
- package/package.json +119 -6
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,788 @@
|
|
|
1
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import { Agent } from "@deepseek-ai/dsh-agent";
|
|
3
|
+
import { SkillRegistration } from "@deepseek-ai/dsh-skill";
|
|
4
|
+
//#region src/signing.d.ts
|
|
5
|
+
type SigVerdict = 'ok' | 'tampered' | 'unsigned' | 'no-key';
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region node_modules/.pnpm/@agent-handoff+core@file+vendor+@agent-handoff+core/node_modules/@agent-handoff/core/dist/index.d.mts
|
|
8
|
+
/** 六段正文 + 可选「建议加载」段 */
|
|
9
|
+
interface CardSections {
|
|
10
|
+
goal: string;
|
|
11
|
+
files: string;
|
|
12
|
+
done: string;
|
|
13
|
+
remaining: string;
|
|
14
|
+
stopped: string;
|
|
15
|
+
warnings: string;
|
|
16
|
+
suggested?: string;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/collect.d.ts
|
|
20
|
+
/**
|
|
21
|
+
* 事件流确定性收集(不调 LLM、不读时钟之外的副作用)。
|
|
22
|
+
* 借道 npm 包 dsh-handoff v0.1.0 的探测思路:全程 typeof 防御,
|
|
23
|
+
* 任何结构偏差都不抛错——探测失败由调用方降级为规范值,绝不 throw。
|
|
24
|
+
* @module dsh-takeover/collect
|
|
25
|
+
*/
|
|
26
|
+
/** 探测结果:events 不可用/无法适配时 skipped=true 并附中文说明 */
|
|
27
|
+
interface ProbeResult {
|
|
28
|
+
events: unknown[];
|
|
29
|
+
skipped: boolean;
|
|
30
|
+
note: string;
|
|
31
|
+
}
|
|
32
|
+
/** 收集到的会话事实(全部来自事件流的确定性蒸馏) */
|
|
33
|
+
interface SessionFacts {
|
|
34
|
+
/** 直接用户消息(source.kind === 'user'),截 200 字 */
|
|
35
|
+
userMessages: Array<{
|
|
36
|
+
time: number;
|
|
37
|
+
text: string;
|
|
38
|
+
}>;
|
|
39
|
+
/** 写过的文件/编辑清单 */
|
|
40
|
+
writeEdits: Array<{
|
|
41
|
+
tool: string;
|
|
42
|
+
file: string;
|
|
43
|
+
}>;
|
|
44
|
+
/** 执行过的命令摘要(bash 系,截 120 字,最多 10 条) */
|
|
45
|
+
commands: string[];
|
|
46
|
+
/** bash 里的 git commit 命令 */
|
|
47
|
+
gitCommits: string[];
|
|
48
|
+
/** 工具调用参数里出现的工作区路径(去重) */
|
|
49
|
+
keyFiles: Set<string>;
|
|
50
|
+
/** 最近一次 todo/write 的快照(原样条目) */
|
|
51
|
+
lastTodo: Array<Record<string, unknown>> | null;
|
|
52
|
+
/** 最近一次 goal/change 的目标文本 */
|
|
53
|
+
lastGoal: string;
|
|
54
|
+
/** 事件总数(探测成功时) */
|
|
55
|
+
eventCount: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 探测会话事件流:优先 session.snapshotEvents()(dsh-session 正式 API),
|
|
59
|
+
* 退回 session.events 数组(dsh-handoff 探测过的形态),再退回降级。
|
|
60
|
+
*/
|
|
61
|
+
export declare function probeSessionEvents(session: unknown): ProbeResult;
|
|
62
|
+
/** 遍历事件流收集会话事实;单条事件结构不符就跳过,绝不抛错 */
|
|
63
|
+
export declare function collectFacts(events: unknown[]): SessionFacts;
|
|
64
|
+
/** todo 条目 → 协议 tasks 快照(text + status 最小公分母,语义 4:迁快照不迁现场) */
|
|
65
|
+
export declare function todoToTasks(facts: SessionFacts): Array<{
|
|
66
|
+
text: string;
|
|
67
|
+
status: string;
|
|
68
|
+
priority?: string;
|
|
69
|
+
}>;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/tools.d.ts
|
|
72
|
+
/** 覆盖率统计:done 段的完成/交付陈述总数与其中带四态标注的条数 */
|
|
73
|
+
interface CoverageStats {
|
|
74
|
+
statements: number;
|
|
75
|
+
marked: number;
|
|
76
|
+
unmarked: number;
|
|
77
|
+
[k: string]: number;
|
|
78
|
+
}
|
|
79
|
+
/** handoff_push 参数:六段文本可选,缺省段走事件流确定性兜底 */
|
|
80
|
+
interface PushArgs {
|
|
81
|
+
goal?: string;
|
|
82
|
+
files?: string;
|
|
83
|
+
done?: string;
|
|
84
|
+
remaining?: string;
|
|
85
|
+
stopped?: string;
|
|
86
|
+
warnings?: string;
|
|
87
|
+
suggested?: string;
|
|
88
|
+
title?: string;
|
|
89
|
+
to?: string;
|
|
90
|
+
project?: string;
|
|
91
|
+
cwd?: string;
|
|
92
|
+
/** 本卡接替的前置卡 id(接力寄存):只进信封不进 SPEC frontmatter */
|
|
93
|
+
supersedes?: string;
|
|
94
|
+
/** 空壳卡守门旁路:六段全是兜底占位时,确认要寄存空壳卡 */
|
|
95
|
+
confirmSkeleton?: boolean;
|
|
96
|
+
/** 密钥闸旁路:扫描命中疑似密钥时,确认带密寄存(留痕进返回值) */
|
|
97
|
+
allowSecrets?: boolean;
|
|
98
|
+
}
|
|
99
|
+
type PushResult = {
|
|
100
|
+
ok: true;
|
|
101
|
+
id: string;
|
|
102
|
+
path: string;
|
|
103
|
+
skipped: boolean;
|
|
104
|
+
note: string;
|
|
105
|
+
coverage: CoverageStats;
|
|
106
|
+
/** 未提交改动补丁随卡情况;undefined = 源目录非 git 仓库 */
|
|
107
|
+
patch?: {
|
|
108
|
+
bytes: number;
|
|
109
|
+
truncated: boolean;
|
|
110
|
+
sidecar: boolean;
|
|
111
|
+
};
|
|
112
|
+
/** 本卡接替的前置卡 id(透传进信封) */
|
|
113
|
+
supersedes?: string;
|
|
114
|
+
/** 空壳卡(守门旁路后落盘):调用方/下游可据此提示 */
|
|
115
|
+
skeleton?: boolean;
|
|
116
|
+
/** 密钥闸旁路留痕:命中规则名列表 */
|
|
117
|
+
secretsBypass?: string[];
|
|
118
|
+
} | {
|
|
119
|
+
ok: false;
|
|
120
|
+
error: string;
|
|
121
|
+
};
|
|
122
|
+
/** 确定性兜底:事件流事实 → 六段正文草稿(中文,证据一律 HISTORY_REPORTED) */
|
|
123
|
+
export declare function factsToSections(facts: SessionFacts, skipped: boolean, note: string): CardSections;
|
|
124
|
+
/**
|
|
125
|
+
* 推送核心(可脱离 host 单测):组装协议卡片写入 pending/。
|
|
126
|
+
* session 可以是任何形态——探测失败只降级,不抛错。
|
|
127
|
+
* 外来段落净化(ANSI/控制字符剥离、伪标题解除形态)并限量(单段 128K 字符,
|
|
128
|
+
* 标量 500)——共享收件箱的卡会被 inboxList/buildState 每次全量重读,不设上限
|
|
129
|
+
* 就是把宿主内存/CPU 交给任意一次 push。
|
|
130
|
+
*/
|
|
131
|
+
export declare function pushHandoff(session: unknown, args: PushArgs, opts?: {
|
|
132
|
+
dir?: string;
|
|
133
|
+
}): PushResult;
|
|
134
|
+
interface InboxItem {
|
|
135
|
+
id: string;
|
|
136
|
+
from: string;
|
|
137
|
+
title: string;
|
|
138
|
+
to: string;
|
|
139
|
+
project: string;
|
|
140
|
+
pushed_at: string;
|
|
141
|
+
taskCount: number;
|
|
142
|
+
[k: string]: string | number;
|
|
143
|
+
}
|
|
144
|
+
type InboxListResult = {
|
|
145
|
+
ok: true;
|
|
146
|
+
action: 'list';
|
|
147
|
+
cards: InboxItem[];
|
|
148
|
+
skipped: number;
|
|
149
|
+
} | {
|
|
150
|
+
ok: false;
|
|
151
|
+
error: string;
|
|
152
|
+
};
|
|
153
|
+
/** 列出 pending 待取件(新→旧),只读不消费;坏卡跳过并计数(skipped),不再静默 */
|
|
154
|
+
export declare function inboxList(opts?: {
|
|
155
|
+
dir?: string;
|
|
156
|
+
}): InboxListResult;
|
|
157
|
+
type InboxLoadResult = {
|
|
158
|
+
ok: true;
|
|
159
|
+
action: 'load';
|
|
160
|
+
id: string;
|
|
161
|
+
text: string;
|
|
162
|
+
mismatches: string[];
|
|
163
|
+
unavailable?: string;
|
|
164
|
+
/** 卡内 extras.coverage(防御式提取,外来卡/坏数据缺省) */
|
|
165
|
+
coverage?: CoverageStats;
|
|
166
|
+
/** 随卡消费的机器信封 JSON 字符数;卡无信封(旧卡/外写卡)缺省 */
|
|
167
|
+
envelopeChars?: number;
|
|
168
|
+
/** 随卡归档的未提交改动补丁路径(git apply 可复原);卡无补丁缺省 */
|
|
169
|
+
patchPath?: string;
|
|
170
|
+
patchBytes?: number;
|
|
171
|
+
/** 信封提示的基线测试命令 */
|
|
172
|
+
testCommand?: string;
|
|
173
|
+
/** 本卡接替的前置卡 id */
|
|
174
|
+
supersedes?: string;
|
|
175
|
+
/** 跨 OS 接手:源卡 OS 与本机不同(路径体系需人工映射) */
|
|
176
|
+
crossOS?: {
|
|
177
|
+
source: string;
|
|
178
|
+
local: string;
|
|
179
|
+
};
|
|
180
|
+
/** 信封验签结论:unsigned=无签名(旧卡/外写卡),no-key=有签名但本机无对应密钥 */
|
|
181
|
+
sig?: SigVerdict;
|
|
182
|
+
} | {
|
|
183
|
+
ok: false;
|
|
184
|
+
error: string;
|
|
185
|
+
};
|
|
186
|
+
/** 取件(消费即弃):pending → archived,附 verifyGit 的 MISMATCH/UNAVAILABLE 警告 */
|
|
187
|
+
export declare function inboxLoad(id: string, opts?: {
|
|
188
|
+
dir?: string;
|
|
189
|
+
}): InboxLoadResult;
|
|
190
|
+
/** 寄存/取件后的宿主通知(对齐 Claude Code 通知习惯):
|
|
191
|
+
* DSH 宿主无 toast / 系统通知的插件挂点,最接近形态是 ctx.userQuestions.ask
|
|
192
|
+
* 的阻塞式问答面板(规范调用样例:dsh-tool-ask-user,agent: exec.agent + signal: exec.signal)。
|
|
193
|
+
* 尽力而为,绝不阻断寄存/取件主流程:
|
|
194
|
+
* - 服务缺席(旧宿主)→ safeUserQuestions 返 undefined,直接跳过;
|
|
195
|
+
* - Web 客户端离线 / 会话无 open turn(NO_PROVIDER)、subagent 持有 agent(DELEGATED_CALLER)、
|
|
196
|
+
* 中止(ASK_ABORTED)→ ask reject,静默降级为工具结果文本。 */
|
|
197
|
+
export declare function handoffHostNotice(userQuestions: unknown, action: 'push' | 'load', id: string, exec?: {
|
|
198
|
+
agent?: Agent;
|
|
199
|
+
signal?: AbortSignal;
|
|
200
|
+
}, log?: (msg: string) => void): Promise<void>;
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region node_modules/.pnpm/@agent-handoff+readers@file+vendor+@agent-handoff+readers/node_modules/@agent-handoff/readers/dist/index.d.mts
|
|
203
|
+
//#region src/transcript.d.ts
|
|
204
|
+
/**
|
|
205
|
+
* 会话 Turn 的最小类型与 Claude transcript 解析(移植自 dsh-hippo src/patterns/transcript.ts,
|
|
206
|
+
* 去掉 cwdToProject——它依赖 hippo 项目别名表,不属于读取层)。
|
|
207
|
+
*
|
|
208
|
+
* 一条 assistant 消息的多个 content block 拆成多个 Turn(text / thinking / tool_use),
|
|
209
|
+
* user 消息里的 tool_result block 变成带 failed 标记的 tool turn。
|
|
210
|
+
*/
|
|
211
|
+
/** 对话的一个最小单元(从一行 transcript 提取) */
|
|
212
|
+
interface Turn {
|
|
213
|
+
role: 'user' | 'assistant' | 'tool';
|
|
214
|
+
text: string;
|
|
215
|
+
cwd: string;
|
|
216
|
+
ts: string;
|
|
217
|
+
toolName: string;
|
|
218
|
+
toolFailed: boolean;
|
|
219
|
+
model: string;
|
|
220
|
+
}
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/types.d.ts
|
|
223
|
+
/** 一个已发现的会话(发现层产物,轻量:不含内容)。 */
|
|
224
|
+
interface SessionRef {
|
|
225
|
+
/** 归属适配器名:claude-code | codex | opencode | zcode | pi | workbuddy | cursor | grok | gemini */
|
|
226
|
+
agent: string;
|
|
227
|
+
/** 稳定 id:文件系=绝对路径;SQLite 系=会话 id。 */
|
|
228
|
+
id: string;
|
|
229
|
+
title: string;
|
|
230
|
+
cwd: string;
|
|
231
|
+
/** 最近更新时间(ms epoch),排序用。 */
|
|
232
|
+
updatedAt: number;
|
|
233
|
+
/** 增量指纹:文件系="mtime:size";SQLite 系=String(time_updated)。 */
|
|
234
|
+
fingerprint: string;
|
|
235
|
+
kind: 'file' | 'sqlite';
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/foreign.d.ts
|
|
239
|
+
/** 面向用户的九家提供方名 → readers 适配器名(claude 是 claude-code 的别名) */
|
|
240
|
+
export declare const FOREIGN_PROVIDERS: readonly ['claude', 'codex', 'opencode', 'zcode', 'pi', 'workbuddy', 'cursor', 'grok', 'gemini'];
|
|
241
|
+
type ForeignProvider = (typeof FOREIGN_PROVIDERS)[number];
|
|
242
|
+
/** 面向用户的 provider 名 → readers 适配器名(设置卡支持矩阵同用) */
|
|
243
|
+
export declare const PROVIDER_TO_ADAPTER: Record<ForeignProvider, string>;
|
|
244
|
+
/** 引用解析结果(与 readers ResolveResult 同构,解耦后单测可手写) */
|
|
245
|
+
type ForeignResolve = {
|
|
246
|
+
kind: 'resolved';
|
|
247
|
+
ref: SessionRef;
|
|
248
|
+
} | {
|
|
249
|
+
kind: 'ambiguous';
|
|
250
|
+
candidates: SessionRef[];
|
|
251
|
+
} | {
|
|
252
|
+
kind: 'not-found';
|
|
253
|
+
reference: string;
|
|
254
|
+
};
|
|
255
|
+
/** 读取层依赖(默认实现 lazy import @agent-handoff/readers;测试注入假货) */
|
|
256
|
+
interface ForeignReaders {
|
|
257
|
+
listSessions(agent: string): SessionRef[];
|
|
258
|
+
resolve(agent: string, reference: string): ForeignResolve;
|
|
259
|
+
readSession(agent: string, ref: SessionRef | string): Turn[];
|
|
260
|
+
/** 适配器支持情况:node:sqlite 缺失(Node<22)时 zcode 报 supported=false */
|
|
261
|
+
adapterNote(agent: string): {
|
|
262
|
+
supported: boolean;
|
|
263
|
+
note: string;
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/** 工具参数 */
|
|
267
|
+
interface ForeignReadArgs {
|
|
268
|
+
provider?: string;
|
|
269
|
+
action?: string;
|
|
270
|
+
reference?: string;
|
|
271
|
+
limit?: number;
|
|
272
|
+
offset?: number;
|
|
273
|
+
}
|
|
274
|
+
/** list 的候选条目(标题 / 时间 / 轮数) */
|
|
275
|
+
type ForeignCandidate = {
|
|
276
|
+
id: string;
|
|
277
|
+
title: string;
|
|
278
|
+
cwd: string;
|
|
279
|
+
updatedAt: string;
|
|
280
|
+
kind: string;
|
|
281
|
+
turns: number;
|
|
282
|
+
};
|
|
283
|
+
/** show 的结构化摘要 */
|
|
284
|
+
type ForeignSummary = {
|
|
285
|
+
title: string;
|
|
286
|
+
sessionId: string;
|
|
287
|
+
cwd: string;
|
|
288
|
+
updatedAt: string;
|
|
289
|
+
turnCount: number;
|
|
290
|
+
userTurns: number;
|
|
291
|
+
firstUserMessage: string;
|
|
292
|
+
lastUserMessage: string;
|
|
293
|
+
tailProgress: string[];
|
|
294
|
+
files: string[];
|
|
295
|
+
commands: string[];
|
|
296
|
+
};
|
|
297
|
+
/** show 的骨架卡六段素材(模型改写六段卡的原料,全部 HISTORY_REPORTED) */
|
|
298
|
+
type ForeignSkeleton = {
|
|
299
|
+
goal: string;
|
|
300
|
+
files: string;
|
|
301
|
+
done: string;
|
|
302
|
+
remaining: string;
|
|
303
|
+
stopped: string;
|
|
304
|
+
warnings: string;
|
|
305
|
+
};
|
|
306
|
+
/** 分页吐出的原文轮次(仅在模型显式传 limit 时给出) */
|
|
307
|
+
type ForeignTurn = {
|
|
308
|
+
index: number;
|
|
309
|
+
role: string;
|
|
310
|
+
ts: string;
|
|
311
|
+
toolName: string;
|
|
312
|
+
toolFailed: boolean;
|
|
313
|
+
text: string;
|
|
314
|
+
};
|
|
315
|
+
type ForeignReadResult = {
|
|
316
|
+
ok: true;
|
|
317
|
+
action: 'list';
|
|
318
|
+
provider: string;
|
|
319
|
+
total: number;
|
|
320
|
+
sessions: ForeignCandidate[];
|
|
321
|
+
} | {
|
|
322
|
+
ok: true;
|
|
323
|
+
action: 'show';
|
|
324
|
+
provider: string;
|
|
325
|
+
summary: ForeignSummary;
|
|
326
|
+
skeleton: ForeignSkeleton;
|
|
327
|
+
turnsTotal: number;
|
|
328
|
+
turnsOffset: number;
|
|
329
|
+
turns?: ForeignTurn[];
|
|
330
|
+
note?: string;
|
|
331
|
+
} | {
|
|
332
|
+
ok: false;
|
|
333
|
+
error: string;
|
|
334
|
+
candidates?: ForeignCandidate[];
|
|
335
|
+
};
|
|
336
|
+
/** 面板浏览的轻量候选行(不含轮数——数轮数要全量解析每个会话,列表页付不起 O(总字节)) */
|
|
337
|
+
type ForeignListRow = {
|
|
338
|
+
id: string;
|
|
339
|
+
title: string;
|
|
340
|
+
cwd: string;
|
|
341
|
+
updatedAt: string;
|
|
342
|
+
kind: string;
|
|
343
|
+
};
|
|
344
|
+
export declare function summarizeTurns(ref: SessionRef, turns: Turn[]): {
|
|
345
|
+
summary: ForeignSummary;
|
|
346
|
+
skeleton: ForeignSkeleton;
|
|
347
|
+
};
|
|
348
|
+
/** 运行时环境钩子:provider 启停闸(host 侧从设置开关注入;缺省不闸) */
|
|
349
|
+
interface ForeignEnv {
|
|
350
|
+
isEnabled?: (provider: ForeignProvider) => boolean;
|
|
351
|
+
}
|
|
352
|
+
/** 停用规范错误值:与设置卡同一文案口径 */
|
|
353
|
+
export declare const disabledError: (provider: string) => string;
|
|
354
|
+
/**
|
|
355
|
+
* 拉取核心(可脱离 cordis 单测):deps 缺省走真实 readers。
|
|
356
|
+
* 任何一步失败都回规范错误值,绝不抛出。
|
|
357
|
+
*/
|
|
358
|
+
export declare function foreignSessionRead(args: ForeignReadArgs, deps?: ForeignReaders, env?: ForeignEnv): Promise<ForeignReadResult>;
|
|
359
|
+
type ForeignListResult = {
|
|
360
|
+
ok: true;
|
|
361
|
+
provider: string;
|
|
362
|
+
total: number;
|
|
363
|
+
sessions: ForeignListRow[];
|
|
364
|
+
note?: string;
|
|
365
|
+
} | {
|
|
366
|
+
ok: false;
|
|
367
|
+
error: string;
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* 面板浏览的会话列表(轻量):只走发现层(SessionRef 元数据),不数轮数、不读内容。
|
|
371
|
+
* 与工具侧 action=list 的分工:工具的候选带用户轮数帮模型挑,面板的行只要标题/时间/目录。
|
|
372
|
+
* 假 0 哨兵(存储布局迁移提示)随 note 下发,面板浮出与支持矩阵同口径。
|
|
373
|
+
*/
|
|
374
|
+
export declare function foreignSessionsList(args: {
|
|
375
|
+
provider?: string;
|
|
376
|
+
limit?: number;
|
|
377
|
+
}, deps?: ForeignReaders, env?: ForeignEnv): Promise<ForeignListResult>;
|
|
378
|
+
type ForeignResolveResult = {
|
|
379
|
+
ok: true;
|
|
380
|
+
ref: SessionRef;
|
|
381
|
+
} | {
|
|
382
|
+
ok: false;
|
|
383
|
+
error: string;
|
|
384
|
+
candidates?: ForeignListRow[];
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* 精确解析一条会话引用( 一键接管的后端步骤):门控与工具同口径,
|
|
388
|
+
* 解析失败(not-found/ambiguous)回规范错误值;ambiguous 附候选。
|
|
389
|
+
*/
|
|
390
|
+
export declare function foreignResolveOne(args: {
|
|
391
|
+
provider?: string;
|
|
392
|
+
reference?: string;
|
|
393
|
+
}, deps?: ForeignReaders, env?: ForeignEnv): Promise<ForeignResolveResult>;
|
|
394
|
+
type ForeignPreviewResult = {
|
|
395
|
+
ok: true;
|
|
396
|
+
provider: string;
|
|
397
|
+
summary: ForeignSummary;
|
|
398
|
+
skeleton: ForeignSkeleton;
|
|
399
|
+
/** 空会话等降级说明(诚实浮出,不粉饰成正常) */
|
|
400
|
+
note?: string;
|
|
401
|
+
} | {
|
|
402
|
+
ok: false;
|
|
403
|
+
error: string;
|
|
404
|
+
candidates?: ForeignListRow[];
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* 面板浏览的单会话预览:结构化摘要 + 骨架六段素材(与工具 action=show 同源同料),
|
|
408
|
+
* 但永不返回 turns 原文——原文分页是模型的深读通道,面板只做「挑得出对的那条」。
|
|
409
|
+
*/
|
|
410
|
+
export declare function foreignSessionPreview(args: {
|
|
411
|
+
provider?: string;
|
|
412
|
+
reference?: string;
|
|
413
|
+
}, deps?: ForeignReaders, env?: ForeignEnv): Promise<ForeignPreviewResult>;
|
|
414
|
+
/**
|
|
415
|
+
* 渲染:execute 返回规范值对象,render 包成中文 text block。
|
|
416
|
+
* dsh-tools 契约:模型只见到 output.render 返回的 content blocks;
|
|
417
|
+
* execute 返回的 value JSON 是程序化字段,永不送达模型(README「The loop
|
|
418
|
+
* retains model-emitted arguments and the registry's final content」)。
|
|
419
|
+
* 所以摘要、骨架六段素材、分页 turns 原文必须全部拼进这份主文本。
|
|
420
|
+
*/
|
|
421
|
+
export declare function renderForeign(_args: unknown, value: unknown): Array<{
|
|
422
|
+
type: 'text';
|
|
423
|
+
text: string;
|
|
424
|
+
}>;
|
|
425
|
+
/** 注册 foreign_session_read 工具;env.isEnabled 缺省则不闸(纯库用法) */
|
|
426
|
+
export declare function registerForeignTool(ctx: Context, env?: ForeignEnv): void;
|
|
427
|
+
//#endregion
|
|
428
|
+
//#region src/settings.d.ts
|
|
429
|
+
/** 开关文件形态:只记停用名单(默认全开,未知条目载入时丢弃) */
|
|
430
|
+
interface TakeoverSwitches {
|
|
431
|
+
disabledProviders: string[];
|
|
432
|
+
}
|
|
433
|
+
/** config.json 路径(HANDOFF_HOME 优先,否则 ~/.handoff) */
|
|
434
|
+
export declare function switchesPath(dir?: string): string;
|
|
435
|
+
/** 读开关:文件缺失/损坏一律视为默认全开(fail-open 是有文档的取舍),
|
|
436
|
+
* 但损坏必须告警——隐私开关被无声恢复是不可接受的静默 */
|
|
437
|
+
export declare function loadSwitches(dir?: string): TakeoverSwitches;
|
|
438
|
+
/** 写开关:tmp+rename 原子替换(进程中断不再留下半截 config.json) */
|
|
439
|
+
export declare function saveSwitches(switches: TakeoverSwitches, dir?: string): void;
|
|
440
|
+
/** 某家是否启用(默认启用;只认九家名单内的停用条目) */
|
|
441
|
+
export declare function isProviderEnabled(provider: string, dir?: string): boolean;
|
|
442
|
+
/** 切某家开关并持久化;未知 provider 抛中文错(路由层转 400) */
|
|
443
|
+
export declare function setProviderEnabled(provider: string, enabled: boolean, dir?: string): TakeoverSwitches;
|
|
444
|
+
/** 收件箱概览的待取件行 */
|
|
445
|
+
interface PendingRow {
|
|
446
|
+
id: string;
|
|
447
|
+
agent: string;
|
|
448
|
+
title: string;
|
|
449
|
+
project: string;
|
|
450
|
+
pushedAt: string;
|
|
451
|
+
/** 目标段(sections.goal)预览,截 240 字;空段回退 done 段 */
|
|
452
|
+
preview: string;
|
|
453
|
+
/** preview 实际取自 done 段(目标段为空的回退)——导出侧据此归段,避免段级错位 */
|
|
454
|
+
previewFromDone?: boolean;
|
|
455
|
+
/** 空壳卡:六段全是兜底占位文本(噪音治理判据,客户端据此打标/折叠) */
|
|
456
|
+
lowInfo: boolean;
|
|
457
|
+
/** 接力链:本卡接替的前置卡 id(信封 extras.supersedes——协议设计只随信封走,卡片本体不含;链可视化)。非接力卡缺省 */
|
|
458
|
+
supersedes?: string;
|
|
459
|
+
}
|
|
460
|
+
/** 支持矩阵行:本机是否支持 / 发现的会话数 / 启用开关 */
|
|
461
|
+
interface ProviderRow {
|
|
462
|
+
name: ForeignProvider;
|
|
463
|
+
supported: boolean;
|
|
464
|
+
/** 发现的会话数;探测失败为 -1(前端显示「—」) */
|
|
465
|
+
sessions: number;
|
|
466
|
+
enabled: boolean;
|
|
467
|
+
note: string;
|
|
468
|
+
}
|
|
469
|
+
interface TakeoverState {
|
|
470
|
+
/** 解析后的 HANDOFF_HOME 绝对路径(默认 ~/.handoff):客户端 localStorage
|
|
471
|
+
* 已见卡集合的键散列数据源(0.3.0 新卡徽标),同源连不同机器不串扰 */
|
|
472
|
+
home: string;
|
|
473
|
+
pending: PendingRow[];
|
|
474
|
+
/** 收件箱概览里被跳过的坏卡数(不再静默) */
|
|
475
|
+
pendingSkipped: number;
|
|
476
|
+
/** 同 frontmatter id 的重复文件数(已按首见去重;多方可写收件箱的防御计数) */
|
|
477
|
+
pendingDuplicates: number;
|
|
478
|
+
/** 收件箱概览不可用时的降级说明(pending 位置异常等);正常时缺省 */
|
|
479
|
+
inboxError?: string;
|
|
480
|
+
archivedCount: number;
|
|
481
|
+
/** 待取件卡账本覆盖聚合(各卡 extras.coverage 求和);无数据缺省。
|
|
482
|
+
* 口径纪律:只聚合不强制——防「为覆盖率假标」污染账本 */
|
|
483
|
+
coverage?: {
|
|
484
|
+
statements: number;
|
|
485
|
+
marked: number;
|
|
486
|
+
unmarked: number;
|
|
487
|
+
};
|
|
488
|
+
/** 待取件机器信封字符总量(*.envelope.json 文件字节数求和);无信封缺省 */
|
|
489
|
+
envelopeChars?: number;
|
|
490
|
+
providers: ProviderRow[];
|
|
491
|
+
/** 0.4.1 死亡地图:卡片生命周期拒收证据(结构化闭集理由)。
|
|
492
|
+
* live = 读侧当前跳过(state 现算,修好即消失);persisted = 写侧/取侧持久事件
|
|
493
|
+
* (lifecycle.jsonl 尾 50 条,多写方排障用);persistedTotal = 日志总条数。
|
|
494
|
+
* 全空(无坏卡且无日志)时缺省。 */
|
|
495
|
+
rejections?: {
|
|
496
|
+
live: Array<{
|
|
497
|
+
file: string;
|
|
498
|
+
reason: string;
|
|
499
|
+
detail: string;
|
|
500
|
+
}>;
|
|
501
|
+
persisted: Array<{
|
|
502
|
+
at: string;
|
|
503
|
+
stage: string;
|
|
504
|
+
reason: string;
|
|
505
|
+
target: string;
|
|
506
|
+
detail: string;
|
|
507
|
+
}>;
|
|
508
|
+
persistedTotal: number;
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* 组装设置卡状态(纯函数核心,读取层与目录都可注入):
|
|
513
|
+
* 单家探测失败只影响该行,不拖垮整体。
|
|
514
|
+
*/
|
|
515
|
+
export declare function buildState(readers: ForeignReaders, dir?: string): TakeoverState;
|
|
516
|
+
/** 清空 archived/:删除全部 .md 文件,返回清除份数(目录不存在=0,不视为错误)。
|
|
517
|
+
* *.md 目录等异常项:跳过不删(应用层删不动,留给人工),单删失败也继续清其余——
|
|
518
|
+
* 此前一个 *.md 目录就让整个清空操作抛 EISDIR,违背「绝不抛出」且永远 500。 */
|
|
519
|
+
export declare function clearArchived(dir?: string): number;
|
|
520
|
+
/** 忽略一张待取件卡:卡与信封原样移入 archived/(保留审计轨迹,不计为取件消费)。
|
|
521
|
+
* pending 只能被消费、没有退出出口,共享总线用久必攒垃圾(2026-10-29 实测 6 张
|
|
522
|
+
* 测试残留卡无处可去)——这是那条出口。找不到/已被取走回规范错误值。 */
|
|
523
|
+
export declare function dismissPending(id: string, dir?: string): {
|
|
524
|
+
ok: boolean;
|
|
525
|
+
moved?: number;
|
|
526
|
+
error?: string;
|
|
527
|
+
};
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/browser-view.d.ts
|
|
530
|
+
/**
|
|
531
|
+
* 外部会话浏览器的纯函数层(client 面板与服务端共享语义,零 DOM / 零 cordis 依赖):
|
|
532
|
+
* - 会话行的即时过滤(标题 / 目录 / id 子串,大小写不敏感);
|
|
533
|
+
* - 相对时间(行内扫读友好:刚刚 / N分钟前 / …;超 30 天回退绝对日期);
|
|
534
|
+
* - 接管 / 寄存指令生成——/resume-* 的引用解析在首个换行前截断(skills/resume 同轮修订),
|
|
535
|
+
* 所以寄存指令是「引用行 + 指示行」两行式:一行塞尾巴会把尾巴吞进引用导致解析失败。
|
|
536
|
+
* 不碰会话内容本体——浏览是只读的,接管与蒸馏都在会话里由模型完成。
|
|
537
|
+
* @module dsh-takeover/browser-view
|
|
538
|
+
*/
|
|
539
|
+
type Lang = 'zh' | 'en';
|
|
540
|
+
/** 交接出去的接收方(any = 不指定,任何 agent 可取) */
|
|
541
|
+
export declare const OUTBOUND_TARGETS: readonly ['any', 'claude', 'codex', 'opencode', 'zcode', 'pi', 'workbuddy', 'cursor', 'grok'];
|
|
542
|
+
type OutboundTarget = (typeof OUTBOUND_TARGETS)[number];
|
|
543
|
+
/** 接收方展示名(与 PROVIDER_LABEL 同风格;any 是协议词不是 provider) */
|
|
544
|
+
export declare const OUTBOUND_LABELS: Record<OutboundTarget, {
|
|
545
|
+
zh: string;
|
|
546
|
+
en: string;
|
|
547
|
+
}>;
|
|
548
|
+
/** 投进当前会话的寄存指令(queue 模式打给本会话的 agent)。
|
|
549
|
+
* 两行式(同 depositCommand 的换行纪律):引用/命令行在前,指示行在后;
|
|
550
|
+
* 指定了接收方时第二行带上「接收方:xxx」——目标选择必须真实影响投出去的内容。 */
|
|
551
|
+
export declare function outboundCommand(lang: Lang, targetLabel?: string): string;
|
|
552
|
+
/** 对面取卡指引:在目标 agent 的输入框里粘贴这句话,它读完卡即接手。
|
|
553
|
+
* CLI 系给可直接启动的一行命令;输入框系给同句。路径用 ~(POSIX/Windows 均按
|
|
554
|
+
* 目标 agent 的 home 展开习惯),卡 id 恒在句中。 */
|
|
555
|
+
export declare function pickupCommand(target: string, id: string, lang: Lang): string;
|
|
556
|
+
/** 字数人性化:7426 → 7.3K;1200000 → 1.2M;<1000 原样。统计条不再出现 6 位数字墙。 */
|
|
557
|
+
export declare function humanChars(n: number): string;
|
|
558
|
+
//#endregion
|
|
559
|
+
//#region src/server.d.ts
|
|
560
|
+
/** 会话控制器最小面(对齐 dsh-api-session-controller 0.2.0-rc.2 的 Remote 形状;多退少补) */
|
|
561
|
+
interface SessionControllerLike {
|
|
562
|
+
create(request?: {
|
|
563
|
+
cwd?: string;
|
|
564
|
+
workspaceId?: string;
|
|
565
|
+
}): Promise<{
|
|
566
|
+
sessionId: string;
|
|
567
|
+
}>;
|
|
568
|
+
rename(request: {
|
|
569
|
+
sessionId: string;
|
|
570
|
+
title: string;
|
|
571
|
+
}): Promise<unknown>;
|
|
572
|
+
prompt(request: {
|
|
573
|
+
requestId: string;
|
|
574
|
+
sessionId: string;
|
|
575
|
+
mode: 'queue' | 'steer';
|
|
576
|
+
content: Array<{
|
|
577
|
+
type: 'text';
|
|
578
|
+
text: string;
|
|
579
|
+
}>;
|
|
580
|
+
clientTimeZone?: string;
|
|
581
|
+
}, signal?: AbortSignal): Promise<{
|
|
582
|
+
accepted: true;
|
|
583
|
+
}>;
|
|
584
|
+
}
|
|
585
|
+
/** 防御式取宿主会话控制器:服务挂在根 ctx(本插件 ctx 未 inject 该服务名,
|
|
586
|
+
* 直接取会 throw「cannot get property without inject」——root 层即可达)。
|
|
587
|
+
* 缺席/形态不符回 undefined( 规范降级),绝不抛出。 */
|
|
588
|
+
export declare function sessionControllerOf(ctx: unknown): SessionControllerLike | undefined;
|
|
589
|
+
type TakeoverMode = 'take' | 'take_deposit' | 'inbox';
|
|
590
|
+
type TakeoverOutcome = {
|
|
591
|
+
ok: true;
|
|
592
|
+
sessionId: string;
|
|
593
|
+
title: string;
|
|
594
|
+
} | {
|
|
595
|
+
ok: false;
|
|
596
|
+
error: string; /** create 成功但后续失败的孤儿会话 id(不隐瞒,可循此清理) */
|
|
597
|
+
sessionId?: string;
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* 投递核心(可脱离 cordis 单测):建新会话 → 改可找标题 → queue 模式投递指令。
|
|
601
|
+
* 指令与浏览器复制的载荷同一出处(browser-view 的 takeoverCommand/depositCommand),
|
|
602
|
+
* 「点按钮」和「手动粘贴」永远等价;mode=inbox 投递裸 /inbox(最小输入纪律),
|
|
603
|
+
* 带reference 时升级为定向取件(/inbox + 指明编号——行级按钮必须取那一张)。
|
|
604
|
+
* 任何一步失败回规范错误值;已建会话的 id 随错误带出(不隐瞒孤儿会话)。
|
|
605
|
+
*/
|
|
606
|
+
export declare function admitTakeover(controller: SessionControllerLike, args: {
|
|
607
|
+
mode: TakeoverMode;
|
|
608
|
+
provider?: string;
|
|
609
|
+
reference?: string;
|
|
610
|
+
lang?: 'zh' | 'en';
|
|
611
|
+
}, deps?: {
|
|
612
|
+
resolve?: typeof foreignResolveOne;
|
|
613
|
+
random?: () => string;
|
|
614
|
+
/** 停用闸环境(与读路由同口径):停用家一键接管同样拒绝 */
|
|
615
|
+
env?: Parameters<typeof foreignResolveOne>[2];
|
|
616
|
+
/** 会话查找(可选):在场时投递成功后向会话日志追加接力溯源记录
|
|
617
|
+
* (依托宿主 ≥0.2.1-alpha.2 的实验性 plugin record API,缺席即跳过) */
|
|
618
|
+
sessions?: {
|
|
619
|
+
get?: (id: string) => unknown;
|
|
620
|
+
flush?: (session: unknown) => unknown;
|
|
621
|
+
};
|
|
622
|
+
}): Promise<TakeoverOutcome>;
|
|
623
|
+
/**
|
|
624
|
+
* 注册 /dsh-takeover/ 前缀路由。webServer 是宿主可选服务(CLI 形态没有),
|
|
625
|
+
* 走 ctx.inject 缺席即跳过,不影响工具与 skill 注册面。
|
|
626
|
+
* opts.takeoverEnv:provider 停用闸(全部路由共用,缺省读真实设置开关;
|
|
627
|
+
* 测试注入假闸——isProviderEnabled 直读真实 HOME,测试不碰)。
|
|
628
|
+
*/
|
|
629
|
+
export declare function registerTakeoverRoutes(ctx: Context, opts?: {
|
|
630
|
+
takeoverEnv?: {
|
|
631
|
+
isEnabled: (p: ForeignProvider) => boolean;
|
|
632
|
+
};
|
|
633
|
+
}): void;
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region src/memory.d.ts
|
|
636
|
+
/** 记忆来源定义:路径确定、只读;project 级仅在给出 cwd 时扫描 */
|
|
637
|
+
interface MemorySourceDef {
|
|
638
|
+
/** 稳定键(客户端勾选回传 / 工具 push 用) */
|
|
639
|
+
key: string;
|
|
640
|
+
/** 归属 agent(展示用) */
|
|
641
|
+
agent: string;
|
|
642
|
+
scope: 'user' | 'project';
|
|
643
|
+
path: (home: string, cwd: string) => string;
|
|
644
|
+
}
|
|
645
|
+
/** 已知记忆文件清单(用户级全局 + 项目级常用约定文件)。
|
|
646
|
+
* 只列有公开文档惯例的路径;没列入的家不是不支持,是路径无公开惯例。
|
|
647
|
+
* hippo-db 特殊行:dsh-hippo(伴侣智能体长期记忆插件)的记忆库——v0.1.9 起是
|
|
648
|
+
* <数据目录>/memories/ 的 zvec 原生目录(proxima 向量索引 + rocksdb FTS),二进制
|
|
649
|
+
* 不随卡直带,存在性照报(UI 提示装了记忆库),出卡时正文替换为 export/import 指引。 */
|
|
650
|
+
export declare const MEMORY_SOURCES: readonly MemorySourceDef[];
|
|
651
|
+
/** 扫描结果行 */
|
|
652
|
+
interface MemorySourceRow {
|
|
653
|
+
key: string;
|
|
654
|
+
agent: string;
|
|
655
|
+
path: string;
|
|
656
|
+
exists: boolean;
|
|
657
|
+
bytes: number;
|
|
658
|
+
/** ISO 时间;不存在为空串 */
|
|
659
|
+
mtime: string;
|
|
660
|
+
/** 开头预览(截 240 字符;不存在/超大为空串) */
|
|
661
|
+
preview: string;
|
|
662
|
+
[k: string]: string | number | boolean;
|
|
663
|
+
}
|
|
664
|
+
/** 扫描已知记忆文件(纯读;deps.home/cwd 可注入,缺省真实 home / 无项目级) */
|
|
665
|
+
export declare function scanMemorySources(deps?: {
|
|
666
|
+
home?: string;
|
|
667
|
+
cwd?: string;
|
|
668
|
+
}): MemorySourceRow[];
|
|
669
|
+
/** 记忆出卡参数(工作台路由与 handoff_memory 工具共用) */
|
|
670
|
+
interface MemoryPushArgs {
|
|
671
|
+
/** 要带的来源键;缺省 = 全部存在的用户级来源 */
|
|
672
|
+
keys?: string[];
|
|
673
|
+
target?: string;
|
|
674
|
+
title?: string;
|
|
675
|
+
lang?: 'zh' | 'en';
|
|
676
|
+
}
|
|
677
|
+
type MemoryPushResult = {
|
|
678
|
+
ok: true;
|
|
679
|
+
id: string;
|
|
680
|
+
path: string;
|
|
681
|
+
sources: number;
|
|
682
|
+
} | {
|
|
683
|
+
ok: false;
|
|
684
|
+
error: string;
|
|
685
|
+
};
|
|
686
|
+
/** 记忆出卡核心(pushHandoff 复用——session 传 undefined,六段全部手写,守门不误伤) */
|
|
687
|
+
export declare function pushMemoryCard(args: MemoryPushArgs, deps?: {
|
|
688
|
+
scan?: typeof scanMemorySources;
|
|
689
|
+
push?: typeof pushHandoff;
|
|
690
|
+
dir?: string;
|
|
691
|
+
}): MemoryPushResult;
|
|
692
|
+
/** 注册 handoff_memory 工具(agent 侧同款能力:scan 看清单 / push 出卡) */
|
|
693
|
+
export declare function registerMemoryTool(ctx: Context): void;
|
|
694
|
+
/** execute 规范值 → 模型可见文本 */
|
|
695
|
+
export declare function renderMemory(_args: unknown, value: unknown): Array<{
|
|
696
|
+
type: 'text';
|
|
697
|
+
text: string;
|
|
698
|
+
}>;
|
|
699
|
+
//#endregion
|
|
700
|
+
//#region skills/handoff.d.ts
|
|
701
|
+
/** /handoff 注册项 */
|
|
702
|
+
export declare function handoffSkillRegistration(): SkillRegistration;
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region skills/inbox.d.ts
|
|
705
|
+
/** /inbox 注册项 */
|
|
706
|
+
export declare function inboxSkillRegistration(): SkillRegistration;
|
|
707
|
+
//#endregion
|
|
708
|
+
//#region skills/resume.d.ts
|
|
709
|
+
interface ResumeSkillSpec {
|
|
710
|
+
readonly name: `resume-${ForeignProvider}`;
|
|
711
|
+
readonly provider: ForeignProvider;
|
|
712
|
+
readonly product: string;
|
|
713
|
+
readonly description: string;
|
|
714
|
+
/** 各家恢复边界文案(读取器排除什么、永不做什么) */
|
|
715
|
+
readonly recoveryBoundary: string;
|
|
716
|
+
}
|
|
717
|
+
/** 九家注册规格:单一出处,content 由模板函数生成 */
|
|
718
|
+
export declare const RESUME_SKILL_SPECS: readonly [{
|
|
719
|
+
readonly name: 'resume-claude';
|
|
720
|
+
readonly provider: 'claude';
|
|
721
|
+
readonly product: 'Claude Code';
|
|
722
|
+
readonly description: '把一条 Claude Code 会话拉进当前会话,生成六段交接卡接手工作;可附会话 id、记录路径或标题关键词。';
|
|
723
|
+
readonly recoveryBoundary: '读取器全量读取本地记录(含被替换/放弃分支的条目,thinking 块以 [thinking] 标记保留);不复活 CLI、不回放工具调用。';
|
|
724
|
+
}, {
|
|
725
|
+
readonly name: 'resume-codex';
|
|
726
|
+
readonly provider: 'codex';
|
|
727
|
+
readonly product: 'Codex';
|
|
728
|
+
readonly description: '把一条 Codex 会话拉进当前会话,生成六段交接卡接手工作;可附会话 id、记录路径或标题关键词。';
|
|
729
|
+
readonly recoveryBoundary: '读取器排除 Codex 的 system / developer / reasoning / world-state / 跨 agent 记录。';
|
|
730
|
+
}, {
|
|
731
|
+
readonly name: 'resume-opencode';
|
|
732
|
+
readonly provider: 'opencode';
|
|
733
|
+
readonly product: 'OpenCode';
|
|
734
|
+
readonly description: '把一条 OpenCode 会话拉进当前会话,生成六段交接卡接手工作;可附会话 id 或标题关键词。';
|
|
735
|
+
readonly recoveryBoundary: '读取器只读 OpenCode 本地存储的会话记录;不复活进程、不回放存储的调用。';
|
|
736
|
+
}, {
|
|
737
|
+
readonly name: 'resume-zcode';
|
|
738
|
+
readonly provider: 'zcode';
|
|
739
|
+
readonly product: 'ZCode';
|
|
740
|
+
readonly description: '把一条 ZCode 会话拉进当前会话,生成六段交接卡接手工作;可附会话 id(支持短前缀)或标题关键词。';
|
|
741
|
+
readonly recoveryBoundary: '读取器只读 ZCode 的 sqlite 库(readonly、随开随关,需 Node ≥22);不回放调用、不复活 CLI;压缩段只是摘要标记,仍在库里的旧行保留。';
|
|
742
|
+
}, {
|
|
743
|
+
readonly name: 'resume-pi';
|
|
744
|
+
readonly provider: 'pi';
|
|
745
|
+
readonly product: 'Pi';
|
|
746
|
+
readonly description: '把一条 Pi 会话拉进当前会话,生成六段交接卡接手工作;可附会话 id、JSONL 路径或标题关键词。';
|
|
747
|
+
readonly recoveryBoundary: '读取器只沿 Pi 当前活跃叶子读取,排除 thinking、hooks、system 消息与扩展注入的记录。';
|
|
748
|
+
}, {
|
|
749
|
+
readonly name: 'resume-workbuddy';
|
|
750
|
+
readonly provider: 'workbuddy';
|
|
751
|
+
readonly product: 'WorkBuddy';
|
|
752
|
+
readonly description: '把一条 WorkBuddy 会话拉进当前会话,生成六段交接卡接手工作;可附会话 id、记录路径或标题关键词。';
|
|
753
|
+
readonly recoveryBoundary: '读取器只导入受支持的 WorkBuddy transcript / 存储记录,永不回放存储的调用。';
|
|
754
|
+
}, {
|
|
755
|
+
readonly name: 'resume-cursor';
|
|
756
|
+
readonly provider: 'cursor';
|
|
757
|
+
readonly product: 'Cursor';
|
|
758
|
+
readonly description: '把一条 Cursor 会话拉进当前会话,生成六段交接卡接手工作;可附会话 id、记录路径或标题关键词。';
|
|
759
|
+
readonly recoveryBoundary: '读取器只导入受支持的 Cursor transcript / store 记录,永不回放存储的调用。';
|
|
760
|
+
}, {
|
|
761
|
+
readonly name: 'resume-grok';
|
|
762
|
+
readonly provider: 'grok';
|
|
763
|
+
readonly product: 'Grok';
|
|
764
|
+
readonly description: '把一条 Grok 会话拉进当前会话,生成六段交接卡接手工作;可附会话 id、会话目录、记录路径或标题关键词。';
|
|
765
|
+
readonly recoveryBoundary: '读取器只用 Grok 可见的 updates.jsonl 流,永不读 chat_history.jsonl 原始模型上下文。';
|
|
766
|
+
}, {
|
|
767
|
+
readonly name: 'resume-gemini';
|
|
768
|
+
readonly provider: 'gemini';
|
|
769
|
+
readonly product: 'Gemini CLI';
|
|
770
|
+
readonly description: '把一条 Gemini CLI 会话拉进当前会话,生成六段交接卡接手工作;本地记录是新旧双格式 JSONL/JSON,子代理会话单独存盘,可附会话 id(记录路径)、记录路径或标题关键词。';
|
|
771
|
+
readonly recoveryBoundary: '读取器只读 Gemini CLI 本地 chats/ 下的会话文件(JSONL 新格式 / 整块 JSON 旧格式,含子代理会话目录);info/error/warning CLI 提示与斜杠命令行不进对话流;只读不写、不复活 Gemini CLI 进程。';
|
|
772
|
+
}];
|
|
773
|
+
/** 单条 skill 内容模板:九条共用一个模板函数 */
|
|
774
|
+
export declare function resumeSkillContent(spec: ResumeSkillSpec): string;
|
|
775
|
+
/** 九条注册项(数组驱动,与 RESUME_SKILL_SPECS 一一对应) */
|
|
776
|
+
export declare function resumeSkillRegistrations(): SkillRegistration[];
|
|
777
|
+
//#endregion
|
|
778
|
+
//#region skills/index.d.ts
|
|
779
|
+
/** 全部 bundled slash skill 注册项(/handoff /inbox + /resume-* 九条) */
|
|
780
|
+
export declare function skillRegistrations(): SkillRegistration[];
|
|
781
|
+
//#endregion
|
|
782
|
+
//#region src/index.d.ts
|
|
783
|
+
export declare const name = "dsh-takeover";
|
|
784
|
+
export declare const inject: string[];
|
|
785
|
+
export declare function apply(ctx: Context): void;
|
|
786
|
+
//#endregion
|
|
787
|
+
export type { ForeignCandidate, ForeignEnv, ForeignListResult, ForeignListRow, ForeignPreviewResult, ForeignProvider, ForeignReadArgs, ForeignReadResult, ForeignReaders, ForeignResolve, ForeignSkeleton, ForeignSummary, ForeignTurn, InboxItem, InboxListResult, InboxLoadResult, MemoryPushArgs, MemoryPushResult, MemorySourceDef, MemorySourceRow, OutboundTarget, PendingRow, ProbeResult, ProviderRow, PushArgs, PushResult, ResumeSkillSpec, SessionControllerLike, SessionFacts, TakeoverMode, TakeoverOutcome, TakeoverState, TakeoverSwitches };
|
|
788
|
+
//# sourceMappingURL=index.d.ts.map
|