dsh-typst-plugin 0.0.0-stage → 0.1.0-alpha.0

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 (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +87 -0
  3. package/README.md +86 -2
  4. package/cordis.patch.yml +6 -0
  5. package/docs/images/icon.png +0 -0
  6. package/docs/plugin-detail.en.md +2 -0
  7. package/docs/plugin-detail.md +2 -0
  8. package/lib/client.js +41044 -0
  9. package/lib/client.js.map +7 -0
  10. package/lib/config.d.ts +50 -0
  11. package/lib/config.d.ts.map +1 -0
  12. package/lib/config.js +31 -0
  13. package/lib/config.js.map +7 -0
  14. package/lib/constants.d.ts +58 -0
  15. package/lib/constants.d.ts.map +1 -0
  16. package/lib/constants.js +62 -0
  17. package/lib/constants.js.map +7 -0
  18. package/lib/contract.d.ts +179 -0
  19. package/lib/contract.d.ts.map +1 -0
  20. package/lib/contract.js +1 -0
  21. package/lib/contract.js.map +7 -0
  22. package/lib/errors.d.ts +77 -0
  23. package/lib/errors.d.ts.map +1 -0
  24. package/lib/errors.js +86 -0
  25. package/lib/errors.js.map +7 -0
  26. package/lib/host/facts.d.ts +31 -0
  27. package/lib/host/facts.d.ts.map +1 -0
  28. package/lib/host/facts.js +151 -0
  29. package/lib/host/facts.js.map +7 -0
  30. package/lib/index.d.ts +2 -0
  31. package/lib/index.d.ts.map +1 -0
  32. package/lib/index.js +5 -0
  33. package/lib/index.js.map +7 -0
  34. package/lib/remote.d.ts +69 -0
  35. package/lib/remote.d.ts.map +1 -0
  36. package/lib/remote.js +146 -0
  37. package/lib/remote.js.map +7 -0
  38. package/lib/service.d.ts +47 -0
  39. package/lib/service.d.ts.map +1 -0
  40. package/lib/service.js +110 -0
  41. package/lib/service.js.map +7 -0
  42. package/lib/skills/typst.d.ts +13 -0
  43. package/lib/skills/typst.d.ts.map +1 -0
  44. package/lib/skills/typst.js +72 -0
  45. package/lib/skills/typst.js.map +7 -0
  46. package/lib/status-codec.d.ts +11 -0
  47. package/lib/status-codec.d.ts.map +1 -0
  48. package/lib/status-codec.js +6 -0
  49. package/lib/status-codec.js.map +7 -0
  50. package/lib/tools/registration.d.ts +22 -0
  51. package/lib/tools/registration.d.ts.map +1 -0
  52. package/lib/tools/registration.js +525 -0
  53. package/lib/tools/registration.js.map +7 -0
  54. package/lib/tools/shared.d.ts +31 -0
  55. package/lib/tools/shared.d.ts.map +1 -0
  56. package/lib/tools/shared.js +70 -0
  57. package/lib/tools/shared.js.map +7 -0
  58. package/lib/typert.d.ts +23 -0
  59. package/lib/typert.d.ts.map +1 -0
  60. package/lib/typert.js +67 -0
  61. package/lib/typert.js.map +7 -0
  62. package/lib/typst/diagnostics.d.ts +58 -0
  63. package/lib/typst/diagnostics.d.ts.map +1 -0
  64. package/lib/typst/diagnostics.js +171 -0
  65. package/lib/typst/diagnostics.js.map +7 -0
  66. package/lib/typst/locate.d.ts +68 -0
  67. package/lib/typst/locate.d.ts.map +1 -0
  68. package/lib/typst/locate.js +194 -0
  69. package/lib/typst/locate.js.map +7 -0
  70. package/lib/typst/mainfile.d.ts +21 -0
  71. package/lib/typst/mainfile.d.ts.map +1 -0
  72. package/lib/typst/mainfile.js +64 -0
  73. package/lib/typst/mainfile.js.map +7 -0
  74. package/lib/typst/match.d.ts +59 -0
  75. package/lib/typst/match.d.ts.map +1 -0
  76. package/lib/typst/match.js +171 -0
  77. package/lib/typst/match.js.map +7 -0
  78. package/lib/typst/oneshot.d.ts +45 -0
  79. package/lib/typst/oneshot.d.ts.map +1 -0
  80. package/lib/typst/oneshot.js +76 -0
  81. package/lib/typst/oneshot.js.map +7 -0
  82. package/lib/typst/pdf-extract.d.ts +29 -0
  83. package/lib/typst/pdf-extract.d.ts.map +1 -0
  84. package/lib/typst/pdf-extract.js +87 -0
  85. package/lib/typst/pdf-extract.js.map +7 -0
  86. package/lib/typst/pdfjs-worker.d.js +1 -0
  87. package/lib/typst/pdfjs-worker.d.js.map +7 -0
  88. package/lib/typst/text.d.ts +65 -0
  89. package/lib/typst/text.d.ts.map +1 -0
  90. package/lib/typst/text.js +314 -0
  91. package/lib/typst/text.js.map +7 -0
  92. package/lib/typst/watcher.d.ts +77 -0
  93. package/lib/typst/watcher.d.ts.map +1 -0
  94. package/lib/typst/watcher.js +219 -0
  95. package/lib/typst/watcher.js.map +7 -0
  96. package/lib/wire-schemas.d.ts +578 -0
  97. package/lib/wire-schemas.d.ts.map +1 -0
  98. package/lib/wire-schemas.js +384 -0
  99. package/lib/wire-schemas.js.map +7 -0
  100. package/lib/workspace/session.d.ts +209 -0
  101. package/lib/workspace/session.d.ts.map +1 -0
  102. package/lib/workspace/session.js +1232 -0
  103. package/lib/workspace/session.js.map +7 -0
  104. package/locale/en.json +9 -0
  105. package/locale/zh.json +9 -0
  106. package/package.json +256 -4
@@ -0,0 +1,525 @@
1
+ import { defineTool } from "@deepseek-ai/dsh-tools";
2
+ import { LIMITS } from "../constants.js";
3
+ import {
4
+ compileSummary,
5
+ countOf,
6
+ diagnosticsText,
7
+ sessionOfExec
8
+ } from "./shared.js";
9
+ function summarize(session) {
10
+ const state = session.state();
11
+ const { errors, warnings } = countOf(state.diagnostics);
12
+ const pages = state.snapshot?.pages ?? null;
13
+ return {
14
+ main: state.main,
15
+ phase: state.status.phase,
16
+ errors,
17
+ warnings,
18
+ pages,
19
+ durationMs: state.status.durationMs ?? null,
20
+ summary: compileSummary(
21
+ state.status,
22
+ state.main,
23
+ state.diagnostics,
24
+ pages ?? void 0
25
+ ),
26
+ problems: state.diagnostics.length ? diagnosticsText(state.diagnostics) : ""
27
+ };
28
+ }
29
+ function textOf(summary) {
30
+ return summary.problems !== "" ? `${summary.summary}
31
+
32
+ ${summary.problems}` : summary.summary;
33
+ }
34
+ function stripAbsent(value) {
35
+ return Object.fromEntries(
36
+ Object.entries(value).filter(([, v]) => v !== void 0)
37
+ );
38
+ }
39
+ function typstStatusTool(ctx, service) {
40
+ return defineTool({
41
+ name: "typst_status",
42
+ description: [
43
+ "Show the Typst workbench: the Typst installation in use (version and path), the main .typ file and the other .typ files in the workspace, and the latest compile result.",
44
+ "Call this first when working on a Typst document.",
45
+ "The live preview panel updates by itself when files are saved; this tool reports the state."
46
+ ].join(" "),
47
+ parameters: {},
48
+ output: {
49
+ schema: {
50
+ type: "object",
51
+ properties: {
52
+ toolchain: {
53
+ type: "json",
54
+ required: true,
55
+ description: "Typst toolchain state view."
56
+ },
57
+ main: {
58
+ type: "string",
59
+ description: "The chosen main .typ file (workspace-relative)."
60
+ },
61
+ candidates: {
62
+ type: "array",
63
+ required: true,
64
+ items: { type: "string" },
65
+ description: "The workspace's .typ files."
66
+ },
67
+ phase: {
68
+ type: "string",
69
+ required: true,
70
+ description: "Latest compile phase."
71
+ },
72
+ errors: { type: "integer", required: true },
73
+ warnings: { type: "integer", required: true },
74
+ pages: { type: "integer", description: "Preview page count." },
75
+ summary: {
76
+ type: "string",
77
+ required: true,
78
+ description: "One-line compile summary."
79
+ }
80
+ },
81
+ additionalProperties: false
82
+ },
83
+ render: (_args, value) => [{ type: "text", text: value.summary }]
84
+ },
85
+ presentCall: () => ({ card: "generic", title: "Typst status" }),
86
+ isConcurrencySafe: () => true,
87
+ async execute(_args, exec) {
88
+ const session = await sessionOfExec(ctx, exec, service);
89
+ await session.activate();
90
+ const state = session.state();
91
+ const summary = summarize(session);
92
+ return stripAbsent({
93
+ toolchain: state.toolchain,
94
+ ...state.main !== null ? { main: state.main } : {},
95
+ candidates: state.candidates,
96
+ phase: summary.phase,
97
+ errors: summary.errors,
98
+ warnings: summary.warnings,
99
+ ...summary.pages !== null ? { pages: summary.pages } : {},
100
+ summary: summary.summary
101
+ });
102
+ }
103
+ });
104
+ }
105
+ function typstSetMainTool(ctx, service) {
106
+ return defineTool({
107
+ name: "typst_set_main",
108
+ description: [
109
+ "Choose the main .typ file of the document (the one you would pass to `typst compile`).",
110
+ "The preview restarts with it, and the choice is remembered for this workspace."
111
+ ].join(" "),
112
+ parameters: {
113
+ path: {
114
+ type: "string",
115
+ required: true,
116
+ description: "Workspace-relative path of a .typ file."
117
+ }
118
+ },
119
+ output: {
120
+ schema: {
121
+ type: "object",
122
+ properties: {
123
+ main: { type: "string", required: true },
124
+ phase: { type: "string", required: true },
125
+ errors: { type: "integer", required: true },
126
+ warnings: { type: "integer", required: true },
127
+ summary: { type: "string", required: true }
128
+ },
129
+ additionalProperties: false
130
+ },
131
+ render: (_args, value) => [{ type: "text", text: value.summary }]
132
+ },
133
+ presentCall: (args) => ({
134
+ card: "generic",
135
+ title: "Set Typst main file",
136
+ rawInput: String(args.path ?? "")
137
+ }),
138
+ isConcurrencySafe: () => false,
139
+ async execute(args, exec) {
140
+ const session = await sessionOfExec(ctx, exec, service);
141
+ const main = await session.setMain(args.path);
142
+ await session.settle(LIMITS.checkTimeoutMs).catch(() => void 0);
143
+ const summary = summarize(session);
144
+ return {
145
+ main,
146
+ phase: summary.phase,
147
+ errors: summary.errors,
148
+ warnings: summary.warnings,
149
+ summary: textOf(summary)
150
+ };
151
+ }
152
+ });
153
+ }
154
+ function typstCheckTool(ctx, service) {
155
+ return defineTool({
156
+ name: "typst_check",
157
+ description: [
158
+ "Compile the document with the user's Typst and report errors and warnings with file:line:column, the source line and Typst's hints.",
159
+ "Waits until every change already saved to disk has been compiled, so call it right after editing.",
160
+ "The preview panel updates by itself; this is how you see the result."
161
+ ].join(" "),
162
+ parameters: {
163
+ timeoutMs: {
164
+ type: "integer",
165
+ description: `How long to wait for Typst in milliseconds (default ${LIMITS.checkTimeoutMs / 1e3} s).`
166
+ }
167
+ },
168
+ output: {
169
+ schema: {
170
+ type: "object",
171
+ properties: {
172
+ main: { type: "string", description: "The chosen main .typ file." },
173
+ phase: { type: "string", required: true },
174
+ errors: { type: "integer", required: true },
175
+ warnings: { type: "integer", required: true },
176
+ pages: { type: "integer", description: "Preview page count." },
177
+ durationMs: { type: "integer", description: "Compile duration." },
178
+ summary: { type: "string", required: true },
179
+ diagnostics: {
180
+ type: "json",
181
+ description: "The full diagnostic views."
182
+ }
183
+ },
184
+ additionalProperties: false
185
+ },
186
+ render: (_args, value) => [{ type: "text", text: value.summary }]
187
+ },
188
+ presentCall: () => ({ card: "generic", title: "Check Typst document" }),
189
+ isConcurrencySafe: () => true,
190
+ async execute(args, exec) {
191
+ const session = await sessionOfExec(ctx, exec, service);
192
+ const timeoutMs = typeof args.timeoutMs === "number" && Number.isFinite(args.timeoutMs) ? Math.min(Math.max(args.timeoutMs, 1e3), 6e5) : LIMITS.checkTimeoutMs;
193
+ await session.settle(timeoutMs);
194
+ const state = session.state();
195
+ const summary = summarize(session);
196
+ return stripAbsent({
197
+ ...state.main !== null ? { main: state.main } : {},
198
+ phase: summary.phase,
199
+ errors: summary.errors,
200
+ warnings: summary.warnings,
201
+ ...summary.pages !== null ? { pages: summary.pages } : {},
202
+ ...summary.durationMs !== null ? { durationMs: Math.round(summary.durationMs) } : {},
203
+ summary: summary.summary,
204
+ diagnostics: state.diagnostics
205
+ });
206
+ }
207
+ });
208
+ }
209
+ function typstRenderPagesTool(ctx, service) {
210
+ return defineTool({
211
+ name: "typst_render_pages",
212
+ description: [
213
+ "Render pages of the document to PNG images so you can look at the layout (overfull lines, figure placement, tables, title page, spacing).",
214
+ "Compiles the files on disk with the user's Typst.",
215
+ `At most ${LIMITS.renderPages} pages per call; default ${LIMITS.ppiDefault} ppi, raise ppi to inspect details.`,
216
+ "Compile errors do not catch layout problems: render the affected pages and look at them."
217
+ ].join(" "),
218
+ parameters: {
219
+ pages: {
220
+ type: "string",
221
+ required: true,
222
+ description: '1-based pages, e.g. "1", "2-3", "1,5".'
223
+ },
224
+ ppi: {
225
+ type: "integer",
226
+ description: `Resolution in pixels per inch (default ${LIMITS.ppiDefault}).`
227
+ }
228
+ },
229
+ output: {
230
+ schema: {
231
+ type: "object",
232
+ properties: {
233
+ pages: {
234
+ type: "array",
235
+ required: true,
236
+ items: { type: "integer" },
237
+ description: "The rendered 1-based pages."
238
+ },
239
+ total: {
240
+ type: "integer",
241
+ description: "Total pages of the document."
242
+ },
243
+ images: {
244
+ type: "array",
245
+ required: true,
246
+ items: {
247
+ type: "object",
248
+ additionalProperties: false,
249
+ properties: {
250
+ page: { type: "integer", required: true },
251
+ dataUrl: { type: "string", required: true }
252
+ }
253
+ },
254
+ description: "Rendered PNGs for the tool card."
255
+ }
256
+ },
257
+ additionalProperties: false
258
+ },
259
+ render: (_args, value) => {
260
+ const images = value.images;
261
+ const rendered = images.map((image) => `page ${image.page}`).join(", ");
262
+ const total = value.total !== void 0 ? ` of ${value.total}` : "";
263
+ return [
264
+ {
265
+ type: "text",
266
+ text: `Rendered ${rendered}${total}. The images are on the tool card.`
267
+ }
268
+ ];
269
+ },
270
+ // The card's data channel: bounded so a pathological render cannot
271
+ // bloat the replay record (the toolview shows text above the cap).
272
+ presentationMeta: (_args, value) => {
273
+ const images = value.images;
274
+ const bytes = images.reduce(
275
+ (sum, image) => sum + image.dataUrl.length,
276
+ 0
277
+ );
278
+ return {
279
+ pages: value.pages,
280
+ ...value.total !== void 0 ? { total: value.total } : {},
281
+ images: bytes > 6e6 ? [] : images
282
+ };
283
+ }
284
+ },
285
+ presentCall: (args) => ({
286
+ card: "generic",
287
+ title: "Render Typst pages",
288
+ rawInput: String(args.pages ?? "")
289
+ }),
290
+ isConcurrencySafe: () => false,
291
+ async execute(args, exec) {
292
+ const session = await sessionOfExec(ctx, exec, service);
293
+ const ppi = typeof args.ppi === "number" && Number.isFinite(args.ppi) ? Math.min(Math.max(args.ppi, LIMITS.ppiMin), LIMITS.ppiMax) : LIMITS.ppiDefault;
294
+ const result = await session.renderPages(args.pages, ppi);
295
+ if (!result.ok) {
296
+ const error = new Error(
297
+ `The document does not compile, so no pages were rendered.
298
+
299
+ ${diagnosticsText(result.diagnostics)}`
300
+ );
301
+ error.name = "TYPST_COMPILE_FAILED";
302
+ throw error;
303
+ }
304
+ return stripAbsent({
305
+ pages: result.pages,
306
+ ...result.total !== void 0 ? { total: result.total } : {},
307
+ images: result.images.map((image) => ({
308
+ page: image.page,
309
+ dataUrl: `data:image/png;base64,${Buffer.from(image.png).toString("base64")}`
310
+ }))
311
+ });
312
+ }
313
+ });
314
+ }
315
+ function typstShowTool(ctx, service) {
316
+ return defineTool({
317
+ name: "typst_show",
318
+ description: [
319
+ "Point the user at something in the live preview: request a page location, or highlight rendered text with an optional comment. The panel notifies the user, who chooses when to navigate.",
320
+ "Give exactly one of: page; quote (words as they appear in the rendered document \u2014 markup is ignored); or file and line (and optionally endLine) to highlight what those source lines produce.",
321
+ "Add a short comment explaining why. Highlights follow the text as the document changes and last for this session."
322
+ ].join(" "),
323
+ parameters: {
324
+ page: { type: "integer", description: "1-based page to request." },
325
+ quote: { type: "string", description: "Rendered words to highlight." },
326
+ file: { type: "string", description: "Workspace-relative .typ file." },
327
+ line: { type: "integer", description: "1-based line in that file." },
328
+ endLine: {
329
+ type: "integer",
330
+ description: "Last line of the range (default: line)."
331
+ },
332
+ comment: {
333
+ type: "string",
334
+ description: "Short comment shown with the highlight."
335
+ }
336
+ },
337
+ output: {
338
+ schema: {
339
+ type: "object",
340
+ properties: {
341
+ highlighted: { type: "boolean", required: true },
342
+ exact: {
343
+ type: "boolean",
344
+ description: "Whether the quote matched exactly."
345
+ },
346
+ id: { type: "string", description: "The highlight id." },
347
+ page: {
348
+ type: "integer",
349
+ description: "The 1-based page requested for viewing."
350
+ }
351
+ },
352
+ additionalProperties: false
353
+ },
354
+ render: (_args, value) => [
355
+ {
356
+ type: "text",
357
+ text: value.highlighted ? "Highlighted in the preview." : `Requested viewing page ${value.page}; the user can open the location notification.`
358
+ }
359
+ ]
360
+ },
361
+ presentCall: (args) => ({
362
+ card: "generic",
363
+ title: "Show in preview",
364
+ rawInput: String(
365
+ args.quote ?? args.file ?? (args.page !== void 0 ? `page ${args.page}` : "")
366
+ )
367
+ }),
368
+ isConcurrencySafe: () => false,
369
+ async execute(args, exec) {
370
+ const session = await sessionOfExec(ctx, exec, service);
371
+ if (typeof args.page === "number") {
372
+ session.showPage(args.page - 1);
373
+ return { highlighted: false, page: args.page };
374
+ }
375
+ const target = {};
376
+ if (typeof args.quote === "string") target.quote = args.quote;
377
+ if (typeof args.file === "string") {
378
+ target.file = args.file;
379
+ if (typeof args.line === "number") target.line = args.line;
380
+ if (typeof args.endLine === "number") target.endLine = args.endLine;
381
+ }
382
+ const created = await session.highlight(
383
+ target,
384
+ typeof args.comment === "string" ? args.comment : ""
385
+ );
386
+ return {
387
+ highlighted: true,
388
+ exact: created.exact,
389
+ id: created.highlight.id
390
+ };
391
+ }
392
+ });
393
+ }
394
+ function typstClearHighlightsTool(ctx, service) {
395
+ return defineTool({
396
+ name: "typst_clear_highlights",
397
+ description: "Remove the highlights you placed in the live preview (all of them, or the named ids).",
398
+ parameters: {
399
+ ids: {
400
+ type: "json",
401
+ description: "Highlight ids to remove; omit to remove all."
402
+ }
403
+ },
404
+ output: {
405
+ schema: {
406
+ type: "object",
407
+ properties: { removed: { type: "integer", required: true } },
408
+ additionalProperties: false
409
+ },
410
+ render: (_args, value) => [
411
+ { type: "text", text: `Removed ${value.removed} highlight(s).` }
412
+ ]
413
+ },
414
+ presentCall: () => ({ card: "generic", title: "Clear preview highlights" }),
415
+ isConcurrencySafe: () => true,
416
+ async execute(args, exec) {
417
+ const session = await sessionOfExec(ctx, exec, service);
418
+ const ids = args.ids;
419
+ const removed = session.clearHighlights(
420
+ Array.isArray(ids) ? ids.map(String) : void 0
421
+ );
422
+ return { removed };
423
+ }
424
+ });
425
+ }
426
+ const PDF_STANDARDS = [
427
+ "a-1b",
428
+ "a-2b",
429
+ "a-2u",
430
+ "a-3b",
431
+ "a-3u",
432
+ "a-4",
433
+ "a-4f"
434
+ ];
435
+ function typstExportPdfTool(ctx, service) {
436
+ return defineTool({
437
+ name: "typst_export_pdf",
438
+ description: [
439
+ "Compile the document with the user's Typst and write a PDF into the workspace.",
440
+ "Optionally a PDF standard (pdfStandard) and a page selection.",
441
+ "The preview's own PDF is not in the workspace; this is how you produce the deliverable."
442
+ ].join(" "),
443
+ parameters: {
444
+ path: {
445
+ type: "string",
446
+ required: true,
447
+ description: "Workspace-relative output path ending in .pdf."
448
+ },
449
+ pdfStandard: {
450
+ type: "string",
451
+ enum: [...PDF_STANDARDS],
452
+ description: "PDF standard to embed."
453
+ },
454
+ pages: {
455
+ type: "string",
456
+ description: '1-based page selection, e.g. "1-3".'
457
+ }
458
+ },
459
+ output: {
460
+ schema: {
461
+ type: "object",
462
+ properties: {
463
+ path: { type: "string", required: true },
464
+ bytes: { type: "integer", description: "PDF byte size." },
465
+ pages: {
466
+ type: "integer",
467
+ description: "Page count of the exported PDF."
468
+ },
469
+ summary: { type: "string", required: true }
470
+ },
471
+ additionalProperties: false
472
+ },
473
+ render: (_args, value) => [{ type: "text", text: value.summary }]
474
+ },
475
+ presentCall: (args) => ({
476
+ card: "generic",
477
+ title: "Export Typst PDF",
478
+ rawInput: String(args.path ?? "")
479
+ }),
480
+ isConcurrencySafe: () => false,
481
+ async execute(args, exec) {
482
+ const session = await sessionOfExec(ctx, exec, service);
483
+ const result = await session.exportPdf(args.path, {
484
+ ...typeof args.pdfStandard === "string" ? { pdfStandard: args.pdfStandard } : {},
485
+ ...typeof args.pages === "string" ? { pages: args.pages } : {}
486
+ });
487
+ if (!result.ok) {
488
+ const error = new Error(
489
+ `The PDF export failed.
490
+
491
+ ${diagnosticsText(result.diagnostics)}`
492
+ );
493
+ error.name = "TYPST_COMPILE_FAILED";
494
+ throw error;
495
+ }
496
+ return stripAbsent({
497
+ path: result.path,
498
+ ...result.bytes !== void 0 ? { bytes: result.bytes } : {},
499
+ ...result.pages !== void 0 ? { pages: result.pages } : {},
500
+ summary: `Exported ${result.path}${result.bytes !== void 0 ? ` (${result.bytes} bytes)` : ""}${result.pages !== void 0 ? ` \u2014 ${result.pages} page(s)` : ""}.`
501
+ });
502
+ }
503
+ });
504
+ }
505
+ function registerTypstTools(ctx, service) {
506
+ const definitions = [
507
+ typstStatusTool(ctx, service),
508
+ typstSetMainTool(ctx, service),
509
+ typstCheckTool(ctx, service),
510
+ typstRenderPagesTool(ctx, service),
511
+ typstShowTool(ctx, service),
512
+ typstClearHighlightsTool(ctx, service),
513
+ typstExportPdfTool(ctx, service)
514
+ ];
515
+ for (const definition of definitions) {
516
+ ctx.effect(
517
+ () => ctx.tools.register(definition),
518
+ `typst: ${definition.name}`
519
+ );
520
+ }
521
+ }
522
+ export {
523
+ registerTypstTools
524
+ };
525
+ //# sourceMappingURL=registration.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/tools/registration.ts"],
4
+ "sourcesContent": ["/**\n * The seven agent tools of the Typst workbench. Semantics ported from the\n * ZCode typst-workbench server (0.2.0); schemas follow the dsh-zotero tool\n * conventions (value-schema literals with per-property `required`, canonical\n * JSON output plus a model-facing render, one registration effect per tool).\n * Host half only.\n *\n * `typst_render_pages` returns base64 PNGs in its canonical value and the\n * client's `tool.call.toolview` view displays them inline; the model-facing\n * render stays text (the canonical JSON is persistence and toolview data).\n * @module dsh-typst/tools/registration\n */\n\nimport type { Context } from \"@deepseek-ai/cordis\";\nimport { defineTool, type ToolDefinition } from \"@deepseek-ai/dsh-tools\";\nimport type { JsonValue } from \"@deepseek-ai/dsh-util-values\";\nimport { LIMITS } from \"../constants.js\";\nimport type { TypstWorkbenchService } from \"../service.js\";\nimport { WorkspaceSession } from \"../workspace/session.js\";\nimport {\n compileSummary,\n countOf,\n diagnosticsText,\n sessionOfExec,\n} from \"./shared.js\";\n\n// ---------------------------------------------------------------------------\n// Shared summary plumbing\n// ---------------------------------------------------------------------------\n\ninterface SessionSummary {\n main: string | null;\n phase: string;\n errors: number;\n warnings: number;\n pages: number | null;\n durationMs: number | null;\n summary: string;\n problems: string;\n}\n\nfunction summarize(session: WorkspaceSession): SessionSummary {\n const state = session.state();\n const { errors, warnings } = countOf(state.diagnostics);\n const pages = state.snapshot?.pages ?? null;\n return {\n main: state.main,\n phase: state.status.phase,\n errors,\n warnings,\n pages,\n durationMs: state.status.durationMs ?? null,\n summary: compileSummary(\n state.status,\n state.main,\n state.diagnostics,\n pages ?? undefined,\n ),\n problems: state.diagnostics.length\n ? diagnosticsText(state.diagnostics)\n : \"\",\n };\n}\n\nfunction textOf(summary: SessionSummary): string {\n return summary.problems !== \"\"\n ? `${summary.summary}\\n\\n${summary.problems}`\n : summary.summary;\n}\n\n/** Canonical JSON must be lossless: optional facts are stripped, never null-typed. */\nfunction stripAbsent<T extends object>(value: T): T {\n return Object.fromEntries(\n Object.entries(value).filter(([, v]) => v !== undefined),\n ) as T;\n}\n\n// ---------------------------------------------------------------------------\n// typst_status\n// ---------------------------------------------------------------------------\n\nfunction typstStatusTool(ctx: Context, service: TypstWorkbenchService) {\n return defineTool({\n name: \"typst_status\",\n description: [\n \"Show the Typst workbench: the Typst installation in use (version and path), the main .typ file and the other .typ files in the workspace, and the latest compile result.\",\n \"Call this first when working on a Typst document.\",\n \"The live preview panel updates by itself when files are saved; this tool reports the state.\",\n ].join(\" \"),\n parameters: {},\n output: {\n schema: {\n type: \"object\",\n properties: {\n toolchain: {\n type: \"json\",\n required: true,\n description: \"Typst toolchain state view.\",\n },\n main: {\n type: \"string\",\n description: \"The chosen main .typ file (workspace-relative).\",\n },\n candidates: {\n type: \"array\",\n required: true,\n items: { type: \"string\" },\n description: \"The workspace's .typ files.\",\n },\n phase: {\n type: \"string\",\n required: true,\n description: \"Latest compile phase.\",\n },\n errors: { type: \"integer\", required: true },\n warnings: { type: \"integer\", required: true },\n pages: { type: \"integer\", description: \"Preview page count.\" },\n summary: {\n type: \"string\",\n required: true,\n description: \"One-line compile summary.\",\n },\n },\n additionalProperties: false,\n },\n render: (_args, value) => [{ type: \"text\", text: value.summary }],\n },\n presentCall: () => ({ card: \"generic\", title: \"Typst status\" }),\n isConcurrencySafe: () => true,\n async execute(_args, exec) {\n const session = await sessionOfExec(ctx, exec, service);\n await session.activate();\n const state = session.state();\n const summary = summarize(session);\n return stripAbsent({\n toolchain: state.toolchain as unknown as JsonValue,\n ...(state.main !== null ? { main: state.main } : {}),\n candidates: state.candidates,\n phase: summary.phase,\n errors: summary.errors,\n warnings: summary.warnings,\n ...(summary.pages !== null ? { pages: summary.pages } : {}),\n summary: summary.summary,\n });\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// typst_set_main\n// ---------------------------------------------------------------------------\n\nfunction typstSetMainTool(ctx: Context, service: TypstWorkbenchService) {\n return defineTool({\n name: \"typst_set_main\",\n description: [\n \"Choose the main .typ file of the document (the one you would pass to `typst compile`).\",\n \"The preview restarts with it, and the choice is remembered for this workspace.\",\n ].join(\" \"),\n parameters: {\n path: {\n type: \"string\",\n required: true,\n description: \"Workspace-relative path of a .typ file.\",\n },\n },\n output: {\n schema: {\n type: \"object\",\n properties: {\n main: { type: \"string\", required: true },\n phase: { type: \"string\", required: true },\n errors: { type: \"integer\", required: true },\n warnings: { type: \"integer\", required: true },\n summary: { type: \"string\", required: true },\n },\n additionalProperties: false,\n },\n render: (_args, value) => [{ type: \"text\", text: value.summary }],\n },\n presentCall: (args) => ({\n card: \"generic\",\n title: \"Set Typst main file\",\n rawInput: String(args.path ?? \"\"),\n }),\n isConcurrencySafe: () => false,\n async execute(args, exec) {\n const session = await sessionOfExec(ctx, exec, service);\n const main = await session.setMain(args.path);\n await session.settle(LIMITS.checkTimeoutMs).catch(() => undefined);\n const summary = summarize(session);\n return {\n main,\n phase: summary.phase,\n errors: summary.errors,\n warnings: summary.warnings,\n summary: textOf(summary),\n };\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// typst_check\n// ---------------------------------------------------------------------------\n\nfunction typstCheckTool(ctx: Context, service: TypstWorkbenchService) {\n return defineTool({\n name: \"typst_check\",\n description: [\n \"Compile the document with the user's Typst and report errors and warnings with file:line:column, the source line and Typst's hints.\",\n \"Waits until every change already saved to disk has been compiled, so call it right after editing.\",\n \"The preview panel updates by itself; this is how you see the result.\",\n ].join(\" \"),\n parameters: {\n timeoutMs: {\n type: \"integer\",\n description: `How long to wait for Typst in milliseconds (default ${LIMITS.checkTimeoutMs / 1e3} s).`,\n },\n },\n output: {\n schema: {\n type: \"object\",\n properties: {\n main: { type: \"string\", description: \"The chosen main .typ file.\" },\n phase: { type: \"string\", required: true },\n errors: { type: \"integer\", required: true },\n warnings: { type: \"integer\", required: true },\n pages: { type: \"integer\", description: \"Preview page count.\" },\n durationMs: { type: \"integer\", description: \"Compile duration.\" },\n summary: { type: \"string\", required: true },\n diagnostics: {\n type: \"json\",\n description: \"The full diagnostic views.\",\n },\n },\n additionalProperties: false,\n },\n render: (_args, value) => [{ type: \"text\", text: value.summary }],\n },\n presentCall: () => ({ card: \"generic\", title: \"Check Typst document\" }),\n isConcurrencySafe: () => true,\n async execute(args, exec) {\n const session = await sessionOfExec(ctx, exec, service);\n const timeoutMs =\n typeof args.timeoutMs === \"number\" && Number.isFinite(args.timeoutMs)\n ? Math.min(Math.max(args.timeoutMs, 1_000), 600_000)\n : LIMITS.checkTimeoutMs;\n await session.settle(timeoutMs);\n const state = session.state();\n const summary = summarize(session);\n return stripAbsent({\n ...(state.main !== null ? { main: state.main } : {}),\n phase: summary.phase,\n errors: summary.errors,\n warnings: summary.warnings,\n ...(summary.pages !== null ? { pages: summary.pages } : {}),\n ...(summary.durationMs !== null\n ? { durationMs: Math.round(summary.durationMs) }\n : {}),\n summary: summary.summary,\n diagnostics: state.diagnostics as unknown as JsonValue,\n });\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// typst_render_pages\n// ---------------------------------------------------------------------------\n\nfunction typstRenderPagesTool(ctx: Context, service: TypstWorkbenchService) {\n return defineTool({\n name: \"typst_render_pages\",\n description: [\n \"Render pages of the document to PNG images so you can look at the layout (overfull lines, figure placement, tables, title page, spacing).\",\n \"Compiles the files on disk with the user's Typst.\",\n `At most ${LIMITS.renderPages} pages per call; default ${LIMITS.ppiDefault} ppi, raise ppi to inspect details.`,\n \"Compile errors do not catch layout problems: render the affected pages and look at them.\",\n ].join(\" \"),\n parameters: {\n pages: {\n type: \"string\",\n required: true,\n description: '1-based pages, e.g. \"1\", \"2-3\", \"1,5\".',\n },\n ppi: {\n type: \"integer\",\n description: `Resolution in pixels per inch (default ${LIMITS.ppiDefault}).`,\n },\n },\n output: {\n schema: {\n type: \"object\",\n properties: {\n pages: {\n type: \"array\",\n required: true,\n items: { type: \"integer\" },\n description: \"The rendered 1-based pages.\",\n },\n total: {\n type: \"integer\",\n description: \"Total pages of the document.\",\n },\n images: {\n type: \"array\",\n required: true,\n items: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n page: { type: \"integer\", required: true },\n dataUrl: { type: \"string\", required: true },\n },\n },\n description: \"Rendered PNGs for the tool card.\",\n },\n },\n additionalProperties: false,\n },\n render: (_args, value) => {\n const images = value.images as { page: number }[];\n const rendered = images.map((image) => `page ${image.page}`).join(\", \");\n const total = value.total !== undefined ? ` of ${value.total}` : \"\";\n return [\n {\n type: \"text\",\n text: `Rendered ${rendered}${total}. The images are on the tool card.`,\n },\n ];\n },\n // The card's data channel: bounded so a pathological render cannot\n // bloat the replay record (the toolview shows text above the cap).\n presentationMeta: (_args, value) => {\n const images = value.images;\n const bytes = images.reduce(\n (sum, image) => sum + image.dataUrl.length,\n 0,\n );\n return {\n pages: value.pages,\n ...(value.total !== undefined ? { total: value.total } : {}),\n images: bytes > 6_000_000 ? [] : images,\n };\n },\n },\n presentCall: (args) => ({\n card: \"generic\",\n title: \"Render Typst pages\",\n rawInput: String(args.pages ?? \"\"),\n }),\n isConcurrencySafe: () => false,\n async execute(args, exec) {\n const session = await sessionOfExec(ctx, exec, service);\n const ppi =\n typeof args.ppi === \"number\" && Number.isFinite(args.ppi)\n ? Math.min(Math.max(args.ppi, LIMITS.ppiMin), LIMITS.ppiMax)\n : LIMITS.ppiDefault;\n const result = await session.renderPages(args.pages, ppi);\n if (!result.ok) {\n const error = new Error(\n `The document does not compile, so no pages were rendered.\\n\\n${diagnosticsText(result.diagnostics)}`,\n );\n error.name = \"TYPST_COMPILE_FAILED\";\n throw error;\n }\n return stripAbsent({\n pages: result.pages,\n ...(result.total !== undefined ? { total: result.total } : {}),\n images: result.images.map((image) => ({\n page: image.page,\n dataUrl: `data:image/png;base64,${Buffer.from(image.png).toString(\"base64\")}`,\n })),\n });\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// typst_show\n// ---------------------------------------------------------------------------\n\nfunction typstShowTool(ctx: Context, service: TypstWorkbenchService) {\n return defineTool({\n name: \"typst_show\",\n description: [\n \"Point the user at something in the live preview: request a page location, or highlight rendered text with an optional comment. The panel notifies the user, who chooses when to navigate.\",\n \"Give exactly one of: page; quote (words as they appear in the rendered document \u2014 markup is ignored); or file and line (and optionally endLine) to highlight what those source lines produce.\",\n \"Add a short comment explaining why. Highlights follow the text as the document changes and last for this session.\",\n ].join(\" \"),\n parameters: {\n page: { type: \"integer\", description: \"1-based page to request.\" },\n quote: { type: \"string\", description: \"Rendered words to highlight.\" },\n file: { type: \"string\", description: \"Workspace-relative .typ file.\" },\n line: { type: \"integer\", description: \"1-based line in that file.\" },\n endLine: {\n type: \"integer\",\n description: \"Last line of the range (default: line).\",\n },\n comment: {\n type: \"string\",\n description: \"Short comment shown with the highlight.\",\n },\n },\n output: {\n schema: {\n type: \"object\",\n properties: {\n highlighted: { type: \"boolean\", required: true },\n exact: {\n type: \"boolean\",\n description: \"Whether the quote matched exactly.\",\n },\n id: { type: \"string\", description: \"The highlight id.\" },\n page: {\n type: \"integer\",\n description: \"The 1-based page requested for viewing.\",\n },\n },\n additionalProperties: false,\n },\n render: (_args, value) => [\n {\n type: \"text\",\n text: value.highlighted\n ? \"Highlighted in the preview.\"\n : `Requested viewing page ${value.page}; the user can open the location notification.`,\n },\n ],\n },\n presentCall: (args) => ({\n card: \"generic\",\n title: \"Show in preview\",\n rawInput: String(\n args.quote ??\n args.file ??\n (args.page !== undefined ? `page ${args.page}` : \"\"),\n ),\n }),\n isConcurrencySafe: () => false,\n async execute(args, exec) {\n const session = await sessionOfExec(ctx, exec, service);\n if (typeof args.page === \"number\") {\n session.showPage(args.page - 1);\n return { highlighted: false, page: args.page };\n }\n const target: Parameters<WorkspaceSession[\"highlight\"]>[0] = {};\n if (typeof args.quote === \"string\") target.quote = args.quote;\n if (typeof args.file === \"string\") {\n target.file = args.file;\n if (typeof args.line === \"number\") target.line = args.line;\n if (typeof args.endLine === \"number\") target.endLine = args.endLine;\n }\n const created = await session.highlight(\n target,\n typeof args.comment === \"string\" ? args.comment : \"\",\n );\n return {\n highlighted: true,\n exact: created.exact,\n id: created.highlight.id,\n };\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// typst_clear_highlights\n// ---------------------------------------------------------------------------\n\nfunction typstClearHighlightsTool(\n ctx: Context,\n service: TypstWorkbenchService,\n) {\n return defineTool({\n name: \"typst_clear_highlights\",\n description:\n \"Remove the highlights you placed in the live preview (all of them, or the named ids).\",\n parameters: {\n ids: {\n type: \"json\",\n description: \"Highlight ids to remove; omit to remove all.\",\n },\n },\n output: {\n schema: {\n type: \"object\",\n properties: { removed: { type: \"integer\", required: true } },\n additionalProperties: false,\n },\n render: (_args, value) => [\n { type: \"text\", text: `Removed ${value.removed} highlight(s).` },\n ],\n },\n presentCall: () => ({ card: \"generic\", title: \"Clear preview highlights\" }),\n isConcurrencySafe: () => true,\n async execute(args, exec) {\n const session = await sessionOfExec(ctx, exec, service);\n const ids = args.ids;\n const removed = session.clearHighlights(\n Array.isArray(ids) ? ids.map(String) : undefined,\n );\n return { removed };\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// typst_export_pdf\n// ---------------------------------------------------------------------------\n\nconst PDF_STANDARDS = [\n \"a-1b\",\n \"a-2b\",\n \"a-2u\",\n \"a-3b\",\n \"a-3u\",\n \"a-4\",\n \"a-4f\",\n] as const;\n\nfunction typstExportPdfTool(ctx: Context, service: TypstWorkbenchService) {\n return defineTool({\n name: \"typst_export_pdf\",\n description: [\n \"Compile the document with the user's Typst and write a PDF into the workspace.\",\n \"Optionally a PDF standard (pdfStandard) and a page selection.\",\n \"The preview's own PDF is not in the workspace; this is how you produce the deliverable.\",\n ].join(\" \"),\n parameters: {\n path: {\n type: \"string\",\n required: true,\n description: \"Workspace-relative output path ending in .pdf.\",\n },\n pdfStandard: {\n type: \"string\",\n enum: [...PDF_STANDARDS],\n description: \"PDF standard to embed.\",\n },\n pages: {\n type: \"string\",\n description: '1-based page selection, e.g. \"1-3\".',\n },\n },\n output: {\n schema: {\n type: \"object\",\n properties: {\n path: { type: \"string\", required: true },\n bytes: { type: \"integer\", description: \"PDF byte size.\" },\n pages: {\n type: \"integer\",\n description: \"Page count of the exported PDF.\",\n },\n summary: { type: \"string\", required: true },\n },\n additionalProperties: false,\n },\n render: (_args, value) => [{ type: \"text\", text: value.summary }],\n },\n presentCall: (args) => ({\n card: \"generic\",\n title: \"Export Typst PDF\",\n rawInput: String(args.path ?? \"\"),\n }),\n isConcurrencySafe: () => false,\n async execute(args, exec) {\n const session = await sessionOfExec(ctx, exec, service);\n const result = await session.exportPdf(args.path, {\n ...(typeof args.pdfStandard === \"string\"\n ? { pdfStandard: args.pdfStandard }\n : {}),\n ...(typeof args.pages === \"string\" ? { pages: args.pages } : {}),\n });\n if (!result.ok) {\n const error = new Error(\n `The PDF export failed.\\n\\n${diagnosticsText(result.diagnostics)}`,\n );\n error.name = \"TYPST_COMPILE_FAILED\";\n throw error;\n }\n return stripAbsent({\n path: result.path,\n ...(result.bytes !== undefined ? { bytes: result.bytes } : {}),\n ...(result.pages !== undefined ? { pages: result.pages } : {}),\n summary: `Exported ${result.path}${result.bytes !== undefined ? ` (${result.bytes} bytes)` : \"\"}${result.pages !== undefined ? ` \u2014 ${result.pages} page(s)` : \"\"}.`,\n });\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// Registration\n// ---------------------------------------------------------------------------\n\n/**\n * Register the seven tools, one effect each (unregistration is the\n * effect's own teardown).\n * @param ctx - the plugin context.\n * @param service - the workbench service the tools resolve sessions through.\n */\nexport function registerTypstTools(\n ctx: Context,\n service: TypstWorkbenchService,\n): void {\n const definitions = [\n typstStatusTool(ctx, service),\n typstSetMainTool(ctx, service),\n typstCheckTool(ctx, service),\n typstRenderPagesTool(ctx, service),\n typstShowTool(ctx, service),\n typstClearHighlightsTool(ctx, service),\n typstExportPdfTool(ctx, service),\n ] satisfies ToolDefinition[];\n for (const definition of definitions) {\n ctx.effect(\n () => ctx.tools.register(definition),\n `typst: ${definition.name}`,\n );\n }\n}\n"],
5
+ "mappings": "AAcA,SAAS,kBAAuC;AAEhD,SAAS,cAAc;AAGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAiBP,SAAS,UAAU,SAA2C;AAC5D,QAAM,QAAQ,QAAQ,MAAM;AAC5B,QAAM,EAAE,QAAQ,SAAS,IAAI,QAAQ,MAAM,WAAW;AACtD,QAAM,QAAQ,MAAM,UAAU,SAAS;AACvC,SAAO;AAAA,IACL,MAAM,MAAM;AAAA,IACZ,OAAO,MAAM,OAAO;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,MAAM,OAAO,cAAc;AAAA,IACvC,SAAS;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,UAAU,MAAM,YAAY,SACxB,gBAAgB,MAAM,WAAW,IACjC;AAAA,EACN;AACF;AAEA,SAAS,OAAO,SAAiC;AAC/C,SAAO,QAAQ,aAAa,KACxB,GAAG,QAAQ,OAAO;AAAA;AAAA,EAAO,QAAQ,QAAQ,KACzC,QAAQ;AACd;AAGA,SAAS,YAA8B,OAAa;AAClD,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,MAAM,MAAM,MAAS;AAAA,EACzD;AACF;AAMA,SAAS,gBAAgB,KAAc,SAAgC;AACrE,SAAO,WAAW;AAAA,IAChB,MAAM;AAAA,IACN,aAAa;AAAA,MACX;AAAA,MACA;AAAA,M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d,cAAM,QAAQ,IAAI;AAAA,UAChB;AAAA;AAAA,EAA6B,gBAAgB,OAAO,WAAW,CAAC;AAAA,QAClE;AACA,cAAM,OAAO;AACb,cAAM;AAAA,MACR;AACA,aAAO,YAAY;AAAA,QACjB,MAAM,OAAO;AAAA,QACb,GAAI,OAAO,UAAU,SAAY,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AAAA,QAC5D,GAAI,OAAO,UAAU,SAAY,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AAAA,QAC5D,SAAS,YAAY,OAAO,IAAI,GAAG,OAAO,UAAU,SAAY,KAAK,OAAO,KAAK,YAAY,EAAE,GAAG,OAAO,UAAU,SAAY,WAAM,OAAO,KAAK,aAAa,EAAE;AAAA,MAClK,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;AAYO,SAAS,mBACd,KACA,SACM;AACN,QAAM,cAAc;AAAA,IAClB,gBAAgB,KAAK,OAAO;AAAA,IAC5B,iBAAiB,KAAK,OAAO;AAAA,IAC7B,eAAe,KAAK,OAAO;AAAA,IAC3B,qBAAqB,KAAK,OAAO;AAAA,IACjC,cAAc,KAAK,OAAO;AAAA,IAC1B,yBAAyB,KAAK,OAAO;AAAA,IACrC,mBAAmB,KAAK,OAAO;AAAA,EACjC;AACA,aAAW,cAAc,aAAa;AACpC,QAAI;AAAA,MACF,MAAM,IAAI,MAAM,SAAS,UAAU;AAAA,MACnC,UAAU,WAAW,IAAI;AAAA,IAC3B;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Shared tool plumbing: session resolution from a tool execution, and the
3
+ * diagnostics/status text the tools return (ported from the ZCode
4
+ * typst-workbench server 0.2.0 `src/domain/format.ts` and
5
+ * `src/adapters/server.ts`). Host half only.
6
+ * @module dsh-typst/tools/shared
7
+ */
8
+ import type { Context } from "@deepseek-ai/cordis";
9
+ import type { ToolRunContext } from "@deepseek-ai/dsh-tools";
10
+ import type { DiagnosticView, StatusView } from "../contract.js";
11
+ import type { TypstWorkbenchService } from "../service.js";
12
+ import { WorkspaceSession } from "../workspace/session.js";
13
+ /**
14
+ * Resolve the executing session's workspace and return its workbench
15
+ * session (creating it on first use).
16
+ * @param ctx - the plugin context (services resolve through it).
17
+ * @param exec - the tool execution context.
18
+ * @param service - the workbench service.
19
+ */
20
+ export declare function sessionOfExec(ctx: Context, exec: ToolRunContext, service: TypstWorkbenchService): Promise<WorkspaceSession>;
21
+ /** Model-facing rendering of one diagnostic: location, excerpt, hints, trace. */
22
+ export declare function diagnosticText(diagnostic: DiagnosticView): string;
23
+ /** The diagnostics block, capped at LIMITS.diagnostics entries. */
24
+ export declare function diagnosticsText(diagnostics: DiagnosticView[], limit?: 30): string;
25
+ export declare function countOf(diagnostics: DiagnosticView[]): {
26
+ errors: number;
27
+ warnings: number;
28
+ };
29
+ /** One-line compile summary the status/check/set_main answers lead with. */
30
+ export declare function compileSummary(status: StatusView, main: string | null, diagnostics: DiagnosticView[], pages: number | undefined): string;
31
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,gBAAgB,CAAC,CAW3B;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM,CAYjE;AAUD,mEAAmE;AACnE,wBAAgB,eAAe,CAC7B,WAAW,EAAE,cAAc,EAAE,EAC7B,KAAK,KAAqB,GACzB,MAAM,CAKR;AAED,wBAAgB,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,GAAG;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAKA;AAKD,4EAA4E;AAC5E,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,WAAW,EAAE,cAAc,EAAE,EAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,MAAM,CAsBR"}