coding-agent-adapters 0.8.3 → 0.8.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/dist/index.cjs +47 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +47 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -753,7 +753,7 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
|
|
|
753
753
|
instructions: "Use Enter/Esc or arrow keys to navigate this dialog"
|
|
754
754
|
};
|
|
755
755
|
}
|
|
756
|
-
if (
|
|
756
|
+
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)) {
|
|
757
757
|
return {
|
|
758
758
|
detected: true,
|
|
759
759
|
type: "config",
|
|
@@ -848,20 +848,18 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
|
|
|
848
848
|
detectToolRunning(output) {
|
|
849
849
|
const stripped = this.stripAnsi(output);
|
|
850
850
|
const tail = stripped.slice(-500);
|
|
851
|
+
const contextualMatch = tail.match(/Claude\s+in\s+([A-Za-z0-9._-]+)\s*\[(\w+_tool)\]/i);
|
|
852
|
+
if (contextualMatch) {
|
|
853
|
+
const appName = contextualMatch[1];
|
|
854
|
+
const toolType = contextualMatch[2].toLowerCase();
|
|
855
|
+
const friendlyName = toolType.replace(/_tool$/i, "");
|
|
856
|
+
return { toolName: friendlyName, description: `${appName} (${toolType})` };
|
|
857
|
+
}
|
|
851
858
|
const toolMatch = tail.match(/\[(\w+_tool)\]/i);
|
|
852
859
|
if (toolMatch) {
|
|
853
860
|
const toolType = toolMatch[1].toLowerCase();
|
|
854
861
|
const friendlyName = toolType.replace(/_tool$/i, "");
|
|
855
|
-
|
|
856
|
-
const description = contextMatch ? `${contextMatch[1]} (${toolType})` : toolType;
|
|
857
|
-
return { toolName: friendlyName, description };
|
|
858
|
-
}
|
|
859
|
-
const appMatch = tail.match(/Claude\s+in\s+(\w+)/i);
|
|
860
|
-
if (appMatch) {
|
|
861
|
-
return {
|
|
862
|
-
toolName: appMatch[1].toLowerCase(),
|
|
863
|
-
description: `Claude in ${appMatch[1]}`
|
|
864
|
-
};
|
|
862
|
+
return { toolName: friendlyName, description: toolType };
|
|
865
863
|
}
|
|
866
864
|
return null;
|
|
867
865
|
}
|
|
@@ -936,11 +934,11 @@ var GeminiAdapter = class extends BaseCodingAdapter {
|
|
|
936
934
|
adapterType = "gemini";
|
|
937
935
|
displayName = "Google Gemini";
|
|
938
936
|
installation = {
|
|
939
|
-
command: "npm install -g @
|
|
937
|
+
command: "npm install -g @google/gemini-cli",
|
|
940
938
|
alternatives: [
|
|
941
939
|
"See documentation for latest installation method"
|
|
942
940
|
],
|
|
943
|
-
docsUrl: "https://github.com/
|
|
941
|
+
docsUrl: "https://github.com/google-gemini/gemini-cli#installation"
|
|
944
942
|
};
|
|
945
943
|
/**
|
|
946
944
|
* Auto-response rules for Gemini CLI.
|
|
@@ -1103,6 +1101,15 @@ var GeminiAdapter = class extends BaseCodingAdapter {
|
|
|
1103
1101
|
instructions: "Gemini is asking to apply a change (file write, shell command, etc.)"
|
|
1104
1102
|
};
|
|
1105
1103
|
}
|
|
1104
|
+
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)) {
|
|
1105
|
+
return {
|
|
1106
|
+
detected: true,
|
|
1107
|
+
type: "tool_wait",
|
|
1108
|
+
prompt: "Interactive shell confirmation required (y/n)",
|
|
1109
|
+
canAutoRespond: false,
|
|
1110
|
+
instructions: "Focus shell input (Tab) and answer the y/n confirmation prompt"
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1106
1113
|
if (/Interactive\s+shell\s+awaiting\s+input/i.test(stripped)) {
|
|
1107
1114
|
return {
|
|
1108
1115
|
detected: true,
|
|
@@ -1112,6 +1119,15 @@ var GeminiAdapter = class extends BaseCodingAdapter {
|
|
|
1112
1119
|
instructions: "Press Tab to focus the interactive shell, or wait for it to complete"
|
|
1113
1120
|
};
|
|
1114
1121
|
}
|
|
1122
|
+
if (/enable.?checkpointing.?to.?recover.?your.?session.?after.?a.?crash/i.test(stripped)) {
|
|
1123
|
+
return {
|
|
1124
|
+
detected: true,
|
|
1125
|
+
type: "config",
|
|
1126
|
+
prompt: "Gemini checkpoint setup prompt",
|
|
1127
|
+
canAutoRespond: false,
|
|
1128
|
+
instructions: 'Respond to checkpoint setup prompt (for example: press "s" to configure or dismiss)'
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1115
1131
|
const loginDetection = this.detectLogin(output);
|
|
1116
1132
|
if (loginDetection.required) {
|
|
1117
1133
|
return {
|
|
@@ -1201,6 +1217,10 @@ var GeminiAdapter = class extends BaseCodingAdapter {
|
|
|
1201
1217
|
}
|
|
1202
1218
|
detectReady(output) {
|
|
1203
1219
|
const stripped = this.stripAnsi(output);
|
|
1220
|
+
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);
|
|
1221
|
+
if (hasActiveOverlay) {
|
|
1222
|
+
return false;
|
|
1223
|
+
}
|
|
1204
1224
|
if (/type.?your.?message/i.test(stripped)) {
|
|
1205
1225
|
return true;
|
|
1206
1226
|
}
|
|
@@ -2297,20 +2317,20 @@ function createAdapter(type) {
|
|
|
2297
2317
|
return new AdapterClass();
|
|
2298
2318
|
}
|
|
2299
2319
|
async function checkAdapters(types) {
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2320
|
+
return Promise.all(
|
|
2321
|
+
types.map(async (type) => {
|
|
2322
|
+
const adapter = createAdapter(type);
|
|
2323
|
+
const validation = await adapter.validateInstallation();
|
|
2324
|
+
return {
|
|
2325
|
+
adapter: adapter.displayName,
|
|
2326
|
+
installed: validation.installed,
|
|
2327
|
+
version: validation.version,
|
|
2328
|
+
error: validation.error,
|
|
2329
|
+
installCommand: adapter.installation.command,
|
|
2330
|
+
docsUrl: adapter.installation.docsUrl
|
|
2331
|
+
};
|
|
2332
|
+
})
|
|
2333
|
+
);
|
|
2314
2334
|
}
|
|
2315
2335
|
async function checkAllAdapters() {
|
|
2316
2336
|
return checkAdapters(Object.keys(ADAPTER_TYPES));
|