@pecot/visual-mcp 1.3.1 → 3.0.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/README.md +12 -12
- package/assets/slidev/package.json +1 -1
- package/assets/slidev/scripts/eslint/slidev-pages-lint/package.json +1 -1
- package/assets/slidev/scripts/eslint/text-constraints/package.json +1 -1
- package/cli/dist/commands/drawio/errors.d.ts +5 -4
- package/cli/dist/commands/drawio/export.d.ts +6 -5
- package/cli/dist/commands/drawio/export.js +0 -2
- package/cli/dist/commands/drawio/url.d.ts +2 -1
- package/cli/dist/commands/drawio/url.js +0 -1
- package/cli/dist/commands/evidence-xlsx/create.d.ts +2 -1
- package/cli/dist/commands/evidence-xlsx/create.js +0 -1
- package/cli/dist/commands/pptx-ooxml/preview.d.ts +4 -3
- package/cli/dist/commands/pptx-ooxml/preview.js +0 -3
- package/cli/dist/commands/slidev-project/create.d.ts +2 -1
- package/cli/dist/commands/slidev-project/create.js +0 -1
- package/cli/dist/commands/slidev-project/lint.d.ts +2 -1
- package/cli/dist/commands/slidev-project/sync.d.ts +2 -1
- package/cli/dist/commands/slidev-project/sync.js +0 -1
- package/cli/dist/commands/slidev-project/theme.d.ts +2 -1
- package/cli/dist/commands/slidev-to-pptx/convert.d.ts +6 -5
- package/cli/dist/commands/slidev-to-pptx/convert.js +0 -4
- package/cli/dist/domain/_shared/failure-kind.d.ts +13 -0
- package/cli/dist/domain/_shared/failure-kind.js +103 -0
- package/cli/dist/domain/slidev-project/errors.d.ts +5 -4
- package/cli/dist/domain/slidev-theme/error-reason.d.ts +9 -5
- package/cli/dist/infra/_shared/dependency-root.d.ts +3 -3
- package/cli/dist/infra/_shared/dependency-root.js +5 -5
- package/cli/dist/infra/_shared/runtime-install.d.ts +1 -1
- package/cli/dist/infra/_shared/runtime-install.js +1 -1
- package/cli/dist/infra/_shared/slidev-bin.d.ts +1 -1
- package/cli/dist/infra/_shared/slidev-bin.js +1 -1
- package/cli/dist/infra/playwright/chromium.js +2 -2
- package/cli/dist/infra/playwright/host-dependencies.js +1 -1
- package/cli/dist/infra/playwright/launch.js +1 -1
- package/cli/dist/infra/slidev-to-pptx/pipeline.js +1 -1
- package/cli/dist/infra/slidev-to-pptx/runner.js +1 -1
- package/cli/dist/mcp/dev-server-registry.d.ts +6 -1
- package/cli/dist/mcp/dev-server-registry.js +4 -1
- package/cli/dist/mcp/result.d.ts +36 -61
- package/cli/dist/mcp/result.js +73 -75
- package/cli/dist/mcp/tool-names.d.ts +17 -0
- package/cli/dist/mcp/tool-names.js +26 -0
- package/cli/dist/mcp/tools/_shared.d.ts +40 -38
- package/cli/dist/mcp/tools/_shared.js +63 -72
- package/cli/dist/mcp/tools/drawio.js +47 -61
- package/cli/dist/mcp/tools/evidence.js +11 -18
- package/cli/dist/mcp/tools/setup.d.ts +1 -1
- package/cli/dist/mcp/tools/setup.js +18 -38
- package/cli/dist/mcp/tools/slide-dev.js +17 -36
- package/cli/dist/mcp/tools/slide-page.d.ts +2 -1
- package/cli/dist/mcp/tools/slide-page.js +20 -26
- package/cli/dist/mcp/tools/slide-theme.js +4 -11
- package/cli/dist/mcp/tools/slide.d.ts +2 -2
- package/cli/dist/mcp/tools/slide.js +31 -73
- package/cli/dist/mcp/warnings.d.ts +24 -0
- package/cli/dist/mcp/warnings.js +101 -0
- package/cli/dist/mcp/windows-path.js +1 -1
- package/npm-shrinkwrap.json +92 -33
- package/package.json +2 -2
- package/vendor/text-rules/dist/source-hash +1 -1
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
// MCP ツール定義のうち slide 系 4 件 (slide_create / slide_convert / slide_sync / slide_lint)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// ための構造で、ハンドラ側には「引数の写像」と「ToolResult への正規化」しか置かない。
|
|
6
|
-
//
|
|
7
|
-
// deps は必ずハンドラ内で組み立てる。
|
|
8
|
-
// 既定 deps ファクトリは CLAUDE_PLUGIN_ROOT 未設定で throw する。
|
|
9
|
-
// モジュール top-level や allTools() 評価時に組み立てると tools/list ごと落ちる。
|
|
10
|
-
// stdout / stderr は MCP のプロセス stdout が JSON-RPC 専有なので、必ず捕捉先へ差し替える。
|
|
3
|
+
// 各ハンドラは CLI コマンドの execute<Cmd>() を呼び、結果を ToolResult に写すだけにする。
|
|
4
|
+
// deps はハンドラ内で組み立てる (既定 deps は CLAUDE_PLUGIN_ROOT 未設定で throw し、top-level だと tools/list ごと落ちる)。
|
|
11
5
|
import path from 'node:path';
|
|
12
6
|
import { z } from 'zod';
|
|
13
|
-
import { errorToReason as slideCreateErrorToReason, executeSlideCreate, slideCreateDefaultDependencies,
|
|
14
|
-
import { errorToReason as slideLintErrorToReason, executeSlideLint, slideLintDefaultDependencies,
|
|
15
|
-
import { errorToReason as slideSyncErrorToReason, executeSlideSync, slideSyncDefaultDependencies,
|
|
16
|
-
import { convertErrorDiagnostics, errorToReason as slideConvertErrorToReason, executeSlideConvert, resolveDefaultOut, slideConvertDefaultDependencies,
|
|
7
|
+
import { errorToReason as slideCreateErrorToReason, executeSlideCreate, slideCreateDefaultDependencies, } from '../../commands/slidev-project/create.js';
|
|
8
|
+
import { errorToReason as slideLintErrorToReason, executeSlideLint, slideLintDefaultDependencies, } from '../../commands/slidev-project/lint.js';
|
|
9
|
+
import { errorToReason as slideSyncErrorToReason, executeSlideSync, slideSyncDefaultDependencies, } from '../../commands/slidev-project/sync.js';
|
|
10
|
+
import { convertErrorDiagnostics, errorToReason as slideConvertErrorToReason, executeSlideConvert, resolveDefaultOut, slideConvertDefaultDependencies, } from '../../commands/slidev-to-pptx/convert.js';
|
|
11
|
+
import { failureKindOf } from '../../domain/_shared/failure-kind.js';
|
|
17
12
|
import { parsePathArguments, toCallToolResult } from '../result.js';
|
|
18
13
|
import { captureCommandOutput, chromiumDefaultDependencies, ensureChromium, ensureRuntimeDependencies, formatError, normalizeThemeArgument, runtimeDefaultDependencies, TOOL_OUTPUT_SCHEMA, WINDOWS_PATH_NOTE, } from './_shared.js';
|
|
19
14
|
/**
|
|
20
15
|
失敗時の ToolResult。data は対応する CLI コマンドの `--json` error payload と同形にする。
|
|
21
16
|
*/
|
|
22
|
-
function failureResult(event, reason,
|
|
23
|
-
const detail = formatError(error);
|
|
17
|
+
function failureResult(event, reason, error, extra = {}) {
|
|
24
18
|
return {
|
|
25
19
|
ok: false,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
data: { event,
|
|
29
|
-
message: detail,
|
|
20
|
+
kind: failureKindOf(reason),
|
|
21
|
+
detail: formatError(error),
|
|
22
|
+
data: { event, ...extra },
|
|
30
23
|
};
|
|
31
24
|
}
|
|
32
25
|
const slideCreateInput = z.object({
|
|
@@ -52,7 +45,7 @@ export function slideCreateTool(buildDependencies = slideCreateDefaultDependenci
|
|
|
52
45
|
description: 'Generates a new talk-dir that references the Slidev theme given by `theme`. '
|
|
53
46
|
+ 'The theme is specified by a git URL with a tag (`git+https://<host>/<owner>/<repo>.git#<tag>`) '
|
|
54
47
|
+ 'or a local path (`file:<path>`). '
|
|
55
|
-
+ 'Returns the presentation categories (
|
|
48
|
+
+ 'Returns the presentation categories (categories) and the list of selectable layouts (layouts). '
|
|
56
49
|
+ 'Also returns the lint result of the whole deck right after generation (generation counts as successful even with lint violations).',
|
|
57
50
|
inputSchema: slideCreateInput,
|
|
58
51
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
@@ -65,14 +58,10 @@ export function slideCreateTool(buildDependencies = slideCreateDefaultDependenci
|
|
|
65
58
|
const input = validated.input;
|
|
66
59
|
const normalized = normalizeThemeArgument(input.theme);
|
|
67
60
|
if (!normalized.ok) {
|
|
68
|
-
return toCallToolResult(
|
|
69
|
-
...failureResult('slide.create.error', 'invalid-option', 2, new Error(normalized.detail)),
|
|
70
|
-
stdout: '',
|
|
71
|
-
stderr: '',
|
|
72
|
-
});
|
|
61
|
+
return toCallToolResult(failureResult('slide.create.error', 'invalid-option', new Error(normalized.detail)));
|
|
73
62
|
}
|
|
74
63
|
// 生成の最後に行う node_modules の張り直しは依存ルートの実体を要る。実処理より前に見る。
|
|
75
|
-
// 見ずに進むと、テーマの取得 (git) を終えた後で symlink-failed になり、
|
|
64
|
+
// 見ずに進むと、テーマの取得 (git) を終えた後で symlink-failed になり、runtime_setup の案内も出ない。
|
|
76
65
|
// 失敗した生成は一時 dir を消すため、途中まで作った talk-dir は残らない。
|
|
77
66
|
const missingRuntime = ensureRuntimeDependencies('slide_create', buildRuntimeDependencies());
|
|
78
67
|
if (missingRuntime !== undefined)
|
|
@@ -86,22 +75,16 @@ export function slideCreateTool(buildDependencies = slideCreateDefaultDependenci
|
|
|
86
75
|
};
|
|
87
76
|
const execution = await executeSlideCreate(input.project_dir,
|
|
88
77
|
// 人間向けの catalog 整形出力は stdout を汚すので出さない。
|
|
89
|
-
// 同じ元データは
|
|
78
|
+
// 同じ元データは layouts に構造化して載る。
|
|
90
79
|
{ theme: normalized.theme, force: input.force, emitCatalog: false }, dependencies);
|
|
91
|
-
return
|
|
80
|
+
return output.finish({
|
|
92
81
|
ok: true,
|
|
93
|
-
exitCode: 0,
|
|
94
|
-
artifacts: [execution.summary.projectDirectory],
|
|
95
82
|
data: execution.data,
|
|
96
83
|
message: `slide create: succeeded (${execution.summary.projectDirectory})`,
|
|
97
|
-
...output.part(),
|
|
98
84
|
});
|
|
99
85
|
}
|
|
100
86
|
catch (error) {
|
|
101
|
-
return
|
|
102
|
-
...failureResult('slide.create.error', slideCreateErrorToReason(error), slideCreateExitCode(error), error),
|
|
103
|
-
...output.part(),
|
|
104
|
-
});
|
|
87
|
+
return output.finish(failureResult('slide.create.error', slideCreateErrorToReason(error), error));
|
|
105
88
|
}
|
|
106
89
|
},
|
|
107
90
|
};
|
|
@@ -152,7 +135,7 @@ export function slideConvertTool(buildDependencies = slideConvertDefaultDependen
|
|
|
152
135
|
const input = validated.input;
|
|
153
136
|
// pipeline (infra/slidev-to-pptx) は @slidev/cli / dom-to-pptx / @slidev/parser を
|
|
154
137
|
// 起動時ではなく実行時に解決する。単体配布ルートではこれらが永続層にしか無いため、
|
|
155
|
-
// 未取得なら `
|
|
138
|
+
// 未取得なら `runtime_setup` を案内して実行前に返す。
|
|
156
139
|
const missingRuntime = ensureRuntimeDependencies('slide_convert', buildRuntimeDependencies());
|
|
157
140
|
if (missingRuntime !== undefined)
|
|
158
141
|
return toCallToolResult(missingRuntime);
|
|
@@ -162,10 +145,7 @@ export function slideConvertTool(buildDependencies = slideConvertDefaultDependen
|
|
|
162
145
|
return toCallToolResult(unavailable);
|
|
163
146
|
const output = captureCommandOutput();
|
|
164
147
|
try {
|
|
165
|
-
// json: false
|
|
166
|
-
// 進捗の人間可読ログは stderr の診断行 (note / warning / error) で出るので、ToolResult の stderr に入る。
|
|
167
|
-
// stdout には変換結果の要約だけが入る。
|
|
168
|
-
// MCP サーバの process.stdout は JSON-RPC 専有なので、実 stdout へは何も書かせない。
|
|
148
|
+
// json: false 相当で呼び、出力を捕捉する。warning の行は warnings、失敗のときの出力は log に入る。
|
|
169
149
|
const dependencies = {
|
|
170
150
|
...buildDependencies(),
|
|
171
151
|
stdout: output.stdout,
|
|
@@ -189,21 +169,15 @@ export function slideConvertTool(buildDependencies = slideConvertDefaultDependen
|
|
|
189
169
|
...(input.morph_option !== undefined && { morphOption: input.morph_option }),
|
|
190
170
|
};
|
|
191
171
|
const execution = await executeSlideConvert(input.project_dir, options, dependencies);
|
|
192
|
-
return
|
|
172
|
+
return output.finish({
|
|
193
173
|
ok: true,
|
|
194
|
-
exitCode: 0,
|
|
195
|
-
artifacts: [execution.summary.outputAbs],
|
|
196
174
|
data: execution.data,
|
|
197
175
|
message: `slide convert: ${execution.summary.inputAbs} -> ${execution.summary.outputAbs}`
|
|
198
176
|
+ ` (${String(Math.round(execution.summary.durationMs))}ms)`,
|
|
199
|
-
...output.part(),
|
|
200
177
|
});
|
|
201
178
|
}
|
|
202
179
|
catch (error) {
|
|
203
|
-
return
|
|
204
|
-
...failureResult('slide.convert.error', slideConvertErrorToReason(error), slideConvertExitCode(error), error, convertErrorDiagnostics(error)),
|
|
205
|
-
...output.part(),
|
|
206
|
-
});
|
|
180
|
+
return output.finish(failureResult('slide.convert.error', slideConvertErrorToReason(error), error, convertErrorDiagnostics(error)));
|
|
207
181
|
}
|
|
208
182
|
},
|
|
209
183
|
};
|
|
@@ -232,12 +206,12 @@ export function slideSyncTool(buildDependencies = slideSyncDefaultDependencies,
|
|
|
232
206
|
description: 'Syncs an existing talk-dir. '
|
|
233
207
|
+ 'A pre-migration talk-dir (one that holds a copy of the template; slide_dev and others stop with theme-none) '
|
|
234
208
|
+ '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
|
|
209
|
+
+ 'and the work area (slides.md / pages/*.md / public/slides/) is kept. The deleted names are returned in migration.removed. '
|
|
236
210
|
+ 'A migrated talk-dir that references a theme (theme: in slides.md points to the theme in dependencies of package.json) '
|
|
237
211
|
+ 'fetches the theme at the version in the dependency and relinks node_modules, '
|
|
238
212
|
+ 'and aligns the generated files (vite.config.ts, start.mjs) with the current content of the plugin. Other files are left unchanged. '
|
|
239
213
|
+ 'To raise the theme version, rewrite the #<tag> of the dependency in package.json before calling. '
|
|
240
|
-
+ 'Returns the presentation categories (
|
|
214
|
+
+ 'Returns the presentation categories (categories), the list of selectable layouts (layouts), '
|
|
241
215
|
+ '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
216
|
inputSchema: slideSyncInput,
|
|
243
217
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
@@ -254,11 +228,7 @@ export function slideSyncTool(buildDependencies = slideSyncDefaultDependencies,
|
|
|
254
228
|
if (input.theme !== undefined) {
|
|
255
229
|
const normalized = normalizeThemeArgument(input.theme);
|
|
256
230
|
if (!normalized.ok) {
|
|
257
|
-
return toCallToolResult(
|
|
258
|
-
...failureResult('slide.sync.error', 'invalid-option', 2, new Error(normalized.detail)),
|
|
259
|
-
stdout: '',
|
|
260
|
-
stderr: '',
|
|
261
|
-
});
|
|
231
|
+
return toCallToolResult(failureResult('slide.sync.error', 'invalid-option', new Error(normalized.detail)));
|
|
262
232
|
}
|
|
263
233
|
theme = normalized.theme;
|
|
264
234
|
}
|
|
@@ -275,20 +245,14 @@ export function slideSyncTool(buildDependencies = slideSyncDefaultDependencies,
|
|
|
275
245
|
stderr: output.stderr,
|
|
276
246
|
};
|
|
277
247
|
const execution = await executeSlideSync({ dir: input.dir, nodeModulesOnly: input.node_modules_only, theme }, dependencies);
|
|
278
|
-
return
|
|
248
|
+
return output.finish({
|
|
279
249
|
ok: true,
|
|
280
|
-
exitCode: 0,
|
|
281
|
-
artifacts: [execution.summary.directory],
|
|
282
250
|
data: execution.data,
|
|
283
251
|
message: syncSuccessMessage(execution.summary),
|
|
284
|
-
...output.part(),
|
|
285
252
|
});
|
|
286
253
|
}
|
|
287
254
|
catch (error) {
|
|
288
|
-
return
|
|
289
|
-
...failureResult('slide.sync.error', slideSyncErrorToReason(error), slideSyncExitCode(error), error),
|
|
290
|
-
...output.part(),
|
|
291
|
-
});
|
|
255
|
+
return output.finish(failureResult('slide.sync.error', slideSyncErrorToReason(error), error));
|
|
292
256
|
}
|
|
293
257
|
},
|
|
294
258
|
};
|
|
@@ -307,8 +271,8 @@ const slideLintInput = z.object({
|
|
|
307
271
|
.describe('Absolute path of the talk-dir to lint. Relative paths are not accepted. ' + WINDOWS_PATH_NOTE),
|
|
308
272
|
});
|
|
309
273
|
/**
|
|
310
|
-
`pecotv slide lint`
|
|
311
|
-
|
|
274
|
+
`pecotv slide lint` 相当。違反の検出は「報告が成果」なので、違反があっても成功で返す (CLI は exit 1)。
|
|
275
|
+
違反の有無は outcome の項目で読む。
|
|
312
276
|
*/
|
|
313
277
|
export function slideLintTool(buildDependencies = slideLintDefaultDependencies) {
|
|
314
278
|
return {
|
|
@@ -316,7 +280,7 @@ export function slideLintTool(buildDependencies = slideLintDefaultDependencies)
|
|
|
316
280
|
config: {
|
|
317
281
|
title: 'Lint a Slidev deck',
|
|
318
282
|
description: 'Lints the whole talk-dir (pages/**/*.md and slides.md) '
|
|
319
|
-
+ 'and returns the list of violations. The call itself succeeds
|
|
283
|
+
+ 'and returns the list of violations. The call itself succeeds even with violations; outcome is violations when any are found.',
|
|
320
284
|
inputSchema: slideLintInput,
|
|
321
285
|
outputSchema: TOOL_OUTPUT_SCHEMA,
|
|
322
286
|
// 読み取りのみで何も書き換えず、ネットワークにも到達しない。
|
|
@@ -336,23 +300,17 @@ export function slideLintTool(buildDependencies = slideLintDefaultDependencies)
|
|
|
336
300
|
};
|
|
337
301
|
const { summary, data } = await executeSlideLint({ dir: input.dir }, dependencies);
|
|
338
302
|
const hasViolations = summary.outcome === 'violations';
|
|
339
|
-
return
|
|
303
|
+
return output.finish({
|
|
340
304
|
ok: true,
|
|
341
|
-
exitCode: hasViolations ? 1 : 0,
|
|
342
|
-
artifacts: [],
|
|
343
305
|
data,
|
|
344
306
|
message: hasViolations
|
|
345
307
|
? `slide lint: violations found (${summary.directory}); ${String(summary.errorCount)} errors`
|
|
346
308
|
+ `; ${String(summary.warningCount)} warnings`
|
|
347
309
|
: `slide lint: succeeded (${summary.directory}); ${String(summary.lintedFileCount)} files linted`,
|
|
348
|
-
...output.part(),
|
|
349
310
|
});
|
|
350
311
|
}
|
|
351
312
|
catch (error) {
|
|
352
|
-
return
|
|
353
|
-
...failureResult('slide.lint.error', slideLintErrorToReason(error), slideLintExitCode(error), error),
|
|
354
|
-
...output.part(),
|
|
355
|
-
});
|
|
313
|
+
return output.finish(failureResult('slide.lint.error', slideLintErrorToReason(error), error));
|
|
356
314
|
}
|
|
357
315
|
},
|
|
358
316
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
保つ warning の件数の上限。超えた分は数えて、最後に知らせの 1 文を足す。
|
|
3
|
+
*/
|
|
4
|
+
export declare const WARNING_LIMIT_COUNT = 100;
|
|
5
|
+
/**
|
|
6
|
+
保つ warning の文の合計の上限 (バイト)。出力の捕捉と同じ 64KB にする。
|
|
7
|
+
*/
|
|
8
|
+
export declare const WARNING_LIMIT_BYTES: number;
|
|
9
|
+
export interface WarningCollector {
|
|
10
|
+
/**
|
|
11
|
+
改行を除いた 1 行を渡す。
|
|
12
|
+
*/
|
|
13
|
+
addLine(line: string): void;
|
|
14
|
+
/**
|
|
15
|
+
ここまでの warning の文。trailing は改行で終わっていない最後の行で、状態には残さない。
|
|
16
|
+
*/
|
|
17
|
+
list(trailing?: string): string[];
|
|
18
|
+
}
|
|
19
|
+
export declare function createWarningCollector(): WarningCollector;
|
|
20
|
+
/**
|
|
21
|
+
文字列の全体から warning の文を取る。続きの行 (先頭に空白 2 つ) は同じ文に含める。
|
|
22
|
+
*/
|
|
23
|
+
export declare function warningsOf(text: string): string[];
|
|
24
|
+
//# sourceMappingURL=warnings.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// diagnostics の `warning: ` の行を文の配列にする。出力の捕捉の上限と別に保ち、早く出た warning を落とさない。
|
|
2
|
+
const WARNING_PREFIX = 'warning: ';
|
|
3
|
+
const CONTINUATION_PREFIX = ' ';
|
|
4
|
+
/**
|
|
5
|
+
保つ warning の件数の上限。超えた分は数えて、最後に知らせの 1 文を足す。
|
|
6
|
+
*/
|
|
7
|
+
export const WARNING_LIMIT_COUNT = 100;
|
|
8
|
+
/**
|
|
9
|
+
保つ warning の文の合計の上限 (バイト)。出力の捕捉と同じ 64KB にする。
|
|
10
|
+
*/
|
|
11
|
+
export const WARNING_LIMIT_BYTES = 64 * 1024;
|
|
12
|
+
class WarningState {
|
|
13
|
+
kept = [];
|
|
14
|
+
seen = new Set();
|
|
15
|
+
keptBytes = 0;
|
|
16
|
+
omitted = 0;
|
|
17
|
+
/**
|
|
18
|
+
組み立て中の warning の行。上限を超えた後の行は足さず、バイト数だけ数える。
|
|
19
|
+
*/
|
|
20
|
+
current;
|
|
21
|
+
currentBytes = 0;
|
|
22
|
+
append(text) {
|
|
23
|
+
const bytes = Buffer.byteLength(text, 'utf8');
|
|
24
|
+
// 1 つの warning が上限を超えたら、それ以上の行は持たない (閉じるときに省いた数へ入る)。
|
|
25
|
+
if (this.currentBytes + bytes <= WARNING_LIMIT_BYTES)
|
|
26
|
+
this.current?.push(text);
|
|
27
|
+
this.currentBytes += bytes;
|
|
28
|
+
}
|
|
29
|
+
close() {
|
|
30
|
+
const { current } = this;
|
|
31
|
+
if (current === undefined)
|
|
32
|
+
return;
|
|
33
|
+
this.current = undefined;
|
|
34
|
+
const text = current.join('\n');
|
|
35
|
+
if (text.trim() === '' || this.seen.has(text))
|
|
36
|
+
return;
|
|
37
|
+
if (this.kept.length >= WARNING_LIMIT_COUNT || this.keptBytes + this.currentBytes > WARNING_LIMIT_BYTES) {
|
|
38
|
+
this.omitted += 1;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.kept.push(text);
|
|
42
|
+
this.seen.add(text);
|
|
43
|
+
this.keptBytes += this.currentBytes;
|
|
44
|
+
}
|
|
45
|
+
clone() {
|
|
46
|
+
const copy = new WarningState();
|
|
47
|
+
copy.kept.push(...this.kept);
|
|
48
|
+
for (const text of this.seen)
|
|
49
|
+
copy.seen.add(text);
|
|
50
|
+
copy.keptBytes = this.keptBytes;
|
|
51
|
+
copy.omitted = this.omitted;
|
|
52
|
+
copy.current = this.current === undefined ? undefined : [...this.current];
|
|
53
|
+
copy.currentBytes = this.currentBytes;
|
|
54
|
+
return copy;
|
|
55
|
+
}
|
|
56
|
+
addLine(line) {
|
|
57
|
+
if (line.startsWith(WARNING_PREFIX)) {
|
|
58
|
+
this.close();
|
|
59
|
+
this.current = [];
|
|
60
|
+
this.currentBytes = 0;
|
|
61
|
+
this.append(line.slice(WARNING_PREFIX.length));
|
|
62
|
+
}
|
|
63
|
+
else if (this.current !== undefined && line.startsWith(CONTINUATION_PREFIX)) {
|
|
64
|
+
this.append(line.slice(CONTINUATION_PREFIX.length));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
this.close();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
finish() {
|
|
71
|
+
this.close();
|
|
72
|
+
return this.omitted > 0 ? [...this.kept, omittedNotice(this.omitted)] : [...this.kept];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function omittedNotice(count) {
|
|
76
|
+
return `${String(count)} more warnings were omitted (limit: ${String(WARNING_LIMIT_COUNT)} warnings or ${String(WARNING_LIMIT_BYTES)} bytes)`;
|
|
77
|
+
}
|
|
78
|
+
export function createWarningCollector() {
|
|
79
|
+
const state = new WarningState();
|
|
80
|
+
return {
|
|
81
|
+
addLine: (line) => {
|
|
82
|
+
state.addLine(line);
|
|
83
|
+
},
|
|
84
|
+
list: (trailing) => {
|
|
85
|
+
const snapshot = state.clone();
|
|
86
|
+
if (trailing !== undefined)
|
|
87
|
+
snapshot.addLine(trailing);
|
|
88
|
+
return snapshot.finish();
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
文字列の全体から warning の文を取る。続きの行 (先頭に空白 2 つ) は同じ文に含める。
|
|
94
|
+
*/
|
|
95
|
+
export function warningsOf(text) {
|
|
96
|
+
const collector = createWarningCollector();
|
|
97
|
+
for (const line of text.split('\n'))
|
|
98
|
+
collector.addLine(line);
|
|
99
|
+
return collector.list();
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=warnings.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// だがクライアントが組み立てるパスは `C:\Users\...` 形式になる。
|
|
5
5
|
// POSIX では `C:\...` は絶対パスと判定されない。
|
|
6
6
|
// 変換を挟まないと FR-011 の絶対パス確認 (src/mcp/result.ts) が実処理の前に全て弾いてしまう。
|
|
7
|
-
//
|
|
7
|
+
// 変換するのは入力側だけ。応答の項目には変換後の POSIX パスをそのまま載せる。
|
|
8
8
|
// Windows 形式への逆変換はしない。
|
|
9
9
|
//
|
|
10
10
|
// 変換後のパスは `..` を含むと mount root の外へ出うる (`C:\..\..\etc` → `/etc`)。FR-011 と
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pecot/visual-mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@pecot/visual-mcp",
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "3.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@cffnpwr/textlint-plugin-comments": "1.0.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@xmldom/xmldom": "^0.9.12",
|
|
20
20
|
"ajv": "^8.20.0",
|
|
21
21
|
"commander": "^15.1.0",
|
|
22
|
-
"eslint": "^10.
|
|
22
|
+
"eslint": "^10.15.0",
|
|
23
23
|
"js-yaml": "^4.3.2",
|
|
24
24
|
"mime-types": "^2.1.35",
|
|
25
25
|
"playwright": "^1.65.0",
|
|
@@ -201,14 +201,14 @@
|
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
203
|
"node_modules/@eslint/config-array": {
|
|
204
|
-
"version": "0.23.
|
|
205
|
-
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.
|
|
206
|
-
"integrity": "sha512-
|
|
204
|
+
"version": "0.23.6",
|
|
205
|
+
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.6.tgz",
|
|
206
|
+
"integrity": "sha512-WrTH7nioI9QPY4NZGnsywmecswJdgeq4BCM76qok9VgjTO29ZgUzUvcuJLVPYVQM4uDbaPBU0M33R9DIxI8X3w==",
|
|
207
207
|
"license": "Apache-2.0",
|
|
208
208
|
"dependencies": {
|
|
209
209
|
"@eslint/object-schema": "^3.0.5",
|
|
210
210
|
"debug": "^4.3.1",
|
|
211
|
-
"minimatch": "^
|
|
211
|
+
"minimatch": "^11.0.5"
|
|
212
212
|
},
|
|
213
213
|
"engines": {
|
|
214
214
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
|
@@ -346,6 +346,12 @@
|
|
|
346
346
|
"url": "https://github.com/sponsors/nzakas"
|
|
347
347
|
}
|
|
348
348
|
},
|
|
349
|
+
"node_modules/@isaacs/nonrecursive-glob-match": {
|
|
350
|
+
"version": "1.1.0",
|
|
351
|
+
"resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz",
|
|
352
|
+
"integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==",
|
|
353
|
+
"license": "BlueOak-1.0.0"
|
|
354
|
+
},
|
|
349
355
|
"node_modules/@keyv/bigmap": {
|
|
350
356
|
"version": "1.3.1",
|
|
351
357
|
"resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.3.1.tgz",
|
|
@@ -1547,9 +1553,9 @@
|
|
|
1547
1553
|
}
|
|
1548
1554
|
},
|
|
1549
1555
|
"node_modules/eslint": {
|
|
1550
|
-
"version": "10.
|
|
1551
|
-
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.
|
|
1552
|
-
"integrity": "sha512
|
|
1556
|
+
"version": "10.15.0",
|
|
1557
|
+
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.15.0.tgz",
|
|
1558
|
+
"integrity": "sha512-+5Wg4p+ze3sG1WErYgUO/3H1IQIfFBymVUA0Fo/XTeBOLS6UQIUekpSJ8sdRkn7O7wjh84b55w/roqavH2aScg==",
|
|
1553
1559
|
"license": "MIT",
|
|
1554
1560
|
"workspaces": [
|
|
1555
1561
|
"packages/*"
|
|
@@ -1557,7 +1563,7 @@
|
|
|
1557
1563
|
"dependencies": {
|
|
1558
1564
|
"@eslint-community/eslint-utils": "^4.8.0",
|
|
1559
1565
|
"@eslint-community/regexpp": "^4.12.2",
|
|
1560
|
-
"@eslint/config-array": "^0.23.
|
|
1566
|
+
"@eslint/config-array": "^0.23.6",
|
|
1561
1567
|
"@eslint/config-helpers": "^0.7.0",
|
|
1562
1568
|
"@eslint/core": "^1.2.1",
|
|
1563
1569
|
"@eslint/plugin-kit": "^0.7.3",
|
|
@@ -1582,7 +1588,7 @@
|
|
|
1582
1588
|
"imurmurhash": "^0.1.4",
|
|
1583
1589
|
"is-glob": "^4.0.0",
|
|
1584
1590
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
|
1585
|
-
"minimatch": "^
|
|
1591
|
+
"minimatch": "^11.0.5",
|
|
1586
1592
|
"natural-compare": "^1.4.0",
|
|
1587
1593
|
"optionator": "^0.9.3"
|
|
1588
1594
|
},
|
|
@@ -2028,6 +2034,21 @@
|
|
|
2028
2034
|
"node": ">=10.13.0"
|
|
2029
2035
|
}
|
|
2030
2036
|
},
|
|
2037
|
+
"node_modules/glob/node_modules/minimatch": {
|
|
2038
|
+
"version": "10.2.6",
|
|
2039
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
|
|
2040
|
+
"integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
|
|
2041
|
+
"license": "BlueOak-1.0.0",
|
|
2042
|
+
"dependencies": {
|
|
2043
|
+
"brace-expansion": "^5.0.8"
|
|
2044
|
+
},
|
|
2045
|
+
"engines": {
|
|
2046
|
+
"node": "18 || 20 || >=22"
|
|
2047
|
+
},
|
|
2048
|
+
"funding": {
|
|
2049
|
+
"url": "https://github.com/sponsors/isaacs"
|
|
2050
|
+
}
|
|
2051
|
+
},
|
|
2031
2052
|
"node_modules/globalthis": {
|
|
2032
2053
|
"version": "1.0.4",
|
|
2033
2054
|
"resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz",
|
|
@@ -4126,15 +4147,16 @@
|
|
|
4126
4147
|
}
|
|
4127
4148
|
},
|
|
4128
4149
|
"node_modules/minimatch": {
|
|
4129
|
-
"version": "
|
|
4130
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-
|
|
4131
|
-
"integrity": "sha512-
|
|
4150
|
+
"version": "11.0.8",
|
|
4151
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz",
|
|
4152
|
+
"integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==",
|
|
4132
4153
|
"license": "BlueOak-1.0.0",
|
|
4133
4154
|
"dependencies": {
|
|
4134
|
-
"
|
|
4155
|
+
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
|
4156
|
+
"brace-expansion": "^5.0.12"
|
|
4135
4157
|
},
|
|
4136
4158
|
"engines": {
|
|
4137
|
-
"node": "
|
|
4159
|
+
"node": "20 || >=22"
|
|
4138
4160
|
},
|
|
4139
4161
|
"funding": {
|
|
4140
4162
|
"url": "https://github.com/sponsors/isaacs"
|
|
@@ -4449,12 +4471,12 @@
|
|
|
4449
4471
|
"license": "ISC"
|
|
4450
4472
|
},
|
|
4451
4473
|
"node_modules/playwright": {
|
|
4452
|
-
"version": "1.65.
|
|
4453
|
-
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.
|
|
4454
|
-
"integrity": "sha512-
|
|
4474
|
+
"version": "1.65.1",
|
|
4475
|
+
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.1.tgz",
|
|
4476
|
+
"integrity": "sha512-vJ1FuoOrNwOKHUIVEvSt3jT1L+wjjDpwhwIstKtfvTh8XIG4FG4bIFuvNdMxi81LGfAhUgUZleVFaOLY4RIUUw==",
|
|
4455
4477
|
"license": "Apache-2.0",
|
|
4456
4478
|
"dependencies": {
|
|
4457
|
-
"playwright-core": "1.65.
|
|
4479
|
+
"playwright-core": "1.65.1"
|
|
4458
4480
|
},
|
|
4459
4481
|
"bin": {
|
|
4460
4482
|
"playwright": "cli.js"
|
|
@@ -4464,9 +4486,9 @@
|
|
|
4464
4486
|
}
|
|
4465
4487
|
},
|
|
4466
4488
|
"node_modules/playwright-core": {
|
|
4467
|
-
"version": "1.65.
|
|
4468
|
-
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.
|
|
4469
|
-
"integrity": "sha512-
|
|
4489
|
+
"version": "1.65.1",
|
|
4490
|
+
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.1.tgz",
|
|
4491
|
+
"integrity": "sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw==",
|
|
4470
4492
|
"license": "Apache-2.0",
|
|
4471
4493
|
"bin": {
|
|
4472
4494
|
"playwright-core": "cli.js"
|
|
@@ -4585,17 +4607,55 @@
|
|
|
4585
4607
|
"license": "MIT"
|
|
4586
4608
|
},
|
|
4587
4609
|
"node_modules/rc-config-loader": {
|
|
4588
|
-
"version": "4.
|
|
4589
|
-
"resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-4.
|
|
4590
|
-
"integrity": "sha512-
|
|
4610
|
+
"version": "4.2.0",
|
|
4611
|
+
"resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-4.2.0.tgz",
|
|
4612
|
+
"integrity": "sha512-PoQabZw5RBxSW9jJhI1WJ8hpLYCjF4PrkhqkkjXYKRpWTo1cn3ovdXku2spdS79dnD3pT/axXeEUnwbG8qxz9A==",
|
|
4591
4613
|
"license": "MIT",
|
|
4592
4614
|
"dependencies": {
|
|
4593
4615
|
"debug": "^4.4.3",
|
|
4594
|
-
"js-yaml": "^
|
|
4616
|
+
"js-yaml": "^5.5.0",
|
|
4595
4617
|
"json5": "^2.2.3",
|
|
4596
4618
|
"require-from-string": "^2.0.2"
|
|
4597
4619
|
}
|
|
4598
4620
|
},
|
|
4621
|
+
"node_modules/rc-config-loader/node_modules/argparse": {
|
|
4622
|
+
"version": "3.0.4",
|
|
4623
|
+
"resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.4.tgz",
|
|
4624
|
+
"integrity": "sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==",
|
|
4625
|
+
"funding": [
|
|
4626
|
+
{
|
|
4627
|
+
"type": "github",
|
|
4628
|
+
"url": "https://github.com/sponsors/puzrin"
|
|
4629
|
+
},
|
|
4630
|
+
{
|
|
4631
|
+
"type": "github",
|
|
4632
|
+
"url": "https://github.com/sponsors/nodeca"
|
|
4633
|
+
}
|
|
4634
|
+
],
|
|
4635
|
+
"license": "PSF-2.0"
|
|
4636
|
+
},
|
|
4637
|
+
"node_modules/rc-config-loader/node_modules/js-yaml": {
|
|
4638
|
+
"version": "5.5.0",
|
|
4639
|
+
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.5.0.tgz",
|
|
4640
|
+
"integrity": "sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==",
|
|
4641
|
+
"funding": [
|
|
4642
|
+
{
|
|
4643
|
+
"type": "github",
|
|
4644
|
+
"url": "https://github.com/sponsors/puzrin"
|
|
4645
|
+
},
|
|
4646
|
+
{
|
|
4647
|
+
"type": "github",
|
|
4648
|
+
"url": "https://github.com/sponsors/nodeca"
|
|
4649
|
+
}
|
|
4650
|
+
],
|
|
4651
|
+
"license": "MIT",
|
|
4652
|
+
"dependencies": {
|
|
4653
|
+
"argparse": "^3.0.3"
|
|
4654
|
+
},
|
|
4655
|
+
"bin": {
|
|
4656
|
+
"js-yaml": "bin/js-yaml.mjs"
|
|
4657
|
+
}
|
|
4658
|
+
},
|
|
4599
4659
|
"node_modules/read-package-up": {
|
|
4600
4660
|
"version": "11.0.0",
|
|
4601
4661
|
"resolved": "https://registry.npmjs.org/read-package-up/-/read-package-up-11.0.0.tgz",
|
|
@@ -5202,13 +5262,12 @@
|
|
|
5202
5262
|
}
|
|
5203
5263
|
},
|
|
5204
5264
|
"node_modules/sentence-splitter": {
|
|
5205
|
-
"version": "5.0
|
|
5206
|
-
"resolved": "https://registry.npmjs.org/sentence-splitter/-/sentence-splitter-5.0.
|
|
5207
|
-
"integrity": "sha512-
|
|
5265
|
+
"version": "5.1.0",
|
|
5266
|
+
"resolved": "https://registry.npmjs.org/sentence-splitter/-/sentence-splitter-5.1.0.tgz",
|
|
5267
|
+
"integrity": "sha512-Zt4F1K7KF3QQQOVgdJ0Of6WYGI9t3aSiGRI6/DpXj1FXvL5wiOobhRbYceDZnNmnuYWfwd4l+wfyLB+nUax5ow==",
|
|
5208
5268
|
"license": "MIT",
|
|
5209
5269
|
"dependencies": {
|
|
5210
|
-
"@textlint/ast-node-types": "^15.8.0"
|
|
5211
|
-
"structured-source": "^4.0.0"
|
|
5270
|
+
"@textlint/ast-node-types": "^15.8.0"
|
|
5212
5271
|
}
|
|
5213
5272
|
},
|
|
5214
5273
|
"node_modules/set-function-length": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pecot/visual-mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "pecotv MCP server (standalone distribution)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"yauzl": "^3.4.0",
|
|
27
27
|
"yazl": "^3.3.1",
|
|
28
28
|
"zod": "^4.6.7",
|
|
29
|
-
"eslint": "^10.
|
|
29
|
+
"eslint": "^10.15.0",
|
|
30
30
|
"@eslint/markdown": "^8.0.3",
|
|
31
31
|
"js-yaml": "^4.3.2",
|
|
32
32
|
"synckit": "^0.12.3",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
e2647438de08fd656307d16eed873f76510c94c736c4d6cd28dce1bb0606eb04
|