dsh-theme-endfield 0.0.0-stage → 1.1.9

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ymh0000123
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,118 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # dsh-theme-endfield
2
+
3
+ 参考《明日方舟:终末地》官网风格的 DSH Web 主题插件。
4
+
5
+ 奶油纸底、墨黑文字、信号黄/武陵青强调色、全直角工业编辑风。Client 侧(`client.js`)通过主题令牌和样式覆盖界面;Host 侧(`index.js`)负责设置持久化与可选的音频通知(派生系统播放器子进程),均不修改应用代码。
6
+
7
+ ## 版本支持
8
+
9
+ | DSH | 设置持久化 | 备注 |
10
+ | --- | --- | --- |
11
+ | **0.2.x**(在 **0.2.0-rc.2** 上实测) | Host 导出 `Config`,浏览器 `ctx.configForms` | 当前支持目标 |
12
+ | 0.1.7 – 0.1.x | 同一套 Config/configForms 接缝 | 无需改动 |
13
+ | ≤ 0.1.5 | `ctx.settings.register` + `ctx.settingsScope` | 自动回落,无需配置 |
14
+
15
+ 0.2 改动了三处本插件依赖的应用侧细节,本次已跟进(都验证过「旧写法在 0.2 上静默失效」):
16
+
17
+ - **回合状态标签**(“Deep diving…”)从 `@deepseek-ai/dsh-client-ui-conversation` 的**渐变文字**搬到 `@deepseek-ai/dsh-client-ui-chat` 的**遮罩扫光文字**,不再有 `turnStatus` 类名,着色改由 `--dsw-alias-label-deep-diving` / `-shimmer` 两个令牌承担,所以旧规则已删除、改在 `theme.overrideTokens` 层换色(实测:留着旧规则时该令牌仍是应用自带值,标签完全没有主题色);
18
+ - **右侧栏**列名由 `_detailsCol` 改为 `_rightbarCol`,且不透明底色移到列元素本身——等高线图层在右侧栏打开时不会再被整块盖住;
19
+ - **插件卡片展示文案**改由 `locale/<语言>.json` 的 `meta.title` / `meta.description` 提供;`package.json` 的 `dsh.client.inject` 也不再列 0.2 已删除的 `@deepseek-ai/dsh-client-runtime` 与 `@deepseek-ai/dsh-client-ui-slots`(改为列出 0.2 真正的提供方)。
20
+
21
+ ## 安装
22
+
23
+ ```bash
24
+ dsh plugin --profile web add github:ymh0000123/dsh-theme-endfield
25
+ ```
26
+
27
+ 重启或重新加载 `web` profile 后生效。**更新插件文件时注意**:Client 半(`client.js`)由 Host 按请求从磁盘读取,浏览器刷新即可生效;Host 半(`index.js`)只在 profile 启动时 import 一次,**必须整进程重启 DSH** 才会重新加载(`dsh-hmr` 的 watch 默认忽略 `**/node_modules`,软链安装的仓库文件不在其观察范围内)。只刷新页面时,运行的仍是启动时那份 Host 代码。卸载:
28
+
29
+ ```bash
30
+ dsh plugin --profile web rm dsh-theme-endfield
31
+ ```
32
+
33
+ ## 功能
34
+
35
+ 在 **设置 › 终末地主题设置** 中调整:
36
+
37
+ - 主题总开关、谷地黄/武陵青配色、直角/圆角模式;
38
+ - 等高线背景、动态开关、`24 / 60 / 120 FPS`;
39
+ - 等高线速度 `1x / 2x / 4x`;
40
+ - 可选鼠标轨迹:鼠标附近的等高线局部变形并逐渐恢复,默认关闭;
41
+ - 背景水印及持续显示;
42
+ - 输出滚动动画:模型流式输出时把「整段跳一大格」摊成逐帧滑动(默认开启,强度分 `柔和 / 标准 / 轻快` 三档);不改动应用自己的滚动位置,因此跟随不会中断,向上滚动、读者手势与系统「减少动态效果」下都保持瞬时(详见 [docs/features.md](docs/features.md)「输出滚动动画」);
43
+ - 启动加载动画;
44
+ - 雷霆大字及入场动画;
45
+ - 顶部余额胶囊:悬浮显示 DeepSeek API 余额与峰谷时段(高峰为工作日 `9-12` 点、`14-18` 点;周末、法定节假日与落在周末的调休日都按低谷半价),默认关闭;会话使用 [dsh-codearts-auth](https://www.npmjs.com/package/dsh-codearts-auth) 渠道模型时自动切换为该渠道的剩余额度与积分消耗进度,随渠道切换实时跟随,主读数可在设置中选择右侧百分比显示剩余或已用(详见 [docs/features.md](docs/features.md)「渠道额度模式」);
46
+ - 可选音频通知:启动音、任务开始/结束音、需要回应时提示,音量与自定义音效目录可调(默认关闭,详见 [docs/audio-notifications.md](docs/audio-notifications.md))。
47
+
48
+ 所有设置由 DSH 自己的设置服务持久化,与页面 origin/端口无关:在 **DSH 0.2.0-rc.2 / 0.1.7-rc.1 及以后**,Host `index.js` 导出一份 31 个字段全部 `.volatile()` 的 schemastery `Config`(命名空间 = 本插件 profile entry id `theme-endfield`),浏览器 `client.js` 通过 `ctx.configForms` 读写并订阅,值随 `<profile>/cordis.patch.yml` 落盘;在**更旧的 DSH(≤ 0.1.5)** 上则回落到 `ctx.settings.register('dsh-theme-endfield', schema)` + `ctx.settingsScope`(`<dshHome>/settings.yaml`)。两代都与页面 origin 无关,因此 DSH web 与 DSH Desktop 都能正确保存并在重启/换端口后恢复,不再使用会被 Desktop 随机端口清空的 `localStorage`。详见 [docs/features.md](docs/features.md) 与 [docs/engineering-notes.md](docs/engineering-notes.md);0.1.7 升级后旧设置需要在设置页重设一次(`settings.yaml` 已被 DSH 废弃,见 [engineering-notes.md § DSH 0.1.7-rc.1 换掉了整套 settings API](docs/engineering-notes.md#dsh-017-rc1-换掉了整套-settings-api-v110-已跟进))。设置文案支持中英文;动态等高线尊重系统「减少动态效果」,动画帧率和速度可独立调整。
49
+
50
+ **如果开关总是「刷新后复位」**:先看 Host 侧有没有这份 `Config`(`Config.listConfigs` 对该 entry 报 `absent` 就是没有)。没有 Config 时 DSH 不投影任何表单,Host `apply()` 会打一行 warn 并在 profile 目录留下报告文件 `theme-endfield-diagnostic.json`(`Config` 构建成功时会自动删除它;报告里的 `schemaMode` / `loaded` / `loadError` 会写明走了哪条解析路径、以及某个副本是否「解析得到却加载失败」)——排查与判据见 [docs/testing.md](docs/testing.md#设置页)。另外注意:**改 Host 半(`index.js`)必须整进程重启 DSH**,刷新页面只重载 `client.js`。
51
+
52
+ ## 文档
53
+
54
+ | 文档 | 内容 |
55
+ | --- | --- |
56
+ | [docs/design-language.md](docs/design-language.md) | 色板、令牌映射与对比度规则 |
57
+ | [docs/features.md](docs/features.md) | 功能行为、默认值、存储键与边界情况 |
58
+ | [docs/engineering-notes.md](docs/engineering-notes.md) | 算法、层叠、动画和性能实现说明 |
59
+ | [docs/testing.md](docs/testing.md) | 校验脚本与测试套件说明 |
60
+ | [docs/contour-trail.md](docs/contour-trail.md) | 鼠标轨迹的采样、衰减与验证 |
61
+
62
+ ## 开发与验证
63
+
64
+ ```bash
65
+ node check.js
66
+ node selftest.js
67
+ npm test
68
+ ```
69
+
70
+ `npm test` 覆盖样式不变量、配色、设置页、真实浏览器渲染、等高线平滑/尖点、动画可访问性、覆盖率和 24/60/120 FPS 性能预算。部分浏览器测试需要本机安装 Chrome 或 Edge。跑测试请用 Node 22+(浏览器 fixture 依赖全局 `WebSocket`/`fetch`,版本不足会在测试处明确报错;插件本身的运行没有这个要求)。
71
+
72
+ ## 项目结构
73
+
74
+ ```text
75
+ src/client/ Client 侧源码片段(拼接顺序见 src/client/manifest.js)
76
+ src/host/ Host 侧源码片段(拼接顺序见 src/host/manifest.js)
77
+ src/styles/ theme.css:主题样式表(那一整个模板字面量的内容)
78
+ src/contour-*.js 等高线 worker / WebGL 源码(npm run build:worker 嵌入产物)
79
+ client.js Client 侧产物,由 src/client/ + src/styles/ 拼接而来
80
+ index.js Host 侧产物,由 src/host/ 拼接而来
81
+ scripts/ 构建与门禁:lib/bundle-build.js 拼接器 + build-*.js 入口
82
+ lib/ 音频通知:槽位定义、WAV 合成与播放运行时
83
+ locale/ 插件卡片的展示文案(meta.title / meta.description)
84
+ sounds/ 生成的通知音(npm run sound:build 重新生成)
85
+ cordis.patch.yml Bundle 注入配置
86
+ check.js 样式表静态校验
87
+ selftest.js 校验器自检
88
+ test/ 渲染、设置、配色与性能测试
89
+ docs/ 设计、功能、工程与测试文档
90
+ ```
91
+
92
+ `client.js` 与 `index.js` 是**构建产物,不要直接编辑**:改 `src/` 下的片段,再跑
93
+ `npm run build:client` / `npm run build:host`(等高线 worker 走 `npm run build:worker`)。
94
+ `npm run check` 与 CI 都用 `--check` 验证产物没有过期:产物与源码不一致时报出第一个差异行。
95
+ 片段划分与改动规则见 [docs/engineering-notes.md](docs/engineering-notes.md) 的「源码是真源,产物是拼出来的」。
96
+
97
+ ## 素材归属
98
+
99
+ 本插件是**非官方同人作品**,与鹰角网络(Hypergryph)不存在任何隶属、赞助或背书关系。
100
+
101
+ - 《明日方舟:终末地》(Arknights: Endfield)的游戏名称、标识、商标、官网视觉与设计语言及相关美术素材,版权归**鹰角网络(上海鹰角网络科技有限公司,Hypergryph Network Technology)**所有。
102
+ - 本仓库中的**部分素材**(如 `assets/` 下的界面截图,以及主题中还原的 `ENDFIELD` 字标、信号黄配色与工业编辑风版式)源自或参考上述作品及其官网,仅用于**学习、展示与非商业用途**;其权利仍归鹰角网络所有,**不在本项目的 MIT 许可证覆盖范围内**。
103
+ - 本项目的原创代码(`client.js`、`index.js`、`src/`、`scripts/`、`test/` 等)以 MIT 许可证发布。
104
+ - 若权利方认为本仓库中的任何素材使用不当,请通过 Issue 联系,我们会立即删除或替换相关内容。
105
+
106
+ ## 许可证
107
+
108
+ MIT,仅覆盖本项目的原创代码;第三方素材的归属见[素材归属](#素材归属)。
109
+
110
+ ## Star History
111
+
112
+ <a href="https://www.star-history.com/?repos=ymh0000123%2Fdsh-theme-endfield&type=date&legend=top-left">
113
+ <picture>
114
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=ymh0000123/dsh-theme-endfield&type=date&theme=dark&legend=top-left" />
115
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=ymh0000123/dsh-theme-endfield&type=date&legend=top-left" />
116
+ <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=ymh0000123/dsh-theme-endfield&type=date&legend=top-left" />
117
+ </picture>
118
+ </a>