/** * opencode Configuration Generator * * Emits an `opencode.json` that wires monomind's MCP server into opencode, * plus permission rules mirroring the Claude Code allow/deny list. * * ADDITIVE ONLY: this target is opt-in via `components.opencode` (default * false). Default `monomind init` (Claude + Antigravity) is byte-identical * whether or not this generator exists — it only runs when the flag is set. * * opencode schema reference: https://opencode.ai/config.json * - `mcp[name].command` is an array of strings, `type` is required * - `permission` per-tool: either an action string or { pattern: action }; * opencode evaluates the LAST matching rule, so broad rules go first, * narrow rules go last. */ import type { InitOptions } from './types.js'; /** * Build the opencode.json config object. */ export declare function generateOpencodeConfig(options: InitOptions): Record; /** * Generate opencode.json as a formatted string. */ export declare function generateOpencodeJson(options: InitOptions): string; /** * Convert a Claude agent definition to opencode agent format. * - Ensures mode: subagent (these are Task-tool subagents). * - Keeps name, description, and the capability: metadata block. * - If no description, derives one from the name so opencode doesn't drop it. */ export declare function convertAgentMd(src: string, fallbackName: string): string; /** * Convert a Claude slash-command to opencode command format. * - Keeps description; drops Claude-only keys (allowed-tools, argument-hint). * - The category dir becomes a filename prefix so /mastermind:build survives * as /mastermind-build (opencode commands are a flat namespace). */ export declare function convertCommandMd(src: string, category: string, fallbackName: string): string; /** Namespace-prefixed command filename: "mastermind-build.md". */ export declare function opencodeCommandFilename(category: string, file: string): string; /** * Convert a SKILL.md. opencode and Claude use the same SKILL.md shape * (name + description). Only ensures description exists, since opencode * filters out skills without one. */ export declare function convertSkillMd(src: string, fallbackName: string): string; /** * Generate the /monomind-status command — the opencode equivalent of the * Claude Code statusline. opencode has no custom statusbar UI, so this command * runs the SAME statusline.cjs (unchanged) and reports a formatted summary. * Reuses the helper verbatim; only the command wrapper is opencode-shaped. */ export declare function generateStatusCommand(): string; /** * Generate AGENTS.md — opencode's instructions file (CLAUDE.md equivalent). * Built as a joined string array so inline-code backticks are literal chars * (no template-literal escaping pitfalls). */ export declare function generateAgentsMd(): string; /** * Generate the opencode hook-shim plugin (Tier 3). * * opencode has no declarative hooks block; hooks come from TS plugins. This * plugin bridges monomind's existing Claude-Code CJS gate handlers * (.claude/helpers/hook-handler.cjs) into opencode's tool.execute.before event. * Blocking maps to throwing inside tool.execute.before (opencode's documented * mechanism — see the .env-protection plugin example). * * The handlers run UNCHANGED: the plugin only synthesises the {tool_name, * tool_input} envelope they already consume and maps exit-code-2 back to a * thrown error. Nothing in .claude/helpers is modified, so Claude Code's own * hook path is unaffected. * * Plugin body is intentionally free of backticks and ${...} so it embeds here * without template-literal escaping. */ export declare function generateHooksPlugin(): string; //# sourceMappingURL=opencode-generator.d.ts.map