Skip to content
providerkit
GitHub

AgentProjectorOptions

Defined in: react/src/agents.ts:134

optional agentId?: string;

Defined in: react/src/agents.ts:142

Registered root agent, when known before a snapshot or handoff event.


optional clientTools?: Readonly<Record<string, (arguments_, request) => unknown>>;

Defined in: react/src/agents.ts:165

Explicitly authorize each device input. Receives effective, approved arguments, NOT the model’s original JSON string. The callback must validate and filter for this viewer.


optional error?: (state) => DisplayError;

Defined in: react/src/agents.ts:169

Without it a failure shows its code and a sentence that says nothing private.

Parameter Type
state | { limit: LimitReason; status: "limited"; } | { error: RunFailure; status: "failed"; }

DisplayError


optional input?: (input, scope) =>
| {
text?: string;
}
| undefined;

Defined in: react/src/agents.ts:178

Viewer-safe text from saved steering input. Never copy raw history or media references.

Parameter Type
input RunInput
scope { rootRunId: string; runId: string; }
scope.rootRunId string
scope.runId string

| { text?: string; } | undefined


optional labels?: object;

Defined in: react/src/agents.ts:146

Words for rows, keyed by tool name and by registered definition id.

optional agent?: Readonly<Record<string, string>>;
optional run?: Readonly<Record<string, string>>;

Optional overrides for a particular run, before the registered-agent label.

optional step?: Readonly<Record<string, string>>;

Explicit safe labels keyed by step key. Unmapped steps have a generic label.

optional tool?: Readonly<Record<string, string>>;
optional workflow?: Readonly<Record<string, string>>;

messageId: string;

Defined in: react/src/agents.ts:136

The assistant message this run writes into.


optional output?: (candidate) => readonly DisplayPart[];

Defined in: react/src/agents.ts:185

Parts for a completed run’s checked result (the submit_result arguments, or the final text of a run without an output contract). Without it the result is not shown. Give the parts ids no SDK operation id can take, and settle them: they are sent unnumbered.

Parameter Type
candidate unknown

readonly DisplayPart[]


optional reasoning?: (source) => boolean;

Defined in: react/src/agents.ts:176

Which runs’ reasoning words are sent, on their thinking rows. Defaults to none. Reasoning can quote the instructions, a tool’s output or private data, so by default a thinking row says only that the model thought and for how long. A run gets thinking rows only where text shows its text.

Parameter Type
source TextSource

boolean


optional request?: (activity) =>
| RequestDisplay
| null
| undefined;

Defined in: react/src/agents.ts:162

Opts viewer-safe question fields, edited inputs and decision data into display. Without it, questions and client actions show a generic, non-actionable waiting row.

Parameter Type
activity AskRecord

| RequestDisplay | null | undefined


runId: string;

Defined in: react/src/agents.ts:140

The run this projector draws: the runId you gave agent.run, or the runId of its saved snapshot. It stays the same across approval segments. Another run’s events are drawn only after a child event named it as a specialist of this one.


optional step?: (activity) =>
| Omit<ToolDisplay, "name">
| null
| undefined;

Defined in: react/src/agents.ts:159

Viewer-safe step details only. Raw step data stays on the server without this callback.

Parameter Type
activity StepActivity

| Omit<ToolDisplay, "name"> | null | undefined


optional text?: (source) => boolean;

Defined in: react/src/agents.ts:171

Which runs’ model text is shown. Defaults to the root and its conversation handoffs only.

Parameter Type
source TextSource

boolean


optional tool?: (activity) =>
| ToolDisplay
| null
| undefined;

Defined in: react/src/agents.ts:157

Return null to hide a call. That is decided from the call before it has a result, so a call is shown for its whole life or never. Called again with the result for the final row.

Parameter Type
activity ToolActivity

| ToolDisplay | null | undefined


optional workflowId?: string;

Defined in: react/src/agents.ts:144

Registered workflow root, instead of agentId. Workflows have no conversation owner.