Skip to main content

Module drone

Module drone 

Source
Expand description

Drone pane backend — issue #753 Phase 1.

Native DAG-of-blocks drone engine modeled after Sim. Frontend lives in frontend/app/view/drone/. The canvas uses @dschz/solid-flow (xyflow core, SolidJS port).

Phase 1 ships 5 block types: Agent, Condition, API, Response, Variables. The Function block (quickjs-rs sandbox) is Phase 2.

Architecture:

  • types — DroneDefinition, DroneRun, FlowNode, FlowEdge (backend/storage/drone_types.rs).
  • storage — mstore CRUD over db_drone_definitions + db_drone_runs (backend/storage/drone_store.rs).
  • executor/ — DAG topological sort + per-layer concurrent runner.
  • executor/blocks — one file per block type.
  • data_flow.rs — {{var}} interpolation (Mustache-style; see RFC §2 Q5).

Modules§

access
Who may fire a drone (docs/specs/SPEC_DRONE_REAL_WORLD_JOBS_2026_11_11.md §6.5): the agent that created it (its owner) and the agents it was given to. The table is db_drone_access (m0052_drone_access).
checkpoint
A checkpoint: what the engine writes after every node so a run can resume (docs/specs/SPEC_DRONE_GENERAL_AUTOMATION_2026_11_11.md §3.3).
data_flow
{{var}} interpolation — Mustache-style. Resolves {{block_id.path}}, {{var.name}}, {{env.NAME}} against the execution context (RFC #753 §2 Q5).
executor
host 🔒
The server a running drone’s blocks reach AgentMux through.
payload_schema
What a drone can read of what started it ({{trigger.*}}), field by field, and which of it is outside text (Drone real-world jobs spec §3.6).
recorder
Writing a run’s checkpoints and reading them back (docs/specs/SPEC_DRONE_GENERAL_AUTOMATION_2026_11_11.md §3.3).
replay
Replay from a step (docs/specs/SPEC_DRONE_GENERAL_AUTOMATION_2026_11_11.md §3.3, “Replay and time travel”).
rule_of_two
The Rule of Two, made checkable (docs/specs/SPEC_DRONE_REAL_WORLD_JOBS_2026_11_11.md §6.2 and §6.3).
state
Run state: the named values a graph writes, and how writes combine (docs/specs/SPEC_DRONE_GENERAL_AUTOMATION_2026_11_11.md §3.2).
storage
Store extension methods for db_drone_definitions + db_drone_runs. They sit with the storage layer because the job store, the job templates and the migrations all read these rows; crate::drone::storage still names this module.
transform
The Transform node’s evaluator: shape lists and objects with a restricted expression language and no code execution (docs/specs/SPEC_DRONE_GENERAL_AUTOMATION_2026_11_11.md §3.9).
types
Drone + run types. Mirrors the frontend shape so RPC payloads flow through serde_json::to_value without manual mapping. They sit with the storage layer because the job store and job templates use them; crate::drone::types still names this module.
value
A value in a run, with what the engine must remember about where it came from (docs/specs/SPEC_DRONE_GENERAL_AUTOMATION_2026_11_11.md §4.2, §4.5).
versions
Graph versions: saving a drone makes a numbered version, a job pins one, and a running run keeps the one it started on (docs/specs/SPEC_DRONE_GENERAL_AUTOMATION_2026_11_11.md §3.3 “Graph versions”).