PtcRunner.SubAgent.Prompt.DataInventory (PtcRunner v0.4.1)

View Source

Data 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

generate(context, context_signature \\ nil, field_descriptions \\ nil)

@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 map
  • context_signature - Optional parsed signature for type information
  • field_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