office-open 0.6.8 → 0.6.10
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 +134 -0
- package/dist/ai/index.d.mts +562 -38
- package/dist/ai/index.d.mts.map +1 -1
- package/dist/ai/index.mjs +2 -2
- package/dist/ai/index.mjs.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/schemas/index.d.mts +554 -38
- package/dist/schemas/index.d.mts.map +1 -1
- package/dist/schemas/index.mjs +1 -1
- package/dist/schemas-BhTmC2Jb.mjs +291 -0
- package/dist/schemas-BhTmC2Jb.mjs.map +1 -0
- package/package.json +9 -9
- package/dist/schemas-BbRmv4RW.mjs +0 -125
- package/dist/schemas-BbRmv4RW.mjs.map +0 -1
package/dist/ai/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/ai/index.ts"],"mappings":";cAQa,QAAA,eAAQ,IAAA;EAAA
|
|
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"}
|
package/dist/ai/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { generate } from "../generate.mjs";
|
|
2
|
-
import { a as docxSchema, i as pptxSchema, n as validateDocumentInput, r as xlsxSchema } from "../schemas-
|
|
2
|
+
import { a as docxSchema, i as pptxSchema, n as validateDocumentInput, r as xlsxSchema } from "../schemas-BhTmC2Jb.mjs";
|
|
3
3
|
import { tool } from "ai";
|
|
4
4
|
//#region src/ai/index.ts
|
|
5
5
|
const docxTool = tool({
|
|
@@ -31,7 +31,7 @@ const pptxTool = tool({
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
const xlsxTool = tool({
|
|
34
|
-
description: "Generate a .xlsx Excel spreadsheet. The input is the document options directly — must include a 'worksheets' array. Each worksheet has '
|
|
34
|
+
description: "Generate a .xlsx Excel spreadsheet. The input is the document options directly — must include a 'worksheets' array. Each worksheet has 'rows' — an array of row objects, each with 'cells'. Cell values: string, number, boolean. Use 'style' for formatting. Optional: columns, mergeCells, freezePanes, autoFilter, images, charts, dataValidations, conditionalFormats.",
|
|
35
35
|
inputSchema: xlsxSchema,
|
|
36
36
|
execute: async (options) => {
|
|
37
37
|
return {
|
package/dist/ai/index.mjs.map
CHANGED
|
@@ -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 '
|
|
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"}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { generateToFile, parseInput } from "./generate.mjs";
|
|
2
|
-
import { n as validateDocumentInput } from "./schemas-
|
|
2
|
+
import { n as validateDocumentInput } from "./schemas-BhTmC2Jb.mjs";
|
|
3
3
|
import { defineCommand, runMain } from "citty";
|
|
4
4
|
//#region src/cli.ts
|
|
5
5
|
function createConvertCommand(type, defaultExt) {
|