@slidev/cli 52.18.1 → 52.19.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.
@@ -1,4 +1,4 @@
1
- import { n as resolveViteConfigs } from "./serve-C3LqO47C.mjs";
1
+ import { n as resolveViteConfigs } from "./serve-CY7V3bOt.mjs";
2
2
  import { join, resolve } from "pathe";
3
3
  import { build as build$1 } from "vite";
4
4
  import { existsSync } from "node:fs";
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { i as isInstalledGlobally, o as resolveEntry } from "./resolver-BIhhHpe7.mjs";
2
- import { c as getThemeMeta, d as loadSetups, f as updateFrontmatterPatch, l as resolveTheme, o as resolveOptions, s as parser, t as createServer, u as version } from "./serve-C3LqO47C.mjs";
2
+ import { c as getThemeMeta, d as loadSetups, f as updateFrontmatterPatch, l as resolveTheme, o as resolveOptions, s as parser, t as createServer, u as version } from "./serve-CY7V3bOt.mjs";
3
3
  import process from "node:process";
4
4
  import path from "pathe";
5
5
  import fs from "node:fs/promises";
@@ -302,7 +302,7 @@ cli.command("build [entry..]", "Build hostable SPA", (args) => exportOptions(com
302
302
  describe: "enable the inspect plugin for debugging"
303
303
  }).strict().help(), async (args) => {
304
304
  const { entry, theme, base, download, out, inspect, "without-notes": withoutNotes, "router-mode": routerMode } = args;
305
- const { build } = await import("./build-CMhuImLu.mjs");
305
+ const { build } = await import("./build-rtQk8gSn.mjs");
306
306
  for (const entryFile of entry) {
307
307
  const options = await resolveOptions({
308
308
  entry: entryFile,
@@ -331,7 +331,7 @@ cli.command("format [entry..]", "Format the markdown file", (args) => commonOpti
331
331
  }
332
332
  });
333
333
  cli.command("mcp [entry]", "Start an MCP (Model Context Protocol) server over stdio for AI agents to inspect and edit the slides", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
334
- const { startMcpStdioServer } = await import("./stdio-BBaEvAO6.mjs");
334
+ const { startMcpStdioServer } = await import("./stdio-TyXSpxhg.mjs");
335
335
  await startMcpStdioServer(await resolveEntry(entry));
336
336
  });
337
337
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as createDataUtils, o as resolveOptions, r as ViteSlidevPlugin, s as parser, t as createServer } from "./serve-C3LqO47C.mjs";
1
+ import { a as createDataUtils, o as resolveOptions, r as ViteSlidevPlugin, s as parser, t as createServer } from "./serve-CY7V3bOt.mjs";
2
2
  export { ViteSlidevPlugin, createDataUtils, createServer, parser, resolveOptions };
@@ -40,8 +40,8 @@ import lz from "lz-string";
40
40
  import { encode } from "plantuml-encoder";
41
41
  import { SourceMapConsumer } from "source-map-js";
42
42
  import { fromAsyncCodeToHtml } from "@shikijs/markdown-it/async";
43
- import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
44
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
43
+ import { NodeStreamableHTTPServerTransport } from "@modelcontextprotocol/node";
44
+ import { McpServer } from "@modelcontextprotocol/server";
45
45
  import { z } from "zod";
46
46
  import ServerRef from "vite-plugin-vue-server-ref";
47
47
  import UnoCSS from "unocss/vite";
@@ -712,7 +712,7 @@ function createLayoutWrapperPlugin({ data, utils }) {
712
712
  }
713
713
  //#endregion
714
714
  //#region package.json
715
- var version = "52.18.1";
715
+ var version = "52.19.0";
716
716
  //#endregion
717
717
  //#region node/integrations/addons.ts
718
718
  async function resolveAddons(addonsInConfig) {
@@ -2771,7 +2771,7 @@ function slideSummary(slide) {
2771
2771
  };
2772
2772
  }
2773
2773
  const noSchema = z.number().int().min(1).describe("Slide number (1-based, as displayed in the presentation)");
2774
- const frontmatterSchema = z.record(z.any()).optional().describe("Slide frontmatter (YAML headmatter of the slide) as an object, e.g. { \"layout\": \"two-cols\" }");
2774
+ const frontmatterSchema = z.record(z.string(), z.any()).optional().describe("Slide frontmatter (YAML headmatter of the slide) as an object, e.g. { \"layout\": \"two-cols\" }");
2775
2775
  /**
2776
2776
  * Create the Slidev MCP server exposing tools for agents to inspect, edit,
2777
2777
  * and (with a running dev server) navigate a slides deck.
@@ -2820,7 +2820,7 @@ function createSlidevMcpServer(ctx) {
2820
2820
  server.registerTool("slidev-get-slide", {
2821
2821
  title: "Get slide",
2822
2822
  description: "Get the full source of one slide: frontmatter, Markdown content, and speaker note.",
2823
- inputSchema: { no: noSchema },
2823
+ inputSchema: z.object({ no: noSchema }),
2824
2824
  annotations: { readOnlyHint: true }
2825
2825
  }, async ({ no }) => {
2826
2826
  const slide = resolveSlide(await ctx.getData(), no);
@@ -2835,12 +2835,12 @@ function createSlidevMcpServer(ctx) {
2835
2835
  server.registerTool("slidev-update-slide", {
2836
2836
  title: "Update slide",
2837
2837
  description: "Update the content, speaker note, and/or frontmatter of a slide. Only the provided fields are changed. Pass an empty string to clear the content or note. In `frontmatter`, only the given keys are patched; pass `null` as a value to delete that key.",
2838
- inputSchema: {
2838
+ inputSchema: z.object({
2839
2839
  no: noSchema,
2840
2840
  content: z.string().optional().describe("New Markdown content of the slide (without frontmatter and note)"),
2841
2841
  note: z.string().optional().describe("New speaker note (Markdown, stored as a trailing HTML comment)"),
2842
2842
  frontmatter: frontmatterSchema
2843
- }
2843
+ })
2844
2844
  }, async ({ no, content, note, frontmatter }) => {
2845
2845
  if (content == null && note == null && frontmatter == null) throw new Error("Nothing to update: provide at least one of `content`, `note`, or `frontmatter`.");
2846
2846
  const { slide } = await applySlidePatch(await ctx.getData(), no, {
@@ -2853,12 +2853,12 @@ function createSlidevMcpServer(ctx) {
2853
2853
  server.registerTool("slidev-insert-slide", {
2854
2854
  title: "Insert slide",
2855
2855
  description: "Insert a new slide after an existing slide (into the same markdown file). To add a slide at the very end, pass the last slide number.",
2856
- inputSchema: {
2856
+ inputSchema: z.object({
2857
2857
  after: z.number().int().min(1).describe("Slide number (1-based) after which the new slide is inserted"),
2858
2858
  content: z.string().describe("Markdown content of the new slide"),
2859
2859
  frontmatter: frontmatterSchema,
2860
2860
  note: z.string().optional().describe("Speaker note of the new slide")
2861
- }
2861
+ })
2862
2862
  }, async ({ after, content, frontmatter, note }) => {
2863
2863
  const { filepath } = await insertSlide(await ctx.getData(), {
2864
2864
  after,
@@ -2871,7 +2871,7 @@ function createSlidevMcpServer(ctx) {
2871
2871
  server.registerTool("slidev-remove-slide", {
2872
2872
  title: "Remove slide",
2873
2873
  description: "Remove a slide from the deck (deletes it from its source markdown file).",
2874
- inputSchema: { no: noSchema },
2874
+ inputSchema: z.object({ no: noSchema }),
2875
2875
  annotations: { destructiveHint: true }
2876
2876
  }, async ({ no }) => {
2877
2877
  const { removed, filepath } = await removeSlide(await ctx.getData(), no);
@@ -2880,11 +2880,11 @@ function createSlidevMcpServer(ctx) {
2880
2880
  server.registerTool("slidev-move-slide", {
2881
2881
  title: "Move slide",
2882
2882
  description: "Move a slide before or after another slide to reorder the deck. Both slides must be in the same markdown file. To swap two adjacent slides, move one after the other.",
2883
- inputSchema: {
2883
+ inputSchema: z.object({
2884
2884
  from: z.number().int().min(1).describe("Slide number (1-based) of the slide to move"),
2885
2885
  before: z.number().int().min(1).optional().describe("Move the slide right before this slide number"),
2886
2886
  after: z.number().int().min(1).optional().describe("Move the slide right after this slide number")
2887
- }
2887
+ })
2888
2888
  }, async ({ from, before, after }) => {
2889
2889
  const { filepath } = await moveSlide(await ctx.getData(), {
2890
2890
  from,
@@ -2898,10 +2898,10 @@ function createSlidevMcpServer(ctx) {
2898
2898
  server.registerTool("slidev-goto-slide", {
2899
2899
  title: "Go to slide",
2900
2900
  description: "Navigate the live presentation (all connected browsers) to a given slide, e.g. to visually verify a slide after editing it.",
2901
- inputSchema: {
2901
+ inputSchema: z.object({
2902
2902
  no: noSchema,
2903
2903
  clicks: z.number().int().min(0).optional().describe("Click animation step to reveal (defaults to 0)")
2904
- },
2904
+ }),
2905
2905
  annotations: { idempotentHint: true }
2906
2906
  }, async ({ no, clicks }) => {
2907
2907
  resolveSlide(await ctx.getData(), no);
@@ -3063,7 +3063,7 @@ function createMcpPlugin(options) {
3063
3063
  }
3064
3064
  try {
3065
3065
  const mcp = createSlidevMcpServer(ctx);
3066
- const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: void 0 });
3066
+ const transport = new NodeStreamableHTTPServerTransport({ sessionIdGenerator: void 0 });
3067
3067
  res.on("close", () => {
3068
3068
  transport.close();
3069
3069
  mcp.close();
@@ -1,6 +1,6 @@
1
1
  import { n as getRoots } from "./resolver-BIhhHpe7.mjs";
2
- import { i as createSlidevMcpServer, s as parser, u as version } from "./serve-C3LqO47C.mjs";
3
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
2
+ import { i as createSlidevMcpServer, s as parser, u as version } from "./serve-CY7V3bOt.mjs";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
4
4
  //#region node/mcp/stdio.ts
5
5
  /**
6
6
  * Start a Slidev MCP server over stdio, operating on the markdown files
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
3
  "type": "module",
4
- "version": "52.18.1",
4
+ "version": "52.19.0",
5
5
  "description": "Presentation slides for developers",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -50,15 +50,16 @@
50
50
  "@antfu/ni": "^30.3.0",
51
51
  "@antfu/utils": "^9.3.0",
52
52
  "@comark/markdown-it": "^0.3.4",
53
- "@iconify-json/carbon": "^1.2.24",
53
+ "@iconify-json/carbon": "^1.2.25",
54
54
  "@iconify-json/ph": "^1.2.2",
55
55
  "@iconify-json/svg-spinners": "^1.2.4",
56
56
  "@lillallol/outline-pdf": "^4.0.0",
57
- "@modelcontextprotocol/sdk": "^1.30.0",
58
- "@shikijs/magic-move": "^4.3.1",
59
- "@shikijs/markdown-it": "^4.3.1",
60
- "@shikijs/twoslash": "^4.3.1",
61
- "@shikijs/vitepress-twoslash": "^4.3.1",
57
+ "@modelcontextprotocol/node": "^2.0.0",
58
+ "@modelcontextprotocol/server": "^2.0.0",
59
+ "@shikijs/magic-move": "^4.4.1",
60
+ "@shikijs/markdown-it": "^4.4.1",
61
+ "@shikijs/twoslash": "^4.4.1",
62
+ "@shikijs/vitepress-twoslash": "^4.4.1",
62
63
  "@unocss/extractor-mdc": "^66.7.5",
63
64
  "@unocss/reset": "^66.7.5",
64
65
  "@vitejs/plugin-vue": "^6.0.8",
@@ -90,14 +91,14 @@
90
91
  "pdf-lib": "^1.17.1",
91
92
  "picomatch": "^4.0.5",
92
93
  "plantuml-encoder": "^1.4.0",
93
- "postcss-nested": "^7.0.2",
94
+ "postcss-nested": "^8.0.0",
94
95
  "pptxgenjs": "^4.0.1",
95
96
  "prompts": "^2.4.2",
96
97
  "public-ip": "^8.0.0",
97
98
  "resolve-from": "^5.0.0",
98
99
  "resolve-global": "^2.0.0",
99
100
  "semver": "^7.8.5",
100
- "shiki": "^4.3.1",
101
+ "shiki": "^4.4.1",
101
102
  "sirv": "^3.0.2",
102
103
  "source-map-js": "^1.2.1",
103
104
  "typescript": "^6.0.3",
@@ -108,8 +109,8 @@
108
109
  "unplugin-vue-markdown": "^32.0.0",
109
110
  "untun": "^0.2.2",
110
111
  "uqr": "^0.1.3",
111
- "vite": "^8.1.5",
112
- "vite-plugin-inspect": "^11.4.1",
112
+ "vite": "^8.2.0",
113
+ "vite-plugin-inspect": "^12.0.2",
113
114
  "vite-plugin-remote-assets": "^2.1.0",
114
115
  "vite-plugin-static-copy": "^4.1.1",
115
116
  "vite-plugin-vue-server-ref": "^1.0.0",
@@ -117,10 +118,10 @@
117
118
  "vue": "^3.5.40",
118
119
  "yaml": "^2.9.0",
119
120
  "yargs": "^18.1.0",
120
- "zod": "^3.25.76",
121
- "@slidev/parser": "52.18.1",
122
- "@slidev/client": "52.18.1",
123
- "@slidev/types": "52.18.1"
121
+ "zod": "^4.4.3",
122
+ "@slidev/client": "52.19.0",
123
+ "@slidev/parser": "52.19.0",
124
+ "@slidev/types": "52.19.0"
124
125
  },
125
126
  "devDependencies": {
126
127
  "@hedgedoc/markdown-it-plugins": "^2.1.4",