src/tools/index.ts.ast-grep/.smartfetch/ with optional secondary-model pass.createCouncilTool (council.ts).src/tools/index.ts is the export surface and re-exports:
ast_grep_search, ast_grep_replace.createWebfetchTool.createCouncilTool.@opencode-ai/plugin/@opencode-ai/plugin/tool and return ToolDefinition objects.ast-grep/)cli.ts owns execution path (runSg, getAstGrepPath, background init).constants.ts centralizes binary resolution, execution limits, and formatting helpers.downloader.ts handles release metadata lookup, download, and extraction for missing CLI.utils.ts formats matches/replacements for user-facing output.smartfetch/)tool.ts owns permission prompts, cache check, fetch orchestration, binary/content branching.network.ts enforces redirect policy, response size caps, and binary/content detection.cache.ts memoizes by normalized URL + behavior-affecting options (CACHE).utils.ts performs extraction/normalization of text/markdown/html payloads.binary.ts stores binary payloads and returns deterministic metadata.secondary-model.ts drives optional post-fetch summarization with fallback.AST-grep path
runSg.runSg resolves CLI binary, executes with timeout, parses JSON results,
then renders search/replace output.Smartfetch path
createWebfetchTool.llms.txt probing and redirect constraints.Council tool path
createCouncilTool checks caller context (orchestrator/council) and
invokes CouncilManager.runCouncil with parent session context.src/index.ts registers these tools into the plugin tool surface.src/council/council-manager.ts consumes createCouncilTool output for
explicit consensus runs.src/tools/* for type-safe contracts and fixture-driven execution.