coding-agent-adapters
Advanced tools
+64
-5
@@ -62,3 +62,3 @@ import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ParsedOutput, ToolRunningInfo } from 'adapter-types'; | ||
| */ | ||
| type AdapterType = 'claude' | 'gemini' | 'codex' | 'aider' | 'hermes'; | ||
| type AdapterType = 'claude' | 'gemini' | 'codex' | 'aider' | 'hermes' | 'opencode'; | ||
| /** | ||
@@ -713,2 +713,61 @@ * Authentication status for a CLI agent's subscription/login. | ||
| /** | ||
| * OpenCode CLI Adapter | ||
| * | ||
| * Adapter for the OpenCode CLI (https://opencode.ai). OpenCode is a | ||
| * provider-agnostic coding agent — it speaks OpenAI's chat-completions | ||
| * protocol against any compatible endpoint (Anthropic, OpenAI, Cerebras, | ||
| * OpenRouter, Groq, Together, DeepSeek, Ollama, vLLM, etc.) plus a | ||
| * native Anthropic backend. Configuration is supplied to the binary via | ||
| * the `OPENCODE_CONFIG_CONTENT` environment variable (a JSON object that | ||
| * defines providers + the chosen model). The orchestrator constructs | ||
| * that JSON from the user's standard provider env keys. | ||
| * | ||
| * Workspace-file convention matches Codex: `AGENTS.md` at the workdir | ||
| * root is auto-loaded as project instructions on startup. | ||
| * | ||
| * Source: https://github.com/sst/opencode | ||
| */ | ||
| declare class OpencodeAdapter extends BaseCodingAdapter { | ||
| readonly adapterType = "opencode"; | ||
| readonly displayName = "OpenCode"; | ||
| /** | ||
| * OpenCode's TUI is light (no full-screen ratatui-style status bar), | ||
| * so a short settle is sufficient — matches Gemini-CLI's 300ms baseline. | ||
| */ | ||
| readonly readySettleMs: number; | ||
| readonly installation: InstallationInfo; | ||
| getWorkspaceFiles(): AgentFileDescriptor[]; | ||
| getRecommendedModels(credentials?: AgentCredentials): ModelRecommendations; | ||
| getCommand(): string; | ||
| getArgs(config: SpawnConfig): string[]; | ||
| getEnv(config: SpawnConfig): Record<string, string>; | ||
| /** | ||
| * OpenCode does not display its own login prompts when an API key is | ||
| * pre-supplied (either via OPENCODE_CONFIG_CONTENT or a provider env | ||
| * var). The bare `opencode auth` CLI exists for interactive setup, but | ||
| * orchestrator-managed sessions never need it — credentials are | ||
| * injected via env at spawn time. | ||
| * | ||
| * Auth-required signals are limited to error banners that surface | ||
| * when an inbound request is rejected (401 / 403 / "invalid api key"). | ||
| */ | ||
| detectLogin(output: string): LoginDetection; | ||
| /** | ||
| * `--dangerously-skip-permissions` on `opencode run` short-circuits the | ||
| * usual permission UI, so during normal orchestrator-spawned sessions | ||
| * the adapter rarely encounters blocking prompts. The patterns below | ||
| * cover the residual cases (interactive sessions, or provider auth | ||
| * surfacing mid-run). | ||
| */ | ||
| detectBlockingPrompt(output: string): BlockingPromptDetection; | ||
| detectLoading(output: string): boolean; | ||
| detectTaskComplete(output: string): boolean; | ||
| detectReady(output: string): boolean; | ||
| parseOutput(output: string): ParsedOutput | null; | ||
| getPromptPattern(): RegExp; | ||
| getHealthCheckCommand(): string; | ||
| } | ||
| /** | ||
| * Dynamic Pattern Loader | ||
@@ -821,9 +880,9 @@ * | ||
| */ | ||
| declare function createAllAdapters(): (ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter)[]; | ||
| declare function createAllAdapters(): (ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter | OpencodeAdapter)[]; | ||
| declare const ADAPTER_TYPES: Record<AdapterType, typeof ClaudeAdapter | typeof GeminiAdapter | typeof CodexAdapter | typeof AiderAdapter | typeof HermesAdapter>; | ||
| declare const ADAPTER_TYPES: Record<AdapterType, typeof ClaudeAdapter | typeof GeminiAdapter | typeof CodexAdapter | typeof AiderAdapter | typeof HermesAdapter | typeof OpencodeAdapter>; | ||
| /** | ||
| * Create a specific adapter by type | ||
| */ | ||
| declare function createAdapter(type: AdapterType): ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter; | ||
| declare function createAdapter(type: AdapterType): ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter | OpencodeAdapter; | ||
| /** | ||
@@ -878,2 +937,2 @@ * Result of checking if a CLI is installed | ||
| export { ADAPTER_TYPES, AIDER_COMMAND_CATEGORIES, type AdapterPatterns, type AdapterType, type AgentCredentials, type AgentFileDescriptor, AiderAdapter, type ApprovalConfig, type ApprovalPreset, type AuthStatus, 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 }; | ||
| export { ADAPTER_TYPES, AIDER_COMMAND_CATEGORIES, type AdapterPatterns, type AdapterType, type AgentCredentials, type AgentFileDescriptor, AiderAdapter, type ApprovalConfig, type ApprovalPreset, type AuthStatus, BaseCodingAdapter, CLAUDE_TOOL_CATEGORIES, CODEX_TOOL_CATEGORIES, ClaudeAdapter, CodexAdapter, type CodingAgentConfig, GEMINI_TOOL_CATEGORIES, GeminiAdapter, HermesAdapter, type InstallationInfo, type ModelRecommendations, OpencodeAdapter, 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 }; |
+64
-5
@@ -62,3 +62,3 @@ import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ParsedOutput, ToolRunningInfo } from 'adapter-types'; | ||
| */ | ||
| type AdapterType = 'claude' | 'gemini' | 'codex' | 'aider' | 'hermes'; | ||
| type AdapterType = 'claude' | 'gemini' | 'codex' | 'aider' | 'hermes' | 'opencode'; | ||
| /** | ||
@@ -713,2 +713,61 @@ * Authentication status for a CLI agent's subscription/login. | ||
| /** | ||
| * OpenCode CLI Adapter | ||
| * | ||
| * Adapter for the OpenCode CLI (https://opencode.ai). OpenCode is a | ||
| * provider-agnostic coding agent — it speaks OpenAI's chat-completions | ||
| * protocol against any compatible endpoint (Anthropic, OpenAI, Cerebras, | ||
| * OpenRouter, Groq, Together, DeepSeek, Ollama, vLLM, etc.) plus a | ||
| * native Anthropic backend. Configuration is supplied to the binary via | ||
| * the `OPENCODE_CONFIG_CONTENT` environment variable (a JSON object that | ||
| * defines providers + the chosen model). The orchestrator constructs | ||
| * that JSON from the user's standard provider env keys. | ||
| * | ||
| * Workspace-file convention matches Codex: `AGENTS.md` at the workdir | ||
| * root is auto-loaded as project instructions on startup. | ||
| * | ||
| * Source: https://github.com/sst/opencode | ||
| */ | ||
| declare class OpencodeAdapter extends BaseCodingAdapter { | ||
| readonly adapterType = "opencode"; | ||
| readonly displayName = "OpenCode"; | ||
| /** | ||
| * OpenCode's TUI is light (no full-screen ratatui-style status bar), | ||
| * so a short settle is sufficient — matches Gemini-CLI's 300ms baseline. | ||
| */ | ||
| readonly readySettleMs: number; | ||
| readonly installation: InstallationInfo; | ||
| getWorkspaceFiles(): AgentFileDescriptor[]; | ||
| getRecommendedModels(credentials?: AgentCredentials): ModelRecommendations; | ||
| getCommand(): string; | ||
| getArgs(config: SpawnConfig): string[]; | ||
| getEnv(config: SpawnConfig): Record<string, string>; | ||
| /** | ||
| * OpenCode does not display its own login prompts when an API key is | ||
| * pre-supplied (either via OPENCODE_CONFIG_CONTENT or a provider env | ||
| * var). The bare `opencode auth` CLI exists for interactive setup, but | ||
| * orchestrator-managed sessions never need it — credentials are | ||
| * injected via env at spawn time. | ||
| * | ||
| * Auth-required signals are limited to error banners that surface | ||
| * when an inbound request is rejected (401 / 403 / "invalid api key"). | ||
| */ | ||
| detectLogin(output: string): LoginDetection; | ||
| /** | ||
| * `--dangerously-skip-permissions` on `opencode run` short-circuits the | ||
| * usual permission UI, so during normal orchestrator-spawned sessions | ||
| * the adapter rarely encounters blocking prompts. The patterns below | ||
| * cover the residual cases (interactive sessions, or provider auth | ||
| * surfacing mid-run). | ||
| */ | ||
| detectBlockingPrompt(output: string): BlockingPromptDetection; | ||
| detectLoading(output: string): boolean; | ||
| detectTaskComplete(output: string): boolean; | ||
| detectReady(output: string): boolean; | ||
| parseOutput(output: string): ParsedOutput | null; | ||
| getPromptPattern(): RegExp; | ||
| getHealthCheckCommand(): string; | ||
| } | ||
| /** | ||
| * Dynamic Pattern Loader | ||
@@ -821,9 +880,9 @@ * | ||
| */ | ||
| declare function createAllAdapters(): (ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter)[]; | ||
| declare function createAllAdapters(): (ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter | OpencodeAdapter)[]; | ||
| declare const ADAPTER_TYPES: Record<AdapterType, typeof ClaudeAdapter | typeof GeminiAdapter | typeof CodexAdapter | typeof AiderAdapter | typeof HermesAdapter>; | ||
| declare const ADAPTER_TYPES: Record<AdapterType, typeof ClaudeAdapter | typeof GeminiAdapter | typeof CodexAdapter | typeof AiderAdapter | typeof HermesAdapter | typeof OpencodeAdapter>; | ||
| /** | ||
| * Create a specific adapter by type | ||
| */ | ||
| declare function createAdapter(type: AdapterType): ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter; | ||
| declare function createAdapter(type: AdapterType): ClaudeAdapter | GeminiAdapter | CodexAdapter | AiderAdapter | HermesAdapter | OpencodeAdapter; | ||
| /** | ||
@@ -878,2 +937,2 @@ * Result of checking if a CLI is installed | ||
| export { ADAPTER_TYPES, AIDER_COMMAND_CATEGORIES, type AdapterPatterns, type AdapterType, type AgentCredentials, type AgentFileDescriptor, AiderAdapter, type ApprovalConfig, type ApprovalPreset, type AuthStatus, 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 }; | ||
| export { ADAPTER_TYPES, AIDER_COMMAND_CATEGORIES, type AdapterPatterns, type AdapterType, type AgentCredentials, type AgentFileDescriptor, AiderAdapter, type ApprovalConfig, type ApprovalPreset, type AuthStatus, BaseCodingAdapter, CLAUDE_TOOL_CATEGORIES, CODEX_TOOL_CATEGORIES, ClaudeAdapter, CodexAdapter, type CodingAgentConfig, GEMINI_TOOL_CATEGORIES, GeminiAdapter, HermesAdapter, type InstallationInfo, type ModelRecommendations, OpencodeAdapter, 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 }; |
+10
-11
| { | ||
| "name": "coding-agent-adapters", | ||
| "version": "0.16.4", | ||
| "description": "CLI adapters for AI coding agents - Claude Code, Gemini CLI, OpenAI Codex, Aider, and Hermes Agent", | ||
| "version": "0.17.0", | ||
| "description": "CLI adapters for AI coding agents - Claude Code, Gemini CLI, OpenAI Codex, Aider, OpenCode, and Hermes Agent", | ||
| "type": "module", | ||
@@ -28,10 +28,2 @@ "main": "./dist/index.cjs", | ||
| }, | ||
| "scripts": { | ||
| "build": "tsup", | ||
| "test": "vitest run", | ||
| "test:watch": "vitest", | ||
| "typecheck": "tsc --noEmit", | ||
| "clean": "rm -rf dist", | ||
| "prepublishOnly": "pnpm run build" | ||
| }, | ||
| "keywords": [ | ||
@@ -65,3 +57,10 @@ "cli", | ||
| "node": ">=18.0.0" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsup", | ||
| "test": "vitest run", | ||
| "test:watch": "vitest", | ||
| "typecheck": "tsc --noEmit", | ||
| "clean": "rm -rf dist" | ||
| } | ||
| } | ||
| } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
881745
7.65%8258
7.33%7
16.67%