Documentation
¶
Overview ¶
Package renderrefs defines the sideband protocol for lifting references from tool output so the chat UI can render a rich card instead of a raw UUID.
The protocol is currently dormant: the former producers (the deleted stella CLI commands) are gone, and no production code calls Emit today. The consumer pipeline still runs Extract in the agent runner / LCM / Feishu paths so native tools can adopt Emit later without a storage migration. References are derived data: nothing is stored that a GET on the entity could not re-derive, so stale previews never lie — the frontend always hydrates by id.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Preview ¶
type Preview struct {
Title string `json:"title,omitempty"`
Status string `json:"status,omitempty"`
}
Preview is a best-effort snapshot used only as a loading placeholder. It is never trusted: the frontend hydrates the live entity by id, so a forged or stale preview cannot grant access or misrepresent state past first paint.
type Reference ¶
type Reference struct {
V int `json:"v"`
Type string `json:"type"` // "task" | "goal" | "recally_article" | future
ID string `json:"id"` // entity UUID
Intent string `json:"intent,omitempty"` // "created" (default emitted) | "referenced"
AgentID string `json:"agent_id,omitempty"` // owning agent, for deep links to agent-scoped pages (task/goal)
Preview *Preview `json:"preview,omitempty"`
}
Reference is one renderable entity reference. Type and ID are the only load- bearing fields; everything else is a hint.
func Extract ¶
Extract pulls every sentinel reference out of text and returns the text with those lines removed. Lines are matched anchored at their start (after leading whitespace), so a sentinel survives stdout/stderr interleaving and tail truncation as long as the line itself is intact. Malformed sentinel lines are dropped silently rather than surfaced as garbage to the user.