@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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type SearchBodyFields, type SearchPreviewBodyFields } from '../shared/wire.js';
|
|
2
|
+
import type { SearchPreviewRequest, SearchRequest } from '../verbs/search.js';
|
|
3
|
+
export type { SearchPreviewRequest, SearchRequest };
|
|
4
|
+
/** 检索两段的请求体解析:形状已由通用解析手保证,这里只查语义。 */
|
|
5
|
+
export declare function searchBodyOf(fields: SearchBodyFields): SearchRequest;
|
|
6
|
+
/** 预览两段的请求体解析:`rowId` 非空与 `messageIndex` 非负整数由字段组保证。 */
|
|
7
|
+
export declare function searchPreviewBodyOf(fields: SearchPreviewBodyFields): SearchPreviewRequest;
|
|
@@ -5,7 +5,7 @@ import type { TrashRowWire } from '../shared/wire.js';
|
|
|
5
5
|
/** 行投影的只读数容器:`releaseBytes` 必填;其余缺席 = 这次没算,不是 0。 */
|
|
6
6
|
type TrashRowReadouts = {
|
|
7
7
|
readonly releaseBytes: number;
|
|
8
|
-
} & Partial<Pick<TrashRowWire, 'subagentCount' | 'subagentBytes' | 'strandedSubagents' | 'strandedBytes' | 'workspaceMissing'>>;
|
|
8
|
+
} & Partial<Pick<TrashRowWire, 'subagentCount' | 'subagentBytes' | 'strandedSubagents' | 'strandedBytes' | 'workspaceMissing' | 'projectRank'>>;
|
|
9
9
|
/** 清册行 → 线上行:清册字段走 `entryWire`(多一个必填字段会编译错),这里只补 `/list` 只读数。 */
|
|
10
10
|
export declare function toWire(row: TrashEntry, readouts: TrashRowReadouts): TrashRowWire;
|
|
11
11
|
/** 装配成「一行 = 一组」:孩子折进父行,父行不在时孩子自己占一行(否则看不见也清不掉)。
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* 整行点击守卫也挂在这棵常驻宿主上;浮条住 `shell.overlay`。
|
|
6
6
|
*/
|
|
7
7
|
import { type ReactElement } from 'react';
|
|
8
|
-
import { type Translate } from '
|
|
9
|
-
import type { OneShotDeps } from '
|
|
8
|
+
import { type Translate } from '../core/copy.js';
|
|
9
|
+
import type { OneShotDeps } from '../core/remote.js';
|
|
10
10
|
export declare function BatchBar({ deps, t, }: {
|
|
11
11
|
deps: OneShotDeps;
|
|
12
12
|
t?: Translate;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PickItem } from '
|
|
1
|
+
import { type PickItem } from '../state/batch-selection-store.js';
|
|
2
2
|
/** 全选:按登记序追加当前可见行;已在名单里的由 `addPicks` 跳过,原有选中保持在前。 */
|
|
3
3
|
export declare function selectAllVisible(): void;
|
|
4
4
|
/** Shift+点的范围勾选:以最近一次翻转的那条为锚,按屏幕可见行序勾上整段(锚点语义住选中集现场)。 */
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* 有状态点与归档行不渲染行首格,走行尾兜底(两条不会同时出现,靠 `ui.css` 的 `:has` 隐藏规则)。
|
|
7
7
|
*/
|
|
8
8
|
import { type ReactElement } from 'react';
|
|
9
|
-
import { type Translate } from '
|
|
10
|
-
import { type SessionDeleteRemote } from '
|
|
9
|
+
import { type Translate } from '../core/copy.js';
|
|
10
|
+
import { type SessionDeleteRemote } from '../core/remote.js';
|
|
11
11
|
/**
|
|
12
12
|
* 一组会话的子会话计数(`/apply` 的 `action:'count'`,纯读、不进串行链)。
|
|
13
13
|
* **一条读不到就整份返回 null**:界面上的合计缺一条就是假数(不许拿 0 冒充没有)。
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 批量模块的入口:多选态的呈现件(浮条 / 勾选控件 / 菜单行)与删除菜单行。选中集本身是场景现场
|
|
3
|
+
* (`state/batch-selection-store.ts`),这一层只管呈现与触发。
|
|
4
|
+
*
|
|
5
|
+
* 外部只 import 本文件;边界由 `tests/dependency-direction.test.ts` 钉住。
|
|
6
|
+
*/
|
|
7
|
+
export { BatchBar } from './batch-bar.js';
|
|
8
|
+
export { BatchSelectMenuItem } from './batch-menu-item.js';
|
|
9
|
+
export { BatchPickButton, BatchPickCheckbox } from './batch-select.js';
|
|
10
|
+
export { DeleteMenuItem } from './delete-menu-item.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 缺席退回内置 zh(为什么不用 inject 见 `docs/architecture.md` §3)。面板行名传 thunk,语言切换时宿主重读。
|
|
4
4
|
* 渠道错误原文(`receipt.ts` 的 missing-id / 幂等空值、`remote.ts` 的取数通道错误)是协议诊断,固定中文,不入本字典。
|
|
5
5
|
*/
|
|
6
|
-
import { type RelativeTimeUnit } from '
|
|
6
|
+
import { type RelativeTimeUnit } from '../ui/format.js';
|
|
7
7
|
import type { ClientContextLike } from './context.js';
|
|
8
8
|
/** zh 是真源;`en` 必须逐键齐全(宿主的对象形式注册会整体校验)。 */
|
|
9
9
|
declare const ZH: {
|
|
@@ -14,6 +14,8 @@ declare const ZH: {
|
|
|
14
14
|
readonly 'common.ago': "{n}{unit}前";
|
|
15
15
|
readonly 'common.retry': "重试";
|
|
16
16
|
readonly 'common.renderFailed': "这一块暂时显示不出来(其余部分照常)";
|
|
17
|
+
readonly 'toast.region': "通知";
|
|
18
|
+
readonly 'toast.close': "关闭通知";
|
|
17
19
|
readonly 'panel.tabs.label': "面板档位";
|
|
18
20
|
readonly 'trash.title': "回收站";
|
|
19
21
|
readonly 'trash.loading': "正在读回收站…";
|
|
@@ -60,6 +62,42 @@ declare const ZH: {
|
|
|
60
62
|
readonly 'trash.confirm.restore': "恢复 {count} 个会话?";
|
|
61
63
|
readonly 'trash.confirm.restore.body': "这一批会回到它们各自的原项目目录,恢复到会话列表里。";
|
|
62
64
|
readonly 'trash.confirm.restoreNow': "恢复";
|
|
65
|
+
readonly 'search.placeholder': "搜索标题与正文";
|
|
66
|
+
readonly 'search.clear': "清除检索";
|
|
67
|
+
readonly 'search.summary': "{sessions} 个会话 · {hits} 处命中";
|
|
68
|
+
readonly 'search.titleSection': "标题命中";
|
|
69
|
+
readonly 'search.bodySection': "正文命中";
|
|
70
|
+
readonly 'search.tag.title': "标题";
|
|
71
|
+
readonly 'search.tag.child': "子会话";
|
|
72
|
+
readonly 'search.hit.count': "已加载 {count} 处";
|
|
73
|
+
readonly 'search.loading': "正在检索…";
|
|
74
|
+
readonly 'search.results.label': "检索结果";
|
|
75
|
+
readonly 'search.scanning': "仍在检索 {done} / {total} 个会话…";
|
|
76
|
+
readonly 'search.loadMore': "继续检索";
|
|
77
|
+
readonly 'search.childMissing': "这条命中所在的子会话不在父会话详情里(可能超出摘要上限或已被移走)。";
|
|
78
|
+
readonly 'search.pagingFailed': "继续检索失败:{message}";
|
|
79
|
+
readonly 'search.incomplete': "检索期间语料发生变化,结果可能不完整。";
|
|
80
|
+
readonly 'search.incomplete.retry': "重新检索";
|
|
81
|
+
readonly 'search.skipped': "{count} 个会话未参与检索";
|
|
82
|
+
readonly 'search.skipped.withReasons': "{count} 个会话未参与检索({reasons})";
|
|
83
|
+
readonly 'search.skipped.unreadable': "读不出日志";
|
|
84
|
+
readonly 'search.skipped.tooLarge': "日志太大";
|
|
85
|
+
readonly 'search.empty.title': "没有找到「{query}」";
|
|
86
|
+
readonly 'search.empty.hint': "换个词试试,或清除检索回到清单。正文检索只包含用户与助手的文字。";
|
|
87
|
+
readonly 'search.failed': "检索失败";
|
|
88
|
+
readonly 'search.listNotReady': "清单还没读出来,检索结果暂时无法对齐到行;稍后重试,或先清空检索。";
|
|
89
|
+
readonly 'search.preview.position': "命中预览 · 第 {index} / {count} 处";
|
|
90
|
+
readonly 'search.preview.prev': "上一处";
|
|
91
|
+
readonly 'search.preview.next': "下一处";
|
|
92
|
+
readonly 'search.preview.openDetail': "在完整详情中打开";
|
|
93
|
+
readonly 'search.preview.fromChild': "这条命中来自子会话(正文取自子会话日志)";
|
|
94
|
+
readonly 'search.preview.truncated': "已截断";
|
|
95
|
+
readonly 'search.preview.restore': "恢复这条会话";
|
|
96
|
+
readonly 'search.preview.unarchive': "解除归档";
|
|
97
|
+
readonly 'search.preview.moveToTrash': "移入回收站";
|
|
98
|
+
readonly 'search.preview.purge': "彻底删除…";
|
|
99
|
+
readonly 'search.preview.roleUser': "你";
|
|
100
|
+
readonly 'search.preview.roleAssistant': "助手";
|
|
63
101
|
readonly 'trash.orphans.banner': "回收站之外发现 {count} 个无主子会话";
|
|
64
102
|
readonly 'trash.orphans.meta': "共 {size},来自 {parents} 个失踪的父会话";
|
|
65
103
|
readonly 'trash.orphans.open': "查看并清理";
|
|
@@ -187,6 +225,7 @@ declare const ZH: {
|
|
|
187
225
|
readonly 'detail.block.status.error': "失败";
|
|
188
226
|
readonly 'detail.block.status.unfinished': "未完成";
|
|
189
227
|
readonly 'detail.block.truncated': "已截断";
|
|
228
|
+
readonly 'detail.jump.missing': "命中在更早一页";
|
|
190
229
|
readonly 'detail.loadOlder': "加载更早";
|
|
191
230
|
readonly 'detail.loadOlder.loading': "正在加载更早…";
|
|
192
231
|
/** 提问轨(详情右缘那道常驻刻度):一句用户提问一格,点一格跳到那句。 */
|
|
@@ -300,7 +339,7 @@ export declare function createTranslate(ctx: ClientContextLike): Translate;
|
|
|
300
339
|
* 换语言就漏了。也必须是词的读数而不是 `t` 的身份:宿主 `t` 身份稳定,换语言后同一个 `t` 吐另一套词。
|
|
301
340
|
*
|
|
302
341
|
* **失效模式**:借的那句若两种语言译成同一字面,探针分不出换语言(memo 恒等、旧语言滞留);由
|
|
303
|
-
* `tests/client/markdown.test.tsx` 的换语言用例兜住,换借句或改那句译文时先看它红不红。
|
|
342
|
+
* `tests/client/detail/markdown.test.tsx` 的换语言用例兜住,换借句或改那句译文时先看它红不红。
|
|
304
343
|
*/
|
|
305
344
|
export declare function localeProbe(t: Translate): string;
|
|
306
345
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Translate } from './copy.js';
|
|
2
|
-
import { type ApplyAction, type ApplyOutcome, type ApplyValueByAction, type AttachmentCleanupWire, type RemoteFailure } from '
|
|
2
|
+
import { type ApplyAction, type ApplyOutcome, type ApplyValueByAction, type AttachmentCleanupWire, type RemoteFailure } from '../../shared/wire.js';
|
|
3
3
|
/**
|
|
4
4
|
* 一条 `/apply` 结果对一个请求 id 的含义(各写入面不许再各自推导):缺 id 是通道错误,`null` 是幂等成功,
|
|
5
5
|
* orphan-clean 的 `not-found` 是中性提示,**N=1 的 `null` 是协议错**;`applyOne` 与 `runWrite` 只消费同一份 verdict。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ApplyAction, type ApplyOutcome, type ApplyValueByAction, type ArchiveDetailWire, type ArchiveListWire, type AttachmentCleanupWire, type AttachmentOrphanReportWire, type OrphanReportWire, type ProjectionCacheCleanupWire, type ProjectionCacheOrphanReportWire, type PurgeStatsWire, type RemoteFailure, type SessionDeleteConfigWire, type TrashDetailWire, type TrashRowWire, type WriteProgressWire } from '
|
|
1
|
+
import { type ApplyAction, type ApplyOutcome, type ApplyValueByAction, type ArchiveDetailWire, type ArchiveListWire, type AttachmentCleanupWire, type AttachmentOrphanReportWire, type OrphanReportWire, type ProjectionCacheCleanupWire, type ProjectionCacheOrphanReportWire, type PurgeStatsWire, type RemoteFailure, type SearchPageWire, type SearchPreviewWire, type SearchScopeWire, type SessionDeleteConfigWire, type TrashDetailWire, type TrashRowWire, type WriteProgressWire } from '../../shared/wire.js';
|
|
2
2
|
/** 下面这些只读面都是 `shared/wire.ts` 的别名:形状的家只在那边(ADR-0003)。 */
|
|
3
3
|
export type TrashEntryLike = TrashRowWire;
|
|
4
4
|
export type PurgeResultLike = PurgeStatsWire;
|
|
@@ -8,6 +8,10 @@ export type TrashDetailLike = TrashDetailWire;
|
|
|
8
8
|
export type ArchiveListLike = ArchiveListWire;
|
|
9
9
|
/** 归档单条详情:基座 + sessionId,无 `entryId`;子会话段是只读投影,来源与回收站不同。 */
|
|
10
10
|
export type ArchiveDetailLike = ArchiveDetailWire;
|
|
11
|
+
/** 检索一页:标题命中(首页即给全)+ 正文命中一页 + 续扫游标。 */
|
|
12
|
+
export type SearchPageLike = SearchPageWire;
|
|
13
|
+
/** 一条正文命中的窗口(前邻 / 命中 / 后邻)与本会话内命中序号。 */
|
|
14
|
+
export type SearchPreviewLike = SearchPreviewWire;
|
|
11
15
|
/** 信封与失败形状的家在 `shared/wire.js`:浏览器半不补标记位、不抛失败(异常 → 失败面是 Node 半的活)。 */
|
|
12
16
|
export type RemoteOutcome<T> = {
|
|
13
17
|
ok: true;
|
|
@@ -39,6 +43,19 @@ export interface SessionDeleteRemote {
|
|
|
39
43
|
archiveList(): Promise<RemoteOutcome<ArchiveListLike>>;
|
|
40
44
|
/** 纯读:归档单条详情(subagent 闭包成员也行;寻址红线:只传 id)。 */
|
|
41
45
|
archiveDetail(sessionId: string, before?: number, rootSessionId?: string): Promise<RemoteOutcome<ArchiveDetailLike>>;
|
|
46
|
+
/** 纯读:按查询串扫一档语料(`scope` 只用来选段名,见实现处的投影);`cursor` 缺省是首页,`null` 即扫完。 */
|
|
47
|
+
search(input: {
|
|
48
|
+
readonly scope: SearchScopeWire;
|
|
49
|
+
readonly query: string;
|
|
50
|
+
readonly cursor?: string;
|
|
51
|
+
}, signal?: AbortSignal): Promise<RemoteOutcome<SearchPageLike>>;
|
|
52
|
+
/** 纯读:一条正文命中的窗口;只服务正文命中,标题命中走 `detail`。 */
|
|
53
|
+
searchPreview(input: {
|
|
54
|
+
readonly scope: SearchScopeWire;
|
|
55
|
+
readonly query: string;
|
|
56
|
+
readonly rowId: string;
|
|
57
|
+
readonly messageIndex: number;
|
|
58
|
+
}, signal?: AbortSignal): Promise<RemoteOutcome<SearchPreviewLike>>;
|
|
42
59
|
/** 一组 id 上的同一动作:顶层 `ok:false` 只表示整次调用没办成,单条成败住在 `ApplyOutcome` 里。 */
|
|
43
60
|
applyOutcomes(action: ApplyAction, ids: readonly string[]): Promise<RemoteOutcome<ApplyOutcome[]>>;
|
|
44
61
|
emptyTrash(): Promise<RemoteOutcome<PurgeResultLike>>;
|
|
@@ -74,7 +91,7 @@ export interface HttpRemoteOptions {
|
|
|
74
91
|
* 鉴权归宿主 `/api` bridge(ADR-0033),凭据是宿主页面访问换来的 cookie,不是插件自己的秘密。
|
|
75
92
|
*/
|
|
76
93
|
export declare function createHttpRemote(options?: HttpRemoteOptions): SessionDeleteRemote;
|
|
77
|
-
/** 探测默认上限:5s
|
|
94
|
+
/** 探测默认上限:5s。超时信号由 `AbortSignal.timeout` 产生,取数面把它转发给 fetch,`activate` 不会永远吊在一条半开连接上。 */
|
|
78
95
|
export declare const PROBE_TIMEOUT_MS = 5000;
|
|
79
96
|
/** 探测的可选覆盖:**生产不传**(只用 {@link PROBE_TIMEOUT_MS});存在只为让「超时算探测不过」在测试里跑到。 */
|
|
80
97
|
export interface ProbeOptions {
|
|
@@ -83,6 +100,10 @@ export interface ProbeOptions {
|
|
|
83
100
|
/**
|
|
84
101
|
* 探测唯一通道:一次 `GET /ping` 回成功信封(`pong`)才注册入口;401/403 与任何失败都不装禁用态。
|
|
85
102
|
* 往返有 5s 上限,超时与网络失败同样是「这一代不可用」,不自动重试(刷新才会再探);失败在 console 留原因。
|
|
103
|
+
*
|
|
104
|
+
* 上限用 `AbortSignal.timeout`(平台原语,2022 年起 widely available):这里没有「取消这一趟」的第二
|
|
105
|
+
* 个入口——探测是单发、无人回撤,`clearTimeout` 那一支也就没有必要。调用方 signal 仍由
|
|
106
|
+
* `requestOutcome` 转发(见那里的 relayAbort),两者互不替代。
|
|
86
107
|
*/
|
|
87
108
|
export declare function probeChannel(deps: SessionDeleteRemote, options?: ProbeOptions): Promise<boolean>;
|
|
88
109
|
/** N=1 的成功支:`value` 必然非空(null 已由 `readSingleReceipt` 折成协议错);成败只认 `RemoteOutcome.ok`(ADR-0053)。 */
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 详情正文的**块渲染**:用户 / 助手 / 折叠块(思考、工具、注入、系统、压缩摘要)怎么画,
|
|
3
|
+
* 以及「工作步骤」四档展开语义(`docs/ui-spec.md` §2 ⑥)。块视图词汇(哪些块算过程内容、
|
|
4
|
+
* 连续过程块怎么收组)住 `detail-blocks.ts`,这里只消费。
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactNode } from 'react';
|
|
7
|
+
import { type CopyKey, type Translate } from '../core/copy.js';
|
|
8
|
+
import { type TrashDetailBlockWire } from '../../shared/wire.js';
|
|
9
|
+
/** 工作步骤展示档位(学宿主那四档;回收站轮次都已结束,所以只落成「过程块显示多少」);判据住 `docs/ui-spec.md` §2 ⑥。 */
|
|
10
|
+
export type ViewMode = 'compact' | 'standard' | 'detailed' | 'verbose';
|
|
11
|
+
export declare const VIEW_MODES: readonly {
|
|
12
|
+
readonly key: ViewMode;
|
|
13
|
+
readonly label: CopyKey;
|
|
14
|
+
}[];
|
|
15
|
+
interface BlockRenderContext {
|
|
16
|
+
open: ReadonlySet<string>;
|
|
17
|
+
toggle: (id: string) => void;
|
|
18
|
+
probe: string;
|
|
19
|
+
t: Translate;
|
|
20
|
+
}
|
|
21
|
+
export declare function renderBlock(block: TrashDetailBlockWire, context: BlockRenderContext): ReactNode;
|
|
22
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 详情正文的**块视图词汇**:哪些块算过程内容、标准档怎么把连续过程块收成一组。
|
|
3
3
|
* 折叠状态与分页不在这里。
|
|
4
4
|
*/
|
|
5
|
-
import type { TrashDetailBlockWire, TrashDetailInjectionBlockWire, TrashDetailTextBlockWire, TrashDetailToolBlockWire } from '
|
|
5
|
+
import type { TrashDetailBlockWire, TrashDetailInjectionBlockWire, TrashDetailTextBlockWire, TrashDetailToolBlockWire } from '../../shared/wire.js';
|
|
6
6
|
/** 除用户与助手之外的块(思考、工具、注入、系统消息、压缩摘要)。`Exclude` 摘不掉文本块 `kind` 联合里的两个成员,
|
|
7
7
|
* 所以按 `kind` 收窄后并上另两种块。 */
|
|
8
8
|
export type DisclosureBlockWire = (TrashDetailTextBlockWire & {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 详情壳的**版面常量**:外壳、标题行、信息表、计量行、正文块与折叠头、工具行与错误字色。
|
|
3
|
+
*
|
|
4
|
+
* 为什么单拎一个文件:这些是纯数据(`CSSProperties` 字面量),改版式要一次改一片、而改逻辑的人不该在
|
|
5
|
+
* 250 行样式里翻正文代码。消费方只有详情壳、块渲染与子会话段三处。
|
|
6
|
+
*/
|
|
7
|
+
import type { CSSProperties } from 'react';
|
|
8
|
+
export declare const JUMP_MISSING: CSSProperties;
|
|
9
|
+
export declare const SHELL: CSSProperties;
|
|
10
|
+
/** 返回键排在标题之后;标题排按紧凑按钮预留高度(父子切换不跳 6px)。`position: sticky`:长会话中段返回键仍在(触屏没有 Esc)。 */
|
|
11
|
+
export declare const HEAD_MIN_HEIGHT = 28;
|
|
12
|
+
export declare const HEAD_PAD_BOTTOM = 6;
|
|
13
|
+
export declare const HEAD: CSSProperties;
|
|
14
|
+
export declare const TITLE_LINE: CSSProperties;
|
|
15
|
+
export declare const BACK: CSSProperties;
|
|
16
|
+
/** 保持超过 300ms 才出「正在读…」:本地读数通常在这之前落地;与宿主慢扫描提示同档。 */
|
|
17
|
+
export declare const HOLD_NOTICE_DELAY_MS = 300;
|
|
18
|
+
export declare const HOLD_NOTICE: CSSProperties;
|
|
19
|
+
/** 会话信息表:行序按「认出 → 时间定位 → 精确核对 → 调试属性」排(`docs/ui-spec.md` §2 ⑥);长串省略、全称走 `title`。 */
|
|
20
|
+
export declare const META: CSSProperties;
|
|
21
|
+
export declare const META_LABEL: CSSProperties;
|
|
22
|
+
export declare const META_VALUE: CSSProperties;
|
|
23
|
+
export declare const META_CODE: CSSProperties;
|
|
24
|
+
/** 计量行:可横着扫的数字,与表分开;不插中点分隔符——那是各语言自己的标点。 */
|
|
25
|
+
export declare const METRICS: CSSProperties;
|
|
26
|
+
export declare const METRIC: CSSProperties;
|
|
27
|
+
export declare const METRIC_LABEL: CSSProperties;
|
|
28
|
+
export declare const METRIC_VALUE: CSSProperties;
|
|
29
|
+
/** 行距取宿主 `--dsh-chat-flow-gap` 的换轮档 12px(我们相邻两条必然换轮)。 */
|
|
30
|
+
export declare const THREAD: CSSProperties;
|
|
31
|
+
/**
|
|
32
|
+
* 消息行照宿主 `MessageItem` / `AssistantMarkdown` 抄(来源 `app.asar` 里 `@deepseek-ai/dsh-client-ui-chat/lib/client.js`
|
|
33
|
+
* 内联的 `MessageItem.module.css` 与 `AssistantMarkdown.module.css`,逐字声明):只有用户有气泡,助手正文铺满栏(给助手画卡片会走形);
|
|
34
|
+
* 字号走 `--dsh-content-font-size`,宿主调内容字号时这里一起动。
|
|
35
|
+
*/
|
|
36
|
+
/** 提问轨跳过来的落位让位(`JUMP_SCROLL_MARGIN_PX`):目标行停在 sticky 标题排之下而不是被它盖住。 */
|
|
37
|
+
export declare const USER_ROW: CSSProperties;
|
|
38
|
+
export declare const ASSISTANT_ROW: CSSProperties;
|
|
39
|
+
/** 宿主是 `.userRow > .userStack > .bubble` 三层,宽度上限在中间层;这里一行一气泡,直接挂在气泡上(少一层)。 */
|
|
40
|
+
export declare const BUBBLE: CSSProperties;
|
|
41
|
+
/** 宿主的次级行字阶(`.referenceSummary` / `.retryRow` 那一族):角色与时间就归它,不再自造 11px。 */
|
|
42
|
+
export declare const META_LINE: CSSProperties;
|
|
43
|
+
/** 读失败与写失败共用的那块(`role="status"`;播报口径与其未验证的边界见 docs/ui-spec.md)。 */
|
|
44
|
+
export declare const STATUS_BLOCK: CSSProperties;
|
|
45
|
+
export declare const BLOCK: CSSProperties;
|
|
46
|
+
/** 折叠头:与清单组头共用 `sd-disclosure-row` 的布局/悬停/无障碍;这里把 button 的 UA 样式压掉。 */
|
|
47
|
+
export declare const BLOCK_ROW: CSSProperties;
|
|
48
|
+
/** 标签不参与收缩:摘要是 `1 1 auto`,标签若也可缩,长结果会把「工具调用 / 来源」挤成几个字。
|
|
49
|
+
* 颜色不跟 `.sd-disclosure-row` 继承:标签提 secondary、摘要留 tertiary,否则同色糊成一句。 */
|
|
50
|
+
export declare const BLOCK_TITLE: CSSProperties;
|
|
51
|
+
export declare const BLOCK_SUMMARY: CSSProperties;
|
|
52
|
+
export declare const BLOCK_META: CSSProperties;
|
|
53
|
+
export declare const BLOCK_BODY: CSSProperties;
|
|
54
|
+
export declare const PLAIN_BODY: CSSProperties;
|
|
55
|
+
/** 工具参数/结果:等宽、保留换行、限高自滚——一段工具输出可能比整页还长。 */
|
|
56
|
+
export declare const CODE_BLOCK: CSSProperties;
|
|
57
|
+
export declare const SECTION_LABEL: CSSProperties;
|
|
58
|
+
/** 标准档「工作步骤」展开后的过程块容器:再缩进一档,与折叠头的前导对齐。 */
|
|
59
|
+
export declare const PROCESS_BODY: CSSProperties;
|
|
60
|
+
export declare const TOOLBAR: CSSProperties;
|
|
61
|
+
export declare const TRUNCATED: CSSProperties;
|
|
62
|
+
export declare const ERROR_TEXT: CSSProperties;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 详情正文的**文字与时间读法**(纯函数,无 React):时间戳降级、活跃跨度、块摘要、注入来源标签、
|
|
3
|
+
* 工具状态词。判据住在这一层:给同样的日志形状,正文到处是同一句人话。
|
|
4
|
+
*/
|
|
5
|
+
import { type Translate } from '../core/copy.js';
|
|
6
|
+
/** 日志里那两个时间戳缺省时的降级(`src/trash/detail.ts` 把初值写成 0,读不到就是 0)。 */
|
|
7
|
+
export declare function timeText(ms: number): string;
|
|
8
|
+
/** 活跃跨度:不足一天给小时、超过给天;两端任一缺省就不答(不把「不知道」报成任何量级)。 */
|
|
9
|
+
export declare function spanText(from: number, to: number, t: Translate): string | undefined;
|
|
10
|
+
export declare function firstLine(text: string): string;
|
|
11
|
+
/** Markdown 块的摘要去掉粗体星号(与宿主 ReasoningRow 同一手法);纯文本块照原样。 */
|
|
12
|
+
export declare function markdownSummary(text: string): string;
|
|
13
|
+
/** 来源标签 + 悬停原串:认不出的 kind 收进「其他上下文」,原串留在 title。 */
|
|
14
|
+
export declare function injectionLabel(kind: string, t: Translate): {
|
|
15
|
+
text: string;
|
|
16
|
+
title: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function toolStatus(status: 'ok' | 'error' | 'unfinished', t: Translate): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 详情模块的入口:会话详情壳(块投影 / 工具配对 / 跳转)、右缘提问轨、读路与分页、子会话段,
|
|
3
|
+
* 以及两档各自的详情读 hook(`useTrashDetailReader` / `useArchiveDetailReader`)。
|
|
4
|
+
*
|
|
5
|
+
* 外部只 import 本文件;`detail-blocks` 的切块、`markdown` 的渲染、分页这些是这一层的实现细节
|
|
6
|
+
* (ADR-0047 / ADR-0054 / ADR-0061)。**详情账本不在这一层**:`src/client/core/detail-ledger.ts` 与首帧快照
|
|
7
|
+
* 同属跨槽位协议,两档读路都经它记账。边界由 `tests/dependency-direction.test.ts` 钉住。
|
|
8
|
+
*/
|
|
9
|
+
export { PromptRail, RAIL_WIDTH } from './prompt-rail.js';
|
|
10
|
+
export { SessionDetail, type DetailInfoRow, type DetailJump, type DetailNav } from './session-detail.js';
|
|
11
|
+
export { timeText } from './detail-text.js';
|
|
12
|
+
export { rowName, useSubagentSection } from './subagent-section.js';
|
|
13
|
+
export { childSubjectOf, useArchiveDetailReader, type ArchiveDetailSubject, } from './use-archive-detail-reader.js';
|
|
14
|
+
export { useDetailFrame, type DetailFrame } from './use-detail-frame.js';
|
|
15
|
+
export { NO_DETAIL_RAIL, type DetailRail, type RailDetailLike } from './use-detail-rail.js';
|
|
16
|
+
export { type DetailState } from './use-detail-reader.js';
|
|
17
|
+
export { useTrashDetailReader } from './use-trash-detail-reader.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Translate } from '
|
|
2
|
-
import '
|
|
1
|
+
import type { Translate } from '../core/copy.js';
|
|
2
|
+
import '../ui/styles.js';
|
|
3
3
|
/**
|
|
4
4
|
* `memo` 是必需的而不是优化:`react-markdown@10.1.0` 里**一处 memoization 都没有**,面板任何一次重渲
|
|
5
5
|
* (悬停、↑↓、「刚刚移入回收站」那句要读 `Date.now()`)都会走到这里 ⇒ 不按住就是每条助手回复每拍重解析一遍。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Translate } from '
|
|
1
|
+
import { type Translate } from '../core/copy.js';
|
|
2
2
|
import type { PromptRailNotice } from './use-prompt-rail.js';
|
|
3
|
-
import type { TrashDetailPromptWire } from '
|
|
3
|
+
import type { TrashDetailPromptWire } from '../../shared/wire.js';
|
|
4
4
|
/** 轨宽(px):刻度与焦点环都按它排;面板的右槽宽度从它派生(`RAIL_GUTTER`)。 */
|
|
5
5
|
export declare const RAIL_WIDTH = 30;
|
|
6
6
|
export interface PromptRailProps {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
* 两档同守:动作留在清单行;正文是块(用户/助手常显,其余默认折叠;注入也铺进正文——对宿主 Chat 的有意偏离,删之前看全);助手/思考走 Markdown,提问保持原话。
|
|
8
8
|
*/
|
|
9
|
-
import { type
|
|
10
|
-
import { type Translate } from '
|
|
11
|
-
import type { SessionDetailWire } from '../shared/wire.js';
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
import { type Translate } from '../core/copy.js';
|
|
12
11
|
import { type DetailFrameView } from './use-detail-frame.js';
|
|
12
|
+
import { type SessionDetailWire } from '../../shared/wire.js';
|
|
13
13
|
/** 详情的导航面(孩子视图的开与回):类型定义在这里(控制器 `import type` 避免环);孩子一律按 id 交接(ADR-0055)。 */
|
|
14
14
|
export interface DetailNav {
|
|
15
15
|
/** 只在主体是清单选中那条时交出(ADR-0055 沿用的单级判据,唯一实现)。 */
|
|
@@ -33,6 +33,16 @@ export interface SubagentSectionProps {
|
|
|
33
33
|
readonly badge: ReactNode;
|
|
34
34
|
readonly body: ReactNode;
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* 「在完整详情中打开」的目标:命中的那条消息的时间戳(块上带同一个 `time`)与查询串(同一毫秒里有多块时按文字挑)。
|
|
38
|
+
* 命中的块不在已加载的这一页 ⇒ 组件出「命中在更早一页 · 加载更早」,不静默放弃。
|
|
39
|
+
*/
|
|
40
|
+
export interface DetailJump {
|
|
41
|
+
readonly time: number;
|
|
42
|
+
readonly query: string;
|
|
43
|
+
/** 期望对齐的主体(条目 id / sessionId):给了就只在详情正画着它时尝试,避免用上一条详情的块误命中。 */
|
|
44
|
+
readonly subjectId?: string;
|
|
45
|
+
}
|
|
36
46
|
export interface SessionDetailProps<S, D extends SessionDetailWire> {
|
|
37
47
|
/** 详情帧:壳只消费读路状态与分页读面;`rail` / `canNavigate` / 行投影不归壳。 */
|
|
38
48
|
frame: DetailFrameView<S, D>;
|
|
@@ -50,15 +60,12 @@ export interface SessionDetailProps<S, D extends SessionDetailWire> {
|
|
|
50
60
|
onRetry: () => void;
|
|
51
61
|
onBack: () => void;
|
|
52
62
|
detailNav: DetailNav;
|
|
63
|
+
/** 检索跳转目标:给了就在这一帧就绪后对齐到命中块(只对齐、不画落地框);`undefined` = 普通打开。 */
|
|
64
|
+
jump?: DetailJump | undefined;
|
|
65
|
+
/** 跳转落地(滚到了或确认找不到)后回调:调用方据此清掉目标,后续重读不再滚。 */
|
|
66
|
+
onJumpDone?: (() => void) | undefined;
|
|
67
|
+
/** 详情头的一条明确提示(例:命中所在的子会话不在摘要里):不静默把失败当成功。 */
|
|
68
|
+
notice?: string | null;
|
|
53
69
|
t: Translate;
|
|
54
70
|
}
|
|
55
|
-
|
|
56
|
-
export declare const HEAD_MIN_HEIGHT = 28;
|
|
57
|
-
export declare const HEAD_PAD_BOTTOM = 6;
|
|
58
|
-
export declare const BLOCK_META: CSSProperties;
|
|
59
|
-
export declare const SECTION_LABEL: CSSProperties;
|
|
60
|
-
/** 日志里那两个时间戳缺省时的降级(`src/trash/detail.ts` 把初值写成 0,读不到就是 0)。 */
|
|
61
|
-
export declare function timeText(ms: number): string;
|
|
62
|
-
/** 空串不是名字:wire 用缺席表示没读到,清册字段仍可能是空串;行名与标题排共用这一条。 */
|
|
63
|
-
export declare function present(value: string | undefined): value is string;
|
|
64
|
-
export declare function SessionDetail<S, D extends SessionDetailWire>({ frame, subjectId, head, infoRows, subagents, busy, wide, onRetry, onBack, detailNav, t, }: SessionDetailProps<S, D>): import("react").JSX.Element;
|
|
71
|
+
export declare function SessionDetail<S, D extends SessionDetailWire>({ frame, subjectId, head, infoRows, subagents, busy, wide, onRetry, onBack, detailNav, jump, onJumpDone, notice, t, }: SessionDetailProps<S, D>): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Translate } from '
|
|
2
|
-
import {
|
|
1
|
+
import { type Translate } from '../core/copy.js';
|
|
2
|
+
import type { SubagentSectionProps } from './session-detail.js';
|
|
3
3
|
/** 子会话行与摘要条共用的显示名:次序走 `preferredNameOf`(ADR-0058),空串走未命名兜底。 */
|
|
4
4
|
export declare function rowName(row: {
|
|
5
5
|
readonly label?: string;
|
package/lib/types/client/{use-archive-detail-reader.d.ts → detail/use-archive-detail-reader.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ArchiveSubagentWire } from '
|
|
2
|
-
import type { ArchiveDetailLike, SessionDeleteRemote } from '
|
|
1
|
+
import type { ArchiveSubagentWire } from '../../shared/wire.js';
|
|
2
|
+
import type { ArchiveDetailLike, SessionDeleteRemote } from '../core/remote.js';
|
|
3
3
|
import { type DetailReader } from './use-detail-reader.js';
|
|
4
4
|
/** 归档详情主体:清单里的已归档行,或父详情子会话段里那条孩子(后者可缺时间读数)。 */
|
|
5
5
|
export interface ArchiveDetailSubject {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 「滚到顶就补一页」会让新页一页页顶在读者头上(ADR-0057)。
|
|
5
5
|
*/
|
|
6
6
|
import { type RefObject } from 'react';
|
|
7
|
-
import type { TrashDetailBlockWire } from '
|
|
7
|
+
import type { TrashDetailBlockWire } from '../../shared/wire.js';
|
|
8
8
|
/** 简洁档一次补页最多自动连翻多少页:服务端按块翻页,一页可能全是藏起来的过程块 ⇒ 点一下什么都不
|
|
9
9
|
* 出现。自动往前翻直到出现对话块、翻完或到上限——上限防"几乎全是工具调用的巨型会话"把一次点击
|
|
10
10
|
* 变成几十个串行请求。 */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* (窄档下钻后 ref 才补上,只靠 ref 会漏挂滚动监听,ADR-0057)。
|
|
6
6
|
*/
|
|
7
7
|
import { type RefObject } from 'react';
|
|
8
|
-
import type { TrashDetailBlockWire, TrashDetailPromptWire } from '
|
|
8
|
+
import type { TrashDetailBlockWire, TrashDetailPromptWire } from '../../shared/wire.js';
|
|
9
9
|
import type { DetailState } from './use-detail-reader.js';
|
|
10
10
|
import { type PromptRailHandle } from './use-prompt-rail.js';
|
|
11
11
|
/** 轨要的三格:`SessionDetailWire` 与它的两档投影都够(两半的详情线上都带这三样)。 */
|
|
@@ -36,4 +36,6 @@ export interface DetailRail {
|
|
|
36
36
|
readonly disabled: boolean;
|
|
37
37
|
readonly handle: PromptRailHandle;
|
|
38
38
|
}
|
|
39
|
+
/** 没有提问轨时的空轨读数(检索态的命中预览不是正文投影,没有轨可画):两档共用同一份,不各写一份字面量。 */
|
|
40
|
+
export declare const NO_DETAIL_RAIL: DetailRail;
|
|
39
41
|
export declare function useDetailRail<S, D extends RailDetailLike>({ state, canNavigate, loadingOlder, olderFailure, loadOlder, scrollRef, paneMounted, }: DetailRailInput<S, D>): DetailRail;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TrashDetailBlockWire } from '
|
|
2
|
-
import type { DetailLedger } from '
|
|
3
|
-
import type { RemoteOutcome } from '
|
|
1
|
+
import type { TrashDetailBlockWire } from '../../shared/wire.js';
|
|
2
|
+
import type { DetailLedger } from '../core/detail-ledger.js';
|
|
3
|
+
import type { RemoteOutcome } from '../core/remote.js';
|
|
4
4
|
/** 详情值的最小面:分页合并只认这两格。 */
|
|
5
5
|
export interface DetailBody {
|
|
6
6
|
readonly blocks: readonly TrashDetailBlockWire[];
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* **当前那句只在已加载的块里找**;**换主体就收手**(跳转账的基线属于起跳那条,`prompts` 身份一变作废)。
|
|
6
6
|
*/
|
|
7
7
|
import { type RefObject } from 'react';
|
|
8
|
-
import type { TrashDetailBlockWire, TrashDetailPromptWire } from '
|
|
8
|
+
import type { TrashDetailBlockWire, TrashDetailPromptWire } from '../../shared/wire.js';
|
|
9
9
|
/** 一次跳转最多连续补多少页(每页 30 块):防「点最老那句」把一次点击变成几十个串行请求。 */
|
|
10
10
|
export declare const JUMP_PAGE_LIMIT = 20;
|
|
11
11
|
/** 跳转落位时目标行离视口顶的距离(px):给 sticky 标题排让位;详情用户行以行内 `scrollMarginTop` 消费它。 */
|
package/lib/types/client/{use-trash-detail-reader.d.ts → detail/use-trash-detail-reader.d.ts}
RENAMED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* 回收站的详情读路:通用机制(`use-detail-reader.ts`)的薄实例——账本 = `trash-snapshot.ts` 的跨挂载账本
|
|
3
3
|
* (键 = 条目 id),fetch = `deps.detail`;机制只住通用层一份。
|
|
4
4
|
*/
|
|
5
|
-
import type { TrashEntryWire } from '
|
|
6
|
-
import type { SessionDeleteRemote, TrashDetailLike } from '
|
|
5
|
+
import type { TrashEntryWire } from '../../shared/wire.js';
|
|
6
|
+
import type { SessionDeleteRemote, TrashDetailLike } from '../core/remote.js';
|
|
7
7
|
import { type DetailReader } from './use-detail-reader.js';
|
|
8
8
|
type DetailDeps = Pick<SessionDeleteRemote, 'detail'>;
|
|
9
9
|
export interface TrashDetailReaderInput {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ClientContextLike } from '
|
|
2
|
-
import type { Translate } from '
|
|
1
|
+
import type { ClientContextLike } from '../core/context.js';
|
|
2
|
+
import type { Translate } from '../core/copy.js';
|
|
3
3
|
import { type SessionsStateLike } from './session-live.js';
|
|
4
4
|
/** legacy 菜单槽:只在 contextMenus 不可用时注册(0.2.2+ 的内置动作已迁到数据动作)。 */
|
|
5
5
|
export declare const SESSION_MENU_SLOT = "sidebar.workspaces.session.menu.item";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 槽位贡献的**包装件**:把通用错误边界(`ui/ErrorBoundary.tsx`)与场景实例(`scene.ts`)装进同一个
|
|
3
|
+
* 组件——注册表里登记的组件就是这一层。
|
|
4
|
+
*
|
|
5
|
+
* **为什么这一层不在 `ui/`**:边界是能独立用的通用控件,场景是应用知识。`ui/` 作为库不碰应用知识
|
|
6
|
+
* (层序门对「指向 `scene.ts` 的边」豁免,所以这是形态选择、不是机器判据);把「场景随贡献进子树」
|
|
7
|
+
* 放在这里,两边都不越界。
|
|
8
|
+
* 宿主各槽位是互不相邻的 React 树,跨槽位共享靠同一实例(不是树),所以 Provider 只能挂在条目边界上。
|
|
9
|
+
*/
|
|
10
|
+
import type { ComponentType } from 'react';
|
|
11
|
+
import { type ClientScene } from '../scene.js';
|
|
12
|
+
/**
|
|
13
|
+
* 把一条槽位贡献包进边界:`displayName` 带上来源,测试与宿主调试面板都能一眼看出这是被隔离过的那颗。
|
|
14
|
+
* 生产传场景实例;测试/旧调用点省略 ⇒ 组件里的 `useClientScene()` 回退默认场景。
|
|
15
|
+
*/
|
|
16
|
+
export declare function withErrorBoundary<P extends object>(Wrapped: ComponentType<P>, fallback: string, scene?: ClientScene): ComponentType<P>;
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* 可选服务走 `ctx.get`、不进条目 `inject`;服务可能迟到 ⇒ `ctx.inject(['workspaces'], child => …)`
|
|
5
5
|
* 的 scoped 等待;缺席 / 形状不符 / 读面抛错一律安静降级。只在归档集数组内容变化时戳,无关变更不重读。
|
|
6
6
|
*/
|
|
7
|
-
import type { ClientContextLike } from '
|
|
7
|
+
import type { ClientContextLike } from '../core/context.js';
|
|
8
8
|
/** 安装观察,返回 disposer;服务缺席/形状不符安静降级,迟到那支走 scoped 等待(见文件头注)。 */
|
|
9
9
|
export declare function installArchiveHostWatch(client: ClientContextLike): () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 宿主接线模块的入口:槽位条目的包装件(错误边界 + 场景实例,`guard.tsx`)、会话菜单两行的注册
|
|
3
|
+
* (ADR-0059)、宿主归档旁路观察、会话活体窄面。
|
|
4
|
+
*
|
|
5
|
+
* 外部只 import 本文件(注册处只在 `src/client/index.tsx` 调一次);宿主服务的取法与命名空间
|
|
6
|
+
* 是这一层的实现细节。边界由 `tests/dependency-direction.test.ts` 钉住。
|
|
7
|
+
*/
|
|
8
|
+
export { withErrorBoundary } from './guard.js';
|
|
9
|
+
export { installSessionMenus } from './context-menu-actions.js';
|
|
10
|
+
export { installArchiveHostWatch } from './host-archive-watch.js';
|
|
11
|
+
export { NEVER_SESSIONS, useSessionLive, type UseSessions } from './session-live.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 归档详情投影:信息表恰五行(项目 / 日志末条 / 会话 id / 大小 / 状态),无「回收站目录」「原本归档」;
|
|
3
|
+
* 状态行认主体自己的归档态(wire 的 `archived`),不认导航道或旧快照。
|
|
4
|
+
*/
|
|
5
|
+
import type { Translate } from '../core/copy.js';
|
|
6
|
+
import type { ArchiveDetailLike } from '../core/remote.js';
|
|
7
|
+
import { type ArchiveDetailSubject, type DetailJump, type DetailNav, type DetailFrame } from '../detail/index.js';
|
|
8
|
+
export interface ArchiveDetailProps {
|
|
9
|
+
frame: DetailFrame<ArchiveDetailSubject, ArchiveDetailLike>;
|
|
10
|
+
busy: boolean;
|
|
11
|
+
wide: boolean;
|
|
12
|
+
detailNav: DetailNav;
|
|
13
|
+
onRetry: () => void;
|
|
14
|
+
onBack: () => void;
|
|
15
|
+
/** 检索跳转目标(命中块的时间与查询串):给了就对齐到命中块(只对齐、不画落地框)。 */
|
|
16
|
+
jump?: DetailJump | undefined;
|
|
17
|
+
onJumpDone?: (() => void) | undefined;
|
|
18
|
+
/** 详情头的一条明确提示(例:还原孩子视图时那一层已经不在)。 */
|
|
19
|
+
notice?: string | null;
|
|
20
|
+
t: Translate;
|
|
21
|
+
}
|
|
22
|
+
export declare function ArchiveDetail({ frame, busy, wide, detailNav, onRetry, onBack, jump, onJumpDone, notice, t, }: ArchiveDetailProps): import("react").JSX.Element;
|