dsh-style-tweaks 0.1.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.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +114 -0
  3. package/README.md +113 -0
  4. package/cordis.patch.yml +12 -0
  5. package/lib/client.js +2379 -0
  6. package/lib/client.js.map +1 -0
  7. package/lib/config.js +90 -0
  8. package/lib/config.js.map +1 -0
  9. package/lib/index.js +28 -0
  10. package/lib/index.js.map +1 -0
  11. package/lib/types/client/conversation-width.d.ts +81 -0
  12. package/lib/types/client/conversation-width.d.ts.map +1 -0
  13. package/lib/types/client/index.d.ts +104 -0
  14. package/lib/types/client/index.d.ts.map +1 -0
  15. package/lib/types/client/tweak-config.d.ts +55 -0
  16. package/lib/types/client/tweak-config.d.ts.map +1 -0
  17. package/lib/types/client/tweak-types.d.ts +32 -0
  18. package/lib/types/client/tweak-types.d.ts.map +1 -0
  19. package/lib/types/client/tweaks/code-block-flush-top.d.ts +91 -0
  20. package/lib/types/client/tweaks/code-block-flush-top.d.ts.map +1 -0
  21. package/lib/types/client/tweaks/locate-current-session.d.ts +62 -0
  22. package/lib/types/client/tweaks/locate-current-session.d.ts.map +1 -0
  23. package/lib/types/client/tweaks/project-running-indicator.d.ts +61 -0
  24. package/lib/types/client/tweaks/project-running-indicator.d.ts.map +1 -0
  25. package/lib/types/client/tweaks/registry.d.ts +22 -0
  26. package/lib/types/client/tweaks/registry.d.ts.map +1 -0
  27. package/lib/types/client/tweaks/settings-nav-scroll.d.ts +168 -0
  28. package/lib/types/client/tweaks/settings-nav-scroll.d.ts.map +1 -0
  29. package/lib/types/client/tweaks/stable-table.d.ts +3 -0
  30. package/lib/types/client/tweaks/stable-table.d.ts.map +1 -0
  31. package/lib/types/client/tweaks/stable-turn-rail.d.ts +53 -0
  32. package/lib/types/client/tweaks/stable-turn-rail.d.ts.map +1 -0
  33. package/lib/types/config.d.ts +149 -0
  34. package/lib/types/config.d.ts.map +1 -0
  35. package/lib/types/index.d.ts +19 -0
  36. package/lib/types/index.d.ts.map +1 -0
  37. package/lib/types/web.d.ts +55 -0
  38. package/lib/types/web.d.ts.map +1 -0
  39. package/lib/web.js +169 -0
  40. package/lib/web.js.map +1 -0
  41. package/package.json +111 -0
@@ -0,0 +1,19 @@
1
+ /**
2
+ * dsh-style-tweaks — server half.
3
+ *
4
+ * Registers the `style-tweaks` settings namespace so users can
5
+ * toggle conversation-view CSS tweaks either from the Settings panel or by
6
+ * editing the settings document directly (settings.yaml
7
+ * `style-tweaks:` section). All rendering work happens in the
8
+ * browser bundle (`src/client`), which reads and writes this namespace
9
+ * through the same-origin route mounted here — the Web settings RPC only
10
+ * exposes a fixed allowlist of namespaces since rc.6, so a custom route is
11
+ * the supported way for a plugin to own a configuration page.
12
+ * @module dsh-style-tweaks
13
+ */
14
+ import type { Context } from '@deepseek-ai/cordis';
15
+ export declare const name = "dsh-style-tweaks";
16
+ /** Required services: the settings seam is the whole server-side surface. */
17
+ export declare const inject: string[];
18
+ export declare function apply(ctx: Context): void;
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAOlD,eAAO,MAAM,IAAI,qBAAqB,CAAA;AAEtC,6EAA6E;AAC7E,eAAO,MAAM,MAAM,UAAsB,CAAA;AAEzC,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAUxC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * dsh-style-tweaks — optional Web routes.
3
+ *
4
+ * The browser Settings panel reads and writes the `style-tweaks`
5
+ * namespace through this same-origin route, because the Web settings RPC only
6
+ * exposes a fixed allowlist of namespaces (hardcoded in dsh-host-apiproxy
7
+ * since rc.6). The route proxies to the real `ctx.settings` service, so the
8
+ * settings document (settings.yaml) stays the single source of truth and
9
+ * hand edits keep working.
10
+ * @module dsh-style-tweaks/web
11
+ */
12
+ import type { IncomingMessage, ServerResponse } from 'node:http';
13
+ import type { Context } from '@deepseek-ai/cordis';
14
+ /** Exact route used by the browser Settings page. */
15
+ export declare const SETTINGS_ROUTE = "/_dsh/style-tweaks/settings";
16
+ /** Public Settings snapshot; no secrets exist in this namespace. */
17
+ export interface StyleTweaksSnapshot {
18
+ writable: boolean;
19
+ value: unknown;
20
+ revision: number;
21
+ }
22
+ type JsonResponse<T> = {
23
+ ok: true;
24
+ value: T;
25
+ } | {
26
+ ok: false;
27
+ error: {
28
+ code: string;
29
+ message: string;
30
+ };
31
+ };
32
+ /** Accept state-changing requests only from the DSH Web application's origin. */
33
+ export declare function sameOriginPost(req: IncomingMessage): boolean;
34
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
35
+ export declare function json<T>(res: ServerResponse, status: number, body: JsonResponse<T>): void;
36
+ export declare function requestError(res: ServerResponse, status: number, code: string, message: string): void;
37
+ export declare function readJson(req: IncomingMessage, maxBytes?: number): Promise<unknown>;
38
+ export declare function messageOf(error: unknown): string;
39
+ /** Same-origin Settings read/write handler. */
40
+ export declare class StyleTweaksWebBackend {
41
+ private readonly ctx;
42
+ constructor(ctx: Context);
43
+ private descriptor;
44
+ private snapshot;
45
+ /** Handle the exact Settings route. */
46
+ handle(req: IncomingMessage, res: ServerResponse): Promise<void>;
47
+ }
48
+ /**
49
+ * Attach the Settings route whenever a webServer service is present.
50
+ * @param ctx - plugin context owning route effects.
51
+ * @param backend - Settings handler.
52
+ */
53
+ export declare function installStyleTweaksWeb(ctx: Context, backend: StyleTweaksWebBackend): void;
54
+ export {};
55
+ //# sourceMappingURL=web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAA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AH,GAAG,EAAE,OAAO;IAEzC,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,QAAQ;IAShB,uCAAuC;IACjC,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA2CvE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAUxF"}
package/lib/web.js ADDED
@@ -0,0 +1,169 @@
1
+ /**
2
+ * dsh-style-tweaks — optional Web routes.
3
+ *
4
+ * The browser Settings panel reads and writes the `style-tweaks`
5
+ * namespace through this same-origin route, because the Web settings RPC only
6
+ * exposes a fixed allowlist of namespaces (hardcoded in dsh-host-apiproxy
7
+ * since rc.6). The route proxies to the real `ctx.settings` service, so the
8
+ * settings document (settings.yaml) stays the single source of truth and
9
+ * hand edits keep working.
10
+ * @module dsh-style-tweaks/web
11
+ */
12
+ import { SettingsConflictError } from '@deepseek-ai/dsh-settings';
13
+ import { STYLE_TWEAKS_SETTINGS_NAMESPACE } from "./config.js";
14
+ /** Exact route used by the browser Settings page. */
15
+ export const SETTINGS_ROUTE = '/_dsh/style-tweaks/settings';
16
+ /** Accept state-changing requests only from the DSH Web application's origin. */
17
+ export function sameOriginPost(req) {
18
+ const fetchSite = req.headers['sec-fetch-site'];
19
+ if (fetchSite === 'cross-site')
20
+ return false;
21
+ const origin = req.headers.origin;
22
+ if (origin === undefined)
23
+ return fetchSite === 'same-origin' || fetchSite === 'same-site' || fetchSite === 'none';
24
+ const host = req.headers.host;
25
+ if (host === undefined)
26
+ return false;
27
+ try {
28
+ const parsed = new URL(origin);
29
+ return (parsed.protocol === 'http:' || parsed.protocol === 'https:') && parsed.host === host;
30
+ }
31
+ catch {
32
+ return false;
33
+ }
34
+ }
35
+ export function isRecord(value) {
36
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
37
+ }
38
+ export function json(res, status, body) {
39
+ const bytes = Buffer.from(JSON.stringify(body));
40
+ res.setHeader('Content-Type', 'application/json; charset=utf-8');
41
+ res.setHeader('Content-Length', String(bytes.length));
42
+ res.setHeader('Cache-Control', 'no-store');
43
+ res.setHeader('X-Content-Type-Options', 'nosniff');
44
+ res.writeHead(status);
45
+ res.end(bytes);
46
+ }
47
+ export function requestError(res, status, code, message) {
48
+ json(res, status, { ok: false, error: { code, message } });
49
+ }
50
+ export async function readJson(req, maxBytes = 16 * 1024) {
51
+ const contentType = req.headers['content-type']?.split(';', 1)[0]?.trim().toLowerCase();
52
+ if (contentType !== 'application/json')
53
+ throw new TypeError('Content-Type must be application/json');
54
+ const chunks = [];
55
+ let bytes = 0;
56
+ for await (const chunk of req) {
57
+ const part = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
58
+ bytes += part.length;
59
+ if (bytes > maxBytes)
60
+ throw new RangeError(`request body exceeds ${maxBytes} bytes`);
61
+ chunks.push(part);
62
+ }
63
+ if (chunks.length === 0)
64
+ throw new TypeError('request body is empty');
65
+ return JSON.parse(Buffer.concat(chunks).toString('utf8'));
66
+ }
67
+ function parseRequest(value) {
68
+ if (!isRecord(value) || typeof value.action !== 'string')
69
+ throw new TypeError('action is required');
70
+ if (typeof value.expectedRevision !== 'number' || !Number.isSafeInteger(value.expectedRevision) || value.expectedRevision < 0) {
71
+ throw new TypeError('expectedRevision must be a non-negative integer');
72
+ }
73
+ const field = value.field;
74
+ if (typeof field !== 'string' || field.length === 0)
75
+ throw new TypeError('field must be a non-empty string');
76
+ if (value.action === 'unset') {
77
+ return { action: 'unset', field, expectedRevision: value.expectedRevision };
78
+ }
79
+ if (value.action === 'set') {
80
+ return { action: 'set', field, value: value.value, expectedRevision: value.expectedRevision };
81
+ }
82
+ throw new TypeError(`unsupported action: ${value.action}`);
83
+ }
84
+ export function messageOf(error) {
85
+ if (error instanceof Error)
86
+ return error.message;
87
+ return String(error);
88
+ }
89
+ /** Same-origin Settings read/write handler. */
90
+ export class StyleTweaksWebBackend {
91
+ ctx;
92
+ constructor(ctx) {
93
+ this.ctx = ctx;
94
+ }
95
+ descriptor() {
96
+ const row = this.ctx.settings.describe().find(candidate => candidate.ns === STYLE_TWEAKS_SETTINGS_NAMESPACE);
97
+ if (row === undefined)
98
+ throw new Error('style-tweaks settings namespace is not registered');
99
+ return row;
100
+ }
101
+ snapshot() {
102
+ const descriptor = this.descriptor();
103
+ return {
104
+ writable: this.ctx.settings.writable,
105
+ value: descriptor.value,
106
+ revision: descriptor.revision,
107
+ };
108
+ }
109
+ /** Handle the exact Settings route. */
110
+ async handle(req, res) {
111
+ if (req.method === 'GET') {
112
+ try {
113
+ json(res, 200, { ok: true, value: this.snapshot() });
114
+ }
115
+ catch (error) {
116
+ this.ctx.logger.warn('dsh-style-tweaks Settings snapshot failed: %s', messageOf(error));
117
+ requestError(res, 503, 'settings-unavailable', 'Style tweaks are unavailable');
118
+ }
119
+ return;
120
+ }
121
+ if (req.method !== 'POST') {
122
+ res.setHeader('Allow', 'GET, POST');
123
+ requestError(res, 405, 'method-not-allowed', 'Use GET or POST');
124
+ return;
125
+ }
126
+ if (!sameOriginPost(req)) {
127
+ requestError(res, 403, 'origin-rejected', 'The request must originate from this DSH Web application');
128
+ return;
129
+ }
130
+ let parsed;
131
+ try {
132
+ parsed = parseRequest(await readJson(req));
133
+ }
134
+ catch (error) {
135
+ requestError(res, error instanceof RangeError ? 413 : 400, 'invalid-request', messageOf(error));
136
+ return;
137
+ }
138
+ try {
139
+ if (parsed.action === 'set') {
140
+ await this.ctx.settings.update(STYLE_TWEAKS_SETTINGS_NAMESPACE, { [parsed.field]: parsed.value }, parsed.expectedRevision);
141
+ }
142
+ else {
143
+ await this.ctx.settings.mutate(STYLE_TWEAKS_SETTINGS_NAMESPACE, [{ op: 'unset', path: [parsed.field] }], parsed.expectedRevision);
144
+ }
145
+ json(res, 200, { ok: true, value: this.snapshot() });
146
+ }
147
+ catch (error) {
148
+ const conflict = error instanceof SettingsConflictError;
149
+ requestError(res, conflict ? 409 : 400, conflict ? 'settings-conflict' : 'settings-rejected', messageOf(error));
150
+ }
151
+ }
152
+ }
153
+ /**
154
+ * Attach the Settings route whenever a webServer service is present.
155
+ * @param ctx - plugin context owning route effects.
156
+ * @param backend - Settings handler.
157
+ */
158
+ export function installStyleTweaksWeb(ctx, backend) {
159
+ ctx.inject(['webServer'], (webCtx) => {
160
+ webCtx.effect(() => {
161
+ return webCtx.webServer.register({
162
+ kind: 'exact',
163
+ path: SETTINGS_ROUTE,
164
+ handler: (req, res) => backend.handle(req, res),
165
+ });
166
+ }, 'dsh-style-tweaks: Web routes');
167
+ });
168
+ }
169
+ //# sourceMappingURL=web.js.map
package/lib/web.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAA;AAE7D,qDAAqD;AACrD,MAAM,CAAC,MAAM,cAAc,GAAG,6BAA6B,CAAA;AA4B3D,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,GAAoB;IACjD,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAC/C,IAAI,SAAS,KAAK,YAAY;QAAE,OAAO,KAAK,CAAA;IAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAA;IACjC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,KAAK,aAAa,IAAI,SAAS,KAAK,WAAW,IAAI,SAAS,KAAK,MAAM,CAAA;IACjH,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAA;IAC7B,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,CAAA;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,C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H,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAY,EAAE,OAA8B;IAChF,GAAG,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE;QACnC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;YACjB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;gBAC/B,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;aAChD,CAAC,CAAA;QACJ,CAAC,EAAE,8BAA8B,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;AACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,111 @@
1
+ {
2
+ "name": "dsh-style-tweaks",
3
+ "version": "0.1.0",
4
+ "description": "DSH plugin: collection of opt-in style tweaks for DSH's UI — precise conversation column-width control (px stepper, presets, plugin-vs-native toggle, side margin) plus small fixes for the sidebar and the settings panel. Each setting has its own toggle in Settings.",
5
+ "keywords": [
6
+ "dsh",
7
+ "deepseek",
8
+ "deepseek-ai",
9
+ "cordis",
10
+ "plugin",
11
+ "layout",
12
+ "style",
13
+ "tweaks",
14
+ "chat-ui",
15
+ "layout",
16
+ "css",
17
+ "column-width",
18
+ "responsive"
19
+ ],
20
+ "type": "module",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/zhj9709/dsh-style-tweaks.git"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "main": "lib/index.js",
29
+ "types": "lib/types/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./lib/types/index.d.ts",
33
+ "default": "./lib/index.js"
34
+ },
35
+ "./client": {
36
+ "types": "./lib/types/client/index.d.ts",
37
+ "default": "./lib/client.js"
38
+ },
39
+ "./cordis.patch.yml": "./cordis.patch.yml",
40
+ "./package.json": "./package.json"
41
+ },
42
+ "files": [
43
+ "lib",
44
+ "cordis.patch.yml",
45
+ "README.md",
46
+ "README.en.md",
47
+ "LICENSE"
48
+ ],
49
+ "engines": {
50
+ "node": ">=20"
51
+ },
52
+ "scripts": {
53
+ "build": "tsc -p tsconfig.json && tsc -p tsconfig.client.json && node scripts/build-client.mjs",
54
+ "prepublishOnly": "pnpm build",
55
+ "prepare": "tsc -p tsconfig.json && tsc -p tsconfig.client.json && node scripts/build-client.mjs",
56
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.public.json"
57
+ },
58
+ "license": "MIT",
59
+ "dsh": {
60
+ "bundle": {
61
+ "patch": "./cordis.patch.yml"
62
+ },
63
+ "client": {
64
+ "inject": [
65
+ "@deepseek-ai/dsh-client-locale",
66
+ "@deepseek-ai/dsh-client-ui-renderer",
67
+ "@deepseek-ai/dsh-client-ui-session",
68
+ "@deepseek-ai/dsh-client-ui-settings",
69
+ "@deepseek-ai/dsh-client-ui-slots"
70
+ ],
71
+ "platform": "web"
72
+ }
73
+ },
74
+ "peerDependencies": {
75
+ "@deepseek-ai/cordis": "^4.0.2",
76
+ "@deepseek-ai/dsh-client-locale": "^0.1.2-rc.1",
77
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-rc.1",
78
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-rc.1",
79
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.2-rc.1",
80
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.2-rc.1",
81
+ "@deepseek-ai/dsh-host-webserver": "^0.1.2-rc.1",
82
+ "@deepseek-ai/dsh-settings": "^0.1.2-rc.1",
83
+ "@deepseek-ai/schemastery": "^3.18.2",
84
+ "react": "^18.2.0",
85
+ "react-dom": "^18.2.0"
86
+ },
87
+ "peerDependenciesMeta": {
88
+ "cordis": {
89
+ "optional": true
90
+ }
91
+ },
92
+ "devDependencies": {
93
+ "@deepseek-ai/cordis": "^4.0.2",
94
+ "@deepseek-ai/dsh-api-session-controller": "0.1.2-rc.1",
95
+ "@deepseek-ai/dsh-api-workspace-controller": "0.1.2-rc.1",
96
+ "@deepseek-ai/dsh-client-locale": "0.1.2-rc.1",
97
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
98
+ "@deepseek-ai/dsh-client-ui-renderer": "0.1.2-rc.1",
99
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.2-rc.1",
100
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.2-rc.1",
101
+ "@deepseek-ai/dsh-host-webserver": "0.1.2-rc.1",
102
+ "@deepseek-ai/dsh-settings": "0.1.2-rc.1",
103
+ "@deepseek-ai/schemastery": "^3.18.2",
104
+ "@types/node": "^24.0.0",
105
+ "@types/react": "~18.3.1",
106
+ "@types/react-dom": "~18.3.1",
107
+ "react": "^18.2.0",
108
+ "react-dom": "^18.2.0",
109
+ "typescript": "^5.7.0"
110
+ }
111
+ }