office-open 0.10.15 → 0.11.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
@@ -4,14 +4,14 @@
4
4
  ![npm downloads](https://img.shields.io/npm/dw/office-open)
5
5
  ![npm license](https://img.shields.io/npm/l/office-open)
6
6
 
7
- > Umbrella package for Office Open XMLall packages, CLI, AI SDK tools, and Zod schemas in one install.
7
+ > Everything for AI-native Office documents in one install Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) generation from JSON, plus a CLI, Vercel AI SDK tools, and frozen JSON Schemas for LLM tool-calling.
8
8
 
9
9
  ## Features
10
10
 
11
- - **Unified Re-exports** — Import from `office-open/docx`, `office-open/pptx`, `office-open/xlsx`
11
+ - **One Install** — Import from `office-open/docx`, `office-open/pptx`, `office-open/xlsx`; no Microsoft Office required
12
+ - **AI SDK Tools** — Vercel AI SDK compatible tools for `generate-docx`, `generate-pptx`, `generate-xlsx`, ready for AI agents and chatbots
13
+ - **JSON Schemas** — Draft-07 input validation for all document types, with on-demand schema slicing for LLM context budgets
12
14
  - **CLI** — Generate files from JSON via `npx office-open`
13
- - **AI SDK Tools** — Vercel AI SDK compatible tools for `generate-docx`, `generate-pptx`, `generate-xlsx`
14
- - **Zod Schemas** — Input validation for all document types
15
15
  - **Generate Function** — Type-agnostic `generate()` for dynamic document creation
16
16
 
17
17
  ## Installation
@@ -57,6 +57,11 @@ const buffer = await generate({
57
57
  npx office-open docx document.json "output.docx"
58
58
  npx office-open pptx slides.json "output.pptx"
59
59
  npx office-open xlsx spreadsheet.json "output.xlsx"
60
+
61
+ # Consult the JSON schemas (for AI agents and humans)
62
+ npx office-open schema index docx # indexed lookup entries by domain
63
+ npx office-open schema index docx --all # every definition name
64
+ npx office-open schema slice docx ParagraphOptions RunOptions # sub-schema for those types
60
65
  ```
61
66
 
62
67
  ### AI SDK Tools
@@ -72,16 +77,31 @@ const result = await generateText({
72
77
  });
73
78
  ```
74
79
 
75
- ### Zod Schemas
80
+ The generate tools carry skeleton input schemas (top-level shape + wrapper keys, ~5K tokens instead of the ~170K-token full schema); the `office-open-schema-lookup` tool fetches precise option schemas on demand.
81
+
82
+ Two more agent entry points live on the documentation site:
83
+
84
+ ```bash
85
+ # MCP server for Claude Code, Cursor, and other MCP clients
86
+ claude mcp add --transport http office-open https://www.office-open.com/mcp
87
+
88
+ # Installable Agent Skill with curated API references
89
+ npx skills add https://www.office-open.com
90
+ ```
91
+
92
+ ### JSON Schemas
76
93
 
77
94
  ```typescript
78
- import { validateDocumentInput } from "office-open/schemas";
95
+ import { validateDocumentInput, sliceDocumentSchema } from "office-open/schemas";
79
96
 
80
97
  try {
81
98
  const validated = validateDocumentInput("docx", userInput);
82
99
  } catch (e) {
83
- // Structured validation error with path and message
100
+ // Aggregated validation errors with instance paths and messages
84
101
  }
102
+
103
+ // Extract the dependency closure of specific option types
104
+ const slice = sliceDocumentSchema("docx", ["ParagraphOptions", "RunOptions"]);
85
105
  ```
86
106
 
87
107
  ### Import from Sub-Packages
@@ -91,7 +111,7 @@ import { generateDocument, parseDocument, patchDocument } from "office-open/docx
91
111
  import { generatePresentation, parsePresentation, patchPresentation } from "office-open/pptx";
92
112
  import { generateWorkbook, parseWorkbook, patchWorkbook } from "office-open/xlsx";
93
113
  import { convertInchesToTwip } from "office-open/core";
94
- import { xml2js, js2xml } from "office-open/xml";
114
+ import { parse, stringify } from "office-open/xml";
95
115
  ```
96
116
 
97
117
  ## Sub-Exports
@@ -106,7 +126,7 @@ import { xml2js, js2xml } from "office-open/xml";
106
126
  | `office-open/xml` | @office-open/xml |
107
127
  | `office-open/generate` | `generate()` function |
108
128
  | `office-open/ai` | Vercel AI SDK tools |
109
- | `office-open/schemas` | Zod validation schemas |
129
+ | `office-open/schemas` | JSON schemas, validation, and slicing |
110
130
 
111
131
  ## JSON Document Structures
112
132