@j0hanz/fetch-url-mcp 0.0.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 (65) hide show
  1. package/README.md +570 -0
  2. package/dist/AGENTS.md +115 -0
  3. package/dist/assets/logo.svg +24837 -0
  4. package/dist/cache.d.ts +47 -0
  5. package/dist/cache.js +316 -0
  6. package/dist/cli.d.ts +17 -0
  7. package/dist/cli.js +48 -0
  8. package/dist/config.d.ts +142 -0
  9. package/dist/config.js +480 -0
  10. package/dist/crypto.d.ts +3 -0
  11. package/dist/crypto.js +49 -0
  12. package/dist/dom-noise-removal.d.ts +1 -0
  13. package/dist/dom-noise-removal.js +488 -0
  14. package/dist/errors.d.ts +10 -0
  15. package/dist/errors.js +61 -0
  16. package/dist/fetch.d.ts +42 -0
  17. package/dist/fetch.js +1544 -0
  18. package/dist/host-normalization.d.ts +1 -0
  19. package/dist/host-normalization.js +77 -0
  20. package/dist/http-native.d.ts +5 -0
  21. package/dist/http-native.js +1313 -0
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.js +91 -0
  24. package/dist/instructions.md +57 -0
  25. package/dist/ip-blocklist.d.ts +8 -0
  26. package/dist/ip-blocklist.js +74 -0
  27. package/dist/json.d.ts +1 -0
  28. package/dist/json.js +34 -0
  29. package/dist/language-detection.d.ts +2 -0
  30. package/dist/language-detection.js +364 -0
  31. package/dist/markdown-cleanup.d.ts +6 -0
  32. package/dist/markdown-cleanup.js +474 -0
  33. package/dist/mcp-validator.d.ts +15 -0
  34. package/dist/mcp-validator.js +44 -0
  35. package/dist/mcp.d.ts +4 -0
  36. package/dist/mcp.js +421 -0
  37. package/dist/observability.d.ts +21 -0
  38. package/dist/observability.js +211 -0
  39. package/dist/prompts.d.ts +7 -0
  40. package/dist/prompts.js +28 -0
  41. package/dist/resources.d.ts +8 -0
  42. package/dist/resources.js +216 -0
  43. package/dist/server-tuning.d.ts +13 -0
  44. package/dist/server-tuning.js +47 -0
  45. package/dist/server.d.ts +4 -0
  46. package/dist/server.js +174 -0
  47. package/dist/session.d.ts +39 -0
  48. package/dist/session.js +218 -0
  49. package/dist/tasks.d.ts +63 -0
  50. package/dist/tasks.js +327 -0
  51. package/dist/timer-utils.d.ts +5 -0
  52. package/dist/timer-utils.js +20 -0
  53. package/dist/tools.d.ts +135 -0
  54. package/dist/tools.js +812 -0
  55. package/dist/transform-types.d.ts +126 -0
  56. package/dist/transform-types.js +5 -0
  57. package/dist/transform.d.ts +36 -0
  58. package/dist/transform.js +2341 -0
  59. package/dist/type-guards.d.ts +14 -0
  60. package/dist/type-guards.js +13 -0
  61. package/dist/workers/transform-child.d.ts +1 -0
  62. package/dist/workers/transform-child.js +136 -0
  63. package/dist/workers/transform-worker.d.ts +1 -0
  64. package/dist/workers/transform-worker.js +128 -0
  65. package/package.json +91 -0
@@ -0,0 +1,47 @@
1
+ import type { ServerResponse } from 'node:http';
2
+ import { z } from 'zod';
3
+ declare const CachedPayloadSchema: z.ZodObject<{
4
+ content: z.ZodOptional<z.ZodString>;
5
+ markdown: z.ZodOptional<z.ZodString>;
6
+ title: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strict>;
8
+ export type CachedPayload = z.infer<typeof CachedPayloadSchema>;
9
+ export interface CacheEntry {
10
+ url: string;
11
+ title?: string;
12
+ content: string;
13
+ fetchedAt: string;
14
+ expiresAt: string;
15
+ }
16
+ export interface CacheKeyParts {
17
+ namespace: string;
18
+ urlHash: string;
19
+ }
20
+ export interface CacheSetOptions {
21
+ force?: boolean;
22
+ }
23
+ export interface CacheGetOptions {
24
+ force?: boolean;
25
+ }
26
+ interface CacheEntryMetadata {
27
+ url: string;
28
+ title?: string;
29
+ }
30
+ interface CacheUpdateEvent {
31
+ cacheKey: string;
32
+ namespace: string;
33
+ urlHash: string;
34
+ }
35
+ type CacheUpdateListener = (event: CacheUpdateEvent) => unknown;
36
+ export declare function parseCachedPayload(raw: string): CachedPayload | null;
37
+ export declare function resolveCachedPayloadContent(payload: CachedPayload): string | null;
38
+ export declare function createCacheKey(namespace: string, url: string, vary?: Record<string, unknown> | string): string | null;
39
+ export declare function parseCacheKey(cacheKey: string): CacheKeyParts | null;
40
+ export declare function onCacheUpdate(listener: CacheUpdateListener): () => void;
41
+ export declare function get(cacheKey: string | null, options?: CacheGetOptions): CacheEntry | undefined;
42
+ export declare function set(cacheKey: string | null, content: string, metadata: CacheEntryMetadata, options?: CacheSetOptions): void;
43
+ export declare function keys(): readonly string[];
44
+ export declare function isEnabled(): boolean;
45
+ export declare function generateSafeFilename(url: string, title?: string, hashFallback?: string, extension?: string): string;
46
+ export declare function handleDownload(res: ServerResponse, namespace: string, hash: string): void;
47
+ export {};
package/dist/cache.js ADDED
@@ -0,0 +1,316 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import { posix as pathPosix } from 'node:path';
3
+ import { z } from 'zod';
4
+ import { config } from './config.js';
5
+ import { sha256Hex } from './crypto.js';
6
+ import { getErrorMessage } from './errors.js';
7
+ import { stableStringify as stableJsonStringify } from './json.js';
8
+ import { logWarn } from './observability.js';
9
+ /* -------------------------------------------------------------------------------------------------
10
+ * Schemas & Types
11
+ * ------------------------------------------------------------------------------------------------- */
12
+ const CacheNamespace = z.literal('markdown');
13
+ const HashString = z
14
+ .string()
15
+ .regex(/^[a-f0-9.]+$/i)
16
+ .min(8)
17
+ .max(64);
18
+ const CachedPayloadSchema = z.strictObject({
19
+ content: z.string().optional(),
20
+ markdown: z.string().optional(),
21
+ title: z.string().optional(),
22
+ });
23
+ /* -------------------------------------------------------------------------------------------------
24
+ * Core: Cache Key Logic
25
+ * ------------------------------------------------------------------------------------------------- */
26
+ const CACHE_CONSTANTS = {
27
+ URL_HASH_LENGTH: 32,
28
+ VARY_HASH_LENGTH: 16,
29
+ };
30
+ export function parseCachedPayload(raw) {
31
+ try {
32
+ const parsed = JSON.parse(raw);
33
+ return CachedPayloadSchema.parse(parsed);
34
+ }
35
+ catch {
36
+ return null;
37
+ }
38
+ }
39
+ export function resolveCachedPayloadContent(payload) {
40
+ return payload.markdown ?? payload.content ?? null;
41
+ }
42
+ function createHashFragment(input, length) {
43
+ return sha256Hex(input).substring(0, length);
44
+ }
45
+ function buildCacheKey(namespace, urlHash, varyHash) {
46
+ return varyHash
47
+ ? `${namespace}:${urlHash}.${varyHash}`
48
+ : `${namespace}:${urlHash}`;
49
+ }
50
+ export function createCacheKey(namespace, url, vary) {
51
+ if (!namespace || !url)
52
+ return null;
53
+ const urlHash = createHashFragment(url, CACHE_CONSTANTS.URL_HASH_LENGTH);
54
+ let varyHash;
55
+ if (vary) {
56
+ let varyString;
57
+ if (typeof vary === 'string') {
58
+ varyString = vary;
59
+ }
60
+ else {
61
+ try {
62
+ varyString = stableJsonStringify(vary);
63
+ }
64
+ catch {
65
+ return null;
66
+ }
67
+ }
68
+ if (varyString) {
69
+ varyHash = createHashFragment(varyString, CACHE_CONSTANTS.VARY_HASH_LENGTH);
70
+ }
71
+ }
72
+ return buildCacheKey(namespace, urlHash, varyHash);
73
+ }
74
+ export function parseCacheKey(cacheKey) {
75
+ if (!cacheKey)
76
+ return null;
77
+ const [namespace, ...rest] = cacheKey.split(':');
78
+ const urlHash = rest.join(':');
79
+ if (!namespace || !urlHash)
80
+ return null;
81
+ return { namespace, urlHash };
82
+ }
83
+ /* -------------------------------------------------------------------------------------------------
84
+ * Core: In-Memory Store
85
+ * ------------------------------------------------------------------------------------------------- */
86
+ class InMemoryCacheStore {
87
+ max = config.cache.maxKeys;
88
+ maxBytes = config.cache.maxSizeBytes;
89
+ ttlMs = config.cache.ttl * 1000;
90
+ entries = new Map();
91
+ updateEmitter = new EventEmitter();
92
+ currentBytes = 0;
93
+ isEnabled() {
94
+ return config.cache.enabled;
95
+ }
96
+ keys() {
97
+ if (!this.isEnabled())
98
+ return [];
99
+ const now = Date.now();
100
+ const result = [];
101
+ for (const [key, entry] of this.entries) {
102
+ if (entry.expiresAtMs > now)
103
+ result.push(key);
104
+ }
105
+ return result;
106
+ }
107
+ onUpdate(listener) {
108
+ const wrapped = (event) => {
109
+ try {
110
+ const result = listener(event);
111
+ if (result instanceof Promise) {
112
+ void result.catch((error) => {
113
+ this.logError('Cache update listener failed (async)', event.cacheKey, error);
114
+ });
115
+ }
116
+ }
117
+ catch (error) {
118
+ this.logError('Cache update listener failed', event.cacheKey, error);
119
+ }
120
+ };
121
+ this.updateEmitter.on('update', wrapped);
122
+ return () => {
123
+ this.updateEmitter.off('update', wrapped);
124
+ };
125
+ }
126
+ get(cacheKey, options) {
127
+ if (!cacheKey || (!this.isEnabled() && !options?.force))
128
+ return undefined;
129
+ const entry = this.entries.get(cacheKey);
130
+ if (!entry)
131
+ return undefined;
132
+ const now = Date.now();
133
+ if (entry.expiresAtMs <= now) {
134
+ this.delete(cacheKey);
135
+ return undefined;
136
+ }
137
+ // Refresh LRU position
138
+ this.entries.delete(cacheKey);
139
+ this.entries.set(cacheKey, entry);
140
+ return entry;
141
+ }
142
+ delete(cacheKey) {
143
+ const entry = this.entries.get(cacheKey);
144
+ if (entry) {
145
+ this.currentBytes -= entry.content.length;
146
+ this.entries.delete(cacheKey);
147
+ }
148
+ }
149
+ set(cacheKey, content, metadata, options) {
150
+ if (!cacheKey || !content)
151
+ return;
152
+ if (!this.isEnabled() && !options?.force)
153
+ return;
154
+ const now = Date.now();
155
+ const expiresAtMs = now + this.ttlMs;
156
+ // Check size limit before insertion
157
+ const entrySize = content.length;
158
+ if (entrySize > this.maxBytes) {
159
+ logWarn('Cache entry exceeds max size', {
160
+ key: cacheKey,
161
+ size: entrySize,
162
+ max: this.maxBytes,
163
+ });
164
+ return;
165
+ }
166
+ // Evict if needed (size-based)
167
+ while (this.currentBytes + entrySize > this.maxBytes) {
168
+ const firstKey = this.entries.keys().next();
169
+ if (firstKey.done)
170
+ break;
171
+ this.delete(firstKey.value);
172
+ }
173
+ const entry = {
174
+ url: metadata.url,
175
+ content,
176
+ fetchedAt: new Date(now).toISOString(),
177
+ expiresAt: new Date(expiresAtMs).toISOString(),
178
+ expiresAtMs,
179
+ ...(metadata.title ? { title: metadata.title } : {}),
180
+ };
181
+ if (this.entries.has(cacheKey)) {
182
+ this.delete(cacheKey);
183
+ }
184
+ this.entries.set(cacheKey, entry);
185
+ this.currentBytes += entrySize;
186
+ // Eviction (LRU: first insertion-order key) - Count based
187
+ if (this.entries.size > this.max) {
188
+ const firstKey = this.entries.keys().next();
189
+ if (!firstKey.done)
190
+ this.delete(firstKey.value);
191
+ }
192
+ this.notify(cacheKey);
193
+ }
194
+ notify(cacheKey) {
195
+ if (this.updateEmitter.listenerCount('update') === 0)
196
+ return;
197
+ const parts = parseCacheKey(cacheKey);
198
+ if (!parts)
199
+ return;
200
+ this.updateEmitter.emit('update', { cacheKey, ...parts });
201
+ }
202
+ logError(message, cacheKey, error) {
203
+ logWarn(message, {
204
+ key: cacheKey.length > 100 ? cacheKey.slice(0, 100) : cacheKey,
205
+ error: getErrorMessage(error),
206
+ });
207
+ }
208
+ }
209
+ // Singleton Instance
210
+ const store = new InMemoryCacheStore();
211
+ // Public Proxy API
212
+ export function onCacheUpdate(listener) {
213
+ return store.onUpdate(listener);
214
+ }
215
+ export function get(cacheKey, options) {
216
+ return store.get(cacheKey, options);
217
+ }
218
+ export function set(cacheKey, content, metadata, options) {
219
+ store.set(cacheKey, content, metadata, options);
220
+ }
221
+ export function keys() {
222
+ return store.keys();
223
+ }
224
+ export function isEnabled() {
225
+ return store.isEnabled();
226
+ }
227
+ /* -------------------------------------------------------------------------------------------------
228
+ * Utils: Filename Logic
229
+ * ------------------------------------------------------------------------------------------------- */
230
+ const FILENAME_RULES = {
231
+ MAX_LEN: 200,
232
+ UNSAFE_CHARS: /[<>:"/\\|?*\p{C}]/gu,
233
+ WHITESPACE: /\s+/g,
234
+ EXTENSIONS: /\.(html?|php|aspx?|jsp)$/i,
235
+ };
236
+ function sanitizeString(input) {
237
+ return input
238
+ .toLowerCase()
239
+ .replace(FILENAME_RULES.UNSAFE_CHARS, '')
240
+ .replace(FILENAME_RULES.WHITESPACE, '-')
241
+ .replace(/-+/g, '-')
242
+ .replace(/(?:^-|-$)/g, '');
243
+ }
244
+ export function generateSafeFilename(url, title, hashFallback, extension = '.md') {
245
+ const tryUrl = () => {
246
+ try {
247
+ if (!URL.canParse(url))
248
+ return null;
249
+ const parsed = new URL(url);
250
+ if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')
251
+ return null;
252
+ const { pathname } = parsed;
253
+ const basename = pathPosix.basename(pathname);
254
+ if (!basename || basename === 'index')
255
+ return null;
256
+ const cleaned = basename.replace(FILENAME_RULES.EXTENSIONS, '');
257
+ const sanitized = sanitizeString(cleaned);
258
+ if (sanitized === 'index')
259
+ return null;
260
+ return sanitized || null;
261
+ }
262
+ catch {
263
+ return null;
264
+ }
265
+ };
266
+ const tryTitle = () => {
267
+ if (!title)
268
+ return null;
269
+ return sanitizeString(title) || null;
270
+ };
271
+ const name = tryUrl() ??
272
+ tryTitle() ??
273
+ hashFallback?.substring(0, 16) ??
274
+ `download-${Date.now()}`;
275
+ const maxBase = FILENAME_RULES.MAX_LEN - extension.length;
276
+ const truncated = name.length > maxBase ? name.substring(0, maxBase) : name;
277
+ return `${truncated}${extension}`;
278
+ }
279
+ /* -------------------------------------------------------------------------------------------------
280
+ * Adapter: Download Handler
281
+ * ------------------------------------------------------------------------------------------------- */
282
+ const DownloadParamsSchema = z.strictObject({
283
+ namespace: CacheNamespace,
284
+ hash: HashString,
285
+ });
286
+ export function handleDownload(res, namespace, hash) {
287
+ const respond = (status, msg, code) => {
288
+ res.writeHead(status, { 'Content-Type': 'application/json' });
289
+ res.end(JSON.stringify({ error: msg, code }));
290
+ };
291
+ const parsed = DownloadParamsSchema.safeParse({ namespace, hash });
292
+ if (!parsed.success) {
293
+ respond(400, 'Invalid namespace or hash', 'BAD_REQUEST');
294
+ return;
295
+ }
296
+ const cacheKey = `${parsed.data.namespace}:${parsed.data.hash}`;
297
+ const entry = store.get(cacheKey, { force: true });
298
+ if (!entry) {
299
+ respond(404, 'Not found or expired', 'NOT_FOUND');
300
+ return;
301
+ }
302
+ const payload = parseCachedPayload(entry.content);
303
+ const content = payload ? resolveCachedPayloadContent(payload) : null;
304
+ if (!content) {
305
+ respond(404, 'Content missing', 'NOT_FOUND');
306
+ return;
307
+ }
308
+ const fileName = generateSafeFilename(entry.url, payload?.title, parsed.data.hash);
309
+ // Safe header generation
310
+ const encoded = encodeURIComponent(fileName).replace(/'/g, '%27');
311
+ res.setHeader('Content-Type', 'text/markdown; charset=utf-8');
312
+ res.setHeader('Content-Disposition', `attachment; filename="${fileName}"; filename*=UTF-8''${encoded}`);
313
+ res.setHeader('Cache-Control', `private, max-age=${config.cache.ttl}`);
314
+ res.setHeader('X-Content-Type-Options', 'nosniff');
315
+ res.end(content);
316
+ }
package/dist/cli.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ export interface CliValues {
2
+ readonly stdio: boolean;
3
+ readonly help: boolean;
4
+ readonly version: boolean;
5
+ }
6
+ interface CliParseSuccess {
7
+ readonly ok: true;
8
+ readonly values: CliValues;
9
+ }
10
+ interface CliParseFailure {
11
+ readonly ok: false;
12
+ readonly message: string;
13
+ }
14
+ export type CliParseResult = CliParseSuccess | CliParseFailure;
15
+ export declare function renderCliUsage(): string;
16
+ export declare function parseCliArgs(args: readonly string[]): CliParseResult;
17
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,48 @@
1
+ import { parseArgs } from 'node:util';
2
+ const usageLines = [
3
+ 'Fetch URL MCP server',
4
+ '',
5
+ 'Usage:',
6
+ ' fetch-url-mcp [--stdio|-s] [--help|-h] [--version|-v]',
7
+ '',
8
+ 'Options:',
9
+ ' --stdio, -s Run in stdio mode (no HTTP server).',
10
+ ' --help, -h Show this help message.',
11
+ ' --version, -v Show server version.',
12
+ '',
13
+ ];
14
+ const optionSchema = {
15
+ stdio: { type: 'boolean', short: 's', default: false },
16
+ help: { type: 'boolean', short: 'h', default: false },
17
+ version: { type: 'boolean', short: 'v', default: false },
18
+ };
19
+ function toErrorMessage(error) {
20
+ return error instanceof Error ? error.message : String(error);
21
+ }
22
+ export function renderCliUsage() {
23
+ return `${usageLines.join('\n')}\n`;
24
+ }
25
+ export function parseCliArgs(args) {
26
+ try {
27
+ const { values } = parseArgs({
28
+ args: [...args],
29
+ options: optionSchema,
30
+ strict: true,
31
+ allowPositionals: false,
32
+ });
33
+ return {
34
+ ok: true,
35
+ values: {
36
+ stdio: values.stdio,
37
+ help: values.help,
38
+ version: values.version,
39
+ },
40
+ };
41
+ }
42
+ catch (error) {
43
+ return {
44
+ ok: false,
45
+ message: toErrorMessage(error),
46
+ };
47
+ }
48
+ }
@@ -0,0 +1,142 @@
1
+ export declare const serverVersion: string;
2
+ export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
3
+ export type TransformWorkerMode = 'threads' | 'process';
4
+ type AuthMode = 'oauth' | 'static';
5
+ interface WorkerResourceLimits {
6
+ maxOldGenerationSizeMb?: number;
7
+ maxYoungGenerationSizeMb?: number;
8
+ codeRangeSizeMb?: number;
9
+ stackSizeMb?: number;
10
+ }
11
+ interface AuthConfig {
12
+ mode: AuthMode;
13
+ issuerUrl: URL | undefined;
14
+ authorizationUrl: URL | undefined;
15
+ tokenUrl: URL | undefined;
16
+ revocationUrl: URL | undefined;
17
+ registrationUrl: URL | undefined;
18
+ introspectionUrl: URL | undefined;
19
+ resourceUrl: URL;
20
+ requiredScopes: string[];
21
+ clientId: string | undefined;
22
+ clientSecret: string | undefined;
23
+ introspectionTimeoutMs: number;
24
+ staticTokens: string[];
25
+ }
26
+ interface HttpsConfig {
27
+ enabled: boolean;
28
+ keyFile: string | undefined;
29
+ certFile: string | undefined;
30
+ caFile: string | undefined;
31
+ }
32
+ interface RuntimeState {
33
+ httpMode: boolean;
34
+ }
35
+ export declare const config: {
36
+ server: {
37
+ name: string;
38
+ version: string;
39
+ port: number;
40
+ host: string;
41
+ https: HttpsConfig;
42
+ sessionTtlMs: number;
43
+ sessionInitTimeoutMs: number;
44
+ maxSessions: number;
45
+ http: {
46
+ headersTimeoutMs: number | undefined;
47
+ requestTimeoutMs: number | undefined;
48
+ keepAliveTimeoutMs: number | undefined;
49
+ keepAliveTimeoutBufferMs: number | undefined;
50
+ maxHeadersCount: number | undefined;
51
+ maxConnections: number;
52
+ blockPrivateConnections: boolean;
53
+ shutdownCloseIdleConnections: boolean;
54
+ shutdownCloseAllConnections: boolean;
55
+ };
56
+ };
57
+ fetcher: {
58
+ timeout: number;
59
+ maxRedirects: number;
60
+ userAgent: string;
61
+ maxContentLength: number;
62
+ };
63
+ transform: {
64
+ timeoutMs: number;
65
+ stageWarnRatio: number;
66
+ metadataFormat: string;
67
+ maxWorkerScale: number;
68
+ workerMode: TransformWorkerMode;
69
+ workerResourceLimits: WorkerResourceLimits | undefined;
70
+ };
71
+ tools: {
72
+ enabled: string[];
73
+ timeoutMs: number;
74
+ };
75
+ tasks: {
76
+ maxTotal: number;
77
+ maxPerOwner: number;
78
+ };
79
+ cache: {
80
+ enabled: boolean;
81
+ ttl: number;
82
+ maxKeys: number;
83
+ maxSizeBytes: number;
84
+ };
85
+ extraction: {
86
+ maxBlockLength: number;
87
+ minParagraphLength: number;
88
+ };
89
+ noiseRemoval: {
90
+ extraTokens: string[];
91
+ extraSelectors: string[];
92
+ enabledCategories: string[];
93
+ debug: boolean;
94
+ aggressiveMode: boolean;
95
+ preserveSvgCanvas: boolean;
96
+ weights: {
97
+ hidden: number;
98
+ structural: number;
99
+ promo: number;
100
+ stickyFixed: number;
101
+ threshold: number;
102
+ };
103
+ };
104
+ markdownCleanup: {
105
+ promoteOrphanHeadings: boolean;
106
+ removeSkipLinks: boolean;
107
+ removeTocBlocks: boolean;
108
+ removeTypeDocComments: boolean;
109
+ headingKeywords: string[];
110
+ };
111
+ i18n: {
112
+ locale: string | undefined;
113
+ };
114
+ logging: {
115
+ level: LogLevel;
116
+ format: string;
117
+ };
118
+ constants: {
119
+ maxHtmlSize: number;
120
+ maxUrlLength: number;
121
+ maxInlineContentChars: number;
122
+ };
123
+ security: {
124
+ blockedHosts: Set<string>;
125
+ blockedIpPatterns: readonly RegExp[];
126
+ blockedIpPattern: RegExp;
127
+ blockedIpv4MappedPattern: RegExp;
128
+ allowedHosts: Set<string>;
129
+ apiKey: string | undefined;
130
+ allowRemote: boolean;
131
+ };
132
+ auth: AuthConfig;
133
+ rateLimit: {
134
+ enabled: boolean;
135
+ maxRequests: number;
136
+ windowMs: number;
137
+ cleanupIntervalMs: number;
138
+ };
139
+ runtime: RuntimeState;
140
+ };
141
+ export declare function enableHttpMode(): void;
142
+ export {};