PtcRunner.SubAgent.Prompt.DataInventory (PtcRunner v0.4.1)
View SourceData inventory section generation for SubAgent prompts.
Generates the Data Inventory section that shows available context variables
with their inferred types and sample values. Handles nested maps, lists,
and firewalled fields (prefixed with _).
Summary
Functions
Generate the data inventory section from context.
Functions
@spec generate(map(), PtcRunner.SubAgent.Signature.signature() | nil, map() | nil) :: String.t()
Generate the data inventory section from context.
Shows available context variables with their inferred types and sample values.
Handles nested maps, lists, and firewalled fields (prefixed with _).
When field descriptions are provided (from upstream agent chaining), they are
rendered as Clojure-style comments below each field.
Parameters
context- Context mapcontext_signature- Optional parsed signature for type informationfield_descriptions- Optional map of field name atoms to description strings
Returns
A string containing the data inventory section in markdown format.
Examples
iex> context = %{user_id: 123, name: "Alice"}
iex> inventory = PtcRunner.SubAgent.Prompt.DataInventory.generate(context, nil)
iex> inventory =~ "ctx/user_id"
true
iex> inventory =~ "ctx/name"
true