dsh-deepseek-theme-studio 0.1.2 → 0.1.3
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/lib/client.js +2 -2
- package/lib/index.js +16 -2
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* dsh-deepseek-theme-studio v0.1.
|
|
2
|
+
* dsh-deepseek-theme-studio v0.1.3 — client bundle (GENERATED by scripts/build.mjs; edit src/ instead).
|
|
3
3
|
*
|
|
4
4
|
* DeepSeek 官网视觉语言的 DSH Web 主题:毛玻璃 / 液化(流体) / 量子化(Q1-Q4)。
|
|
5
5
|
*
|
|
@@ -5087,7 +5087,7 @@ function createPluginBody(ctx, options = {}) {
|
|
|
5087
5087
|
*/
|
|
5088
5088
|
function apply(ctx) {
|
|
5089
5089
|
if (typeof document === 'undefined' || typeof window === 'undefined') return
|
|
5090
|
-
var body = createPluginBody(ctx, { version: '0.1.
|
|
5090
|
+
var body = createPluginBody(ctx, { version: '0.1.3' })
|
|
5091
5091
|
if (ctx !== undefined && ctx !== null && typeof ctx.effect === 'function') {
|
|
5092
5092
|
ctx.effect(() => {
|
|
5093
5093
|
try {
|
package/lib/index.js
CHANGED
|
@@ -50,6 +50,20 @@ export function statePath() {
|
|
|
50
50
|
return join(home, STATE_FILENAME)
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Where the parameter file lives, in a form that is safe to put on the page.
|
|
55
|
+
*
|
|
56
|
+
* The absolute path embeds the local account name (`C:\Users\<name>\.dsh\…`),
|
|
57
|
+
* and this string is rendered in the settings row — from where it lands in
|
|
58
|
+
* every screenshot a user shares. `$DSH_HOME/…` says the same thing, is
|
|
59
|
+
* shorter, and carries nothing machine-specific. The real path is still used
|
|
60
|
+
* inside the process; it just never crosses the wire.
|
|
61
|
+
*/
|
|
62
|
+
export function displayPath() {
|
|
63
|
+
const home = process.env.DSH_HOME && process.env.DSH_HOME.length > 0 ? process.env.DSH_HOME : null
|
|
64
|
+
return home === null ? `~/.dsh/${STATE_FILENAME}` : `$DSH_HOME/${STATE_FILENAME}`
|
|
65
|
+
}
|
|
66
|
+
|
|
53
67
|
/**
|
|
54
68
|
* Read the state object.
|
|
55
69
|
*
|
|
@@ -258,7 +272,7 @@ async function handleApi(req, res, trustedHosts) {
|
|
|
258
272
|
// GET is a convenience for humans and for `curl`; the client uses POST.
|
|
259
273
|
if (req.method === 'GET') {
|
|
260
274
|
const current = readState()
|
|
261
|
-
writeJson(res, 200, { ok: true, value: current.value, fileError: current.error, revision, path:
|
|
275
|
+
writeJson(res, 200, { ok: true, value: current.value, fileError: current.error, revision, path: displayPath() })
|
|
262
276
|
return
|
|
263
277
|
}
|
|
264
278
|
if (req.method !== 'POST') {
|
|
@@ -284,7 +298,7 @@ async function handleApi(req, res, trustedHosts) {
|
|
|
284
298
|
|
|
285
299
|
if (payload.method === 'get') {
|
|
286
300
|
const current = readState()
|
|
287
|
-
writeJson(res, 200, { ok: true, value: current.value, fileError: current.error, revision, path:
|
|
301
|
+
writeJson(res, 200, { ok: true, value: current.value, fileError: current.error, revision, path: displayPath() })
|
|
288
302
|
return
|
|
289
303
|
}
|
|
290
304
|
|