AgentDbWeb.AdminComponents (agent_db v0.1.0)

Copy Markdown View Source

The console's sections, as function components.

One LiveView still owns /admin -- its lifecycle, its subscriptions, and the data it loads. What lives here is only presentation, so that a section is something you can read, and a new one is something you add, without editing a template that has grown past the point where its sections can be found in it.

Every component here is given its data. None of them calls the store: an operator sees what the facade reported, which is what a program gets, and a second path into the store would make the console a way to see things the rest of the system cannot.

Summary

Functions

The store's documents, one bounded page at a time.

Recursive show-all document listing with status and group per row.

The feedback a page set for the operator, one entry per kind.

What the store holds, and how much of that is the cache rather than content.

The store's own health checks, per check rather than as one verdict.

Where an operator imports Agent Skills from.

How much of the store each index covers.

The LLM-facing layers of one document: L0 abstract, L1 overview, L2 content.

Model state per role, with load duration and live inference count.

Background work: what is outstanding, how far behind, and what failed.

The recent-change feed: URI, kind, and version only.

How long the node has been up, what it is running, and what has failed.

Document search over the store, linking each hit to the editor.

Looking a session up by id; the store keeps no index to list them by.

The console's sidebar navigation, marking the page currently shown.

Installed-skill inventory with status and group per row, alongside import.

Functions

documents(assigns)

The store's documents, one bounded page at a time.

root is the URI the page was listed from, so each entry becomes the URI it actually names. Everything that acts on a row needs that full URI: the editor link and the removal button both hand it to the store, and a bare name is not something the store can resolve -- acting on one reports invalid_uri for an entry the operator can plainly see.

Attributes

  • documents (:map) (required)
  • root (:string) (required)

documents_all(assigns)

Recursive show-all document listing with status and group per row.

Rows carry full URIs, so toggle and group actions address what the store resolves. Bulk actions apply to the current filtered set.

Attributes

  • listing (:map) (required)
  • substring (:string) - Defaults to "".
  • group (:string) - Defaults to "".
  • show_disabled (:boolean) - Defaults to false.

flash_group(assigns)

The feedback a page set for the operator, one entry per kind.

A LiveView sets feedback with put_flash, but it only reaches the operator if a layout renders it. Every console page shares this shell, so rendering it here is what makes the outcome of an action visible without leaving the page. The host is always present -- an empty one measures nothing -- so the live region exists before any message arrives.

Attributes

  • flash (:map) (required)

footprint(assigns)

What the store holds, and how much of that is the cache rather than content.

Attributes

  • storage (:map) (required)
  • cache (:map) (required)

health(assigns)

The store's own health checks, per check rather than as one verdict.

Attributes

  • health (:map) (required)

import_skills(assigns)

Where an operator imports Agent Skills from.

Attributes

  • uploads (:map) (required)
  • user_id (:string) - Defaults to "".
  • limits (:map) (required)
  • results (:list) - Defaults to [].

indexes(assigns)

How much of the store each index covers.

An index that cannot be queried says so: "not available" and "nothing indexed yet" are different states, and telling them apart is the whole point of the section.

Attributes

  • coverage (:map) (required)

llm_layers(assigns)

The LLM-facing layers of one document: L0 abstract, L1 overview, L2 content.

Given the map Context.get_layers/1 returns. Presentation only: it never reads the store, so what the operator sees is what a program gets. A layer longer than the excerpt bound renders its excerpt with the full text one expand away, so a large document stays usable.

Attributes

  • layers (:map) (required)
  • title (:string) - Defaults to "How the LLM sees this document".

memory_candidates(assigns)

Attributes

  • candidates (:list) - Defaults to [].

memory_stats(assigns)

Attributes

  • stats (:map) - Defaults to %{}.

models(assigns)

Model state per role, with load duration and live inference count.

Attributes

  • models (:map) (required)

operation_stats(assigns)

queue(assigns)

Background work: what is outstanding, how far behind, and what failed.

Attributes

  • jobs (:map) (required)
  • detail (:map) (required)

recent_changes(assigns)

The recent-change feed: URI, kind, and version only.

Attributes

  • changes (:list) (required)

runtime(assigns)

How long the node has been up, what it is running, and what has failed.

search(assigns)

Document search over the store, linking each hit to the editor.

Attributes

  • term (:string) - Defaults to "".
  • scope (:string) - Defaults to "".
  • results (:list) - Defaults to [].
  • notice (:string) - Defaults to nil.

session_lookup(assigns)

Looking a session up by id; the store keeps no index to list them by.

Attributes

  • session_id (:string) - Defaults to "".
  • messages (:list) - Defaults to [].
  • notice (:string) - Defaults to nil.

sidebar(assigns)

The console's sidebar navigation, marking the page currently shown.

Attributes

  • active (:atom) (required)

skills_inventory(assigns)

Installed-skill inventory with status and group per row, alongside import.

A row's LLM view toggle expands the files under that skill root with the layers the store answers for each file.

Attributes

  • inventory (:map) (required)
  • substring (:string) - Defaults to "".
  • owner (:string) - Defaults to "".
  • group (:string) - Defaults to "".
  • show_disabled (:boolean) - Defaults to false.
  • llm_uri (:string) - Defaults to nil.
  • llm_view (:map) - Defaults to nil.