@xrn1997/dsh-session-delete 0.7.0 → 0.9.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 +133 -173
- package/THIRD_PARTY_NOTICES.md +4 -2
- package/docs/DETAIL.md +1 -0
- package/docs/DETAIL.zh.md +1 -0
- package/docs/preview.svg +119 -0
- package/docs/preview.zh.svg +117 -0
- package/docs/screenshots/screenshot-01.png +0 -0
- package/lib/client.js +5276 -2159
- package/lib/index.js +1594 -489
- package/lib/types/api/archive-rows.d.ts +20 -0
- package/lib/types/api/attachment.d.ts +2 -2
- package/lib/types/api/connection-route.d.ts +1 -1
- package/lib/types/api/route-table.d.ts +100 -11
- package/lib/types/client/archive-detail.d.ts +27 -0
- package/lib/types/client/archive-pane.d.ts +60 -0
- package/lib/types/client/archive-store.d.ts +6 -0
- package/lib/types/client/attachment-view.d.ts +0 -7
- package/lib/types/client/batch-bar.d.ts +5 -6
- package/lib/types/client/batch-confirm.d.ts +19 -11
- package/lib/types/client/batch-menu-item.d.ts +1 -1
- package/lib/types/client/batch-pick.d.ts +2 -1
- package/lib/types/client/busy-gate.d.ts +12 -5
- package/lib/types/client/config-settings.d.ts +2 -2
- package/lib/types/client/confirm-dialog.d.ts +23 -0
- package/lib/types/client/context-menu-actions.d.ts +11 -5
- package/lib/types/client/copy.d.ts +66 -14
- package/lib/types/client/delete-confirm.d.ts +2 -2
- package/lib/types/client/delete-menu-item.d.ts +2 -2
- package/lib/types/client/detail-ledger.d.ts +23 -0
- package/lib/types/client/detail-pane.d.ts +33 -0
- package/lib/types/client/host-archive-watch.d.ts +22 -0
- package/lib/types/client/host-rows.d.ts +7 -0
- package/lib/types/client/maintenance-parts.d.ts +4 -3
- package/lib/types/client/maintenance-settings.d.ts +4 -3
- package/lib/types/client/notice.d.ts +16 -0
- package/lib/types/client/orphan-maintenance.d.ts +1 -1
- package/lib/types/client/plugin.d.ts +6 -0
- package/lib/types/client/prompt-rail.d.ts +22 -0
- package/lib/types/client/receipt.d.ts +4 -1
- package/lib/types/client/remote.d.ts +82 -98
- package/lib/types/client/reset-client-state.d.ts +1 -0
- package/lib/types/client/session-detail.d.ts +94 -0
- package/lib/types/client/session-list.d.ts +112 -0
- package/lib/types/client/session-live.d.ts +31 -0
- package/lib/types/client/settings-cards.d.ts +1 -1
- package/lib/types/client/subagent-section.d.ts +45 -0
- package/lib/types/client/trash-confirm.d.ts +2 -1
- package/lib/types/client/trash-detail.d.ts +9 -50
- package/lib/types/client/trash-nav.d.ts +8 -7
- package/lib/types/client/trash-panel.d.ts +1 -1
- package/lib/types/client/trash-snapshot.d.ts +38 -0
- package/lib/types/client/trash-view.d.ts +41 -10
- package/lib/types/client/ui/ErrorBoundary.d.ts +32 -0
- package/lib/types/client/ui/icons.d.ts +10 -4
- package/lib/types/client/undo-notices.d.ts +27 -7
- package/lib/types/client/undo-toast.d.ts +5 -3
- package/lib/types/client/use-archive-detail-reader.d.ts +28 -0
- package/lib/types/client/use-archive-panel-controller.d.ts +73 -0
- package/lib/types/client/use-archive-query.d.ts +29 -0
- package/lib/types/client/use-detail-pager.d.ts +7 -3
- package/lib/types/client/use-detail-rail.d.ts +48 -0
- package/lib/types/client/use-detail-reader.d.ts +71 -0
- package/lib/types/client/use-gated-refresh.d.ts +27 -0
- package/lib/types/client/{use-trash-selection.d.ts → use-list-selection.d.ts} +16 -14
- package/lib/types/client/use-maintenance-section.d.ts +29 -18
- package/lib/types/client/use-maintenance.d.ts +21 -8
- package/lib/types/client/use-panel-selection.d.ts +38 -0
- package/lib/types/client/use-prefetch.d.ts +14 -0
- package/lib/types/client/use-prompt-rail.d.ts +60 -0
- package/lib/types/client/use-trash-detail-reader.d.ts +27 -0
- package/lib/types/client/use-trash-panel-controller.d.ts +23 -9
- package/lib/types/client/use-trash-query.d.ts +14 -7
- package/lib/types/client/write-seats.d.ts +95 -23
- package/lib/types/deps.d.ts +9 -6
- package/lib/types/{verbs/errors.d.ts → errors.d.ts} +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/log/session-log.d.ts +24 -2
- package/lib/types/log/zstd-frames.d.ts +8 -1
- package/lib/types/ports/fs-port.d.ts +35 -2
- package/lib/types/ports/host-port.d.ts +107 -15
- package/lib/types/shared/project-key.d.ts +28 -0
- package/lib/types/shared/session-path.d.ts +35 -0
- package/lib/types/shared/wire.d.ts +250 -36
- package/lib/types/trash/archive-detail.d.ts +27 -0
- package/lib/types/trash/attachments.d.ts +7 -4
- package/lib/types/trash/detail.d.ts +28 -3
- package/lib/types/trash/display-name.d.ts +16 -0
- package/lib/types/trash/entry.d.ts +27 -10
- package/lib/types/trash/groups.d.ts +1 -0
- package/lib/types/trash/ledger.d.ts +4 -2
- package/lib/types/trash/projection-cache.d.ts +24 -0
- package/lib/types/trash/reconcile.d.ts +5 -3
- package/lib/types/trash/session-rows.d.ts +83 -0
- package/lib/types/trash/shrinking-view.d.ts +30 -0
- package/lib/types/verbs/batch-carried.d.ts +4 -2
- package/lib/types/verbs/live-admission.d.ts +7 -2
- package/lib/types/verbs/member-journal.d.ts +1 -1
- package/lib/types/verbs/permanent-removal.d.ts +15 -5
- package/lib/types/verbs/restore-session.d.ts +6 -4
- package/lib/types/verbs/trash-scope.d.ts +14 -13
- package/locale/en.json +7 -6
- package/locale/zh.json +2 -1
- package/package.json +10 -4
- package/lib/types/client/confirm-close.d.ts +0 -14
- package/lib/types/client/write-settlement.d.ts +0 -66
- package/lib/types/client/write.d.ts +0 -64
|
@@ -18,14 +18,14 @@ declare const ZH: {
|
|
|
18
18
|
readonly 'common.justNow': "刚刚";
|
|
19
19
|
readonly 'common.ago': "{n}{unit}前";
|
|
20
20
|
readonly 'common.retry': "重试";
|
|
21
|
+
readonly 'common.renderFailed': "这一块暂时显示不出来(其余部分照常)";
|
|
22
|
+
readonly 'panel.tabs.label': "面板档位";
|
|
21
23
|
readonly 'trash.title': "回收站";
|
|
22
24
|
readonly 'trash.loading': "正在读回收站…";
|
|
23
25
|
readonly 'trash.readFailed': "回收站读不到";
|
|
24
26
|
readonly 'trash.empty.title': "回收站是空的";
|
|
25
27
|
readonly 'trash.empty.hint': "在会话条目的「…」菜单里选「删除」,会话会先进到这里,随时可以恢复。";
|
|
26
28
|
readonly 'trash.summary': "{count} 个会话 · 可释放 {size}";
|
|
27
|
-
readonly 'trash.group.count': "{count} 个会话";
|
|
28
|
-
readonly 'trash.group.ungrouped': "未分组";
|
|
29
29
|
readonly 'trash.project.unknown': "未记录项目";
|
|
30
30
|
readonly 'trash.row.deletedNow': "刚刚删除";
|
|
31
31
|
readonly 'trash.row.deletedAgo': "删除于 {n}{unit}前";
|
|
@@ -45,19 +45,21 @@ declare const ZH: {
|
|
|
45
45
|
readonly 'trash.confirm.all': "清空回收站?";
|
|
46
46
|
readonly 'trash.confirm.one': "彻底删除 1 个会话?";
|
|
47
47
|
readonly 'trash.confirm.one.meta': "{project} · 删除于 {at} · {size}";
|
|
48
|
-
readonly 'trash.confirm.body': "这会从回收站移除文件,{strong}
|
|
48
|
+
readonly 'trash.confirm.body': "这会从回收站移除文件,{strong}。只清理会话独占的图片附件副本(共享副本保留);这些会话自己的投影缓存记录也会一并清理,其他会话的缓存与你磁盘上的原图不受影响。";
|
|
49
49
|
readonly 'trash.confirm.body.strong': "之后没有任何副本可以恢复";
|
|
50
50
|
readonly 'trash.confirm.purge': "彻底删除";
|
|
51
|
-
readonly '
|
|
52
|
-
readonly '
|
|
53
|
-
readonly '
|
|
54
|
-
readonly '
|
|
55
|
-
readonly '
|
|
56
|
-
readonly '
|
|
57
|
-
readonly '
|
|
51
|
+
readonly 'list.group.count': "{count} 个会话";
|
|
52
|
+
readonly 'list.group.ungrouped': "未分组";
|
|
53
|
+
readonly 'list.group.collapseAll': "全部折叠";
|
|
54
|
+
readonly 'list.group.expandAll': "全部展开";
|
|
55
|
+
readonly 'list.divider.label': "调整左右分栏宽度";
|
|
56
|
+
readonly 'list.select.group': "勾选「{project}」这 {count} 条会话";
|
|
57
|
+
readonly 'list.select.enter': "多选";
|
|
58
|
+
readonly 'list.select.exit': "退出多选";
|
|
59
|
+
readonly 'list.select.count': "已选 {count} 条";
|
|
60
|
+
readonly 'list.select.needOne': "先勾选要处理的会话";
|
|
58
61
|
readonly 'trash.select.purge': "彻底删除 {count} 条";
|
|
59
62
|
readonly 'trash.select.restore': "恢复 {count} 条";
|
|
60
|
-
readonly 'trash.select.needOne': "先勾选要处理的会话";
|
|
61
63
|
readonly 'trash.select.row': "勾选「{title}」";
|
|
62
64
|
readonly 'trash.confirm.bulk': "彻底删除 {count} 个会话?";
|
|
63
65
|
readonly 'trash.confirm.restore': "恢复 {count} 个会话?";
|
|
@@ -67,9 +69,9 @@ declare const ZH: {
|
|
|
67
69
|
readonly 'trash.orphans.meta': "共 {size},来自 {parents} 个失踪的父会话";
|
|
68
70
|
readonly 'trash.orphans.open': "查看并清理";
|
|
69
71
|
readonly 'trash.orphans.confirm': "清理 {count} 个无主子会话?";
|
|
70
|
-
readonly 'trash.orphans.body': "
|
|
72
|
+
readonly 'trash.orphans.body': "这些子会话的父会话已经不在会话列表或回收站里,清理后不可恢复。正在运行的子会话会被拒绝,不会被删除。只清理会话独占的图片附件副本(共享副本保留)与这些会话自己的投影缓存记录;其他会话的缓存与你磁盘上的原图不受影响。若剩余引用源读不出,本次附件清理会跳过(会话目录仍会删除)。";
|
|
71
73
|
readonly 'trash.orphans.group': "{project} · {count} 个 · {size}";
|
|
72
|
-
readonly 'trash.orphans.cacheNote': "
|
|
74
|
+
readonly 'trash.orphans.cacheNote': "本次会一并清理会话独占的图片附件副本与这些会话自己的投影缓存记录;其他会话的缓存不受影响。若剩余引用源读不出,本次附件清理会跳过(会话目录仍会删除)。";
|
|
73
75
|
readonly 'trash.orphans.clean': "清理";
|
|
74
76
|
readonly 'trash.orphans.failure': "残留检查/清理失败:{message}";
|
|
75
77
|
readonly 'trash.orphans.cleanFailed': "{count} 组未清理:{message}";
|
|
@@ -117,6 +119,17 @@ declare const ZH: {
|
|
|
117
119
|
readonly 'maintenance.attachments.previewTruncated': "仅预览前 {shown} 个;清理会处理全部 {total} 个。";
|
|
118
120
|
readonly 'maintenance.attachments.previewHint': "点图片可放大;关闭这个框不会删除任何东西。";
|
|
119
121
|
readonly 'maintenance.attachments.clean': "清理这些附件";
|
|
122
|
+
readonly 'maintenance.projection.title': "投影缓存";
|
|
123
|
+
readonly 'maintenance.projection.hint': "宿主 session_projcache 里已经找不到对应会话或回收站条目的记录。检查只读,清理只动这些派生记录。";
|
|
124
|
+
readonly 'maintenance.projection.count': "{count} 条";
|
|
125
|
+
readonly 'maintenance.projection.found': "发现 {count} 条没有对应会话的投影缓存记录";
|
|
126
|
+
readonly 'maintenance.projection.scanFailed': "检查失败:{message}";
|
|
127
|
+
readonly 'maintenance.projection.confirm': "清理 {count} 条投影缓存记录?";
|
|
128
|
+
readonly 'maintenance.projection.body': "这些是宿主会话投影的派生缓存;清理不会动会话本体、清册或附件。";
|
|
129
|
+
readonly 'maintenance.projection.clean': "清理这些记录";
|
|
130
|
+
readonly 'maintenance.projection.cleaned': "已清理 {count} 条投影缓存记录";
|
|
131
|
+
readonly 'maintenance.projection.cleanFailed': "{count} 条投影缓存记录未能清理(已清理 {removed} 条)";
|
|
132
|
+
readonly 'maintenance.projection.cleanError': "投影缓存清理失败:{message}";
|
|
120
133
|
readonly 'detail.notSelected': "选中一条会话,看它讲了什么";
|
|
121
134
|
readonly 'detail.loading': "正在读这条会话…";
|
|
122
135
|
readonly 'detail.readFailed': "这条会话的正文读不出来";
|
|
@@ -135,6 +148,33 @@ declare const ZH: {
|
|
|
135
148
|
readonly 'detail.field.sessionId': "会话 id";
|
|
136
149
|
readonly 'detail.field.trashDir': "回收站目录";
|
|
137
150
|
readonly 'detail.field.wasArchived': "原本归档";
|
|
151
|
+
readonly 'archive.unnamed': "未命名 · {id}";
|
|
152
|
+
readonly 'archive.tab': "归档";
|
|
153
|
+
readonly 'archive.summary': "{count} 个已归档会话 · 合计 {size}";
|
|
154
|
+
readonly 'archive.summary.missingSize': " · {count} 条大小缺席";
|
|
155
|
+
readonly 'archive.loading': "正在读归档…";
|
|
156
|
+
readonly 'archive.readFailed': "归档读不到";
|
|
157
|
+
readonly 'archive.empty.title': "没有已归档的会话";
|
|
158
|
+
readonly 'archive.empty.hint': "在宿主会话列表里归档的会话会出现在这里。";
|
|
159
|
+
readonly 'archive.corpusMissing.title': "语料不可见";
|
|
160
|
+
readonly 'archive.corpusMissing.hint': "宿主的会话查询服务不可用,归档清单读不出来。";
|
|
161
|
+
readonly 'archive.row.lastActivity': "最后活动";
|
|
162
|
+
readonly 'archive.row.created': "创建于";
|
|
163
|
+
readonly 'archive.row.timeAbsent': "时间未知";
|
|
164
|
+
readonly 'archive.row.unarchive': "解除归档";
|
|
165
|
+
readonly 'archive.row.delete': "删除";
|
|
166
|
+
readonly 'archive.row.subagent': "子代理";
|
|
167
|
+
readonly 'archive.row.deleteHint': "删除后进入回收站,可恢复。";
|
|
168
|
+
readonly 'archive.select.unarchive': "解除所选 {count} 条";
|
|
169
|
+
readonly 'archive.select.delete': "删除所选 {count} 条";
|
|
170
|
+
readonly 'archive.size.absent': "—";
|
|
171
|
+
readonly 'archive.detail.lastEvent': "日志末条";
|
|
172
|
+
readonly 'archive.detail.statusLabel': "状态";
|
|
173
|
+
readonly 'archive.detail.status': "已归档";
|
|
174
|
+
readonly 'archive.detail.statusChild': "随归档父会话查看";
|
|
175
|
+
readonly 'archive.subagents.note': "子会话随归档父会话只读查看;它们不会随之归档或取消归档。";
|
|
176
|
+
readonly 'undo.movedArchived': "{title} 已移入回收站;撤销后回到「归档」";
|
|
177
|
+
readonly 'undo.movedBatchArchived': "{n} 条会话已移入回收站;其中已归档的,撤销后回到「归档」";
|
|
138
178
|
readonly 'detail.value.yes': "是";
|
|
139
179
|
readonly 'detail.value.no': "否";
|
|
140
180
|
readonly 'detail.value.spanLessThanHour': "不足 1 小时";
|
|
@@ -154,6 +194,14 @@ declare const ZH: {
|
|
|
154
194
|
readonly 'detail.block.truncated': "已截断";
|
|
155
195
|
readonly 'detail.loadOlder': "加载更早";
|
|
156
196
|
readonly 'detail.loadOlder.loading': "正在加载更早…";
|
|
197
|
+
/** 提问轨(详情右缘那道常驻刻度):一句用户提问一格,点一格跳到那句。 */
|
|
198
|
+
readonly 'detail.rail.label': "提问导航";
|
|
199
|
+
readonly 'detail.rail.jump': "跳到第 {n} 句提问:{preview}";
|
|
200
|
+
readonly 'detail.rail.jumpUntitled': "跳到第 {n} 句提问";
|
|
201
|
+
readonly 'detail.rail.position': "第 {n} / {total} 句";
|
|
202
|
+
readonly 'detail.rail.hint': "点一下跳到这一句";
|
|
203
|
+
readonly 'detail.rail.hintPending': "点一下跳到这一句,会先补页";
|
|
204
|
+
readonly 'detail.rail.tooFar': "这句离现在太远,先点更近的一条。";
|
|
157
205
|
readonly 'detail.viewMode.label': "工作步骤展示";
|
|
158
206
|
readonly 'detail.viewMode.compact': "简洁";
|
|
159
207
|
readonly 'detail.viewMode.standard': "标准";
|
|
@@ -186,7 +234,11 @@ declare const ZH: {
|
|
|
186
234
|
readonly 'detail.attachment.saving': "保存中…";
|
|
187
235
|
readonly 'detail.attachment.saveFailed': "保存失败:{message}";
|
|
188
236
|
readonly 'detail.back': "← 返回清单";
|
|
189
|
-
readonly 'detail.subagents.
|
|
237
|
+
readonly 'detail.subagents.label': "子会话";
|
|
238
|
+
readonly 'detail.subagents.note': "随本条一起恢复或删除";
|
|
239
|
+
readonly 'detail.subagents.expand': "展开子会话列表";
|
|
240
|
+
readonly 'detail.subagents.collapse': "收起子会话列表";
|
|
241
|
+
readonly 'detail.subagents.jump': "展开并跳到子会话段";
|
|
190
242
|
readonly 'detail.subagents.open': "查看子会话详情";
|
|
191
243
|
readonly 'detail.subagents.truncated': "仅列出前 {shown} 条,共 {total} 条";
|
|
192
244
|
readonly 'detail.backToParent': "← 返回父会话";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Translate } from './copy.js';
|
|
2
|
-
import { type
|
|
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:
|
|
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(`
|
|
9
|
+
/** 上方那条发丝线;缺省 true。多选入口排在删除前面时由它带线,删除行改成 false(`context-menu-actions.tsx`)。 */
|
|
10
10
|
separatorBefore?: boolean;
|
|
11
11
|
/**
|
|
12
|
-
* 菜单 owner 交下来的「收起菜单」——槽位注入的 `useMenuOpenState`(`
|
|
12
|
+
* 菜单 owner 交下来的「收起菜单」——槽位注入的 `useMenuOpenState`(`context-menu-actions.tsx` 的 `DeleteRow` 接住)。
|
|
13
13
|
* 「关不关菜单是 owner 的决定」是官方对该槽位的契约;按下这一行时**先发请求、再收菜单**。
|
|
14
14
|
* 缺省不动,方便单独测这一行。
|
|
15
15
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 详情账本的**容量与淘汰**(两档共用一份判据):账本本身谁读谁写由实例定——回收站是
|
|
3
|
+
* `trash-snapshot.ts` 的模块级账本(跨面板挂载存活、写时复制),归档是挂载内的 Map。
|
|
4
|
+
* 两种存法不同,但「留多少条、按什么次序淘汰」是同一条口径,住这里。
|
|
5
|
+
*/
|
|
6
|
+
/** 账本 seam(两种存法见文件头)。 */
|
|
7
|
+
export interface DetailLedger<D> {
|
|
8
|
+
read(id: string): D | undefined;
|
|
9
|
+
write(id: string, detail: D): void;
|
|
10
|
+
forget(id: string): void;
|
|
11
|
+
/** 整本作废(归档集变更时两档共用的读路要丢旧快照)。 */
|
|
12
|
+
clear(): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 详情账本的上限。孩子详情从不在清单行里(`reloadSucceeded` 只按清单 id 修剪),回收站那本
|
|
16
|
+
* 又是模块级、跨所有面板挂载存活:不设上限时,一个长会话里打开几十个子会话就把每份详情(含已翻
|
|
17
|
+
* 出来的分页块与附件读数)永久留在进程里。64 远高于一屏能开出来的条目数,命中率不受影响。
|
|
18
|
+
* 归档那本按挂载存活、条数同理,用同一个上限(两档各持一份账本,不互相挤兑——ADR-0060 决定第 4 条)。
|
|
19
|
+
*/
|
|
20
|
+
export declare const DETAIL_LEDGER_LIMIT = 64;
|
|
21
|
+
/** 记下一条详情:**重写挪到队尾**(等价于按「最近一次写入」淘汰),再淘汰到上限。
|
|
22
|
+
* 传进来的 Map 由调用方拥有——回收站交的是写时复制出来的新 Map,归档交的是挂载内那一份。 */
|
|
23
|
+
export declare function writeDetail<D>(map: Map<string, D>, id: string, detail: D): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 两档共用的**栏外壳**:详情栏(滚动容器 + 贴右缘的提问轨)与清单栏(滚动容器)。
|
|
3
|
+
* 回收站档与归档档的正文视图不同(`TrashDetail` / `ArchiveDetail`),但装它们的那两层壳、
|
|
4
|
+
* 滚动条档位、正文收口宽度与轨的右缘是同一份几何——住这里,两档各交一个孩子与一台轨接线。
|
|
5
|
+
*
|
|
6
|
+
* 几何只有一个来源:右缘是正文列宽的函数(`DETAIL_TEXT_MAX_WIDTH`),轨宽住 `PromptRail` 的
|
|
7
|
+
* `RAIL_WIDTH`、右槽从它派生。样式表里再抄一份列宽或轨宽就是第二份事实,迟早与内层 `maxWidth`
|
|
8
|
+
* 漂开——轨会离开正文列、间距也不再是那一档(`tests/layout-css.test.ts` 钉住这条)。
|
|
9
|
+
*/
|
|
10
|
+
import type { CSSProperties, ReactNode, RefObject } from 'react';
|
|
11
|
+
import type { Translate } from './copy.js';
|
|
12
|
+
import type { ListDom } from './session-list.js';
|
|
13
|
+
import type { DetailRail } from './use-detail-rail.js';
|
|
14
|
+
/** 详情正文的收口宽度:中央列再宽也不把文字拉成长线。 */
|
|
15
|
+
export declare const DETAIL_TEXT_MAX_WIDTH = 860;
|
|
16
|
+
export interface DetailPaneProps {
|
|
17
|
+
/** 这一档的 DOM 身份:详情容器标成 `<kind>-detail`。 */
|
|
18
|
+
kind: ListDom['kind'];
|
|
19
|
+
/** 详情栏的滚动容器:分页 prepend 后按高度差补偿滚动位置,提问轨也按它算当前那句。 */
|
|
20
|
+
scrollRef: RefObject<HTMLDivElement>;
|
|
21
|
+
/** 这一档的提问轨接线(`useDetailRail`):没有轨那一拍只画正文。 */
|
|
22
|
+
rail: DetailRail;
|
|
23
|
+
/** 正文视图(`TrashDetail` / `ArchiveDetail`)。 */
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
t: Translate;
|
|
26
|
+
}
|
|
27
|
+
export declare function DetailPane({ kind, scrollRef, rail, children, t }: DetailPaneProps): import("react").JSX.Element;
|
|
28
|
+
/** 清单那一栏的滚动外壳:宽与 `flex` 由调用点现给(两栏时是可拖的定宽,单列时铺满),
|
|
29
|
+
* 滚动配方与详情栏同一份(`SCROLL_COLUMN`)。两档都无条件预留滚动条槽(`layout.css` 的 `.sd-stable-scroll`)。 */
|
|
30
|
+
export declare function ListPane({ style, children }: {
|
|
31
|
+
style: CSSProperties;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 宿主归档集的**旁路观察**——浏览器半可选读宿主客户端服务
|
|
3
|
+
* `ctx.get('workspaces').list`(`getSnapshot().archivedSessionIds` / `subscribe`),
|
|
4
|
+
* 归档集一变就 `invalidateArchive()`。零新增宿主↔Node 面(ADR-0036「订阅不轮询」的路子)。
|
|
5
|
+
*
|
|
6
|
+
* 纪律(AGENTS 红线 + ADR-0060 决定第 4 条):
|
|
7
|
+
* - 窄镜像**只声明这两格**、按方法面判形;不 import 宿主包、不做 `declare module`。
|
|
8
|
+
* - 可选服务走 `ctx.get`,**不进条目 `inject`**(写进去 = 这一代没有它就整条 pending)。
|
|
9
|
+
* - 服务**可能迟到**:`dsh-api-workspace-controller` 自己 inject `remote` / `remote.workspace`,
|
|
10
|
+
* 而本条目只 inject `slots`,可以在它之前激活。所以 `get` 落空时按 AGENTS 的规矩用
|
|
11
|
+
* `ctx.inject(['workspaces'], child => …)` 的 **scoped 等待**切过去;等待装在 child 上,
|
|
12
|
+
* 服务就绪才回调、条目卸载时随 child 一起收。
|
|
13
|
+
* - 服务缺席 / 形状不符 / 安装期读面抛错 ⇒ **安静降级**(console.info 一句留因,不抛、不戳):
|
|
14
|
+
* 旁路观察不可用时归档档退化为"打开时重取 + 自己动作后重取"(`useArchiveQuery` 本来就有这两条腿)。
|
|
15
|
+
* - 只在**归档集数组内容**变化时戳(逐元素比较):无关的 workspace 变更不许把归档档拉起来重读。
|
|
16
|
+
*/
|
|
17
|
+
import type { ClientContextLike } from './context.js';
|
|
18
|
+
/**
|
|
19
|
+
* 安装观察:返回 disposer(交给 `client.effect` 的工厂收尾)。服务缺席/形状不符时安静降级;
|
|
20
|
+
* 服务可能迟到的那一支走 `ctx.inject` 的 scoped 等待(见文件头注)。
|
|
21
|
+
*/
|
|
22
|
+
export declare function installArchiveHostWatch(client: ClientContextLike): () => void;
|
|
@@ -27,6 +27,13 @@ export declare function unregisterHostRowInfo(sessionId: string): void;
|
|
|
27
27
|
* 登记表是可见行的事实源,所以"没登记"就是"这一行此刻不在可见集合里"。
|
|
28
28
|
*/
|
|
29
29
|
export declare function pickableRowOf(sessionId: string): HostRowInfo | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* 比 {@link pickableRowOf} 宽一档:只看「登记过没有」,不看跑不跑。
|
|
32
|
+
* 模式内的整行点击守卫用它判「吞不吞这一下」——在跑的行不勾选(与置灰勾选框同口径),
|
|
33
|
+
* 但那一行仍是本插件接管的可见会话行,点整行必须照旧被吃掉(否则会打开正在跑的会话)。
|
|
34
|
+
* 没登记的行才完全放行(别的列表 / 本插件没接管的行)。
|
|
35
|
+
*/
|
|
36
|
+
export declare function registeredHostRowOf(sessionId: string): HostRowInfo | undefined;
|
|
30
37
|
/**
|
|
31
38
|
* 「当前可见」的可选行:**已登记**的会话行(槽位开关还挂在渲染树上)——折叠组、归档过滤外的行
|
|
32
39
|
* 没有挂载,因此没有登记;在跑的行跳过(与置灰勾选框同口径)。标题/运行态来自登记值;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 维护卡各段共用的两块皮:警告条外壳与失败块。
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* 三段(孤儿会话 / 孤儿附件 / 投影缓存)在结构上只差正文:图标、底色、动作按钮与失败块的
|
|
5
|
+
* 「原文 + 重试」都一样。收在这里,改布局或按钮材质时不必逐段改;正文仍由各段自己给。
|
|
6
|
+
* 清理后的回执行不在本文件:它同时被回收站面板用到,住中立模块 `src/client/notice.tsx`。
|
|
6
7
|
*/
|
|
7
8
|
import type { ReactElement, ReactNode } from 'react';
|
|
8
9
|
import type { Translate } from './copy.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 插件设置页的「维护」卡(ADR-0021):那张槽位上的两张卡里,本文件只拥有下面这一张。
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 三段都是**手动**的:检查 → 预览 → 清理,没有挂载即扫、没有定时器。卡片的职责只有呈现:
|
|
5
5
|
* 状态那一行、检查按钮、以及各段自己的横幅 / 失败 / 提示 / 确认框;读数与动作全归
|
|
6
6
|
* `src/client/use-maintenance.ts`。两张卡的先后与 `summary` 守卫在 `src/client/settings-cards.tsx`。
|
|
7
7
|
*
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
* `settingsCardShell` / `Button` / `Modal` / `fileSizeText`,所以同一张卡放在插件详情页的任意宽度下都成立。
|
|
10
10
|
*
|
|
11
11
|
* 孤儿会话段直接复用 `OrphanMaintenance`(警告条 / 失败 / 中性提示 / 预览确认的既有呈现);
|
|
12
|
-
* 孤儿附件段是本文件里的 `AttachmentMaintenance`(横幅 + 失败 + 回执 +
|
|
12
|
+
* 孤儿附件段是本文件里的 `AttachmentMaintenance`(横幅 + 失败 + 回执 + 缩略图预览与清理确认);
|
|
13
|
+
* 投影缓存段是 `ProjectionMaintenance`(横幅 + 失败 + 回执 + 只按条数确认)。
|
|
13
14
|
*/
|
|
14
15
|
import type { ReactElement } from 'react';
|
|
15
16
|
import { type Translate } from './copy.js';
|
|
16
17
|
import { type MaintenanceDeps } from './use-maintenance.js';
|
|
17
18
|
export interface MaintenanceSettingsProps {
|
|
18
|
-
/**
|
|
19
|
+
/** 维护六件(三段读数与动作);可调项两件由占用者另发给「可调项」卡。 */
|
|
19
20
|
deps: MaintenanceDeps;
|
|
20
21
|
/** 文案(缺省 = 内置 zh;宿主 locale 服务缺席时也是它,见 `copy.ts`)。 */
|
|
21
22
|
t?: Translate;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 一段**状态回执行**:清理后的中性 / 成功 / 警告摘要。不是失败块,也不冒充检查状态;
|
|
3
|
+
* 没有话说时整块不画。`tone` 只决定图标与颜色,句子由调用方按自己的判据拼好。
|
|
4
|
+
*
|
|
5
|
+
* 它住在中立模块而不是维护卡里:回收站面板的附件清理提示与设置页维护卡的三段都用它,
|
|
6
|
+
* 面板不该为了一个回执行去 import 设置卡模块。
|
|
7
|
+
*/
|
|
8
|
+
import type { ReactElement } from 'react';
|
|
9
|
+
export interface NoticeProps {
|
|
10
|
+
readonly message: string | null;
|
|
11
|
+
/** 旧面板块用过的下边距;设置页段内间距由父级 gap 给,默认不加。 */
|
|
12
|
+
readonly gapBelow?: boolean;
|
|
13
|
+
/** 默认 warning(附件失败 / 跳过、孤儿清理回执);纯成功回执用 success。 */
|
|
14
|
+
readonly tone?: 'warning' | 'success';
|
|
15
|
+
}
|
|
16
|
+
export declare function Notice({ message, gapBelow, tone }: NoticeProps): ReactElement | null;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import type { ReactElement } from 'react';
|
|
22
22
|
import type { Translate } from './copy.js';
|
|
23
|
-
import type { OrphanReportWire } from '
|
|
23
|
+
import type { OrphanReportWire } from '../shared/wire.js';
|
|
24
24
|
import type { MaintenanceSectionView } from './use-maintenance-section.js';
|
|
25
25
|
export interface OrphanMaintenanceProps {
|
|
26
26
|
/** 段视图:读数、提示、确认框、忙碌与四个动作都在它上面,本块不多要也不少读。 */
|
|
@@ -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;
|
|
@@ -7,7 +7,7 @@ import { type ApplyAction, type ApplyOutcome, type ApplyValueByAction, type Atta
|
|
|
7
7
|
*
|
|
8
8
|
* 各 action 可能出现的 kind(类型面故意保持同一个联合,消费方按 action 自己收窄):
|
|
9
9
|
* - delete / restore:`ok` / `already-gone` / `failed` / `missing`
|
|
10
|
-
* - count / purge:`ok` / `failed` / `missing`
|
|
10
|
+
* - count / purge / unarchive:`ok` / `failed` / `missing`
|
|
11
11
|
* - orphan-clean:`ok` / `neutral` / `failed` / `missing`
|
|
12
12
|
* - 单条读法(`readSingleReceipt`):不含 `already-gone`;null 折成 `failed`
|
|
13
13
|
*/
|
|
@@ -83,6 +83,9 @@ export interface ReceiptSummary {
|
|
|
83
83
|
* (回盘名单);purge / count / orphan-clean 没有可撤销的落地 id,恒为空。
|
|
84
84
|
* 两个域不混在一个数组里靠调用方猜,也不各留一个永远为空的字段。 */
|
|
85
85
|
readonly landedIds: readonly string[];
|
|
86
|
+
/** 落地条目里带**已归档**标记的那些(域同 `landedIds` 的 entry 域):已归档会话删除后
|
|
87
|
+
* 撤销是**回「归档」**不是回会话列表,撤销文案据此改口(ADR-0060 决定第 1 条)。 */
|
|
88
|
+
readonly landedArchivedIds: readonly string[];
|
|
86
89
|
readonly anySuccess: boolean;
|
|
87
90
|
/** purge / orphan-clean 的 `ok` 回执里那半份附件读数,**按批相加**(一段 `/apply` 可能带多条 ok)。
|
|
88
91
|
* `skipped` 取第一条有的:它说的是"这一轮为什么没敢清",不是可累加的计数。
|