pptx-viewer-mcp 1.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/README.md +146 -0
- package/dist/codec/index.d.mts +26 -0
- package/dist/codec/index.d.ts +26 -0
- package/dist/codec/index.js +241 -0
- package/dist/codec/index.mjs +238 -0
- package/dist/index.d.mts +480 -0
- package/dist/index.d.ts +480 -0
- package/dist/index.js +1581 -0
- package/dist/index.mjs +1547 -0
- package/dist/mcp/index.d.mts +1 -0
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.js +2339 -0
- package/dist/mcp/index.mjs +2337 -0
- package/dist/schemas/index.d.mts +728 -0
- package/dist/schemas/index.d.ts +728 -0
- package/dist/schemas/index.js +285 -0
- package/dist/schemas/index.mjs +259 -0
- package/package.json +87 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var zod = require('zod');
|
|
4
|
+
|
|
5
|
+
// src/schemas/slide-schemas.ts
|
|
6
|
+
var GetSlideSchema = zod.z.object({
|
|
7
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
8
|
+
slideIndex: zod.z.number().int().min(0).describe("Zero-based slide index")
|
|
9
|
+
});
|
|
10
|
+
var AddSlideSchema = zod.z.object({
|
|
11
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
12
|
+
insertAfterIndex: zod.z.number().int().min(0).optional().describe("Insert after this slide index"),
|
|
13
|
+
backgroundColor: zod.z.string().optional().describe("Background color (hex)")
|
|
14
|
+
});
|
|
15
|
+
var DeleteSlidesSchema = zod.z.object({
|
|
16
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
17
|
+
slideIndexes: zod.z.array(zod.z.number().int().min(0)).min(1).describe("Slide indexes to delete")
|
|
18
|
+
});
|
|
19
|
+
var ReorderSlidesSchema = zod.z.object({
|
|
20
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
21
|
+
newOrder: zod.z.array(zod.z.number().int().min(0)).min(1).describe("New slide order as array of indexes")
|
|
22
|
+
});
|
|
23
|
+
var DuplicateSlideSchema = zod.z.object({
|
|
24
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
25
|
+
slideIndex: zod.z.number().int().min(0).describe("Slide to duplicate"),
|
|
26
|
+
targetIndex: zod.z.number().int().min(0).optional().describe("Where to insert the duplicate")
|
|
27
|
+
});
|
|
28
|
+
var UpdateSlidePropertiesSchema = zod.z.object({
|
|
29
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
30
|
+
slideIndex: zod.z.number().int().min(0).describe("Zero-based slide index"),
|
|
31
|
+
backgroundColor: zod.z.string().optional().describe("Background color (hex)"),
|
|
32
|
+
backgroundGradient: zod.z.string().optional().describe("Background gradient CSS"),
|
|
33
|
+
backgroundImage: zod.z.string().optional().describe("Background image data URL"),
|
|
34
|
+
notes: zod.z.string().optional().describe("Speaker notes text"),
|
|
35
|
+
hidden: zod.z.boolean().optional().describe("Whether slide is hidden")
|
|
36
|
+
});
|
|
37
|
+
var SetSlideTransitionSchema = zod.z.object({
|
|
38
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
39
|
+
slideIndex: zod.z.number().int().min(0).describe("Zero-based slide index"),
|
|
40
|
+
type: zod.z.string().describe('Transition type (e.g. "fade", "wipe", "none")'),
|
|
41
|
+
durationMs: zod.z.number().int().min(0).optional().describe("Duration in ms"),
|
|
42
|
+
direction: zod.z.string().optional().describe('Direction (e.g. "left", "right")'),
|
|
43
|
+
advanceOnClick: zod.z.boolean().optional().describe("Advance on mouse click"),
|
|
44
|
+
advanceAfterMs: zod.z.number().int().min(0).optional().describe("Auto-advance after ms")
|
|
45
|
+
});
|
|
46
|
+
var SetCanvasSizeSchema = zod.z.object({
|
|
47
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
48
|
+
width: zod.z.number().positive().describe("Canvas width in points"),
|
|
49
|
+
height: zod.z.number().positive().describe("Canvas height in points")
|
|
50
|
+
});
|
|
51
|
+
var ConvertToMarkdownSchema = zod.z.object({
|
|
52
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
53
|
+
outputDir: zod.z.string().optional().describe("Output directory for markdown and media"),
|
|
54
|
+
mediaFolderName: zod.z.string().optional().describe("Name for extracted media folder"),
|
|
55
|
+
includeMetadata: zod.z.boolean().optional().describe("Include presentation metadata"),
|
|
56
|
+
slideRange: zod.z.object({
|
|
57
|
+
start: zod.z.number().int().min(0).optional(),
|
|
58
|
+
end: zod.z.number().int().min(0).optional()
|
|
59
|
+
}).optional().describe("Slide range to convert"),
|
|
60
|
+
includeSpeakerNotes: zod.z.boolean().optional().describe("Include speaker notes"),
|
|
61
|
+
semanticMode: zod.z.boolean().optional().describe("Use semantic (clean) markdown mode")
|
|
62
|
+
});
|
|
63
|
+
var AccessibilityCheckSchema = zod.z.object({
|
|
64
|
+
filePath: zod.z.string().describe("Path to the PPTX file")
|
|
65
|
+
});
|
|
66
|
+
var AddElementSchema = zod.z.object({
|
|
67
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
68
|
+
slideIndex: zod.z.number().int().min(0).describe("Zero-based slide index"),
|
|
69
|
+
type: zod.z.enum(["text", "shape", "image", "table", "connector"]).describe("Element type to add"),
|
|
70
|
+
x: zod.z.number().optional().describe("X position in points"),
|
|
71
|
+
y: zod.z.number().optional().describe("Y position in points"),
|
|
72
|
+
width: zod.z.number().optional().describe("Width in points"),
|
|
73
|
+
height: zod.z.number().optional().describe("Height in points"),
|
|
74
|
+
text: zod.z.string().optional().describe("Text content"),
|
|
75
|
+
fontSize: zod.z.number().optional().describe("Font size in points"),
|
|
76
|
+
fontFamily: zod.z.string().optional().describe("Font family name"),
|
|
77
|
+
fontColor: zod.z.string().optional().describe("Font color (hex)"),
|
|
78
|
+
bold: zod.z.boolean().optional().describe("Bold text"),
|
|
79
|
+
italic: zod.z.boolean().optional().describe("Italic text"),
|
|
80
|
+
underline: zod.z.boolean().optional().describe("Underline text"),
|
|
81
|
+
alignment: zod.z.enum(["left", "center", "right", "justify"]).optional().describe("Text alignment"),
|
|
82
|
+
shapeType: zod.z.string().optional().describe('Shape type (e.g. "rect", "ellipse")'),
|
|
83
|
+
fillColor: zod.z.string().optional().describe("Fill color (hex)"),
|
|
84
|
+
strokeColor: zod.z.string().optional().describe("Stroke color (hex)"),
|
|
85
|
+
strokeWidth: zod.z.number().optional().describe("Stroke width in points"),
|
|
86
|
+
imageData: zod.z.string().optional().describe("Image as base64 data URL"),
|
|
87
|
+
altText: zod.z.string().optional().describe("Alt text for accessibility"),
|
|
88
|
+
rows: zod.z.number().int().min(1).optional().describe("Number of table rows"),
|
|
89
|
+
columns: zod.z.number().int().min(1).optional().describe("Number of table columns"),
|
|
90
|
+
cellData: zod.z.array(zod.z.array(zod.z.string())).optional().describe("Table cell data as 2D array"),
|
|
91
|
+
headerRow: zod.z.boolean().optional().describe("Style first row as header"),
|
|
92
|
+
startArrow: zod.z.string().optional().describe("Start arrow type"),
|
|
93
|
+
endArrow: zod.z.string().optional().describe("End arrow type"),
|
|
94
|
+
startShapeId: zod.z.string().optional().describe("Connect start to shape ID"),
|
|
95
|
+
endShapeId: zod.z.string().optional().describe("Connect end to shape ID")
|
|
96
|
+
});
|
|
97
|
+
var UpdateElementSchema = zod.z.object({
|
|
98
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
99
|
+
slideIndex: zod.z.number().int().min(0).describe("Zero-based slide index"),
|
|
100
|
+
elementId: zod.z.string().describe("Element ID to update"),
|
|
101
|
+
x: zod.z.number().optional(),
|
|
102
|
+
y: zod.z.number().optional(),
|
|
103
|
+
width: zod.z.number().optional(),
|
|
104
|
+
height: zod.z.number().optional(),
|
|
105
|
+
rotation: zod.z.number().optional(),
|
|
106
|
+
text: zod.z.string().optional(),
|
|
107
|
+
fontSize: zod.z.number().optional(),
|
|
108
|
+
fontFamily: zod.z.string().optional(),
|
|
109
|
+
fontColor: zod.z.string().optional(),
|
|
110
|
+
bold: zod.z.boolean().optional(),
|
|
111
|
+
italic: zod.z.boolean().optional(),
|
|
112
|
+
underline: zod.z.boolean().optional(),
|
|
113
|
+
alignment: zod.z.enum(["left", "center", "right", "justify"]).optional(),
|
|
114
|
+
fillColor: zod.z.string().optional(),
|
|
115
|
+
strokeColor: zod.z.string().optional(),
|
|
116
|
+
strokeWidth: zod.z.number().optional(),
|
|
117
|
+
opacity: zod.z.number().min(0).max(1).optional(),
|
|
118
|
+
hidden: zod.z.boolean().optional(),
|
|
119
|
+
flipH: zod.z.boolean().optional(),
|
|
120
|
+
flipV: zod.z.boolean().optional()
|
|
121
|
+
});
|
|
122
|
+
var DeleteElementsSchema = zod.z.object({
|
|
123
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
124
|
+
slideIndex: zod.z.number().int().min(0),
|
|
125
|
+
elementIds: zod.z.array(zod.z.string()).min(1).describe("Element IDs to delete")
|
|
126
|
+
});
|
|
127
|
+
var ArrangeElementsSchema = zod.z.object({
|
|
128
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
129
|
+
slideIndex: zod.z.number().int().min(0),
|
|
130
|
+
action: zod.z.enum(["align", "reorderLayer"]),
|
|
131
|
+
elementIds: zod.z.array(zod.z.string()).optional().describe("Element IDs (for align)"),
|
|
132
|
+
alignment: zod.z.enum(["left", "right", "top", "bottom", "centerH", "centerV"]).optional(),
|
|
133
|
+
elementId: zod.z.string().optional().describe("Element ID (for reorderLayer)"),
|
|
134
|
+
layerAction: zod.z.enum(["bringForward", "sendBackward", "bringToFront", "sendToBack"]).optional()
|
|
135
|
+
});
|
|
136
|
+
var CloneElementSchema = zod.z.object({
|
|
137
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
138
|
+
slideIndex: zod.z.number().int().min(0),
|
|
139
|
+
elementId: zod.z.string(),
|
|
140
|
+
targetSlideIndexes: zod.z.array(zod.z.number().int().min(0)).optional(),
|
|
141
|
+
offsetX: zod.z.number().optional(),
|
|
142
|
+
offsetY: zod.z.number().optional()
|
|
143
|
+
});
|
|
144
|
+
var SetElementAnimationSchema = zod.z.object({
|
|
145
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
146
|
+
slideIndex: zod.z.number().int().min(0),
|
|
147
|
+
elementId: zod.z.string(),
|
|
148
|
+
entrance: zod.z.string().optional(),
|
|
149
|
+
exit: zod.z.string().optional(),
|
|
150
|
+
durationMs: zod.z.number().optional(),
|
|
151
|
+
delayMs: zod.z.number().optional(),
|
|
152
|
+
order: zod.z.number().optional()
|
|
153
|
+
});
|
|
154
|
+
var GroupElementsSchema = zod.z.object({
|
|
155
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
156
|
+
slideIndex: zod.z.number().int().min(0),
|
|
157
|
+
elementIds: zod.z.array(zod.z.string()).min(2).describe("At least 2 element IDs to group")
|
|
158
|
+
});
|
|
159
|
+
var UngroupElementsSchema = zod.z.object({
|
|
160
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
161
|
+
slideIndex: zod.z.number().int().min(0),
|
|
162
|
+
groupElementId: zod.z.string().describe("Group element ID to ungroup")
|
|
163
|
+
});
|
|
164
|
+
var BatchUpdateElementsSchema = zod.z.object({
|
|
165
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
166
|
+
slideIndex: zod.z.number().int().min(0),
|
|
167
|
+
elementIds: zod.z.array(zod.z.string()).min(1),
|
|
168
|
+
x: zod.z.number().optional(),
|
|
169
|
+
y: zod.z.number().optional(),
|
|
170
|
+
width: zod.z.number().optional(),
|
|
171
|
+
height: zod.z.number().optional(),
|
|
172
|
+
rotation: zod.z.number().optional(),
|
|
173
|
+
opacity: zod.z.number().min(0).max(1).optional(),
|
|
174
|
+
hidden: zod.z.boolean().optional()
|
|
175
|
+
});
|
|
176
|
+
var UpdateTableCellsSchema = zod.z.object({
|
|
177
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
178
|
+
slideIndex: zod.z.number().int().min(0),
|
|
179
|
+
elementId: zod.z.string().describe("Table element ID"),
|
|
180
|
+
cells: zod.z.array(
|
|
181
|
+
zod.z.object({
|
|
182
|
+
row: zod.z.number().int().min(0),
|
|
183
|
+
col: zod.z.number().int().min(0),
|
|
184
|
+
text: zod.z.string()
|
|
185
|
+
})
|
|
186
|
+
).min(1).describe("Cells to update")
|
|
187
|
+
});
|
|
188
|
+
var ManageTableStructureSchema = zod.z.object({
|
|
189
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
190
|
+
slideIndex: zod.z.number().int().min(0),
|
|
191
|
+
elementId: zod.z.string().describe("Table element ID"),
|
|
192
|
+
action: zod.z.enum(["insertRow", "deleteRow", "insertColumn", "deleteColumn"]),
|
|
193
|
+
position: zod.z.number().int().min(0).optional().describe("Insertion position index"),
|
|
194
|
+
referenceIndex: zod.z.number().int().min(0).optional(),
|
|
195
|
+
cellTexts: zod.z.array(zod.z.string()).optional()
|
|
196
|
+
});
|
|
197
|
+
var UpdateElementStyleSchema = zod.z.object({
|
|
198
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
199
|
+
slideIndex: zod.z.number().int().min(0),
|
|
200
|
+
elementId: zod.z.string(),
|
|
201
|
+
fillColor: zod.z.string().optional(),
|
|
202
|
+
fillMode: zod.z.string().optional(),
|
|
203
|
+
fillGradientStops: zod.z.array(
|
|
204
|
+
zod.z.object({
|
|
205
|
+
color: zod.z.string(),
|
|
206
|
+
position: zod.z.number(),
|
|
207
|
+
opacity: zod.z.number().optional()
|
|
208
|
+
})
|
|
209
|
+
).optional(),
|
|
210
|
+
fillGradientAngle: zod.z.number().optional(),
|
|
211
|
+
fillGradientType: zod.z.string().optional(),
|
|
212
|
+
fillOpacity: zod.z.number().optional(),
|
|
213
|
+
strokeColor: zod.z.string().optional(),
|
|
214
|
+
strokeWidth: zod.z.number().optional(),
|
|
215
|
+
strokeDash: zod.z.string().optional(),
|
|
216
|
+
strokeOpacity: zod.z.number().optional(),
|
|
217
|
+
shadowColor: zod.z.string().optional(),
|
|
218
|
+
shadowBlur: zod.z.number().optional(),
|
|
219
|
+
shadowOffsetX: zod.z.number().optional(),
|
|
220
|
+
shadowOffsetY: zod.z.number().optional(),
|
|
221
|
+
shadowOpacity: zod.z.number().optional(),
|
|
222
|
+
glowColor: zod.z.string().optional(),
|
|
223
|
+
glowRadius: zod.z.number().optional(),
|
|
224
|
+
glowOpacity: zod.z.number().optional(),
|
|
225
|
+
softEdgeRadius: zod.z.number().optional(),
|
|
226
|
+
cropLeft: zod.z.number().optional(),
|
|
227
|
+
cropTop: zod.z.number().optional(),
|
|
228
|
+
cropRight: zod.z.number().optional(),
|
|
229
|
+
cropBottom: zod.z.number().optional(),
|
|
230
|
+
brightness: zod.z.number().optional(),
|
|
231
|
+
contrast: zod.z.number().optional(),
|
|
232
|
+
grayscale: zod.z.boolean().optional(),
|
|
233
|
+
altText: zod.z.string().optional()
|
|
234
|
+
});
|
|
235
|
+
var FindTextSchema = zod.z.object({
|
|
236
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
237
|
+
query: zod.z.string().describe("Text to search for"),
|
|
238
|
+
useRegex: zod.z.boolean().optional().describe("Treat query as regex"),
|
|
239
|
+
caseSensitive: zod.z.boolean().optional().describe("Case-sensitive search"),
|
|
240
|
+
slideIndexes: zod.z.array(zod.z.number().int().min(0)).optional().describe("Limit search to specific slides")
|
|
241
|
+
});
|
|
242
|
+
var ReplaceTextSchema = zod.z.object({
|
|
243
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
244
|
+
query: zod.z.string().describe("Text to find"),
|
|
245
|
+
replacement: zod.z.string().describe("Replacement text"),
|
|
246
|
+
useRegex: zod.z.boolean().optional(),
|
|
247
|
+
caseSensitive: zod.z.boolean().optional(),
|
|
248
|
+
slideIndexes: zod.z.array(zod.z.number().int().min(0)).optional()
|
|
249
|
+
});
|
|
250
|
+
var ManageCommentsSchema = zod.z.object({
|
|
251
|
+
filePath: zod.z.string().describe("Path to the PPTX file"),
|
|
252
|
+
action: zod.z.enum(["list", "add", "delete", "resolve"]),
|
|
253
|
+
slideIndex: zod.z.number().int().min(0).optional(),
|
|
254
|
+
text: zod.z.string().optional(),
|
|
255
|
+
author: zod.z.string().optional(),
|
|
256
|
+
commentId: zod.z.string().optional(),
|
|
257
|
+
resolved: zod.z.boolean().optional(),
|
|
258
|
+
includeResolved: zod.z.boolean().optional()
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
exports.AccessibilityCheckSchema = AccessibilityCheckSchema;
|
|
262
|
+
exports.AddElementSchema = AddElementSchema;
|
|
263
|
+
exports.AddSlideSchema = AddSlideSchema;
|
|
264
|
+
exports.ArrangeElementsSchema = ArrangeElementsSchema;
|
|
265
|
+
exports.BatchUpdateElementsSchema = BatchUpdateElementsSchema;
|
|
266
|
+
exports.CloneElementSchema = CloneElementSchema;
|
|
267
|
+
exports.ConvertToMarkdownSchema = ConvertToMarkdownSchema;
|
|
268
|
+
exports.DeleteElementsSchema = DeleteElementsSchema;
|
|
269
|
+
exports.DeleteSlidesSchema = DeleteSlidesSchema;
|
|
270
|
+
exports.DuplicateSlideSchema = DuplicateSlideSchema;
|
|
271
|
+
exports.FindTextSchema = FindTextSchema;
|
|
272
|
+
exports.GetSlideSchema = GetSlideSchema;
|
|
273
|
+
exports.GroupElementsSchema = GroupElementsSchema;
|
|
274
|
+
exports.ManageCommentsSchema = ManageCommentsSchema;
|
|
275
|
+
exports.ManageTableStructureSchema = ManageTableStructureSchema;
|
|
276
|
+
exports.ReorderSlidesSchema = ReorderSlidesSchema;
|
|
277
|
+
exports.ReplaceTextSchema = ReplaceTextSchema;
|
|
278
|
+
exports.SetCanvasSizeSchema = SetCanvasSizeSchema;
|
|
279
|
+
exports.SetElementAnimationSchema = SetElementAnimationSchema;
|
|
280
|
+
exports.SetSlideTransitionSchema = SetSlideTransitionSchema;
|
|
281
|
+
exports.UngroupElementsSchema = UngroupElementsSchema;
|
|
282
|
+
exports.UpdateElementSchema = UpdateElementSchema;
|
|
283
|
+
exports.UpdateElementStyleSchema = UpdateElementStyleSchema;
|
|
284
|
+
exports.UpdateSlidePropertiesSchema = UpdateSlidePropertiesSchema;
|
|
285
|
+
exports.UpdateTableCellsSchema = UpdateTableCellsSchema;
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/schemas/slide-schemas.ts
|
|
4
|
+
var GetSlideSchema = z.object({
|
|
5
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
6
|
+
slideIndex: z.number().int().min(0).describe("Zero-based slide index")
|
|
7
|
+
});
|
|
8
|
+
var AddSlideSchema = z.object({
|
|
9
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
10
|
+
insertAfterIndex: z.number().int().min(0).optional().describe("Insert after this slide index"),
|
|
11
|
+
backgroundColor: z.string().optional().describe("Background color (hex)")
|
|
12
|
+
});
|
|
13
|
+
var DeleteSlidesSchema = z.object({
|
|
14
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
15
|
+
slideIndexes: z.array(z.number().int().min(0)).min(1).describe("Slide indexes to delete")
|
|
16
|
+
});
|
|
17
|
+
var ReorderSlidesSchema = z.object({
|
|
18
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
19
|
+
newOrder: z.array(z.number().int().min(0)).min(1).describe("New slide order as array of indexes")
|
|
20
|
+
});
|
|
21
|
+
var DuplicateSlideSchema = z.object({
|
|
22
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
23
|
+
slideIndex: z.number().int().min(0).describe("Slide to duplicate"),
|
|
24
|
+
targetIndex: z.number().int().min(0).optional().describe("Where to insert the duplicate")
|
|
25
|
+
});
|
|
26
|
+
var UpdateSlidePropertiesSchema = z.object({
|
|
27
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
28
|
+
slideIndex: z.number().int().min(0).describe("Zero-based slide index"),
|
|
29
|
+
backgroundColor: z.string().optional().describe("Background color (hex)"),
|
|
30
|
+
backgroundGradient: z.string().optional().describe("Background gradient CSS"),
|
|
31
|
+
backgroundImage: z.string().optional().describe("Background image data URL"),
|
|
32
|
+
notes: z.string().optional().describe("Speaker notes text"),
|
|
33
|
+
hidden: z.boolean().optional().describe("Whether slide is hidden")
|
|
34
|
+
});
|
|
35
|
+
var SetSlideTransitionSchema = z.object({
|
|
36
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
37
|
+
slideIndex: z.number().int().min(0).describe("Zero-based slide index"),
|
|
38
|
+
type: z.string().describe('Transition type (e.g. "fade", "wipe", "none")'),
|
|
39
|
+
durationMs: z.number().int().min(0).optional().describe("Duration in ms"),
|
|
40
|
+
direction: z.string().optional().describe('Direction (e.g. "left", "right")'),
|
|
41
|
+
advanceOnClick: z.boolean().optional().describe("Advance on mouse click"),
|
|
42
|
+
advanceAfterMs: z.number().int().min(0).optional().describe("Auto-advance after ms")
|
|
43
|
+
});
|
|
44
|
+
var SetCanvasSizeSchema = z.object({
|
|
45
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
46
|
+
width: z.number().positive().describe("Canvas width in points"),
|
|
47
|
+
height: z.number().positive().describe("Canvas height in points")
|
|
48
|
+
});
|
|
49
|
+
var ConvertToMarkdownSchema = z.object({
|
|
50
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
51
|
+
outputDir: z.string().optional().describe("Output directory for markdown and media"),
|
|
52
|
+
mediaFolderName: z.string().optional().describe("Name for extracted media folder"),
|
|
53
|
+
includeMetadata: z.boolean().optional().describe("Include presentation metadata"),
|
|
54
|
+
slideRange: z.object({
|
|
55
|
+
start: z.number().int().min(0).optional(),
|
|
56
|
+
end: z.number().int().min(0).optional()
|
|
57
|
+
}).optional().describe("Slide range to convert"),
|
|
58
|
+
includeSpeakerNotes: z.boolean().optional().describe("Include speaker notes"),
|
|
59
|
+
semanticMode: z.boolean().optional().describe("Use semantic (clean) markdown mode")
|
|
60
|
+
});
|
|
61
|
+
var AccessibilityCheckSchema = z.object({
|
|
62
|
+
filePath: z.string().describe("Path to the PPTX file")
|
|
63
|
+
});
|
|
64
|
+
var AddElementSchema = z.object({
|
|
65
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
66
|
+
slideIndex: z.number().int().min(0).describe("Zero-based slide index"),
|
|
67
|
+
type: z.enum(["text", "shape", "image", "table", "connector"]).describe("Element type to add"),
|
|
68
|
+
x: z.number().optional().describe("X position in points"),
|
|
69
|
+
y: z.number().optional().describe("Y position in points"),
|
|
70
|
+
width: z.number().optional().describe("Width in points"),
|
|
71
|
+
height: z.number().optional().describe("Height in points"),
|
|
72
|
+
text: z.string().optional().describe("Text content"),
|
|
73
|
+
fontSize: z.number().optional().describe("Font size in points"),
|
|
74
|
+
fontFamily: z.string().optional().describe("Font family name"),
|
|
75
|
+
fontColor: z.string().optional().describe("Font color (hex)"),
|
|
76
|
+
bold: z.boolean().optional().describe("Bold text"),
|
|
77
|
+
italic: z.boolean().optional().describe("Italic text"),
|
|
78
|
+
underline: z.boolean().optional().describe("Underline text"),
|
|
79
|
+
alignment: z.enum(["left", "center", "right", "justify"]).optional().describe("Text alignment"),
|
|
80
|
+
shapeType: z.string().optional().describe('Shape type (e.g. "rect", "ellipse")'),
|
|
81
|
+
fillColor: z.string().optional().describe("Fill color (hex)"),
|
|
82
|
+
strokeColor: z.string().optional().describe("Stroke color (hex)"),
|
|
83
|
+
strokeWidth: z.number().optional().describe("Stroke width in points"),
|
|
84
|
+
imageData: z.string().optional().describe("Image as base64 data URL"),
|
|
85
|
+
altText: z.string().optional().describe("Alt text for accessibility"),
|
|
86
|
+
rows: z.number().int().min(1).optional().describe("Number of table rows"),
|
|
87
|
+
columns: z.number().int().min(1).optional().describe("Number of table columns"),
|
|
88
|
+
cellData: z.array(z.array(z.string())).optional().describe("Table cell data as 2D array"),
|
|
89
|
+
headerRow: z.boolean().optional().describe("Style first row as header"),
|
|
90
|
+
startArrow: z.string().optional().describe("Start arrow type"),
|
|
91
|
+
endArrow: z.string().optional().describe("End arrow type"),
|
|
92
|
+
startShapeId: z.string().optional().describe("Connect start to shape ID"),
|
|
93
|
+
endShapeId: z.string().optional().describe("Connect end to shape ID")
|
|
94
|
+
});
|
|
95
|
+
var UpdateElementSchema = z.object({
|
|
96
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
97
|
+
slideIndex: z.number().int().min(0).describe("Zero-based slide index"),
|
|
98
|
+
elementId: z.string().describe("Element ID to update"),
|
|
99
|
+
x: z.number().optional(),
|
|
100
|
+
y: z.number().optional(),
|
|
101
|
+
width: z.number().optional(),
|
|
102
|
+
height: z.number().optional(),
|
|
103
|
+
rotation: z.number().optional(),
|
|
104
|
+
text: z.string().optional(),
|
|
105
|
+
fontSize: z.number().optional(),
|
|
106
|
+
fontFamily: z.string().optional(),
|
|
107
|
+
fontColor: z.string().optional(),
|
|
108
|
+
bold: z.boolean().optional(),
|
|
109
|
+
italic: z.boolean().optional(),
|
|
110
|
+
underline: z.boolean().optional(),
|
|
111
|
+
alignment: z.enum(["left", "center", "right", "justify"]).optional(),
|
|
112
|
+
fillColor: z.string().optional(),
|
|
113
|
+
strokeColor: z.string().optional(),
|
|
114
|
+
strokeWidth: z.number().optional(),
|
|
115
|
+
opacity: z.number().min(0).max(1).optional(),
|
|
116
|
+
hidden: z.boolean().optional(),
|
|
117
|
+
flipH: z.boolean().optional(),
|
|
118
|
+
flipV: z.boolean().optional()
|
|
119
|
+
});
|
|
120
|
+
var DeleteElementsSchema = z.object({
|
|
121
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
122
|
+
slideIndex: z.number().int().min(0),
|
|
123
|
+
elementIds: z.array(z.string()).min(1).describe("Element IDs to delete")
|
|
124
|
+
});
|
|
125
|
+
var ArrangeElementsSchema = z.object({
|
|
126
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
127
|
+
slideIndex: z.number().int().min(0),
|
|
128
|
+
action: z.enum(["align", "reorderLayer"]),
|
|
129
|
+
elementIds: z.array(z.string()).optional().describe("Element IDs (for align)"),
|
|
130
|
+
alignment: z.enum(["left", "right", "top", "bottom", "centerH", "centerV"]).optional(),
|
|
131
|
+
elementId: z.string().optional().describe("Element ID (for reorderLayer)"),
|
|
132
|
+
layerAction: z.enum(["bringForward", "sendBackward", "bringToFront", "sendToBack"]).optional()
|
|
133
|
+
});
|
|
134
|
+
var CloneElementSchema = z.object({
|
|
135
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
136
|
+
slideIndex: z.number().int().min(0),
|
|
137
|
+
elementId: z.string(),
|
|
138
|
+
targetSlideIndexes: z.array(z.number().int().min(0)).optional(),
|
|
139
|
+
offsetX: z.number().optional(),
|
|
140
|
+
offsetY: z.number().optional()
|
|
141
|
+
});
|
|
142
|
+
var SetElementAnimationSchema = z.object({
|
|
143
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
144
|
+
slideIndex: z.number().int().min(0),
|
|
145
|
+
elementId: z.string(),
|
|
146
|
+
entrance: z.string().optional(),
|
|
147
|
+
exit: z.string().optional(),
|
|
148
|
+
durationMs: z.number().optional(),
|
|
149
|
+
delayMs: z.number().optional(),
|
|
150
|
+
order: z.number().optional()
|
|
151
|
+
});
|
|
152
|
+
var GroupElementsSchema = z.object({
|
|
153
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
154
|
+
slideIndex: z.number().int().min(0),
|
|
155
|
+
elementIds: z.array(z.string()).min(2).describe("At least 2 element IDs to group")
|
|
156
|
+
});
|
|
157
|
+
var UngroupElementsSchema = z.object({
|
|
158
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
159
|
+
slideIndex: z.number().int().min(0),
|
|
160
|
+
groupElementId: z.string().describe("Group element ID to ungroup")
|
|
161
|
+
});
|
|
162
|
+
var BatchUpdateElementsSchema = z.object({
|
|
163
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
164
|
+
slideIndex: z.number().int().min(0),
|
|
165
|
+
elementIds: z.array(z.string()).min(1),
|
|
166
|
+
x: z.number().optional(),
|
|
167
|
+
y: z.number().optional(),
|
|
168
|
+
width: z.number().optional(),
|
|
169
|
+
height: z.number().optional(),
|
|
170
|
+
rotation: z.number().optional(),
|
|
171
|
+
opacity: z.number().min(0).max(1).optional(),
|
|
172
|
+
hidden: z.boolean().optional()
|
|
173
|
+
});
|
|
174
|
+
var UpdateTableCellsSchema = z.object({
|
|
175
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
176
|
+
slideIndex: z.number().int().min(0),
|
|
177
|
+
elementId: z.string().describe("Table element ID"),
|
|
178
|
+
cells: z.array(
|
|
179
|
+
z.object({
|
|
180
|
+
row: z.number().int().min(0),
|
|
181
|
+
col: z.number().int().min(0),
|
|
182
|
+
text: z.string()
|
|
183
|
+
})
|
|
184
|
+
).min(1).describe("Cells to update")
|
|
185
|
+
});
|
|
186
|
+
var ManageTableStructureSchema = z.object({
|
|
187
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
188
|
+
slideIndex: z.number().int().min(0),
|
|
189
|
+
elementId: z.string().describe("Table element ID"),
|
|
190
|
+
action: z.enum(["insertRow", "deleteRow", "insertColumn", "deleteColumn"]),
|
|
191
|
+
position: z.number().int().min(0).optional().describe("Insertion position index"),
|
|
192
|
+
referenceIndex: z.number().int().min(0).optional(),
|
|
193
|
+
cellTexts: z.array(z.string()).optional()
|
|
194
|
+
});
|
|
195
|
+
var UpdateElementStyleSchema = z.object({
|
|
196
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
197
|
+
slideIndex: z.number().int().min(0),
|
|
198
|
+
elementId: z.string(),
|
|
199
|
+
fillColor: z.string().optional(),
|
|
200
|
+
fillMode: z.string().optional(),
|
|
201
|
+
fillGradientStops: z.array(
|
|
202
|
+
z.object({
|
|
203
|
+
color: z.string(),
|
|
204
|
+
position: z.number(),
|
|
205
|
+
opacity: z.number().optional()
|
|
206
|
+
})
|
|
207
|
+
).optional(),
|
|
208
|
+
fillGradientAngle: z.number().optional(),
|
|
209
|
+
fillGradientType: z.string().optional(),
|
|
210
|
+
fillOpacity: z.number().optional(),
|
|
211
|
+
strokeColor: z.string().optional(),
|
|
212
|
+
strokeWidth: z.number().optional(),
|
|
213
|
+
strokeDash: z.string().optional(),
|
|
214
|
+
strokeOpacity: z.number().optional(),
|
|
215
|
+
shadowColor: z.string().optional(),
|
|
216
|
+
shadowBlur: z.number().optional(),
|
|
217
|
+
shadowOffsetX: z.number().optional(),
|
|
218
|
+
shadowOffsetY: z.number().optional(),
|
|
219
|
+
shadowOpacity: z.number().optional(),
|
|
220
|
+
glowColor: z.string().optional(),
|
|
221
|
+
glowRadius: z.number().optional(),
|
|
222
|
+
glowOpacity: z.number().optional(),
|
|
223
|
+
softEdgeRadius: z.number().optional(),
|
|
224
|
+
cropLeft: z.number().optional(),
|
|
225
|
+
cropTop: z.number().optional(),
|
|
226
|
+
cropRight: z.number().optional(),
|
|
227
|
+
cropBottom: z.number().optional(),
|
|
228
|
+
brightness: z.number().optional(),
|
|
229
|
+
contrast: z.number().optional(),
|
|
230
|
+
grayscale: z.boolean().optional(),
|
|
231
|
+
altText: z.string().optional()
|
|
232
|
+
});
|
|
233
|
+
var FindTextSchema = z.object({
|
|
234
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
235
|
+
query: z.string().describe("Text to search for"),
|
|
236
|
+
useRegex: z.boolean().optional().describe("Treat query as regex"),
|
|
237
|
+
caseSensitive: z.boolean().optional().describe("Case-sensitive search"),
|
|
238
|
+
slideIndexes: z.array(z.number().int().min(0)).optional().describe("Limit search to specific slides")
|
|
239
|
+
});
|
|
240
|
+
var ReplaceTextSchema = z.object({
|
|
241
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
242
|
+
query: z.string().describe("Text to find"),
|
|
243
|
+
replacement: z.string().describe("Replacement text"),
|
|
244
|
+
useRegex: z.boolean().optional(),
|
|
245
|
+
caseSensitive: z.boolean().optional(),
|
|
246
|
+
slideIndexes: z.array(z.number().int().min(0)).optional()
|
|
247
|
+
});
|
|
248
|
+
var ManageCommentsSchema = z.object({
|
|
249
|
+
filePath: z.string().describe("Path to the PPTX file"),
|
|
250
|
+
action: z.enum(["list", "add", "delete", "resolve"]),
|
|
251
|
+
slideIndex: z.number().int().min(0).optional(),
|
|
252
|
+
text: z.string().optional(),
|
|
253
|
+
author: z.string().optional(),
|
|
254
|
+
commentId: z.string().optional(),
|
|
255
|
+
resolved: z.boolean().optional(),
|
|
256
|
+
includeResolved: z.boolean().optional()
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
export { AccessibilityCheckSchema, AddElementSchema, AddSlideSchema, ArrangeElementsSchema, BatchUpdateElementsSchema, CloneElementSchema, ConvertToMarkdownSchema, DeleteElementsSchema, DeleteSlidesSchema, DuplicateSlideSchema, FindTextSchema, GetSlideSchema, GroupElementsSchema, ManageCommentsSchema, ManageTableStructureSchema, ReorderSlidesSchema, ReplaceTextSchema, SetCanvasSizeSchema, SetElementAnimationSchema, SetSlideTransitionSchema, UngroupElementsSchema, UpdateElementSchema, UpdateElementStyleSchema, UpdateSlidePropertiesSchema, UpdateTableCellsSchema };
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pptx-viewer-mcp",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "PPTX manipulation tools, MCP server, and collaboration codec for pptx-viewer-core.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"mcp",
|
|
8
|
+
"powerpoint",
|
|
9
|
+
"pptx",
|
|
10
|
+
"tools"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/ChristopherVR/pptx-viewer",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/ChristopherVR/pptx-viewer/issues"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "ChristopherVR",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/ChristopherVR/pptx-viewer.git",
|
|
21
|
+
"directory": "packages/tools"
|
|
22
|
+
},
|
|
23
|
+
"bin": {
|
|
24
|
+
"pptx-tools": "./dist/mcp/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist/",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"main": "dist/index.mjs",
|
|
32
|
+
"module": "dist/index.mjs",
|
|
33
|
+
"types": "dist/index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"import": "./dist/index.mjs",
|
|
38
|
+
"require": "./dist/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./mcp": {
|
|
41
|
+
"types": "./dist/mcp/index.d.ts",
|
|
42
|
+
"import": "./dist/mcp/index.mjs",
|
|
43
|
+
"require": "./dist/mcp/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./codec": {
|
|
46
|
+
"types": "./dist/codec/index.d.ts",
|
|
47
|
+
"import": "./dist/codec/index.mjs",
|
|
48
|
+
"require": "./dist/codec/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./schemas": {
|
|
51
|
+
"types": "./dist/schemas/index.d.ts",
|
|
52
|
+
"import": "./dist/schemas/index.mjs",
|
|
53
|
+
"require": "./dist/schemas/index.js"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsup",
|
|
58
|
+
"dev": "tsup --watch",
|
|
59
|
+
"typecheck": "tsc --noEmit --pretty",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"test:watch": "vitest",
|
|
62
|
+
"pack": "bun run build && bun pm pack"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
66
|
+
"zod": "^3.24.0"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"fast-xml-parser": "^5.5.5",
|
|
70
|
+
"jszip": "^3.10.1",
|
|
71
|
+
"pptx-viewer-core": "workspace:*",
|
|
72
|
+
"tsup": "^8.5.1",
|
|
73
|
+
"typescript": "^5.9.3",
|
|
74
|
+
"vitest": "^4.1.0",
|
|
75
|
+
"yjs": "^13.6.30"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"fast-xml-parser": "^5.5.0",
|
|
79
|
+
"jszip": "^3.10.0",
|
|
80
|
+
"pptx-viewer-core": ">=1.0.0"
|
|
81
|
+
},
|
|
82
|
+
"peerDependenciesMeta": {
|
|
83
|
+
"yjs": {
|
|
84
|
+
"optional": true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|