@deepseek-ai/dsh-plugin-manager 0.1.6-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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +133 -0
- package/README.zh.md +133 -0
- package/lib/index.js +1174 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +604 -0
- package/lib/typert.remote-client.d.ts +37 -0
- package/lib/typert.remote-client.js +393 -0
- package/lib/types/build-approval.d.ts +12 -0
- package/lib/types/build-approval.js +56 -0
- package/lib/types/failure.d.ts +10 -0
- package/lib/types/failure.js +8 -0
- package/lib/types/index.d.ts +107 -0
- package/lib/types/index.js +623 -0
- package/lib/types/install-failure.d.ts +23 -0
- package/lib/types/install-failure.js +33 -0
- package/lib/types/install-spec.d.ts +44 -0
- package/lib/types/install-spec.js +73 -0
- package/lib/types/operations.d.ts +93 -0
- package/lib/types/operations.js +177 -0
- package/lib/types/patch.d.ts +9 -0
- package/lib/types/patch.js +50 -0
- package/lib/types/tools.d.ts +8 -0
- package/lib/types/tools.js +74 -0
- package/lib/types/types.d.ts +169 -0
- package/lib/types/types.js +2 -0
- package/package.json +102 -0
|
@@ -0,0 +1,393 @@
|
|
|
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_plugin_manager_pluginManager_cancelInstall_parameter_0$schema$value
|
|
5
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_cancelInstall_parameter_0$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_cancelInstall_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
|
|
6
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_cancelInstall_result$schema$value
|
|
7
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_cancelInstall_result$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_cancelInstall_result$schema$value ??= z.object({
|
|
8
|
+
'status': z.union([z.literal("cancelled"), z.literal("not-running"), z.literal("too-late")]).readonly(),
|
|
9
|
+
}))
|
|
10
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_inspect_parameter_0$schema$value
|
|
11
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_inspect_parameter_0$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_inspect_parameter_0$schema$value ??= z.string())
|
|
12
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_inspect_result$schema$value
|
|
13
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_inspect_result$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_inspect_result$schema$value ??= z.union([z.object({
|
|
14
|
+
'status': z.literal("accepted").readonly(),
|
|
15
|
+
'kind': z.union([z.literal("registry"), z.literal("path"), z.literal("git"), z.literal("tarball")]).readonly(),
|
|
16
|
+
'name': z.string().readonly().optional(),
|
|
17
|
+
'version': z.string().readonly().optional(),
|
|
18
|
+
'description': z.string().readonly().optional(),
|
|
19
|
+
'bundle': z.union([z.literal(null), z.literal(false), z.literal(true)]).readonly(),
|
|
20
|
+
}), z.object({
|
|
21
|
+
'status': z.literal("refused").readonly(),
|
|
22
|
+
'problem': z.union([z.literal("invalid-spec"), z.literal("already-installed"), z.literal("not-found"), z.literal("not-a-package"), z.literal("not-a-bundle"), z.literal("network"), z.literal("unknown")]).readonly(),
|
|
23
|
+
'reason': z.string().readonly(),
|
|
24
|
+
})]))
|
|
25
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_parameter_0$schema$value
|
|
26
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_parameter_0$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_parameter_0$schema$value ??= z.string())
|
|
27
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_parameter_1$schema$value
|
|
28
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_parameter_1$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_parameter_1$schema$value ??= z.union([z.undefined(), z.object({
|
|
29
|
+
'enabled': z.boolean().optional(),
|
|
30
|
+
'requestId': z.intersection(z.string(), z.unknown()).optional(),
|
|
31
|
+
'approvedBuilds': z.array(z.string()).optional(),
|
|
32
|
+
})]))
|
|
33
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_result$schema$value
|
|
34
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_result$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_result$schema$value ??= z.object({
|
|
35
|
+
'changed': z.boolean(),
|
|
36
|
+
'application': z.union([z.literal("failed"), z.literal("cancelled"), z.literal("applied"), z.literal("restart-required"), z.literal("overridden")]),
|
|
37
|
+
'stage': z.union([z.literal("remove"), z.literal("install"), z.literal("enable")]),
|
|
38
|
+
'target': z.string(),
|
|
39
|
+
'enabled': z.boolean().optional(),
|
|
40
|
+
'error': z.object({
|
|
41
|
+
'code': z.union([z.literal("management-required"), z.literal("unaddressable"), z.literal("unknown-plugin"), z.literal("invalid-spec"), z.literal("ambiguous-install"), z.literal("not-bundle"), z.literal("not-removable"), z.literal("stop-profile"), z.literal("bundle-in-use"), z.literal("stale-approval"), z.literal("operation-error")]),
|
|
42
|
+
'diagnostic': z.string().optional(),
|
|
43
|
+
}).optional(),
|
|
44
|
+
'warnings': z.array(z.string()).optional(),
|
|
45
|
+
'packageResult': z.object({
|
|
46
|
+
'exitCode': z.number(),
|
|
47
|
+
'output': z.string(),
|
|
48
|
+
'truncated': z.boolean(),
|
|
49
|
+
'logPath': z.string(),
|
|
50
|
+
'kind': z.union([z.literal("not-found"), z.literal("network"), z.literal("unknown"), z.literal("pnpm-missing"), z.literal("timeout"), z.literal("no-matching-version"), z.literal("disk-full"), z.literal("permission"), z.literal("build-blocked"), z.literal("integrity")]).optional(),
|
|
51
|
+
}).optional(),
|
|
52
|
+
'bundle': z.string().optional(),
|
|
53
|
+
'pendingBuilds': z.array(z.string()).optional(),
|
|
54
|
+
'approvedBuilds': z.array(z.string()).optional(),
|
|
55
|
+
}))
|
|
56
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_listBundles_result$schema$value
|
|
57
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_listBundles_result$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_listBundles_result$schema$value ??= z.array(z.object({
|
|
58
|
+
'name': z.string(),
|
|
59
|
+
'version': z.string().optional(),
|
|
60
|
+
'description': z.string().optional(),
|
|
61
|
+
'enabled': z.boolean(),
|
|
62
|
+
'installed': z.boolean(),
|
|
63
|
+
'optional': z.boolean(),
|
|
64
|
+
'removable': z.boolean(),
|
|
65
|
+
'readOnlyReason': z.union([z.literal("management-required"), z.literal("unaddressable")]).optional(),
|
|
66
|
+
'error': z.object({
|
|
67
|
+
'code': z.union([z.literal("management-required"), z.literal("unaddressable"), z.literal("unknown-plugin"), z.literal("invalid-spec"), z.literal("ambiguous-install"), z.literal("not-bundle"), z.literal("not-removable"), z.literal("stop-profile"), z.literal("bundle-in-use"), z.literal("stale-approval"), z.literal("operation-error")]),
|
|
68
|
+
'diagnostic': z.string().optional(),
|
|
69
|
+
}).optional(),
|
|
70
|
+
'rows': z.array(z.object({
|
|
71
|
+
'rowId': z.string(),
|
|
72
|
+
'moduleName': z.string(),
|
|
73
|
+
'entryId': z.intersection(z.string(), z.unknown()).optional(),
|
|
74
|
+
})),
|
|
75
|
+
'overrides': z.array(z.string()),
|
|
76
|
+
})))
|
|
77
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_listPlugins_result$schema$value
|
|
78
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_listPlugins_result$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_listPlugins_result$schema$value ??= z.array(z.union([z.intersection(z.object({
|
|
79
|
+
'entryId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
80
|
+
'moduleName': z.string().readonly(),
|
|
81
|
+
'enabled': z.boolean().readonly(),
|
|
82
|
+
'fiberPhase': z.union([z.literal(null), z.literal("pending"), z.literal("active"), z.literal("failed"), z.literal("loading"), z.literal("unloading")]).readonly(),
|
|
83
|
+
}), z.object({
|
|
84
|
+
'patchId': z.string(),
|
|
85
|
+
'readOnlyReason': z.never().optional(),
|
|
86
|
+
})), z.intersection(z.object({
|
|
87
|
+
'entryId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
88
|
+
'moduleName': z.string().readonly(),
|
|
89
|
+
'enabled': z.boolean().readonly(),
|
|
90
|
+
'fiberPhase': z.union([z.literal(null), z.literal("pending"), z.literal("active"), z.literal("failed"), z.literal("loading"), z.literal("unloading")]).readonly(),
|
|
91
|
+
}), z.object({
|
|
92
|
+
'patchId': z.never().optional(),
|
|
93
|
+
'readOnlyReason': z.union([z.literal("management-required"), z.literal("unaddressable")]),
|
|
94
|
+
}))])))
|
|
95
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_removeBundle_parameter_0$schema$value
|
|
96
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_removeBundle_parameter_0$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_removeBundle_parameter_0$schema$value ??= z.string())
|
|
97
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_removeBundle_result$schema$value
|
|
98
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_removeBundle_result$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_removeBundle_result$schema$value ??= z.object({
|
|
99
|
+
'changed': z.boolean(),
|
|
100
|
+
'application': z.union([z.literal("failed"), z.literal("cancelled"), z.literal("applied"), z.literal("restart-required"), z.literal("overridden")]),
|
|
101
|
+
'stage': z.union([z.literal("remove"), z.literal("install"), z.literal("enable")]),
|
|
102
|
+
'target': z.string(),
|
|
103
|
+
'enabled': z.boolean().optional(),
|
|
104
|
+
'error': z.object({
|
|
105
|
+
'code': z.union([z.literal("management-required"), z.literal("unaddressable"), z.literal("unknown-plugin"), z.literal("invalid-spec"), z.literal("ambiguous-install"), z.literal("not-bundle"), z.literal("not-removable"), z.literal("stop-profile"), z.literal("bundle-in-use"), z.literal("stale-approval"), z.literal("operation-error")]),
|
|
106
|
+
'diagnostic': z.string().optional(),
|
|
107
|
+
}).optional(),
|
|
108
|
+
'warnings': z.array(z.string()).optional(),
|
|
109
|
+
'packageResult': z.object({
|
|
110
|
+
'exitCode': z.number(),
|
|
111
|
+
'output': z.string(),
|
|
112
|
+
'truncated': z.boolean(),
|
|
113
|
+
'logPath': z.string(),
|
|
114
|
+
'kind': z.union([z.literal("not-found"), z.literal("network"), z.literal("unknown"), z.literal("pnpm-missing"), z.literal("timeout"), z.literal("no-matching-version"), z.literal("disk-full"), z.literal("permission"), z.literal("build-blocked"), z.literal("integrity")]).optional(),
|
|
115
|
+
}).optional(),
|
|
116
|
+
'bundle': z.string().optional(),
|
|
117
|
+
'pendingBuilds': z.array(z.string()).optional(),
|
|
118
|
+
'approvedBuilds': z.array(z.string()).optional(),
|
|
119
|
+
}))
|
|
120
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_parameter_0$schema$value
|
|
121
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_parameter_0$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_parameter_0$schema$value ??= z.string())
|
|
122
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_parameter_1$schema$value
|
|
123
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_parameter_1$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_parameter_1$schema$value ??= z.boolean())
|
|
124
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_result$schema$value
|
|
125
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_result$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_result$schema$value ??= z.object({
|
|
126
|
+
'changed': z.boolean(),
|
|
127
|
+
'application': z.union([z.literal("failed"), z.literal("cancelled"), z.literal("applied"), z.literal("restart-required"), z.literal("overridden")]),
|
|
128
|
+
'stage': z.union([z.literal("remove"), z.literal("install"), z.literal("enable")]),
|
|
129
|
+
'target': z.string(),
|
|
130
|
+
'enabled': z.boolean().optional(),
|
|
131
|
+
'error': z.object({
|
|
132
|
+
'code': z.union([z.literal("management-required"), z.literal("unaddressable"), z.literal("unknown-plugin"), z.literal("invalid-spec"), z.literal("ambiguous-install"), z.literal("not-bundle"), z.literal("not-removable"), z.literal("stop-profile"), z.literal("bundle-in-use"), z.literal("stale-approval"), z.literal("operation-error")]),
|
|
133
|
+
'diagnostic': z.string().optional(),
|
|
134
|
+
}).optional(),
|
|
135
|
+
'warnings': z.array(z.string()).optional(),
|
|
136
|
+
'packageResult': z.object({
|
|
137
|
+
'exitCode': z.number(),
|
|
138
|
+
'output': z.string(),
|
|
139
|
+
'truncated': z.boolean(),
|
|
140
|
+
'logPath': z.string(),
|
|
141
|
+
'kind': z.union([z.literal("not-found"), z.literal("network"), z.literal("unknown"), z.literal("pnpm-missing"), z.literal("timeout"), z.literal("no-matching-version"), z.literal("disk-full"), z.literal("permission"), z.literal("build-blocked"), z.literal("integrity")]).optional(),
|
|
142
|
+
}).optional(),
|
|
143
|
+
'bundle': z.string().optional(),
|
|
144
|
+
'pendingBuilds': z.array(z.string()).optional(),
|
|
145
|
+
'approvedBuilds': z.array(z.string()).optional(),
|
|
146
|
+
}))
|
|
147
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_parameter_0$schema$value
|
|
148
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_parameter_0$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
|
|
149
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_parameter_1$schema$value
|
|
150
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_parameter_1$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_parameter_1$schema$value ??= z.boolean())
|
|
151
|
+
let _deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_result$schema$value
|
|
152
|
+
const _deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_result$schema = () => (_deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_result$schema$value ??= z.object({
|
|
153
|
+
'changed': z.boolean(),
|
|
154
|
+
'application': z.union([z.literal("failed"), z.literal("cancelled"), z.literal("applied"), z.literal("restart-required"), z.literal("overridden")]),
|
|
155
|
+
'stage': z.union([z.literal("remove"), z.literal("install"), z.literal("enable")]),
|
|
156
|
+
'target': z.string(),
|
|
157
|
+
'enabled': z.boolean().optional(),
|
|
158
|
+
'error': z.object({
|
|
159
|
+
'code': z.union([z.literal("management-required"), z.literal("unaddressable"), z.literal("unknown-plugin"), z.literal("invalid-spec"), z.literal("ambiguous-install"), z.literal("not-bundle"), z.literal("not-removable"), z.literal("stop-profile"), z.literal("bundle-in-use"), z.literal("stale-approval"), z.literal("operation-error")]),
|
|
160
|
+
'diagnostic': z.string().optional(),
|
|
161
|
+
}).optional(),
|
|
162
|
+
'warnings': z.array(z.string()).optional(),
|
|
163
|
+
'packageResult': z.object({
|
|
164
|
+
'exitCode': z.number(),
|
|
165
|
+
'output': z.string(),
|
|
166
|
+
'truncated': z.boolean(),
|
|
167
|
+
'logPath': z.string(),
|
|
168
|
+
'kind': z.union([z.literal("not-found"), z.literal("network"), z.literal("unknown"), z.literal("pnpm-missing"), z.literal("timeout"), z.literal("no-matching-version"), z.literal("disk-full"), z.literal("permission"), z.literal("build-blocked"), z.literal("integrity")]).optional(),
|
|
169
|
+
}).optional(),
|
|
170
|
+
'bundle': z.string().optional(),
|
|
171
|
+
'pendingBuilds': z.array(z.string()).optional(),
|
|
172
|
+
'approvedBuilds': z.array(z.string()).optional(),
|
|
173
|
+
}))
|
|
174
|
+
|
|
175
|
+
export const TYPERT_REMOTE = {
|
|
176
|
+
package: '@deepseek-ai/dsh-plugin-manager',
|
|
177
|
+
descriptors: [
|
|
178
|
+
{
|
|
179
|
+
id: '@deepseek-ai/dsh-plugin-manager#pluginManager/cancelInstall',
|
|
180
|
+
service: 'pluginManager',
|
|
181
|
+
namespace: 'pluginManager',
|
|
182
|
+
method: 'cancelInstall',
|
|
183
|
+
invocation: { kind: 'direct' },
|
|
184
|
+
parameters: [
|
|
185
|
+
{
|
|
186
|
+
name: 'requestId',
|
|
187
|
+
wire: 'requestId',
|
|
188
|
+
source: 'json',
|
|
189
|
+
codec: {
|
|
190
|
+
mode: 'strict',
|
|
191
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager/types#PluginInstallRequestId',
|
|
192
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_cancelInstall_parameter_0$schema,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
result: {
|
|
197
|
+
mode: 'strict',
|
|
198
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager/types#PluginInstallCancellation',
|
|
199
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_cancelInstall_result$schema,
|
|
200
|
+
},
|
|
201
|
+
sourceLocation: {"file":"packages/boot/plugin-manager/src/index.ts","line":406,"column":9},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: '@deepseek-ai/dsh-plugin-manager#pluginManager/inspect',
|
|
205
|
+
service: 'pluginManager',
|
|
206
|
+
namespace: 'pluginManager',
|
|
207
|
+
method: 'inspect',
|
|
208
|
+
invocation: { kind: 'direct' },
|
|
209
|
+
parameters: [
|
|
210
|
+
{
|
|
211
|
+
name: 'spec',
|
|
212
|
+
wire: 'spec',
|
|
213
|
+
source: 'json',
|
|
214
|
+
codec: {
|
|
215
|
+
mode: 'strict',
|
|
216
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager#pluginManager/inspect:spec',
|
|
217
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_inspect_parameter_0$schema,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
cancellation: { parameter: 'signal' },
|
|
222
|
+
result: {
|
|
223
|
+
mode: 'strict',
|
|
224
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager/types#PluginSpecInspection',
|
|
225
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_inspect_result$schema,
|
|
226
|
+
},
|
|
227
|
+
sourceLocation: {"file":"packages/boot/plugin-manager/src/index.ts","line":233,"column":9},
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
id: '@deepseek-ai/dsh-plugin-manager#pluginManager/installBundle',
|
|
231
|
+
service: 'pluginManager',
|
|
232
|
+
namespace: 'pluginManager',
|
|
233
|
+
method: 'installBundle',
|
|
234
|
+
invocation: { kind: 'direct' },
|
|
235
|
+
parameters: [
|
|
236
|
+
{
|
|
237
|
+
name: 'spec',
|
|
238
|
+
wire: 'spec',
|
|
239
|
+
source: 'json',
|
|
240
|
+
codec: {
|
|
241
|
+
mode: 'strict',
|
|
242
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager#pluginManager/installBundle:spec',
|
|
243
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_parameter_0$schema,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: 'options',
|
|
248
|
+
wire: 'options',
|
|
249
|
+
source: 'json',
|
|
250
|
+
acceptsUndefined: true,
|
|
251
|
+
codec: {
|
|
252
|
+
mode: 'strict',
|
|
253
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager/types#InstallBundleOptions',
|
|
254
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_parameter_1$schema,
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
result: {
|
|
259
|
+
mode: 'strict',
|
|
260
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager/types#ChangeResult',
|
|
261
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_installBundle_result$schema,
|
|
262
|
+
},
|
|
263
|
+
sourceLocation: {"file":"packages/boot/plugin-manager/src/index.ts","line":338,"column":3},
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
id: '@deepseek-ai/dsh-plugin-manager#pluginManager/listBundles',
|
|
267
|
+
service: 'pluginManager',
|
|
268
|
+
namespace: 'pluginManager',
|
|
269
|
+
method: 'listBundles',
|
|
270
|
+
invocation: { kind: 'direct' },
|
|
271
|
+
parameters: [
|
|
272
|
+
],
|
|
273
|
+
result: {
|
|
274
|
+
mode: 'strict',
|
|
275
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager#pluginManager/listBundles:result',
|
|
276
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_listBundles_result$schema,
|
|
277
|
+
},
|
|
278
|
+
sourceLocation: {"file":"packages/boot/plugin-manager/src/index.ts","line":194,"column":3},
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: '@deepseek-ai/dsh-plugin-manager#pluginManager/listPlugins',
|
|
282
|
+
service: 'pluginManager',
|
|
283
|
+
namespace: 'pluginManager',
|
|
284
|
+
method: 'listPlugins',
|
|
285
|
+
invocation: { kind: 'direct' },
|
|
286
|
+
parameters: [
|
|
287
|
+
],
|
|
288
|
+
result: {
|
|
289
|
+
mode: 'strict',
|
|
290
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager#pluginManager/listPlugins:result',
|
|
291
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_listPlugins_result$schema,
|
|
292
|
+
},
|
|
293
|
+
sourceLocation: {"file":"packages/boot/plugin-manager/src/index.ts","line":170,"column":9},
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
id: '@deepseek-ai/dsh-plugin-manager#pluginManager/removeBundle',
|
|
297
|
+
service: 'pluginManager',
|
|
298
|
+
namespace: 'pluginManager',
|
|
299
|
+
method: 'removeBundle',
|
|
300
|
+
invocation: { kind: 'direct' },
|
|
301
|
+
parameters: [
|
|
302
|
+
{
|
|
303
|
+
name: 'name',
|
|
304
|
+
wire: 'name',
|
|
305
|
+
source: 'json',
|
|
306
|
+
codec: {
|
|
307
|
+
mode: 'strict',
|
|
308
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager#pluginManager/removeBundle:name',
|
|
309
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_removeBundle_parameter_0$schema,
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
],
|
|
313
|
+
result: {
|
|
314
|
+
mode: 'strict',
|
|
315
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager/types#ChangeResult',
|
|
316
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_removeBundle_result$schema,
|
|
317
|
+
},
|
|
318
|
+
sourceLocation: {"file":"packages/boot/plugin-manager/src/index.ts","line":421,"column":3},
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
id: '@deepseek-ai/dsh-plugin-manager#pluginManager/setBundleEnabled',
|
|
322
|
+
service: 'pluginManager',
|
|
323
|
+
namespace: 'pluginManager',
|
|
324
|
+
method: 'setBundleEnabled',
|
|
325
|
+
invocation: { kind: 'direct' },
|
|
326
|
+
parameters: [
|
|
327
|
+
{
|
|
328
|
+
name: 'name',
|
|
329
|
+
wire: 'name',
|
|
330
|
+
source: 'json',
|
|
331
|
+
codec: {
|
|
332
|
+
mode: 'strict',
|
|
333
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager#pluginManager/setBundleEnabled:name',
|
|
334
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_parameter_0$schema,
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: 'enabled',
|
|
339
|
+
wire: 'enabled',
|
|
340
|
+
source: 'json',
|
|
341
|
+
codec: {
|
|
342
|
+
mode: 'strict',
|
|
343
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager#pluginManager/setBundleEnabled:enabled',
|
|
344
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_parameter_1$schema,
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
],
|
|
348
|
+
result: {
|
|
349
|
+
mode: 'strict',
|
|
350
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager/types#ChangeResult',
|
|
351
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_setBundleEnabled_result$schema,
|
|
352
|
+
},
|
|
353
|
+
sourceLocation: {"file":"packages/boot/plugin-manager/src/index.ts","line":321,"column":3},
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
id: '@deepseek-ai/dsh-plugin-manager#pluginManager/setPluginEnabled',
|
|
357
|
+
service: 'pluginManager',
|
|
358
|
+
namespace: 'pluginManager',
|
|
359
|
+
method: 'setPluginEnabled',
|
|
360
|
+
invocation: { kind: 'direct' },
|
|
361
|
+
parameters: [
|
|
362
|
+
{
|
|
363
|
+
name: 'id',
|
|
364
|
+
wire: 'id',
|
|
365
|
+
source: 'json',
|
|
366
|
+
codec: {
|
|
367
|
+
mode: 'strict',
|
|
368
|
+
typeSymbol: '@deepseek-ai/dsh-host-plugin-inventory/types#PluginEntryId',
|
|
369
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_parameter_0$schema,
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: 'enabled',
|
|
374
|
+
wire: 'enabled',
|
|
375
|
+
source: 'json',
|
|
376
|
+
codec: {
|
|
377
|
+
mode: 'strict',
|
|
378
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager#pluginManager/setPluginEnabled:enabled',
|
|
379
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_parameter_1$schema,
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
],
|
|
383
|
+
result: {
|
|
384
|
+
mode: 'strict',
|
|
385
|
+
typeSymbol: '@deepseek-ai/dsh-plugin-manager/types#ChangeResult',
|
|
386
|
+
create: _deepseek_ai_dsh_plugin_manager_pluginManager_setPluginEnabled_result$schema,
|
|
387
|
+
},
|
|
388
|
+
sourceLocation: {"file":"packages/boot/plugin-manager/src/index.ts","line":303,"column":3},
|
|
389
|
+
},
|
|
390
|
+
],
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export default TYPERT_REMOTE
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Read package names left undecided by pnpm 11, including after installation cleanup.
|
|
2
|
+
* @param dir Current profile directory.
|
|
3
|
+
* @returns Exact package names awaiting a build decision; wildcard rules are excluded.
|
|
4
|
+
*/
|
|
5
|
+
export declare function readPendingBuilds(dir: string): Promise<string[]>;
|
|
6
|
+
/** Persist approval without running scripts; the caller holds the profile manifest lock.
|
|
7
|
+
* @param dir Current profile directory.
|
|
8
|
+
* @param names Explicit package names from the pending build list.
|
|
9
|
+
* @throws If a name is no longer pending or allowBuilds contains YAML anchors or aliases; no approvals are written.
|
|
10
|
+
*/
|
|
11
|
+
export declare function approveBuilds(dir: string, names: readonly string[]): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=build-approval.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Approve pnpm's pending dependency scripts in the current profile's workspace settings. */
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { isAlias, isMap, isNode, isScalar, parseDocument, visit } from 'yaml';
|
|
5
|
+
import { ManagementFailure } from "./failure.js";
|
|
6
|
+
import { writeFileAtomic } from '@deepseek-ai/dsh-atomic-write';
|
|
7
|
+
async function readPolicy(dir) {
|
|
8
|
+
let text;
|
|
9
|
+
try {
|
|
10
|
+
text = await readFile(join(dir, 'pnpm-workspace.yaml'), 'utf8');
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
if (error.code !== 'ENOENT')
|
|
14
|
+
throw error;
|
|
15
|
+
text = '{}\n';
|
|
16
|
+
}
|
|
17
|
+
const document = parseDocument(text);
|
|
18
|
+
if (document.errors[0] !== undefined)
|
|
19
|
+
throw document.errors[0];
|
|
20
|
+
if (!isMap(document.contents))
|
|
21
|
+
throw new Error('pnpm-workspace.yaml must be a YAML mapping');
|
|
22
|
+
const builds = document.get('allowBuilds');
|
|
23
|
+
if (builds !== undefined && !isMap(builds))
|
|
24
|
+
throw new Error('allowBuilds must be a YAML mapping');
|
|
25
|
+
visit(builds ?? null, (_key, node) => {
|
|
26
|
+
if (isAlias(node) || (isNode(node) && 'anchor' in node && node.anchor)) {
|
|
27
|
+
throw new Error('allowBuilds must not contain YAML anchors or aliases');
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const pending = isMap(builds) ? builds.items.flatMap(({ key, value }) => isScalar(key) && typeof key.value === 'string' && !/[*?]/.test(key.value)
|
|
31
|
+
&& isScalar(value) && value.value === 'set this to true or false' ? [key.value] : []) : [];
|
|
32
|
+
return { document, pending };
|
|
33
|
+
}
|
|
34
|
+
/** Read package names left undecided by pnpm 11, including after installation cleanup.
|
|
35
|
+
* @param dir Current profile directory.
|
|
36
|
+
* @returns Exact package names awaiting a build decision; wildcard rules are excluded.
|
|
37
|
+
*/
|
|
38
|
+
export async function readPendingBuilds(dir) {
|
|
39
|
+
return (await readPolicy(dir)).pending;
|
|
40
|
+
}
|
|
41
|
+
/** Persist approval without running scripts; the caller holds the profile manifest lock.
|
|
42
|
+
* @param dir Current profile directory.
|
|
43
|
+
* @param names Explicit package names from the pending build list.
|
|
44
|
+
* @throws If a name is no longer pending or allowBuilds contains YAML anchors or aliases; no approvals are written.
|
|
45
|
+
*/
|
|
46
|
+
export async function approveBuilds(dir, names) {
|
|
47
|
+
const { document, pending } = await readPolicy(dir);
|
|
48
|
+
if (names.some(name => !pending.includes(name)))
|
|
49
|
+
throw new ManagementFailure('stale-approval');
|
|
50
|
+
if (names.length === 0)
|
|
51
|
+
return;
|
|
52
|
+
for (const name of names)
|
|
53
|
+
document.setIn(['allowBuilds', name], true);
|
|
54
|
+
await writeFileAtomic(join(dir, 'pnpm-workspace.yaml'), String(document), { mode: 0o600 });
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=build-approval.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Localizable rejections shared by profile management operations. */
|
|
2
|
+
import type { ManagementError } from './types.ts';
|
|
3
|
+
/** Expected management rejection; presentation belongs to the caller's locale. */
|
|
4
|
+
export declare class ManagementFailure extends Error {
|
|
5
|
+
/** Code rendered by the caller's locale dictionary. */
|
|
6
|
+
readonly code: ManagementError['code'];
|
|
7
|
+
/** @param code Localizable management rejection. */
|
|
8
|
+
constructor(code: ManagementError['code']);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=failure.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Expected management rejection; presentation belongs to the caller's locale. */
|
|
2
|
+
export class ManagementFailure extends Error {
|
|
3
|
+
/** Code rendered by the caller's locale dictionary. */
|
|
4
|
+
code;
|
|
5
|
+
/** @param code Localizable management rejection. */
|
|
6
|
+
constructor(code) { super(code); this.code = code; }
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=failure.js.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import z from '@deepseek-ai/schemastery';
|
|
3
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
4
|
+
import type { BundleInfo, ChangeResult, InstallBundleOptions, PluginEntryId, PluginInfo, PluginInstallCancellation, PluginInstallRequestId, PluginSpecInspection } from './types.ts';
|
|
5
|
+
export type * from './types.ts';
|
|
6
|
+
export { classifyInstallFailure, type InstallFailureFacts } from './install-failure.ts';
|
|
7
|
+
export { InvalidInstallSpecError, parseInstallSpec, type ParsedInstallSpec } from './install-spec.ts';
|
|
8
|
+
/** The pnpm executable and the limits for package diagnostics and registry lookups. */
|
|
9
|
+
export interface Config {
|
|
10
|
+
/** The pnpm executable name or path; resolved through `PATH` like the `dsh plugin` command. */
|
|
11
|
+
pnpmCommand?: string;
|
|
12
|
+
/** Maximum retained pnpm diagnostic bytes per operation. */
|
|
13
|
+
outputBytes?: number;
|
|
14
|
+
/** Maximum time to wait for another process's profile package operation. */
|
|
15
|
+
lockWaitMs?: number;
|
|
16
|
+
/** Bound on one registry lookup an inspection runs, in milliseconds. */
|
|
17
|
+
inspectTimeoutMs?: number;
|
|
18
|
+
}
|
|
19
|
+
declare module '@deepseek-ai/cordis' {
|
|
20
|
+
interface Context {
|
|
21
|
+
/** Persistent management of the current profile's composition and packages. */
|
|
22
|
+
pluginManager: PluginManager;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Manage profile files and apply their declared reload lifecycle. */
|
|
26
|
+
export declare class PluginManager extends TypertRemoteService {
|
|
27
|
+
static inject: string[];
|
|
28
|
+
static Config: z<Config>;
|
|
29
|
+
private readonly ownerEntryId;
|
|
30
|
+
private readonly packageOperations;
|
|
31
|
+
private readonly profile;
|
|
32
|
+
private readonly outputBytes;
|
|
33
|
+
private readonly lockWaitMs;
|
|
34
|
+
private readonly inspectTimeoutMs;
|
|
35
|
+
private readonly pnpmCommand;
|
|
36
|
+
private readonly ownerContext;
|
|
37
|
+
private readonly abort;
|
|
38
|
+
/** Installations by request id, from their call until it settles. */
|
|
39
|
+
private readonly installs;
|
|
40
|
+
constructor(ctx: Context, config: Config);
|
|
41
|
+
/** Read current plugins, including why a row cannot be changed through the profile patch.
|
|
42
|
+
* @returns Current runtime entries with persistent patch targets.
|
|
43
|
+
*/
|
|
44
|
+
listPlugins(): Promise<PluginInfo[]>;
|
|
45
|
+
/** Read the profile's installed bundles, the bundles this dsh installation supplies, and the selected names that are not bundles.
|
|
46
|
+
* A dependency without a bundle patch is listed, as a `not-bundle` problem, only while it is selected.
|
|
47
|
+
* @returns Package versions, one-liners, rows, activation selections, whether the installation offers the
|
|
48
|
+
* bundle, and removal availability.
|
|
49
|
+
*/
|
|
50
|
+
listBundles(): Promise<BundleInfo[]>;
|
|
51
|
+
/** Read what a spec names before installing it.
|
|
52
|
+
* @param spec One package spec: a registry name, an absolute path, a git address, or a tarball.
|
|
53
|
+
* @param signal Ends a registry lookup early.
|
|
54
|
+
* @returns The package the spec names, or why it is refused.
|
|
55
|
+
*/
|
|
56
|
+
inspect(spec: string, signal?: AbortSignal): Promise<PluginSpecInspection>;
|
|
57
|
+
/** Persist a plugin entry's desired enablement and apply it on live profiles.
|
|
58
|
+
* @param id Loader entry identity returned by listPlugins.
|
|
59
|
+
* @param enabled Whether the plugin should run.
|
|
60
|
+
* @returns Saved and runtime outcomes, including higher-priority overrides.
|
|
61
|
+
*/
|
|
62
|
+
setPluginEnabled(id: PluginEntryId, enabled: boolean): Promise<ChangeResult>;
|
|
63
|
+
/** Select or remove a bundle layer while retaining installed dependencies.
|
|
64
|
+
* @param name Bundle package name.
|
|
65
|
+
* @param enabled Whether the bundle contributes its patch layer.
|
|
66
|
+
* @returns Persisted and runtime outcomes.
|
|
67
|
+
*/
|
|
68
|
+
setBundleEnabled(name: string, enabled: boolean): Promise<ChangeResult>;
|
|
69
|
+
/**
|
|
70
|
+
* Install a package using the same pnpm implementation as dsh plugin. A run
|
|
71
|
+
* that fails, is cancelled, or adds a package without a bundle patch restores
|
|
72
|
+
* `package.json` and `pnpm-lock.yaml` as they were; downloaded files can stay.
|
|
73
|
+
* @param spec One package spec, including local paths relative to the invocation directory.
|
|
74
|
+
* @param options Whether to activate the installed bundle (defaults to true), the request id a cancellation names, and
|
|
75
|
+
* the pending build scripts to allow for this profile before pnpm runs.
|
|
76
|
+
* @returns Package-manager diagnostics and observed activation outcome.
|
|
77
|
+
*/
|
|
78
|
+
installBundle(spec: string, options?: InstallBundleOptions): Promise<ChangeResult>;
|
|
79
|
+
/** Stop an installation this manager owns and wait until its files are back.
|
|
80
|
+
* @param requestId The id the installation was started with.
|
|
81
|
+
* @returns `cancelled` once pnpm exited and the files are restored, `too-late` once the bundle is being
|
|
82
|
+
* applied, `not-running` for any other id.
|
|
83
|
+
*/
|
|
84
|
+
cancelInstall(requestId: PluginInstallRequestId): Promise<PluginInstallCancellation>;
|
|
85
|
+
/** Unload and remove a profile-owned bundle dependency through dsh plugin's pnpm path.
|
|
86
|
+
* @param name Installed dependency name.
|
|
87
|
+
* @returns Removal diagnostics and the remaining profile state.
|
|
88
|
+
*/
|
|
89
|
+
removeBundle(name: string): Promise<ChangeResult>;
|
|
90
|
+
/** The rows a bundle's patch inserts and the existing rows it changes; an unreadable patch throws. */
|
|
91
|
+
private declaredRows;
|
|
92
|
+
/** Run one pnpm command in the profile, streaming its output as install-log chunks. */
|
|
93
|
+
private runPnpm;
|
|
94
|
+
/** The profile files an installation may rewrite, as they are now; absent files read as undefined. */
|
|
95
|
+
private readRestoredFiles;
|
|
96
|
+
/** Put the profile files back; pnpm has exited by the time this runs. */
|
|
97
|
+
private restoreFiles;
|
|
98
|
+
private selectBundle;
|
|
99
|
+
private bundleRows;
|
|
100
|
+
private protectsManager;
|
|
101
|
+
private configure;
|
|
102
|
+
private reload;
|
|
103
|
+
private change;
|
|
104
|
+
private diskState;
|
|
105
|
+
}
|
|
106
|
+
export default PluginManager;
|
|
107
|
+
//# sourceMappingURL=index.d.ts.map
|