dsh-background-by-model 0.4.5 → 0.5.0
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 +6 -20
- package/README.zh.md +6 -20
- package/lib/client.js +2 -1665
- package/lib/client.js.map +1 -1
- package/lib/index.js +0 -24
- package/package.json +4 -9
- package/lib/host-scan-C6rdxkf8.js +0 -1186
- package/lib/host-scan.js +0 -2
- package/lib/testing.js +0 -632
- package/scripts/host-contract-scan.mjs +0 -182
- package/test/host-check.test.mjs +0 -581
package/lib/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { t as checkHostOnDisk } from "./host-scan-C6rdxkf8.js";
|
|
2
1
|
import { access, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
2
|
import { dshHomePath } from "@deepseek-ai/dsh-home-paths";
|
|
5
3
|
//#region src/schema.ts
|
|
6
4
|
/** Every accepted `bgMode`, in UI order. */
|
|
@@ -422,24 +420,6 @@ function defaultModel(ctx) {
|
|
|
422
420
|
} catch {}
|
|
423
421
|
return null;
|
|
424
422
|
}
|
|
425
|
-
/**
|
|
426
|
-
* The installed-host half of the self-check.
|
|
427
|
-
*
|
|
428
|
-
* The browser probe behind the "Host check" tab already answers "does this host
|
|
429
|
-
* still provide what I use"; this adds the two facts only the node half can know:
|
|
430
|
-
* the host's own version, and whether the packages on disk still contain the
|
|
431
|
-
* literals the plugin depends on. Reading it costs a handful of file reads, and
|
|
432
|
-
* it is only ever called while that tab is open.
|
|
433
|
-
*/
|
|
434
|
-
let pluginDir = null;
|
|
435
|
-
function thisPluginDir() {
|
|
436
|
-
if (pluginDir === null) pluginDir = fileURLToPath(new URL("..", import.meta.url));
|
|
437
|
-
return pluginDir;
|
|
438
|
-
}
|
|
439
|
-
async function hostCheck(payload) {
|
|
440
|
-
const lang = payload?.lang === "en" ? "en" : "zh";
|
|
441
|
-
return await checkHostOnDisk(thisPluginDir(), lang);
|
|
442
|
-
}
|
|
443
423
|
const NS = "dshBackgroundByModel";
|
|
444
424
|
const RPC_CHANNEL = "/dsh-background-by-model";
|
|
445
425
|
const RPC_BODY_MAX = 314572800;
|
|
@@ -505,10 +485,6 @@ async function handleRpcMethod(ctx, endpoint, payload) {
|
|
|
505
485
|
ok: true,
|
|
506
486
|
value: defaultModel(ctx)
|
|
507
487
|
};
|
|
508
|
-
case "hostCheck": return {
|
|
509
|
-
ok: true,
|
|
510
|
-
value: await hostCheck(payload)
|
|
511
|
-
};
|
|
512
488
|
default: return {
|
|
513
489
|
ok: false,
|
|
514
490
|
error: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-background-by-model",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Appearance plugin for DeepSeek Harness: an ordered list of model rules, each carrying its own wallpaper, theme color, layout mode, opacity and blur 鈥?the background follows the model you switch to.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -46,19 +46,14 @@
|
|
|
46
46
|
"lib/invariant.js",
|
|
47
47
|
"lib/client.js",
|
|
48
48
|
"lib/client.js.map",
|
|
49
|
-
"lib/host-scan.js",
|
|
50
|
-
"lib/host-scan-*.js",
|
|
51
|
-
"lib/testing.js",
|
|
52
|
-
"scripts/host-contract-scan.mjs",
|
|
53
|
-
"test/host-check.test.mjs",
|
|
54
49
|
"cordis.patch.yml",
|
|
55
50
|
"example_img"
|
|
56
|
-
],
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
57
53
|
"bundle": "tsdown",
|
|
58
54
|
"watch": "tsdown --watch",
|
|
59
55
|
"typecheck": "tsc -p tsconfig.json",
|
|
60
|
-
"
|
|
61
|
-
"test": "tsdown && node --test test/host-check.test.mjs"
|
|
56
|
+
"test": "tsdown && tsc -p tsconfig.json"
|
|
62
57
|
},
|
|
63
58
|
"devDependencies": {
|
|
64
59
|
"@deepseek-ai/dsh-home-paths": "^0.1.0-rc.6",
|