document-mcp 1.3.11 → 1.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.
package/dist/bin.js CHANGED
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { serveStdio } from "@modelcontextprotocol/server/stdio";
3
3
  import { McpServer } from "@modelcontextprotocol/server";
4
- import { DocumentFormatSchema, OdbReportNotSpecifiedError, OdmUnresolvedSectionError, UnrecognizedDocumentSchemaError, base64ToBytes, buildDocumentBytes, bytesToBase64, createLocalDocumentConverter, decodeOdbPackage, decodePackage, documentFromJson, evaluateSelect, extractSourceFontsForFormat, layoutDocumentWithSchema, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odmToPdf, parseSelect, readDocumentMetadata, readDocxExtras, readOdbForms, readOdbInventory, readOdbReportContent, readOdbReports, readOdbTables, readPdf, setDocumentMetadata } from "documents.js";
4
+ import { DocumentFormatSchema, OdbReportNotSpecifiedError, OdmUnresolvedSectionError, UnrecognizedDocumentSchemaError, base64ToBytes, buildDocumentBytes, bytesToBase64, createLocalDocumentConverter, decodeOdbPackage, decodePackage, describeFontFace, documentFromJson, evaluateSelect, extractSourceFontsForFormat, layoutDocumentWithSchema, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odmToPdf, parseSelect, readDocumentMetadata, readDocxExtras, readOdbForms, readOdbInventory, readOdbReportContent, readOdbReports, readOdbTables, readPdf, setDocumentMetadata } from "documents.js";
5
5
  import { z } from "zod";
6
6
  import { readFile, writeFile } from "node:fs/promises";
7
- import { readFontFace } from "pdf-codec";
8
7
  import { existsSync, readFileSync } from "node:fs";
9
8
  import { basename, join } from "node:path";
10
9
  //#region package.json
11
- var version = "1.3.11";
10
+ var version = "1.4.1";
12
11
  //#endregion
13
12
  //#region src/io/document-input.ts
14
13
  const EXTENSION_TO_FORMAT = {
@@ -252,7 +251,7 @@ function errorResult$1(message) {
252
251
  isError: true
253
252
  };
254
253
  }
255
- /** errorResult's counterpart for a caught exception: UnsupportedFontSourceFormatError (extractSourceFontsForFormat rejecting a format with no source-embedded-font concept -- xlsx/pdf/markdown/odf) and FontFaceParseError (readFontFace rejecting bytes that are not a recognised sfnt font, or a .ttc collection) both carry a self-contained, already-actionable message, so there is nothing to add beyond surfacing it verbatim. */
254
+ /** errorResult's counterpart for a caught exception: UnsupportedFontSourceFormatError (extractSourceFontsForFormat rejecting a format with no source-embedded-font concept -- xlsx/pdf/markdown/odf) and FontFaceParseError (describeFontFace rejecting bytes that are not a recognised sfnt font, or a .ttc collection) both carry a self-contained, already-actionable message, so there is nothing to add beyond surfacing it verbatim. */
256
255
  function toErrorResult$1(error) {
257
256
  return errorResult$1(error instanceof Error ? error.message : String(error));
258
257
  }
@@ -291,7 +290,7 @@ function registerFontTools(server) {
291
290
  }, async ({ source }) => {
292
291
  try {
293
292
  const { bytes, source: label } = await resolveFontFileInput(source);
294
- const face = readFontFace(bytes, label);
293
+ const face = describeFontFace(bytes, label);
295
294
  return jsonResult({
296
295
  family: face.family,
297
296
  bold: face.bold,
package/dist/index.cjs CHANGED
@@ -3,11 +3,10 @@ let _modelcontextprotocol_server = require("@modelcontextprotocol/server");
3
3
  let documents_js = require("documents.js");
4
4
  let zod = require("zod");
5
5
  let node_fs_promises = require("node:fs/promises");
6
- let pdf_codec = require("pdf-codec");
7
6
  let node_fs = require("node:fs");
8
7
  let node_path = require("node:path");
9
8
  //#region package.json
10
- var version = "1.3.11";
9
+ var version = "1.4.1";
11
10
  //#endregion
12
11
  //#region src/io/document-input.ts
13
12
  const EXTENSION_TO_FORMAT = {
@@ -251,7 +250,7 @@ function errorResult$1(message) {
251
250
  isError: true
252
251
  };
253
252
  }
254
- /** errorResult's counterpart for a caught exception: UnsupportedFontSourceFormatError (extractSourceFontsForFormat rejecting a format with no source-embedded-font concept -- xlsx/pdf/markdown/odf) and FontFaceParseError (readFontFace rejecting bytes that are not a recognised sfnt font, or a .ttc collection) both carry a self-contained, already-actionable message, so there is nothing to add beyond surfacing it verbatim. */
253
+ /** errorResult's counterpart for a caught exception: UnsupportedFontSourceFormatError (extractSourceFontsForFormat rejecting a format with no source-embedded-font concept -- xlsx/pdf/markdown/odf) and FontFaceParseError (describeFontFace rejecting bytes that are not a recognised sfnt font, or a .ttc collection) both carry a self-contained, already-actionable message, so there is nothing to add beyond surfacing it verbatim. */
255
254
  function toErrorResult$1(error) {
256
255
  return errorResult$1(error instanceof Error ? error.message : String(error));
257
256
  }
@@ -290,7 +289,7 @@ function registerFontTools(server) {
290
289
  }, async ({ source }) => {
291
290
  try {
292
291
  const { bytes, source: label } = await resolveFontFileInput(source);
293
- const face = (0, pdf_codec.readFontFace)(bytes, label);
292
+ const face = (0, documents_js.describeFontFace)(bytes, label);
294
293
  return jsonResult({
295
294
  family: face.family,
296
295
  bold: face.bold,
package/dist/index.js CHANGED
@@ -1,12 +1,11 @@
1
1
  import { McpServer } from "@modelcontextprotocol/server";
2
- import { DocumentFormatSchema, OdbReportNotSpecifiedError, OdmUnresolvedSectionError, UnrecognizedDocumentSchemaError, base64ToBytes, buildDocumentBytes, bytesToBase64, createLocalDocumentConverter, decodeOdbPackage, decodePackage, documentFromJson, evaluateSelect, extractSourceFontsForFormat, layoutDocumentWithSchema, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odmToPdf, parseSelect, readDocumentMetadata, readDocxExtras, readOdbForms, readOdbInventory, readOdbReportContent, readOdbReports, readOdbTables, readPdf, setDocumentMetadata } from "documents.js";
2
+ import { DocumentFormatSchema, OdbReportNotSpecifiedError, OdmUnresolvedSectionError, UnrecognizedDocumentSchemaError, base64ToBytes, buildDocumentBytes, bytesToBase64, createLocalDocumentConverter, decodeOdbPackage, decodePackage, describeFontFace, documentFromJson, evaluateSelect, extractSourceFontsForFormat, layoutDocumentWithSchema, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odmToPdf, parseSelect, readDocumentMetadata, readDocxExtras, readOdbForms, readOdbInventory, readOdbReportContent, readOdbReports, readOdbTables, readPdf, setDocumentMetadata } from "documents.js";
3
3
  import { z } from "zod";
4
4
  import { readFile, writeFile } from "node:fs/promises";
5
- import { readFontFace } from "pdf-codec";
6
5
  import { existsSync, readFileSync } from "node:fs";
7
6
  import { basename, join } from "node:path";
8
7
  //#region package.json
9
- var version = "1.3.11";
8
+ var version = "1.4.1";
10
9
  //#endregion
11
10
  //#region src/io/document-input.ts
12
11
  const EXTENSION_TO_FORMAT = {
@@ -250,7 +249,7 @@ function errorResult$1(message) {
250
249
  isError: true
251
250
  };
252
251
  }
253
- /** errorResult's counterpart for a caught exception: UnsupportedFontSourceFormatError (extractSourceFontsForFormat rejecting a format with no source-embedded-font concept -- xlsx/pdf/markdown/odf) and FontFaceParseError (readFontFace rejecting bytes that are not a recognised sfnt font, or a .ttc collection) both carry a self-contained, already-actionable message, so there is nothing to add beyond surfacing it verbatim. */
252
+ /** errorResult's counterpart for a caught exception: UnsupportedFontSourceFormatError (extractSourceFontsForFormat rejecting a format with no source-embedded-font concept -- xlsx/pdf/markdown/odf) and FontFaceParseError (describeFontFace rejecting bytes that are not a recognised sfnt font, or a .ttc collection) both carry a self-contained, already-actionable message, so there is nothing to add beyond surfacing it verbatim. */
254
253
  function toErrorResult$1(error) {
255
254
  return errorResult$1(error instanceof Error ? error.message : String(error));
256
255
  }
@@ -289,7 +288,7 @@ function registerFontTools(server) {
289
288
  }, async ({ source }) => {
290
289
  try {
291
290
  const { bytes, source: label } = await resolveFontFileInput(source);
292
- const face = readFontFace(bytes, label);
291
+ const face = describeFontFace(bytes, label);
293
292
  return jsonResult({
294
293
  family: face.family,
295
294
  bold: face.bold,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document-mcp",
3
- "version": "1.3.11",
3
+ "version": "1.4.1",
4
4
  "description": "MCP (Model Context Protocol) server exposing documents.js's document-conversion, .odb, metadata, and font tooling as MCP tools.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -48,15 +48,22 @@
48
48
  "node": ">=20"
49
49
  },
50
50
  "scripts": {
51
- "build": "tsdown",
51
+ "build": "turbo run _build",
52
+ "_build": "tsdown",
52
53
  "prepublishOnly": "pnpm run lint && pnpm run typecheck && tsdown && publint && attw --pack",
53
- "lint": "eslint . --fix --cache --max-warnings 0",
54
- "typecheck": "tsc --noEmit",
55
- "test": "vitest run --project unit",
56
- "test:workers": "vitest run --config vitest.workers.config.ts",
54
+ "lint": "turbo run _lint",
55
+ "_lint": "eslint . --fix --cache --max-warnings 0",
56
+ "typecheck": "turbo run _typecheck",
57
+ "_typecheck": "tsc --noEmit",
58
+ "test": "turbo run _test",
59
+ "_test": "vitest run --project unit",
60
+ "test:workers": "turbo run _test:workers",
61
+ "_test:workers": "vitest run --config vitest.workers.config.ts",
57
62
  "test:watch": "vitest --project unit",
58
- "test:coverage": "vitest run --project unit --coverage",
59
- "test:smoke": "tsdown && vitest run --project smoke",
63
+ "test:coverage": "turbo run _test:coverage",
64
+ "_test:coverage": "vitest run --project unit --coverage",
65
+ "test:smoke": "turbo run _test:smoke",
66
+ "_test:smoke": "tsdown && vitest run --project smoke",
60
67
  "prepare": "husky",
61
68
  "release": "semantic-release"
62
69
  },
@@ -78,8 +85,7 @@
78
85
  "packageManager": "pnpm@11.6.0",
79
86
  "dependencies": {
80
87
  "@modelcontextprotocol/server": "^2.0.0",
81
- "documents.js": "^1.94.0",
82
- "pdf-codec": "^2.0.0",
88
+ "documents.js": "^1.95.1",
83
89
  "zod": "^4.2.0"
84
90
  },
85
91
  "devDependencies": {
@@ -98,9 +104,11 @@
98
104
  "husky": "^9.1.7",
99
105
  "lint-staged": "^17.3.0",
100
106
  "odf.js": "^2.3.1",
107
+ "pdf-codec": "^2.1.1",
101
108
  "publint": "^0.3.22",
102
109
  "semantic-release": "^25.0.8",
103
110
  "tsdown": "^0.22.14",
111
+ "turbo": "^2.10.8",
104
112
  "typescript": "^6.0.3",
105
113
  "typescript-eslint": "^8.65.0",
106
114
  "vitest": "^4.1.10"