Message
Transcript messages: what an entry contributes to model context (EntryRecord.model). The shapes follow pi-ai’s, so
a transcript can record what effect/ai cannot express in its Prompt: an assistant message’s stop reason and usage,
and positional system messages that patch named prompt sections and the offered tools. Generation converts a derived
context to an effect/ai Prompt at request time.
Since v0.0.0
AssistantMessage
Section titled “AssistantMessage”Signature
declare const AssistantMessage: anySince v0.0.0
AssistantMessage (type alias)
Section titled “AssistantMessage (type alias)”Signature
type AssistantMessage = typeof AssistantMessage.TypeSince v0.0.0
ImageContent
Section titled “ImageContent”Signature
declare const ImageContent: anySince v0.0.0
ImageContent (type alias)
Section titled “ImageContent (type alias)”Signature
type ImageContent = typeof ImageContent.TypeSince v0.0.0
Message
Section titled “Message”Signature
declare const Message: anySince v0.0.0
Message (type alias)
Section titled “Message (type alias)”Signature
type Message = typeof Message.TypeSince v0.0.0
StopReason
Section titled “StopReason”Why an assistant message ended; pending while it streams. Context derivation never sends aborted, error or
deferred messages again.
Signature
declare const StopReason: anySince v0.0.0
StopReason (type alias)
Section titled “StopReason (type alias)”Signature
type StopReason = typeof StopReason.TypeSince v0.0.0
SystemMessage
Section titled “SystemMessage”A positional change of the system prompt and tool set. sections is an ordered patch: a string adds or replaces a
section, null removes it; toolsRemoved applies before toolsAdded. Replaying every system message in order
yields the prompt and tools in effect. The harness always writes content: "".
Signature
declare const SystemMessage: anySince v0.0.0
SystemMessage (type alias)
Section titled “SystemMessage (type alias)”Signature
type SystemMessage = typeof SystemMessage.TypeSince v0.0.0
TextContent
Section titled “TextContent”Signature
declare const TextContent: anySince v0.0.0
TextContent (type alias)
Section titled “TextContent (type alias)”Signature
type TextContent = typeof TextContent.TypeSince v0.0.0
ThinkingContent
Section titled “ThinkingContent”Model reasoning, with an opaque provider signature for replay.
Signature
declare const ThinkingContent: anySince v0.0.0
ThinkingContent (type alias)
Section titled “ThinkingContent (type alias)”Signature
type ThinkingContent = typeof ThinkingContent.TypeSince v0.0.0
ToolCall
Section titled “ToolCall”A call the model made. arguments is the parsed JSON object.
Signature
declare const ToolCall: anySince v0.0.0
ToolCall (type alias)
Section titled “ToolCall (type alias)”Signature
type ToolCall = typeof ToolCall.TypeSince v0.0.0
ToolDeclaration
Section titled “ToolDeclaration”A tool as offered to the model. parameters is a JSON Schema.
Signature
declare const ToolDeclaration: anySince v0.0.0
ToolDeclaration (type alias)
Section titled “ToolDeclaration (type alias)”Signature
type ToolDeclaration = typeof ToolDeclaration.TypeSince v0.0.0
ToolResultMessage
Section titled “ToolResultMessage”Signature
declare const ToolResultMessage: anySince v0.0.0
ToolResultMessage (type alias)
Section titled “ToolResultMessage (type alias)”Signature
type ToolResultMessage = typeof ToolResultMessage.TypeSince v0.0.0
Tokens and cost of one request or tool execution.
Signature
declare const Usage: anySince v0.0.0
Usage (type alias)
Section titled “Usage (type alias)”Signature
type Usage = typeof Usage.TypeSince v0.0.0
UserMessage
Section titled “UserMessage”Signature
declare const UserMessage: anySince v0.0.0
UserMessage (type alias)
Section titled “UserMessage (type alias)”Signature
type UserMessage = typeof UserMessage.TypeSince v0.0.0
emptyUsage
Section titled “emptyUsage”Signature
declare const emptyUsage: () => UsageSince v0.0.0
The text of a message’s text parts, joined.
Signature
declare const text: (message: Message | undefined) => stringSince v0.0.0
toolCalls
Section titled “toolCalls”The tool calls of an assistant message, in order.
Signature
declare const toolCalls: (message: Message | undefined) => ReadonlyArray<ToolCall>Since v0.0.0