@takboo/dsh-session-bin 0.1.0 → 0.2.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 +10 -10
- package/dist/client-model.js +61 -2
- package/dist/client.js +223 -137
- package/dist/client.js.map +1 -1
- package/dist/host/native-retirement-metadata.d.ts +7 -0
- package/dist/index.js +92 -5
- package/dist/index.js.map +2 -2
- package/dist/types/client/locales.d.ts +11 -4
- package/dist/types/client/model.d.ts +15 -1
- package/docs/client-interface.md +4 -4
- package/docs/host-lifecycle.md +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { LocaleDictOf } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
2
|
export declare const NS = "dshSessionBin";
|
|
3
3
|
export declare const en: {
|
|
4
|
+
readonly settings: "Settings";
|
|
5
|
+
readonly confirmDeletionSetting: "Confirm before permanently deleting conversations";
|
|
6
|
+
readonly confirmDeletionHint: "Applies to single deletion, selected conversations, and clear all in this browser profile for this Host. When off, clicking Delete starts permanent deletion immediately.";
|
|
7
|
+
readonly batchPreparingTitle: "Checking conversations";
|
|
8
|
+
readonly batchRunningTitle: "Deleting conversations";
|
|
9
|
+
readonly batchExecutionProgress: "Processed {completed} of {total}";
|
|
10
|
+
readonly batchProgressLabel: "Deletion progress";
|
|
4
11
|
readonly title: "Session Bin";
|
|
5
12
|
readonly count: "{count} conversations";
|
|
6
13
|
readonly countOne: "{count} conversation";
|
|
@@ -48,7 +55,7 @@ export declare const en: {
|
|
|
48
55
|
readonly deleteConversation: "Permanently delete {title}";
|
|
49
56
|
readonly deleteTitle: "Permanently delete “{title}”?";
|
|
50
57
|
readonly deleteDescription: "Delete this one conversation’s logs and its session metadata and indexes. This cannot be undone.";
|
|
51
|
-
readonly deleteScope: "Shared attachments, independent forks, and copies in external tools are kept.
|
|
58
|
+
readonly deleteScope: "Shared attachments, independent forks, and copies in external tools are kept.";
|
|
52
59
|
readonly deletionAcknowledge: "I understand that this conversation cannot be restored.";
|
|
53
60
|
readonly cancelDeletion: "Cancel";
|
|
54
61
|
readonly confirmDeletion: "Delete permanently";
|
|
@@ -76,14 +83,14 @@ export declare const en: {
|
|
|
76
83
|
readonly batchSelectionTitle: "Permanently delete {count} selected conversations?";
|
|
77
84
|
readonly batchAllTitle: "Clear all {count} archived conversations?";
|
|
78
85
|
readonly batchPreparingDescription: "Preparing and checking each fixed target. Closing stops targets that have not started preparation.";
|
|
79
|
-
readonly batchConfirmDescription: "
|
|
86
|
+
readonly batchConfirmDescription: "These conversations will be permanently deleted and cannot be restored.";
|
|
80
87
|
readonly batchRunningDescription: "Deletion runs one conversation at a time. Stop prevents unsent conversations; the current operation still finishes and remains protected.";
|
|
81
88
|
readonly closeBatchDeletion: "Close batch deletion";
|
|
82
89
|
readonly confirmBatchDeletion: "Delete executable conversations";
|
|
83
90
|
readonly stopBatchDeletion: "Stop remaining deletions";
|
|
84
91
|
readonly batchSummary: "{total} fixed · {executable} executable · {blocked} blocked";
|
|
85
92
|
readonly batchPreparationProgress: "Checked {prepared} of {total}";
|
|
86
|
-
readonly batchScope: "
|
|
93
|
+
readonly batchScope: "Blocked conversations will be skipped.";
|
|
87
94
|
readonly batchResources: "Combined resource scope";
|
|
88
95
|
readonly resourceErase: "Erase";
|
|
89
96
|
readonly resourceReleaseReference: "Release references";
|
|
@@ -103,7 +110,7 @@ export declare const en: {
|
|
|
103
110
|
readonly batchPausedDescription: "Review or handle the current operation first, then continue the remaining conversations.";
|
|
104
111
|
readonly batchDoneTitle: "Batch deletion complete";
|
|
105
112
|
readonly batchCancelledTitle: "Batch deletion stopped";
|
|
106
|
-
readonly batchOutcome: "{success} deleted · {unresolved}
|
|
113
|
+
readonly batchOutcome: "{success} deleted · {unresolved} not deleted";
|
|
107
114
|
readonly continueBatchDeletion: "Continue remaining";
|
|
108
115
|
readonly dismissBatchDeletion: "Dismiss batch results";
|
|
109
116
|
};
|
|
@@ -25,6 +25,11 @@ export interface PurgeConfirmation {
|
|
|
25
25
|
title: string;
|
|
26
26
|
acknowledged: boolean;
|
|
27
27
|
}
|
|
28
|
+
export interface DeletionPreferences {
|
|
29
|
+
load(): boolean;
|
|
30
|
+
save(confirm: boolean): void;
|
|
31
|
+
subscribe?(listener: (confirm: boolean) => void): () => void;
|
|
32
|
+
}
|
|
28
33
|
export interface BinClientState {
|
|
29
34
|
phase: 'loading' | 'ready' | 'error';
|
|
30
35
|
entries: readonly ArchiveEntry[];
|
|
@@ -39,6 +44,7 @@ export interface BinClientState {
|
|
|
39
44
|
purgeBatch: PurgeBatchState | null;
|
|
40
45
|
purgeBatchOperationIds: readonly string[];
|
|
41
46
|
purgeCacheBlocked: boolean;
|
|
47
|
+
confirmDeletion: boolean;
|
|
42
48
|
}
|
|
43
49
|
export interface PurgeGrantSnapshot {
|
|
44
50
|
operationId: string;
|
|
@@ -64,6 +70,7 @@ export declare class SessionBinClientModel {
|
|
|
64
70
|
private readonly api;
|
|
65
71
|
private readonly createStream;
|
|
66
72
|
private readonly cache?;
|
|
73
|
+
private readonly preferences?;
|
|
67
74
|
private state;
|
|
68
75
|
private snapshot;
|
|
69
76
|
private readonly listeners;
|
|
@@ -85,7 +92,9 @@ export declare class SessionBinClientModel {
|
|
|
85
92
|
private purgeBatch;
|
|
86
93
|
private purgeBatchRun;
|
|
87
94
|
private purgePreparationEpoch;
|
|
88
|
-
|
|
95
|
+
private stopPreferences;
|
|
96
|
+
constructor(api: SessionBinRemoteApi, createStream: () => RemoteStream<BinSnapshot>, cache?: PendingCache | undefined, preferences?: DeletionPreferences | undefined);
|
|
97
|
+
setConfirmDeletion(confirmDeletion: boolean): void;
|
|
89
98
|
getSnapshot: () => BinClientState;
|
|
90
99
|
subscribe: (listener: () => void) => (() => void);
|
|
91
100
|
private publish;
|
|
@@ -105,6 +114,9 @@ export declare class SessionBinClientModel {
|
|
|
105
114
|
private purgeOutcome;
|
|
106
115
|
private publishConfirmation;
|
|
107
116
|
private requestPurgePlan;
|
|
117
|
+
/** Only a fresh user click can opt out of the presentation confirmation. */
|
|
118
|
+
requestPurge(entry: Pick<ArchiveEntry, 'sessionId' | 'entryId'>, title: string): Promise<void>;
|
|
119
|
+
requestPurgeBatch(scope: PurgeBatchScope, titles?: Readonly<Record<string, string>>): Promise<void>;
|
|
108
120
|
preparePurge(entry: Pick<ArchiveEntry, 'sessionId' | 'entryId'>, title: string): Promise<PurgePlan | null>;
|
|
109
121
|
acknowledgePurge(acknowledged: boolean): void;
|
|
110
122
|
cancelPurge(): void;
|
|
@@ -135,3 +147,5 @@ export declare class SessionBinClientModel {
|
|
|
135
147
|
private run;
|
|
136
148
|
}
|
|
137
149
|
export declare function browserPendingCache(storage: Storage): PendingCache;
|
|
150
|
+
/** Browser profile/Host-wide presentation preference; independent of deletion journals. */
|
|
151
|
+
export declare function browserDeletionPreferences(storage: Pick<Storage, 'getItem' | 'setItem'>, events?: Pick<Window, 'addEventListener' | 'removeEventListener'>): DeletionPreferences;
|
package/docs/client-interface.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
Harness 原生 Archive 是唯一归档入口。插件不注册会话菜单中的“移入回收站”,也不提供第二个归档 Undo;归档活动保护、停止确认及撤销由宿主原生交互负责。
|
|
10
10
|
|
|
11
|
-
侧栏入口与根 `main` 槽位共用 `dsh-session-bin.panel` 身份。面板直接展示原生已归档集合,包括插件安装前或由其他原生界面归档的会话。名称来自原生 Session 摘要,工作区按当前 `WorkspaceView.sessionIds` 匹配;不为列表激活或 retain
|
|
11
|
+
侧栏入口与根 `main` 槽位共用 `dsh-session-bin.panel` 身份。面板直接展示原生已归档集合,包括插件安装前或由其他原生界面归档的会话。名称来自原生 Session 摘要,工作区按当前 `WorkspaceView.sessionIds` 匹配;不为列表激活或 retain 冷会话,也不读取日志。默认按工作区分组展示,无法匹配工作区的会话放入未分组。支持名称及工作区元数据搜索、工作区筛选、单项取消归档和固定选择的批量取消归档。
|
|
12
12
|
|
|
13
13
|
选中对象使用 Host 的观察 `entryId`。请求再次核对准备结果中的身份,批量在开始时固定对象集合;后来归档的会话不加入。成功项取消选择,失败项保留并显示逐项原因,已经退出集合的对象退出选择。取消归档始终移除原生归档标记,不沿用旧 Bin 的 `wasArchived`。原生集合没有归档时间;列表不显示旧移入时间、首次观察时间或“原先已归档”标签。观察身份也不是宿主生命周期或原生归档代际,不能保证识别未观察的取消归档再归档。
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ Harness 原生 Archive 是唯一归档入口。插件不注册会话菜单中的
|
|
|
16
16
|
|
|
17
17
|
## 单项永久删除
|
|
18
18
|
|
|
19
|
-
每个归档行提供单项永久删除。客户端先准备并固定同一观察 entryId,准备结果不能静默换成后来对象。原生 Modal 展示不可逆语义、实际 blockers,以及共享附件/独立 fork
|
|
19
|
+
每个归档行提供单项永久删除。客户端先准备并固定同一观察 entryId,准备结果不能静默换成后来对象。原生 Modal 展示不可逆语义、实际 blockers,以及共享附件/独立 fork/外部副本保留范围;初始焦点为取消,点击“确认永久删除”执行同一私有快照计划,无需额外勾选。默认启用删除确认;面板“设置”中的全局开关适用于当前浏览器配置中此 Host 的单项删除、固定选择和清空。偏好以独立版本化 localStorage 保存并同步同源窗口;不可用或无效时默认确认开启。关闭后仅新鲜的删除按钮点击可在准备成功、连接代次未变化且偏好仍关闭时直接执行;切换偏好和重载均不执行删除。宿主资格、blockers、固定身份、资源与 pending 保护不受该偏好影响。missing 项重新准备仍须明确确认。取消、关闭和单独 preparation 不执行删除。仅支持 Host 经过独立版本/资源检查的冷会话组合,加载、活动或未排空引用会明确阻止;固定批量与清空复用相同的单项资格,规则见下一节。
|
|
20
20
|
|
|
21
21
|
严格执行只接受 v2 purge;旧 v1 仅历史查询。删除与取消归档分别保存 journal/pending,永久删除成功只认 owner done 的完整固定请求/资源/nonce 回执。pending-recovery/partial-failure 持续保护对象,客户端可检查或明确继续同一个已保存操作;未曾观察 admission 的 missing 必须重新准备与确认,若旧观察已更换可明确放弃缺失的本地请求再选择新行,不能把旧请求改绑新对象。已观察的授权或无法恢复的观察见证继续保持未知保护,规则见下文连接恢复。
|
|
22
22
|
|
|
@@ -24,13 +24,13 @@ Harness 原生 Archive 是唯一归档入口。插件不注册会话菜单中的
|
|
|
24
24
|
|
|
25
25
|
固定选择使用当前选中的观察 entryId;“清空全部归档(N)”始终从 Model 的完整 `entries` 冻结点击时全部对象,搜索或工作区筛选只改变列表显示,不改变范围和计数。期间新增归档、同 SID 的新观察不加入;旧对象变化由准备/执行复核并逐项阻止。选定编排见 [ADR 0009](decisions/0009-fixed-purge-batches.md)。
|
|
26
26
|
|
|
27
|
-
页面级批次先串行准备每项独立 lifecycle
|
|
27
|
+
页面级批次先串行准备每项独立 lifecycle 与冻结清单,准备及运行期间在面板内显示有界进度与逐项日志,可停止未发送对象。全部准备结束后,默认确认框展示固定总数、可执行数、阻止数、固定目标与逐项原因,并简述不可逆清除和共享副本保留范围;不展开内部资源计数。准备 blocker 不伪造 Host 回执,零可执行项不得开始。原生 Modal 默认聚焦取消,点击确认后才发送私有冻结计划;关闭全局确认时,同一新鲜点击准备成功后可直接开始,零可执行项仍展示阻止原因且不得开始;公开快照或调用方对象的改动不扩展范围。
|
|
28
28
|
|
|
29
29
|
执行串行复用既有单项 Remote/journal,最多一条未终结发送项。success/rejected/conflict 可继续下一项;pending/partial、断线未知或 missing 都立即暂停后续对象。当前项由既有查询、同操作续办或未观察 admission 时的 fresh prepare + 再确认处理;确认当前结果后仍需明确继续剩余项。停止只取消尚未发送项,不 abort 或改绑已发送项;已接受准备也须排空后才可开始新批次。批次内 missing 不提供放弃保护旁路。
|
|
30
30
|
|
|
31
31
|
停止或重载后,已发送项保留批次来源标记,仍禁止放弃保护;未观察 admission、Host journal 确认缺失且观察身份仍匹配时,可独立重新准备并再次确认。取消新确认保留旧 pending;明确执行新确认后才替换旧计划。已停止批次的剩余项保持取消,重载作废的未发送队列不重建。连接失败或执行期间更换 baseline 时,排空当前已发送项并暂停下一项;即使新 baseline 先于当前回复到达,也须明确继续。
|
|
32
32
|
|
|
33
|
-
重载只查询已发送单项,不恢复未发送内存队列,不自动删除。没有额外 Host batch journal 或跨会话事务;每项结果仍由完整 owner done 回执决定。单个批次可含超过 64 个终态目标,但 pending/grant/observation
|
|
33
|
+
重载只查询已发送单项,不恢复未发送内存队列,不自动删除。没有额外 Host batch journal 或跨会话事务;每项结果仍由完整 owner done 回执决定。单个批次可含超过 64 个终态目标,但 pending/grant/observation 原始缓存超过容量时不截断、不迁移、不重写,只核对现有结果并禁止新删除。成功项退出选择;完成或停止后只显示简短统计和失败、阻止、未知项,不保留成功项的日志或资源清单。未知 pending 的检查、同操作续办和明确继续入口保持可用,关闭结果展示不解除 pending 保护。
|
|
34
34
|
|
|
35
35
|
## 严格 Remote 边界
|
|
36
36
|
|
package/docs/host-lifecycle.md
CHANGED
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
|
|
46
46
|
`NativeRetirementOwner` 自行拥有被明确 adoption 的会话记录删除生命周期。当前默认生产资格限已实际验收的 DSH `0.2.0-rc.2`、Node `24.18.1` / libuv `1.52.1`、Windows x64、macOS ARM64/Intel、Linux ARM64/x64、单 Host,以及独立验证通过的 JSONL raw/zstd、已知 Workspace/JSON domain、已启用 SQLite 查询与投影 cache 组合;确认没有相应 optional provider 的最小组合也可使用。未验收的平台/架构(包括 Windows ARM64)不因 Adapter 存在或 Host 配置 true 自动获得生产资格。正在初始化的 provider 会先等待,unknown/disabled/path 或实例漂移不伪称不存在。SDK 所有参与包版本与源码 SHA-256 固定于 `native-retirement-sdk`;变更组合需独立验收。支持的是会话日志和声明的会话元数据/派生索引,共享附件、外部工具副本和独立 fork 保留,不做全局 GC 或安全擦除。
|
|
47
47
|
|
|
48
|
+
显式删除准备先在目标准入围栏内释放 API Session 自己激活的空闲 Agent:仅使用在匹配 `resumeObserved/createOrAdopt` 调用内取得的原始 `AgentHandle.dispose`,复核原生归档、活动提供方、真实 idle phase(不包含 maintenance)和空 inbox;不通过裸 Agent 或未识别的生命周期强行卸载。等待日志句柄关闭、目标已跟踪 history follower 结束和 cache 写入排空后,重新发布持久化冷摘要,取消删除仍保留标题、归档和日志。没有明确 disposal capability 的安装前/其他所有者生命周期继续拒绝。该释放只发生于显式准备及执行复核,不在启动、列举或归档观察时自动发生。
|
|
49
|
+
|
|
48
50
|
准入只接受原生归档的冷目标,拒绝 live Session/Agent、turn/job/subagent/schedule、尚未释放的 SessionHandle、query lease、history follower、cache dirty 和迁移准备。不能识别目标的安装前 follower 保守拒绝;不隐式停止其他会话。实例 guard 保留 Cordis caller shadow context,覆盖原生 Workspace 队列执行与写入前复核、SessionStore 准入、JSONL create/open/低层读写、cache 实际 put、完整 query/SQLite queue。全局 header/historical-corpus 读帧在执行前排空,新普通扫描等待 scope 释放,防止跨 SID 历史读取与删除相互等待;其他 SID 的既有 current writer 不被本次删除停止。
|
|
49
51
|
|
|
50
52
|
`session_bin_jsonl_resources` 保存 durable store/root/fingerprint 和 exact lifecycle nonce、最低既存 canonical anchor、完整文件 identity/digest、metadata medium/memory/location 快照。这个 nonce 是本插件 Adapter 提供的逻辑生命周期,不能描述为原生格式字段。显式准备固定这些证据;已退役 SID namespace 不重用,历史请求只处理原 token。`session_bin_jsonl_retirement_owner` 保存协调器 journal,恢复不从当前 SID 重建新目标。
|