search-mcp-rotator 1.0.2 → 1.0.3

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/index.js CHANGED
@@ -5,11 +5,15 @@ import { ExhaustionDetector } from './detector.js';
5
5
  import { AuthInjector } from './auth-injector.js';
6
6
  import { MCPProxy } from './proxy.js';
7
7
  import { logger, setLogLevel, setProvider } from './logger.js';
8
+ import { runSetup } from './setup.js';
8
9
  function parseArgs(argv) {
9
10
  const args = {};
10
11
  for (let i = 2; i < argv.length; i++) {
11
12
  const arg = argv[i];
12
- if (arg.startsWith('--provider=')) {
13
+ if (arg === '--setup') {
14
+ args.setup = true;
15
+ }
16
+ else if (arg.startsWith('--provider=')) {
13
17
  args.provider = arg.split('=')[1];
14
18
  }
15
19
  else if (arg.startsWith('--config=')) {
@@ -27,6 +31,10 @@ function parseArgs(argv) {
27
31
  async function main() {
28
32
  try {
29
33
  const args = parseArgs(process.argv);
34
+ if (args.setup) {
35
+ await runSetup(args.config);
36
+ return;
37
+ }
30
38
  const providerName = args.provider;
31
39
  if (!providerName) {
32
40
  throw new Error('--provider argument required. Usage: search-mcp-rotator --provider=<name>');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "search-mcp-rotator",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Local MCP proxy with automatic API key rotation",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -6,13 +6,16 @@ import { ExhaustionDetector } from './detector.js'
6
6
  import { AuthInjector } from './auth-injector.js'
7
7
  import { MCPProxy } from './proxy.js'
8
8
  import { logger, setLogLevel, setProvider } from './logger.js'
9
+ import { runSetup } from './setup.js'
9
10
 
10
- function parseArgs(argv: string[]): { provider?: string; config?: string } {
11
- const args: { provider?: string; config?: string } = {}
11
+ function parseArgs(argv: string[]): { provider?: string; config?: string; setup?: boolean } {
12
+ const args: { provider?: string; config?: string; setup?: boolean } = {}
12
13
 
13
14
  for (let i = 2; i < argv.length; i++) {
14
15
  const arg = argv[i]
15
- if (arg.startsWith('--provider=')) {
16
+ if (arg === '--setup') {
17
+ args.setup = true
18
+ } else if (arg.startsWith('--provider=')) {
16
19
  args.provider = arg.split('=')[1]
17
20
  } else if (arg.startsWith('--config=')) {
18
21
  args.config = arg.split('=')[1]
@@ -29,6 +32,12 @@ function parseArgs(argv: string[]): { provider?: string; config?: string } {
29
32
  async function main(): Promise<void> {
30
33
  try {
31
34
  const args = parseArgs(process.argv)
35
+
36
+ if (args.setup) {
37
+ await runSetup(args.config)
38
+ return
39
+ }
40
+
32
41
  const providerName = args.provider
33
42
 
34
43
  if (!providerName) {