coding-agent-adapters 0.11.1 → 0.13.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
@@ -1,4 +1,4 @@
1
- import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ToolRunningInfo, ParsedOutput } from 'pty-manager';
1
+ import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ToolRunningInfo, ParsedOutput } from 'adapter-types';
2
2
 
3
3
  /**
4
4
  * Approval Presets
@@ -44,6 +44,7 @@ declare function generateClaudeApprovalConfig(preset: ApprovalPreset): ApprovalC
44
44
  declare function generateGeminiApprovalConfig(preset: ApprovalPreset): ApprovalConfig;
45
45
  declare function generateCodexApprovalConfig(preset: ApprovalPreset): ApprovalConfig;
46
46
  declare function generateAiderApprovalConfig(preset: ApprovalPreset): ApprovalConfig;
47
+ declare function generateHermesApprovalConfig(preset: ApprovalPreset): ApprovalConfig;
47
48
  declare function generateApprovalConfig(adapterType: AdapterType, preset: ApprovalPreset): ApprovalConfig;
48
49
  declare function listPresets(): PresetDefinition[];
49
50
  declare function getPresetDefinition(preset: ApprovalPreset): PresetDefinition;
@@ -58,7 +59,7 @@ declare function getPresetDefinition(preset: ApprovalPreset): PresetDefinition;
58
59
  /**
59
60
  * Supported adapter types
60
61
  */
61
- type AdapterType = 'claude' | 'gemini' | 'codex' | 'aider';
62
+ type AdapterType = 'claude' | 'gemini' | 'codex' | 'aider' | 'hermes';
62
63
  /**
63
64
  * Credentials that can be passed via SpawnConfig.adapterConfig
64
65
  */
@@ -137,6 +138,24 @@ interface CodingAgentConfig extends SpawnConfig {
137
138
  * Translates to CLI-specific config files and flags.
138
139
  */
139
140
  approvalPreset?: ApprovalPreset;
141
+ /**
142
+ * Claude-only: enable hook marker telemetry parsing.
143
+ * Requires Claude hook config that emits PARALLAX_CLAUDE_HOOK lines.
144
+ */
145
+ claudeHookTelemetry?: boolean;
146
+ /**
147
+ * Claude-only: override hook marker prefix token.
148
+ */
149
+ claudeHookMarkerPrefix?: string;
150
+ /**
151
+ * Gemini-only: enable hook marker telemetry parsing.
152
+ * Requires Gemini hook config that emits PARALLAX_GEMINI_HOOK markers.
153
+ */
154
+ geminiHookTelemetry?: boolean;
155
+ /**
156
+ * Gemini-only: override hook marker prefix token.
157
+ */
158
+ geminiHookMarkerPrefix?: string;
140
159
  } & Record<string, unknown>;
141
160
  }
142
161
  /**
@@ -196,6 +215,21 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
196
215
  * detectReady / detectTaskComplete.
197
216
  */
198
217
  protected stripAnsi(str: string): string;
218
+ /**
219
+ * Generate hook telemetry protocol configuration.
220
+ * Returns null by default — only Claude adapter supports hooks.
221
+ */
222
+ getHookTelemetryProtocol(_options?: {
223
+ scriptPath?: string;
224
+ markerPrefix?: string;
225
+ httpUrl?: string;
226
+ sessionId?: string;
227
+ }): {
228
+ markerPrefix: string;
229
+ scriptPath: string;
230
+ scriptContent: string;
231
+ settingsHooks: Record<string, unknown>;
232
+ } | null;
199
233
  /**
200
234
  * Override detectExit to include installation instructions
201
235
  */
@@ -278,6 +312,20 @@ declare class ClaudeAdapter extends BaseCodingAdapter {
278
312
  getCommand(): string;
279
313
  getArgs(config: SpawnConfig): string[];
280
314
  getEnv(config: SpawnConfig): Record<string, string>;
315
+ getHookTelemetryProtocol(options?: {
316
+ scriptPath?: string;
317
+ markerPrefix?: string;
318
+ httpUrl?: string;
319
+ sessionId?: string;
320
+ }): {
321
+ markerPrefix: string;
322
+ scriptPath: string;
323
+ scriptContent: string;
324
+ settingsHooks: Record<string, unknown>;
325
+ };
326
+ private getHookMarkers;
327
+ private getLatestHookMarker;
328
+ private stripHookMarkers;
281
329
  detectLogin(output: string): LoginDetection;
282
330
  /**
283
331
  * Detect blocking prompts specific to Claude Code CLI
@@ -318,6 +366,11 @@ declare class ClaudeAdapter extends BaseCodingAdapter {
318
366
  parseOutput(output: string): ParsedOutput | null;
319
367
  getPromptPattern(): RegExp;
320
368
  getHealthCheckCommand(): string;
369
+ detectExit(output: string): {
370
+ exited: boolean;
371
+ code?: number;
372
+ error?: string;
373
+ };
321
374
  }
322
375
 
323
376
  /**
@@ -341,6 +394,20 @@ declare class GeminiAdapter extends BaseCodingAdapter {
341
394
  getCommand(): string;
342
395
  getArgs(config: SpawnConfig): string[];
343
396
  getEnv(config: SpawnConfig): Record<string, string>;
397
+ getHookTelemetryProtocol(options?: {
398
+ scriptPath?: string;
399
+ markerPrefix?: string;
400
+ httpUrl?: string;
401
+ sessionId?: string;
402
+ }): {
403
+ markerPrefix: string;
404
+ scriptPath: string;
405
+ scriptContent: string;
406
+ settingsHooks: Record<string, unknown>;
407
+ };
408
+ private getHookMarkers;
409
+ private getLatestHookMarker;
410
+ private stripHookMarkers;
344
411
  detectLogin(output: string): LoginDetection;
345
412
  detectBlockingPrompt(output: string): BlockingPromptDetection;
346
413
  /**
@@ -351,6 +418,7 @@ declare class GeminiAdapter extends BaseCodingAdapter {
351
418
  * - gemini_active_waiting_user_confirmation: "Waiting for user confirmation..."
352
419
  */
353
420
  detectLoading(output: string): boolean;
421
+ detectToolRunning(output: string): ToolRunningInfo | null;
354
422
  /**
355
423
  * Detect task completion for Gemini CLI.
356
424
  *
@@ -511,6 +579,38 @@ declare class AiderAdapter extends BaseCodingAdapter {
511
579
  getHealthCheckCommand(): string;
512
580
  }
513
581
 
582
+ /**
583
+ * Hermes Agent CLI Adapter
584
+ *
585
+ * Adapter for the Hermes Agent CLI tool.
586
+ */
587
+
588
+ declare class HermesAdapter extends BaseCodingAdapter {
589
+ readonly adapterType = "hermes";
590
+ readonly displayName = "Hermes Agent";
591
+ /** Prompt-toolkit TUI + spinner rendering needs a slightly longer settle. */
592
+ readonly readySettleMs: number;
593
+ readonly installation: InstallationInfo;
594
+ getWorkspaceFiles(): AgentFileDescriptor[];
595
+ getRecommendedModels(_credentials?: AgentCredentials): ModelRecommendations;
596
+ getCommand(): string;
597
+ getArgs(_config: SpawnConfig): string[];
598
+ getEnv(config: SpawnConfig): Record<string, string>;
599
+ detectLogin(output: string): LoginDetection;
600
+ detectBlockingPrompt(output: string): BlockingPromptDetection;
601
+ detectLoading(output: string): boolean;
602
+ detectTaskComplete(output: string): boolean;
603
+ detectReady(output: string): boolean;
604
+ parseOutput(output: string): ParsedOutput | null;
605
+ getPromptPattern(): RegExp;
606
+ detectExit(output: string): {
607
+ exited: boolean;
608
+ code?: number;
609
+ error?: string;
610
+ };
611
+ getHealthCheckCommand(): string;
612
+ }
613
+
514
614
  /**
515
615
  * Dynamic Pattern Loader
516
616
  *
@@ -619,13 +719,13 @@ declare function hasDynamicPatterns(adapter: AdapterType): Promise<boolean>;
619
719
  /**
620
720
  * Create instances of all available adapters
621
721
  */
622
- declare function createAllAdapters(): (ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter)[];
722
+ declare function createAllAdapters(): (ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter)[];
623
723
 
624
- declare const ADAPTER_TYPES: Record<AdapterType, typeof ClaudeAdapter | typeof GeminiAdapter | typeof CodexAdapter | typeof AiderAdapter>;
724
+ declare const ADAPTER_TYPES: Record<AdapterType, typeof ClaudeAdapter | typeof GeminiAdapter | typeof CodexAdapter | typeof AiderAdapter | typeof HermesAdapter>;
625
725
  /**
626
726
  * Create a specific adapter by type
627
727
  */
628
- declare function createAdapter(type: AdapterType): ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter;
728
+ declare function createAdapter(type: AdapterType): ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter;
629
729
  /**
630
730
  * Result of checking if a CLI is installed
631
731
  */
@@ -673,4 +773,4 @@ declare function checkAllAdapters(): Promise<PreflightResult[]>;
673
773
  */
674
774
  declare function printMissingAdapters(types?: AdapterType[]): Promise<void>;
675
775
 
676
- export { ADAPTER_TYPES, AIDER_COMMAND_CATEGORIES, type AdapterPatterns, type AdapterType, type AgentCredentials, type AgentFileDescriptor, AiderAdapter, type ApprovalConfig, type ApprovalPreset, BaseCodingAdapter, CLAUDE_TOOL_CATEGORIES, CODEX_TOOL_CATEGORIES, ClaudeAdapter, CodexAdapter, type CodingAgentConfig, GEMINI_TOOL_CATEGORIES, GeminiAdapter, type InstallationInfo, type ModelRecommendations, PRESET_DEFINITIONS, type PreflightResult, type PresetDefinition, type RiskLevel, TOOL_CATEGORIES, type ToolCategory, type ToolCategoryInfo, type WriteMemoryOptions, checkAdapters, checkAllAdapters, clearPatternCache, createAdapter, createAllAdapters, generateAiderApprovalConfig, generateApprovalConfig, generateClaudeApprovalConfig, generateCodexApprovalConfig, generateGeminiApprovalConfig, getBaselinePatterns, getPresetDefinition, hasDynamicPatterns, listPresets, loadPatterns, loadPatternsSync, preloadAllPatterns, printMissingAdapters };
776
+ export { ADAPTER_TYPES, AIDER_COMMAND_CATEGORIES, type AdapterPatterns, type AdapterType, type AgentCredentials, type AgentFileDescriptor, AiderAdapter, type ApprovalConfig, type ApprovalPreset, BaseCodingAdapter, CLAUDE_TOOL_CATEGORIES, CODEX_TOOL_CATEGORIES, ClaudeAdapter, CodexAdapter, type CodingAgentConfig, GEMINI_TOOL_CATEGORIES, GeminiAdapter, HermesAdapter, type InstallationInfo, type ModelRecommendations, PRESET_DEFINITIONS, type PreflightResult, type PresetDefinition, type RiskLevel, TOOL_CATEGORIES, type ToolCategory, type ToolCategoryInfo, type WriteMemoryOptions, checkAdapters, checkAllAdapters, clearPatternCache, createAdapter, createAllAdapters, generateAiderApprovalConfig, generateApprovalConfig, generateClaudeApprovalConfig, generateCodexApprovalConfig, generateGeminiApprovalConfig, generateHermesApprovalConfig, getBaselinePatterns, getPresetDefinition, hasDynamicPatterns, listPresets, loadPatterns, loadPatternsSync, preloadAllPatterns, printMissingAdapters };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ToolRunningInfo, ParsedOutput } from 'pty-manager';
1
+ import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ToolRunningInfo, ParsedOutput } from 'adapter-types';
2
2
 
3
3
  /**
4
4
  * Approval Presets
@@ -44,6 +44,7 @@ declare function generateClaudeApprovalConfig(preset: ApprovalPreset): ApprovalC
44
44
  declare function generateGeminiApprovalConfig(preset: ApprovalPreset): ApprovalConfig;
45
45
  declare function generateCodexApprovalConfig(preset: ApprovalPreset): ApprovalConfig;
46
46
  declare function generateAiderApprovalConfig(preset: ApprovalPreset): ApprovalConfig;
47
+ declare function generateHermesApprovalConfig(preset: ApprovalPreset): ApprovalConfig;
47
48
  declare function generateApprovalConfig(adapterType: AdapterType, preset: ApprovalPreset): ApprovalConfig;
48
49
  declare function listPresets(): PresetDefinition[];
49
50
  declare function getPresetDefinition(preset: ApprovalPreset): PresetDefinition;
@@ -58,7 +59,7 @@ declare function getPresetDefinition(preset: ApprovalPreset): PresetDefinition;
58
59
  /**
59
60
  * Supported adapter types
60
61
  */
61
- type AdapterType = 'claude' | 'gemini' | 'codex' | 'aider';
62
+ type AdapterType = 'claude' | 'gemini' | 'codex' | 'aider' | 'hermes';
62
63
  /**
63
64
  * Credentials that can be passed via SpawnConfig.adapterConfig
64
65
  */
@@ -137,6 +138,24 @@ interface CodingAgentConfig extends SpawnConfig {
137
138
  * Translates to CLI-specific config files and flags.
138
139
  */
139
140
  approvalPreset?: ApprovalPreset;
141
+ /**
142
+ * Claude-only: enable hook marker telemetry parsing.
143
+ * Requires Claude hook config that emits PARALLAX_CLAUDE_HOOK lines.
144
+ */
145
+ claudeHookTelemetry?: boolean;
146
+ /**
147
+ * Claude-only: override hook marker prefix token.
148
+ */
149
+ claudeHookMarkerPrefix?: string;
150
+ /**
151
+ * Gemini-only: enable hook marker telemetry parsing.
152
+ * Requires Gemini hook config that emits PARALLAX_GEMINI_HOOK markers.
153
+ */
154
+ geminiHookTelemetry?: boolean;
155
+ /**
156
+ * Gemini-only: override hook marker prefix token.
157
+ */
158
+ geminiHookMarkerPrefix?: string;
140
159
  } & Record<string, unknown>;
141
160
  }
142
161
  /**
@@ -196,6 +215,21 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
196
215
  * detectReady / detectTaskComplete.
197
216
  */
198
217
  protected stripAnsi(str: string): string;
218
+ /**
219
+ * Generate hook telemetry protocol configuration.
220
+ * Returns null by default — only Claude adapter supports hooks.
221
+ */
222
+ getHookTelemetryProtocol(_options?: {
223
+ scriptPath?: string;
224
+ markerPrefix?: string;
225
+ httpUrl?: string;
226
+ sessionId?: string;
227
+ }): {
228
+ markerPrefix: string;
229
+ scriptPath: string;
230
+ scriptContent: string;
231
+ settingsHooks: Record<string, unknown>;
232
+ } | null;
199
233
  /**
200
234
  * Override detectExit to include installation instructions
201
235
  */
@@ -278,6 +312,20 @@ declare class ClaudeAdapter extends BaseCodingAdapter {
278
312
  getCommand(): string;
279
313
  getArgs(config: SpawnConfig): string[];
280
314
  getEnv(config: SpawnConfig): Record<string, string>;
315
+ getHookTelemetryProtocol(options?: {
316
+ scriptPath?: string;
317
+ markerPrefix?: string;
318
+ httpUrl?: string;
319
+ sessionId?: string;
320
+ }): {
321
+ markerPrefix: string;
322
+ scriptPath: string;
323
+ scriptContent: string;
324
+ settingsHooks: Record<string, unknown>;
325
+ };
326
+ private getHookMarkers;
327
+ private getLatestHookMarker;
328
+ private stripHookMarkers;
281
329
  detectLogin(output: string): LoginDetection;
282
330
  /**
283
331
  * Detect blocking prompts specific to Claude Code CLI
@@ -318,6 +366,11 @@ declare class ClaudeAdapter extends BaseCodingAdapter {
318
366
  parseOutput(output: string): ParsedOutput | null;
319
367
  getPromptPattern(): RegExp;
320
368
  getHealthCheckCommand(): string;
369
+ detectExit(output: string): {
370
+ exited: boolean;
371
+ code?: number;
372
+ error?: string;
373
+ };
321
374
  }
322
375
 
323
376
  /**
@@ -341,6 +394,20 @@ declare class GeminiAdapter extends BaseCodingAdapter {
341
394
  getCommand(): string;
342
395
  getArgs(config: SpawnConfig): string[];
343
396
  getEnv(config: SpawnConfig): Record<string, string>;
397
+ getHookTelemetryProtocol(options?: {
398
+ scriptPath?: string;
399
+ markerPrefix?: string;
400
+ httpUrl?: string;
401
+ sessionId?: string;
402
+ }): {
403
+ markerPrefix: string;
404
+ scriptPath: string;
405
+ scriptContent: string;
406
+ settingsHooks: Record<string, unknown>;
407
+ };
408
+ private getHookMarkers;
409
+ private getLatestHookMarker;
410
+ private stripHookMarkers;
344
411
  detectLogin(output: string): LoginDetection;
345
412
  detectBlockingPrompt(output: string): BlockingPromptDetection;
346
413
  /**
@@ -351,6 +418,7 @@ declare class GeminiAdapter extends BaseCodingAdapter {
351
418
  * - gemini_active_waiting_user_confirmation: "Waiting for user confirmation..."
352
419
  */
353
420
  detectLoading(output: string): boolean;
421
+ detectToolRunning(output: string): ToolRunningInfo | null;
354
422
  /**
355
423
  * Detect task completion for Gemini CLI.
356
424
  *
@@ -511,6 +579,38 @@ declare class AiderAdapter extends BaseCodingAdapter {
511
579
  getHealthCheckCommand(): string;
512
580
  }
513
581
 
582
+ /**
583
+ * Hermes Agent CLI Adapter
584
+ *
585
+ * Adapter for the Hermes Agent CLI tool.
586
+ */
587
+
588
+ declare class HermesAdapter extends BaseCodingAdapter {
589
+ readonly adapterType = "hermes";
590
+ readonly displayName = "Hermes Agent";
591
+ /** Prompt-toolkit TUI + spinner rendering needs a slightly longer settle. */
592
+ readonly readySettleMs: number;
593
+ readonly installation: InstallationInfo;
594
+ getWorkspaceFiles(): AgentFileDescriptor[];
595
+ getRecommendedModels(_credentials?: AgentCredentials): ModelRecommendations;
596
+ getCommand(): string;
597
+ getArgs(_config: SpawnConfig): string[];
598
+ getEnv(config: SpawnConfig): Record<string, string>;
599
+ detectLogin(output: string): LoginDetection;
600
+ detectBlockingPrompt(output: string): BlockingPromptDetection;
601
+ detectLoading(output: string): boolean;
602
+ detectTaskComplete(output: string): boolean;
603
+ detectReady(output: string): boolean;
604
+ parseOutput(output: string): ParsedOutput | null;
605
+ getPromptPattern(): RegExp;
606
+ detectExit(output: string): {
607
+ exited: boolean;
608
+ code?: number;
609
+ error?: string;
610
+ };
611
+ getHealthCheckCommand(): string;
612
+ }
613
+
514
614
  /**
515
615
  * Dynamic Pattern Loader
516
616
  *
@@ -619,13 +719,13 @@ declare function hasDynamicPatterns(adapter: AdapterType): Promise<boolean>;
619
719
  /**
620
720
  * Create instances of all available adapters
621
721
  */
622
- declare function createAllAdapters(): (ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter)[];
722
+ declare function createAllAdapters(): (ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter)[];
623
723
 
624
- declare const ADAPTER_TYPES: Record<AdapterType, typeof ClaudeAdapter | typeof GeminiAdapter | typeof CodexAdapter | typeof AiderAdapter>;
724
+ declare const ADAPTER_TYPES: Record<AdapterType, typeof ClaudeAdapter | typeof GeminiAdapter | typeof CodexAdapter | typeof AiderAdapter | typeof HermesAdapter>;
625
725
  /**
626
726
  * Create a specific adapter by type
627
727
  */
628
- declare function createAdapter(type: AdapterType): ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter;
728
+ declare function createAdapter(type: AdapterType): ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter;
629
729
  /**
630
730
  * Result of checking if a CLI is installed
631
731
  */
@@ -673,4 +773,4 @@ declare function checkAllAdapters(): Promise<PreflightResult[]>;
673
773
  */
674
774
  declare function printMissingAdapters(types?: AdapterType[]): Promise<void>;
675
775
 
676
- export { ADAPTER_TYPES, AIDER_COMMAND_CATEGORIES, type AdapterPatterns, type AdapterType, type AgentCredentials, type AgentFileDescriptor, AiderAdapter, type ApprovalConfig, type ApprovalPreset, BaseCodingAdapter, CLAUDE_TOOL_CATEGORIES, CODEX_TOOL_CATEGORIES, ClaudeAdapter, CodexAdapter, type CodingAgentConfig, GEMINI_TOOL_CATEGORIES, GeminiAdapter, type InstallationInfo, type ModelRecommendations, PRESET_DEFINITIONS, type PreflightResult, type PresetDefinition, type RiskLevel, TOOL_CATEGORIES, type ToolCategory, type ToolCategoryInfo, type WriteMemoryOptions, checkAdapters, checkAllAdapters, clearPatternCache, createAdapter, createAllAdapters, generateAiderApprovalConfig, generateApprovalConfig, generateClaudeApprovalConfig, generateCodexApprovalConfig, generateGeminiApprovalConfig, getBaselinePatterns, getPresetDefinition, hasDynamicPatterns, listPresets, loadPatterns, loadPatternsSync, preloadAllPatterns, printMissingAdapters };
776
+ export { ADAPTER_TYPES, AIDER_COMMAND_CATEGORIES, type AdapterPatterns, type AdapterType, type AgentCredentials, type AgentFileDescriptor, AiderAdapter, type ApprovalConfig, type ApprovalPreset, BaseCodingAdapter, CLAUDE_TOOL_CATEGORIES, CODEX_TOOL_CATEGORIES, ClaudeAdapter, CodexAdapter, type CodingAgentConfig, GEMINI_TOOL_CATEGORIES, GeminiAdapter, HermesAdapter, type InstallationInfo, type ModelRecommendations, PRESET_DEFINITIONS, type PreflightResult, type PresetDefinition, type RiskLevel, TOOL_CATEGORIES, type ToolCategory, type ToolCategoryInfo, type WriteMemoryOptions, checkAdapters, checkAllAdapters, clearPatternCache, createAdapter, createAllAdapters, generateAiderApprovalConfig, generateApprovalConfig, generateClaudeApprovalConfig, generateCodexApprovalConfig, generateGeminiApprovalConfig, generateHermesApprovalConfig, getBaselinePatterns, getPresetDefinition, hasDynamicPatterns, listPresets, loadPatterns, loadPatternsSync, preloadAllPatterns, printMissingAdapters };