/** * Mission planner — Phase 1.g of the AgenticROS strategy. * * Compiles a natural-language goal ("find a chair and drive toward * it", "take a picture", "follow me") into a declarative `Mission` * the runner can execute. The compiler is intentionally rule-based * (no LLM dependency) so: * * - Phase 1 doesn't ship with a hard Ollama requirement * - Tests are deterministic (same input → same plan) * - Failures are explainable ("I matched verb X but had no input * for Y") — agents can self-correct without an extra round-trip * * A future LLM-backed planner is intended to live behind the same * `compileGoalToMission` contract — Phase 2+ work. For now this * covers the canonical verbs in `BUILTIN_CAPABILITIES` + the * skill-declared `find_object` / `follow_person` that ship with * AgenticROS. * * The planner ONLY emits steps for capabilities present in the * `capabilities` argument it's handed. Skill capabilities that * aren't installed are silently skipped — the planner never * fabricates calls to non-existent tools. When nothing matches, * the result includes hints + the recognised verb list so the * agent can recover. * * See: docs/strategy-ai-agents-plus-ros.md §4 Phase 1.g. */ import type { Capability } from "../capabilities.js"; import type { Mission } from "../mission.js"; /** One candidate match the planner considered for the goal. */ export interface PlannerCandidate { /** Capability id we matched. */ capability_id: string; /** 0..1 confidence — higher = better fit. */ confidence: number; /** Human-readable explanation ("matched 'find' verb on token 'find'"). */ rationale: string; /** Inputs the matcher extracted (e.g. `target: "chair"`). */ inputs: Record; } /** Outcome of `compileGoalToMission`. */ export interface PlannerResult { /** When non-null, the compiled mission ready to run. */ mission: Mission | null; /** Free-text explanation on failure (otherwise undefined). */ error?: string; /** * Verbs the planner could parse from the goal but didn't act on * (e.g. user asked for "navigate" which isn't bound to a runnable * capability today). Surfaced so the agent can pick a different * phrasing without re-prompting the user. */ unmatched_verbs?: string[]; /** * The candidate matches the planner ranked. Always present; the * first one wins when the planner picks a single step (multi-step * patterns are explicit in `mission.steps`). */ candidates: PlannerCandidate[]; /** * Hints surfaced to help the agent recover from a failed compile * (e.g. "try 'take a picture' or 'follow me'"). Empty when the * compile succeeds. */ suggestions: string[]; } interface CompileOptions { /** Optional mission name; defaults to "Goal: ". */ mission_name?: string; /** Optional default robot id propagated onto the mission. */ robot_id?: string; } /** * Compile a free-text goal into a runnable `Mission`. * * Returns a structured `PlannerResult`: when `mission` is non-null * the caller can hand it straight to `runMission`; when it's null * the caller should surface `error` + `suggestions` to the agent so * it can self-correct. */ export declare function compileGoalToMission(goal: string, capabilities: Capability[], options?: CompileOptions): PlannerResult; export {}; //# sourceMappingURL=index.d.ts.map