Planck.Headless.ResourceStore (Planck.Headless v0.1.0)

Copy Markdown View Source

GenServer started at application boot that holds the loaded resources — the single source of truth for skills, teams, and available models.

Resources are loaded once at startup from the directories configured in Planck.Headless.Config. New sessions pick up whatever is in the store at the time they start; in-flight sessions are not affected by reloads.

Reload

Planck.Headless.ResourceStore.reload()

Triggers a synchronous reload of tools, skills, and teams from disk. Available models are also re-resolved.

Summary

Functions

Returns a specification to start this module under a supervisor.

Clear all sidecar tools. Called by SidecarManager on nodedown.

Return the full resource store state.

Replace the sidecar tool list. Called by SidecarManager on nodeup.

Reload tools, skills, and teams from disk.

Start the ResourceStore under its supervisor.

Types

t()

@type t() :: %Planck.Headless.ResourceStore{
  available_models: [Planck.AI.Model.t()],
  skills: [Planck.Agent.Skill.t()],
  teams: %{required(String.t()) => Planck.Agent.Team.t()},
  tools: [Planck.Agent.Tool.t()]
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear_tools()

@spec clear_tools() :: :ok

Clear all sidecar tools. Called by SidecarManager on nodedown.

get()

@spec get() :: t()

Return the full resource store state.

put_tools(tools)

@spec put_tools([Planck.Agent.Tool.t()]) :: :ok

Replace the sidecar tool list. Called by SidecarManager on nodeup.

reload()

@spec reload() :: :ok

Reload tools, skills, and teams from disk.

In-flight sessions keep their original resources. Only new sessions created after this call will see the updated resources.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Start the ResourceStore under its supervisor.