Help us shape the future of Go! Take the 2026 Go Developer Survey

craftdash

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package craftdash renders the operator's live monitor for craft-plan execution: each plans.PlanRun's DAG as a mermaid flowchart (done nodes faded grey, dispatched nodes bold/gold, parked nodes red) plus a per-item progress table. It is the primary way an operator watches Executor B work a plan tick by tick.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MermaidForPlan

func MermaidForPlan(pr *plans.PlanRun) string

MermaidForPlan renders the plan DAG as mermaid flowchart source.

State -> class: done -> "done" (faded grey), dispatched -> "active" (bold gold), parked -> "parked" (red); waiting nodes get no class (default mermaid styling). KindBlocked nodes always render parked-red even if, for some reason, their NodeRun.State was never flipped to NodeParked — a blocked node is never a healthy default-styled node.

Node label is "<kind> <item> x<qty>", with "<br/>@<agent>" appended on active nodes that have a pinned agent, or "<br/>PARKED (<reason>): <detail>" on parked nodes. Synthetic haul (xfer) nodes render with kind "xfer".

Edges are drawn consumer --> producer (DependsOn direction); an edge whose consumer (the arrow's source) is dispatched/active uses a thick link (==>) so the diagram highlights exactly what's being worked right now.

Node ids are sanitized for mermaid: '/' and any rune outside [a-zA-Z0-9_-] become '_'. Label content pulled from plan data (item id, agent id, park detail) is stripped of characters that could break out of a mermaid quoted label or inject markup (", [, ], <, >).

func Page

func Page(runs []*plans.PlanRun, refreshSec int) []byte

Page renders the full HTML for all runs: per-plan header (id, status, spent/cap), the mermaid <pre class="mermaid">, and the progress table.

func PageWithErrors

func PageWithErrors(runs []*plans.PlanRun, loadErrs []error, refreshSec int) []byte

PageWithErrors is Page plus a visible warning banner listing any LoadAllRuns errors, so a corrupt state file never silently disappears from the operator's view.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL