@pecot/visual-mcp 1.1.0 → 1.3.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/.claude-plugin/plugin.json +1 -1
- package/assets/slidev/deck-lint.config.js +2 -2
- package/assets/slidev/deck-lint.env.config.js +2 -2
- package/assets/slidev/package.json +7 -7
- package/assets/slidev/runtime/package.json +11 -11
- package/assets/slidev/scripts/eslint/_shared/dist/lib/drawio-geometry.js +10 -10
- package/assets/slidev/scripts/eslint/_shared/dist/lib/text-measurer.d.ts +2 -2
- package/assets/slidev/scripts/eslint/_shared/dist/lib/text-measurer.js +4 -4
- package/assets/slidev/scripts/eslint/_shared/dist/tsconfig.tsbuildinfo +1 -1
- package/assets/slidev/scripts/eslint/_shared/lib/drawio-geometry.ts +10 -10
- package/assets/slidev/scripts/eslint/_shared/lib/text-measurer.ts +4 -4
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-content-before-frontmatter.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-missing-marker-cell.js +4 -4
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-missing-page.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-numeric-asset-prefix.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-numeric-filename-prefix.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-scaled-drawio.js +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-triple-hyphen-in-frontmatter.js +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-unknown-props.js +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/one-slide-per-file.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/require-matching-length.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/require-slides-entry.js +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/validate-clicks.js +7 -7
- package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/tsconfig.tsbuildinfo +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-content-before-frontmatter.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-missing-marker-cell.ts +4 -4
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-missing-page.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-numeric-asset-prefix.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-numeric-filename-prefix.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-scaled-drawio.ts +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-triple-hyphen-in-frontmatter.ts +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-unknown-props.ts +3 -3
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/one-slide-per-file.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/require-matching-length.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/require-slides-entry.ts +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/validate-clicks.ts +7 -7
- package/assets/slidev/scripts/eslint/slidev-pages-lint/package.json +1 -1
- package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/max-chars.js +6 -6
- package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/textlint-body.js +3 -3
- package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/textlint.js +2 -2
- package/assets/slidev/scripts/eslint/text-constraints/dist/tsconfig.tsbuildinfo +1 -1
- package/assets/slidev/scripts/eslint/text-constraints/lib/rules/max-chars.ts +6 -6
- package/assets/slidev/scripts/eslint/text-constraints/lib/rules/textlint-body.ts +3 -3
- package/assets/slidev/scripts/eslint/text-constraints/lib/rules/textlint.ts +2 -2
- package/assets/slidev/scripts/eslint/text-constraints/package.json +1 -1
- package/assets/slidev/scripts/eslint/validate-references/dist/index.js +1 -1
- package/assets/slidev/scripts/eslint/validate-references/dist/lib/schema-validator.js +1 -1
- package/assets/slidev/scripts/eslint/validate-references/dist/lib/semantic-validator.js +12 -12
- package/assets/slidev/scripts/eslint/validate-references/dist/tsconfig.tsbuildinfo +1 -1
- package/assets/slidev/scripts/eslint/validate-references/index.ts +1 -1
- package/assets/slidev/scripts/eslint/validate-references/lib/schema-validator.ts +2 -2
- package/assets/slidev/scripts/eslint/validate-references/lib/semantic-validator.ts +12 -12
- package/assets/slidev/scripts/eslint/validate-references/package.json +1 -1
- package/cli/dist/cli.js +11 -10
- package/cli/dist/commands/chromium/host-dependencies.js +14 -7
- package/cli/dist/commands/drawio/export.js +27 -24
- package/cli/dist/commands/drawio/theme.js +8 -8
- package/cli/dist/commands/drawio/url.js +40 -32
- package/cli/dist/commands/evidence-xlsx/create.js +19 -18
- package/cli/dist/commands/pptx-ooxml/preview.js +26 -30
- package/cli/dist/commands/slidev-project/create.js +27 -26
- package/cli/dist/commands/slidev-project/linked-theme.js +5 -5
- package/cli/dist/commands/slidev-project/lint.js +29 -27
- package/cli/dist/commands/slidev-project/sync.js +35 -34
- package/cli/dist/commands/slidev-project/theme.js +19 -18
- package/cli/dist/commands/slidev-to-pptx/convert.d.ts +4 -0
- package/cli/dist/commands/slidev-to-pptx/convert.js +88 -75
- package/cli/dist/diagnostics.d.ts +38 -0
- package/cli/dist/diagnostics.js +46 -0
- package/cli/dist/domain/_shared/ports.d.ts +0 -1
- package/cli/dist/domain/_shared/text-check.js +2 -2
- package/cli/dist/domain/drawio/export.js +4 -4
- package/cli/dist/domain/drawio/label-text.js +1 -1
- package/cli/dist/domain/drawio/url.d.ts +11 -7
- package/cli/dist/domain/drawio/url.js +67 -45
- package/cli/dist/domain/evidence-xlsx/image-dimensions.js +14 -14
- package/cli/dist/domain/evidence-xlsx/spec-schema.js +26 -26
- package/cli/dist/domain/pptx-ooxml/merge.js +3 -3
- package/cli/dist/domain/pptx-ooxml/prerender-replace.d.ts +1 -0
- package/cli/dist/domain/pptx-ooxml/prerender-replace.js +3 -3
- package/cli/dist/domain/slidev-project/generated-files.d.ts +1 -1
- package/cli/dist/domain/slidev-project/generated-files.js +36 -36
- package/cli/dist/domain/slidev-project/initial-pages.js +4 -4
- package/cli/dist/domain/slidev-project/lint.js +11 -11
- package/cli/dist/domain/slidev-project/sync.js +13 -13
- package/cli/dist/domain/slidev-project/warnings.js +4 -4
- package/cli/dist/domain/slidev-theme/declaration.js +9 -9
- package/cli/dist/domain/slidev-theme/references.js +10 -10
- package/cli/dist/domain/slidev-theme/store-layout.js +6 -6
- package/cli/dist/domain/slidev-theme/talk-theme.js +13 -13
- package/cli/dist/domain/slidev-theme/theme-spec.js +5 -5
- package/cli/dist/domain/slidev-to-pptx/errors.js +3 -3
- package/cli/dist/infra/_shared/dependency-root.js +4 -4
- package/cli/dist/infra/_shared/patch-apply.js +6 -5
- package/cli/dist/infra/_shared/runtime-install.d.ts +12 -84
- package/cli/dist/infra/_shared/runtime-install.js +74 -108
- package/cli/dist/infra/_shared/slidev-bin.js +1 -1
- package/cli/dist/infra/drawio/icons.js +3 -3
- package/cli/dist/infra/drawio/pdf.js +1 -1
- package/cli/dist/infra/drawio/screenshot.js +10 -9
- package/cli/dist/infra/evidence-xlsx/workbook-writer.js +2 -2
- package/cli/dist/infra/playwright/chromium.js +4 -3
- package/cli/dist/infra/playwright/host-dependencies.js +8 -8
- package/cli/dist/infra/playwright/launch.js +5 -5
- package/cli/dist/infra/pptx-ooxml/soffice.js +2 -2
- package/cli/dist/infra/slidev-project/eslint-runner.js +10 -9
- package/cli/dist/infra/slidev-project/fs.js +6 -6
- package/cli/dist/infra/slidev-theme/store.js +18 -15
- package/cli/dist/infra/slidev-to-pptx/cache-store.js +6 -6
- package/cli/dist/infra/slidev-to-pptx/console-logger.d.ts +5 -5
- package/cli/dist/infra/slidev-to-pptx/console-logger.js +19 -20
- package/cli/dist/infra/slidev-to-pptx/dom-converter.d.ts +1 -1
- package/cli/dist/infra/slidev-to-pptx/dom-converter.js +12 -12
- package/cli/dist/infra/slidev-to-pptx/index.js +1 -9
- package/cli/dist/infra/slidev-to-pptx/pipeline.d.ts +2 -2
- package/cli/dist/infra/slidev-to-pptx/pipeline.js +56 -56
- package/cli/dist/infra/slidev-to-pptx/prerender-capture.js +14 -14
- package/cli/dist/infra/slidev-to-pptx/prerender.js +10 -10
- package/cli/dist/infra/slidev-to-pptx/runner.js +1 -0
- package/cli/dist/infra/slidev-to-pptx/scanner.js +10 -10
- package/cli/dist/infra/slidev-to-pptx/server.d.ts +2 -1
- package/cli/dist/infra/slidev-to-pptx/server.js +3 -3
- package/cli/dist/infra/slidev-to-pptx/single-pass-worker.js +39 -39
- package/cli/dist/infra/slidev-to-pptx/slide-worker.js +3 -3
- package/cli/dist/infra/slidev-to-pptx/visibility-helpers.js +8 -8
- package/cli/dist/mcp/dev-server-registry.js +10 -9
- package/cli/dist/mcp/queue.js +1 -1
- package/cli/dist/mcp/result.js +4 -4
- package/cli/dist/mcp/serve.js +5 -3
- package/cli/dist/mcp/server.js +2 -2
- package/cli/dist/mcp/tools/_shared.d.ts +1 -1
- package/cli/dist/mcp/tools/_shared.js +47 -38
- package/cli/dist/mcp/tools/drawio.js +23 -22
- package/cli/dist/mcp/tools/evidence.js +8 -8
- package/cli/dist/mcp/tools/setup.js +26 -26
- package/cli/dist/mcp/tools/slide-dev.js +20 -20
- package/cli/dist/mcp/tools/slide-page.js +39 -37
- package/cli/dist/mcp/tools/slide-theme.js +6 -6
- package/cli/dist/mcp/tools/slide.js +52 -50
- package/cli/dist/mcp/windows-path.js +8 -7
- package/cli/dist/node-runtime.d.ts +6 -1
- package/cli/dist/node-runtime.js +16 -8
- package/npm-shrinkwrap.json +46 -52
- package/package.json +6 -6
- package/vendor/text-rules/dist/source-hash +1 -1
|
@@ -17,6 +17,7 @@ import path from 'node:path';
|
|
|
17
17
|
import { z } from 'zod';
|
|
18
18
|
import { errorToReason as slideThemeErrorToReason, executeSlideTheme, } from '../../commands/slidev-project/theme.js';
|
|
19
19
|
import { NodeThemeFiles } from '../../infra/slidev-theme/fs.js';
|
|
20
|
+
import { createDiagnostics } from '../../diagnostics.js';
|
|
20
21
|
import { extractSkeleton, isFrontmatterBlock } from '../../domain/slidev-theme/skeleton.js';
|
|
21
22
|
import { parsePathArguments, toCallToolResult } from '../result.js';
|
|
22
23
|
import { captureCommandOutput, formatError, TOOL_OUTPUT_SCHEMA, WINDOWS_PATH_NOTE, } from './_shared.js';
|
|
@@ -58,14 +59,14 @@ includes ブロック内の yaml コメント行。項目の間に挟まって
|
|
|
58
59
|
const YAML_COMMENT_REGEX = /^[ \t]*#/;
|
|
59
60
|
const slidePageInput = z.object({
|
|
60
61
|
layout: z.string()
|
|
61
|
-
.describe('
|
|
62
|
-
+ '
|
|
62
|
+
.describe('Layout name. Decide the presentation style from the categories (data.categories) in the slide_create / slide_sync response, '
|
|
63
|
+
+ 'then choose from the names in data.layouts that belong to that category'),
|
|
63
64
|
dir: z.string()
|
|
64
|
-
.describe('
|
|
65
|
+
.describe('Absolute path of the talk-dir to generate the page in. Relative paths are not accepted. ' + WINDOWS_PATH_NOTE),
|
|
65
66
|
file: z.string()
|
|
66
|
-
.describe('pages/
|
|
67
|
+
.describe('File name to generate directly under pages/ (.md may be omitted). Names with path separators or starting with a digit are not accepted'),
|
|
67
68
|
force: z.boolean().default(false)
|
|
68
|
-
.describe('
|
|
69
|
+
.describe('Overwrite when a page with the same name already exists'),
|
|
69
70
|
});
|
|
70
71
|
/**
|
|
71
72
|
失敗時の ToolResult (stdout / stderr は呼び出し側が付ける)。
|
|
@@ -93,7 +94,7 @@ export function normalizePageFileName(file) {
|
|
|
93
94
|
return {
|
|
94
95
|
ok: false,
|
|
95
96
|
reason: 'invalid-file-name',
|
|
96
|
-
detail: `file
|
|
97
|
+
detail: `file must not contain a path separator: ${file}; pages are generated only directly under pages/ of the talk-dir`,
|
|
97
98
|
};
|
|
98
99
|
}
|
|
99
100
|
const filename = file.endsWith(PAGE_EXTENSION) ? file : `${file}${PAGE_EXTENSION}`;
|
|
@@ -102,25 +103,25 @@ export function normalizePageFileName(file) {
|
|
|
102
103
|
return {
|
|
103
104
|
ok: false,
|
|
104
105
|
reason: 'invalid-file-name',
|
|
105
|
-
detail: 'file
|
|
106
|
+
detail: 'file is empty; specify the file name of the page to generate',
|
|
106
107
|
};
|
|
107
108
|
}
|
|
108
109
|
if (!PAGE_STEM_REGEX.test(stem)) {
|
|
109
110
|
return {
|
|
110
111
|
ok: false,
|
|
111
112
|
reason: 'invalid-file-name',
|
|
112
|
-
detail: `file
|
|
113
|
-
+ '
|
|
114
|
-
+ '(
|
|
113
|
+
detail: `file contains characters that cannot be used in a file name: ${file}`
|
|
114
|
+
+ '; use a name that starts with an alphanumeric character and consists only of alphanumerics, underscores, hyphens and dots '
|
|
115
|
+
+ '(e.g. cover.md)',
|
|
115
116
|
};
|
|
116
117
|
}
|
|
117
118
|
if (LEADING_DIGIT_REGEX.test(stem)) {
|
|
118
119
|
return {
|
|
119
120
|
ok: false,
|
|
120
121
|
reason: 'numeric-filename-prefix',
|
|
121
|
-
detail: `file
|
|
122
|
-
+ '
|
|
123
|
-
+ '
|
|
122
|
+
detail: `file must not start with a digit: ${filename}`
|
|
123
|
+
+ '; slide order is managed only by the order of src: entries in slides.md, '
|
|
124
|
+
+ 'so use an English name that does not start with a digit (e.g. cover.md)',
|
|
124
125
|
};
|
|
125
126
|
}
|
|
126
127
|
return { ok: true, filename };
|
|
@@ -200,19 +201,20 @@ output) {
|
|
|
200
201
|
return themeFailure(error);
|
|
201
202
|
}
|
|
202
203
|
const { data: theme, references } = execution;
|
|
204
|
+
const diagnostics = createDiagnostics(output.stderr);
|
|
203
205
|
for (const warning of theme.warnings)
|
|
204
|
-
|
|
206
|
+
diagnostics.warning(warning);
|
|
205
207
|
// 一致確認はファイルを開く前に済ませる。layout は利用者入力なので、パストラバーサル・
|
|
206
208
|
// hidden 名・大文字違いはここで構造的に落とす (一致確認を後ろに回すと任意ファイル読みになる)。
|
|
207
209
|
const entry = theme.layouts.find(candidate => candidate.layout === input.layout);
|
|
208
210
|
const reference = references.entries.find(candidate => candidate.name === input.layout);
|
|
209
211
|
if (entry === undefined || reference === undefined) {
|
|
210
|
-
return failure('unknown-layout',
|
|
211
|
-
+ 'data.categories
|
|
212
|
+
return failure('unknown-layout', `layout not found in theme ${theme.theme.name} referenced by ${input.dir}: ${input.layout}`
|
|
213
|
+
+ '; decide the presentation style from data.categories, then choose from data.layouts of that category', { categories: theme.categories, layouts: theme.layouts });
|
|
212
214
|
}
|
|
213
215
|
if (!reference.file.endsWith('.yaml')) {
|
|
214
|
-
return failure('skeleton-unavailable',
|
|
215
|
-
+ '
|
|
216
|
+
return failure('skeleton-unavailable', `cannot write a skeleton: theme ${theme.theme.name} has no reference yaml for ${entry.layout} (references/${entry.layout}.yaml)`
|
|
217
|
+
+ '; add the reference yaml to the theme or place it in references/ of the talk-dir');
|
|
216
218
|
}
|
|
217
219
|
// catalog の確認と読み取りの間に参照 yaml が消える競合は、書き込みの失敗と分けて報告する。
|
|
218
220
|
let referenceText;
|
|
@@ -220,21 +222,21 @@ output) {
|
|
|
220
222
|
referenceText = await readReferenceText(reference.file);
|
|
221
223
|
}
|
|
222
224
|
catch (error) {
|
|
223
|
-
return failure('reference-read-failed',
|
|
225
|
+
return failure('reference-read-failed', `could not read the reference yaml (${reference.file}): ${formatError(error)}`);
|
|
224
226
|
}
|
|
225
227
|
const skeleton = extractSkeleton(referenceText);
|
|
226
228
|
if (skeleton === undefined) {
|
|
227
|
-
return failure('skeleton-unavailable',
|
|
228
|
-
+
|
|
229
|
+
return failure('skeleton-unavailable', `cannot extract skeleton frontmatter from ${entry.filename} (examples is empty)`
|
|
230
|
+
+ `; the reference yaml is corrupted (fix: repair ${reference.file} of theme ${theme.theme.name})`);
|
|
229
231
|
}
|
|
230
232
|
if (!isFrontmatterBlock(skeleton)) {
|
|
231
|
-
return failure('skeleton-unavailable',
|
|
232
|
-
+
|
|
233
|
+
return failure('skeleton-unavailable', `cannot write a skeleton: examples in ${entry.filename} is not enclosed in \`---\``
|
|
234
|
+
+ `; the reference yaml is corrupted (fix: repair ${reference.file} of theme ${theme.theme.name})`);
|
|
233
235
|
}
|
|
234
236
|
const included = await readIncludedReferences(theme.lint.referencesDirectories, referenceText);
|
|
235
237
|
if (!included.ok) {
|
|
236
|
-
return failure('broken-reference', `${
|
|
237
|
-
+
|
|
238
|
+
return failure('broken-reference', `${included.missing} included by ${entry.filename} not found in ${theme.lint.referencesDirectories.join(' , ')}`
|
|
239
|
+
+ `; add ${included.missing} to references/ of theme ${theme.theme.name}`);
|
|
238
240
|
}
|
|
239
241
|
// 既存ページの保護は open のフラグに任せる (事前の存在確認と書き込みの間に別プロセスが
|
|
240
242
|
// 作ったページを上書きしないため)。force のときだけ `w` で上書きを許す。
|
|
@@ -245,7 +247,7 @@ output) {
|
|
|
245
247
|
catch (error) {
|
|
246
248
|
if (!isAlreadyExistsError(error))
|
|
247
249
|
throw error;
|
|
248
|
-
return failure('file-exists',
|
|
250
|
+
return failure('file-exists', `file already exists: ${target}; pass force: true to overwrite, or specify a different file`);
|
|
249
251
|
}
|
|
250
252
|
return {
|
|
251
253
|
ok: true,
|
|
@@ -261,9 +263,9 @@ output) {
|
|
|
261
263
|
reference: referenceText,
|
|
262
264
|
includes: included.includes,
|
|
263
265
|
},
|
|
264
|
-
message: `slide page:
|
|
265
|
-
+ '
|
|
266
|
-
+ `
|
|
266
|
+
message: `slide page: generated (${target})`
|
|
267
|
+
+ '; fill in the content following props / text_constraints in data.reference, '
|
|
268
|
+
+ `then register "src: ./pages/${file.filename}" in slides.md separately`,
|
|
267
269
|
};
|
|
268
270
|
}
|
|
269
271
|
/**
|
|
@@ -295,14 +297,14 @@ readReferenceText = file => readFile(file, 'utf8')) {
|
|
|
295
297
|
return {
|
|
296
298
|
name: 'slide_page',
|
|
297
299
|
config: {
|
|
298
|
-
title: 'Slidev
|
|
299
|
-
description: '
|
|
300
|
-
+ '
|
|
301
|
-
+ '
|
|
302
|
-
+ '
|
|
303
|
-
+ '
|
|
304
|
-
+ '
|
|
305
|
-
+ '
|
|
300
|
+
title: 'Generate a Slidev page',
|
|
301
|
+
description: 'Generates a skeleton page for one layout under pages/ of the talk-dir, '
|
|
302
|
+
+ 'and returns the specification of that layout (props / text_constraints / clicks / best_practices / anti_patterns / examples). '
|
|
303
|
+
+ 'The specification is returned in data.reference and data.includes. '
|
|
304
|
+
+ 'Decide the presentation style from the categories (data.categories) in the slide_create / slide_sync response, '
|
|
305
|
+
+ 'then choose the layout name from data.layouts of that category '
|
|
306
|
+
+ '(passing an unknown name returns data.categories and data.layouts in the response). '
|
|
307
|
+
+ 'The generated page must be registered separately as a src: entry in slides.md.',
|
|
306
308
|
inputSchema: slidePageInput,
|
|
307
309
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
308
310
|
// talk-dir 配下の読み取りと 1 ファイルの書き込みだけで、ネットワークには到達しない。
|
|
@@ -14,7 +14,7 @@ import { formatError, TOOL_OUTPUT_SCHEMA, WINDOWS_PATH_NOTE } from './_shared.js
|
|
|
14
14
|
const SLIDE_THEME_EXIT_CODE = 1;
|
|
15
15
|
const slideThemeInput = z.object({
|
|
16
16
|
dir: z.string()
|
|
17
|
-
.describe('
|
|
17
|
+
.describe('Absolute path of the talk-dir whose theme to inspect. Relative paths are not accepted. ' + WINDOWS_PATH_NOTE),
|
|
18
18
|
});
|
|
19
19
|
/**
|
|
20
20
|
`pecotv slide theme` 相当。
|
|
@@ -24,10 +24,10 @@ export function slideThemeTool(buildDependencies = slideThemeDefaultDependencies
|
|
|
24
24
|
return {
|
|
25
25
|
name: 'slide_theme',
|
|
26
26
|
config: {
|
|
27
|
-
title: 'Slidev
|
|
28
|
-
description: 'talk-dir
|
|
29
|
-
+ '
|
|
30
|
-
+ '
|
|
27
|
+
title: 'Slidev theme declaration',
|
|
28
|
+
description: 'Returns the theme declaration referenced by a talk-dir and the list of layouts. '
|
|
29
|
+
+ 'The declaration covers fonts, font sizes, PPTX fonts and link colors, and lint rules. '
|
|
30
|
+
+ 'Skills use it to obtain theme values.',
|
|
31
31
|
inputSchema: slideThemeInput,
|
|
32
32
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
33
33
|
// 読み取りのみで何も書き換えず、ネットワークにも到達しない。
|
|
@@ -45,7 +45,7 @@ export function slideThemeTool(buildDependencies = slideThemeDefaultDependencies
|
|
|
45
45
|
exitCode: 0,
|
|
46
46
|
artifacts: [],
|
|
47
47
|
data: { ...data },
|
|
48
|
-
message: `slide theme: ${data.theme.name}
|
|
48
|
+
message: `slide theme: ${data.theme.name} (${String(data.layouts.length)} layouts)`,
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
catch (error) {
|
|
@@ -31,14 +31,14 @@ function failureResult(event, reason, exitCode, error, extra = {}) {
|
|
|
31
31
|
}
|
|
32
32
|
const slideCreateInput = z.object({
|
|
33
33
|
project_dir: z.string()
|
|
34
|
-
.describe('
|
|
35
|
-
+ ' (
|
|
34
|
+
.describe('Absolute path of the destination directory. Specify a place where the calling agent has write permission for later edits'
|
|
35
|
+
+ ' (e.g. under the working directory). Relative paths are not accepted. ' + WINDOWS_PATH_NOTE),
|
|
36
36
|
theme: z.string()
|
|
37
|
-
.describe('
|
|
38
|
-
+ '
|
|
37
|
+
.describe('Theme to reference (required): `git+https://<host>/<owner>/<repo>.git#<tag>` or `file:<absolute path>`. '
|
|
38
|
+
+ 'A git URL without a tag is not accepted.'),
|
|
39
39
|
force: z.boolean()
|
|
40
40
|
.default(false)
|
|
41
|
-
.describe('
|
|
41
|
+
.describe('Delete and overwrite when the destination already exists'),
|
|
42
42
|
});
|
|
43
43
|
/**
|
|
44
44
|
`pecotv slide create` 相当。`theme` で指定したテーマを参照する Slidev プロジェクトを生成し、
|
|
@@ -48,12 +48,12 @@ export function slideCreateTool(buildDependencies = slideCreateDefaultDependenci
|
|
|
48
48
|
return {
|
|
49
49
|
name: 'slide_create',
|
|
50
50
|
config: {
|
|
51
|
-
title: 'Slidev
|
|
52
|
-
description: '
|
|
53
|
-
+ '
|
|
54
|
-
+ '
|
|
55
|
-
+ '
|
|
56
|
-
+ '
|
|
51
|
+
title: 'Generate a Slidev project',
|
|
52
|
+
description: 'Generates a new talk-dir that references the Slidev theme given by `theme`. '
|
|
53
|
+
+ 'The theme is specified by a git URL with a tag (`git+https://<host>/<owner>/<repo>.git#<tag>`) '
|
|
54
|
+
+ 'or a local path (`file:<path>`). '
|
|
55
|
+
+ 'Returns the presentation categories (data.categories) and the list of selectable layouts (data.layouts). '
|
|
56
|
+
+ 'Also returns the lint result of the whole deck right after generation (generation counts as successful even with lint violations).',
|
|
57
57
|
inputSchema: slideCreateInput,
|
|
58
58
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
59
59
|
// git でテーマを取得するため、ネットワークに到達しうる。openWorldHint は明示しない(SDK の既定)。
|
|
@@ -93,7 +93,7 @@ export function slideCreateTool(buildDependencies = slideCreateDefaultDependenci
|
|
|
93
93
|
exitCode: 0,
|
|
94
94
|
artifacts: [execution.summary.projectDirectory],
|
|
95
95
|
data: execution.data,
|
|
96
|
-
message: `slide create:
|
|
96
|
+
message: `slide create: succeeded (${execution.summary.projectDirectory})`,
|
|
97
97
|
...output.part(),
|
|
98
98
|
});
|
|
99
99
|
}
|
|
@@ -108,26 +108,26 @@ export function slideCreateTool(buildDependencies = slideCreateDefaultDependenci
|
|
|
108
108
|
}
|
|
109
109
|
const slideConvertInput = z.object({
|
|
110
110
|
project_dir: z.string()
|
|
111
|
-
.describe('Slidev
|
|
111
|
+
.describe('Absolute path of the Slidev project directory. Relative paths are not accepted. ' + WINDOWS_PATH_NOTE),
|
|
112
112
|
out_path: z.string().optional()
|
|
113
|
-
.describe('
|
|
113
|
+
.describe('Absolute path of the output .pptx. If omitted, <project_dir>/pptx/<title of slides.md | basename>.pptx. '
|
|
114
114
|
+ WINDOWS_PATH_NOTE),
|
|
115
115
|
theme: z.string().optional()
|
|
116
|
-
.describe('slidev
|
|
116
|
+
.describe('Name passed to slidev --theme (allowed characters: [a-zA-Z0-9@/_.-])'),
|
|
117
117
|
spacing_json_path: z.string().optional()
|
|
118
|
-
.describe('letter-spacing JSON
|
|
118
|
+
.describe('Absolute path of the letter-spacing JSON. If omitted, staging/slides/letter-spacing.json is auto-detected. '
|
|
119
119
|
+ WINDOWS_PATH_NOTE),
|
|
120
120
|
href_json_path: z.string().optional()
|
|
121
|
-
.describe('hyperlink JSON
|
|
121
|
+
.describe('Absolute path of the hyperlink JSON. If omitted, staging/slides/href-map.json is auto-detected. '
|
|
122
122
|
+ WINDOWS_PATH_NOTE),
|
|
123
123
|
transition_type: z.enum(['fade', 'morph']).optional()
|
|
124
|
-
.describe('
|
|
124
|
+
.describe('Slide transition type (default: fade)'),
|
|
125
125
|
transition_duration_ms: z.number().int().positive().optional()
|
|
126
|
-
.describe('
|
|
126
|
+
.describe('Slide transition duration, as a positive integer in milliseconds (default: 500)'),
|
|
127
127
|
morph_option: z.enum(['byObject', 'byWord', 'byChar']).optional()
|
|
128
|
-
.describe('morph
|
|
128
|
+
.describe('Granularity of the morph transition. Only meaningful when transition_type=morph'),
|
|
129
129
|
cache: z.boolean().default(true)
|
|
130
|
-
.describe('
|
|
130
|
+
.describe('Whether to read the diff cache. Even with false, the cache is rebuilt when the conversion completes'),
|
|
131
131
|
});
|
|
132
132
|
/**
|
|
133
133
|
`pecotv slide convert` 相当。`slidev build` と in-process pipeline を起動するため、11 ツールの中で最も長時間かかる。
|
|
@@ -137,8 +137,8 @@ export function slideConvertTool(buildDependencies = slideConvertDefaultDependen
|
|
|
137
137
|
return {
|
|
138
138
|
name: 'slide_convert',
|
|
139
139
|
config: {
|
|
140
|
-
title: 'Slidev
|
|
141
|
-
description: 'Slidev
|
|
140
|
+
title: 'Convert Slidev to PPTX',
|
|
141
|
+
description: 'Converts a Slidev project to PPTX. The duration is proportional to the number of slides (just under 30 seconds for 55 slides).',
|
|
142
142
|
inputSchema: slideConvertInput,
|
|
143
143
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
144
144
|
},
|
|
@@ -162,7 +162,9 @@ export function slideConvertTool(buildDependencies = slideConvertDefaultDependen
|
|
|
162
162
|
return toCallToolResult(unavailable);
|
|
163
163
|
const output = captureCommandOutput();
|
|
164
164
|
try {
|
|
165
|
-
// json: false
|
|
165
|
+
// json: false 相当で呼び、output の stdout / stderr へ集める。
|
|
166
|
+
// 進捗の人間可読ログは stderr の診断行 (note / warning / error) で出るので、ToolResult の stderr に入る。
|
|
167
|
+
// stdout には変換結果の要約だけが入る。
|
|
166
168
|
// MCP サーバの process.stdout は JSON-RPC 専有なので、実 stdout へは何も書かせない。
|
|
167
169
|
const dependencies = {
|
|
168
170
|
...buildDependencies(),
|
|
@@ -208,13 +210,13 @@ export function slideConvertTool(buildDependencies = slideConvertDefaultDependen
|
|
|
208
210
|
}
|
|
209
211
|
const slideSyncInput = z.object({
|
|
210
212
|
dir: z.string()
|
|
211
|
-
.describe('
|
|
213
|
+
.describe('Absolute path of the talk-dir to sync. Relative paths are not accepted. ' + WINDOWS_PATH_NOTE),
|
|
212
214
|
theme: z.string().optional()
|
|
213
|
-
.describe('
|
|
214
|
-
+ '
|
|
215
|
+
.describe('Theme the pre-migration talk-dir should reference: `git+https://<host>/<owner>/<repo>.git#<tag>` or `file:<absolute path>`. '
|
|
216
|
+
+ 'Required for a pre-migration talk-dir (one that holds a copy of the template). Not used for a migrated talk-dir'),
|
|
215
217
|
node_modules_only: z.boolean().default(false)
|
|
216
|
-
.describe('node_modules
|
|
217
|
-
+ '
|
|
218
|
+
.describe('Only relink node_modules. The theme in package.json is fetched first, then linked (no network access if it is already fetched). '
|
|
219
|
+
+ 'A migrated talk-dir that references a theme behaves the same even when this is omitted. The generated files (vite.config.ts, start.mjs) are also aligned with the current content of the plugin. Cannot be specified together with theme'),
|
|
218
220
|
});
|
|
219
221
|
/**
|
|
220
222
|
`pecotv slide sync` 相当。移行前の talk-dir は、`theme` で指定したテーマを参照する形へ移す。
|
|
@@ -226,17 +228,17 @@ export function slideSyncTool(buildDependencies = slideSyncDefaultDependencies,
|
|
|
226
228
|
return {
|
|
227
229
|
name: 'slide_sync',
|
|
228
230
|
config: {
|
|
229
|
-
title: 'Slidev
|
|
230
|
-
description: '
|
|
231
|
-
+ '
|
|
232
|
-
+ '`theme
|
|
233
|
-
+ '
|
|
234
|
-
+ '
|
|
235
|
-
+ '
|
|
236
|
-
+ '
|
|
237
|
-
+ '
|
|
238
|
-
+ '
|
|
239
|
-
+ '
|
|
231
|
+
title: 'Sync a Slidev talk-dir',
|
|
232
|
+
description: 'Syncs an existing talk-dir. '
|
|
233
|
+
+ 'A pre-migration talk-dir (one that holds a copy of the template; slide_dev and others stop with theme-none) '
|
|
234
|
+
+ 'is moved to a form that references the theme given by `theme`. Files that came from the template are deleted, '
|
|
235
|
+
+ 'and the work area (slides.md / pages/*.md / public/slides/) is kept. The deleted names are returned in data.migration.removed. '
|
|
236
|
+
+ 'A migrated talk-dir that references a theme (theme: in slides.md points to the theme in dependencies of package.json) '
|
|
237
|
+
+ 'fetches the theme at the version in the dependency and relinks node_modules, '
|
|
238
|
+
+ 'and aligns the generated files (vite.config.ts, start.mjs) with the current content of the plugin. Other files are left unchanged. '
|
|
239
|
+
+ 'To raise the theme version, rewrite the #<tag> of the dependency in package.json before calling. '
|
|
240
|
+
+ 'Returns the presentation categories (data.categories), the list of selectable layouts (data.layouts), '
|
|
241
|
+
+ 'and the lint result of the whole deck after the sync. A running slide_dev must be stopped with stop: true and started again.',
|
|
240
242
|
inputSchema: slideSyncInput,
|
|
241
243
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
242
244
|
// theme を渡したときと、node_modules_only・移行済みの talk-dir の通常の sync は、テーマを git で取得しうるため、ネットワークに到達しうる。
|
|
@@ -292,17 +294,17 @@ export function slideSyncTool(buildDependencies = slideSyncDefaultDependencies,
|
|
|
292
294
|
};
|
|
293
295
|
}
|
|
294
296
|
function syncSuccessMessage(summary) {
|
|
295
|
-
const base = `slide sync:
|
|
297
|
+
const base = `slide sync: succeeded (${summary.directory})`;
|
|
296
298
|
if (summary.theme === undefined)
|
|
297
299
|
return base;
|
|
298
|
-
const themeText = `${base}
|
|
300
|
+
const themeText = `${base}; theme: ${summary.theme.name} (${summary.theme.spec})`;
|
|
299
301
|
return summary.mode === 'migrate'
|
|
300
|
-
? `${themeText}
|
|
302
|
+
? `${themeText}; migration: removed ${String(summary.removed.length)} files from the template (${summary.removed.join(', ')})`
|
|
301
303
|
: themeText;
|
|
302
304
|
}
|
|
303
305
|
const slideLintInput = z.object({
|
|
304
306
|
dir: z.string()
|
|
305
|
-
.describe('
|
|
307
|
+
.describe('Absolute path of the talk-dir to lint. Relative paths are not accepted. ' + WINDOWS_PATH_NOTE),
|
|
306
308
|
});
|
|
307
309
|
/**
|
|
308
310
|
`pecotv slide lint` 相当。違反の検出は「報告が成果」なので ok: true / exitCode 1 で返す
|
|
@@ -312,9 +314,9 @@ export function slideLintTool(buildDependencies = slideLintDefaultDependencies)
|
|
|
312
314
|
return {
|
|
313
315
|
name: 'slide_lint',
|
|
314
316
|
config: {
|
|
315
|
-
title: 'Slidev
|
|
316
|
-
description: 'talk-dir
|
|
317
|
-
+ '
|
|
317
|
+
title: 'Lint a Slidev deck',
|
|
318
|
+
description: 'Lints the whole talk-dir (pages/**/*.md and slides.md) '
|
|
319
|
+
+ 'and returns the list of violations. The call itself succeeds (exitCode 1) even with violations.',
|
|
318
320
|
inputSchema: slideLintInput,
|
|
319
321
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
320
322
|
// 読み取りのみで何も書き換えず、ネットワークにも到達しない。
|
|
@@ -340,9 +342,9 @@ export function slideLintTool(buildDependencies = slideLintDefaultDependencies)
|
|
|
340
342
|
artifacts: [],
|
|
341
343
|
data,
|
|
342
344
|
message: hasViolations
|
|
343
|
-
? `slide lint:
|
|
344
|
-
+
|
|
345
|
-
: `slide lint:
|
|
345
|
+
? `slide lint: violations found (${summary.directory}); ${String(summary.errorCount)} errors`
|
|
346
|
+
+ `; ${String(summary.warningCount)} warnings`
|
|
347
|
+
: `slide lint: succeeded (${summary.directory}); ${String(summary.lintedFileCount)} files linted`,
|
|
346
348
|
...output.part(),
|
|
347
349
|
});
|
|
348
350
|
}
|
|
@@ -54,7 +54,9 @@ Windows 形式のパスを POSIX パスへ変換する。
|
|
|
54
54
|
UNC 形式は、参照先の distro が自分自身のときだけ WSL 内のパスへ畳める。他の distro の
|
|
55
55
|
filesystem はこのプロセスから見えないため、解決できない旨を返す。
|
|
56
56
|
*/
|
|
57
|
-
export function toPosixPath(value,
|
|
57
|
+
export function toPosixPath(value,
|
|
58
|
+
// interface-env: WSL_DISTRO_NAME PECOTV_WSL_MOUNT_ROOT
|
|
59
|
+
environment = process.env) {
|
|
58
60
|
const drive = DRIVE_ABSOLUTE_REGEX.exec(value);
|
|
59
61
|
if (drive !== null) {
|
|
60
62
|
const [, letter = '', rest = ''] = drive;
|
|
@@ -66,8 +68,8 @@ export function toPosixPath(value, environment = process.env) {
|
|
|
66
68
|
if (DRIVE_RELATIVE_REGEX.test(value)) {
|
|
67
69
|
return {
|
|
68
70
|
kind: 'unsupported',
|
|
69
|
-
reason:
|
|
70
|
-
+ ' (
|
|
71
|
+
reason: `cannot resolve drive-relative path (depends on cwd): ${value}`
|
|
72
|
+
+ ' (fix: put a separator right after the drive letter to make it absolute)',
|
|
71
73
|
};
|
|
72
74
|
}
|
|
73
75
|
const uncPrefix = WSL_UNC_PREFIX_REGEX.exec(value);
|
|
@@ -76,8 +78,8 @@ export function toPosixPath(value, environment = process.env) {
|
|
|
76
78
|
if (UNC_PREFIX_REGEX.test(value)) {
|
|
77
79
|
return {
|
|
78
80
|
kind: 'unsupported',
|
|
79
|
-
reason: `UNC
|
|
80
|
-
+ ' (WSL
|
|
81
|
+
reason: `cannot resolve UNC path: ${value}`
|
|
82
|
+
+ ' (fix: use an absolute path visible from WSL, or a drive-letter path)',
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
85
|
return { kind: 'unchanged' };
|
|
@@ -95,8 +97,7 @@ function fromWslUnc(body, environment) {
|
|
|
95
97
|
if (current?.toLowerCase() !== distro.toLowerCase()) {
|
|
96
98
|
return {
|
|
97
99
|
kind: 'unsupported',
|
|
98
|
-
reason:
|
|
99
|
-
+ `distro '${distro}' のパスは解決できません`,
|
|
100
|
+
reason: `cannot resolve a path on distro ${distro}: this server runs on distro ${current ?? '(WSL_DISTRO_NAME unset)'}`,
|
|
100
101
|
};
|
|
101
102
|
}
|
|
102
103
|
return { kind: 'converted', path: path.posix.normalize(`/${toPosixSeparators(rest)}`) };
|
|
@@ -12,9 +12,14 @@ export declare const MINIMUM_NODE_VERSIONS: Readonly<Record<number, string>>;
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function suggestedNodeVersion(): string;
|
|
14
14
|
/**
|
|
15
|
-
起動してよい版なら undefined
|
|
15
|
+
起動してよい版なら undefined、止めるべき版なら字下げ無しの複数行の案内文を返す。
|
|
16
|
+
CLI は診断行の共通の関数に渡し、続きの行の字下げはそちらが付ける。
|
|
16
17
|
表に無い major は、表の最大 major より新しければ修正後のリリースとみなして許可し、
|
|
17
18
|
それ以外(24 未満・サポート終了の 25 系)は止める。
|
|
18
19
|
*/
|
|
20
|
+
export declare function nodeRuntimeGuidance(version: string): string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
launcher と hook がそのまま書く形。続きの行の先頭に空白 2 つを付けた案内文を返す。
|
|
23
|
+
*/
|
|
19
24
|
export declare function checkNodeRuntime(version: string): string | undefined;
|
|
20
25
|
//# sourceMappingURL=node-runtime.d.ts.map
|
package/cli/dist/node-runtime.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
// enum・namespace・パラメータプロパティを使わず、他モジュールを import しない。
|
|
7
7
|
// ランチャーと hook が node から直接読み込んで checkNodeRuntime を呼ぶため。
|
|
8
8
|
//
|
|
9
|
-
// 判定は cli.ts の main()
|
|
9
|
+
// 判定は cli.ts の main() で行う。CLI は nodeRuntimeGuidance の結果を診断行の共通の関数に渡す
|
|
10
|
+
// (続きの行の字下げは共通の関数が付ける)。静的 import の評価後に動くため、import の段階で落ちる
|
|
10
11
|
// 古い major(23 以前)では案内を出せないことがある。判定だけのエントリモジュールには分けない。
|
|
11
12
|
/**
|
|
12
13
|
系列(major)ごとの最低版。2026-10-21 の Node.js セキュリティリリース
|
|
@@ -44,8 +45,8 @@ function isAtLeast(actual, minimum) {
|
|
|
44
45
|
}
|
|
45
46
|
function requiredVersionsText() {
|
|
46
47
|
return Object.entries(MINIMUM_NODE_VERSIONS)
|
|
47
|
-
.map(([major, minimum]) => `${major}
|
|
48
|
-
.join('
|
|
48
|
+
.map(([major, minimum]) => `${major}.x: ${minimum} or later`)
|
|
49
|
+
.join(', ');
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
52
|
案内に載せる更新先の版。表の最小 major の最低版。
|
|
@@ -57,17 +58,18 @@ export function suggestedNodeVersion() {
|
|
|
57
58
|
}
|
|
58
59
|
function guidance(version) {
|
|
59
60
|
return [
|
|
60
|
-
`Node.js ${version}
|
|
61
|
-
`
|
|
62
|
-
`
|
|
61
|
+
`Node.js ${version} does not include fixes for known vulnerabilities; not starting`,
|
|
62
|
+
`required: ${requiredVersionsText()}`,
|
|
63
|
+
`(fix: update Node.js and run again; with nvm: nvm install ${suggestedNodeVersion()})`,
|
|
63
64
|
].join('\n');
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
66
|
-
起動してよい版なら undefined
|
|
67
|
+
起動してよい版なら undefined、止めるべき版なら字下げ無しの複数行の案内文を返す。
|
|
68
|
+
CLI は診断行の共通の関数に渡し、続きの行の字下げはそちらが付ける。
|
|
67
69
|
表に無い major は、表の最大 major より新しければ修正後のリリースとみなして許可し、
|
|
68
70
|
それ以外(24 未満・サポート終了の 25 系)は止める。
|
|
69
71
|
*/
|
|
70
|
-
export function
|
|
72
|
+
export function nodeRuntimeGuidance(version) {
|
|
71
73
|
const actual = parseVersion(version);
|
|
72
74
|
if (actual === undefined)
|
|
73
75
|
return guidance(version);
|
|
@@ -81,4 +83,10 @@ export function checkNodeRuntime(version) {
|
|
|
81
83
|
return guidance(version);
|
|
82
84
|
return isAtLeast(actual, minimumVersion.tuple) ? undefined : guidance(version);
|
|
83
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
launcher と hook がそのまま書く形。続きの行の先頭に空白 2 つを付けた案内文を返す。
|
|
88
|
+
*/
|
|
89
|
+
export function checkNodeRuntime(version) {
|
|
90
|
+
return nodeRuntimeGuidance(version)?.split('\n').join('\n ');
|
|
91
|
+
}
|
|
84
92
|
//# sourceMappingURL=node-runtime.js.map
|