@xrn1997/dsh-session-delete 0.12.0 → 0.14.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 +4 -3
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/lib/client.js +7856 -5511
- package/lib/index.js +1147 -174
- package/lib/types/api/project-ranks.d.ts +3 -0
- package/lib/types/api/search.d.ts +7 -0
- package/lib/types/api/trash-rows.d.ts +1 -1
- package/lib/types/client/{batch-bar.d.ts → batch/batch-bar.d.ts} +2 -2
- package/lib/types/client/{batch-menu-item.d.ts → batch/batch-menu-item.d.ts} +1 -1
- package/lib/types/client/{batch-pick.d.ts → batch/batch-pick.d.ts} +1 -1
- package/lib/types/client/{batch-select.d.ts → batch/batch-select.d.ts} +2 -2
- package/lib/types/client/{delete-menu-item.d.ts → batch/delete-menu-item.d.ts} +1 -1
- package/lib/types/client/batch/index.d.ts +10 -0
- package/lib/types/client/{copy.d.ts → core/copy.d.ts} +41 -2
- package/lib/types/client/{receipt.d.ts → core/receipt.d.ts} +1 -1
- package/lib/types/client/{remote.d.ts → core/remote.d.ts} +23 -2
- package/lib/types/client/detail/block-render.d.ts +22 -0
- package/lib/types/client/{detail-blocks.d.ts → detail/detail-blocks.d.ts} +1 -1
- package/lib/types/client/detail/detail-style.d.ts +62 -0
- package/lib/types/client/detail/detail-text.d.ts +18 -0
- package/lib/types/client/detail/index.d.ts +17 -0
- package/lib/types/client/{markdown.d.ts → detail/markdown.d.ts} +2 -2
- package/lib/types/client/{prompt-rail.d.ts → detail/prompt-rail.d.ts} +2 -2
- package/lib/types/client/{session-detail.d.ts → detail/session-detail.d.ts} +20 -13
- package/lib/types/client/{subagent-section.d.ts → detail/subagent-section.d.ts} +2 -2
- package/lib/types/client/{use-archive-detail-reader.d.ts → detail/use-archive-detail-reader.d.ts} +2 -2
- package/lib/types/client/{use-detail-pager.d.ts → detail/use-detail-pager.d.ts} +1 -1
- package/lib/types/client/{use-detail-rail.d.ts → detail/use-detail-rail.d.ts} +3 -1
- package/lib/types/client/{use-detail-reader.d.ts → detail/use-detail-reader.d.ts} +3 -3
- package/lib/types/client/{use-prompt-rail.d.ts → detail/use-prompt-rail.d.ts} +1 -1
- package/lib/types/client/{use-trash-detail-reader.d.ts → detail/use-trash-detail-reader.d.ts} +2 -2
- package/lib/types/client/{context-menu-actions.d.ts → host/context-menu-actions.d.ts} +2 -2
- package/lib/types/client/host/guard.d.ts +16 -0
- package/lib/types/client/{host-archive-watch.d.ts → host/host-archive-watch.d.ts} +1 -1
- package/lib/types/client/host/index.d.ts +11 -0
- package/lib/types/client/panel/archive-detail.d.ts +22 -0
- package/lib/types/client/{archive-pane.d.ts → panel/archive-pane.d.ts} +28 -9
- package/lib/types/client/{detail-pane.d.ts → panel/detail-pane.d.ts} +3 -3
- package/lib/types/client/panel/index.d.ts +9 -0
- package/lib/types/client/panel/panel-tab.d.ts +61 -0
- package/lib/types/client/{session-list.d.ts → panel/session-list.d.ts} +4 -4
- package/lib/types/client/{trash-confirm.d.ts → panel/trash-confirm.d.ts} +2 -12
- package/lib/types/client/{trash-detail.d.ts → panel/trash-detail.d.ts} +10 -7
- package/lib/types/client/{trash-drop.d.ts → panel/trash-drop.d.ts} +1 -1
- package/lib/types/client/{trash-entry.d.ts → panel/trash-entry.d.ts} +2 -2
- package/lib/types/client/{trash-panel.d.ts → panel/trash-panel.d.ts} +1 -1
- package/lib/types/client/panel/trash-tab.d.ts +42 -0
- package/lib/types/client/{use-archive-panel-controller.d.ts → panel/use-archive-panel-controller.d.ts} +7 -5
- package/lib/types/client/{use-archive-query.d.ts → panel/use-archive-query.d.ts} +2 -2
- package/lib/types/client/{use-list-selection.d.ts → panel/use-list-selection.d.ts} +1 -1
- package/lib/types/client/{use-panel-child-view.d.ts → panel/use-panel-child-view.d.ts} +1 -1
- package/lib/types/client/{use-panel-tab.d.ts → panel/use-panel-tab.d.ts} +9 -12
- package/lib/types/client/{use-trash-panel-controller.d.ts → panel/use-trash-panel-controller.d.ts} +10 -4
- package/lib/types/client/{use-trash-query.d.ts → panel/use-trash-query.d.ts} +4 -4
- package/lib/types/client/panel/view-switches.d.ts +29 -0
- package/lib/types/client/scene.d.ts +8 -8
- package/lib/types/client/search/index.d.ts +12 -0
- package/lib/types/client/search/search-box.d.ts +24 -0
- package/lib/types/client/search/search-preview.d.ts +46 -0
- package/lib/types/client/search/search-results.d.ts +62 -0
- package/lib/types/client/search/search-text.d.ts +13 -0
- package/lib/types/client/search/use-search-view.d.ts +59 -0
- package/lib/types/client/search/use-search.d.ts +62 -0
- package/lib/types/client/{config-settings.d.ts → settings/config-settings.d.ts} +2 -2
- package/lib/types/client/settings/index.d.ts +8 -0
- package/lib/types/client/{maintenance-parts.d.ts → settings/maintenance-parts.d.ts} +1 -1
- package/lib/types/client/{maintenance-settings.d.ts → settings/maintenance-settings.d.ts} +1 -1
- package/lib/types/client/settings/orphan-confirm.d.ts +12 -0
- package/lib/types/client/{orphan-maintenance.d.ts → settings/orphan-maintenance.d.ts} +3 -3
- package/lib/types/client/{settings-cards.d.ts → settings/settings-cards.d.ts} +2 -2
- package/lib/types/client/{use-maintenance-section.d.ts → settings/use-maintenance-section.d.ts} +1 -1
- package/lib/types/client/{use-maintenance.d.ts → settings/use-maintenance.d.ts} +4 -4
- package/lib/types/client/{batch-selection-store.d.ts → state/batch-selection-store.d.ts} +11 -4
- package/lib/types/client/state/delete-action.d.ts +16 -0
- package/lib/types/client/{main-view.d.ts → state/main-view.d.ts} +1 -1
- package/lib/types/client/{trash-snapshot.d.ts → state/trash-snapshot.d.ts} +1 -1
- package/lib/types/client/{undo-notices.d.ts → state/undo-notices.d.ts} +9 -22
- package/lib/types/client/ui/Button.d.ts +2 -1
- package/lib/types/client/ui/ErrorBoundary.d.ts +4 -8
- package/lib/types/client/ui/Modal.d.ts +4 -3
- package/lib/types/client/ui/Toast.d.ts +13 -3
- package/lib/types/client/ui/Tooltip.d.ts +3 -2
- package/lib/types/client/ui/anchor-fit.d.ts +42 -0
- package/lib/types/client/ui/icons.d.ts +13 -2
- package/lib/types/client/ui/inert.d.ts +15 -0
- package/lib/types/client/{attachment-view.d.ts → widgets/attachment-view.d.ts} +3 -3
- package/lib/types/client/{confirm-dialog.d.ts → widgets/confirm-dialog.d.ts} +4 -0
- package/lib/types/client/{trash-view.d.ts → widgets/trash-view.d.ts} +8 -5
- package/lib/types/client/write/delete-action-host.d.ts +4 -0
- package/lib/types/client/write/index.d.ts +13 -0
- package/lib/types/client/{undo-toast.d.ts → write/undo-toast.d.ts} +2 -2
- package/lib/types/client/{use-write-progress.d.ts → write/use-write-progress.d.ts} +2 -2
- package/lib/types/client/{write-progress.d.ts → write/write-progress.d.ts} +1 -1
- package/lib/types/client/{write-seats.d.ts → write/write-seats.d.ts} +7 -15
- package/lib/types/ports/agent-handles.d.ts +2 -1
- package/lib/types/ports/host-port.d.ts +6 -1
- package/lib/types/shared/wire.d.ts +135 -3
- package/lib/types/trash/content-text.d.ts +10 -0
- package/lib/types/trash/groups.d.ts +18 -6
- package/lib/types/trash/search-corpus.d.ts +40 -0
- package/lib/types/trash/search-text.d.ts +43 -0
- package/lib/types/trash/shrinking-view.d.ts +6 -4
- package/lib/types/verbs/permanent-removal.d.ts +22 -6
- package/lib/types/verbs/search.d.ts +53 -0
- package/lib/types/verbs/trash-scope.d.ts +5 -1
- package/package.json +7 -7
- package/lib/types/client/archive-detail.d.ts +0 -19
- package/lib/types/client/delete-action.d.ts +0 -23
- package/lib/types/client/panel-tab.d.ts +0 -39
- package/lib/types/client/trash-tab.d.ts +0 -22
- package/lib/types/client/ui/Tag.d.ts +0 -16
- /package/lib/types/client/{api-base.d.ts → core/api-base.d.ts} +0 -0
- /package/lib/types/client/{context.d.ts → core/context.d.ts} +0 -0
- /package/lib/types/client/{detail-ledger.d.ts → core/detail-ledger.d.ts} +0 -0
- /package/lib/types/client/{plugin.d.ts → core/plugin.d.ts} +0 -0
- /package/lib/types/client/{use-gated-refresh.d.ts → core/use-gated-refresh.d.ts} +0 -0
- /package/lib/types/client/{use-prefetch.d.ts → core/use-prefetch.d.ts} +0 -0
- /package/lib/types/client/{store.d.ts → core/value-store.d.ts} +0 -0
- /package/lib/types/client/{use-detail-frame.d.ts → detail/use-detail-frame.d.ts} +0 -0
- /package/lib/types/client/{session-live.d.ts → host/session-live.d.ts} +0 -0
- /package/lib/types/client/{drop-machine.d.ts → panel/drop-machine.d.ts} +0 -0
- /package/lib/types/client/{trash-nav.d.ts → panel/trash-nav.d.ts} +0 -0
- /package/lib/types/client/{use-column-resize.d.ts → panel/use-column-resize.d.ts} +0 -0
- /package/lib/types/client/{use-panel-list-read.d.ts → panel/use-panel-list-read.d.ts} +0 -0
- /package/lib/types/client/{use-panel-selection.d.ts → panel/use-panel-selection.d.ts} +0 -0
- /package/lib/types/client/{use-panel-width.d.ts → panel/use-panel-width.d.ts} +0 -0
- /package/lib/types/client/{settings-view.d.ts → settings/settings-view.d.ts} +0 -0
- /package/lib/types/client/{archive-store.d.ts → state/archive-store.d.ts} +0 -0
- /package/lib/types/client/{host-rows.d.ts → state/host-rows.d.ts} +0 -0
- /package/lib/types/client/{pending-open.d.ts → state/pending-open.d.ts} +0 -0
- /package/lib/types/client/{trash-store.d.ts → state/trash-store.d.ts} +0 -0
- /package/lib/types/client/{notice.d.ts → widgets/notice.d.ts} +0 -0
- /package/lib/types/client/{busy-gate.d.ts → write/busy-gate.d.ts} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 永久删除的测量、计划与执行:先记录目录/字节/账本归属,再按计划动盘。计划函数只读;活体准入在计划阶段、任何写之前完成,
|
|
3
3
|
* 执行器动第一笔写前再查一次(ADR-0027)。
|
|
4
|
-
* 测量与补账本归属**分家**:`/list` 的只读计划只吃 `measureMembers`(零账本读);`workspaceOf`
|
|
4
|
+
* 测量与补账本归属**分家**:`/list` 的只读计划只吃 `measureMembers`(零账本读);`workspaceOf` 只由 purge / orphan-clean
|
|
5
|
+
* 的删除计划与执行器的归属复核付(`/list` 不吃)。
|
|
5
6
|
*
|
|
6
7
|
* **批级扫描 + 尾只带走真删掉的目录**:独占图片的候选与剩余引用扫描提到**批级**(`planBatchImageAttachmentRemoval`,
|
|
7
8
|
* 全批两趟读:计划一趟、复核一趟),逐组计划只吐本组被删目录(`attachmentDirs`);附件尾 `executeAttachmentTail`
|
|
@@ -25,11 +26,14 @@ export interface PlannedMemberRemoval {
|
|
|
25
26
|
readonly bytes: number;
|
|
26
27
|
readonly workspaceId?: string;
|
|
27
28
|
}
|
|
28
|
-
/**
|
|
29
|
+
/** 递归量尺寸撞到 ENOENT 时按调用方的用途处置:读路径折叠成「不在」,写计划必须响亮失败(ADR-0078)。 */
|
|
30
|
+
type DirRacePolicy = 'absent' | 'throw';
|
|
31
|
+
/** 成员的盘上目录与字节(扫描、清单与 purge 共用一条口径);目录缺席回 `undefined`,不拿旧读数冒充盘上残留。
|
|
32
|
+
* `race` 决定递归 ENOENT 的处置(ADR-0078):读路径 `'absent'`,删除计划 `'throw'`。 */
|
|
29
33
|
export declare function measureMemberDir(deps: CoreDeps, member: {
|
|
30
34
|
readonly sessionId: string;
|
|
31
35
|
readonly projectDir: string;
|
|
32
|
-
}): Promise<MeasuredMemberDir | undefined>;
|
|
36
|
+
}, race: DirRacePolicy): Promise<MeasuredMemberDir | undefined>;
|
|
33
37
|
/** 一条成员的**测量**读数:身份两格 + 目录 + 实测字节;没有账本归属格(归属只有 `delete` 动词才读)。 */
|
|
34
38
|
export interface MeasuredMember {
|
|
35
39
|
readonly sessionId: string;
|
|
@@ -42,7 +46,7 @@ export interface MeasuredMember {
|
|
|
42
46
|
export declare function measureMembers(deps: CoreDeps, members: readonly {
|
|
43
47
|
readonly sessionId: string;
|
|
44
48
|
readonly projectDir: string;
|
|
45
|
-
}[]): Promise<MeasuredMember[]>;
|
|
49
|
+
}[], race: DirRacePolicy): Promise<MeasuredMember[]>;
|
|
46
50
|
/** 回收站里的一条要删的行:目录、在不在、实测字节(缺席 = 0)。purge 与 `/list` 都由它量。 */
|
|
47
51
|
export interface PlannedTrashRow {
|
|
48
52
|
readonly entry: TrashEntry;
|
|
@@ -50,6 +54,8 @@ export interface PlannedTrashRow {
|
|
|
50
54
|
readonly present: boolean;
|
|
51
55
|
readonly bytes: number;
|
|
52
56
|
}
|
|
57
|
+
/** 一份清册快照里的会话 id 集(bare 归一)。批量面一次算好、多处复用,避免每个组重建一份 n 行的 Set。 */
|
|
58
|
+
export declare function manifestSessionIds(rows: readonly TrashEntry[]): ReadonlySet<string>;
|
|
53
59
|
/** `/list` 的一行(一组):`releaseBytes` 是这一组**实测**会释放的字节;`members` 是测量读数(无账本归属格)。 */
|
|
54
60
|
export interface VisibleTrashGroup extends TrashGroupView {
|
|
55
61
|
readonly trash: readonly PlannedTrashRow[];
|
|
@@ -89,7 +95,9 @@ export interface RemovalPlan {
|
|
|
89
95
|
* - 活体准入在量目录与任何写之前逐个查 targets 与**全部枚举到的**盘上后代;没有跳过它的开关(执行器首笔写前还会复查)。
|
|
90
96
|
* - `sessionQuery` 缺席 ⇒ members 为空、不抛(盘上残留留给 `GET /orphans` 兜底)。
|
|
91
97
|
*/
|
|
92
|
-
export declare function planTrashRemoval(deps: CoreDeps, rows: readonly TrashEntry[], targets: readonly TrashEntry[]
|
|
98
|
+
export declare function planTrashRemoval(deps: CoreDeps, rows: readonly TrashEntry[], targets: readonly TrashEntry[],
|
|
99
|
+
/** 批量入口一次算好的清册 id 集;单条/直接调用缺省按 `rows` 现算。 */
|
|
100
|
+
manifestIds?: ReadonlySet<string>): Promise<RemovalPlan>;
|
|
93
101
|
/**
|
|
94
102
|
* 第二波补跑面的附件候选目录(ADR-0070 决定 5):一组**未来会删**的目录 = 行目录 + 盘上残离子会话目录。
|
|
95
103
|
* 与 `planTrashRemoval` 的区别只是不过闸、不补账本:计划期被活体准入拒掉的组,它的挂起条目仍可能在第二波
|
|
@@ -98,7 +106,9 @@ export declare function planTrashRemoval(deps: CoreDeps, rows: readonly TrashEnt
|
|
|
98
106
|
* 盘上后代读不出时 `complete: false`、只交行目录:调用方要据此把该组的第二波补跑判失败(留着让人重试),
|
|
99
107
|
* 不能让它删掉一批没进过扫描面的目录——那才是孤儿附件的来源。
|
|
100
108
|
*/
|
|
101
|
-
export declare function plannedAttachmentDirs(deps: CoreDeps, rows: readonly TrashEntry[], targets: readonly TrashEntry[]
|
|
109
|
+
export declare function plannedAttachmentDirs(deps: CoreDeps, rows: readonly TrashEntry[], targets: readonly TrashEntry[],
|
|
110
|
+
/** 同 `planTrashRemoval`:批量入口一次算好传进来。 */
|
|
111
|
+
manifestIds?: ReadonlySet<string>): Promise<{
|
|
102
112
|
readonly dirs: readonly string[];
|
|
103
113
|
readonly complete: boolean;
|
|
104
114
|
}>;
|
|
@@ -132,6 +142,11 @@ export type RemovalExecutor = (plan: RemovalPlan) => Promise<RemovalStats>;
|
|
|
132
142
|
* 目录删掉就没有"退回去"这回事,中途失败**不回滚目录**;已删的由计数器如实交回。附件对象不在这条管线里——
|
|
133
143
|
* 归批级尾(`executeAttachmentTail`),见文件头注的口径。
|
|
134
144
|
*
|
|
145
|
+
* **账本与工作区归属**(ADR-0077):摘账本前对每个计划成员复核一次 `workspaceOf`——执行时已无归属就跳过
|
|
146
|
+
* (同批先手已摘 / 用户解绑 / 工作区已删,`detach` 本就是空转),有归属但与计划不一致则响亮失败等重试。
|
|
147
|
+
* 失败出口按 detach 记录的反向顺序,对目录仍在的成员 `attach(..., 'if-unassigned')` 补回原工作区
|
|
148
|
+
* (已删目录 / 用户已重新归组 / 工作区已删都跳过);回滚失败与归档回滚一样进 `details.rollbackFailures`。
|
|
149
|
+
*
|
|
135
150
|
* **归档态回滚**:`unarchive` 排在所有删除之前,所以失败时目录还在、归档位却已摘。失败出口把**目录还在**的那些按删除前的读数
|
|
136
151
|
* 重新归档(预读 `isArchived`,不按 `wasArchived` 猜),目录不在的跳过——否则会造幽灵 id。回滚失败走 `details.rollbackFailures`(ADR-0040)。
|
|
137
152
|
*
|
|
@@ -169,3 +184,4 @@ export interface AttachmentTailResult {
|
|
|
169
184
|
* `run.skipped` 原样带回计划期与复核两段原因——skipped 原文是 fail-closed 的用户可见落点(ADR-0041),不许丢。
|
|
170
185
|
*/
|
|
171
186
|
export declare function executeAttachmentTail(deps: AttachmentRemovalDeps, batch: BatchAttachmentPlan): Promise<AttachmentTailResult>;
|
|
187
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 检索的**编排层**:把语料扫成「标题命中(首页即给全)+ 正文命中(按游标分页)」。
|
|
3
|
+
*
|
|
4
|
+
* 四条口径:
|
|
5
|
+
* ① **不建索引、不缓存**:回收站每次请求都现解压走帧,归档读宿主 `readSession` 事件流。索引是第二份事实源,会因会话继续写入 / 压缩 / 修复而失效,
|
|
6
|
+
* 而回收站的语义是"永不自动过期、随时可恢复"——维护一份会腐烂的副本比多解几次便宜得多(ADR-0074)。
|
|
7
|
+
* ② **扫描序 = 可见组序**:组根按清册原序、根接住的孩子紧跟其根;服务端不复刻界面的项目分组排序(那是视图语义),
|
|
8
|
+
* 标题区只认组根、正文区按这条扫描序,分页也稳定。游标记「下一条待扫的会话 + 该会话内已扫到的消息」,不记语料下标。
|
|
9
|
+
* ③ **读不出的会话不是"没有"**:解不开、超上限的进 `skipped` 单列,单位是**会话**(与 `scanned/total` 同单位),
|
|
10
|
+
* 界面必须说出来(否则用户以为自己搜全了)。
|
|
11
|
+
* ④ **预算是会话的属性、分页是传输的属性**:字符预算归抽取器(停机只停"收命中"、不停"计字符"),
|
|
12
|
+
* 编排层只负责一页扫多少会话。这样任何页都不会出现「先给了命中、后来又说没搜完」的半截结论。
|
|
13
|
+
*
|
|
14
|
+
* 两档的语料与读面不同,**由段名分开**(`/search` = 回收站、`/archive-search` = 归档):回收站读清册目录里的
|
|
15
|
+
* 日志文件(`readWholeSessionLog`),归档读宿主 `readSession` 的整本事件流;归档档是**平铺**的(一行一条会话、
|
|
16
|
+
* 不折孩子,`groupId` 就是 `sessionId`),且只认归档集成员(ADR-0061 的寻址边界)。分页 / 预算 / 游标的状态机
|
|
17
|
+
* 只写一遍({@link runPagedSearch}),档差异由 {@link SearchSource} 的七格适配器注入。
|
|
18
|
+
*/
|
|
19
|
+
import { type TrashEntry } from '../trash/entry.js';
|
|
20
|
+
import type { CoreDeps } from '../deps.js';
|
|
21
|
+
import type { SearchPageWire, SearchPreviewWire } from '../shared/wire.js';
|
|
22
|
+
/** `/search` 与 `/archive-search` 的请求。 */
|
|
23
|
+
export interface SearchRequest {
|
|
24
|
+
/** 已归一(trim + 小写)的查询串;匹配与哈希都认它。 */
|
|
25
|
+
readonly query: string;
|
|
26
|
+
readonly cursor: string | undefined;
|
|
27
|
+
}
|
|
28
|
+
/** `/search-preview` 与 `/archive-search-preview` 的请求。 */
|
|
29
|
+
export interface SearchPreviewRequest {
|
|
30
|
+
readonly query: string;
|
|
31
|
+
readonly rowId: string;
|
|
32
|
+
readonly messageIndex: number;
|
|
33
|
+
}
|
|
34
|
+
/** 一页最多回多少条正文命中。 */
|
|
35
|
+
export declare const SEARCH_PAGE_HITS = 20;
|
|
36
|
+
/** 一页最多扫多少条会话(防单个请求被一个大回收站拖死)。 */
|
|
37
|
+
export declare const SEARCH_PAGE_SESSIONS = 40;
|
|
38
|
+
/** 一页的软时限:到点先回这一页,剩下的走游标续扫。 */
|
|
39
|
+
export declare const SEARCH_PAGE_MS = 1500;
|
|
40
|
+
/** 归档档一页最多扫多少条会话:`readSession` 是整本事件流(没有字节读数、也没有流式),单页条数压小。 */
|
|
41
|
+
export declare const SEARCH_ARCHIVE_PAGE_SESSIONS = 8;
|
|
42
|
+
/** 单条日志的**压缩字节**上限:超过就不解,直接判超限(与详情的 256 MiB 是两个闸,检索不该为一条巨型日志等几秒)。 */
|
|
43
|
+
export declare const SEARCH_MAX_LOG_BYTES: number;
|
|
44
|
+
/** 单条会话**解压后正文**的上限(UTF-16 码元,与 JS 字符串下标同一把尺):压缩比可以很高,字节闸兜不住解压后的量。 */
|
|
45
|
+
export declare const SEARCH_MAX_TEXT_CHARS = 8000000;
|
|
46
|
+
/** 回收站档的一页检索(段名 `/search`):标题命中首页给全,正文命中按实体游标续扫。 */
|
|
47
|
+
export declare function runSearch(deps: CoreDeps, request: SearchRequest, rows: readonly TrashEntry[]): Promise<SearchPageWire>;
|
|
48
|
+
/** 归档档的一页检索(段名 `/archive-search`):与回收站同一条分页协议,语料换成「归档集 ∩ 语料」。 */
|
|
49
|
+
export declare function runArchiveSearch(deps: CoreDeps, request: SearchRequest): Promise<SearchPageWire>;
|
|
50
|
+
/** 回收站档的命中预览(段名 `/search-preview`):寻址只认清册行(外部输入进不了文件系统)。 */
|
|
51
|
+
export declare function runSearchPreview(deps: CoreDeps, request: SearchPreviewRequest, rows: readonly TrashEntry[]): Promise<SearchPreviewWire>;
|
|
52
|
+
/** 归档档的命中预览(段名 `/archive-search-preview`):只认归档集成员(与 `/archive-detail` 同一条寻址边界,ADR-0061)。 */
|
|
53
|
+
export declare function runArchivePreview(deps: CoreDeps, request: SearchPreviewRequest): Promise<SearchPreviewWire>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TrashEntry } from '../trash/entry.js';
|
|
2
|
-
import { type IdGroupClaim } from '../trash/groups.js';
|
|
2
|
+
import { type GroupClaim, type IdGroupClaim } from '../trash/groups.js';
|
|
3
3
|
import type { RemovalExecutor, RemovalPlan, RemovalStats } from './permanent-removal.js';
|
|
4
4
|
/**
|
|
5
5
|
* **清册作用域**:purge 这条写路径的「拿目标」owner。调用方交进一份清册快照(报告与 orphan-clean 入口不经作用域),
|
|
@@ -20,6 +20,10 @@ import type { RemovalExecutor, RemovalPlan, RemovalStats } from './permanent-rem
|
|
|
20
20
|
export interface TrashScope {
|
|
21
21
|
/** 一批 id 的输入序预裁决:`fresh` 带整组;carried / absent 没有组可交(判别联合不给误用的机会)。 */
|
|
22
22
|
claimAll(ids: readonly string[]): readonly IdGroupClaim[];
|
|
23
|
+
/** 单条按当前视图裁决(第二波补跑用:实况为准,不拿预裁决结果当答案)。 */
|
|
24
|
+
claim(id: string): GroupClaim;
|
|
25
|
+
/** 整批开始时这条 id 所属的组(挂起条目的附件扫描用,不随执行期收缩)。 */
|
|
26
|
+
originalGroup(id: string): readonly TrashEntry[];
|
|
23
27
|
/** 把这一组的计划递交给执行器;**成功才**收缩视图(收缩面 = 计划里真删的行,不二次扩组)。 */
|
|
24
28
|
runGroup(plan: RemovalPlan): Promise<RemovalStats>;
|
|
25
29
|
/** 清空:全部行当一组递进执行器;成功收缩到底(同一作用域再 claimAll 走 carried 幂等)。 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xrn1997/dsh-session-delete",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "在 DeepSeek Harness 里清理会话:可恢复的移入回收站,无恢复路径的彻底删除需二次确认",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@11.25.0",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"gates": "pnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm run pack:dry"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"react": "^18.3.1",
|
|
54
|
-
"react-dom": "18.3.1"
|
|
53
|
+
"react": "^18.3.1 || ^19.3.1",
|
|
54
|
+
"react-dom": "^18.3.1 || ^19.3.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependenciesMeta": {
|
|
57
57
|
"react": {
|
|
@@ -68,15 +68,15 @@
|
|
|
68
68
|
"@testing-library/jest-dom": "^6.10.0",
|
|
69
69
|
"@testing-library/react": "^16.3.3",
|
|
70
70
|
"@types/node": "24.19.0",
|
|
71
|
-
"@types/react": "
|
|
72
|
-
"@types/react-dom": "
|
|
71
|
+
"@types/react": "~19.3.3",
|
|
72
|
+
"@types/react-dom": "~19.3.0",
|
|
73
73
|
"@types/semver": "^7.8.0",
|
|
74
74
|
"eslint": "^10.14.0",
|
|
75
75
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
76
76
|
"globals": "^17.13.0",
|
|
77
77
|
"jsdom": "^26.1.0",
|
|
78
|
-
"react": "^
|
|
79
|
-
"react-dom": "
|
|
78
|
+
"react": "^19.3.1",
|
|
79
|
+
"react-dom": "^19.3.1",
|
|
80
80
|
"react-markdown": "^10.1.0",
|
|
81
81
|
"remark-gfm": "^4.0.1",
|
|
82
82
|
"semver": "^7.8.5",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 归档详情投影:信息表恰五行(项目 / 日志末条 / 会话 id / 大小 / 状态),无「回收站目录」「原本归档」;
|
|
3
|
-
* 状态行认主体自己的归档态(wire 的 `archived`),不认导航道或旧快照。
|
|
4
|
-
*/
|
|
5
|
-
import type { Translate } from './copy.js';
|
|
6
|
-
import type { ArchiveDetailLike } from './remote.js';
|
|
7
|
-
import type { ArchiveDetailSubject } from './use-archive-detail-reader.js';
|
|
8
|
-
import { type DetailNav } from './session-detail.js';
|
|
9
|
-
import type { DetailFrame } from './use-detail-frame.js';
|
|
10
|
-
export interface ArchiveDetailProps {
|
|
11
|
-
frame: DetailFrame<ArchiveDetailSubject, ArchiveDetailLike>;
|
|
12
|
-
busy: boolean;
|
|
13
|
-
wide: boolean;
|
|
14
|
-
detailNav: DetailNav;
|
|
15
|
-
onRetry: () => void;
|
|
16
|
-
onBack: () => void;
|
|
17
|
-
t: Translate;
|
|
18
|
-
}
|
|
19
|
-
export declare function ArchiveDetail({ frame, busy, wide, detailNav, onRetry, onBack, t, }: ArchiveDetailProps): import("react").JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { OneShotDeps } from './remote.js';
|
|
2
|
-
import { type TrashMoveTarget } from './write-seats.js';
|
|
3
|
-
export interface DeleteActionRequest extends TrashMoveTarget {
|
|
4
|
-
readonly seq: number;
|
|
5
|
-
}
|
|
6
|
-
export interface DeleteActionScene {
|
|
7
|
-
request(input: TrashMoveTarget): void;
|
|
8
|
-
clear(expected: DeleteActionRequest): void;
|
|
9
|
-
use(): DeleteActionRequest | null;
|
|
10
|
-
reset(): void;
|
|
11
|
-
}
|
|
12
|
-
export declare function createDeleteActionScene(): DeleteActionScene;
|
|
13
|
-
export declare function requestDelete(input: TrashMoveTarget): void;
|
|
14
|
-
export declare function useDeleteActionRequest(): DeleteActionRequest | null;
|
|
15
|
-
/**
|
|
16
|
-
* 菜单「移入回收站」的常驻动作宿主(挂 `shell.overlay`,不画界面):
|
|
17
|
-
* - 按 `handledRef` 认同一个请求对象引用,挡住 React StrictMode 对同一请求的二次 effect;
|
|
18
|
-
* - 按 `inFlightRef` 维护跨 tick 的单会话单飞,同一会话在飞时再点菜单不发第二趟写;
|
|
19
|
-
* - 错误兜底 + finally 清请求,防止 unhandled rejection 或请求悬挂。
|
|
20
|
-
*/
|
|
21
|
-
export declare function DeleteActionHost({ deps }: {
|
|
22
|
-
deps: OneShotDeps;
|
|
23
|
-
}): null;
|
|
@@ -1,39 +0,0 @@
|
|
|
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,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 回收站档:adapter(两档差异的回收站那一半)+ 本档四个视图件(清单行读数 / 详情投影 / 工具行 / 页脚)。
|
|
3
|
-
* 装配线住 `use-panel-tab.ts`,四格版面住 `panel-tab.tsx`;判据与 DOM 身份不变。
|
|
4
|
-
*/
|
|
5
|
-
import { type TrashEntryWire } from '../shared/wire.js';
|
|
6
|
-
import { type Translate } from './copy.js';
|
|
7
|
-
import type { TrashDetailLike } from './remote.js';
|
|
8
|
-
import type { TrashEntryLike } from './remote.js';
|
|
9
|
-
import { type TrashQuery } from './use-trash-query.js';
|
|
10
|
-
import { type TrashPanelController } from './use-trash-panel-controller.js';
|
|
11
|
-
import { type PanelTab, type PanelTabAdapter, type PanelTabContext } from './use-panel-tab.js';
|
|
12
|
-
import { type PanelTabFrameLayout } from './panel-tab.js';
|
|
13
|
-
export declare const TRASH_TAB_ADAPTER: PanelTabAdapter<TrashQuery, TrashEntryLike, TrashEntryWire, TrashDetailLike, TrashPanelController>;
|
|
14
|
-
export type TrashPanelTab = PanelTab<TrashQuery, TrashEntryLike, TrashEntryWire, TrashDetailLike, TrashPanelController>;
|
|
15
|
-
export interface TrashTabViewProps {
|
|
16
|
-
readonly tab: TrashPanelTab;
|
|
17
|
-
readonly layout: PanelTabFrameLayout;
|
|
18
|
-
readonly t: Translate;
|
|
19
|
-
}
|
|
20
|
-
/** 回收站档的四格视图:清单、详情、工具行(折叠 / 多选)、页脚(「不自动过期」+ 清空 / 批量两颗)。 */
|
|
21
|
-
export declare function TrashTabView({ tab, layout, t }: TrashTabViewProps): import("react").JSX.Element;
|
|
22
|
-
export declare function useTrashTab(ctx: PanelTabContext): TrashPanelTab;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `Tag`(**照抄** `@deepseek-ai/dsh-client-ui-primitives@0.2.0-rc.2` 的 Tag,出处与三条改写规则见
|
|
3
|
-
* `ui.css` 头注):只读的状态胶囊。
|
|
4
|
-
*
|
|
5
|
-
* 官方那套有八个 tone(outline/solid/neutral/quiet/success/info/warning/danger),本插件只用
|
|
6
|
-
* **danger 一档**(确认框里的失败原文)⇒ 这里只有这一个 tone,`tone` 收成单值联合而不是"先铺开、
|
|
7
|
-
* 以后可能用得上"。要加第二档时,把对应那条 CSS 与这个联合一起加。
|
|
8
|
-
*/
|
|
9
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
10
|
-
import './styles.js';
|
|
11
|
-
export interface TagProps {
|
|
12
|
-
/** 唯一的色板:破坏性/失败面(error 色的 10% 透明底 + error 字)。 */
|
|
13
|
-
tone: 'danger';
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
export declare function Tag({ tone, children }: TagProps): ReactElement;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|