@sqjian/dsh-skin 0.1.1 → 0.2.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/dist/index.js +63 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,69 @@
|
|
|
1
1
|
import Schema from "@deepseek-ai/schemastery";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
|
-
import { extname, resolve } from "node:path";
|
|
3
|
+
import { extname, join, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import {
|
|
5
|
+
import { homedir } from "node:os";
|
|
6
|
+
// node_modules/.pnpm/@deepseek-ai+dsh-home-paths@0.2.2-rc.3_@deepseek-ai+cordis@4.1.0/node_modules/@deepseek-ai/dsh-home-paths/lib/index.js
|
|
7
|
+
/**
|
|
8
|
+
* Shared filesystem path helpers for DeepSeek Harness user data.
|
|
9
|
+
*
|
|
10
|
+
* @module @deepseek-ai/dsh-home-paths
|
|
11
|
+
*/
|
|
12
|
+
/** Directory name for the default DeepSeek Harness home under the OS home. */
|
|
13
|
+
var DSH_HOME_DIR_NAME = ".dsh";
|
|
14
|
+
/** Environment variable that overrides the default DeepSeek Harness home. */
|
|
15
|
+
var DSH_HOME_ENV = "DSH_HOME";
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the default DeepSeek Harness home using Node's platform path rules.
|
|
18
|
+
* @returns the absolute default harness home path.
|
|
19
|
+
*/
|
|
20
|
+
function defaultDshHome() {
|
|
21
|
+
return join(homedir(), DSH_HOME_DIR_NAME);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Expand supported tilde prefixes against the operating-system home.
|
|
25
|
+
* @param path - configured path that may begin with `~`, `~/`, or `~\`.
|
|
26
|
+
* @returns the expanded path, or the original value when no supported prefix is present.
|
|
27
|
+
*/
|
|
28
|
+
function expandHomePath(path) {
|
|
29
|
+
if (path === "~") return homedir();
|
|
30
|
+
if (path.startsWith("~/") || path.startsWith("~\\")) return join(homedir(), path.slice(2));
|
|
31
|
+
return path;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolve one user-data root from an explicit path, an environment override, and a default.
|
|
35
|
+
* @param configured - explicit path, which has highest precedence.
|
|
36
|
+
* @param env - environment mapping to read.
|
|
37
|
+
* @param envName - environment variable that overrides the default.
|
|
38
|
+
* @param fallback - default root, used when neither the explicit path nor the environment provides one.
|
|
39
|
+
* @returns the normalized absolute root.
|
|
40
|
+
*/
|
|
41
|
+
function resolveRoot(configured, env, envName, fallback) {
|
|
42
|
+
const fromEnv = env[envName];
|
|
43
|
+
return resolve(expandHomePath(configured ?? (fromEnv !== void 0 && fromEnv.trim().length > 0 ? fromEnv : fallback())));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Resolve the single-root DeepSeek Harness home.
|
|
47
|
+
*
|
|
48
|
+
* Precedence, highest first: an explicit configured path, `$DSH_HOME`, then
|
|
49
|
+
* `~/.dsh`. The harness keeps all user data under one root. An empty or
|
|
50
|
+
* whitespace-only `$DSH_HOME` is treated as unset, so a blank override never
|
|
51
|
+
* resolves the home to the current working directory.
|
|
52
|
+
* @param configured - explicit harness-home override, which has highest precedence.
|
|
53
|
+
* @param env - environment mapping used to read `DSH_HOME`.
|
|
54
|
+
* @returns the normalized absolute harness home path.
|
|
55
|
+
*/
|
|
56
|
+
function resolveDshHome(configured, env = process.env) {
|
|
57
|
+
return resolveRoot(configured, env, DSH_HOME_ENV, defaultDshHome);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Join path segments onto the resolved DeepSeek Harness home.
|
|
61
|
+
* @param segments - path segments appended to the Harness home; an empty list returns the home itself.
|
|
62
|
+
* @returns the normalized absolute joined path.
|
|
63
|
+
*/
|
|
64
|
+
function dshHomePath(...segments) {
|
|
65
|
+
return join(resolveDshHome(), ...segments);
|
|
66
|
+
}
|
|
6
67
|
// src/skin.ts
|
|
7
68
|
var builtins = /* @__PURE__ */ new Map([["builtin:ghostery-mono", "ghostery-mono.svg"], ["builtin:ghostery-color", "ghostery-color.svg"]]);
|
|
8
69
|
function resolveSkin(config = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqjian/dsh-skin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "可配置侧栏、聊天首屏和浏览器图标",
|
|
6
6
|
"engines": {
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@deepseek-ai/dsh-home-paths": "0.2.2-rc.3",
|
|
35
34
|
"@deepseek-ai/schemastery": "^3.18.1"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
37
|
+
"@deepseek-ai/dsh-home-paths": "0.2.2-rc.3",
|
|
38
38
|
"@types/node": "22.20.4",
|
|
39
39
|
"@types/react": "18.3.31",
|
|
40
40
|
"typescript": "5.9.3",
|