/** * CLI task runner — spawns a detached worker process that executes the tool * and writes the terminal outcome back to the persistent store. * * The worker is launched via `frontmcp __run-task ` using either: * 1. An explicit `tasks.cliRunnerCommand` override, or * 2. The currently-running executable (`argv[0]` + `argv[1]`), * 3. Falling back to `node `. * * Cancellation uses `process.kill(pid, SIGTERM)`. The worker is expected to * observe the signal via the AbortSignal surfaced on `ToolContext.signal`. * * @module task/helpers/cli-task-runner */ import type { FrontMcpLogger } from '../../common'; import type { TaskStore } from '../store'; import type { TaskRecord } from '../task.types'; import type { SpawnContext, TaskRunner } from './task-runner.types'; export interface CliTaskRunnerCommand { exe: string; args?: string[]; } export interface CliTaskRunnerDeps { store: TaskStore; /** Explicit command override. When omitted, the runner uses `argv[0]`+`argv[1]`. */ command?: CliTaskRunnerCommand; logger?: FrontMcpLogger; } declare const RUN_TASK_SUBCOMMAND = "__run-task"; declare const RUN_TASK_ENV_VAR = "FRONTMCP_RUN_TASK_ID"; export declare class CliTaskRunner implements TaskRunner { private readonly deps; readonly kind: "cli"; constructor(deps: CliTaskRunnerDeps); run(record: TaskRecord, _context: SpawnContext): Promise; /** * Transition a task to `failed` when we couldn't even get a worker off the * ground. Publishes the terminal event so any `tasks/result` waiter is * unblocked, and is best-effort (a failing store write is only logged). */ private markBootstrapFailure; cancel(record: TaskRecord): Promise; private resolveCommand; } export { RUN_TASK_SUBCOMMAND, RUN_TASK_ENV_VAR }; //# sourceMappingURL=cli-task-runner.d.ts.map