Skip to content

Interface: PresenterConfig<T>

Defined in: packages/core/src/presenter/definePresenter.ts:67

Full declarative configuration for definePresenter().

Type Parameters

Type ParameterDescription
TInferred from the schema field's output type

Properties

agentLimit?

ts
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()?

ts
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

ParameterType
itemsT[]
ctx?unknown

Returns

Promise<(UiBlock | null)[]>


asyncRules()?

ts
readonly optional asyncRules: (data, ctx?) => Promise<(string | null)[]>;

Defined in: packages/core/src/presenter/definePresenter.ts:201

Async system rules generation.

Parameters

ParameterType
dataT
ctx?unknown

Returns

Promise<(string | null)[]>


asyncSuggestActions()?

ts
readonly optional asyncSuggestActions: (data, ctx?) => Promise<(ActionSuggestion | null)[]>;

Defined in: packages/core/src/presenter/definePresenter.ts:206

Async action suggestions generation.

Parameters

ParameterType
dataT
ctx?unknown

Returns

Promise<(ActionSuggestion | null)[]>


asyncUi()?

ts
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

ParameterType
itemT
ctx?unknown

Returns

Promise<(UiBlock | null)[]>


autoRules?

ts
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

ts
true

collectionRules?

ts
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()?

ts
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

ParameterType
itemsT[]
ctx?unknown

Returns

(ActionSuggestion | null)[]


collectionUi()?

ts
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

ParameterType
itemsT[]
ctx?unknown

Returns

(UiBlock | null)[]


embeds?

ts
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

ts
readonly name: string;

Defined in: packages/core/src/presenter/definePresenter.ts:69

Human-readable domain name (for debugging and introspection)


redactPII?

ts
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?

ts
readonly optional censor: string | (value) => string;

paths

ts
readonly paths: string[];

Example

typescript
redactPII: {
    paths: ['*.ssn', 'credit_card.number', 'patients[*].diagnosis'],
    censor: '[REDACTED]',
}

rules?

ts
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?

ts
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()?

ts
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

ParameterType
dataT
ctx?unknown

Returns

ActionSuggestion[]


ui()?

ts
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

ParameterType
itemT
ctx?unknown

Returns

(UiBlock | null)[]