@deepseek-ai/dsh-client-ui-plugin-manager 0.1.6-alpha.2 → 0.1.7-alpha.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/lib/index.js CHANGED
@@ -1,6 +1,142 @@
1
+ import z from "@deepseek-ai/schemastery";
2
+ import { MAX_TIMER_DELAY_MS } from "@deepseek-ai/dsh-timeout";
3
+ import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
1
4
  //#region lib/types/index.js
2
- /** Host loader entry for the plugin-manager tab's browser implementation exported from `./client`. */
3
- /** Host plugin body — no host-side behavior for the plugin manager tab. */
4
- function apply() {}
5
+ /** Host registry-response probing for the plugin installation dialog. */
6
+ var __runInitializers = function(thisArg, initializers, value) {
7
+ var useValue = arguments.length > 2;
8
+ for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
9
+ return useValue ? value : void 0;
10
+ };
11
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
12
+ function accept(f) {
13
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
14
+ return f;
15
+ }
16
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
17
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
18
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
19
+ var _, done = false;
20
+ for (var i = decorators.length - 1; i >= 0; i--) {
21
+ var context = {};
22
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
23
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
24
+ context.addInitializer = function(f) {
25
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
26
+ extraInitializers.push(accept(f || null));
27
+ };
28
+ var result = (0, decorators[i])(kind === "accessor" ? {
29
+ get: descriptor.get,
30
+ set: descriptor.set
31
+ } : descriptor[key], context);
32
+ if (kind === "accessor") {
33
+ if (result === void 0) continue;
34
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
35
+ if (_ = accept(result.get)) descriptor.get = _;
36
+ if (_ = accept(result.set)) descriptor.set = _;
37
+ if (_ = accept(result.init)) initializers.unshift(_);
38
+ } else if (_ = accept(result)) if (kind === "field") initializers.unshift(_);
39
+ else descriptor[key] = _;
40
+ }
41
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
42
+ done = true;
43
+ };
44
+ let PluginRegistryProbe = (() => {
45
+ let _classSuper = TypertRemoteService;
46
+ let _instanceExtraInitializers = [];
47
+ let _fastest_decorators;
48
+ return class PluginRegistryProbe extends _classSuper {
49
+ static {
50
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
51
+ _fastest_decorators = [Remote];
52
+ __esDecorate(this, null, _fastest_decorators, {
53
+ kind: "method",
54
+ name: "fastest",
55
+ static: false,
56
+ private: false,
57
+ access: {
58
+ has: (obj) => "fastest" in obj,
59
+ get: (obj) => obj.fastest
60
+ },
61
+ metadata: _metadata
62
+ }, null, _instanceExtraInitializers);
63
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, {
64
+ enumerable: true,
65
+ configurable: true,
66
+ writable: true,
67
+ value: _metadata
68
+ });
69
+ }
70
+ config = __runInitializers(this, _instanceExtraInitializers);
71
+ static Config = z.object({
72
+ registryProbeEnabled: z.boolean().default(true),
73
+ registryProbeTimeoutMs: z.natural().min(1).max(MAX_TIMER_DELAY_MS).default(1500),
74
+ registryProbeCacheTtlMs: z.natural().default(3e5)
75
+ });
76
+ lifetime = new AbortController();
77
+ pending;
78
+ cached;
79
+ constructor(ctx, config) {
80
+ super(ctx, "pluginRegistryProbe");
81
+ this.config = config;
82
+ ctx.effect(() => async () => {
83
+ this.lifetime.abort();
84
+ await this.pending;
85
+ });
86
+ }
87
+ /**
88
+ * Race npm and npmmirror HTTPS ping responses through the Host's fetch proxy.
89
+ * Concurrent readers share a probe; a winner cancels and awaits the other request.
90
+ * @returns the first registry with a successful response, or null when disabled or neither responds successfully; results are cached.
91
+ * @throws rejects when the service has been unloaded.
92
+ */
93
+ async fastest() {
94
+ this.lifetime.signal.throwIfAborted();
95
+ if (!this.config.registryProbeEnabled) return null;
96
+ if (this.cached !== void 0 && this.cached.expiresAt > Date.now()) return this.cached.registry;
97
+ this.pending ??= this.probe().finally(() => {
98
+ this.pending = void 0;
99
+ });
100
+ return this.pending;
101
+ }
102
+ async probe() {
103
+ const finished = new AbortController();
104
+ const signal = AbortSignal.any([
105
+ this.lifetime.signal,
106
+ finished.signal,
107
+ AbortSignal.timeout(this.config.registryProbeTimeoutMs)
108
+ ]);
109
+ const requests = ["https://registry.npmjs.org/-/ping", "https://registry.npmmirror.com/-/ping"].map(async (endpoint) => ({
110
+ registry: new URL("/", endpoint).href,
111
+ response: await fetch(endpoint, {
112
+ signal,
113
+ redirect: "error"
114
+ })
115
+ }));
116
+ const successful = requests.map(async (request) => {
117
+ const { registry, response } = await request;
118
+ if (!response.ok) throw new Error(`Registry ping returned HTTP ${response.status}`);
119
+ return registry;
120
+ });
121
+ let registry;
122
+ try {
123
+ registry = await Promise.any(successful);
124
+ } catch (_unavailableRegistries) {
125
+ registry = null;
126
+ } finally {
127
+ finished.abort();
128
+ const responses = await Promise.allSettled(requests);
129
+ await Promise.allSettled(responses.map(async (result) => {
130
+ if (result.status === "fulfilled") await result.value.response.body?.cancel();
131
+ }));
132
+ }
133
+ if (!this.lifetime.signal.aborted) this.cached = {
134
+ registry,
135
+ expiresAt: Date.now() + this.config.registryProbeCacheTtlMs
136
+ };
137
+ return registry;
138
+ }
139
+ };
140
+ })();
5
141
  //#endregion
6
- export { apply };
142
+ export { PluginRegistryProbe as default };
@@ -0,0 +1,3 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+
3
+ export declare const TYPERT: unknown
@@ -0,0 +1,53 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ let _deepseek_ai_dsh_client_ui_plugin_manager_pluginRegistryProbe_fastest_result$schema$value
5
+ const _deepseek_ai_dsh_client_ui_plugin_manager_pluginRegistryProbe_fastest_result$schema = () => (_deepseek_ai_dsh_client_ui_plugin_manager_pluginRegistryProbe_fastest_result$schema$value ??= z.union([z.literal(null), z.string()]))
6
+
7
+ export const TYPERT = {
8
+ package: '@deepseek-ai/dsh-client-ui-plugin-manager',
9
+ face: 'host',
10
+ schemas: [
11
+ ],
12
+ invocations: [
13
+ {
14
+ id: '@deepseek-ai/dsh-client-ui-plugin-manager#pluginRegistryProbe/fastest',
15
+ service: 'pluginRegistryProbe',
16
+ namespace: 'pluginRegistryProbe',
17
+ method: 'fastest',
18
+ invocation: { kind: 'direct' },
19
+ parameters: [
20
+ ],
21
+ result: {
22
+ mode: 'strict',
23
+ typeSymbol: '@deepseek-ai/dsh-client-ui-plugin-manager#pluginRegistryProbe/fastest:result',
24
+ create: _deepseek_ai_dsh_client_ui_plugin_manager_pluginRegistryProbe_fastest_result$schema,
25
+ },
26
+ sourceLocation: {"file":"packages/client/ui-plugin-manager/src/index.ts","line":51,"column":9},
27
+ },
28
+ ],
29
+ model: {
30
+ "services": [
31
+ {
32
+ "description": "Compares public registry responses on the Host; the Client owns the initial selection.",
33
+ "summary": "Compares public registry responses on the Host; the Client owns the initial selection.",
34
+ "tags": [],
35
+ "jsDoc": "/** Compares public registry responses on the Host; the Client owns the initial selection. */",
36
+ "key": "pluginRegistryProbe",
37
+ "exportName": "default",
38
+ "members": [
39
+ {
40
+ "kind": "method",
41
+ "name": "fastest",
42
+ "signature": "@Remote async fastest(): Promise<string | null>",
43
+ "summary": "Race npm and npmmirror HTTPS ping responses through the Host's fetch proxy.",
44
+ "jsDoc": "/**\n * Race npm and npmmirror HTTPS ping responses through the Host's fetch proxy.\n * Concurrent readers share a probe; a winner cancels and awaits the other request.\n * @returns the first registry with a successful response, or null when disabled or neither responds successfully; results are cached.\n * @throws rejects when the service has been unloaded.\n */"
45
+ }
46
+ ],
47
+ "types": []
48
+ }
49
+ ],
50
+ "events": [],
51
+ "objects": []
52
+ },
53
+ }
@@ -0,0 +1,21 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import type {
3
+ RemoteResult,
4
+ TypertRemoteContribution,
5
+ } from '@deepseek-ai/dsh-typert-protocol'
6
+
7
+ declare module '@deepseek-ai/dsh-typert-protocol' {
8
+ interface TypertRemoteNamespace$706c7567696e526567697374727950726f6265 {
9
+ fastest: () => Promise<RemoteResult<string | null>>
10
+ }
11
+ interface TypertRemoteMap {
12
+ 'pluginRegistryProbe/fastest': () => Promise<RemoteResult<string | null>>
13
+ }
14
+ interface TypertRemoteNamespaceMap {
15
+ 'pluginRegistryProbe': TypertRemoteNamespace$706c7567696e526567697374727950726f6265
16
+ }
17
+ }
18
+
19
+ export declare const TYPERT_REMOTE: TypertRemoteContribution
20
+ export default TYPERT_REMOTE
21
+ //# sourceMappingURL=typert.remote-client.d.ts.map
@@ -0,0 +1,28 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ let _deepseek_ai_dsh_client_ui_plugin_manager_pluginRegistryProbe_fastest_result$schema$value
5
+ const _deepseek_ai_dsh_client_ui_plugin_manager_pluginRegistryProbe_fastest_result$schema = () => (_deepseek_ai_dsh_client_ui_plugin_manager_pluginRegistryProbe_fastest_result$schema$value ??= z.union([z.literal(null), z.string()]))
6
+
7
+ export const TYPERT_REMOTE = {
8
+ package: '@deepseek-ai/dsh-client-ui-plugin-manager',
9
+ descriptors: [
10
+ {
11
+ id: '@deepseek-ai/dsh-client-ui-plugin-manager#pluginRegistryProbe/fastest',
12
+ service: 'pluginRegistryProbe',
13
+ namespace: 'pluginRegistryProbe',
14
+ method: 'fastest',
15
+ invocation: { kind: 'direct' },
16
+ parameters: [
17
+ ],
18
+ result: {
19
+ mode: 'strict',
20
+ typeSymbol: '@deepseek-ai/dsh-client-ui-plugin-manager#pluginRegistryProbe/fastest:result',
21
+ create: _deepseek_ai_dsh_client_ui_plugin_manager_pluginRegistryProbe_fastest_result$schema,
22
+ },
23
+ sourceLocation: {"file":"packages/client/ui-plugin-manager/src/index.ts","line":51,"column":9},
24
+ },
25
+ ],
26
+ }
27
+
28
+ export default TYPERT_REMOTE
@@ -12,7 +12,7 @@ import { type ReactNode } from 'react';
12
12
  import type { InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
13
13
  import { type PluginManagerFace } from './manager-store.ts';
14
14
  /** Full component props assembled by the main slot renderer. */
15
- export type PluginManagerPageProps = PropsRuntime<'main'> & PropsLocale<'pluginManager'> & PropsRenderSlots<'plugins.item' | 'plugins.bundle.config' | 'plugins.row.config'> & InjectFace<PluginManagerFace>;
15
+ export type PluginManagerPageProps = PropsRuntime<'main'> & PropsLocale<'pluginManager'> & PropsRenderSlots<'plugins.item' | 'plugins.bundle.config' | 'plugins.row.config' | 'plugins.bundle.activation' | 'plugins.detail.actions' | 'plugins.detail.badge' | 'plugins.detail.section'> & InjectFace<PluginManagerFace>;
16
16
  /** Render the plugin manager: the official plugins and installed bundles, their pages, the install dialog, and the confirmation. */
17
17
  export declare function PluginManagerPage(props: PluginManagerPageProps): ReactNode;
18
18
  //# sourceMappingURL=PluginManagerPage.d.ts.map
@@ -13,7 +13,7 @@ export type { PluginManagerPageProps } from './PluginManagerPage.tsx';
13
13
  export type { ConfigLedger, OfficialItem } from './config-ledger.ts';
14
14
  export type { PluginManagerFace } from './manager-store.ts';
15
15
  export type { PluginManagerLocaleKey } from './locales.ts';
16
- export type { PluginConfigViewProps } from './slot-contract.ts';
16
+ export type { ConfigPageForm, PluginActivationOwnerProps, PluginConfigViewProps, PluginDetailProps, PluginPackageRef, PluginRowRef, PluginsSubject, } from './slot-contract.ts';
17
17
  declare module '@deepseek-ai/dsh-client-ui-slots' {
18
18
  interface LocaleNamespaceMap {
19
19
  /** Plugin manager tab copy. */
@@ -1,4 +1,4 @@
1
- /** Plugin management copy and display names of shipped global rows. */
1
+ /** Plugin management interface copy. */
2
2
  /** Simplified Chinese dictionary and key source of truth. */
3
3
  export declare const zh: {
4
4
  panel: string;
@@ -15,17 +15,11 @@ export declare const zh: {
15
15
  overriddenNotice: string;
16
16
  bundlesTitle: string;
17
17
  officialTitle: string;
18
- builtinAgentTeamTitle: string;
19
- builtinAgentTeamDescription: string;
20
- builtinAgentTeamWebTitle: string;
21
- builtinAgentTeamWebDescription: string;
22
- builtinAutoReviewTitle: string;
23
- builtinAutoReviewDescription: string;
24
18
  statusProblem: string;
25
19
  statusBeta: string;
26
20
  reasonLabel: string;
21
+ metadataError: string;
27
22
  versionTag: string;
28
- noDescription: string;
29
23
  partsLabel: string;
30
24
  partsEmpty: string;
31
25
  partsCountTotal: string;
@@ -56,8 +50,6 @@ export declare const zh: {
56
50
  installSpecPlaceholder: string;
57
51
  installGuideToggle: string;
58
52
  installGuideHide: string;
59
- installGuideIntro: string;
60
- installGuideIdNote: string;
61
53
  installGuideIdTitle: string;
62
54
  installGuideIdExample: string;
63
55
  installGuideIdHint: string;
@@ -71,6 +63,16 @@ export declare const zh: {
71
63
  installGuideFill: string;
72
64
  installGuideFillAria: string;
73
65
  installGuideSafety: string;
66
+ registryToggle: string;
67
+ registryLegend: string;
68
+ registryDefault: string;
69
+ registryNpmmirror: string;
70
+ registryWithHost: string;
71
+ registryCustom: string;
72
+ registryCustomPlaceholder: string;
73
+ registryCustomHint: string;
74
+ registryCustomInvalid: string;
75
+ registryListSeparator: string;
74
76
  installRun: string;
75
77
  installChecking: string;
76
78
  installProblemInvalid: string;
@@ -79,14 +81,29 @@ export declare const zh: {
79
81
  installProblemNotPackage: string;
80
82
  installProblemNotBundle: string;
81
83
  installProblemNetwork: string;
84
+ installProblemNetworkAll: string;
82
85
  installProblemUnknown: string;
83
86
  installingTitle: string;
84
87
  installedTitle: string;
85
88
  installFailedTitle: string;
86
89
  installEdit: string;
87
90
  installEditAria: string;
91
+ installCancelAndEdit: string;
92
+ installApplyingCancellationError: string;
93
+ installReconcile: string;
94
+ installUnknownTitle: string;
95
+ installUnknownDescription: string;
96
+ installResultUnconfirmed: string;
97
+ installAwaitingAcceptance: string;
98
+ installBackgroundUnknown: string;
88
99
  installCancel: string;
89
100
  installCloseCancels: string;
101
+ installViewTask: string;
102
+ installUnconfirmedTitle: string;
103
+ installBackgroundDone: string;
104
+ installBackgroundFailed: string;
105
+ installBackgroundUnconfirmed: string;
106
+ installBackgroundApplying: string;
90
107
  installStarting: string;
91
108
  installCancelling: string;
92
109
  installApplying: string;
@@ -102,7 +119,12 @@ export declare const zh: {
102
119
  installSubjectTarball: string;
103
120
  installLocation: string;
104
121
  installRetry: string;
122
+ installChangeRegistry: string;
123
+ installAttempt: string;
124
+ installAttemptBadge: string;
105
125
  installFailureNetwork: string;
126
+ installFailureNetworkAll: string;
127
+ installFailureNetworkHost: string;
106
128
  installFailureNotFound: string;
107
129
  installFailureNoMatchingVersion: string;
108
130
  installFailureDiskFull: string;
@@ -175,17 +197,11 @@ export declare const en: {
175
197
  overriddenNotice: string;
176
198
  bundlesTitle: string;
177
199
  officialTitle: string;
178
- builtinAgentTeamTitle: string;
179
- builtinAgentTeamDescription: string;
180
- builtinAgentTeamWebTitle: string;
181
- builtinAgentTeamWebDescription: string;
182
- builtinAutoReviewTitle: string;
183
- builtinAutoReviewDescription: string;
184
200
  statusProblem: string;
185
201
  statusBeta: string;
186
202
  reasonLabel: string;
203
+ metadataError: string;
187
204
  versionTag: string;
188
- noDescription: string;
189
205
  partsLabel: string;
190
206
  partsEmpty: string;
191
207
  partsCountTotal: string;
@@ -216,8 +232,6 @@ export declare const en: {
216
232
  installSpecPlaceholder: string;
217
233
  installGuideToggle: string;
218
234
  installGuideHide: string;
219
- installGuideIntro: string;
220
- installGuideIdNote: string;
221
235
  installGuideIdTitle: string;
222
236
  installGuideIdExample: string;
223
237
  installGuideIdHint: string;
@@ -231,6 +245,16 @@ export declare const en: {
231
245
  installGuideFill: string;
232
246
  installGuideFillAria: string;
233
247
  installGuideSafety: string;
248
+ registryToggle: string;
249
+ registryLegend: string;
250
+ registryDefault: string;
251
+ registryNpmmirror: string;
252
+ registryWithHost: string;
253
+ registryCustom: string;
254
+ registryCustomPlaceholder: string;
255
+ registryCustomHint: string;
256
+ registryCustomInvalid: string;
257
+ registryListSeparator: string;
234
258
  installRun: string;
235
259
  installChecking: string;
236
260
  installProblemInvalid: string;
@@ -239,14 +263,29 @@ export declare const en: {
239
263
  installProblemNotPackage: string;
240
264
  installProblemNotBundle: string;
241
265
  installProblemNetwork: string;
266
+ installProblemNetworkAll: string;
242
267
  installProblemUnknown: string;
243
268
  installingTitle: string;
244
269
  installedTitle: string;
245
270
  installFailedTitle: string;
246
271
  installEdit: string;
247
272
  installEditAria: string;
273
+ installCancelAndEdit: string;
274
+ installApplyingCancellationError: string;
275
+ installReconcile: string;
276
+ installUnknownTitle: string;
277
+ installUnknownDescription: string;
278
+ installResultUnconfirmed: string;
279
+ installAwaitingAcceptance: string;
280
+ installBackgroundUnknown: string;
248
281
  installCancel: string;
249
282
  installCloseCancels: string;
283
+ installViewTask: string;
284
+ installUnconfirmedTitle: string;
285
+ installBackgroundDone: string;
286
+ installBackgroundFailed: string;
287
+ installBackgroundUnconfirmed: string;
288
+ installBackgroundApplying: string;
250
289
  installStarting: string;
251
290
  installCancelling: string;
252
291
  installApplying: string;
@@ -262,7 +301,12 @@ export declare const en: {
262
301
  installSubjectTarball: string;
263
302
  installLocation: string;
264
303
  installRetry: string;
304
+ installChangeRegistry: string;
305
+ installAttempt: string;
306
+ installAttemptBadge: string;
265
307
  installFailureNetwork: string;
308
+ installFailureNetworkAll: string;
309
+ installFailureNetworkHost: string;
266
310
  installFailureNotFound: string;
267
311
  installFailureNoMatchingVersion: string;
268
312
  installFailureDiskFull: string;