Skip to main content

Crate luft_planner

Crate luft_planner 

Source
Expand description

§luft-planner

Natural-language → Lua orchestration script planner.

Instead of classifying the task with keywords and filling fixed templates, the planner asks an LLM agent to generate a Lua orchestration script for the task. The model acts as a compiler (NL → DSL); the runtime then executes the script deterministically.

§Flow

 User NL task
      │
      ▼
 ┌─────────────────┐     ┌──────────────────┐
 │ LUA_DSL_REFERENCE│ ──► │  Planner Agent   │
 │ (system prompt)  │     │  (backend.run)   │
 └─────────────────┘     └────────┬─────────┘
                                   │
                           ┌───────▼────────┐
                           │ validate_script │ ── fail ──► retry (up to max_retries)
                           └───────┬────────┘
                                   │ pass
                           ┌───────▼────────┐
                           │ PlannedWorkflow │
                           │  (script+meta)  │
                           └────────────────┘

The generated script orchestrates only — it never touches the filesystem or shell (the Lua sandbox forbids io/os). All real work — reading files, grepping, editing, web search — happens inside the agent() prompts the script spawns at runtime.

Re-exports§

pub use meta::extract_meta;
pub use meta::validate_meta as validate_meta_extracted;
pub use meta::MetaPhase;
pub use meta::MetaValidation;
pub use meta::PlanMeta;

Modules§

meta
planner::meta — Declarative workflow metadata extraction.

Structs§

PlannedWorkflow
A planned workflow: the generated Lua script + its extracted metadata.
PlannerConfig
Planning configuration.

Enums§

PlannerError
Planner errors.

Functions§

plan_workflow
Generate a Lua orchestration script for task by asking the backend agent.