@cyanheads/mcp-ts-core 0.11.2 → 0.11.4
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/AGENTS.md +14 -10
- package/CLAUDE.md +14 -10
- package/README.md +3 -3
- package/changelog/0.11.x/0.11.3.md +49 -0
- package/changelog/0.11.x/0.11.4.md +67 -0
- package/dist/config/index.d.ts +0 -10
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -25
- package/dist/config/index.js.map +1 -1
- package/dist/config/logLevelAlias.d.ts +15 -0
- package/dist/config/logLevelAlias.d.ts.map +1 -0
- package/dist/config/logLevelAlias.js +30 -0
- package/dist/config/logLevelAlias.js.map +1 -0
- package/dist/core/context.d.ts +10 -0
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +10 -1
- package/dist/core/context.js.map +1 -1
- package/dist/core/worker.js +1 -1
- package/dist/core/worker.js.map +1 -1
- package/dist/linter/rules/enrichment-rules.d.ts +3 -2
- package/dist/linter/rules/enrichment-rules.d.ts.map +1 -1
- package/dist/linter/rules/enrichment-rules.js +35 -7
- package/dist/linter/rules/enrichment-rules.js.map +1 -1
- package/dist/linter/rules/format-parity-rules.d.ts +8 -4
- package/dist/linter/rules/format-parity-rules.d.ts.map +1 -1
- package/dist/linter/rules/format-parity-rules.js +72 -20
- package/dist/linter/rules/format-parity-rules.js.map +1 -1
- package/dist/linter/rules/index.d.ts +1 -1
- package/dist/linter/rules/index.d.ts.map +1 -1
- package/dist/linter/rules/index.js +1 -1
- package/dist/linter/rules/index.js.map +1 -1
- package/dist/linter/rules/prompt-rules.d.ts.map +1 -1
- package/dist/linter/rules/prompt-rules.js +6 -3
- package/dist/linter/rules/prompt-rules.js.map +1 -1
- package/dist/linter/rules/resource-rules.d.ts.map +1 -1
- package/dist/linter/rules/resource-rules.js +11 -5
- package/dist/linter/rules/resource-rules.js.map +1 -1
- package/dist/linter/rules/schema-rules.d.ts +21 -2
- package/dist/linter/rules/schema-rules.d.ts.map +1 -1
- package/dist/linter/rules/schema-rules.js +110 -2
- package/dist/linter/rules/schema-rules.js.map +1 -1
- package/dist/linter/rules/tool-rules.d.ts.map +1 -1
- package/dist/linter/rules/tool-rules.js +11 -5
- package/dist/linter/rules/tool-rules.js.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +44 -10
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts +10 -10
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts.map +1 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js +29 -24
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js.map +1 -1
- package/dist/storage/core/storageValidation.d.ts +4 -4
- package/dist/storage/core/storageValidation.d.ts.map +1 -1
- package/dist/storage/core/storageValidation.js +4 -20
- package/dist/storage/core/storageValidation.js.map +1 -1
- package/dist/testing/fuzz.d.ts.map +1 -1
- package/dist/testing/fuzz.js +57 -2
- package/dist/testing/fuzz.js.map +1 -1
- package/dist/testing/index.d.ts +45 -13
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +29 -76
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/vitest.d.ts +1 -1
- package/dist/utils/formatting/diffFormatter.d.ts +5 -5
- package/dist/utils/formatting/diffFormatter.d.ts.map +1 -1
- package/dist/utils/formatting/diffFormatter.js +1 -1
- package/dist/utils/formatting/diffFormatter.js.map +1 -1
- package/dist/utils/formatting/tableFormatter.d.ts +3 -3
- package/dist/utils/formatting/tableFormatter.d.ts.map +1 -1
- package/dist/utils/formatting/tableFormatter.js +1 -1
- package/dist/utils/formatting/tableFormatter.js.map +1 -1
- package/dist/utils/formatting/treeFormatter.d.ts +3 -3
- package/dist/utils/formatting/treeFormatter.d.ts.map +1 -1
- package/dist/utils/formatting/treeFormatter.js +1 -1
- package/dist/utils/formatting/treeFormatter.js.map +1 -1
- package/dist/utils/metrics/tokenCounter.d.ts +3 -3
- package/dist/utils/metrics/tokenCounter.d.ts.map +1 -1
- package/dist/utils/metrics/tokenCounter.js.map +1 -1
- package/dist/utils/network/fetchWithTimeout.d.ts +43 -15
- package/dist/utils/network/fetchWithTimeout.d.ts.map +1 -1
- package/dist/utils/network/fetchWithTimeout.js +163 -44
- package/dist/utils/network/fetchWithTimeout.js.map +1 -1
- package/dist/utils/network/httpError.d.ts.map +1 -1
- package/dist/utils/network/httpError.js +1 -2
- package/dist/utils/network/httpError.js.map +1 -1
- package/dist/utils/network/responseBody.d.ts +27 -7
- package/dist/utils/network/responseBody.d.ts.map +1 -1
- package/dist/utils/network/responseBody.js +54 -13
- package/dist/utils/network/responseBody.js.map +1 -1
- package/dist/utils/network/retry.d.ts +2 -2
- package/dist/utils/network/retry.d.ts.map +1 -1
- package/dist/utils/overflow/outlineOnOverflow.d.ts +4 -3
- package/dist/utils/overflow/outlineOnOverflow.d.ts.map +1 -1
- package/dist/utils/overflow/outlineOnOverflow.js +27 -8
- package/dist/utils/overflow/outlineOnOverflow.js.map +1 -1
- package/dist/utils/pagination/pagination.d.ts +3 -3
- package/dist/utils/pagination/pagination.d.ts.map +1 -1
- package/dist/utils/pagination/pagination.js.map +1 -1
- package/dist/utils/parsing/csvParser.d.ts +2 -2
- package/dist/utils/parsing/csvParser.d.ts.map +1 -1
- package/dist/utils/parsing/csvParser.js +1 -1
- package/dist/utils/parsing/csvParser.js.map +1 -1
- package/dist/utils/parsing/dateParser.d.ts +11 -7
- package/dist/utils/parsing/dateParser.d.ts.map +1 -1
- package/dist/utils/parsing/dateParser.js +8 -4
- package/dist/utils/parsing/dateParser.js.map +1 -1
- package/dist/utils/parsing/frontmatterParser.d.ts +5 -4
- package/dist/utils/parsing/frontmatterParser.d.ts.map +1 -1
- package/dist/utils/parsing/frontmatterParser.js +5 -4
- package/dist/utils/parsing/frontmatterParser.js.map +1 -1
- package/dist/utils/parsing/htmlExtractor.d.ts +5 -4
- package/dist/utils/parsing/htmlExtractor.d.ts.map +1 -1
- package/dist/utils/parsing/htmlExtractor.js +4 -3
- package/dist/utils/parsing/htmlExtractor.js.map +1 -1
- package/dist/utils/parsing/inputBudget.d.ts +18 -11
- package/dist/utils/parsing/inputBudget.d.ts.map +1 -1
- package/dist/utils/parsing/inputBudget.js +20 -17
- package/dist/utils/parsing/inputBudget.js.map +1 -1
- package/dist/utils/parsing/jsonParser.d.ts +5 -4
- package/dist/utils/parsing/jsonParser.d.ts.map +1 -1
- package/dist/utils/parsing/jsonParser.js +5 -4
- package/dist/utils/parsing/jsonParser.js.map +1 -1
- package/dist/utils/parsing/pdfParser.d.ts +38 -24
- package/dist/utils/parsing/pdfParser.d.ts.map +1 -1
- package/dist/utils/parsing/pdfParser.js +42 -31
- package/dist/utils/parsing/pdfParser.js.map +1 -1
- package/dist/utils/parsing/xmlParser.d.ts +3 -3
- package/dist/utils/parsing/xmlParser.d.ts.map +1 -1
- package/dist/utils/parsing/xmlParser.js +3 -6
- package/dist/utils/parsing/xmlParser.js.map +1 -1
- package/dist/utils/parsing/yamlParser.d.ts +3 -3
- package/dist/utils/parsing/yamlParser.d.ts.map +1 -1
- package/dist/utils/parsing/yamlParser.js +3 -3
- package/dist/utils/parsing/yamlParser.js.map +1 -1
- package/dist/utils/security/rateLimiter.d.ts +2 -2
- package/dist/utils/security/rateLimiter.d.ts.map +1 -1
- package/dist/utils/security/rateLimiter.js +1 -1
- package/dist/utils/security/rateLimiter.js.map +1 -1
- package/dist/utils/telemetry/trace.d.ts +3 -3
- package/dist/utils/telemetry/trace.d.ts.map +1 -1
- package/dist/utils/telemetry/trace.js.map +1 -1
- package/package.json +1 -1
- package/scripts/tree.ts +9 -3
- package/skills/add-test/SKILL.md +2 -2
- package/skills/api-auth/SKILL.md +5 -5
- package/skills/api-context/SKILL.md +14 -12
- package/skills/api-linter/SKILL.md +59 -5
- package/skills/api-testing/SKILL.md +31 -10
- package/skills/api-utils/SKILL.md +4 -2
- package/skills/api-utils/references/parsing.md +3 -2
- package/skills/setup/SKILL.md +6 -3
- package/skills/techniques/SKILL.md +1 -1
- package/skills/techniques/references/outline-on-overflow.md +3 -1
- package/templates/AGENTS.md +1 -1
- package/templates/CLAUDE.md +1 -1
- package/templates/Dockerfile +7 -2
- package/templates/_tsconfig.build.json +5 -0
- package/templates/_tsconfig.json +4 -2
- package/templates/package.json +1 -0
- package/templates/tests/prompts/echo.prompt.test.ts +4 -3
- package/templates/tests/resources/echo.resource.test.ts +11 -3
- package/templates/tests/smoke/definitions.smoke.test.ts +8 -4
- package/templates/tests/tools/echo.tool.test.ts +23 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { McpError, validationError } from '../../types-global/errors.js';
|
|
2
2
|
import { lazyImport } from '../../utils/internal/lazyImport.js';
|
|
3
3
|
import { logger } from '../../utils/internal/logger.js';
|
|
4
|
-
import { requestContextService } from '../../utils/internal/requestContext.js';
|
|
4
|
+
import { requestContextService, } from '../../utils/internal/requestContext.js';
|
|
5
5
|
import { assertTextInputBudget } from './inputBudget.js';
|
|
6
6
|
const getDefuddle = lazyImport(() => import('defuddle/node'), 'Install "defuddle" to use HTML article extraction: bun add defuddle linkedom');
|
|
7
7
|
const getLinkedom = lazyImport(() => import('linkedom'), 'Install "linkedom" to use HTML article extraction: bun add defuddle linkedom');
|
|
@@ -43,7 +43,8 @@ export class HtmlExtractor {
|
|
|
43
43
|
*
|
|
44
44
|
* @param html - Raw HTML string to extract from.
|
|
45
45
|
* @param options - Optional extraction options (format, URL, content selector, etc.).
|
|
46
|
-
* @param context - Optional
|
|
46
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
47
|
+
* handler `Context` is accepted directly.
|
|
47
48
|
* @returns Extracted content and metadata. Only `content` is guaranteed to
|
|
48
49
|
* be present; all other fields are best-effort.
|
|
49
50
|
* @throws {McpError} With `ConfigurationError` if `defuddle` or `linkedom` is not installed.
|
|
@@ -142,7 +143,7 @@ export class HtmlExtractor {
|
|
|
142
143
|
...logContext,
|
|
143
144
|
errorDetails: error.message,
|
|
144
145
|
});
|
|
145
|
-
throw validationError(
|
|
146
|
+
throw validationError(`Failed to extract article from HTML: ${error.message}`, { reason: 'html_extract_failed' }, { cause: error });
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
149
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlExtractor.js","sourceRoot":"","sources":["../../../src/utils/parsing/htmlExtractor.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"htmlExtractor.js","sourceRoot":"","sources":["../../../src/utils/parsing/htmlExtractor.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAGL,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,WAAW,GAAG,UAAU,CAC5B,GAAG,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,EAC7B,8EAA8E,CAC/E,CAAC;AAEF,MAAM,WAAW,GAAG,UAAU,CAC5B,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EACxB,8EAA8E,CAC/E,CAAC;AAUF;;;sCAGsC;AACtC,SAAS,eAAe,CACtB,IAAuC;IAEvC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACvC,M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E,MAAM,CAAC,CAAC;YACnC,MAAM,KAAK,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,MAAM,CAAC,KAAK,CAAC,sCAAsC,EAAE;gBACnD,GAAG,UAAU;gBACb,YAAY,EAAE,KAAK,CAAC,OAAO;aAC5B,CAAC,CAAC;YACH,MAAM,eAAe,CACnB,wCAAwC,KAAK,CAAC,OAAO,EAAE,EACvD,EAAE,MAAM,EAAE,qBAAqB,EAAE,EACjC,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* @fileoverview Opt-in input byte budgets shared by the parsing utilities. A
|
|
3
|
+
* parser is unbounded unless its caller supplies `maxBytes`: the input is
|
|
4
|
+
* already resident in memory by the time a parser sees it, so a budget is a
|
|
5
|
+
* caller's work-shaping knob rather than a trust boundary.
|
|
5
6
|
* @module src/utils/parsing/inputBudget
|
|
6
7
|
*/
|
|
7
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Suggested UTF-8 input budget for text parsers (1 MiB). Not applied unless a
|
|
10
|
+
* caller passes it as `maxBytes`.
|
|
11
|
+
*/
|
|
8
12
|
export declare const DEFAULT_TEXT_PARSER_MAX_BYTES: number;
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Suggested input budget for binary parsers (25 MiB). Not applied unless a
|
|
15
|
+
* caller passes it as `maxBytes`.
|
|
16
|
+
*/
|
|
10
17
|
export declare const DEFAULT_BINARY_PARSER_MAX_BYTES: number;
|
|
11
18
|
/**
|
|
12
|
-
* Caller override for a parser's input budget.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
19
|
+
* Caller override for a parser's input budget. Omit `maxBytes` for no bound;
|
|
20
|
+
* {@link DEFAULT_TEXT_PARSER_MAX_BYTES} and
|
|
21
|
+
* {@link DEFAULT_BINARY_PARSER_MAX_BYTES} are starting points for a caller that
|
|
22
|
+
* wants one.
|
|
16
23
|
*/
|
|
17
24
|
export interface ParserInputBudgetOptions {
|
|
18
25
|
maxBytes?: number;
|
|
19
26
|
}
|
|
20
27
|
/** Return the UTF-8 byte length without allocating a second copy of the input. */
|
|
21
28
|
export declare function utf8ByteLength(input: string): number;
|
|
22
|
-
/** Assert a text input fits
|
|
29
|
+
/** Assert a text input fits any budget the caller declared. Returns its UTF-8 byte length. */
|
|
23
30
|
export declare function assertTextInputBudget(input: string, options?: ParserInputBudgetOptions): number;
|
|
24
|
-
/** Assert a binary input fits
|
|
31
|
+
/** Assert a binary input fits any budget the caller declared. Returns its byte length. */
|
|
25
32
|
export declare function assertBinaryInputBudget(input: Uint8Array | ArrayBuffer, options?: ParserInputBudgetOptions): number;
|
|
26
33
|
/** Assert a set of binary inputs fits one shared budget. Returns their combined byte length. */
|
|
27
34
|
export declare function assertBinaryInputsBudget(inputs: readonly (Uint8Array | ArrayBuffer)[], options?: ParserInputBudgetOptions): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputBudget.d.ts","sourceRoot":"","sources":["../../../src/utils/parsing/inputBudget.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inputBudget.d.ts","sourceRoot":"","sources":["../../../src/utils/parsing/inputBudget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;GAGG;AACH,eAAO,MAAM,6BAA6B,QAAc,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,+BAA+B,QAAmB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAeD,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAyBpD;AAcD,8FAA8F;AAC9F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,MAAM,CAE/F;AAED,0FAA0F;AAC1F,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,UAAU,GAAG,WAAW,EAC/B,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,CAER;AAED,gGAAgG;AAChG,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,CAAC,UAAU,GAAG,WAAW,CAAC,EAAE,EAC7C,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,CAGR"}
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* @fileoverview Opt-in input byte budgets shared by the parsing utilities. A
|
|
3
|
+
* parser is unbounded unless its caller supplies `maxBytes`: the input is
|
|
4
|
+
* already resident in memory by the time a parser sees it, so a budget is a
|
|
5
|
+
* caller's work-shaping knob rather than a trust boundary.
|
|
5
6
|
* @module src/utils/parsing/inputBudget
|
|
6
7
|
*/
|
|
7
8
|
import { validationError } from '../../types-global/errors.js';
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Suggested UTF-8 input budget for text parsers (1 MiB). Not applied unless a
|
|
11
|
+
* caller passes it as `maxBytes`.
|
|
12
|
+
*/
|
|
9
13
|
export const DEFAULT_TEXT_PARSER_MAX_BYTES = 1024 * 1024;
|
|
10
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Suggested input budget for binary parsers (25 MiB). Not applied unless a
|
|
16
|
+
* caller passes it as `maxBytes`.
|
|
17
|
+
*/
|
|
11
18
|
export const DEFAULT_BINARY_PARSER_MAX_BYTES = 25 * 1024 * 1024;
|
|
12
|
-
function resolveLimit(options
|
|
19
|
+
function resolveLimit(options) {
|
|
13
20
|
const requested = options?.maxBytes;
|
|
14
21
|
if (requested === undefined)
|
|
15
|
-
return
|
|
22
|
+
return;
|
|
16
23
|
if (!Number.isSafeInteger(requested) || requested < 1) {
|
|
17
24
|
throw validationError('Parser input byte limit must be a positive safe integer.', {
|
|
18
25
|
reason: 'parser_input_limit_invalid',
|
|
19
|
-
limitBytes: defaultLimit,
|
|
20
26
|
});
|
|
21
27
|
}
|
|
22
28
|
return requested;
|
|
@@ -48,7 +54,7 @@ export function utf8ByteLength(input) {
|
|
|
48
54
|
return bytes;
|
|
49
55
|
}
|
|
50
56
|
function assertWithinLimit(sizeBytes, limitBytes) {
|
|
51
|
-
if (sizeBytes > limitBytes) {
|
|
57
|
+
if (limitBytes !== undefined && sizeBytes > limitBytes) {
|
|
52
58
|
throw validationError('Parser input exceeds the maximum allowed byte size.', {
|
|
53
59
|
reason: 'parser_input_too_large',
|
|
54
60
|
sizeBytes,
|
|
@@ -57,20 +63,17 @@ function assertWithinLimit(sizeBytes, limitBytes) {
|
|
|
57
63
|
}
|
|
58
64
|
return sizeBytes;
|
|
59
65
|
}
|
|
60
|
-
/** Assert a text input fits
|
|
66
|
+
/** Assert a text input fits any budget the caller declared. Returns its UTF-8 byte length. */
|
|
61
67
|
export function assertTextInputBudget(input, options) {
|
|
62
|
-
|
|
63
|
-
return assertWithinLimit(utf8ByteLength(input), limitBytes);
|
|
68
|
+
return assertWithinLimit(utf8ByteLength(input), resolveLimit(options));
|
|
64
69
|
}
|
|
65
|
-
/** Assert a binary input fits
|
|
70
|
+
/** Assert a binary input fits any budget the caller declared. Returns its byte length. */
|
|
66
71
|
export function assertBinaryInputBudget(input, options) {
|
|
67
|
-
|
|
68
|
-
return assertWithinLimit(input.byteLength, limitBytes);
|
|
72
|
+
return assertWithinLimit(input.byteLength, resolveLimit(options));
|
|
69
73
|
}
|
|
70
74
|
/** Assert a set of binary inputs fits one shared budget. Returns their combined byte length. */
|
|
71
75
|
export function assertBinaryInputsBudget(inputs, options) {
|
|
72
|
-
const limitBytes = resolveLimit(options, DEFAULT_BINARY_PARSER_MAX_BYTES);
|
|
73
76
|
const sizeBytes = inputs.reduce((total, input) => total + input.byteLength, 0);
|
|
74
|
-
return assertWithinLimit(sizeBytes,
|
|
77
|
+
return assertWithinLimit(sizeBytes, resolveLimit(options));
|
|
75
78
|
}
|
|
76
79
|
//# sourceMappingURL=inputBudget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputBudget.js","sourceRoot":"","sources":["../../../src/utils/parsing/inputBudget.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inputBudget.js","sourceRoot":"","sources":["../../../src/utils/parsing/inputBudget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAYhE,SAAS,YAAY,CAAC,OAA6C;IACjE,MAAM,SAAS,GAAG,OAAO,EAAE,QAAQ,CAAC;IACpC,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO;IAEpC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;QACtD,MAAM,eAAe,CAAC,0DAA0D,EAAE;YAChF,MAAM,EAAE,4BAA4B;SACrC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAA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BAAiB,CAAC,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,wBAAwB,CACtC,MAA6C,EAC7C,OAAkC;IAElC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC/E,OAAO,iBAAiB,CAAC,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RequestContext } from '../../utils/internal/requestContext.js';
|
|
1
|
+
import { type RequestContext, type RequestContextLike } from '../../utils/internal/requestContext.js';
|
|
2
2
|
import { type ParserInputBudgetOptions } from './inputBudget.js';
|
|
3
3
|
/**
|
|
4
4
|
* Bit flags specifying which partial JSON types are permissible during parsing.
|
|
@@ -68,8 +68,9 @@ export declare class JsonParser {
|
|
|
68
68
|
* and/or be a partial (incomplete) JSON value.
|
|
69
69
|
* @param allowPartial - Bitwise OR combination of `Allow` flags controlling which
|
|
70
70
|
* partial JSON types are accepted. Defaults to `Allow.ALL`.
|
|
71
|
-
* @param context - Optional
|
|
72
|
-
*
|
|
71
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
72
|
+
* handler `Context` is accepted directly.
|
|
73
|
+
* @param budget - Optional UTF-8 byte budget for the input. Unbounded when omitted.
|
|
73
74
|
* @returns The parsed JavaScript value cast to `T`.
|
|
74
75
|
* @throws {McpError} With `ValidationError` if the string is empty after stripping the
|
|
75
76
|
* `<think>` block and trimming, or if `partial-json` fails to parse the content.
|
|
@@ -88,7 +89,7 @@ export declare class JsonParser {
|
|
|
88
89
|
* console.log(result); // { items: [1, 2] }
|
|
89
90
|
* ```
|
|
90
91
|
*/
|
|
91
|
-
parse<T = unknown>(jsonString: string, allowPartial?: number, context?: RequestContext, budget?: ParserInputBudgetOptions): Promise<T>;
|
|
92
|
+
parse<T = unknown>(jsonString: string, allowPartial?: number, context?: RequestContextLike | RequestContext, budget?: ParserInputBudgetOptions): Promise<T>;
|
|
92
93
|
}
|
|
93
94
|
/**
|
|
94
95
|
* Singleton instance of `JsonParser`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonParser.d.ts","sourceRoot":"","sources":["../../../src/utils/parsing/jsonParser.ts"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"jsonParser.d.ts","sourceRoot":"","sources":["../../../src/utils/parsing/jsonParser.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EAExB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAyB,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAQxF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,KAAK;IAChB,6BAA6B;aAC7B,GAAG,EAAE,CAAG;IACR,6BAA6B;aAC7B,GAAG,EAAE,CAAG;IACR,4BAA4B;aAC5B,GAAG,EAAE,CAAG;IACR,6BAA6B;aAC7B,GAAG,EAAE,CAAG;IACR,iCAAiC;aACjC,IAAI,EAAE,EAAI;IACV,8BAA8B;aAC9B,IAAI,EAAE,EAAI;IACV,wBAAwB;aACxB,GAAG,EAAE,EAAI;IACT,+BAA+B;aAC/B,QAAQ,EAAE,GAAI;IACd,+BAA+B;aAC/B,SAAS,EAAE,GAAK;IAChB,0EAA0E;aAC1E,GAAG;IACH,sEAAsE;aACtE,OAAO;IACP,8EAA8E;aAC9E,IAAI;IACJ,8CAA8C;aAC9C,UAAU;IACV,+BAA+B;aAC/B,GAAG;CACK,CAAC;AAEX;;;;;;;GAOG;AACH,qBAAa,UAAU;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACG,KAAK,CAAC,CAAC,GAAG,OAAO,EACrB,UAAU,EAAE,MAAM,EAClB,YAAY,GAAE,MAAkB,EAChC,OAAO,CAAC,EAAE,kBAAkB,GAAG,cAAc,EAC7C,MAAM,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,CAAC,CAAC,CAyDZ;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,UAAU,YAAmB,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { validationError } from '../../types-global/errors.js';
|
|
8
8
|
import { lazyImport } from '../../utils/internal/lazyImport.js';
|
|
9
9
|
import { logger } from '../../utils/internal/logger.js';
|
|
10
|
-
import { requestContextService } from '../../utils/internal/requestContext.js';
|
|
10
|
+
import { requestContextService, } from '../../utils/internal/requestContext.js';
|
|
11
11
|
import { assertTextInputBudget } from './inputBudget.js';
|
|
12
12
|
import { thinkBlockRegex } from './thinkBlock.js';
|
|
13
13
|
const getPartialJson = lazyImport(() => import('partial-json'), 'Install "partial-json" to use partial JSON parsing: bun add partial-json');
|
|
@@ -79,8 +79,9 @@ export class JsonParser {
|
|
|
79
79
|
* and/or be a partial (incomplete) JSON value.
|
|
80
80
|
* @param allowPartial - Bitwise OR combination of `Allow` flags controlling which
|
|
81
81
|
* partial JSON types are accepted. Defaults to `Allow.ALL`.
|
|
82
|
-
* @param context - Optional
|
|
83
|
-
*
|
|
82
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
83
|
+
* handler `Context` is accepted directly.
|
|
84
|
+
* @param budget - Optional UTF-8 byte budget for the input. Unbounded when omitted.
|
|
84
85
|
* @returns The parsed JavaScript value cast to `T`.
|
|
85
86
|
* @throws {McpError} With `ValidationError` if the string is empty after stripping the
|
|
86
87
|
* `<think>` block and trimming, or if `partial-json` fails to parse the content.
|
|
@@ -140,7 +141,7 @@ export class JsonParser {
|
|
|
140
141
|
errorDetails: error.message,
|
|
141
142
|
contentAttempted: stringToParse.substring(0, 200),
|
|
142
143
|
});
|
|
143
|
-
throw validationError(
|
|
144
|
+
throw validationError(`Failed to parse JSON content: ${error.message}`, { reason: 'json_parse_failed' }, { cause: error });
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonParser.js","sourceRoot":"","sources":["../../../src/utils/parsing/jsonParser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"jsonParser.js","sourceRoot":"","sources":["../../../src/utils/parsing/jsonParser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAGL,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAiC,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,cAAc,GAAG,UAAU,CAC/B,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,EAC5B,0EAA0E,CAC3E,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,6BAA6B;IAC7B,GAAG,EAAE,GAAG;IACR,6BAA6B;IAC7B,GAAG,EAAE,GAAG;IACR,4BAA4B;IAC5B,GAAG,EAAE,GAAG;IACR,6BAA6B;IAC7B,GAAG,EAAE,GAAG;IACR,iCAAiC;IACjC,IAAI,EAAE,IAAI;IACV,8BAA8B;IAC9B,IAAI,EAAE,IAAI;IACV,wBAAwB;IACx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AAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @module src/utils/parsing/pdfParser
|
|
6
6
|
*/
|
|
7
7
|
import type { PDFDocument, PDFFont, PDFImage, PDFPage, RGB } from 'pdf-lib';
|
|
8
|
-
import { type RequestContext } from '../../utils/internal/requestContext.js';
|
|
8
|
+
import { type RequestContext, type RequestContextLike } from '../../utils/internal/requestContext.js';
|
|
9
9
|
import { type ParserInputBudgetOptions } from './inputBudget.js';
|
|
10
10
|
/**
|
|
11
11
|
* Options for adding a new page to a PDF document.
|
|
@@ -74,7 +74,7 @@ export interface EmbedImageOptions {
|
|
|
74
74
|
* Image data as Uint8Array or ArrayBuffer.
|
|
75
75
|
*/
|
|
76
76
|
imageBytes: Uint8Array | ArrayBuffer;
|
|
77
|
-
/** Input budget in bytes.
|
|
77
|
+
/** Input budget in bytes. Unbounded when omitted. */
|
|
78
78
|
maxBytes?: number;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
@@ -211,8 +211,13 @@ export interface FillFormOptions {
|
|
|
211
211
|
* Options for extracting text from a PDF document.
|
|
212
212
|
*/
|
|
213
213
|
export interface ExtractTextOptions {
|
|
214
|
-
/** Input budget in bytes.
|
|
214
|
+
/** Input budget in bytes. Unbounded when omitted. */
|
|
215
215
|
maxBytes?: number;
|
|
216
|
+
/**
|
|
217
|
+
* Ceiling in pixels on a single decoded image, forwarded to pdf.js as
|
|
218
|
+
* `maxImageSize`. Unbounded when omitted, matching pdf.js's own default.
|
|
219
|
+
*/
|
|
220
|
+
maxImageSize?: number;
|
|
216
221
|
/**
|
|
217
222
|
* Whether to merge all pages into a single string.
|
|
218
223
|
* If true, returns text as a single string.
|
|
@@ -250,7 +255,8 @@ export declare class PdfParser {
|
|
|
250
255
|
*
|
|
251
256
|
* Async due to lazy loading of the `pdf-lib` peer dependency (`bun add pdf-lib`).
|
|
252
257
|
*
|
|
253
|
-
* @param context - Optional
|
|
258
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
259
|
+
* handler `Context` is accepted directly.
|
|
254
260
|
* @returns A new empty `PDFDocument` instance.
|
|
255
261
|
* @throws {McpError} With `ConfigurationError` if `pdf-lib` is not installed.
|
|
256
262
|
* @throws {McpError} With `InternalError` if document creation fails.
|
|
@@ -260,15 +266,16 @@ export declare class PdfParser {
|
|
|
260
266
|
* const page = pdfParser.addPage(doc);
|
|
261
267
|
* ```
|
|
262
268
|
*/
|
|
263
|
-
createDocument(context?: RequestContext): Promise<PDFDocument>;
|
|
269
|
+
createDocument(context?: RequestContextLike | RequestContext): Promise<PDFDocument>;
|
|
264
270
|
/**
|
|
265
271
|
* Loads an existing PDF document from raw bytes.
|
|
266
272
|
*
|
|
267
273
|
* Async due to lazy loading of the `pdf-lib` peer dependency (`bun add pdf-lib`).
|
|
268
274
|
*
|
|
269
275
|
* @param pdfBytes - The PDF file contents as `Uint8Array` or `ArrayBuffer`.
|
|
270
|
-
* @param context - Optional
|
|
271
|
-
*
|
|
276
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
277
|
+
* handler `Context` is accepted directly.
|
|
278
|
+
* @param budget - Optional byte budget for the input. Unbounded when omitted.
|
|
272
279
|
* @returns The loaded `PDFDocument` instance.
|
|
273
280
|
* @throws {McpError} With `ConfigurationError` if `pdf-lib` is not installed.
|
|
274
281
|
* @throws {McpError} With `ValidationError` if the bytes are not a valid PDF.
|
|
@@ -279,7 +286,7 @@ export declare class PdfParser {
|
|
|
279
286
|
* const doc = await pdfParser.loadDocument(pdfBytes);
|
|
280
287
|
* ```
|
|
281
288
|
*/
|
|
282
|
-
loadDocument(pdfBytes: Uint8Array | ArrayBuffer, context?: RequestContext, budget?: ParserInputBudgetOptions): Promise<PDFDocument>;
|
|
289
|
+
loadDocument(pdfBytes: Uint8Array | ArrayBuffer, context?: RequestContextLike | RequestContext, budget?: ParserInputBudgetOptions): Promise<PDFDocument>;
|
|
283
290
|
/**
|
|
284
291
|
* Adds a new blank page to a PDF document.
|
|
285
292
|
*
|
|
@@ -303,7 +310,8 @@ export declare class PdfParser {
|
|
|
303
310
|
*
|
|
304
311
|
* @param doc - The `PDFDocument` to embed the font into.
|
|
305
312
|
* @param fontName - A `StandardFonts` key. Defaults to `'Helvetica'`.
|
|
306
|
-
* @param context - Optional
|
|
313
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
314
|
+
* handler `Context` is accepted directly.
|
|
307
315
|
* @returns The embedded `PDFFont` ready to pass to `drawText`.
|
|
308
316
|
* @throws {McpError} With `ConfigurationError` if `pdf-lib` is not installed.
|
|
309
317
|
* @throws {McpError} With `InternalError` if the font name is invalid or embedding fails.
|
|
@@ -312,7 +320,7 @@ export declare class PdfParser {
|
|
|
312
320
|
* const font = await pdfParser.embedFont(doc, 'TimesRoman');
|
|
313
321
|
* ```
|
|
314
322
|
*/
|
|
315
|
-
embedFont(doc: PDFDocument, fontName?: string, context?: RequestContext): Promise<PDFFont>;
|
|
323
|
+
embedFont(doc: PDFDocument, fontName?: string, context?: RequestContextLike | RequestContext): Promise<PDFFont>;
|
|
316
324
|
/**
|
|
317
325
|
* Embeds a PNG or JPEG image into a PDF document for later rendering.
|
|
318
326
|
*
|
|
@@ -321,7 +329,8 @@ export declare class PdfParser {
|
|
|
321
329
|
*
|
|
322
330
|
* @param doc - The `PDFDocument` to embed the image into.
|
|
323
331
|
* @param options - Image bytes and format (`'png'` or `'jpg'`).
|
|
324
|
-
* @param context - Optional
|
|
332
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
333
|
+
* handler `Context` is accepted directly.
|
|
325
334
|
* @returns The embedded `PDFImage`, usable as the `image` option in `drawImage`.
|
|
326
335
|
* @throws {McpError} With `ConfigurationError` if `pdf-lib` is not installed.
|
|
327
336
|
* @throws {McpError} With `InternalError` if the image data is invalid or embedding fails.
|
|
@@ -333,7 +342,7 @@ export declare class PdfParser {
|
|
|
333
342
|
* pdfParser.drawImage(page, { image, x: 50, y: 700, width: 100, height: 50 });
|
|
334
343
|
* ```
|
|
335
344
|
*/
|
|
336
|
-
embedImage(doc: PDFDocument, options: EmbedImageOptions, context?: RequestContext): Promise<PDFImage>;
|
|
345
|
+
embedImage(doc: PDFDocument, options: EmbedImageOptions, context?: RequestContextLike | RequestContext): Promise<PDFImage>;
|
|
337
346
|
/**
|
|
338
347
|
* Draws text on a PDF page with optional font, size, color, rotation, and word-wrap.
|
|
339
348
|
*
|
|
@@ -391,8 +400,9 @@ export declare class PdfParser {
|
|
|
391
400
|
* `pdf-lib` (`bun add pdf-lib`).
|
|
392
401
|
*
|
|
393
402
|
* @param pdfBytesArray - Source PDF files as `Uint8Array` or `ArrayBuffer` elements.
|
|
394
|
-
* @param context - Optional
|
|
395
|
-
*
|
|
403
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
404
|
+
* handler `Context` is accepted directly.
|
|
405
|
+
* @param budget - Optional aggregate byte budget across all inputs. Unbounded when omitted.
|
|
396
406
|
* @returns A new `PDFDocument` containing all pages from the input documents.
|
|
397
407
|
* @throws {McpError} With `ConfigurationError` if `pdf-lib` is not installed.
|
|
398
408
|
* @throws {McpError} With `InternalError` if any source PDF is invalid or merging fails.
|
|
@@ -405,7 +415,7 @@ export declare class PdfParser {
|
|
|
405
415
|
* const bytes = await pdfParser.saveDocument(merged);
|
|
406
416
|
* ```
|
|
407
417
|
*/
|
|
408
|
-
mergePdfs(pdfBytesArray: (Uint8Array | ArrayBuffer)[], context?: RequestContext, budget?: ParserInputBudgetOptions): Promise<PDFDocument>;
|
|
418
|
+
mergePdfs(pdfBytesArray: (Uint8Array | ArrayBuffer)[], context?: RequestContextLike | RequestContext, budget?: ParserInputBudgetOptions): Promise<PDFDocument>;
|
|
409
419
|
/**
|
|
410
420
|
* Splits a PDF document into multiple new documents based on page ranges.
|
|
411
421
|
*
|
|
@@ -415,8 +425,9 @@ export declare class PdfParser {
|
|
|
415
425
|
*
|
|
416
426
|
* @param pdfBytes - The source PDF as `Uint8Array` or `ArrayBuffer`.
|
|
417
427
|
* @param ranges - Page ranges to extract; each produces one output document.
|
|
418
|
-
* @param context - Optional
|
|
419
|
-
*
|
|
428
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
429
|
+
* handler `Context` is accepted directly.
|
|
430
|
+
* @param budget - Optional byte budget for the input. Unbounded when omitted.
|
|
420
431
|
* @returns An array of new `PDFDocument` instances, one per range, in order.
|
|
421
432
|
* @throws {McpError} With `ConfigurationError` if `pdf-lib` is not installed.
|
|
422
433
|
* @throws {McpError} With `InternalError` if the source PDF is invalid or a page index is out of bounds.
|
|
@@ -430,7 +441,7 @@ export declare class PdfParser {
|
|
|
430
441
|
* ]);
|
|
431
442
|
* ```
|
|
432
443
|
*/
|
|
433
|
-
splitPdf(pdfBytes: Uint8Array | ArrayBuffer, ranges: PageRange[], context?: RequestContext, budget?: ParserInputBudgetOptions): Promise<PDFDocument[]>;
|
|
444
|
+
splitPdf(pdfBytes: Uint8Array | ArrayBuffer, ranges: PageRange[], context?: RequestContextLike | RequestContext, budget?: ParserInputBudgetOptions): Promise<PDFDocument[]>;
|
|
434
445
|
/**
|
|
435
446
|
* Fills form fields in a PDF document.
|
|
436
447
|
*
|
|
@@ -441,7 +452,8 @@ export declare class PdfParser {
|
|
|
441
452
|
*
|
|
442
453
|
* @param doc - The `PDFDocument` containing the AcroForm.
|
|
443
454
|
* @param options - Map of field names to values, plus optional `flatten` flag.
|
|
444
|
-
* @param context - Optional
|
|
455
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
456
|
+
* handler `Context` is accepted directly.
|
|
445
457
|
* @throws {McpError} With `InternalError` if the overall form operation fails.
|
|
446
458
|
* @example
|
|
447
459
|
* ```typescript
|
|
@@ -455,7 +467,7 @@ export declare class PdfParser {
|
|
|
455
467
|
* });
|
|
456
468
|
* ```
|
|
457
469
|
*/
|
|
458
|
-
fillForm(doc: PDFDocument, options: FillFormOptions, context?: RequestContext): void;
|
|
470
|
+
fillForm(doc: PDFDocument, options: FillFormOptions, context?: RequestContextLike | RequestContext): void;
|
|
459
471
|
/**
|
|
460
472
|
* Extracts metadata from a PDF document.
|
|
461
473
|
*
|
|
@@ -504,7 +516,8 @@ export declare class PdfParser {
|
|
|
504
516
|
* @param input - Raw PDF bytes (`Uint8Array` | `ArrayBuffer`) or a loaded `PDFDocument`.
|
|
505
517
|
* @param options - Optional extraction options. Set `mergePages: true` to get a
|
|
506
518
|
* single concatenated string instead of one string per page.
|
|
507
|
-
* @param context - Optional
|
|
519
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
520
|
+
* handler `Context` is accepted directly.
|
|
508
521
|
* @returns An `ExtractTextResult` with `totalPages` and `text` — a `string[]` (one
|
|
509
522
|
* per page) by default, or a single `string` when `mergePages` is `true`.
|
|
510
523
|
* @throws {McpError} With `ConfigurationError` if `unpdf` is not installed (or
|
|
@@ -521,7 +534,7 @@ export declare class PdfParser {
|
|
|
521
534
|
* const perPage = await pdfParser.extractText(doc);
|
|
522
535
|
* ```
|
|
523
536
|
*/
|
|
524
|
-
extractText(input: PDFDocument | Uint8Array | ArrayBuffer, options?: ExtractTextOptions, context?: RequestContext): Promise<ExtractTextResult>;
|
|
537
|
+
extractText(input: PDFDocument | Uint8Array | ArrayBuffer, options?: ExtractTextOptions, context?: RequestContextLike | RequestContext): Promise<ExtractTextResult>;
|
|
525
538
|
/**
|
|
526
539
|
* Serializes a PDF document to a `Uint8Array` for writing to disk or transmission.
|
|
527
540
|
*
|
|
@@ -529,7 +542,8 @@ export declare class PdfParser {
|
|
|
529
542
|
* compatible). Does not reload peer dependencies if already cached.
|
|
530
543
|
*
|
|
531
544
|
* @param doc - The `PDFDocument` to serialize.
|
|
532
|
-
* @param context - Optional
|
|
545
|
+
* @param context - Optional context for correlated logging and error metadata. The
|
|
546
|
+
* handler `Context` is accepted directly.
|
|
533
547
|
* @returns The complete PDF file as a `Uint8Array`.
|
|
534
548
|
* @throws {McpError} With `InternalError` if serialization fails.
|
|
535
549
|
* @example
|
|
@@ -539,7 +553,7 @@ export declare class PdfParser {
|
|
|
539
553
|
* await writeFile('output.pdf', pdfBytes);
|
|
540
554
|
* ```
|
|
541
555
|
*/
|
|
542
|
-
saveDocument(doc: PDFDocument, context?: RequestContext): Promise<Uint8Array>;
|
|
556
|
+
saveDocument(doc: PDFDocument, context?: RequestContextLike | RequestContext): Promise<Uint8Array>;
|
|
543
557
|
}
|
|
544
558
|
/**
|
|
545
559
|
* Singleton instance of `PdfParser`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdfParser.d.ts","sourceRoot":"","sources":["../../../src/utils/parsing/pdfParser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAK5E,OAAO,
|
|
1
|
+
{"version":3,"file":"pdfParser.d.ts","sourceRoot":"","sources":["../../../src/utils/parsing/pdfParser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAK5E,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EAExB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,kBAAkB,CAAC;AAkC1B;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IAEZ;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ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