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.
asyncCollectionUi()?
readonly optional asyncCollectionUi: (items, ctx?) => Promise<(UiBlock | null)[]>;Defined in: packages/core/src/presenter/definePresenter.ts:196
Async UI blocks for a collection of items.
Parameters
| Parameter | Type |
|---|---|
items | T[] |
ctx? | unknown |
Returns
Promise<(UiBlock | null)[]>
asyncRules()?
readonly optional asyncRules: (data, ctx?) => Promise<(string | null)[]>;Defined in: packages/core/src/presenter/definePresenter.ts:201
Async system rules generation.
Parameters
| Parameter | Type |
|---|---|
data | T |
ctx? | unknown |
Returns
Promise<(string | null)[]>
asyncSuggestActions()?
readonly optional asyncSuggestActions: (data, ctx?) => Promise<(ActionSuggestion | null)[]>;Defined in: packages/core/src/presenter/definePresenter.ts:206
Async action suggestions generation.
Parameters
| Parameter | Type |
|---|---|
data | T |
ctx? | unknown |
Returns
Promise<(ActionSuggestion | null)[]>
asyncUi()?
readonly optional asyncUi: (item, ctx?) => Promise<(UiBlock | null)[]>;Defined in: packages/core/src/presenter/definePresenter.ts:191
Async UI blocks for a single data item.
Used when UI generation requires I/O (database, API, etc.). Ignored by sync make() — only consumed by makeAsync().
Parameters
| Parameter | Type |
|---|---|
item | T |
ctx? | unknown |
Returns
Promise<(UiBlock | null)[]>
autoRules?
readonly optional autoRules: boolean;Defined in: packages/core/src/presenter/definePresenter.ts:159
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
truecollectionRules?
readonly optional collectionRules: readonly string[] | (items, ctx?) => (string | null)[];Defined in: packages/core/src/presenter/definePresenter.ts:147
Collection-level system rules evaluated with the entire array.
Use for aggregate context (totals, counts, mixed-status warnings) that cannot be derived from a single item.
Both per-item rules and collectionRules are merged in the response.
- Static:
string[]— always injected for collections - Dynamic:
(items[], ctx?) => (string | null)[]— context-aware
collectionSuggestions()?
readonly optional collectionSuggestions: (items, ctx?) => (ActionSuggestion | null)[];Defined in: packages/core/src/presenter/definePresenter.ts:134
HATEOAS-style suggestions for collections (arrays).
Unlike suggestActions, this callback receives the entire array of validated items, enabling aggregate-level suggestions like batch operations, bulk approvals, or summary insights.
Return null for conditional suggestions (filtered automatically).
When both suggestActions and collectionSuggestions are set, only collectionSuggestions is used for arrays.
Parameters
| Parameter | Type |
|---|---|
items | T[] |
ctx? | unknown |
Returns
(ActionSuggestion | null)[]
collectionUi()?
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:178
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)[]