dsh-opencode-palette 1.7.1 → 2.0.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.
package/README.md CHANGED
@@ -1,97 +1,100 @@
1
- <h1 align="center">🎨 dsh-opencode-palette</h1>
2
-
3
- <div align="center">
4
-
5
- **🌐 [中文](../README.md) · [English](README.en.md)**
6
-
7
- **Built for long coding sessions — 38 eye-friendly themes, one click. Easier on the eyes, nicer to code in.**
8
-
9
- *为长时间编程而生 —— 38 款护眼配色一键换上,眼睛舒服,码字开心。*
10
-
11
- Your ⭐ is the brightest star in my night sky.
12
-
13
- [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](../LICENSE)
14
- [![npm](https://img.shields.io/npm/v/dsh-opencode-palette)](https://www.npmjs.com/package/dsh-opencode-palette)
15
- [![themes](https://img.shields.io/badge/themes-38%20opencode-orange)](https://github.com/anomalyco/opencode)
16
- [![tests](https://img.shields.io/badge/tests-38%2F38-green)]()
17
-
18
- </div>
19
-
20
-
21
- <h2 align="center"><sub>INSTALL</sub><br>Install in one command</h2>
22
-
23
- <div align="center">
24
-
25
- Requires the **DSH CLI**. **Zero configuration** — restart DSH (or refresh the browser page) and it just works, with the official `opencode` theme on by default.
26
-
27
- </div>
28
-
29
- ```bash
30
- # 1. install the DSH CLI first (skip if you have it)
31
- npm install -g @deepseek-ai/dsh
32
-
33
- # 2. add the plugin to your profile
34
- dsh plugin --profile web add dsh-opencode-palette
35
- ```
36
-
37
- <h2 align="center"><sub>GUIDE</sub><br>Get started in 30 seconds</h2>
38
-
39
- 1. Open **Settings → Plugins → Opencode Palette** (in Chinese: **设置 → 插件 → OpenCode 调色板**).
40
- 2. Click any theme chip — the interface re-skins instantly. Try a few and find the kindest one for your eyes.
41
-
42
- <h2 align="center"><sub>THEMES</sub><br>Features</h2>
43
-
44
- <div align="center">
45
-
46
- Every theme name has a story behind it, and all 38 live in the settings panel grouped by color family — search and switch. Each theme's 7 core colors — `background · text · primary · accent · error · warning · success` — are defined in `src/themes/`.
47
-
48
- </div>
49
-
50
- ![theme stories](../assets/theme-stories-en.svg)
51
-
52
- <div align="center">
53
-
54
- Typography stays independent from the theme: applied to all text or code only, 11–18 px, 6 code fonts with live preview. `system` takes you back to DSH's native look in one click while keeping your typography. The panel follows your DSH interface language (中文 / English) instantly.
55
-
56
- </div>
57
-
58
- <h2 align="center"><sub>UPGRADE</sub><br>Upgrade</h2>
59
-
60
- ```bash
61
- dsh plugin --profile web update dsh-opencode-palette
62
- # pin to an older version:
63
- dsh plugin --profile web add dsh-opencode-palette@<version>
64
- ```
65
-
66
- <div align="center">
67
-
68
- <details>
69
- <summary>Upgrading from 1.4.x or earlier</summary>
70
-
71
- Old versions wrote a registration block into `~/.dsh/profiles/web/cordis.patch.yml` via postinstall. Delete the `opencode-palette` block from that file first (a leftover would duplicate the bundle registration), then run `update` above.
72
-
73
- </details>
74
-
75
- </div>
76
-
77
- <h2 align="center"><sub>MORE</sub><br>More from the author</h2>
78
-
79
- <div align="center">
80
-
81
- If you like this plugin, you might also like:
82
-
83
- **[dsh-prompt](https://github.com/FeatherHunter/dsh-prompt)** — When you get stuck writing a prompt, it has 24 deep templates — one click, straight into your input box
84
-
85
- **[dsh-mattpocock-skills-deck](https://github.com/FeatherHunter/dsh-mattpocock-skills-deck)** — Want your AI to do more than chat? 25 engineering skills, installed with a single prompt
86
-
87
- </div>
88
-
89
- <h2 align="center"><sub>CONNECT</sub><br>Feedback & Contact</h2>
90
-
91
- <div align="center">
92
-
93
- Found a bug or have an idea? Please [open an issue](https://github.com/FeatherHunter/dsh-opencode-palette/issues). You can also scan the QR code to add the author on Feishu (mention `dsh-opencode-palette`).
94
-
95
- <img src="../assets/feishu-qr.png" alt="Author's Feishu QR code" width="260" />
96
-
97
- </div>
1
+ <h1 align="center">🎨 dsh-opencode-palette</h1>
2
+
3
+ <div align="center">
4
+
5
+ **🌐 [中文](../README.md) · [English](README.en.md)**
6
+
7
+ **Built for long coding sessions — 38 eye-friendly themes, one click.**
8
+
9
+ *为长时间编程而生 —— 38 款护眼配色一键换上,眼睛舒服,码字开心。*
10
+
11
+ Your ⭐ is the brightest star in my night sky.
12
+
13
+ [![npm](https://img.shields.io/npm/v/dsh-opencode-palette?label=npm)](https://www.npmjs.com/package/dsh-opencode-palette)
14
+ [![downloads](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.npmjs.org%2Fdownloads%2Fpoint%2Flast-month%2Fdsh-opencode-palette&query=%24.downloads&label=downloads&suffix=%2Fmo&color=brightgreen)](https://www.npmjs.com/package/dsh-opencode-palette)
15
+ [![last-commit](https://img.shields.io/github/last-commit/FeatherHunter/dsh-opencode-palette?label=last-commit&color=FE7D37)](https://github.com/FeatherHunter/dsh-opencode-palette/commits/main)
16
+ [![themes](https://img.shields.io/badge/themes-opencode%C2%B738-9D7CD8)](https://github.com/anomalyco/opencode)
17
+ [![PRs welcome](https://img.shields.io/badge/PRs%20welcome-brightgreen.svg)](https://github.com/FeatherHunter/dsh-opencode-palette/issues)
18
+
19
+ </div>
20
+
21
+
22
+ <h2 align="center"><sub>INSTALL</sub><br>Get started in three steps</h2>
23
+
24
+ ```bash
25
+ # 1. install the DSH CLI first (skip if you have it)
26
+ npm install -g @deepseek-ai/dsh
27
+
28
+ # 2. add the plugin to your profile
29
+ dsh plugin --profile web add dsh-opencode-palette
30
+
31
+ # 3. restart DSH when done (or refresh the browser page)
32
+ ```
33
+
34
+ **① Install the plugin.**
35
+
36
+ **② Open “opencode调色板”.** Settings → Plugins → opencode调色板
37
+
38
+ **③ Pick a theme you like.**
39
+
40
+ <h2 align="center"><sub>THEMES</sub><br>Themes</h2>
41
+
42
+ 38 entries, grouped by color family and one search away. Every cell in the picture below is a palette.
43
+
44
+ ![theme stories](../assets/theme-stories-en.svg)
45
+
46
+ <h2 align="center"><sub>EXTENSIONS</sub><br>What the opencode themes come with</h2>
47
+
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.
49
+
50
+ **A panel you can find.** 38 entries grouped by color family, searchable, and following your DSH interface language (中文 / English).
51
+
52
+ <h2 align="center"><sub>UPGRADE</sub><br>Upgrade</h2>
53
+
54
+ ```bash
55
+ dsh plugin --profile web update dsh-opencode-palette
56
+ # pin to an older version:
57
+ dsh plugin --profile web add dsh-opencode-palette@<version>
58
+ ```
59
+
60
+ Prefer a button? Go to Settings → Plugins → opencode调色板: the **Check for updates** button at the right of the title row only goes online when you click it; when a newer version exists it turns into “Update to vX.Y.Z” right there — one click upgrades. Restart DSH to apply: until you do, a banner stays at the top of the panel.
61
+
62
+ <h2 align="center"><sub>MORE</sub><br>More from the author</h2>
63
+
64
+ <div align="center">
65
+
66
+ If you like this plugin, you might also like:
67
+
68
+ **[dsh-prompt](https://github.com/FeatherHunter/dsh-prompt)** — When you get stuck writing a prompt, it has 24 deep templates — one click, straight into your input box
69
+
70
+ **[dsh-mattpocock-skills-deck](https://github.com/FeatherHunter/dsh-mattpocock-skills-deck)** — Want your AI to do more than chat? 25 engineering skills, installed with a single prompt
71
+
72
+ **[dsh-im-companion](https://github.com/FeatherHunter/dsh-im-companion)** — Supercharge the dsh-im plugin and DSH workspaces for a better experience.
73
+
74
+ </div>
75
+
76
+ <h2 align="center"><sub>THANKS</sub><br>Contributors</h2>
77
+
78
+ <div align="left">
79
+
80
+ Every issue gets a 🌹 — everything asked for below is already shipped.
81
+
82
+ [@the-beating-light-of-the-nail](https://github.com/the-beating-light-of-the-nail) — #3 listed this plugin in DSH Meme Hub with palette notes 🌹
83
+
84
+ [@xiSage](https://github.com/xiSage) — #11 asked for any system font; the panel now lists your local fonts 🌹
85
+
86
+ [@Number444](https://github.com/Number444) — #12 asked for Maple Mono NF CN 2:1 CJK 🌹
87
+
88
+ [@anupamme](https://github.com/anupamme) — #32 flagged a missing check on theme downloads 🌹
89
+
90
+ </div>
91
+
92
+ <h2 align="center"><sub>CONNECT</sub><br>Feedback & Contact</h2>
93
+
94
+ <div align="center">
95
+
96
+ Found a bug or have an idea? Please [open an issue](https://github.com/FeatherHunter/dsh-opencode-palette/issues). You can also scan the QR code to add the author on Feishu (mention `dsh-opencode-palette`).
97
+
98
+ <img src="../assets/feishu-qr.png" alt="Author's Feishu QR code" width="260" />
99
+
100
+ </div>
@@ -0,0 +1,27 @@
1
+ /**
2
+ * runtime/channel.mjs — 浏览器半与宿主半共用的接线常量(单一真源)
3
+ *
4
+ * 两侧必须逐个对上,写错一个就整条通道静默不通,所以只在这里定义一次:
5
+ * - 宿主半用 fetch.register 注册精确路由 ROUTE_PATH;
6
+ * - 浏览器半用 connection.rpc.call(CHANNEL, ENDPOINT, ...) 调它(拼出的路径同为 ROUTE_PATH)。
7
+ *
8
+ * 命名规则(DSH 连接服务):通道 CHANNEL 必须匹配 /^\/[A-Za-z0-9._~-]+$/(单段,故只能 /api);
9
+ * 端点 ENDPOINT 必须匹配 /^[A-Za-z0-9_$.-]+$/。真正的电话名在请求体里,不受这条限制。
10
+ */
11
+
12
+ /** /api 载体上的通道名(与 deck、im-companion 同构:DSH 公开的精确路由载体)。 */
13
+ export const CHANNEL = '/api'
14
+ /** 本插件的端点名;注册路径 = CHANNEL + '/' + ENDPOINT。 */
15
+ export const ENDPOINT = 'opencode-palette'
16
+ /** 宿主注册的精确路径,客户端拼出的路径必须与它一致。 */
17
+ export const ROUTE_PATH = CHANNEL + '/' + ENDPOINT
18
+
19
+ /** 插件标识(日志落盘目录、更新环境指纹、事件清单三处共用一个值)。 */
20
+ export const PLUGIN_ID = 'dsh-opencode-palette'
21
+ /** 电话名前缀:日志 5 条与更新 3 条共用,拼出的电话名形如 palette.updateStatus。 */
22
+ export const PHONE_PREFIX = 'palette'
23
+ /** 要检查更新的那个包(本插件自己)。 */
24
+ export const TARGET_PACKAGE_NAME = 'dsh-opencode-palette'
25
+
26
+ /** 浏览器半向宿主半回一个失败的调用结果(宿主不可用时用,形状与宿主回包一致)。 */
27
+ export const HOST_UNAVAILABLE = 'host-unavailable'