coding-agent-adapters 0.8.2 → 0.8.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/dist/index.cjs CHANGED
@@ -755,7 +755,7 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
755
755
  instructions: "Use Enter/Esc or arrow keys to navigate this dialog"
756
756
  };
757
757
  }
758
- if (/\/agents\b|\/chrome\b|\/config\b|\/tasks\b|\/skills\b|\/remote-env\b|press .* to navigate .* enter .* esc/i.test(stripped)) {
758
+ if (/press .* to navigate .* enter .* esc|use (?:arrow|↑↓) keys|enter to select|esc to (?:go back|close|cancel)/i.test(stripped) || /(?:^|\n)\s*(?:❯|>)\s*\/(?:agents|chrome|config|tasks|skills|remote-env)\b/im.test(stripped)) {
759
759
  return {
760
760
  detected: true,
761
761
  type: "config",
@@ -850,20 +850,18 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
850
850
  detectToolRunning(output) {
851
851
  const stripped = this.stripAnsi(output);
852
852
  const tail = stripped.slice(-500);
853
+ const contextualMatch = tail.match(/Claude\s+in\s+([A-Za-z0-9._-]+)\s*\[(\w+_tool)\]/i);
854
+ if (contextualMatch) {
855
+ const appName = contextualMatch[1];
856
+ const toolType = contextualMatch[2].toLowerCase();
857
+ const friendlyName = toolType.replace(/_tool$/i, "");
858
+ return { toolName: friendlyName, description: `${appName} (${toolType})` };
859
+ }
853
860
  const toolMatch = tail.match(/\[(\w+_tool)\]/i);
854
861
  if (toolMatch) {
855
862
  const toolType = toolMatch[1].toLowerCase();
856
863
  const friendlyName = toolType.replace(/_tool$/i, "");
857
- const contextMatch = tail.match(/(?:Claude\s+in|Running|Using)\s+(\S+)/i);
858
- const description = contextMatch ? `${contextMatch[1]} (${toolType})` : toolType;
859
- return { toolName: friendlyName, description };
860
- }
861
- const appMatch = tail.match(/Claude\s+in\s+(\w+)/i);
862
- if (appMatch) {
863
- return {
864
- toolName: appMatch[1].toLowerCase(),
865
- description: `Claude in ${appMatch[1]}`
866
- };
864
+ return { toolName: friendlyName, description: toolType };
867
865
  }
868
866
  return null;
869
867
  }
@@ -938,11 +936,11 @@ var GeminiAdapter = class extends BaseCodingAdapter {
938
936
  adapterType = "gemini";
939
937
  displayName = "Google Gemini";
940
938
  installation = {
941
- command: "npm install -g @anthropics/gemini-cli",
939
+ command: "npm install -g @google/gemini-cli",
942
940
  alternatives: [
943
941
  "See documentation for latest installation method"
944
942
  ],
945
- docsUrl: "https://github.com/anthropics/gemini-cli#installation"
943
+ docsUrl: "https://github.com/google-gemini/gemini-cli#installation"
946
944
  };
947
945
  /**
948
946
  * Auto-response rules for Gemini CLI.
@@ -1105,6 +1103,15 @@ var GeminiAdapter = class extends BaseCodingAdapter {
1105
1103
  instructions: "Gemini is asking to apply a change (file write, shell command, etc.)"
1106
1104
  };
1107
1105
  }
1106
+ if (/do.?you.?want.?to.?continue\s*\([yY]\/[nN]\)\??/i.test(stripped) || /continue\??\s*\([yY]\/[nN]\)\??/i.test(stripped) || /are.?you.?sure\??\s*\([yY]\/[nN]\)\??/i.test(stripped)) {
1107
+ return {
1108
+ detected: true,
1109
+ type: "tool_wait",
1110
+ prompt: "Interactive shell confirmation required (y/n)",
1111
+ canAutoRespond: false,
1112
+ instructions: "Focus shell input (Tab) and answer the y/n confirmation prompt"
1113
+ };
1114
+ }
1108
1115
  if (/Interactive\s+shell\s+awaiting\s+input/i.test(stripped)) {
1109
1116
  return {
1110
1117
  detected: true,
@@ -1114,6 +1121,15 @@ var GeminiAdapter = class extends BaseCodingAdapter {
1114
1121
  instructions: "Press Tab to focus the interactive shell, or wait for it to complete"
1115
1122
  };
1116
1123
  }
1124
+ if (/enable.?checkpointing.?to.?recover.?your.?session.?after.?a.?crash/i.test(stripped)) {
1125
+ return {
1126
+ detected: true,
1127
+ type: "config",
1128
+ prompt: "Gemini checkpoint setup prompt",
1129
+ canAutoRespond: false,
1130
+ instructions: 'Respond to checkpoint setup prompt (for example: press "s" to configure or dismiss)'
1131
+ };
1132
+ }
1117
1133
  const loginDetection = this.detectLogin(output);
1118
1134
  if (loginDetection.required) {
1119
1135
  return {
@@ -1203,6 +1219,10 @@ var GeminiAdapter = class extends BaseCodingAdapter {
1203
1219
  }
1204
1220
  detectReady(output) {
1205
1221
  const stripped = this.stripAnsi(output);
1222
+ const hasActiveOverlay = /interactive\s+shell\s+awaiting\s+input|press\s+tab\s+to\s+focus\s+shell/i.test(stripped) || /waiting\s+for\s+user\s+confirmation|apply.?this.?change|allow.?execution|do.?you.?want.?to.?proceed/i.test(stripped) || /do.?you.?want.?to.?continue\s*\([yY]\/[nN]\)\??|are.?you.?sure\??\s*\([yY]\/[nN]\)\??/i.test(stripped) || /enable.?checkpointing.?to.?recover.?your.?session.?after.?a.?crash/i.test(stripped) || /esc\s+to\s+cancel|esc\s+to\s+interrupt/i.test(stripped);
1223
+ if (hasActiveOverlay) {
1224
+ return false;
1225
+ }
1206
1226
  if (/type.?your.?message/i.test(stripped)) {
1207
1227
  return true;
1208
1228
  }
@@ -2299,20 +2319,20 @@ function createAdapter(type) {
2299
2319
  return new AdapterClass();
2300
2320
  }
2301
2321
  async function checkAdapters(types) {
2302
- const results = [];
2303
- for (const type of types) {
2304
- const adapter = createAdapter(type);
2305
- const validation = await adapter.validateInstallation();
2306
- results.push({
2307
- adapter: adapter.displayName,
2308
- installed: validation.installed,
2309
- version: validation.version,
2310
- error: validation.error,
2311
- installCommand: adapter.installation.command,
2312
- docsUrl: adapter.installation.docsUrl
2313
- });
2314
- }
2315
- return results;
2322
+ return Promise.all(
2323
+ types.map(async (type) => {
2324
+ const adapter = createAdapter(type);
2325
+ const validation = await adapter.validateInstallation();
2326
+ return {
2327
+ adapter: adapter.displayName,
2328
+ installed: validation.installed,
2329
+ version: validation.version,
2330
+ error: validation.error,
2331
+ installCommand: adapter.installation.command,
2332
+ docsUrl: adapter.installation.docsUrl
2333
+ };
2334
+ })
2335
+ );
2316
2336
  }
2317
2337
  async function checkAllAdapters() {
2318
2338
  return checkAdapters(Object.keys(ADAPTER_TYPES));