coding-agent-adapters 0.5.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/dist/index.d.cts CHANGED
@@ -151,6 +151,12 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
151
151
  * Coding agent CLIs use TUI menus that require arrow-key navigation.
152
152
  */
153
153
  readonly usesTuiMenus: boolean;
154
+ /**
155
+ * Ms of output silence after detectReady match before emitting session_ready.
156
+ * Allows TUI rendering (status bar, shortcuts, update notices) to complete
157
+ * before the orchestrator sends input.
158
+ */
159
+ readonly readySettleMs: number;
154
160
  /**
155
161
  * Installation information for this CLI tool
156
162
  */
@@ -208,6 +214,12 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
208
214
  * Extract the main content from CLI output, removing common artifacts
209
215
  */
210
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;
211
223
  /**
212
224
  * Detect if the CLI has completed a task and returned to its idle prompt.
213
225
  * More specific than detectReady() — matches high-confidence completion indicators
@@ -250,6 +262,8 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
250
262
  declare class ClaudeAdapter extends BaseCodingAdapter {
251
263
  readonly adapterType = "claude";
252
264
  readonly displayName = "Claude Code";
265
+ /** Heaviest TUI — status bar, shortcuts, update notices, /ide suggestions */
266
+ readonly readySettleMs: number;
253
267
  readonly installation: InstallationInfo;
254
268
  /**
255
269
  * Auto-response rules for Claude Code CLI.
@@ -267,6 +281,14 @@ declare class ClaudeAdapter extends BaseCodingAdapter {
267
281
  * Detect blocking prompts specific to Claude Code CLI
268
282
  */
269
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;
270
292
  /**
271
293
  * Detect task completion for Claude Code.
272
294
  *
@@ -308,6 +330,14 @@ declare class GeminiAdapter extends BaseCodingAdapter {
308
330
  getEnv(config: SpawnConfig): Record<string, string>;
309
331
  detectLogin(output: string): LoginDetection;
310
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;
311
341
  /**
312
342
  * Detect task completion for Gemini CLI.
313
343
  *
@@ -361,6 +391,15 @@ declare class CodexAdapter extends BaseCodingAdapter {
361
391
  * Source: approval_overlay.rs, chatwidget.rs, request_user_input/mod.rs
362
392
  */
363
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;
364
403
  /**
365
404
  * Detect task completion for Codex CLI.
366
405
  *
@@ -398,6 +437,8 @@ declare class CodexAdapter extends BaseCodingAdapter {
398
437
  declare class AiderAdapter extends BaseCodingAdapter {
399
438
  readonly adapterType = "aider";
400
439
  readonly displayName = "Aider";
440
+ /** Minimal TUI, mostly text output — shorter settle delay */
441
+ readonly readySettleMs: number;
401
442
  /**
402
443
  * Aider uses plain text [y/n] prompts, NOT TUI arrow-key menus.
403
444
  */
@@ -422,6 +463,15 @@ declare class AiderAdapter extends BaseCodingAdapter {
422
463
  * Source: io.py, onboarding.py, base_coder.py, report.py
423
464
  */
424
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;
425
475
  /**
426
476
  * Detect task completion for Aider.
427
477
  *
package/dist/index.d.ts CHANGED
@@ -151,6 +151,12 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
151
151
  * Coding agent CLIs use TUI menus that require arrow-key navigation.
152
152
  */
153
153
  readonly usesTuiMenus: boolean;
154
+ /**
155
+ * Ms of output silence after detectReady match before emitting session_ready.
156
+ * Allows TUI rendering (status bar, shortcuts, update notices) to complete
157
+ * before the orchestrator sends input.
158
+ */
159
+ readonly readySettleMs: number;
154
160
  /**
155
161
  * Installation information for this CLI tool
156
162
  */
@@ -208,6 +214,12 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
208
214
  * Extract the main content from CLI output, removing common artifacts
209
215
  */
210
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;
211
223
  /**
212
224
  * Detect if the CLI has completed a task and returned to its idle prompt.
213
225
  * More specific than detectReady() — matches high-confidence completion indicators
@@ -250,6 +262,8 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
250
262
  declare class ClaudeAdapter extends BaseCodingAdapter {
251
263
  readonly adapterType = "claude";
252
264
  readonly displayName = "Claude Code";
265
+ /** Heaviest TUI — status bar, shortcuts, update notices, /ide suggestions */
266
+ readonly readySettleMs: number;
253
267
  readonly installation: InstallationInfo;
254
268
  /**
255
269
  * Auto-response rules for Claude Code CLI.
@@ -267,6 +281,14 @@ declare class ClaudeAdapter extends BaseCodingAdapter {
267
281
  * Detect blocking prompts specific to Claude Code CLI
268
282
  */
269
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;
270
292
  /**
271
293
  * Detect task completion for Claude Code.
272
294
  *
@@ -308,6 +330,14 @@ declare class GeminiAdapter extends BaseCodingAdapter {
308
330
  getEnv(config: SpawnConfig): Record<string, string>;
309
331
  detectLogin(output: string): LoginDetection;
310
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;
311
341
  /**
312
342
  * Detect task completion for Gemini CLI.
313
343
  *
@@ -361,6 +391,15 @@ declare class CodexAdapter extends BaseCodingAdapter {
361
391
  * Source: approval_overlay.rs, chatwidget.rs, request_user_input/mod.rs
362
392
  */
363
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;
364
403
  /**
365
404
  * Detect task completion for Codex CLI.
366
405
  *
@@ -398,6 +437,8 @@ declare class CodexAdapter extends BaseCodingAdapter {
398
437
  declare class AiderAdapter extends BaseCodingAdapter {
399
438
  readonly adapterType = "aider";
400
439
  readonly displayName = "Aider";
440
+ /** Minimal TUI, mostly text output — shorter settle delay */
441
+ readonly readySettleMs: number;
401
442
  /**
402
443
  * Aider uses plain text [y/n] prompts, NOT TUI arrow-key menus.
403
444
  */
@@ -422,6 +463,15 @@ declare class AiderAdapter extends BaseCodingAdapter {
422
463
  * Source: io.py, onboarding.py, base_coder.py, report.py
423
464
  */
424
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;
425
475
  /**
426
476
  * Detect task completion for Aider.
427
477
  *
package/dist/index.js CHANGED
@@ -366,6 +366,12 @@ var BaseCodingAdapter = class extends BaseCLIAdapter {
366
366
  * Coding agent CLIs use TUI menus that require arrow-key navigation.
367
367
  */
368
368
  usesTuiMenus = true;
369
+ /**
370
+ * Ms of output silence after detectReady match before emitting session_ready.
371
+ * Allows TUI rendering (status bar, shortcuts, update notices) to complete
372
+ * before the orchestrator sends input.
373
+ */
374
+ readySettleMs = 300;
369
375
  /**
370
376
  * The primary memory file for this CLI (the one it reads for project instructions).
371
377
  * Returns the relativePath of the first 'memory' type file from getWorkspaceFiles().
@@ -533,6 +539,8 @@ Docs: ${this.installation.docsUrl}`
533
539
  var ClaudeAdapter = class extends BaseCodingAdapter {
534
540
  adapterType = "claude";
535
541
  displayName = "Claude Code";
542
+ /** Heaviest TUI — status bar, shortcuts, update notices, /ide suggestions */
543
+ readySettleMs = 500;
536
544
  installation = {
537
545
  command: "npm install -g @anthropic-ai/claude-code",
538
546
  alternatives: [
@@ -750,6 +758,24 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
750
758
  }
751
759
  return super.detectBlockingPrompt(output);
752
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
+ }
753
779
  /**
754
780
  * Detect task completion for Claude Code.
755
781
  *
@@ -1041,6 +1067,24 @@ var GeminiAdapter = class extends BaseCodingAdapter {
1041
1067
  }
1042
1068
  return super.detectBlockingPrompt(output);
1043
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
+ }
1044
1088
  /**
1045
1089
  * Detect task completion for Gemini CLI.
1046
1090
  *
@@ -1377,6 +1421,28 @@ var CodexAdapter = class extends BaseCodingAdapter {
1377
1421
  }
1378
1422
  return super.detectBlockingPrompt(output);
1379
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
+ }
1380
1446
  /**
1381
1447
  * Detect task completion for Codex CLI.
1382
1448
  *
@@ -1464,6 +1530,8 @@ var CodexAdapter = class extends BaseCodingAdapter {
1464
1530
  var AiderAdapter = class extends BaseCodingAdapter {
1465
1531
  adapterType = "aider";
1466
1532
  displayName = "Aider";
1533
+ /** Minimal TUI, mostly text output — shorter settle delay */
1534
+ readySettleMs = 200;
1467
1535
  /**
1468
1536
  * Aider uses plain text [y/n] prompts, NOT TUI arrow-key menus.
1469
1537
  */
@@ -1807,6 +1875,25 @@ var AiderAdapter = class extends BaseCodingAdapter {
1807
1875
  }
1808
1876
  return super.detectBlockingPrompt(output);
1809
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
+ }
1810
1897
  /**
1811
1898
  * Detect task completion for Aider.
1812
1899
  *