search-mcp-rotator 1.1.2 → 1.1.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/README.md +1 -1
- package/dist/detector.d.ts +15 -21
- package/dist/detector.js +500 -210
- package/dist/multi-proxy.d.ts +1 -1
- package/dist/multi-proxy.js +52 -28
- package/dist/proxy.d.ts +4 -4
- package/dist/proxy.js +46 -32
- package/dist/setup.js +2 -2
- package/package.json +2 -1
package/README.md
CHANGED
package/dist/detector.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { ExhaustionError, ExhaustionPatternConfig } from
|
|
1
|
+
import type { ExhaustionError, ExhaustionPatternConfig } from "./types.js";
|
|
2
2
|
export declare const PROVIDER_EXHAUSTION_CONFIG: {
|
|
3
3
|
readonly exa: {
|
|
4
4
|
readonly httpStatusCodes: readonly [401, 402, 429];
|
|
5
5
|
readonly jsonRpcErrorCodes: readonly [-32000];
|
|
6
|
-
readonly messagePatterns: readonly ["invalid api key", "no_more_credits", "api_key_budget_exceeded", "team_budget_exceeded", "credits exhausted", "payment required", "account credits", "spending budget", "rate limit", "too many requests", "you've exceeded your exa rate limit", "you've hit exa's free mcp rate limit", "quota"];
|
|
6
|
+
readonly messagePatterns: readonly ["invalid api key", "no_more_credits", "api_key_budget_exceeded", "team_budget_exceeded", "x402_payment_required", "credits exhausted", "payment required", "account credits", "spending budget", "rate limit", "too many requests", "you've exceeded your exa rate limit", "you've hit exa's free mcp rate limit", "quota"];
|
|
7
7
|
readonly cooldownOverrides: {
|
|
8
|
-
readonly 402:
|
|
9
|
-
readonly 401:
|
|
8
|
+
readonly 402: number;
|
|
9
|
+
readonly 401: number;
|
|
10
10
|
};
|
|
11
11
|
readonly hasRetryAfterHeader: true;
|
|
12
12
|
};
|
|
@@ -15,54 +15,54 @@ export declare const PROVIDER_EXHAUSTION_CONFIG: {
|
|
|
15
15
|
readonly jsonRpcErrorCodes: readonly [];
|
|
16
16
|
readonly messagePatterns: readonly ["rate limit exceeded", "request rate limit exceeded", "concurrency limit reached", "payment required", "insufficient credits", "payment required to access", "unauthorized: invalid token", "unauthorized: token missing", "unauthorized", "retry after", "error creating server"];
|
|
17
17
|
readonly cooldownOverrides: {
|
|
18
|
-
readonly 402:
|
|
19
|
-
readonly 401:
|
|
18
|
+
readonly 402: number;
|
|
19
|
+
readonly 401: number;
|
|
20
20
|
};
|
|
21
21
|
readonly hasRetryAfterHeader: true;
|
|
22
22
|
};
|
|
23
23
|
readonly tavily: {
|
|
24
24
|
readonly httpStatusCodes: readonly [401, 429, 432, 433];
|
|
25
25
|
readonly jsonRpcErrorCodes: readonly [];
|
|
26
|
-
readonly messagePatterns: readonly ["authentication required", "unauthorized", "invalid api key", "missing or invalid", "excessive requests", "rate of requests", "usage limit", "pay-as-you-go", "paygo limit"
|
|
26
|
+
readonly messagePatterns: readonly ["authentication required", "unauthorized", "invalid api key", "missing or invalid", "excessive requests", "rate of requests", "usage limit", "pay-as-you-go", "paygo limit"];
|
|
27
27
|
readonly cooldownOverrides: {
|
|
28
|
-
readonly 432:
|
|
29
|
-
readonly 433:
|
|
30
|
-
readonly 401:
|
|
28
|
+
readonly 432: number;
|
|
29
|
+
readonly 433: number;
|
|
30
|
+
readonly 401: number;
|
|
31
31
|
};
|
|
32
32
|
readonly hasRetryAfterHeader: true;
|
|
33
33
|
};
|
|
34
34
|
readonly linkup: {
|
|
35
35
|
readonly httpStatusCodes: readonly [401, 403, 429];
|
|
36
36
|
readonly jsonRpcErrorCodes: readonly [-32000];
|
|
37
|
-
readonly messagePatterns: readonly ["unauthorized action", "api key is required", "
|
|
37
|
+
readonly messagePatterns: readonly ["unauthorized action", "api key is required", "insufficient_funds_credits", "too_many_requests", "too many requests", "out of credit", "insufficient funds", "rate limit"];
|
|
38
38
|
readonly cooldownOverrides: {};
|
|
39
39
|
readonly hasRetryAfterHeader: false;
|
|
40
40
|
};
|
|
41
41
|
readonly brightdata: {
|
|
42
42
|
readonly httpStatusCodes: readonly [401, 402, 407, 429];
|
|
43
43
|
readonly jsonRpcErrorCodes: readonly [];
|
|
44
|
-
readonly messagePatterns: readonly ["
|
|
44
|
+
readonly messagePatterns: readonly ["auth method is not supported", "token expired", "5,000 request monthly limit", "monthly limit for bright data mcp", "usage limit", "zone has reached usage limit", "client_10100", "client_10110", "policy_20130", "policy_20140", "policy_20220", "policy_20221", "policy_20222", "account is suspended", "kyc required"];
|
|
45
45
|
readonly cooldownOverrides: {};
|
|
46
46
|
readonly hasRetryAfterHeader: false;
|
|
47
47
|
};
|
|
48
48
|
readonly olostep: {
|
|
49
49
|
readonly httpStatusCodes: readonly [401, 402, 403];
|
|
50
50
|
readonly jsonRpcErrorCodes: readonly [];
|
|
51
|
-
readonly messagePatterns: readonly ["invalid_api_key", "invalid api key", "your api key is invalid", "credits exhausted", "payment required", "olostep api error: 401", "olostep api error: 402", "olostep api error: 403"];
|
|
51
|
+
readonly messagePatterns: readonly ["invalid_api_key", "invalid api key", "your api key is invalid", "credits exhausted", "payment required", "olostep api error: 401", "olostep api error: 402", "olostep api error: 403", "access denied", "feature approval required", "feature not enabled"];
|
|
52
52
|
readonly cooldownOverrides: {};
|
|
53
53
|
readonly hasRetryAfterHeader: false;
|
|
54
54
|
};
|
|
55
55
|
readonly dappier: {
|
|
56
56
|
readonly httpStatusCodes: readonly [401, 402];
|
|
57
57
|
readonly jsonRpcErrorCodes: readonly [];
|
|
58
|
-
readonly messagePatterns: readonly ["error: failed to retrieve real-time information", "error: failed to retrieve", "error: unable to retrieve", "error: authentication", "error: unauthorized", "missing authentication"];
|
|
58
|
+
readonly messagePatterns: readonly ["error: failed to retrieve real-time information", "error: failed to retrieve", "error: unable to retrieve", "error: authentication", "error: unauthorized", "error: invalid", "quota", "rate limit", "credits", "billing", "missing authentication"];
|
|
59
59
|
readonly cooldownOverrides: {};
|
|
60
60
|
readonly hasRetryAfterHeader: false;
|
|
61
61
|
};
|
|
62
62
|
readonly parallel: {
|
|
63
63
|
readonly httpStatusCodes: readonly [401, 402, 429];
|
|
64
64
|
readonly jsonRpcErrorCodes: readonly [];
|
|
65
|
-
readonly messagePatterns: readonly ["oauth.v2.invalidapikey", "steps.oauth.v2.failedtoresolveapikey", "oauth.v2.apikeyexpired", "oauth.v2.apikeynotapproved", "invalid apikey", "failedtoresolveapikey", "invalid api key", "rate limit", "too many requests", "insufficient credit", "quota exceeded", "code\":16"];
|
|
65
|
+
readonly messagePatterns: readonly ["oauth.v2.invalidapikey", "steps.oauth.v2.failedtoresolveapikey", "oauth.v2.invalidapikeyforgivenresource", "oauth.v2.apikeyexpired", "oauth.v2.apikeynotapproved", "invalid apikey", "failedtoresolveapikey", "failed to resolve api key", "invalid api key", "invalid api key (c.1)", "rate limit exceeded", "too many requests", "insufficient credit", "insufficient credits", "payment required", "account balance depleted", "quota exceeded", "code\":16", "code\": 16"];
|
|
66
66
|
readonly cooldownOverrides: {};
|
|
67
67
|
readonly hasRetryAfterHeader: false;
|
|
68
68
|
};
|
|
@@ -71,9 +71,6 @@ export declare class ExhaustionDetector {
|
|
|
71
71
|
private patterns;
|
|
72
72
|
private providerName;
|
|
73
73
|
constructor(providerName: string, customPatterns?: Partial<ExhaustionPatternConfig>);
|
|
74
|
-
/**
|
|
75
|
-
* Determine if an error indicates key exhaustion
|
|
76
|
-
*/
|
|
77
74
|
isExhausted(error: ExhaustionError): boolean;
|
|
78
75
|
private isExaExhausted;
|
|
79
76
|
private isFirecrawlExhausted;
|
|
@@ -85,7 +82,4 @@ export declare class ExhaustionDetector {
|
|
|
85
82
|
private isParallelExhausted;
|
|
86
83
|
private isGenericExhausted;
|
|
87
84
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Extract cooldown duration from error (if provider specifies it)
|
|
90
|
-
*/
|
|
91
85
|
export declare function extractCooldown(error: ExhaustionError, providerName: string, defaultCooldownMs: number): number;
|