@pikecode/api-key-manager 2.1.3 → 2.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikecode/api-key-manager",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "A CLI tool for managing and switching multiple API provider configurations",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -59,21 +59,14 @@ async function executeWithEnv(config, launchArgs = []) {
59
59
 
60
60
  return new Promise((resolve, reject) => {
61
61
  const child = spawn('claude', args, {
62
- stdio: ['inherit', 'pipe', 'pipe'],
62
+ stdio: ['inherit', 'inherit', 'pipe'],
63
63
  env,
64
64
  shell: false
65
65
  });
66
66
 
67
67
  let stderrOutput = '';
68
- let stdoutOutput = '';
69
-
70
- // 捕获 stdout 和 stderr 用于检查错误信息
71
- child.stdout.on('data', (data) => {
72
- const output = data.toString();
73
- stdoutOutput += output;
74
- process.stdout.write(data);
75
- });
76
68
 
69
+ // 捕获 stderr 用于检查错误信息
77
70
  child.stderr.on('data', (data) => {
78
71
  const output = data.toString();
79
72
  stderrOutput += output;
@@ -85,11 +78,12 @@ async function executeWithEnv(config, launchArgs = []) {
85
78
  resolve();
86
79
  } else {
87
80
  // 检查是否是"没有可恢复会话"的错误
88
- // 检查 stdout 和 stderr 中是否包含错误消息
89
- const combinedOutput = (stderrOutput + stdoutOutput).toLowerCase();
81
+ // 检查 stderr 中是否包含各种格式的错误消息
82
+ const errorOutput = stderrOutput.toLowerCase();
90
83
  const isNoConversationError =
91
- combinedOutput.includes('no conversation found') ||
92
- combinedOutput.includes('no recoverable session');
84
+ errorOutput.includes('no conversation found') ||
85
+ errorOutput.includes('no recoverable session') ||
86
+ errorOutput.includes('no deferred tool marker');
93
87
 
94
88
  if (isNoConversationError) {
95
89
  const error = new Error('没有可恢复的会话\n提示: 请选择不带 --continue 参数重新开始');