@deepseek-ai/dsh-api-settings-controller 0.1.2-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.
@@ -0,0 +1,407 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ const JsonValueRemoteCodec$schema = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))])
5
+ const JsonValueRemoteCodec$schema2 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema2)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema2))])
6
+ const JsonValueRemoteCodec$schema3 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))])
7
+ const JsonValueRemoteCodec$schema4 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4))])
8
+ const JsonValueRemoteCodec$schema5 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5))])
9
+ const JsonValueRemoteCodec$schema6 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema6)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema6))])
10
+ const JsonValueRemoteCodec$schema7 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema7)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema7))])
11
+ const _deepseek_ai_dsh_api_settings_controller_credentials_describe_parameter_0$schema = z.array(z.string())
12
+ const _deepseek_ai_dsh_api_settings_controller_credentials_describe_result$schema = z.record(z.string(), z.object({
13
+ 'configured': z.boolean(),
14
+ 'source': z.string().optional(),
15
+ 'writable': z.boolean(),
16
+ }))
17
+ const _deepseek_ai_dsh_api_settings_controller_credentials_set_parameter_0$schema = z.string()
18
+ const _deepseek_ai_dsh_api_settings_controller_credentials_set_parameter_1$schema = z.string()
19
+ const _deepseek_ai_dsh_api_settings_controller_credentials_set_result$schema = z.void()
20
+ const _deepseek_ai_dsh_api_settings_controller_credentials_unset_parameter_0$schema = z.string()
21
+ const _deepseek_ai_dsh_api_settings_controller_credentials_unset_result$schema = z.void()
22
+ const _deepseek_ai_dsh_api_settings_controller_settings_canOpenAgentPresetDirectory_result$schema = z.boolean()
23
+ const _deepseek_ai_dsh_api_settings_controller_settings_describe_result$schema = z.object({
24
+ 'writable': z.boolean(),
25
+ 'hasDocument': z.boolean(),
26
+ 'namespaces': z.array(z.object({
27
+ 'ns': z.string(),
28
+ 'schema': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))]),
29
+ 'value': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))]),
30
+ 'base': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))]).optional(),
31
+ 'user': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))]).optional(),
32
+ 'applies': z.union([z.literal("live"), z.literal("restart")]),
33
+ 'secrets': z.array(z.object({
34
+ 'path': z.array(z.string()),
35
+ 'set': z.boolean(),
36
+ })),
37
+ 'revision': z.number(),
38
+ })),
39
+ })
40
+ const _deepseek_ai_dsh_api_settings_controller_settings_mutate_parameter_0$schema = z.string()
41
+ const _deepseek_ai_dsh_api_settings_controller_settings_mutate_parameter_1$schema = z.array(z.union([z.object({
42
+ 'op': z.literal("set"),
43
+ 'path': z.array(z.string()),
44
+ 'value': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema6)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema6))]),
45
+ }), z.object({
46
+ 'op': z.literal("unset"),
47
+ 'path': z.array(z.string()),
48
+ })]))
49
+ const _deepseek_ai_dsh_api_settings_controller_settings_mutate_parameter_2$schema = z.union([z.undefined(), z.number()])
50
+ const _deepseek_ai_dsh_api_settings_controller_settings_mutate_result$schema = z.object({
51
+ 'ns': z.string(),
52
+ 'schema': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema7)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema7))]),
53
+ 'value': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema7)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema7))]),
54
+ 'base': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema7)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema7))]).optional(),
55
+ 'user': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema7)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema7))]).optional(),
56
+ 'applies': z.union([z.literal("live"), z.literal("restart")]),
57
+ 'secrets': z.array(z.object({
58
+ 'path': z.array(z.string()),
59
+ 'set': z.boolean(),
60
+ })),
61
+ 'revision': z.number(),
62
+ })
63
+ const _deepseek_ai_dsh_api_settings_controller_settings_openAgentPresetDirectory_parameter_0$schema = z.string()
64
+ const _deepseek_ai_dsh_api_settings_controller_settings_openAgentPresetDirectory_result$schema = z.union([z.object({
65
+ 'opened': z.literal(true).readonly(),
66
+ }), z.object({
67
+ 'opened': z.literal(false).readonly(),
68
+ 'path': z.string().readonly(),
69
+ })])
70
+ const _deepseek_ai_dsh_api_settings_controller_settings_openSettingsDocument_result$schema = z.object({
71
+ 'opened': z.literal(true).readonly(),
72
+ })
73
+ const _deepseek_ai_dsh_api_settings_controller_settings_replace_parameter_0$schema = z.string()
74
+ const _deepseek_ai_dsh_api_settings_controller_settings_replace_parameter_1$schema = z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4))]))
75
+ const _deepseek_ai_dsh_api_settings_controller_settings_replace_parameter_2$schema = z.union([z.undefined(), z.number()])
76
+ const _deepseek_ai_dsh_api_settings_controller_settings_replace_result$schema = z.object({
77
+ 'ns': z.string(),
78
+ 'schema': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5))]),
79
+ 'value': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5))]),
80
+ 'base': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5))]).optional(),
81
+ 'user': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5))]).optional(),
82
+ 'applies': z.union([z.literal("live"), z.literal("restart")]),
83
+ 'secrets': z.array(z.object({
84
+ 'path': z.array(z.string()),
85
+ 'set': z.boolean(),
86
+ })),
87
+ 'revision': z.number(),
88
+ })
89
+ const _deepseek_ai_dsh_api_settings_controller_settings_update_parameter_0$schema = z.string()
90
+ const _deepseek_ai_dsh_api_settings_controller_settings_update_parameter_1$schema = z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema2)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema2))]))
91
+ const _deepseek_ai_dsh_api_settings_controller_settings_update_parameter_2$schema = z.union([z.undefined(), z.number()])
92
+ const _deepseek_ai_dsh_api_settings_controller_settings_update_result$schema = z.object({
93
+ 'ns': z.string(),
94
+ 'schema': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]),
95
+ 'value': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]),
96
+ 'base': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]).optional(),
97
+ 'user': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]).optional(),
98
+ 'applies': z.union([z.literal("live"), z.literal("restart")]),
99
+ 'secrets': z.array(z.object({
100
+ 'path': z.array(z.string()),
101
+ 'set': z.boolean(),
102
+ })),
103
+ 'revision': z.number(),
104
+ })
105
+
106
+ export const TYPERT_REMOTE = {
107
+ package: '@deepseek-ai/dsh-api-settings-controller',
108
+ descriptors: [
109
+ {
110
+ id: '@deepseek-ai/dsh-api-settings-controller#credentials/describe',
111
+ service: 'credentialsController',
112
+ namespace: 'credentials',
113
+ method: 'describe',
114
+ invocation: { kind: 'direct' },
115
+ parameters: [
116
+ {
117
+ name: 'refs',
118
+ wire: 'refs',
119
+ source: 'json',
120
+ codec: {
121
+ mode: 'strict',
122
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#credentials/describe:refs',
123
+ schema: _deepseek_ai_dsh_api_settings_controller_credentials_describe_parameter_0$schema,
124
+ },
125
+ },
126
+ ],
127
+ result: {
128
+ mode: 'strict',
129
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#credentials/describe:result',
130
+ schema: _deepseek_ai_dsh_api_settings_controller_credentials_describe_result$schema,
131
+ },
132
+ sourceLocation: {"file":"packages/api/settings-controller/src/credentials.ts","line":83,"column":9},
133
+ },
134
+ {
135
+ id: '@deepseek-ai/dsh-api-settings-controller#credentials/set',
136
+ service: 'credentialsController',
137
+ namespace: 'credentials',
138
+ method: 'set',
139
+ invocation: { kind: 'direct' },
140
+ parameters: [
141
+ {
142
+ name: 'ref',
143
+ wire: 'ref',
144
+ source: 'json',
145
+ codec: {
146
+ mode: 'strict',
147
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#credentials/set:ref',
148
+ schema: _deepseek_ai_dsh_api_settings_controller_credentials_set_parameter_0$schema,
149
+ },
150
+ },
151
+ {
152
+ name: 'value',
153
+ wire: 'value',
154
+ source: 'json',
155
+ codec: {
156
+ mode: 'strict',
157
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#credentials/set:value',
158
+ schema: _deepseek_ai_dsh_api_settings_controller_credentials_set_parameter_1$schema,
159
+ },
160
+ },
161
+ ],
162
+ result: {
163
+ mode: 'strict',
164
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#credentials/set:result',
165
+ schema: _deepseek_ai_dsh_api_settings_controller_credentials_set_result$schema,
166
+ },
167
+ sourceLocation: {"file":"packages/api/settings-controller/src/credentials.ts","line":100,"column":9},
168
+ },
169
+ {
170
+ id: '@deepseek-ai/dsh-api-settings-controller#credentials/unset',
171
+ service: 'credentialsController',
172
+ namespace: 'credentials',
173
+ method: 'unset',
174
+ invocation: { kind: 'direct' },
175
+ parameters: [
176
+ {
177
+ name: 'ref',
178
+ wire: 'ref',
179
+ source: 'json',
180
+ codec: {
181
+ mode: 'strict',
182
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#credentials/unset:ref',
183
+ schema: _deepseek_ai_dsh_api_settings_controller_credentials_unset_parameter_0$schema,
184
+ },
185
+ },
186
+ ],
187
+ result: {
188
+ mode: 'strict',
189
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#credentials/unset:result',
190
+ schema: _deepseek_ai_dsh_api_settings_controller_credentials_unset_result$schema,
191
+ },
192
+ sourceLocation: {"file":"packages/api/settings-controller/src/credentials.ts","line":113,"column":9},
193
+ },
194
+ {
195
+ id: '@deepseek-ai/dsh-api-settings-controller#settings/canOpenAgentPresetDirectory',
196
+ service: 'settingsController',
197
+ namespace: 'settings',
198
+ method: 'canOpenAgentPresetDirectory',
199
+ invocation: { kind: 'direct' },
200
+ parameters: [
201
+ ],
202
+ result: {
203
+ mode: 'strict',
204
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/canOpenAgentPresetDirectory:result',
205
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_canOpenAgentPresetDirectory_result$schema,
206
+ },
207
+ sourceLocation: {"file":"packages/api/settings-controller/src/index.ts","line":131,"column":3},
208
+ },
209
+ {
210
+ id: '@deepseek-ai/dsh-api-settings-controller#settings/describe',
211
+ service: 'settingsController',
212
+ namespace: 'settings',
213
+ method: 'describe',
214
+ invocation: { kind: 'direct' },
215
+ parameters: [
216
+ ],
217
+ result: {
218
+ mode: 'strict',
219
+ typeSymbol: '@deepseek-ai/dsh-settings/types#SettingsDescribeValue',
220
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_describe_result$schema,
221
+ },
222
+ sourceLocation: {"file":"packages/api/settings-controller/src/index.ts","line":117,"column":3},
223
+ },
224
+ {
225
+ id: '@deepseek-ai/dsh-api-settings-controller#settings/mutate',
226
+ service: 'settingsController',
227
+ namespace: 'settings',
228
+ method: 'mutate',
229
+ invocation: { kind: 'direct' },
230
+ parameters: [
231
+ {
232
+ name: 'ns',
233
+ wire: 'ns',
234
+ source: 'json',
235
+ codec: {
236
+ mode: 'strict',
237
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/mutate:ns',
238
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_mutate_parameter_0$schema,
239
+ },
240
+ },
241
+ {
242
+ name: 'ops',
243
+ wire: 'ops',
244
+ source: 'json',
245
+ codec: {
246
+ mode: 'strict',
247
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/mutate:ops',
248
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_mutate_parameter_1$schema,
249
+ },
250
+ },
251
+ {
252
+ name: 'expectedRevision',
253
+ wire: 'expectedRevision',
254
+ source: 'json',
255
+ acceptsUndefined: true,
256
+ codec: {
257
+ mode: 'strict',
258
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/mutate:expectedRevision',
259
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_mutate_parameter_2$schema,
260
+ },
261
+ },
262
+ ],
263
+ result: {
264
+ mode: 'strict',
265
+ typeSymbol: '@deepseek-ai/dsh-settings/types#SettingsNamespaceView',
266
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_mutate_result$schema,
267
+ },
268
+ sourceLocation: {"file":"packages/api/settings-controller/src/index.ts","line":180,"column":9},
269
+ },
270
+ {
271
+ id: '@deepseek-ai/dsh-api-settings-controller#settings/openAgentPresetDirectory',
272
+ service: 'settingsController',
273
+ namespace: 'settings',
274
+ method: 'openAgentPresetDirectory',
275
+ invocation: { kind: 'direct' },
276
+ parameters: [
277
+ {
278
+ name: 'agentPreset',
279
+ wire: 'agentPreset',
280
+ source: 'json',
281
+ codec: {
282
+ mode: 'strict',
283
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/openAgentPresetDirectory:agentPreset',
284
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_openAgentPresetDirectory_parameter_0$schema,
285
+ },
286
+ },
287
+ ],
288
+ cancellation: { parameter: 'signal' },
289
+ result: {
290
+ mode: 'strict',
291
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller/types#AgentPresetDirectoryOpenValue',
292
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_openAgentPresetDirectory_result$schema,
293
+ },
294
+ sourceLocation: {"file":"packages/api/settings-controller/src/index.ts","line":226,"column":9},
295
+ },
296
+ {
297
+ id: '@deepseek-ai/dsh-api-settings-controller#settings/openSettingsDocument',
298
+ service: 'settingsController',
299
+ namespace: 'settings',
300
+ method: 'openSettingsDocument',
301
+ invocation: { kind: 'direct' },
302
+ parameters: [
303
+ ],
304
+ cancellation: { parameter: 'signal' },
305
+ result: {
306
+ mode: 'strict',
307
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller/types#SettingsDocumentOpenValue',
308
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_openSettingsDocument_result$schema,
309
+ },
310
+ sourceLocation: {"file":"packages/api/settings-controller/src/index.ts","line":195,"column":9},
311
+ },
312
+ {
313
+ id: '@deepseek-ai/dsh-api-settings-controller#settings/replace',
314
+ service: 'settingsController',
315
+ namespace: 'settings',
316
+ method: 'replace',
317
+ invocation: { kind: 'direct' },
318
+ parameters: [
319
+ {
320
+ name: 'ns',
321
+ wire: 'ns',
322
+ source: 'json',
323
+ codec: {
324
+ mode: 'strict',
325
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/replace:ns',
326
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_replace_parameter_0$schema,
327
+ },
328
+ },
329
+ {
330
+ name: 'section',
331
+ wire: 'section',
332
+ source: 'json',
333
+ codec: {
334
+ mode: 'strict',
335
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/replace:section',
336
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_replace_parameter_1$schema,
337
+ },
338
+ },
339
+ {
340
+ name: 'expectedRevision',
341
+ wire: 'expectedRevision',
342
+ source: 'json',
343
+ acceptsUndefined: true,
344
+ codec: {
345
+ mode: 'strict',
346
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/replace:expectedRevision',
347
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_replace_parameter_2$schema,
348
+ },
349
+ },
350
+ ],
351
+ result: {
352
+ mode: 'strict',
353
+ typeSymbol: '@deepseek-ai/dsh-settings/types#SettingsNamespaceView',
354
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_replace_result$schema,
355
+ },
356
+ sourceLocation: {"file":"packages/api/settings-controller/src/index.ts","line":161,"column":3},
357
+ },
358
+ {
359
+ id: '@deepseek-ai/dsh-api-settings-controller#settings/update',
360
+ service: 'settingsController',
361
+ namespace: 'settings',
362
+ method: 'update',
363
+ invocation: { kind: 'direct' },
364
+ parameters: [
365
+ {
366
+ name: 'ns',
367
+ wire: 'ns',
368
+ source: 'json',
369
+ codec: {
370
+ mode: 'strict',
371
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/update:ns',
372
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_update_parameter_0$schema,
373
+ },
374
+ },
375
+ {
376
+ name: 'patch',
377
+ wire: 'patch',
378
+ source: 'json',
379
+ codec: {
380
+ mode: 'strict',
381
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/update:patch',
382
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_update_parameter_1$schema,
383
+ },
384
+ },
385
+ {
386
+ name: 'expectedRevision',
387
+ wire: 'expectedRevision',
388
+ source: 'json',
389
+ acceptsUndefined: true,
390
+ codec: {
391
+ mode: 'strict',
392
+ typeSymbol: '@deepseek-ai/dsh-api-settings-controller#settings/update:expectedRevision',
393
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_update_parameter_2$schema,
394
+ },
395
+ },
396
+ ],
397
+ result: {
398
+ mode: 'strict',
399
+ typeSymbol: '@deepseek-ai/dsh-settings/types#SettingsNamespaceView',
400
+ schema: _deepseek_ai_dsh_api_settings_controller_settings_update_result$schema,
401
+ },
402
+ sourceLocation: {"file":"packages/api/settings-controller/src/index.ts","line":144,"column":3},
403
+ },
404
+ ],
405
+ }
406
+
407
+ export default TYPERT_REMOTE
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Host owner of the `credentials` Remote namespace: the reference half of
3
+ * `ctx.credentials` as a browser configuration page reads and writes it.
4
+ *
5
+ * @module @deepseek-ai/dsh-api-settings-controller/src/credentials.ts
6
+ */
7
+ import { Context } from '@deepseek-ai/cordis';
8
+ import type { CredentialInfo } from '@deepseek-ai/dsh-credentials/types';
9
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
10
+ declare module '@deepseek-ai/cordis' {
11
+ interface Context {
12
+ /** Host owner of the `credentials` Remote namespace. */
13
+ credentialsController: CredentialsController;
14
+ }
15
+ }
16
+ /**
17
+ * Host service backing the generated `ctx.remote.credentials` namespace. It
18
+ * carries every wire obligation the credential seam itself does not: the batch
19
+ * fan-out bound, the field-by-field view projection, the reference-grammar
20
+ * guard, and the refusal mapping. Secret values cross in one direction only —
21
+ * no method here returns one.
22
+ */
23
+ export declare class CredentialsController extends TypertRemoteService {
24
+ /** @param ctx - Host context where a credential provider may be mounted. */
25
+ constructor(ctx: Context);
26
+ /**
27
+ * Describe several references for one configuration surface. Batched because
28
+ * a settings page describes every reference its rows name at once, and one
29
+ * round trip keeps those rows from settling separately.
30
+ * @param refs - reference names, at most {@link MAX_DESCRIBE_REFS}; a name outside the grammar
31
+ * rejects the whole call as `gateway/bad-request`.
32
+ * @returns one view per requested name, keyed by that name.
33
+ * @throws RemoteError when the request is invalid or no credential provider is mounted.
34
+ */
35
+ describe(refs: string[]): Promise<Record<string, CredentialInfo>>;
36
+ /**
37
+ * Store one value from a configuration surface. The value crosses the wire in
38
+ * this direction only: no read path returns it.
39
+ * @param ref - reference name to store under.
40
+ * @param value - the non-empty secret value.
41
+ * @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
42
+ */
43
+ set(ref: string, value: string): Promise<void>;
44
+ /**
45
+ * Remove one reference from a configuration surface.
46
+ * @param ref - reference name to remove.
47
+ * @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
48
+ */
49
+ unset(ref: string): Promise<void>;
50
+ /** Resolve the optional provider or report how to supply it. */
51
+ private provider;
52
+ /**
53
+ * Run one remote write and report every refusal as `credential/rejected`
54
+ * carrying the seam's own message: a read-only source shadowing the reference
55
+ * is what a configuration surface must show verbatim. Callers brand the
56
+ * reference before entering, so a name outside the grammar never reaches this
57
+ * path and fails the same way it does on the read side. The details name only
58
+ * the reference, so no failure path can carry the value back out.
59
+ */
60
+ private write;
61
+ }
62
+ export default CredentialsController;
63
+ //# sourceMappingURL=credentials.d.ts.map
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Host owner of the `credentials` Remote namespace: the reference half of
3
+ * `ctx.credentials` as a browser configuration page reads and writes it.
4
+ *
5
+ * @module @deepseek-ai/dsh-api-settings-controller/src/credentials.ts
6
+ */
7
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
8
+ var useValue = arguments.length > 2;
9
+ for (var i = 0; i < initializers.length; i++) {
10
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
11
+ }
12
+ return useValue ? value : void 0;
13
+ };
14
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
15
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
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) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
25
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
26
+ if (kind === "accessor") {
27
+ if (result === void 0) continue;
28
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
29
+ if (_ = accept(result.get)) descriptor.get = _;
30
+ if (_ = accept(result.set)) descriptor.set = _;
31
+ if (_ = accept(result.init)) initializers.unshift(_);
32
+ }
33
+ else if (_ = accept(result)) {
34
+ if (kind === "field") initializers.unshift(_);
35
+ else descriptor[key] = _;
36
+ }
37
+ }
38
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
39
+ done = true;
40
+ };
41
+ import { credentialRef } from '@deepseek-ai/dsh-credentials';
42
+ import { Remote, RemoteError, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
43
+ import { z } from 'zod';
44
+ /**
45
+ * Fan-out bound on one remote `describe` batch. A settings page asks about the
46
+ * references its own rows name, so this is far above any real page and still
47
+ * keeps one authenticated request from starting unbounded provider work.
48
+ */
49
+ const MAX_DESCRIBE_REFS = 64;
50
+ const credentialRefSchema = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
51
+ const describeRequestSchema = z.object({
52
+ refs: z.array(credentialRefSchema).max(MAX_DESCRIBE_REFS),
53
+ });
54
+ const setRequestSchema = z.object({ ref: credentialRefSchema, value: z.string().min(1) });
55
+ const unsetRequestSchema = z.object({ ref: credentialRefSchema });
56
+ /** Parse the domain constraints that are more specific than generated TypeScript codecs. */
57
+ function parseRequest(method, schema, value) {
58
+ const parsed = schema.safeParse(value);
59
+ if (!parsed.success) {
60
+ throw new RemoteError('gateway/bad-request', `invalid payload for ${method}`, { issues: parsed.error.issues });
61
+ }
62
+ return parsed.data;
63
+ }
64
+ /**
65
+ * Copy exactly the fields {@link CredentialInfo} declares. The Gateway returns
66
+ * a business result without decoding it, so a provider whose `describe` carried
67
+ * extra enumerable properties would otherwise serialize them to the caller.
68
+ * @param info - the provider's answer for one reference.
69
+ * @returns the same facts with nothing else attached.
70
+ */
71
+ function projectCredentialInfo(info) {
72
+ return {
73
+ configured: info.configured,
74
+ ...info.source === undefined ? {} : { source: info.source },
75
+ writable: info.writable,
76
+ };
77
+ }
78
+ /**
79
+ * Host service backing the generated `ctx.remote.credentials` namespace. It
80
+ * carries every wire obligation the credential seam itself does not: the batch
81
+ * fan-out bound, the field-by-field view projection, the reference-grammar
82
+ * guard, and the refusal mapping. Secret values cross in one direction only —
83
+ * no method here returns one.
84
+ */
85
+ let CredentialsController = (() => {
86
+ let _classSuper = TypertRemoteService;
87
+ let _instanceExtraInitializers = [];
88
+ let _describe_decorators;
89
+ let _set_decorators;
90
+ let _unset_decorators;
91
+ return class CredentialsController extends _classSuper {
92
+ static {
93
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
94
+ _describe_decorators = [Remote];
95
+ _set_decorators = [Remote];
96
+ _unset_decorators = [Remote];
97
+ __esDecorate(this, null, _describe_decorators, { kind: "method", name: "describe", static: false, private: false, access: { has: obj => "describe" in obj, get: obj => obj.describe }, metadata: _metadata }, null, _instanceExtraInitializers);
98
+ __esDecorate(this, null, _set_decorators, { kind: "method", name: "set", static: false, private: false, access: { has: obj => "set" in obj, get: obj => obj.set }, metadata: _metadata }, null, _instanceExtraInitializers);
99
+ __esDecorate(this, null, _unset_decorators, { kind: "method", name: "unset", static: false, private: false, access: { has: obj => "unset" in obj, get: obj => obj.unset }, metadata: _metadata }, null, _instanceExtraInitializers);
100
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
101
+ }
102
+ /** @param ctx - Host context where a credential provider may be mounted. */
103
+ constructor(ctx) {
104
+ super(ctx, 'credentialsController', { namespace: 'credentials' });
105
+ __runInitializers(this, _instanceExtraInitializers);
106
+ }
107
+ /**
108
+ * Describe several references for one configuration surface. Batched because
109
+ * a settings page describes every reference its rows name at once, and one
110
+ * round trip keeps those rows from settling separately.
111
+ * @param refs - reference names, at most {@link MAX_DESCRIBE_REFS}; a name outside the grammar
112
+ * rejects the whole call as `gateway/bad-request`.
113
+ * @returns one view per requested name, keyed by that name.
114
+ * @throws RemoteError when the request is invalid or no credential provider is mounted.
115
+ */
116
+ async describe(refs) {
117
+ const request = parseRequest('credentials.describe', describeRequestSchema, { refs });
118
+ const branded = request.refs.map(ref => [ref, credentialRef(ref)]);
119
+ const credentials = this.provider();
120
+ const entries = await Promise.all(branded.map(async ([ref, key]) => [ref, projectCredentialInfo(await credentials.describe(key))]));
121
+ return Object.fromEntries(entries);
122
+ }
123
+ /**
124
+ * Store one value from a configuration surface. The value crosses the wire in
125
+ * this direction only: no read path returns it.
126
+ * @param ref - reference name to store under.
127
+ * @param value - the non-empty secret value.
128
+ * @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
129
+ */
130
+ async set(ref, value) {
131
+ const request = parseRequest('credentials.set', setRequestSchema, { ref, value });
132
+ const branded = credentialRef(request.ref);
133
+ const credentials = this.provider();
134
+ await this.write(request.ref, () => credentials.set(branded, request.value));
135
+ }
136
+ /**
137
+ * Remove one reference from a configuration surface.
138
+ * @param ref - reference name to remove.
139
+ * @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
140
+ */
141
+ async unset(ref) {
142
+ const request = parseRequest('credentials.unset', unsetRequestSchema, { ref });
143
+ const branded = credentialRef(request.ref);
144
+ const credentials = this.provider();
145
+ await this.write(request.ref, () => credentials.unset(branded));
146
+ }
147
+ /** Resolve the optional provider or report how to supply it. */
148
+ provider() {
149
+ const credentials = this.ctx.get('credentials');
150
+ if (credentials === undefined) {
151
+ throw new RemoteError('gateway/internal', 'credentials service is absent: this deployment does not mount a credential provider (e.g. @deepseek-ai/dsh-credentials-local) in its composition', {});
152
+ }
153
+ return credentials;
154
+ }
155
+ /**
156
+ * Run one remote write and report every refusal as `credential/rejected`
157
+ * carrying the seam's own message: a read-only source shadowing the reference
158
+ * is what a configuration surface must show verbatim. Callers brand the
159
+ * reference before entering, so a name outside the grammar never reaches this
160
+ * path and fails the same way it does on the read side. The details name only
161
+ * the reference, so no failure path can carry the value back out.
162
+ */
163
+ async write(ref, write) {
164
+ try {
165
+ await write();
166
+ }
167
+ catch (error) {
168
+ throw new RemoteError('credential/rejected', error instanceof Error ? error.message : String(error), { ref }, { cause: error });
169
+ }
170
+ }
171
+ };
172
+ })();
173
+ export { CredentialsController };
174
+ export default CredentialsController;
175
+ //# sourceMappingURL=credentials.js.map