dsh-plugin-shop 0.8.1 → 0.8.2
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 +6 -5
- package/lib/client.js +455 -197
- package/lib/index.js +712 -164
- package/lib/typert.host.js +38 -25
- package/lib/typert.remote-client.js +23 -18
- package/lib/types/client/ShopTab.d.ts +4 -0
- package/lib/types/client/locales.d.ts +20 -2
- package/lib/types/client/present.d.ts +60 -9
- package/lib/types/client/useFlows.d.ts +66 -0
- package/lib/types/client/useInstall.d.ts +17 -27
- package/lib/types/client/useUninstall.d.ts +24 -17
- package/lib/types/client/useUpdateSelf.d.ts +1 -1
- package/lib/types/host/activation.d.ts +55 -0
- package/lib/types/host/client-half.d.ts +28 -0
- package/lib/types/host/dsh-cli.d.ts +11 -0
- package/lib/types/host/executor.d.ts +18 -5
- package/lib/types/host/hot.d.ts +16 -5
- package/lib/types/host/index.d.ts +111 -16
- package/lib/types/host/peers.d.ts +5 -3
- package/lib/types/host/prefetch.d.ts +67 -0
- package/lib/types/shared/install-state.d.ts +16 -0
- package/package.json +1 -1
package/lib/typert.host.js
CHANGED
|
@@ -76,6 +76,7 @@ const dsh_plugin_shop_shop_installStart_parameter_0$schema = z.object({
|
|
|
76
76
|
const dsh_plugin_shop_shop_installStart_result$schema = z.union([z.object({
|
|
77
77
|
'ok': z.literal(true),
|
|
78
78
|
'installId': z.string(),
|
|
79
|
+
'state': z.union([z.literal("downloading"), z.literal("running"), z.literal("done"), z.literal("failed")]),
|
|
79
80
|
}), z.object({
|
|
80
81
|
'ok': z.literal(false),
|
|
81
82
|
'code': z.union([z.literal("not-in-catalog"), z.literal("denied"), z.literal("version-mismatch"), z.literal("needs-acknowledgement"), z.literal("tarball-integrity"), z.literal("ambiguous-identity"), z.literal("name-taken")]),
|
|
@@ -86,10 +87,10 @@ const dsh_plugin_shop_shop_installStatus_parameter_0$schema = z.object({
|
|
|
86
87
|
})
|
|
87
88
|
const dsh_plugin_shop_shop_installStatus_result$schema = z.object({
|
|
88
89
|
'found': z.boolean(),
|
|
89
|
-
'state': z.union([z.literal("running"), z.literal("done"), z.literal("failed")]),
|
|
90
|
+
'state': z.union([z.literal("downloading"), z.literal("running"), z.literal("done"), z.literal("failed")]),
|
|
90
91
|
'log': z.array(z.string()),
|
|
91
|
-
'
|
|
92
|
-
'restartReason': z.union([z.undefined(), z.literal("no-patch"), z.literal("not-simple"), z.literal("host-unsupported"), z.literal("timeout"), z.literal("mount-failed")]).optional(),
|
|
92
|
+
'activation': z.union([z.undefined(), z.literal("live"), z.literal("reload"), z.literal("restart")]).optional(),
|
|
93
|
+
'restartReason': z.union([z.undefined(), z.literal("no-patch"), z.literal("not-simple"), z.literal("host-unsupported"), z.literal("timeout"), z.literal("mount-failed"), z.literal("client-half")]).optional(),
|
|
93
94
|
'detail': z.union([z.undefined(), z.string()]).optional(),
|
|
94
95
|
})
|
|
95
96
|
const dsh_plugin_shop_shop_restart_result$schema = z.union([z.object({
|
|
@@ -102,10 +103,13 @@ const dsh_plugin_shop_shop_setEnabled_parameter_0$schema = z.object({
|
|
|
102
103
|
'name': z.string(),
|
|
103
104
|
'enabled': z.boolean(),
|
|
104
105
|
})
|
|
105
|
-
const dsh_plugin_shop_shop_setEnabled_result$schema = z.object({
|
|
106
|
-
'ok': z.
|
|
107
|
-
'
|
|
108
|
-
})
|
|
106
|
+
const dsh_plugin_shop_shop_setEnabled_result$schema = z.union([z.object({
|
|
107
|
+
'ok': z.literal(true),
|
|
108
|
+
'activation': z.union([z.literal("live"), z.literal("reload"), z.literal("restart")]),
|
|
109
|
+
}), z.object({
|
|
110
|
+
'ok': z.literal(false),
|
|
111
|
+
'detail': z.string(),
|
|
112
|
+
})])
|
|
109
113
|
const dsh_plugin_shop_shop_uninstallStart_parameter_0$schema = z.object({
|
|
110
114
|
'name': z.string(),
|
|
111
115
|
})
|
|
@@ -122,6 +126,7 @@ const dsh_plugin_shop_shop_updateStart_parameter_0$schema = z.object({
|
|
|
122
126
|
const dsh_plugin_shop_shop_updateStart_result$schema = z.union([z.object({
|
|
123
127
|
'ok': z.literal(true),
|
|
124
128
|
'installId': z.string(),
|
|
129
|
+
'state': z.union([z.literal("downloading"), z.literal("running"), z.literal("done"), z.literal("failed")]),
|
|
125
130
|
}), z.object({
|
|
126
131
|
'ok': z.literal(false),
|
|
127
132
|
'detail': z.string(),
|
|
@@ -130,7 +135,7 @@ const dsh_plugin_shop_shop_version_result$schema = z.object({
|
|
|
130
135
|
'installed': z.string(),
|
|
131
136
|
'latest': z.union([z.literal(null), z.string()]),
|
|
132
137
|
'outdated': z.boolean(),
|
|
133
|
-
'
|
|
138
|
+
'restartBlocked': z.union([z.literal(null), z.literal("windows"), z.literal("systemd"), z.literal("port-zero")]),
|
|
134
139
|
})
|
|
135
140
|
|
|
136
141
|
export const TYPERT = {
|
|
@@ -163,7 +168,7 @@ export const TYPERT = {
|
|
|
163
168
|
typeSymbol: 'dsh-plugin-shop/types#ShopCatalogResult',
|
|
164
169
|
schema: dsh_plugin_shop_shop_catalog_result$schema,
|
|
165
170
|
},
|
|
166
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
171
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":867,"column":9},
|
|
167
172
|
},
|
|
168
173
|
{
|
|
169
174
|
id: 'dsh-plugin-shop#shop/installed',
|
|
@@ -178,7 +183,7 @@ export const TYPERT = {
|
|
|
178
183
|
typeSymbol: 'dsh-plugin-shop#shop/installed:result',
|
|
179
184
|
schema: dsh_plugin_shop_shop_installed_result$schema,
|
|
180
185
|
},
|
|
181
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
186
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1140,"column":9},
|
|
182
187
|
},
|
|
183
188
|
{
|
|
184
189
|
id: 'dsh-plugin-shop#shop/installedSpecs',
|
|
@@ -193,7 +198,7 @@ export const TYPERT = {
|
|
|
193
198
|
typeSymbol: 'dsh-plugin-shop#shop/installedSpecs:result',
|
|
194
199
|
schema: dsh_plugin_shop_shop_installedSpecs_result$schema,
|
|
195
200
|
},
|
|
196
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
201
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1131,"column":9},
|
|
197
202
|
},
|
|
198
203
|
{
|
|
199
204
|
id: 'dsh-plugin-shop#shop/installStart',
|
|
@@ -219,7 +224,7 @@ export const TYPERT = {
|
|
|
219
224
|
typeSymbol: 'dsh-plugin-shop/types#ShopInstallResult',
|
|
220
225
|
schema: dsh_plugin_shop_shop_installStart_result$schema,
|
|
221
226
|
},
|
|
222
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
227
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":915,"column":9},
|
|
223
228
|
},
|
|
224
229
|
{
|
|
225
230
|
id: 'dsh-plugin-shop#shop/installStatus',
|
|
@@ -244,7 +249,7 @@ export const TYPERT = {
|
|
|
244
249
|
typeSymbol: 'dsh-plugin-shop/types#ShopInstallStatusResult',
|
|
245
250
|
schema: dsh_plugin_shop_shop_installStatus_result$schema,
|
|
246
251
|
},
|
|
247
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
252
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1107,"column":3},
|
|
248
253
|
},
|
|
249
254
|
{
|
|
250
255
|
id: 'dsh-plugin-shop#shop/restart',
|
|
@@ -259,7 +264,7 @@ export const TYPERT = {
|
|
|
259
264
|
typeSymbol: 'dsh-plugin-shop/types#ShopRestartResult',
|
|
260
265
|
schema: dsh_plugin_shop_shop_restart_result$schema,
|
|
261
266
|
},
|
|
262
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
267
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1311,"column":9},
|
|
263
268
|
},
|
|
264
269
|
{
|
|
265
270
|
id: 'dsh-plugin-shop#shop/setEnabled',
|
|
@@ -284,7 +289,7 @@ export const TYPERT = {
|
|
|
284
289
|
typeSymbol: 'dsh-plugin-shop/types#ShopSetEnabledResult',
|
|
285
290
|
schema: dsh_plugin_shop_shop_setEnabled_result$schema,
|
|
286
291
|
},
|
|
287
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
292
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":692,"column":9},
|
|
288
293
|
},
|
|
289
294
|
{
|
|
290
295
|
id: 'dsh-plugin-shop#shop/uninstallStart',
|
|
@@ -310,7 +315,7 @@ export const TYPERT = {
|
|
|
310
315
|
typeSymbol: 'dsh-plugin-shop/types#ShopUninstallResult',
|
|
311
316
|
schema: dsh_plugin_shop_shop_uninstallStart_result$schema,
|
|
312
317
|
},
|
|
313
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
318
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1233,"column":9},
|
|
314
319
|
},
|
|
315
320
|
{
|
|
316
321
|
id: 'dsh-plugin-shop#shop/updateStart',
|
|
@@ -335,7 +340,7 @@ export const TYPERT = {
|
|
|
335
340
|
typeSymbol: 'dsh-plugin-shop/types#ShopUpdateResult',
|
|
336
341
|
schema: dsh_plugin_shop_shop_updateStart_result$schema,
|
|
337
342
|
},
|
|
338
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
343
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1379,"column":9},
|
|
339
344
|
},
|
|
340
345
|
{
|
|
341
346
|
id: 'dsh-plugin-shop#shop/version',
|
|
@@ -350,7 +355,7 @@ export const TYPERT = {
|
|
|
350
355
|
typeSymbol: 'dsh-plugin-shop/types#ShopVersionResult',
|
|
351
356
|
schema: dsh_plugin_shop_shop_version_result$schema,
|
|
352
357
|
},
|
|
353
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
358
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1363,"column":9},
|
|
354
359
|
},
|
|
355
360
|
],
|
|
356
361
|
model: {
|
|
@@ -441,6 +446,10 @@ export const TYPERT = {
|
|
|
441
446
|
}
|
|
442
447
|
],
|
|
443
448
|
"types": [
|
|
449
|
+
{
|
|
450
|
+
"name": "Activation",
|
|
451
|
+
"declaration": "export type Activation = 'live' | 'reload' | 'restart';"
|
|
452
|
+
},
|
|
444
453
|
{
|
|
445
454
|
"name": "CatalogEntry",
|
|
446
455
|
"declaration": "export interface CatalogEntry {\n name: string;\n version: string;\n integrity: string | null;\n publishedAt: string | null;\n repository: string | null;\n license: string | null;\n tier: 'verified' | 'verified-stale' | 'community';\n metadata: 'declared' | 'derived';\n review?: { reviewedVersion?: string; reviewedCommit?: string; reviewedSha256?: string; reviewer: string; reviewCommit: string; notes: string; };\n catalog?: CatalogSection;\n source: 'npm' | 'github';\n publisher?: string;\n repo?: string;\n subdir?: string;\n tarball?: { url: string; sha256: string; };\n added?: string;\n peers?: string[];\n unpackedSize?: number;\n}"
|
|
@@ -459,7 +468,7 @@ export const TYPERT = {
|
|
|
459
468
|
},
|
|
460
469
|
{
|
|
461
470
|
"name": "HotRestartReason",
|
|
462
|
-
"declaration": "export type HotRestartReason = 'no-patch' | 'not-simple' | 'host-unsupported' | 'timeout' | 'mount-failed';"
|
|
471
|
+
"declaration": "export type HotRestartReason = 'no-patch' | 'not-simple' | 'host-unsupported' | 'timeout' | 'mount-failed' | 'client-half';"
|
|
463
472
|
},
|
|
464
473
|
{
|
|
465
474
|
"name": "InstallArgs",
|
|
@@ -471,11 +480,15 @@ export const TYPERT = {
|
|
|
471
480
|
},
|
|
472
481
|
{
|
|
473
482
|
"name": "InstallState",
|
|
474
|
-
"declaration": "export type InstallState = 'running' | 'done' | 'failed';"
|
|
483
|
+
"declaration": "export type InstallState = 'downloading' | 'running' | 'done' | 'failed';"
|
|
475
484
|
},
|
|
476
485
|
{
|
|
477
486
|
"name": "InstallStatus",
|
|
478
|
-
"declaration": "export interface InstallStatus {\n state: InstallState;\n log: string[];\n
|
|
487
|
+
"declaration": "export interface InstallStatus {\n state: InstallState;\n log: string[];\n activation?: Activation;\n restartReason?: HotRestartReason;\n detail?: string;\n}"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"name": "RestartBlockedReason",
|
|
491
|
+
"declaration": "export type RestartBlockedReason = 'windows' | 'systemd' | 'port-zero';"
|
|
479
492
|
},
|
|
480
493
|
{
|
|
481
494
|
"name": "RestartOutcome",
|
|
@@ -491,7 +504,7 @@ export const TYPERT = {
|
|
|
491
504
|
},
|
|
492
505
|
{
|
|
493
506
|
"name": "ShopInstallResult",
|
|
494
|
-
"declaration": "export type ShopInstallResult = { ok: true; installId: string; } | { ok: false; code: InstallRejectionCode; detail: string; };"
|
|
507
|
+
"declaration": "export type ShopInstallResult = { ok: true; installId: string; state: InstallState; } | { ok: false; code: InstallRejectionCode; detail: string; };"
|
|
495
508
|
},
|
|
496
509
|
{
|
|
497
510
|
"name": "ShopInstallStatusResult",
|
|
@@ -503,7 +516,7 @@ export const TYPERT = {
|
|
|
503
516
|
},
|
|
504
517
|
{
|
|
505
518
|
"name": "ShopSetEnabledResult",
|
|
506
|
-
"declaration": "export
|
|
519
|
+
"declaration": "export type ShopSetEnabledResult = { ok: true; activation: Activation; } | { ok: false; detail: string; };"
|
|
507
520
|
},
|
|
508
521
|
{
|
|
509
522
|
"name": "ShopUninstallResult",
|
|
@@ -511,11 +524,11 @@ export const TYPERT = {
|
|
|
511
524
|
},
|
|
512
525
|
{
|
|
513
526
|
"name": "ShopUpdateResult",
|
|
514
|
-
"declaration": "export type ShopUpdateResult = { ok: true; installId: string; } | { ok: false; detail: string; };"
|
|
527
|
+
"declaration": "export type ShopUpdateResult = { ok: true; installId: string; state: InstallState; } | { ok: false; detail: string; };"
|
|
515
528
|
},
|
|
516
529
|
{
|
|
517
530
|
"name": "ShopVersionResult",
|
|
518
|
-
"declaration": "export interface ShopVersionResult {\n installed: string;\n latest: string | null;\n outdated: boolean;\n
|
|
531
|
+
"declaration": "export interface ShopVersionResult {\n installed: string;\n latest: string | null;\n outdated: boolean;\n restartBlocked: RestartBlockedReason | null;\n}"
|
|
519
532
|
}
|
|
520
533
|
]
|
|
521
534
|
}
|
|
@@ -76,6 +76,7 @@ const dsh_plugin_shop_shop_installStart_parameter_0$schema = z.object({
|
|
|
76
76
|
const dsh_plugin_shop_shop_installStart_result$schema = z.union([z.object({
|
|
77
77
|
'ok': z.literal(true),
|
|
78
78
|
'installId': z.string(),
|
|
79
|
+
'state': z.union([z.literal("downloading"), z.literal("running"), z.literal("done"), z.literal("failed")]),
|
|
79
80
|
}), z.object({
|
|
80
81
|
'ok': z.literal(false),
|
|
81
82
|
'code': z.union([z.literal("not-in-catalog"), z.literal("denied"), z.literal("version-mismatch"), z.literal("needs-acknowledgement"), z.literal("tarball-integrity"), z.literal("ambiguous-identity"), z.literal("name-taken")]),
|
|
@@ -86,10 +87,10 @@ const dsh_plugin_shop_shop_installStatus_parameter_0$schema = z.object({
|
|
|
86
87
|
})
|
|
87
88
|
const dsh_plugin_shop_shop_installStatus_result$schema = z.object({
|
|
88
89
|
'found': z.boolean(),
|
|
89
|
-
'state': z.union([z.literal("running"), z.literal("done"), z.literal("failed")]),
|
|
90
|
+
'state': z.union([z.literal("downloading"), z.literal("running"), z.literal("done"), z.literal("failed")]),
|
|
90
91
|
'log': z.array(z.string()),
|
|
91
|
-
'
|
|
92
|
-
'restartReason': z.union([z.undefined(), z.literal("no-patch"), z.literal("not-simple"), z.literal("host-unsupported"), z.literal("timeout"), z.literal("mount-failed")]).optional(),
|
|
92
|
+
'activation': z.union([z.undefined(), z.literal("live"), z.literal("reload"), z.literal("restart")]).optional(),
|
|
93
|
+
'restartReason': z.union([z.undefined(), z.literal("no-patch"), z.literal("not-simple"), z.literal("host-unsupported"), z.literal("timeout"), z.literal("mount-failed"), z.literal("client-half")]).optional(),
|
|
93
94
|
'detail': z.union([z.undefined(), z.string()]).optional(),
|
|
94
95
|
})
|
|
95
96
|
const dsh_plugin_shop_shop_restart_result$schema = z.union([z.object({
|
|
@@ -102,10 +103,13 @@ const dsh_plugin_shop_shop_setEnabled_parameter_0$schema = z.object({
|
|
|
102
103
|
'name': z.string(),
|
|
103
104
|
'enabled': z.boolean(),
|
|
104
105
|
})
|
|
105
|
-
const dsh_plugin_shop_shop_setEnabled_result$schema = z.object({
|
|
106
|
-
'ok': z.
|
|
107
|
-
'
|
|
108
|
-
})
|
|
106
|
+
const dsh_plugin_shop_shop_setEnabled_result$schema = z.union([z.object({
|
|
107
|
+
'ok': z.literal(true),
|
|
108
|
+
'activation': z.union([z.literal("live"), z.literal("reload"), z.literal("restart")]),
|
|
109
|
+
}), z.object({
|
|
110
|
+
'ok': z.literal(false),
|
|
111
|
+
'detail': z.string(),
|
|
112
|
+
})])
|
|
109
113
|
const dsh_plugin_shop_shop_uninstallStart_parameter_0$schema = z.object({
|
|
110
114
|
'name': z.string(),
|
|
111
115
|
})
|
|
@@ -122,6 +126,7 @@ const dsh_plugin_shop_shop_updateStart_parameter_0$schema = z.object({
|
|
|
122
126
|
const dsh_plugin_shop_shop_updateStart_result$schema = z.union([z.object({
|
|
123
127
|
'ok': z.literal(true),
|
|
124
128
|
'installId': z.string(),
|
|
129
|
+
'state': z.union([z.literal("downloading"), z.literal("running"), z.literal("done"), z.literal("failed")]),
|
|
125
130
|
}), z.object({
|
|
126
131
|
'ok': z.literal(false),
|
|
127
132
|
'detail': z.string(),
|
|
@@ -130,7 +135,7 @@ const dsh_plugin_shop_shop_version_result$schema = z.object({
|
|
|
130
135
|
'installed': z.string(),
|
|
131
136
|
'latest': z.union([z.literal(null), z.string()]),
|
|
132
137
|
'outdated': z.boolean(),
|
|
133
|
-
'
|
|
138
|
+
'restartBlocked': z.union([z.literal(null), z.literal("windows"), z.literal("systemd"), z.literal("port-zero")]),
|
|
134
139
|
})
|
|
135
140
|
|
|
136
141
|
export const TYPERT_REMOTE = {
|
|
@@ -160,7 +165,7 @@ export const TYPERT_REMOTE = {
|
|
|
160
165
|
typeSymbol: 'dsh-plugin-shop/types#ShopCatalogResult',
|
|
161
166
|
schema: dsh_plugin_shop_shop_catalog_result$schema,
|
|
162
167
|
},
|
|
163
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
168
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":867,"column":9},
|
|
164
169
|
},
|
|
165
170
|
{
|
|
166
171
|
id: 'dsh-plugin-shop#shop/installed',
|
|
@@ -175,7 +180,7 @@ export const TYPERT_REMOTE = {
|
|
|
175
180
|
typeSymbol: 'dsh-plugin-shop#shop/installed:result',
|
|
176
181
|
schema: dsh_plugin_shop_shop_installed_result$schema,
|
|
177
182
|
},
|
|
178
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
183
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1140,"column":9},
|
|
179
184
|
},
|
|
180
185
|
{
|
|
181
186
|
id: 'dsh-plugin-shop#shop/installedSpecs',
|
|
@@ -190,7 +195,7 @@ export const TYPERT_REMOTE = {
|
|
|
190
195
|
typeSymbol: 'dsh-plugin-shop#shop/installedSpecs:result',
|
|
191
196
|
schema: dsh_plugin_shop_shop_installedSpecs_result$schema,
|
|
192
197
|
},
|
|
193
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
198
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1131,"column":9},
|
|
194
199
|
},
|
|
195
200
|
{
|
|
196
201
|
id: 'dsh-plugin-shop#shop/installStart',
|
|
@@ -216,7 +221,7 @@ export const TYPERT_REMOTE = {
|
|
|
216
221
|
typeSymbol: 'dsh-plugin-shop/types#ShopInstallResult',
|
|
217
222
|
schema: dsh_plugin_shop_shop_installStart_result$schema,
|
|
218
223
|
},
|
|
219
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
224
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":915,"column":9},
|
|
220
225
|
},
|
|
221
226
|
{
|
|
222
227
|
id: 'dsh-plugin-shop#shop/installStatus',
|
|
@@ -241,7 +246,7 @@ export const TYPERT_REMOTE = {
|
|
|
241
246
|
typeSymbol: 'dsh-plugin-shop/types#ShopInstallStatusResult',
|
|
242
247
|
schema: dsh_plugin_shop_shop_installStatus_result$schema,
|
|
243
248
|
},
|
|
244
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
249
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1107,"column":3},
|
|
245
250
|
},
|
|
246
251
|
{
|
|
247
252
|
id: 'dsh-plugin-shop#shop/restart',
|
|
@@ -256,7 +261,7 @@ export const TYPERT_REMOTE = {
|
|
|
256
261
|
typeSymbol: 'dsh-plugin-shop/types#ShopRestartResult',
|
|
257
262
|
schema: dsh_plugin_shop_shop_restart_result$schema,
|
|
258
263
|
},
|
|
259
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
264
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1311,"column":9},
|
|
260
265
|
},
|
|
261
266
|
{
|
|
262
267
|
id: 'dsh-plugin-shop#shop/setEnabled',
|
|
@@ -281,7 +286,7 @@ export const TYPERT_REMOTE = {
|
|
|
281
286
|
typeSymbol: 'dsh-plugin-shop/types#ShopSetEnabledResult',
|
|
282
287
|
schema: dsh_plugin_shop_shop_setEnabled_result$schema,
|
|
283
288
|
},
|
|
284
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
289
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":692,"column":9},
|
|
285
290
|
},
|
|
286
291
|
{
|
|
287
292
|
id: 'dsh-plugin-shop#shop/uninstallStart',
|
|
@@ -307,7 +312,7 @@ export const TYPERT_REMOTE = {
|
|
|
307
312
|
typeSymbol: 'dsh-plugin-shop/types#ShopUninstallResult',
|
|
308
313
|
schema: dsh_plugin_shop_shop_uninstallStart_result$schema,
|
|
309
314
|
},
|
|
310
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
315
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1233,"column":9},
|
|
311
316
|
},
|
|
312
317
|
{
|
|
313
318
|
id: 'dsh-plugin-shop#shop/updateStart',
|
|
@@ -332,7 +337,7 @@ export const TYPERT_REMOTE = {
|
|
|
332
337
|
typeSymbol: 'dsh-plugin-shop/types#ShopUpdateResult',
|
|
333
338
|
schema: dsh_plugin_shop_shop_updateStart_result$schema,
|
|
334
339
|
},
|
|
335
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
340
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1379,"column":9},
|
|
336
341
|
},
|
|
337
342
|
{
|
|
338
343
|
id: 'dsh-plugin-shop#shop/version',
|
|
@@ -347,7 +352,7 @@ export const TYPERT_REMOTE = {
|
|
|
347
352
|
typeSymbol: 'dsh-plugin-shop/types#ShopVersionResult',
|
|
348
353
|
schema: dsh_plugin_shop_shop_version_result$schema,
|
|
349
354
|
},
|
|
350
|
-
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":
|
|
355
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":1363,"column":9},
|
|
351
356
|
},
|
|
352
357
|
],
|
|
353
358
|
}
|
|
@@ -34,6 +34,10 @@ export interface ShopTabInjected {
|
|
|
34
34
|
updateStart: (args: {
|
|
35
35
|
version: string;
|
|
36
36
|
}) => Promise<ShopUpdateResult>;
|
|
37
|
+
/** The §4 reload trigger, defaulted once at the tab root to a real page
|
|
38
|
+
* reload. Injected so a test can observe it without touching jsdom's
|
|
39
|
+
* non-writable `location.reload`. */
|
|
40
|
+
reload?: () => void;
|
|
37
41
|
}
|
|
38
42
|
/** Full component props assembled by the Settings slot renderer. */
|
|
39
43
|
export type ShopTabProps = PropsRuntime<'settings.plugins.tab'> & PropsLocale<'settings.shop'> & InjectFace<ShopTabInjected>;
|
|
@@ -26,9 +26,11 @@ export declare const zh: {
|
|
|
26
26
|
install: string;
|
|
27
27
|
confirm: string;
|
|
28
28
|
cancel: string;
|
|
29
|
+
dismiss: string;
|
|
29
30
|
acknowledgementTitle: string;
|
|
30
31
|
acknowledgementBody: string;
|
|
31
32
|
installing: string;
|
|
33
|
+
downloading: string;
|
|
32
34
|
installedRestartNotice: string;
|
|
33
35
|
incompatibleBadge: string;
|
|
34
36
|
incompatibleDetail: string;
|
|
@@ -37,7 +39,11 @@ export declare const zh: {
|
|
|
37
39
|
hotHostUnsupportedNotice: string;
|
|
38
40
|
hotTimeoutNotice: string;
|
|
39
41
|
hotMountFailedNotice: string;
|
|
42
|
+
hotClientHalfNotice: string;
|
|
40
43
|
installedNoRestartNotice: string;
|
|
44
|
+
installedReloadNotice: string;
|
|
45
|
+
reload: string;
|
|
46
|
+
reloadNote: string;
|
|
41
47
|
installFailed: string;
|
|
42
48
|
installTransportFailed: string;
|
|
43
49
|
refresh: string;
|
|
@@ -84,6 +90,7 @@ export declare const zh: {
|
|
|
84
90
|
uninstallTransportFailed: string;
|
|
85
91
|
uninstalledLiveNotice: string;
|
|
86
92
|
uninstalledRestartNotice: string;
|
|
93
|
+
uninstalledReloadNotice: string;
|
|
87
94
|
restart: string;
|
|
88
95
|
restartTitle: string;
|
|
89
96
|
restartBody: string;
|
|
@@ -91,7 +98,9 @@ export declare const zh: {
|
|
|
91
98
|
restarting: string;
|
|
92
99
|
restartFailedNotice: string;
|
|
93
100
|
restartTransportFailed: string;
|
|
94
|
-
|
|
101
|
+
restartBlockedWindowsNotice: string;
|
|
102
|
+
restartBlockedSystemdNotice: string;
|
|
103
|
+
restartBlockedPortZeroNotice: string;
|
|
95
104
|
updateFailed: string;
|
|
96
105
|
updateTransportFailed: string;
|
|
97
106
|
checkUpdate: string;
|
|
@@ -131,9 +140,11 @@ export declare const en: {
|
|
|
131
140
|
install: string;
|
|
132
141
|
confirm: string;
|
|
133
142
|
cancel: string;
|
|
143
|
+
dismiss: string;
|
|
134
144
|
acknowledgementTitle: string;
|
|
135
145
|
acknowledgementBody: string;
|
|
136
146
|
installing: string;
|
|
147
|
+
downloading: string;
|
|
137
148
|
installedRestartNotice: string;
|
|
138
149
|
incompatibleBadge: string;
|
|
139
150
|
incompatibleDetail: string;
|
|
@@ -142,7 +153,11 @@ export declare const en: {
|
|
|
142
153
|
hotHostUnsupportedNotice: string;
|
|
143
154
|
hotTimeoutNotice: string;
|
|
144
155
|
hotMountFailedNotice: string;
|
|
156
|
+
hotClientHalfNotice: string;
|
|
145
157
|
installedNoRestartNotice: string;
|
|
158
|
+
installedReloadNotice: string;
|
|
159
|
+
reload: string;
|
|
160
|
+
reloadNote: string;
|
|
146
161
|
installFailed: string;
|
|
147
162
|
installTransportFailed: string;
|
|
148
163
|
refresh: string;
|
|
@@ -184,6 +199,7 @@ export declare const en: {
|
|
|
184
199
|
uninstallTransportFailed: string;
|
|
185
200
|
uninstalledLiveNotice: string;
|
|
186
201
|
uninstalledRestartNotice: string;
|
|
202
|
+
uninstalledReloadNotice: string;
|
|
187
203
|
restart: string;
|
|
188
204
|
restartTitle: string;
|
|
189
205
|
restartBody: string;
|
|
@@ -191,7 +207,9 @@ export declare const en: {
|
|
|
191
207
|
restarting: string;
|
|
192
208
|
restartFailedNotice: string;
|
|
193
209
|
restartTransportFailed: string;
|
|
194
|
-
|
|
210
|
+
restartBlockedWindowsNotice: string;
|
|
211
|
+
restartBlockedSystemdNotice: string;
|
|
212
|
+
restartBlockedPortZeroNotice: string;
|
|
195
213
|
updateFailed: string;
|
|
196
214
|
updateTransportFailed: string;
|
|
197
215
|
checkUpdate: string;
|
|
@@ -5,11 +5,44 @@ export { isShopLike } from '../shared/shop-like.ts';
|
|
|
5
5
|
export { identityKey, type EntryIdentity } from '../shared/identity.ts';
|
|
6
6
|
import { type EntryIdentity } from '../shared/identity.ts';
|
|
7
7
|
import type { ShopLocaleKey } from './locales.ts';
|
|
8
|
-
import type { CatalogEntry, HotRestartReason, InstallRejectionCode } from '../host/index.ts';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import type { CatalogEntry, HotRestartReason, InstallRejectionCode, RestartBlockedReason } from '../host/index.ts';
|
|
9
|
+
import type { Activation } from '../host/activation.ts';
|
|
10
|
+
import { type InstallState } from '../shared/install-state.ts';
|
|
11
|
+
export type { Activation };
|
|
12
|
+
/** The done notice for one activation, as a locale key.
|
|
13
|
+
*
|
|
14
|
+
* A hot-mount reason code names WHY a restart is needed and is meaningful
|
|
15
|
+
* only under `restart`; `live` and `reload` ignore any reason riding along,
|
|
16
|
+
* because rendering one there would tell a reader their reload had failed.
|
|
17
|
+
* An absent or unrecognized reason keeps the generic restart line rather
|
|
18
|
+
* than showing a bare code. */
|
|
19
|
+
export declare function activationNoticeKey(activation: Activation, restartReason: HotRestartReason | undefined): ShopLocaleKey;
|
|
20
|
+
/** The same mapping for an UNINSTALL's done notice.
|
|
21
|
+
*
|
|
22
|
+
* A sibling rather than a `prefix` parameter on `activationNoticeKey`: the
|
|
23
|
+
* two key sets are not parallel — `installedNoRestartNotice` against
|
|
24
|
+
* `uninstalledLiveNotice` — so no prefix derives one from the other. It takes
|
|
25
|
+
* no reason code, because a hot-mount reason explains why a MOUNT could not
|
|
26
|
+
* happen and an uninstall mounts nothing.
|
|
27
|
+
*
|
|
28
|
+
* Here rather than in JSX because this is a pure Activation -> copy decision,
|
|
29
|
+
* and in a component no fixture can reach it: the install side was covered
|
|
30
|
+
* and this one was not, for the whole time both existed. */
|
|
31
|
+
export declare function uninstallActivationNoticeKey(activation: Activation): ShopLocaleKey;
|
|
32
|
+
/** The copy key for one install phase. A function rather than an inline
|
|
33
|
+
* ternary in the JSX so it is unit-testable: the tab's only test seam is a
|
|
34
|
+
* whole-tab render driven by injected RPCs, which cannot be handed one view. */
|
|
35
|
+
export declare function installPhaseKey(phase: 'downloading' | 'installing'): ShopLocaleKey;
|
|
36
|
+
/** Why the shop cannot restart dsh, as a locale key.
|
|
37
|
+
*
|
|
38
|
+
* A sibling of `activationNoticeKey` and exhaustive for the same reason: the
|
|
39
|
+
* switch has no default, so a fourth reason added to `RestartBlockedReason` is
|
|
40
|
+
* a type error here rather than a card that silently keeps the third one's
|
|
41
|
+
* copy. That is the whole point of the type — the single boolean this replaced
|
|
42
|
+
* had ONE string for three causes, and it named systemd, so a Windows reader
|
|
43
|
+
* was told to restart a service they do not run and to set an override that
|
|
44
|
+
* could not have helped. */
|
|
45
|
+
export declare function restartBlockedNoticeKey(reason: RestartBlockedReason): ShopLocaleKey;
|
|
13
46
|
/** Tier → locale key, for the entry-card tier badge (§6.2). */
|
|
14
47
|
export declare function tierKey(tier: CatalogEntry['tier']): ShopLocaleKey;
|
|
15
48
|
/** The peers the Host said this installation does not provide, or none when it
|
|
@@ -63,13 +96,17 @@ export declare function isCustomLicense(license: string | null): boolean;
|
|
|
63
96
|
/** One polled install status (§7.3 wire data), structural. */
|
|
64
97
|
export interface InstallStatusShape {
|
|
65
98
|
found: boolean;
|
|
66
|
-
state:
|
|
99
|
+
state: InstallState;
|
|
67
100
|
log: string[];
|
|
68
|
-
|
|
101
|
+
activation?: Activation;
|
|
69
102
|
restartReason?: HotRestartReason;
|
|
70
103
|
detail?: string;
|
|
71
104
|
}
|
|
72
|
-
/** The install view state machine (§7.2).
|
|
105
|
+
/** The install view state machine (§7.2). `phase` distinguishes the download
|
|
106
|
+
* that runs ahead of the per-profile mutex from the install that holds it.
|
|
107
|
+
* It rides the `running` kind rather than adding a kind of its own: every
|
|
108
|
+
* `view.kind === 'running'` site — `useInstall.ts`'s poll collection among
|
|
109
|
+
* them — must keep treating a downloading install as live. */
|
|
73
110
|
export type InstallView = {
|
|
74
111
|
kind: 'idle';
|
|
75
112
|
} | {
|
|
@@ -80,9 +117,10 @@ export type InstallView = {
|
|
|
80
117
|
kind: 'running';
|
|
81
118
|
installId: string;
|
|
82
119
|
log: string[];
|
|
120
|
+
phase: 'downloading' | 'installing';
|
|
83
121
|
} | {
|
|
84
122
|
kind: 'done';
|
|
85
|
-
|
|
123
|
+
activation: Activation;
|
|
86
124
|
log: string[];
|
|
87
125
|
restartReason?: HotRestartReason;
|
|
88
126
|
} | {
|
|
@@ -98,10 +136,23 @@ export type InstallEvent = {
|
|
|
98
136
|
} | {
|
|
99
137
|
type: 'started';
|
|
100
138
|
installId: string;
|
|
139
|
+
state: InstallState;
|
|
101
140
|
} | {
|
|
102
141
|
type: 'status';
|
|
103
142
|
status: InstallStatusShape;
|
|
104
143
|
};
|
|
144
|
+
/** The phase a non-terminal state renders as: the WIRE state the host
|
|
145
|
+
* reported (`InstallState`) mapped onto the phase the view carries. Exported
|
|
146
|
+
* because every hook that turns a start or a poll result into a view spells
|
|
147
|
+
* this same mapping, and three hand-copied ternaries are three chances for
|
|
148
|
+
* one of them to drift.
|
|
149
|
+
*
|
|
150
|
+
* Not to be confused with `installPhaseKey`, which is the OTHER direction and
|
|
151
|
+
* a different pair of values: view phase → the locale key to render. They
|
|
152
|
+
* happen to share two spellings today and that is a coincidence of naming,
|
|
153
|
+
* not a reason to fuse them — the wire union and the locale key set are free
|
|
154
|
+
* to diverge. */
|
|
155
|
+
export declare function phaseOf(state: InstallState): 'downloading' | 'installing';
|
|
105
156
|
/** §7.2 once-per-second poll cadence, as a named constant. */
|
|
106
157
|
export declare const INSTALL_POLL_MS = 1000;
|
|
107
158
|
/** §8 restart handoff: the client polls the origin only after this grace
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One keyed registry of install-shaped flows: start, poll to terminal, reset.
|
|
3
|
+
*
|
|
4
|
+
* Install and uninstall are the same machine. Both fold a
|
|
5
|
+
* `ShopInstallStatusResult` through `reduceInstall` into an `InstallView`,
|
|
6
|
+
* both poll every running identity from one interval, and both must keep a
|
|
7
|
+
* settled outcome after the installed projection that follows it drops the
|
|
8
|
+
* row the panel was mounted on (I-1, §7.2) — which is why the state is keyed
|
|
9
|
+
* by identity here rather than held by the card.
|
|
10
|
+
*
|
|
11
|
+
* They differ in exactly one place: what the STARTING RPC's answer means. An
|
|
12
|
+
* install refusal is a `rejected` view carrying the gate's code; an uninstall
|
|
13
|
+
* refusal is a `failed` view carrying the host's published detail, because
|
|
14
|
+
* `ShopUninstallResult`'s failure variant has no code to populate and those
|
|
15
|
+
* codes belong to the install gate. That difference is the `begin` parameter,
|
|
16
|
+
* and it is the whole of it.
|
|
17
|
+
*
|
|
18
|
+
* The two used to be hand-synced copies — 71 of 84 lines identical. The cost
|
|
19
|
+
* was not theoretical: a single review round had to make the same edit twice
|
|
20
|
+
* (the settle signature, and its call), and the `pending` set below was added
|
|
21
|
+
* to one of them and not the other before this module existed.
|
|
22
|
+
*/
|
|
23
|
+
import type { ShopInstallStatusResult } from '../host/index.ts';
|
|
24
|
+
import { type InstallView } from './present.ts';
|
|
25
|
+
/** One identity's flow, as the tab hands it to a panel. */
|
|
26
|
+
export interface KeyedFlow<TArgs> {
|
|
27
|
+
view: InstallView;
|
|
28
|
+
start: (args: TArgs) => Promise<void>;
|
|
29
|
+
reset: () => void;
|
|
30
|
+
}
|
|
31
|
+
export interface UseKeyedFlows<TArgs> {
|
|
32
|
+
/** Two panels asking for the same identity receive one flow. */
|
|
33
|
+
flowFor: (key: string) => KeyedFlow<TArgs>;
|
|
34
|
+
/** Return one identity to `idle` without building a flow for it. Stable
|
|
35
|
+
* across renders (unlike `flowFor`, whose identity tracks `views`), so one
|
|
36
|
+
* registry's settle callback can supersede the other's receipt for the same
|
|
37
|
+
* key without taking a dependency on that registry's output. */
|
|
38
|
+
resetFlow: (key: string) => void;
|
|
39
|
+
/**
|
|
40
|
+
* The identities whose flow is not `idle` — asked by the shelf, which has
|
|
41
|
+
* to keep a settled uninstall's row in the Installed view after the
|
|
42
|
+
* installed projection drops it.
|
|
43
|
+
*
|
|
44
|
+
* A membership test rather than a flow, and its IDENTITY changes only when
|
|
45
|
+
* that membership does. Both matter to the same caller: `flowFor` builds a
|
|
46
|
+
* fresh object and two closures per call, so asking it inside a filter
|
|
47
|
+
* allocated three objects for every entry on the shelf; and it tracks
|
|
48
|
+
* `views`, which changes on every poll RESPONSE, because `reduceInstall`
|
|
49
|
+
* returns a new `running` view for each status. A filter depending on that
|
|
50
|
+
* re-ran over the whole catalog once a second for a log line nobody read.
|
|
51
|
+
*/
|
|
52
|
+
pending: ReadonlySet<string>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @param begin the starting RPC and its answer, mapped to the first view.
|
|
56
|
+
* Never rejects: a transport throw is the caller's to fold into a view,
|
|
57
|
+
* because only the caller knows which localized line stands in for a detail
|
|
58
|
+
* too private to render.
|
|
59
|
+
* @param onSettled called once per identity that reaches a terminal state,
|
|
60
|
+
* with WHICH terminal state. The outcome is load-bearing: a failed flow
|
|
61
|
+
* changed nothing on the server, so a caller acting on "settled" alone
|
|
62
|
+
* discards outcomes that are still true.
|
|
63
|
+
*/
|
|
64
|
+
export declare function useKeyedFlows<TArgs>(begin: (args: TArgs) => Promise<InstallView>, installStatus: (args: {
|
|
65
|
+
installId: string;
|
|
66
|
+
}) => Promise<ShopInstallStatusResult>, onSettled?: (key: string, outcome: 'done' | 'failed') => void): UseKeyedFlows<TArgs>;
|