Documentation
¶
Overview ¶
Package cli holds embeddable Kong commands for the bones binary.
Each command type is a Kong-tagged struct with a Run method. The command tree is assembled in cmd/bones/cli.go alongside libfossil/cli and EdgeSync/cli.
Index ¶
- type InitCmd
- type JoinCmd
- type OrchestratorCmd
- type TasksAggregateCmd
- type TasksAutoclaimCmd
- type TasksClaimCmd
- type TasksCloseCmd
- type TasksCmd
- type TasksCompactCmd
- type TasksCreateCmd
- type TasksDispatchCmd
- type TasksDispatchParentCmd
- type TasksDispatchWorkerCmd
- type TasksLinkCmd
- type TasksListCmd
- type TasksOrphansCmd
- type TasksPreflightCmd
- type TasksPrimeCmd
- type TasksReadyCmd
- type TasksShowCmd
- type TasksStaleCmd
- type TasksStatusCmd
- type TasksUpdateCmd
- type TasksWatchCmd
- type UpCmd
- type ValidatePlanCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InitCmd ¶
type InitCmd struct{}
InitCmd creates a new bones workspace in the current directory.
type OrchestratorCmd ¶
type OrchestratorCmd struct{}
OrchestratorCmd installs the hub-leaf orchestrator scripts, skills, and Claude Code hooks into an existing workspace.
func (*OrchestratorCmd) Run ¶
func (c *OrchestratorCmd) Run(g *libfossilcli.Globals) error
type TasksAggregateCmd ¶
type TasksAggregateCmd struct {
Since time.Duration `name:"since" default:"1h" help:"window size"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksAggregateCmd produces a per-slot summary of tasks within a window.
func (*TasksAggregateCmd) Run ¶
func (c *TasksAggregateCmd) Run(g *libfossilcli.Globals) error
type TasksAutoclaimCmd ¶
type TasksAutoclaimCmd struct {
Enabled *bool `name:"enabled" help:"enable tick (default: env AGENT_INFRA_AUTOCLAIM)"`
Idle bool `name:"idle" default:"true" help:"treat session as idle for this tick"`
ClaimTTL time.Duration `name:"claim-ttl" default:"1m" help:"claim TTL for auto-claimed task"`
}
TasksAutoclaimCmd runs a single autoclaim tick.
func (*TasksAutoclaimCmd) Run ¶
func (c *TasksAutoclaimCmd) Run(g *libfossilcli.Globals) error
type TasksClaimCmd ¶
type TasksClaimCmd struct {
ID string `arg:"" help:"task id"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksClaimCmd claims a task as the current agent.
func (*TasksClaimCmd) Run ¶
func (c *TasksClaimCmd) Run(g *libfossilcli.Globals) error
type TasksCloseCmd ¶
type TasksCloseCmd struct {
ID string `arg:"" help:"task id"`
Reason string `name:"reason" help:"close reason (optional)"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksCloseCmd closes a task.
func (*TasksCloseCmd) Run ¶
func (c *TasksCloseCmd) Run(g *libfossilcli.Globals) error
type TasksCmd ¶
type TasksCmd struct {
Add TasksCreateCmd `cmd:"" help:"Alias for create"`
Create TasksCreateCmd `cmd:"" help:"Create a new task"`
List TasksListCmd `cmd:"" help:"List tasks"`
Show TasksShowCmd `cmd:"" help:"Show a task"`
Update TasksUpdateCmd `cmd:"" help:"Update a task"`
Claim TasksClaimCmd `cmd:"" help:"Claim a task"`
Close TasksCloseCmd `cmd:"" help:"Close a task"`
Ready TasksReadyCmd `cmd:"" help:"List tasks ready for claim"`
Watch TasksWatchCmd `cmd:"" help:"Stream task lifecycle events"`
Status TasksStatusCmd `cmd:"" help:"Snapshot of all tasks by status"`
Link TasksLinkCmd `cmd:"" help:"Link two tasks with an edge type"`
Prime TasksPrimeCmd `cmd:"" help:"Print agent-tasks context (prime)"`
Stale TasksStaleCmd `cmd:"" help:"List stale tasks"`
Orphans TasksOrphansCmd `cmd:"" help:"List orphaned (claimed by absent agent) tasks"`
Preflight TasksPreflightCmd `cmd:"" help:"Combined stale + orphans report"`
Compact TasksCompactCmd `cmd:"" help:"Compact closed tasks"`
Autoclaim TasksAutoclaimCmd `cmd:"" help:"Run one autoclaim tick"`
Dispatch TasksDispatchCmd `cmd:"" help:"Dispatch parent/worker"`
Aggregate TasksAggregateCmd `cmd:"" help:"Aggregate per-slot task summary"`
}
TasksCmd groups all `bones tasks <verb>` subcommands.
type TasksCompactCmd ¶
type TasksCompactCmd struct {
MinAge time.Duration `name:"min-age" default:"24h" help:"minimum closed age"`
Limit int `name:"limit" default:"20" help:"maximum tasks per pass"`
Prune bool `name:"prune" help:"archive and purge compacted tasks"`
Every time.Duration `name:"every" help:"repeat compaction on this interval"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksCompactCmd compacts (archives + optionally purges) closed tasks.
The underlying compaction primitive moved from *coord.Coord to *coord.Leaf in Task 10 of the EdgeSync refactor; this CLI does not own a Leaf, so the run-once path returns errCompactCLIUnavailable. Flag parsing and the runCompactCadence loop are preserved so the existing test surface continues to compile and pass.
func (*TasksCompactCmd) Run ¶
func (c *TasksCompactCmd) Run(g *libfossilcli.Globals) error
type TasksCreateCmd ¶
type TasksCreateCmd struct {
Title string `arg:"" help:"task title"`
Files string `name:"files" help:"comma-separated file list"`
Parent string `name:"parent" help:"parent task id"`
DeferUntil string `name:"defer-until" help:"RFC3339 time"`
Context []string `name:"context" help:"key=value (repeatable)" sep:"none"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksCreateCmd creates a new task.
func (*TasksCreateCmd) Run ¶
func (c *TasksCreateCmd) Run(g *libfossilcli.Globals) error
type TasksDispatchCmd ¶
type TasksDispatchCmd struct {
Parent TasksDispatchParentCmd `cmd:"" help:"Run dispatch parent"`
Worker TasksDispatchWorkerCmd `cmd:"" help:"Run dispatch worker"`
}
TasksDispatchCmd groups dispatch parent/worker subcommands.
type TasksDispatchParentCmd ¶
type TasksDispatchParentCmd struct {
TaskID string `name:"task-id" required:"" help:"task id"`
WorkerBin string `name:"worker-bin" help:"worker binary path (default: this process)"`
WorkerResult string `name:"worker-result" default:"success" help:"worker final result"`
WorkerSummary string `name:"worker-summary" default:"done" help:"worker final summary"`
WorkerClaimHandoff bool `name:"worker-claim-handoff" help:"worker takes claim ownership"`
}
TasksDispatchParentCmd runs the parent side of the dispatch flow: spawn a worker process, subscribe for its result, then close/fork the claimed task accordingly.
func (*TasksDispatchParentCmd) Run ¶
func (c *TasksDispatchParentCmd) Run(g *libfossilcli.Globals) error
type TasksDispatchWorkerCmd ¶
type TasksDispatchWorkerCmd struct {
TaskID string `name:"task-id" required:"" help:"task id"`
TaskThread string `name:"task-thread" required:"" help:"task chat thread"`
WorkerAgentID string `name:"worker-agent-id" required:"" help:"worker agent id"`
ClaimFromAgentID string `name:"claim-from-agent-id" help:"expected previous claimer"`
HandoffTTL time.Duration `name:"handoff-ttl" help:"handoff hold ttl"`
Result string `name:"result" default:"success" help:"success|fork|fail"`
Summary string `name:"summary" default:"done" help:"final summary"`
Branch string `name:"branch" help:"fork branch"`
Rev string `name:"rev" help:"fork rev"`
}
TasksDispatchWorkerCmd runs the worker side of the dispatch flow: optionally take over a claim, post progress to the task thread, then close (on success-with-handoff) or just announce the result.
func (*TasksDispatchWorkerCmd) Run ¶
func (c *TasksDispatchWorkerCmd) Run(g *libfossilcli.Globals) error
type TasksLinkCmd ¶
type TasksLinkCmd struct {
From string `arg:"" help:"from task id"`
To string `arg:"" help:"to task id"`
Type string `name:"type" help:"edge type: blocks|supersedes|duplicates|discovered-from"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksLinkCmd links two tasks with a typed edge.
func (*TasksLinkCmd) Run ¶
func (c *TasksLinkCmd) Run(g *libfossilcli.Globals) error
type TasksListCmd ¶
type TasksListCmd struct {
All bool `name:"all" help:"include closed tasks"`
Status string `name:"status" help:"open|claimed|closed"`
ClaimedBy string `name:"claimed-by" help:"agent id, or - for unclaimed"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksListCmd lists tasks.
func (*TasksListCmd) Run ¶
func (c *TasksListCmd) Run(g *libfossilcli.Globals) error
type TasksOrphansCmd ¶
type TasksOrphansCmd struct {
JSON bool `name:"json" help:"emit JSON"`
}
TasksOrphansCmd lists claimed tasks whose claimer is not currently online.
func (*TasksOrphansCmd) Run ¶
func (c *TasksOrphansCmd) Run(g *libfossilcli.Globals) error
type TasksPreflightCmd ¶
type TasksPreflightCmd struct {
Days int `name:"days" default:"7" help:"minimum stale age in days"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksPreflightCmd runs both stale and orphans, returning a combined report.
func (*TasksPreflightCmd) Run ¶
func (c *TasksPreflightCmd) Run(g *libfossilcli.Globals) error
type TasksPrimeCmd ¶
type TasksPrimeCmd struct {
JSON bool `name:"json" help:"emit JSON"`
}
TasksPrimeCmd prints an agent context summary (open/ready/claimed tasks, recent threads, peers online).
func (*TasksPrimeCmd) Run ¶
func (c *TasksPrimeCmd) Run(g *libfossilcli.Globals) error
type TasksReadyCmd ¶
type TasksReadyCmd struct {
JSON bool `name:"json" help:"emit JSON"`
}
TasksReadyCmd lists tasks that are ready to claim.
func (*TasksReadyCmd) Run ¶
func (c *TasksReadyCmd) Run(g *libfossilcli.Globals) error
type TasksShowCmd ¶
type TasksShowCmd struct {
ID string `arg:"" help:"task id"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksShowCmd prints a single task.
func (*TasksShowCmd) Run ¶
func (c *TasksShowCmd) Run(g *libfossilcli.Globals) error
type TasksStaleCmd ¶
type TasksStaleCmd struct {
Days int `name:"days" default:"7" help:"minimum age in days"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksStaleCmd lists open/claimed tasks not updated within --days.
func (*TasksStaleCmd) Run ¶
func (c *TasksStaleCmd) Run(g *libfossilcli.Globals) error
type TasksStatusCmd ¶
type TasksStatusCmd struct{}
TasksStatusCmd prints a one-shot snapshot of hub and backlog state.
Output:
hub: http://127.0.0.1:8765 (pid 12345) nats: nats://127.0.0.1:4222 backlog: 3 open · 1 claimed · 2 closed (last 24h)
func (*TasksStatusCmd) Run ¶
func (c *TasksStatusCmd) Run(g *libfossilcli.Globals) error
type TasksUpdateCmd ¶
type TasksUpdateCmd struct {
ID string `arg:"" help:"task id"`
Status string `name:"status" help:"open|claimed|closed"`
Title *string `name:"title" help:"new title"`
Files *string `name:"files" help:"comma-separated file list (replaces existing)"`
Parent *string `name:"parent" help:"parent task id"`
DeferUntil *string `name:"defer-until" help:"RFC3339 time (empty clears)"`
Context []string `name:"context" help:"key=value (repeatable; merges)" sep:"none"`
ClaimedBy *string `name:"claimed-by" help:"agent id to claim as"`
JSON bool `name:"json" help:"emit JSON"`
}
TasksUpdateCmd updates a task. Flags are pointer-typed so we can detect "flag absent" vs "flag set to empty string" — a distinction the underlying mutator depends on (only set fields get applied).
func (*TasksUpdateCmd) Run ¶
func (c *TasksUpdateCmd) Run(g *libfossilcli.Globals) error
type TasksWatchCmd ¶
type TasksWatchCmd struct{}
TasksWatchCmd subscribes to the tasks KV bucket and streams human-readable lifecycle events to stdout until Ctrl-C or context cancellation.
func (*TasksWatchCmd) Run ¶
func (c *TasksWatchCmd) Run(g *libfossilcli.Globals) error
type UpCmd ¶
type UpCmd struct{}
UpCmd performs full bootstrap from a fresh clone: workspace init, orchestrator scaffold, leaf binary resolution, and hub bootstrap.
type ValidatePlanCmd ¶
type ValidatePlanCmd struct {
Path string `arg:"" type:"existingfile" help:"Markdown plan path"`
ListSlots bool `name:"list-slots" help:"emit JSON slot→task list (still runs validation)"`
}
ValidatePlanCmd parses a Markdown plan, extracts [slot: name] annotations, and verifies:
- Every Task heading has a [slot: name].
- Slots are directory-disjoint (no two slots share a directory prefix).
- Each task's Files: paths begin with the slot's owned directory.
Exits 0 if valid, 1 if violations are reported. With --list-slots, also emits a JSON slot→task mapping to stdout on success.
func (*ValidatePlanCmd) Run ¶
func (c *ValidatePlanCmd) Run(g *libfossilcli.Globals) error
Source Files
¶
- init.go
- orchestrator.go
- tasks_aggregate.go
- tasks_autoclaim.go
- tasks_claim.go
- tasks_close.go
- tasks_common.go
- tasks_compact.go
- tasks_create.go
- tasks_dispatch.go
- tasks_format.go
- tasks_health.go
- tasks_link.go
- tasks_list.go
- tasks_prime.go
- tasks_ready.go
- tasks_show.go
- tasks_status.go
- tasks_update.go
- tasks_watch.go
- up.go
- validate_plan.go