@xrn1997/dsh-session-delete 0.1.1 → 0.2.1
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 +124 -55
- package/lib/client.js +1429 -427
- package/lib/index.js +830 -183
- package/lib/types/api/dispatch.d.ts +55 -0
- package/lib/types/client/batch-bar.d.ts +24 -0
- package/lib/types/client/batch-confirm.d.ts +31 -0
- package/lib/types/client/batch-menu-item.d.ts +19 -0
- package/lib/types/client/batch-select.d.ts +97 -0
- package/lib/types/client/context.d.ts +31 -0
- package/lib/types/client/copy.d.ts +168 -0
- package/lib/types/client/delete-confirm.d.ts +40 -0
- package/lib/types/client/delete-menu-item.d.ts +20 -0
- package/lib/types/client/index.d.ts +19 -0
- package/lib/types/client/markdown.d.ts +11 -0
- package/lib/types/client/remote.d.ts +181 -0
- package/lib/types/client/trash-detail.d.ts +27 -0
- package/lib/types/client/trash-entry.d.ts +6 -0
- package/lib/types/client/trash-panel.d.ts +10 -0
- package/lib/types/client/trash-store.d.ts +4 -0
- package/lib/types/client/ui/Button.d.ts +21 -0
- package/lib/types/client/ui/Checkbox.d.ts +29 -0
- package/lib/types/client/ui/MenuItemButton.d.ts +32 -0
- package/lib/types/client/ui/Modal.d.ts +35 -0
- package/lib/types/client/ui/Tag.d.ts +16 -0
- package/lib/types/client/ui/Toast.d.ts +36 -0
- package/lib/types/client/ui/Tooltip.d.ts +37 -0
- package/lib/types/client/ui/format.d.ts +18 -0
- package/lib/types/client/ui/icons.d.ts +33 -0
- package/lib/types/client/ui/recipe.d.ts +11 -0
- package/lib/types/client/ui/styles.d.ts +2 -0
- package/lib/types/client/undo-toast.d.ts +49 -0
- package/lib/types/client/use-column-resize.d.ts +62 -0
- package/lib/types/client/use-panel-width.d.ts +15 -0
- package/lib/{index.d.ts → types/index.d.ts} +9 -36
- package/lib/types/log/session-log.d.ts +40 -0
- package/lib/types/log/zstd-frames.d.ts +30 -0
- package/lib/types/ports/fs-port.d.ts +16 -0
- package/lib/types/ports/host-port.d.ts +97 -0
- package/lib/types/remote/map-error.d.ts +19 -0
- package/lib/types/shared/wire.d.ts +134 -0
- package/lib/types/trash/detail.d.ts +40 -0
- package/lib/types/trash/entry.d.ts +35 -0
- package/lib/types/trash/manifest.d.ts +18 -0
- package/lib/types/trash/reconcile.d.ts +35 -0
- package/lib/types/verbs/apply.d.ts +3 -0
- package/lib/types/verbs/delete-session.d.ts +30 -0
- package/lib/types/verbs/errors.d.ts +20 -0
- package/lib/types/verbs/purge-trash.d.ts +6 -0
- package/lib/types/verbs/restore-session.d.ts +37 -0
- package/package.json +105 -95
- package/lib/client.js.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type TrashEntry } from '../trash/entry.js';
|
|
2
|
+
import { type HostPort } from '../ports/host-port.js';
|
|
3
|
+
import type { DeleteDeps } from './delete-session.js';
|
|
4
|
+
/**
|
|
5
|
+
* 恢复 = 把删除那次**按原路退回**,而且按组走:当年是按组一起搬进来的(父 + 它在盘上的孩子),
|
|
6
|
+
* 只回父就会在回收站里留下一堆点不到的孩子行——清单只列父行,那些行既看不见也清不掉。
|
|
7
|
+
*
|
|
8
|
+
* 三段与删除对称:
|
|
9
|
+
* ① **预检整组**(一个字节都不写):每个成员的回收站目录与项目目录都得在。缺席的判据与原来一致
|
|
10
|
+
* (回收站目录不在 = `trash-empty`;原项目目录不在 = `project-missing`,且绝不静默建目录)。
|
|
11
|
+
* 预检在写之前,是为了不让"父已经回到 `sessions/`、孩子因为项目目录没了而回不去"这种半组留在外面。
|
|
12
|
+
* **工作区账本不在这条硬前提里**:宿主的「删除工作区」只删注册、保留日志,记下的工作区没了就按
|
|
13
|
+
* 「未分组」收(判据在 {@link attachableWorkspaceId}),照旧回盘——恢复是加法,不该因为一个可选的账目而失败。
|
|
14
|
+
* ② **逐个恢复**,顺序与删除相反:文件先回来 → 挂账本 → 还原可见性 → 摘清册行 → 通告回来。
|
|
15
|
+
* ③ 中途失败把这个成员自己退回回收站(就地回滚),并把**已经恢复完的**兄弟按相反顺序一起退回,失败照抛。
|
|
16
|
+
*/
|
|
17
|
+
export declare function restoreSession(deps: DeleteDeps): (entryId: string, options?: {
|
|
18
|
+
readonly snapshot?: TrashEntry[];
|
|
19
|
+
/** 批量(`verbs/apply.ts`)**自己收尾一次发**时传 `suppressAnnounce`:动词不再逐条通告——
|
|
20
|
+
* 单条一份摘要 = 一条一次宿主全表扫,那是 2026-10-17 "恢复很慢"的头号来源。 */
|
|
21
|
+
readonly suppressAnnounce?: boolean;
|
|
22
|
+
}) => Promise<TrashEntry>;
|
|
23
|
+
/**
|
|
24
|
+
* 这一次恢复**到底挂不挂账本**:交出能挂的那个 `workspaceId`,挂不了就 `undefined`。
|
|
25
|
+
*
|
|
26
|
+
* 两种缺席是同一件事:空串 = 删除时它就没有账目(「未分组」的会话);非空但账本里已经没它 =
|
|
27
|
+
* 宿主的「删除工作区」只删注册、保留目录与每一份日志,那些会话之后本来就在「未分组」下。
|
|
28
|
+
* 恢复不该为了挂一个不存在的账本把整条退回回收站。
|
|
29
|
+
*
|
|
30
|
+
* 判据**只有这一处**:`restoreOne` 拿它决定挂不挂,`GET /list` 拿它决定行上那句「原工作区已不存在,
|
|
31
|
+
* 恢复后归入未分组」说不说。两边各问一遍就会有一天一个说、一个不挂。
|
|
32
|
+
*/
|
|
33
|
+
export declare function attachableWorkspaceId(host: Pick<HostPort, 'workspaceExists'>, entry: TrashEntry): Promise<string | undefined>;
|
|
34
|
+
/** 这一条记着的工作区**是不是已经没了**(区别于"删除时它就没有账目"的空串)——清单行据此决定
|
|
35
|
+
* 要不要在点之前说那句「原工作区已不存在,恢复后归入未分组」。由 {@link attachableWorkspaceId}
|
|
36
|
+
* 派生,不另起一份判据:那样会有一天一个说、一个不挂。 */
|
|
37
|
+
export declare function isWorkspaceMissing(host: Pick<HostPort, 'workspaceExists'>, entry: TrashEntry): Promise<boolean>;
|
package/package.json
CHANGED
|
@@ -1,95 +1,105 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xrn1997/dsh-session-delete",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "在 DeepSeek Harness 里删除会话:删除=移入回收站(可恢复),另设显式彻底删除",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"types": "lib/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./lib/index.d.ts",
|
|
11
|
-
"default": "./lib/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./client":
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
},
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"react
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
"session"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@xrn1997/dsh-session-delete",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "在 DeepSeek Harness 里删除会话:删除=移入回收站(可恢复),另设显式彻底删除",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./client": {
|
|
14
|
+
"types": "./lib/types/client/index.d.ts",
|
|
15
|
+
"default": "./lib/client.js"
|
|
16
|
+
},
|
|
17
|
+
"./locale/*.json": "./locale/*.json",
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"icon": "./icon.svg",
|
|
21
|
+
"files": [
|
|
22
|
+
"lib/index.js",
|
|
23
|
+
"lib/client.js",
|
|
24
|
+
"lib/types/**/*.d.ts",
|
|
25
|
+
"locale",
|
|
26
|
+
"icon.svg",
|
|
27
|
+
"cordis.patch.yml",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=24",
|
|
33
|
+
"dsh": ">=0.1.7-rc.2 <0.3.0-0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsdown && tsc -p tsconfig.build.json",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"prepack": "npm run build"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
43
|
+
"react": "^18.3.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
47
|
+
"@testing-library/dom": "^10.4.2",
|
|
48
|
+
"@testing-library/jest-dom": "^6.10.0",
|
|
49
|
+
"@testing-library/react": "^16.3.3",
|
|
50
|
+
"@types/node": "24.19.0",
|
|
51
|
+
"@types/react": "18.3.31",
|
|
52
|
+
"@types/react-dom": "18.3.5",
|
|
53
|
+
"@types/semver": "^7.8.0",
|
|
54
|
+
"jsdom": "^26.1.0",
|
|
55
|
+
"react": "^18.3.1",
|
|
56
|
+
"react-dom": "18.3.1",
|
|
57
|
+
"semver": "^7.8.5",
|
|
58
|
+
"tsdown": "0.23.0",
|
|
59
|
+
"typescript": "5.9.3",
|
|
60
|
+
"vitest": "3.2.7"
|
|
61
|
+
},
|
|
62
|
+
"dsh": {
|
|
63
|
+
"bundle": {
|
|
64
|
+
"patch": "./cordis.patch.yml"
|
|
65
|
+
},
|
|
66
|
+
"client": {
|
|
67
|
+
"inject": [
|
|
68
|
+
"@deepseek-ai/dsh-client-locale"
|
|
69
|
+
],
|
|
70
|
+
"platform": "web"
|
|
71
|
+
},
|
|
72
|
+
"compatibility": {
|
|
73
|
+
"dshReleases": {
|
|
74
|
+
"0.2.0-rc.2": "compatible",
|
|
75
|
+
"0.2.1-rc.1": "compatible",
|
|
76
|
+
"0.2.1-rc.2": "compatible"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"publishConfig": {
|
|
81
|
+
"access": "public"
|
|
82
|
+
},
|
|
83
|
+
"repository": {
|
|
84
|
+
"type": "git",
|
|
85
|
+
"url": "git+https://github.com/xrn1997/dsh-session-delete.git"
|
|
86
|
+
},
|
|
87
|
+
"homepage": "https://github.com/xrn1997/dsh-session-delete#readme",
|
|
88
|
+
"bugs": {
|
|
89
|
+
"url": "https://github.com/xrn1997/dsh-session-delete/issues"
|
|
90
|
+
},
|
|
91
|
+
"keywords": [
|
|
92
|
+
"dsh",
|
|
93
|
+
"deepseek-harness",
|
|
94
|
+
"plugin",
|
|
95
|
+
"session",
|
|
96
|
+
"trash",
|
|
97
|
+
"delete"
|
|
98
|
+
],
|
|
99
|
+
"author": "xrn1997",
|
|
100
|
+
"license": "Apache-2.0",
|
|
101
|
+
"dependencies": {
|
|
102
|
+
"react-markdown": "^10.1.0",
|
|
103
|
+
"remark-gfm": "^4.0.1"
|
|
104
|
+
}
|
|
105
|
+
}
|