@deepseek-ai/dsh-api-workspace-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.
- package/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +56 -0
- package/README.zh.md +56 -0
- package/lib/client.js +415 -0
- package/lib/index.js +726 -0
- package/lib/invariant.js +13 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +552 -0
- package/lib/typert.remote-client.d.ts +44 -0
- package/lib/typert.remote-client.js +371 -0
- package/lib/types/client/index.d.ts +45 -0
- package/lib/types/client/index.js +70 -0
- package/lib/types/client/model.d.ts +140 -0
- package/lib/types/client/model.js +292 -0
- package/lib/types/client/service.d.ts +88 -0
- package/lib/types/client/service.js +63 -0
- package/lib/types/commands.d.ts +49 -0
- package/lib/types/commands.js +144 -0
- package/lib/types/directory-picker.d.ts +49 -0
- package/lib/types/directory-picker.js +179 -0
- package/lib/types/feed.d.ts +34 -0
- package/lib/types/feed.js +175 -0
- package/lib/types/index.d.ts +64 -0
- package/lib/types/index.js +145 -0
- package/lib/types/invariant.d.ts +9 -0
- package/lib/types/invariant.js +12 -0
- package/lib/types/types.d.ts +132 -0
- package/lib/types/types.js +8 -0
- package/package.json +99 -0
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const _deepseek_ai_dsh_api_workspace_controller_directoryPicker_createDirectory_parameter_0$schema = z.string()
|
|
5
|
+
const _deepseek_ai_dsh_api_workspace_controller_directoryPicker_createDirectory_parameter_1$schema = z.string()
|
|
6
|
+
const _deepseek_ai_dsh_api_workspace_controller_directoryPicker_createDirectory_result$schema = z.string()
|
|
7
|
+
const _deepseek_ai_dsh_api_workspace_controller_directoryPicker_list_parameter_0$schema = z.union([z.undefined(), z.string()])
|
|
8
|
+
const _deepseek_ai_dsh_api_workspace_controller_directoryPicker_list_result$schema = z.object({
|
|
9
|
+
'path': z.string(),
|
|
10
|
+
'home': z.string(),
|
|
11
|
+
'crumbs': z.array(z.object({
|
|
12
|
+
'name': z.string(),
|
|
13
|
+
'path': z.string(),
|
|
14
|
+
'hidden': z.boolean(),
|
|
15
|
+
})),
|
|
16
|
+
'entries': z.array(z.object({
|
|
17
|
+
'name': z.string(),
|
|
18
|
+
'path': z.string(),
|
|
19
|
+
'hidden': z.boolean(),
|
|
20
|
+
})),
|
|
21
|
+
'truncated': z.boolean(),
|
|
22
|
+
})
|
|
23
|
+
const _deepseek_ai_dsh_api_workspace_controller_directoryPicker_pick_result$schema = z.union([z.literal(null), z.string()])
|
|
24
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_archiveSession_parameter_0$schema = z.object({
|
|
25
|
+
'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
26
|
+
})
|
|
27
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_archiveSession_result$schema = z.object({
|
|
28
|
+
'archivedSessionIds': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
29
|
+
})
|
|
30
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_create_parameter_0$schema = z.object({
|
|
31
|
+
'path': z.string().readonly(),
|
|
32
|
+
})
|
|
33
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_create_result$schema = z.object({
|
|
34
|
+
'workspace': z.object({
|
|
35
|
+
'workspaceId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
36
|
+
'path': z.string().readonly(),
|
|
37
|
+
'title': z.string().readonly(),
|
|
38
|
+
'sessionIds': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
39
|
+
'createdAt': z.string().readonly(),
|
|
40
|
+
'updatedAt': z.string().readonly(),
|
|
41
|
+
}).readonly(),
|
|
42
|
+
'created': z.boolean().readonly(),
|
|
43
|
+
})
|
|
44
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_delete_parameter_0$schema = z.object({
|
|
45
|
+
'workspaceId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
46
|
+
})
|
|
47
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_delete_result$schema = z.object({
|
|
48
|
+
'deleted': z.literal(true).readonly(),
|
|
49
|
+
})
|
|
50
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_follow_result$schema = z.union([z.object({
|
|
51
|
+
'type': z.literal("baseline").readonly(),
|
|
52
|
+
'value': z.object({
|
|
53
|
+
'items': z.array(z.object({
|
|
54
|
+
'workspaceId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
55
|
+
'path': z.string().readonly(),
|
|
56
|
+
'title': z.string().readonly(),
|
|
57
|
+
'sessionIds': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
58
|
+
'createdAt': z.string().readonly(),
|
|
59
|
+
'updatedAt': z.string().readonly(),
|
|
60
|
+
})).readonly(),
|
|
61
|
+
'archivedSessionIds': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
62
|
+
}).readonly(),
|
|
63
|
+
}), z.object({
|
|
64
|
+
'type': z.literal("upsert").readonly(),
|
|
65
|
+
'workspace': z.object({
|
|
66
|
+
'workspaceId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
67
|
+
'path': z.string().readonly(),
|
|
68
|
+
'title': z.string().readonly(),
|
|
69
|
+
'sessionIds': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
70
|
+
'createdAt': z.string().readonly(),
|
|
71
|
+
'updatedAt': z.string().readonly(),
|
|
72
|
+
}).readonly(),
|
|
73
|
+
}), z.object({
|
|
74
|
+
'type': z.literal("remove").readonly(),
|
|
75
|
+
'workspaceId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
76
|
+
}), z.object({
|
|
77
|
+
'type': z.literal("order").readonly(),
|
|
78
|
+
'workspaceIds': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
79
|
+
}), z.object({
|
|
80
|
+
'type': z.literal("archived").readonly(),
|
|
81
|
+
'archivedSessionIds': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
82
|
+
})])
|
|
83
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_insertBefore_parameter_0$schema = z.object({
|
|
84
|
+
'workspaceId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
85
|
+
'beforeWorkspaceId': z.intersection(z.string(), z.unknown()).readonly().optional(),
|
|
86
|
+
})
|
|
87
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_insertBefore_result$schema = z.object({
|
|
88
|
+
'workspaceIds': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
89
|
+
})
|
|
90
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_insertSessionBefore_parameter_0$schema = z.object({
|
|
91
|
+
'workspaceId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
92
|
+
'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
93
|
+
'beforeSessionId': z.intersection(z.string(), z.unknown()).readonly().optional(),
|
|
94
|
+
})
|
|
95
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_insertSessionBefore_result$schema = z.object({
|
|
96
|
+
'workspace': z.object({
|
|
97
|
+
'workspaceId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
98
|
+
'path': z.string().readonly(),
|
|
99
|
+
'title': z.string().readonly(),
|
|
100
|
+
'sessionIds': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
101
|
+
'createdAt': z.string().readonly(),
|
|
102
|
+
'updatedAt': z.string().readonly(),
|
|
103
|
+
}).readonly(),
|
|
104
|
+
})
|
|
105
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_rename_parameter_0$schema = z.object({
|
|
106
|
+
'workspaceId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
107
|
+
'title': z.string().readonly(),
|
|
108
|
+
})
|
|
109
|
+
const _deepseek_ai_dsh_api_workspace_controller_workspace_rename_result$schema = z.object({
|
|
110
|
+
'workspace': z.object({
|
|
111
|
+
'workspaceId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
112
|
+
'path': z.string().readonly(),
|
|
113
|
+
'title': z.string().readonly(),
|
|
114
|
+
'sessionIds': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
115
|
+
'createdAt': z.string().readonly(),
|
|
116
|
+
'updatedAt': z.string().readonly(),
|
|
117
|
+
}).readonly(),
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
export const TYPERT_REMOTE = {
|
|
121
|
+
package: '@deepseek-ai/dsh-api-workspace-controller',
|
|
122
|
+
descriptors: [
|
|
123
|
+
{
|
|
124
|
+
id: '@deepseek-ai/dsh-api-workspace-controller#directoryPicker/createDirectory',
|
|
125
|
+
service: 'directoryPickerController',
|
|
126
|
+
namespace: 'directoryPicker',
|
|
127
|
+
method: 'createDirectory',
|
|
128
|
+
invocation: { kind: 'direct' },
|
|
129
|
+
parameters: [
|
|
130
|
+
{
|
|
131
|
+
name: 'path',
|
|
132
|
+
wire: 'path',
|
|
133
|
+
source: 'json',
|
|
134
|
+
codec: {
|
|
135
|
+
mode: 'strict',
|
|
136
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller#directoryPicker/createDirectory:path',
|
|
137
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_directoryPicker_createDirectory_parameter_0$schema,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'name',
|
|
142
|
+
wire: 'name',
|
|
143
|
+
source: 'json',
|
|
144
|
+
codec: {
|
|
145
|
+
mode: 'strict',
|
|
146
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller#directoryPicker/createDirectory:name',
|
|
147
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_directoryPicker_createDirectory_parameter_1$schema,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
result: {
|
|
152
|
+
mode: 'strict',
|
|
153
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller#directoryPicker/createDirectory:result',
|
|
154
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_directoryPicker_createDirectory_result$schema,
|
|
155
|
+
},
|
|
156
|
+
sourceLocation: {"file":"packages/api/workspace-controller/src/directory-picker.ts","line":88,"column":9},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: '@deepseek-ai/dsh-api-workspace-controller#directoryPicker/list',
|
|
160
|
+
service: 'directoryPickerController',
|
|
161
|
+
namespace: 'directoryPicker',
|
|
162
|
+
method: 'list',
|
|
163
|
+
invocation: { kind: 'direct' },
|
|
164
|
+
parameters: [
|
|
165
|
+
{
|
|
166
|
+
name: 'path',
|
|
167
|
+
wire: 'path',
|
|
168
|
+
source: 'json',
|
|
169
|
+
acceptsUndefined: true,
|
|
170
|
+
codec: {
|
|
171
|
+
mode: 'strict',
|
|
172
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller#directoryPicker/list:path',
|
|
173
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_directoryPicker_list_parameter_0$schema,
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
cancellation: { parameter: 'signal' },
|
|
178
|
+
result: {
|
|
179
|
+
mode: 'strict',
|
|
180
|
+
typeSymbol: '@deepseek-ai/dsh-host-directory-picker/types#DirectoryListing',
|
|
181
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_directoryPicker_list_result$schema,
|
|
182
|
+
},
|
|
183
|
+
sourceLocation: {"file":"packages/api/workspace-controller/src/directory-picker.ts","line":72,"column":9},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: '@deepseek-ai/dsh-api-workspace-controller#directoryPicker/pick',
|
|
187
|
+
service: 'directoryPickerController',
|
|
188
|
+
namespace: 'directoryPicker',
|
|
189
|
+
method: 'pick',
|
|
190
|
+
invocation: { kind: 'direct' },
|
|
191
|
+
parameters: [
|
|
192
|
+
],
|
|
193
|
+
cancellation: { parameter: 'signal' },
|
|
194
|
+
result: {
|
|
195
|
+
mode: 'strict',
|
|
196
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller#directoryPicker/pick:result',
|
|
197
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_directoryPicker_pick_result$schema,
|
|
198
|
+
},
|
|
199
|
+
sourceLocation: {"file":"packages/api/workspace-controller/src/directory-picker.ts","line":55,"column":9},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: '@deepseek-ai/dsh-api-workspace-controller#workspace/archiveSession',
|
|
203
|
+
service: 'workspaceController',
|
|
204
|
+
namespace: 'workspace',
|
|
205
|
+
method: 'archiveSession',
|
|
206
|
+
invocation: { kind: 'direct' },
|
|
207
|
+
parameters: [
|
|
208
|
+
{
|
|
209
|
+
name: 'request',
|
|
210
|
+
wire: 'request',
|
|
211
|
+
source: 'json',
|
|
212
|
+
codec: {
|
|
213
|
+
mode: 'strict',
|
|
214
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceArchiveSessionRequest',
|
|
215
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_archiveSession_parameter_0$schema,
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
result: {
|
|
220
|
+
mode: 'strict',
|
|
221
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceArchiveValue',
|
|
222
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_archiveSession_result$schema,
|
|
223
|
+
},
|
|
224
|
+
sourceLocation: {"file":"packages/api/workspace-controller/src/index.ts","line":108,"column":3},
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: '@deepseek-ai/dsh-api-workspace-controller#workspace/create',
|
|
228
|
+
service: 'workspaceController',
|
|
229
|
+
namespace: 'workspace',
|
|
230
|
+
method: 'create',
|
|
231
|
+
invocation: { kind: 'direct' },
|
|
232
|
+
parameters: [
|
|
233
|
+
{
|
|
234
|
+
name: 'request',
|
|
235
|
+
wire: 'request',
|
|
236
|
+
source: 'json',
|
|
237
|
+
codec: {
|
|
238
|
+
mode: 'strict',
|
|
239
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceCreateRequest',
|
|
240
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_create_parameter_0$schema,
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
result: {
|
|
245
|
+
mode: 'strict',
|
|
246
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceCreateValue',
|
|
247
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_create_result$schema,
|
|
248
|
+
},
|
|
249
|
+
sourceLocation: {"file":"packages/api/workspace-controller/src/index.ts","line":58,"column":3},
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: '@deepseek-ai/dsh-api-workspace-controller#workspace/delete',
|
|
253
|
+
service: 'workspaceController',
|
|
254
|
+
namespace: 'workspace',
|
|
255
|
+
method: 'delete',
|
|
256
|
+
invocation: { kind: 'direct' },
|
|
257
|
+
parameters: [
|
|
258
|
+
{
|
|
259
|
+
name: 'request',
|
|
260
|
+
wire: 'request',
|
|
261
|
+
source: 'json',
|
|
262
|
+
codec: {
|
|
263
|
+
mode: 'strict',
|
|
264
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceDeleteRequest',
|
|
265
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_delete_parameter_0$schema,
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
result: {
|
|
270
|
+
mode: 'strict',
|
|
271
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceDeleteValue',
|
|
272
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_delete_result$schema,
|
|
273
|
+
},
|
|
274
|
+
sourceLocation: {"file":"packages/api/workspace-controller/src/index.ts","line":78,"column":3},
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: '@deepseek-ai/dsh-api-workspace-controller#workspace/follow',
|
|
278
|
+
service: 'workspaceController',
|
|
279
|
+
namespace: 'workspace',
|
|
280
|
+
method: 'follow',
|
|
281
|
+
mode: 'stream',
|
|
282
|
+
invocation: { kind: 'direct' },
|
|
283
|
+
parameters: [
|
|
284
|
+
],
|
|
285
|
+
cancellation: { parameter: 'signal' },
|
|
286
|
+
result: {
|
|
287
|
+
mode: 'strict',
|
|
288
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceFollowFrame',
|
|
289
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_follow_result$schema,
|
|
290
|
+
},
|
|
291
|
+
sourceLocation: {"file":"packages/api/workspace-controller/src/index.ts","line":118,"column":3},
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
id: '@deepseek-ai/dsh-api-workspace-controller#workspace/insertBefore',
|
|
295
|
+
service: 'workspaceController',
|
|
296
|
+
namespace: 'workspace',
|
|
297
|
+
method: 'insertBefore',
|
|
298
|
+
invocation: { kind: 'direct' },
|
|
299
|
+
parameters: [
|
|
300
|
+
{
|
|
301
|
+
name: 'request',
|
|
302
|
+
wire: 'request',
|
|
303
|
+
source: 'json',
|
|
304
|
+
codec: {
|
|
305
|
+
mode: 'strict',
|
|
306
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceInsertBeforeRequest',
|
|
307
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_insertBefore_parameter_0$schema,
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
],
|
|
311
|
+
result: {
|
|
312
|
+
mode: 'strict',
|
|
313
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceOrderValue',
|
|
314
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_insertBefore_result$schema,
|
|
315
|
+
},
|
|
316
|
+
sourceLocation: {"file":"packages/api/workspace-controller/src/index.ts","line":88,"column":3},
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
id: '@deepseek-ai/dsh-api-workspace-controller#workspace/insertSessionBefore',
|
|
320
|
+
service: 'workspaceController',
|
|
321
|
+
namespace: 'workspace',
|
|
322
|
+
method: 'insertSessionBefore',
|
|
323
|
+
invocation: { kind: 'direct' },
|
|
324
|
+
parameters: [
|
|
325
|
+
{
|
|
326
|
+
name: 'request',
|
|
327
|
+
wire: 'request',
|
|
328
|
+
source: 'json',
|
|
329
|
+
codec: {
|
|
330
|
+
mode: 'strict',
|
|
331
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceInsertSessionBeforeRequest',
|
|
332
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_insertSessionBefore_parameter_0$schema,
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
result: {
|
|
337
|
+
mode: 'strict',
|
|
338
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceValue',
|
|
339
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_insertSessionBefore_result$schema,
|
|
340
|
+
},
|
|
341
|
+
sourceLocation: {"file":"packages/api/workspace-controller/src/index.ts","line":98,"column":3},
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: '@deepseek-ai/dsh-api-workspace-controller#workspace/rename',
|
|
345
|
+
service: 'workspaceController',
|
|
346
|
+
namespace: 'workspace',
|
|
347
|
+
method: 'rename',
|
|
348
|
+
invocation: { kind: 'direct' },
|
|
349
|
+
parameters: [
|
|
350
|
+
{
|
|
351
|
+
name: 'request',
|
|
352
|
+
wire: 'request',
|
|
353
|
+
source: 'json',
|
|
354
|
+
codec: {
|
|
355
|
+
mode: 'strict',
|
|
356
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceRenameRequest',
|
|
357
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_rename_parameter_0$schema,
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
],
|
|
361
|
+
result: {
|
|
362
|
+
mode: 'strict',
|
|
363
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-controller/types#WorkspaceValue',
|
|
364
|
+
schema: _deepseek_ai_dsh_api_workspace_controller_workspace_rename_result$schema,
|
|
365
|
+
},
|
|
366
|
+
sourceLocation: {"file":"packages/api/workspace-controller/src/index.ts","line":68,"column":3},
|
|
367
|
+
},
|
|
368
|
+
],
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export default TYPERT_REMOTE
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Workspace-specific adapter for the Gateway-owned snapshot stream lifecycle. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import { RemoteSnapshotStream, RemoteStreamCarrierError, type ClientRemote } from '@deepseek-ai/dsh-api-gateway/client';
|
|
4
|
+
import type { WorkspaceFollowFrame, WorkspaceFollowIncrement } from '../types.ts';
|
|
5
|
+
import type { WorkspaceFollowSink } from './model.ts';
|
|
6
|
+
export { ClientWorkspaceModel } from './model.ts';
|
|
7
|
+
export type { WorkspaceFollowSink, WorkspaceListPhase, WorkspaceRemote, WorkspaceSnapshot, } from './model.ts';
|
|
8
|
+
export { WorkspaceController, WorkspaceCreateError } from './service.ts';
|
|
9
|
+
export type { IWorkspaces, WorkspaceSource } from './service.ts';
|
|
10
|
+
export type { WorkspaceId, WorkspaceView } from '../types.ts';
|
|
11
|
+
type WorkspaceBaselineFrame = Extract<WorkspaceFollowFrame, {
|
|
12
|
+
type: 'baseline';
|
|
13
|
+
}>;
|
|
14
|
+
/** Gateway-owned snapshot stream configured for Workspace state. */
|
|
15
|
+
export type WorkspaceStateStream = RemoteSnapshotStream<WorkspaceBaselineFrame, WorkspaceFollowIncrement>;
|
|
16
|
+
declare module '@deepseek-ai/cordis' {
|
|
17
|
+
interface Context {
|
|
18
|
+
/** React-free Client Workspace state and commands. */
|
|
19
|
+
workspaces: import('./service.ts').IWorkspaces;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** Required Client Remote services. */
|
|
23
|
+
export declare const inject: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Install Client Workspace state, commands, and reconnecting follow control.
|
|
26
|
+
* @param ctx - Client root Context.
|
|
27
|
+
*/
|
|
28
|
+
export declare function apply(ctx: Context): void;
|
|
29
|
+
/** Domain sinks used by the Workspace state stream. */
|
|
30
|
+
export interface WorkspaceStateStreamOptions {
|
|
31
|
+
/** Destinations for decoded Workspace state operations. */
|
|
32
|
+
readonly accept: WorkspaceFollowSink;
|
|
33
|
+
/** Observe a retryable carrier loss before reconnection. */
|
|
34
|
+
readonly carrierFailed?: (error: RemoteStreamCarrierError) => void;
|
|
35
|
+
/** Publish a terminal business or protocol failure. */
|
|
36
|
+
readonly failed: (error: unknown) => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create the reconnecting Workspace state stream.
|
|
40
|
+
* @param remote - Client Remote face carrying the Workspace namespace and the stream factory.
|
|
41
|
+
* @param options - Workspace state destinations.
|
|
42
|
+
* @returns an unstarted stream owned by the Client Workspace runtime.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createWorkspaceStateStream(remote: ClientRemote, options: WorkspaceStateStreamOptions): WorkspaceStateStream;
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** Workspace-specific adapter for the Gateway-owned snapshot stream lifecycle. */
|
|
2
|
+
import { RemoteSnapshotStream, RemoteStreamCarrierError, } from '@deepseek-ai/dsh-api-gateway/client';
|
|
3
|
+
import { ClientWorkspaceModel } from "./model.js";
|
|
4
|
+
import { WorkspaceController } from "./service.js";
|
|
5
|
+
export { ClientWorkspaceModel } from "./model.js";
|
|
6
|
+
export { WorkspaceController, WorkspaceCreateError } from "./service.js";
|
|
7
|
+
/** Required Client Remote services. */
|
|
8
|
+
export const inject = ['remote', 'remote.workspace'];
|
|
9
|
+
/**
|
|
10
|
+
* Install Client Workspace state, commands, and reconnecting follow control.
|
|
11
|
+
* @param ctx - Client root Context.
|
|
12
|
+
*/
|
|
13
|
+
export function apply(ctx) {
|
|
14
|
+
const model = new ClientWorkspaceModel(ctx.remote.workspace);
|
|
15
|
+
new WorkspaceController(ctx, model);
|
|
16
|
+
const control = createWorkspaceStateStream(ctx.remote, {
|
|
17
|
+
accept: model,
|
|
18
|
+
carrierFailed: () => { model.handleCarrierFailure(); },
|
|
19
|
+
failed: (error) => { model.handleStreamFailure(error); },
|
|
20
|
+
});
|
|
21
|
+
control.start();
|
|
22
|
+
ctx.effect(() => async () => { await control.dispose(); }, 'workspace-controller.client.control');
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create the reconnecting Workspace state stream.
|
|
26
|
+
* @param remote - Client Remote face carrying the Workspace namespace and the stream factory.
|
|
27
|
+
* @param options - Workspace state destinations.
|
|
28
|
+
* @returns an unstarted stream owned by the Client Workspace runtime.
|
|
29
|
+
*/
|
|
30
|
+
export function createWorkspaceStateStream(remote, options) {
|
|
31
|
+
const stream = remote.$stream({
|
|
32
|
+
name: 'Workspace state stream',
|
|
33
|
+
open: signal => remote.workspace.follow(signal),
|
|
34
|
+
ended: accepted => accepted
|
|
35
|
+
? new RemoteStreamCarrierError('Workspace state stream ended without a terminal result')
|
|
36
|
+
: new Error('Workspace state stream ended before its opening snapshot'),
|
|
37
|
+
...(options.carrierFailed === undefined ? {} : { carrierFailed: options.carrierFailed }),
|
|
38
|
+
});
|
|
39
|
+
return new RemoteSnapshotStream(stream, {
|
|
40
|
+
name: 'Workspace state stream',
|
|
41
|
+
isSnapshot: (frame) => frame.type === 'baseline',
|
|
42
|
+
replace: (frame) => { options.accept.replaceBaseline(frame.value); },
|
|
43
|
+
update: (frame) => { acceptIncrement(options.accept, frame); },
|
|
44
|
+
failed: options.failed,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function acceptIncrement(accept, frame) {
|
|
48
|
+
switch (frame.type) {
|
|
49
|
+
case 'upsert':
|
|
50
|
+
accept.upsertView(frame.workspace);
|
|
51
|
+
return;
|
|
52
|
+
case 'remove':
|
|
53
|
+
accept.removeView(frame.workspaceId);
|
|
54
|
+
return;
|
|
55
|
+
case 'order':
|
|
56
|
+
accept.replaceOrder(frame.workspaceIds);
|
|
57
|
+
return;
|
|
58
|
+
case 'archived':
|
|
59
|
+
accept.replaceArchived(frame.archivedSessionIds);
|
|
60
|
+
return;
|
|
61
|
+
/* v8 ignore next -- the generated Remote codec validates this closed union */
|
|
62
|
+
default:
|
|
63
|
+
return assertNever(frame);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/* v8 ignore next 3 -- closed-union backstop after generated Remote validation */
|
|
67
|
+
function assertNever(value) {
|
|
68
|
+
throw new Error(`unreachable Workspace increment: ${JSON.stringify(value)}`);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/** Client-side Workspace state model shared by Remote transport and UI projection. */
|
|
2
|
+
import type { RemoteFailure, RemoteResult, TypertClientRemote } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import type { WorkspaceArchiveSessionRequest, WorkspaceArchiveValue, WorkspaceBaseline, WorkspaceCreateRequest, WorkspaceCreateValue, WorkspaceDeleteValue, WorkspaceInsertSessionBeforeRequest, WorkspaceOrderValue, WorkspaceValue, WorkspaceId, WorkspaceView } from '../types.ts';
|
|
4
|
+
/** Complete generated `ctx.remote.workspace` namespace. */
|
|
5
|
+
export type WorkspaceRemote = TypertClientRemote['workspace'];
|
|
6
|
+
/** Monotone Workspace-list arrival lifecycle. */
|
|
7
|
+
export type WorkspaceListPhase = 'pending' | 'ready';
|
|
8
|
+
/** Immutable Client Workspace state. */
|
|
9
|
+
export interface WorkspaceSnapshot {
|
|
10
|
+
readonly items: readonly WorkspaceView[];
|
|
11
|
+
/** Complete registry-global archive set in Host order. */
|
|
12
|
+
readonly archivedSessionIds: WorkspaceArchiveValue['archivedSessionIds'];
|
|
13
|
+
readonly state: 'idle' | 'loading' | 'error';
|
|
14
|
+
readonly phase: WorkspaceListPhase;
|
|
15
|
+
readonly error: RemoteFailure | null;
|
|
16
|
+
}
|
|
17
|
+
/** State operations emitted by a decoded Workspace follow generation. */
|
|
18
|
+
export interface WorkspaceFollowSink {
|
|
19
|
+
/** Replace all state from the generation baseline. */
|
|
20
|
+
replaceBaseline(value: WorkspaceBaseline): void;
|
|
21
|
+
/** Merge one Workspace row. */
|
|
22
|
+
upsertView(workspace: WorkspaceView): void;
|
|
23
|
+
/** Remove one Workspace row. */
|
|
24
|
+
removeView(workspaceId: WorkspaceId): void;
|
|
25
|
+
/** Replace the Host-confirmed Workspace order. */
|
|
26
|
+
replaceOrder(workspaceIds: readonly WorkspaceId[]): void;
|
|
27
|
+
/** Replace the complete archived Session set. */
|
|
28
|
+
replaceArchived(sessionIds: WorkspaceArchiveValue['archivedSessionIds']): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Owns the Client Workspace projection, mutation echoes, and stream/unary race resolution.
|
|
32
|
+
*/
|
|
33
|
+
export declare class ClientWorkspaceModel implements WorkspaceFollowSink {
|
|
34
|
+
private readonly remote;
|
|
35
|
+
private items;
|
|
36
|
+
private archivedSessionIds;
|
|
37
|
+
private state;
|
|
38
|
+
private phase;
|
|
39
|
+
private error;
|
|
40
|
+
/** Latest local reorder request; only its unary echo may install order. */
|
|
41
|
+
private orderRequestGeneration;
|
|
42
|
+
/** Increments on stream orders so a later remote commit outranks an older unary echo. */
|
|
43
|
+
private orderFrameGeneration;
|
|
44
|
+
/** Last complete order accepted from a baseline, increment, or current unary echo. */
|
|
45
|
+
private committedOrder;
|
|
46
|
+
/** Host Workspace ids are never reused, so delayed data cannot resurrect a removed row. */
|
|
47
|
+
private readonly removedIds;
|
|
48
|
+
private readonly listeners;
|
|
49
|
+
private snapshotCache;
|
|
50
|
+
private snapshotDirty;
|
|
51
|
+
private notificationPending;
|
|
52
|
+
private notificationScheduled;
|
|
53
|
+
private notificationGeneration;
|
|
54
|
+
/** @param remote - generated Workspace Remote namespace. */
|
|
55
|
+
constructor(remote: WorkspaceRemote);
|
|
56
|
+
/**
|
|
57
|
+
* Create or resolve a Workspace and merge the unary result immediately.
|
|
58
|
+
* @param input - existing absolute path to adopt.
|
|
59
|
+
* @returns generated Remote result.
|
|
60
|
+
*/
|
|
61
|
+
create(input: WorkspaceCreateRequest): Promise<RemoteResult<WorkspaceCreateValue>>;
|
|
62
|
+
/**
|
|
63
|
+
* Rename a Workspace and merge the unary result immediately.
|
|
64
|
+
* @param workspaceId - target Workspace.
|
|
65
|
+
* @param title - new display title.
|
|
66
|
+
* @returns generated Remote result.
|
|
67
|
+
*/
|
|
68
|
+
rename(workspaceId: WorkspaceId, title: string): Promise<RemoteResult<WorkspaceValue>>;
|
|
69
|
+
/**
|
|
70
|
+
* Delete a Workspace and remove it from the local projection immediately.
|
|
71
|
+
* @param workspaceId - target Workspace.
|
|
72
|
+
* @returns generated Remote result.
|
|
73
|
+
*/
|
|
74
|
+
delete(workspaceId: WorkspaceId): Promise<RemoteResult<WorkspaceDeleteValue>>;
|
|
75
|
+
/**
|
|
76
|
+
* Optimistically move a Workspace and reconcile the returned complete order.
|
|
77
|
+
* @param workspaceId - Workspace to move.
|
|
78
|
+
* @param beforeWorkspaceId - anchor Workspace; omitted appends.
|
|
79
|
+
* @returns generated Remote result.
|
|
80
|
+
*/
|
|
81
|
+
insertBefore(workspaceId: WorkspaceId, beforeWorkspaceId?: WorkspaceId): Promise<RemoteResult<WorkspaceOrderValue>>;
|
|
82
|
+
/**
|
|
83
|
+
* Move a Session within its Workspace and merge the returned row.
|
|
84
|
+
* @param workspaceId - owning Workspace.
|
|
85
|
+
* @param sessionId - accounted Session to move.
|
|
86
|
+
* @param beforeSessionId - accounted anchor; omitted appends.
|
|
87
|
+
* @returns generated Remote result.
|
|
88
|
+
*/
|
|
89
|
+
insertSessionBefore(workspaceId: WorkspaceInsertSessionBeforeRequest['workspaceId'], sessionId: WorkspaceInsertSessionBeforeRequest['sessionId'], beforeSessionId?: WorkspaceInsertSessionBeforeRequest['beforeSessionId']): Promise<RemoteResult<WorkspaceValue>>;
|
|
90
|
+
/**
|
|
91
|
+
* Archive one Session and install the returned complete archive set.
|
|
92
|
+
* @param sessionId - Session to archive.
|
|
93
|
+
* @returns generated Remote result.
|
|
94
|
+
*/
|
|
95
|
+
archiveSession(sessionId: WorkspaceArchiveSessionRequest['sessionId']): Promise<RemoteResult<WorkspaceArchiveValue>>;
|
|
96
|
+
/**
|
|
97
|
+
* Replace the projection from one complete stream-generation baseline.
|
|
98
|
+
* @param baseline - complete Workspace and archive projection.
|
|
99
|
+
*/
|
|
100
|
+
replaceBaseline(baseline: WorkspaceBaseline): void;
|
|
101
|
+
/** Merge one decoded Workspace upsert from the current follow generation. */
|
|
102
|
+
upsertView(workspace: WorkspaceView): void;
|
|
103
|
+
/** Apply one decoded Workspace removal from the current follow generation. */
|
|
104
|
+
removeView(workspaceId: WorkspaceId): void;
|
|
105
|
+
/** Replace Host-confirmed order from the current follow generation. */
|
|
106
|
+
replaceOrder(workspaceIds: readonly WorkspaceId[]): void;
|
|
107
|
+
/**
|
|
108
|
+
* Replace the archived Session set from the current follow generation.
|
|
109
|
+
* @param archivedSessionIds - complete Host-confirmed archive set.
|
|
110
|
+
*/
|
|
111
|
+
replaceArchived(archivedSessionIds: WorkspaceArchiveValue['archivedSessionIds']): void;
|
|
112
|
+
/** Keep the last complete projection visible while a lost carrier reconnects. */
|
|
113
|
+
handleCarrierFailure(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Publish a non-retryable stream or protocol failure.
|
|
116
|
+
* @param error - terminal stream failure.
|
|
117
|
+
*/
|
|
118
|
+
handleStreamFailure(error: unknown): void;
|
|
119
|
+
/**
|
|
120
|
+
* Subscribe to Workspace state invalidation.
|
|
121
|
+
* @param listener - invalidation callback.
|
|
122
|
+
* @returns unsubscribe function.
|
|
123
|
+
*/
|
|
124
|
+
subscribe(listener: () => void): () => void;
|
|
125
|
+
/**
|
|
126
|
+
* Read the cached state, rebuilding it first when necessary.
|
|
127
|
+
* @returns the current stable Workspace list snapshot.
|
|
128
|
+
*/
|
|
129
|
+
getSnapshot(): WorkspaceSnapshot;
|
|
130
|
+
private buildSnapshot;
|
|
131
|
+
private installArchived;
|
|
132
|
+
private installOrder;
|
|
133
|
+
private upsert;
|
|
134
|
+
private remove;
|
|
135
|
+
private installViews;
|
|
136
|
+
private invalidate;
|
|
137
|
+
private flush;
|
|
138
|
+
private refreshSnapshot;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=model.d.ts.map
|