office-open 0.8.0 → 0.9.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.
package/README.md CHANGED
@@ -87,9 +87,9 @@ try {
87
87
  ### Import from Sub-Packages
88
88
 
89
89
  ```typescript
90
- import { Document, Packer } from "office-open/docx";
91
- import { Presentation, Packer } from "office-open/pptx";
92
- import { Workbook, Packer } from "office-open/xlsx";
90
+ import { generateDocument, parseDocument, patchDocument } from "office-open/docx";
91
+ import { generatePresentation, parsePresentation, patchPresentation } from "office-open/pptx";
92
+ import { generateWorkbook, parseWorkbook, patchWorkbook } from "office-open/xlsx";
93
93
  import { convertInchesToTwip } from "office-open/core";
94
94
  import { xml2js, js2xml } from "office-open/xml";
95
95
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/ai/index.ts"],"mappings":";cAQa,QAAA,eAAQ,IAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsBR,QAAA,eAAQ,IAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsBR,QAAA,eAAQ,IAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsBR,eAAA;EAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/ai/index.ts"],"mappings":";cAWa,QAAA,eAAQ,IAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsBR,QAAA,eAAQ,IAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsBR,QAAA,eAAQ,IAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsBR,eAAA;EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/ai/index.ts"],"sourcesContent":["import { tool } from \"ai\";\n\nimport { generate } from \"../generate\";\nimport { validateDocumentInput } from \"../schemas\";\nimport { docxSchema } from \"../schemas/docx\";\nimport { pptxSchema } from \"../schemas/pptx\";\nimport { xlsxSchema } from \"../schemas/xlsx\";\n\nexport const docxTool = tool({\n description:\n \"Generate a .docx Word document. \" +\n \"The input is the document options directly — must include a 'sections' array. \" +\n \"Each section has 'children' (paragraphs, tables, etc.). \" +\n \"Paragraphs use { paragraph: { children: [{ text: '...' }] }}, tables use { table: { rows: [...] } }. \" +\n \"Optional metadata: title, creator, subject, styles, numbering, comments, footnotes, endnotes, background, features.\",\n inputSchema: docxSchema,\n execute: async (options) => {\n const validated = validateDocumentInput(\"docx\", options);\n const base64 = (await generate({\n type: \"docx\",\n options: validated,\n outputType: \"base64\",\n })) as string;\n return {\n base64,\n mimeType: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n };\n },\n});\n\nexport const pptxTool = tool({\n description:\n \"Generate a .pptx PowerPoint presentation. \" +\n \"The input is the document options directly — must include a 'slides' array. \" +\n \"Each slide has 'children' (shapes, pictures, tables, charts, groups, etc.). \" +\n \"Shapes use { shape: { x, y, width, height, text?, fill?, ... } }. \" +\n \"Optional: size ('16:9' or '4:3' or { width, height }), title, creator, masters, show.\",\n inputSchema: pptxSchema,\n execute: async (options) => {\n const validated = validateDocumentInput(\"pptx\", options);\n const base64 = (await generate({\n type: \"pptx\",\n options: validated,\n outputType: \"base64\",\n })) as string;\n return {\n base64,\n mimeType: \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n };\n },\n});\n\nexport const xlsxTool = tool({\n description:\n \"Generate a .xlsx Excel spreadsheet. \" +\n \"The input is the document options directly — must include a 'worksheets' array. \" +\n \"Each worksheet has 'rows' — an array of row objects, each with 'cells'. \" +\n \"Cell values: string, number, boolean. Use 'style' for formatting. \" +\n \"Optional: columns, mergeCells, freezePanes, autoFilter, images, charts, dataValidations, conditionalFormats.\",\n inputSchema: xlsxSchema,\n execute: async (options) => {\n const validated = validateDocumentInput(\"xlsx\", options);\n const base64 = (await generate({\n type: \"xlsx\",\n options: validated,\n outputType: \"base64\",\n })) as string;\n return {\n base64,\n mimeType: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n };\n },\n});\n\nexport const officeOpenTools = {\n \"generate-docx\": docxTool,\n \"generate-pptx\": pptxTool,\n \"generate-xlsx\": xlsxTool,\n} as const;\n"],"mappings":";;;;AAQA,MAAa,WAAW,KAAK;CAC3B,aACE;CAKF,aAAa;CACb,SAAS,OAAO,YAAY;EAO1B,OAAO;GACL,QAAA,MANoB,SAAS;IAC7B,MAAM;IACN,SAHgB,sBAAsB,QAAQ,OAG7B;IACjB,YAAY;GACd,CAAC;GAGC,UAAU;EACZ;CACF;AACF,CAAC;AAED,MAAa,WAAW,KAAK;CAC3B,aACE;CAKF,aAAa;CACb,SAAS,OAAO,YAAY;EAO1B,OAAO;GACL,QAAA,MANoB,SAAS;IAC7B,MAAM;IACN,SAHgB,sBAAsB,QAAQ,OAG7B;IACjB,YAAY;GACd,CAAC;GAGC,UAAU;EACZ;CACF;AACF,CAAC;AAED,MAAa,WAAW,KAAK;CAC3B,aACE;CAKF,aAAa;CACb,SAAS,OAAO,YAAY;EAO1B,OAAO;GACL,QAAA,MANoB,SAAS;IAC7B,MAAM;IACN,SAHgB,sBAAsB,QAAQ,OAG7B;IACjB,YAAY;GACd,CAAC;GAGC,UAAU;EACZ;CACF;AACF,CAAC;AAED,MAAa,kBAAkB;CAC7B,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;AACnB"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/ai/index.ts"],"sourcesContent":["import type { DocumentOptions } from \"@office-open/docx\";\nimport type { PresentationOptions } from \"@office-open/pptx\";\nimport type { WorkbookOptions } from \"@office-open/xlsx\";\nimport { tool } from \"ai\";\n\nimport { generate } from \"../generate\";\nimport { validateDocumentInput } from \"../schemas\";\nimport { docxSchema } from \"../schemas/docx\";\nimport { pptxSchema } from \"../schemas/pptx\";\nimport { xlsxSchema } from \"../schemas/xlsx\";\n\nexport const docxTool = tool({\n description:\n \"Generate a .docx Word document. \" +\n \"The input is the document options directly — must include a 'sections' array. \" +\n \"Each section has 'children' (paragraphs, tables, etc.). \" +\n \"Paragraphs use { paragraph: { children: [{ text: '...' }] }}, tables use { table: { rows: [...] } }. \" +\n \"Optional metadata: title, creator, subject, styles, numbering, comments, footnotes, endnotes, background, features.\",\n inputSchema: docxSchema,\n execute: async (options) => {\n const validated = validateDocumentInput(\"docx\", options);\n const base64 = (await generate({\n type: \"docx\",\n options: validated as unknown as DocumentOptions,\n outputType: \"base64\",\n })) as string;\n return {\n base64,\n mimeType: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n };\n },\n});\n\nexport const pptxTool = tool({\n description:\n \"Generate a .pptx PowerPoint presentation. \" +\n \"The input is the document options directly — must include a 'slides' array. \" +\n \"Each slide has 'children' (shapes, pictures, tables, charts, groups, etc.). \" +\n \"Shapes use { shape: { x, y, width, height, text?, fill?, ... } }. \" +\n \"Optional: size ('16:9' or '4:3' or { width, height }), title, creator, masters, show.\",\n inputSchema: pptxSchema,\n execute: async (options) => {\n const validated = validateDocumentInput(\"pptx\", options);\n const base64 = (await generate({\n type: \"pptx\",\n options: validated as PresentationOptions,\n outputType: \"base64\",\n })) as string;\n return {\n base64,\n mimeType: \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n };\n },\n});\n\nexport const xlsxTool = tool({\n description:\n \"Generate a .xlsx Excel spreadsheet. \" +\n \"The input is the document options directly — must include a 'worksheets' array. \" +\n \"Each worksheet has 'rows' — an array of row objects, each with 'cells'. \" +\n \"Cell values: string, number, boolean. Use 'style' for formatting. \" +\n \"Optional: columns, mergeCells, freezePanes, autoFilter, images, charts, dataValidations, conditionalFormats.\",\n inputSchema: xlsxSchema,\n execute: async (options) => {\n const validated = validateDocumentInput(\"xlsx\", options);\n const base64 = (await generate({\n type: \"xlsx\",\n options: validated as WorkbookOptions,\n outputType: \"base64\",\n })) as string;\n return {\n base64,\n mimeType: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n };\n },\n});\n\nexport const officeOpenTools = {\n \"generate-docx\": docxTool,\n \"generate-pptx\": pptxTool,\n \"generate-xlsx\": xlsxTool,\n} as const;\n"],"mappings":";;;;AAWA,MAAa,WAAW,KAAK;CAC3B,aACE;CAKF,aAAa;CACb,SAAS,OAAO,YAAY;EAO1B,OAAO;GACL,QAAA,MANoB,SAAS;IAC7B,MAAM;IACN,SAHgB,sBAAsB,QAAQ,OAG7B;IACjB,YAAY;GACd,CAAC;GAGC,UAAU;EACZ;CACF;AACF,CAAC;AAED,MAAa,WAAW,KAAK;CAC3B,aACE;CAKF,aAAa;CACb,SAAS,OAAO,YAAY;EAO1B,OAAO;GACL,QAAA,MANoB,SAAS;IAC7B,MAAM;IACN,SAHgB,sBAAsB,QAAQ,OAG7B;IACjB,YAAY;GACd,CAAC;GAGC,UAAU;EACZ;CACF;AACF,CAAC;AAED,MAAa,WAAW,KAAK;CAC3B,aACE;CAKF,aAAa;CACb,SAAS,OAAO,YAAY;EAO1B,OAAO;GACL,QAAA,MANoB,SAAS;IAC7B,MAAM;IACN,SAHgB,sBAAsB,QAAQ,OAG7B;IACjB,YAAY;GACd,CAAC;GAGC,UAAU;EACZ;CACF;AACF,CAAC;AAED,MAAa,kBAAkB;CAC7B,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;AACnB"}
@@ -1,15 +1,23 @@
1
+ import { DocumentOptions } from "@office-open/docx";
2
+ import { PresentationOptions } from "@office-open/pptx";
3
+ import { WorkbookOptions } from "@office-open/xlsx";
1
4
  import { OutputType, OutputType as OutputType$1 } from "@office-open/core";
2
5
 
3
6
  //#region src/generate.d.ts
4
7
  type GenerateType = "docx" | "pptx" | "xlsx";
5
- interface GenerateOptions {
6
- readonly type: GenerateType;
7
- readonly options: Record<string, unknown>;
8
+ interface GenerateOptionsMap {
9
+ docx: DocumentOptions;
10
+ pptx: PresentationOptions;
11
+ xlsx: WorkbookOptions;
12
+ }
13
+ interface GenerateOptions<T extends GenerateType = GenerateType> {
14
+ readonly type: T;
15
+ readonly options: GenerateOptionsMap[T];
8
16
  readonly outputType?: OutputType$1;
9
17
  }
10
- declare function generate(options: GenerateOptions): Promise<unknown>;
18
+ declare function generate<T extends GenerateType>(options: GenerateOptions<T>): Promise<unknown>;
11
19
  declare function parseInput(input: string): Promise<Record<string, unknown>>;
12
20
  declare function generateToFile(outputPath: string, options: GenerateOptions): Promise<void>;
13
21
  //#endregion
14
- export { GenerateOptions, GenerateType, type OutputType, generate, generateToFile, parseInput };
22
+ export { GenerateOptions, GenerateOptionsMap, GenerateType, type OutputType, generate, generateToFile, parseInput };
15
23
  //# sourceMappingURL=generate.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.mts","names":[],"sources":["../src/generate.ts"],"mappings":";;;KAYY,YAAA;AAAA,UAEK,eAAA;EAAA,SACN,IAAA,EAAM,YAAA;EAAA,SACN,OAAA,EAAS,MAAA;EAAA,SACT,UAAA,GAAa,YAAA;AAAA;AAAA,iBAwBF,QAAA,CAAS,OAAA,EAAS,eAAA,GAAkB,OAAO;AAAA,iBAO3C,UAAA,CAAW,KAAA,WAAgB,OAAO,CAAC,MAAA;AAAA,iBASnC,cAAA,CAAe,UAAA,UAAoB,OAAA,EAAS,eAAA,GAAkB,OAAO"}
1
+ {"version":3,"file":"generate.d.mts","names":[],"sources":["../src/generate.ts"],"mappings":";;;;;;KAYY,YAAA;AAAA,UAGK,kBAAA;EACf,IAAA,EAAM,eAAA;EACN,IAAA,EAAM,mBAAA;EACN,IAAA,EAAM,eAAA;AAAA;AAAA,UAGS,eAAA,WAA0B,YAAA,GAAe,YAAA;EAAA,SAC/C,IAAA,EAAM,CAAA;EAAA,SACN,OAAA,EAAS,kBAAA,CAAmB,CAAA;EAAA,SAC5B,UAAA,GAAa,YAAA;AAAA;AAAA,iBAGF,QAAA,WAAmB,YAAA,EACvC,OAAA,EAAS,eAAA,CAAgB,CAAA,IACxB,OAAA;AAAA,iBAuBmB,UAAA,CAAW,KAAA,WAAgB,OAAO,CAAC,MAAA;AAAA,iBASnC,cAAA,CAAe,UAAA,UAAoB,OAAA,EAAS,eAAA,GAAkB,OAAO"}
package/dist/generate.mjs CHANGED
@@ -1,26 +1,16 @@
1
1
  import { readFile, writeFile } from "node:fs/promises";
2
- import { Document, Packer } from "@office-open/docx";
3
- import { Packer as Packer$1, Presentation } from "@office-open/pptx";
4
- import { Packer as Packer$2, Workbook } from "@office-open/xlsx";
2
+ import { generateDocument } from "@office-open/docx";
3
+ import { generatePresentation } from "@office-open/pptx";
4
+ import { generateWorkbook } from "@office-open/xlsx";
5
5
  //#region src/generate.ts
6
- const PACKERS = {
7
- docx: {
8
- newFile: (opts) => new Document(opts),
9
- pack: (file, type) => Packer.pack(file, type)
10
- },
11
- pptx: {
12
- newFile: (opts) => new Presentation(opts),
13
- pack: (file, type) => Packer$1.pack(file, type)
14
- },
15
- xlsx: {
16
- newFile: (opts) => new Workbook(opts),
17
- pack: (file, type) => Packer$2.pack(file, type)
18
- }
19
- };
20
6
  async function generate(options) {
21
7
  const { type, options: docOptions, outputType = "nodebuffer" } = options;
22
- const { newFile, pack } = PACKERS[type];
23
- return pack(newFile(docOptions), outputType);
8
+ const packerOpts = { type: outputType };
9
+ switch (type) {
10
+ case "docx": return generateDocument(docOptions, packerOpts);
11
+ case "pptx": return generatePresentation(docOptions, packerOpts);
12
+ case "xlsx": return generateWorkbook(docOptions, packerOpts);
13
+ }
24
14
  }
25
15
  async function parseInput(input) {
26
16
  const trimmed = input.trim();
@@ -1 +1 @@
1
- {"version":3,"file":"generate.mjs","names":["DocxPacker","PptxPacker","XlsxPacker"],"sources":["../src/generate.ts"],"sourcesContent":["import { readFile, writeFile } from \"node:fs/promises\";\n\nimport type { OutputType } from \"@office-open/core\";\nexport { type OutputType } from \"@office-open/core\";\n\nimport { Document, Packer as DocxPacker } from \"@office-open/docx\";\nimport type { PropertiesOptions } from \"@office-open/docx\";\nimport { Presentation, Packer as PptxPacker } from \"@office-open/pptx\";\nimport type { PresentationOptions } from \"@office-open/pptx\";\nimport { Workbook, Packer as XlsxPacker } from \"@office-open/xlsx\";\nimport type { WorkbookOptions } from \"@office-open/xlsx\";\n\nexport type GenerateType = \"docx\" | \"pptx\" | \"xlsx\";\n\nexport interface GenerateOptions {\n readonly type: GenerateType;\n readonly options: Record<string, unknown>;\n readonly outputType?: OutputType;\n}\n\nconst PACKERS = {\n docx: {\n newFile: (opts: unknown) => new Document(opts as unknown as PropertiesOptions),\n pack: (file: unknown, type: OutputType) => DocxPacker.pack(file as Document, type),\n },\n pptx: {\n newFile: (opts: unknown) => new Presentation(opts as unknown as PresentationOptions),\n pack: (file: unknown, type: OutputType) => PptxPacker.pack(file as Presentation, type),\n },\n xlsx: {\n newFile: (opts: unknown) => new Workbook(opts as unknown as WorkbookOptions),\n pack: (file: unknown, type: OutputType) => XlsxPacker.pack(file as Workbook, type),\n },\n} as const satisfies Record<\n GenerateType,\n {\n newFile: (opts: unknown) => unknown;\n pack: (file: unknown, type: OutputType) => Promise<unknown>;\n }\n>;\n\nexport async function generate(options: GenerateOptions): Promise<unknown> {\n const { type, options: docOptions, outputType = \"nodebuffer\" as OutputType } = options;\n const { newFile, pack } = PACKERS[type];\n const file = newFile(docOptions);\n return pack(file, outputType);\n}\n\nexport async function parseInput(input: string): Promise<Record<string, unknown>> {\n const trimmed = input.trim();\n if (trimmed.startsWith(\"{\") || trimmed.startsWith(\"[\")) {\n return JSON.parse(trimmed) as Record<string, unknown>;\n }\n const content = await readFile(trimmed, \"utf-8\");\n return JSON.parse(content) as Record<string, unknown>;\n}\n\nexport async function generateToFile(outputPath: string, options: GenerateOptions): Promise<void> {\n const buffer = (await generate({ ...options, outputType: \"nodebuffer\" })) as Buffer;\n await writeFile(outputPath, buffer);\n}\n"],"mappings":";;;;;AAoBA,MAAM,UAAU;CACd,MAAM;EACJ,UAAU,SAAkB,IAAI,SAAS,IAAoC;EAC7E,OAAO,MAAe,SAAqBA,OAAW,KAAK,MAAkB,IAAI;CACnF;CACA,MAAM;EACJ,UAAU,SAAkB,IAAI,aAAa,IAAsC;EACnF,OAAO,MAAe,SAAqBC,SAAW,KAAK,MAAsB,IAAI;CACvF;CACA,MAAM;EACJ,UAAU,SAAkB,IAAI,SAAS,IAAkC;EAC3E,OAAO,MAAe,SAAqBC,SAAW,KAAK,MAAkB,IAAI;CACnF;AACF;AAQA,eAAsB,SAAS,SAA4C;CACzE,MAAM,EAAE,MAAM,SAAS,YAAY,aAAa,iBAA+B;CAC/E,MAAM,EAAE,SAAS,SAAS,QAAQ;CAElC,OAAO,KADM,QAAQ,UACN,GAAG,UAAU;AAC9B;AAEA,eAAsB,WAAW,OAAiD;CAChF,MAAM,UAAU,MAAM,KAAK;CAC3B,IAAI,QAAQ,WAAW,GAAG,KAAK,QAAQ,WAAW,GAAG,GACnD,OAAO,KAAK,MAAM,OAAO;CAE3B,MAAM,UAAU,MAAM,SAAS,SAAS,OAAO;CAC/C,OAAO,KAAK,MAAM,OAAO;AAC3B;AAEA,eAAsB,eAAe,YAAoB,SAAyC;CAEhG,MAAM,UAAU,YAAY,MADN,SAAS;EAAE,GAAG;EAAS,YAAY;CAAa,CAAC,CACrC;AACpC"}
1
+ {"version":3,"file":"generate.mjs","names":[],"sources":["../src/generate.ts"],"sourcesContent":["import { readFile, writeFile } from \"node:fs/promises\";\n\nimport type { OutputType, PackerOptions } from \"@office-open/core\";\nexport { type OutputType } from \"@office-open/core\";\n\nimport { generateDocument } from \"@office-open/docx\";\nimport type { DocumentOptions } from \"@office-open/docx\";\nimport { generatePresentation } from \"@office-open/pptx\";\nimport type { PresentationOptions } from \"@office-open/pptx\";\nimport { generateWorkbook } from \"@office-open/xlsx\";\nimport type { WorkbookOptions } from \"@office-open/xlsx\";\n\nexport type GenerateType = \"docx\" | \"pptx\" | \"xlsx\";\n\n/** Map from type string to the corresponding options type. */\nexport interface GenerateOptionsMap {\n docx: DocumentOptions;\n pptx: PresentationOptions;\n xlsx: WorkbookOptions;\n}\n\nexport interface GenerateOptions<T extends GenerateType = GenerateType> {\n readonly type: T;\n readonly options: GenerateOptionsMap[T];\n readonly outputType?: OutputType;\n}\n\nexport async function generate<T extends GenerateType>(\n options: GenerateOptions<T>,\n): Promise<unknown> {\n const { type, options: docOptions, outputType = \"nodebuffer\" as OutputType } = options;\n const packerOpts = { type: outputType } as PackerOptions<OutputType>;\n\n switch (type) {\n case \"docx\":\n return generateDocument(\n docOptions as DocumentOptions,\n packerOpts as PackerOptions<\"nodebuffer\">,\n );\n case \"pptx\":\n return generatePresentation(\n docOptions as PresentationOptions,\n packerOpts as PackerOptions<\"nodebuffer\">,\n );\n case \"xlsx\":\n return generateWorkbook(\n docOptions as WorkbookOptions,\n packerOpts as PackerOptions<\"nodebuffer\">,\n );\n }\n}\n\nexport async function parseInput(input: string): Promise<Record<string, unknown>> {\n const trimmed = input.trim();\n if (trimmed.startsWith(\"{\") || trimmed.startsWith(\"[\")) {\n return JSON.parse(trimmed) as Record<string, unknown>;\n }\n const content = await readFile(trimmed, \"utf-8\");\n return JSON.parse(content) as Record<string, unknown>;\n}\n\nexport async function generateToFile(outputPath: string, options: GenerateOptions): Promise<void> {\n const buffer = (await generate({ ...options, outputType: \"nodebuffer\" })) as Buffer;\n await writeFile(outputPath, buffer);\n}\n"],"mappings":";;;;;AA2BA,eAAsB,SACpB,SACkB;CAClB,MAAM,EAAE,MAAM,SAAS,YAAY,aAAa,iBAA+B;CAC/E,MAAM,aAAa,EAAE,MAAM,WAAW;CAEtC,QAAQ,MAAR;EACE,KAAK,QACH,OAAO,iBACL,YACA,UACF;EACF,KAAK,QACH,OAAO,qBACL,YACA,UACF;EACF,KAAK,QACH,OAAO,iBACL,YACA,UACF;CACJ;AACF;AAEA,eAAsB,WAAW,OAAiD;CAChF,MAAM,UAAU,MAAM,KAAK;CAC3B,IAAI,QAAQ,WAAW,GAAG,KAAK,QAAQ,WAAW,GAAG,GACnD,OAAO,KAAK,MAAM,OAAO;CAE3B,MAAM,UAAU,MAAM,SAAS,SAAS,OAAO;CAC/C,OAAO,KAAK,MAAM,OAAO;AAC3B;AAEA,eAAsB,eAAe,YAAoB,SAAyC;CAEhG,MAAM,UAAU,YAAY,MADN,SAAS;EAAE,GAAG;EAAS,YAAY;CAAa,CAAC,CACrC;AACpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "office-open",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Unified Office document toolkit — CLI, AI SDK tools, Zod schemas, and all packages in one install",
5
5
  "keywords": [
6
6
  "ai",
@@ -21,7 +21,7 @@
21
21
  "author": {
22
22
  "name": "Demo Macro",
23
23
  "email": "abc@imst.xyz",
24
- "url": "https://imst.xyz/"
24
+ "url": "https://www.demomacro.com/"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",
@@ -77,11 +77,11 @@
77
77
  "dependencies": {
78
78
  "citty": "0.2.2",
79
79
  "zod": "4.4.3",
80
- "@office-open/core": "0.8.0",
81
- "@office-open/pptx": "0.8.0",
82
- "@office-open/xlsx": "0.8.0",
83
- "@office-open/docx": "0.8.0",
84
- "@office-open/xml": "0.8.0"
80
+ "@office-open/docx": "0.9.0",
81
+ "@office-open/core": "0.9.0",
82
+ "@office-open/xlsx": "0.9.0",
83
+ "@office-open/pptx": "0.9.0",
84
+ "@office-open/xml": "0.9.0"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "ai": "^6.0.0"