@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.
Files changed (145) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/assets/slidev/deck-lint.config.js +2 -2
  3. package/assets/slidev/deck-lint.env.config.js +2 -2
  4. package/assets/slidev/package.json +7 -7
  5. package/assets/slidev/runtime/package.json +11 -11
  6. package/assets/slidev/scripts/eslint/_shared/dist/lib/drawio-geometry.js +10 -10
  7. package/assets/slidev/scripts/eslint/_shared/dist/lib/text-measurer.d.ts +2 -2
  8. package/assets/slidev/scripts/eslint/_shared/dist/lib/text-measurer.js +4 -4
  9. package/assets/slidev/scripts/eslint/_shared/dist/tsconfig.tsbuildinfo +1 -1
  10. package/assets/slidev/scripts/eslint/_shared/lib/drawio-geometry.ts +10 -10
  11. package/assets/slidev/scripts/eslint/_shared/lib/text-measurer.ts +4 -4
  12. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-content-before-frontmatter.js +1 -1
  13. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-missing-marker-cell.js +4 -4
  14. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-missing-page.js +1 -1
  15. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-numeric-asset-prefix.js +1 -1
  16. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-numeric-filename-prefix.js +1 -1
  17. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-scaled-drawio.js +3 -3
  18. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-triple-hyphen-in-frontmatter.js +3 -3
  19. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/no-unknown-props.js +3 -3
  20. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/one-slide-per-file.js +1 -1
  21. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/require-matching-length.js +1 -1
  22. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/require-slides-entry.js +1 -1
  23. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/lib/rules/validate-clicks.js +7 -7
  24. package/assets/slidev/scripts/eslint/slidev-pages-lint/dist/tsconfig.tsbuildinfo +1 -1
  25. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-content-before-frontmatter.ts +1 -1
  26. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-missing-marker-cell.ts +4 -4
  27. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-missing-page.ts +1 -1
  28. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-numeric-asset-prefix.ts +1 -1
  29. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-numeric-filename-prefix.ts +1 -1
  30. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-scaled-drawio.ts +3 -3
  31. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-triple-hyphen-in-frontmatter.ts +3 -3
  32. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/no-unknown-props.ts +3 -3
  33. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/one-slide-per-file.ts +1 -1
  34. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/require-matching-length.ts +1 -1
  35. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/require-slides-entry.ts +1 -1
  36. package/assets/slidev/scripts/eslint/slidev-pages-lint/lib/rules/validate-clicks.ts +7 -7
  37. package/assets/slidev/scripts/eslint/slidev-pages-lint/package.json +1 -1
  38. package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/max-chars.js +6 -6
  39. package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/textlint-body.js +3 -3
  40. package/assets/slidev/scripts/eslint/text-constraints/dist/lib/rules/textlint.js +2 -2
  41. package/assets/slidev/scripts/eslint/text-constraints/dist/tsconfig.tsbuildinfo +1 -1
  42. package/assets/slidev/scripts/eslint/text-constraints/lib/rules/max-chars.ts +6 -6
  43. package/assets/slidev/scripts/eslint/text-constraints/lib/rules/textlint-body.ts +3 -3
  44. package/assets/slidev/scripts/eslint/text-constraints/lib/rules/textlint.ts +2 -2
  45. package/assets/slidev/scripts/eslint/text-constraints/package.json +1 -1
  46. package/assets/slidev/scripts/eslint/validate-references/dist/index.js +1 -1
  47. package/assets/slidev/scripts/eslint/validate-references/dist/lib/schema-validator.js +1 -1
  48. package/assets/slidev/scripts/eslint/validate-references/dist/lib/semantic-validator.js +12 -12
  49. package/assets/slidev/scripts/eslint/validate-references/dist/tsconfig.tsbuildinfo +1 -1
  50. package/assets/slidev/scripts/eslint/validate-references/index.ts +1 -1
  51. package/assets/slidev/scripts/eslint/validate-references/lib/schema-validator.ts +2 -2
  52. package/assets/slidev/scripts/eslint/validate-references/lib/semantic-validator.ts +12 -12
  53. package/assets/slidev/scripts/eslint/validate-references/package.json +1 -1
  54. package/cli/dist/cli.js +11 -10
  55. package/cli/dist/commands/chromium/host-dependencies.js +14 -7
  56. package/cli/dist/commands/drawio/export.js +27 -24
  57. package/cli/dist/commands/drawio/theme.js +8 -8
  58. package/cli/dist/commands/drawio/url.js +40 -32
  59. package/cli/dist/commands/evidence-xlsx/create.js +19 -18
  60. package/cli/dist/commands/pptx-ooxml/preview.js +26 -30
  61. package/cli/dist/commands/slidev-project/create.js +27 -26
  62. package/cli/dist/commands/slidev-project/linked-theme.js +5 -5
  63. package/cli/dist/commands/slidev-project/lint.js +29 -27
  64. package/cli/dist/commands/slidev-project/sync.js +35 -34
  65. package/cli/dist/commands/slidev-project/theme.js +19 -18
  66. package/cli/dist/commands/slidev-to-pptx/convert.d.ts +4 -0
  67. package/cli/dist/commands/slidev-to-pptx/convert.js +88 -75
  68. package/cli/dist/diagnostics.d.ts +38 -0
  69. package/cli/dist/diagnostics.js +46 -0
  70. package/cli/dist/domain/_shared/ports.d.ts +0 -1
  71. package/cli/dist/domain/_shared/text-check.js +2 -2
  72. package/cli/dist/domain/drawio/export.js +4 -4
  73. package/cli/dist/domain/drawio/label-text.js +1 -1
  74. package/cli/dist/domain/drawio/url.d.ts +11 -7
  75. package/cli/dist/domain/drawio/url.js +67 -45
  76. package/cli/dist/domain/evidence-xlsx/image-dimensions.js +14 -14
  77. package/cli/dist/domain/evidence-xlsx/spec-schema.js +26 -26
  78. package/cli/dist/domain/pptx-ooxml/merge.js +3 -3
  79. package/cli/dist/domain/pptx-ooxml/prerender-replace.d.ts +1 -0
  80. package/cli/dist/domain/pptx-ooxml/prerender-replace.js +3 -3
  81. package/cli/dist/domain/slidev-project/generated-files.d.ts +1 -1
  82. package/cli/dist/domain/slidev-project/generated-files.js +36 -36
  83. package/cli/dist/domain/slidev-project/initial-pages.js +4 -4
  84. package/cli/dist/domain/slidev-project/lint.js +11 -11
  85. package/cli/dist/domain/slidev-project/sync.js +13 -13
  86. package/cli/dist/domain/slidev-project/warnings.js +4 -4
  87. package/cli/dist/domain/slidev-theme/declaration.js +9 -9
  88. package/cli/dist/domain/slidev-theme/references.js +10 -10
  89. package/cli/dist/domain/slidev-theme/store-layout.js +6 -6
  90. package/cli/dist/domain/slidev-theme/talk-theme.js +13 -13
  91. package/cli/dist/domain/slidev-theme/theme-spec.js +5 -5
  92. package/cli/dist/domain/slidev-to-pptx/errors.js +3 -3
  93. package/cli/dist/infra/_shared/dependency-root.js +4 -4
  94. package/cli/dist/infra/_shared/patch-apply.js +6 -5
  95. package/cli/dist/infra/_shared/runtime-install.d.ts +12 -84
  96. package/cli/dist/infra/_shared/runtime-install.js +74 -108
  97. package/cli/dist/infra/_shared/slidev-bin.js +1 -1
  98. package/cli/dist/infra/drawio/icons.js +3 -3
  99. package/cli/dist/infra/drawio/pdf.js +1 -1
  100. package/cli/dist/infra/drawio/screenshot.js +10 -9
  101. package/cli/dist/infra/evidence-xlsx/workbook-writer.js +2 -2
  102. package/cli/dist/infra/playwright/chromium.js +4 -3
  103. package/cli/dist/infra/playwright/host-dependencies.js +8 -8
  104. package/cli/dist/infra/playwright/launch.js +5 -5
  105. package/cli/dist/infra/pptx-ooxml/soffice.js +2 -2
  106. package/cli/dist/infra/slidev-project/eslint-runner.js +10 -9
  107. package/cli/dist/infra/slidev-project/fs.js +6 -6
  108. package/cli/dist/infra/slidev-theme/store.js +18 -15
  109. package/cli/dist/infra/slidev-to-pptx/cache-store.js +6 -6
  110. package/cli/dist/infra/slidev-to-pptx/console-logger.d.ts +5 -5
  111. package/cli/dist/infra/slidev-to-pptx/console-logger.js +19 -20
  112. package/cli/dist/infra/slidev-to-pptx/dom-converter.d.ts +1 -1
  113. package/cli/dist/infra/slidev-to-pptx/dom-converter.js +12 -12
  114. package/cli/dist/infra/slidev-to-pptx/index.js +1 -9
  115. package/cli/dist/infra/slidev-to-pptx/pipeline.d.ts +2 -2
  116. package/cli/dist/infra/slidev-to-pptx/pipeline.js +56 -56
  117. package/cli/dist/infra/slidev-to-pptx/prerender-capture.js +14 -14
  118. package/cli/dist/infra/slidev-to-pptx/prerender.js +10 -10
  119. package/cli/dist/infra/slidev-to-pptx/runner.js +1 -0
  120. package/cli/dist/infra/slidev-to-pptx/scanner.js +10 -10
  121. package/cli/dist/infra/slidev-to-pptx/server.d.ts +2 -1
  122. package/cli/dist/infra/slidev-to-pptx/server.js +3 -3
  123. package/cli/dist/infra/slidev-to-pptx/single-pass-worker.js +39 -39
  124. package/cli/dist/infra/slidev-to-pptx/slide-worker.js +3 -3
  125. package/cli/dist/infra/slidev-to-pptx/visibility-helpers.js +8 -8
  126. package/cli/dist/mcp/dev-server-registry.js +10 -9
  127. package/cli/dist/mcp/queue.js +1 -1
  128. package/cli/dist/mcp/result.js +4 -4
  129. package/cli/dist/mcp/serve.js +5 -3
  130. package/cli/dist/mcp/server.js +2 -2
  131. package/cli/dist/mcp/tools/_shared.d.ts +1 -1
  132. package/cli/dist/mcp/tools/_shared.js +47 -38
  133. package/cli/dist/mcp/tools/drawio.js +23 -22
  134. package/cli/dist/mcp/tools/evidence.js +8 -8
  135. package/cli/dist/mcp/tools/setup.js +26 -26
  136. package/cli/dist/mcp/tools/slide-dev.js +20 -20
  137. package/cli/dist/mcp/tools/slide-page.js +39 -37
  138. package/cli/dist/mcp/tools/slide-theme.js +6 -6
  139. package/cli/dist/mcp/tools/slide.js +52 -50
  140. package/cli/dist/mcp/windows-path.js +8 -7
  141. package/cli/dist/node-runtime.d.ts +6 -1
  142. package/cli/dist/node-runtime.js +16 -8
  143. package/npm-shrinkwrap.json +46 -52
  144. package/package.json +6 -6
  145. package/vendor/text-rules/dist/source-hash +1 -1
@@ -160,7 +160,7 @@ export async function applyPrerenderImageReplace(slide, rels, partMap, entries,
160
160
  highResolutionBuffer = await io.readFile(entry.imagePath);
161
161
  }
162
162
  catch (error) {
163
- console.warn(`prerender image read failed: ${entry.imagePath}: ${String(error)}`);
163
+ io.warn(`prerender image read failed: ${entry.imagePath}: ${String(error)}`);
164
164
  continue;
165
165
  }
166
166
  // 1 段目: 座標 + サイズ。matchPrerenderToMedia は matched 済 mediaPart を
@@ -222,13 +222,13 @@ async function loadMeta(metaPath, io) {
222
222
  return undefined;
223
223
  }
224
224
  if (!isRecord(parsed)) {
225
- console.warn(`prerender meta unrecognized: ${metaPath} (not a JSON object)`);
225
+ io.warn(`prerender meta unrecognized: ${metaPath} (not a JSON object)`);
226
226
  return undefined;
227
227
  }
228
228
  const width = parsed['width'];
229
229
  const height = parsed['height'];
230
230
  if (typeof width !== 'number' || typeof height !== 'number') {
231
- console.warn(`prerender meta unrecognized: ${metaPath} (width/height missing or non-numeric)`);
231
+ io.warn(`prerender meta unrecognized: ${metaPath} (width/height missing or non-numeric)`);
232
232
  return undefined;
233
233
  }
234
234
  const meta = { width, height };
@@ -8,7 +8,7 @@ export interface ViteConfigOptions {
8
8
  }
9
9
  /**
10
10
  `vite.config.ts` の中身。
11
- 日本語を含む行は、文章 lint が 1 行ずつ読む。そのため、中身は 1 行 1 要素の配列で組み立てる。
11
+ 中身は 1 行 1 要素の配列で組み立てる。
12
12
  */
13
13
  export declare function viteConfigSource(options: Readonly<ViteConfigOptions>): string;
14
14
  /**
@@ -23,10 +23,10 @@ vite-plugin-static-copy は、talk-dir からの相対パスの先頭の `../`
23
23
  function themePublicLines(themeName) {
24
24
  return [
25
25
  '',
26
- '// talk-dir の位置。設定ファイルの隣にある。',
26
+ '// location of the talk-dir, next to this config file.',
27
27
  'const talkDirectory = path.dirname(fileURLToPath(import.meta.url))',
28
28
  '',
29
- '// 実体のパスを求める。無ければ undefined にして、Slidev の既定に任せる。',
29
+ '// resolve the real path; return undefined when it is missing and leave it to the Slidev default.',
30
30
  'function resolveRealPath(...segments: string[]): string | undefined {',
31
31
  ' try {',
32
32
  ' return realpathSync(path.join(...segments))',
@@ -36,20 +36,20 @@ function themePublicLines(themeName) {
36
36
  ' }',
37
37
  '}',
38
38
  '',
39
- '// glob の特殊文字を、文字そのものとして扱わせる。Windows の区切りは / にそろえる。',
39
+ '// make glob special characters match literally; normalize the Windows separator to /.',
40
40
  'function escapeGlob(value: string): string {',
41
41
  ' const posixPath = path.sep === \'\\\\\' ? value.replaceAll(\'\\\\\', \'/\') : value',
42
42
  ' const specials = path.sep === \'\\\\\' ? /[()[\\]{}!+@]/gu : /[\\\\()[\\]{}!*?|+@]/gu',
43
43
  ' return posixPath.replaceAll(specials, \'\\\\$&\')',
44
44
  '}',
45
45
  '',
46
- '// テーマの実体と、その public/。',
46
+ '// real path of the theme and its public/.',
47
47
  `const themeRoot = resolveRealPath(talkDirectory, 'node_modules', ${quoted(themeName)})`,
48
48
  'const themePublic = themeRoot === undefined ? undefined : resolveRealPath(themeRoot, \'public\')',
49
49
  '',
50
- '// テーマの peerDependencies のうち、talk-dir の node_modules から解決できる名前。',
51
- '// optional の名前は除く。Vite は dedupe の名前を root からだけ解決し、見つからないと起動が失敗する。',
52
- '// 読めない・JSON でないときは空にして、設定の読み込みを止めない。',
50
+ '// names in the theme peerDependencies that resolve from node_modules of the talk-dir.',
51
+ '// optional ones are excluded; Vite resolves dedupe names from the root only and fails to start when one is not found.',
52
+ '// return an empty list when the file is unreadable or not JSON, so loading the config does not stop.',
53
53
  'function readThemePeers(): string[] {',
54
54
  ' if (themeRoot === undefined) return []',
55
55
  ' try {',
@@ -68,7 +68,7 @@ function themePublicLines(themeName) {
68
68
  '',
69
69
  'const themePeers = readThemePeers()',
70
70
  '',
71
- '// talk-dir からテーマの public/ までの区間の数(先頭の ../ は数えない)。',
71
+ '// number of segments from the talk-dir to the theme public/ (leading ../ are not counted).',
72
72
  'const themePublicDepth = themePublic === undefined',
73
73
  ' ? 0',
74
74
  ' : path.relative(talkDirectory, themePublic).split(/[\\\\/]/u).filter(segment => segment !== \'..\').length',
@@ -87,9 +87,9 @@ function themePublicLines(themeName) {
87
87
  ' },',
88
88
  ' }',
89
89
  '',
90
- '// テーマの layouts・components・styles は、dev の起動時の warmup で変換しておく。',
91
- '// node_modules の下の glob は、Vite が無視する。そのためテーマの実体のパスで書く。',
92
- '// talk-dir の側の同名のファイルは、テーマを上書きする利用者のものなので、相対の glob で並べる。',
90
+ '// transform theme layouts, components and styles in the warmup at dev start.',
91
+ '// Vite ignores globs under node_modules, so write them with the real path of the theme.',
92
+ '// files of the same name on the talk-dir side override the theme and belong to the user, so list them with relative globs.',
93
93
  'const themeServer = themeRoot === undefined',
94
94
  ' ? {}',
95
95
  ' : {',
@@ -108,7 +108,7 @@ function themePublicLines(themeName) {
108
108
  }
109
109
  /**
110
110
  `vite.config.ts` の中身。
111
- 日本語を含む行は、文章 lint が 1 行ずつ読む。そのため、中身は 1 行 1 要素の配列で組み立てる。
111
+ 中身は 1 行 1 要素の配列で組み立てる。
112
112
  */
113
113
  export function viteConfigSource(options) {
114
114
  const themeName = options.themeName;
@@ -124,41 +124,41 @@ export function viteConfigSource(options) {
124
124
  const slidevLines = themeName === undefined
125
125
  ? []
126
126
  : [
127
- ' // テーマの public/ を /theme/ で配る。',
127
+ ' // serve the theme public/ at /theme/.',
128
128
  ' slidev: themeStaticCopy,',
129
129
  ];
130
130
  const serverSpread = themeName === undefined ? [] : [' ...themeServer,'];
131
131
  return [
132
- '// 本体が生成するファイル。本体の更新で書き直す。',
133
- '// Vite の追加設定は setup/vite-plugins.ts に置く。',
132
+ '// generated by pecotv; rewritten when pecotv is updated.',
133
+ '// put extra Vite settings in setup/vite-plugins.ts.',
134
134
  '/// <reference types="@slidev/types" />',
135
135
  ...importLines,
136
136
  'import { defineConfig } from \'vite\'',
137
137
  ...themeLines,
138
138
  '',
139
139
  'export default defineConfig({',
140
- ' // キャッシュを talk-dir に閉じる。',
141
- ' // node_modules/.vite を共有すると衝突する。',
140
+ ' // keep the cache inside the talk-dir.',
141
+ ' // sharing node_modules/.vite causes conflicts.',
142
142
  ' cacheDir: \'./.vite\',',
143
143
  ' resolve: {',
144
- ' // node_modules とテーマは symlink で張る。',
145
- ' // Vite の既定(false)では、symlink 先の Vue ファイルの scoped CSS が build に入らない。',
144
+ ' // node_modules and the theme are linked with symlinks.',
145
+ ' // with the Vite default (false), scoped CSS of Vue files behind a symlink is left out of the build.',
146
146
  ' preserveSymlinks: true,',
147
- ' // テーマの peerDependencies は、本体の 1 つに寄せる。',
147
+ ' // dedupe the theme peerDependencies to the single copy of the main package.',
148
148
  dedupeLine,
149
149
  ' },',
150
150
  ...slidevLines,
151
151
  ' server: {',
152
152
  ...serverSpread,
153
- ' // dev サーバを起動し直した後も、ブラウザに古い変換結果を使わせない。',
154
- ' // 古い結果を使うと、許可リストの外の CSS が 403 で拒まれ、プレビューが白紙のままになる。',
153
+ ' // keep the browser from using stale transform results after the dev server restarts.',
154
+ ' // with stale results, CSS outside the allow list is rejected with 403 and the preview stays blank.',
155
155
  ' headers: { \'Cache-Control\': \'no-cache\' },',
156
156
  ' },',
157
157
  ' define: {',
158
- ' // pecotv の slide convert は print ページを 1 回読み込んで全ページを変換する。',
159
- ' // その print ルートを build 済み SPA に入れるための指定。',
160
- ' // Slidev 内部の define であり、公開 API ではない。',
161
- ' // このフラグが働かない build では、pecotv が警告を出して従来方式で変換する。',
158
+ ' // pecotv slide convert loads the print page once and converts all pages.',
159
+ ' // this setting puts the print route into the built SPA.',
160
+ ' // it is a Slidev-internal define, not a public API.',
161
+ ' // when this flag has no effect on a build, pecotv warns and converts the old way.',
162
162
  ' __SLIDEV_FEATURE_PRINT__: \'true\',',
163
163
  ' },',
164
164
  '})',
@@ -173,14 +173,14 @@ export const START_SCRIPT_SOURCE = [
173
173
  '#!/usr/bin/env node',
174
174
  '',
175
175
  '/**',
176
- ' * OS 非依存の Slidev 起動スクリプト(pecotv が生成する)。',
176
+ ' * OS-independent Slidev start script (generated by pecotv).',
177
177
  ' *',
178
- ' * MCP を使わない環境向けの、手動プレビューの手段。',
179
- ' * 対象は、pecot-visual サーバを登録していないエディタや素の端末。',
180
- ' * このスクリプトのあるディレクトリを動作起点とする。',
181
- ' * node_modules は pecotv slide create と pecotv slide sync が用意する。',
182
- ' * 無ければ sync を案内して終了する。',
183
- ' * Slidev の bin を、node で直接起動する。',
178
+ ' * A way to preview manually in environments that do not use MCP.',
179
+ ' * It targets editors and plain terminals that have not registered the pecot-visual server.',
180
+ ' * The directory of this script is the working root.',
181
+ ' * node_modules is prepared by pecotv slide create and pecotv slide sync.',
182
+ ' * When it is missing, the script points to sync and exits.',
183
+ ' * It starts the Slidev bin directly with node.',
184
184
  ' */',
185
185
  '',
186
186
  'import { fileURLToPath } from \'node:url\'',
@@ -194,8 +194,8 @@ export const START_SCRIPT_SOURCE = [
194
194
  'const slidevBin = join(__dirname, \'node_modules\', \'@slidev\', \'cli\', \'bin\', \'slidev.mjs\')',
195
195
  '',
196
196
  'if (!existsSync(slidevBin)) {',
197
- ' console.error(\'@slidev/cli not found at \' + slidevBin + \'.\')',
198
- ' console.error(\'pecotv slide sync --dir \' + __dirname + \' --node-modules-only を実行してください。\')',
197
+ ' console.error(\'error: @slidev/cli not found at \' + slidevBin + \'.\')',
198
+ ' console.error(\' run pecotv slide sync --dir \' + __dirname + \' --node-modules-only\')',
199
199
  ' process.exit(1)',
200
200
  '}',
201
201
  '',
@@ -211,7 +211,7 @@ export const START_SCRIPT_SOURCE = [
211
211
  '})',
212
212
  '',
213
213
  'slidev.on(\'error\', (error) => {',
214
- ' console.error(\'Failed to start Slidev:\', error)',
214
+ ' console.error(\'error: Failed to start Slidev:\', error)',
215
215
  ' process.exit(1)',
216
216
  '})',
217
217
  '',
@@ -31,7 +31,7 @@ export async function buildInitialPages(references, files) {
31
31
  const usable = references.filter((entry) => {
32
32
  const isUsable = PAGE_STEM.test(entry.name);
33
33
  if (!isUsable)
34
- warnings.push(`レイアウト名 '${entry.name}' はページのファイル名に使えないため、初期ページから除きました`);
34
+ warnings.push(`layout name cannot be used as a page file name, so it is left out of the initial pages: ${entry.name}`);
35
35
  return isUsable;
36
36
  });
37
37
  const sorted = usable.toSorted((a, b) => a.name.localeCompare(b.name));
@@ -56,15 +56,15 @@ export async function buildInitialPages(references, files) {
56
56
  if (first === undefined) {
57
57
  return {
58
58
  pages: [],
59
- warnings: [...warnings, 'テーマにレイアウトが無いため、初期ページを作れませんでした。テーマの layouts/ を確認してください。'],
59
+ warnings: [...warnings, 'the theme has no layouts, so no initial page was created (fix: check layouts/ in the theme)'],
60
60
  };
61
61
  }
62
62
  return {
63
63
  pages: [{ filename: `${first.name}.md`, content: `---\nlayout: ${first.name}\n---\n` }],
64
64
  warnings: [
65
65
  ...warnings,
66
- `テーマの参照に examples が無いため、初期ページは layout: ${first.name} だけにしました。`
67
- + 'テーマの references/ に examples を足すと、雛形の入った初期ページが作られます。',
66
+ `the theme reference has no examples, so the initial page has only layout: ${first.name}; `
67
+ + 'add examples to references/ in the theme to create initial pages with a skeleton',
68
68
  ],
69
69
  };
70
70
  }
@@ -37,19 +37,19 @@ talk-dir マーカー検証。振り分けは domain/slidev-project/sync.ts の
37
37
  */
38
38
  export async function assertTalkDirectory(directory, fs) {
39
39
  if (!path.isAbsolute(directory)) {
40
- throw new SlideLintUsageError(`--dir には絶対パスを指定してください (受け取った値: '${directory}')`, 'relative-dir');
40
+ throw new SlideLintUsageError(`--dir must be an absolute path: ${directory}`, 'relative-dir');
41
41
  }
42
42
  const info = await fs.talkDirectoryExists(directory);
43
43
  if (!info.exists) {
44
- throw new SlideLintRuntimeError(`'${directory}' はディレクトリとして存在しません`, 'dir-not-found');
44
+ throw new SlideLintRuntimeError(`directory not found: ${directory}`, 'dir-not-found');
45
45
  }
46
46
  if (!info.isDirectory) {
47
- throw new SlideLintRuntimeError(`'${directory}' はディレクトリではありません`, 'not-a-directory');
47
+ throw new SlideLintRuntimeError(`not a directory: ${directory}`, 'not-a-directory');
48
48
  }
49
49
  const hasSlidesMd = await fs.doesSlidesMdExist(directory);
50
50
  if (!hasSlidesMd) {
51
- throw new SlideLintRuntimeError(`'${directory}' に slides.md が無いため talk-dir として扱えません。`
52
- + ' pecotv slide create で作成された talk-dir を指定してください。', 'not-talk-dir');
51
+ throw new SlideLintRuntimeError(`not a talk-dir (no slides.md): ${directory}; `
52
+ + 'specify a talk-dir created by pecotv slide create', 'not-talk-dir');
53
53
  }
54
54
  }
55
55
  /**
@@ -71,13 +71,13 @@ export async function runSlideLint(options, dependencies) {
71
71
  });
72
72
  // timedOut 時も SIGTERM で exitCode は null になるため、起動失敗より先に判定する。
73
73
  if (result.timedOut) {
74
- throw new SlideLintRuntimeError(`eslint が時間内に終了しませんでした: ${summarizeStderr(result.stderr)}`, 'eslint-timeout');
74
+ throw new SlideLintRuntimeError(`eslint did not finish in time: ${summarizeStderr(result.stderr)}`, 'eslint-timeout');
75
75
  }
76
76
  if (result.exitCode === null) {
77
- throw new SlideLintRuntimeError(`eslint の起動に失敗しました: ${summarizeStderr(result.stderr)}`, 'eslint-not-launched');
77
+ throw new SlideLintRuntimeError(`eslint failed to start: ${summarizeStderr(result.stderr)}`, 'eslint-not-launched');
78
78
  }
79
79
  if (result.exitCode !== 0 && result.exitCode !== 1) {
80
- throw new SlideLintRuntimeError(`eslint が異常終了しました (exit ${String(result.exitCode)}): ${summarizeStderr(result.stderr)}`, 'eslint-failed');
80
+ throw new SlideLintRuntimeError(`eslint exited abnormally (exit ${String(result.exitCode)}): ${summarizeStderr(result.stderr)}`, 'eslint-failed');
81
81
  }
82
82
  // eslint が辿れなかった symlink dir の検出は lint 結果と独立。走査失敗以外で
83
83
  // outcome / exit code を動かさないため、集計の外側で合流させる。
@@ -90,10 +90,10 @@ function parseEslintReport(stdout) {
90
90
  parsed = JSON.parse(stdout);
91
91
  }
92
92
  catch (error) {
93
- throw new SlideLintRuntimeError(`eslint の JSON 出力を解析できませんでした: ${formatError(error)}`, 'invalid-report');
93
+ throw new SlideLintRuntimeError(`cannot parse the eslint JSON output: ${formatError(error)}`, 'invalid-report');
94
94
  }
95
95
  if (!Array.isArray(parsed)) {
96
- throw new SlideLintRuntimeError('eslint の JSON 出力が配列ではありません', 'invalid-report');
96
+ throw new SlideLintRuntimeError('eslint JSON output is not an array', 'invalid-report');
97
97
  }
98
98
  // eslint-disable-next-line no-restricted-syntax -- JSON.parse 戻り値の narrowing
99
99
  return parsed;
@@ -147,7 +147,7 @@ const STDERR_EXCERPT_LIMIT = 400;
147
147
  function summarizeStderr(stderr) {
148
148
  const trimmed = stderr.trim();
149
149
  if (trimmed === '')
150
- return '(stderr なし)';
150
+ return '(no stderr)';
151
151
  if (trimmed.length <= STDERR_EXCERPT_LIMIT)
152
152
  return trimmed;
153
153
  return `${trimmed.slice(0, STDERR_EXCERPT_LIMIT)}...`;
@@ -39,28 +39,28 @@ talk-dir マーカー検証。
39
39
  */
40
40
  export async function assertTalkDirectory(directory, fs) {
41
41
  if (!path.isAbsolute(directory)) {
42
- throw new SlideSyncUsageError(`--dir には絶対パスを指定してください (受け取った値: '${directory}')`, 'relative-dir');
42
+ throw new SlideSyncUsageError(`--dir must be an absolute path: ${directory}`, 'relative-dir');
43
43
  }
44
44
  const info = await fs.talkDirectoryExists(directory);
45
45
  if (!info.exists) {
46
- throw new SlideSyncRuntimeError(`'${directory}' はディレクトリとして存在しません`, 'dir-not-found');
46
+ throw new SlideSyncRuntimeError(`directory not found: ${directory}`, 'dir-not-found');
47
47
  }
48
48
  if (!info.isDirectory) {
49
- throw new SlideSyncRuntimeError(`'${directory}' はディレクトリではありません`, 'not-a-directory');
49
+ throw new SlideSyncRuntimeError(`not a directory: ${directory}`, 'not-a-directory');
50
50
  }
51
51
  const hasSlidesMd = await fs.doesSlidesMdExist(directory);
52
52
  if (!hasSlidesMd) {
53
- throw new SlideSyncRuntimeError(`'${directory}' に slides.md が無いため talk-dir として扱えません。`
54
- + ' pecotv slide create で作成された talk-dir を指定してください。', 'not-talk-dir');
53
+ throw new SlideSyncRuntimeError(`not a talk-dir (no slides.md): ${directory}; `
54
+ + 'specify a talk-dir created by pecotv slide create', 'not-talk-dir');
55
55
  }
56
56
  }
57
57
  function themeRequiredMessage(directory) {
58
- return `${directory} はテーマを参照していない移行前の talk-dir です。移行するテーマを指定してください: `
58
+ return `${directory} is a talk-dir from before migration that does not reference a theme; specify the theme to migrate to: `
59
59
  + `slide sync --dir ${directory} --theme <theme-spec>`
60
- + `(MCP では slide_sync の dir: ${directory}, theme: <theme-spec>)`;
60
+ + ` (MCP: slide_sync with dir: ${directory}, theme: <theme-spec>)`;
61
61
  }
62
- const IGNORED_THEME_WARNING = '--theme は使いませんでした。この talk-dir はすでにテーマを参照しています。'
63
- + 'テーマや版を替えるときは、package.json の依存を書き換えてから sync してください';
62
+ const IGNORED_THEME_WARNING = '--theme was not used because this talk-dir already references a theme; '
63
+ + 'to change the theme or its version, edit the dependency in package.json and run sync';
64
64
  /**
65
65
  sync の工程。talk-dir を 3 通りに分けて進める。
66
66
 
@@ -81,8 +81,8 @@ export async function runSlideSync(options, dependencies) {
81
81
  await assertTalkDirectory(options.directory, dependencies.fs);
82
82
  if (options.nodeModulesOnly) {
83
83
  if (options.theme !== undefined) {
84
- throw new SlideSyncUsageError('--node-modules-only と --theme は同時に指定できません。'
85
- + 'node_modules の張り直しだけなら --node-modules-only を、移行なら --theme を指定してください', 'theme-with-node-modules-only');
84
+ throw new SlideSyncUsageError('--node-modules-only and --theme cannot be used together; '
85
+ + 'use --node-modules-only to relink node_modules only, or --theme to migrate', 'theme-with-node-modules-only');
86
86
  }
87
87
  return await relink(options, dependencies, []);
88
88
  }
@@ -151,7 +151,7 @@ async function migrate(directory, themeSpec, dependencies) {
151
151
  catch (error) {
152
152
  if (error instanceof SlideSyncRuntimeError || error instanceof SlideSyncUsageError)
153
153
  throw error;
154
- throw new SlideSyncRuntimeError(`移行に失敗しました: ${formatError(error)}`, 'migrate-failed');
154
+ throw new SlideSyncRuntimeError(`migration failed: ${formatError(error)}`, 'migrate-failed');
155
155
  }
156
156
  let nodeModulesTarget;
157
157
  try {
@@ -183,7 +183,7 @@ function wrapLinkError(error) {
183
183
  // theme-name-mismatch など、原因の文言を持つ例外は包み直さない。
184
184
  if (error instanceof SlideCreateRuntimeError)
185
185
  return error;
186
- return new SlideSyncRuntimeError(`node_modules の張り直しに失敗しました: ${formatError(error)}`, 'symlink-failed');
186
+ return new SlideSyncRuntimeError(`relinking node_modules failed: ${formatError(error)}`, 'symlink-failed');
187
187
  }
188
188
  /* c8 ignore start -- 非 Error 例外 (string throw 等) は本実装範囲では未発生、防御網のみ */
189
189
  function formatError(error) {
@@ -1,6 +1,6 @@
1
1
  // 利用者に伝える警告の文言。create・convert が同じ文言を使う。
2
- export const LINK_COLOR_OMITTED_WARNING = 'pptx.linkColor を省いたため、PPTX ではリンクは変換されません(ハイパーリンクが付きません)。'
3
- + 'リンクを変換するには pecot-theme.json の pptx.linkColor に 6 桁の 16 進で書いてください';
4
- export const EAST_ASIAN_FONT_OMITTED_WARNING = 'pptx.eastAsianFont を省いたため、PPTX では東アジア書体を書き込みません。'
5
- + '日本語の書体を揃えるには pecot-theme.json の pptx.eastAsianFont に書体名を書いてください';
2
+ export const LINK_COLOR_OMITTED_WARNING = 'pptx.linkColor is omitted, so links are not converted in the PPTX (no hyperlinks are added); '
3
+ + 'to convert links, set pptx.linkColor in pecot-theme.json to 6 hex digits';
4
+ export const EAST_ASIAN_FONT_OMITTED_WARNING = 'pptx.eastAsianFont is omitted, so no East Asian font is written to the PPTX; '
5
+ + 'to set the Japanese font, set pptx.eastAsianFont in pecot-theme.json to a font name';
6
6
  //# sourceMappingURL=warnings.js.map
@@ -10,7 +10,7 @@ export const THEME_DECLARATION_FILE_NAME = 'pecot-theme.json';
10
10
  export const SUPPORTED_SCHEMA = 1;
11
11
  // 誤りの文言に添える、契約の節の案内。
12
12
  const CONTRACT_FILE = 'contracts/theme-declaration.md';
13
- const SHAPE_SECTION = `${CONTRACT_FILE} の「\`${THEME_DECLARATION_FILE_NAME}\`」の節`;
13
+ const SHAPE_SECTION = `the \`${THEME_DECLARATION_FILE_NAME}\` section of ${CONTRACT_FILE}`;
14
14
  export class ThemeDeclarationError extends Error {
15
15
  reason;
16
16
  constructor(message, reason) {
@@ -35,7 +35,7 @@ const fontSizesSchema = z.object({
35
35
  });
36
36
  const pptxSchema = z.object({
37
37
  eastAsianFont: name.optional(),
38
- linkColor: z.string().regex(/^[\da-f]{6}$/iu, '6 桁の 16 進で書く').optional(),
38
+ linkColor: z.string().regex(/^[\da-f]{6}$/iu, 'must be 6 hex digits').optional(),
39
39
  });
40
40
  const lintSchema = z.object({ rules: z.record(z.string(), severity).optional() });
41
41
  const layoutsSchema = z.object({ references: name.optional() });
@@ -62,27 +62,27 @@ JSON を読んだ unknown 値を宣言として検証し、省いた項目を既
62
62
  */
63
63
  export function parseThemeDeclaration(raw) {
64
64
  if (!isRecord(raw)) {
65
- throw new ThemeDeclarationError(`${THEME_DECLARATION_FILE_NAME} がオブジェクトではありません。${SHAPE_SECTION}を参照してください`, 'invalid-shape');
65
+ throw new ThemeDeclarationError(`${THEME_DECLARATION_FILE_NAME} must be an object (see ${SHAPE_SECTION})`, 'invalid-shape');
66
66
  }
67
67
  const { schema } = raw;
68
68
  if (typeof schema === 'number' && schema !== SUPPORTED_SCHEMA) {
69
69
  return {
70
70
  declaration: DEFAULT_THEME_DECLARATION,
71
71
  warnings: [
72
- `${THEME_DECLARATION_FILE_NAME} の schema ${String(schema)} は、この pecot では読めません(読めるのは ${String(SUPPORTED_SCHEMA)})。宣言を使わず、本体の既定値で続けます`,
72
+ `${THEME_DECLARATION_FILE_NAME} schema ${String(schema)} is not supported (supported: ${String(SUPPORTED_SCHEMA)}); ignoring the declaration and continuing with the defaults`,
73
73
  ],
74
74
  };
75
75
  }
76
76
  const parsed = declarationSchema.safeParse(raw);
77
77
  if (!parsed.success) {
78
78
  const detail = parsed.error.issues
79
- .map(issue => `${issue.path.map(String).join('.') || '(最上位)'}: ${issue.message}`)
79
+ .map(issue => `${issue.path.map(String).join('.') || '(top level)'}: ${issue.message}`)
80
80
  .join('; ');
81
- throw new ThemeDeclarationError(`${THEME_DECLARATION_FILE_NAME} の形が誤っています: ${detail}。${SHAPE_SECTION}を参照してください`, 'invalid-shape');
81
+ throw new ThemeDeclarationError(`invalid shape of ${THEME_DECLARATION_FILE_NAME}: ${detail} (see ${SHAPE_SECTION})`, 'invalid-shape');
82
82
  }
83
83
  const unknownRules = Object.keys(parsed.data.lint?.rules ?? {}).filter(id => !KNOWN_RULES.has(id));
84
84
  if (unknownRules.length > 0) {
85
- throw new ThemeDeclarationError(`${THEME_DECLARATION_FILE_NAME} の lint.rules に、本体の deck lint が持たない規則があります: ${unknownRules.join(', ')}。${SHAPE_SECTION}の「lint.rules」の項を参照してください`, 'unknown-rule');
85
+ throw new ThemeDeclarationError(`lint.rules in ${THEME_DECLARATION_FILE_NAME} has rules the deck lint does not have: ${unknownRules.join(', ')} (see the "lint.rules" part of ${SHAPE_SECTION})`, 'unknown-rule');
86
86
  }
87
87
  return { declaration: resolve(parsed.data), warnings: [] };
88
88
  }
@@ -95,7 +95,7 @@ export async function readThemeDeclaration(files, themeRoot) {
95
95
  if (text === undefined) {
96
96
  return {
97
97
  declaration: DEFAULT_THEME_DECLARATION,
98
- warnings: [`テーマ ${themeRoot} に ${THEME_DECLARATION_FILE_NAME} の宣言が無いため、本体の既定値で続けます`],
98
+ warnings: [`theme ${themeRoot} has no ${THEME_DECLARATION_FILE_NAME} declaration; continuing with the defaults`],
99
99
  };
100
100
  }
101
101
  let raw;
@@ -104,7 +104,7 @@ export async function readThemeDeclaration(files, themeRoot) {
104
104
  }
105
105
  catch (error) {
106
106
  const reason = error instanceof Error ? error.message : String(error);
107
- throw new ThemeDeclarationError(`${filePath} を JSON として読めません: ${reason}。${SHAPE_SECTION}を参照してください`, 'invalid-shape');
107
+ throw new ThemeDeclarationError(`cannot read ${filePath} as JSON: ${reason} (see ${SHAPE_SECTION})`, 'invalid-shape');
108
108
  }
109
109
  return parseThemeDeclaration(raw);
110
110
  }
@@ -11,7 +11,7 @@ const COMMON_FILE_NAME = '_common.yaml';
11
11
  /**
12
12
  分類を読めなかったときの復旧導線。テーマ側の宣言を直す案内を、分類まわりの警告に必ず添える。
13
13
  */
14
- const CATEGORY_SYNC_HINT = 'テーマの references/_common.yaml の layout_categories を確認してください';
14
+ const CATEGORY_SYNC_HINT = 'check layout_categories in references/_common.yaml of the theme';
15
15
  function isDeclarationFile(fileName, extension) {
16
16
  return fileName.endsWith(extension) && !fileName.startsWith('_');
17
17
  }
@@ -27,7 +27,7 @@ warnings) {
27
27
  }
28
28
  default: {
29
29
  if (typeof value === 'string' && value !== '') {
30
- warnings.push(`${fileName} の status '${value}' は未知の値です。stable として扱います`);
30
+ warnings.push(`unknown status in ${fileName}: ${value}; treating it as stable`);
31
31
  }
32
32
  return 'stable';
33
33
  }
@@ -97,8 +97,8 @@ export async function resolveLayoutReferences(files, options) {
97
97
  */
98
98
  const UNCATEGORIZED_CATEGORY = {
99
99
  id: UNCATEGORIZED,
100
- label: '未分類',
101
- question: `category が未設定か未知語彙のレイアウト(${CATEGORY_SYNC_HINT})`,
100
+ label: 'Uncategorized',
101
+ question: `layouts whose category is unset or unknown (${CATEGORY_SYNC_HINT})`,
102
102
  };
103
103
  /**
104
104
  `layout_categories` の 1 要素を `LayoutCategory` へ写す。`id` / `label` / `question` が
@@ -119,7 +119,7 @@ function toLayoutCategory(value) {
119
119
  function categoriesUnusable(commonPath, reason) {
120
120
  return {
121
121
  categories: [],
122
- warnings: [`見せ方の分類を読み取れませんでした (${commonPath}: ${reason})。分類なしで続行します。${CATEGORY_SYNC_HINT}`],
122
+ warnings: [`cannot read the layout categories (${commonPath}: ${reason}); continuing without categories (fix: ${CATEGORY_SYNC_HINT})`],
123
123
  };
124
124
  }
125
125
  async function findCommonFile(files, directories) {
@@ -146,14 +146,14 @@ export async function readLayoutCategories(files, directories) {
146
146
  const found = await findCommonFile(files, directories);
147
147
  const lastDirectory = directories.at(-1) ?? '';
148
148
  if (found === undefined) {
149
- return categoriesUnusable(path.join(lastDirectory, COMMON_FILE_NAME), 'ファイルがありません');
149
+ return categoriesUnusable(path.join(lastDirectory, COMMON_FILE_NAME), 'file not found');
150
150
  }
151
151
  let items;
152
152
  try {
153
153
  const parsed = parse(found.text);
154
154
  const raw = isRecord(parsed) ? parsed['layout_categories'] : undefined;
155
155
  if (!Array.isArray(raw))
156
- throw new TypeError('layout_categories が配列として見つかりません');
156
+ throw new TypeError('layout_categories is not found as an array');
157
157
  items = raw;
158
158
  }
159
159
  catch (error) {
@@ -178,14 +178,14 @@ export async function readLayoutCategories(files, directories) {
178
178
  }
179
179
  if (categories.length === 0) {
180
180
  // 全滅は「分類が読めなかった」のと利用者から見て区別がつかないので、同じ 1 行に合流させる。
181
- return categoriesUnusable(found.path, `layout_categories に使える要素がありません (${String(items.length)} 件中 0 件)`);
181
+ return categoriesUnusable(found.path, `layout_categories has no usable item (0 of ${String(items.length)})`);
182
182
  }
183
183
  const warnings = [];
184
184
  if (reserved > 0) {
185
- warnings.push(`layout_categories の id '${UNCATEGORIZED}' は予約語のため無視します (${String(reserved)} 件、${CATEGORY_SYNC_HINT})`);
185
+ warnings.push(`ignoring reserved layout_categories id ${UNCATEGORIZED} (${String(reserved)} item(s)); ${CATEGORY_SYNC_HINT}`);
186
186
  }
187
187
  if (malformed > 0) {
188
- warnings.push(`layout_categories の一部を読み飛ばしました (id/label/question が不揃い: ${String(malformed)} 件)。${CATEGORY_SYNC_HINT}`);
188
+ warnings.push(`skipped part of layout_categories (id, label or question missing: ${String(malformed)} item(s)); ${CATEGORY_SYNC_HINT}`);
189
189
  }
190
190
  return { categories, warnings };
191
191
  }
@@ -86,18 +86,18 @@ export function classifyGitFailure(stderr) {
86
86
  export function gitFailureAdvice(kind, spec) {
87
87
  switch (kind) {
88
88
  case 'connection': {
89
- return `テーマの取得元 ${spec.url} に接続できません。ネットワークとプロキシを確認してください。`
90
- + 'SSL 証明書の検証で止まる場合は、git の http.sslCAInfo に、TLS を中継するプロキシの CA の証明書の束を指定してください。';
89
+ return `cannot connect to the theme source: ${spec.url} (fix: check the network and proxy; `
90
+ + 'if it stops at SSL certificate verification, set git http.sslCAInfo to the CA bundle of the TLS-intercepting proxy)';
91
91
  }
92
92
  case 'auth': {
93
- return `テーマの取得元 ${spec.url} の認証に失敗しました。`
94
- + 'git の認証情報(credential helper か SSH 鍵)を設定してから、やり直してください。';
93
+ return `authentication failed for the theme source: ${spec.url} `
94
+ + '(fix: set up git credentials, a credential helper or an SSH key, and retry)';
95
95
  }
96
96
  case 'tag': {
97
- return `テーマの取得元 ${spec.url} にタグ '${spec.tag}' がありません。タグ名を確認してください。ブランチ名は指定できません。`;
97
+ return `tag not found in the theme source ${spec.url}: ${spec.tag} (fix: check the tag name; branch names are not accepted)`;
98
98
  }
99
99
  case 'unknown': {
100
- return `テーマの取得元 ${spec.url} から git で取得できませんでした。`;
100
+ return `git could not fetch the theme source: ${spec.url}`;
101
101
  }
102
102
  }
103
103
  }