pptx-viewer-mcp 2.0.1 → 2.1.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/CHANGELOG.md CHANGED
@@ -4,6 +4,22 @@ All notable changes to this project are documented here.
4
4
  This file is generated from [Conventional Commits](https://www.conventionalcommits.org)
5
5
  by [git-cliff](https://git-cliff.org); do not edit it by hand.
6
6
 
7
+ ## [2.0.2](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-mcp@2.0.2) - 2026-07-27
8
+
9
+ ### Bug Fixes
10
+
11
+ - **ci:** Resolve workspace: ranges in every published manifest (by @ChristopherVR) ([ea35290](https://github.com/ChristopherVR/pptx-viewer/commit/ea35290721ba679571f71708933ed718e65e3942))
12
+
13
+ ## [2.0.1](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-mcp@2.0.1) - 2026-07-25
14
+
15
+ ### Bug Fixes
16
+
17
+ - **tools:** Resolve pptx-viewer-core to the workspace copy (by @ChristopherVR) ([1d4e3ff](https://github.com/ChristopherVR/pptx-viewer/commit/1d4e3ff00694d12606245de7726210d675d713f6))
18
+
19
+ ### Chores
20
+
21
+ - **deps-dev:** Update tsdown requirement ([#109](https://github.com/ChristopherVR/pptx-viewer/issues/109)) (by @dependabot[bot]) ([f83aa0a](https://github.com/ChristopherVR/pptx-viewer/commit/f83aa0a0012d9678cb1fcbef3bbf45b04f179755))
22
+
7
23
  ## [2.0.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-mcp@2.0.0) - 2026-07-23
8
24
 
9
25
  ### Documentation
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm](https://img.shields.io/npm/v/pptx-viewer-mcp.svg)](https://www.npmjs.com/package/pptx-viewer-mcp)
4
4
  [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
5
5
 
6
- Edit PowerPoint files from an AI agent. It ships a ready-to-run [MCP](https://modelcontextprotocol.io) server that gives an agent 51 PowerPoint editing tools (for example "add a slide" or "replace text"). The same tools are also available as plain functions you can call yourself, along with their Zod input schemas and a codec for real-time collaboration (Y.Doc). The [`pptx-viewer-core`](https://www.npmjs.com/package/pptx-viewer-core) engine is bundled in, so a single install gives you everything and you never install the core separately.
6
+ Edit PowerPoint files from an AI agent. It ships a ready-to-run [MCP](https://modelcontextprotocol.io) server that gives an agent 54 PowerPoint editing tools (for example "add a slide" or "replace text"). The same tools are also available as plain functions you can call yourself, along with their Zod input schemas and a codec for real-time collaboration (Y.Doc). The [`pptx-viewer-core`](https://www.npmjs.com/package/pptx-viewer-core) engine is bundled in, so a single install gives you everything and you never install the core separately.
7
7
 
8
8
  ![An AI agent calling validated MCP tools to edit and save a PowerPoint file](https://raw.githubusercontent.com/ChristopherVR/pptx-viewer/main/.github/assets/packages/mcp-tools.svg)
9
9
 
@@ -31,7 +31,7 @@ No clone, no build, no separate core install. Point your MCP client at the publi
31
31
 
32
32
  That is the entire setup. `npx` downloads `pptx-viewer-mcp` and its bundled `pptx-viewer-core` engine on first run, so there is nothing else to install. Add the config above, restart your client, and the tools are available.
33
33
 
34
- This works in Claude Desktop, Claude Code, Cursor, and any MCP-compatible client. All 51 tools are exposed over stdio in snake_case (for example `add_slide`, `batch_update_elements`). Every tool takes a `filePath` argument and the server handles load and save internally. File access is scoped to a root directory (`PPTX_TOOLS_ROOT`, defaulting to the process working directory) and restricted to `.pptx` and `.ppt` files.
34
+ This works in Claude Desktop, Claude Code, Cursor, and any MCP-compatible client. All 54 tools are exposed over stdio in snake_case (for example `add_slide`, `batch_update_elements`). Every tool takes a `filePath` argument and the server handles load and save internally. File access is scoped to a root directory (`PPTX_TOOLS_ROOT`, defaulting to the process working directory) and restricted to `.pptx` and `.ppt` files.
35
35
 
36
36
  > If you prefer a global install (`npm i -g pptx-viewer-mcp`), the same server is available as the `pptx-tools` binary. Point `command` at `pptx-tools` with no args.
37
37
 
@@ -73,7 +73,7 @@ See [Use as a library](#use-as-a-library) below for the higher-level `executeToo
73
73
 
74
74
  | Entry point | Contents |
75
75
  | ------------------------- | ----------------------------------------------------------------------------------------------------- |
76
- | `pptx-viewer-mcp` | 51 tool functions, the `PptxHandler` engine, provider types, and the execution pipeline |
76
+ | `pptx-viewer-mcp` | 54 tool functions, the `PptxHandler` engine, provider types, and the execution pipeline |
77
77
  | `pptx-viewer-mcp/schemas` | Zod schemas for every tool input |
78
78
  | `pptx-viewer-mcp/codec` | `PptxCodec`, the Y.Doc to PPTX bytes codec |
79
79
  | `pptx-viewer-mcp/mcp` | The runnable stdio server entry (what `npx pptx-viewer-mcp` executes); importing it starts the server |
@@ -95,7 +95,7 @@ See [Use as a library](#use-as-a-library) below for the higher-level `executeToo
95
95
  | Sections & hyperlinks (2) | `manageSections` `manageHyperlinks` |
96
96
  | Geometry & locking (2) | `replaceGeometry` `setElementLock` |
97
97
  | Validation (2) | `validatePresentation` `repairPresentation` |
98
- | Export & conversion (3) | `convertToMarkdown` `exportToSvg` `exportSlideSvg` |
98
+ | Export & conversion (5) | `convertToMarkdown` `exportToSvg` `exportSlideSvg` `exportToJson` `importFromJson` |
99
99
 
100
100
  ## Use as a library
101
101
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Doc } from "yjs";
2
- import { ChartAxisEdit, PptxAppProperties, PptxCoreProperties, PptxCustomProperty, PptxData, PptxData as PptxData$1, PptxData as PptxData$2, PptxElement, PptxElement as PptxElement$1, PptxHandler, PptxPresentationProperties, PptxSlide, PptxSlide as PptxSlide$1, PptxThemeColorScheme, PptxThemeFontScheme, PresentationDiff, ShapeStyle } from "pptx-viewer-core";
2
+ import { ChartAxisEdit, PptxAppProperties, PptxCoreProperties, PptxCustomProperty, PptxData, PptxData as PptxData$1, PptxData as PptxData$2, PptxElement, PptxElement as PptxElement$1, PptxHandler, PptxJsonAssetStats, PptxPresentationProperties, PptxSlide, PptxSlide as PptxSlide$1, PptxThemeColorScheme, PptxThemeFontScheme, PresentationDiff, ShapeStyle } from "pptx-viewer-core";
3
3
  //#region src/types.d.ts
4
4
  /**
5
5
  * Platform-agnostic context passed to every tool function.
@@ -252,6 +252,16 @@ interface UpdateElementParams {
252
252
  declare function updateElement(ctx: ToolContext, params: UpdateElementParams): ToolResult<{
253
253
  elementId: string;
254
254
  }>;
255
+ interface RenameElementParams {
256
+ slideIndex: number;
257
+ elementId: string;
258
+ /** New element name (`cNvPr/@name`); an empty string clears the name. */
259
+ name: string;
260
+ }
261
+ declare function renameElement(ctx: ToolContext, params: RenameElementParams): ToolResult<{
262
+ elementId: string;
263
+ name: string;
264
+ }>;
255
265
  interface DeleteElementsParams {
256
266
  slideIndex: number;
257
267
  elementIds: string[];
@@ -760,6 +770,43 @@ interface ExportSlideSvgResult {
760
770
  }
761
771
  declare function exportSlideSvg(ctx: ToolContext, params: ExportSlideSvgParams): ToolResult<ExportSlideSvgResult>;
762
772
  //#endregion
773
+ //#region src/tools/json-tools.d.ts
774
+ interface ExportToJsonParams {
775
+ /** Pretty-print with 2-space indentation. Default `true`. */
776
+ pretty?: boolean;
777
+ }
778
+ interface ExportToJsonResult {
779
+ /** The serialized `pptx-viewer-json` document text. */
780
+ json: string;
781
+ slideCount: number;
782
+ /** UTF-8 byte size of the serialized document. */
783
+ byteSize: number;
784
+ /** Embedded binary-asset accounting (count + decoded bytes). */
785
+ assets: PptxJsonAssetStats;
786
+ }
787
+ /**
788
+ * Serialize the presentation to the portable, self-contained
789
+ * `pptx-viewer-json` document format (binary assets embedded as base64).
790
+ */
791
+ declare function exportToJson(ctx: ToolContext, params: ExportToJsonParams): ToolResult<ExportToJsonResult>;
792
+ interface ImportFromJsonParams {
793
+ /** The `pptx-viewer-json` document text to import. */
794
+ json: string;
795
+ }
796
+ interface ImportFromJsonResult {
797
+ slideCount: number;
798
+ width: number;
799
+ height: number;
800
+ }
801
+ /**
802
+ * Replace the presentation content with a deck imported from a
803
+ * `pptx-viewer-json` document: every presentation-level field the document
804
+ * defines wins, and the slide array is replaced wholesale. The context's
805
+ * `pptxData` object is mutated in place so hosts holding a reference (viewer
806
+ * bridges, the save pipeline) observe the imported deck.
807
+ */
808
+ declare function importFromJson(ctx: ToolContext, params: ImportFromJsonParams): ToolResult<ImportFromJsonResult>;
809
+ //#endregion
763
810
  //#region src/tools/hyperlink-tools.d.ts
764
811
  interface ManageHyperlinksParams {
765
812
  slideIndex: number;
@@ -894,5 +941,5 @@ interface ApplyLayoutResult {
894
941
  }
895
942
  declare function applyLayout(ctx: ToolContext, params: ApplyLayoutParams): ToolResult<ApplyLayoutResult>;
896
943
  //#endregion
897
- export { type AccessibilityCheckResult, type AccessibilityIssue, type AddChartSeriesParams, type AddElementParams, type AddElementResult, type AddSlideParams, type AddSlideResult, type ApplyLayoutParams, type ApplyLayoutResult, type ApplyTemplateParams, type ApplyTemplateResult, type ApplyThemePresetParams, type ApplyThemePresetResult, type ArrangeElementsParams, type BatchUpdateElementsParams, type CloneElementParams, type CloneElementResult, type CollaborationProvider, type CommentInfo, type ConvertToMarkdownParams, type ConvertToMarkdownResult, type CreateChartParams, type CreateChartResult, type DeleteElementsParams, type DeleteSlidesParams, type DeleteSlidesResult, type DiffPresentationsParams, type DuplicateSlideParams, type ExecutionContext, type ExportSlideSvgParams, type ExportSlideSvgResult, type ExportToSvgParams, type ExportToSvgResult, type FileSystemProvider, type FindPlaceholdersResult, type FindTextParams, type FindTextResult, type GetLayoutsResult, type GetSlideResult, type GroupElementsParams, type GroupElementsResult, type HyperlinkInfo, type LayoutInfo, type ManageCommentsParams, type ManageCommentsResult, type ManageHyperlinksParams, type ManageHyperlinksResult, type ManageSectionsParams, type ManageSectionsResult, type ManageSmartArtParams, type ManageSmartArtResult, type ManageTableStructureParams, type MergePresentationParams, type MergePresentationResult, type MetadataResult, type PptxData, type PptxElement, PptxHandler, type PptxSlide, type RemoveChartSeriesParams, type ReorderSlidesParams, type RepairPresentationResult, type ReplaceGeometryParams, type ReplaceTextParams, type ReplaceTextResult, type SectionInfo, type SetCanvasSizeParams, type SetElementAnimationParams, type SetElementLockParams, type SetSlideTransitionParams, type SmartArtNodeInfo, type TextMatch, type ThemeInfo, type ToolContext, type ToolResult, type UngroupElementsParams, type UngroupElementsResult, type UpdateChartParams, type UpdateChartSeriesDataParams, type UpdateElementParams, type UpdateElementStyleParams, type UpdateMetadataParams, type UpdatePresentationPropertiesParams, type UpdateSlidePropertiesParams, type UpdateTableCellsParams, type UpdateThemeColorsParams, type UpdateThemeFontsParams, type ValidatePresentationResult, type ViewerProvider, addChartSeriesT, addElement, addSlide, applyLayout, applyTemplateT, applyThemePreset, arrangeElements, batchUpdateElements, cloneElement, convertToMarkdown, createChart, deleteElements, deleteSlides, describeElement, diffPresentationsT, duplicateSlide, executeToolWithContext, exportSlideSvg, exportToSvg, extractSlideText, findPlaceholdersT, findText, generateElementId, generateSlideId, getLayouts, getMetadata, getPresentationProperties, getSlide, getThemeInfo, groupElements, loadPresentation, manageComments, manageHyperlinks, manageSections, manageSmartArt, manageTableStructure, mergePresentationT, removeChartSeriesT, reorderSlides, repairPresentation, replaceGeometry, replaceText, runAccessibilityCheck, savePresentation, setCanvasSize, setElementAnimation, setElementLockT, setSlideTransition, ungroupElements, updateChart, updateChartSeriesData, updateElement, updateElementStyle, updateMetadata, updatePresentationProperties, updateSlideProperties, updateTableCells, updateThemeColors, updateThemeFonts, validatePresentation, validateSlideIndex };
944
+ export { type AccessibilityCheckResult, type AccessibilityIssue, type AddChartSeriesParams, type AddElementParams, type AddElementResult, type AddSlideParams, type AddSlideResult, type ApplyLayoutParams, type ApplyLayoutResult, type ApplyTemplateParams, type ApplyTemplateResult, type ApplyThemePresetParams, type ApplyThemePresetResult, type ArrangeElementsParams, type BatchUpdateElementsParams, type CloneElementParams, type CloneElementResult, type CollaborationProvider, type CommentInfo, type ConvertToMarkdownParams, type ConvertToMarkdownResult, type CreateChartParams, type CreateChartResult, type DeleteElementsParams, type DeleteSlidesParams, type DeleteSlidesResult, type DiffPresentationsParams, type DuplicateSlideParams, type ExecutionContext, type ExportSlideSvgParams, type ExportSlideSvgResult, type ExportToJsonParams, type ExportToJsonResult, type ExportToSvgParams, type ExportToSvgResult, type FileSystemProvider, type FindPlaceholdersResult, type FindTextParams, type FindTextResult, type GetLayoutsResult, type GetSlideResult, type GroupElementsParams, type GroupElementsResult, type HyperlinkInfo, type ImportFromJsonParams, type ImportFromJsonResult, type LayoutInfo, type ManageCommentsParams, type ManageCommentsResult, type ManageHyperlinksParams, type ManageHyperlinksResult, type ManageSectionsParams, type ManageSectionsResult, type ManageSmartArtParams, type ManageSmartArtResult, type ManageTableStructureParams, type MergePresentationParams, type MergePresentationResult, type MetadataResult, type PptxData, type PptxElement, PptxHandler, type PptxSlide, type RemoveChartSeriesParams, type RenameElementParams, type ReorderSlidesParams, type RepairPresentationResult, type ReplaceGeometryParams, type ReplaceTextParams, type ReplaceTextResult, type SectionInfo, type SetCanvasSizeParams, type SetElementAnimationParams, type SetElementLockParams, type SetSlideTransitionParams, type SmartArtNodeInfo, type TextMatch, type ThemeInfo, type ToolContext, type ToolResult, type UngroupElementsParams, type UngroupElementsResult, type UpdateChartParams, type UpdateChartSeriesDataParams, type UpdateElementParams, type UpdateElementStyleParams, type UpdateMetadataParams, type UpdatePresentationPropertiesParams, type UpdateSlidePropertiesParams, type UpdateTableCellsParams, type UpdateThemeColorsParams, type UpdateThemeFontsParams, type ValidatePresentationResult, type ViewerProvider, addChartSeriesT, addElement, addSlide, applyLayout, applyTemplateT, applyThemePreset, arrangeElements, batchUpdateElements, cloneElement, convertToMarkdown, createChart, deleteElements, deleteSlides, describeElement, diffPresentationsT, duplicateSlide, executeToolWithContext, exportSlideSvg, exportToJson, exportToSvg, extractSlideText, findPlaceholdersT, findText, generateElementId, generateSlideId, getLayouts, getMetadata, getPresentationProperties, getSlide, getThemeInfo, groupElements, importFromJson, loadPresentation, manageComments, manageHyperlinks, manageSections, manageSmartArt, manageTableStructure, mergePresentationT, removeChartSeriesT, renameElement, reorderSlides, repairPresentation, replaceGeometry, replaceText, runAccessibilityCheck, savePresentation, setCanvasSize, setElementAnimation, setElementLockT, setSlideTransition, ungroupElements, updateChart, updateChartSeriesData, updateElement, updateElementStyle, updateMetadata, updatePresentationProperties, updateSlideProperties, updateTableCells, updateThemeColors, updateThemeFonts, validatePresentation, validateSlideIndex };
898
945
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/execution.ts","../src/tools/slide-tools.ts","../src/tools/helpers.ts","../src/tools/element-tools.ts","../src/tools/table-tools.ts","../src/tools/style-tools.ts","../src/tools/content-tools.ts","../src/tools/conversion-tools.ts","../src/tools/theme-tools.ts","../src/tools/chart-tools.ts","../src/tools/smartart-tools.ts","../src/tools/merge-tools.ts","../src/tools/template-tools.ts","../src/tools/metadata-tools.ts","../src/tools/section-tools.ts","../src/tools/export-tools.ts","../src/tools/hyperlink-tools.ts","../src/tools/geometry-tools.ts","../src/tools/lock-tools.ts","../src/tools/validation-tools.ts","../src/tools/presentation-tools.ts","../src/tools/layout-tools.ts"],"mappings":";;;;;;;UAOiB;;EAEhB,UAAU;;EAEV,gBAAgB,iBAAiB,QAAQ;;EAEzC,gBAAgB,iBAAiB,QAAQ;;;;;;UAOzB,WAAW;;EAE3B,UAAU;;EAEV,QAAQ;;EAER;;;;;;UAWgB;;EAEhB,QAAQ;IAAqB,MAAM;;;EAEnC,SAAS;IACR,QAAQ,MAAM,KAAM,OAAO,YAAY,kBAAkB;IACzD,UAAU,MAAM,MAAO,QAAQ;;;EAGhC,YAAY;;;;;;;UAQI;EAChB,SAAS,eAAe,QAAQ;EAChC,UAAU,cAAc,MAAM,aAAa;;;;;;UAO3B;EAChB,eACC,kBACA,OAAO,YACP;IAAW;IAAoB;;EAEhC,SAAS,mBAAmB;;;;;UAMZ;;EAEhB,YAAY;;EAEZ,gBAAgB;;EAEhB,SAAS;;EAET;;;;;;;;;iBCvEqB,iBACrB,kBACA,SAAS,mBACP;EAAU,UA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;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,cACf,KAAK,aACL,QAAQ,sBACN;EAAa;;UA8GC;EAChB;EACA;;iBAGe,eACf,KAAK,aACL,QAAQ,uBACN;EAAa;;UA0BC;EAChB;EACA;EAEA;EACA;EAEA;EACA;;iBAGe,gBACf,KAAK,aACL,QAAQ,wBACN;EAAa;;UA6GC;EAChB;EACA;EACA;EACA;EACA;;UAGgB;EAChB;;iBAGe,aACf,KAAK,aACL,QAAQ,qBACN,WAAW;UAuCG;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,oBACf,KAAK,aACL,QAAQ,4BACN;EAAa;;UAsDC;EAChB;EACA;;UAGgB;EAChB;;iBAGe,cACf,KAAK,aACL,QAAQ,sBACN,WAAW;UAyDG;EAChB;EACA;;UAGgB;EAChB;;iBAGe,gBACf,KAAK,aACL,QAAQ,wBACN,WAAW;UAqCG;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,oBACf,KAAK,aACL,QAAQ,4BACN;EAAa;;;;UC7vBC;EAChB;EACA;EACA,OAAO;IAAQ;IAAa;IAAa;;;iBAG1B,iBACf,KAAK,aACL,QAAQ,yBACN;EAAa;;UA6CC;EAChB;EACA;EACA;EACA;EACA;EACA;;iBAGe,qBACf,KAAK,aACL,QAAQ,6BACN;EAAa;EAAkB;;;;UCjEjB;EAChB;EACA;EAEA;EACA,WAAW;EACX,oBAAoB;IAAQ;IAAe;IAAkB;;EAC7D;EACA;EACA;EAEA;EACA;EACA,aAAa;EACb;EAEA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,mBACf,KAAK,aACL,QAAQ,2BACN;EAAa;;UA6HC;EAChB;EACA;EACA;EACA;;UAGgB;EAChB;EACA;EACA;EACA;EACA;EACA,QAAQ;;iBAGO,sBAAsB,KAAK,cAAc,WAAW;;;UCnJnD;EAChB;EACA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ACf,KAAK,aACL,QAAQ,uBACN,WAAW;;;UCjEG;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGgB;EAChB;EACA;EACA;EACA;EACA;EACA;;UAGgB;EAChB;EACA,aAAa;EACb;;iBAGe,iBACf,KAAK,aACL,QAAQ,yBACN,WAAW;;;UC5BG;EAChB;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,cAAc;;iBAGC,gBACf,KAAK,aACL,QAAQ,wBACN;EAAa;EAAmB;;;;UCnBlB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,gBACf,KAAK,aACL,QAAQ,uBACN;EAAa;EAAmB;;;;UChBlB;EAChB;EACA;EACA;EACA;EACA,QAAQ;IACP;IACA;IACA;IACA;;;;;;;;iBASoB,qBACrB,UAAU,cACR,QAAQ;UAaM;EAChB;EACA;;iBAGqB,mBACrB,UAAU,cACR;EAAU,QAAQ;EAA0B,eAAe;;;;iBCvC9C,0BAA0B,KAAK,cAAc;EAC5D,YAAY;EACZ;EACA;EACA;;UAgBgB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,6BACf,KAAK,aACL,QAAQ,qCACN;EAAa,YAAY;;;;UClCX;EAChB;EACA;EACA;;UAGgB;EAChB,SAAS;EACT;;iBAGe,WAAW,KAAK,cAAc,WAAW;UAmCxC;EAChB;EACA;EACA;;UAGgB;EAChB;EACA;;iBAGe,YACf,KAAK,aACL,QAAQ,oBACN,WAAW"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/execution.ts","../src/tools/slide-tools.ts","../src/tools/helpers.ts","../src/tools/element-tools.ts","../src/tools/table-tools.ts","../src/tools/style-tools.ts","../src/tools/content-tools.ts","../src/tools/conversion-tools.ts","../src/tools/theme-tools.ts","../src/tools/chart-tools.ts","../src/tools/smartart-tools.ts","../src/tools/merge-tools.ts","../src/tools/template-tools.ts","../src/tools/metadata-tools.ts","../src/tools/section-tools.ts","../src/tools/export-tools.ts","../src/tools/json-tools.ts","../src/tools/hyperlink-tools.ts","../src/tools/geometry-tools.ts","../src/tools/lock-tools.ts","../src/tools/validation-tools.ts","../src/tools/presentation-tools.ts","../src/tools/layout-tools.ts"],"mappings":";;;;;;;UAOiB;;EAEhB,UAAU;;EAEV,gBAAgB,iBAAiB,QAAQ;;EAEzC,gBAAgB,iBAAiB,QAAQ;;;;;;UAOzB,WAAW;;EAE3B,UAAU;;EAEV,QAAQ;;EAER;;;;;;UAWgB;;EAEhB,QAAQ;IAAqB,MAAM;;;EAEnC,SAAS;IACR,QAAQ,MAAM,KAAM,OAAO,YAAY,kBAAkB;IACzD,UAAU,MAAM,MAAO,QAAQ;;;EAGhC,YAAY;;;;;;;UAQI;EAChB,SAAS,eAAe,QAAQ;EAChC,UAAU,cAAc,MAAM,aAAa;;;;;;UAO3B;EAChB,eACC,kBACA,OAAO,YACP;IAAW;IAAoB;;EAEhC,SAAS,mBAAmB;;;;;UAMZ;;EAEhB,YAAY;;EAEZ,gBAAgB;;EAEhB,SAAS;;EAET;;;;;;;;;iBCvEqB,iBACrB,kBACA,SAAS,mBACP;EAAU,UAAU;EAAU,UAAU;;;;;iBA0BrB,iBACrB,kBACA,UAAU,YACV,UAAU,YACV,SAAS,mBACP;EAAU;EAAsB;;;;;;iBAgDb,uBAAuB,GAC5C,kBACA,SAAS,kBACT,SAAS,KAAK,gBAAgB,WAAW,KAAK,QAAQ,WAAW,MAC/D,QAAQ;EAAM;EAAuB;;;;UCxFvB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,UAAU;;iBAGK,SACf,KAAK,aACL;EAAU;IACR,WAAW;UAuBG;EAChB;EACA;;UAGgB;EAChB;EACA;;iBAGe,SAAS,KAAK,aAAa,QAAQ,iBAAiB,WAAW;UA2B9D;EAChB;;UAGgB;EAChB;EACA;;iBAGe,aACf,KAAK,aACL,QAAQ,qBACN,WAAW;UA4BG;EAChB;;iBAGe,cACf,KAAK,aACL,QAAQ,sBACN;EAAa;;UA2BC;EAChB;EACA;;iBAGe,eACf,KAAK,aACL,QAAQ,uBACN;EAAa;EAAuB;;UA4BtB;EAChB;EACA;EACA;EACA;EACA;EACA;;iBAGe,sBACf,KAAK,aACL,QAAQ,8BACN;EAAa;;UA8BC;EAChB;EACA;EACA;EACA;EACA;EACA;;iBAGe,mBACf,KAAK,aACL,QAAQ,2BACN;EAAa;EAAoB;;UAmCnB;EAChB;EACA;;iBAGe,cACf,KAAK,aACL,QAAQ,sBACN;EAAa;EAAqB;;;;iBChSrB;iBAIA;;iBAKA,gBAAgB,IAAI,gBAAc;;iBAwGlC,iBAAiB,OAAO;;iBA0BxB,mBAAmB,oBAAoB;;;UC9HtC;EAChB;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;UAGgB;EAChB;EACA;;iBAGe,WACf,KAAK,aACL,QAAQ,mBACN,WAAW;UAmKG;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,cACf,KAAK,aACL,QAAQ,sBACN;EAAa;;UA8GC;EAChB;EACA;;EAEA;;iBAGe,cACf,KAAK,aACL,QAAQ,sBACN;EAAa;EAAmB;;UA4BlB;EAChB;EACA;;iBAGe,eACf,KAAK,aACL,QAAQ,uBACN;EAAa;;UA0BC;EAChB;EACA;EAEA;EACA;EAEA;EACA;;iBAGe,gBACf,KAAK,aACL,QAAQ,wBACN;EAAa;;UA6GC;EAChB;EACA;EACA;EACA;EACA;;UAGgB;EAChB;;iBAGe,aACf,KAAK,aACL,QAAQ,qBACN,WAAW;UAuCG;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,oBACf,KAAK,aACL,QAAQ,4BACN;EAAa;;UAsDC;EAChB;EACA;;UAGgB;EAChB;;iBAGe,cACf,KAAK,aACL,QAAQ,sBACN,WAAW;UAyDG;EAChB;EACA;;UAGgB;EAChB;;iBAGe,gBACf,KAAK,aACL,QAAQ,wBACN,WAAW;UAqCG;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,oBACf,KAAK,aACL,QAAQ,4BACN;EAAa;;;;UCnyBC;EAChB;EACA;EACA,OAAO;IAAQ;IAAa;IAAa;;;iBAG1B,iBACf,KAAK,aACL,QAAQ,yBACN;EAAa;;UA6CC;EAChB;EACA;EACA;EACA;EACA;EACA;;iBAGe,qBACf,KAAK,aACL,QAAQ,6BACN;EAAa;EAAkB;;;;UCjEjB;EAChB;EACA;EAEA;EACA,WAAW;EACX,oBAAoB;IAAQ;IAAe;IAAkB;;EAC7D;EACA;EACA;EAEA;EACA;EACA,aAAa;EACb;EAEA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,mBACf,KAAK,aACL,QAAQ,2BACN;EAAa;;UA6HC;EAChB;EACA;EACA;EACA;;UAGgB;EAChB;EACA;EACA;EACA;EACA;EACA,QAAQ;;iBAGO,sBAAsB,KAAK,cAAc,WAAW;;;UCnJnD;EAChB;EACA;EACA;EACA;;UAGgB;EAChB;EACA;EACA;EACA;EACA;;UAGgB;EAChB;EACA;EACA,SAAS;;iBAGM,SAAS,KAAK,aAAa,QAAQ,iBAAiB,WAAW;UA2G9D;EAChB;EACA;EACA;EACA;EACA;;UAGgB;EAChB;EACA;EACA;;iBAGe,YACf,KAAK,aACL,QAAQ,oBACN,WAAW;UAiGG;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;;UAGgB;EAChB;EACA;EACA;EACA;EACA;EACA;;UAGgB;EAChB;EACA,WAAW;EACX;EACA;;iBAGe,eACf,KAAK,aACL,QAAQ,uBACN,WAAW;;;UCpTG;EAChB;EACA;EACA;EACA;IAAe;IAAgB;;EAC/B;EACA;E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EAEA;;EAEA,cAAc;;iBAGC,gBACf,KAAK,aACL,QAAQ,wBACN;EAAa;EAAmB;;;;UCnBlB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,gBACf,KAAK,aACL,QAAQ,uBACN;EAAa;EAAmB;;;;UChBlB;EAChB;EACA;EACA;EACA;EACA,QAAQ;IACP;IACA;IACA;IACA;;;;;;;;iBASoB,qBACrB,UAAU,cACR,QAAQ;UAaM;EAChB;EACA;;iBAGqB,mBACrB,UAAU,cACR;EAAU,QAAQ;EAA0B,eAAe;;;;iBCvC9C,0BAA0B,KAAK,cAAc;EAC5D,YAAY;EACZ;EACA;EACA;;UAgBgB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,6BACf,KAAK,aACL,QAAQ,qCACN;EAAa,YAAY;;;;UClCX;EAChB;EACA;EACA;;UAGgB;EAChB,SAAS;EACT;;iBAGe,WAAW,KAAK,cAAc,WAAW;UAmCxC;EAChB;EACA;EACA;;UAGgB;EAChB;EACA;;iBAGe,YACf,KAAK,aACL,QAAQ,oBACN,WAAW"}
package/dist/index.js CHANGED
@@ -623,6 +623,28 @@ function updateElement(ctx, params) {
623
623
  result: { elementId: params.elementId }
624
624
  };
625
625
  }
626
+ function renameElement(ctx, params) {
627
+ const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
628
+ if (err) {
629
+ throw new Error(err);
630
+ }
631
+ const slide = ctx.pptxData.slides[params.slideIndex];
632
+ const el = slide.elements.find((e) => e.id === params.elementId);
633
+ if (!el) {
634
+ throw new Error(`Element '${params.elementId}' not found on slide ${params.slideIndex}.`);
635
+ }
636
+ const name = params.name.trim();
637
+ if (name.length === 0) {
638
+ delete el.name;
639
+ } else {
640
+ el.name = name;
641
+ }
642
+ return {
643
+ pptxData: ctx.pptxData,
644
+ dirty: true,
645
+ result: { elementId: params.elementId, name }
646
+ };
647
+ }
626
648
  function deleteElements(ctx, params) {
627
649
  const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
628
650
  if (err) {
@@ -2212,6 +2234,33 @@ function exportSlideSvg(ctx, params) {
2212
2234
  result: { svg, slideIndex: params.slideIndex }
2213
2235
  };
2214
2236
  }
2237
+ function exportToJson(ctx, params) {
2238
+ const document = pptxViewerCore.buildPptxJsonDocument(ctx.pptxData, { generator: "pptx-viewer-mcp" });
2239
+ const json = JSON.stringify(document, null, params.pretty === false ? void 0 : 2);
2240
+ return {
2241
+ pptxData: ctx.pptxData,
2242
+ dirty: false,
2243
+ result: {
2244
+ json,
2245
+ slideCount: document.slideCount,
2246
+ byteSize: new TextEncoder().encode(json).byteLength,
2247
+ assets: document.assets
2248
+ }
2249
+ };
2250
+ }
2251
+ function importFromJson(ctx, params) {
2252
+ const imported = pptxViewerCore.deserializePptxFromJson(params.json);
2253
+ pptxViewerCore.applyImportedPptxData(ctx.pptxData, imported);
2254
+ return {
2255
+ pptxData: ctx.pptxData,
2256
+ dirty: true,
2257
+ result: {
2258
+ slideCount: ctx.pptxData.slides.length,
2259
+ width: ctx.pptxData.width,
2260
+ height: ctx.pptxData.height
2261
+ }
2262
+ };
2263
+ }
2215
2264
 
2216
2265
  // src/tools/hyperlink-tools.ts
2217
2266
  function manageHyperlinks(ctx, params) {
@@ -2543,6 +2592,7 @@ exports.diffPresentationsT = diffPresentationsT;
2543
2592
  exports.duplicateSlide = duplicateSlide;
2544
2593
  exports.executeToolWithContext = executeToolWithContext;
2545
2594
  exports.exportSlideSvg = exportSlideSvg;
2595
+ exports.exportToJson = exportToJson;
2546
2596
  exports.exportToSvg = exportToSvg;
2547
2597
  exports.extractSlideText = extractSlideText;
2548
2598
  exports.findPlaceholdersT = findPlaceholdersT;
@@ -2555,6 +2605,7 @@ exports.getPresentationProperties = getPresentationProperties;
2555
2605
  exports.getSlide = getSlide;
2556
2606
  exports.getThemeInfo = getThemeInfo;
2557
2607
  exports.groupElements = groupElements;
2608
+ exports.importFromJson = importFromJson;
2558
2609
  exports.loadPresentation = loadPresentation;
2559
2610
  exports.manageComments = manageComments;
2560
2611
  exports.manageHyperlinks = manageHyperlinks;
@@ -2563,6 +2614,7 @@ exports.manageSmartArt = manageSmartArt;
2563
2614
  exports.manageTableStructure = manageTableStructure;
2564
2615
  exports.mergePresentationT = mergePresentationT;
2565
2616
  exports.removeChartSeriesT = removeChartSeriesT;
2617
+ exports.renameElement = renameElement;
2566
2618
  exports.reorderSlides = reorderSlides;
2567
2619
  exports.repairPresentation = repairPresentation;
2568
2620
  exports.replaceGeometry = replaceGeometry;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { PptxHandler, hasTextProperties, PptxMarkdownConverter, ThemePresets, getThemePreset, setChartType, setChartTitle, setChartGrouping, setChartLegend, setChartDataLabels, setChartAxis, setChartCategories, addChartSeries, removeChartSeries, updateChartSeriesValues, ChartBuilder, decomposeSmartArt, demoteSmartArtNode, promoteSmartArtNode, reorderSmartArtNode, updateSmartArtNodeText, removeSmartArtNode, addSmartArtNode, mergePresentation, diffPresentations, findPlaceholders, applyTemplate, getSectionForSlide, moveSlidesToSection, reorderSections, removeSection, addSection, SvgExporter, replaceWithCustomGeometry, replaceShapeGeometry, setElementLocked, validatePptx, repairPptx, findLayoutByName, findLayoutByType } from 'pptx-viewer-core';
1
+ import { PptxHandler, hasTextProperties, PptxMarkdownConverter, ThemePresets, getThemePreset, setChartType, setChartTitle, setChartGrouping, setChartLegend, setChartDataLabels, setChartAxis, setChartCategories, addChartSeries, removeChartSeries, updateChartSeriesValues, ChartBuilder, decomposeSmartArt, demoteSmartArtNode, promoteSmartArtNode, reorderSmartArtNode, updateSmartArtNodeText, removeSmartArtNode, addSmartArtNode, mergePresentation, diffPresentations, findPlaceholders, applyTemplate, getSectionForSlide, moveSlidesToSection, reorderSections, removeSection, addSection, SvgExporter, buildPptxJsonDocument, deserializePptxFromJson, applyImportedPptxData, replaceWithCustomGeometry, replaceShapeGeometry, setElementLocked, validatePptx, repairPptx, findLayoutByName, findLayoutByType } from 'pptx-viewer-core';
2
2
  export { PptxHandler } from 'pptx-viewer-core';
3
3
 
4
4
  // src/execution.ts
@@ -622,6 +622,28 @@ function updateElement(ctx, params) {
622
622
  result: { elementId: params.elementId }
623
623
  };
624
624
  }
625
+ function renameElement(ctx, params) {
626
+ const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
627
+ if (err) {
628
+ throw new Error(err);
629
+ }
630
+ const slide = ctx.pptxData.slides[params.slideIndex];
631
+ const el = slide.elements.find((e) => e.id === params.elementId);
632
+ if (!el) {
633
+ throw new Error(`Element '${params.elementId}' not found on slide ${params.slideIndex}.`);
634
+ }
635
+ const name = params.name.trim();
636
+ if (name.length === 0) {
637
+ delete el.name;
638
+ } else {
639
+ el.name = name;
640
+ }
641
+ return {
642
+ pptxData: ctx.pptxData,
643
+ dirty: true,
644
+ result: { elementId: params.elementId, name }
645
+ };
646
+ }
625
647
  function deleteElements(ctx, params) {
626
648
  const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
627
649
  if (err) {
@@ -2211,6 +2233,33 @@ function exportSlideSvg(ctx, params) {
2211
2233
  result: { svg, slideIndex: params.slideIndex }
2212
2234
  };
2213
2235
  }
2236
+ function exportToJson(ctx, params) {
2237
+ const document = buildPptxJsonDocument(ctx.pptxData, { generator: "pptx-viewer-mcp" });
2238
+ const json = JSON.stringify(document, null, params.pretty === false ? void 0 : 2);
2239
+ return {
2240
+ pptxData: ctx.pptxData,
2241
+ dirty: false,
2242
+ result: {
2243
+ json,
2244
+ slideCount: document.slideCount,
2245
+ byteSize: new TextEncoder().encode(json).byteLength,
2246
+ assets: document.assets
2247
+ }
2248
+ };
2249
+ }
2250
+ function importFromJson(ctx, params) {
2251
+ const imported = deserializePptxFromJson(params.json);
2252
+ applyImportedPptxData(ctx.pptxData, imported);
2253
+ return {
2254
+ pptxData: ctx.pptxData,
2255
+ dirty: true,
2256
+ result: {
2257
+ slideCount: ctx.pptxData.slides.length,
2258
+ width: ctx.pptxData.width,
2259
+ height: ctx.pptxData.height
2260
+ }
2261
+ };
2262
+ }
2214
2263
 
2215
2264
  // src/tools/hyperlink-tools.ts
2216
2265
  function manageHyperlinks(ctx, params) {
@@ -2520,4 +2569,4 @@ function applyLayout(ctx, params) {
2520
2569
  };
2521
2570
  }
2522
2571
 
2523
- export { addChartSeriesT, addElement, addSlide, applyLayout, applyTemplateT, applyThemePreset, arrangeElements, batchUpdateElements, cloneElement, convertToMarkdown, createChart, deleteElements, deleteSlides, describeElement, diffPresentationsT, duplicateSlide, executeToolWithContext, exportSlideSvg, exportToSvg, extractSlideText, findPlaceholdersT, findText, generateElementId, generateSlideId, getLayouts, getMetadata, getPresentationProperties, getSlide, getThemeInfo, groupElements, loadPresentation, manageComments, manageHyperlinks, manageSections, manageSmartArt, manageTableStructure, mergePresentationT, removeChartSeriesT, reorderSlides, repairPresentation, replaceGeometry, replaceText, runAccessibilityCheck, savePresentation, setCanvasSize, setElementAnimation, setElementLockT, setSlideTransition, ungroupElements, updateChart, updateChartSeriesData, updateElement, updateElementStyle, updateMetadata, updatePresentationProperties, updateSlideProperties, updateTableCells, updateThemeColors, updateThemeFonts, validatePresentation, validateSlideIndex };
2572
+ export { addChartSeriesT, addElement, addSlide, applyLayout, applyTemplateT, applyThemePreset, arrangeElements, batchUpdateElements, cloneElement, convertToMarkdown, createChart, deleteElements, deleteSlides, describeElement, diffPresentationsT, duplicateSlide, executeToolWithContext, exportSlideSvg, exportToJson, exportToSvg, extractSlideText, findPlaceholdersT, findText, generateElementId, generateSlideId, getLayouts, getMetadata, getPresentationProperties, getSlide, getThemeInfo, groupElements, importFromJson, loadPresentation, manageComments, manageHyperlinks, manageSections, manageSmartArt, manageTableStructure, mergePresentationT, removeChartSeriesT, renameElement, reorderSlides, repairPresentation, replaceGeometry, replaceText, runAccessibilityCheck, savePresentation, setCanvasSize, setElementAnimation, setElementLockT, setSlideTransition, ungroupElements, updateChart, updateChartSeriesData, updateElement, updateElementStyle, updateMetadata, updatePresentationProperties, updateSlideProperties, updateTableCells, updateThemeColors, updateThemeFonts, validatePresentation, validateSlideIndex };
package/dist/mcp/index.js CHANGED
@@ -124,6 +124,12 @@ var UpdateElementSchema = zod.z.object({
124
124
  flipH: zod.z.boolean().optional(),
125
125
  flipV: zod.z.boolean().optional()
126
126
  });
127
+ var RenameElementSchema = zod.z.object({
128
+ filePath: zod.z.string().describe("Path to the PPTX file"),
129
+ slideIndex: zod.z.number().int().min(0).describe("Zero-based slide index"),
130
+ elementId: zod.z.string().describe("Element ID to rename"),
131
+ name: zod.z.string().describe("New element name (empty string clears the name)")
132
+ });
127
133
  var DeleteElementsSchema = zod.z.object({
128
134
  filePath: zod.z.string().describe("Path to the PPTX file"),
129
135
  slideIndex: zod.z.number().int().min(0),
@@ -435,6 +441,14 @@ var ExportSlideSvgSchema = zod.z.object({
435
441
  defaultFontFamily: zod.z.string().optional().describe("Default font family for SVG"),
436
442
  defaultFontSize: zod.z.number().optional().describe("Default font size")
437
443
  });
444
+ var ExportToJsonSchema = zod.z.object({
445
+ filePath: zod.z.string().describe("Path to the PPTX file"),
446
+ pretty: zod.z.boolean().optional().describe("Pretty-print the JSON document with 2-space indentation (default true)")
447
+ });
448
+ var ImportFromJsonSchema = zod.z.object({
449
+ filePath: zod.z.string().describe("Path to the PPTX file"),
450
+ json: zod.z.string().describe("The pptx-viewer-json document text to import (replaces the deck content)")
451
+ });
438
452
  var ManageHyperlinksSchema = zod.z.object({
439
453
  filePath: zod.z.string().describe("Path to the PPTX file"),
440
454
  slideIndex: zod.z.number().int().min(0).describe("Zero-based slide index"),
@@ -1308,6 +1322,28 @@ function updateElement(ctx, params) {
1308
1322
  result: { elementId: params.elementId }
1309
1323
  };
1310
1324
  }
1325
+ function renameElement(ctx, params) {
1326
+ const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
1327
+ if (err) {
1328
+ throw new Error(err);
1329
+ }
1330
+ const slide = ctx.pptxData.slides[params.slideIndex];
1331
+ const el = slide.elements.find((e) => e.id === params.elementId);
1332
+ if (!el) {
1333
+ throw new Error(`Element '${params.elementId}' not found on slide ${params.slideIndex}.`);
1334
+ }
1335
+ const name = params.name.trim();
1336
+ if (name.length === 0) {
1337
+ delete el.name;
1338
+ } else {
1339
+ el.name = name;
1340
+ }
1341
+ return {
1342
+ pptxData: ctx.pptxData,
1343
+ dirty: true,
1344
+ result: { elementId: params.elementId, name }
1345
+ };
1346
+ }
1311
1347
  function deleteElements(ctx, params) {
1312
1348
  const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
1313
1349
  if (err) {
@@ -1819,6 +1855,33 @@ function manageHyperlinks(ctx, params) {
1819
1855
  throw new Error(`Unknown hyperlink action: ${String(params.action)}`);
1820
1856
  }
1821
1857
  }
1858
+ function exportToJson(ctx, params) {
1859
+ const document = pptxViewerCore.buildPptxJsonDocument(ctx.pptxData, { generator: "pptx-viewer-mcp" });
1860
+ const json = JSON.stringify(document, null, params.pretty === false ? void 0 : 2);
1861
+ return {
1862
+ pptxData: ctx.pptxData,
1863
+ dirty: false,
1864
+ result: {
1865
+ json,
1866
+ slideCount: document.slideCount,
1867
+ byteSize: new TextEncoder().encode(json).byteLength,
1868
+ assets: document.assets
1869
+ }
1870
+ };
1871
+ }
1872
+ function importFromJson(ctx, params) {
1873
+ const imported = pptxViewerCore.deserializePptxFromJson(params.json);
1874
+ pptxViewerCore.applyImportedPptxData(ctx.pptxData, imported);
1875
+ return {
1876
+ pptxData: ctx.pptxData,
1877
+ dirty: true,
1878
+ result: {
1879
+ slideCount: ctx.pptxData.slides.length,
1880
+ width: ctx.pptxData.width,
1881
+ height: ctx.pptxData.height
1882
+ }
1883
+ };
1884
+ }
1822
1885
  function getLayouts(ctx) {
1823
1886
  const layouts = [];
1824
1887
  if (ctx.pptxData.slideMasters) {
@@ -3231,6 +3294,27 @@ function createServer() {
3231
3294
  };
3232
3295
  }
3233
3296
  );
3297
+ server2.registerTool(
3298
+ "rename_element",
3299
+ {
3300
+ description: "Rename an element (the selection pane's display name; cNvPr/@name)",
3301
+ inputSchema: RenameElementSchema.shape
3302
+ },
3303
+ async (params) => {
3304
+ const result = await runMcpTool(
3305
+ params.filePath,
3306
+ (ctx) => renameElement(ctx, params)
3307
+ );
3308
+ return {
3309
+ content: [
3310
+ {
3311
+ type: "text",
3312
+ text: JSON.stringify(result, null, 2)
3313
+ }
3314
+ ]
3315
+ };
3316
+ }
3317
+ );
3234
3318
  server2.registerTool(
3235
3319
  "delete_elements",
3236
3320
  {
@@ -3775,6 +3859,34 @@ function createServer() {
3775
3859
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
3776
3860
  }
3777
3861
  );
3862
+ server2.registerTool(
3863
+ "export_to_json",
3864
+ {
3865
+ description: "Export the presentation to the portable pptx-viewer-json document format (self-contained, binary assets embedded as base64)",
3866
+ inputSchema: ExportToJsonSchema.shape
3867
+ },
3868
+ async (params) => {
3869
+ const result = await runMcpTool(
3870
+ params.filePath,
3871
+ (ctx) => exportToJson(ctx, params)
3872
+ );
3873
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
3874
+ }
3875
+ );
3876
+ server2.registerTool(
3877
+ "import_from_json",
3878
+ {
3879
+ description: "Replace the presentation content with a deck imported from a pptx-viewer-json document",
3880
+ inputSchema: ImportFromJsonSchema.shape
3881
+ },
3882
+ async (params) => {
3883
+ const result = await runMcpTool(
3884
+ params.filePath,
3885
+ (ctx) => importFromJson(ctx, params)
3886
+ );
3887
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
3888
+ }
3889
+ );
3778
3890
  server2.registerTool(
3779
3891
  "manage_hyperlinks",
3780
3892
  {
@@ -2,7 +2,7 @@
2
2
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
3
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
4
  import { z } from 'zod';
5
- import { validatePptx, repairPptx, PptxHandler, hasTextProperties, PptxMarkdownConverter, ThemePresets, getThemePreset, setChartType, setChartTitle, setChartGrouping, setChartLegend, setChartDataLabels, setChartAxis, setChartCategories, addChartSeries, removeChartSeries, updateChartSeriesValues, ChartBuilder, decomposeSmartArt, demoteSmartArtNode, promoteSmartArtNode, reorderSmartArtNode, updateSmartArtNodeText, removeSmartArtNode, addSmartArtNode, findPlaceholders, applyTemplate, getSectionForSlide, moveSlidesToSection, reorderSections, removeSection, addSection, SvgExporter, replaceWithCustomGeometry, replaceShapeGeometry, setElementLocked, findLayoutByName, findLayoutByType } from 'pptx-viewer-core';
5
+ import { validatePptx, repairPptx, PptxHandler, hasTextProperties, PptxMarkdownConverter, ThemePresets, getThemePreset, setChartType, setChartTitle, setChartGrouping, setChartLegend, setChartDataLabels, setChartAxis, setChartCategories, addChartSeries, removeChartSeries, updateChartSeriesValues, ChartBuilder, decomposeSmartArt, demoteSmartArtNode, promoteSmartArtNode, reorderSmartArtNode, updateSmartArtNodeText, removeSmartArtNode, addSmartArtNode, findPlaceholders, applyTemplate, getSectionForSlide, moveSlidesToSection, reorderSections, removeSection, addSection, SvgExporter, buildPptxJsonDocument, deserializePptxFromJson, applyImportedPptxData, replaceWithCustomGeometry, replaceShapeGeometry, setElementLocked, findLayoutByName, findLayoutByType } from 'pptx-viewer-core';
6
6
  import { writeFile, readFile } from 'fs/promises';
7
7
  import { resolve, isAbsolute, sep } from 'path';
8
8
 
@@ -122,6 +122,12 @@ var UpdateElementSchema = z.object({
122
122
  flipH: z.boolean().optional(),
123
123
  flipV: z.boolean().optional()
124
124
  });
125
+ var RenameElementSchema = z.object({
126
+ filePath: z.string().describe("Path to the PPTX file"),
127
+ slideIndex: z.number().int().min(0).describe("Zero-based slide index"),
128
+ elementId: z.string().describe("Element ID to rename"),
129
+ name: z.string().describe("New element name (empty string clears the name)")
130
+ });
125
131
  var DeleteElementsSchema = z.object({
126
132
  filePath: z.string().describe("Path to the PPTX file"),
127
133
  slideIndex: z.number().int().min(0),
@@ -433,6 +439,14 @@ var ExportSlideSvgSchema = z.object({
433
439
  defaultFontFamily: z.string().optional().describe("Default font family for SVG"),
434
440
  defaultFontSize: z.number().optional().describe("Default font size")
435
441
  });
442
+ var ExportToJsonSchema = z.object({
443
+ filePath: z.string().describe("Path to the PPTX file"),
444
+ pretty: z.boolean().optional().describe("Pretty-print the JSON document with 2-space indentation (default true)")
445
+ });
446
+ var ImportFromJsonSchema = z.object({
447
+ filePath: z.string().describe("Path to the PPTX file"),
448
+ json: z.string().describe("The pptx-viewer-json document text to import (replaces the deck content)")
449
+ });
436
450
  var ManageHyperlinksSchema = z.object({
437
451
  filePath: z.string().describe("Path to the PPTX file"),
438
452
  slideIndex: z.number().int().min(0).describe("Zero-based slide index"),
@@ -1306,6 +1320,28 @@ function updateElement(ctx, params) {
1306
1320
  result: { elementId: params.elementId }
1307
1321
  };
1308
1322
  }
1323
+ function renameElement(ctx, params) {
1324
+ const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
1325
+ if (err) {
1326
+ throw new Error(err);
1327
+ }
1328
+ const slide = ctx.pptxData.slides[params.slideIndex];
1329
+ const el = slide.elements.find((e) => e.id === params.elementId);
1330
+ if (!el) {
1331
+ throw new Error(`Element '${params.elementId}' not found on slide ${params.slideIndex}.`);
1332
+ }
1333
+ const name = params.name.trim();
1334
+ if (name.length === 0) {
1335
+ delete el.name;
1336
+ } else {
1337
+ el.name = name;
1338
+ }
1339
+ return {
1340
+ pptxData: ctx.pptxData,
1341
+ dirty: true,
1342
+ result: { elementId: params.elementId, name }
1343
+ };
1344
+ }
1309
1345
  function deleteElements(ctx, params) {
1310
1346
  const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
1311
1347
  if (err) {
@@ -1817,6 +1853,33 @@ function manageHyperlinks(ctx, params) {
1817
1853
  throw new Error(`Unknown hyperlink action: ${String(params.action)}`);
1818
1854
  }
1819
1855
  }
1856
+ function exportToJson(ctx, params) {
1857
+ const document = buildPptxJsonDocument(ctx.pptxData, { generator: "pptx-viewer-mcp" });
1858
+ const json = JSON.stringify(document, null, params.pretty === false ? void 0 : 2);
1859
+ return {
1860
+ pptxData: ctx.pptxData,
1861
+ dirty: false,
1862
+ result: {
1863
+ json,
1864
+ slideCount: document.slideCount,
1865
+ byteSize: new TextEncoder().encode(json).byteLength,
1866
+ assets: document.assets
1867
+ }
1868
+ };
1869
+ }
1870
+ function importFromJson(ctx, params) {
1871
+ const imported = deserializePptxFromJson(params.json);
1872
+ applyImportedPptxData(ctx.pptxData, imported);
1873
+ return {
1874
+ pptxData: ctx.pptxData,
1875
+ dirty: true,
1876
+ result: {
1877
+ slideCount: ctx.pptxData.slides.length,
1878
+ width: ctx.pptxData.width,
1879
+ height: ctx.pptxData.height
1880
+ }
1881
+ };
1882
+ }
1820
1883
  function getLayouts(ctx) {
1821
1884
  const layouts = [];
1822
1885
  if (ctx.pptxData.slideMasters) {
@@ -3229,6 +3292,27 @@ function createServer() {
3229
3292
  };
3230
3293
  }
3231
3294
  );
3295
+ server2.registerTool(
3296
+ "rename_element",
3297
+ {
3298
+ description: "Rename an element (the selection pane's display name; cNvPr/@name)",
3299
+ inputSchema: RenameElementSchema.shape
3300
+ },
3301
+ async (params) => {
3302
+ const result = await runMcpTool(
3303
+ params.filePath,
3304
+ (ctx) => renameElement(ctx, params)
3305
+ );
3306
+ return {
3307
+ content: [
3308
+ {
3309
+ type: "text",
3310
+ text: JSON.stringify(result, null, 2)
3311
+ }
3312
+ ]
3313
+ };
3314
+ }
3315
+ );
3232
3316
  server2.registerTool(
3233
3317
  "delete_elements",
3234
3318
  {
@@ -3773,6 +3857,34 @@ function createServer() {
3773
3857
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
3774
3858
  }
3775
3859
  );
3860
+ server2.registerTool(
3861
+ "export_to_json",
3862
+ {
3863
+ description: "Export the presentation to the portable pptx-viewer-json document format (self-contained, binary assets embedded as base64)",
3864
+ inputSchema: ExportToJsonSchema.shape
3865
+ },
3866
+ async (params) => {
3867
+ const result = await runMcpTool(
3868
+ params.filePath,
3869
+ (ctx) => exportToJson(ctx, params)
3870
+ );
3871
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
3872
+ }
3873
+ );
3874
+ server2.registerTool(
3875
+ "import_from_json",
3876
+ {
3877
+ description: "Replace the presentation content with a deck imported from a pptx-viewer-json document",
3878
+ inputSchema: ImportFromJsonSchema.shape
3879
+ },
3880
+ async (params) => {
3881
+ const result = await runMcpTool(
3882
+ params.filePath,
3883
+ (ctx) => importFromJson(ctx, params)
3884
+ );
3885
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
3886
+ }
3887
+ );
3776
3888
  server2.registerTool(
3777
3889
  "manage_hyperlinks",
3778
3890
  {
@@ -134,6 +134,12 @@ declare const UpdateElementSchema: z.ZodObject<{
134
134
  flipH: z.ZodOptional<z.ZodBoolean>;
135
135
  flipV: z.ZodOptional<z.ZodBoolean>;
136
136
  }, z.core.$strip>;
137
+ declare const RenameElementSchema: z.ZodObject<{
138
+ filePath: z.ZodString;
139
+ slideIndex: z.ZodNumber;
140
+ elementId: z.ZodString;
141
+ name: z.ZodString;
142
+ }, z.core.$strip>;
137
143
  declare const DeleteElementsSchema: z.ZodObject<{
138
144
  filePath: z.ZodString;
139
145
  slideIndex: z.ZodNumber;
@@ -488,6 +494,16 @@ declare const ExportSlideSvgSchema: z.ZodObject<{
488
494
  defaultFontSize: z.ZodOptional<z.ZodNumber>;
489
495
  }, z.core.$strip>;
490
496
  //#endregion
497
+ //#region src/schemas/json-schemas.d.ts
498
+ declare const ExportToJsonSchema: z.ZodObject<{
499
+ filePath: z.ZodString;
500
+ pretty: z.ZodOptional<z.ZodBoolean>;
501
+ }, z.core.$strip>;
502
+ declare const ImportFromJsonSchema: z.ZodObject<{
503
+ filePath: z.ZodString;
504
+ json: z.ZodString;
505
+ }, z.core.$strip>;
506
+ //#endregion
491
507
  //#region src/schemas/hyperlink-schemas.d.ts
492
508
  declare const ManageHyperlinksSchema: z.ZodObject<{
493
509
  filePath: z.ZodString;
@@ -588,5 +604,5 @@ declare const ApplyLayoutSchema: z.ZodObject<{
588
604
  layoutType: z.ZodOptional<z.ZodString>;
589
605
  }, z.core.$strip>;
590
606
  //#endregion
591
- export { AccessibilityCheckSchema, AddChartSeriesSchema, AddElementSchema, AddSlideSchema, ApplyLayoutSchema, ApplyTemplateSchema, ApplyThemePresetSchema, ArrangeElementsSchema, BatchUpdateElementsSchema, CloneElementSchema, ConvertToMarkdownSchema, CreateChartSchema, DeleteElementsSchema, DeleteSlidesSchema, DuplicateSlideSchema, ExportSlideSvgSchema, ExportToSvgSchema, FindPlaceholdersSchema, FindTextSchema, GetLayoutsSchema, GetMetadataSchema, GetPresentationPropertiesSchema, GetSlideSchema, GetThemeInfoSchema, GroupElementsSchema, ManageCommentsSchema, ManageHyperlinksSchema, ManageSectionsSchema, ManageSmartArtSchema, ManageTableStructureSchema, RemoveChartSeriesSchema, ReorderSlidesSchema, RepairPresentationSchema, ReplaceGeometrySchema, ReplaceTextSchema, SetCanvasSizeSchema, SetElementAnimationSchema, SetElementLockSchema, SetSlideTransitionSchema, UngroupElementsSchema, UpdateChartSchema, UpdateChartSeriesDataSchema, UpdateElementSchema, UpdateElementStyleSchema, UpdateMetadataSchema, UpdatePresentationPropertiesSchema, UpdateSlidePropertiesSchema, UpdateTableCellsSchema, UpdateThemeColorsSchema, UpdateThemeFontsSchema, ValidatePresentationSchema };
607
+ export { AccessibilityCheckSchema, AddChartSeriesSchema, AddElementSchema, AddSlideSchema, ApplyLayoutSchema, ApplyTemplateSchema, ApplyThemePresetSchema, ArrangeElementsSchema, BatchUpdateElementsSchema, CloneElementSchema, ConvertToMarkdownSchema, CreateChartSchema, DeleteElementsSchema, DeleteSlidesSchema, DuplicateSlideSchema, ExportSlideSvgSchema, ExportToJsonSchema, ExportToSvgSchema, FindPlaceholdersSchema, FindTextSchema, GetLayoutsSchema, GetMetadataSchema, GetPresentationPropertiesSchema, GetSlideSchema, GetThemeInfoSchema, GroupElementsSchema, ImportFromJsonSchema, ManageCommentsSchema, ManageHyperlinksSchema, ManageSectionsSchema, ManageSmartArtSchema, ManageTableStructureSchema, RemoveChartSeriesSchema, RenameElementSchema, ReorderSlidesSchema, RepairPresentationSchema, ReplaceGeometrySchema, ReplaceTextSchema, SetCanvasSizeSchema, SetElementAnimationSchema, SetElementLockSchema, SetSlideTransitionSchema, UngroupElementsSchema, UpdateChartSchema, UpdateChartSeriesDataSchema, UpdateElementSchema, UpdateElementStyleSchema, UpdateMetadataSchema, UpdatePresentationPropertiesSchema, UpdateSlidePropertiesSchema, UpdateTableCellsSchema, UpdateThemeColorsSchema, UpdateThemeFontsSchema, ValidatePresentationSchema };
592
608
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/schemas/slide-schemas.ts","../../src/schemas/element-schemas.ts","../../src/schemas/table-style-schemas.ts","../../src/schemas/theme-schemas.ts","../../src/schemas/chart-schemas.ts","../../src/schemas/smartart-schemas.ts","../../src/schemas/template-schemas.ts","../../src/schemas/metadata-schemas.ts","../../src/schemas/section-schemas.ts","../../src/schemas/export-schemas.ts","../../src/schemas/hyperlink-schemas.ts","../../src/schemas/geometry-schemas.ts","../../src/schemas/lock-schemas.ts","../../src/schemas/validation-schemas.ts","../../src/schemas/presentation-schemas.ts","../../src/schemas/layout-schemas.ts"],"mappings":";;cAEa,gBAAc,EAAA;;;GAGzB,EAAA,KAAA;cAEW,gBAAc,EAAA;;;;GAIzB,EAAA,KAAA;cAEW,oBAAkB,EAAA;;;GAG7B,EAAA,KAAA;cAEW,qBAAmB,EAAA;;;GAG9B,EAAA,KAAA;cAEW,sBAAoB,EAAA;;;;GAI/B,EAAA,KAAA;cAEW,6BAA2B,EAAA;;;;;;;;GAQtC,EAAA,KAAA;cAEW,0BAAwB,EAAA;;;;;;;;GAQnC,EAAA,KAAA;cAEW,qBAAmB,EAAA;;;;GAI9B,EAAA,KAAA;cAEW,yBAAuB,EAAA;;;;;;;;;;;GAclC,EAAA,KAA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KlC,EAAA,KAAA;cAEW,6BAA2B,EAAA;;;;;;GAMtC,EAAA,KAAA;cAEW,mBAAiB,EAAA;;;;;;;;;;;;;;;;;;;GA2B5B,EAAA,KAAA;;;cCnGW,sBAAoB,EAAA;;;;;;;;;;;;;;;;;;GAoB/B,EAAA,KAAA;;;cCpBW,wBAAsB,EAAA;;GAEjC,EAAA,KAAA;cAEW,qBAAmB,EAAA;;;GAK9B,EAAA,KAAA;;;cCTW,mBAAiB,EAAA;;GAE5B,EAAA,KAAA;cAEW,sBAAoB,EAAA;;;;;;;;;;;;;;;GAoB/B,EAAA,KAAA;;;cCxBW,sBAAoB,EAAA;;;;;;;;;;;;;;;GAa/B,EAAA,KAAA;;;cCbW,mBAAiB,EAAA;;;;;;GAS5B,EAAA,KAAA;cAEW,sBAAoB,EAAA;;;;;GAK/B,EAAA,KAAA;;;cChBW,wBAAsB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAkBjC,EAAA,KAAA;;;cClBW,uBAAqB,EAAA;;;;;;;;;GAehC,EAAA,KAAA;;;cCfW,sBAAoB,EAAA;;;;;;;;;;GAU/B,EAAA,KAAA;;;cCVW,4BAA0B,EAAA;;GAErC,EAAA,KAAA;cAEW,0BAAwB,EAAA;;GAEnC,EAAA,KAAA;;;cCNW,iCAA+B,EAAA;;GAE1C,EAAA,KAAA;cAEW,oCAAkC,EAAA;;;;;;;;;;;;;;;;;;;;;;GAc7C,EAAA,KAAA;;;cClBW,kBAAgB,EAAA;;GAE3B,EAAA,KAAA;cAEW,mBAAiB,EAAA;;;;;GAK5B,EAAA,KAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/schemas/slide-schemas.ts","../../src/schemas/element-schemas.ts","../../src/schemas/table-style-schemas.ts","../../src/schemas/theme-schemas.ts","../../src/schemas/chart-schemas.ts","../../src/schemas/smartart-schemas.ts","../../src/schemas/template-schemas.ts","../../src/schemas/metadata-schemas.ts","../../src/schemas/section-schemas.ts","../../src/schemas/export-schemas.ts","../../src/schemas/json-schemas.ts","../../src/schemas/hyperlink-schemas.ts","../../src/schemas/geometry-schemas.ts","../../src/schemas/lock-schemas.ts","../../src/schemas/validation-schemas.ts","../../src/schemas/presentation-schemas.ts","../../src/schemas/layout-schemas.ts"],"mappings":";;cAEa,gBAAc,EAAA;;;GAGzB,EAAA,KAAA;cAEW,gBAAc,EAAA;;;;GAIzB,EAAA,KAAA;cAEW,oBAAkB,EAAA;;;GAG7B,EAAA,KAAA;cAEW,qBAAmB,EAAA;;;GAG9B,EAAA,KAAA;cAEW,sBAAoB,EAAA;;;;GAI/B,EAAA,KAAA;cAEW,6BAA2B,EAAA;;;;;;;;GAQtC,EAAA,KAAA;cAEW,0BAAwB,EAAA;;;;;;;;GAQnC,EAAA,KAAA;cAEW,qBAAmB,EAAA;;;;GAI9B,EAAA,KAAA;cAEW,yBAAuB,EAAA;;;;;;;;;;;GAclC,EAAA,KAAA;cAEW,0BAAwB,EAAA;;GAEnC,EAAA,KAAA;;;cCvEW,kBAAgB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8B3B,EAAA,KAAA;cAEW,qBAAmB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwB9B,EAAA,KAAA;cAEW,qBAAmB,EAAA;;;;;GAK9B,EAAA,KAAA;cAEW,sBAAoB,EAAA;;;;GAI/B,EAAA,KAAA;cAEW,uBAAqB,EAAA;;;;;;;;;;;;;;;;;;;;;;;GAQhC,EAAA,KAAA;cAEW,oBAAkB,EAAA;;;;;;;GAO7B,EAAA,KAAA;cAEW,2BAAyB,EAAA;;;;;;;;;GASpC,EAAA,KAAA;cAEW,qBAAmB,EAAA;;;;GAI9B,EAAA,KAAA;cAEW,uBAAqB,EAAA;;;;GAIhC,EAAA,KAAA;cAEW,2BAAyB,EAAA;;;;;;;;;;;GAWpC,EAAA,KAAA;;;cC5HW,wBAAsB,EAAA;;;;;;;;;GAcjC,EAAA,KAAA;cAEW,4BA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;;;cCbW,wBAAsB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAkBjC,EAAA,KAAA;;;cClBW,uBAAqB,EAAA;;;;;;;;;GAehC,EAAA,KAAA;;;cCfW,sBAAoB,EAAA;;;;;;;;;;GAU/B,EAAA,KAAA;;;cCVW,4BAA0B,EAAA;;GAErC,EAAA,KAAA;cAEW,0BAAwB,EAAA;;GAEnC,EAAA,KAAA;;;cCNW,iCAA+B,EAAA;;GAE1C,EAAA,KAAA;cAEW,oCAAkC,EAAA;;;;;;;;;;;;;;;;;;;;;;GAc7C,EAAA,KAAA;;;cClBW,kBAAgB,EAAA;;GAE3B,EAAA,KAAA;cAEW,mBAAiB,EAAA;;;;;GAK5B,EAAA,KAAA"}
@@ -119,6 +119,12 @@ var UpdateElementSchema = zod.z.object({
119
119
  flipH: zod.z.boolean().optional(),
120
120
  flipV: zod.z.boolean().optional()
121
121
  });
122
+ var RenameElementSchema = zod.z.object({
123
+ filePath: zod.z.string().describe("Path to the PPTX file"),
124
+ slideIndex: zod.z.number().int().min(0).describe("Zero-based slide index"),
125
+ elementId: zod.z.string().describe("Element ID to rename"),
126
+ name: zod.z.string().describe("New element name (empty string clears the name)")
127
+ });
122
128
  var DeleteElementsSchema = zod.z.object({
123
129
  filePath: zod.z.string().describe("Path to the PPTX file"),
124
130
  slideIndex: zod.z.number().int().min(0),
@@ -430,6 +436,14 @@ var ExportSlideSvgSchema = zod.z.object({
430
436
  defaultFontFamily: zod.z.string().optional().describe("Default font family for SVG"),
431
437
  defaultFontSize: zod.z.number().optional().describe("Default font size")
432
438
  });
439
+ var ExportToJsonSchema = zod.z.object({
440
+ filePath: zod.z.string().describe("Path to the PPTX file"),
441
+ pretty: zod.z.boolean().optional().describe("Pretty-print the JSON document with 2-space indentation (default true)")
442
+ });
443
+ var ImportFromJsonSchema = zod.z.object({
444
+ filePath: zod.z.string().describe("Path to the PPTX file"),
445
+ json: zod.z.string().describe("The pptx-viewer-json document text to import (replaces the deck content)")
446
+ });
433
447
  var ManageHyperlinksSchema = zod.z.object({
434
448
  filePath: zod.z.string().describe("Path to the PPTX file"),
435
449
  slideIndex: zod.z.number().int().min(0).describe("Zero-based slide index"),
@@ -509,6 +523,7 @@ exports.DeleteElementsSchema = DeleteElementsSchema;
509
523
  exports.DeleteSlidesSchema = DeleteSlidesSchema;
510
524
  exports.DuplicateSlideSchema = DuplicateSlideSchema;
511
525
  exports.ExportSlideSvgSchema = ExportSlideSvgSchema;
526
+ exports.ExportToJsonSchema = ExportToJsonSchema;
512
527
  exports.ExportToSvgSchema = ExportToSvgSchema;
513
528
  exports.FindPlaceholdersSchema = FindPlaceholdersSchema;
514
529
  exports.FindTextSchema = FindTextSchema;
@@ -518,12 +533,14 @@ exports.GetPresentationPropertiesSchema = GetPresentationPropertiesSchema;
518
533
  exports.GetSlideSchema = GetSlideSchema;
519
534
  exports.GetThemeInfoSchema = GetThemeInfoSchema;
520
535
  exports.GroupElementsSchema = GroupElementsSchema;
536
+ exports.ImportFromJsonSchema = ImportFromJsonSchema;
521
537
  exports.ManageCommentsSchema = ManageCommentsSchema;
522
538
  exports.ManageHyperlinksSchema = ManageHyperlinksSchema;
523
539
  exports.ManageSectionsSchema = ManageSectionsSchema;
524
540
  exports.ManageSmartArtSchema = ManageSmartArtSchema;
525
541
  exports.ManageTableStructureSchema = ManageTableStructureSchema;
526
542
  exports.RemoveChartSeriesSchema = RemoveChartSeriesSchema;
543
+ exports.RenameElementSchema = RenameElementSchema;
527
544
  exports.ReorderSlidesSchema = ReorderSlidesSchema;
528
545
  exports.RepairPresentationSchema = RepairPresentationSchema;
529
546
  exports.ReplaceGeometrySchema = ReplaceGeometrySchema;
@@ -117,6 +117,12 @@ var UpdateElementSchema = z.object({
117
117
  flipH: z.boolean().optional(),
118
118
  flipV: z.boolean().optional()
119
119
  });
120
+ var RenameElementSchema = z.object({
121
+ filePath: z.string().describe("Path to the PPTX file"),
122
+ slideIndex: z.number().int().min(0).describe("Zero-based slide index"),
123
+ elementId: z.string().describe("Element ID to rename"),
124
+ name: z.string().describe("New element name (empty string clears the name)")
125
+ });
120
126
  var DeleteElementsSchema = z.object({
121
127
  filePath: z.string().describe("Path to the PPTX file"),
122
128
  slideIndex: z.number().int().min(0),
@@ -428,6 +434,14 @@ var ExportSlideSvgSchema = z.object({
428
434
  defaultFontFamily: z.string().optional().describe("Default font family for SVG"),
429
435
  defaultFontSize: z.number().optional().describe("Default font size")
430
436
  });
437
+ var ExportToJsonSchema = z.object({
438
+ filePath: z.string().describe("Path to the PPTX file"),
439
+ pretty: z.boolean().optional().describe("Pretty-print the JSON document with 2-space indentation (default true)")
440
+ });
441
+ var ImportFromJsonSchema = z.object({
442
+ filePath: z.string().describe("Path to the PPTX file"),
443
+ json: z.string().describe("The pptx-viewer-json document text to import (replaces the deck content)")
444
+ });
431
445
  var ManageHyperlinksSchema = z.object({
432
446
  filePath: z.string().describe("Path to the PPTX file"),
433
447
  slideIndex: z.number().int().min(0).describe("Zero-based slide index"),
@@ -491,4 +505,4 @@ var ApplyLayoutSchema = z.object({
491
505
  layoutType: z.string().optional().describe("Layout type to apply (alternative to name)")
492
506
  });
493
507
 
494
- export { AccessibilityCheckSchema, AddChartSeriesSchema, AddElementSchema, AddSlideSchema, ApplyLayoutSchema, ApplyTemplateSchema, ApplyThemePresetSchema, ArrangeElementsSchema, BatchUpdateElementsSchema, CloneElementSchema, ConvertToMarkdownSchema, CreateChartSchema, DeleteElementsSchema, DeleteSlidesSchema, DuplicateSlideSchema, ExportSlideSvgSchema, ExportToSvgSchema, FindPlaceholdersSchema, FindTextSchema, GetLayoutsSchema, GetMetadataSchema, GetPresentationPropertiesSchema, GetSlideSchema, GetThemeInfoSchema, GroupElementsSchema, ManageCommentsSchema, ManageHyperlinksSchema, ManageSectionsSchema, ManageSmartArtSchema, ManageTableStructureSchema, RemoveChartSeriesSchema, ReorderSlidesSchema, RepairPresentationSchema, ReplaceGeometrySchema, ReplaceTextSchema, SetCanvasSizeSchema, SetElementAnimationSchema, SetElementLockSchema, SetSlideTransitionSchema, UngroupElementsSchema, UpdateChartSchema, UpdateChartSeriesDataSchema, UpdateElementSchema, UpdateElementStyleSchema, UpdateMetadataSchema, UpdatePresentationPropertiesSchema, UpdateSlidePropertiesSchema, UpdateTableCellsSchema, UpdateThemeColorsSchema, UpdateThemeFontsSchema, ValidatePresentationSchema };
508
+ export { AccessibilityCheckSchema, AddChartSeriesSchema, AddElementSchema, AddSlideSchema, ApplyLayoutSchema, ApplyTemplateSchema, ApplyThemePresetSchema, ArrangeElementsSchema, BatchUpdateElementsSchema, CloneElementSchema, ConvertToMarkdownSchema, CreateChartSchema, DeleteElementsSchema, DeleteSlidesSchema, DuplicateSlideSchema, ExportSlideSvgSchema, ExportToJsonSchema, ExportToSvgSchema, FindPlaceholdersSchema, FindTextSchema, GetLayoutsSchema, GetMetadataSchema, GetPresentationPropertiesSchema, GetSlideSchema, GetThemeInfoSchema, GroupElementsSchema, ImportFromJsonSchema, ManageCommentsSchema, ManageHyperlinksSchema, ManageSectionsSchema, ManageSmartArtSchema, ManageTableStructureSchema, RemoveChartSeriesSchema, RenameElementSchema, ReorderSlidesSchema, RepairPresentationSchema, ReplaceGeometrySchema, ReplaceTextSchema, SetCanvasSizeSchema, SetElementAnimationSchema, SetElementLockSchema, SetSlideTransitionSchema, UngroupElementsSchema, UpdateChartSchema, UpdateChartSeriesDataSchema, UpdateElementSchema, UpdateElementStyleSchema, UpdateMetadataSchema, UpdatePresentationPropertiesSchema, UpdateSlidePropertiesSchema, UpdateTableCellsSchema, UpdateThemeColorsSchema, UpdateThemeFontsSchema, ValidatePresentationSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptx-viewer-mcp",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "PowerPoint PPTX tools and MCP server: manipulate, convert, and collaborate on .pptx files from AI agents.",
5
5
  "keywords": [
6
6
  "ai",