@linxin666/dsh-client-ui-plugin-manager 0.3.24 → 0.4.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 CHANGED
@@ -1754,6 +1754,28 @@ function isJsonObject(value) {
1754
1754
  return typeof value === "object" && value !== null && !Array.isArray(value);
1755
1755
  }
1756
1756
  /**
1757
+ * Request init that asks a remote origin for an uncompressed body.
1758
+ *
1759
+ * The DSH host boots `@deepseek-ai/dsh-http-proxy`, whose top-level import of
1760
+ * the npm `undici` copy replaces the legacy `undici.globalDispatcher.1` slot
1761
+ * Node's built-in `fetch()` reads. That cross-major wrapper drops the
1762
+ * `content-encoding` header and automatic decompression, so a plain fetch
1763
+ * resolves to raw gzip/brotli/zstd bytes — compressed noise no JSON or text
1764
+ * consumer can read. Every host fetch that parses a remote body must request
1765
+ * identity encoding. Caller headers survive; `accept-encoding` is forced to
1766
+ * `identity` because a caller value has no decoder behind it in this host.
1767
+ * @param init - the caller's request init (signal, headers, method, ...).
1768
+ * @returns a copy with `accept-encoding: identity` merged in.
1769
+ */
1770
+ function withIdentityEncoding(init = {}) {
1771
+ const headers = new Headers(init.headers);
1772
+ headers.set("accept-encoding", "identity");
1773
+ return {
1774
+ ...init,
1775
+ headers
1776
+ };
1777
+ }
1778
+ /**
1757
1779
  * Write one JSON response. Default headers are the family defaults
1758
1780
  * (content-type and referrer-policy); caller headers are appended or
1759
1781
  * override them.
@@ -1978,7 +2000,7 @@ function captureProbe(chunk, buffer) {
1978
2000
  */
1979
2001
  async function fetchRegistryManifest(name) {
1980
2002
  const encoded = name.startsWith("@") ? name.replace("/", "%2F") : name;
1981
- const response = await fetch(`https://registry.npmjs.org/${encoded}/latest`, { signal: AbortSignal.timeout(REGISTRY_TIMEOUT_MS) });
2003
+ const response = await fetch(`https://registry.npmjs.org/${encoded}/latest`, withIdentityEncoding({ signal: AbortSignal.timeout(REGISTRY_TIMEOUT_MS) }));
1982
2004
  if (!response.ok) return void 0;
1983
2005
  const body = await response.json();
1984
2006
  if (typeof body.version !== "string") return void 0;
@@ -5,16 +5,10 @@ import type { InstallProgressItem, InstalledPluginItem, PluginControlItem, Plugi
5
5
  export interface PluginManagerTabInjected {
6
6
  /** Whether this browser has loopback authority to use the host routes. */
7
7
  isLoopback: boolean;
8
- /** Read the installed snapshot. */
8
+ /** Read the installed snapshot (the tab renders it read-only). */
9
9
  list: () => Promise<InstalledPluginItem[]>;
10
- /** Install one plugin from an npm spec or git URL. */
11
- install: (spec: string) => Promise<InstalledPluginItem>;
12
10
  /** Re-install one plugin from its recorded source. */
13
11
  update: (id: string) => Promise<InstalledPluginItem>;
14
- /** Remove one plugin. */
15
- uninstall: (id: string) => Promise<InstalledPluginItem[]>;
16
- /** Persist one user plugin's next-start enablement. */
17
- setEnabled: (id: string, enabled: boolean) => Promise<InstalledPluginItem>;
18
12
  /** Compare installed versions against their sources. */
19
13
  checkUpdates: () => Promise<PluginUpdateItem[]>;
20
14
  /** Read the current install/update progress. */
@@ -6,6 +6,7 @@
6
6
  /** Simplified Chinese copy (the key-set source of truth). */
7
7
  declare const STATIC_ZH: {
8
8
  tab: string;
9
+ manageElsewhere: string;
9
10
  loading: string;
10
11
  empty: string;
11
12
  userPlugins: string;
@@ -16,10 +17,6 @@ declare const STATIC_ZH: {
16
17
  conflictChanged: string;
17
18
  undoConflict: string;
18
19
  conflictHint: string;
19
- installPlaceholder: string;
20
- install: string;
21
- installing: string;
22
- installHint: string;
23
20
  version: string;
24
21
  latest: string;
25
22
  update: string;
@@ -29,11 +26,6 @@ declare const STATIC_ZH: {
29
26
  noUpdates: string;
30
27
  updateRequiresDsh: string;
31
28
  updateBlockedDsh: string;
32
- uninstall: string;
33
- uninstallConfirmTitle: string;
34
- uninstallConfirmBody: string;
35
- confirm: string;
36
- cancel: string;
37
29
  restartHint: string;
38
30
  failed: string;
39
31
  enabled: string;
@@ -60,17 +52,11 @@ declare const STATIC_ZH: {
60
52
  exitSafeMode: string;
61
53
  npmSource: string;
62
54
  gitSource: string;
63
- enableSwitch: string;
64
- disableSwitch: string;
65
55
  lockedRowHint: string;
66
56
  childrenHint: string;
67
57
  childrenSummary: string;
68
58
  childrenShow: string;
69
59
  childrenHide: string;
70
- repairInstallTitle: string;
71
- repairInstallSpecLabel: string;
72
- repairInstallErrorLabel: string;
73
- repairInstallAsk: string;
74
60
  repairFailureTitle: string;
75
61
  repairFailurePluginLabel: string;
76
62
  repairFailureKindLabel: string;
@@ -92,6 +78,7 @@ declare const STATIC_ZH: {
92
78
  };
93
79
  export declare const zh: {
94
80
  tab: string;
81
+ manageElsewhere: string;
95
82
  loading: string;
96
83
  empty: string;
97
84
  userPlugins: string;
@@ -102,10 +89,6 @@ export declare const zh: {
102
89
  conflictChanged: string;
103
90
  undoConflict: string;
104
91
  conflictHint: string;
105
- installPlaceholder: string;
106
- install: string;
107
- installing: string;
108
- installHint: string;
109
92
  version: string;
110
93
  latest: string;
111
94
  update: string;
@@ -115,11 +98,6 @@ export declare const zh: {
115
98
  noUpdates: string;
116
99
  updateRequiresDsh: string;
117
100
  updateBlockedDsh: string;
118
- uninstall: string;
119
- uninstallConfirmTitle: string;
120
- uninstallConfirmBody: string;
121
- confirm: string;
122
- cancel: string;
123
101
  restartHint: string;
124
102
  failed: string;
125
103
  enabled: string;
@@ -146,17 +124,11 @@ export declare const zh: {
146
124
  exitSafeMode: string;
147
125
  npmSource: string;
148
126
  gitSource: string;
149
- enableSwitch: string;
150
- disableSwitch: string;
151
127
  lockedRowHint: string;
152
128
  childrenHint: string;
153
129
  childrenSummary: string;
154
130
  childrenShow: string;
155
131
  childrenHide: string;
156
- repairInstallTitle: string;
157
- repairInstallSpecLabel: string;
158
- repairInstallErrorLabel: string;
159
- repairInstallAsk: string;
160
132
  repairFailureTitle: string;
161
133
  repairFailurePluginLabel: string;
162
134
  repairFailureKindLabel: string;
@@ -178,6 +150,7 @@ export declare const zh: {
178
150
  };
179
151
  export declare const en: {
180
152
  tab: string;
153
+ manageElsewhere: string;
181
154
  loading: string;
182
155
  empty: string;
183
156
  userPlugins: string;
@@ -188,10 +161,6 @@ export declare const en: {
188
161
  conflictChanged: string;
189
162
  undoConflict: string;
190
163
  conflictHint: string;
191
- installPlaceholder: string;
192
- install: string;
193
- installing: string;
194
- installHint: string;
195
164
  version: string;
196
165
  latest: string;
197
166
  update: string;
@@ -201,11 +170,6 @@ export declare const en: {
201
170
  noUpdates: string;
202
171
  updateRequiresDsh: string;
203
172
  updateBlockedDsh: string;
204
- uninstall: string;
205
- uninstallConfirmTitle: string;
206
- uninstallConfirmBody: string;
207
- confirm: string;
208
- cancel: string;
209
173
  restartHint: string;
210
174
  failed: string;
211
175
  enabled: string;
@@ -232,17 +196,11 @@ export declare const en: {
232
196
  exitSafeMode: string;
233
197
  npmSource: string;
234
198
  gitSource: string;
235
- enableSwitch: string;
236
- disableSwitch: string;
237
199
  lockedRowHint: string;
238
200
  childrenHint: string;
239
201
  childrenSummary: string;
240
202
  childrenShow: string;
241
203
  childrenHide: string;
242
- repairInstallTitle: string;
243
- repairInstallSpecLabel: string;
244
- repairInstallErrorLabel: string;
245
- repairInstallAsk: string;
246
204
  repairFailureTitle: string;
247
205
  repairFailurePluginLabel: string;
248
206
  repairFailureKindLabel: string;
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Repair-conversation seed text. Two failure surfaces hand off to the agent
3
- * through the same shape: a failed install (target spec + install error) and
4
- * a recorded boot failure (the failure-ring row). The seeded message must be
2
+ * Repair-conversation seed text. The failure surfaces this package still owns
3
+ * hand off to the agent through the same shape: a recorded boot failure (the
4
+ * failure-ring row) and an install-conflict change. The seeded message must be
5
5
  * self-contained — the repair session's workspace is the plugin install root,
6
6
  * so the agent's file tools reach the plugin code without leaving the
7
7
  * workspace boundary.
@@ -16,10 +16,6 @@ import type { PluginFailureItem } from './protocol.ts';
16
16
  import type { LayerState } from './patch-diff.ts';
17
17
  /** Localized fragments the builders assemble. */
18
18
  export interface RepairCopy {
19
- installTitle: string;
20
- installSpecLabel: string;
21
- installErrorLabel: string;
22
- installAsk: string;
23
19
  failureTitle: string;
24
20
  failurePluginLabel: string;
25
21
  failureKindLabel: string;
@@ -39,15 +35,6 @@ export interface RepairCopy {
39
35
  }
40
36
  /** Default copy (zh): the package's zh dictionary keys map onto these strings. */
41
37
  export declare const DEFAULT_REPAIR_COPY: RepairCopy;
42
- /**
43
- * Seed text for a failed install: the target and the rendered error,
44
- * self-contained for the agent.
45
- * @param spec - the install target (npm spec or git URL) that failed.
46
- * @param error - the rendered install error text.
47
- * @param copy - localized fragments.
48
- * @returns the repair prompt text.
49
- */
50
- export declare function installRepairMessage(spec: string, error: string, copy?: RepairCopy): string;
51
38
  /**
52
39
  * Seed text for one boot-failure ring row: the failure record, so the agent
53
40
  * can attribute and fix it in place.
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * Shared JSON body/response helpers for the host route families: one strict
3
3
  * bounded body reader, one lenient bounded body reader, one JSON object
4
- * narrow, and one JSON writer. Previously these were copy-pasted across the
4
+ * narrow, one JSON writer, and the outbound request-init helper that keeps a
5
+ * host fetch body decodable (withIdentityEncoding). Previously the readers
6
+ * were copy-pasted across the
5
7
  * package route files (routes.ts, update-routes.ts, mobile-api.ts, and each
6
8
  * family's route module) with drifting contracts: body caps ranging 4 KiB to
7
9
  * 1 MiB and four distinct overflow behaviors (reject, undefined, null, throw).
@@ -34,6 +36,21 @@ export declare function readJsonBody(req: IncomingMessage, opts?: {
34
36
  }): Promise<unknown | null>;
35
37
  /** Narrow a value to a JSON object, or undefined when it is not one. */
36
38
  export declare function asJsonObject(value: unknown): Record<string, unknown> | undefined;
39
+ /**
40
+ * Request init that asks a remote origin for an uncompressed body.
41
+ *
42
+ * The DSH host boots `@deepseek-ai/dsh-http-proxy`, whose top-level import of
43
+ * the npm `undici` copy replaces the legacy `undici.globalDispatcher.1` slot
44
+ * Node's built-in `fetch()` reads. That cross-major wrapper drops the
45
+ * `content-encoding` header and automatic decompression, so a plain fetch
46
+ * resolves to raw gzip/brotli/zstd bytes — compressed noise no JSON or text
47
+ * consumer can read. Every host fetch that parses a remote body must request
48
+ * identity encoding. Caller headers survive; `accept-encoding` is forced to
49
+ * `identity` because a caller value has no decoder behind it in this host.
50
+ * @param init - the caller's request init (signal, headers, method, ...).
51
+ * @returns a copy with `accept-encoding: identity` merged in.
52
+ */
53
+ export declare function withIdentityEncoding(init?: RequestInit): RequestInit;
37
54
  /**
38
55
  * Write one JSON response. Default headers are the family defaults
39
56
  * (content-type and referrer-policy); caller headers are appended or
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-client-ui-plugin-manager",
3
3
  "description": "Plugin manager tab for the dsh web GUI Plugins settings section: installs plugins from npm or git through the official host channels, lists installed plugins with next-start enablement switches, surfaces install-time conflict actions with undo, and hands failures off to repair conversations.",
4
- "version": "0.3.24",
4
+ "version": "0.4.0",
5
+ "icon": "icon.svg",
5
6
  "type": "module",
6
7
  "main": "lib/index.js",
7
8
  "types": "lib/types/index.d.ts",
@@ -19,7 +20,7 @@
19
20
  },
20
21
  "dsh": {
21
22
  "engines": {
22
- "dsh": ">=0.1.5-rc.1"
23
+ "dsh": ">=0.1.7-rc.1"
23
24
  },
24
25
  "bundle": {
25
26
  "patch": "./cordis.patch.yml"
@@ -30,25 +31,28 @@
30
31
  "@deepseek-ai/dsh-api-workspace-controller",
31
32
  "@deepseek-ai/dsh-client-connection",
32
33
  "@deepseek-ai/dsh-client-ui-renderer",
33
- "@deepseek-ai/dsh-client-ui-settings"
34
+ "@deepseek-ai/dsh-client-ui-settings",
35
+ "@deepseek-ai/dsh-client-ui-workspace"
34
36
  ],
35
37
  "platform": "web"
36
38
  }
37
39
  },
38
40
  "peerDependencies": {
41
+ "@deepseek-ai/dsh": ">=0.1.7-rc.1",
39
42
  "react": "^18.2.0"
40
43
  },
41
44
  "devDependencies": {
42
- "@deepseek-ai/cordis": "^4.0.2",
43
- "@deepseek-ai/dsh-api-session-controller": "^0.1.5-rc.1",
44
- "@deepseek-ai/dsh-api-workspace-controller": "^0.1.5-rc.1",
45
- "@deepseek-ai/dsh-client-connection": "^0.1.5-rc.1",
46
- "@deepseek-ai/dsh-client-locale": "^0.1.5-rc.1",
47
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-rc.1",
48
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-rc.1",
49
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.5-rc.1",
50
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.1",
51
- "@deepseek-ai/dsh-host-webserver": "^0.1.5-rc.1",
45
+ "@deepseek-ai/cordis": "^4.0.4",
46
+ "@deepseek-ai/dsh-api-session-controller": "^0.1.7-rc.1",
47
+ "@deepseek-ai/dsh-api-workspace-controller": "^0.1.7-rc.1",
48
+ "@deepseek-ai/dsh-client-connection": "^0.1.7-rc.1",
49
+ "@deepseek-ai/dsh-client-locale": "^0.1.7-rc.1",
50
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.1",
51
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-rc.1",
52
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.7-rc.1",
53
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.1",
54
+ "@deepseek-ai/dsh-client-ui-workspace": "^0.1.7-rc.1",
55
+ "@deepseek-ai/dsh-host-webserver": "^0.1.7-rc.1",
52
56
  "@testing-library/react": "^16.1.0",
53
57
  "@types/node": "^22.20.0",
54
58
  "@types/react": "~18.3.1",
@@ -65,7 +69,8 @@
65
69
  "cordis.patch.yml",
66
70
  "README.md",
67
71
  "README.zh.md",
68
- "README.i18n.yaml"
72
+ "README.i18n.yaml",
73
+ "icon.svg"
69
74
  ],
70
75
  "license": "BSD-3-Clause",
71
76
  "dependencies": {