feishu-user-plugin 1.3.0 → 1.3.2

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/src/setup.js CHANGED
@@ -12,7 +12,7 @@
12
12
  const readline = require('readline');
13
13
  const { findMcpConfig, writeNewConfig } = require('./config');
14
14
 
15
- // Parse CLI args: --app-id, --app-secret, --cookie
15
+ // Parse CLI args: --app-id, --app-secret, --cookie, --client
16
16
  function parseArgs() {
17
17
  const args = {};
18
18
  const argv = process.argv.slice(2);
@@ -20,6 +20,7 @@ function parseArgs() {
20
20
  if (argv[i] === '--app-id' && argv[i + 1]) args.appId = argv[++i];
21
21
  else if (argv[i] === '--app-secret' && argv[i + 1]) args.appSecret = argv[++i];
22
22
  else if (argv[i] === '--cookie' && argv[i + 1]) args.cookie = argv[++i];
23
+ else if (argv[i] === '--client' && argv[i + 1]) args.client = argv[++i];
23
24
  }
24
25
  return args;
25
26
  }
@@ -135,6 +136,20 @@ async function main() {
135
136
  const existingRT = existingEnv.LARK_USER_REFRESH_TOKEN;
136
137
  const hasUAT = existingUAT && existingUAT !== 'SETUP_NEEDED' && existingUAT.length > 20;
137
138
 
139
+ // Resolve target client
140
+ let client = cliArgs.client || null; // 'claude' | 'codex' | 'both' | null (interactive)
141
+ if (!client && !nonInteractive) {
142
+ console.log('\n--- Target Client ---');
143
+ console.log(' 1. Claude Code (default)');
144
+ console.log(' 2. Codex');
145
+ console.log(' 3. Both');
146
+ const choice = (await ask('Choose target [1]: ')).trim();
147
+ if (choice === '2') client = 'codex';
148
+ else if (choice === '3') client = 'both';
149
+ else client = 'claude';
150
+ }
151
+ if (!client) client = 'claude';
152
+
138
153
  // Write config
139
154
  console.log('\n--- Writing Config ---');
140
155
 
@@ -146,8 +161,9 @@ async function main() {
146
161
  LARK_USER_REFRESH_TOKEN: hasUAT ? (existingRT || '') : '',
147
162
  };
148
163
 
149
- const result = writeNewConfig(env);
150
- console.log(`Written to ${result.configPath} (global)`);
164
+ const result = writeNewConfig(env, undefined, undefined, client);
165
+ if (result.configPath) console.log(`Written to ${result.configPath} (Claude Code)`);
166
+ if (result.codexConfigPath) console.log(`Written to ${result.codexConfigPath} (Codex)`);
151
167
 
152
168
  // Summary
153
169
  console.log('\n' + '='.repeat(60));