document-operations 1.1.56 → 1.1.57
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/dist/index.cjs +7 -3
- package/dist/index.d.cts +32 -32
- package/dist/index.d.ts +32 -32
- package/dist/index.js +7 -3
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -94,10 +94,12 @@ async function resolveDocumentInput(input, options) {
|
|
|
94
94
|
* The hybrid output shape every MCP tool that produces a document accepts: an optional filesystem path to write the result to. Omitting it returns the bytes inline, base64-encoded, instead.
|
|
95
95
|
*/
|
|
96
96
|
const DocumentOutputSchema = zod.z.object({ outputPath: zod.z.string().optional().describe("Filesystem path to write the resulting document to. Omit to receive the document bytes inline, base64-encoded, in the tool result instead.") });
|
|
97
|
+
/** Bytes per kibibyte, the base unit `LARGE_RESULT_THRESHOLD_BYTES` is derived from. */
|
|
98
|
+
const BYTES_PER_KIBIBYTE = 1024;
|
|
97
99
|
/**
|
|
98
|
-
* Above this many bytes, an inline base64 result is flagged `large: true` so a caller/LLM can see the response is sizeable before deciding whether to consume it directly. Purely advisory: `resolveDocumentOutput` never truncates or refuses to return large bytes, it only flags them — silently truncating a document would produce a corrupt file with no indication anything was lost.
|
|
100
|
+
* Above this many bytes, an inline base64 result is flagged `large: true` so a caller/LLM can see the response is sizeable before deciding whether to consume it directly. Purely advisory: `resolveDocumentOutput` never truncates or refuses to return large bytes, it only flags them — silently truncating a document would produce a corrupt file with no indication anything was lost.
|
|
99
101
|
*/
|
|
100
|
-
const LARGE_RESULT_THRESHOLD_BYTES =
|
|
102
|
+
const LARGE_RESULT_THRESHOLD_BYTES = 5 * (BYTES_PER_KIBIBYTE * BYTES_PER_KIBIBYTE);
|
|
101
103
|
/**
|
|
102
104
|
* Resolves output bytes against the hybrid DocumentOutput shape: writes to `outputPath` and reports the path plus byte length when one is given, otherwise returns the bytes inline as base64 (flagged `large: true` above `LARGE_RESULT_THRESHOLD_BYTES`, never truncated or refused).
|
|
103
105
|
*/
|
|
@@ -319,6 +321,8 @@ const WritableFormatSchema = zod.z.enum([
|
|
|
319
321
|
"pdf",
|
|
320
322
|
"markdown"
|
|
321
323
|
]);
|
|
324
|
+
/** The deepest heading level docx/odt support — HTML/ODF both cap heading nesting at h1-h6. */
|
|
325
|
+
const MAX_HEADING_LEVEL = 6;
|
|
322
326
|
const RunSchema = zod.z.object({
|
|
323
327
|
text: zod.z.string().optional().describe("The run's own text content."),
|
|
324
328
|
bold: zod.z.boolean().optional(),
|
|
@@ -334,7 +338,7 @@ const RunSchema = zod.z.object({
|
|
|
334
338
|
const ParagraphSchema = zod.z.object({
|
|
335
339
|
text: zod.z.string().optional().describe("Plain paragraph text, as a single run. Omit and use `runs` instead for mixed formatting within one paragraph."),
|
|
336
340
|
styleId: zod.z.string().optional(),
|
|
337
|
-
headingLevel: zod.z.number().int().min(1).max(
|
|
341
|
+
headingLevel: zod.z.number().int().min(1).max(MAX_HEADING_LEVEL).optional().describe("docx/odt only."),
|
|
338
342
|
alignment: zod.z.enum([
|
|
339
343
|
"left",
|
|
340
344
|
"center",
|
package/dist/index.d.cts
CHANGED
|
@@ -113,7 +113,7 @@ declare const DocumentOutputSchema: z.ZodObject<{
|
|
|
113
113
|
}, z.core.$strip>;
|
|
114
114
|
type DocumentOutput = z.infer<typeof DocumentOutputSchema>;
|
|
115
115
|
/**
|
|
116
|
-
* Above this many bytes, an inline base64 result is flagged `large: true` so a caller/LLM can see the response is sizeable before deciding whether to consume it directly. Purely advisory: `resolveDocumentOutput` never truncates or refuses to return large bytes, it only flags them — silently truncating a document would produce a corrupt file with no indication anything was lost.
|
|
116
|
+
* Above this many bytes, an inline base64 result is flagged `large: true` so a caller/LLM can see the response is sizeable before deciding whether to consume it directly. Purely advisory: `resolveDocumentOutput` never truncates or refuses to return large bytes, it only flags them — silently truncating a document would produce a corrupt file with no indication anything was lost.
|
|
117
117
|
*/
|
|
118
118
|
declare const LARGE_RESULT_THRESHOLD_BYTES: number;
|
|
119
119
|
interface WrittenDocumentOutput {
|
|
@@ -336,7 +336,7 @@ declare const computeFormulaOperation: {
|
|
|
336
336
|
path: string;
|
|
337
337
|
} | {
|
|
338
338
|
bytesBase64: string;
|
|
339
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
339
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
340
340
|
};
|
|
341
341
|
bindings?: Record<string, {
|
|
342
342
|
kind: "quantity";
|
|
@@ -349,7 +349,7 @@ declare const computeFormulaOperation: {
|
|
|
349
349
|
dimension: Partial<Record<"length" | "mass" | "time" | "electricCurrent" | "thermodynamicTemperature" | "amountOfSubstance" | "luminousIntensity", number>>;
|
|
350
350
|
}> | undefined;
|
|
351
351
|
}, context?: DocumentOperationContext): Promise<{
|
|
352
|
-
sourceFormat: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
352
|
+
sourceFormat: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
353
353
|
documentKind: "wordprocessing" | "presentation" | "spreadsheet" | "drawing" | "formula";
|
|
354
354
|
formulaCount: number;
|
|
355
355
|
formulas: {
|
|
@@ -596,9 +596,9 @@ declare const convertDocumentOperation: {
|
|
|
596
596
|
path: string;
|
|
597
597
|
} | {
|
|
598
598
|
bytesBase64: string;
|
|
599
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
599
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
600
600
|
};
|
|
601
|
-
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
601
|
+
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
602
602
|
output?: {
|
|
603
603
|
outputPath?: string | undefined;
|
|
604
604
|
} | undefined;
|
|
@@ -611,7 +611,7 @@ declare const convertDocumentOperation: {
|
|
|
611
611
|
onSubstitutionDiagnostics?: boolean | undefined;
|
|
612
612
|
images?: Record<string, string> | undefined;
|
|
613
613
|
}, context?: DocumentOperationContext): Promise<{
|
|
614
|
-
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
614
|
+
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
615
615
|
output: {
|
|
616
616
|
path: string;
|
|
617
617
|
byteLength: number;
|
|
@@ -686,8 +686,8 @@ declare const listDocumentConversionsOperation: {
|
|
|
686
686
|
}, z.core.$strip>;
|
|
687
687
|
run(input: Record<string, never>, context?: DocumentOperationContext): Promise<{
|
|
688
688
|
conversions: {
|
|
689
|
-
source: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
690
|
-
target: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
689
|
+
source: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
690
|
+
target: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
691
691
|
}[];
|
|
692
692
|
}>;
|
|
693
693
|
};
|
|
@@ -729,7 +729,7 @@ declare const docxExtrasOperation: {
|
|
|
729
729
|
path: string;
|
|
730
730
|
} | {
|
|
731
731
|
bytesBase64: string;
|
|
732
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
732
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
733
733
|
};
|
|
734
734
|
}, context?: DocumentOperationContext): Promise<import("documents.js").DocxExtras>;
|
|
735
735
|
};
|
|
@@ -744,8 +744,8 @@ declare const documentCreateOperation: {
|
|
|
744
744
|
docx: "docx";
|
|
745
745
|
pptx: "pptx";
|
|
746
746
|
odt: "odt";
|
|
747
|
-
odp: "odp";
|
|
748
747
|
ods: "ods";
|
|
748
|
+
odp: "odp";
|
|
749
749
|
odg: "odg";
|
|
750
750
|
markdown: "markdown";
|
|
751
751
|
pdf: "pdf";
|
|
@@ -763,7 +763,7 @@ declare const documentCreateOperation: {
|
|
|
763
763
|
large: z.ZodOptional<z.ZodLiteral<true>>;
|
|
764
764
|
}, z.core.$strip>]>;
|
|
765
765
|
run(input: {
|
|
766
|
-
format: "docx" | "pptx" | "odt" | "
|
|
766
|
+
format: "docx" | "pptx" | "odt" | "ods" | "odp" | "odg" | "markdown" | "pdf";
|
|
767
767
|
output?: {
|
|
768
768
|
outputPath?: string | undefined;
|
|
769
769
|
} | undefined;
|
|
@@ -817,8 +817,8 @@ declare const documentAppendParagraphsOperation: {
|
|
|
817
817
|
headingLevel: z.ZodOptional<z.ZodNumber>;
|
|
818
818
|
alignment: z.ZodOptional<z.ZodEnum<{
|
|
819
819
|
left: "left";
|
|
820
|
-
center: "center";
|
|
821
820
|
right: "right";
|
|
821
|
+
center: "center";
|
|
822
822
|
justify: "justify";
|
|
823
823
|
}>>;
|
|
824
824
|
runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -851,14 +851,14 @@ declare const documentAppendParagraphsOperation: {
|
|
|
851
851
|
path: string;
|
|
852
852
|
} | {
|
|
853
853
|
bytesBase64: string;
|
|
854
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
854
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
855
855
|
};
|
|
856
856
|
targetFormat: "docx" | "odt" | "markdown";
|
|
857
857
|
paragraphs: {
|
|
858
858
|
text?: string | undefined;
|
|
859
859
|
styleId?: string | undefined;
|
|
860
860
|
headingLevel?: number | undefined;
|
|
861
|
-
alignment?: "left" | "
|
|
861
|
+
alignment?: "left" | "right" | "center" | "justify" | undefined;
|
|
862
862
|
runs?: {
|
|
863
863
|
text?: string | undefined;
|
|
864
864
|
bold?: boolean | undefined;
|
|
@@ -930,7 +930,7 @@ declare const fontsOperation: {
|
|
|
930
930
|
path: string;
|
|
931
931
|
} | {
|
|
932
932
|
bytesBase64: string;
|
|
933
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
933
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
934
934
|
};
|
|
935
935
|
}, context?: DocumentOperationContext): Promise<{
|
|
936
936
|
faces: {
|
|
@@ -1038,9 +1038,9 @@ declare const fromPackageOperation: {
|
|
|
1038
1038
|
path: string;
|
|
1039
1039
|
} | {
|
|
1040
1040
|
bytesBase64: string;
|
|
1041
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1041
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1042
1042
|
};
|
|
1043
|
-
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1043
|
+
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1044
1044
|
output?: {
|
|
1045
1045
|
outputPath?: string | undefined;
|
|
1046
1046
|
} | undefined;
|
|
@@ -1091,7 +1091,7 @@ declare const metadataReadOperation: {
|
|
|
1091
1091
|
path: string;
|
|
1092
1092
|
} | {
|
|
1093
1093
|
bytesBase64: string;
|
|
1094
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1094
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1095
1095
|
};
|
|
1096
1096
|
}, context?: DocumentOperationContext): Promise<{
|
|
1097
1097
|
title?: string | undefined;
|
|
@@ -1185,9 +1185,9 @@ declare const metadataWriteOperation: {
|
|
|
1185
1185
|
path: string;
|
|
1186
1186
|
} | {
|
|
1187
1187
|
bytesBase64: string;
|
|
1188
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1188
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1189
1189
|
};
|
|
1190
|
-
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1190
|
+
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1191
1191
|
output?: {
|
|
1192
1192
|
outputPath?: string | undefined;
|
|
1193
1193
|
} | undefined;
|
|
@@ -1337,7 +1337,7 @@ declare const odbTablesOperation: {
|
|
|
1337
1337
|
path: string;
|
|
1338
1338
|
} | {
|
|
1339
1339
|
bytesBase64: string;
|
|
1340
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1340
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1341
1341
|
};
|
|
1342
1342
|
}, context?: DocumentOperationContext): Promise<readonly import("documents.js").HsqldbTable[]>;
|
|
1343
1343
|
};
|
|
@@ -1377,7 +1377,7 @@ declare const odbFormsOperation: {
|
|
|
1377
1377
|
path: string;
|
|
1378
1378
|
} | {
|
|
1379
1379
|
bytesBase64: string;
|
|
1380
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1380
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1381
1381
|
};
|
|
1382
1382
|
}, context?: DocumentOperationContext): Promise<readonly OdbForm[]>;
|
|
1383
1383
|
};
|
|
@@ -1417,7 +1417,7 @@ declare const odbReportsOperation: {
|
|
|
1417
1417
|
path: string;
|
|
1418
1418
|
} | {
|
|
1419
1419
|
bytesBase64: string;
|
|
1420
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1420
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1421
1421
|
};
|
|
1422
1422
|
}, context?: DocumentOperationContext): Promise<readonly OdbReport[]>;
|
|
1423
1423
|
};
|
|
@@ -1459,7 +1459,7 @@ declare const odbQueryOperation: {
|
|
|
1459
1459
|
path: string;
|
|
1460
1460
|
} | {
|
|
1461
1461
|
bytesBase64: string;
|
|
1462
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1462
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1463
1463
|
};
|
|
1464
1464
|
sql?: string | undefined;
|
|
1465
1465
|
query?: string | undefined;
|
|
@@ -1505,7 +1505,7 @@ declare const odbToCsvOperation: {
|
|
|
1505
1505
|
path: string;
|
|
1506
1506
|
} | {
|
|
1507
1507
|
bytesBase64: string;
|
|
1508
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1508
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1509
1509
|
};
|
|
1510
1510
|
table?: string | undefined;
|
|
1511
1511
|
output?: {
|
|
@@ -1552,7 +1552,7 @@ declare const odbToXlsxOperation: {
|
|
|
1552
1552
|
path: string;
|
|
1553
1553
|
} | {
|
|
1554
1554
|
bytesBase64: string;
|
|
1555
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1555
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1556
1556
|
};
|
|
1557
1557
|
output?: {
|
|
1558
1558
|
outputPath?: string | undefined;
|
|
@@ -1720,7 +1720,7 @@ declare const odbRenderReportOperation: {
|
|
|
1720
1720
|
path: string;
|
|
1721
1721
|
} | {
|
|
1722
1722
|
bytesBase64: string;
|
|
1723
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1723
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1724
1724
|
};
|
|
1725
1725
|
targetFormat: "docx" | "odt" | "pdf";
|
|
1726
1726
|
report?: string | undefined;
|
|
@@ -1849,7 +1849,7 @@ declare const odmToPdfOperation: {
|
|
|
1849
1849
|
path: string;
|
|
1850
1850
|
} | {
|
|
1851
1851
|
bytesBase64: string;
|
|
1852
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1852
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1853
1853
|
};
|
|
1854
1854
|
}[];
|
|
1855
1855
|
output: {
|
|
@@ -1917,7 +1917,7 @@ declare const outlineDocumentOperation: {
|
|
|
1917
1917
|
path: string;
|
|
1918
1918
|
} | {
|
|
1919
1919
|
bytesBase64: string;
|
|
1920
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1920
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1921
1921
|
};
|
|
1922
1922
|
}, context?: DocumentOperationContext): Promise<OutlineDocumentOutput>;
|
|
1923
1923
|
};
|
|
@@ -2005,7 +2005,7 @@ declare const pdfInspectOperation: {
|
|
|
2005
2005
|
path: string;
|
|
2006
2006
|
} | {
|
|
2007
2007
|
bytesBase64: string;
|
|
2008
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
2008
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
2009
2009
|
};
|
|
2010
2010
|
full?: boolean | undefined;
|
|
2011
2011
|
}, context?: DocumentOperationContext): Promise<{
|
|
@@ -2208,7 +2208,7 @@ declare const pdfInspectOperation: {
|
|
|
2208
2208
|
yPt: number;
|
|
2209
2209
|
}][] | undefined;
|
|
2210
2210
|
source?: {
|
|
2211
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
2211
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odm" | "odb" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd";
|
|
2212
2212
|
xml: string;
|
|
2213
2213
|
} | undefined;
|
|
2214
2214
|
}[] | undefined;
|
|
@@ -2251,7 +2251,7 @@ declare const pdfInspectOperation: {
|
|
|
2251
2251
|
structure?: LayoutStructureElement[] | undefined;
|
|
2252
2252
|
form?: LayoutFormField[] | undefined;
|
|
2253
2253
|
source?: Record<string, {
|
|
2254
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
2254
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odm" | "odb" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd";
|
|
2255
2255
|
xml: string;
|
|
2256
2256
|
}> | undefined;
|
|
2257
2257
|
} | PdfInspectSummary>;
|
package/dist/index.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ declare const DocumentOutputSchema: z.ZodObject<{
|
|
|
113
113
|
}, z.core.$strip>;
|
|
114
114
|
type DocumentOutput = z.infer<typeof DocumentOutputSchema>;
|
|
115
115
|
/**
|
|
116
|
-
* Above this many bytes, an inline base64 result is flagged `large: true` so a caller/LLM can see the response is sizeable before deciding whether to consume it directly. Purely advisory: `resolveDocumentOutput` never truncates or refuses to return large bytes, it only flags them — silently truncating a document would produce a corrupt file with no indication anything was lost.
|
|
116
|
+
* Above this many bytes, an inline base64 result is flagged `large: true` so a caller/LLM can see the response is sizeable before deciding whether to consume it directly. Purely advisory: `resolveDocumentOutput` never truncates or refuses to return large bytes, it only flags them — silently truncating a document would produce a corrupt file with no indication anything was lost.
|
|
117
117
|
*/
|
|
118
118
|
declare const LARGE_RESULT_THRESHOLD_BYTES: number;
|
|
119
119
|
interface WrittenDocumentOutput {
|
|
@@ -336,7 +336,7 @@ declare const computeFormulaOperation: {
|
|
|
336
336
|
path: string;
|
|
337
337
|
} | {
|
|
338
338
|
bytesBase64: string;
|
|
339
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
339
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
340
340
|
};
|
|
341
341
|
bindings?: Record<string, {
|
|
342
342
|
kind: "quantity";
|
|
@@ -349,7 +349,7 @@ declare const computeFormulaOperation: {
|
|
|
349
349
|
dimension: Partial<Record<"length" | "mass" | "time" | "electricCurrent" | "thermodynamicTemperature" | "amountOfSubstance" | "luminousIntensity", number>>;
|
|
350
350
|
}> | undefined;
|
|
351
351
|
}, context?: DocumentOperationContext): Promise<{
|
|
352
|
-
sourceFormat: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
352
|
+
sourceFormat: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
353
353
|
documentKind: "wordprocessing" | "presentation" | "spreadsheet" | "drawing" | "formula";
|
|
354
354
|
formulaCount: number;
|
|
355
355
|
formulas: {
|
|
@@ -596,9 +596,9 @@ declare const convertDocumentOperation: {
|
|
|
596
596
|
path: string;
|
|
597
597
|
} | {
|
|
598
598
|
bytesBase64: string;
|
|
599
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
599
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
600
600
|
};
|
|
601
|
-
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
601
|
+
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
602
602
|
output?: {
|
|
603
603
|
outputPath?: string | undefined;
|
|
604
604
|
} | undefined;
|
|
@@ -611,7 +611,7 @@ declare const convertDocumentOperation: {
|
|
|
611
611
|
onSubstitutionDiagnostics?: boolean | undefined;
|
|
612
612
|
images?: Record<string, string> | undefined;
|
|
613
613
|
}, context?: DocumentOperationContext): Promise<{
|
|
614
|
-
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
614
|
+
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
615
615
|
output: {
|
|
616
616
|
path: string;
|
|
617
617
|
byteLength: number;
|
|
@@ -686,8 +686,8 @@ declare const listDocumentConversionsOperation: {
|
|
|
686
686
|
}, z.core.$strip>;
|
|
687
687
|
run(input: Record<string, never>, context?: DocumentOperationContext): Promise<{
|
|
688
688
|
conversions: {
|
|
689
|
-
source: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
690
|
-
target: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
689
|
+
source: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
690
|
+
target: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
691
691
|
}[];
|
|
692
692
|
}>;
|
|
693
693
|
};
|
|
@@ -729,7 +729,7 @@ declare const docxExtrasOperation: {
|
|
|
729
729
|
path: string;
|
|
730
730
|
} | {
|
|
731
731
|
bytesBase64: string;
|
|
732
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
732
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
733
733
|
};
|
|
734
734
|
}, context?: DocumentOperationContext): Promise<import("documents.js").DocxExtras>;
|
|
735
735
|
};
|
|
@@ -744,8 +744,8 @@ declare const documentCreateOperation: {
|
|
|
744
744
|
docx: "docx";
|
|
745
745
|
pptx: "pptx";
|
|
746
746
|
odt: "odt";
|
|
747
|
-
odp: "odp";
|
|
748
747
|
ods: "ods";
|
|
748
|
+
odp: "odp";
|
|
749
749
|
odg: "odg";
|
|
750
750
|
markdown: "markdown";
|
|
751
751
|
pdf: "pdf";
|
|
@@ -763,7 +763,7 @@ declare const documentCreateOperation: {
|
|
|
763
763
|
large: z.ZodOptional<z.ZodLiteral<true>>;
|
|
764
764
|
}, z.core.$strip>]>;
|
|
765
765
|
run(input: {
|
|
766
|
-
format: "docx" | "pptx" | "odt" | "
|
|
766
|
+
format: "docx" | "pptx" | "odt" | "ods" | "odp" | "odg" | "markdown" | "pdf";
|
|
767
767
|
output?: {
|
|
768
768
|
outputPath?: string | undefined;
|
|
769
769
|
} | undefined;
|
|
@@ -817,8 +817,8 @@ declare const documentAppendParagraphsOperation: {
|
|
|
817
817
|
headingLevel: z.ZodOptional<z.ZodNumber>;
|
|
818
818
|
alignment: z.ZodOptional<z.ZodEnum<{
|
|
819
819
|
left: "left";
|
|
820
|
-
center: "center";
|
|
821
820
|
right: "right";
|
|
821
|
+
center: "center";
|
|
822
822
|
justify: "justify";
|
|
823
823
|
}>>;
|
|
824
824
|
runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -851,14 +851,14 @@ declare const documentAppendParagraphsOperation: {
|
|
|
851
851
|
path: string;
|
|
852
852
|
} | {
|
|
853
853
|
bytesBase64: string;
|
|
854
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
854
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
855
855
|
};
|
|
856
856
|
targetFormat: "docx" | "odt" | "markdown";
|
|
857
857
|
paragraphs: {
|
|
858
858
|
text?: string | undefined;
|
|
859
859
|
styleId?: string | undefined;
|
|
860
860
|
headingLevel?: number | undefined;
|
|
861
|
-
alignment?: "left" | "
|
|
861
|
+
alignment?: "left" | "right" | "center" | "justify" | undefined;
|
|
862
862
|
runs?: {
|
|
863
863
|
text?: string | undefined;
|
|
864
864
|
bold?: boolean | undefined;
|
|
@@ -930,7 +930,7 @@ declare const fontsOperation: {
|
|
|
930
930
|
path: string;
|
|
931
931
|
} | {
|
|
932
932
|
bytesBase64: string;
|
|
933
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
933
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
934
934
|
};
|
|
935
935
|
}, context?: DocumentOperationContext): Promise<{
|
|
936
936
|
faces: {
|
|
@@ -1038,9 +1038,9 @@ declare const fromPackageOperation: {
|
|
|
1038
1038
|
path: string;
|
|
1039
1039
|
} | {
|
|
1040
1040
|
bytesBase64: string;
|
|
1041
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1041
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1042
1042
|
};
|
|
1043
|
-
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1043
|
+
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1044
1044
|
output?: {
|
|
1045
1045
|
outputPath?: string | undefined;
|
|
1046
1046
|
} | undefined;
|
|
@@ -1091,7 +1091,7 @@ declare const metadataReadOperation: {
|
|
|
1091
1091
|
path: string;
|
|
1092
1092
|
} | {
|
|
1093
1093
|
bytesBase64: string;
|
|
1094
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1094
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1095
1095
|
};
|
|
1096
1096
|
}, context?: DocumentOperationContext): Promise<{
|
|
1097
1097
|
title?: string | undefined;
|
|
@@ -1185,9 +1185,9 @@ declare const metadataWriteOperation: {
|
|
|
1185
1185
|
path: string;
|
|
1186
1186
|
} | {
|
|
1187
1187
|
bytesBase64: string;
|
|
1188
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1188
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1189
1189
|
};
|
|
1190
|
-
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1190
|
+
targetFormat: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1191
1191
|
output?: {
|
|
1192
1192
|
outputPath?: string | undefined;
|
|
1193
1193
|
} | undefined;
|
|
@@ -1337,7 +1337,7 @@ declare const odbTablesOperation: {
|
|
|
1337
1337
|
path: string;
|
|
1338
1338
|
} | {
|
|
1339
1339
|
bytesBase64: string;
|
|
1340
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1340
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1341
1341
|
};
|
|
1342
1342
|
}, context?: DocumentOperationContext): Promise<readonly import("documents.js").HsqldbTable[]>;
|
|
1343
1343
|
};
|
|
@@ -1377,7 +1377,7 @@ declare const odbFormsOperation: {
|
|
|
1377
1377
|
path: string;
|
|
1378
1378
|
} | {
|
|
1379
1379
|
bytesBase64: string;
|
|
1380
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1380
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1381
1381
|
};
|
|
1382
1382
|
}, context?: DocumentOperationContext): Promise<readonly OdbForm[]>;
|
|
1383
1383
|
};
|
|
@@ -1417,7 +1417,7 @@ declare const odbReportsOperation: {
|
|
|
1417
1417
|
path: string;
|
|
1418
1418
|
} | {
|
|
1419
1419
|
bytesBase64: string;
|
|
1420
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1420
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1421
1421
|
};
|
|
1422
1422
|
}, context?: DocumentOperationContext): Promise<readonly OdbReport[]>;
|
|
1423
1423
|
};
|
|
@@ -1459,7 +1459,7 @@ declare const odbQueryOperation: {
|
|
|
1459
1459
|
path: string;
|
|
1460
1460
|
} | {
|
|
1461
1461
|
bytesBase64: string;
|
|
1462
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1462
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1463
1463
|
};
|
|
1464
1464
|
sql?: string | undefined;
|
|
1465
1465
|
query?: string | undefined;
|
|
@@ -1505,7 +1505,7 @@ declare const odbToCsvOperation: {
|
|
|
1505
1505
|
path: string;
|
|
1506
1506
|
} | {
|
|
1507
1507
|
bytesBase64: string;
|
|
1508
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1508
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1509
1509
|
};
|
|
1510
1510
|
table?: string | undefined;
|
|
1511
1511
|
output?: {
|
|
@@ -1552,7 +1552,7 @@ declare const odbToXlsxOperation: {
|
|
|
1552
1552
|
path: string;
|
|
1553
1553
|
} | {
|
|
1554
1554
|
bytesBase64: string;
|
|
1555
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1555
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1556
1556
|
};
|
|
1557
1557
|
output?: {
|
|
1558
1558
|
outputPath?: string | undefined;
|
|
@@ -1720,7 +1720,7 @@ declare const odbRenderReportOperation: {
|
|
|
1720
1720
|
path: string;
|
|
1721
1721
|
} | {
|
|
1722
1722
|
bytesBase64: string;
|
|
1723
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1723
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1724
1724
|
};
|
|
1725
1725
|
targetFormat: "docx" | "odt" | "pdf";
|
|
1726
1726
|
report?: string | undefined;
|
|
@@ -1849,7 +1849,7 @@ declare const odmToPdfOperation: {
|
|
|
1849
1849
|
path: string;
|
|
1850
1850
|
} | {
|
|
1851
1851
|
bytesBase64: string;
|
|
1852
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1852
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1853
1853
|
};
|
|
1854
1854
|
}[];
|
|
1855
1855
|
output: {
|
|
@@ -1917,7 +1917,7 @@ declare const outlineDocumentOperation: {
|
|
|
1917
1917
|
path: string;
|
|
1918
1918
|
} | {
|
|
1919
1919
|
bytesBase64: string;
|
|
1920
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
1920
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
1921
1921
|
};
|
|
1922
1922
|
}, context?: DocumentOperationContext): Promise<OutlineDocumentOutput>;
|
|
1923
1923
|
};
|
|
@@ -2005,7 +2005,7 @@ declare const pdfInspectOperation: {
|
|
|
2005
2005
|
path: string;
|
|
2006
2006
|
} | {
|
|
2007
2007
|
bytesBase64: string;
|
|
2008
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
2008
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd" | "svg" | "csv" | "doc" | "xls" | "ppt";
|
|
2009
2009
|
};
|
|
2010
2010
|
full?: boolean | undefined;
|
|
2011
2011
|
}, context?: DocumentOperationContext): Promise<{
|
|
@@ -2208,7 +2208,7 @@ declare const pdfInspectOperation: {
|
|
|
2208
2208
|
yPt: number;
|
|
2209
2209
|
}][] | undefined;
|
|
2210
2210
|
source?: {
|
|
2211
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
2211
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odm" | "odb" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd";
|
|
2212
2212
|
xml: string;
|
|
2213
2213
|
} | undefined;
|
|
2214
2214
|
}[] | undefined;
|
|
@@ -2251,7 +2251,7 @@ declare const pdfInspectOperation: {
|
|
|
2251
2251
|
structure?: LayoutStructureElement[] | undefined;
|
|
2252
2252
|
form?: LayoutFormField[] | undefined;
|
|
2253
2253
|
source?: Record<string, {
|
|
2254
|
-
format: "docx" | "pptx" | "xlsx" | "odt" | "
|
|
2254
|
+
format: "docx" | "pptx" | "xlsx" | "odt" | "ods" | "odp" | "odg" | "odm" | "odb" | "odf" | "markdown" | "pdf" | "epub" | "rtf" | "wpd";
|
|
2255
2255
|
xml: string;
|
|
2256
2256
|
}> | undefined;
|
|
2257
2257
|
} | PdfInspectSummary>;
|
package/dist/index.js
CHANGED
|
@@ -93,10 +93,12 @@ async function resolveDocumentInput(input, options) {
|
|
|
93
93
|
* The hybrid output shape every MCP tool that produces a document accepts: an optional filesystem path to write the result to. Omitting it returns the bytes inline, base64-encoded, instead.
|
|
94
94
|
*/
|
|
95
95
|
const DocumentOutputSchema = z.object({ outputPath: z.string().optional().describe("Filesystem path to write the resulting document to. Omit to receive the document bytes inline, base64-encoded, in the tool result instead.") });
|
|
96
|
+
/** Bytes per kibibyte, the base unit `LARGE_RESULT_THRESHOLD_BYTES` is derived from. */
|
|
97
|
+
const BYTES_PER_KIBIBYTE = 1024;
|
|
96
98
|
/**
|
|
97
|
-
* Above this many bytes, an inline base64 result is flagged `large: true` so a caller/LLM can see the response is sizeable before deciding whether to consume it directly. Purely advisory: `resolveDocumentOutput` never truncates or refuses to return large bytes, it only flags them — silently truncating a document would produce a corrupt file with no indication anything was lost.
|
|
99
|
+
* Above this many bytes, an inline base64 result is flagged `large: true` so a caller/LLM can see the response is sizeable before deciding whether to consume it directly. Purely advisory: `resolveDocumentOutput` never truncates or refuses to return large bytes, it only flags them — silently truncating a document would produce a corrupt file with no indication anything was lost.
|
|
98
100
|
*/
|
|
99
|
-
const LARGE_RESULT_THRESHOLD_BYTES =
|
|
101
|
+
const LARGE_RESULT_THRESHOLD_BYTES = 5 * (BYTES_PER_KIBIBYTE * BYTES_PER_KIBIBYTE);
|
|
100
102
|
/**
|
|
101
103
|
* Resolves output bytes against the hybrid DocumentOutput shape: writes to `outputPath` and reports the path plus byte length when one is given, otherwise returns the bytes inline as base64 (flagged `large: true` above `LARGE_RESULT_THRESHOLD_BYTES`, never truncated or refused).
|
|
102
104
|
*/
|
|
@@ -318,6 +320,8 @@ const WritableFormatSchema = z.enum([
|
|
|
318
320
|
"pdf",
|
|
319
321
|
"markdown"
|
|
320
322
|
]);
|
|
323
|
+
/** The deepest heading level docx/odt support — HTML/ODF both cap heading nesting at h1-h6. */
|
|
324
|
+
const MAX_HEADING_LEVEL = 6;
|
|
321
325
|
const RunSchema = z.object({
|
|
322
326
|
text: z.string().optional().describe("The run's own text content."),
|
|
323
327
|
bold: z.boolean().optional(),
|
|
@@ -333,7 +337,7 @@ const RunSchema = z.object({
|
|
|
333
337
|
const ParagraphSchema = z.object({
|
|
334
338
|
text: z.string().optional().describe("Plain paragraph text, as a single run. Omit and use `runs` instead for mixed formatting within one paragraph."),
|
|
335
339
|
styleId: z.string().optional(),
|
|
336
|
-
headingLevel: z.number().int().min(1).max(
|
|
340
|
+
headingLevel: z.number().int().min(1).max(MAX_HEADING_LEVEL).optional().describe("docx/odt only."),
|
|
337
341
|
alignment: z.enum([
|
|
338
342
|
"left",
|
|
339
343
|
"center",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-operations",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.57",
|
|
4
4
|
"description": "The canonical set of document-conversion, editing, inspection, and .odb operations documents.js exposes — one Zod input/output schema and one transport-agnostic run() function per operation, shared by document-mcp, document-cli, and a REST API server rather than each defining its own copy.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
"license": "MIT",
|
|
83
83
|
"packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"document-compute.js": "1.6.
|
|
85
|
+
"document-compute.js": "1.6.5",
|
|
86
86
|
"document-outline.js": "3.10.2",
|
|
87
87
|
"document-schema.js": "7.15.0",
|
|
88
|
-
"documents.js": "14.3.
|
|
88
|
+
"documents.js": "14.3.4",
|
|
89
89
|
"zod": "4.4.3"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|