@pecot/visual-mcp 3.1.1-dev.142 → 3.1.1-dev.144
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/cli/dist/commands/drawio/export.d.ts +9 -24
- package/cli/dist/commands/drawio/export.js +15 -135
- package/cli/dist/commands/drawio/theme.d.ts +3 -3
- package/cli/dist/commands/drawio/theme.js +10 -10
- package/cli/dist/commands/drawio/url.d.ts +9 -26
- package/cli/dist/commands/drawio/url.js +18 -131
- package/cli/dist/commands/evidence-xlsx/create.d.ts +4 -12
- package/cli/dist/commands/evidence-xlsx/create.js +9 -92
- package/cli/dist/commands/slidev-project/create.d.ts +5 -30
- package/cli/dist/commands/slidev-project/create.js +12 -136
- package/cli/dist/commands/slidev-project/linked-theme.d.ts +1 -1
- package/cli/dist/commands/slidev-project/linked-theme.js +2 -2
- package/cli/dist/commands/slidev-project/lint.d.ts +8 -37
- package/cli/dist/commands/slidev-project/lint.js +16 -161
- package/cli/dist/commands/slidev-project/sync.d.ts +7 -26
- package/cli/dist/commands/slidev-project/sync.js +15 -156
- package/cli/dist/commands/slidev-project/theme.d.ts +2 -13
- package/cli/dist/commands/slidev-project/theme.js +3 -93
- package/cli/dist/commands/slidev-to-pptx/convert.d.ts +10 -17
- package/cli/dist/commands/slidev-to-pptx/convert.js +25 -266
- package/cli/dist/diagnostics.d.ts +0 -4
- package/cli/dist/diagnostics.js +0 -6
- package/cli/dist/domain/_shared/failure-kind.d.ts +2 -2
- package/cli/dist/domain/_shared/failure-kind.js +2 -2
- package/cli/dist/domain/_shared/ports.d.ts +3 -4
- package/cli/dist/domain/evidence-xlsx/image-dimensions.d.ts +1 -1
- package/cli/dist/domain/pptx-ooxml/preview-normalize.d.ts +0 -12
- package/cli/dist/domain/pptx-ooxml/preview-normalize.js +1 -25
- package/cli/dist/domain/slidev-project/errors.js +2 -2
- package/cli/dist/domain/slidev-project/generated-files.js +3 -3
- package/cli/dist/domain/slidev-project/lint.d.ts +7 -7
- package/cli/dist/domain/slidev-project/lint.js +8 -8
- package/cli/dist/domain/slidev-project/package-json.d.ts +1 -1
- package/cli/dist/domain/slidev-project/package-json.js +2 -2
- package/cli/dist/domain/slidev-project/sync.d.ts +11 -11
- package/cli/dist/domain/slidev-project/sync.js +18 -19
- package/cli/dist/domain/slidev-theme/deck-lint-input.js +1 -1
- package/cli/dist/domain/slidev-theme/declaration.js +1 -1
- package/cli/dist/domain/slidev-theme/skeleton.js +1 -1
- package/cli/dist/domain/slidev-theme/talk-theme.d.ts +3 -3
- package/cli/dist/domain/slidev-theme/talk-theme.js +5 -7
- package/cli/dist/domain/slidev-to-pptx/config.d.ts +1 -1
- package/cli/dist/domain/slidev-to-pptx/config.js +1 -1
- package/cli/dist/domain/slidev-to-pptx/errors.d.ts +4 -4
- package/cli/dist/domain/slidev-to-pptx/errors.js +4 -4
- package/cli/dist/domain/slidev-to-pptx/types.d.ts +1 -1
- package/cli/dist/infra/_shared/dependency-root.d.ts +9 -67
- package/cli/dist/infra/_shared/dependency-root.js +15 -126
- package/cli/dist/infra/_shared/flock.js +1 -2
- package/cli/dist/infra/_shared/plugin-root.d.ts +3 -5
- package/cli/dist/infra/_shared/plugin-root.js +5 -12
- package/cli/dist/infra/evidence-xlsx/workbook-writer.d.ts +1 -1
- package/cli/dist/infra/playwright/chromium.d.ts +4 -15
- package/cli/dist/infra/playwright/chromium.js +6 -18
- package/cli/dist/infra/playwright/host-dependencies.d.ts +2 -2
- package/cli/dist/infra/playwright/host-dependencies.js +6 -6
- package/cli/dist/infra/pptx-ooxml/soffice.js +1 -1
- package/cli/dist/infra/slidev-project/eslint-runner.d.ts +1 -1
- package/cli/dist/infra/slidev-project/eslint-runner.js +2 -2
- package/cli/dist/infra/slidev-to-pptx/index.js +1 -1
- package/cli/dist/infra/slidev-to-pptx/pipeline.js +1 -1
- package/cli/dist/infra/slidev-to-pptx/prerender-capture.js +1 -1
- package/cli/dist/infra/slidev-to-pptx/server.js +2 -2
- package/cli/dist/main.d.ts +3 -0
- package/cli/dist/main.js +28 -0
- package/cli/dist/mcp/result.d.ts +5 -1
- package/cli/dist/mcp/result.js +9 -1
- package/cli/dist/mcp/serve.d.ts +2 -3
- package/cli/dist/mcp/serve.js +4 -5
- package/cli/dist/mcp/server.d.ts +5 -1
- package/cli/dist/mcp/server.js +10 -7
- package/cli/dist/mcp/tool-names.js +4 -1
- package/cli/dist/mcp/tools/_shared.d.ts +1 -1
- package/cli/dist/mcp/tools/_shared.js +2 -2
- package/cli/dist/mcp/tools/drawio.js +12 -15
- package/cli/dist/mcp/tools/evidence.js +2 -2
- package/cli/dist/mcp/tools/file.d.ts +31 -0
- package/cli/dist/mcp/tools/file.js +482 -0
- package/cli/dist/mcp/tools/index.d.ts +1 -1
- package/cli/dist/mcp/tools/index.js +6 -3
- package/cli/dist/mcp/tools/setup.js +3 -3
- package/cli/dist/mcp/tools/slide-dev.js +6 -7
- package/cli/dist/mcp/tools/slide-page.js +3 -3
- package/cli/dist/mcp/tools/slide-theme.d.ts +0 -1
- package/cli/dist/mcp/tools/slide-theme.js +2 -3
- package/cli/dist/mcp/tools/slide.d.ts +4 -4
- package/cli/dist/mcp/tools/slide.js +13 -14
- package/cli/dist/node-runtime.d.ts +2 -2
- package/cli/dist/node-runtime.js +4 -13
- package/cli/dist/version.d.ts +1 -8
- package/cli/dist/version.js +2 -11
- package/npm-shrinkwrap.json +7 -17
- package/package.json +2 -3
- package/bin/pecot-visual-mcp.mjs +0 -10
- package/cli/dist/cli.d.ts +0 -5
- package/cli/dist/cli.js +0 -109
- package/cli/dist/commands/chromium/host-dependencies.d.ts +0 -18
- package/cli/dist/commands/chromium/host-dependencies.js +0 -75
- package/cli/dist/commands/pptx-ooxml/preview.d.ts +0 -74
- package/cli/dist/commands/pptx-ooxml/preview.js +0 -399
package/cli/dist/mcp/serve.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// MCP サーバとして stdio で待ち受ける実装。
|
|
2
2
|
//
|
|
3
3
|
// 配置が src/commands/ ではなく src/mcp/ なのは ESLint の依存方向制約
|
|
4
4
|
// (commands → mcp の import 禁止) による。cli.ts はどの zone の target でもないため、
|
|
@@ -77,7 +77,7 @@ export function installStdoutGuard(stdout, stderr) {
|
|
|
77
77
|
dev サーバの後始末を終了ルートへ接続する。
|
|
78
78
|
|
|
79
79
|
子を kill しない限り親は終了できない。stdio パイプを持つ子プロセスハンドルが Node の
|
|
80
|
-
イベントループを保持するため、stdin の EOF で server.close() を呼んでも
|
|
80
|
+
イベントループを保持するため、stdin の EOF で server.close() を呼んでも MCP サーバのプロセスが
|
|
81
81
|
残り続ける。接続は「孤児を残さないため」だけでなく「親が終われるようにするため」にも要る。
|
|
82
82
|
|
|
83
83
|
SIGTERM / SIGINT はハンドラを登録した時点で既定の即終了が無効になるので、明示的に exit する。
|
|
@@ -154,10 +154,9 @@ export function runMcpServe(dependencies) {
|
|
|
154
154
|
return handle;
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
157
|
-
|
|
157
|
+
MCP サーバの起動の実行本体。
|
|
158
158
|
|
|
159
|
-
|
|
160
|
-
そのため例外はここで捕まえて process.exitCode へ載せる (unhandled rejection にしない)。
|
|
159
|
+
例外はここで捕まえて process.exitCode へ載せる (unhandled rejection にしない)。
|
|
161
160
|
*/
|
|
162
161
|
export function executeMcpServe(buildDependencies) {
|
|
163
162
|
const dependencies = buildDependencies();
|
package/cli/dist/mcp/server.d.ts
CHANGED
|
@@ -60,6 +60,10 @@ export interface ToolDefinition {
|
|
|
60
60
|
readonly name: string;
|
|
61
61
|
readonly config: ToolConfig;
|
|
62
62
|
readonly handler: ToolHandler;
|
|
63
|
+
/**
|
|
64
|
+
フックが呼ぶツール。編集のたびに呼ばれるので直列のキューに並べず、outputSchema に共通の 4 項目を足さない。
|
|
65
|
+
*/
|
|
66
|
+
readonly isForHook?: boolean;
|
|
63
67
|
}
|
|
64
68
|
interface McpServerOptions {
|
|
65
69
|
/**
|
|
@@ -70,7 +74,7 @@ interface McpServerOptions {
|
|
|
70
74
|
/**
|
|
71
75
|
MCP サーバを生成し、渡されたツール定義を登録する。
|
|
72
76
|
|
|
73
|
-
各ハンドラは登録時にキューで包むため、tools/call が並行に届いても実行は 1
|
|
77
|
+
各ハンドラは登録時にキューで包むため、tools/call が並行に届いても実行は 1 件ずつになる(isForHook のツールは除く)
|
|
74
78
|
(直列化はここで構造的に保証し、ツール実装側には依存しない)。キューは再入を禁止するので、
|
|
75
79
|
ハンドラ内から同じキューへ積み直すと ReentrantEnqueueError で失敗する。
|
|
76
80
|
|
package/cli/dist/mcp/server.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { McpServer } from '@modelcontextprotocol/server';
|
|
12
12
|
import { readVersion } from '../version.js';
|
|
13
13
|
import { createExecutionQueue } from './queue.js';
|
|
14
|
-
import { standardOutputSchema, toolOutputSchema } from './result.js';
|
|
14
|
+
import { plainOutputSchema, standardOutputSchema, toolOutputSchema } from './result.js';
|
|
15
15
|
import { ignoreRejection } from '../domain/_shared/ignore-rejection.js';
|
|
16
16
|
/**
|
|
17
17
|
progress ハートビートの送出周期 (ms)。
|
|
@@ -84,7 +84,7 @@ function startProgressHeartbeat(toolName, context, intervalMs) {
|
|
|
84
84
|
/**
|
|
85
85
|
MCP サーバを生成し、渡されたツール定義を登録する。
|
|
86
86
|
|
|
87
|
-
各ハンドラは登録時にキューで包むため、tools/call が並行に届いても実行は 1
|
|
87
|
+
各ハンドラは登録時にキューで包むため、tools/call が並行に届いても実行は 1 件ずつになる(isForHook のツールは除く)
|
|
88
88
|
(直列化はここで構造的に保証し、ツール実装側には依存しない)。キューは再入を禁止するので、
|
|
89
89
|
ハンドラ内から同じキューへ積み直すと ReentrantEnqueueError で失敗する。
|
|
90
90
|
|
|
@@ -107,16 +107,19 @@ export function createMcpServer(tools = [], options = {}) {
|
|
|
107
107
|
const intervalMs = options.progressIntervalMs ?? PROGRESS_HEARTBEAT_INTERVAL_MS;
|
|
108
108
|
for (const tool of tools) {
|
|
109
109
|
const { outputSchema, ...config } = tool.config;
|
|
110
|
-
|
|
110
|
+
const isForHook = tool.isForHook === true;
|
|
111
|
+
const declaredSchema = outputSchema === undefined ? undefined : (isForHook ? plainOutputSchema(outputSchema) : toolOutputSchema(outputSchema));
|
|
112
|
+
server.registerTool(tool.name, { ...config, ...(declaredSchema !== undefined && { outputSchema: standardOutputSchema(declaredSchema) }) }, async (arguments_, serverContext) => {
|
|
111
113
|
const heartbeat = startProgressHeartbeat(tool.name, serverContext, intervalMs);
|
|
112
114
|
const context = {
|
|
113
115
|
reportProgress: (message) => { heartbeat?.report(message); },
|
|
114
116
|
};
|
|
117
|
+
const run = () => {
|
|
118
|
+
heartbeat?.markRunning();
|
|
119
|
+
return tool.handler(arguments_, { signal: serverContext.mcpReq.signal }, context);
|
|
120
|
+
};
|
|
115
121
|
try {
|
|
116
|
-
return await queue.enqueue(
|
|
117
|
-
heartbeat?.markRunning();
|
|
118
|
-
return tool.handler(arguments_, { signal: serverContext.mcpReq.signal }, context);
|
|
119
|
-
});
|
|
122
|
+
return await (isForHook ? run() : queue.enqueue(run));
|
|
120
123
|
}
|
|
121
124
|
finally {
|
|
122
125
|
heartbeat?.stop();
|
|
@@ -8,6 +8,7 @@ export const TOOL_SUBJECTS = [
|
|
|
8
8
|
{ word: 'evidence', meaning: 'evidence workbooks built from screenshots' },
|
|
9
9
|
{ word: 'slide', meaning: 'Slidev decks and talk directories' },
|
|
10
10
|
{ word: 'runtime', meaning: 'runtime dependencies and Playwright Chromium' },
|
|
11
|
+
{ word: 'file', meaning: 'a file the agent just wrote or edited (called by hooks)' },
|
|
11
12
|
];
|
|
12
13
|
/**
|
|
13
14
|
ツール名の 2 語目。対象に対する操作
|
|
@@ -17,10 +18,12 @@ export const TOOL_VERBS = [
|
|
|
17
18
|
{ word: 'export', meaning: 'write a diagram out as SVG and PDF' },
|
|
18
19
|
{ word: 'convert', meaning: 'convert a deck to PPTX' },
|
|
19
20
|
{ word: 'dev', meaning: 'start the dev server' },
|
|
20
|
-
{ word: 'lint', meaning: 'list rule violations in a talk directory' },
|
|
21
|
+
{ word: 'lint', meaning: 'list rule violations in a talk directory or a file' },
|
|
21
22
|
{ word: 'page', meaning: 'generate a page skeleton for a layout' },
|
|
22
23
|
{ word: 'sync', meaning: 'bring a talk directory in line with its theme' },
|
|
23
24
|
{ word: 'theme', meaning: 'return the theme declaration and its layouts' },
|
|
24
25
|
{ word: 'setup', meaning: 'download what other tools need at run time' },
|
|
26
|
+
{ word: 'validate', meaning: 'check reference yaml against its schema' },
|
|
27
|
+
{ word: 'brief', meaning: 'return the conventions that apply to a page' },
|
|
25
28
|
];
|
|
26
29
|
//# sourceMappingURL=tool-names.js.map
|
|
@@ -136,7 +136,7 @@ export declare function chromiumInstallFailureDetail(result: Readonly<SpawnResul
|
|
|
136
136
|
chromium を要するツールのハンドラ冒頭で使う実行時ガード (続行可否を ToolResult の有無で返す形)。
|
|
137
137
|
続行してよければ undefined、諦めるなら失敗の ToolResult を返す。
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
MCP サーバは接続タイムアウト (Claude Code の MCP_TIMEOUT は 30000ms が初期値) に収めるため、
|
|
140
140
|
起動時に chromium を取得しない。モデルから呼ばれるツールが 120MB のダウンロードを無断で始めないよう、
|
|
141
141
|
初期状態では取得せず、`runtime_setup` ツールの呼び出しを案内する。
|
|
142
142
|
PECOTV_AUTO_INSTALL_BROWSER=1 のときだけ、その場で取得してから処理を続行する。
|
|
@@ -160,7 +160,7 @@ function expectedLocation(dependencies) {
|
|
|
160
160
|
return dependencies.browsersRoot() ?? 'the default Playwright browsers directory';
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
|
-
取得先とネットワークの設定を確認させる誘導。
|
|
163
|
+
取得先とネットワークの設定を確認させる誘導。
|
|
164
164
|
*/
|
|
165
165
|
const NETWORK_HINT = '; check network reachability, the proxy settings (HTTPS_PROXY / HTTP_PROXY) and PLAYWRIGHT_DOWNLOAD_HOST, then run again';
|
|
166
166
|
/**
|
|
@@ -231,7 +231,7 @@ function chromiumFailureReason(result) {
|
|
|
231
231
|
chromium を要するツールのハンドラ冒頭で使う実行時ガード (続行可否を ToolResult の有無で返す形)。
|
|
232
232
|
続行してよければ undefined、諦めるなら失敗の ToolResult を返す。
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
MCP サーバは接続タイムアウト (Claude Code の MCP_TIMEOUT は 30000ms が初期値) に収めるため、
|
|
235
235
|
起動時に chromium を取得しない。モデルから呼ばれるツールが 120MB のダウンロードを無断で始めないよう、
|
|
236
236
|
初期状態では取得せず、`runtime_setup` ツールの呼び出しを案内する。
|
|
237
237
|
PECOTV_AUTO_INSTALL_BROWSER=1 のときだけ、その場で取得してから処理を続行する。
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// drawio 系 MCP ツール (drawio_create / drawio_export)。
|
|
2
|
-
// deps
|
|
2
|
+
// deps はハンドラ内で組み立てる。
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { assertOutputExtension as assertDrawioExportOutputExtension, drawioExportDefaultDependencies, errorToReason as drawioExportErrorToReason, executeDrawioExport, } from '../../commands/drawio/export.js';
|
|
5
5
|
import { drawioUrlDefaultDependencies, errorData as drawioUrlErrorData, errorToReason as drawioUrlErrorToReason, executeDrawioUrl, } from '../../commands/drawio/url.js';
|
|
@@ -70,7 +70,7 @@ function warningSuffix(warningCount) {
|
|
|
70
70
|
return warningCount > 0 ? ` (${String(warningCount)} warnings; see warnings)` : '';
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
|
|
73
|
+
実行層の `warnings` は件数。ツールでは warnings を捕捉した文の配列にするため、件数を外す。
|
|
74
74
|
*/
|
|
75
75
|
function withoutWarningCount(data) {
|
|
76
76
|
const { warnings: _count, ...rest } = data;
|
|
@@ -83,19 +83,16 @@ function drawioCreateMessage(outputFile, warningCount) {
|
|
|
83
83
|
: `wrote drawio viewer HTML to ${outputFile}${warnings}`;
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
|
-
chromium 不在で PNG
|
|
86
|
+
chromium 不在で PNG を諦めたときの結果。PNG 生成の失敗は warning に格下げし、表示用 HTML は書く。
|
|
87
87
|
|
|
88
|
-
CLI (`pecotv drawio url`) は PNG 生成の失敗を warning に格下げする。
|
|
89
|
-
表示用 HTML は書いたうえで、`png: null` / `pngFailed: true` / warning 1 件を返す。
|
|
90
|
-
MCP だけが実処理の前に hard-fail すると、CLI と結果が食い違う。
|
|
91
88
|
degrade できる条件はこれだけ。drawio_export と slide_convert は、chromium が無いと成果物を 1 つも作れない。
|
|
92
|
-
|
|
89
|
+
`png: null` / `pngFailed: true` / warning 1 件を返し、`runtime_setup` の誘導は message へ載せる。
|
|
93
90
|
*/
|
|
94
91
|
function degradeToPngSkipped(execution, unavailable, warningCount) {
|
|
95
92
|
return {
|
|
96
93
|
data: {
|
|
97
94
|
...withoutWarningCount(execution.data),
|
|
98
|
-
// eslint-disable-next-line unicorn/no-null -- PNG
|
|
95
|
+
// eslint-disable-next-line unicorn/no-null -- PNG 失敗時は png: null を返す契約
|
|
99
96
|
png: null,
|
|
100
97
|
pngFailed: true,
|
|
101
98
|
},
|
|
@@ -116,7 +113,7 @@ call) => {
|
|
|
116
113
|
return toCallToolResult({
|
|
117
114
|
ok: false,
|
|
118
115
|
kind: 'invalid-option',
|
|
119
|
-
detail: `
|
|
116
|
+
detail: `drawio_create: ${detail}`,
|
|
120
117
|
data: { event: 'drawio.url.error' },
|
|
121
118
|
});
|
|
122
119
|
}
|
|
@@ -125,14 +122,14 @@ call) => {
|
|
|
125
122
|
? await ensureChromium('drawio_create PNG output', chromiumDefaultDependencies(), call.signal)
|
|
126
123
|
: undefined;
|
|
127
124
|
const output = captureCommandOutput();
|
|
128
|
-
//
|
|
125
|
+
// PNG の失敗は warning の行に書き、warnings に入れる。
|
|
129
126
|
if (unavailable !== undefined)
|
|
130
127
|
createDiagnostics(output.stderr).warning(`PNG export failed: ${unavailable.detail}`);
|
|
131
128
|
try {
|
|
132
129
|
const execution = await executeDrawioUrl(input.input_path,
|
|
133
130
|
// chromium が無いときは PNG を要求せずに実行する (表示用 HTML の生成は成立する)。
|
|
134
131
|
{ mode: input.mode, png: input.png && unavailable === undefined, theme: normalized?.theme, output: input.out_path }, { ...drawioUrlDefaultDependencies(), stdout: output.stdout, stderr: output.stderr, signal: call.signal });
|
|
135
|
-
//
|
|
132
|
+
// 警告ありでも URL の生成そのものは完了しているので成功で返す。
|
|
136
133
|
return output.finish({
|
|
137
134
|
ok: true,
|
|
138
135
|
data: withoutWarningCount(execution.data),
|
|
@@ -145,7 +142,7 @@ call) => {
|
|
|
145
142
|
return output.finish({
|
|
146
143
|
ok: false,
|
|
147
144
|
kind: failureKindOf(drawioUrlErrorToReason(error)),
|
|
148
|
-
detail: `
|
|
145
|
+
detail: `drawio_create: ${failureDetailOf(error, data)}`,
|
|
149
146
|
data: withoutCommonFailureFields(data),
|
|
150
147
|
});
|
|
151
148
|
}
|
|
@@ -177,7 +174,7 @@ call) => {
|
|
|
177
174
|
const output = captureCommandOutput();
|
|
178
175
|
try {
|
|
179
176
|
const execution = await executeDrawioExport(input.input_path, { icons: iconsRoot, output: input.out_path, printHash: input.print_hash, pdf: input.pdf }, { ...drawioExportDefaultDependencies(), stdout: output.stdout, stderr: output.stderr });
|
|
180
|
-
//
|
|
177
|
+
// PDF 生成の失敗という警告ありでも SVG の書き出しは完了しているので成功で返す。
|
|
181
178
|
return output.finish({
|
|
182
179
|
ok: true,
|
|
183
180
|
data: withoutWarningCount(execution.data),
|
|
@@ -189,13 +186,13 @@ call) => {
|
|
|
189
186
|
}
|
|
190
187
|
};
|
|
191
188
|
/**
|
|
192
|
-
drawio_export の失敗を
|
|
189
|
+
drawio_export の失敗を ToolResult に写す。
|
|
193
190
|
*/
|
|
194
191
|
function drawioExportFailure(error) {
|
|
195
192
|
return {
|
|
196
193
|
ok: false,
|
|
197
194
|
kind: failureKindOf(drawioExportErrorToReason(error)),
|
|
198
|
-
detail: `
|
|
195
|
+
detail: `drawio_export: ${formatError(error)}`,
|
|
199
196
|
data: { event: 'drawio.export.error' },
|
|
200
197
|
};
|
|
201
198
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// evidence 系の MCP ツール定義 (evidence_create)。
|
|
1
|
+
// evidence 系の MCP ツール定義 (evidence_create)。
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { errorData, errorToReason, evidenceCreateDefaultDependencies, executeEvidenceCreate, } from '../../commands/evidence-xlsx/create.js';
|
|
@@ -23,7 +23,7 @@ const evidenceCreateOutput = toolOutputFields(evidenceCreateShape, TEXT_VIOLATIO
|
|
|
23
23
|
/**
|
|
24
24
|
out_path 省略時の既定。
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
既定の `./evidence.xlsx` は cwd 依存で、MCP サーバの cwd はクライアントの cwd と
|
|
27
27
|
一致する保証が無い (FR-011 が相対パスを弾く理由と同じ)。input_path と同じディレクトリに置く。
|
|
28
28
|
*/
|
|
29
29
|
function defaultOutPath(inputPath) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ToolDefinition } from '../server.js';
|
|
2
|
+
/**
|
|
3
|
+
1 行目に `<kind>: `、2 行目以降に空白 2 つを付ける。空行は空のまま残す。
|
|
4
|
+
*/
|
|
5
|
+
export declare function hookMessage(kind: 'warning', text: string): string;
|
|
6
|
+
interface CappedContext {
|
|
7
|
+
readonly body: string;
|
|
8
|
+
readonly note: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
本文を UTF-8 のバイト数で行単位に切る。切ったら、残りの行のうち `item` に合う数を note に書く。
|
|
12
|
+
*/
|
|
13
|
+
export declare function capContext(max: number, item: RegExp, unit: string, text: string): CappedContext;
|
|
14
|
+
/**
|
|
15
|
+
`slides.md` と `pages/` を持つ最も近い上の dir。論理パスで遡る(pages/ が talk-dir の外への symlink でも見失わない)。
|
|
16
|
+
*/
|
|
17
|
+
export declare function findTalkRoot(directory: string): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
編集したファイルの lint。talk-dir の pages/**\/*.md と slides.md はテーマの規則の eslint、それ以外は文章規則。
|
|
20
|
+
*/
|
|
21
|
+
export declare const fileLintTool: ToolDefinition;
|
|
22
|
+
/**
|
|
23
|
+
編集した参照の YAML を、テーマの参照の dir ごと validate-references で検証する。
|
|
24
|
+
*/
|
|
25
|
+
export declare const fileValidateTool: ToolDefinition;
|
|
26
|
+
/**
|
|
27
|
+
編集したページの layout に当たる参照の YAML から、status・best_practices・anti_patterns の原文を返す。
|
|
28
|
+
*/
|
|
29
|
+
export declare const fileBriefTool: ToolDefinition;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=file.d.ts.map
|