dsh-dream-skin 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/lib/index.js ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * dsh-dream-skin — host half.
3
+ *
4
+ * The host side is intentionally a no-op loader entry: the whole feature
5
+ * lives in the browser half (`./client`), which DSH's dsh-client-modules
6
+ * picks up through the package's `dsh.client` declaration — the same shape
7
+ * as the shipped ui-* packages.
8
+ *
9
+ * Why localStorage for persistence? The Host settings wire only exposes an
10
+ * allowlisted set of namespaces to browser clients
11
+ * (dsh-host-apiproxy's WEB_SETTINGS_NAMESPACES), so a third-party namespace
12
+ * would answer `settings-not-exposed`, and the product itself keeps remote
13
+ * browser preferences process-local. localStorage matches that boundary for a
14
+ * purely visual preference while surviving reloads on the same origin.
15
+ */
16
+
17
+ /** Host loader entry for the browser implementation exported from `./client`. */
18
+ export function apply() {}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Browser-half type declarations for `dsh-dream-skin`.
3
+ *
4
+ * These describe the surface the bundle exports (`SKINS`, `apply`, `inject`)
5
+ * and the cordis service shape it relies on (`ctx.theme`, `ctx.slots`,
6
+ * `ctx.locale`). They are advisory — the shipped bundle is plain JS executed
7
+ * through the shell's lazy-CJS module table, so no runtime import of these
8
+ * types happens.
9
+ */
10
+
11
+ import type { Context } from "@deepseek-ai/cordis";
12
+ import type { DreamSkin, SkinTokens } from "../index.js";
13
+
14
+ /** Registry definition accepted by ThemeRuntime.register. */
15
+ export interface ThemeRegistration {
16
+ id: string;
17
+ colorScheme: "light" | "dark";
18
+ tokens: SkinTokens;
19
+ }
20
+
21
+ /** One color scheme for a token override (must be `{ light, dark }`). */
22
+ export interface TokenOverridePair {
23
+ light: string;
24
+ dark: string;
25
+ }
26
+
27
+ /** The immutable theme snapshot published on `theme/change`. */
28
+ export interface ThemeSnapshot {
29
+ preference: "light" | "dark" | "system" | string;
30
+ active: ThemeRegistration;
31
+ themes: ReadonlyArray<ThemeRegistration>;
32
+ revision: number;
33
+ }
34
+
35
+ /** The cordis services a browser bundle relies on. */
36
+ export interface DreamSkinCtx extends Context {
37
+ theme: {
38
+ getTheme(): ThemeSnapshot;
39
+ setTheme(id: string): void;
40
+ register(def: ThemeRegistration): () => void;
41
+ overrideTokens(source: string, tokens: Record<string, TokenOverridePair>): () => void;
42
+ };
43
+ slots: {
44
+ inject(name: string, register: () => unknown): void;
45
+ register(desc: Record<string, unknown>, Component: unknown): unknown;
46
+ };
47
+ locale: {
48
+ register(namespace: string, dict: Record<string, Record<string, string>>): () => void;
49
+ };
50
+ on(event: "theme/change", handler: (snapshot: ThemeSnapshot) => void): void;
51
+ }
52
+
53
+ /** Browser-half entry: register skins and settings rows. */
54
+ export function apply(ctx: DreamSkinCtx): void;
55
+
56
+ /** Services injected before this plugin's `apply`. */
57
+ export const inject: string[];
58
+
59
+ /** The curated skin catalog (also exported for previews/tests). */
60
+ export const SKINS: DreamSkin[];
61
+
62
+ /** Sentinel id meaning "follow the built-in appearance". */
63
+ export const DEFAULT_SKIN: "system";
64
+
65
+ /** The settings-row locale namespace. */
66
+ export const SETTINGS_NS: string;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Host-side type declarations for `dsh-dream-skin`.
3
+ *
4
+ * The host half is a no-op loader entry — see {@link apply}. All feature
5
+ * behavior lives in the browser half (`./client`).
6
+ */
7
+
8
+ /** Token-name → concrete CSS color for a registered theme (scalar per scheme). */
9
+ export interface SkinTokens {
10
+ [name: string]: string;
11
+ }
12
+
13
+ /** A curated skin: an immutable third-party theme definition. */
14
+ export interface DreamSkin {
15
+ /** Unique theme id (registered into ThemeRuntime; `"system"` is reserved). */
16
+ id: string;
17
+ /** Base palette this skin builds on; drives `body[data-ds-dark-theme]`. */
18
+ colorScheme: "light" | "dark";
19
+ /** `--dsw-alias-*` token overrides (and component-specific tokens). */
20
+ tokens: SkinTokens;
21
+ }
22
+
23
+ /**
24
+ * Host loader entry. A no-op: the patch layer (cordis.patch.yml) inserts the
25
+ * `dream-skin` row and dsh-client-modules picks up the browser half through
26
+ * the package's `dsh.client` declaration, exactly like the shipped ui-*
27
+ * packages.
28
+ */
29
+ export function apply(ctx?: unknown): void;
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "dsh-dream-skin",
3
+ "version": "0.2.0",
4
+ "description": "DeepSeek Harness 换肤插件 (Dream Skin for DeepSeek Harness): curated --dsw-alias-* theme presets, a custom translucent wallpaper with opacity/blur controls, theme-pack import/export + share links, per-user accent, favorites & surprise-me, and durable per-browser persistence — in the spirit of the Codex Dream Skin project.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "lib/index.js",
8
+ "types": "lib/types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./lib/types/index.d.ts",
12
+ "default": "./lib/index.js"
13
+ },
14
+ "./client": {
15
+ "types": "./lib/types/client/index.d.ts",
16
+ "default": "./lib/client.js"
17
+ },
18
+ "./package.json": "./package.json"
19
+ },
20
+ "files": [
21
+ "lib/index.js",
22
+ "lib/client.js",
23
+ "lib/types",
24
+ "cordis.patch.yml"
25
+ ],
26
+ "author": "dsh-dream-skin contributors",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/RevolutionLA/dsh-dream-skin.git"
30
+ },
31
+ "bugs": {
32
+ "url": "https://github.com/RevolutionLA/dsh-dream-skin/issues"
33
+ },
34
+ "homepage": "https://github.com/RevolutionLA/dsh-dream-skin#readme",
35
+ "keywords": [
36
+ "deepseek-harness",
37
+ "dsh",
38
+ "dsh-plugin",
39
+ "plugin",
40
+ "theme",
41
+ "skin",
42
+ "wallpaper",
43
+ "web-ui",
44
+ "换肤"
45
+ ],
46
+ "engines": {
47
+ "node": ">=18"
48
+ },
49
+ "scripts": {
50
+ "test": "node --test tests/client.smoke.test.cjs"
51
+ },
52
+ "dsh": {
53
+ "bundle": {
54
+ "patch": "./cordis.patch.yml"
55
+ },
56
+ "client": {
57
+ "inject": [
58
+ "@deepseek-ai/dsh-client-runtime",
59
+ "@deepseek-ai/dsh-client-locale",
60
+ "@deepseek-ai/dsh-client-ui-theme",
61
+ "@deepseek-ai/dsh-client-ui-settings",
62
+ "@deepseek-ai/dsh-client-ui-settings-general"
63
+ ],
64
+ "platform": "web",
65
+ "immediately": true
66
+ }
67
+ },
68
+ "peerDependencies": {
69
+ "react": "^18.2.0",
70
+ "@deepseek-ai/cordis": "^4.0.1",
71
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
72
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
73
+ "@deepseek-ai/dsh-client-ui-theme": "^0.1.0-rc.6",
74
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6",
75
+ "@deepseek-ai/dsh-client-ui-settings-general": "^0.1.0-rc.6",
76
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6"
77
+ }
78
+ }