dsh-nook 0.3.0 → 0.3.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.
Files changed (2) hide show
  1. package/README.md +40 -62
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,89 +1,67 @@
1
- # Nook / 角落小窝
1
+ # Nook · 角落小窝
2
2
 
3
- 把 [Fable-Kawaii-3D-ThreeJS](https://huggingface.co/datasets/liumindmind/Fable-Kawaii-3D-ThreeJS) 里的一张治愈系 3D 微缩沙盘放在对话面板右下角、正文右侧的空白里。它不占正文的布局空间、不接收点击;四周用面板自己的底色(`--dsw-alias-bg-base`)做径向渐变,所以白色主题下就是一整片从白底里浮现的风景,没有一圈看得见的窗口边框。每个场景是一个自带 three.js 的 WebGL 页面,在 iframe 里持续渲染。
3
+ [![npm](https://img.shields.io/npm/v/dsh-nook?color=8fbf9f)](https://www.npmjs.com/package/dsh-nook)
4
4
 
5
- One kawaii 3D diorama from the same dataset sits in the conversation panel's bottom-right, in the empty band right of the transcript. It takes no layout space and no pointer events; its rim melts into the panel's own fill (`--dsw-alias-bg-base`) through a radial gradient, so in the light theme the scene surfaces out of the same white with no visible window border. Every scene is a self-contained three.js page running in an iframe.
5
+ **在对话的角落,安放一处安静的微缩风景。**
6
+ *A quiet little world in the corner of your conversation.*
6
7
 
7
- ## 用法 / Usage
8
+ ![Nook 场景示例:灯会列车环岛](https://raw.githubusercontent.com/FreemanHsu/dsh-nook/main/assets/hero.jpg)
8
9
 
9
- 场景按钮在输入框工具行里、模型选择器左边。悬停显示当前场景名,点开是:
10
+ Nook 把一张治愈系 3D 微缩沙盘放在 DeepSeek Harness 对话面板的右下角。它不占正文的布局空间,四周用面板自己的底色做渐变,像一小块风景从白底里悄悄浮现。想细看就点一下——它 zoom out 铺满对话区;光标回到输入框,它自己缩回角落。
10
11
 
11
- The diorama button sits in the composer tool row, just left of the model selector. Its tooltip shows the current scene; it opens:
12
+ - **安静**:场景永远在文字下面,点一下才铺满,聚焦输入框就自动收回。
13
+ - **可换**:32 个场景(自然 / 水畔 / 城镇 / 旅途 / 集市 / 庭院 / 夜空 / 室内各 4 个),随机或指定,选择会记住。
14
+ - **可调**:画面浓度 35%–100%,淡到只剩一层颜色也行。
15
+ - **离线**:场景与 three.js 全部随包分发,运行时不联网。
12
16
 
13
- - **点一下沙盘**:放大铺满对话区(正文让位给它),右上方出现「收回」按钮;点它或按 `Esc` 缩回右下角。**只要把光标点进输入框(聚焦对话框),沙盘就自动收回**——回去接着对话时少一步操作。放大态下正文暂时被盖住,输入框仍然可用。
14
- - **开关**:菜单第一项控制这块场景是否显示。
15
- - **换一个场景**:随机换一个(会跳过当前这个),菜单随即收起,好让你看到新场景。
16
- - **场景列表**:32 个场景按题材分组,点选后固定使用这个场景(刷新也保持),选中后菜单收起。
17
- - **画面浓度**:`−` / `+` 调节浓淡(35%–100%),越淡越像背景里晕开的一层颜色。
17
+ ## 安装
18
18
 
19
- - **Click the diorama** to fill the conversation with it. A collapse control sits in the top-right corner, and `Esc` works too; **focusing the composer collapses it automatically**, because focusing the input means the conversation is about to continue.
20
- - **Switch** turns the corner diorama on or off.
21
- - **Another scene** shuffles to a different diorama and closes the menu so the result is visible.
22
- - **Scene list** is grouped by theme; picking one pins it across reloads and closes the menu.
23
- - **Presence** (`−` / `+`) fades the diorama (35%–100%); fainter reads as a tint in the corner.
19
+ ```bash
20
+ dsh plugin --profile web add dsh-nook
21
+ ```
24
22
 
25
- 选择保存在当前浏览器的 `localStorage`(键 `dsh.nook.v1`,会从旧的 `dsh.fable-scene-bg.v2` 迁移一次)。关掉插件后,面板立即恢复成原来的样子。
23
+ 或在 **插件 → 添加插件** 里输入 `dsh-nook`。入口在输入框工具行、模型选择器左侧。
26
24
 
27
- The choice is stored in this browser under `dsh.nook.v1` (migrated once from `dsh.fable-scene-bg.v2`). Turning the bundle off restores the plain panel immediately.
25
+ ## 场景
28
26
 
29
- ## 配置 / Configuration
27
+ ![三个场景示例:月球标本盒、暮色吊桥、竹篱小院](https://raw.githubusercontent.com/FreemanHsu/dsh-nook/main/assets/gallery.jpg)
30
28
 
31
- `cordis.patch.yml` 里 `nook` 这一行的 `config`(Host 半在激活时读取一次,改动后需要重新激活):
29
+ 菜单里按题材分组,点一下就固定下来,刷新也还在。
32
30
 
33
- | key | 默认 | 说明 |
34
- | --- | --- | --- |
35
- | `enabled` | `true` | 默认是否显示场景 |
36
- | `scene` | `random` | `random` 或 `scenes/catalog.json` 里的某个场景 id |
37
- | `opacity` | `1` | 场景浓度,0.35–1 |
38
- | `rotateSeconds` | `0` | 每隔 N 秒随机换一个场景,0 为关闭;固定了某个场景时不轮换 |
31
+ ## 配置
39
32
 
40
- 浏览器里用选择器做过的选择优先生效;配置只影响没有本地选择时的默认值。
33
+ `cordis.patch.yml` 里 `nook` 这一行的 `config`,改完重新激活插件生效:
41
34
 
42
- ## 尺寸 / Geometry
43
-
44
- 场景窗宽度跟着正文两侧的留白走:
45
-
46
- ```css
47
- width: clamp(180px, calc((100% - var(--dsh-chat-content-width, 920px)) / 2 - 24px), 560px);
48
- aspect-ratio: 5 / 4;
49
- right: 10px; bottom: 108px;
50
- ```
51
-
52
- `--dsh-chat-content-width` 是对话面板实时公布的正文栏宽,所以拖动会话宽度时场景窗会跟着变;窗口够宽时它基本填满右侧留白,太窄没有留白时退回 180px 的最小尺寸。底部 108px 让出约一行输入框的高度。
53
-
54
- ## 场景 / Scenes
35
+ | key | 默认 | 说明 |
36
+ | --- | --- | --- |
37
+ | `enabled` | `true` | 默认是否显示 |
38
+ | `scene` | `random` | `random` 或 `scenes/catalog.json` 里的场景 id |
39
+ | `opacity` | `1` | 画面浓度,0.35–1 |
40
+ | `rotateSeconds` | `0` | 每隔 N 秒随机换一个,0 为关闭 |
55
41
 
56
- 32 个场景,八个题材各四个(自然地貌、水畔温泉、城镇广场、旅途交通、集市小店、庭院花园、夜空深海、室内工坊),清单和标题见 `scenes/catalog.json`。
42
+ 在界面里做过的选择优先于配置,存在浏览器本地。
57
43
 
58
- ## 已知限制 / Limitations
44
+ ## 致谢 / Thanks
59
45
 
60
- - 每个场景是独立的 WebGL 页面,首次切换要等它渲染出来(约几百毫秒),切换时淡入。切换时会显式释放上一个场景的 WebGL 上下文(浏览器同时只允许十几个),所以连续翻场景不会把上下文用光。
61
- - L3_1356 / L3_1966 / L3_2869 三个场景原本把 three.js 塞进一个 blob 模块再 `import()`;blob 模块没有基准 URL,所以本地化的相对路径解析不了,构建脚本已改成直接从页面 `import('./three.module.min.js')`。
62
- - 某个场景如果自己起不来(场景页在画面里显示它的报错),沙盘右下角会出现「重新加载场景」按钮;菜单里也有同一项,重新点一次列表里当前这个场景同样会重新加载。
63
- - 场景画在正文下面(`z-index` 更低),文字和控件始终在场景之上;窄窗口下羽化区和正文右缘会略微重叠。
64
- - 输入框展开成多行时会盖住场景已经淡化的下缘;放大态下场景在输入框之上,草稿超过约一行时输入框顶部会被淡化后的场景压住一点。
65
- - 没有会话的冷启动首页不渲染输入框工具行,因此那里也不显示场景(装饰必须留一个关闭入口)。
66
- - 对话面板有多处(例如右侧栏的对话),它们共用同一份设置,各自一份 iframe。
67
- - 场景页面与主页面同源(同源才能加载 ES module);页面都是本地内置、构建时抓取并检查过没有外部请求的静态 HTML。
68
- - 图形完全本地内置(`scenes/`),运行时不联网;`scripts/build-scenes.mjs` 可以重新抓取并生成同一批场景。
69
- - 系统开启「减少动态效果」时,场景渲染约 1.6 秒后定格,画面保留但停止运动。
46
+ - 场景素材全部来自 **[Fable-Kawaii-3D-ThreeJS](https://huggingface.co/datasets/liumindmind/Fable-Kawaii-3D-ThreeJS)**(作者 [liumindmind](https://huggingface.co/liumindmind),MIT 许可)。谢谢作者把这些安静又可爱的微缩世界开源出来——这个插件做的事情只是把它们放进对话的角落,并努力不打扰人。README 里的示例图也来自该数据集的官方预览图。
47
+ - [three.js](https://github.com/mrdoob/three.js) r160(MIT),随场景一起本地分发。
48
+ - 每个场景页只做了三处改动:three.js 指向本地副本、注入一个「定格/恢复」钩子、隐藏场景自带的说明浮层。
70
49
 
71
- ## 重新生成场景 / Rebuilding
50
+ ## 开发
72
51
 
73
52
  ```bash
74
- node scripts/build-scenes.mjs
53
+ node scripts/build-scenes.mjs # 重新抓取并生成场景
54
+ node --experimental-vm-modules scripts/check-scenes.mjs # 32 个场景构建自检
75
55
  ```
76
56
 
77
- 脚本会:下载 `SCENES` 列表里的场景 → 把 three.js 0.160.0 从 cdnjs 改指向本地 `scenes/three.module.min.js` → 注入「定格/恢复」消息钩子、隐藏场景自带的说明浮层 → 校验没有残留外链 → 重新生成 `scenes/catalog.json`(标题取自每个页面自己的 `<title>`)。
57
+ 发布:改 `version` → `git tag v<version> && git push origin v<version>`,GitHub Actions 会先跑场景自检再 `npm publish --provenance`。
78
58
 
79
- ## 自检 / Scene check
59
+ ## English
80
60
 
81
- ```bash
82
- node --experimental-vm-modules scripts/check-scenes.mjs
83
- ```
61
+ **Nook** keeps one kawaii 3D diorama in the bottom-right corner of the DSH conversation. It takes no layout space and no clicks; its rim melts into the panel fill, so it reads as a small landscape surfacing out of the page. Click it to fill the conversation, focus the composer and it settles back on its own. 32 scenes, randomly picked or chosen by hand, with an adjustable presence; everything is vendored, so it never touches the network.
84
62
 
85
- 用真实 three.js + 一个 `WebGLRenderer` 空壳和一个无头 DOM,把每个场景自身的构建代码真正跑一遍:语法/引用错误、被场景 `try/catch` 吞掉后写进错误框的异常,都会在这里暴露。它不涉及 GPU,所以着色器、驱动、上下文数量这类问题不在覆盖范围内。
63
+ Scenes come from [Fable-Kawaii-3D-ThreeJS](https://huggingface.co/datasets/liumindmind/Fable-Kawaii-3D-ThreeJS) by liumindmind (MIT) — with thanks.
86
64
 
87
- ## 许可 / License
65
+ ## License
88
66
 
89
- 插件代码 MIT。`scenes/` 里的 HTML 来自 `liumindmind/Fable-Kawaii-3D-ThreeJS`(MIT 许可),three.js 来自 three.js 项目(MIT)。详见 `LICENSE`。
67
+ MIT · scenes and preview images © the Fable-Kawaii-3D-ThreeJS authors (MIT) · three.js © three.js authors (MIT). See [LICENSE](LICENSE).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-nook",
3
- "version": "0.3.0",
4
- "description": "Nook - a quiet kawaii 3D diorama in the corner of the DeepSeek Harness conversation. Click to fill the panel; 32 scenes from the Fable-Kawaii-3D-ThreeJS dataset.",
3
+ "version": "0.3.1",
4
+ "description": "Nook · 角落小窝 — a quiet kawaii 3D diorama in the corner of the DeepSeek Harness conversation. 32 scenes, click to fill the panel.",
5
5
  "keywords": [
6
6
  "dsh",
7
7
  "dsh-plugin",