@xrn1997/dsh-session-delete 0.7.0 → 0.8.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.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/lib/client.js +2179 -1220
  3. package/lib/index.js +390 -186
  4. package/lib/types/api/attachment.d.ts +2 -2
  5. package/lib/types/api/route-table.d.ts +2 -2
  6. package/lib/types/client/batch-bar.d.ts +2 -4
  7. package/lib/types/client/batch-confirm.d.ts +6 -7
  8. package/lib/types/client/busy-gate.d.ts +12 -5
  9. package/lib/types/client/confirm-dialog.d.ts +23 -0
  10. package/lib/types/client/context-menu-actions.d.ts +11 -5
  11. package/lib/types/client/copy.d.ts +13 -1
  12. package/lib/types/client/delete-confirm.d.ts +2 -2
  13. package/lib/types/client/delete-menu-item.d.ts +2 -2
  14. package/lib/types/client/plugin.d.ts +6 -0
  15. package/lib/types/client/prompt-rail.d.ts +22 -0
  16. package/lib/types/client/remote.d.ts +48 -95
  17. package/lib/types/client/reset-client-state.d.ts +1 -0
  18. package/lib/types/client/session-live.d.ts +31 -0
  19. package/lib/types/client/trash-detail.d.ts +13 -3
  20. package/lib/types/client/trash-snapshot.d.ts +51 -0
  21. package/lib/types/client/trash-view.d.ts +2 -1
  22. package/lib/types/client/undo-notices.d.ts +4 -4
  23. package/lib/types/client/undo-toast.d.ts +1 -2
  24. package/lib/types/client/use-detail-pager.d.ts +7 -3
  25. package/lib/types/client/use-maintenance-section.d.ts +29 -18
  26. package/lib/types/client/use-maintenance.d.ts +14 -5
  27. package/lib/types/client/use-prefetch.d.ts +14 -0
  28. package/lib/types/client/use-prompt-rail.d.ts +60 -0
  29. package/lib/types/client/use-trash-detail-reader.d.ts +33 -0
  30. package/lib/types/client/use-trash-panel-controller.d.ts +6 -4
  31. package/lib/types/client/use-trash-query.d.ts +14 -7
  32. package/lib/types/client/write-seats.d.ts +17 -17
  33. package/lib/types/client/write-settlement.d.ts +3 -3
  34. package/lib/types/client/write.d.ts +9 -7
  35. package/lib/types/deps.d.ts +2 -2
  36. package/lib/types/log/session-log.d.ts +2 -0
  37. package/lib/types/ports/fs-port.d.ts +23 -2
  38. package/lib/types/ports/host-port.d.ts +18 -10
  39. package/lib/types/shared/project-key.d.ts +28 -0
  40. package/lib/types/shared/wire.d.ts +56 -20
  41. package/lib/types/trash/attachments.d.ts +3 -3
  42. package/lib/types/trash/detail.d.ts +4 -2
  43. package/lib/types/trash/display-name.d.ts +16 -0
  44. package/lib/types/trash/entry.d.ts +4 -2
  45. package/package.json +1 -1
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 宿主 `projectKey(cwd)` 的**编码与解码一对**:字母表、转义与包裹规则只住这一份。
3
+ *
4
+ * - 编码是宿主实现的逐字镜像(跨插件不能 import,宿主也没把它暴露成服务)。出处:asar
5
+ * `dsh-session-persistence-jsonl/lib/index.js` 的 `projectKey`;调用链
6
+ * `locate` → `logPath` → `projectDir` → `projectKey`。本机实测
7
+ * `D:/develop/GitHub/dsh-session-delete` → `--D-develop-GitHub-dsh-session-delete--`。
8
+ * 宿主换代先复核算法。
9
+ * 唯一有意偏离:宿主对空串直接抛(`cannot encode an empty project path`),这里把它编成
10
+ * `--root--`——宿主写日志时不会产生空 cwd,读面碰到的是手工改过的 header;这里只做兜底,
11
+ * 不让一条坏 header 把整次对账/列表读挂掉。
12
+ * - 解码给浏览器半渲染回收站组头用;配对关系由 `tests/assembly.test.ts` 的往返用例钉住。
13
+ * - **空串照常编码**(得到 `--root--`):`''` 不是"没有这格",它是读到了一个空路径。只有
14
+ * **缺席** cwd 才落 `NO_CWD_PROJECT_DIR`,那一条判据住 `src/ports/host-port.ts` 的 `projectDirOfCwd`
15
+ * (删除计划、列表投影与对账重建共用同一处)。宿主的 `projectDir` 在 cwd 缺席时用同名目录,
16
+ * 浏览器半渲染组头时也要认它——所以字面量住这里,两半共用。宿主换代先复核算法。
17
+ *
18
+ * **只还原可还原的那部分**:不在 `[A-Za-z0-9._-]` 里、又不是 `~` 的字符编成 `~` + 4 位大写十六进制
19
+ * 码元,字面 `~` 自己编成 `~007E` ⇒ `~XXXX` 不含歧义。而**分隔符(`/` `\` `:`)被折成一个 `-`,
20
+ * 那一段是有损的**,解码还原不回来——调用方按"尽力显示"用它,别拿它反推真实路径。
21
+ */
22
+ /** 无 cwd 的会话落在 `_no-cwd/`(宿主 `projectDir` 原文:`if (cwd === void 0) return join(root, "_no-cwd");`)。
23
+ * Node 半用它合成目录名,浏览器半用它把组头念成「未记录项目」——同一事实只有这一份。 */
24
+ export declare const NO_CWD_PROJECT_DIR = "_no-cwd";
25
+ /** cwd → 项目目录名(宿主 `projectKey` 的逐字镜像)。 */
26
+ export declare function escapeProjectKey(cwd: string): string;
27
+ /** 项目目录名 → 可读文本(只还原 `~XXXX`,分隔符折叠的那一段不还原)。 */
28
+ export declare function unescapeProjectKey(encoded: string): string;
@@ -18,10 +18,15 @@ export declare const SESSION_DELETE_API_PREFIX = "/dsh-session-delete-api";
18
18
  * 都从它起;`SESSION_DELETE_API_PREFIX` 只作为段名的相对前缀与错误原文。
19
19
  */
20
20
  export declare const OFFICIAL_SESSION_DELETE_API_PREFIX = "/api/dsh-session-delete-api";
21
- /** 十段段名(相对前缀)。**每项 `{ path, method }` 两键**:某段用什么方法也是线上形状的一部分
22
- * (ADR-0003),家就在这一张表——路由记录(`src/api/route-table.ts`)逐行投影(`ROUTES.x.method`),
23
- * 浏览器半的 GET 段同样投影、写段把 `ROUTES.x.method` 交给 `src/client/remote.ts` 的 `post()`,
24
- * 两半都不逐段手写一份。
21
+ /** 请求体的线上形状。`none` = 没有字段(GET,或只带空对象的 POST);`query` = GET 查询串(二进制段);
22
+ * 其余是 JSON 体的字段组。**读这一格的是 Node 半**:`src/api/route-table.ts` 的 `bodyOf` 据此决定
23
+ * 分发器要不要预读 JSON。浏览器半的入参形状由 `src/client/remote.ts` 的 interface 签名决定,只投影
24
+ * 这一格的**配对事实**(有 JSON 字段的段必然是 POST),配对由 `tests/wire-shape.test.ts` 钉住。 */
25
+ export type RouteBody = 'none' | 'query' | 'config' | 'entry' | 'apply';
26
+ /** 十段段名(相对前缀)。**每项 `{ path, method, body }` 三键**:某段用什么方法、带什么请求体也是线上
27
+ * 形状的一部分(ADR-0003),家就在这一张表——路由记录(`src/api/route-table.ts`)逐行投影
28
+ * (`ROUTES.x.method` / `bodyOf(ROUTES.x)`),浏览器半的取数通道(`src/client/remote.ts`)从同一格
29
+ * 投影路径与方法,两半都不逐段手写一份字面量。
25
30
  * 写动作统一走一段 `/apply`:一次 HTTP 带一组 id、逐条回结果;
26
31
  * 单条就是长度为 1 的批量,仓里不留第二条执行路径。
27
32
  * - `list`:对账并读清单(`session-trash/` 里的目录是准)。
@@ -31,7 +36,7 @@ export declare const OFFICIAL_SESSION_DELETE_API_PREFIX = "/api/dsh-session-dele
31
36
  * - `empty`:清空回收站(聚合回执,不按条回)。
32
37
  * - `orphans`:无主子会话的扫描报告(纯读)。清理是 `/apply` 的第五个动作,
33
38
  * 这一段只负责"有多少、在哪、多大"。
34
- * - `attachment`:附件原始字节(全仓唯一的二进制响应段;失败仍回 JSON 信封)。
39
+ * - `attachment`:附件原始字节(全仓唯一的二进制响应段;按查询串寻址,失败仍回 JSON 信封)。
35
40
  * - `attachmentOrphans`:无引用图片对象的扫描报告(纯读;数量/字节 + 供预览的对象清单)。
36
41
  * - `attachmentClean`:清掉报告那一刻无引用的图片对象(聚合回执 `AttachmentCleanupWire`)。
37
42
  * - `config`:三只可调项的读/写共用一段——空体读当前值,带字段写回 profile 的 patch 层。 */
@@ -39,51 +44,61 @@ export declare const ROUTES: {
39
44
  readonly list: {
40
45
  readonly path: "/list";
41
46
  readonly method: "GET";
47
+ readonly body: "none";
42
48
  };
43
49
  /** 通道的"在不在"专用:没有入参、没有副作用、没有磁盘读。 */
44
50
  readonly ping: {
45
51
  readonly path: "/ping";
46
52
  readonly method: "GET";
53
+ readonly body: "none";
47
54
  };
48
55
  /** 可调项:空体读(与 `/detail` 同法,用 POST 表达一个读);带字段写,写必须进到达序链。 */
49
56
  readonly config: {
50
57
  readonly path: "/config";
51
58
  readonly method: "POST";
59
+ readonly body: "config";
52
60
  };
53
61
  /** 单条详情(读回收站目录里那条会话自己的日志)。 */
54
62
  readonly detail: {
55
63
  readonly path: "/detail";
56
64
  readonly method: "POST";
65
+ readonly body: "entry";
57
66
  };
58
67
  /** 一组 id 上的同一个动作;删除确认框那句「含 N 个子会话」也走这里(`action: 'count'`,纯读语义)。 */
59
68
  readonly apply: {
60
69
  readonly path: "/apply";
61
70
  readonly method: "POST";
71
+ readonly body: "apply";
62
72
  };
63
73
  /** 清空回收站。 */
64
74
  readonly empty: {
65
75
  readonly path: "/empty";
66
76
  readonly method: "POST";
77
+ readonly body: "none";
67
78
  };
68
79
  /** 纯读:扫描回收站之外的无主子会话(父已不在语料/清册)。 */
69
80
  readonly orphans: {
70
81
  readonly path: "/orphans";
71
82
  readonly method: "GET";
83
+ readonly body: "none";
72
84
  };
73
- /** 附件字节(图片/普通文件):全仓唯一的二进制响应段,读的是宿主附件库。 */
85
+ /** 附件字节(图片/普通文件):全仓唯一的二进制响应段,按查询串寻址。 */
74
86
  readonly attachment: {
75
87
  readonly path: "/attachment";
76
88
  readonly method: "GET";
89
+ readonly body: "query";
77
90
  };
78
91
  /** 纯读:扫全部引用源与附件库 `objects`,报无引用图片的数量、字节与预览清单。 */
79
92
  readonly attachmentOrphans: {
80
93
  readonly path: "/attachment-orphans";
81
94
  readonly method: "GET";
95
+ readonly body: "none";
82
96
  };
83
97
  /** 聚合清理:只删 `objects` 下无引用的图片,回 `AttachmentCleanupWire`。 */
84
98
  readonly attachmentClean: {
85
99
  readonly path: "/attachment-clean";
86
100
  readonly method: "POST";
101
+ readonly body: "none";
87
102
  };
88
103
  };
89
104
  /** 段名 → 那一段的路径。从结构化段名表派生:加一段只在上面加一项,`Record<RouteName, …>` 类型闸
@@ -159,6 +174,13 @@ export interface TrashEntryWire {
159
174
  title: string;
160
175
  sizeBytes: number;
161
176
  parentEntryId?: string;
177
+ /** **子会话的显示名**(委派 `subagent` 时的 `description`,与宿主工作中同名;ADR-0058)。
178
+ * 只在详情 `subagents` 行过线:它是**日志里读出来的事实**——通常是父日志 `subagent/catalog`
179
+ * 的 label;没有 catalog 登记、清册标题又和父/兄弟撞名的 fork 孩子,是它自己日志的当前标题
180
+ * (fork 没有 descriptor)。清册里没有这格——`/list` 的 `toWire` 不发它(缺席 = 没读到名字,
181
+ * 界面回落 `title`)。与 `logTitle` 同一类兜底:清册标题是删除那一刻的快照,label 补的是
182
+ * 快照起错名的存量条目。 */
183
+ label?: string;
162
184
  }
163
185
  /**
164
186
  * `GET /list` 真正发出去的那一行:清册那一行 + 六个**现算现给**的只读数(ADR-0003)。
@@ -240,6 +262,17 @@ export interface TrashDetailToolBlockWire {
240
262
  attachments: TrashDetailAttachmentWire[];
241
263
  }
242
264
  export type TrashDetailBlockWire = TrashDetailTextBlockWire | TrashDetailInjectionBlockWire | TrashDetailToolBlockWire;
265
+ /** 详情右缘「提问轨」的一行:**整条会话**里的一句用户提问,与当前分页窗口无关。
266
+ *
267
+ * `id` 就是那块在整条日志里的序号(与 `blocks[].id` 同一套),所以「跳到这句」在已加载窗口里
268
+ * 按它直接找;没加载就照 `olderCursor` 一页页往回补到它进窗(`src/client/use-prompt-rail.ts`
269
+ * 的跳转循环),不另发一次定向读。`preview` 有界(空白折叠、超长带省略号):它是导航用的标签,
270
+ * 不是正文的第二份抄本。 */
271
+ export interface TrashDetailPromptWire {
272
+ id: string;
273
+ at: number;
274
+ preview: string;
275
+ }
243
276
  /** 回收站单条详情的线上形状(`POST /detail`)。
244
277
  *
245
278
  * 正文按块分页:`blocks` 是当前这一页(从新往旧取),`olderCursor` 指向更早一页的边界;
@@ -252,6 +285,12 @@ export interface TrashDetailWire {
252
285
  lastActivity: number;
253
286
  /** 日志内 `session/title` 那条记录;清册标题为空串时客户端拿它兜底。 */
254
287
  logTitle: string;
288
+ /** **这条会话自己的显示名**(与宿主工作中同名)。只在详情读时从被读的这条日志折出:
289
+ * 子会话取 `subagent/descriptor` 的 `label`(值来自委派 `description`);fork 子会话没有 descriptor,header 有
290
+ * `parentSession` 时取它自己日志的当前 `session/title`。它补的是没有父详情可兜的独立子会话
291
+ * ——那种条目的清册 `title` 是主会话那套起名法,`logTitle` 单看也是错的。
292
+ * 缺席 = 主会话、或没有 descriptor 也没有 `parentSession` 的会话,界面回落清册标题。 */
293
+ label?: string;
255
294
  models: string[];
256
295
  turnCount: number;
257
296
  userMessageCount: number;
@@ -263,6 +302,9 @@ export interface TrashDetailWire {
263
302
  blocks: TrashDetailBlockWire[];
264
303
  /** 更早一页的块序号;`null` = 已经到顶。把它原样回传给 `POST /detail` 的 `before`。 */
265
304
  olderCursor: number | null;
305
+ /** 整条会话的提问索引,按日志顺序;**只在首次读(不带 `before`)时出线**——它不随分页变化,
306
+ * 跟着详情账本走,后续翻页不重复搬。没有用户提问时是空数组(缺席 = 这一读没带,不是"没有")。 */
307
+ prompts?: TrashDetailPromptWire[];
266
308
  /** 跟着这条父条目一起进回收站、并**折进这一行**的孩子(清册里 `parentEntryId` 指向它,
267
309
  * 且组语义接得住——折的判据复用 `src/trash/groups.ts` 的 `visibleGroups`),按清册原序。
268
310
  * 确有孩子时出线;**缺席 = 没有孩子**,不是空数组。孩子的详情仍按 `entryId` 走同一个 `/detail`。
@@ -272,6 +314,9 @@ export interface TrashDetailWire {
272
314
  subagents?: TrashEntryWire[];
273
315
  /** 子会话总数;**只在 `subagents` 被条数闸截断时出线**(缺席 = 上面就是全部)。 */
274
316
  subagentsTotal?: number;
317
+ /** **全部**折进来的孩子的清册 `sizeBytes` 合计;有孩子时出线(即使未被条数闸截断)。
318
+ * 摘要条报「清册大小合计」用它——不要拿 `subagents` 已列行自己求和,那只是前 N 条。 */
319
+ subagentsSizeBytes?: number;
275
320
  }
276
321
  /** 一次永久删除顺带、或一次孤儿附件清理的附件读数。`skipped` 有值 = 这一轮**部分或整体没清**:
277
322
  * 有候选日志或剩余引用源读不出(原因上屏)。此时 `removed` 仍可能 > 0——损坏的只是某一组候选,
@@ -369,8 +414,11 @@ export type RemoteResult<T> = {
369
414
  * 位名与判法取自宿主网关客户端面的原文:
370
415
  * `if (typeof value === "object" && value !== null && value.isDSHRemoteError === true && typeof value.code === "string") return value`。
371
416
  *
372
- * 线上递过来的是**一段 JSON**(标记位不跟着过线)⇒ 落到哪一端,由那端的构造处就地补上标记:
373
- * 浏览器半是 `src/client/remote.ts` 的 `throwRemoteFailure`。
417
+ * 线上递过来的是**一段 JSON**(标记位不跟着过线)⇒ 标记位只由**宿主服务抛出的 `RemoteError`** 自带,
418
+ * 本仓生产侧不造它:Node 半的 `toRemoteFailure`(`src/remote/map-error.ts`)只**消费**它,产出的
419
+ * `RemoteFailure` 是普通过线对象;浏览器半的取数通道**不抛失败、也不补标记**——信封原样当数据交回
420
+ * (`RemoteOutcome`),通道自己造的诊断(打不通 / 非信封 / 401·403)是普通失败对象,不进这条判别;
421
+ * 测试假件同样只消费(`tests/client/support/fake-remote.ts` 的 `failureOf`)。
374
422
  */
375
423
  export declare function isDSHRemoteError(value: unknown): value is RemoteFailure;
376
424
  /**
@@ -405,15 +453,3 @@ export declare function verbCodeOf(error: unknown): VerbCode | undefined;
405
453
  export declare const TRASH_DIR_NAME = "session-trash";
406
454
  /** 页脚/文案里带尾斜杠的那一版(`splitOn` 按它切一刀再把目录名包成 code)。 */
407
455
  export declare const TRASH_DIR_LABEL = "session-trash/";
408
- /**
409
- * 宿主 `projectKey` 的 **`~XXXX` 转义还原**。
410
- *
411
- * 编码那一半在 Node 侧(`src/ports/host-port.ts` 的 `projectKey`,逐字镜像宿主实现);这里放与它配对的
412
- * 解码,客户端渲染回收站组头用它——**字母表只有这一份**,两边不会各自漂移(配对关系由
413
- * `tests/assembly.test.ts` 的往返用例钉住)。
414
- *
415
- * **只还原可还原的那部分**:不在 `[A-Za-z0-9._-]` 里、又不是 `~` 的字符编成 `~` + 4 位大写十六进制码元,
416
- * 字面 `~` 自己编成 `~007E` ⇒ `~XXXX` 不含歧义。而**分隔符(`/` `\` `:`)被折成一个 `-`,那一段是有损的**,
417
- * 这里还原不回来——调用方按"尽力显示"用它,别拿它反推真实路径。
418
- */
419
- export declare function unescapeProjectKey(encoded: string): string;
@@ -1,5 +1,5 @@
1
1
  import { isAbsentPath } from '../ports/fs-port.js';
2
- import type { FsPort } from '../ports/fs-port.js';
2
+ import type { FsReferenceScanPort, FsReferenceScanRemovalPort } from '../ports/fs-port.js';
3
3
  import type { SessionDeleteConfig } from '../config.js';
4
4
  import { type AttachmentCleanupWire } from '../shared/wire.js';
5
5
  export interface ImageRef {
@@ -32,12 +32,12 @@ export declare function attachmentPathOf(home: string, kind: 'image' | 'file', i
32
32
  /** 一条消息的 `content[]` 里的附件块;畸形 id / 非附件段一律跳过。 */
33
33
  export declare function attachmentsInContent(content: unknown): AttachmentRef[];
34
34
  export interface AttachmentReadDeps {
35
- fs: Pick<FsPort, 'exists' | 'listFiles' | 'listDirs' | 'readFile' | 'statFile' | 'realpath'>;
35
+ fs: FsReferenceScanPort;
36
36
  home: string;
37
37
  config: Pick<SessionDeleteConfig, 'maxJsonRefBytes'>;
38
38
  }
39
39
  export interface AttachmentRemovalDeps extends AttachmentReadDeps {
40
- fs: Pick<FsPort, 'exists' | 'listFiles' | 'listDirs' | 'readFile' | 'statFile' | 'realpath' | 'removeFile'>;
40
+ fs: FsReferenceScanRemovalPort;
41
41
  }
42
42
  /** 一个会话目录里的图片引用;`unreadable` 有值 = 这一组不可知(调用方按"跳过它"处理)。
43
43
  *
@@ -23,7 +23,7 @@
23
23
  * "少了几张图"与"这块被截断"不是同一件事,拿一个数兼报会让两个数都对不上。
24
24
  */
25
25
  import { type TrashEntry } from './entry.js';
26
- import type { FsPort } from '../ports/fs-port.js';
26
+ import type { FsDetailPort } from '../ports/fs-port.js';
27
27
  import type { TrashDetailWire } from '../shared/wire.js';
28
28
  /** 每块文字的上限(字符)。正文、工具参数、工具结果各自吃这一刀。 */
29
29
  export declare const PER_BLOCK_CHAR_CAP = 16000;
@@ -31,12 +31,14 @@ export declare const PER_BLOCK_CHAR_CAP = 16000;
31
31
  export declare const PAGE_BLOCK_LIMIT = 30;
32
32
  /** 一页正文的总字符上限(块按日志顺序累计;单块超闸时仍保留一块)。 */
33
33
  export declare const PAGE_CHAR_LIMIT = 500000;
34
+ /** 提问轨预览的字符上限:它是导航标签,不是正文的第二份抄本。 */
35
+ export declare const PROMPT_PREVIEW_LIMIT = 80;
34
36
  /** 子会话摘要最多列多少条;超出时只过线前 N 条,总数另走 `subagentsTotal`。 */
35
37
  export declare const SUBAGENT_SUMMARY_LIMIT = 200;
36
38
  export type TrashDetail = TrashDetailWire;
37
39
  export type DetailDeps = {
38
40
  /** 详情自己直接要的三件(判目录在不在、挑日志、读日志)。对账不在这条路上,所以不需要 `listDirs`。 */
39
- fs: Pick<FsPort, 'exists' | 'listFiles' | 'readFile'>;
41
+ fs: FsDetailPort;
40
42
  /** 路由交来的清册 **raw 行**:`/detail` 声明为 pure,读一次不能顺手对账——对账会写清册行,那是写动作,
41
43
  * 必须排在到达序链上。读面由路由记录选好(`read: 'raw'`),这里只消费行,不再自己挑 `list()` / `raw()`。
42
44
  * 代价是有意的:只有目录、清册还没这一行的手工搬入条目读不到(`/list` 对账后可见)。 */
@@ -0,0 +1,16 @@
1
+ /** `subagent/descriptor` 的 label;空/缺席 = 这条 descriptor 没有名字(one-shot 可以不给)。 */
2
+ export declare function descriptorLabelOf(data: Record<string, unknown>): string;
3
+ export interface LogDisplayName {
4
+ /** 最后一条 descriptor 的 label;空串 = 没有。 */
5
+ readonly label: string;
6
+ /** 最后一条 `session/title`;空串 = 没有。 */
7
+ readonly title: string;
8
+ }
9
+ /**
10
+ * 走一遍日志,折出**这条会话自己**的 descriptor label 与最后一条日志标题。
11
+ *
12
+ * 折叠语义与宿主 `subagent` 投影一致:每遇一条 descriptor 就覆盖(空 label 也覆盖),
13
+ * 所以 fork 种子里祖先的 descriptor 会被子会话自己的那条盖掉。日志标题取**最后一条**:
14
+ * 它是会话改名 / 兜底标题之后的当前值。
15
+ */
16
+ export declare function displayNameOfLog(raw: Buffer): LogDisplayName;
@@ -14,8 +14,10 @@ export interface TrashEntry {
14
14
  * 旧条目迁移用它区分“删除时被我们归档的”(false 且当前仍归档)与“用户删前自己归档的”(true)。 */
15
15
  wasArchived: boolean;
16
16
  deletedAt: number;
17
- /** 删除时**尽力**取的会话标题(来源:宿主 projection cache 服务;底层是
18
- * `storages/session_projcache/sessions/<会话id>.json` 里的 `title` 投影)。取不到存空串,绝不因此让删除失败。 */
17
+ /** 删除时**尽力**取的**显示名**(与工作中同名:子会话取 `subagent` 投影的 label,其余取 `title`
18
+ * 投影;判据住 `src/ports/host-port.ts` 的 `titleOf`,ADR-0058。底层是
19
+ * `storages/session_projcache/sessions/<会话id>.json` 里的投影行)。取不到存空串,绝不因此让删除失败。
20
+ * 存量条目的读时兜底(父日志 catalog / 子会话自己的日志)不回写这一格,见 `src/trash/detail.ts`。 */
19
21
  title: string;
20
22
  /** 删除时用 `fs.sizeOfDir` 量到的会话目录字节数。 */
21
23
  sizeBytes: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xrn1997/dsh-session-delete",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "在 DeepSeek Harness 里删除会话:删除=移入回收站(可恢复),另设显式彻底删除",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.25.0",