SquidSonar.SavedSpecs (squid_sonar v0.2.0)

Copy Markdown View Source

Host-owned saved workflow spec boundary.

SquidSonar normalizes and previews values the host provides, but persistence, approval policy, action registry ownership, and activation remain host-owned.

Summary

Functions

Fetches one saved workflow spec record by its stable host key.

Lists saved workflow spec records from host-provided keyed data.

Builds example payload JSON for a saved spec's executable runtime spec.

Types

saved_spec()

@type saved_spec() :: %{
  key: String.t(),
  title: String.t(),
  status: atom() | String.t() | nil,
  status_label: String.t(),
  description: String.t() | nil,
  updated_at: term(),
  editor_json: term(),
  source_spec: term(),
  spec: term(),
  validation: validation(),
  preview: {:ok, map()} | {:error, term()} | nil,
  diff: {:ok, map()} | {:error, term()} | nil,
  startable?: boolean()
}

validation()

@type validation() :: %{status: :valid | :invalid, errors: [map()]}

Functions

get(saved_specs, key, action_registry \\ nil)

@spec get(term(), String.t(), term()) :: {:ok, saved_spec()} | {:error, :not_found}

Fetches one saved workflow spec record by its stable host key.

list(saved_specs, action_registry \\ nil)

@spec list(term(), term()) :: [saved_spec()]

Lists saved workflow spec records from host-provided keyed data.

payload_json(arg1)

@spec payload_json(saved_spec()) :: String.t()

Builds example payload JSON for a saved spec's executable runtime spec.