what-was-that 0.1.9 → 0.1.10

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 CHANGED
@@ -3,6 +3,8 @@
3
3
  <p>
4
4
  <a href="https://github.com/topics/dsh-plugin"><code>dsh-plugin</code></a>
5
5
  <a href="https://github.com/SH-9999/what-was-that"><code>DeepSeek Harness 插件</code></a>
6
+ <a href="https://www.npmjs.com/package/what-was-that"><code>npm: v0.1.10</code></a>
7
+ <a href="https://github.com/SH-9999/what-was-that/actions"><code>CI: typecheck · test · build</code></a>
6
8
  <a href="https://github.com/SH-9999/what-was-that/blob/main/LICENSE"><code>MIT License</code></a>
7
9
  <a href="https://github.com/SH-9999/what-was-that"><code>静态插件</code></a>
8
10
  </p>
@@ -13,15 +15,24 @@
13
15
 
14
16
  ---
15
17
 
16
- ## 🆕 本仓库:静态插件(第二阶段)
18
+ ## 📦 本仓库:已发布到 npm 的静态插件
17
19
 
18
- 这是**第一阶段的正式移植**:把原型用的临时动态插件(粘贴 JS),重写成了规范的 **TypeScript 静态插件包**。
20
+ 从最初的动态插件原型(粘贴 JS),重写为规范的 **TypeScript 静态插件包**,现已发布到 npm(`what-was-that@0.1.10`)。
19
21
 
20
- ### 相对第一阶段(原型)的改进
22
+ ### ✅ 适配 DSH 0.1.5-alpha.1(v0.1.10)
23
+
24
+ v0.1.10 已验证兼容 **DeepSeek Harness 0.1.5-alpha.1**,主要变更:
25
+
26
+ - **修复 host 端 `fs` 服务注入**:0.1.5 中 `fs` 是独立的 cordis 服务,`ctx.get('fs')` 在插件 apply 阶段只有在 `inject` 中显式声明才能拿到。v0.1.10 将 host 入口 `inject` 从 `['typert']` 改为 `['typert', 'fs']`,**修复了启动时的 `wwt: no fs service` 警告**,本地词库(lexicon.json)与宠物 SVG 现在都能在启动阶段正常加载(此前只有运行时 remote 调用才能拿到 fs)。
27
+ - **client 端依赖对齐**:移除 `dsh.client.inject` 与 `peerDependencies` 中 0.1.5 已不存在的 `@deepseek-ai/dsh-client-runtime` 包(0.1.5 的 client 运行时已并入 `dsh-client-modules` 模块系统)。client 端使用的 `slots` / `remote` / `connection` 三个服务在 0.1.5 中分别由 `dsh-client-ui-renderer`(slots 已打包进平台 seed)、`dsh-api-gateway`、`dsh-client-connection` 提供,无需改动。
28
+ - 兼容性结论:**槽位 API 与 0.1.5 官方文档逐字一致**(`slots.inject` + `slots.register(spec, renderFn)`),`shell.overlay` / `conversation.chat.assistant-actions` / `settings.section` 三个挂载点在新版中全部保留。
29
+
30
+ ### 相对原型阶段的改进
21
31
  - ✅ **TypeScript 源码**(`src/`),不再是一大段粘贴的字符串
22
32
  - ✅ **可移植**:资源(词库 / 宠物 SVG)随包内置,通过 `import.meta.url` 相对解析,**不再依赖写死的绝对路径**
23
- - ✅ **一键安装**:构建产物 `lib/` 提交,用户无需编译直接安装
24
- - ✅ **不污染环境**:只依赖 DSH 运行时提供的接口,无全局安装
33
+ - ✅ **一键安装**:已发布到 npm,`dsh plugin --profile web add what-was-that` 一条命令即可(`lib/` 产物随包发布,无需编译)
34
+ - ✅ **不污染环境**:只依赖 DSH 运行时提供的接口,无全局依赖
35
+ - ✅ **自动回归**:GitHub Actions CI 在每次 push/PR 自动跑 typecheck + 测试 + 构建
25
36
 
26
37
  ### 目录结构
27
38
  ```
@@ -36,12 +47,25 @@ what-was-that/
36
47
  ├── lib/ # 构建产物(提交,免编译安装)
37
48
  ├── dsh.plugin.json # 插件声明
38
49
  ├── cordis.patch.yml # 挂载点
50
+ ├── .github/workflows/ci.yml # CI:typecheck + 测试 + 构建
39
51
  ├── build.mjs # esbuild 构建脚本
40
52
  └── package.json
41
53
  ```
42
54
 
43
55
  ### 安装(给 DSH 用户)
44
- 在 DSH 的插件配置里挂载 `cordis.patch.yml` 声明的 `what-was-that` 插件即可(`lib/` 已含全部产物,无需构建)。
56
+
57
+ 已发布到 npm:`what-was-that@0.1.10`(压缩包仅 **212 KB**,轻量无负担)。在 DSH 的 profile 里一条命令装入并启用:
58
+
59
+ ```bash
60
+ # 要求:机器上已安装 pnpm(dsh plugin 命令依赖它)
61
+ dsh plugin --profile web add what-was-that
62
+ ```
63
+
64
+ 装完**重启 `dsh web`** 并硬刷新(Ctrl+Shift+R),右下角出现小章鱼即成功。
65
+
66
+ > 适用版本:**DSH ≥ 0.1.5-alpha.1**(v0.1.10 起,inject 声明了 `fs` 服务,与 0.1.5 的新服务模型对齐)。
67
+
68
+ > 没有 pnpm 时,也可以把 `lib/` 产物放进 profile 手动挂载(`cordis.patch.yml` 声明了挂载点),无需编译。
45
69
 
46
70
  ### 本地构建(给开发者)
47
71
  ```bash
@@ -72,6 +96,7 @@ node build.mjs # 打包 lib/index.js + lib/client.js,并复制 assets
72
96
  - 🔒 **隐私红线**:不把完整回复发回模型;AI 深挖只发点中的词 ±80 字,带缓存
73
97
 
74
98
  ### 轻量优先
99
+ - 📦 **npm 包很小**——压缩包仅 **212 KB**(解压 1.3 MB,含词库 255 条 + 四态形象 + 全部构建产物),比一张照片还小
75
100
  - 🪶 **零运行时依赖**——只用 DSH 自带接口
76
101
  - 🧾 **极小透明 SVG**(每张 15–20 KB)
77
102
  - ⚡ **启动快、占用小**
package/dsh.plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "what-was-that",
3
3
  "description": "Tiny octopus pet that explains AI jargon in plain language",
4
- "version": "0.1.9",
4
+ "version": "0.1.10",
5
5
  "entry": {
6
6
  "name": "what-was-that",
7
7
  "inject": []
package/lib/index.js CHANGED
@@ -14823,7 +14823,7 @@ var LIMIT_TEXT = "\u5C0F\u7AE0\u9C7C\u662F\u6709\u5E95\u7EBF\u7684\uFF0C\u65E0\u
14823
14823
  var SHORT_SYSTEM = '\u4F60\u662F"\u90A3\u662F\u5565"\uFF08What Was That\uFF09\u5C0F\u52A9\u624B\uFF0C\u5E2E\u5B8C\u5168\u4E0D\u61C2\u6280\u672F\u7684\u7528\u6237\u770B\u61C2 AI \u52A9\u624B\u56DE\u7B54\u91CC\u7684\u672F\u8BED\u548C\u9ED1\u8BDD\u3002\u89C4\u5219\uFF1A\u76F4\u63A5\u7ED9\u51FA\u89E3\u91CA\uFF0C\u7981\u6B62\u590D\u8FF0\u6216\u91CD\u8FF0\u672C\u6307\u4EE4\uFF0C\u7981\u6B62\u590D\u8FF0\u7528\u6237\u7684\u95EE\u9898\uFF0C\u4E0D\u8981\u4EFB\u4F55\u601D\u8003\u8FC7\u7A0B\uFF1B\u7528\u751F\u6D3B\u6BD4\u55BB\uFF0C\u50CF\u8DDF\u670B\u53CB\u804A\u5929\uFF1B90 \u4E2A\u6C49\u5B57\u4EE5\u5185\uFF1B\u8F7B\u677E\u5E7D\u9ED8\u4E0D\u6CB9\u6ED1\uFF1B\u4E0D\u7528 markdown\u3001\u4E0D\u5217\u70B9\uFF0C\u76F4\u63A5\u4E00\u6BB5\u8BDD\u3002';
14824
14824
  var LONG_SYSTEM = '\u4F60\u662F"\u90A3\u662F\u5565"\uFF08What Was That\uFF09\u5C0F\u52A9\u624B\uFF0C\u7ED9\u6280\u672F\u5C0F\u767D\u8BB2\u6E05\u695A\u4E00\u4E2A\u672F\u8BED\u3002\u8BF7\u7ED9\u51FA\u4E00\u4E2A\u5B8C\u6574\u3001\u6B63\u5F0F\u3001\u6761\u7406\u6E05\u695A\u7684\u89E3\u91CA\uFF1A\u7B2C\u4E00\u53E5\u7528\u4E00\u53E5\u8BDD\u5B9A\u4E49\u5B83\u662F\u4EC0\u4E48\uFF1B\u63A5\u7740\u7528 1-2 \u4E2A\u751F\u6D3B\u6BD4\u55BB\u5E2E\u52A9\u7406\u89E3\uFF1B\u6700\u540E\u7ED9\u4E00\u6761\u5B9E\u7528\u5EFA\u8BAE\u6216\u63D0\u9192\u3002\u5168\u6587\u7EA6 200 \u4E2A\u6C49\u5B57\uFF0C\u5141\u8BB8\u7528\u7B80\u77ED\u5206\u6BB5\uFF0C\u4F46\u4E0D\u8981\u7528 markdown \u7B26\u53F7\u3001\u4E0D\u8981\u7F16\u53F7\u5217\u8868\u3002';
14825
14825
  var name = "what-was-that";
14826
- var inject = ["typert"];
14826
+ var inject = ["typert", "fs"];
14827
14827
  function assetsDir() {
14828
14828
  const here = fileURLToPath(import.meta.url);
14829
14829
  return here.replace(/[\\/]lib[\\/][^\\/]+\.js$/, "") + "/assets";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "what-was-that",
3
3
  "description": "A tiny octopus desktop pet that explains AI-jargon in plain language for the DeepSeek Harness web GUI.",
4
- "version": "0.1.9",
4
+ "version": "0.1.10",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/SH-9999/what-was-that",
7
7
  "repository": {
@@ -40,7 +40,6 @@
40
40
  "client": {
41
41
  "platform": "web",
42
42
  "inject": [
43
- "@deepseek-ai/dsh-client-runtime",
44
43
  "@deepseek-ai/dsh-client-ui-slots",
45
44
  "@deepseek-ai/dsh-client-locale"
46
45
  ]
@@ -63,7 +62,6 @@
63
62
  "@deepseek-ai/dsh-agent": "*",
64
63
  "@deepseek-ai/dsh-typert-protocol": "*",
65
64
  "@deepseek-ai/dsh-typert-registry": "*",
66
- "@deepseek-ai/dsh-client-runtime": "*",
67
65
  "@deepseek-ai/dsh-client-ui-slots": "*",
68
66
  "@deepseek-ai/dsh-client-locale": "*",
69
67
  "react": "^18.2.0"
@@ -73,7 +71,6 @@
73
71
  "@deepseek-ai/dsh-agent": { "optional": true },
74
72
  "@deepseek-ai/dsh-typert-protocol": { "optional": true },
75
73
  "@deepseek-ai/dsh-typert-registry": { "optional": true },
76
- "@deepseek-ai/dsh-client-runtime": { "optional": true },
77
74
  "@deepseek-ai/dsh-client-ui-slots": { "optional": true },
78
75
  "@deepseek-ai/dsh-client-locale": { "optional": true },
79
76
  "react": { "optional": true }