@linxin666/dsh-client-ui-plugin-manager 0.4.6 → 0.4.8
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.i18n.yaml +2 -2
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/lib/client.js +76 -35
- package/lib/client.js.map +1 -1
- package/lib/index.js +859 -123
- package/lib/types/client/PluginUpdatePatch.d.ts +25 -0
- package/lib/types/client/locales.d.ts +3 -0
- package/lib/types/client/telemetry.d.ts +14 -2
- package/lib/types/core/protocol.d.ts +5 -3
- package/lib/types/core/version.d.ts +20 -22
- package/lib/types/host/dsh-compat.d.ts +47 -0
- package/lib/types/host/gateway.d.ts +283 -6
- package/lib/types/host/loopback.d.ts +20 -1
- package/lib/types/host/restart.d.ts +23 -0
- package/lib/types/host/rows.d.ts +83 -0
- package/lib/types/host/state.d.ts +10 -6
- package/package.json +17 -15
package/lib/types/host/rows.d.ts
CHANGED
|
@@ -72,6 +72,23 @@ export declare function findBareRow(root: YAMLSeq, id: string): {
|
|
|
72
72
|
* @returns the claimed insert ids, in order.
|
|
73
73
|
*/
|
|
74
74
|
export declare function claimedIdsOf(patchText: string): string[];
|
|
75
|
+
/**
|
|
76
|
+
* Every entry id a layer declares: its top-level `- id:` rows (bare override
|
|
77
|
+
* rows and config rows alike) plus the entries of its `- insert:` lists. Ids
|
|
78
|
+
* nested inside a row's own `config:` are composition children of that entry,
|
|
79
|
+
* not layer entries, and are not declared here.
|
|
80
|
+
*
|
|
81
|
+
* This answers "does this layer still declare that row?" without composing, so
|
|
82
|
+
* it stays true in the states where a composition probe is not: a host that
|
|
83
|
+
* composes mid-upgrade, or while a bundle's package is being replaced, drops
|
|
84
|
+
* rows whose layers still exist.
|
|
85
|
+
* @param patchText - a patch layer's text.
|
|
86
|
+
* @param filename - absolute path (diagnostics only).
|
|
87
|
+
* @returns the declared ids, in file order, without duplicates.
|
|
88
|
+
* @throws when the layer does not parse; a caller must then treat this layer's
|
|
89
|
+
* declarations as unknown rather than empty.
|
|
90
|
+
*/
|
|
91
|
+
export declare function declaredRowIds(patchText: string, filename: string): string[];
|
|
75
92
|
/** One insert entry of a bundle patch: the claimed id and the plugin package name. */
|
|
76
93
|
export interface InsertRow {
|
|
77
94
|
id?: string;
|
|
@@ -120,3 +137,69 @@ export declare function findInsertRow(root: YAMLSeq, id: string): YAMLMap | unde
|
|
|
120
137
|
* @returns the new file text.
|
|
121
138
|
*/
|
|
122
139
|
export declare function setRowEnabled(text: string, filename: string, id: string, name: string, enabled: boolean, baseEnabled?: boolean): string;
|
|
140
|
+
/**
|
|
141
|
+
* The entry id of an enablement override row this package owns, when the item
|
|
142
|
+
* is one: a bare row carrying a string `id`, a boolean `disabled`, and no
|
|
143
|
+
* other key. Anything else is somebody else's row — a config row carrying
|
|
144
|
+
* options, a row with an unknown shape, an insert wrapper — and the manager
|
|
145
|
+
* never edits or removes it.
|
|
146
|
+
* @param item - one top-level patch item.
|
|
147
|
+
* @returns the override's entry id, or undefined when the item is not ours.
|
|
148
|
+
*/
|
|
149
|
+
export declare function overrideRowId(item: unknown): string | undefined;
|
|
150
|
+
/** The rewritten patch text and the entry ids that were dropped. */
|
|
151
|
+
export interface PrunedOverrides {
|
|
152
|
+
/** The new file text; the original text when nothing was pruned. */
|
|
153
|
+
readonly text: string;
|
|
154
|
+
/** The pruned entry ids, in file order. */
|
|
155
|
+
readonly pruned: string[];
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Drop this package's own enablement overrides whose entry id the composed
|
|
159
|
+
* profile no longer carries — a retired row leaves a stale override behind,
|
|
160
|
+
* which the loader reports on every boot as `patch: entry "<id>" not found`.
|
|
161
|
+
* The prunable set is decided by the caller from the composed entry ids: an
|
|
162
|
+
* id the composition does not carry has no row left to override. Only rows
|
|
163
|
+
* {@link overrideRowId} recognizes are removed, comments and every other row
|
|
164
|
+
* are kept, and an already-pruned file returns its input text unchanged so the
|
|
165
|
+
* caller can skip the write entirely.
|
|
166
|
+
* @param text - current patch file text.
|
|
167
|
+
* @param filename - absolute path (diagnostics only).
|
|
168
|
+
* @param composedIds - the entry ids the composed profile carries.
|
|
169
|
+
* @returns the rewritten text and the pruned ids.
|
|
170
|
+
*/
|
|
171
|
+
export declare function pruneOrphanRowOverrides(text: string, filename: string, composedIds: ReadonlySet<string>): PrunedOverrides;
|
|
172
|
+
/** The live entry names by id, and the rows this manager repaired. */
|
|
173
|
+
export interface RepairedRowNames {
|
|
174
|
+
/** The new file text; the original text when nothing was repaired. */
|
|
175
|
+
readonly text: string;
|
|
176
|
+
/** The repaired rows, in file order. */
|
|
177
|
+
readonly repaired: Array<{
|
|
178
|
+
id: string;
|
|
179
|
+
from: string;
|
|
180
|
+
to: string;
|
|
181
|
+
}>;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Point the profile's own rows at the packages that now carry those entry ids.
|
|
185
|
+
*
|
|
186
|
+
* The include patch semantics skip a row whose `name` does not match the name
|
|
187
|
+
* of the row a bundle inserted under that id, and the skip takes the whole row
|
|
188
|
+
* with it: a config row stops configuring anything and a `disabled` override
|
|
189
|
+
* stops disabling anything, both without a word in the browser. A package that
|
|
190
|
+
* changes its name — the aggregate's family rows moved from the
|
|
191
|
+
* `@linxin666/dsh-web-all/<family>` subpath to the real package in issue
|
|
192
|
+
* #1901 — therefore leaves every profile row that named it dead.
|
|
193
|
+
*
|
|
194
|
+
* The live names come from the installed bundles' own patch files, which is
|
|
195
|
+
* where the loader takes the row it inserts, so a repaired row names exactly
|
|
196
|
+
* the package the loader mounts under that id. A row whose id no bundle claims
|
|
197
|
+
* is left alone: its package may still be carried by a layer this manager
|
|
198
|
+
* cannot see, and a name it cannot prove is a name it must not write.
|
|
199
|
+
*
|
|
200
|
+
* @param text - current patch file text.
|
|
201
|
+
* @param filename - absolute path (diagnostics only).
|
|
202
|
+
* @param liveNames - the live entry names, by entry id.
|
|
203
|
+
* @returns the rewritten text and the repaired rows.
|
|
204
|
+
*/
|
|
205
|
+
export declare function repairStaleRowNames(text: string, filename: string, liveNames: ReadonlyMap<string, string>): RepairedRowNames;
|
|
@@ -10,12 +10,16 @@ import type { LayerSnapshot } from '../core/patch-diff.ts';
|
|
|
10
10
|
import { type ProfileFacts } from './profile.ts';
|
|
11
11
|
/**
|
|
12
12
|
* Entry rows that must never carry a disabled override: the manager tab
|
|
13
|
-
* itself (the UI performing the write)
|
|
14
|
-
* injects into
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `ui-
|
|
13
|
+
* itself (the UI performing the write) and the family settings surface the
|
|
14
|
+
* tab injects into. Covers both the standalone and the aggregate row ids. The
|
|
15
|
+
* standalone id is this package's own `cordis.patch.yml` insert id, never the
|
|
16
|
+
* official `ui-plugin-manager` row the DSH web-app bundle already claims.
|
|
17
|
+
*
|
|
18
|
+
* `web-ui-compat` is deliberately NOT locked (issue #1901). It used to be:
|
|
19
|
+
* the compat row carried the inlined browser half of every family, so
|
|
20
|
+
* disabling it blanked the whole page while the host rows kept running. Family
|
|
21
|
+
* rows mount their own packages now, and the compat row is the optional
|
|
22
|
+
* compatibility patch layer the issue asks users to be able to turn off.
|
|
19
23
|
*/
|
|
20
24
|
export declare const LOCKED_ENTRY_IDS: ReadonlySet<string>;
|
|
21
25
|
/** The listing result: plugin rows plus the raw layer snapshot for diffs. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxin666/dsh-client-ui-plugin-manager",
|
|
3
3
|
"description": "Update checking for the dsh web GUI's official Plugins page: compares installed plugins against the version their registry source serves, gates the update on the DSH runtime minimum the release declares, and drives the update through the official installer channel or this package's loopback CLI gateway.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.8",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dsh": {
|
|
22
22
|
"engines": {
|
|
23
|
-
"dsh": ">=0.2.
|
|
23
|
+
"dsh": ">=0.2.1-rc.2"
|
|
24
24
|
},
|
|
25
25
|
"bundle": {
|
|
26
26
|
"patch": "./cordis.patch.yml"
|
|
@@ -34,25 +34,26 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@deepseek-ai/dsh": ">=0.2.
|
|
37
|
+
"@deepseek-ai/dsh": ">=0.2.1-rc.2",
|
|
38
38
|
"react": "^18.2.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
42
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.2.
|
|
43
|
-
"@deepseek-ai/dsh-api-workspace-controller": "^0.2.
|
|
44
|
-
"@deepseek-ai/dsh-client-connection": "^0.2.
|
|
45
|
-
"@deepseek-ai/dsh-client-locale": "^0.2.
|
|
46
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.2.
|
|
47
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.
|
|
48
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.2.
|
|
49
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.2.
|
|
50
|
-
"@deepseek-ai/dsh-client-ui-workspace": "^0.2.
|
|
51
|
-
"@deepseek-ai/dsh-host-webserver": "^0.2.
|
|
41
|
+
"@deepseek-ai/cordis": "^4.0.5",
|
|
42
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.2.1-rc.2",
|
|
43
|
+
"@deepseek-ai/dsh-api-workspace-controller": "^0.2.1-rc.2",
|
|
44
|
+
"@deepseek-ai/dsh-client-connection": "^0.2.1-rc.2",
|
|
45
|
+
"@deepseek-ai/dsh-client-locale": "^0.2.1-rc.2",
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.2.1-rc.2",
|
|
47
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.1-rc.2",
|
|
48
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.2.1-rc.2",
|
|
49
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.2.1-rc.2",
|
|
50
|
+
"@deepseek-ai/dsh-client-ui-workspace": "^0.2.1-rc.2",
|
|
51
|
+
"@deepseek-ai/dsh-host-webserver": "^0.2.1-rc.2",
|
|
52
52
|
"@testing-library/react": "^16.1.0",
|
|
53
53
|
"@types/node": "^22.20.0",
|
|
54
54
|
"@types/react": "~18.3.1",
|
|
55
55
|
"@types/react-dom": "^18.3.5",
|
|
56
|
+
"@types/semver": "^7.8.0",
|
|
56
57
|
"jsdom": "^26.0.0",
|
|
57
58
|
"react": "^18.3.1",
|
|
58
59
|
"react-dom": "^18.3.1",
|
|
@@ -73,12 +74,13 @@
|
|
|
73
74
|
],
|
|
74
75
|
"license": "BSD-3-Clause",
|
|
75
76
|
"dependencies": {
|
|
77
|
+
"semver": "^7.8.5",
|
|
76
78
|
"yaml": "^2.8.2"
|
|
77
79
|
},
|
|
78
80
|
"scripts": {
|
|
79
81
|
"build": "tsc -b tsconfig.build.json && tsdown",
|
|
80
82
|
"watch": "tsdown --watch",
|
|
81
83
|
"test": "vitest run",
|
|
82
|
-
"typecheck": "
|
|
84
|
+
"typecheck": "tsgo --noEmit"
|
|
83
85
|
}
|
|
84
86
|
}
|