@xrn1997/dsh-session-delete 0.9.0 → 0.11.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/README.md +40 -39
- package/lib/client.js +28235 -27782
- package/lib/index.js +2090 -1698
- package/lib/types/api/archive-rows.d.ts +4 -17
- package/lib/types/api/attachment-orphans.d.ts +3 -9
- package/lib/types/api/attachment.d.ts +4 -18
- package/lib/types/api/connection-route.d.ts +2 -6
- package/lib/types/api/route-table.d.ts +18 -59
- package/lib/types/api/trash-rows.d.ts +6 -22
- package/lib/types/client/api-base.d.ts +5 -12
- package/lib/types/client/archive-detail.d.ts +6 -14
- package/lib/types/client/archive-pane.d.ts +27 -24
- package/lib/types/client/archive-store.d.ts +7 -3
- package/lib/types/client/attachment-view.d.ts +3 -10
- package/lib/types/client/batch-bar.d.ts +4 -15
- package/lib/types/client/batch-confirm.d.ts +17 -22
- package/lib/types/client/batch-menu-item.d.ts +2 -10
- package/lib/types/client/batch-pick.d.ts +8 -14
- package/lib/types/client/batch-select.d.ts +11 -26
- package/lib/types/client/batch-selection-store.d.ts +25 -9
- package/lib/types/client/busy-gate.d.ts +2 -4
- package/lib/types/client/config-settings.d.ts +2 -3
- package/lib/types/client/confirm-dialog.d.ts +4 -7
- package/lib/types/client/context-menu-actions.d.ts +2 -8
- package/lib/types/client/context.d.ts +6 -15
- package/lib/types/client/copy.d.ts +36 -44
- package/lib/types/client/delete-confirm.d.ts +25 -13
- package/lib/types/client/delete-menu-item.d.ts +5 -9
- package/lib/types/client/detail-blocks.d.ts +5 -6
- package/lib/types/client/detail-ledger.d.ts +6 -10
- package/lib/types/client/detail-pane.d.ts +5 -10
- package/lib/types/client/drop-machine.d.ts +34 -0
- package/lib/types/client/host-archive-watch.d.ts +5 -18
- package/lib/types/client/host-rows.d.ts +31 -42
- package/lib/types/client/index.d.ts +5 -19
- package/lib/types/client/main-view.d.ts +25 -34
- package/lib/types/client/maintenance-parts.d.ts +2 -5
- package/lib/types/client/maintenance-settings.d.ts +3 -13
- package/lib/types/client/markdown.d.ts +4 -9
- package/lib/types/client/notice.d.ts +2 -5
- package/lib/types/client/orphan-maintenance.d.ts +7 -19
- package/lib/types/client/panel-tab.d.ts +39 -0
- package/lib/types/client/pending-open.d.ts +0 -1
- package/lib/types/client/plugin.d.ts +2 -4
- package/lib/types/client/prompt-rail.d.ts +1 -2
- package/lib/types/client/receipt.d.ts +13 -43
- package/lib/types/client/remote.d.ts +32 -98
- package/lib/types/client/scene.d.ts +41 -0
- package/lib/types/client/session-detail.d.ts +11 -41
- package/lib/types/client/session-list.d.ts +10 -44
- package/lib/types/client/session-live.d.ts +3 -13
- package/lib/types/client/settings-cards.d.ts +3 -6
- package/lib/types/client/settings-view.d.ts +1 -7
- package/lib/types/client/store.d.ts +6 -25
- package/lib/types/client/subagent-section.d.ts +4 -13
- package/lib/types/client/trash-confirm.d.ts +7 -9
- package/lib/types/client/trash-detail.d.ts +9 -12
- package/lib/types/client/trash-drop.d.ts +33 -0
- package/lib/types/client/trash-entry.d.ts +8 -2
- package/lib/types/client/trash-nav.d.ts +4 -11
- package/lib/types/client/trash-panel.d.ts +4 -6
- package/lib/types/client/trash-snapshot.d.ts +27 -22
- package/lib/types/client/trash-store.d.ts +12 -4
- package/lib/types/client/trash-tab.d.ts +22 -0
- package/lib/types/client/trash-view.d.ts +19 -49
- package/lib/types/client/ui/Checkbox.d.ts +5 -2
- package/lib/types/client/ui/ErrorBoundary.d.ts +2 -1
- package/lib/types/client/ui/Modal.d.ts +3 -1
- package/lib/types/client/ui/Toast.d.ts +6 -3
- package/lib/types/client/ui/icons.d.ts +16 -8
- package/lib/types/client/undo-notices.d.ts +45 -30
- package/lib/types/client/undo-toast.d.ts +6 -12
- package/lib/types/client/use-archive-detail-reader.d.ts +2 -3
- package/lib/types/client/use-archive-panel-controller.d.ts +9 -38
- package/lib/types/client/use-archive-query.d.ts +2 -0
- package/lib/types/client/use-column-resize.d.ts +4 -11
- package/lib/types/client/use-detail-frame.d.ts +50 -0
- package/lib/types/client/use-detail-pager.d.ts +5 -13
- package/lib/types/client/use-detail-rail.d.ts +5 -14
- package/lib/types/client/use-detail-reader.d.ts +5 -16
- package/lib/types/client/use-gated-refresh.d.ts +3 -3
- package/lib/types/client/use-list-selection.d.ts +5 -3
- package/lib/types/client/use-maintenance-section.d.ts +7 -12
- package/lib/types/client/use-maintenance.d.ts +7 -13
- package/lib/types/client/use-panel-child-view.d.ts +20 -0
- package/lib/types/client/use-panel-list-read.d.ts +51 -0
- package/lib/types/client/use-panel-selection.d.ts +1 -3
- package/lib/types/client/use-panel-tab.d.ts +134 -0
- package/lib/types/client/use-panel-width.d.ts +3 -11
- package/lib/types/client/use-prompt-rail.d.ts +8 -28
- package/lib/types/client/use-trash-detail-reader.d.ts +3 -10
- package/lib/types/client/use-trash-panel-controller.d.ts +14 -46
- package/lib/types/client/use-trash-query.d.ts +9 -25
- package/lib/types/client/use-write-progress.d.ts +26 -0
- package/lib/types/client/write-progress.d.ts +18 -0
- package/lib/types/client/write-seats.d.ts +33 -75
- package/lib/types/config.d.ts +8 -25
- package/lib/types/deps.d.ts +6 -11
- package/lib/types/domain/closure.d.ts +11 -30
- package/lib/types/errors.d.ts +6 -12
- package/lib/types/index.d.ts +9 -32
- package/lib/types/log/session-log.d.ts +33 -25
- package/lib/types/log/zstd-frames.d.ts +7 -29
- package/lib/types/ports/agent-handles.d.ts +10 -19
- package/lib/types/ports/attachments-port.d.ts +2 -6
- package/lib/types/ports/fs-port.d.ts +17 -31
- package/lib/types/ports/home.d.ts +7 -15
- package/lib/types/ports/host-port.d.ts +51 -98
- package/lib/types/ports/presence-port.d.ts +5 -12
- package/lib/types/remote/map-error.d.ts +4 -17
- package/lib/types/shared/apply-actions.d.ts +36 -0
- package/lib/types/shared/apply-values.d.ts +163 -0
- package/lib/types/shared/project-key.d.ts +5 -23
- package/lib/types/shared/session-path.d.ts +8 -33
- package/lib/types/shared/value-schema.d.ts +54 -0
- package/lib/types/shared/wire.d.ts +117 -249
- package/lib/types/trash/archive-detail.d.ts +9 -20
- package/lib/types/trash/attachments.d.ts +60 -46
- package/lib/types/trash/detail.d.ts +17 -36
- package/lib/types/trash/display-name.d.ts +2 -5
- package/lib/types/trash/entry.d.ts +19 -44
- package/lib/types/trash/groups.d.ts +17 -26
- package/lib/types/trash/ledger.d.ts +5 -11
- package/lib/types/trash/manifest.d.ts +4 -6
- package/lib/types/trash/projection-cache.d.ts +5 -11
- package/lib/types/trash/reconcile.d.ts +11 -23
- package/lib/types/trash/session-rows.d.ts +15 -35
- package/lib/types/trash/shrinking-view.d.ts +10 -11
- package/lib/types/trash/storage-manifest.d.ts +4 -7
- package/lib/types/trash/subagent-summary.d.ts +35 -0
- package/lib/types/verbs/batch-carried.d.ts +22 -4
- package/lib/types/verbs/batch.d.ts +39 -2
- package/lib/types/verbs/config.d.ts +3 -11
- package/lib/types/verbs/delete-session.d.ts +8 -13
- package/lib/types/verbs/empty-batch.d.ts +18 -0
- package/lib/types/verbs/live-admission.d.ts +3 -10
- package/lib/types/verbs/member-journal.d.ts +3 -7
- package/lib/types/verbs/member-presence.d.ts +7 -18
- package/lib/types/verbs/move-group.d.ts +2 -6
- package/lib/types/verbs/orphan-subagents.d.ts +23 -36
- package/lib/types/verbs/permanent-removal.d.ts +91 -84
- package/lib/types/verbs/restore-session.d.ts +10 -26
- package/lib/types/verbs/trash-scope.d.ts +21 -30
- package/lib/types/verbs/write-progress.d.ts +37 -0
- package/package.json +135 -134
- package/lib/types/client/reset-client-state.d.ts +0 -1
|
@@ -1,56 +1,45 @@
|
|
|
1
1
|
import type { PickItem } from './batch-selection-store.js';
|
|
2
2
|
export interface HostRowInfo {
|
|
3
|
-
/**
|
|
3
|
+
/** 槽位宿主投影的标题;守卫只读登记,不读 DOM 文本。 */
|
|
4
4
|
readonly title: string;
|
|
5
5
|
/** 在跑的行点整行也不选:与置灰的勾选框同口径(级联遇在跑成员整组拒绝)。 */
|
|
6
6
|
readonly live: boolean;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
/** 一台可见行登记现场:登记 / 查找 / 渲染快照 / 两个 hook / 收场。 */
|
|
9
|
+
export interface HostRowsScene {
|
|
10
|
+
/** 行槽位开关登记一行:模式内与模式外都要登记(守卫进模式的那一帧就得有标题)。 */
|
|
11
|
+
register(sessionId: string, info?: HostRowInfo): void;
|
|
12
|
+
/** 标题/运行态变了就地更新:**不注销、不重登记**,否则这一行会被挪到登记序末尾(ADR-0034 决定 2)。 */
|
|
13
|
+
update(sessionId: string, info: HostRowInfo): void;
|
|
14
|
+
/** 行槽位开关卸载时调用:那一行已经离开渲染树,登记跟着走(多实例按 owners 计数)。 */
|
|
15
|
+
unregister(sessionId: string): void;
|
|
16
|
+
/** 守卫与全选共用的一行读数:可勾选时交回登记;未登记或在跑回 `undefined`。 */
|
|
17
|
+
pickable(sessionId: string): HostRowInfo | undefined;
|
|
18
|
+
/** 只看「登记过没有」,不看跑不跑(模式内整行点击守卫用它判吞不吞这一下)。 */
|
|
19
|
+
registered(sessionId: string): HostRowInfo | undefined;
|
|
20
|
+
/** 当场读「当前可见」的可选行(事件路径与测试用)。 */
|
|
21
|
+
readVisible(): PickItem[];
|
|
22
|
+
/** 渲染侧快照(脏了才重读登记;干净时回同一引用)。 */
|
|
23
|
+
snapshot(): readonly PickItem[];
|
|
24
|
+
/** 渲染侧只读快照 + 订阅;`enabled === false` 不订阅也不读登记。 */
|
|
25
|
+
useVisible(enabled: boolean): readonly PickItem[];
|
|
26
|
+
/** 槽位组件共用的登记生命周期:挂载登记、卸载注销;标题/运行态变化只走更新口。 */
|
|
27
|
+
useRegistration(sessionId: string, info: HostRowInfo): void;
|
|
28
|
+
reset(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare function createHostRowsScene(): HostRowsScene;
|
|
12
31
|
export declare function registerHostRowInfo(sessionId: string, info?: HostRowInfo): void;
|
|
13
|
-
/**
|
|
14
|
-
* 标题/运行态变了就地更新:**不注销、不重登记**,否则这一行会被挪到登记序末尾(ADR-0034 决定 2)。
|
|
15
|
-
*/
|
|
16
32
|
export declare function updateHostRowInfo(sessionId: string, info: HostRowInfo): void;
|
|
17
|
-
/**
|
|
18
|
-
* 槽位组件共用的登记生命周期:挂载登记、卸载注销;标题/运行态变化只走更新口。
|
|
19
|
-
* 两次 effect 分工是顺序契约:先占住首次登记序,再填值。
|
|
20
|
-
*/
|
|
21
|
-
export declare function useHostRowRegistration(sessionId: string, info: HostRowInfo): void;
|
|
22
|
-
/** 行槽位开关卸载时调用:那一行已经离开渲染树,登记跟着走。
|
|
23
|
-
* 还有别的挂载实例在用同一行(重复行)就只减计数,不摘登记。 */
|
|
24
33
|
export declare function unregisterHostRowInfo(sessionId: string): void;
|
|
25
|
-
/**
|
|
26
|
-
* 守卫与全选共用的一行读数:这一行此刻可勾选时交回登记(含标题);未登记或在跑回 `undefined`。
|
|
27
|
-
* 登记表是可见行的事实源,所以"没登记"就是"这一行此刻不在可见集合里"。
|
|
28
|
-
*/
|
|
34
|
+
/** 守卫与全选共用的一行读数(默认场景)。 */
|
|
29
35
|
export declare function pickableRowOf(sessionId: string): HostRowInfo | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* 比 {@link pickableRowOf} 宽一档:只看「登记过没有」,不看跑不跑。
|
|
32
|
-
* 模式内的整行点击守卫用它判「吞不吞这一下」——在跑的行不勾选(与置灰勾选框同口径),
|
|
33
|
-
* 但那一行仍是本插件接管的可见会话行,点整行必须照旧被吃掉(否则会打开正在跑的会话)。
|
|
34
|
-
* 没登记的行才完全放行(别的列表 / 本插件没接管的行)。
|
|
35
|
-
*/
|
|
36
|
+
/** 模式内整行点击守卫用它判「吞不吞这一下」(默认场景)。 */
|
|
36
37
|
export declare function registeredHostRowOf(sessionId: string): HostRowInfo | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* 「当前可见」的可选行:**已登记**的会话行(槽位开关还挂在渲染树上)——折叠组、归档过滤外的行
|
|
39
|
-
* 没有挂载,因此没有登记;在跑的行跳过(与置灰勾选框同口径)。标题/运行态来自登记值;
|
|
40
|
-
* 顺序是登记顺序(宿主按列表顺序挂载行)。
|
|
41
|
-
*
|
|
42
|
-
* 这是**当场读**:事件路径(点「全选」那一刻的页面)与测试用它;渲染侧读下面的快照。
|
|
43
|
-
*/
|
|
38
|
+
/** 当场读「当前可见」的可选行(默认场景)。 */
|
|
44
39
|
export declare function readVisibleSelectableRows(): PickItem[];
|
|
45
|
-
/**
|
|
46
|
-
* 渲染侧的快照:脏了才重读登记;干净时回同一个引用(React 的 `useSyncExternalStore` 契约)。
|
|
47
|
-
* 没变化时连续两次调用必须同引用,否则订阅方会被自己的快照更新推成死循环。
|
|
48
|
-
*/
|
|
40
|
+
/** 渲染侧快照(默认场景)。 */
|
|
49
41
|
export declare function getVisibleSelectableRowsSnapshot(): readonly PickItem[];
|
|
50
|
-
/**
|
|
51
|
-
* 渲染侧只读快照 + 登记订阅;`enabled === false` 不订阅也不读登记——行列表只随多选态存在,
|
|
52
|
-
* 模式外不必付订阅的成本。
|
|
53
|
-
*/
|
|
42
|
+
/** 渲染侧只读快照 + 登记订阅(生产走 Provider 的那一份;测试无 Provider 回退默认场景)。 */
|
|
54
43
|
export declare function useVisibleSelectableRows(enabled: boolean): readonly PickItem[];
|
|
55
|
-
/**
|
|
56
|
-
export declare function
|
|
44
|
+
/** 槽位组件共用的登记生命周期(生产写进 Provider 的那一份;测试无 Provider 回退默认场景)。 */
|
|
45
|
+
export declare function useHostRowRegistration(sessionId: string, info: HostRowInfo): void;
|
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
export declare const name = "@xrn1997/dsh-session-delete/client";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* 取数通道不在这里——理由见文件头注(它不是 inject 能表达的事,写错了代价是进程死)。
|
|
6
|
-
* **`locale` 也不在这里**:宿主自己的 `ui-sidebar` 是硬注入它的,但那是"宿主知道自己那一代"的前提;
|
|
7
|
-
* 本插件要跨代活着 ⇒ 走 `ctx.get('locale')` 可选读,缺席时降级到内置 zh 文案(见 `copy.ts` 头注)。
|
|
8
|
-
* 写进 inject 就等于"这一代没有 locale 就不让整个客户端条目激活",而那等于宿主进程死。
|
|
9
|
-
* **`contextMenus` 同理**:0.2.2+ 用 `ctx.get('contextMenus')` 探测,服务比本条目晚到时按
|
|
10
|
-
* `ctx.inject(['contextMenus'])` 的 scoped 等待切过去;旧宿主没有这个服务时回调不来,legacy 槽位留着。
|
|
11
|
-
* 条目自己的 `inject` 仍然只有 `slots`——把可能迟到的服务写进去等于让整个客户端条目 pending。
|
|
12
|
-
*/
|
|
2
|
+
/** 只列**宿主公开面保证存在**的成员(`slots` 是冻结平台模块表里的静态键)。取数通道、`locale`、
|
|
3
|
+
* `contextMenus` 都不在这里:它们走 `ctx.get` 可选读,写进 `inject` 等于这一代缺它就不激活
|
|
4
|
+
* ⇒ 宿主进程死。`contextMenus` 迟到时按 `ctx.inject` scoped 等待切过去,旧宿主没有就留 legacy 槽位。 */
|
|
13
5
|
export declare const inject: string[];
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* 注册挂在探测的续拍上,两条理由:① 前端启动自检只看 entry 声明的 `inject` 服务齐不齐(`slots`
|
|
18
|
-
* 一定在),不看它注册了几行;② 槽位注册是注册表的一次 mutation,渲染层按微任务批量订阅
|
|
19
|
-
* (`SlotCore` 的变更传播契约),晚一拍注册照常上屏——宿主侧栏对 `sidebar.panellist` 正是
|
|
20
|
-
* `ctx.slots.subscribe("sidebar.panellist", syncPanels)`(asar @44795361)。
|
|
21
|
-
*/
|
|
6
|
+
/** 入口:**同步返回、绝不抛**。注册挂在探测的续拍上:前端启动自检只看 entry 声明的 `inject` 服务齐不齐,
|
|
7
|
+
* 且槽位注册是注册表的一次 mutation、渲染层按微任务批量订阅,晚一拍注册照常上屏。 */
|
|
22
8
|
export declare function apply(ctx: unknown): void;
|
|
@@ -1,43 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 宿主**主视图**的一处窄面:删掉当前打开的会话时把它关掉,撤销恢复后把它重开。
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
*
|
|
9
|
-
* 发现当前会话进了归档集就 `clearMain()`(`dsh-client-ui-workspace/lib/client.js`)。
|
|
10
|
-
*
|
|
11
|
-
* 所以关闭/重开是**一段生命周期**,不是一个 id:删除成功后 `afterDelete` 关掉当前
|
|
12
|
-
* 主视图并记下"这一条是我们关掉的";撤销成功后 `afterRestore` 只重开自己记过的那些。调用方不再
|
|
13
|
-
* 各自判定该不该关、也不再把会话 id 塞进撤销提示传一圈——判据全在这一处。两次重开排队时只有最新
|
|
14
|
-
* 那条会打开(等待本身住 `src/client/pending-open.ts` 的票与订阅),`resetMainView()` 清掉这份记忆
|
|
15
|
-
* 并取消在等的重开。
|
|
16
|
-
*
|
|
17
|
-
* **不 import 宿主客户端包**(AGENTS.md 红线):只通过 `ctx.get('uiWorkspace')` 可选读服务,
|
|
18
|
-
* 形状不符/服务缺席都安静退回,绝不影响插件激活。字段与方法名来自上面两个包的产物原文;
|
|
19
|
-
* 宿主换代时先复核 `UiWorkspaceService` 的 `selection` / `sessions` / `clearMain` / `openSession`。
|
|
3
|
+
* 宿主常驻 `Session` 的 `removed` 是**粘性**的(`dsh-api-session-controller/lib/client.js` 的 `handleRemoved()`
|
|
4
|
+
* 只置位,`handleSessionAdded()` 只 merge 摘要、从不清它),除非把
|
|
5
|
+
* 常驻实例本身丢掉:所以关闭/重开是**一段生命周期**,不是一个 id——`afterDelete` 只记我们自己关过的,
|
|
6
|
+
* `afterRestore` 只重开记过的;两次重开排队时只有最新那条会打开(等待住 `pending-open.ts`)。
|
|
7
|
+
* 归档时 `clearMain()` 的判据在 `dsh-client-ui-workspace/lib/client.js`。
|
|
8
|
+
* 不 import 宿主客户端包(AGENTS.md 红线):只通过 `ctx.get('uiWorkspace')` 可选读服务,形状不符/缺席安静退回。
|
|
20
9
|
*/
|
|
21
10
|
import type { ClientContextLike } from './context.js';
|
|
22
|
-
/**
|
|
11
|
+
/** 一台主视图收尾现场:绑定宿主 / 关主视图 / 重开 / 遗忘 / 收场。 */
|
|
12
|
+
export interface MainViewScene {
|
|
13
|
+
/** 入口激活时绑一次;之后每次调用再读服务(客户端插件激活顺序早于 `uiWorkspace` 也没关系)。 */
|
|
14
|
+
bind(ctx: ClientContextLike): void;
|
|
15
|
+
/** 测试/场景收场:记忆清空、在等的重开作废。 */
|
|
16
|
+
reset(): void;
|
|
17
|
+
/** 删除成功后调用:当前主视图若在这批里,把它关掉并记下"这一条是我们关掉的"(供撤销重开)。 */
|
|
18
|
+
afterDelete(sessionIds: readonly string[]): void;
|
|
19
|
+
/** 撤销恢复成功后调用:把**我们自己关掉的**那几个会话重新打开(只认 `afterDelete` 记过的)。 */
|
|
20
|
+
afterRestore(sessionIds: readonly string[]): void;
|
|
21
|
+
/** 面板恢复已经替这些会话完成结算:只忘掉我们关过的那几条,不重开、不抢焦点。 */
|
|
22
|
+
forget(sessionIds: readonly string[]): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function createMainViewScene(): MainViewScene;
|
|
25
|
+
/** 入口激活时绑一次(默认场景)。 */
|
|
23
26
|
export declare function bindMainView(ctx: ClientContextLike): void;
|
|
24
|
-
/**
|
|
27
|
+
/** 测试专用:默认场景的主视图现场归零(记忆清空、在等的重开作废)。 */
|
|
25
28
|
export declare function resetMainView(): void;
|
|
26
|
-
/**
|
|
27
|
-
* 删除成功后调用:当前主视图若在这批里,把它关掉并记下"这一条是我们关掉的"(供撤销重开)。
|
|
28
|
-
* 关不掉/不是当前会话都什么都不做——这只是界面收尾,绝不让删除结果变红。
|
|
29
|
-
*/
|
|
29
|
+
/** 删除成功后调用(默认场景):当前主视图若在这批里,把它关掉并记下。 */
|
|
30
30
|
export declare function afterDelete(sessionIds: readonly string[]): void;
|
|
31
|
-
/**
|
|
32
|
-
* 撤销恢复成功后调用:把**我们自己关掉的**那几个会话重新打开(只认 `afterDelete` 记过的)。
|
|
33
|
-
*
|
|
34
|
-
* 一批里只有最后一条会开(`targets[targets.length - 1]`):主视图一次只装一个会话,而撤销恢复
|
|
35
|
-
* 的成功条数可能多于一条;`openWhenListed` 的最新票守卫保证前一条的等待不会后落地抢焦点。
|
|
36
|
-
* 任何更新的删除/恢复都会先作废旧等待;这里只负责「这一次要开哪一条」。
|
|
37
|
-
*/
|
|
31
|
+
/** 撤销恢复成功后调用(默认场景):重开我们自己关掉的会话。 */
|
|
38
32
|
export declare function afterRestore(sessionIds: readonly string[]): void;
|
|
39
|
-
/**
|
|
40
|
-
* 面板恢复已经替这些会话完成了“回来”的结算:只忘掉我们关过的那几条,不重开、不抢焦点。
|
|
41
|
-
* 它不动 `reopen`:同一会话不会既在等重开、又躺在回收站里等面板恢复;在等的重开属于另一条动作。
|
|
42
|
-
*/
|
|
33
|
+
/** 面板恢复后遗忘(默认场景):只忘、不重开。 */
|
|
43
34
|
export declare function forgetMainView(sessionIds: readonly string[]): void;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* 三段(孤儿会话 / 孤儿附件 / 投影缓存)在结构上只差正文:图标、底色、动作按钮与失败块的
|
|
5
|
-
* 「原文 + 重试」都一样。收在这里,改布局或按钮材质时不必逐段改;正文仍由各段自己给。
|
|
6
|
-
* 清理后的回执行不在本文件:它同时被回收站面板用到,住中立模块 `src/client/notice.tsx`。
|
|
2
|
+
* 维护卡各段共用的两块皮:警告条外壳与失败块。三段只差正文;清理后的回执行不在本文件,
|
|
3
|
+
* 它同时被回收站面板用到,住中立模块 `notice.tsx`。
|
|
7
4
|
*/
|
|
8
5
|
import type { ReactElement, ReactNode } from 'react';
|
|
9
6
|
import type { Translate } from './copy.js';
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 插件设置页的「维护」卡(ADR-0021
|
|
3
|
-
*
|
|
4
|
-
* 三段都是**手动**的:检查 → 预览 → 清理,没有挂载即扫、没有定时器。卡片的职责只有呈现:
|
|
5
|
-
* 状态那一行、检查按钮、以及各段自己的横幅 / 失败 / 提示 / 确认框;读数与动作全归
|
|
6
|
-
* `src/client/use-maintenance.ts`。两张卡的先后与 `summary` 守卫在 `src/client/settings-cards.tsx`。
|
|
7
|
-
*
|
|
8
|
-
* 与回收站面板的区别:这里没有面板高度、没有清单与详情两栏、没有全局闸。控件只用
|
|
9
|
-
* `settingsCardShell` / `Button` / `Modal` / `fileSizeText`,所以同一张卡放在插件详情页的任意宽度下都成立。
|
|
10
|
-
*
|
|
11
|
-
* 孤儿会话段直接复用 `OrphanMaintenance`(警告条 / 失败 / 中性提示 / 预览确认的既有呈现);
|
|
12
|
-
* 孤儿附件段是本文件里的 `AttachmentMaintenance`(横幅 + 失败 + 回执 + 缩略图预览与清理确认);
|
|
13
|
-
* 投影缓存段是 `ProjectionMaintenance`(横幅 + 失败 + 回执 + 只按条数确认)。
|
|
2
|
+
* 插件设置页的「维护」卡(ADR-0021)。三段都是**手动**的(检查 → 预览 → 清理,没有挂载即扫、没有定时器),
|
|
3
|
+
* 卡片只呈现,读数与动作归 `use-maintenance.ts`;孤儿会话段复用 `OrphanMaintenance`,另两段在本文件。
|
|
14
4
|
*/
|
|
15
5
|
import type { ReactElement } from 'react';
|
|
16
6
|
import { type Translate } from './copy.js';
|
|
17
7
|
import { type MaintenanceDeps } from './use-maintenance.js';
|
|
18
8
|
export interface MaintenanceSettingsProps {
|
|
19
|
-
/**
|
|
9
|
+
/** 维护七件(三段读数与动作 + 进度认领那一读);可调项两件由占用者另发给「可调项」卡。 */
|
|
20
10
|
deps: MaintenanceDeps;
|
|
21
11
|
/** 文案(缺省 = 内置 zh;宿主 locale 服务缺席时也是它,见 `copy.ts`)。 */
|
|
22
12
|
t?: Translate;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import type { Translate } from './copy.js';
|
|
2
2
|
import './ui/styles.js';
|
|
3
3
|
/**
|
|
4
|
-
* `memo` 是必需的而不是优化:`react-markdown@10.1.0` 里**一处 memoization
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 按住的条件是 `text` 与**探针 `probe`**:一句按当前 locale 现算的译文,专给 comparator 当
|
|
9
|
-
* 「换语言了没」的读数。为什么必须渲染时现算存进 props、为什么宿主 `t` 只能当稳定身份而不是
|
|
10
|
-
* 语言读数、「借哪句」,这些都住 `copy.ts` 的 `localeProbe`——调用方与测试一律
|
|
11
|
-
* `probe={localeProbe(t)}`,「借哪句」的知识不散到各调用方。
|
|
12
|
-
* 探针没变 = 同语言同 `t` ⇒ 跳过重解析;变了(换语言或换 `t`)⇒ 重解析。
|
|
4
|
+
* `memo` 是必需的而不是优化:`react-markdown@10.1.0` 里**一处 memoization 都没有**,面板任何一次重渲
|
|
5
|
+
* (悬停、↑↓、「刚刚删除」那句要读 `Date.now()`)都会走到这里 ⇒ 不按住就是每条助手回复每拍重解析一遍。
|
|
6
|
+
* 按住条件是 `text` 与探针 `probe`(按当前 locale 现算的译文,专给 comparator 当「换语言了没」的读数;
|
|
7
|
+
* 「借哪句」的知识住 `copy.ts` 的 `localeProbe`,调用方一律 `probe={localeProbe(t)}`)。
|
|
13
8
|
*/
|
|
14
9
|
export declare const MarkdownBody: import("react").NamedExoticComponent<{
|
|
15
10
|
text: string;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 一段**状态回执行**:清理后的中性 / 成功 /
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* 它住在中立模块而不是维护卡里:回收站面板的附件清理提示与设置页维护卡的三段都用它,
|
|
6
|
-
* 面板不该为了一个回执行去 import 设置卡模块。
|
|
2
|
+
* 一段**状态回执行**:清理后的中性 / 成功 / 警告摘要。不是失败块,也不冒充检查状态;没有话说时整块不画。
|
|
3
|
+
* 住中立模块(回收站面板与设置页维护卡共用):面板不该为一个回执行去 import 设置卡模块。
|
|
7
4
|
*/
|
|
8
5
|
import type { ReactElement } from 'react';
|
|
9
6
|
export interface NoticeProps {
|
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* 之所以仍收成一个 module:这三段与任何一面的清单渲染、选择、键盘、拖栏都毫无关系;改维护块的文案或
|
|
6
|
-
* 确认框时,diff 不该与布局改动互相踩。它只吃泛型段 module 的一张视图 `MaintenanceSectionView`——
|
|
7
|
-
* 报告、三条提示、确认框与四个动作;实现方是 `use-maintenance-section.ts` 的状态机
|
|
8
|
-
* (设置页的 `use-maintenance.ts` 为孤儿会话段实例化它)。
|
|
9
|
-
*
|
|
10
|
-
* 三条界面规则(现状住 `docs/ui-spec.md`):
|
|
11
|
-
* - **报告非空才出警告条**:空报告与 `null` 都不出现——"检查过了,什么都没有"不是要给用户看的东西,
|
|
12
|
-
* 而"还没扫到"更不是"零条"。
|
|
13
|
-
* - **读不到就说读不到**:检查/清理失败在原位摆原文 + 重试,绝不静默折成一条都不出现
|
|
14
|
-
* ("没能回答有多少残留"与"没有残留"是两件事,不许折成空报告)。
|
|
15
|
-
* - **「已经不在」不是失败**:别处清掉或父已回到清册时单独一条中性提示,不计入失败,下次检查时自然消失。
|
|
16
|
-
*
|
|
17
|
-
* 四个动作都从段上取:警告条开预览(`openPreview`,唯一开门、先清旧提示)、失败块重试(`scan`)、
|
|
18
|
-
* 确认框清理(`clean`)、取消(`cancel`,只收框)。`busy` 也不再是 prop——段自己给(在飞即忙),
|
|
19
|
-
* 本块只读它按住按钮。
|
|
2
|
+
* 无主子会话的**维护块**:警告条、失败块、中性提示与清理确认框(现住插件设置页维护卡,ADR-0021)。
|
|
3
|
+
* 只吃泛型段视图 `MaintenanceSectionView`。三条界面规则:报告非空才出警告条;读不到就说读不到
|
|
4
|
+
* (原位原文 + 重试,不折成空报告);「已经不在」不是失败(中性提示,下次检查自然消失)。
|
|
20
5
|
*/
|
|
21
6
|
import type { ReactElement } from 'react';
|
|
22
7
|
import type { Translate } from './copy.js';
|
|
23
8
|
import type { OrphanReportWire } from '../shared/wire.js';
|
|
9
|
+
import type { OneShotDeps } from './remote.js';
|
|
24
10
|
import type { MaintenanceSectionView } from './use-maintenance-section.js';
|
|
25
11
|
export interface OrphanMaintenanceProps {
|
|
26
12
|
/** 段视图:读数、提示、确认框、忙碌与四个动作都在它上面,本块不多要也不少读。 */
|
|
27
13
|
section: MaintenanceSectionView<OrphanReportWire>;
|
|
14
|
+
/** 确认框里的进度行要轮询 `/progress`(写身份认领),走同一份取数依赖。 */
|
|
15
|
+
deps: OneShotDeps;
|
|
28
16
|
t: Translate;
|
|
29
17
|
}
|
|
30
|
-
export declare function OrphanMaintenance({ section, t }: OrphanMaintenanceProps): ReactElement | null;
|
|
18
|
+
export declare function OrphanMaintenance({ section, deps, t }: OrphanMaintenanceProps): ReactElement | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 一档的**四格版面**:工具行 / 清单 / 详情 / 页脚。两档共用容器与分栏/下钻分支,视图件只交四个槽位与
|
|
3
|
+
* 三格布局事实。版面判据住 `docs/ui-spec.md` §3:工具行住在 body **之外**(长清单滚到底也不滚走);
|
|
4
|
+
* 两栏成立时清单可拖定宽、详情吃余下,否则铺满。返回 **fragment**(不新增 DOM 容器)。
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactNode, RefObject } from 'react';
|
|
7
|
+
import type { Translate } from './copy.js';
|
|
8
|
+
import type { ListDom } from './session-list.js';
|
|
9
|
+
import type { ColumnResizeHandleProps } from './use-column-resize.js';
|
|
10
|
+
import type { DetailRail } from './use-detail-rail.js';
|
|
11
|
+
/** 详情格的槽位:外壳由帧统一画,调用方只交外壳要的四格(档位、滚动容器、轨接线、正文)。 */
|
|
12
|
+
export interface PanelTabDetail {
|
|
13
|
+
readonly kind: ListDom['kind'];
|
|
14
|
+
readonly scrollRef: RefObject<HTMLDivElement>;
|
|
15
|
+
readonly rail: DetailRail;
|
|
16
|
+
readonly children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/** 一档视图要的布局事实(几何住面板:断点与列宽拖拽不搬进档里;帧与视图只消费这两格)。 */
|
|
19
|
+
export interface PanelTabFrameLayout {
|
|
20
|
+
readonly listWidth: number;
|
|
21
|
+
readonly handleProps: ColumnResizeHandleProps;
|
|
22
|
+
}
|
|
23
|
+
export interface PanelTabFrameProps {
|
|
24
|
+
/** 两栏成立(宽槽 + 清单有行)。 */
|
|
25
|
+
readonly split: boolean;
|
|
26
|
+
/** 窄档下详情栏在 DOM 里(宽档恒真,本组件按 `split` 先用)。 */
|
|
27
|
+
readonly detailMounted: boolean;
|
|
28
|
+
readonly listWidth: number;
|
|
29
|
+
readonly handleProps: ColumnResizeHandleProps;
|
|
30
|
+
/** 工具行的 DOM 身份(回收站档带 `trash-toolbar`,归档档的标识挂在它自己的工具行里)。 */
|
|
31
|
+
readonly toolbarAttr?: string;
|
|
32
|
+
readonly toolbar: ReactNode;
|
|
33
|
+
readonly list: ReactNode;
|
|
34
|
+
readonly detail: PanelTabDetail;
|
|
35
|
+
readonly footer: ReactNode;
|
|
36
|
+
readonly t: Translate;
|
|
37
|
+
}
|
|
38
|
+
/** 四格版面本体。`split` 时清单定宽 + 把手 + 详情;否则 `detailMounted` 时详情铺满,其余清单铺满。 */
|
|
39
|
+
export declare function PanelTabFrame({ split, detailMounted, listWidth, handleProps, toolbarAttr, toolbar, list, detail, footer, t, }: PanelTabFrameProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export interface PendingOpenInput {
|
|
2
2
|
/** 订阅「清单变了」;返回退订。旧 store 可能没有——那时只有"已经出现"这一支能开。 */
|
|
3
3
|
readonly subscribe?: ((listener: () => void) => () => void) | undefined;
|
|
4
|
-
/** 目标是否已经出现在清单里。 */
|
|
5
4
|
readonly isReady: () => boolean;
|
|
6
5
|
/** 出现的这一拍还该不该抢焦点(用户可能已经选了别的会话)。 */
|
|
7
6
|
readonly canOpen: () => boolean;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** 包名:槽位 id 与插件设置页 key 都长在它上面。 */
|
|
2
2
|
export declare const PLUGIN_ID = "@xrn1997/dsh-session-delete";
|
|
3
|
-
/**
|
|
4
|
-
* 这些名字由宿主按字面派发(key 撞上别人已占的那一格会顶掉占用者),所以它必须是本插件专属的;
|
|
5
|
-
* 点号形式与包名同源,改名时与 {@link PLUGIN_ID} 一起改,不在调用点另写一份字面量。 */
|
|
3
|
+
/** 同一身份的点号写法:宿主按字面派发、撞名即顶掉占用者,必须专属;改名时与 {@link PLUGIN_ID} 一起改。 */
|
|
6
4
|
export declare const PLUGIN_KEY_PREFIX = "xrn1997.session-delete";
|
|
@@ -12,8 +12,7 @@ export interface PromptRailProps {
|
|
|
12
12
|
/** 跳转收手时的说明(目前只有「太远」一种)。 */
|
|
13
13
|
readonly notice: PromptRailNotice | null;
|
|
14
14
|
readonly onJump: (id: string) => void;
|
|
15
|
-
/**
|
|
16
|
-
* 算好交进来,样式表不重抄列宽。 */
|
|
15
|
+
/** 右缘的定位表达式(正文列宽的函数):由面板算好交进来,样式表不重抄列宽。 */
|
|
17
16
|
readonly right: string;
|
|
18
17
|
/** 详情保持期:轨跟着上一条的帧一起顶住,但整条不可交互(不把人补到别人的游标上)。 */
|
|
19
18
|
readonly disabled?: boolean;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import type { Translate } from './copy.js';
|
|
2
2
|
import { type ApplyAction, type ApplyOutcome, type ApplyValueByAction, type AttachmentCleanupWire, type RemoteFailure } from '../shared/wire.js';
|
|
3
3
|
/**
|
|
4
|
-
* 一条 `/apply` 结果对一个请求 id
|
|
5
|
-
*
|
|
6
|
-
* **N=1 的 `null` 是协议错**——最后这条也在这里判,`applyOne` 与 `runWrite` 只消费同一份 verdict。
|
|
7
|
-
*
|
|
8
|
-
* 各 action 可能出现的 kind(类型面故意保持同一个联合,消费方按 action 自己收窄):
|
|
9
|
-
* - delete / restore:`ok` / `already-gone` / `failed` / `missing`
|
|
10
|
-
* - count / purge / unarchive:`ok` / `failed` / `missing`
|
|
11
|
-
* - orphan-clean:`ok` / `neutral` / `failed` / `missing`
|
|
12
|
-
* - 单条读法(`readSingleReceipt`):不含 `already-gone`;null 折成 `failed`
|
|
4
|
+
* 一条 `/apply` 结果对一个请求 id 的含义(各写入面不许再各自推导):缺 id 是通道错误,`null` 是幂等成功,
|
|
5
|
+
* orphan-clean 的 `not-found` 是中性提示,**N=1 的 `null` 是协议错**;`applyOne` 与 `runWrite` 只消费同一份 verdict。
|
|
13
6
|
*/
|
|
14
7
|
export type ReceiptVerdict<A extends ApplyAction> = {
|
|
15
8
|
readonly kind: 'ok';
|
|
@@ -32,7 +25,6 @@ export type ReceiptVerdict<A extends ApplyAction> = {
|
|
|
32
25
|
readonly message: string;
|
|
33
26
|
};
|
|
34
27
|
export interface Receipt<A extends ApplyAction> {
|
|
35
|
-
/** 产生这份回执的动作:摘要据此只派发该动作真的有的那几种落地 id。 */
|
|
36
28
|
readonly action: A;
|
|
37
29
|
readonly verdicts: readonly ReceiptVerdict<A>[];
|
|
38
30
|
readonly byId: ReadonlyMap<string, ReceiptVerdict<A>>;
|
|
@@ -40,7 +32,6 @@ export interface Receipt<A extends ApplyAction> {
|
|
|
40
32
|
/** 浏览器半自己的未分类诊断码(通道打不通 / 非信封 / 单条协议错)。它不过线,线上失败码仍归 `shared/wire.ts`。 */
|
|
41
33
|
export declare const CLIENT_UNKNOWN_CODE = "client/unknown";
|
|
42
34
|
export interface ReceiptOptions {
|
|
43
|
-
/** N=1:null 只能是通道答错了,不冒充幂等成功。 */
|
|
44
35
|
readonly single?: boolean;
|
|
45
36
|
}
|
|
46
37
|
export type SingleReceiptVerdict<A extends ApplyAction> = Exclude<ReceiptVerdict<A>, {
|
|
@@ -51,20 +42,14 @@ export interface SingleReceipt<A extends ApplyAction> {
|
|
|
51
42
|
readonly byId: ReadonlyMap<string, SingleReceiptVerdict<A>>;
|
|
52
43
|
}
|
|
53
44
|
export declare function missingOutcomeMessage(action: ApplyAction, id: string): string;
|
|
54
|
-
/** 三种“这一条没成”的 verdict;`failureMessage` 是它们原文取值的唯一入口。 */
|
|
55
45
|
export type FailureVerdict<A extends ApplyAction> = Extract<ReceiptVerdict<A>, {
|
|
56
46
|
kind: 'failed' | 'neutral' | 'missing';
|
|
57
47
|
}>;
|
|
58
|
-
/** failed / neutral 取服务端原文 `error.message`;missing 取通道自己写的那句。 */
|
|
59
48
|
export declare function failureMessage<A extends ApplyAction>(verdict: FailureVerdict<A>): string;
|
|
60
49
|
export declare function readReceipt<A extends ApplyAction>(action: A, requestedIds: readonly string[], outcomes: readonly ApplyOutcome[], options?: ReceiptOptions): Receipt<A>;
|
|
61
|
-
/**
|
|
62
|
-
* N=1 的读法:null 折成协议错,类型面因此不含 `already-gone`(下面那次过滤只服务类型收窄,
|
|
63
|
-
* single 读法运行期不会产出它)。`applyOne` 用它之后只剩「按 id 取一条 + 抛失败」。
|
|
64
|
-
*/
|
|
50
|
+
/** N=1 读法:`null` 折成协议错,类型面因此不含 `already-gone`(运行期不会产出,过滤只服务类型收窄)。 */
|
|
65
51
|
export declare function readSingleReceipt<A extends ApplyAction>(action: A, id: string, outcomes: readonly ApplyOutcome[]): SingleReceipt<A>;
|
|
66
|
-
/**
|
|
67
|
-
* 座位与收尾不再自己 walk `verdicts`——那会把同一套判据在调用点再组装一遍。 */
|
|
52
|
+
/** 一次写入回执的唯一读法:成功 / 失败 / 中性 / 部分计数 / 落地 id 都从这里出,座位与收尾不再各自 walk `verdicts`。 */
|
|
68
53
|
export interface ReceiptSummary {
|
|
69
54
|
readonly successIds: readonly string[];
|
|
70
55
|
readonly neutralIds: readonly string[];
|
|
@@ -73,46 +58,31 @@ export interface ReceiptSummary {
|
|
|
73
58
|
readonly id: string;
|
|
74
59
|
readonly error: RemoteFailure;
|
|
75
60
|
}[];
|
|
76
|
-
/**
|
|
77
|
-
* ("删了一半才炸"的那部分释放量);neutral / missing 不带 details,不参与累加。 */
|
|
61
|
+
/** 部分计数只住这里:只累加 failed 的 `details`("删了一半才炸"的释放量);neutral / missing 不参与。 */
|
|
78
62
|
readonly partial: {
|
|
79
63
|
readonly removed: number;
|
|
80
64
|
readonly freedBytes: number;
|
|
81
65
|
};
|
|
82
|
-
/**
|
|
83
|
-
* (回盘名单);purge / count / orphan-clean 没有可撤销的落地 id,恒为空。
|
|
84
|
-
* 两个域不混在一个数组里靠调用方猜,也不各留一个永远为空的字段。 */
|
|
66
|
+
/** 真正落地的 id,域由 `action` 定:delete = 条目 id,restore = 会话 id,其余恒空(两个域不混)。 */
|
|
85
67
|
readonly landedIds: readonly string[];
|
|
86
|
-
/**
|
|
87
|
-
* 撤销是**回「归档」**不是回会话列表,撤销文案据此改口(ADR-0060 决定第 1 条)。 */
|
|
68
|
+
/** 带**已归档**标记的落地条目(entry 域):撤销回「归档」而非会话列表,撤销文案据此改口(ADR-0060)。 */
|
|
88
69
|
readonly landedArchivedIds: readonly string[];
|
|
89
70
|
readonly anySuccess: boolean;
|
|
90
|
-
/** purge / orphan-clean
|
|
91
|
-
* `skipped` 取第一条有的:它说的是"这一轮为什么没敢清",不是可累加的计数。
|
|
92
|
-
* 两种动作都没有读数(或这一批一条都没落地)时缺席——不拿零冒充"清过"。 */
|
|
71
|
+
/** purge / orphan-clean 的附件读数,按批相加;`skipped` 取第一条有的(不是可累加计数)。没有读数时缺席——不拿零冒充「清过」。 */
|
|
93
72
|
readonly attachmentCleanup?: AttachmentCleanupWire;
|
|
94
73
|
}
|
|
95
|
-
/**
|
|
96
|
-
* 失败表只挂在 `WriteSuccess` 上(成败两支的统一读法),摘要自己不再留第二份。 */
|
|
74
|
+
/** 摘要派生的两样产物:聚合摘要与逐条失败原文(失败表只挂在成功支上,摘要不另存)。 */
|
|
97
75
|
export interface ReceiptRead {
|
|
98
76
|
readonly summary: ReceiptSummary;
|
|
99
77
|
readonly failures: ReadonlyMap<string, string>;
|
|
100
78
|
}
|
|
101
79
|
/**
|
|
102
|
-
* 附件清理回执的「跳过半句」:`skipped`
|
|
103
|
-
* `
|
|
104
|
-
* 面板(`use-trash-query.ts`)与维护卡(`use-maintenance.ts`)共用这一判据,不许各拼一份。
|
|
105
|
-
* 没 `skipped` 时回 `null`:后半句(全清/失败怎么说)两个面各有各的口径,由调用方自己接。
|
|
80
|
+
* 附件清理回执的「跳过半句」:`skipped` 是"为什么没敢清"而非失败——原因上屏,`removed > 0` 说「部分」,`failed` 件数追加句尾。
|
|
81
|
+
* 面板与维护卡共用这一判据;没 `skipped` 回 `null`(后半句口径归调用方)。
|
|
106
82
|
*/
|
|
107
83
|
export declare function attachmentSkippedSentence(a: AttachmentCleanupWire, t: Translate): string | null;
|
|
108
84
|
export declare function summarizeReceipt<A extends ApplyAction>(receipt: Receipt<A>, sessionIdOfEntry?: (entryId: string) => string | undefined): ReceiptRead;
|
|
109
|
-
/**
|
|
110
|
-
* `/apply` 成功支回执里的条目 id(delete / restore 的 `value.id`);purge 的聚合值与 count 的数字值跳过。
|
|
111
|
-
* 撤销名单只收 `ok` 支的条目 id:already-gone 是「已被同批前一条带走」的幂等条,跟着组走,不单列。
|
|
112
|
-
*/
|
|
85
|
+
/** delete / restore 成功支的条目 id(purge / count 的值跳过);already-gone 是「同批前一条已带走」的幂等条,不单列。 */
|
|
113
86
|
export declare function landedEntryIds<A extends ApplyAction>(receipt: Receipt<A>): string[];
|
|
114
|
-
/**
|
|
115
|
-
* restore 回执里真正回盘的会话 id:`ok` 支取条目上的 `sessionId`;`already-gone` 没有行,
|
|
116
|
-
* 由调用方给条目查找兜底。purge / count 的 `ok` 值没有 `sessionId`,会被跳过。
|
|
117
|
-
*/
|
|
87
|
+
/** restore 回执里真正回盘的会话 id:`ok` 取 `sessionId`,`already-gone` 由调用方按条目查找兜底。 */
|
|
118
88
|
export declare function restoredSessionIds<A extends ApplyAction>(receipt: Receipt<A>, sessionIdOfEntry?: (entryId: string) => string | undefined): string[];
|