/** * Grok Build host init (ADR-402). * * Mirrors `init --codex`: writes project-scoped `.grok/` surface + team bus scripts * so any repo can run Ruflo Agent Teams under Grok without Claude SendMessage. * * Writes outside the project only with `statusLine: true` (`--grok-statusline`): * the status row lives in the user's ~/.grok/config.toml, which is parsed and * merged with a real TOML parser, never blindly appended to. */ import { grokTemplatesRoot } from './grok-templates.js'; export interface GrokInitOptions { targetDir: string; force?: boolean; /** Also write docs/grok/README.md operator guide */ docs?: boolean; /** Install the status row into the user's ~/.grok/config.toml (opt-in). */ statusLine?: boolean; /** Report what would be written; write nothing. */ dryRun?: boolean; /** Home directory for the user-level status row (tests). */ homeDir?: string; } export type GrokUserConfigAction = 'not-requested' | 'created' | 'merged' | 'already-set' | 'snippet' | 'would-write'; export interface GrokUserConfigResult { action: GrokUserConfigAction; /** ~/.grok/config.toml */ path: string; /** TOML to paste when init did not write it */ snippet: string; reason?: string; } export interface GrokMcpLaunch { command: string; args: string[]; /** published: pinned to this CLI's npm version; checkout: this local build */ source: 'published' | 'checkout'; version: string; } export interface GrokInitResult { success: boolean; dryRun: boolean; /** Files written (or, in a dry run, that would be written) */ filesCreated: string[]; filesSkipped: string[]; errors: string[]; mcp: GrokMcpLaunch; userConfig: GrokUserConfigResult; } export { grokTemplatesRoot }; /** * How the project .grok/config.toml starts the Ruflo MCP server. * * The team_* tools ship in the same release as `init --grok`, so the server is * pinned to the version that is running this init — never `@latest`, which can * be an older release without them. Running from a source checkout (not under * node_modules) points at that checkout's CLI, since its version may not be * published yet. */ export declare function rufloMcpLaunch(root?: string): GrokMcpLaunch; /** * Fill the template placeholders. Every inserted value is escaped as a TOML * string, so a Windows path such as C:\Users\x stays valid TOML. */ export declare function materializeGrokConfig(template: string, launch: GrokMcpLaunch, home: string): string; /** Where the opt-in status row script is installed: a stable absolute path. */ export declare function grokStatusScriptPath(home: string): string; /** `node ""` — no shell builtins, and never a repo-relative script. */ export declare function grokStatusLineCommand(home: string): string; export declare function grokStatusLineSnippet(home: string): string; type MergeOutcome = { kind: 'write'; text: string; } | { kind: 'already-set'; ours: boolean; } | { kind: 'unsafe'; reason: string; }; /** * Add the status row to an existing user config without disturbing it. * * Any existing `ui.status_line` — header, `[ ui.status_line ]`, * `[ui."status_line"]`, dotted keys, or an inline table — is detected by * parsing, and left alone. Otherwise the block is appended and the result is * re-parsed: it is written only if it parses, carries exactly our status row, * and every other value is unchanged. Anything else (unparseable file, `ui` * as an inline table, …) falls back to printing the snippet. */ export declare function mergeGrokStatusLine(existing: string, home: string): MergeOutcome; /** * Initialize Grok host surface in targetDir. */ export declare function executeGrokInit(options: GrokInitOptions): GrokInitResult; //# sourceMappingURL=grok-generator.d.ts.map