@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
@@ -19,13 +19,13 @@
19
19
  *
20
20
  * 请求本身不对(id/kind 形状)⇒ 400;对象不在 / 超限 / 读失败 ⇒ 200 + 信封(与其余段同一条错误面)。
21
21
  */
22
- import type { FsPort } from '../ports/fs-port.js';
22
+ import type { FsAttachmentPort } from '../ports/fs-port.js';
23
23
  import type { SessionDeleteConfig } from '../config.js';
24
24
  import type { AttachmentsPort } from '../ports/attachments-port.js';
25
25
  import type { BinaryResponse } from './route-table.js';
26
26
  /** 读附件只需要 stat + read、宿主 `attachments` 读面与响应上限;执行面(removeDir/removeFile)不给。 */
27
27
  export interface AttachmentReadPorts {
28
- fs: Pick<FsPort, 'statFile' | 'readFile'>;
28
+ fs: FsAttachmentPort;
29
29
  home: string;
30
30
  attachments: AttachmentsPort;
31
31
  config: Pick<SessionDeleteConfig, 'maxAttachmentBytes'>;
@@ -8,8 +8,8 @@
8
8
  * - 切片声明宽了 ⇒ 危险能力(删目录 / 时钟)漏进读段的 run;窄了 ⇒ 写段的处理编译不过。
9
9
  *
10
10
  * 这张表不放 shared/wire.ts:处理函数会 import 动词与 node:fs,而浏览器半要 import wire.ts。
11
- * 段名、方法与动作仍住 wire.ts(`ROUTES` 每项 `{ path, method }`,本表的 method 只投影、不写第二份字面量);
12
- * 这张表只回答“怎么处理”。
11
+ * 段名、方法与请求体形状住 wire.ts(`ROUTES` 每项 `{ path, method, body }`,本表的 method / body 只投影、
12
+ * 不写第二份字面量);这张表只回答“怎么处理”。
13
13
  */
14
14
  import { type ApplyAction, type RouteName } from '../shared/wire.js';
15
15
  import type { ConfigEditorLike, CoreDeps, DeleteDeps, RemovalDeps } from '../deps.js';
@@ -16,10 +16,8 @@
16
16
  */
17
17
  import { type ReactElement } from 'react';
18
18
  import { type Translate } from './copy.js';
19
- import type { SessionDeleteRemote } from './remote.js';
20
- /** 浮条只需要那一个批量口(计数);执行归确认框。 */
21
- export type BatchBarDeps = Pick<SessionDeleteRemote, 'applyOutcomes'>;
19
+ import type { OneShotDeps } from './remote.js';
22
20
  export declare function BatchBar({ deps, t, }: {
23
- deps: BatchBarDeps;
21
+ deps: OneShotDeps;
24
22
  t?: Translate;
25
23
  }): ReactElement | null;
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * 批量删除的确认框——挂在 `shell.overlay` 上的宿主,加它读的那个模块级现场。
3
3
  *
4
- * 为什么又开一个文件而不是把 `delete-confirm.tsx` 撑大:单删那张框是**已交付的面**(docs/ui-spec.md 状态 ②,
5
- * 用例钉着),批量形与它只有三件不同——标题随条数、目标卡逐条列、执行是一次批量 `apply`。共用一个壳
6
- * 意味着单删的 `busy` / 失败面要跟着学批量形,那是拿已交付的行为去换省一个文件。卡片样式(`TARGET_CARD`)
7
- * 与 hint、子会话那两句**复用**单删的,一句不造第二个键。
4
+ * 与单删那张框的关系:**页脚与关框规则共壳**(`confirm-dialog.tsx`,裁决见 ADR-0052),业务面
5
+ * 仍然各是各的——批量形的标题随条数、目标卡逐条列、执行是一次批量 `apply`、失败面按行回;
6
+ * 单删的 `busy` / 失败面没有被拖进来。卡片样式(`TARGET_CARD`)与 hint、子会话那两句**复用**单删的,
7
+ * 一句不造第二个键。
8
8
  *
9
9
  * 现场是模块级的(同 `delete-confirm.tsx` / `undo-notices.ts`):请求从浮条那颗按钮发来,确认框住在
10
10
  * `shell.overlay` 上——它必须活在行开关那棵子树之外(槽位行随宿主重排而卸载,见 `delete-confirm.tsx` 头注)。
11
11
  */
12
12
  import { type ReactElement } from 'react';
13
13
  import { type Translate } from './copy.js';
14
- import type { SessionDeleteRemote } from './remote.js';
14
+ import type { OneShotDeps } from './remote.js';
15
15
  import { type PickItem } from './batch-selection-store.js';
16
16
  export interface BatchDeleteRequest {
17
17
  /** 每次发布递增:换一批就重挂载,busy / 失败面不带着上一批的记忆。 */
@@ -25,9 +25,8 @@ export declare function clearDeleteBatchRequest(): void;
25
25
  export declare function useDeleteBatchRequest(): BatchDeleteRequest | null;
26
26
  /** 测试专用:现场与 seq 归零,用例之间互不串味。 */
27
27
  export declare function resetBatchConfirm(): void;
28
- export type BatchConfirmDeps = Pick<SessionDeleteRemote, 'applyOutcomes'>;
29
28
  /** 常驻的批量确认框宿主。没有待确认的批量删除时什么都不渲染。 */
30
29
  export declare function BatchConfirmHost({ deps, t, }: {
31
- deps: BatchConfirmDeps;
30
+ deps: OneShotDeps;
32
31
  t?: Translate;
33
32
  }): ReactElement | null;
@@ -1,10 +1,17 @@
1
+ /** 一次过闸的落地面:**没跑**与**跑了**在类型面就是两支,不靠 `undefined` 兼职。 */
2
+ export type GateRun<T> = {
3
+ readonly kind: 'blocked';
4
+ } | {
5
+ readonly kind: 'ran';
6
+ readonly value: T;
7
+ };
1
8
  export interface BusyGate {
2
9
  readonly busy: boolean;
3
10
  /** 把一次任务整个包进「这一趟还算忙」;落地与抛错都放回 false。
4
- * 同一枚闸已有任务在飞时这一次**不执行**(同步判重),立即回 `undefined`。类型里带上 `undefined`
5
- * 不是将就,是判据:挡回的那一趟什么都没跑,把它伪装成一枚 `T` 就是把「没跑」当成「跑完且结果是
6
- * 那个值」——消费返回值的调用方(写入座位、清空)会照着编出失败原文或宣布成功。怎么收尾由调用方
7
- * 定:这一趟的界面后果归在飞的那一趟,挡回来的那一份什么都不该改。 */
8
- around: <T>(task: () => Promise<T>) => Promise<T | undefined>;
11
+ * 同一枚闸已有任务在飞时这一次**不执行**(同步判重),立即回 `{ kind: 'blocked' }`。
12
+ * 挡回的那一趟什么都没跑——把它伪装成一枚 `T` 就是把「没跑」当成「跑完且结果是那个值」,
13
+ * 消费返回值的调用方(写入座位、清空)会照着编出失败原文或宣布成功。挡回来那一份的界面后果
14
+ * 归在飞的那一趟,调用方按 `kind` 分派,写不出「拿没跑当跑完」。 */
15
+ around: <T>(task: () => Promise<T>) => Promise<GateRun<T>>;
9
16
  }
10
17
  export declare function useBusyGate(): BusyGate;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 六个确认框共用的**一个壳**:`Modal` + 标题 + 关闭钮 + 「取消(描边) / 确认(主按钮)」页脚。
3
+ *
4
+ * 共用的只有**页脚与关框规则**(`useIdleClose`:在飞时取消与关闭都按住),不共用业务:每个框的
5
+ * 标题、正文、列什么、确认键文案与危险层级都由调用方交,各框自己的状态机与失败面一行业没少。
6
+ * 曾经在 `batch-confirm.tsx` 的头注里否过一次共壳——那时否的是把单删的 `busy` / 失败面拖进批量形;
7
+ * 这里共的是页脚这一层,裁决见 ADR-0052。
8
+ */
9
+ import type { ReactNode } from 'react';
10
+ export interface ConfirmDialogProps {
11
+ readonly title: string;
12
+ readonly closeLabel: string;
13
+ readonly cancelLabel: string;
14
+ readonly confirmLabel: string;
15
+ /** 在飞:取消 / 关闭与确认键一起按住。 */
16
+ readonly busy: boolean;
17
+ readonly onCancel: () => void;
18
+ readonly onConfirm: () => void;
19
+ /** 危险层级:实心红主按钮;缺省是普通 primary(与「移入回收站」同款)。 */
20
+ readonly danger?: boolean;
21
+ readonly children?: ReactNode;
22
+ }
23
+ export declare function ConfirmDialog({ title, closeLabel, cancelLabel, confirmLabel, busy, onCancel, onConfirm, danger, children, }: ConfirmDialogProps): ReactNode;
@@ -1,4 +1,8 @@
1
+ import type { ClientContextLike } from './context.js';
1
2
  import type { Translate } from './copy.js';
3
+ import { type SessionsStateLike } from './session-live.js';
4
+ /** legacy 菜单槽:只在 contextMenus 不可用时注册(0.2.2+ 的内置动作已迁到数据动作)。 */
5
+ export declare const SESSION_MENU_SLOT = "sidebar.workspaces.session.menu.item";
2
6
  interface MenuTarget {
3
7
  readonly sessionId: string;
4
8
  readonly displayTitle: string;
@@ -19,11 +23,6 @@ export interface ObservableSnapshotLike<T> {
19
23
  getSnapshot(): T;
20
24
  subscribe(listener: () => void): () => void;
21
25
  }
22
- interface SessionsStateLike {
23
- byId?: Record<string, {
24
- running?: boolean;
25
- } | undefined>;
26
- }
27
26
  export interface SessionsServiceLike {
28
27
  list?: ObservableSnapshotLike<SessionsStateLike>;
29
28
  }
@@ -44,4 +43,11 @@ export declare const ICON_DELETE = "xrn1997.session-delete.delete";
44
43
  * 所以它们与 Archive 一起排掉 legacy 组件行,恢复「归档在多选/删除之前」。
45
44
  */
46
45
  export declare function createSessionMenuContribution(t: Translate, sessionList?: ObservableSnapshotLike<SessionsStateLike>): MenuContributionLike;
46
+ /** 菜单槽注入的 `useMenuOpenState`:官方 `menuOpenStateFactory` 交回一对开合状态(asar @46195835)。 */
47
+ export type UseMenuOpenState = () => readonly [boolean, (open: boolean) => void];
48
+ /**
49
+ * 注册菜单两行:数据动作可用就走数据动作(+ 两个 icon key),否则注册 legacy 槽位行并等
50
+ * `contextMenus` 迟到。`index.tsx` 的贡献表只留一行调用。
51
+ */
52
+ export declare function installSessionMenus(client: ClientContextLike, t: Translate): void;
47
53
  export {};
@@ -154,6 +154,14 @@ declare const ZH: {
154
154
  readonly 'detail.block.truncated': "已截断";
155
155
  readonly 'detail.loadOlder': "加载更早";
156
156
  readonly 'detail.loadOlder.loading': "正在加载更早…";
157
+ /** 提问轨(详情右缘那道常驻刻度):一句用户提问一格,点一格跳到那句。 */
158
+ readonly 'detail.rail.label': "提问导航";
159
+ readonly 'detail.rail.jump': "跳到第 {n} 句提问:{preview}";
160
+ readonly 'detail.rail.jumpUntitled': "跳到第 {n} 句提问";
161
+ readonly 'detail.rail.position': "第 {n} / {total} 句";
162
+ readonly 'detail.rail.hint': "点一下跳到这一句";
163
+ readonly 'detail.rail.hintPending': "点一下跳到这一句,会先补页";
164
+ readonly 'detail.rail.tooFar': "这句离现在太远,先点更近的一条。";
157
165
  readonly 'detail.viewMode.label': "工作步骤展示";
158
166
  readonly 'detail.viewMode.compact': "简洁";
159
167
  readonly 'detail.viewMode.standard': "标准";
@@ -186,7 +194,11 @@ declare const ZH: {
186
194
  readonly 'detail.attachment.saving': "保存中…";
187
195
  readonly 'detail.attachment.saveFailed': "保存失败:{message}";
188
196
  readonly 'detail.back': "← 返回清单";
189
- readonly 'detail.subagents.header': "子会话({n}) · {size},随本条一起恢复或删除";
197
+ readonly 'detail.subagents.label': "子会话";
198
+ readonly 'detail.subagents.note': "随本条一起恢复或删除";
199
+ readonly 'detail.subagents.expand': "展开子会话列表";
200
+ readonly 'detail.subagents.collapse': "收起子会话列表";
201
+ readonly 'detail.subagents.jump': "展开并跳到子会话段";
190
202
  readonly 'detail.subagents.open': "查看子会话详情";
191
203
  readonly 'detail.subagents.truncated': "仅列出前 {shown} 条,共 {total} 条";
192
204
  readonly 'detail.backToParent': "← 返回父会话";
@@ -1,5 +1,5 @@
1
1
  import { type Translate } from './copy.js';
2
- import { type DeleteConfirmDeps } from './remote.js';
2
+ import { type OneShotDeps } from './remote.js';
3
3
  /**
4
4
  * 被操作对象那张卡。`Modal`(`ui/Modal.tsx`,照官方抄的)的 `.sd-modal-body` 不设字号也不给层级 ⇒ 裸摆一行会话标题会和下面那句
5
5
  * 提示**同字同色**,读不出"这才是要被删的东西"。配方与「彻底删除」框里那张摘要卡同一套(宿主设置面
@@ -35,6 +35,6 @@ export declare function resetDeleteRequest(): void;
35
35
  * pill all belong here"):没有待确认的删除时什么都不渲染。
36
36
  */
37
37
  export declare function DeleteConfirmHost({ deps, t }: {
38
- deps: DeleteConfirmDeps;
38
+ deps: OneShotDeps;
39
39
  t?: Translate;
40
40
  }): import("react").JSX.Element | null;
@@ -6,10 +6,10 @@ export interface DeleteMenuItemProps {
6
6
  title: string;
7
7
  /** 会话在跑:这一行置灰,并把原因摆在行上。 */
8
8
  live?: boolean;
9
- /** 上方那条发丝线;缺省 true。多选入口排在删除前面时由它带线,删除行改成 false(`index.tsx`)。 */
9
+ /** 上方那条发丝线;缺省 true。多选入口排在删除前面时由它带线,删除行改成 false(`context-menu-actions.tsx`)。 */
10
10
  separatorBefore?: boolean;
11
11
  /**
12
- * 菜单 owner 交下来的「收起菜单」——槽位注入的 `useMenuOpenState`(`index.tsx` 的 `DeleteRow` 接住)。
12
+ * 菜单 owner 交下来的「收起菜单」——槽位注入的 `useMenuOpenState`(`context-menu-actions.tsx` 的 `DeleteRow` 接住)。
13
13
  * 「关不关菜单是 owner 的决定」是官方对该槽位的契约;按下这一行时**先发请求、再收菜单**。
14
14
  * 缺省不动,方便单独测这一行。
15
15
  */
@@ -0,0 +1,6 @@
1
+ /** 本插件在宿主注册面里的包名:槽位 id 与插件设置页 key 都长在它上面(`${PLUGIN_ID}.trash` 这类)。 */
2
+ export declare const PLUGIN_ID = "@xrn1997/dsh-session-delete";
3
+ /** 同一身份的点号写法:宿主的 `contextMenu.icon` key 与 `contextMenus` 贡献 id 用它。
4
+ * 这些名字由宿主按字面派发(key 撞上别人已占的那一格会顶掉占用者),所以它必须是本插件专属的;
5
+ * 点号形式与包名同源,改名时与 {@link PLUGIN_ID} 一起改,不在调用点另写一份字面量。 */
6
+ export declare const PLUGIN_KEY_PREFIX = "xrn1997.session-delete";
@@ -0,0 +1,22 @@
1
+ import { type Translate } from './copy.js';
2
+ import type { PromptRailNotice } from './use-prompt-rail.js';
3
+ import type { TrashDetailPromptWire } from '../shared/wire.js';
4
+ /** 轨宽(px):刻度与焦点环都按它排;面板的右槽宽度从它派生(`RAIL_GUTTER`)。 */
5
+ export declare const RAIL_WIDTH = 30;
6
+ export interface PromptRailProps {
7
+ readonly prompts: readonly TrashDetailPromptWire[];
8
+ /** 已加载的块 id:未加载的刻度更短更淡,预览卡里也明说「会先补页」。 */
9
+ readonly loadedIds: ReadonlySet<string>;
10
+ readonly activeId: string | null;
11
+ readonly busyId: string | null;
12
+ /** 跳转收手时的说明(目前只有「太远」一种)。 */
13
+ readonly notice: PromptRailNotice | null;
14
+ readonly onJump: (id: string) => void;
15
+ /** 右缘的定位表达式(`max(14px, calc(100% - <正文列宽>px))`):由面板从 `DETAIL_TEXT_MAX_WIDTH`
16
+ * 算好交进来,样式表不重抄列宽。 */
17
+ readonly right: string;
18
+ /** 详情保持期:轨跟着上一条的帧一起顶住,但整条不可交互(不把人补到别人的游标上)。 */
19
+ readonly disabled?: boolean;
20
+ readonly t: Translate;
21
+ }
22
+ export declare function PromptRail({ prompts, loadedIds, activeId, busyId, notice, onJump, right, disabled, t }: PromptRailProps): import("react").JSX.Element | null;
@@ -1,23 +1,23 @@
1
1
  /**
2
2
  * 浏览器半的取数通道:同源 fetch 宿主 `connection.fetch` 的 exact Fetch 路由(`/api` + 插件前缀)。
3
- * 信封与失败原文在这一层收口。
3
+ * **一次调用只有一种落地面**:`RemoteOutcome<T>`(成功带值 / 失败带 `RemoteFailure`)。信封解析、
4
+ * 401/403 原文、非信封诊断与网络失败归一都在这里一次完成——没有 raw 层、没有 make-it-throw 的适配层、
5
+ * 也没有调用点各自的 try/catch。
4
6
  *
7
+ * - 每段的**路径与方法**从 `src/shared/wire.ts` 的 `ROUTES` 投影(`{ path, method, body }`);本文件不写
8
+ * 段名或方法的第二份字面量,请求字段只由上面 interface 的签名决定(`body` 那一格是给 Node 半决定
9
+ * 「要不要预读 JSON」的,见 `src/api/route-table.ts`)。取数地址(官方 `/api` 前缀 + 文档挂载点)归
10
+ * `src/client/api-base.ts`(根部署下与旧版逐字相同)。
5
11
  * - 十段注册在宿主 `connection.fetch.register` 上,鉴权归宿主 `/api` bridge(ADR-0033);
6
12
  * 没有旧前缀 fallback——支持面是 web UI 与桌面端,二者的标准组合都装 `client-connection`。
7
13
  * 官方 remote.<namespace> 仍不可用(第三方拿不到 Typert 描述符的动态发现挂载点)。
8
- * - 十段的**段名与方法**住 `src/shared/wire.ts` 的结构化段名表(`ROUTES` 每项 `{ path, method }`),
9
- * 本文件只投影段名与方法(GET 段直接取 `ROUTES.x.method`,写段把它交给 `post()`)——方法字面量
10
- * 不在本文件出现第二份;取数地址(官方 `/api` 前缀 + 文档挂载点)归 `src/client/api-base.ts`
11
- * (根部署下与旧版逐字相同)。
12
- * 写动作统一走 apply;`attachment` 是唯一二进制段,由 `src/client/attachment-view.tsx` 经同一投影
13
- * 拼地址,不经过本文件的信封通道;`attachment-orphans`(纯读)与 `attachment-clean`(聚合写)是孤儿
14
- * 附件的两段。
15
- * - 信封与官方 unary 面同形:{ok:true,value} / {ok:false,error}。HTTP 往返本身失败才 reject;
16
- * 业务失败以信封返回,由 unwrapRemoteResult 在注入面抛出。
17
- * - error 在线上是 {code,message,details?} 普通对象;判别依据 isDSHRemoteError 住在
18
- * src/shared/wire.ts,这里不 import 任何宿主客户端包。
14
+ * - 写动作统一走 apply;`attachment` 是唯一二进制段,由 `src/client/attachment-view.tsx` 经同一投影
15
+ * 拼地址,不经过本文件的 JSON 通道;`attachment-orphans`(纯读)与 `attachment-clean`(聚合写)是
16
+ * 孤儿附件的两段。
17
+ * - 失败在线上是 {code,message,details?} 普通对象;本通道把它原样当数据交回,既不补标记位也不抛
18
+ * (标记位判别 isDSHRemoteError 的家在 src/shared/wire.ts,读它的是 Node 半),这里不 import 任何宿主客户端包。
19
19
  */
20
- import { type ApplyAction, type ApplyOutcome, type ApplyValueByAction, type AttachmentCleanupWire, type AttachmentOrphanReportWire, type OrphanReportWire, type PurgeStatsWire, type RemoteFailure, type RemoteResult, type SessionDeleteConfigWire, type TrashDetailWire, type TrashRowWire } from '../shared/wire.js';
20
+ import { type ApplyAction, type ApplyOutcome, type ApplyValueByAction, type AttachmentCleanupWire, type AttachmentOrphanReportWire, type OrphanReportWire, type PurgeStatsWire, type RemoteFailure, type SessionDeleteConfigWire, type TrashDetailWire, type TrashRowWire } from '../shared/wire.js';
21
21
  /**
22
22
  * 回收站条目(`/list` 那一行)。**形状的家在 `shared/wire.ts`**(ADR-0003):这里只是别名,
23
23
  * 所以浏览器半不再自己抄一遍字段;下面几处"只读面"的镜像同理。
@@ -32,15 +32,12 @@ export type PurgeResultLike = PurgeStatsWire;
32
32
  * 清册已有的字段一律不过线——组件按 `entryId` 与自己手上那份清单配对,这样"清单里的大小"和
33
33
  * "详情里的大小"永远是同一个数,不会因为两次读数不同而各说各话。
34
34
  * 例外只有一格:`subagents`(孩子摘要)。孩子不在客户端清单里、无从配对,
35
- * 它们的清册事实只能随详情过线(issue #7,ADR-0029)。
35
+ * 它们的清册事实只能随详情过线(issue #7;单级判据现由 ADR-0055 的「沿用」节承接)。
36
36
  */
37
37
  export type TrashDetailLike = TrashDetailWire;
38
- /** 任意异常 → 失败面。非带标记的失败(网络层、TypeError…)也保留原文,绝不吞;带标记的失败把
39
- * `details` 第三件一起带出。 */
40
- export declare function failureOf(reason: unknown): RemoteFailure;
41
- /** 注入面用的那一处展开:`ok ? value : throw Object.assign(new Error(error.message), { code })`。 */
42
- export declare function unwrapRemoteResult<T>(result: RemoteResult<T>): T;
43
- /** 一次远程调用的落地面:要么值,要么失败——调用方只做状态检查。 */
38
+ /** 一次远程调用的落地面:要么值,要么失败——所有操作都交这一种形状,调用方只做状态检查。
39
+ * 失败**不抛**:抛出来的失败面会让每个调用点再学一套 try/catch,也会让「返回的失败」与
40
+ * 「抛出的失败」变成两种落地。 */
44
41
  export type RemoteOutcome<T> = {
45
42
  ok: true;
46
43
  value: T;
@@ -49,48 +46,47 @@ export type RemoteOutcome<T> = {
49
46
  failure: RemoteFailure;
50
47
  };
51
48
  /**
52
- * 跑一次远程调用,把两种落地(值 / 抛出的失败)收成一个状态。
49
+ * 浏览器半的**唯一取数 interface**:每个操作交回同一种落地面 `RemoteOutcome<T>`。
53
50
  *
54
- * 「返回的失败」在这里不再是一种落地:`{ ok: false, error }` 已在注入面被 `unwrapRemoteResult`
55
- * 抛成了异常,所以到这一层的只有裸值或 throw——判别留在 `failureOf` 里(带标记位的失败带出它自己的
56
- * code,其余按原文兜底)。
51
+ * 两个 adapter 是真的:生产是同源 fetch({@link createHttpRemote}),测试是内存假件
52
+ * (`tests/client/support/fake-remote.ts`)。没有第二条「raw 信封」interface,也没有把信封
53
+ * 再展开成 throw 的中间层——失败形状从三种收成一种。
57
54
  */
58
- export declare function callRemote<T>(run: () => Promise<T>): Promise<RemoteOutcome<T>>;
59
- /** 本插件前缀路由那套**响应信封**的窄镜像(不是宿主服务 `ctx.remote.*`——那条 typert 通道为什么用不了,见 `AGENTS.md` 的 `remote.<namespace>` 那条):
60
- * 每个方法 resolve 成 `RemoteResult<T>`。十个段名里这层走九个 JSON 段:`list` / `ping` / `config` / `orphans` / `detail` / `apply` / `empty` /
61
- * `attachment-orphans` / `attachment-clean`;写动作统一走 `apply`(一组 id 进、逐条结果出);
62
- * `/attachment` 是二进制段,由 `src/client/attachment-view.tsx` 直接拼地址。 */
63
- export interface RawSessionDeleteRemote {
64
- list(): Promise<RemoteResult<TrashEntryLike[]>>;
55
+ export interface SessionDeleteRemote {
65
56
  /** 通道的"在不在":一次零成本的 GET(探测专用,见 `src/api/dispatch.ts` 的 `ping` 支)。
66
57
  * `signal` 由探测方给:半开连接不能把 `activate` 永远吊在这里。 */
67
- ping(signal?: AbortSignal): Promise<RemoteResult<string>>;
68
- /** 读三只可调项的当前值:空体 POST(与 `/detail` 的“POST 表达读”同法)。 */
69
- config(): Promise<RemoteResult<SessionDeleteConfigWire>>;
70
- /** 写回三只可调项:走宿主 `configEditor.edit`,这一行会重启;失败以 `io` 信封回来。 */
71
- saveConfig(config: SessionDeleteConfigWire): Promise<RemoteResult<SessionDeleteConfigWire>>;
72
- /** 纯读:回收站之外的无主子会话扫描。它**不清理**——清理是 `apply` 的 `orphan-clean` 动作,
73
- * 这一段只交回"有多少、在哪、多大"(读不到语料时报 `io`,调用方不许把它折成"零条残留")。 */
74
- orphans(): Promise<RemoteResult<OrphanReportWire>>;
75
- /** 纯读:`.dsh` 内无引用图片对象的数量、字节与预览清单(引用源读不出时报 `io`,不折成 0)。 */
76
- attachmentOrphans(): Promise<RemoteResult<AttachmentOrphanReportWire>>;
58
+ ping(signal?: AbortSignal): Promise<RemoteOutcome<string>>;
59
+ list(): Promise<RemoteOutcome<TrashEntryLike[]>>;
60
+ /** 三只可调项的当前值:空体 POST(与 `/detail` 的“POST 表达读”同法)。 */
61
+ config(): Promise<RemoteOutcome<SessionDeleteConfigWire>>;
62
+ /** 写回三只可调项:走宿主 `configEditor.edit`,这一行会重启;失败以 `io` 落地。 */
63
+ saveConfig(config: SessionDeleteConfigWire): Promise<RemoteOutcome<SessionDeleteConfigWire>>;
64
+ /** 纯读:回收站之外的无主子会话扫描。它**不清理**——清理是 `apply` 的 `orphan-clean` 动作。
65
+ * 读不到是失败,调用方不许把它折成"零条残留"。 */
66
+ scanOrphans(): Promise<RemoteOutcome<OrphanReportWire>>;
67
+ /** 纯读:`.dsh` 内无引用图片对象的数量、字节与预览清单(引用源读不出是失败,不折成 0)。 */
68
+ scanAttachmentOrphans(): Promise<RemoteOutcome<AttachmentOrphanReportWire>>;
77
69
  /** 聚合写:只删上一条报告那一刻无引用的图片对象,回 `AttachmentCleanupWire`。 */
78
- attachmentClean(): Promise<RemoteResult<AttachmentCleanupWire>>;
79
- detail(entryId: string, before?: number): Promise<RemoteResult<TrashDetailLike>>;
80
- /** 一组 id 上的同一个动作。顶层信封的 `ok:false` 只表示**整次调用**没办成(路由自检、栅栏之外);
70
+ cleanAttachmentOrphans(): Promise<RemoteOutcome<AttachmentCleanupWire>>;
71
+ detail(entryId: string, before?: number): Promise<RemoteOutcome<TrashDetailLike>>;
72
+ /** 一组 id 上的同一个动作。顶层 `ok:false` 只表示**整次调用**没办成(路由自检、栅栏之外);
81
73
  * 单条动作的成败住在 `ApplyOutcome` 里——这是批量接口的判据,别在信封层找它。 */
82
- apply(action: ApplyAction, ids: readonly string[]): Promise<RemoteResult<ApplyOutcome[]>>;
74
+ applyOutcomes(action: ApplyAction, ids: readonly string[]): Promise<RemoteOutcome<ApplyOutcome[]>>;
83
75
  /** 清空回收站:聚合回执,不按条回。 */
84
- empty(): Promise<RemoteResult<PurgeResultLike>>;
76
+ emptyTrash(): Promise<RemoteOutcome<PurgeResultLike>>;
85
77
  }
78
+ /** 插件设置页「可调项」卡只要这两件。 */
79
+ export type ConfigDeps = Pick<SessionDeleteRemote, 'config' | 'saveConfig'>;
80
+ /** 需要那一段 `/apply` 的组件只要这一段 deps(单条非写调用见 {@link applyOne},写动作走 `./write.js` 的 `runWrite`)。 */
81
+ export type OneShotDeps = Pick<SessionDeleteRemote, 'applyOutcomes'>;
86
82
  /**
87
- * exact Fetch 路由的 fetch 实现。**同源、带挂载点前缀**:不拼 host、不认 origin——页面本身就是从
83
+ * 唯一生产 adapter:同源 fetch。**同源、带挂载点前缀**:不拼 host、不认 origin——页面本身就是从
88
84
  * 宿主页面加载的,同源是这条通道的全部前提;路径只由 `api-base.ts` 从 `document.baseURI` 的目录
89
85
  * 与官方 `/api` 前缀拼出(根部署下与旧版逐字相同,反代到 `/dsh/` 时得到 `/dsh/api/...`)。
90
86
  * 鉴权归宿主 `/api` bridge(ADR-0033)。所以这条通道**只对**宿主页面打开过、带宿主身份的客户端
91
87
  * 成立(凭据是那次访问换来的 cookie,不是插件自己的秘密)。
92
88
  */
93
- export declare function createHttpRemote(): RawSessionDeleteRemote;
89
+ export declare function createHttpRemote(): SessionDeleteRemote;
94
90
  /** 探测默认上限:5s。超时经 `AbortController` 打断 fetch,`activate` 不会永远吊在一条半开连接上。 */
95
91
  export declare const PROBE_TIMEOUT_MS = 5000;
96
92
  /**
@@ -111,68 +107,25 @@ export interface ProbeOptions {
111
107
  * 「这一代不可用」,不自动重试(一次探测一个结论,刷新页面才会再探)。三种失败都在
112
108
  * console 留下原因——入口不出现是有意的,但"为什么没出现"不能只活在脑子里。
113
109
  */
114
- export declare function probeChannel(raw: RawSessionDeleteRemote, options?: ProbeOptions): Promise<boolean>;
110
+ export declare function probeChannel(deps: SessionDeleteRemote, options?: ProbeOptions): Promise<boolean>;
115
111
  /** `shared/wire.ts` 的 `ApplyOutcome`、扫描报告与附件回执从这里转出去——浏览器半只认 `remote.js` 这一扇门。 */
116
112
  export type { ApplyAction, ApplyOutcome, AttachmentCleanupWire, AttachmentOrphanReportWire, OrphanReportWire, } from '../shared/wire.js';
117
113
  /**
118
114
  * N=1 的成功支:`null` 已被 `receipt.ts` 的单条读法折成协议错,所以 `value` 必然非空。
119
115
  * 不再需要条件类型把 `delete` / `restore` 的 null 抠掉——那份判据只住回执读法一处。
116
+ * 成败判别只住外层 `RemoteOutcome.ok`(ADR-0053 唯一落地面),这里不再叠第二枚 ok。
120
117
  */
121
118
  export type OneShotSuccess<A extends ApplyAction> = {
122
119
  readonly id: string;
123
120
  readonly action: A;
124
- readonly ok: true;
125
121
  readonly value: Exclude<ApplyValueByAction[A], null>;
126
122
  };
127
- /**
128
- * 注入面(`deps`)的 interface:**九个方法**(raw 层另有 `ping` 供探测;十段里的 `/attachment` 由
129
- * `src/client/attachment-view.tsx` 直接拼地址,也不在这层)。
130
- *
131
- * **不再有 N=1 的便捷方法**:`delete` / `restore` / `countSubagents` 曾是同一段
132
- * `/apply` 的三种写法,于是一个 `module` 里同一个动作有两条路(回收站面板的 deps 同时躺着
133
- * `applyOutcomes` 与 `restore`)。现在单条非写调用(如 `count`)走自由函数 {@link applyOne};
134
- * 写动作走 `src/client/write.ts` 的 `runWrite`,而不是让 interface 多背三个方法。
135
- */
136
- export interface SessionDeleteRemote {
137
- list(): Promise<TrashEntryLike[]>;
138
- /** 三只可调项的当前值(`apply` 归一后的那一份)。 */
139
- config(): Promise<SessionDeleteConfigWire>;
140
- /** 写回三只可调项:宿主 `configEditor.edit` 落盘并重启这一行;失败就是 throw。 */
141
- saveConfig(config: SessionDeleteConfigWire): Promise<SessionDeleteConfigWire>;
142
- /** 回收站之外的无主子会话报告(纯读)。读不到就是 throw —— 界面上那是**一次失败的检查**,
143
- * 不是"零条残留"(把 `io` 折成空报告等于把"不知道"说成"没有")。 */
144
- scanOrphans(): Promise<OrphanReportWire>;
145
- /** `.dsh` 内无引用图片对象的报告(纯读;预览清单条数由 Node 半配置,默认 200)。读不到就是 throw,同样不许折成 0。 */
146
- scanAttachmentOrphans(): Promise<AttachmentOrphanReportWire>;
147
- /** 清掉报告那一刻无引用的图片副本(聚合回执)。 */
148
- cleanAttachmentOrphans(): Promise<AttachmentCleanupWire>;
149
- detail(entryId: string, before?: number): Promise<TrashDetailLike>;
150
- /** 一段管所有写动作:一次调用把整批办完,逐条结果原样交回组件。 */
151
- applyOutcomes(action: ApplyAction, ids: readonly string[]): Promise<ApplyOutcome[]>;
152
- /** 清空回收站(聚合回执)。 */
153
- emptyTrash(): Promise<PurgeResultLike>;
154
- }
155
- /** 插件设置页「可调项」卡只要这两件。 */
156
- export type ConfigDeps = Pick<SessionDeleteRemote, 'config' | 'saveConfig'>;
157
- /** 需要那一段 `/apply` 的组件只要这一段 deps(单条非写调用见 {@link applyOne},写动作走 `./write.js` 的 `runWrite`)。 */
158
- export type OneShotDeps = Pick<SessionDeleteRemote, 'applyOutcomes'>;
159
123
  /**
160
124
  * **N=1 的 `apply`**:一个动作 + 一个 id → 那一条的成功支(`value` 必然非空)。
161
125
  *
162
126
  * 三件事各归一个家:
163
127
  * - **按发出去的那个 id** 取结果(取"第一条"会把别条的成败安在这条头上);
164
128
  * - 成/败/幂等/缺失与「单条 null 是协议错」的判读只走 {@link readSingleReceipt};
165
- * - 这里只把 verdict 折成「拿到值 / 抛失败」。
166
- */
167
- export declare function applyOne<A extends ApplyAction>(deps: OneShotDeps, action: A, id: string): Promise<OneShotSuccess<A>>;
168
- /**
169
- * 注入面的**唯一一处适配**:`RemoteResult` → 裸值。
170
- *
171
- * **为什么必须有这一步**:通道那头的调用 resolve 成 `RemoteResult<T>`(`{ ok: true, value }` /
172
- * `{ ok: false, error }`),失败是**返回**而不是 reject。组件面要的是「拿到值 / 抛异常」,
173
- * 所以在这里展开一次:`ok ? value : throw`。
129
+ * - 这里只把 verdict 折成同一落地面(拿到值 / 失败),不抛——与通道的其余操作同一条契约。
174
130
  */
175
- export declare function buildDeps(raw: RawSessionDeleteRemote): SessionDeleteRemote;
176
- /** 「删除」确认框的宿主只需要那一段 `/apply`:删除前那一次计数走 {@link applyOne};
177
- * 提交删除走 `src/client/write.ts` 的 `runWrite`。 */
178
- export type DeleteConfirmDeps = OneShotDeps;
131
+ export declare function applyOne<A extends ApplyAction>(deps: OneShotDeps, action: A, id: string): Promise<RemoteOutcome<OneShotSuccess<A>>>;
@@ -0,0 +1 @@
1
+ export declare function resetClientState(): void;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * 会话行的 live 读法:菜单行与两枚勾选框行共用这一支。
3
+ *
4
+ * 从 `context-menu-actions.tsx` 分出:那个文件的例外只覆盖**菜单注册**(双轨协商与两个 icon key),
5
+ * 不把勾选行的读法也绑进菜单模块;否则菜单模块会因两类无关原因而变(Divergent Change)。
6
+ *
7
+ * root hook 缺席时走恒等兜底:`running` 判 false、`title` 取空串,hook 顺序不变。
8
+ * 读到 false 不等于「没在跑」;Node 半仍会拒绝 live 删除。
9
+ */
10
+ /** 宿主 root hook 交回的会话 state(只窄镜像本插件用到的两格)。 */
11
+ export interface SessionRowState {
12
+ byId?: Record<string, {
13
+ running?: boolean;
14
+ title?: string;
15
+ } | undefined>;
16
+ }
17
+ /** `ui-session` 通过 `ctx.slots.provideRoot({ hooks: { sessions: ctx.sessions.list } })` 提供的根
18
+ * hook(asar @22967283 原文)。 */
19
+ export type UseSessions = <T>(select: (state: SessionRowState | undefined) => T) => T;
20
+ /** 菜单贡献的订阅面只读 `running`;与 `SessionRowState` 同源、窄一格。 */
21
+ export interface SessionsStateLike {
22
+ byId?: Record<string, {
23
+ running?: boolean;
24
+ } | undefined>;
25
+ }
26
+ /** 会话是否在跑:state / 条目缺席都按「不知道」判 false(Node 半仍会拒绝 live 删除)。 */
27
+ export declare function runningOf(state: SessionsStateLike | undefined, sessionId: string): boolean;
28
+ /** 根 hook 缺失时的兜底:对空 state 求值。恒等身份,hook 顺序不变。 */
29
+ export declare const NEVER_SESSIONS: UseSessions;
30
+ /** 槽位行的 live 读法:root hook 缺席走 NEVER_SESSIONS 兜底;菜单行与两枚勾选框行共用这一支。 */
31
+ export declare function useSessionLive(useSessions: UseSessions | undefined, sessionId: string): boolean;
@@ -1,5 +1,6 @@
1
1
  /**
2
- * 回收站详情块:只画状态,不取数。选中、缓存、失败与重读都在面板控制器里。
2
+ * 回收站详情块:只画状态,不取数。选中与孩子视图归面板控制器;账本、失败与重读归
3
+ * `use-trash-detail-reader.ts`。
3
4
  *
4
5
  * 三条界面约束:
5
6
  * - 动作(恢复/彻底删除)留在清单行右侧;详情只负责看。
@@ -26,12 +27,19 @@ export type TrashDetailState = {
26
27
  kind: 'failed';
27
28
  entry: TrashEntryWire;
28
29
  message: string;
30
+ }
31
+ /** 换到没读过的条目时的「保持」:画的是上一条已就绪的详情,正文 `inert` + `aria-busy`;
32
+ * 超过静默窗口才在标题排出提示(`HOLD_NOTICE_DELAY_MS`)。首次读数没有上一条可保持,走 `loading`。 */
33
+ | {
34
+ kind: 'holding';
35
+ entry: TrashEntryWire;
36
+ detail: TrashDetailLike;
29
37
  } | {
30
38
  kind: 'ready';
31
39
  entry: TrashEntryWire;
32
40
  detail: TrashDetailLike;
33
41
  };
34
- /** 「加载更早」这一块(在飞/失败 + 滚动容器)整体过手:`TrashDetail` 只转交,谁画正文谁拆开用。
42
+ /** 分页这一块(在飞/失败 + 滚动容器)整体过手:`TrashDetail` 只转交,谁画正文谁拆开用。
35
43
  * 四样东西是一个概念(分页读面)的四个格子,打包走一个名字,不再逐样穿透组件边界。 */
36
44
  export interface DetailPager {
37
45
  /** 更早一页正在读。 */
@@ -45,8 +53,10 @@ export interface DetailPager {
45
53
  /** 详情的导航面(孩子视图的开与回):类型定义住在这里(视图定 prop 形状),
46
54
  * 控制器 `import type` 它避免环。判据(谁在场、title 给什么)住控制器的 `detailNav` 派生。 */
47
55
  export interface DetailNav {
48
- /** 只在主体是清单选中那条时交出(ADR-0029 单级判据的唯一实现)。 */
56
+ /** 只在主体是清单选中那条时交出(ADR-0055 沿用的单级判据,唯一实现)。 */
49
57
  readonly onOpenChild?: (child: TrashEntryWire) => void;
58
+ /** 与 `onOpenChild` 同进同出的意图预取:hover/focus 子会话行时先把它的详情读进来。 */
59
+ readonly onPrefetchChild?: (child: TrashEntryWire) => void;
50
60
  /** 孩子视图的返回目标;title 是原文(未命名兜底由视图按 t 处理)。 */
51
61
  readonly parentContext?: {
52
62
  readonly title: string;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * 回收站面板的**首帧快照**与**详情账本**:上一次成功读到的清单、选中与详情,跨面板挂载留一份。
3
+ *
4
+ * 为什么需要它:面板是宿主 `main` 的 keyed 占用者,切到会话时整棵卸载、回来整棵挂载;
5
+ * 如果状态只活在组件里,回来第一帧只能从 `loading` 起画,于是「正在读回收站…」→ 两栏 →
6
+ * 详情骨架在百来毫秒里轮换。宿主对同类问题的做法是「面板卸载、状态不丢」(插件管理页把
7
+ * controller / slot store 放在组件之外),这里把它收成本仓最小的形状:模块级、读一次、不订阅。
8
+ *
9
+ * 详情账本独立于清单快照存在:组件挂载先于清单成功读数时,详情读路仍要能落账;下一次成功
10
+ * 清单读数按行修剪它。它不是「清单状态」的第四态(三态仍住 `use-trash-query.ts`),
11
+ * 也不是持久化:进程重启就没了。**失败时整份丢掉**——读不到就不许再拿旧行冒充此刻的回收站
12
+ * (`unknown` 的老判据)。也不记折叠集、列宽、孩子视图:那些是视图状态,跨挂载记住会与
13
+ * ADR-0050/ui-spec 打架。
14
+ */
15
+ import type { TrashDetailLike, TrashEntryLike } from './remote.js';
16
+ /** 快照的形状:只搬清册/详情线上已有的只读事实,不带时间戳或"读了几次"这类读数。 */
17
+ export interface TrashSnapshot {
18
+ readonly rows: readonly TrashEntryLike[];
19
+ readonly selectedId: string | null;
20
+ readonly details: ReadonlyMap<string, TrashDetailLike>;
21
+ }
22
+ /** 读当前快照;没有(或已 clear)⇒ null。只在挂载首帧读一次,不做订阅。 */
23
+ export declare function readTrashSnapshot(): TrashSnapshot | null;
24
+ /** 读一条已成功读到的详情:详情账本的唯一读口,清单快照是否存在不影响它。
25
+ * 名字带 `Cached`:Node 半的 `trash/detail.ts` 也有一个 `readTrashDetail`(读会话日志),
26
+ * 两个「唯一实现」不是同一个东西,grep 不该把它们混在一起。 */
27
+ export declare function readCachedTrashDetail(entryId: string): TrashDetailLike | undefined;
28
+ /**
29
+ * 写入一份**成功**的清单读数:复制数组、按上一份清单修剪详情账本,选中行不在了就置空。
30
+ * 只修剪「上一份清单里出现过、这一份不见了」的条目:孩子详情从不在清单行里,不能被误删。
31
+ * 调用方是 `use-trash-query` 的 `reload` 成功支;失败支不许调它。
32
+ */
33
+ export declare function reconcileTrashRows(rows: readonly TrashEntryLike[]): void;
34
+ /** 记下选中行;没有清单快照时无处可挂,直接忽略。 */
35
+ export declare function writeTrashSelection(entryId: string | null): void;
36
+ /** 记下一条成功读到的详情;失败不写(失败由调用方落 `failed` 状态)。
37
+ * 写时复制:已经交出去的 `snapshot.details` 引用永远不再变,读方可以安全地比引用。 */
38
+ export declare function writeTrashDetail(entryId: string, detail: TrashDetailLike): void;
39
+ /** 丢掉一条详情(恢复 / 彻底删除成功、或那一条的读数失败)。写时复制,口径同 `writeTrashDetail`。 */
40
+ export declare function forgetTrashDetail(entryId: string): void;
41
+ /** 按写动作的成功名单丢一组详情(settlement 收尾与撤销座位共用):逐条走 `forgetTrashDetail`。 */
42
+ export declare function forgetTrashDetails(entryIds: readonly string[]): void;
43
+ /** 丢掉整份快照与详情账本:清单读失败、清空失败,以及测试/HMR 复位都走这一条。 */
44
+ export declare function clearTrashSnapshot(): void;
45
+ /**
46
+ * 只丢详情账本,清单快照原样留着:清空回收站**成功**后走这一条——`emptyTrash` 已经重读并
47
+ * `reconcileTrashRows([])` 写下过一份空清单,整份 clear 会把这份成功读数也丢掉,下一次挂载
48
+ * 又从「正在读回收站…」起画(ADR-0048 要消灭的正是这帧闪)。要丢的只有详情:随条目作废,
49
+ * 而且孩子详情不随清单修剪,不丢就永远留在账本里(ADR-0048 决定 4)。
50
+ */
51
+ export declare function clearTrashDetails(): void;
@@ -41,7 +41,8 @@ export declare const BULK_DANGER: CSSProperties;
41
41
  * 项目名怎么念:宿主的 `projectKey` 把 cwd 里的 `/`、`\`、`:` 全折成**一个** `-` ⇒ 分隔符那部分有损、
42
42
  * 拆不回真实路径;但**非分隔符那部分可逆**(`~XXXX` 十六进制码元,字面 `~` 编成 `~007E`)。
43
43
  * 摘掉 `--…--` 裹边、还原这些转义,剩下的原样摆出来,完整串交给组头 `title`。
44
- * 字母表只有一份:还原走 `shared/wire.ts`。
44
+ * 字母表只有一份:还原走 `src/shared/project-key.ts` 的 `unescapeProjectKey`;无 cwd 的目录名
45
+ * 也认同一个共享字面量(`NO_CWD_PROJECT_DIR`),不在浏览器半另写一份 `_no-cwd`。
45
46
  */
46
47
  export declare function projectLabel(projectDir: string, t: Translate): string;
47
48
  /** 清单上的一个项目组(组头 + 组内的条目,组内按删除时间倒序)。 */