coding-agent-adapters 0.13.0 → 0.14.0
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 +45 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +45 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -589,6 +589,16 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
|
|
|
589
589
|
* Explicit responseType: 'text' prevents the usesTuiMenus default from kicking in.
|
|
590
590
|
*/
|
|
591
591
|
autoResponseRules = [
|
|
592
|
+
{
|
|
593
|
+
pattern: /choose\s+the\s+text\s+style\s+that\s+looks\s+best\s+with\s+your\s+terminal|syntax\s+theme:/i,
|
|
594
|
+
type: "config",
|
|
595
|
+
response: "",
|
|
596
|
+
responseType: "keys",
|
|
597
|
+
keys: ["enter"],
|
|
598
|
+
description: "Accept Claude first-run theme/style prompt",
|
|
599
|
+
safe: true,
|
|
600
|
+
once: true
|
|
601
|
+
},
|
|
592
602
|
{
|
|
593
603
|
pattern: /trust.*(?:folder|directory)|safety.?check|project.you.created|(?:Yes|Allow).*(?:No|Deny).*(?:Enter|Return)/i,
|
|
594
604
|
type: "permission",
|
|
@@ -1095,7 +1105,8 @@ jq -nc --arg event "${"$"}EVENT" --arg notification_type "${"$"}NOTIFICATION
|
|
|
1095
1105
|
const hasConversationalReadyText = stripped.includes("How can I help") || stripped.includes("What would you like");
|
|
1096
1106
|
const hasLegacyPrompt = /claude>/i.test(tail);
|
|
1097
1107
|
const hasShortcutsHint = stripped.includes("for shortcuts");
|
|
1098
|
-
|
|
1108
|
+
const hasInteractivePromptBar = /❯\s+\S/.test(tail) && (/\/effort/i.test(stripped) || /Welcome back/i.test(stripped) || /Recent activity/i.test(stripped) || /What's new/i.test(stripped));
|
|
1109
|
+
return hasConversationalReadyText || hasLegacyPrompt || hasShortcutsHint || hasInteractivePromptBar;
|
|
1099
1110
|
}
|
|
1100
1111
|
parseOutput(output) {
|
|
1101
1112
|
const withoutHookMarkers = this.stripHookMarkers(output);
|
|
@@ -1947,12 +1958,20 @@ var CodexAdapter = class extends BaseCodingAdapter {
|
|
|
1947
1958
|
return false;
|
|
1948
1959
|
}
|
|
1949
1960
|
detectReady(output) {
|
|
1961
|
+
const rawTail = output.slice(-2e3);
|
|
1962
|
+
const hasRawComposerSignals = /OpenAI\s+Codex/i.test(rawTail) && (/Explain\s+this\s+codebase/i.test(rawTail) || /Summarize\s+recent\s+commits/i.test(rawTail) || /Ask\s+Codex\s+to\s+do\s+anything/i.test(rawTail) || /\?\s+for\s+shortcuts/i.test(rawTail) || /context\s+left/i.test(rawTail));
|
|
1963
|
+
if (hasRawComposerSignals) {
|
|
1964
|
+
return true;
|
|
1965
|
+
}
|
|
1950
1966
|
const stripped = this.stripAnsi(output);
|
|
1951
1967
|
if (!stripped.trim()) return false;
|
|
1952
1968
|
const tail = stripped.slice(-1200);
|
|
1953
1969
|
const hasComposerPrompt = /^\s*›\s*(?!\d+\.)\S.*$/m.test(tail) || /›\s+Ask\s+Codex\s+to\s+do\s+anything/.test(tail);
|
|
1954
1970
|
const hasComposerFooter = /\?\s+for\s+shortcuts/i.test(tail) || /context\s+left/i.test(tail) || /tab\s+to\s+queue\s+message/i.test(tail) || /shift\s*\+\s*enter\s+for\s+newline/i.test(tail);
|
|
1955
|
-
|
|
1971
|
+
const hasStartupComposerHints = /Summarize\s+recent\s+commits/i.test(tail) || /Explain\s+this\s+codebase/i.test(tail) || /Ask\s+Codex\s+to\s+do\s+anything/i.test(tail);
|
|
1972
|
+
const hasCodexHeader = /OpenAI\s+Codex/i.test(tail) && /directory:\s+~?\/?.+/i.test(tail);
|
|
1973
|
+
const hasInteractiveStatusBar = /gpt-[\w.-]+\s+(?:high|medium|low)/i.test(tail) && /left\b/i.test(tail);
|
|
1974
|
+
if (hasComposerPrompt || hasComposerFooter || hasStartupComposerHints || hasCodexHeader && hasInteractiveStatusBar) {
|
|
1956
1975
|
return true;
|
|
1957
1976
|
}
|
|
1958
1977
|
if (/do.?you.?trust.?the.?contents/i.test(stripped) || /sign.?in.?with.?chatgpt/i.test(stripped) || /update.?available/i.test(stripped) || /enable.?full.?access/i.test(stripped) || /choose.?working.?directory/i.test(stripped)) {
|
|
@@ -2061,6 +2080,14 @@ var AiderAdapter = class extends BaseCodingAdapter {
|
|
|
2061
2080
|
description: "Decline automatic bug report",
|
|
2062
2081
|
safe: true
|
|
2063
2082
|
},
|
|
2083
|
+
{
|
|
2084
|
+
pattern: /open documentation url for more info\?/i,
|
|
2085
|
+
type: "config",
|
|
2086
|
+
response: "n",
|
|
2087
|
+
responseType: "text",
|
|
2088
|
+
description: "Decline opening Aider documentation for model warnings",
|
|
2089
|
+
safe: true
|
|
2090
|
+
},
|
|
2064
2091
|
// ── File / edit operations ──────────────────────────────────────────
|
|
2065
2092
|
{
|
|
2066
2093
|
pattern: /add .+ to the chat\?/i,
|
|
@@ -2234,8 +2261,9 @@ var AiderAdapter = class extends BaseCodingAdapter {
|
|
|
2234
2261
|
}
|
|
2235
2262
|
getArgs(config) {
|
|
2236
2263
|
const args = [];
|
|
2237
|
-
|
|
2238
|
-
if (!
|
|
2264
|
+
const interactive = this.isInteractive(config);
|
|
2265
|
+
if (!interactive) {
|
|
2266
|
+
args.push("--auto-commits");
|
|
2239
2267
|
args.push("--no-pretty");
|
|
2240
2268
|
args.push("--no-show-diffs");
|
|
2241
2269
|
}
|
|
@@ -2243,22 +2271,26 @@ var AiderAdapter = class extends BaseCodingAdapter {
|
|
|
2243
2271
|
const credentials = this.getCredentials(config);
|
|
2244
2272
|
if (config.env?.AIDER_MODEL) {
|
|
2245
2273
|
args.push("--model", config.env.AIDER_MODEL);
|
|
2246
|
-
} else if (
|
|
2274
|
+
} else if (interactive && (credentials.googleKey || process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY)) {
|
|
2275
|
+
args.push("--model", "gemini");
|
|
2276
|
+
} else if (!interactive && provider === "anthropic") {
|
|
2247
2277
|
args.push("--model", "sonnet");
|
|
2248
|
-
} else if (provider === "openai") {
|
|
2278
|
+
} else if (!interactive && provider === "openai") {
|
|
2249
2279
|
args.push("--model", "4o");
|
|
2250
|
-
} else if (provider === "google") {
|
|
2280
|
+
} else if (!interactive && provider === "google") {
|
|
2251
2281
|
args.push("--model", "gemini");
|
|
2252
|
-
} else if (credentials.anthropicKey) {
|
|
2282
|
+
} else if (!interactive && credentials.anthropicKey) {
|
|
2253
2283
|
args.push("--model", "sonnet");
|
|
2254
|
-
} else if (credentials.openaiKey) {
|
|
2284
|
+
} else if (!interactive && credentials.openaiKey) {
|
|
2255
2285
|
args.push("--model", "4o");
|
|
2256
|
-
} else if (credentials.googleKey) {
|
|
2286
|
+
} else if (!interactive && credentials.googleKey) {
|
|
2257
2287
|
args.push("--model", "gemini");
|
|
2258
2288
|
}
|
|
2259
|
-
if (
|
|
2260
|
-
|
|
2261
|
-
|
|
2289
|
+
if (!interactive) {
|
|
2290
|
+
if (credentials.anthropicKey) args.push("--api-key", `anthropic=${credentials.anthropicKey}`);
|
|
2291
|
+
if (credentials.openaiKey) args.push("--api-key", `openai=${credentials.openaiKey}`);
|
|
2292
|
+
if (credentials.googleKey) args.push("--api-key", `gemini=${credentials.googleKey}`);
|
|
2293
|
+
}
|
|
2262
2294
|
const approvalConfig = this.getApprovalConfig(config);
|
|
2263
2295
|
if (approvalConfig) {
|
|
2264
2296
|
args.push(...approvalConfig.cliFlags);
|