dsh-session-ops 0.1.4 → 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.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 本包内部的小工具:只放「宿主边界上重复出现、但语义必须逐字一致」的那几行。
3
+ *
4
+ * 目前只有一处:把 `unknown` 类型抛出的错误取成可读文案。JS 里的写法是
5
+ * `String(error?.message ?? error)`——它同时容忍 Error、任意带 `message` 的对象、
6
+ * 以及 `throw 'oops'` 这样的原始值。TS 的 `catch` 变量是 `unknown`,这份语义必须
7
+ * 原样保留(错误文案会被用户可见的报告与日志引用),所以收成一个函数。
8
+ *
9
+ * @module dsh-session-ops/store/util
10
+ */
11
+ /**
12
+ * 取一个 unknown 错误的可读文案,语义与 `String(error?.message ?? error)` 逐字一致。
13
+ * @param error - catch 到的错误。
14
+ * @returns 可读文案。
15
+ */
16
+ export declare function messageOf(error: unknown): string;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "dsh-session-ops",
3
- "version": "0.1.4",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "description": "Session operations for DeepSeek Harness: really delete persisted sessions (workspace/archive/subagent filters, running-session guards) and move sessions between workspaces (log relocation, header.cwd rewrite, workspace registry follow). Ships the shared session-store primitives (project-directory keys, jsonl.zstd frames, workspace registry, host/HTTP plumbing) as lib/store. One host entry with two HTTP prefixes and two model tools, one browser bundle with two right-pane tabs and a merged config card.",
8
+ "description": "Session operations for DeepSeek Harness: really delete persisted sessions (ungrouped/temp/archive/subagent filters, running-session guards) and move sessions between workspaces (log relocation, header.cwd rewrite, workspace registry follow). Ships the shared session-store primitives (project-directory keys, jsonl.zstd frames, workspace registry, host/HTTP plumbing) as lib/store. One host entry with two HTTP prefixes and two model tools, one browser bundle with two right-pane tabs and a merged config card.",
9
9
  "keywords": [
10
10
  "dsh",
11
11
  "dsh-plugin",
@@ -21,14 +21,17 @@
21
21
  "author": "Cooper Zhuang",
22
22
  "type": "module",
23
23
  "main": "lib/index.js",
24
+ "types": "lib/types/index.d.ts",
24
25
  "exports": {
25
26
  ".": {
27
+ "types": "./lib/types/index.d.ts",
26
28
  "default": "./lib/index.js"
27
29
  },
28
30
  "./client": {
29
31
  "default": "./lib/client.js"
30
32
  },
31
33
  "./store": {
34
+ "types": "./lib/types/store/index.d.ts",
32
35
  "default": "./lib/store/index.js"
33
36
  },
34
37
  "./package.json": "./package.json"
@@ -44,7 +47,10 @@
44
47
  "docs"
45
48
  ],
46
49
  "scripts": {
47
- "test": "node --test"
50
+ "build": "tsc -p tsconfig.json && tsc -p tsconfig.client.json && node scripts/build-client.mts",
51
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
52
+ "test": "npm run build && node --test test/*.test.ts test/store/*.test.ts",
53
+ "prepare": "npm run build"
48
54
  },
49
55
  "engines": {
50
56
  "node": ">=24",
@@ -77,5 +83,9 @@
77
83
  ],
78
84
  "platform": "web"
79
85
  }
86
+ },
87
+ "devDependencies": {
88
+ "@types/node": "^26.6.5",
89
+ "typescript": "^7.0.2"
80
90
  }
81
91
  }