dsh-version-manager 0.1.0 → 0.1.1
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.md +4 -2
- package/lib/client.js +17 -15
- package/lib/host/inventory.js +4 -1
- package/lib/host/routes.js +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ From a local tarball:
|
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
npm pack
|
|
24
|
-
dsh plugin --profile <your-profile> add /absolute/path/dsh-version-manager
|
|
24
|
+
dsh plugin --profile <your-profile> add /absolute/path/dsh-version-manager-<version>.tgz
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Then restart the host and open the panel from the left sidebar.
|
|
@@ -57,6 +57,8 @@ Three states are kept apart on purpose, because collapsing them produces false c
|
|
|
57
57
|
|
|
58
58
|
**Check updates** asks the host for versions newer than the installed one. Stable and prerelease are separate lists; a prerelease requires an explicit opt-in, and a row shows whether the version is still a bundle, whether it is deprecated, and what its compatibility verdict is.
|
|
59
59
|
|
|
60
|
+
The summary line above the table counts entries the host would let this plugin write (**writable** or 可写入), not entries that have a newer version. Those are different questions: only a per-target version check can answer the second one, and the panel does not pretend to know it in advance. A writable row with nothing newer available is the normal case, not a contradiction.
|
|
61
|
+
|
|
60
62
|
**Update** always shows the from → to pair plus the four side effects before it runs:
|
|
61
63
|
|
|
62
64
|
- a snapshot is written first and read back before anything else happens;
|
|
@@ -162,7 +164,7 @@ What was exercised, and what it produced:
|
|
|
162
164
|
| Git-managed Skill: register, first apply, update A→B, restore A, hand-edit then restore | registered against an empty directory (`populated: false`), first update filled it, an update moved `8569b20 → c3d0909` with `M SKILL.md` / `A extra.md`, a restore put `8569b20` back and removed `extra.md`, a hand-edited file made the update refuse `local-modifications` while the restore still ran and left an undo snapshot holding the edited bytes |
|
|
163
165
|
| the Desktop shell | sidebar entry, panel, both tabs, confirmation bar, operation list and snapshot list all rendered and worked; a snapshot taken by clicking in the UI landed on disk |
|
|
164
166
|
|
|
165
|
-
Two defects found this way and fixed rather than documented away: a nested-but-successful host reply was being classified as a failure, and a bundled Skill could be offered a restore the plugin would refuse everywhere else. A third was cosmetic but worse than cosmetic — one local path was compared in two spellings and reported as a change that never happened. A fourth came out of the Git flow: the panel reported a freshly registered, still-empty directory as "modified, update will be refused" because the empty directory's digest never equals the commit's, while the update path allowed it — the row now reads the same refusal function the update path uses, so the two cannot drift apart again.
|
|
167
|
+
Two defects found this way and fixed rather than documented away: a nested-but-successful host reply was being classified as a failure, and a bundled Skill could be offered a restore the plugin would refuse everywhere else. A third was cosmetic but worse than cosmetic — one local path was compared in two spellings and reported as a change that never happened. A fourth came out of the Git flow: the panel reported a freshly registered, still-empty directory as "modified, update will be refused" because the empty directory's digest never equals the commit's, while the update path allowed it — the row now reads the same refusal function the update path uses, so the two cannot drift apart again. A fifth was found by installing the published package: the panel said "2 updatable" for two rows that had no newer version at all, because the number was counting rows the host would accept a write for. The field and its labels now say **writable** — what is actually measured.
|
|
166
168
|
|
|
167
169
|
Not verified: another DSH version, a Linux or macOS Desktop, and a non-bundled Skill provider.
|
|
168
170
|
|
package/lib/client.js
CHANGED
|
@@ -55,15 +55,15 @@ window.__ModuleLoader__.load({
|
|
|
55
55
|
observed: '读取时间',
|
|
56
56
|
unknown: '未知',
|
|
57
57
|
notAvailable: '不可获取',
|
|
58
|
-
counts: (total,
|
|
59
|
-
const base = `${total} 个条目,${
|
|
58
|
+
counts: (total, writable, official, unsatisfied, unknownCompat) => {
|
|
59
|
+
const base = `${total} 个条目,${writable} 个可写入,${official} 个官方内置`
|
|
60
60
|
const parts = []
|
|
61
61
|
if (unsatisfied > 0) parts.push(`${unsatisfied} 个与当前宿主版本不匹配`)
|
|
62
62
|
if (unknownCompat > 0) parts.push(`${unknownCompat} 个兼容性未能判定`)
|
|
63
63
|
return parts.length === 0 ? base : `${base},${parts.join(',')}`
|
|
64
64
|
},
|
|
65
65
|
filterAll: '全部',
|
|
66
|
-
|
|
66
|
+
filterWritable: '可写入',
|
|
67
67
|
filterReadOnly: '只读',
|
|
68
68
|
search: '按名称过滤',
|
|
69
69
|
colName: '包',
|
|
@@ -106,7 +106,7 @@ window.__ModuleLoader__.load({
|
|
|
106
106
|
prerelease: '预发布',
|
|
107
107
|
published: '发布于',
|
|
108
108
|
deprecated: '已废弃',
|
|
109
|
-
versionListRefused: '
|
|
109
|
+
versionListRefused: '宿主要求只读,不提供更新',
|
|
110
110
|
updateTo: '更新到',
|
|
111
111
|
confirmTitle: '确认这次更新',
|
|
112
112
|
confirmBody: (name, from, to) =>
|
|
@@ -304,15 +304,15 @@ window.__ModuleLoader__.load({
|
|
|
304
304
|
observed: 'Observed',
|
|
305
305
|
unknown: 'unknown',
|
|
306
306
|
notAvailable: 'not available',
|
|
307
|
-
counts: (total,
|
|
308
|
-
const base = `${total} entries, ${
|
|
307
|
+
counts: (total, writable, official, unsatisfied, unknownCompat) => {
|
|
308
|
+
const base = `${total} entries, ${writable} writable, ${official} official`
|
|
309
309
|
const parts = []
|
|
310
310
|
if (unsatisfied > 0) parts.push(`${unsatisfied} incompatible with this host`)
|
|
311
311
|
if (unknownCompat > 0) parts.push(`${unknownCompat} with undecidable compatibility`)
|
|
312
312
|
return parts.length === 0 ? base : `${base}, ${parts.join(', ')}`
|
|
313
313
|
},
|
|
314
314
|
filterAll: 'All',
|
|
315
|
-
|
|
315
|
+
filterWritable: 'Writable',
|
|
316
316
|
filterReadOnly: 'Read-only',
|
|
317
317
|
search: 'Filter by name',
|
|
318
318
|
colName: 'Package',
|
|
@@ -355,7 +355,7 @@ window.__ModuleLoader__.load({
|
|
|
355
355
|
prerelease: 'Prerelease',
|
|
356
356
|
published: 'published',
|
|
357
357
|
deprecated: 'deprecated',
|
|
358
|
-
versionListRefused: '
|
|
358
|
+
versionListRefused: 'The host keeps this entry read-only, so no update is offered',
|
|
359
359
|
updateTo: 'Update to',
|
|
360
360
|
confirmTitle: 'Confirm this update',
|
|
361
361
|
confirmBody: (name, from, to) =>
|
|
@@ -1093,7 +1093,9 @@ window.__ModuleLoader__.load({
|
|
|
1093
1093
|
}
|
|
1094
1094
|
}, [pendingRestore, row.targetId, onRefresh, t])
|
|
1095
1095
|
|
|
1096
|
-
|
|
1096
|
+
// Not "updatable": the host accepting a write says nothing about whether
|
|
1097
|
+
// a newer version exists. Only the version check answers that.
|
|
1098
|
+
const writable = row.updateRefusal === null
|
|
1097
1099
|
|
|
1098
1100
|
const summaryRow = h(
|
|
1099
1101
|
'tr',
|
|
@@ -1126,7 +1128,7 @@ window.__ModuleLoader__.load({
|
|
|
1126
1128
|
'div',
|
|
1127
1129
|
{ style: { display: 'flex', gap: 4, marginTop: 3, flexWrap: 'wrap' } },
|
|
1128
1130
|
row.official === true ? h(Badge, null, t.official) : null,
|
|
1129
|
-
|
|
1131
|
+
writable ? null : h(Badge, null, t.readOnly),
|
|
1130
1132
|
row.prerelease === true ? h(Badge, null, t.prerelease) : null,
|
|
1131
1133
|
),
|
|
1132
1134
|
),
|
|
@@ -1158,8 +1160,8 @@ window.__ModuleLoader__.load({
|
|
|
1158
1160
|
Button,
|
|
1159
1161
|
{
|
|
1160
1162
|
onClick: loadVersions,
|
|
1161
|
-
disabled: !
|
|
1162
|
-
title:
|
|
1163
|
+
disabled: !writable || versionsBusy,
|
|
1164
|
+
title: writable ? undefined : refusalLabel(row.updateRefusal, t) ?? '',
|
|
1163
1165
|
},
|
|
1164
1166
|
versionsBusy ? t.checking : t.checkVersions,
|
|
1165
1167
|
),
|
|
@@ -2062,7 +2064,7 @@ window.__ModuleLoader__.load({
|
|
|
2062
2064
|
const visible = useMemo(() => {
|
|
2063
2065
|
const needle = query.trim().toLowerCase()
|
|
2064
2066
|
return rows.filter((row) => {
|
|
2065
|
-
if (filter === '
|
|
2067
|
+
if (filter === 'writable' && row.updateRefusal !== null) return false
|
|
2066
2068
|
if (filter === 'readonly' && row.updateRefusal === null) return false
|
|
2067
2069
|
if (needle !== '' && !String(row.targetId).toLowerCase().includes(needle)) return false
|
|
2068
2070
|
return true
|
|
@@ -2107,7 +2109,7 @@ window.__ModuleLoader__.load({
|
|
|
2107
2109
|
{ role: 'group', 'aria-label': t.filterAll, style: { display: 'inline-flex', gap: 4 } },
|
|
2108
2110
|
[
|
|
2109
2111
|
['all', t.filterAll],
|
|
2110
|
-
['
|
|
2112
|
+
['writable', t.filterWritable],
|
|
2111
2113
|
['readonly', t.filterReadOnly],
|
|
2112
2114
|
].map(([key, label]) =>
|
|
2113
2115
|
h(
|
|
@@ -2142,7 +2144,7 @@ window.__ModuleLoader__.load({
|
|
|
2142
2144
|
? null
|
|
2143
2145
|
: h('span', { style: { fontSize: 12, opacity: 0.7 } }, t.counts(
|
|
2144
2146
|
state.data.counts.total,
|
|
2145
|
-
state.data.counts.
|
|
2147
|
+
state.data.counts.writable,
|
|
2146
2148
|
state.data.counts.official,
|
|
2147
2149
|
state.data.counts.unsatisfied ?? 0,
|
|
2148
2150
|
state.data.counts.unknownCompatibility ?? 0,
|
package/lib/host/inventory.js
CHANGED
|
@@ -198,7 +198,10 @@ export function buildPluginRows(input) {
|
|
|
198
198
|
reason: 'The installed package manifest has not been read yet.',
|
|
199
199
|
detail: typeof row.error === 'string' ? row.error : null,
|
|
200
200
|
},
|
|
201
|
-
|
|
201
|
+
// "Writable" is the only claim this row supports: the host would accept an
|
|
202
|
+
// update for it. Whether a newer version actually exists is a different
|
|
203
|
+
// question, answered per target by the version check and never assumed.
|
|
204
|
+
recoverability: refusal === null ? 'writable' : 'read_only',
|
|
202
205
|
updateRefusal: refusal,
|
|
203
206
|
official: row.official === true,
|
|
204
207
|
availability: row.availability ?? 'unknown',
|
package/lib/host/routes.js
CHANGED
|
@@ -228,10 +228,14 @@ export async function buildOverview(ctx) {
|
|
|
228
228
|
},
|
|
229
229
|
counts: {
|
|
230
230
|
total: rows.length,
|
|
231
|
-
|
|
231
|
+
// Named for what it measures. "Writable" means the host would accept an
|
|
232
|
+
// update for this entry; it says nothing about whether a newer version
|
|
233
|
+
// exists, which only a per-target version check can answer. Calling this
|
|
234
|
+
// "updatable" made the panel promise updates that did not exist.
|
|
235
|
+
writable: rows.filter((row) => row.updateRefusal === null).length,
|
|
232
236
|
official: rows.filter((row) => row.official).length,
|
|
233
|
-
// Three useful totals: what
|
|
234
|
-
// load, and what this plugin could not evaluate.
|
|
237
|
+
// Three useful totals: what the host would let us write, what the host
|
|
238
|
+
// would refuse to load, and what this plugin could not evaluate.
|
|
235
239
|
unsatisfied: rows.filter((row) => row.compatibility?.verdict === 'unsatisfied').length,
|
|
236
240
|
unknownCompatibility: rows.filter((row) => row.compatibility?.verdict === 'unknown').length,
|
|
237
241
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-version-manager",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Version management for DSH plugins and skills: an honest inventory of what is installed, a preview of what an update would change, a verifiable snapshot taken before the change, and a recovery path that is only offered when it can actually work.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|