Interface: PresenterConfig<T>
Defined in: packages/core/src/presenter/definePresenter.ts:67
Full declarative configuration for definePresenter().
Type Parameters
| Type Parameter | Description |
|---|---|
T | Inferred from the schema field's output type |
Properties
agentLimit?
readonly optional agentLimit: AgentLimitDef;Defined in: packages/core/src/presenter/definePresenter.ts:105
Cognitive guardrail that truncates large collections.
Protects against context DDoS by limiting returned array length and injecting a summary block.
autoRules?
readonly optional autoRules: boolean;Defined in: packages/core/src/presenter/definePresenter.ts:132
Automatically extract .describe() annotations from the Zod schema and merge them with rules as system rules.
When true (the default), field-level .describe() annotations become system rules, ensuring documentation never drifts from the actual data shape. Set to false to opt out.
Default
truecollectionUi()?
readonly optional collectionUi: (items, ctx?) => (UiBlock | null)[];Defined in: packages/core/src/presenter/definePresenter.ts:97
Aggregated UI blocks for a collection (array) of items.
Called once with the entire validated array. Prevents N individual charts from flooding the LLM's context.
Parameters
| Parameter | Type |
|---|---|
items | T[] |
ctx? | unknown |
Returns
(UiBlock | null)[]
embeds?
readonly optional embeds: readonly EmbedDef[];Defined in: packages/core/src/presenter/definePresenter.ts:120
Embedded child Presenters for nested relational data.
Define once, embed everywhere. Each embed's key is looked up on the parent data, and the child Presenter renders its own blocks/rules.
name
readonly name: string;Defined in: packages/core/src/presenter/definePresenter.ts:69
Human-readable domain name (for debugging and introspection)
redactPII?
readonly optional redactPII: {
censor?: string | (value) => string;
paths: string[];
};Defined in: packages/core/src/presenter/definePresenter.ts:151
PII redaction paths for DLP compliance.
Compiles object paths into V8-optimized masking functions using fast-redact. Masked data reaches the LLM, while UI blocks and system rules see the full unmasked data.
Requires fast-redact as an optional peer dependency.
censor?
readonly optional censor: string | (value) => string;paths
readonly paths: string[];Example
redactPII: {
paths: ['*.ssn', 'credit_card.number', 'patients[*].diagnosis'],
censor: '[REDACTED]',
}rules?
readonly optional rules: readonly string[] | (data, ctx?) => (string | null)[];Defined in: packages/core/src/presenter/definePresenter.ts:82
System rules that travel with the data.
- Static:
string[]— always injected - Dynamic:
(data, ctx?) => (string | null)[]— context-aware (RBAC, DLP, locale)
Return null from dynamic rules to conditionally exclude them.
schema?
readonly optional schema: ZodType<any, any, any>;Defined in: packages/core/src/presenter/definePresenter.ts:72
Zod schema for data validation and field filtering
suggestActions()?
readonly optional suggestActions: (data, ctx?) => ActionSuggestion[];Defined in: packages/core/src/presenter/definePresenter.ts:112
HATEOAS-style next-action suggestions based on data state.
Eliminates routing hallucinations by providing explicit next-step hints.
Parameters
| Parameter | Type |
|---|---|
data | T |
ctx? | unknown |
Returns
ActionSuggestion[]
ui()?
readonly optional ui: (item, ctx?) => (UiBlock | null)[];Defined in: packages/core/src/presenter/definePresenter.ts:89
UI blocks for a single data item.
Return null for conditional blocks (filtered automatically).
Parameters
| Parameter | Type |
|---|---|
item | T |
ctx? | unknown |
Returns
(UiBlock | null)[]