@pecot/visual-mcp 1.2.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 +1 -1
- 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/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/validate-references/dist/index.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/semantic-validator.ts +12 -12
- package/cli/dist/cli.js +8 -8
- package/cli/dist/commands/chromium/host-dependencies.js +3 -3
- package/cli/dist/commands/drawio/export.js +15 -15
- package/cli/dist/commands/drawio/theme.js +7 -7
- package/cli/dist/commands/drawio/url.js +14 -14
- package/cli/dist/commands/evidence-xlsx/create.js +11 -11
- package/cli/dist/commands/pptx-ooxml/preview.js +13 -13
- package/cli/dist/commands/slidev-project/create.js +12 -12
- package/cli/dist/commands/slidev-project/linked-theme.js +5 -5
- package/cli/dist/commands/slidev-project/lint.js +13 -13
- package/cli/dist/commands/slidev-project/sync.js +19 -19
- package/cli/dist/commands/slidev-project/theme.js +9 -9
- package/cli/dist/commands/slidev-to-pptx/convert.js +47 -47
- 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.js +27 -27
- 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/slidev-project/generated-files.d.ts +1 -1
- package/cli/dist/domain/slidev-project/generated-files.js +34 -34
- 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.js +4 -3
- 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/dom-converter.js +12 -12
- package/cli/dist/infra/slidev-to-pptx/pipeline.d.ts +1 -1
- package/cli/dist/infra/slidev-to-pptx/pipeline.js +54 -54
- 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.js +2 -2
- 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 +1 -1
- 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 +36 -37
- package/cli/dist/mcp/tools/drawio.js +22 -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 +36 -36
- package/cli/dist/mcp/tools/slide-theme.js +6 -6
- package/cli/dist/mcp/tools/slide.js +49 -49
- 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 +3 -3
- package/package.json +2 -2
- package/vendor/text-rules/dist/source-hash +1 -1
|
@@ -59,14 +59,14 @@ includes ブロック内の yaml コメント行。項目の間に挟まって
|
|
|
59
59
|
const YAML_COMMENT_REGEX = /^[ \t]*#/;
|
|
60
60
|
const slidePageInput = z.object({
|
|
61
61
|
layout: z.string()
|
|
62
|
-
.describe('
|
|
63
|
-
+ '
|
|
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'),
|
|
64
64
|
dir: z.string()
|
|
65
|
-
.describe('
|
|
65
|
+
.describe('Absolute path of the talk-dir to generate the page in. Relative paths are not accepted. ' + WINDOWS_PATH_NOTE),
|
|
66
66
|
file: z.string()
|
|
67
|
-
.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'),
|
|
68
68
|
force: z.boolean().default(false)
|
|
69
|
-
.describe('
|
|
69
|
+
.describe('Overwrite when a page with the same name already exists'),
|
|
70
70
|
});
|
|
71
71
|
/**
|
|
72
72
|
失敗時の ToolResult (stdout / stderr は呼び出し側が付ける)。
|
|
@@ -94,7 +94,7 @@ export function normalizePageFileName(file) {
|
|
|
94
94
|
return {
|
|
95
95
|
ok: false,
|
|
96
96
|
reason: 'invalid-file-name',
|
|
97
|
-
detail: `file
|
|
97
|
+
detail: `file must not contain a path separator: ${file}; pages are generated only directly under pages/ of the talk-dir`,
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
const filename = file.endsWith(PAGE_EXTENSION) ? file : `${file}${PAGE_EXTENSION}`;
|
|
@@ -103,25 +103,25 @@ export function normalizePageFileName(file) {
|
|
|
103
103
|
return {
|
|
104
104
|
ok: false,
|
|
105
105
|
reason: 'invalid-file-name',
|
|
106
|
-
detail: 'file
|
|
106
|
+
detail: 'file is empty; specify the file name of the page to generate',
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
if (!PAGE_STEM_REGEX.test(stem)) {
|
|
110
110
|
return {
|
|
111
111
|
ok: false,
|
|
112
112
|
reason: 'invalid-file-name',
|
|
113
|
-
detail: `file
|
|
114
|
-
+ '
|
|
115
|
-
+ '(
|
|
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)',
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
if (LEADING_DIGIT_REGEX.test(stem)) {
|
|
119
119
|
return {
|
|
120
120
|
ok: false,
|
|
121
121
|
reason: 'numeric-filename-prefix',
|
|
122
|
-
detail: `file
|
|
123
|
-
+ '
|
|
124
|
-
+ '
|
|
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)',
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
return { ok: true, filename };
|
|
@@ -209,12 +209,12 @@ output) {
|
|
|
209
209
|
const entry = theme.layouts.find(candidate => candidate.layout === input.layout);
|
|
210
210
|
const reference = references.entries.find(candidate => candidate.name === input.layout);
|
|
211
211
|
if (entry === undefined || reference === undefined) {
|
|
212
|
-
return failure('unknown-layout',
|
|
213
|
-
+ '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 });
|
|
214
214
|
}
|
|
215
215
|
if (!reference.file.endsWith('.yaml')) {
|
|
216
|
-
return failure('skeleton-unavailable',
|
|
217
|
-
+ '
|
|
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');
|
|
218
218
|
}
|
|
219
219
|
// catalog の確認と読み取りの間に参照 yaml が消える競合は、書き込みの失敗と分けて報告する。
|
|
220
220
|
let referenceText;
|
|
@@ -222,21 +222,21 @@ output) {
|
|
|
222
222
|
referenceText = await readReferenceText(reference.file);
|
|
223
223
|
}
|
|
224
224
|
catch (error) {
|
|
225
|
-
return failure('reference-read-failed',
|
|
225
|
+
return failure('reference-read-failed', `could not read the reference yaml (${reference.file}): ${formatError(error)}`);
|
|
226
226
|
}
|
|
227
227
|
const skeleton = extractSkeleton(referenceText);
|
|
228
228
|
if (skeleton === undefined) {
|
|
229
|
-
return failure('skeleton-unavailable',
|
|
230
|
-
+
|
|
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})`);
|
|
231
231
|
}
|
|
232
232
|
if (!isFrontmatterBlock(skeleton)) {
|
|
233
|
-
return failure('skeleton-unavailable',
|
|
234
|
-
+
|
|
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})`);
|
|
235
235
|
}
|
|
236
236
|
const included = await readIncludedReferences(theme.lint.referencesDirectories, referenceText);
|
|
237
237
|
if (!included.ok) {
|
|
238
|
-
return failure('broken-reference', `${
|
|
239
|
-
+
|
|
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}`);
|
|
240
240
|
}
|
|
241
241
|
// 既存ページの保護は open のフラグに任せる (事前の存在確認と書き込みの間に別プロセスが
|
|
242
242
|
// 作ったページを上書きしないため)。force のときだけ `w` で上書きを許す。
|
|
@@ -247,7 +247,7 @@ output) {
|
|
|
247
247
|
catch (error) {
|
|
248
248
|
if (!isAlreadyExistsError(error))
|
|
249
249
|
throw error;
|
|
250
|
-
return failure('file-exists',
|
|
250
|
+
return failure('file-exists', `file already exists: ${target}; pass force: true to overwrite, or specify a different file`);
|
|
251
251
|
}
|
|
252
252
|
return {
|
|
253
253
|
ok: true,
|
|
@@ -263,9 +263,9 @@ output) {
|
|
|
263
263
|
reference: referenceText,
|
|
264
264
|
includes: included.includes,
|
|
265
265
|
},
|
|
266
|
-
message: `slide page:
|
|
267
|
-
+ '
|
|
268
|
-
+ `
|
|
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`,
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
271
|
/**
|
|
@@ -297,14 +297,14 @@ readReferenceText = file => readFile(file, 'utf8')) {
|
|
|
297
297
|
return {
|
|
298
298
|
name: 'slide_page',
|
|
299
299
|
config: {
|
|
300
|
-
title: 'Slidev
|
|
301
|
-
description: '
|
|
302
|
-
+ '
|
|
303
|
-
+ '
|
|
304
|
-
+ '
|
|
305
|
-
+ '
|
|
306
|
-
+ '
|
|
307
|
-
+ '
|
|
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.',
|
|
308
308
|
inputSchema: slidePageInput,
|
|
309
309
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
310
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
|
},
|
|
@@ -210,13 +210,13 @@ export function slideConvertTool(buildDependencies = slideConvertDefaultDependen
|
|
|
210
210
|
}
|
|
211
211
|
const slideSyncInput = z.object({
|
|
212
212
|
dir: z.string()
|
|
213
|
-
.describe('
|
|
213
|
+
.describe('Absolute path of the talk-dir to sync. Relative paths are not accepted. ' + WINDOWS_PATH_NOTE),
|
|
214
214
|
theme: z.string().optional()
|
|
215
|
-
.describe('
|
|
216
|
-
+ '
|
|
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'),
|
|
217
217
|
node_modules_only: z.boolean().default(false)
|
|
218
|
-
.describe('node_modules
|
|
219
|
-
+ '
|
|
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'),
|
|
220
220
|
});
|
|
221
221
|
/**
|
|
222
222
|
`pecotv slide sync` 相当。移行前の talk-dir は、`theme` で指定したテーマを参照する形へ移す。
|
|
@@ -228,17 +228,17 @@ export function slideSyncTool(buildDependencies = slideSyncDefaultDependencies,
|
|
|
228
228
|
return {
|
|
229
229
|
name: 'slide_sync',
|
|
230
230
|
config: {
|
|
231
|
-
title: 'Slidev
|
|
232
|
-
description: '
|
|
233
|
-
+ '
|
|
234
|
-
+ '`theme
|
|
235
|
-
+ '
|
|
236
|
-
+ '
|
|
237
|
-
+ '
|
|
238
|
-
+ '
|
|
239
|
-
+ '
|
|
240
|
-
+ '
|
|
241
|
-
+ '
|
|
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.',
|
|
242
242
|
inputSchema: slideSyncInput,
|
|
243
243
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
244
244
|
// theme を渡したときと、node_modules_only・移行済みの talk-dir の通常の sync は、テーマを git で取得しうるため、ネットワークに到達しうる。
|
|
@@ -294,17 +294,17 @@ export function slideSyncTool(buildDependencies = slideSyncDefaultDependencies,
|
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
296
|
function syncSuccessMessage(summary) {
|
|
297
|
-
const base = `slide sync:
|
|
297
|
+
const base = `slide sync: succeeded (${summary.directory})`;
|
|
298
298
|
if (summary.theme === undefined)
|
|
299
299
|
return base;
|
|
300
|
-
const themeText = `${base}
|
|
300
|
+
const themeText = `${base}; theme: ${summary.theme.name} (${summary.theme.spec})`;
|
|
301
301
|
return summary.mode === 'migrate'
|
|
302
|
-
? `${themeText}
|
|
302
|
+
? `${themeText}; migration: removed ${String(summary.removed.length)} files from the template (${summary.removed.join(', ')})`
|
|
303
303
|
: themeText;
|
|
304
304
|
}
|
|
305
305
|
const slideLintInput = z.object({
|
|
306
306
|
dir: z.string()
|
|
307
|
-
.describe('
|
|
307
|
+
.describe('Absolute path of the talk-dir to lint. Relative paths are not accepted. ' + WINDOWS_PATH_NOTE),
|
|
308
308
|
});
|
|
309
309
|
/**
|
|
310
310
|
`pecotv slide lint` 相当。違反の検出は「報告が成果」なので ok: true / exitCode 1 で返す
|
|
@@ -314,9 +314,9 @@ export function slideLintTool(buildDependencies = slideLintDefaultDependencies)
|
|
|
314
314
|
return {
|
|
315
315
|
name: 'slide_lint',
|
|
316
316
|
config: {
|
|
317
|
-
title: 'Slidev
|
|
318
|
-
description: 'talk-dir
|
|
319
|
-
+ '
|
|
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.',
|
|
320
320
|
inputSchema: slideLintInput,
|
|
321
321
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
322
322
|
// 読み取りのみで何も書き換えず、ネットワークにも到達しない。
|
|
@@ -342,9 +342,9 @@ export function slideLintTool(buildDependencies = slideLintDefaultDependencies)
|
|
|
342
342
|
artifacts: [],
|
|
343
343
|
data,
|
|
344
344
|
message: hasViolations
|
|
345
|
-
? `slide lint:
|
|
346
|
-
+
|
|
347
|
-
: `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`,
|
|
348
348
|
...output.part(),
|
|
349
349
|
});
|
|
350
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
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pecot/visual-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@pecot/visual-mcp",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.3.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@cffnpwr/textlint-plugin-comments": "1.0.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"eslint": "^10.14.0",
|
|
23
23
|
"js-yaml": "^4.3.2",
|
|
24
24
|
"mime-types": "^2.1.35",
|
|
25
|
-
"playwright": "^1.
|
|
25
|
+
"playwright": "^1.65.0",
|
|
26
26
|
"synckit": "^0.12.3",
|
|
27
27
|
"textlint": "^15.8.0",
|
|
28
28
|
"textlint-rule-preset-ai-words-ja": "1.2.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pecot/visual-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "pecotv MCP server (standalone distribution)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@xmldom/xmldom": "^0.9.12",
|
|
21
21
|
"commander": "^15.1.0",
|
|
22
22
|
"mime-types": "^2.1.35",
|
|
23
|
-
"playwright": "^1.
|
|
23
|
+
"playwright": "^1.65.0",
|
|
24
24
|
"xpath": "^0.0.36",
|
|
25
25
|
"yaml": "2.9.1",
|
|
26
26
|
"yauzl": "^3.4.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f6773c877776dc5b38bd541980ff8f57f733794763b1f9348a103cbeef6b02f1
|