/** * kimi-code Configuration Generator * * Emits Kimi Code CLI artifacts that wire monomind into kimi: * * Tier 1 (project-level, zero-install): * .kimi-code/mcp.json — monomind MCP server (merged, never clobbered) * .kimi-code/agents/.md — converted from .claude/agents/ * .kimi-code/skills//SKILL.md — converted from .claude/skills/ * .kimi-code/skills/-/ — .claude/commands/ converted to flow skills * (the only project-level command mechanism kimi has) * AGENTS.md — kimi workspace instructions (skip-if-exists) * * Tier 2 (hooks bridge): * .kimi-code/plugin/hooks/monomind-gate.mjs — stdin/exit-code bridge into the * existing .claude/helpers/hook-handler.cjs gates. * Kimi's hook protocol matches Claude's (JSON on * stdin, exit 2 = block), so the handlers run unchanged. * * Tier 3 (plugin packaging): * .kimi-code/plugin/kimi.plugin.json + commands/ — installable via * `/plugins install ./.kimi-code/plugin`, giving * /: slash commands and auto-wired hooks * (hooks cannot be configured project-level otherwise — * [[hooks]] only lives in the user config.toml or plugins). * * ADDITIVE ONLY: opt-in via components.kimicode (default false). Never touches * .claude/, .gemini/, .opencode/ or opencode.json. * * Kimi format references (https://www.kimi.com/code/docs/en/): * - MCP: .kimi-code/mcp.json → { mcpServers: { name: { command, args, env } } } * - Agents: frontmatter name (kebab-case, else skipped), description; unknown * fields (Claude's `model`, opencode's `mode`) are ignored; comma-separated * `tools:` strings load fine. * - Skills: directory-form SKILL.md requires name + description; `type: flow` * means manual invocation only (no model auto-invocation). * - Commands: plugin manifest `commands` field → /monomind:; $ARGUMENTS * is the placeholder, same convention Claude commands already use. */ import type { InitOptions } from './types.js'; /** * Build the .kimi-code/mcp.json object. Standalone (no existing file) case; * the executor merges into an existing file via mergeKimiMcpJson below. */ export declare function generateKimiMcpConfig(options: InitOptions): Record; export declare function generateKimiMcpJson(options: InitOptions): string; /** * Merge the monomind server into an existing .kimi-code/mcp.json without * touching the user's other servers. Returns null when the existing file is * unparseable (caller should skip, never clobber). */ export declare function mergeKimiMcpJson(existing: string, options: InitOptions): string | null; /** * Convert a Claude agent definition to kimi agent format. * - name is slugified to kebab-case (hard requirement — kimi skips the file otherwise). * - description is ensured (kimi shows it to the main agent for delegation). * - Everything else passes through: kimi ignores Claude-only keys (model, etc.) * and accepts comma-separated tools: strings. */ export declare function convertKimiAgentMd(src: string, fallbackName: string): string; /** * Convert a SKILL.md. Both Claude and kimi use directory-form SKILL.md with * required name + description — this only guarantees those two keys. */ export declare function convertKimiSkillMd(src: string, fallbackName: string): string; /** * Convert a Claude slash-command into a kimi flow skill — the only way to get * an invocable command at PROJECT level (kimi has no project-level command * directory; real slash commands require the plugin, see Tier 3). * - type: flow → manual invocation only (/skill:), never auto-invoked. * - Strips Claude-only frontmatter keys (allowed-tools, argument-hint, bare * claude model names) whose semantics kimi doesn't share. */ export declare function convertKimiCommandToFlowSkill(src: string, category: string, fallbackName: string): string; /** * Convert a Claude slash-command into a kimi PLUGIN command file. * Plugin commands only read `name`/`description` frontmatter; the body is the * prompt and $ARGUMENTS is the placeholder — the same convention Claude * commands already use, so bodies pass through unchanged. */ export declare function convertKimiPluginCommandMd(src: string, category: string, fallbackName: string): string; /** Namespace-prefixed command filename: "mastermind-build.md". */ export declare function kimiCommandFilename(category: string, file: string): string; /** * Generate AGENTS.md for kimi — workspace instructions (CLAUDE.md equivalent). * Only written when no AGENTS.md exists (the opencode target may already have * written one; both are generic monomind instructions). */ export declare function generateKimiAgentsMd(): string; /** * Generate ~/.kimi-code/statusline.sh — reads the cwd out of kimi's stdin * JSON snapshot and delegates to that project's monomind statusline helper, * joining its multi-line output into the single footer line kimi renders. * Exits 0 with no output when there's nothing to show (kimi then keeps its * built-in layout). * * The script must be free of backticks and ${...} outside its own template * usage — it is embedded into a TypeScript template literal by the caller. */ export declare function generateKimiStatuslineSh(): string; /** * Merge [status_line].command into a tui.toml file WITHOUT clobbering: * - existing [status_line] with a command → unchanged (user's choice wins) * - existing [status_line] without a command → command inserted into the section * - no [status_line] section → appended at the end * Anything else in the file is preserved byte-for-byte. */ export declare function mergeKimiTuiTomlStatusline(existing: string, command: string): string; export declare function generateKimiGateScript(): string; /** * Generate kimi.plugin.json for the self-contained plugin directory * (.kimi-code/plugin/). The manifest deliberately declares only `commands` * and `hooks`: * - skills/agents stay project-level (.kimi-code/skills, .kimi-code/agents) * so they work with zero install — no duplication inside the plugin. * - mcpServers stays in project .kimi-code/mcp.json to avoid a duplicate * "monomind" server when both the project config and the plugin load. * - hooks are the plugin's whole reason to exist: kimi has no project-level * hooks, so the gate bridge only runs while the plugin is enabled — which * also means disabling the plugin cleanly disables monomind enforcement. */ export declare function generateKimiPluginManifest(_options: InitOptions): string; //# sourceMappingURL=kimi-generator.d.ts.map