@j0hanz/fetch-url-mcp 1.11.3 → 1.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/dist/http/helpers.d.ts +1 -1
- package/dist/http/helpers.d.ts.map +1 -1
- package/dist/http/helpers.js +1 -1
- package/dist/http/native.js +1 -1
- package/dist/lib/config.d.ts +152 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +478 -0
- package/dist/lib/core.d.ts +1 -150
- package/dist/lib/core.d.ts.map +1 -1
- package/dist/lib/core.js +3 -459
- package/dist/lib/{mcp-tools.d.ts → mcp-interop.d.ts} +49 -1
- package/dist/lib/mcp-interop.d.ts.map +1 -0
- package/dist/lib/mcp-interop.js +354 -0
- package/dist/lib/task-handlers.js +1 -1
- package/dist/resources/index.js +1 -1
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +1 -1
- package/dist/server.js +2 -2
- package/dist/tasks/handlers.d.ts +11 -0
- package/dist/tasks/handlers.d.ts.map +1 -0
- package/dist/tasks/handlers.js +151 -0
- package/dist/tasks/owner.d.ts +1 -2
- package/dist/tasks/owner.d.ts.map +1 -1
- package/dist/tasks/registry.d.ts +1 -1
- package/dist/tasks/registry.d.ts.map +1 -1
- package/dist/tools/fetch-url.d.ts +1 -2
- package/dist/tools/fetch-url.d.ts.map +1 -1
- package/dist/tools/fetch-url.js +2 -2
- package/dist/{lib → transform}/dom-prep.d.ts +1 -1
- package/dist/transform/dom-prep.d.ts.map +1 -0
- package/dist/{lib → transform}/dom-prep.js +2 -2
- package/dist/transform/html-translators.d.ts.map +1 -1
- package/dist/transform/html-translators.js +1 -1
- package/dist/transform/metadata.d.ts +8 -0
- package/dist/transform/metadata.d.ts.map +1 -1
- package/dist/transform/metadata.js +66 -0
- package/dist/transform/transform.d.ts.map +1 -1
- package/dist/transform/transform.js +2 -3
- package/package.json +1 -1
- package/dist/lib/dom-prep.d.ts.map +0 -1
- package/dist/lib/mcp-tools.d.ts.map +0 -1
- package/dist/lib/mcp-tools.js +0 -129
- package/dist/lib/progress.d.ts +0 -32
- package/dist/lib/progress.d.ts.map +0 -1
- package/dist/lib/progress.js +0 -143
- package/dist/lib/sdk-interop.d.ts +0 -20
- package/dist/lib/sdk-interop.d.ts.map +0 -1
- package/dist/lib/sdk-interop.js +0 -85
- package/dist/transform/title-policy.d.ts +0 -9
- package/dist/transform/title-policy.d.ts.map +0 -1
- package/dist/transform/title-policy.js +0 -67
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface SyntheticTitleContext {
|
|
2
|
-
readonly title: string | undefined;
|
|
3
|
-
}
|
|
4
|
-
export declare function normalizeSyntheticTitleToken(value: string | undefined): string;
|
|
5
|
-
export declare function shouldPreferPrimaryHeadingTitle(primaryHeading: string | undefined, title: string | undefined): boolean;
|
|
6
|
-
export declare function isGithubRepositoryRootUrl(url: string): boolean;
|
|
7
|
-
export declare function maybeStripGithubPrimaryHeading(markdown: string, primaryHeading: string | undefined, url: string): string;
|
|
8
|
-
export declare function maybePrependSyntheticTitle(markdown: string, context: SyntheticTitleContext): string;
|
|
9
|
-
//# sourceMappingURL=title-policy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"title-policy.d.ts","sourceRoot":"","sources":["../../src/transform/title-policy.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAMD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,MAAM,CAER;AAED,wBAAgB,+BAA+B,CAC7C,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,OAAO,CAWT;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAU9D;AAkCD,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,GAAG,EAAE,MAAM,GACV,MAAM,CAMR;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,qBAAqB,GAC7B,MAAM,CAMR"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { parseUrlOrNull } from '../lib/utils.js';
|
|
2
|
-
const TITLE_PART_SEPARATOR = /\s*(?:[-|:•·]|–|—)\s*/u;
|
|
3
|
-
const LEADING_HEADING_PATTERN = /^(#{1,6})\s+(.+?)\s*$/;
|
|
4
|
-
const HEADING_SCAN_LIMIT = 12;
|
|
5
|
-
export function normalizeSyntheticTitleToken(value) {
|
|
6
|
-
return (value ?? '').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
7
|
-
}
|
|
8
|
-
export function shouldPreferPrimaryHeadingTitle(primaryHeading, title) {
|
|
9
|
-
const primary = normalizeSyntheticTitleToken(primaryHeading);
|
|
10
|
-
if (!primary)
|
|
11
|
-
return false;
|
|
12
|
-
const normalizedTitle = normalizeSyntheticTitleToken(title);
|
|
13
|
-
if (!normalizedTitle)
|
|
14
|
-
return true;
|
|
15
|
-
if (normalizedTitle === primary)
|
|
16
|
-
return true;
|
|
17
|
-
return normalizedTitle
|
|
18
|
-
.split(TITLE_PART_SEPARATOR)
|
|
19
|
-
.some((part) => part === primary);
|
|
20
|
-
}
|
|
21
|
-
export function isGithubRepositoryRootUrl(url) {
|
|
22
|
-
const parsed = parseUrlOrNull(url);
|
|
23
|
-
if (!parsed)
|
|
24
|
-
return false;
|
|
25
|
-
const hostname = parsed.hostname.toLowerCase();
|
|
26
|
-
if (hostname !== 'github.com' && hostname !== 'www.github.com') {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
return parsed.pathname.split('/').filter(Boolean).length === 2;
|
|
30
|
-
}
|
|
31
|
-
function stripLeadingHeading(markdown, headingText) {
|
|
32
|
-
if (!markdown)
|
|
33
|
-
return markdown;
|
|
34
|
-
const lines = markdown.split('\n');
|
|
35
|
-
const target = normalizeSyntheticTitleToken(headingText);
|
|
36
|
-
let nonEmptySeen = 0;
|
|
37
|
-
for (let index = 0; index < lines.length && nonEmptySeen < HEADING_SCAN_LIMIT; index += 1) {
|
|
38
|
-
const trimmed = lines[index]?.trim() ?? '';
|
|
39
|
-
if (!trimmed)
|
|
40
|
-
continue;
|
|
41
|
-
nonEmptySeen += 1;
|
|
42
|
-
const match = LEADING_HEADING_PATTERN.exec(trimmed);
|
|
43
|
-
if (!match)
|
|
44
|
-
continue;
|
|
45
|
-
const current = normalizeSyntheticTitleToken(match[2] ?? '');
|
|
46
|
-
if (current !== target)
|
|
47
|
-
return markdown;
|
|
48
|
-
lines.splice(index, 1);
|
|
49
|
-
if ((lines[index] ?? '').trim() === '') {
|
|
50
|
-
lines.splice(index, 1);
|
|
51
|
-
}
|
|
52
|
-
return lines.join('\n');
|
|
53
|
-
}
|
|
54
|
-
return markdown;
|
|
55
|
-
}
|
|
56
|
-
export function maybeStripGithubPrimaryHeading(markdown, primaryHeading, url) {
|
|
57
|
-
if (primaryHeading === undefined || !isGithubRepositoryRootUrl(url)) {
|
|
58
|
-
return markdown;
|
|
59
|
-
}
|
|
60
|
-
return stripLeadingHeading(markdown, primaryHeading);
|
|
61
|
-
}
|
|
62
|
-
export function maybePrependSyntheticTitle(markdown, context) {
|
|
63
|
-
if (!context.title || /^#\s/.test(markdown.trimStart())) {
|
|
64
|
-
return markdown;
|
|
65
|
-
}
|
|
66
|
-
return `# ${context.title}\n\n${markdown}`;
|
|
67
|
-
}
|