@deepseek-ai/dsh-api-workspace-files 0.1.6-alpha.1 → 0.1.7-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +27 -24
- package/README.zh.md +27 -24
- package/lib/client.js +41 -35
- package/lib/index.js +135 -132
- package/lib/typert.host.js +127 -173
- package/lib/typert.remote-client.d.ts +10 -9
- package/lib/typert.remote-client.js +116 -152
- package/lib/types/changes.d.ts +8 -11
- package/lib/types/changes.js +106 -46
- package/lib/types/client/change-feed.d.ts +14 -13
- package/lib/types/client/change-feed.js +34 -27
- package/lib/types/client/provider.d.ts +4 -4
- package/lib/types/client/provider.js +13 -6
- package/lib/types/client/types.d.ts +5 -3
- package/lib/types/index.d.ts +13 -30
- package/lib/types/index.js +38 -60
- package/lib/types/types.d.ts +24 -13
- package/package.json +16 -14
package/lib/typert.host.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
const
|
|
4
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_parameter_0$schema$value
|
|
5
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_parameter_0$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
|
|
6
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_parameter_1$schema$value
|
|
7
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_parameter_1$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_parameter_1$schema$value ??= z.string())
|
|
8
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_result$schema$value
|
|
9
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_result$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_result$schema$value ??= z.union([z.object({
|
|
6
10
|
'kind': z.literal("ready").readonly(),
|
|
7
11
|
}), z.object({
|
|
8
12
|
'kind': z.literal("change").readonly(),
|
|
@@ -13,10 +17,13 @@ const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_result$schema
|
|
|
13
17
|
'absolutePath': z.string().readonly(),
|
|
14
18
|
'absent': z.literal(true).readonly(),
|
|
15
19
|
})]).readonly(),
|
|
16
|
-
})])
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
+
})]))
|
|
21
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_parameter_0$schema$value
|
|
22
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_parameter_0$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
|
|
23
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_parameter_1$schema$value
|
|
24
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_parameter_1$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_parameter_1$schema$value ??= z.string())
|
|
25
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_result$schema$value
|
|
26
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_result$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_result$schema$value ??= z.object({
|
|
20
27
|
'path': z.string().readonly(),
|
|
21
28
|
'entries': z.array(z.object({
|
|
22
29
|
'name': z.string().readonly(),
|
|
@@ -24,14 +31,18 @@ const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_result$schema = z
|
|
|
24
31
|
'size': z.number().readonly().optional(),
|
|
25
32
|
})).readonly(),
|
|
26
33
|
'truncated': z.boolean().readonly(),
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
34
|
+
}))
|
|
35
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_0$schema$value
|
|
36
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_0$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
|
|
37
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_1$schema$value
|
|
38
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_1$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_1$schema$value ??= z.string())
|
|
39
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_2$schema$value
|
|
40
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_2$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_2$schema$value ??= z.object({
|
|
31
41
|
'offset': z.number().readonly().optional(),
|
|
32
42
|
'limit': z.number().readonly().optional(),
|
|
33
|
-
})
|
|
34
|
-
|
|
43
|
+
}))
|
|
44
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_result$schema$value
|
|
45
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_result$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_result$schema$value ??= z.object({
|
|
35
46
|
'offset': z.number().readonly(),
|
|
36
47
|
'text': z.string().readonly(),
|
|
37
48
|
'lines': z.number().readonly(),
|
|
@@ -39,49 +50,74 @@ const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_result$schema = z
|
|
|
39
50
|
'absolutePath': z.string().readonly(),
|
|
40
51
|
'version': z.string().readonly(),
|
|
41
52
|
'bytes': z.number().readonly().optional(),
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'
|
|
50
|
-
'version': z.string().readonly(),
|
|
51
|
-
'bytes': z.number().readonly().optional(),
|
|
52
|
-
})
|
|
53
|
-
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
54
|
-
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_1$schema = z.string()
|
|
55
|
-
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_2$schema = z.object({
|
|
53
|
+
}))
|
|
54
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_0$schema$value
|
|
55
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_0$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
|
|
56
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_1$schema$value
|
|
57
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_1$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_1$schema$value ??= z.string())
|
|
58
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_2$schema$value
|
|
59
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_2$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_2$schema$value ??= z.object({
|
|
60
|
+
'range': z.object({
|
|
56
61
|
'offset': z.number().readonly().optional(),
|
|
57
62
|
'length': z.number().readonly().optional(),
|
|
58
|
-
})
|
|
59
|
-
|
|
63
|
+
}).readonly().optional(),
|
|
64
|
+
'baseFile': z.string().readonly().optional(),
|
|
65
|
+
}))
|
|
66
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_result$schema$value
|
|
67
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_result$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_result$schema$value ??= z.object({
|
|
60
68
|
'offset': z.number().readonly(),
|
|
61
|
-
'data': z.
|
|
69
|
+
'data': z.instanceof(Uint8Array),
|
|
62
70
|
'eof': z.boolean().readonly(),
|
|
63
71
|
'absolutePath': z.string().readonly(),
|
|
64
72
|
'version': z.string().readonly(),
|
|
65
73
|
'bytes': z.number().readonly().optional(),
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'eof': z.boolean().readonly(),
|
|
74
|
+
}))
|
|
75
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_parameter_0$schema$value
|
|
76
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_parameter_0$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
|
|
77
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_parameter_1$schema$value
|
|
78
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_parameter_1$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_parameter_1$schema$value ??= z.string())
|
|
79
|
+
let _deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_result$schema$value
|
|
80
|
+
const _deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_result$schema = () => (_deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_result$schema$value ??= z.object({
|
|
74
81
|
'absolutePath': z.string().readonly(),
|
|
75
82
|
'version': z.string().readonly(),
|
|
76
83
|
'bytes': z.number().readonly().optional(),
|
|
77
|
-
})
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
'
|
|
82
|
-
'
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
}))
|
|
85
|
+
const $resultSnapshot = (input, path) => {
|
|
86
|
+
if (input === null || typeof input !== 'object' || input instanceof Uint8Array) return input
|
|
87
|
+
const toJSON = input.toJSON
|
|
88
|
+
const value = typeof toJSON === 'function' ? toJSON.call(input, path.at(-1)?.toString() ?? 'value') : input
|
|
89
|
+
if (value === null || typeof value !== 'object' || value instanceof Uint8Array) return value
|
|
90
|
+
if (Array.isArray(value)) {
|
|
91
|
+
const items = []
|
|
92
|
+
for (let index = 0, length = value.length; index < length; index++) items.push(value[index])
|
|
93
|
+
return items
|
|
94
|
+
}
|
|
95
|
+
const fields = {}
|
|
96
|
+
for (const key of Object.keys(value)) {
|
|
97
|
+
const item = key === 'toJSON' && value === input ? toJSON : value[key]
|
|
98
|
+
if (key === 'toJSON' && typeof item === 'function') continue
|
|
99
|
+
Object.defineProperty(fields, key, { value: item, enumerable: true, writable: true, configurable: true })
|
|
100
|
+
}
|
|
101
|
+
return fields
|
|
102
|
+
}
|
|
103
|
+
const $resultContainer = (input, path, ancestors, project, snapshot) => {
|
|
104
|
+
if (input === null || typeof input !== 'object') return project(input)
|
|
105
|
+
const owner = !ancestors.has(input)
|
|
106
|
+
if (!owner && ancestors.get(input) !== path.length) throw new TypeError('Remote result contains a circular object')
|
|
107
|
+
if (owner) ancestors.set(input, path.length)
|
|
108
|
+
try { return project(snapshot ? $resultSnapshot(input, path) : input) }
|
|
109
|
+
finally { if (owner) ancestors.delete(input) }
|
|
110
|
+
}
|
|
111
|
+
const $encode1 = (value, writeBytes, path, ancestors) => {
|
|
112
|
+
return value instanceof Uint8Array ? writeBytes(value, path) : value
|
|
113
|
+
}
|
|
114
|
+
const $encode0 = (value, writeBytes, path, ancestors) => {
|
|
115
|
+
return $resultContainer(value, path, ancestors, value => {
|
|
116
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value) || value instanceof Uint8Array) return value
|
|
117
|
+
if (Object.hasOwn(value, 'data')) value['data'] = $encode1(value['data'], writeBytes, [...path, 'data'], ancestors)
|
|
118
|
+
return value
|
|
119
|
+
}, true)
|
|
120
|
+
}
|
|
85
121
|
|
|
86
122
|
export const TYPERT = {
|
|
87
123
|
package: '@deepseek-ai/dsh-api-workspace-files',
|
|
@@ -105,7 +141,17 @@ export const TYPERT = {
|
|
|
105
141
|
codec: {
|
|
106
142
|
mode: 'strict',
|
|
107
143
|
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
108
|
-
|
|
144
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_parameter_0$schema,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'path',
|
|
149
|
+
wire: 'path',
|
|
150
|
+
source: 'json',
|
|
151
|
+
codec: {
|
|
152
|
+
mode: 'strict',
|
|
153
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/changes:path',
|
|
154
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_parameter_1$schema,
|
|
109
155
|
},
|
|
110
156
|
},
|
|
111
157
|
],
|
|
@@ -113,9 +159,9 @@ export const TYPERT = {
|
|
|
113
159
|
result: {
|
|
114
160
|
mode: 'strict',
|
|
115
161
|
typeSymbol: '@deepseek-ai/dsh-api-workspace-files/types#WorkspaceFileWatchFrame',
|
|
116
|
-
|
|
162
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_changes_result$schema,
|
|
117
163
|
},
|
|
118
|
-
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":
|
|
164
|
+
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":331,"column":3},
|
|
119
165
|
},
|
|
120
166
|
{
|
|
121
167
|
id: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/list',
|
|
@@ -132,7 +178,7 @@ export const TYPERT = {
|
|
|
132
178
|
codec: {
|
|
133
179
|
mode: 'strict',
|
|
134
180
|
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
135
|
-
|
|
181
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_parameter_0$schema,
|
|
136
182
|
},
|
|
137
183
|
},
|
|
138
184
|
{
|
|
@@ -142,7 +188,7 @@ export const TYPERT = {
|
|
|
142
188
|
codec: {
|
|
143
189
|
mode: 'strict',
|
|
144
190
|
typeSymbol: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/list:path',
|
|
145
|
-
|
|
191
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_parameter_1$schema,
|
|
146
192
|
},
|
|
147
193
|
},
|
|
148
194
|
],
|
|
@@ -150,9 +196,9 @@ export const TYPERT = {
|
|
|
150
196
|
result: {
|
|
151
197
|
mode: 'strict',
|
|
152
198
|
typeSymbol: '@deepseek-ai/dsh-api-workspace-files/types#WorkspaceDirectoryListing',
|
|
153
|
-
|
|
199
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_list_result$schema,
|
|
154
200
|
},
|
|
155
|
-
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":
|
|
201
|
+
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":303,"column":9},
|
|
156
202
|
},
|
|
157
203
|
{
|
|
158
204
|
id: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/read',
|
|
@@ -169,7 +215,7 @@ export const TYPERT = {
|
|
|
169
215
|
codec: {
|
|
170
216
|
mode: 'strict',
|
|
171
217
|
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
172
|
-
|
|
218
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_0$schema,
|
|
173
219
|
},
|
|
174
220
|
},
|
|
175
221
|
{
|
|
@@ -179,7 +225,7 @@ export const TYPERT = {
|
|
|
179
225
|
codec: {
|
|
180
226
|
mode: 'strict',
|
|
181
227
|
typeSymbol: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/read:path',
|
|
182
|
-
|
|
228
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_1$schema,
|
|
183
229
|
},
|
|
184
230
|
},
|
|
185
231
|
{
|
|
@@ -189,7 +235,7 @@ export const TYPERT = {
|
|
|
189
235
|
codec: {
|
|
190
236
|
mode: 'strict',
|
|
191
237
|
typeSymbol: '@deepseek-ai/dsh-api-workspace-files/types#WorkspaceFileRange',
|
|
192
|
-
|
|
238
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_parameter_2$schema,
|
|
193
239
|
},
|
|
194
240
|
},
|
|
195
241
|
],
|
|
@@ -197,46 +243,9 @@ export const TYPERT = {
|
|
|
197
243
|
result: {
|
|
198
244
|
mode: 'strict',
|
|
199
245
|
typeSymbol: '@deepseek-ai/dsh-api-workspace-files/types#WorkspaceFileText',
|
|
200
|
-
|
|
201
|
-
},
|
|
202
|
-
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":232,"column":9},
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
id: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/readAll',
|
|
206
|
-
service: 'workspaceFiles',
|
|
207
|
-
namespace: 'workspaceFiles',
|
|
208
|
-
method: 'readAll',
|
|
209
|
-
invocation: { kind: 'direct' },
|
|
210
|
-
parameters: [
|
|
211
|
-
{
|
|
212
|
-
name: 'workspaceFileScope',
|
|
213
|
-
wire: 'workspaceFileScopeId',
|
|
214
|
-
source: 'lookup',
|
|
215
|
-
lookup: 'workspaceFileScope',
|
|
216
|
-
codec: {
|
|
217
|
-
mode: 'strict',
|
|
218
|
-
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
219
|
-
schema: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readAll_parameter_0$schema,
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
name: 'path',
|
|
224
|
-
wire: 'path',
|
|
225
|
-
source: 'json',
|
|
226
|
-
codec: {
|
|
227
|
-
mode: 'strict',
|
|
228
|
-
typeSymbol: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/readAll:path',
|
|
229
|
-
schema: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readAll_parameter_1$schema,
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
],
|
|
233
|
-
cancellation: { parameter: 'signal' },
|
|
234
|
-
result: {
|
|
235
|
-
mode: 'strict',
|
|
236
|
-
typeSymbol: '@deepseek-ai/dsh-api-workspace-files/types#WorkspaceFileBytes',
|
|
237
|
-
schema: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readAll_result$schema,
|
|
246
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_read_result$schema,
|
|
238
247
|
},
|
|
239
|
-
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":
|
|
248
|
+
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":233,"column":9},
|
|
240
249
|
},
|
|
241
250
|
{
|
|
242
251
|
id: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/readBytes',
|
|
@@ -253,7 +262,7 @@ export const TYPERT = {
|
|
|
253
262
|
codec: {
|
|
254
263
|
mode: 'strict',
|
|
255
264
|
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
256
|
-
|
|
265
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_0$schema,
|
|
257
266
|
},
|
|
258
267
|
},
|
|
259
268
|
{
|
|
@@ -263,17 +272,17 @@ export const TYPERT = {
|
|
|
263
272
|
codec: {
|
|
264
273
|
mode: 'strict',
|
|
265
274
|
typeSymbol: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/readBytes:path',
|
|
266
|
-
|
|
275
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_1$schema,
|
|
267
276
|
},
|
|
268
277
|
},
|
|
269
278
|
{
|
|
270
|
-
name: '
|
|
271
|
-
wire: '
|
|
279
|
+
name: 'options',
|
|
280
|
+
wire: 'options',
|
|
272
281
|
source: 'json',
|
|
273
282
|
codec: {
|
|
274
283
|
mode: 'strict',
|
|
275
|
-
typeSymbol: '@deepseek-ai/dsh-api-workspace-files/types#
|
|
276
|
-
|
|
284
|
+
typeSymbol: '@deepseek-ai/dsh-api-workspace-files/types#WorkspaceByteReadOptions',
|
|
285
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_parameter_2$schema,
|
|
277
286
|
},
|
|
278
287
|
},
|
|
279
288
|
],
|
|
@@ -281,57 +290,12 @@ export const TYPERT = {
|
|
|
281
290
|
result: {
|
|
282
291
|
mode: 'strict',
|
|
283
292
|
typeSymbol: '@deepseek-ai/dsh-api-workspace-files/types#WorkspaceFileBytes',
|
|
284
|
-
|
|
293
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_result$schema,
|
|
294
|
+
decode: value => _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readBytes_result$schema().parse(value),
|
|
295
|
+
encode: (value, writeBytes) => $encode0(value, writeBytes, [], new Map()),
|
|
285
296
|
},
|
|
286
297
|
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":257,"column":9},
|
|
287
298
|
},
|
|
288
|
-
{
|
|
289
|
-
id: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/readRelated',
|
|
290
|
-
service: 'workspaceFiles',
|
|
291
|
-
namespace: 'workspaceFiles',
|
|
292
|
-
method: 'readRelated',
|
|
293
|
-
invocation: { kind: 'direct' },
|
|
294
|
-
parameters: [
|
|
295
|
-
{
|
|
296
|
-
name: 'workspaceFileScope',
|
|
297
|
-
wire: 'workspaceFileScopeId',
|
|
298
|
-
source: 'lookup',
|
|
299
|
-
lookup: 'workspaceFileScope',
|
|
300
|
-
codec: {
|
|
301
|
-
mode: 'strict',
|
|
302
|
-
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
303
|
-
schema: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readRelated_parameter_0$schema,
|
|
304
|
-
},
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
name: 'path',
|
|
308
|
-
wire: 'path',
|
|
309
|
-
source: 'json',
|
|
310
|
-
codec: {
|
|
311
|
-
mode: 'strict',
|
|
312
|
-
typeSymbol: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/readRelated:path',
|
|
313
|
-
schema: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readRelated_parameter_1$schema,
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
name: 'relativePath',
|
|
318
|
-
wire: 'relativePath',
|
|
319
|
-
source: 'json',
|
|
320
|
-
codec: {
|
|
321
|
-
mode: 'strict',
|
|
322
|
-
typeSymbol: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/readRelated:relativePath',
|
|
323
|
-
schema: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readRelated_parameter_2$schema,
|
|
324
|
-
},
|
|
325
|
-
},
|
|
326
|
-
],
|
|
327
|
-
cancellation: { parameter: 'signal' },
|
|
328
|
-
result: {
|
|
329
|
-
mode: 'strict',
|
|
330
|
-
typeSymbol: '@deepseek-ai/dsh-api-workspace-files/types#WorkspaceFileBytes',
|
|
331
|
-
schema: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_readRelated_result$schema,
|
|
332
|
-
},
|
|
333
|
-
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":300,"column":9},
|
|
334
|
-
},
|
|
335
299
|
{
|
|
336
300
|
id: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/stat',
|
|
337
301
|
service: 'workspaceFiles',
|
|
@@ -347,7 +311,7 @@ export const TYPERT = {
|
|
|
347
311
|
codec: {
|
|
348
312
|
mode: 'strict',
|
|
349
313
|
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
350
|
-
|
|
314
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_parameter_0$schema,
|
|
351
315
|
},
|
|
352
316
|
},
|
|
353
317
|
{
|
|
@@ -357,7 +321,7 @@ export const TYPERT = {
|
|
|
357
321
|
codec: {
|
|
358
322
|
mode: 'strict',
|
|
359
323
|
typeSymbol: '@deepseek-ai/dsh-api-workspace-files#workspaceFiles/stat:path',
|
|
360
|
-
|
|
324
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_parameter_1$schema,
|
|
361
325
|
},
|
|
362
326
|
},
|
|
363
327
|
],
|
|
@@ -365,9 +329,9 @@ export const TYPERT = {
|
|
|
365
329
|
result: {
|
|
366
330
|
mode: 'strict',
|
|
367
331
|
typeSymbol: '@deepseek-ai/dsh-api-workspace-files/types#WorkspaceFileStat',
|
|
368
|
-
|
|
332
|
+
create: _deepseek_ai_dsh_api_workspace_files_workspaceFiles_stat_result$schema,
|
|
369
333
|
},
|
|
370
|
-
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":
|
|
334
|
+
sourceLocation: {"file":"packages/api/workspace-files/src/index.ts","line":290,"column":9},
|
|
371
335
|
},
|
|
372
336
|
],
|
|
373
337
|
model: {
|
|
@@ -390,23 +354,9 @@ export const TYPERT = {
|
|
|
390
354
|
{
|
|
391
355
|
"kind": "method",
|
|
392
356
|
"name": "readBytes",
|
|
393
|
-
"signature": "@Remote async readBytes( workspaceFileScope: WorkspaceFileScope, path: string,
|
|
394
|
-
"summary": "Read
|
|
395
|
-
"jsDoc": "/**\n * Read
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
"kind": "method",
|
|
399
|
-
"name": "readAll",
|
|
400
|
-
"signature": "@Remote async readAll(workspaceFileScope: WorkspaceFileScope, path: string, signal: AbortSignal): Promise<WorkspaceFileBytes>",
|
|
401
|
-
"summary": "Read a complete regular file as bytes, subject to the configured full-file cap.",
|
|
402
|
-
"jsDoc": "/**\n * Read a complete regular file as bytes, subject to the configured full-file cap.\n * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.\n * @param path - absolute or workspace-relative file path.\n * @param signal - caller cancellation.\n * @returns one complete base64 window with offset zero and eof true; oversized files fail with too-large.\n */"
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
"kind": "method",
|
|
406
|
-
"name": "readRelated",
|
|
407
|
-
"signature": "@Remote async readRelated( workspaceFileScope: WorkspaceFileScope, path: string, relativePath: string, signal: AbortSignal, ): Promise<WorkspaceFileBytes>",
|
|
408
|
-
"summary": "Read a complete file relative to another file's directory, including outside the workspace.",
|
|
409
|
-
"jsDoc": "/**\n * Read a complete file relative to another file's directory, including outside the workspace.\n * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.\n * @param path - base file, absolute or workspace-relative.\n * @param relativePath - relative filesystem path, not a URL or absolute path.\n * @param signal - caller cancellation.\n * @returns the complete related file using the ordinary file-size and access checks.\n */"
|
|
357
|
+
"signature": "@Remote async readBytes( workspaceFileScope: WorkspaceFileScope, path: string, options: WorkspaceByteReadOptions, signal: AbortSignal, ): Promise<WorkspaceFileBytes>",
|
|
358
|
+
"summary": "Read a complete regular file or one byte range without text decoding.",
|
|
359
|
+
"jsDoc": "/**\n * Read a complete regular file or one byte range without text decoding.\n * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.\n * @param path - target path, absolute or workspace-relative; relative to the base file's directory when provided.\n * @param options - optional base file and range; without a range the complete-file cap applies.\n * @param signal - caller cancellation.\n * @returns native bytes with the file's version and size at the preceding stat, byte offset, and EOF marker.\n */"
|
|
410
360
|
},
|
|
411
361
|
{
|
|
412
362
|
"kind": "method",
|
|
@@ -425,9 +375,9 @@ export const TYPERT = {
|
|
|
425
375
|
{
|
|
426
376
|
"kind": "method",
|
|
427
377
|
"name": "changes",
|
|
428
|
-
"signature": "@Remote({ mode: 'stream' }) changes(workspaceFileScope: WorkspaceFileScope, signal: AbortSignal): AsyncIterable<WorkspaceFileWatchFrame>",
|
|
429
|
-
"summary": "
|
|
430
|
-
"jsDoc": "/**\n *
|
|
378
|
+
"signature": "@Remote({ mode: 'stream' }) changes(workspaceFileScope: WorkspaceFileScope, path: string, signal: AbortSignal): AsyncIterable<WorkspaceFileWatchFrame>",
|
|
379
|
+
"summary": "Watch one file or a directory's direct entries in the Session's filesystem.",
|
|
380
|
+
"jsDoc": "/**\n * Watch one file or a directory's direct entries in the Session's filesystem.\n * Files use the backend's read authority; directories remain workspace-scoped.\n * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.\n * @param path - target path; the Host determines its type and confines directories to the workspace.\n * @param signal - generation cancellation.\n * @returns `ready` once the target watch is active, then current metadata for queued and live invalidations.\n * @throws RemoteError when watching is unavailable or a directory is outside the workspace.\n */"
|
|
431
381
|
}
|
|
432
382
|
],
|
|
433
383
|
"types": [
|
|
@@ -443,6 +393,10 @@ export const TYPERT = {
|
|
|
443
393
|
"name": "WorkspaceByteRange",
|
|
444
394
|
"declaration": "export interface WorkspaceByteRange {\n readonly offset?: number;\n readonly length?: number;\n}"
|
|
445
395
|
},
|
|
396
|
+
{
|
|
397
|
+
"name": "WorkspaceByteReadOptions",
|
|
398
|
+
"declaration": "export interface WorkspaceByteReadOptions {\n readonly range?: WorkspaceByteRange;\n readonly baseFile?: string;\n}"
|
|
399
|
+
},
|
|
446
400
|
{
|
|
447
401
|
"name": "WorkspaceDirectoryEntry",
|
|
448
402
|
"declaration": "export interface WorkspaceDirectoryEntry {\n readonly name: string;\n readonly type: 'file' | 'directory' | 'other';\n readonly size?: number;\n}"
|
|
@@ -453,7 +407,7 @@ export const TYPERT = {
|
|
|
453
407
|
},
|
|
454
408
|
{
|
|
455
409
|
"name": "WorkspaceFileBytes",
|
|
456
|
-
"declaration": "export interface WorkspaceFileBytes extends WorkspaceFileStat {\n readonly offset: number;\n readonly data:
|
|
410
|
+
"declaration": "export interface WorkspaceFileBytes<Data extends Uint8Array = Uint8Array> extends WorkspaceFileStat {\n readonly offset: number;\n readonly data: Data;\n readonly eof: boolean;\n}"
|
|
457
411
|
},
|
|
458
412
|
{
|
|
459
413
|
"name": "WorkspaceFileChange",
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
2
|
import type {
|
|
3
3
|
RemoteResult,
|
|
4
|
+
RemoteStreamHandle,
|
|
4
5
|
TypertRemoteContribution,
|
|
5
6
|
} from '@deepseek-ai/dsh-typert-protocol'
|
|
6
|
-
import type {
|
|
7
|
+
import type { WorkspaceByteReadOptions, WorkspaceDirectoryListing, WorkspaceFileBytes, WorkspaceFileRange, WorkspaceFileStat, WorkspaceFileText, WorkspaceFileWatchFrame } from '@deepseek-ai/dsh-api-workspace-files/types'
|
|
7
8
|
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
|
8
9
|
|
|
10
|
+
type RemoteDecoded<Value> = Value extends Uint8Array ? Uint8Array<ArrayBuffer>
|
|
11
|
+
: Value extends string | number | boolean | null | undefined ? Value
|
|
12
|
+
: { [Key in keyof Value]: RemoteDecoded<Value[Key]> }
|
|
13
|
+
|
|
9
14
|
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
10
15
|
interface TypertRemoteNamespace$776f726b737061636546696c6573 {
|
|
11
|
-
changes: (workspaceFileScopeId: SessionId, signal?: AbortSignal) =>
|
|
16
|
+
changes: (workspaceFileScopeId: SessionId, path: string, signal?: AbortSignal) => RemoteStreamHandle<WorkspaceFileWatchFrame, never>
|
|
12
17
|
list: (workspaceFileScopeId: SessionId, path: string, signal?: AbortSignal) => Promise<RemoteResult<WorkspaceDirectoryListing>>
|
|
13
18
|
read: (workspaceFileScopeId: SessionId, path: string, range: WorkspaceFileRange, signal?: AbortSignal) => Promise<RemoteResult<WorkspaceFileText>>
|
|
14
|
-
|
|
15
|
-
readBytes: (workspaceFileScopeId: SessionId, path: string, range: WorkspaceByteRange, signal?: AbortSignal) => Promise<RemoteResult<WorkspaceFileBytes>>
|
|
16
|
-
readRelated: (workspaceFileScopeId: SessionId, path: string, relativePath: string, signal?: AbortSignal) => Promise<RemoteResult<WorkspaceFileBytes>>
|
|
19
|
+
readBytes: (workspaceFileScopeId: SessionId, path: string, options: WorkspaceByteReadOptions, signal?: AbortSignal) => Promise<RemoteResult<RemoteDecoded<WorkspaceFileBytes>>>
|
|
17
20
|
stat: (workspaceFileScopeId: SessionId, path: string, signal?: AbortSignal) => Promise<RemoteResult<WorkspaceFileStat>>
|
|
18
21
|
}
|
|
19
22
|
interface TypertRemoteMap {
|
|
20
|
-
'workspaceFiles/changes': (workspaceFileScopeId: SessionId, signal?: AbortSignal) =>
|
|
23
|
+
'workspaceFiles/changes': (workspaceFileScopeId: SessionId, path: string, signal?: AbortSignal) => RemoteStreamHandle<WorkspaceFileWatchFrame, never>
|
|
21
24
|
'workspaceFiles/list': (workspaceFileScopeId: SessionId, path: string, signal?: AbortSignal) => Promise<RemoteResult<WorkspaceDirectoryListing>>
|
|
22
25
|
'workspaceFiles/read': (workspaceFileScopeId: SessionId, path: string, range: WorkspaceFileRange, signal?: AbortSignal) => Promise<RemoteResult<WorkspaceFileText>>
|
|
23
|
-
'workspaceFiles/
|
|
24
|
-
'workspaceFiles/readBytes': (workspaceFileScopeId: SessionId, path: string, range: WorkspaceByteRange, signal?: AbortSignal) => Promise<RemoteResult<WorkspaceFileBytes>>
|
|
25
|
-
'workspaceFiles/readRelated': (workspaceFileScopeId: SessionId, path: string, relativePath: string, signal?: AbortSignal) => Promise<RemoteResult<WorkspaceFileBytes>>
|
|
26
|
+
'workspaceFiles/readBytes': (workspaceFileScopeId: SessionId, path: string, options: WorkspaceByteReadOptions, signal?: AbortSignal) => Promise<RemoteResult<RemoteDecoded<WorkspaceFileBytes>>>
|
|
26
27
|
'workspaceFiles/stat': (workspaceFileScopeId: SessionId, path: string, signal?: AbortSignal) => Promise<RemoteResult<WorkspaceFileStat>>
|
|
27
28
|
}
|
|
28
29
|
interface TypertRemoteNamespaceMap {
|