@lmcc-dev/mult-fetch-mcp-server 1.1.0 → 1.2.0
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/README.md +8 -8
- package/README.zh.md +16 -8
- package/dist/i18n-test-report.json +8 -0
- package/dist/i18n-unused-keys-report.json +8 -0
- package/dist/src/client.js +50 -35
- package/dist/src/index.js +0 -0
- package/dist/src/lib/BrowserFetcher.js +12 -12
- package/dist/src/lib/NodeFetcher.js +22 -22
- package/dist/src/lib/fetch.js +40 -0
- package/dist/src/lib/fetchers/FetcherFactory.js +43 -0
- package/dist/src/lib/fetchers/browser/BrowserFetcher.js +381 -0
- package/dist/src/lib/fetchers/browser/BrowserInstance.js +180 -0
- package/dist/src/lib/fetchers/browser/PageOperations.js +168 -0
- package/dist/src/lib/fetchers/common/types.js +41 -0
- package/dist/src/lib/fetchers/common/utils.js +141 -0
- package/dist/src/lib/fetchers/index.js +62 -0
- package/dist/src/lib/fetchers/node/HttpClient.js +239 -0
- package/dist/src/lib/fetchers/node/NodeFetcher.js +180 -0
- package/dist/src/lib/i18n/index.js +105 -17
- package/dist/src/lib/i18n/keys/base.js +41 -0
- package/dist/src/lib/i18n/keys/browser.js +91 -0
- package/dist/src/lib/i18n/keys/client.js +68 -0
- package/dist/src/lib/i18n/keys/errors.js +49 -0
- package/dist/src/lib/i18n/keys/factory.js +46 -0
- package/dist/src/lib/i18n/keys/fetcher.js +87 -0
- package/dist/src/lib/i18n/keys/index.js +16 -0
- package/dist/src/lib/i18n/keys/node.js +69 -0
- package/dist/src/lib/i18n/keys/prompts.js +79 -0
- package/dist/src/lib/i18n/keys/resources.js +53 -0
- package/dist/src/lib/i18n/keys/server.js +67 -0
- package/dist/src/lib/i18n/keys/tools.js +39 -0
- package/dist/src/lib/i18n/keys.js +488 -119
- package/dist/src/lib/i18n/locales/en/browser.js +67 -57
- package/dist/src/lib/i18n/locales/en/client.js +57 -33
- package/dist/src/lib/i18n/locales/en/errors.js +36 -12
- package/dist/src/lib/i18n/locales/en/factory.js +38 -0
- package/dist/src/lib/i18n/locales/en/fetcher.js +8 -2
- package/dist/src/lib/i18n/locales/en/index.js +10 -8
- package/dist/src/lib/i18n/locales/en/node.js +57 -35
- package/dist/src/lib/i18n/locales/en/prompts.js +42 -65
- package/dist/src/lib/i18n/locales/en/resources.js +52 -55
- package/dist/src/lib/i18n/locales/en/server.js +49 -24
- package/dist/src/lib/i18n/locales/en/tools.js +27 -19
- package/dist/src/lib/i18n/locales/zh/browser.js +71 -62
- package/dist/src/lib/i18n/locales/zh/client.js +57 -32
- package/dist/src/lib/i18n/locales/zh/errors.js +36 -12
- package/dist/src/lib/i18n/locales/zh/factory.js +38 -0
- package/dist/src/lib/i18n/locales/zh/fetcher.js +36 -30
- package/dist/src/lib/i18n/locales/zh/index.js +10 -8
- package/dist/src/lib/i18n/locales/zh/node.js +61 -36
- package/dist/src/lib/i18n/locales/zh/prompts.js +35 -57
- package/dist/src/lib/i18n/locales/zh/resources.js +52 -55
- package/dist/src/lib/i18n/locales/zh/server.js +51 -25
- package/dist/src/lib/i18n/locales/zh/tools.js +27 -19
- package/dist/src/lib/i18n/logger.js +90 -19
- package/dist/src/lib/logger.js +135 -14
- package/dist/src/lib/server/browser.js +2 -2
- package/dist/src/lib/server/fetcher.js +13 -34
- package/dist/src/lib/server/index.js +2 -2
- package/dist/src/lib/server/prompts.js +1 -1
- package/dist/src/lib/server/resources.js +1 -1
- package/dist/src/lib/server/tools.js +46 -10
- package/dist/src/lib/utils/ErrorHandler.js +125 -0
- package/dist/src/mcp-server.js +0 -0
- package/dist/src/test-i18n.js +139 -0
- package/dist/tests/BrowserFetcher.test.js +0 -0
- package/dist/tests/NodeFetcher.test.js +0 -0
- package/dist/tests/client.test.js +42 -81
- package/dist/tests/fetch.test.js +70 -0
- package/dist/tests/fetchers/Fetcher.test.js +108 -0
- package/dist/tests/fetchers/browser/BrowserFetcher.test.js +195 -0
- package/dist/tests/fetchers/browser/BrowserInstance.test.js +163 -0
- package/dist/tests/fetchers/node/NodeFetcher.test.js +211 -0
- package/dist/tests/i18n-missing-keys.js +364 -0
- package/dist/tests/i18n-remove-unused-keys.js +236 -0
- package/dist/tests/i18n-test-report.json +2004 -0
- package/dist/tests/i18n-unused-keys.js +425 -0
- package/dist/tests/i18n.test.js +6 -7
- package/dist/tests/logger.test.js +14 -13
- package/dist/tests/mcp-server.test.js +7 -7
- package/dist/tests/server/browser.test.js +25 -21
- package/dist/tests/server/fetcher.test.js +58 -101
- package/dist/tests/server/index.test.js +30 -30
- package/dist/tests/server/prompts.test.js +36 -33
- package/dist/tests/server/resources.test.js +120 -84
- package/dist/tests/server/tools.test.js +7 -6
- package/dist/tests/setup.js +36 -0
- package/dist/tests/src/lib/i18n/index.js +108 -0
- package/dist/tests/src/lib/i18n/keys/base.js +47 -0
- package/dist/tests/src/lib/i18n/keys/browser.js +93 -0
- package/dist/tests/src/lib/i18n/keys/client.js +70 -0
- package/dist/tests/src/lib/i18n/keys/errors.js +34 -0
- package/dist/tests/src/lib/i18n/keys/fetcher.js +84 -0
- package/dist/tests/src/lib/i18n/keys/index.js +31 -0
- package/dist/tests/src/lib/i18n/keys/node.js +56 -0
- package/dist/tests/src/lib/i18n/keys/prompts.js +82 -0
- package/dist/tests/src/lib/i18n/keys/resources.js +50 -0
- package/dist/tests/src/lib/i18n/keys/server.js +64 -0
- package/dist/tests/src/lib/i18n/keys/tools.js +34 -0
- package/dist/tests/src/lib/i18n/locales/en/browser.js +88 -0
- package/dist/tests/src/lib/i18n/locales/en/client.js +66 -0
- package/dist/tests/src/lib/i18n/locales/en/errors.js +28 -0
- package/dist/tests/src/lib/i18n/locales/en/fetcher.js +71 -0
- package/dist/tests/src/lib/i18n/locales/en/index.js +29 -0
- package/dist/tests/src/lib/i18n/locales/en/node.js +51 -0
- package/dist/tests/src/lib/i18n/locales/en/prompts.js +52 -0
- package/dist/tests/src/lib/i18n/locales/en/resources.js +50 -0
- package/dist/tests/src/lib/i18n/locales/en/server.js +56 -0
- package/dist/tests/src/lib/i18n/locales/en/tools.js +28 -0
- package/dist/tests/src/lib/i18n/locales/zh/browser.js +87 -0
- package/dist/tests/src/lib/i18n/locales/zh/client.js +66 -0
- package/dist/tests/src/lib/i18n/locales/zh/errors.js +28 -0
- package/dist/tests/src/lib/i18n/locales/zh/fetcher.js +71 -0
- package/dist/tests/src/lib/i18n/locales/zh/index.js +29 -0
- package/dist/tests/src/lib/i18n/locales/zh/node.js +51 -0
- package/dist/tests/src/lib/i18n/locales/zh/prompts.js +53 -0
- package/dist/tests/src/lib/i18n/locales/zh/resources.js +50 -0
- package/dist/tests/src/lib/i18n/locales/zh/server.js +57 -0
- package/dist/tests/src/lib/i18n/locales/zh/tools.js +28 -0
- package/dist/tests/src/lib/i18n/logger.js +114 -0
- package/dist/tests/src/lib/logger.js +181 -0
- package/dist/tests/test-direct-client.js +0 -0
- package/dist/tests/test-i18n.js +530 -0
- package/dist/tests/test-mcp-methods.js +1 -1
- package/dist/tests/test-mcp.js +0 -0
- package/dist/tests/test-mini4k.js +0 -0
- package/dist/tests/tests/test-i18n.js +588 -0
- package/dist/tests/types.test.js +1 -1
- package/dist/tests/utils/ErrorHandler.test.js +144 -0
- package/dist/vitest.config.js +29 -0
- package/package.json +31 -27
- package/dist/src/cli-language.js +0 -78
- package/dist/src/client.d.ts +0 -6
- package/dist/src/client.js.map +0 -1
- package/dist/src/index.d.ts +0 -15
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/BrowserFetcher.d.ts +0 -175
- package/dist/src/lib/BrowserFetcher.js.map +0 -1
- package/dist/src/lib/NodeFetcher.d.ts +0 -92
- package/dist/src/lib/NodeFetcher.js.map +0 -1
- package/dist/src/lib/example.js +0 -93
- package/dist/src/lib/i18n/index.js.map +0 -1
- package/dist/src/lib/i18n/locales/en/browser.d.ts +0 -61
- package/dist/src/lib/i18n/locales/en/browser.js.map +0 -1
- package/dist/src/lib/i18n/locales/en/client.d.ts +0 -39
- package/dist/src/lib/i18n/locales/en/client.js.map +0 -1
- package/dist/src/lib/i18n/locales/en/errors.d.ts +0 -17
- package/dist/src/lib/i18n/locales/en/errors.js.map +0 -1
- package/dist/src/lib/i18n/locales/en/fetcher.d.ts +0 -66
- package/dist/src/lib/i18n/locales/en/fetcher.js.map +0 -1
- package/dist/src/lib/i18n/locales/en/index.d.ts +0 -344
- package/dist/src/lib/i18n/locales/en/index.js.map +0 -1
- package/dist/src/lib/i18n/locales/en/node.d.ts +0 -41
- package/dist/src/lib/i18n/locales/en/node.js.map +0 -1
- package/dist/src/lib/i18n/locales/en/prompts.d.ts +0 -65
- package/dist/src/lib/i18n/locales/en/prompts.js.map +0 -1
- package/dist/src/lib/i18n/locales/en/resources.d.ts +0 -41
- package/dist/src/lib/i18n/locales/en/resources.js.map +0 -1
- package/dist/src/lib/i18n/locales/en/server.d.ts +0 -30
- package/dist/src/lib/i18n/locales/en/server.js.map +0 -1
- package/dist/src/lib/i18n/locales/en/tools.d.ts +0 -24
- package/dist/src/lib/i18n/locales/en/tools.js.map +0 -1
- package/dist/src/lib/i18n/locales/zh/browser.d.ts +0 -61
- package/dist/src/lib/i18n/locales/zh/browser.js.map +0 -1
- package/dist/src/lib/i18n/locales/zh/client.d.ts +0 -38
- package/dist/src/lib/i18n/locales/zh/client.js.map +0 -1
- package/dist/src/lib/i18n/locales/zh/errors.d.ts +0 -17
- package/dist/src/lib/i18n/locales/zh/errors.js.map +0 -1
- package/dist/src/lib/i18n/locales/zh/fetcher.d.ts +0 -66
- package/dist/src/lib/i18n/locales/zh/fetcher.js.map +0 -1
- package/dist/src/lib/i18n/locales/zh/index.d.ts +0 -343
- package/dist/src/lib/i18n/locales/zh/index.js.map +0 -1
- package/dist/src/lib/i18n/locales/zh/node.d.ts +0 -41
- package/dist/src/lib/i18n/locales/zh/node.js.map +0 -1
- package/dist/src/lib/i18n/locales/zh/prompts.d.ts +0 -65
- package/dist/src/lib/i18n/locales/zh/prompts.js.map +0 -1
- package/dist/src/lib/i18n/locales/zh/resources.d.ts +0 -41
- package/dist/src/lib/i18n/locales/zh/resources.js.map +0 -1
- package/dist/src/lib/i18n/locales/zh/server.d.ts +0 -30
- package/dist/src/lib/i18n/locales/zh/server.js.map +0 -1
- package/dist/src/lib/i18n/locales/zh/tools.d.ts +0 -24
- package/dist/src/lib/i18n/locales/zh/tools.js.map +0 -1
- package/dist/src/lib/i18n/logger.d.ts +0 -38
- package/dist/src/lib/i18n/logger.js.map +0 -1
- package/dist/src/lib/logger.d.ts +0 -32
- package/dist/src/lib/logger.js.map +0 -1
- package/dist/src/lib/server/browser.d.ts +0 -34
- package/dist/src/lib/server/browser.js.map +0 -1
- package/dist/src/lib/server/fetcher.d.ts +0 -20
- package/dist/src/lib/server/fetcher.js.map +0 -1
- package/dist/src/lib/server/index.d.ts +0 -10
- package/dist/src/lib/server/index.js.map +0 -1
- package/dist/src/lib/server/logger.js +0 -23
- package/dist/src/lib/server/prompts.d.ts +0 -11
- package/dist/src/lib/server/prompts.js.map +0 -1
- package/dist/src/lib/server/resources.d.ts +0 -11
- package/dist/src/lib/server/resources.js.map +0 -1
- package/dist/src/lib/server/tools.d.ts +0 -12
- package/dist/src/lib/server/tools.js.map +0 -1
- package/dist/src/lib/server/types.d.ts +0 -71
- package/dist/src/lib/server/types.js.map +0 -1
- package/dist/src/lib/types.d.ts +0 -119
- package/dist/src/lib/types.js.map +0 -1
- package/dist/src/mcp-server.d.ts +0 -6
- package/dist/src/mcp-server.js.map +0 -1
- package/dist/tests/jest.setup.d.ts +0 -6
- package/dist/tests/jest.setup.js +0 -30
- package/dist/tests/jest.setup.js.map +0 -1
- package/dist/tests/test-direct-client.d.ts +0 -6
- package/dist/tests/test-direct-client.js.map +0 -1
- package/dist/tests/test-mcp-methods.d.ts +0 -6
- package/dist/tests/test-mcp-methods.js.map +0 -1
- package/dist/tests/test-mcp.d.ts +0 -6
- package/dist/tests/test-mcp.js.map +0 -1
- package/dist/tests/test-mini4k.d.ts +0 -6
- package/dist/tests/test-mini4k.js.map +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Author: Martin <lmccc.dev@gmail.com>
|
|
3
|
+
* Co-Author: AI Assistant (Claude)
|
|
4
|
+
* Description: This code was collaboratively developed by Martin and AI Assistant.
|
|
5
|
+
*/
|
|
6
|
+
import { createKeyGenerator } from './base.js';
|
|
7
|
+
/**
|
|
8
|
+
* 获取器相关键 (Fetcher related keys)
|
|
9
|
+
*/
|
|
10
|
+
export const FETCHER_KEYS = (() => {
|
|
11
|
+
const keyGen = createKeyGenerator('fetcher');
|
|
12
|
+
return {
|
|
13
|
+
// 延迟相关 (Delay related)
|
|
14
|
+
addingDelay: keyGen('addingDelay'),
|
|
15
|
+
delayCompleted: keyGen('delayCompleted'),
|
|
16
|
+
// 代理相关 (Proxy related)
|
|
17
|
+
usingProxy: keyGen('usingProxy'),
|
|
18
|
+
usingSpecifiedProxy: keyGen('usingSpecifiedProxy'),
|
|
19
|
+
attemptingToUseSystemProxy: keyGen('attemptingToUseSystemProxy'),
|
|
20
|
+
notUsingProxy: keyGen('notUsingProxy'),
|
|
21
|
+
finalProxyUsed: keyGen('finalProxyUsed'),
|
|
22
|
+
noProxy: keyGen('noProxy'),
|
|
23
|
+
foundNoProxy: keyGen('foundNoProxy'),
|
|
24
|
+
usingHttpsProxy: keyGen('usingHttpsProxy'),
|
|
25
|
+
usingHttpProxy: keyGen('usingHttpProxy'),
|
|
26
|
+
systemProxyDisabled: keyGen('systemProxyDisabled'),
|
|
27
|
+
// 请求相关 (Request related)
|
|
28
|
+
fetchingUrl: keyGen('fetchingUrl'),
|
|
29
|
+
usingUserAgent: keyGen('usingUserAgent'),
|
|
30
|
+
requestOptions: keyGen('requestOptions'),
|
|
31
|
+
startingFetch: keyGen('startingFetch'),
|
|
32
|
+
fetchCompleted: keyGen('fetchCompleted'),
|
|
33
|
+
// 响应相关 (Response related)
|
|
34
|
+
responseStatus: keyGen('responseStatus'),
|
|
35
|
+
redirectingTo: keyGen('redirectingTo'),
|
|
36
|
+
constructedFullRedirectUrl: keyGen('constructedFullRedirectUrl'),
|
|
37
|
+
requestSuccess: keyGen('requestSuccess'),
|
|
38
|
+
// 错误相关 (Error related)
|
|
39
|
+
errorResponse: keyGen('errorResponse'),
|
|
40
|
+
errorResponseBody: keyGen('errorResponseBody'),
|
|
41
|
+
errorReadingBody: keyGen('errorReadingBody'),
|
|
42
|
+
fetchError: keyGen('fetchError'),
|
|
43
|
+
requestAborted: keyGen('requestAborted'),
|
|
44
|
+
networkError: keyGen('networkError'),
|
|
45
|
+
requestTimeout: keyGen('requestTimeout'),
|
|
46
|
+
fetchFailed: keyGen('fetchFailed'),
|
|
47
|
+
tooManyRedirects: keyGen('tooManyRedirects'),
|
|
48
|
+
// 内容类型相关 (Content type related)
|
|
49
|
+
startingHtmlFetch: keyGen('startingHtmlFetch'),
|
|
50
|
+
fetchingHtml: keyGen('fetchingHtml'),
|
|
51
|
+
fetchingJson: keyGen('fetchingJson'),
|
|
52
|
+
fetchingTxt: keyGen('fetchingTxt'),
|
|
53
|
+
fetchingMarkdown: keyGen('fetchingMarkdown'),
|
|
54
|
+
readingText: keyGen('readingText'),
|
|
55
|
+
htmlContentLength: keyGen('htmlContentLength'),
|
|
56
|
+
startingJsonFetch: keyGen('startingJsonFetch'),
|
|
57
|
+
parsingJson: keyGen('parsingJson'),
|
|
58
|
+
jsonParsed: keyGen('jsonParsed'),
|
|
59
|
+
jsonParseError: keyGen('jsonParseError'),
|
|
60
|
+
startingTxtFetch: keyGen('startingTxtFetch'),
|
|
61
|
+
textContentLength: keyGen('textContentLength'),
|
|
62
|
+
startingMarkdownFetch: keyGen('startingMarkdownFetch'),
|
|
63
|
+
creatingTurndown: keyGen('creatingTurndown'),
|
|
64
|
+
convertingToMarkdown: keyGen('convertingToMarkdown'),
|
|
65
|
+
markdownContentLength: keyGen('markdownContentLength'),
|
|
66
|
+
// 系统代理相关 (System proxy related)
|
|
67
|
+
checkingProxyEnv: keyGen('checkingProxyEnv'),
|
|
68
|
+
envVarValue: keyGen('envVarValue'),
|
|
69
|
+
foundSystemProxy: keyGen('foundSystemProxy'),
|
|
70
|
+
systemCommandProxySettings: keyGen('systemCommandProxySettings'),
|
|
71
|
+
foundProxyFromCommand: keyGen('foundProxyFromCommand'),
|
|
72
|
+
errorGettingProxyFromCommand: keyGen('errorGettingProxyFromCommand'),
|
|
73
|
+
checkingSystemEnvVars: keyGen('checkingSystemEnvVars'),
|
|
74
|
+
windowsEnvVars: keyGen('windowsEnvVars'),
|
|
75
|
+
foundWindowsEnvProxy: keyGen('foundWindowsEnvProxy'),
|
|
76
|
+
errorGettingWindowsEnvVars: keyGen('errorGettingWindowsEnvVars'),
|
|
77
|
+
unixEnvVars: keyGen('unixEnvVars'),
|
|
78
|
+
foundUnixEnvProxy: keyGen('foundUnixEnvProxy'),
|
|
79
|
+
errorGettingUnixEnvVars: keyGen('errorGettingUnixEnvVars'),
|
|
80
|
+
errorGettingSystemEnvVars: keyGen('errorGettingSystemEnvVars'),
|
|
81
|
+
noSystemProxyFound: keyGen('noSystemProxyFound'),
|
|
82
|
+
// 通用 (General)
|
|
83
|
+
notSet: keyGen('notSet'),
|
|
84
|
+
debug: keyGen('debug'),
|
|
85
|
+
none: keyGen('none')
|
|
86
|
+
};
|
|
87
|
+
})();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Author: Martin <lmccc.dev@gmail.com>
|
|
3
|
+
* Co-Author: AI Assistant (Claude)
|
|
4
|
+
* Description: This code was collaboratively developed by Martin and AI Assistant.
|
|
5
|
+
*/
|
|
6
|
+
export * from './base.js';
|
|
7
|
+
export * from './browser.js';
|
|
8
|
+
export * from './client.js';
|
|
9
|
+
export * from './errors.js';
|
|
10
|
+
export * from './factory.js';
|
|
11
|
+
export * from './fetcher.js';
|
|
12
|
+
export * from './node.js';
|
|
13
|
+
export * from './prompts.js';
|
|
14
|
+
export * from './resources.js';
|
|
15
|
+
export * from './server.js';
|
|
16
|
+
export * from './tools.js';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Author: Martin <lmccc.dev@gmail.com>
|
|
3
|
+
* Co-Author: AI Assistant (Claude)
|
|
4
|
+
* Description: This code was collaboratively developed by Martin and AI Assistant.
|
|
5
|
+
*/
|
|
6
|
+
import { createKeyGenerator } from './base.js';
|
|
7
|
+
/**
|
|
8
|
+
* 节点相关键 (Node related keys)
|
|
9
|
+
*/
|
|
10
|
+
export const NODE_KEYS = (() => {
|
|
11
|
+
const keyGen = createKeyGenerator('node');
|
|
12
|
+
return {
|
|
13
|
+
// 延迟和代理相关 (Delay and proxy related)
|
|
14
|
+
addingDelay: keyGen('addingDelay'),
|
|
15
|
+
noProxy: keyGen('noProxy'),
|
|
16
|
+
usingProxy: keyGen('usingProxy'),
|
|
17
|
+
usingHttpsProxy: keyGen('usingHttpsProxy'),
|
|
18
|
+
usingHttpProxy: keyGen('usingHttpProxy'),
|
|
19
|
+
// 系统代理相关 (System proxy related)
|
|
20
|
+
checkingProxyEnv: keyGen('checkingProxyEnv'),
|
|
21
|
+
envVarValue: keyGen('envVarValue'),
|
|
22
|
+
foundSystemProxy: keyGen('foundSystemProxy'),
|
|
23
|
+
checkingSystemEnvVars: keyGen('checkingSystemEnvVars'),
|
|
24
|
+
windowsEnvVars: keyGen('windowsEnvVars'),
|
|
25
|
+
foundWindowsEnvProxy: keyGen('foundWindowsEnvProxy'),
|
|
26
|
+
errorGettingWindowsEnvVars: keyGen('errorGettingWindowsEnvVars'),
|
|
27
|
+
unixEnvVars: keyGen('unixEnvVars'),
|
|
28
|
+
foundUnixEnvProxy: keyGen('foundUnixEnvProxy'),
|
|
29
|
+
errorGettingUnixEnvVars: keyGen('errorGettingUnixEnvVars'),
|
|
30
|
+
noSystemProxyFound: keyGen('noSystemProxyFound'),
|
|
31
|
+
errorGettingSystemEnvVars: keyGen('errorGettingSystemEnvVars'),
|
|
32
|
+
foundNoProxy: keyGen('foundNoProxy'),
|
|
33
|
+
// 请求相关 (Request related)
|
|
34
|
+
usingUserAgent: keyGen('usingUserAgent'),
|
|
35
|
+
requestDetails: keyGen('requestDetails'),
|
|
36
|
+
requestOptions: keyGen('requestOptions'),
|
|
37
|
+
startingFetch: keyGen('startingFetch'),
|
|
38
|
+
fetchingUrl: keyGen('fetchingUrl'),
|
|
39
|
+
// 响应相关 (Response related)
|
|
40
|
+
responseStatus: keyGen('responseStatus'),
|
|
41
|
+
redirectingTo: keyGen('redirectingTo'),
|
|
42
|
+
constructedFullRedirectUrl: keyGen('constructedFullRedirectUrl'),
|
|
43
|
+
requestSuccess: keyGen('requestSuccess'),
|
|
44
|
+
// 错误相关 (Error related)
|
|
45
|
+
errorResponse: keyGen('errorResponse'),
|
|
46
|
+
errorResponseBody: keyGen('errorResponseBody'),
|
|
47
|
+
errorReadingBody: keyGen('errorReadingBody'),
|
|
48
|
+
fetchError: keyGen('fetchError'),
|
|
49
|
+
requestAborted: keyGen('requestAborted'),
|
|
50
|
+
networkError: keyGen('networkError'),
|
|
51
|
+
tooManyRedirects: keyGen('tooManyRedirects'),
|
|
52
|
+
// 内容类型相关 (Content type related)
|
|
53
|
+
startingHtmlFetch: keyGen('startingHtmlFetch'),
|
|
54
|
+
readingText: keyGen('readingText'),
|
|
55
|
+
htmlContentLength: keyGen('htmlContentLength'),
|
|
56
|
+
htmlFetchError: keyGen('htmlFetchError'),
|
|
57
|
+
startingJsonFetch: keyGen('startingJsonFetch'),
|
|
58
|
+
parsingJson: keyGen('parsingJson'),
|
|
59
|
+
jsonParsed: keyGen('jsonParsed'),
|
|
60
|
+
jsonParseError: keyGen('jsonParseError'),
|
|
61
|
+
jsonFetchError: keyGen('jsonFetchError'),
|
|
62
|
+
startingTxtFetch: keyGen('startingTxtFetch'),
|
|
63
|
+
textContentLength: keyGen('textContentLength'),
|
|
64
|
+
startingMarkdownFetch: keyGen('startingMarkdownFetch'),
|
|
65
|
+
creatingTurndown: keyGen('creatingTurndown'),
|
|
66
|
+
convertingToMarkdown: keyGen('convertingToMarkdown'),
|
|
67
|
+
markdownContentLength: keyGen('markdownContentLength')
|
|
68
|
+
};
|
|
69
|
+
})();
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Author: Martin <lmccc.dev@gmail.com>
|
|
3
|
+
* Co-Author: AI Assistant (Claude)
|
|
4
|
+
* Description: This code was collaboratively developed by Martin and AI Assistant.
|
|
5
|
+
*/
|
|
6
|
+
import { createKeyGenerator } from './base.js';
|
|
7
|
+
/**
|
|
8
|
+
* 提示相关键 (Prompts related keys)
|
|
9
|
+
*/
|
|
10
|
+
export const PROMPTS_KEYS = (() => {
|
|
11
|
+
const keyGen = createKeyGenerator('prompts');
|
|
12
|
+
return {
|
|
13
|
+
// 提示列表和获取 (Prompt list and get)
|
|
14
|
+
list: {
|
|
15
|
+
request: keyGen('list.request')
|
|
16
|
+
},
|
|
17
|
+
get: {
|
|
18
|
+
request: keyGen('get.request')
|
|
19
|
+
},
|
|
20
|
+
// 错误消息 (Error messages)
|
|
21
|
+
notFound: keyGen('notFound'),
|
|
22
|
+
missingRequiredArg: keyGen('missingRequiredArg'),
|
|
23
|
+
useBrowserValue: keyGen('useBrowserValue'),
|
|
24
|
+
// 通用提示 (Generic prompt)
|
|
25
|
+
generic: {
|
|
26
|
+
result: keyGen('generic.result'),
|
|
27
|
+
message: keyGen('generic.message'),
|
|
28
|
+
args: keyGen('generic.args')
|
|
29
|
+
},
|
|
30
|
+
// 是/否 (Yes/No)
|
|
31
|
+
yes: keyGen('yes'),
|
|
32
|
+
no: keyGen('no'),
|
|
33
|
+
// 提示描述和参数 (Prompt descriptions and parameters)
|
|
34
|
+
url: {
|
|
35
|
+
description: keyGen('url.description')
|
|
36
|
+
},
|
|
37
|
+
format: {
|
|
38
|
+
description: keyGen('format.description')
|
|
39
|
+
},
|
|
40
|
+
useBrowser: {
|
|
41
|
+
description: keyGen('useBrowser.description')
|
|
42
|
+
},
|
|
43
|
+
selector: {
|
|
44
|
+
description: keyGen('selector.description')
|
|
45
|
+
},
|
|
46
|
+
dataType: {
|
|
47
|
+
description: keyGen('dataType.description')
|
|
48
|
+
},
|
|
49
|
+
error: {
|
|
50
|
+
description: keyGen('error.description')
|
|
51
|
+
},
|
|
52
|
+
// 获取网站提示 (Fetch website prompt)
|
|
53
|
+
fetchWebsite: {
|
|
54
|
+
description: keyGen('fetchWebsite.description'),
|
|
55
|
+
result: keyGen('fetchWebsite.result'),
|
|
56
|
+
message: keyGen('fetchWebsite.message'),
|
|
57
|
+
response: keyGen('fetchWebsite.response'),
|
|
58
|
+
instruction: keyGen('fetchWebsite.instruction'),
|
|
59
|
+
formatInstruction: keyGen('fetchWebsite.formatInstruction'),
|
|
60
|
+
browserInstruction: keyGen('fetchWebsite.browserInstruction')
|
|
61
|
+
},
|
|
62
|
+
// 提取内容提示 (Extract content prompt)
|
|
63
|
+
extractContent: {
|
|
64
|
+
description: keyGen('extractContent.description'),
|
|
65
|
+
result: keyGen('extractContent.result'),
|
|
66
|
+
message: keyGen('extractContent.message'),
|
|
67
|
+
selectorInstruction: keyGen('extractContent.selectorInstruction'),
|
|
68
|
+
dataTypeInstruction: keyGen('extractContent.dataTypeInstruction')
|
|
69
|
+
},
|
|
70
|
+
// 调试获取提示 (Debug fetch prompt)
|
|
71
|
+
debugFetch: {
|
|
72
|
+
description: keyGen('debugFetch.description'),
|
|
73
|
+
result: keyGen('debugFetch.result'),
|
|
74
|
+
message: keyGen('debugFetch.message'),
|
|
75
|
+
errorDetails: keyGen('debugFetch.errorDetails'),
|
|
76
|
+
instruction: keyGen('debugFetch.instruction')
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
})();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Author: Martin <lmccc.dev@gmail.com>
|
|
3
|
+
* Co-Author: AI Assistant (Claude)
|
|
4
|
+
* Description: This code was collaboratively developed by Martin and AI Assistant.
|
|
5
|
+
*/
|
|
6
|
+
import { createKeyGenerator, createResourceKeys } from './base.js';
|
|
7
|
+
/**
|
|
8
|
+
* 资源相关键 (Resources related keys)
|
|
9
|
+
*/
|
|
10
|
+
export const RESOURCES_KEYS = (() => {
|
|
11
|
+
const keyGen = createKeyGenerator('resources');
|
|
12
|
+
const resourceKeys = createResourceKeys('resources');
|
|
13
|
+
return {
|
|
14
|
+
...resourceKeys,
|
|
15
|
+
// 读取操作 (Read operations)
|
|
16
|
+
read: {
|
|
17
|
+
request: keyGen('read.request'),
|
|
18
|
+
success: keyGen('read.success'),
|
|
19
|
+
error: keyGen('read.error'),
|
|
20
|
+
notFound: keyGen('read.notFound')
|
|
21
|
+
},
|
|
22
|
+
// 额外的资源相关键 (Additional resource related keys)
|
|
23
|
+
fileReadError: keyGen('fileReadError'),
|
|
24
|
+
invalidUri: keyGen('invalidUri'),
|
|
25
|
+
notFound: keyGen('notFound'),
|
|
26
|
+
readError: keyGen('readError'),
|
|
27
|
+
// 资源描述 (Resource descriptions)
|
|
28
|
+
readme: {
|
|
29
|
+
description: keyGen('readme.description')
|
|
30
|
+
},
|
|
31
|
+
package: {
|
|
32
|
+
description: keyGen('package.description')
|
|
33
|
+
},
|
|
34
|
+
index: {
|
|
35
|
+
description: keyGen('index.description')
|
|
36
|
+
},
|
|
37
|
+
client: {
|
|
38
|
+
description: keyGen('client.description')
|
|
39
|
+
},
|
|
40
|
+
// 资源模板描述 (Resource template descriptions)
|
|
41
|
+
sourceFile: {
|
|
42
|
+
name: keyGen('sourceFile.name'),
|
|
43
|
+
description: keyGen('sourceFile.description')
|
|
44
|
+
},
|
|
45
|
+
docFile: {
|
|
46
|
+
name: keyGen('docFile.name'),
|
|
47
|
+
description: keyGen('docFile.description')
|
|
48
|
+
},
|
|
49
|
+
filename: {
|
|
50
|
+
description: keyGen('filename.description')
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
})();
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Author: Martin <lmccc.dev@gmail.com>
|
|
3
|
+
* Co-Author: AI Assistant (Claude)
|
|
4
|
+
* Description: This code was collaboratively developed by Martin and AI Assistant.
|
|
5
|
+
*/
|
|
6
|
+
import { createKeyGenerator } from './base.js';
|
|
7
|
+
/**
|
|
8
|
+
* 服务器相关键 (Server related keys)
|
|
9
|
+
*/
|
|
10
|
+
export const SERVER_KEYS = (() => {
|
|
11
|
+
const keyGen = createKeyGenerator('server');
|
|
12
|
+
return {
|
|
13
|
+
// 服务器状态 (Server status)
|
|
14
|
+
starting: keyGen('starting'),
|
|
15
|
+
started: keyGen('started'),
|
|
16
|
+
stopping: keyGen('stopping'),
|
|
17
|
+
stopped: keyGen('stopped'),
|
|
18
|
+
error: keyGen('error'),
|
|
19
|
+
startupError: keyGen('startupError'),
|
|
20
|
+
// 连接相关 (Connection related)
|
|
21
|
+
connecting: keyGen('connecting'),
|
|
22
|
+
connected: keyGen('connected'),
|
|
23
|
+
connectionFailed: keyGen('connectionFailed'),
|
|
24
|
+
disconnected: keyGen('disconnected'),
|
|
25
|
+
connectionError: keyGen('connectionError'),
|
|
26
|
+
// 错误相关 (Error related)
|
|
27
|
+
serverError: keyGen('serverError'),
|
|
28
|
+
transportError: keyGen('transportError'),
|
|
29
|
+
// 请求处理 (Request handling)
|
|
30
|
+
receivedRequest: keyGen('receivedRequest'),
|
|
31
|
+
processingRequest: keyGen('processingRequest'),
|
|
32
|
+
requestCompleted: keyGen('requestCompleted'),
|
|
33
|
+
requestError: keyGen('requestError'),
|
|
34
|
+
requestReceived: keyGen('requestReceived'),
|
|
35
|
+
requestProcessed: keyGen('requestProcessed'),
|
|
36
|
+
requestFailed: keyGen('requestFailed'),
|
|
37
|
+
// 浏览器相关 (Browser related)
|
|
38
|
+
initializingBrowser: keyGen('initializingBrowser'),
|
|
39
|
+
browserInitialized: keyGen('browserInitialized'),
|
|
40
|
+
browserInitFailed: keyGen('browserInitFailed'),
|
|
41
|
+
closingBrowser: keyGen('closingBrowser'),
|
|
42
|
+
browserClosed: keyGen('browserClosed'),
|
|
43
|
+
// 工具相关 (Tool related)
|
|
44
|
+
tool: {
|
|
45
|
+
requestReceived: keyGen('tool.requestReceived'),
|
|
46
|
+
requestProcessed: keyGen('tool.requestProcessed'),
|
|
47
|
+
requestError: keyGen('tool.requestError')
|
|
48
|
+
},
|
|
49
|
+
// 系统相关 (System related)
|
|
50
|
+
receivedInterruptSignal: keyGen('receivedInterruptSignal'),
|
|
51
|
+
receivedTerminateSignal: keyGen('receivedTerminateSignal'),
|
|
52
|
+
uncaughtException: keyGen('uncaughtException'),
|
|
53
|
+
debug: keyGen('debug'),
|
|
54
|
+
listeningOn: keyGen('listeningOn'),
|
|
55
|
+
// 入口相关 (Entry related)
|
|
56
|
+
entry: {
|
|
57
|
+
loaded: keyGen('entry.loaded')
|
|
58
|
+
},
|
|
59
|
+
// 其他键 (Other keys)
|
|
60
|
+
receivedToolRequest: keyGen('receivedToolRequest'),
|
|
61
|
+
processingToolRequestError: keyGen('processingToolRequestError'),
|
|
62
|
+
usingBrowserMode: keyGen('usingBrowserMode'),
|
|
63
|
+
usingAutoDetectMode: keyGen('usingAutoDetectMode'),
|
|
64
|
+
switchingToBrowserMode: keyGen('switchingToBrowserMode'),
|
|
65
|
+
fetchError: keyGen('fetchError')
|
|
66
|
+
};
|
|
67
|
+
})();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Author: Martin <lmccc.dev@gmail.com>
|
|
3
|
+
* Co-Author: AI Assistant (Claude)
|
|
4
|
+
* Description: This code was collaboratively developed by Martin and AI Assistant.
|
|
5
|
+
*/
|
|
6
|
+
import { createKeyGenerator } from './base.js';
|
|
7
|
+
/**
|
|
8
|
+
* 工具相关键 (Tools related keys)
|
|
9
|
+
*/
|
|
10
|
+
export const TOOLS_KEYS = (() => {
|
|
11
|
+
const keyGen = createKeyGenerator('tools');
|
|
12
|
+
return {
|
|
13
|
+
// 通用工具描述 (General tool descriptions)
|
|
14
|
+
fetchHtmlDescription: keyGen('fetchHtmlDescription'),
|
|
15
|
+
fetchJsonDescription: keyGen('fetchJsonDescription'),
|
|
16
|
+
fetchTxtDescription: keyGen('fetchTxtDescription'),
|
|
17
|
+
fetchMarkdownDescription: keyGen('fetchMarkdownDescription'),
|
|
18
|
+
// 参数描述 (Parameter descriptions)
|
|
19
|
+
urlDescription: keyGen('urlDescription'),
|
|
20
|
+
// 错误消息 (Error messages)
|
|
21
|
+
fetchHtmlError: keyGen('fetchHtmlError'),
|
|
22
|
+
fetchJsonError: keyGen('fetchJsonError'),
|
|
23
|
+
fetchTxtError: keyGen('fetchTxtError'),
|
|
24
|
+
fetchMarkdownError: keyGen('fetchMarkdownError'),
|
|
25
|
+
jsonParseWarning: keyGen('jsonParseWarning'),
|
|
26
|
+
// 成功消息 (Success messages)
|
|
27
|
+
fetchHtmlSuccess: keyGen('fetchHtmlSuccess'),
|
|
28
|
+
fetchJsonSuccess: keyGen('fetchJsonSuccess'),
|
|
29
|
+
fetchTxtSuccess: keyGen('fetchTxtSuccess'),
|
|
30
|
+
fetchMarkdownSuccess: keyGen('fetchMarkdownSuccess'),
|
|
31
|
+
// 工具调用相关 (Tool call related)
|
|
32
|
+
callReceived: keyGen('callReceived'),
|
|
33
|
+
unknownTool: keyGen('unknownTool'),
|
|
34
|
+
callError: keyGen('callError'),
|
|
35
|
+
missingUrl: keyGen('missingUrl'),
|
|
36
|
+
fetchRequest: keyGen('fetchRequest'),
|
|
37
|
+
fetchError: keyGen('fetchError')
|
|
38
|
+
};
|
|
39
|
+
})();
|