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.


autoRules?

ts
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

ts
true

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

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)[]