/** * Shell-command execution layer for `slowcook serve`. * * Closes sc#173 finding #1: prior to this, planners emitted command * strings into `output[]` and exited without executing them, even when * `profile.ssh_target` was set. Operators had to copy-paste the emitted * command and run it themselves — the verb was documentation, not * automation. * * Now planners populate `result.commands[]` with structured ShellCommand * records; `runCommands()` wraps `remote: true` commands in * `ssh user@host 'cd checkout_dir && '` and executes (unless * --dry-run, in which case the wrapped form is just printed). * * Local commands run via execSync in the repoRoot. Remote commands run * via execSync of an ssh invocation. Either way: stdio inherited so the * operator sees docker / git output in real time. */ import type { ProfileConfig } from "./config.js"; export interface ShellCommand { /** The local-shell-shape command (e.g. `docker compose -f a.yml up -d`). */ cmd: string; /** * When true AND `profile.ssh_target` is set, wrap the command in * `ssh @ 'cd && '`. When `ssh_target` * is absent, runs locally regardless. Use for docker / box-side * operations (up, down, logs). Local-only operations like `git push` * should pass `remote: false`. */ remote?: boolean; /** Optional label printed before the command (e.g. "bring up", "seed"). */ label?: string; } export interface RunCommandsArgs { commands: ShellCommand[]; profile: ProfileConfig; repoRoot: string; /** When true: print the resolved command but don't execute. */ dryRun?: boolean; } export interface RunCommandsResult { exitCode: number; /** Additional human-readable lines emitted by the runner (resolved cmds, errors). */ output: string[]; } /** * Resolve a single ShellCommand into the wire-form string we'd actually * pass to /bin/sh. Pure; useful for tests + the dry-run print path. */ export declare function resolveCommand(cmd: ShellCommand, profile: ProfileConfig): string; export declare function runCommands(args: RunCommandsArgs): RunCommandsResult; //# sourceMappingURL=runner.d.ts.map