@shuji-bonji/pdf-spec-mcp 0.3.1 → 0.4.1

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 (77) hide show
  1. package/README.ja.md +11 -4
  2. package/README.md +11 -4
  3. package/dist/config.d.ts +22 -0
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +32 -1
  6. package/dist/config.js.map +1 -1
  7. package/dist/errors.d.ts +69 -5
  8. package/dist/errors.d.ts.map +1 -1
  9. package/dist/errors.js +70 -9
  10. package/dist/errors.js.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +5 -42
  14. package/dist/index.js.map +1 -1
  15. package/dist/server.d.ts +18 -0
  16. package/dist/server.d.ts.map +1 -0
  17. package/dist/server.js +59 -0
  18. package/dist/server.js.map +1 -0
  19. package/dist/services/compare-service.d.ts +1 -1
  20. package/dist/services/compare-service.d.ts.map +1 -1
  21. package/dist/services/compare-service.js +2 -2
  22. package/dist/services/compare-service.js.map +1 -1
  23. package/dist/services/content-extractor.d.ts +25 -0
  24. package/dist/services/content-extractor.d.ts.map +1 -1
  25. package/dist/services/content-extractor.js +52 -12
  26. package/dist/services/content-extractor.js.map +1 -1
  27. package/dist/services/outline-resolver.d.ts +1 -1
  28. package/dist/services/outline-resolver.d.ts.map +1 -1
  29. package/dist/services/pdf-loader.d.ts +12 -2
  30. package/dist/services/pdf-loader.d.ts.map +1 -1
  31. package/dist/services/pdf-loader.js +21 -13
  32. package/dist/services/pdf-loader.js.map +1 -1
  33. package/dist/services/pdf-registry.d.ts.map +1 -1
  34. package/dist/services/pdf-registry.js +16 -8
  35. package/dist/services/pdf-registry.js.map +1 -1
  36. package/dist/services/pdf-service.d.ts +13 -1
  37. package/dist/services/pdf-service.d.ts.map +1 -1
  38. package/dist/services/pdf-service.js +79 -72
  39. package/dist/services/pdf-service.js.map +1 -1
  40. package/dist/services/requirement-extractor.d.ts +1 -1
  41. package/dist/services/requirement-extractor.d.ts.map +1 -1
  42. package/dist/services/requirement-extractor.js +40 -4
  43. package/dist/services/requirement-extractor.js.map +1 -1
  44. package/dist/services/search-index.d.ts +1 -1
  45. package/dist/services/search-index.d.ts.map +1 -1
  46. package/dist/services/search-index.js +6 -6
  47. package/dist/services/search-index.js.map +1 -1
  48. package/dist/services/table-collector.d.ts +19 -0
  49. package/dist/services/table-collector.d.ts.map +1 -0
  50. package/dist/services/table-collector.js +67 -0
  51. package/dist/services/table-collector.js.map +1 -0
  52. package/dist/tools/definitions.d.ts +26 -3
  53. package/dist/tools/definitions.d.ts.map +1 -1
  54. package/dist/tools/definitions.js +47 -114
  55. package/dist/tools/definitions.js.map +1 -1
  56. package/dist/tools/handlers.d.ts +18 -9
  57. package/dist/tools/handlers.d.ts.map +1 -1
  58. package/dist/tools/handlers.js +57 -38
  59. package/dist/tools/handlers.js.map +1 -1
  60. package/dist/types/index.d.ts +28 -33
  61. package/dist/types/index.d.ts.map +1 -1
  62. package/dist/utils/cache.d.ts.map +1 -1
  63. package/dist/utils/cache.js +4 -0
  64. package/dist/utils/cache.js.map +1 -1
  65. package/dist/utils/stdout-guard.d.ts +24 -0
  66. package/dist/utils/stdout-guard.d.ts.map +1 -0
  67. package/dist/utils/stdout-guard.js +27 -0
  68. package/dist/utils/stdout-guard.js.map +1 -0
  69. package/dist/utils/validation.d.ts +96 -14
  70. package/dist/utils/validation.d.ts.map +1 -1
  71. package/dist/utils/validation.js +152 -94
  72. package/dist/utils/validation.js.map +1 -1
  73. package/package.json +14 -11
  74. package/dist/container.d.ts +0 -25
  75. package/dist/container.d.ts.map +0 -1
  76. package/dist/container.js +0 -25
  77. package/dist/container.js.map +0 -1
package/README.ja.md CHANGED
@@ -165,12 +165,12 @@ pdf-specs/
165
165
  ### 2. インストール
166
166
 
167
167
  このパッケージは MCP クライアントから起動される CLI バイナリ(`pdf-spec-mcp`)を提供します。
168
- **通常は手動でインストールする必要はありません** — 次のステップのように MCP クライアント側で `npx @shuji-bonji/pdf-spec-mcp` を指定してください。
168
+ **通常は手動でインストールする必要はありません** — 次のステップのように MCP クライアント側で `npx @shuji-bonji/pdf-spec-mcp@latest` を指定してください。
169
169
 
170
170
  シェルから直接動作確認したい場合(デバッグ用途など):
171
171
 
172
172
  ```bash
173
- PDF_SPEC_DIR=/path/to/pdf-specs npx -y @shuji-bonji/pdf-spec-mcp
173
+ PDF_SPEC_DIR=/path/to/pdf-specs npx -y @shuji-bonji/pdf-spec-mcp@latest
174
174
  ```
175
175
 
176
176
  グローバルインストールしたい場合(任意):
@@ -197,7 +197,7 @@ PDF_SPEC_DIR=/path/to/pdf-specs pdf-spec-mcp
197
197
  "mcpServers": {
198
198
  "pdf-spec": {
199
199
  "command": "npx",
200
- "args": ["-y", "@shuji-bonji/pdf-spec-mcp"],
200
+ "args": ["-y", "@shuji-bonji/pdf-spec-mcp@latest"],
201
201
  "env": {
202
202
  "PDF_SPEC_DIR": "/path/to/pdf-specs"
203
203
  }
@@ -206,6 +206,13 @@ PDF_SPEC_DIR=/path/to/pdf-specs pdf-spec-mcp
206
206
  }
207
207
  ```
208
208
 
209
+ > [!IMPORTANT]
210
+ > **`@latest` を付ける(またはバージョンを固定する)。** バージョン指定なしの `npx -y <pkg>` は
211
+ > **最初にキャッシュしたものを使い続ける** — `-y` はインストールの確認を省くだけで、更新は確認しない。
212
+ > 指定なしだと数ヶ月前のリリースが動き続けることがある。`@latest` を付けると npx が起動のたびに
213
+ > レジストリを確認する。再現性が要るなら `@0.4.0` のように固定する。
214
+ > 古いキャッシュを消すには `rm -rf ~/.npm/_npx`。
215
+
209
216
  #### Cursor / VS Code
210
217
 
211
218
  `.cursor/mcp.json` または VS Code の MCP 設定に追加:
@@ -215,7 +222,7 @@ PDF_SPEC_DIR=/path/to/pdf-specs pdf-spec-mcp
215
222
  "mcpServers": {
216
223
  "pdf-spec": {
217
224
  "command": "npx",
218
- "args": ["-y", "@shuji-bonji/pdf-spec-mcp"],
225
+ "args": ["-y", "@shuji-bonji/pdf-spec-mcp@latest"],
219
226
  "env": {
220
227
  "PDF_SPEC_DIR": "/path/to/pdf-specs"
221
228
  }
package/README.md CHANGED
@@ -165,12 +165,12 @@ pdf-specs/
165
165
  ### 2. Install
166
166
 
167
167
  This package ships a CLI binary (`pdf-spec-mcp`) intended to be launched by an MCP client.
168
- **You do not need to install it manually** — just point your MCP client to `npx @shuji-bonji/pdf-spec-mcp` as shown in the next step.
168
+ **You do not need to install it manually** — just point your MCP client to `npx @shuji-bonji/pdf-spec-mcp@latest` as shown in the next step.
169
169
 
170
170
  If you want to run it directly from the shell (e.g. for debugging):
171
171
 
172
172
  ```bash
173
- PDF_SPEC_DIR=/path/to/pdf-specs npx -y @shuji-bonji/pdf-spec-mcp
173
+ PDF_SPEC_DIR=/path/to/pdf-specs npx -y @shuji-bonji/pdf-spec-mcp@latest
174
174
  ```
175
175
 
176
176
  Or install it globally (optional):
@@ -197,7 +197,7 @@ Add to `claude_desktop_config.json`:
197
197
  "mcpServers": {
198
198
  "pdf-spec": {
199
199
  "command": "npx",
200
- "args": ["-y", "@shuji-bonji/pdf-spec-mcp"],
200
+ "args": ["-y", "@shuji-bonji/pdf-spec-mcp@latest"],
201
201
  "env": {
202
202
  "PDF_SPEC_DIR": "/path/to/pdf-specs"
203
203
  }
@@ -206,6 +206,13 @@ Add to `claude_desktop_config.json`:
206
206
  }
207
207
  ```
208
208
 
209
+ > [!IMPORTANT]
210
+ > **Use `@latest` (or pin a version).** `npx -y <pkg>` without a version keeps running whatever
211
+ > it cached the first time — `-y` only skips the install prompt, it does not check for updates.
212
+ > A bare specifier will happily run a months-old release. `@latest` makes npx check the registry
213
+ > on each start; pin `@0.4.0` instead if you want reproducibility.
214
+ > To clear a stale cache: `rm -rf ~/.npm/_npx`.
215
+
209
216
  #### Cursor / VS Code
210
217
 
211
218
  Add to `.cursor/mcp.json` or VS Code MCP settings:
@@ -215,7 +222,7 @@ Add to `.cursor/mcp.json` or VS Code MCP settings:
215
222
  "mcpServers": {
216
223
  "pdf-spec": {
217
224
  "command": "npx",
218
- "args": ["-y", "@shuji-bonji/pdf-spec-mcp"],
225
+ "args": ["-y", "@shuji-bonji/pdf-spec-mcp@latest"],
219
226
  "env": {
220
227
  "PDF_SPEC_DIR": "/path/to/pdf-specs"
221
228
  }
package/dist/config.d.ts CHANGED
@@ -35,6 +35,8 @@ export declare const VALIDATION_LIMITS: {
35
35
  };
36
36
  readonly defaultMaxResults: 10;
37
37
  };
38
+ /** Matches a table caption paragraph ("Table 182 — Additional entries...") */
39
+ export declare const TABLE_CAPTION_START_RE: RegExp;
38
40
  /** Concurrency limits for chunked parallel processing */
39
41
  export declare const CONCURRENCY: {
40
42
  /** Pages processed in parallel during search index build */
@@ -44,6 +46,26 @@ export declare const CONCURRENCY: {
44
46
  /** Pages processed in parallel during content extraction */
45
47
  readonly contentExtraction: 10;
46
48
  };
49
+ /** A normative area this server cannot answer for. */
50
+ export interface CoverageGap {
51
+ area: string;
52
+ standards: string[];
53
+ consequence: string;
54
+ }
55
+ /**
56
+ * Areas outside this server's corpus (S-2).
57
+ *
58
+ * family 規約 §2.0 routes implementation decisions through this server, which makes a
59
+ * silent gap dangerous: `search_spec("PDF/A conformance")` returns zero hits, and zero hits
60
+ * read exactly like "no such requirement". The most consequential answers this server gives
61
+ * are the ones it cannot give, so it has to say so.
62
+ *
63
+ * These are not "the file happens to be missing". There is no SPEC_PATTERNS entry for
64
+ * either standard, so the PDFs would not be indexed even if they were placed in
65
+ * PDF_SPEC_DIR. Closing a gap means adding a pattern here, not just a file — and then
66
+ * removing the entry below.
67
+ */
68
+ export declare const COVERAGE_GAPS: CoverageGap[];
47
69
  /** Filename pattern → spec ID mapping rule */
48
70
  export interface SpecPattern {
49
71
  pattern: RegExp;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE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,4DAA4D;;CAEpD,CAAC;AAEX,sDAAsD;AACtD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,EAAE,WAAW,EAiBtC,CAAC;AAEF,8CAA8C;AAC9C,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,WAAW,EAwItC,CAAC"}
package/dist/config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Application Configuration
3
3
  */
4
- import { createRequire } from 'module';
4
+ import { createRequire } from 'node:module';
5
5
  const require = createRequire(import.meta.url);
6
6
  const packageJson = require('../package.json');
7
7
  export const PACKAGE_INFO = {
@@ -28,6 +28,8 @@ export const VALIDATION_LIMITS = {
28
28
  maxResultsRange: { min: 1, max: 50 },
29
29
  defaultMaxResults: 10,
30
30
  };
31
+ /** Matches a table caption paragraph ("Table 182 — Additional entries...") */
32
+ export const TABLE_CAPTION_START_RE = /^Table\s+\d+/;
31
33
  /** Concurrency limits for chunked parallel processing */
32
34
  export const CONCURRENCY = {
33
35
  /** Pages processed in parallel during search index build */
@@ -37,6 +39,35 @@ export const CONCURRENCY = {
37
39
  /** Pages processed in parallel during content extraction */
38
40
  contentExtraction: 10,
39
41
  };
42
+ /**
43
+ * Areas outside this server's corpus (S-2).
44
+ *
45
+ * family 規約 §2.0 routes implementation decisions through this server, which makes a
46
+ * silent gap dangerous: `search_spec("PDF/A conformance")` returns zero hits, and zero hits
47
+ * read exactly like "no such requirement". The most consequential answers this server gives
48
+ * are the ones it cannot give, so it has to say so.
49
+ *
50
+ * These are not "the file happens to be missing". There is no SPEC_PATTERNS entry for
51
+ * either standard, so the PDFs would not be indexed even if they were placed in
52
+ * PDF_SPEC_DIR. Closing a gap means adding a pattern here, not just a file — and then
53
+ * removing the entry below.
54
+ */
55
+ export const COVERAGE_GAPS = [
56
+ {
57
+ area: 'PDF/A — archival conformance',
58
+ standards: ['ISO 19005-1', 'ISO 19005-2', 'ISO 19005-3', 'ISO 19005-4'],
59
+ consequence: 'Requirements specific to PDF/A cannot be quoted or verified here. pdf-verify-mcp ' +
60
+ 'validate_conformance with a "pdfa-*" flavour has no normative text to trace to in this ' +
61
+ 'corpus. A search returning nothing is not evidence that no requirement exists.',
62
+ },
63
+ {
64
+ area: 'PAdES — signature profiles',
65
+ standards: ['ETSI EN 319 142-1', 'ETSI EN 319 142-2'],
66
+ consequence: 'Baseline signature levels (B-B / B-T / B-LT / B-LTA) are defined by ETSI, not by ' +
67
+ 'ISO 32000-2. pdf-verify-mcp detect_pades_level cannot be checked against normative text ' +
68
+ 'here. ISO 32000-2 §12.8 covers signatures in general and is available.',
69
+ },
70
+ ];
40
71
  /**
41
72
  * Ordered list of filename patterns for auto-discovery.
42
73
  * Array order = priority: when multiple files map to the same spec ID,
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGvC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAsC,CAAC;AAEpF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAC,IAAI;IACtB,OAAO,EAAE,WAAW,CAAC,OAAO;CACpB,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,cAAc;IACtB,UAAU,EA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oB;IACpB;QACE,OAAO,EAAE,cAAc;QACvB,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,8BAA8B;QACrC,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,0BAA0B;KACxC;IACD;QACE,OAAO,EAAE,cAAc;QACvB,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,8BAA8B;QACrC,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,kBAAkB;KAChC;IACD;QACE,OAAO,EAAE,cAAc;QACvB,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,8BAA8B;QACrC,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,2BAA2B;KACzC;CACF,CAAC"}
package/dist/errors.d.ts CHANGED
@@ -4,35 +4,99 @@
4
4
  * Structured error classes for consistent error handling across the MCP server.
5
5
  * Each error carries a `code` string for programmatic error identification.
6
6
  */
7
+ /** A concrete step an agent can take to get past an error. */
8
+ export interface NextAction {
9
+ action: string;
10
+ reason: string;
11
+ }
12
+ /**
13
+ * The family error contract (規約 §2.3).
14
+ *
15
+ * `code` alone tells an agent *what* went wrong; `hint` and `next_actions` tell it what to
16
+ * do about it, and `retryable` whether doing so is worth trying. Orchestration Skills read
17
+ * these to decide their next move instead of surfacing a dead end to the user.
18
+ *
19
+ * @see https://github.com/shuji-bonji/houki-research-skill/blob/main/docs/ERROR-CODES.md
20
+ */
21
+ export interface SpecServiceError {
22
+ error: string;
23
+ code: string;
24
+ /** What the caller should understand about the failure. */
25
+ hint?: string;
26
+ /** Concrete next steps. */
27
+ next_actions?: NextAction[];
28
+ /** Whether a different argument or a fixed environment could make this succeed. */
29
+ retryable?: boolean;
30
+ }
7
31
  /**
8
32
  * Base error class for all pdf-spec-mcp errors.
9
33
  */
10
34
  export declare class PDFSpecError extends Error {
11
35
  readonly code: string;
12
- constructor(code: string, message: string);
36
+ readonly hint?: string;
37
+ readonly next_actions?: NextAction[];
38
+ readonly retryable?: boolean;
39
+ constructor(code: string, message: string, options?: {
40
+ hint?: string;
41
+ next_actions?: NextAction[];
42
+ retryable?: boolean;
43
+ });
13
44
  }
45
+ type ErrorOptions = {
46
+ hint?: string;
47
+ next_actions?: NextAction[];
48
+ retryable?: boolean;
49
+ };
14
50
  /**
15
51
  * Input validation errors (invalid parameters, out-of-range values, etc.)
52
+ *
53
+ * Always retryable: the caller controls the arguments.
16
54
  */
17
55
  export declare class ValidationError extends PDFSpecError {
18
- constructor(message: string);
56
+ constructor(message: string, options?: ErrorOptions);
19
57
  }
20
58
  /**
21
59
  * Registry-related errors (spec not found, env var missing, discovery failure)
22
60
  */
23
61
  export declare class RegistryError extends PDFSpecError {
24
- constructor(message: string);
62
+ constructor(message: string, options?: ErrorOptions);
25
63
  }
26
64
  /**
27
65
  * Content extraction errors (section not found, page access failure, parse errors)
28
66
  */
29
67
  export declare class ContentError extends PDFSpecError {
30
- constructor(message: string);
68
+ constructor(message: string, options?: ErrorOptions);
31
69
  }
32
70
  /**
33
71
  * Tool prerequisite errors (required specs not available, missing dependencies)
72
+ *
73
+ * Not retryable as-is: the environment has to change first. `next_actions` carries what
74
+ * that change is, so an orchestrating Skill can tell the user precisely what to install
75
+ * rather than reporting a bare failure.
34
76
  */
35
77
  export declare class ToolPrerequisiteError extends PDFSpecError {
36
- constructor(message: string);
78
+ constructor(message: string, options?: ErrorOptions);
37
79
  }
80
+ /**
81
+ * Shape an error for the MCP response (規約 §2.3).
82
+ *
83
+ * Optional members are omitted rather than set to undefined, so the JSON stays clean for
84
+ * whatever reads it.
85
+ */
86
+ export declare function toStructuredError(error: unknown): SpecServiceError;
87
+ /**
88
+ * Presets for the recurring dead ends.
89
+ *
90
+ * This server is useless without its corpus — the spec PDFs are copyrighted and cannot be
91
+ * shipped, so "the file is not there" is the normal first-run failure rather than an
92
+ * exceptional one. Saying exactly which file, and where to get it, is what turns that into
93
+ * something an agent can resolve.
94
+ */
95
+ export declare const NEXT_ACTIONS: {
96
+ readonly setSpecDir: (envVar: string) => NextAction;
97
+ readonly downloadSpec: (file: string, url: string) => NextAction;
98
+ readonly listSpecs: () => NextAction;
99
+ readonly getStructure: () => NextAction;
100
+ };
101
+ export {};
38
102
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK1C;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,YAAY;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;gBAChC,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;gBACzC,OAAO,EAAE,MAAM;CAI5B"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8DAA8D;AAC9D,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;gBAG3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAO;CASpF;AAED,KAAK,YAAY,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAExF;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;CAIxD;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,YAAY;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;CAIxD;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;gBAChC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;CAIxD;AAED;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;gBACzC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;CAIxD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAYlE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;kCACF,MAAM,KAAG,UAAU;kCAMnB,MAAM,OAAO,MAAM,KAAG,UAAU;8BAItC,UAAU;iCAIP,UAAU;CAIpB,CAAC"}
package/dist/errors.js CHANGED
@@ -9,18 +9,26 @@
9
9
  */
10
10
  export class PDFSpecError extends Error {
11
11
  code;
12
- constructor(code, message) {
12
+ hint;
13
+ next_actions;
14
+ retryable;
15
+ constructor(code, message, options = {}) {
13
16
  super(message);
14
17
  this.name = 'PDFSpecError';
15
18
  this.code = code;
19
+ this.hint = options.hint;
20
+ this.next_actions = options.next_actions;
21
+ this.retryable = options.retryable;
16
22
  }
17
23
  }
18
24
  /**
19
25
  * Input validation errors (invalid parameters, out-of-range values, etc.)
26
+ *
27
+ * Always retryable: the caller controls the arguments.
20
28
  */
21
29
  export class ValidationError extends PDFSpecError {
22
- constructor(message) {
23
- super('VALIDATION_ERROR', message);
30
+ constructor(message, options = {}) {
31
+ super('VALIDATION_ERROR', message, { retryable: true, ...options });
24
32
  this.name = 'ValidationError';
25
33
  }
26
34
  }
@@ -28,8 +36,8 @@ export class ValidationError extends PDFSpecError {
28
36
  * Registry-related errors (spec not found, env var missing, discovery failure)
29
37
  */
30
38
  export class RegistryError extends PDFSpecError {
31
- constructor(message) {
32
- super('REGISTRY_ERROR', message);
39
+ constructor(message, options = {}) {
40
+ super('REGISTRY_ERROR', message, options);
33
41
  this.name = 'RegistryError';
34
42
  }
35
43
  }
@@ -37,18 +45,71 @@ export class RegistryError extends PDFSpecError {
37
45
  * Content extraction errors (section not found, page access failure, parse errors)
38
46
  */
39
47
  export class ContentError extends PDFSpecError {
40
- constructor(message) {
41
- super('CONTENT_ERROR', message);
48
+ constructor(message, options = {}) {
49
+ super('CONTENT_ERROR', message, options);
42
50
  this.name = 'ContentError';
43
51
  }
44
52
  }
45
53
  /**
46
54
  * Tool prerequisite errors (required specs not available, missing dependencies)
55
+ *
56
+ * Not retryable as-is: the environment has to change first. `next_actions` carries what
57
+ * that change is, so an orchestrating Skill can tell the user precisely what to install
58
+ * rather than reporting a bare failure.
47
59
  */
48
60
  export class ToolPrerequisiteError extends PDFSpecError {
49
- constructor(message) {
50
- super('PREREQUISITE_ERROR', message);
61
+ constructor(message, options = {}) {
62
+ super('PREREQUISITE_ERROR', message, { retryable: false, ...options });
51
63
  this.name = 'ToolPrerequisiteError';
52
64
  }
53
65
  }
66
+ /**
67
+ * Shape an error for the MCP response (規約 §2.3).
68
+ *
69
+ * Optional members are omitted rather than set to undefined, so the JSON stays clean for
70
+ * whatever reads it.
71
+ */
72
+ export function toStructuredError(error) {
73
+ if (error instanceof PDFSpecError) {
74
+ const out = { error: error.message, code: error.code };
75
+ if (error.hint)
76
+ out.hint = error.hint;
77
+ if (error.next_actions && error.next_actions.length > 0)
78
+ out.next_actions = error.next_actions;
79
+ if (error.retryable !== undefined)
80
+ out.retryable = error.retryable;
81
+ return out;
82
+ }
83
+ if (error instanceof Error) {
84
+ return { error: error.message, code: 'INTERNAL_ERROR' };
85
+ }
86
+ return { error: String(error), code: 'INTERNAL_ERROR' };
87
+ }
88
+ /**
89
+ * Presets for the recurring dead ends.
90
+ *
91
+ * This server is useless without its corpus — the spec PDFs are copyrighted and cannot be
92
+ * shipped, so "the file is not there" is the normal first-run failure rather than an
93
+ * exceptional one. Saying exactly which file, and where to get it, is what turns that into
94
+ * something an agent can resolve.
95
+ */
96
+ export const NEXT_ACTIONS = {
97
+ setSpecDir: (envVar) => ({
98
+ action: `set_${envVar}`,
99
+ reason: `Set the ${envVar} environment variable to the directory holding the specification PDFs, ` +
100
+ 'then restart the MCP server. The PDFs are copyrighted and are not distributed with this package.',
101
+ }),
102
+ downloadSpec: (file, url) => ({
103
+ action: 'download_spec_pdf',
104
+ reason: `Place "${file}" in PDF_SPEC_DIR. Download it from ${url}`,
105
+ }),
106
+ listSpecs: () => ({
107
+ action: 'call_list_specs',
108
+ reason: 'Call list_specs to see which specification PDFs are currently available.',
109
+ }),
110
+ getStructure: () => ({
111
+ action: 'call_get_structure',
112
+ reason: 'Call get_structure to see the available section numbers for this spec.',
113
+ }),
114
+ };
54
115
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B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AAC;QAC/B,MAAM,EAAE,oBAAoB;QAC5B,MAAM,EAAE,wEAAwE;KACjF,CAAC;CACM,CAAC"}
package/dist/index.d.ts CHANGED
@@ -3,5 +3,5 @@
3
3
  * PDF Spec MCP Server
4
4
  * MCP server for structured understanding of ISO 32000 (PDF) specifications
5
5
  */
6
- export {};
6
+ import './utils/stdout-guard.js';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAIH,OAAO,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -3,52 +3,15 @@
3
3
  * PDF Spec MCP Server
4
4
  * MCP server for structured understanding of ISO 32000 (PDF) specifications
5
5
  */
6
- import { Server } from '@modelcontextprotocol/sdk/server/index.js';
6
+ // MUST be the first import: installs the stdout guard before any dependency
7
+ // (notably pdfjs-dist) is evaluated. See utils/stdout-guard.ts.
8
+ import './utils/stdout-guard.js';
7
9
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
8
- import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
9
- import { tools } from './tools/definitions.js';
10
- import { toolHandlers } from './tools/handlers.js';
11
- import { PDFSpecError } from './errors.js';
12
10
  import { PACKAGE_INFO } from './config.js';
13
- const server = new Server({
14
- name: PACKAGE_INFO.name,
15
- version: PACKAGE_INFO.version,
16
- }, {
17
- capabilities: {
18
- tools: {},
19
- },
20
- });
21
- // List tools
22
- server.setRequestHandler(ListToolsRequestSchema, async () => {
23
- return { tools };
24
- });
25
- // Execute tool
26
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
27
- const { name, arguments: args } = request.params;
28
- try {
29
- if (!(name in toolHandlers)) {
30
- throw new Error(`Unknown tool: ${name}`);
31
- }
32
- // Type boundary: MCP SDK provides args as Record<string, unknown>.
33
- // After validating the tool name, we cast args to match the handler's
34
- // expected input — each handler validates its own arguments at runtime.
35
- const handler = toolHandlers[name];
36
- const result = await handler(args ?? {});
37
- return {
38
- content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
39
- };
40
- }
41
- catch (error) {
42
- const message = error instanceof Error ? error.message : String(error);
43
- const code = error instanceof PDFSpecError ? error.code : 'INTERNAL_ERROR';
44
- return {
45
- content: [{ type: 'text', text: JSON.stringify({ error: message, code }, null, 2) }],
46
- isError: true,
47
- };
48
- }
49
- });
11
+ import { buildServer } from './server.js';
50
12
  // Start server
51
13
  async function main() {
14
+ const server = buildServer();
52
15
  const transport = new StdioServerTransport();
53
16
  await server.connect(transport);
54
17
  console.error(`${PACKAGE_INFO.name} v${PACKAGE_INFO.version} started`);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAEnG,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI,EAAE,YAAY,CAAC,IAAI;IACvB,OAAO,EAAE,YAAY,CAAC,OAAO;CAC9B,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF,aAAa;AACb,MAAM,CAAC,iBAAiB,CAAC,sB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AAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * MCP server construction (A-4: McpServer + registerTool + Zod).
3
+ *
4
+ * Kept apart from index.ts so the server can be built without starting a stdio
5
+ * transport — `registry.test.ts` drives it over an in-memory transport to pin the
6
+ * external tool surface. index.ts is left as the entry point that wires it to stdio.
7
+ *
8
+ * Tools come from the definitions.ts registry rather than being registered by hand here,
9
+ * so "what this server exposes" is one list rather than a sequence of calls, and a tool
10
+ * defined without a handler fails loudly at startup instead of at first use.
11
+ */
12
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
13
+ /**
14
+ * Build the MCP server with all tools registered.
15
+ * Does not connect a transport — the caller decides how it is driven.
16
+ */
17
+ export declare function buildServer(): McpServer;
18
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOpE;;;GAGG;AACH,wBAAgB,WAAW,IAAI,SAAS,CA0CvC"}
package/dist/server.js ADDED
@@ -0,0 +1,59 @@
1
+ /**
2
+ * MCP server construction (A-4: McpServer + registerTool + Zod).
3
+ *
4
+ * Kept apart from index.ts so the server can be built without starting a stdio
5
+ * transport — `registry.test.ts` drives it over an in-memory transport to pin the
6
+ * external tool surface. index.ts is left as the entry point that wires it to stdio.
7
+ *
8
+ * Tools come from the definitions.ts registry rather than being registered by hand here,
9
+ * so "what this server exposes" is one list rather than a sequence of calls, and a tool
10
+ * defined without a handler fails loudly at startup instead of at first use.
11
+ */
12
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
13
+ import { PACKAGE_INFO } from './config.js';
14
+ import { toStructuredError } from './errors.js';
15
+ import { tools } from './tools/definitions.js';
16
+ import { toolHandlers } from './tools/handlers.js';
17
+ import { logger } from './utils/logger.js';
18
+ /**
19
+ * Build the MCP server with all tools registered.
20
+ * Does not connect a transport — the caller decides how it is driven.
21
+ */
22
+ export function buildServer() {
23
+ const server = new McpServer({
24
+ name: PACKAGE_INFO.name,
25
+ version: PACKAGE_INFO.version,
26
+ });
27
+ for (const tool of tools) {
28
+ const handler = toolHandlers[tool.name];
29
+ if (!handler) {
30
+ throw new Error(`No handler registered for tool: ${tool.name}`);
31
+ }
32
+ server.registerTool(tool.name, {
33
+ title: tool.title,
34
+ description: tool.description,
35
+ inputSchema: tool.shape,
36
+ annotations: tool.annotations,
37
+ }, async (args) => {
38
+ try {
39
+ const result = await handler(args);
40
+ return {
41
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
42
+ };
43
+ }
44
+ catch (error) {
45
+ // Report failures as an isError result rather than throwing: a thrown error
46
+ // reaches the client as an opaque protocol error, losing the code / hint /
47
+ // next_actions an agent needs to recover (規約 §2.3).
48
+ const structured = toStructuredError(error);
49
+ logger.error(tool.name, structured.error, error instanceof Error ? error : undefined);
50
+ return {
51
+ content: [{ type: 'text', text: JSON.stringify(structured, null, 2) }],
52
+ isError: true,
53
+ };
54
+ }
55
+ });
56
+ }
57
+ return server;
58
+ }
59
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAiB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;;GAGG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,MAAM,GAA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AAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;oBAC/E,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * Results are cached — full comparison runs once, then filtered per request.
13
13
  */
14
- import type { SectionIndex, SectionMapping, UnmatchedSection, CompareVersionsResult } from '../types/index.js';
14
+ import type { CompareVersionsResult, SectionIndex, SectionMapping, UnmatchedSection } from '../types/index.js';
15
15
  export interface FullCompareResult {
16
16
  matched: SectionMapping[];
17
17
  added: UnmatchedSection[];
@@ -1 +1 @@
1
- {"version":3,"file":"compare-service.d.ts","sourceRoot":"","sources":["../../src/services/compare-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EACV,YAAY,EAEZ,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAM3B,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAMD,qBAAa,cAAc;IAGb,OAAO,CAAC,aAAa;IAFjC,OAAO,CAAC,kBAAkB,CAA2C;gBAEjD,aAAa,EAAE;QAAE,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;KAAE;IAE7F;;;OAGG;IACG,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA4CvE;;OAEG;YACW,mBAAmB;CAsFlC;AAMD,eAAO,MAAM,qBAAqB,gBAA0C,CAAC;AAM7E;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,mCAAmD,CAAC"}
1
+ {"version":3,"file":"compare-service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