coding-agent-adapters 0.6.0 → 0.7.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/README.md +27 -0
- package/dist/index.cjs +77 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -214,6 +214,12 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
|
|
|
214
214
|
* Extract the main content from CLI output, removing common artifacts
|
|
215
215
|
*/
|
|
216
216
|
protected extractContent(output: string, promptPattern: RegExp): string;
|
|
217
|
+
/**
|
|
218
|
+
* Detect if the CLI is actively loading/processing (thinking spinner,
|
|
219
|
+
* file reading, model streaming, etc.). When true, stall detection is
|
|
220
|
+
* suppressed because the agent is provably working.
|
|
221
|
+
*/
|
|
222
|
+
abstract detectLoading(output: string): boolean;
|
|
217
223
|
/**
|
|
218
224
|
* Detect if the CLI has completed a task and returned to its idle prompt.
|
|
219
225
|
* More specific than detectReady() — matches high-confidence completion indicators
|
|
@@ -275,6 +281,14 @@ declare class ClaudeAdapter extends BaseCodingAdapter {
|
|
|
275
281
|
* Detect blocking prompts specific to Claude Code CLI
|
|
276
282
|
*/
|
|
277
283
|
detectBlockingPrompt(output: string): BlockingPromptDetection;
|
|
284
|
+
/**
|
|
285
|
+
* Detect if Claude Code is actively loading/processing.
|
|
286
|
+
*
|
|
287
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
288
|
+
* - claude_active_reading_files: "Reading N files…"
|
|
289
|
+
* - General: "esc to interrupt" spinner status line
|
|
290
|
+
*/
|
|
291
|
+
detectLoading(output: string): boolean;
|
|
278
292
|
/**
|
|
279
293
|
* Detect task completion for Claude Code.
|
|
280
294
|
*
|
|
@@ -316,6 +330,14 @@ declare class GeminiAdapter extends BaseCodingAdapter {
|
|
|
316
330
|
getEnv(config: SpawnConfig): Record<string, string>;
|
|
317
331
|
detectLogin(output: string): LoginDetection;
|
|
318
332
|
detectBlockingPrompt(output: string): BlockingPromptDetection;
|
|
333
|
+
/**
|
|
334
|
+
* Detect if Gemini CLI is actively loading/processing.
|
|
335
|
+
*
|
|
336
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
337
|
+
* - gemini_active_loading_line: "(esc to cancel, Xs)"
|
|
338
|
+
* - gemini_active_waiting_user_confirmation: "Waiting for user confirmation..."
|
|
339
|
+
*/
|
|
340
|
+
detectLoading(output: string): boolean;
|
|
319
341
|
/**
|
|
320
342
|
* Detect task completion for Gemini CLI.
|
|
321
343
|
*
|
|
@@ -369,6 +391,15 @@ declare class CodexAdapter extends BaseCodingAdapter {
|
|
|
369
391
|
* Source: approval_overlay.rs, chatwidget.rs, request_user_input/mod.rs
|
|
370
392
|
*/
|
|
371
393
|
detectBlockingPrompt(output: string): BlockingPromptDetection;
|
|
394
|
+
/**
|
|
395
|
+
* Detect if Codex CLI is actively loading/processing.
|
|
396
|
+
*
|
|
397
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
398
|
+
* - codex_active_status_row: "• Working (0s • esc to interrupt)"
|
|
399
|
+
* - codex_active_booting_mcp: "Booting MCP server: ..."
|
|
400
|
+
* - codex_active_web_search: "Searching the web"
|
|
401
|
+
*/
|
|
402
|
+
detectLoading(output: string): boolean;
|
|
372
403
|
/**
|
|
373
404
|
* Detect task completion for Codex CLI.
|
|
374
405
|
*
|
|
@@ -432,6 +463,15 @@ declare class AiderAdapter extends BaseCodingAdapter {
|
|
|
432
463
|
* Source: io.py, onboarding.py, base_coder.py, report.py
|
|
433
464
|
*/
|
|
434
465
|
detectBlockingPrompt(output: string): BlockingPromptDetection;
|
|
466
|
+
/**
|
|
467
|
+
* Detect if Aider is actively loading/processing.
|
|
468
|
+
*
|
|
469
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
470
|
+
* - aider_active_waiting_model: "Waiting for <model>"
|
|
471
|
+
* - aider_active_waiting_llm_default: "Waiting for LLM"
|
|
472
|
+
* - aider_active_generating_commit_message: "Generating commit message with ..."
|
|
473
|
+
*/
|
|
474
|
+
detectLoading(output: string): boolean;
|
|
435
475
|
/**
|
|
436
476
|
* Detect task completion for Aider.
|
|
437
477
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -214,6 +214,12 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
|
|
|
214
214
|
* Extract the main content from CLI output, removing common artifacts
|
|
215
215
|
*/
|
|
216
216
|
protected extractContent(output: string, promptPattern: RegExp): string;
|
|
217
|
+
/**
|
|
218
|
+
* Detect if the CLI is actively loading/processing (thinking spinner,
|
|
219
|
+
* file reading, model streaming, etc.). When true, stall detection is
|
|
220
|
+
* suppressed because the agent is provably working.
|
|
221
|
+
*/
|
|
222
|
+
abstract detectLoading(output: string): boolean;
|
|
217
223
|
/**
|
|
218
224
|
* Detect if the CLI has completed a task and returned to its idle prompt.
|
|
219
225
|
* More specific than detectReady() — matches high-confidence completion indicators
|
|
@@ -275,6 +281,14 @@ declare class ClaudeAdapter extends BaseCodingAdapter {
|
|
|
275
281
|
* Detect blocking prompts specific to Claude Code CLI
|
|
276
282
|
*/
|
|
277
283
|
detectBlockingPrompt(output: string): BlockingPromptDetection;
|
|
284
|
+
/**
|
|
285
|
+
* Detect if Claude Code is actively loading/processing.
|
|
286
|
+
*
|
|
287
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
288
|
+
* - claude_active_reading_files: "Reading N files…"
|
|
289
|
+
* - General: "esc to interrupt" spinner status line
|
|
290
|
+
*/
|
|
291
|
+
detectLoading(output: string): boolean;
|
|
278
292
|
/**
|
|
279
293
|
* Detect task completion for Claude Code.
|
|
280
294
|
*
|
|
@@ -316,6 +330,14 @@ declare class GeminiAdapter extends BaseCodingAdapter {
|
|
|
316
330
|
getEnv(config: SpawnConfig): Record<string, string>;
|
|
317
331
|
detectLogin(output: string): LoginDetection;
|
|
318
332
|
detectBlockingPrompt(output: string): BlockingPromptDetection;
|
|
333
|
+
/**
|
|
334
|
+
* Detect if Gemini CLI is actively loading/processing.
|
|
335
|
+
*
|
|
336
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
337
|
+
* - gemini_active_loading_line: "(esc to cancel, Xs)"
|
|
338
|
+
* - gemini_active_waiting_user_confirmation: "Waiting for user confirmation..."
|
|
339
|
+
*/
|
|
340
|
+
detectLoading(output: string): boolean;
|
|
319
341
|
/**
|
|
320
342
|
* Detect task completion for Gemini CLI.
|
|
321
343
|
*
|
|
@@ -369,6 +391,15 @@ declare class CodexAdapter extends BaseCodingAdapter {
|
|
|
369
391
|
* Source: approval_overlay.rs, chatwidget.rs, request_user_input/mod.rs
|
|
370
392
|
*/
|
|
371
393
|
detectBlockingPrompt(output: string): BlockingPromptDetection;
|
|
394
|
+
/**
|
|
395
|
+
* Detect if Codex CLI is actively loading/processing.
|
|
396
|
+
*
|
|
397
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
398
|
+
* - codex_active_status_row: "• Working (0s • esc to interrupt)"
|
|
399
|
+
* - codex_active_booting_mcp: "Booting MCP server: ..."
|
|
400
|
+
* - codex_active_web_search: "Searching the web"
|
|
401
|
+
*/
|
|
402
|
+
detectLoading(output: string): boolean;
|
|
372
403
|
/**
|
|
373
404
|
* Detect task completion for Codex CLI.
|
|
374
405
|
*
|
|
@@ -432,6 +463,15 @@ declare class AiderAdapter extends BaseCodingAdapter {
|
|
|
432
463
|
* Source: io.py, onboarding.py, base_coder.py, report.py
|
|
433
464
|
*/
|
|
434
465
|
detectBlockingPrompt(output: string): BlockingPromptDetection;
|
|
466
|
+
/**
|
|
467
|
+
* Detect if Aider is actively loading/processing.
|
|
468
|
+
*
|
|
469
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
470
|
+
* - aider_active_waiting_model: "Waiting for <model>"
|
|
471
|
+
* - aider_active_waiting_llm_default: "Waiting for LLM"
|
|
472
|
+
* - aider_active_generating_commit_message: "Generating commit message with ..."
|
|
473
|
+
*/
|
|
474
|
+
detectLoading(output: string): boolean;
|
|
435
475
|
/**
|
|
436
476
|
* Detect task completion for Aider.
|
|
437
477
|
*
|
package/dist/index.js
CHANGED
|
@@ -758,6 +758,24 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
|
|
|
758
758
|
}
|
|
759
759
|
return super.detectBlockingPrompt(output);
|
|
760
760
|
}
|
|
761
|
+
/**
|
|
762
|
+
* Detect if Claude Code is actively loading/processing.
|
|
763
|
+
*
|
|
764
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
765
|
+
* - claude_active_reading_files: "Reading N files…"
|
|
766
|
+
* - General: "esc to interrupt" spinner status line
|
|
767
|
+
*/
|
|
768
|
+
detectLoading(output) {
|
|
769
|
+
const stripped = this.stripAnsi(output);
|
|
770
|
+
const tail = stripped.slice(-500);
|
|
771
|
+
if (/esc\s+to\s+interrupt/i.test(tail)) {
|
|
772
|
+
return true;
|
|
773
|
+
}
|
|
774
|
+
if (/Reading\s+\d+\s+files/i.test(tail)) {
|
|
775
|
+
return true;
|
|
776
|
+
}
|
|
777
|
+
return false;
|
|
778
|
+
}
|
|
761
779
|
/**
|
|
762
780
|
* Detect task completion for Claude Code.
|
|
763
781
|
*
|
|
@@ -1049,6 +1067,24 @@ var GeminiAdapter = class extends BaseCodingAdapter {
|
|
|
1049
1067
|
}
|
|
1050
1068
|
return super.detectBlockingPrompt(output);
|
|
1051
1069
|
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Detect if Gemini CLI is actively loading/processing.
|
|
1072
|
+
*
|
|
1073
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
1074
|
+
* - gemini_active_loading_line: "(esc to cancel, Xs)"
|
|
1075
|
+
* - gemini_active_waiting_user_confirmation: "Waiting for user confirmation..."
|
|
1076
|
+
*/
|
|
1077
|
+
detectLoading(output) {
|
|
1078
|
+
const stripped = this.stripAnsi(output);
|
|
1079
|
+
const tail = stripped.slice(-500);
|
|
1080
|
+
if (/esc\s+to\s+cancel/i.test(tail)) {
|
|
1081
|
+
return true;
|
|
1082
|
+
}
|
|
1083
|
+
if (/Waiting\s+for\s+user\s+confirmation/i.test(tail)) {
|
|
1084
|
+
return true;
|
|
1085
|
+
}
|
|
1086
|
+
return false;
|
|
1087
|
+
}
|
|
1052
1088
|
/**
|
|
1053
1089
|
* Detect task completion for Gemini CLI.
|
|
1054
1090
|
*
|
|
@@ -1385,6 +1421,28 @@ var CodexAdapter = class extends BaseCodingAdapter {
|
|
|
1385
1421
|
}
|
|
1386
1422
|
return super.detectBlockingPrompt(output);
|
|
1387
1423
|
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Detect if Codex CLI is actively loading/processing.
|
|
1426
|
+
*
|
|
1427
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
1428
|
+
* - codex_active_status_row: "• Working (0s • esc to interrupt)"
|
|
1429
|
+
* - codex_active_booting_mcp: "Booting MCP server: ..."
|
|
1430
|
+
* - codex_active_web_search: "Searching the web"
|
|
1431
|
+
*/
|
|
1432
|
+
detectLoading(output) {
|
|
1433
|
+
const stripped = this.stripAnsi(output);
|
|
1434
|
+
const tail = stripped.slice(-500);
|
|
1435
|
+
if (/esc\s+to\s+interrupt/i.test(tail)) {
|
|
1436
|
+
return true;
|
|
1437
|
+
}
|
|
1438
|
+
if (/Booting\s+MCP\s+server/i.test(tail)) {
|
|
1439
|
+
return true;
|
|
1440
|
+
}
|
|
1441
|
+
if (/Searching\s+the\s+web/i.test(tail)) {
|
|
1442
|
+
return true;
|
|
1443
|
+
}
|
|
1444
|
+
return false;
|
|
1445
|
+
}
|
|
1388
1446
|
/**
|
|
1389
1447
|
* Detect task completion for Codex CLI.
|
|
1390
1448
|
*
|
|
@@ -1817,6 +1875,25 @@ var AiderAdapter = class extends BaseCodingAdapter {
|
|
|
1817
1875
|
}
|
|
1818
1876
|
return super.detectBlockingPrompt(output);
|
|
1819
1877
|
}
|
|
1878
|
+
/**
|
|
1879
|
+
* Detect if Aider is actively loading/processing.
|
|
1880
|
+
*
|
|
1881
|
+
* Patterns from: AGENT_LOADING_STATUS_PATTERNS.json
|
|
1882
|
+
* - aider_active_waiting_model: "Waiting for <model>"
|
|
1883
|
+
* - aider_active_waiting_llm_default: "Waiting for LLM"
|
|
1884
|
+
* - aider_active_generating_commit_message: "Generating commit message with ..."
|
|
1885
|
+
*/
|
|
1886
|
+
detectLoading(output) {
|
|
1887
|
+
const stripped = this.stripAnsi(output);
|
|
1888
|
+
const tail = stripped.slice(-500);
|
|
1889
|
+
if (/Waiting\s+for\s+(?:LLM|[A-Za-z0-9_./:@-]+)/i.test(tail)) {
|
|
1890
|
+
return true;
|
|
1891
|
+
}
|
|
1892
|
+
if (/Generating\s+commit\s+message\s+with\s+/i.test(tail)) {
|
|
1893
|
+
return true;
|
|
1894
|
+
}
|
|
1895
|
+
return false;
|
|
1896
|
+
}
|
|
1820
1897
|
/**
|
|
1821
1898
|
* Detect task completion for Aider.
|
|
1822
1899
|
*
|