@deepseek-ai/dsh-office-kit 0.0.0-stage → 0.2.2-rc.3

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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +37 -0
  3. package/README.md +128 -2
  4. package/README.zh.md +129 -0
  5. package/lib/index.js +1234 -0
  6. package/lib/typert.host.d.ts +3 -0
  7. package/lib/typert.host.js +346 -0
  8. package/lib/typert.remote-client.d.ts +30 -0
  9. package/lib/typert.remote-client.d.ts.map +1 -0
  10. package/lib/typert.remote-client.js +162 -0
  11. package/lib/types/errors.d.ts +13 -0
  12. package/lib/types/errors.d.ts.map +1 -0
  13. package/lib/types/errors.js +15 -0
  14. package/lib/types/errors.js.map +1 -0
  15. package/lib/types/identity.d.ts +27 -0
  16. package/lib/types/identity.d.ts.map +1 -0
  17. package/lib/types/identity.js +23 -0
  18. package/lib/types/identity.js.map +1 -0
  19. package/lib/types/index.d.ts +157 -0
  20. package/lib/types/index.d.ts.map +1 -0
  21. package/lib/types/index.js +459 -0
  22. package/lib/types/index.js.map +1 -0
  23. package/lib/types/locate.d.ts +48 -0
  24. package/lib/types/locate.d.ts.map +1 -0
  25. package/lib/types/locate.js +65 -0
  26. package/lib/types/locate.js.map +1 -0
  27. package/lib/types/output.d.ts +26 -0
  28. package/lib/types/output.d.ts.map +1 -0
  29. package/lib/types/output.js +75 -0
  30. package/lib/types/output.js.map +1 -0
  31. package/lib/types/outputs.d.ts +75 -0
  32. package/lib/types/outputs.d.ts.map +1 -0
  33. package/lib/types/outputs.js +198 -0
  34. package/lib/types/outputs.js.map +1 -0
  35. package/lib/types/queue.d.ts +106 -0
  36. package/lib/types/queue.d.ts.map +1 -0
  37. package/lib/types/queue.js +276 -0
  38. package/lib/types/queue.js.map +1 -0
  39. package/lib/types/types.d.ts +151 -0
  40. package/lib/types/types.d.ts.map +1 -0
  41. package/lib/types/types.js +2 -0
  42. package/lib/types/types.js.map +1 -0
  43. package/locale/de.json +6 -0
  44. package/locale/en.json +6 -0
  45. package/locale/es.json +6 -0
  46. package/locale/fr.json +6 -0
  47. package/locale/ja.json +6 -0
  48. package/locale/pt.json +6 -0
  49. package/locale/ru.json +6 -0
  50. package/locale/zh.json +6 -0
  51. package/package.json +68 -3
  52. package/src/errors.ts +15 -0
  53. package/src/identity.ts +31 -0
  54. package/src/index.ts +484 -0
  55. package/src/locate.ts +93 -0
  56. package/src/output.ts +69 -0
  57. package/src/outputs.ts +218 -0
  58. package/src/queue.ts +316 -0
  59. package/src/types.ts +168 -0
@@ -0,0 +1,3 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+
3
+ export declare const TYPERT: unknown
@@ -0,0 +1,346 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ import { createTypertRemoteInfo } from '@deepseek-ai/dsh-typert-protocol/remote-info'
5
+
6
+ let _deepseek_ai_dsh_office_kit_officeKit_generation_result$schema$value
7
+ const _deepseek_ai_dsh_office_kit_officeKit_generation_result$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_generation_result$schema$value ??= z.string())
8
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0$schema$value
9
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_0$schema$value ??= z.string())
10
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1$schema$value
11
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_1$schema$value ??= z.string())
12
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2$schema$value
13
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_2$schema$value ??= z.union([z.literal("foreground"), z.literal("background")]))
14
+ let _deepseek_ai_dsh_office_kit_officeKit_render_result$schema$value
15
+ const _deepseek_ai_dsh_office_kit_officeKit_render_result$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_result$schema$value ??= z.object({
16
+ 'missingFonts': z.array(z.string()).readonly(),
17
+ 'generation': z.string().readonly(),
18
+ 'offset': z.number().readonly().describe('First byte of the window, as requested.'),
19
+ 'data': z.instanceof(Uint8Array).describe('Native file bytes; empty at or past EOF.'),
20
+ 'eof': z.boolean().readonly().describe('Whether the window includes the file\'s last byte.'),
21
+ 'absolutePath': z.string().readonly().describe('Absolute path of the file in the filesystem\'s execution world, symlinks resolved: `/`-separated on POSIX, drive-rooted with the platform separator on Windows. What a `dsh-resource://file/absolute/…` address carries, and what a `dsh-resource://file/session/<sessionId>/…` address\'s workspace-relative path resolves to against that Session\'s root.'),
22
+ 'version': z.string().readonly().describe('Opaque freshness token at the time of the stat; never parsed.'),
23
+ 'bytes': z.number().readonly().optional().describe('Byte size of the complete file, when the backend reports it.'),
24
+ }))
25
+ const $resultSnapshot = (input, path) => {
26
+ if (input === null || typeof input !== 'object' || input instanceof Uint8Array) return input
27
+ const toJSON = input.toJSON
28
+ const value = typeof toJSON === 'function' ? toJSON.call(input, path.at(-1)?.toString() ?? 'value') : input
29
+ if (value === null || typeof value !== 'object' || value instanceof Uint8Array) return value
30
+ if (Array.isArray(value)) {
31
+ const items = []
32
+ for (let index = 0, length = value.length; index < length; index++) items.push(value[index])
33
+ return items
34
+ }
35
+ const fields = {}
36
+ for (const key of Object.keys(value)) {
37
+ const item = key === 'toJSON' && value === input ? toJSON : value[key]
38
+ if (key === 'toJSON' && typeof item === 'function') continue
39
+ Object.defineProperty(fields, key, { value: item, enumerable: true, writable: true, configurable: true })
40
+ }
41
+ return fields
42
+ }
43
+ const $resultContainer = (input, path, ancestors, project, snapshot) => {
44
+ if (input === null || typeof input !== 'object') return project(input)
45
+ const owner = !ancestors.has(input)
46
+ if (!owner && ancestors.get(input) !== path.length) throw new TypeError('Remote result contains a circular object')
47
+ if (owner) ancestors.set(input, path.length)
48
+ try { return project(snapshot ? $resultSnapshot(input, path) : input) }
49
+ finally { if (owner) ancestors.delete(input) }
50
+ }
51
+ const $encode1 = (value, writeBytes, path, ancestors) => {
52
+ return value instanceof Uint8Array ? writeBytes(value, path) : value
53
+ }
54
+ const $encode0 = (value, writeBytes, path, ancestors) => {
55
+ return $resultContainer(value, path, ancestors, value => {
56
+ if (value === null || typeof value !== 'object' || Array.isArray(value) || value instanceof Uint8Array) return value
57
+ if (Object.hasOwn(value, 'data')) value['data'] = $encode1(value['data'], writeBytes, [...path, 'data'], ancestors)
58
+ return value
59
+ }, true)
60
+ }
61
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0_strict$schema$value
62
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0_strict$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_0_strict$schema$value ??= z.string())
63
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1_strict$schema$value
64
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1_strict$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_1_strict$schema$value ??= z.string())
65
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2_strict$schema$value
66
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2_strict$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_2_strict$schema$value ??= z.union([z.literal("foreground"), z.literal("background")]))
67
+
68
+ const $remote = createTypertRemoteInfo({
69
+ package: '@deepseek-ai/dsh-office-kit',
70
+ methods: {
71
+ 'officeKit/generation': {
72
+ service: 'officeKit',
73
+ description: 'Read the current rendering generation before reusing a Client PDF.',
74
+ implementation: 'getGeneration',
75
+ invocation: { kind: 'direct' },
76
+ parameters: [
77
+ ],
78
+ cancellation: { parameter: 'signal' },
79
+ result: {
80
+ mode: 'strict',
81
+ typeSymbol: '@deepseek-ai/dsh-office-kit/types#OfficeKitGeneration',
82
+ create: _deepseek_ai_dsh_office_kit_officeKit_generation_result$schema,
83
+ description: 'provider lifetime, replaced with rendering, font, or engine configuration.',
84
+ jsonSchema: {"type":"string"},
85
+ },
86
+ sourceLocation: {"file":"packages/document/office-kit/src/index.ts","line":276,"column":3},
87
+ },
88
+ 'officeKit/render': {
89
+ service: 'officeKit',
90
+ description: 'Read and convert one Office file using the Session\'s ordinary filesystem authorization.',
91
+ invocation: { kind: 'direct' },
92
+ parameters: [
93
+ {
94
+ name: 'workspaceFileScope',
95
+ wire: 'workspaceFileScopeId',
96
+ description: 'Session header lookup shared with workspaceFiles.',
97
+ source: 'lookup',
98
+ lookup: 'workspaceFileScope',
99
+ codec: {
100
+ mode: 'strict',
101
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
102
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0$schema,
103
+ jsonSchema: {"type":"string"},
104
+ },
105
+ strictCodec: {
106
+ mode: 'strict',
107
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
108
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0_strict$schema,
109
+ jsonSchema: {"type":"string"},
110
+ },
111
+ },
112
+ {
113
+ name: 'path',
114
+ description: 'absolute or workspace-relative Office path.',
115
+ source: 'json',
116
+ codec: {
117
+ mode: 'strict',
118
+ typeSymbol: '@deepseek-ai/dsh-office-kit#officeKit/render:path',
119
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1$schema,
120
+ jsonSchema: {"type":"string"},
121
+ },
122
+ strictCodec: {
123
+ mode: 'strict',
124
+ typeSymbol: '@deepseek-ai/dsh-office-kit#officeKit/render:path',
125
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1_strict$schema,
126
+ jsonSchema: {"type":"string"},
127
+ },
128
+ },
129
+ {
130
+ name: 'priority',
131
+ description: 'foreground preview or speculative background work.',
132
+ source: 'json',
133
+ codec: {
134
+ mode: 'strict',
135
+ typeSymbol: '@deepseek-ai/dsh-office-kit/types#OfficeKitPriority',
136
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2$schema,
137
+ jsonSchema: {"type":"string","enum":["foreground","background"]},
138
+ },
139
+ strictCodec: {
140
+ mode: 'strict',
141
+ typeSymbol: '@deepseek-ai/dsh-office-kit/types#OfficeKitPriority',
142
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2_strict$schema,
143
+ jsonSchema: {"type":"string","enum":["foreground","background"]},
144
+ },
145
+ },
146
+ ],
147
+ cancellation: { parameter: 'signal' },
148
+ result: {
149
+ mode: 'strict',
150
+ typeSymbol: '@deepseek-ai/dsh-office-kit/types#RenderedDocumentBytes',
151
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_result$schema,
152
+ description: 'complete PDF bytes with original source identity and missing font families.',
153
+ jsonSchemaError: 'typert tool schema: unsupported selected reference Uint8Array',
154
+ decode: value => _deepseek_ai_dsh_office_kit_officeKit_render_result$schema().parse(value),
155
+ encode: (value, writeBytes) => $encode0(value, writeBytes, [], new Map()),
156
+ },
157
+ sourceLocation: {"file":"packages/document/office-kit/src/index.ts","line":261,"column":9},
158
+ },
159
+ },
160
+ }, z)
161
+
162
+ export const TYPERT = {
163
+ package: '@deepseek-ai/dsh-office-kit',
164
+ face: 'host',
165
+ schemas: [
166
+ ],
167
+ get invocations() { return $remote.descriptors },
168
+ model: {
169
+ "services": [
170
+ {
171
+ "description": "A provider lifetime owns all converters, queued calls, and temporary files.",
172
+ "summary": "A provider lifetime owns all converters, queued calls, and temporary files.",
173
+ "tags": [],
174
+ "jsDoc": "/** A provider lifetime owns all converters, queued calls, and temporary files. */",
175
+ "key": "officeKit",
176
+ "exportName": "OfficeKit",
177
+ "members": [
178
+ {
179
+ "kind": "property",
180
+ "name": "generation",
181
+ "signature": "readonly generation: OfficeKitGeneration = OfficeKitGeneration(randomUUID())",
182
+ "summary": "Changes whenever engine, font, or conversion configuration is replaced.",
183
+ "jsDoc": "/** Changes whenever engine, font, or conversion configuration is replaced. */"
184
+ },
185
+ {
186
+ "kind": "property",
187
+ "name": "outputDirectory",
188
+ "signature": "readonly outputDirectory: string",
189
+ "summary": "Absolute Host directory holding converted and recalculated files; consumers check that their execution world reads it.",
190
+ "jsDoc": "/** Absolute Host directory holding converted and recalculated files; consumers check that their execution world reads it. */"
191
+ },
192
+ {
193
+ "kind": "method",
194
+ "name": "convert",
195
+ "signature": "async convert(request: OfficeKitRequest, signal?: AbortSignal): Promise<OfficeKitResult>",
196
+ "summary": "Convert Office bytes to PDF without modifying the source or writing Session events.",
197
+ "jsDoc": "/**\n * Convert Office bytes to PDF without modifying the source or writing Session events.\n * @param request - authorized metadata and deferred bounded source read.\n * @param signal - caller cancellation; provider disposal also stops active work.\n * @returns caller-owned PDF bytes after conversion and scratch cleanup settle; canceled readers reject independently.\n * @throws {OfficeKitError} Invalid input, unusable output, or engine failure; cancellation rejects with its reason.\n */"
198
+ },
199
+ {
200
+ "kind": "method",
201
+ "name": "renderImages",
202
+ "signature": "async renderImages(request: OfficeImagesRequest, signal?: AbortSignal): Promise<OfficeImagesResult>",
203
+ "summary": "Render selected pages, slides, or worksheet areas of one document as PNG images.",
204
+ "jsDoc": "/**\n * Render selected pages, slides, or worksheet areas of one document as PNG images. Requests share the admission\n * queue, concurrency, source-byte reservation, and cache with previews, and run at foreground priority.\n * @param request - authorized metadata, deferred bounded source read, selection, and complete-result limits.\n * @param signal - caller cancellation; provider disposal also stops active work.\n * @returns caller-owned images in document order whose count, per-image size, and total bytes satisfy the limits.\n * @throws {OfficeKitError} `invalid-request` for a selection the engine rejects, `output-too-large` when the\n * selection exceeds a limit, and the other conversion codes; cancellation rejects with its reason.\n */"
205
+ },
206
+ {
207
+ "kind": "method",
208
+ "name": "convertTo",
209
+ "signature": "async convertTo(request: OfficeConversionRequest, signal?: AbortSignal): Promise<OfficeFileResult>",
210
+ "summary": "Convert one document to another format at foreground priority, sharing admission, concurrency, and cache with previews, and save the result in the provider's output store.",
211
+ "jsDoc": "/**\n * Convert one document to another format at foreground priority, sharing admission, concurrency, and cache with\n * previews, and save the result in the provider's output store.\n * @param request - authorized metadata, deferred bounded source read, target format, and output owner and name.\n * @param signal - caller cancellation; provider disposal also stops active work.\n * @returns the saved file's absolute Host path and size; the file is deleted after `outputRetentionMs`, when older\n * outputs need `maxOutputStoreBytes`, when the Session whose id is `output.owner` is disposed, or when the provider is disposed.\n * @throws {OfficeKitError} `invalid-request` for a format or sheet the engine rejects and the other conversion\n * codes; cancellation rejects with its reason.\n */"
212
+ },
213
+ {
214
+ "kind": "method",
215
+ "name": "recalculate",
216
+ "signature": "async recalculate(request: OfficeRecalculationRequest, signal?: AbortSignal): Promise<OfficeFileResult>",
217
+ "summary": "Recalculate every formula of one workbook at foreground priority and save formulas with refreshed cached results, sharing admission, concurrency, and cache with previews, and save the workbook in the provider's output store.",
218
+ "jsDoc": "/**\n * Recalculate every formula of one workbook at foreground priority and save formulas with refreshed cached results, sharing admission,\n * concurrency, and cache with previews, and save the workbook in the provider's output store. This does not validate\n * formulas or business data.\n * @param request - authorized workbook metadata, deferred bounded source read, output format, and output owner and name.\n * @param signal - caller cancellation; provider disposal also stops active work.\n * @returns the saved workbook's absolute Host path and size, retained like {@link convertTo} outputs.\n * @throws {OfficeKitError} Invalid input, unusable output, or engine failure; cancellation rejects with its reason.\n */"
219
+ },
220
+ {
221
+ "kind": "method",
222
+ "name": "render",
223
+ "signature": "@Remote async render( workspaceFileScope: WorkspaceFileScope, path: string, priority: OfficeKitPriority, signal: AbortSignal, ): Promise<RenderedDocumentBytes>",
224
+ "summary": "Read and convert one Office file using the Session's ordinary filesystem authorization.",
225
+ "jsDoc": "/**\n * Read and convert one Office file using the Session's ordinary filesystem authorization.\n * @param workspaceFileScope - Session header lookup shared with workspaceFiles.\n * @param path - absolute or workspace-relative Office path.\n * @param priority - foreground preview or speculative background work.\n * @param signal - Remote cancellation; disposal also cancels outstanding reads and conversions.\n * @returns complete PDF bytes with original source identity and missing font families.\n */"
226
+ },
227
+ {
228
+ "kind": "method",
229
+ "name": "getGeneration",
230
+ "signature": "@Remote('generation') getGeneration(signal: AbortSignal): OfficeKitGeneration",
231
+ "summary": "Read the current rendering generation before reusing a Client PDF.",
232
+ "jsDoc": "/**\n * Read the current rendering generation before reusing a Client PDF.\n * @param signal - Remote caller cancellation.\n * @returns provider lifetime, replaced with rendering, font, or engine configuration.\n */"
233
+ }
234
+ ],
235
+ "types": [
236
+ {
237
+ "name": "Branded",
238
+ "declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
239
+ },
240
+ {
241
+ "name": "OfficeConversionFormat",
242
+ "declaration": "export type OfficeConversionFormat = 'pdf' | 'docx' | 'odt' | 'txt' | 'xlsx' | 'ods' | 'csv' | 'pptx' | 'odp';"
243
+ },
244
+ {
245
+ "name": "OfficeConversionRequest",
246
+ "declaration": "export interface OfficeConversionRequest {\n readonly extension: OfficeDocumentExtension;\n readonly format: OfficeConversionFormat;\n readonly sheet?: string;\n readonly source: OfficeKitSource;\n readonly output: OfficeOutputTarget;\n}"
247
+ },
248
+ {
249
+ "name": "OfficeDocumentExtension",
250
+ "declaration": "export type OfficeDocumentExtension = OfficeExtension | 'odt' | 'ods' | 'odp';"
251
+ },
252
+ {
253
+ "name": "OfficeExtension",
254
+ "declaration": "export type OfficeExtension = 'doc' | 'docx' | 'xls' | 'xlsx' | 'ppt' | 'pptx';"
255
+ },
256
+ {
257
+ "name": "OfficeFileResult",
258
+ "declaration": "export interface OfficeFileResult {\n readonly path: string;\n readonly bytes: number;\n readonly pageCount?: number;\n readonly missingFonts: string[];\n}"
259
+ },
260
+ {
261
+ "name": "OfficeImage",
262
+ "declaration": "export interface OfficeImage {\n readonly png: Uint8Array;\n readonly width: number;\n readonly height: number;\n readonly page?: number;\n readonly sheet?: string;\n readonly range?: string;\n}"
263
+ },
264
+ {
265
+ "name": "OfficeImageInputExtension",
266
+ "declaration": "export type OfficeImageInputExtension = OfficeDocumentExtension | 'pdf';"
267
+ },
268
+ {
269
+ "name": "OfficeImagesRequest",
270
+ "declaration": "export interface OfficeImagesRequest {\n readonly extension: OfficeImageInputExtension;\n readonly source: OfficeKitSource;\n readonly pages?: readonly number[];\n readonly sheet?: string;\n readonly range?: string;\n readonly dpi?: number;\n readonly maxImages: number;\n readonly maxPixels: number;\n readonly maxDimension: number;\n readonly maxBytes: number;\n}"
271
+ },
272
+ {
273
+ "name": "OfficeImagesResult",
274
+ "declaration": "export interface OfficeImagesResult {\n readonly images: readonly OfficeImage[];\n readonly pageCount: number;\n readonly dpi: number;\n readonly missingFonts: string[];\n}"
275
+ },
276
+ {
277
+ "name": "OfficeKitGeneration",
278
+ "declaration": "export type OfficeKitGeneration = Branded<'OfficeKitGeneration'>;"
279
+ },
280
+ {
281
+ "name": "OfficeKitKey",
282
+ "declaration": "export type OfficeKitKey = Branded<'OfficeKitKey'>;"
283
+ },
284
+ {
285
+ "name": "OfficeKitPriority",
286
+ "declaration": "export type OfficeKitPriority = 'foreground' | 'background';"
287
+ },
288
+ {
289
+ "name": "OfficeKitRequest",
290
+ "declaration": "export interface OfficeKitRequest {\n readonly extension: OfficeExtension;\n readonly priority: OfficeKitPriority;\n readonly source: OfficeKitSource;\n}"
291
+ },
292
+ {
293
+ "name": "OfficeKitResult",
294
+ "declaration": "export interface OfficeKitResult {\n readonly pdf: Uint8Array;\n readonly missingFonts: string[];\n readonly cacheKey: OfficeKitKey;\n readonly generation: OfficeKitGeneration;\n}"
295
+ },
296
+ {
297
+ "name": "OfficeKitSource",
298
+ "declaration": "export interface OfficeKitSource {\n readonly key: OfficeSourceKey;\n readonly version: string;\n readonly bytes?: number;\n read(signal: AbortSignal, maxBytes: number): Promise<{ readonly bytes: Uint8Array; readonly version: string; }>;\n}"
299
+ },
300
+ {
301
+ "name": "OfficeOutputTarget",
302
+ "declaration": "export interface OfficeOutputTarget {\n readonly owner: string;\n readonly name: string;\n}"
303
+ },
304
+ {
305
+ "name": "OfficeRecalculationFormat",
306
+ "declaration": "export type OfficeRecalculationFormat = 'xlsx' | 'ods';"
307
+ },
308
+ {
309
+ "name": "OfficeRecalculationRequest",
310
+ "declaration": "export interface OfficeRecalculationRequest {\n readonly extension: OfficeWorkbookExtension;\n readonly format: OfficeRecalculationFormat;\n readonly source: OfficeKitSource;\n readonly output: OfficeOutputTarget;\n}"
311
+ },
312
+ {
313
+ "name": "OfficeSourceKey",
314
+ "declaration": "export type OfficeSourceKey = Branded<'OfficeSourceKey'>;"
315
+ },
316
+ {
317
+ "name": "OfficeWorkbookExtension",
318
+ "declaration": "export type OfficeWorkbookExtension = 'xls' | 'xlsx' | 'ods';"
319
+ },
320
+ {
321
+ "name": "RenderedDocumentBytes",
322
+ "declaration": "export interface RenderedDocumentBytes extends WorkspaceFileBytes {\n readonly missingFonts: string[];\n readonly generation: OfficeKitGeneration;\n}"
323
+ },
324
+ {
325
+ "name": "SessionId",
326
+ "declaration": "export type SessionId = Branded<'SessionId'>;"
327
+ },
328
+ {
329
+ "name": "WorkspaceFileBytes",
330
+ "declaration": "export interface WorkspaceFileBytes<Data extends Uint8Array = Uint8Array> extends WorkspaceFileStat {\n readonly offset: number;\n readonly data: Data;\n readonly eof: boolean;\n}"
331
+ },
332
+ {
333
+ "name": "WorkspaceFileScope",
334
+ "declaration": "export interface WorkspaceFileScope {\n readonly sessionId: SessionId;\n readonly workspaceRoot: string;\n}"
335
+ },
336
+ {
337
+ "name": "WorkspaceFileStat",
338
+ "declaration": "export interface WorkspaceFileStat {\n readonly absolutePath: string;\n readonly version: string;\n readonly bytes?: number;\n}"
339
+ }
340
+ ]
341
+ }
342
+ ],
343
+ "events": [],
344
+ "objects": []
345
+ },
346
+ }
@@ -0,0 +1,30 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import type {
3
+ RemoteDecoded,
4
+ RemoteResult,
5
+ TypertRemoteInfo,
6
+ TypertRemoteMethod,
7
+ } from '@deepseek-ai/dsh-typert-protocol'
8
+ import type { OfficeKitGeneration, OfficeKitPriority, RenderedDocumentBytes } from '@deepseek-ai/dsh-office-kit/types'
9
+ import type { SessionId } from '@deepseek-ai/dsh-session/types'
10
+
11
+ declare module '@deepseek-ai/dsh-typert-protocol' {
12
+ interface TypertRemoteNamespace$6f66666963654b6974 {
13
+ generation: (signal?: AbortSignal) => Promise<RemoteResult<OfficeKitGeneration>>
14
+ render: (workspaceFileScopeId: SessionId, path: string, priority: OfficeKitPriority, signal?: AbortSignal) => Promise<RemoteResult<RemoteDecoded<RenderedDocumentBytes>>>
15
+ }
16
+ interface TypertRemoteMap {
17
+ 'officeKit/generation': (signal?: AbortSignal) => Promise<RemoteResult<OfficeKitGeneration>>
18
+ 'officeKit/render': (workspaceFileScopeId: SessionId, path: string, priority: OfficeKitPriority, signal?: AbortSignal) => Promise<RemoteResult<RemoteDecoded<RenderedDocumentBytes>>>
19
+ }
20
+ interface TypertRemoteNamespaceMap {
21
+ 'officeKit': TypertRemoteNamespace$6f66666963654b6974
22
+ }
23
+ }
24
+
25
+ export declare const TYPERT_REMOTE: TypertRemoteInfo<{
26
+ readonly 'officeKit/generation': TypertRemoteMethod<{ }, OfficeKitGeneration>
27
+ readonly 'officeKit/render': TypertRemoteMethod<{ readonly 'workspaceFileScopeId': SessionId; readonly 'path': string; readonly 'priority': OfficeKitPriority }, RenderedDocumentBytes, 'unary', never, RemoteDecoded<RenderedDocumentBytes>>
28
+ }>
29
+ export default TYPERT_REMOTE
30
+ //# sourceMappingURL=typert.remote-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typert.remote-client.d.ts","names":["generation","render"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;IAmREA,U;IAfMC,M;;;IAeND,sB;IAfMC,kB","ignoreList":[]}
@@ -0,0 +1,162 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ import { createTypertRemoteInfo } from '@deepseek-ai/dsh-typert-protocol/remote-info'
5
+
6
+ let _deepseek_ai_dsh_office_kit_officeKit_generation_result$schema$value
7
+ const _deepseek_ai_dsh_office_kit_officeKit_generation_result$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_generation_result$schema$value ??= z.string())
8
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0$schema$value
9
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_0$schema$value ??= z.string())
10
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1$schema$value
11
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_1$schema$value ??= z.string())
12
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2$schema$value
13
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_2$schema$value ??= z.union([z.literal("foreground"), z.literal("background")]))
14
+ let _deepseek_ai_dsh_office_kit_officeKit_render_result$schema$value
15
+ const _deepseek_ai_dsh_office_kit_officeKit_render_result$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_result$schema$value ??= z.object({
16
+ 'missingFonts': z.array(z.string()).readonly(),
17
+ 'generation': z.string().readonly(),
18
+ 'offset': z.number().readonly().describe('First byte of the window, as requested.'),
19
+ 'data': z.instanceof(Uint8Array).describe('Native file bytes; empty at or past EOF.'),
20
+ 'eof': z.boolean().readonly().describe('Whether the window includes the file\'s last byte.'),
21
+ 'absolutePath': z.string().readonly().describe('Absolute path of the file in the filesystem\'s execution world, symlinks resolved: `/`-separated on POSIX, drive-rooted with the platform separator on Windows. What a `dsh-resource://file/absolute/…` address carries, and what a `dsh-resource://file/session/<sessionId>/…` address\'s workspace-relative path resolves to against that Session\'s root.'),
22
+ 'version': z.string().readonly().describe('Opaque freshness token at the time of the stat; never parsed.'),
23
+ 'bytes': z.number().readonly().optional().describe('Byte size of the complete file, when the backend reports it.'),
24
+ }))
25
+ const $resultSnapshot = (input, path) => {
26
+ if (input === null || typeof input !== 'object' || input instanceof Uint8Array) return input
27
+ const toJSON = input.toJSON
28
+ const value = typeof toJSON === 'function' ? toJSON.call(input, path.at(-1)?.toString() ?? 'value') : input
29
+ if (value === null || typeof value !== 'object' || value instanceof Uint8Array) return value
30
+ if (Array.isArray(value)) {
31
+ const items = []
32
+ for (let index = 0, length = value.length; index < length; index++) items.push(value[index])
33
+ return items
34
+ }
35
+ const fields = {}
36
+ for (const key of Object.keys(value)) {
37
+ const item = key === 'toJSON' && value === input ? toJSON : value[key]
38
+ if (key === 'toJSON' && typeof item === 'function') continue
39
+ Object.defineProperty(fields, key, { value: item, enumerable: true, writable: true, configurable: true })
40
+ }
41
+ return fields
42
+ }
43
+ const $resultContainer = (input, path, ancestors, project, snapshot) => {
44
+ if (input === null || typeof input !== 'object') return project(input)
45
+ const owner = !ancestors.has(input)
46
+ if (!owner && ancestors.get(input) !== path.length) throw new TypeError('Remote result contains a circular object')
47
+ if (owner) ancestors.set(input, path.length)
48
+ try { return project(snapshot ? $resultSnapshot(input, path) : input) }
49
+ finally { if (owner) ancestors.delete(input) }
50
+ }
51
+ const $encode1 = (value, writeBytes, path, ancestors) => {
52
+ return value instanceof Uint8Array ? writeBytes(value, path) : value
53
+ }
54
+ const $encode0 = (value, writeBytes, path, ancestors) => {
55
+ return $resultContainer(value, path, ancestors, value => {
56
+ if (value === null || typeof value !== 'object' || Array.isArray(value) || value instanceof Uint8Array) return value
57
+ if (Object.hasOwn(value, 'data')) value['data'] = $encode1(value['data'], writeBytes, [...path, 'data'], ancestors)
58
+ return value
59
+ }, true)
60
+ }
61
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0_strict$schema$value
62
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0_strict$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_0_strict$schema$value ??= z.string())
63
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1_strict$schema$value
64
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1_strict$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_1_strict$schema$value ??= z.string())
65
+ let _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2_strict$schema$value
66
+ const _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2_strict$schema = () => (_deepseek_ai_dsh_office_kit_officeKit_render_parameter_2_strict$schema$value ??= z.union([z.literal("foreground"), z.literal("background")]))
67
+
68
+ export const TYPERT_REMOTE = createTypertRemoteInfo({
69
+ package: '@deepseek-ai/dsh-office-kit',
70
+ methods: {
71
+ 'officeKit/generation': {
72
+ service: 'officeKit',
73
+ description: 'Read the current rendering generation before reusing a Client PDF.',
74
+ implementation: 'getGeneration',
75
+ invocation: { kind: 'direct' },
76
+ parameters: [
77
+ ],
78
+ cancellation: { parameter: 'signal' },
79
+ result: {
80
+ mode: 'strict',
81
+ typeSymbol: '@deepseek-ai/dsh-office-kit/types#OfficeKitGeneration',
82
+ create: _deepseek_ai_dsh_office_kit_officeKit_generation_result$schema,
83
+ description: 'provider lifetime, replaced with rendering, font, or engine configuration.',
84
+ jsonSchema: {"type":"string"},
85
+ },
86
+ sourceLocation: {"file":"packages/document/office-kit/src/index.ts","line":276,"column":3},
87
+ },
88
+ 'officeKit/render': {
89
+ service: 'officeKit',
90
+ description: 'Read and convert one Office file using the Session\'s ordinary filesystem authorization.',
91
+ invocation: { kind: 'direct' },
92
+ parameters: [
93
+ {
94
+ name: 'workspaceFileScope',
95
+ wire: 'workspaceFileScopeId',
96
+ description: 'Session header lookup shared with workspaceFiles.',
97
+ source: 'lookup',
98
+ lookup: 'workspaceFileScope',
99
+ codec: {
100
+ mode: 'strict',
101
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
102
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0$schema,
103
+ jsonSchema: {"type":"string"},
104
+ },
105
+ strictCodec: {
106
+ mode: 'strict',
107
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
108
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_0_strict$schema,
109
+ jsonSchema: {"type":"string"},
110
+ },
111
+ },
112
+ {
113
+ name: 'path',
114
+ description: 'absolute or workspace-relative Office path.',
115
+ source: 'json',
116
+ codec: {
117
+ mode: 'strict',
118
+ typeSymbol: '@deepseek-ai/dsh-office-kit#officeKit/render:path',
119
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1$schema,
120
+ jsonSchema: {"type":"string"},
121
+ },
122
+ strictCodec: {
123
+ mode: 'strict',
124
+ typeSymbol: '@deepseek-ai/dsh-office-kit#officeKit/render:path',
125
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_1_strict$schema,
126
+ jsonSchema: {"type":"string"},
127
+ },
128
+ },
129
+ {
130
+ name: 'priority',
131
+ description: 'foreground preview or speculative background work.',
132
+ source: 'json',
133
+ codec: {
134
+ mode: 'strict',
135
+ typeSymbol: '@deepseek-ai/dsh-office-kit/types#OfficeKitPriority',
136
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2$schema,
137
+ jsonSchema: {"type":"string","enum":["foreground","background"]},
138
+ },
139
+ strictCodec: {
140
+ mode: 'strict',
141
+ typeSymbol: '@deepseek-ai/dsh-office-kit/types#OfficeKitPriority',
142
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_parameter_2_strict$schema,
143
+ jsonSchema: {"type":"string","enum":["foreground","background"]},
144
+ },
145
+ },
146
+ ],
147
+ cancellation: { parameter: 'signal' },
148
+ result: {
149
+ mode: 'strict',
150
+ typeSymbol: '@deepseek-ai/dsh-office-kit/types#RenderedDocumentBytes',
151
+ create: _deepseek_ai_dsh_office_kit_officeKit_render_result$schema,
152
+ description: 'complete PDF bytes with original source identity and missing font families.',
153
+ jsonSchemaError: 'typert tool schema: unsupported selected reference Uint8Array',
154
+ decode: value => _deepseek_ai_dsh_office_kit_officeKit_render_result$schema().parse(value),
155
+ encode: (value, writeBytes) => $encode0(value, writeBytes, [], new Map()),
156
+ },
157
+ sourceLocation: {"file":"packages/document/office-kit/src/index.ts","line":261,"column":9},
158
+ },
159
+ },
160
+ }, z)
161
+
162
+ export default TYPERT_REMOTE
@@ -0,0 +1,13 @@
1
+ /** Classified failures shared by conversion and its consumers. */
2
+ import type { OfficeKitErrorCode } from './types.ts';
3
+ /** Classified conversion failure; engine details stay in the cause. */
4
+ export declare class OfficeKitError extends Error {
5
+ readonly code: OfficeKitErrorCode;
6
+ /**
7
+ * @param code - category suitable for a conversion consumer.
8
+ * @param message - diagnostic explaining the failed conversion.
9
+ * @param options - underlying engine or filesystem failure.
10
+ */
11
+ constructor(code: OfficeKitErrorCode, message: string, options?: ErrorOptions);
12
+ }
13
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,uEAAuE;AACvE,qBAAa,cAAe,SAAQ,KAAK;IAM3B,QAAQ,CAAC,IAAI,EAAE,kBAAkB;IAL7C;;;;OAIG;gBACkB,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIvF"}
@@ -0,0 +1,15 @@
1
+ /** Classified conversion failure; engine details stay in the cause. */
2
+ export class OfficeKitError extends Error {
3
+ code;
4
+ /**
5
+ * @param code - category suitable for a conversion consumer.
6
+ * @param message - diagnostic explaining the failed conversion.
7
+ * @param options - underlying engine or filesystem failure.
8
+ */
9
+ constructor(code, message, options) {
10
+ super(message, options);
11
+ this.code = code;
12
+ this.name = 'OfficeKitError';
13
+ }
14
+ }
15
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAGA,uEAAuE;AACvE,MAAM,OAAO,cAAe,SAAQ,KAAK;IAMlB;IALrB;;;;OAIG;IACH,YAAqB,IAAwB,EAAE,OAAe,EAAE,OAAsB;QACpF,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QADJ,SAAI,GAAJ,IAAI,CAAoB;QAE3C,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAA;IAC9B,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ /** Source locators and converter-owned identities for shared PDF reuse. */
2
+ import { type Branded } from '@deepseek-ai/dsh-brand';
3
+ /** Authorized execution scope and canonical source path, encoded by the consumer. */
4
+ export type OfficeSourceKey = Branded<'OfficeSourceKey'>;
5
+ /**
6
+ * Label an authorized source locator for pre-read deduplication.
7
+ * @param key - unambiguous encoding of authorization scope, execution world, and canonical path.
8
+ * @returns branded source locator; source authorization remains the caller's responsibility.
9
+ */
10
+ export declare function OfficeSourceKey(key: string): OfficeSourceKey;
11
+ /** One provider lifetime, including its engine, rendering settings, and font configuration. */
12
+ export type OfficeKitGeneration = Branded<'OfficeKitGeneration'>;
13
+ /**
14
+ * Label a provider lifetime.
15
+ * @param value - unique generation created by the provider.
16
+ * @returns branded converter generation.
17
+ */
18
+ export declare function OfficeKitGeneration(value: string): OfficeKitGeneration;
19
+ /** Provider generation and source-content digest; consumers must not parse it. */
20
+ export type OfficeKitKey = Branded<'OfficeKitKey'>;
21
+ /**
22
+ * Label a converter-owned content identity.
23
+ * @param value - generation and content identity created by the provider.
24
+ * @returns branded conversion identity.
25
+ */
26
+ export declare function OfficeKitKey(value: string): OfficeKitKey;
27
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/identity.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAElE,qFAAqF;AACrF,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AACxD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAA6C;AAE1G,+FAA+F;AAC/F,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAChE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,CAEtE;AAED,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;AAClD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAA4C"}
@@ -0,0 +1,23 @@
1
+ /** Source locators and converter-owned identities for shared PDF reuse. */
2
+ import { brandString } from '@deepseek-ai/dsh-brand';
3
+ /**
4
+ * Label an authorized source locator for pre-read deduplication.
5
+ * @param key - unambiguous encoding of authorization scope, execution world, and canonical path.
6
+ * @returns branded source locator; source authorization remains the caller's responsibility.
7
+ */
8
+ export function OfficeSourceKey(key) { return brandString(key); }
9
+ /**
10
+ * Label a provider lifetime.
11
+ * @param value - unique generation created by the provider.
12
+ * @returns branded converter generation.
13
+ */
14
+ export function OfficeKitGeneration(value) {
15
+ return brandString(value);
16
+ }
17
+ /**
18
+ * Label a converter-owned content identity.
19
+ * @param value - generation and content identity created by the provider.
20
+ * @returns branded conversion identity.
21
+ */
22
+ export function OfficeKitKey(value) { return brandString(value); }
23
+ //# sourceMappingURL=identity.js.map