dsh-plugin-shop 0.1.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/README.md +64 -0
- package/README.zh.md +57 -0
- package/cordis.patch.yml +9 -0
- package/lib/client.js +5246 -0
- package/lib/index.js +725 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +312 -0
- package/lib/typert.remote-client.d.ts +30 -0
- package/lib/typert.remote-client.js +200 -0
- package/lib/types/client/StoreTab.d.ts +30 -0
- package/lib/types/client/index.d.ts +30 -0
- package/lib/types/client/locales.d.ts +103 -0
- package/lib/types/client/present.d.ts +78 -0
- package/lib/types/client/useInstall.d.ts +14 -0
- package/lib/types/host/catalog.d.ts +37 -0
- package/lib/types/host/executor.d.ts +32 -0
- package/lib/types/host/index.d.ts +130 -0
- package/lib/types/host/install.d.ts +21 -0
- package/lib/types/host/profile.d.ts +30 -0
- package/lib/types/host/types.d.ts +31 -0
- package/lib/types/index.d.ts +3 -0
- package/package.json +120 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const dsh_plugin_shop_store_catalog_parameter_0$schema = z.union([z.undefined(), z.object({
|
|
5
|
+
'refresh': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
|
|
6
|
+
})])
|
|
7
|
+
const dsh_plugin_shop_store_catalog_result$schema = z.object({
|
|
8
|
+
'schemaVersion': z.number(),
|
|
9
|
+
'builtAt': z.string(),
|
|
10
|
+
'stale': z.boolean(),
|
|
11
|
+
'plugins': z.array(z.object({
|
|
12
|
+
'name': z.string(),
|
|
13
|
+
'version': z.string(),
|
|
14
|
+
'integrity': z.union([z.literal(null), z.string()]),
|
|
15
|
+
'publishedAt': z.union([z.literal(null), z.string()]),
|
|
16
|
+
'repository': z.union([z.literal(null), z.string()]),
|
|
17
|
+
'license': z.union([z.literal(null), z.string()]),
|
|
18
|
+
'tier': z.union([z.literal("verified"), z.literal("verified-stale"), z.literal("community")]),
|
|
19
|
+
'metadata': z.union([z.literal("declared"), z.literal("derived")]),
|
|
20
|
+
'review': z.union([z.undefined(), z.object({
|
|
21
|
+
'reviewedVersion': z.string(),
|
|
22
|
+
'reviewer': z.string(),
|
|
23
|
+
'reviewCommit': z.string(),
|
|
24
|
+
'notes': z.string(),
|
|
25
|
+
})]).optional(),
|
|
26
|
+
'catalog': z.union([z.undefined(), z.object({
|
|
27
|
+
'category': z.union([z.literal("tool"), z.literal("provider"), z.literal("ui"), z.literal("workflow"), z.literal("integration"), z.literal("other")]),
|
|
28
|
+
'summary': z.object({
|
|
29
|
+
'en': z.string(),
|
|
30
|
+
'zh': z.union([z.undefined(), z.string()]).optional(),
|
|
31
|
+
}),
|
|
32
|
+
'capabilities': z.array(z.string()),
|
|
33
|
+
})]).optional(),
|
|
34
|
+
})),
|
|
35
|
+
'denied': z.array(z.object({
|
|
36
|
+
'name': z.string(),
|
|
37
|
+
'detail': z.string(),
|
|
38
|
+
})),
|
|
39
|
+
})
|
|
40
|
+
const dsh_plugin_shop_store_installStart_parameter_0$schema = z.object({
|
|
41
|
+
'name': z.string(),
|
|
42
|
+
'version': z.string(),
|
|
43
|
+
'acknowledged': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
|
|
44
|
+
})
|
|
45
|
+
const dsh_plugin_shop_store_installStart_result$schema = z.union([z.object({
|
|
46
|
+
'ok': z.literal(true),
|
|
47
|
+
'installId': z.string(),
|
|
48
|
+
}), z.object({
|
|
49
|
+
'ok': z.literal(false),
|
|
50
|
+
'code': z.union([z.literal("not-in-catalog"), z.literal("denied"), z.literal("version-mismatch"), z.literal("needs-acknowledgement")]),
|
|
51
|
+
'detail': z.string(),
|
|
52
|
+
})])
|
|
53
|
+
const dsh_plugin_shop_store_installStatus_parameter_0$schema = z.object({
|
|
54
|
+
'installId': z.string(),
|
|
55
|
+
})
|
|
56
|
+
const dsh_plugin_shop_store_installStatus_result$schema = z.object({
|
|
57
|
+
'found': z.boolean(),
|
|
58
|
+
'state': z.union([z.literal("running"), z.literal("done"), z.literal("failed")]),
|
|
59
|
+
'log': z.array(z.string()),
|
|
60
|
+
'needsRestart': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
|
|
61
|
+
'detail': z.union([z.undefined(), z.string()]).optional(),
|
|
62
|
+
})
|
|
63
|
+
const dsh_plugin_shop_store_outdated_result$schema = z.array(z.object({
|
|
64
|
+
'name': z.string(),
|
|
65
|
+
'installed': z.string(),
|
|
66
|
+
'latest': z.string(),
|
|
67
|
+
}))
|
|
68
|
+
const dsh_plugin_shop_store_setEnabled_parameter_0$schema = z.object({
|
|
69
|
+
'name': z.string(),
|
|
70
|
+
'enabled': z.boolean(),
|
|
71
|
+
})
|
|
72
|
+
const dsh_plugin_shop_store_setEnabled_result$schema = z.object({
|
|
73
|
+
'ok': z.boolean(),
|
|
74
|
+
'detail': z.union([z.undefined(), z.string()]).optional(),
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
export const TYPERT = {
|
|
78
|
+
package: 'dsh-plugin-shop',
|
|
79
|
+
face: 'host',
|
|
80
|
+
schemas: [
|
|
81
|
+
],
|
|
82
|
+
invocations: [
|
|
83
|
+
{
|
|
84
|
+
id: 'dsh-plugin-shop#store/catalog',
|
|
85
|
+
service: 'store',
|
|
86
|
+
namespace: 'store',
|
|
87
|
+
method: 'catalog',
|
|
88
|
+
invocation: { kind: 'direct' },
|
|
89
|
+
parameters: [
|
|
90
|
+
{
|
|
91
|
+
name: 'args',
|
|
92
|
+
wire: 'args',
|
|
93
|
+
source: 'json',
|
|
94
|
+
acceptsUndefined: true,
|
|
95
|
+
codec: {
|
|
96
|
+
mode: 'strict',
|
|
97
|
+
typeSymbol: 'dsh-plugin-shop#store/catalog:args',
|
|
98
|
+
schema: dsh_plugin_shop_store_catalog_parameter_0$schema,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
result: {
|
|
103
|
+
mode: 'strict',
|
|
104
|
+
typeSymbol: 'dsh-plugin-shop/types#StoreCatalogResult',
|
|
105
|
+
schema: dsh_plugin_shop_store_catalog_result$schema,
|
|
106
|
+
},
|
|
107
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":177,"column":9},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 'dsh-plugin-shop#store/installStart',
|
|
111
|
+
service: 'store',
|
|
112
|
+
namespace: 'store',
|
|
113
|
+
method: 'installStart',
|
|
114
|
+
implementation: 'install',
|
|
115
|
+
invocation: { kind: 'direct' },
|
|
116
|
+
parameters: [
|
|
117
|
+
{
|
|
118
|
+
name: 'args',
|
|
119
|
+
wire: 'args',
|
|
120
|
+
source: 'json',
|
|
121
|
+
codec: {
|
|
122
|
+
mode: 'strict',
|
|
123
|
+
typeSymbol: 'dsh-plugin-shop/types#InstallArgs',
|
|
124
|
+
schema: dsh_plugin_shop_store_installStart_parameter_0$schema,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
result: {
|
|
129
|
+
mode: 'strict',
|
|
130
|
+
typeSymbol: 'dsh-plugin-shop/types#StoreInstallResult',
|
|
131
|
+
schema: dsh_plugin_shop_store_installStart_result$schema,
|
|
132
|
+
},
|
|
133
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":202,"column":9},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'dsh-plugin-shop#store/installStatus',
|
|
137
|
+
service: 'store',
|
|
138
|
+
namespace: 'store',
|
|
139
|
+
method: 'installStatus',
|
|
140
|
+
invocation: { kind: 'direct' },
|
|
141
|
+
parameters: [
|
|
142
|
+
{
|
|
143
|
+
name: 'args',
|
|
144
|
+
wire: 'args',
|
|
145
|
+
source: 'json',
|
|
146
|
+
codec: {
|
|
147
|
+
mode: 'strict',
|
|
148
|
+
typeSymbol: 'dsh-plugin-shop#store/installStatus:args',
|
|
149
|
+
schema: dsh_plugin_shop_store_installStatus_parameter_0$schema,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
result: {
|
|
154
|
+
mode: 'strict',
|
|
155
|
+
typeSymbol: 'dsh-plugin-shop/types#StoreInstallStatusResult',
|
|
156
|
+
schema: dsh_plugin_shop_store_installStatus_result$schema,
|
|
157
|
+
},
|
|
158
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":240,"column":3},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'dsh-plugin-shop#store/outdated',
|
|
162
|
+
service: 'store',
|
|
163
|
+
namespace: 'store',
|
|
164
|
+
method: 'outdated',
|
|
165
|
+
invocation: { kind: 'direct' },
|
|
166
|
+
parameters: [
|
|
167
|
+
],
|
|
168
|
+
result: {
|
|
169
|
+
mode: 'strict',
|
|
170
|
+
typeSymbol: 'dsh-plugin-shop#store/outdated:result',
|
|
171
|
+
schema: dsh_plugin_shop_store_outdated_result$schema,
|
|
172
|
+
},
|
|
173
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":248,"column":9},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: 'dsh-plugin-shop#store/setEnabled',
|
|
177
|
+
service: 'store',
|
|
178
|
+
namespace: 'store',
|
|
179
|
+
method: 'setEnabled',
|
|
180
|
+
invocation: { kind: 'direct' },
|
|
181
|
+
parameters: [
|
|
182
|
+
{
|
|
183
|
+
name: 'args',
|
|
184
|
+
wire: 'args',
|
|
185
|
+
source: 'json',
|
|
186
|
+
codec: {
|
|
187
|
+
mode: 'strict',
|
|
188
|
+
typeSymbol: 'dsh-plugin-shop#store/setEnabled:args',
|
|
189
|
+
schema: dsh_plugin_shop_store_setEnabled_parameter_0$schema,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
result: {
|
|
194
|
+
mode: 'strict',
|
|
195
|
+
typeSymbol: 'dsh-plugin-shop/types#StoreSetEnabledResult',
|
|
196
|
+
schema: dsh_plugin_shop_store_setEnabled_result$schema,
|
|
197
|
+
},
|
|
198
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":146,"column":3},
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
model: {
|
|
202
|
+
"services": [
|
|
203
|
+
{
|
|
204
|
+
"description": "Remote-only service exposing the store Remote methods of §7.3.",
|
|
205
|
+
"summary": "Remote-only service exposing the store Remote methods of §7.3.",
|
|
206
|
+
"tags": [
|
|
207
|
+
{
|
|
208
|
+
"name": "typert",
|
|
209
|
+
"comment": "service store",
|
|
210
|
+
"text": "@typert service store"
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"jsDoc": "/** Remote-only service exposing the store Remote methods of §7.3.\n *\n * @typert service store */",
|
|
214
|
+
"key": "store",
|
|
215
|
+
"exportName": "StoreGateway",
|
|
216
|
+
"members": [
|
|
217
|
+
{
|
|
218
|
+
"kind": "method",
|
|
219
|
+
"name": "setEnabled",
|
|
220
|
+
"signature": "@Remote('setEnabled') setEnabled(args: { name: string; enabled: boolean }): StoreSetEnabledResult",
|
|
221
|
+
"summary": "Enable or disable one installed plugin, hot (§8): a disable writes the row to the user layer, an enable drops it again so the bundle default rules — the CLI's watchUserPatches applies either through HMR.",
|
|
222
|
+
"jsDoc": "/** Enable or disable one installed plugin, hot (§8): a disable writes the\n * row to the user layer, an enable drops it again so the bundle default\n * rules — the CLI's watchUserPatches applies either through HMR. */"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"kind": "method",
|
|
226
|
+
"name": "catalog",
|
|
227
|
+
"signature": "@Remote('catalog') async catalog(args?: { refresh?: boolean }): Promise<StoreCatalogResult>",
|
|
228
|
+
"summary": "Browse the catalog (§7.3): cached snapshot, refreshed on demand.",
|
|
229
|
+
"jsDoc": "/** Browse the catalog (§7.3): cached snapshot, refreshed on demand. */"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"kind": "method",
|
|
233
|
+
"name": "install",
|
|
234
|
+
"signature": "@Remote('installStart') async install(args: InstallArgs): Promise<StoreInstallResult>",
|
|
235
|
+
"summary": "Install one cataloged version into the profile (§7.2).",
|
|
236
|
+
"jsDoc": "/**\n * Install one cataloged version into the profile (§7.2). The four rejection\n * paths run against this Host's snapshot before anything is spawned; only a\n * passing request reaches the executor.\n */"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"kind": "method",
|
|
240
|
+
"name": "installStatus",
|
|
241
|
+
"signature": "@Remote('installStatus') installStatus(args: { installId: string }): StoreInstallStatusResult",
|
|
242
|
+
"summary": "Poll one install's progress (§7.2); unknown ids report `found: false`.",
|
|
243
|
+
"jsDoc": "/** Poll one install's progress (§7.2); unknown ids report `found: false`. */"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"kind": "method",
|
|
247
|
+
"name": "outdated",
|
|
248
|
+
"signature": "@Remote('outdated') async outdated(): Promise<StoreOutdatedEntry[]>",
|
|
249
|
+
"summary": "Installed plugins whose installed version is older than the catalog's (§7.3).",
|
|
250
|
+
"jsDoc": "/** Installed plugins whose installed version is older than the catalog's (§7.3). */"
|
|
251
|
+
}
|
|
252
|
+
],
|
|
253
|
+
"types": [
|
|
254
|
+
{
|
|
255
|
+
"name": "CatalogEntry",
|
|
256
|
+
"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; reviewer: string; reviewCommit: string; notes: string; };\n catalog?: CatalogSection;\n}"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "CatalogSection",
|
|
260
|
+
"declaration": "export interface CatalogSection {\n category: 'tool' | 'provider' | 'ui' | 'workflow' | 'integration' | 'other';\n summary: CatalogSummary;\n capabilities: string[];\n}"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "CatalogSummary",
|
|
264
|
+
"declaration": "export interface CatalogSummary {\n en: string;\n zh?: string;\n}"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "DeniedEntry",
|
|
268
|
+
"declaration": "export interface DeniedEntry {\n name: string;\n detail: string;\n}"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "InstallArgs",
|
|
272
|
+
"declaration": "export interface InstallArgs {\n name: string;\n version: string;\n acknowledged?: boolean;\n}"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"name": "InstallRejectionCode",
|
|
276
|
+
"declaration": "export type InstallRejectionCode = 'not-in-catalog' | 'denied' | 'version-mismatch' | 'needs-acknowledgement';"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "InstallState",
|
|
280
|
+
"declaration": "export type InstallState = 'running' | 'done' | 'failed';"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"name": "InstallStatus",
|
|
284
|
+
"declaration": "export interface InstallStatus {\n state: InstallState;\n log: string[];\n needsRestart?: boolean;\n detail?: string;\n}"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"name": "StoreCatalogResult",
|
|
288
|
+
"declaration": "export interface StoreCatalogResult {\n schemaVersion: number;\n builtAt: string;\n stale: boolean;\n plugins: CatalogEntry[];\n denied: DeniedEntry[];\n}"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "StoreInstallResult",
|
|
292
|
+
"declaration": "export type StoreInstallResult = { ok: true; installId: string; } | { ok: false; code: InstallRejectionCode; detail: string; };"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "StoreInstallStatusResult",
|
|
296
|
+
"declaration": "export interface StoreInstallStatusResult extends InstallStatus {\n found: boolean;\n}"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"name": "StoreOutdatedEntry",
|
|
300
|
+
"declaration": "export interface StoreOutdatedEntry {\n name: string;\n installed: string;\n latest: string;\n}"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "StoreSetEnabledResult",
|
|
304
|
+
"declaration": "export interface StoreSetEnabledResult {\n ok: boolean;\n detail?: string;\n}"
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"events": [],
|
|
310
|
+
"objects": []
|
|
311
|
+
},
|
|
312
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import type { InstallArgs, StoreCatalogResult, StoreInstallResult, StoreInstallStatusResult, StoreOutdatedEntry, StoreSetEnabledResult } from 'dsh-plugin-shop/types'
|
|
7
|
+
|
|
8
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
9
|
+
interface TypertRemoteNamespace$73746f7265 {
|
|
10
|
+
catalog: (args?: { refresh?: boolean; }) => Promise<RemoteResult<StoreCatalogResult>>
|
|
11
|
+
installStart: (args: InstallArgs) => Promise<RemoteResult<StoreInstallResult>>
|
|
12
|
+
installStatus: (args: { installId: string; }) => Promise<RemoteResult<StoreInstallStatusResult>>
|
|
13
|
+
outdated: () => Promise<RemoteResult<StoreOutdatedEntry[]>>
|
|
14
|
+
setEnabled: (args: { name: string; enabled: boolean; }) => Promise<RemoteResult<StoreSetEnabledResult>>
|
|
15
|
+
}
|
|
16
|
+
interface TypertRemoteMap {
|
|
17
|
+
'store/catalog': (args?: { refresh?: boolean; }) => Promise<RemoteResult<StoreCatalogResult>>
|
|
18
|
+
'store/installStart': (args: InstallArgs) => Promise<RemoteResult<StoreInstallResult>>
|
|
19
|
+
'store/installStatus': (args: { installId: string; }) => Promise<RemoteResult<StoreInstallStatusResult>>
|
|
20
|
+
'store/outdated': () => Promise<RemoteResult<StoreOutdatedEntry[]>>
|
|
21
|
+
'store/setEnabled': (args: { name: string; enabled: boolean; }) => Promise<RemoteResult<StoreSetEnabledResult>>
|
|
22
|
+
}
|
|
23
|
+
interface TypertRemoteNamespaceMap {
|
|
24
|
+
'store': TypertRemoteNamespace$73746f7265
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare const TYPERT_REMOTE: TypertRemoteContribution
|
|
29
|
+
export default TYPERT_REMOTE
|
|
30
|
+
//# sourceMappingURL=typert.remote-client.d.ts.map
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const dsh_plugin_shop_store_catalog_parameter_0$schema = z.union([z.undefined(), z.object({
|
|
5
|
+
'refresh': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
|
|
6
|
+
})])
|
|
7
|
+
const dsh_plugin_shop_store_catalog_result$schema = z.object({
|
|
8
|
+
'schemaVersion': z.number(),
|
|
9
|
+
'builtAt': z.string(),
|
|
10
|
+
'stale': z.boolean(),
|
|
11
|
+
'plugins': z.array(z.object({
|
|
12
|
+
'name': z.string(),
|
|
13
|
+
'version': z.string(),
|
|
14
|
+
'integrity': z.union([z.literal(null), z.string()]),
|
|
15
|
+
'publishedAt': z.union([z.literal(null), z.string()]),
|
|
16
|
+
'repository': z.union([z.literal(null), z.string()]),
|
|
17
|
+
'license': z.union([z.literal(null), z.string()]),
|
|
18
|
+
'tier': z.union([z.literal("verified"), z.literal("verified-stale"), z.literal("community")]),
|
|
19
|
+
'metadata': z.union([z.literal("declared"), z.literal("derived")]),
|
|
20
|
+
'review': z.union([z.undefined(), z.object({
|
|
21
|
+
'reviewedVersion': z.string(),
|
|
22
|
+
'reviewer': z.string(),
|
|
23
|
+
'reviewCommit': z.string(),
|
|
24
|
+
'notes': z.string(),
|
|
25
|
+
})]).optional(),
|
|
26
|
+
'catalog': z.union([z.undefined(), z.object({
|
|
27
|
+
'category': z.union([z.literal("tool"), z.literal("provider"), z.literal("ui"), z.literal("workflow"), z.literal("integration"), z.literal("other")]),
|
|
28
|
+
'summary': z.object({
|
|
29
|
+
'en': z.string(),
|
|
30
|
+
'zh': z.union([z.undefined(), z.string()]).optional(),
|
|
31
|
+
}),
|
|
32
|
+
'capabilities': z.array(z.string()),
|
|
33
|
+
})]).optional(),
|
|
34
|
+
})),
|
|
35
|
+
'denied': z.array(z.object({
|
|
36
|
+
'name': z.string(),
|
|
37
|
+
'detail': z.string(),
|
|
38
|
+
})),
|
|
39
|
+
})
|
|
40
|
+
const dsh_plugin_shop_store_installStart_parameter_0$schema = z.object({
|
|
41
|
+
'name': z.string(),
|
|
42
|
+
'version': z.string(),
|
|
43
|
+
'acknowledged': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
|
|
44
|
+
})
|
|
45
|
+
const dsh_plugin_shop_store_installStart_result$schema = z.union([z.object({
|
|
46
|
+
'ok': z.literal(true),
|
|
47
|
+
'installId': z.string(),
|
|
48
|
+
}), z.object({
|
|
49
|
+
'ok': z.literal(false),
|
|
50
|
+
'code': z.union([z.literal("not-in-catalog"), z.literal("denied"), z.literal("version-mismatch"), z.literal("needs-acknowledgement")]),
|
|
51
|
+
'detail': z.string(),
|
|
52
|
+
})])
|
|
53
|
+
const dsh_plugin_shop_store_installStatus_parameter_0$schema = z.object({
|
|
54
|
+
'installId': z.string(),
|
|
55
|
+
})
|
|
56
|
+
const dsh_plugin_shop_store_installStatus_result$schema = z.object({
|
|
57
|
+
'found': z.boolean(),
|
|
58
|
+
'state': z.union([z.literal("running"), z.literal("done"), z.literal("failed")]),
|
|
59
|
+
'log': z.array(z.string()),
|
|
60
|
+
'needsRestart': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
|
|
61
|
+
'detail': z.union([z.undefined(), z.string()]).optional(),
|
|
62
|
+
})
|
|
63
|
+
const dsh_plugin_shop_store_outdated_result$schema = z.array(z.object({
|
|
64
|
+
'name': z.string(),
|
|
65
|
+
'installed': z.string(),
|
|
66
|
+
'latest': z.string(),
|
|
67
|
+
}))
|
|
68
|
+
const dsh_plugin_shop_store_setEnabled_parameter_0$schema = z.object({
|
|
69
|
+
'name': z.string(),
|
|
70
|
+
'enabled': z.boolean(),
|
|
71
|
+
})
|
|
72
|
+
const dsh_plugin_shop_store_setEnabled_result$schema = z.object({
|
|
73
|
+
'ok': z.boolean(),
|
|
74
|
+
'detail': z.union([z.undefined(), z.string()]).optional(),
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
export const TYPERT_REMOTE = {
|
|
78
|
+
package: 'dsh-plugin-shop',
|
|
79
|
+
descriptors: [
|
|
80
|
+
{
|
|
81
|
+
id: 'dsh-plugin-shop#store/catalog',
|
|
82
|
+
service: 'store',
|
|
83
|
+
namespace: 'store',
|
|
84
|
+
method: 'catalog',
|
|
85
|
+
invocation: { kind: 'direct' },
|
|
86
|
+
parameters: [
|
|
87
|
+
{
|
|
88
|
+
name: 'args',
|
|
89
|
+
wire: 'args',
|
|
90
|
+
source: 'json',
|
|
91
|
+
acceptsUndefined: true,
|
|
92
|
+
codec: {
|
|
93
|
+
mode: 'strict',
|
|
94
|
+
typeSymbol: 'dsh-plugin-shop#store/catalog:args',
|
|
95
|
+
schema: dsh_plugin_shop_store_catalog_parameter_0$schema,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
result: {
|
|
100
|
+
mode: 'strict',
|
|
101
|
+
typeSymbol: 'dsh-plugin-shop/types#StoreCatalogResult',
|
|
102
|
+
schema: dsh_plugin_shop_store_catalog_result$schema,
|
|
103
|
+
},
|
|
104
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":177,"column":9},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'dsh-plugin-shop#store/installStart',
|
|
108
|
+
service: 'store',
|
|
109
|
+
namespace: 'store',
|
|
110
|
+
method: 'installStart',
|
|
111
|
+
implementation: 'install',
|
|
112
|
+
invocation: { kind: 'direct' },
|
|
113
|
+
parameters: [
|
|
114
|
+
{
|
|
115
|
+
name: 'args',
|
|
116
|
+
wire: 'args',
|
|
117
|
+
source: 'json',
|
|
118
|
+
codec: {
|
|
119
|
+
mode: 'strict',
|
|
120
|
+
typeSymbol: 'dsh-plugin-shop/types#InstallArgs',
|
|
121
|
+
schema: dsh_plugin_shop_store_installStart_parameter_0$schema,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
result: {
|
|
126
|
+
mode: 'strict',
|
|
127
|
+
typeSymbol: 'dsh-plugin-shop/types#StoreInstallResult',
|
|
128
|
+
schema: dsh_plugin_shop_store_installStart_result$schema,
|
|
129
|
+
},
|
|
130
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":202,"column":9},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 'dsh-plugin-shop#store/installStatus',
|
|
134
|
+
service: 'store',
|
|
135
|
+
namespace: 'store',
|
|
136
|
+
method: 'installStatus',
|
|
137
|
+
invocation: { kind: 'direct' },
|
|
138
|
+
parameters: [
|
|
139
|
+
{
|
|
140
|
+
name: 'args',
|
|
141
|
+
wire: 'args',
|
|
142
|
+
source: 'json',
|
|
143
|
+
codec: {
|
|
144
|
+
mode: 'strict',
|
|
145
|
+
typeSymbol: 'dsh-plugin-shop#store/installStatus:args',
|
|
146
|
+
schema: dsh_plugin_shop_store_installStatus_parameter_0$schema,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
result: {
|
|
151
|
+
mode: 'strict',
|
|
152
|
+
typeSymbol: 'dsh-plugin-shop/types#StoreInstallStatusResult',
|
|
153
|
+
schema: dsh_plugin_shop_store_installStatus_result$schema,
|
|
154
|
+
},
|
|
155
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":240,"column":3},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 'dsh-plugin-shop#store/outdated',
|
|
159
|
+
service: 'store',
|
|
160
|
+
namespace: 'store',
|
|
161
|
+
method: 'outdated',
|
|
162
|
+
invocation: { kind: 'direct' },
|
|
163
|
+
parameters: [
|
|
164
|
+
],
|
|
165
|
+
result: {
|
|
166
|
+
mode: 'strict',
|
|
167
|
+
typeSymbol: 'dsh-plugin-shop#store/outdated:result',
|
|
168
|
+
schema: dsh_plugin_shop_store_outdated_result$schema,
|
|
169
|
+
},
|
|
170
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":248,"column":9},
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 'dsh-plugin-shop#store/setEnabled',
|
|
174
|
+
service: 'store',
|
|
175
|
+
namespace: 'store',
|
|
176
|
+
method: 'setEnabled',
|
|
177
|
+
invocation: { kind: 'direct' },
|
|
178
|
+
parameters: [
|
|
179
|
+
{
|
|
180
|
+
name: 'args',
|
|
181
|
+
wire: 'args',
|
|
182
|
+
source: 'json',
|
|
183
|
+
codec: {
|
|
184
|
+
mode: 'strict',
|
|
185
|
+
typeSymbol: 'dsh-plugin-shop#store/setEnabled:args',
|
|
186
|
+
schema: dsh_plugin_shop_store_setEnabled_parameter_0$schema,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
result: {
|
|
191
|
+
mode: 'strict',
|
|
192
|
+
typeSymbol: 'dsh-plugin-shop/types#StoreSetEnabledResult',
|
|
193
|
+
schema: dsh_plugin_shop_store_setEnabled_result$schema,
|
|
194
|
+
},
|
|
195
|
+
sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":146,"column":3},
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export default TYPERT_REMOTE
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** The store tab: browse the catalog, detail an entry, install with the
|
|
2
|
+
* acknowledgement gate, poll the install to its terminal state (§7.2).
|
|
3
|
+
* Everything the tab renders is text — summaries, capabilities, log lines,
|
|
4
|
+
* details — never markup, so hostile npm descriptions cannot inject (spec
|
|
5
|
+
* §11.3.4): no render path here may ever use dangerouslySetInnerHTML. */
|
|
6
|
+
import { type ReactNode } from 'react';
|
|
7
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
8
|
+
import type { InstallArgs, StoreCatalogResult, StoreInstallResult, StoreInstallStatusResult, StoreOutdatedEntry, StoreSetEnabledResult } from '../host/index.ts';
|
|
9
|
+
/** The tab's Remote face: the Host result types, already unwrapped from the
|
|
10
|
+
* wire envelope by `index.ts`; `catalog` throws on a wire error so the tab's
|
|
11
|
+
* error state renders. */
|
|
12
|
+
export interface StoreTabInjected {
|
|
13
|
+
catalog: (args?: {
|
|
14
|
+
refresh?: boolean;
|
|
15
|
+
}) => Promise<StoreCatalogResult>;
|
|
16
|
+
install: (args: InstallArgs) => Promise<StoreInstallResult>;
|
|
17
|
+
installStatus: (args: {
|
|
18
|
+
installId: string;
|
|
19
|
+
}) => Promise<StoreInstallStatusResult>;
|
|
20
|
+
setEnabled: (args: {
|
|
21
|
+
name: string;
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
}) => Promise<StoreSetEnabledResult>;
|
|
24
|
+
outdated: () => Promise<StoreOutdatedEntry[]>;
|
|
25
|
+
}
|
|
26
|
+
/** Full component props assembled by the Settings slot renderer. */
|
|
27
|
+
export type StoreTabProps = PropsRuntime<'settings.plugins.tab'> & PropsLocale<'settings.store'> & InjectFace<StoreTabInjected>;
|
|
28
|
+
/** The store tab root: browse, search, refresh, and render one card per
|
|
29
|
+
* entry. Data attributes on the e2e-relevant nodes follow the Task 3 list. */
|
|
30
|
+
export declare function StoreTab(props: StoreTabProps): ReactNode;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store settings surface, browser half — one tab in `settings.plugins.tab`
|
|
3
|
+
* that browses the catalog, installs with acknowledgement, toggles
|
|
4
|
+
* enablement, and lists outdated installs. Mounts the store Remote itself
|
|
5
|
+
* (the assembly does not know this package) and holds no privilege beyond
|
|
6
|
+
* the five `store/*` methods (§5.3).
|
|
7
|
+
*/
|
|
8
|
+
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
|
|
9
|
+
import type { StoreLocaleKey } from './locales.ts';
|
|
10
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
11
|
+
interface LocaleNamespaceMap {
|
|
12
|
+
/** Store settings tab copy. */
|
|
13
|
+
'settings.store': StoreLocaleKey;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** Dictionary namespace owned by this plugin. */
|
|
17
|
+
export declare const NS = "settings.store";
|
|
18
|
+
/** Services required by the tab registration and the Remote mount.
|
|
19
|
+
*
|
|
20
|
+
* `remote.store` is deliberately ABSENT: this package both mounts its own
|
|
21
|
+
* Remote (the assembly does not know it, §7.3) and consumes it, and cordis
|
|
22
|
+
* will not let one package do both through the inject face. Declaring the
|
|
23
|
+
* face makes the boot's activation gate wait for the `remote.store` service —
|
|
24
|
+
* which only this package's own apply can register — and the real web boot
|
|
25
|
+
* deadlocked on exactly that ("waiting for service: remote.store"). The
|
|
26
|
+
* namespace is therefore read through the reflect store instead (`ctx.get`,
|
|
27
|
+
* see apply), which has no inject requirement. */
|
|
28
|
+
export declare const inject: string[];
|
|
29
|
+
/** Mount the store Remote and contribute the store tab. */
|
|
30
|
+
export declare function apply(ctx: ClientContext): Promise<void>;
|