dsh-opencode-palette 2.0.0 → 2.0.2
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 +8 -8
- package/lib/client.js +2 -2
- package/lib/index.js +35 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,13 +27,15 @@ npm install -g @deepseek-ai/dsh
|
|
|
27
27
|
|
|
28
28
|
# 2. add the plugin to your profile
|
|
29
29
|
dsh plugin --profile web add dsh-opencode-palette
|
|
30
|
+
|
|
31
|
+
# 3. restart DSH when done (or refresh the browser page)
|
|
30
32
|
```
|
|
31
33
|
|
|
32
|
-
**① Install
|
|
34
|
+
**① Install the plugin.**
|
|
33
35
|
|
|
34
|
-
**② Open
|
|
36
|
+
**② Open “opencode调色板”.** Settings → Plugins → opencode调色板
|
|
35
37
|
|
|
36
|
-
**③ Pick a theme
|
|
38
|
+
**③ Pick a theme you like.**
|
|
37
39
|
|
|
38
40
|
<h2 align="center"><sub>THEMES</sub><br>Themes</h2>
|
|
39
41
|
|
|
@@ -41,13 +43,11 @@ dsh plugin --profile web add dsh-opencode-palette
|
|
|
41
43
|
|
|
42
44
|

|
|
43
45
|
|
|
44
|
-
<h2 align="center"><sub>EXTENSIONS</sub><br>
|
|
46
|
+
<h2 align="center"><sub>EXTENSIONS</sub><br>What the opencode themes come with</h2>
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
**Plenty of fonts.** Typography is its own dimension: apply it to all text or code only, 11–18 px, your pick of code font — orthogonal to color, kept across restarts.
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
- **An easy way back.** “Native look” restores DSH in one click: it overrides no colors, it only keeps your typography setup.
|
|
50
|
-
- **A panel you can find.** 38 entries grouped by color family, searchable, and following your DSH interface language (中文 / English).
|
|
50
|
+
**A panel you can find.** 38 entries grouped by color family, searchable, and following your DSH interface language (中文 / English).
|
|
51
51
|
|
|
52
52
|
<h2 align="center"><sub>UPGRADE</sub><br>Upgrade</h2>
|
|
53
53
|
|
package/lib/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* dsh-opencode-palette v2.0.
|
|
2
|
+
* dsh-opencode-palette v2.0.2 — 浏览器半(构建产物,勿手改)
|
|
3
3
|
* 数据驱动管线:opencode v1.18.12 官方主题 JSON → 颜色解析 → DSH 适配注入
|
|
4
4
|
* 面板「检查更新」:dsh-plugin-update 客户端入口经构建期内联(vendor)
|
|
5
5
|
* 源:src/engine/* + runtime/*.mjs + npm 包 dsh-log / dsh-plugin-update 的客户端入口
|
|
@@ -9963,7 +9963,7 @@ const STORAGE_KEY = 'dsh.opencode-palette.v2'
|
|
|
9963
9963
|
const LEGACY_STORAGE_KEY = 'dsh.opencode-tui-theme.v2'
|
|
9964
9964
|
const DEFAULT_STATE = { enabled: true, theme: 'opencode', mode: 'mono', size: 13, fontKey: 'JetBrains Mono' }
|
|
9965
9965
|
// 构建时由 scripts/build-client.mjs 替换为 package.json 版本(面板底部署小字)
|
|
9966
|
-
const PALETTE_VERSION = '2.0.
|
|
9966
|
+
const PALETTE_VERSION = '2.0.2'
|
|
9967
9967
|
|
|
9968
9968
|
function getReact() {
|
|
9969
9969
|
if (typeof require === 'function') { try { return require('react') } catch (e) { /* 动态版无 require */ } }
|
package/lib/index.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* 把它的 dist 原样放进本包 lib/vendor/ 下,import.meta.url 就落在本包内,两条判定都成立。
|
|
20
20
|
* vendor 副本由构建从 npm 包复制(见 scripts/build-client.mjs),门禁断言与 npm 包逐字节一致。
|
|
21
21
|
*/
|
|
22
|
-
import { readFileSync } from 'node:fs'
|
|
22
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
23
23
|
import { mkdir, readdir, readFile, unlink, writeFile } from 'node:fs/promises'
|
|
24
24
|
import { homedir } from 'node:os'
|
|
25
25
|
import { dirname, join } from 'node:path'
|
|
@@ -40,6 +40,32 @@ const SWITCH_FILE_NAME = 'log-switch-' + PLUGIN_ID + '.json'
|
|
|
40
40
|
const RPC_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/
|
|
41
41
|
const ENDPOINT_PATTERN = /^[A-Za-z0-9_$.-]+$/
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* 装配时先把日志目录建好、把开关文件用缺省值物化(2026-09-19 修,真机噪声两则)。
|
|
45
|
+
*
|
|
46
|
+
* 现象:两天日志里除 `log.persist.fail / readBack / read-fail` 之外什么都没有 —— 等于日志系统
|
|
47
|
+
* 没真正跑起来,还会带偏排障。
|
|
48
|
+
*
|
|
49
|
+
* 根因(本地插桩实测,非推断):
|
|
50
|
+
* 1. `dsh-log` 的 `persistSwitch()` 只调 `writeText`,**不会建父目录**;而写日志那条路
|
|
51
|
+
* (`writeBatch`)自己会先 `mkdir`。所以"没写过日志之前" `<DSH_HOME>/logs` 并不存在。
|
|
52
|
+
* 2. `loadSwitch()` 把「开关文件不存在」和「读坏了」归成同一条错误路径:`readText` 在目录
|
|
53
|
+
* 不存在时抛 ENOENT → 落 catch → 记一条 `readBack / read-fail` warn。
|
|
54
|
+
* 3. 于是**每次启动读开关都记一条误报**,且首次 `setSwitch()` 也会失败 —— 更糟的是
|
|
55
|
+
* `persistSwitch()` 把异常吞掉(调用方拿到"成功",磁盘上什么都没有)。
|
|
56
|
+
*
|
|
57
|
+
* 修法:装配时 `mkdir` 日志目录(recursive),再让 store 用**自己的 API**把缺省开关写下去。
|
|
58
|
+
* 不自己拼路径写 JSON:开关文件的落点与形状归 store 管,自己写会变成第二份真源。
|
|
59
|
+
*/
|
|
60
|
+
async function prepareLogHome(store, cacheDir) {
|
|
61
|
+
if (!cacheDir) return
|
|
62
|
+
await mkdir(join(cacheDir), { recursive: true })
|
|
63
|
+
const file = join(cacheDir, store.config.switchFileName)
|
|
64
|
+
if (existsSync(file)) return
|
|
65
|
+
const defaults = store.getSwitchState()
|
|
66
|
+
await store.setSwitch(defaults.enabled, defaults.sampleRate)
|
|
67
|
+
}
|
|
68
|
+
|
|
43
69
|
const PACKAGE_DIR = dirname(dirname(fileURLToPath(import.meta.url)))
|
|
44
70
|
|
|
45
71
|
/** 本进程正在跑的版本:启动那一刻读自己的 package.json(= 加载进内存的那份代码的版本)。
|
|
@@ -104,6 +130,14 @@ export function apply(ctx) {
|
|
|
104
130
|
const registry = new Map()
|
|
105
131
|
registerHostLogPhones(registry, hostLog)
|
|
106
132
|
|
|
133
|
+
// 日志目录 + 开关文件在装配时就备好:不做的话,首次运行读开关会记一条 readBack 误报,
|
|
134
|
+
// 且首次 setSwitch 会因父目录不存在而静默失败(详见 prepareLogHome 注释)
|
|
135
|
+
const logCacheDir = join(homeDir, 'logs')
|
|
136
|
+
const logHomeReady = prepareLogHome(hostLog.store, logCacheDir)
|
|
137
|
+
if (logHomeReady && typeof logHomeReady.catch === 'function') {
|
|
138
|
+
logHomeReady.catch(function () { /* 备目录失败不阻断装配:store 自己会记 persistSwitch/write-fail */ })
|
|
139
|
+
}
|
|
140
|
+
|
|
107
141
|
const update = createHostUpdate(
|
|
108
142
|
{ ctx: ctx, logCtx: { fire: function (level, event, fields) { return hostLog.store.log(level, event, fields) } }, readerOverrides: { runningVersion: runningVersion } },
|
|
109
143
|
{ pluginId: PLUGIN_ID, prefix: PHONE_PREFIX, targetPackageName: TARGET_PACKAGE_NAME }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-opencode-palette",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "让 DeepSeek Harness 穿上 38 款经典皮肤——东京的霓虹夜色、德古拉的暗红月光、复古工坊的暖黄灯火、黑客帝国的数字雨、玫瑰松林间的风……一键换肤,即点即换,重启不丢。38 legendary skins for DeepSeek Harness — tokyonight's neon dusk, dracula's crimson moon, gruvbox's retro glow, the matrix's digital rain, rose-pine's rosewood calm… one click, instant, persisted.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|