import type { MastraDBMessage } from '@mastra/core/agent-controller'; import type { CreatedAgentSignal } from '@mastra/core/signals'; export interface TextRenderPart { kind: 'text'; text: string; } export interface ThinkingRenderPart { kind: 'thinking'; text: string; } export interface ToolRenderPart { kind: 'tool'; toolCallId: string; toolName: string; args: unknown; result: unknown; hasResult: boolean; isError: boolean; } export interface OmRenderPart { kind: 'om'; event: 'start' | 'end' | 'failed' | 'thread-title'; operationType: string; data: Record; } export type AssistantRenderPart = TextRenderPart | ThinkingRenderPart | ToolRenderPart | OmRenderPart; /** Join the text of all `text` parts on a message (assistant/user), newline-separated. */ export declare function getMessageText(message: MastraDBMessage): string; /** * Walk a message's `content.parts` and project them into flat render items in * document order. Text/reasoning/tool-invocation/data-om-* parts are surfaced; * bookkeeping parts (`step-start`, `data-om-status`, etc.) are skipped. */ export declare function getAssistantRenderParts(message: MastraDBMessage): AssistantRenderPart[]; /** A message persisted/streamed as a signal carries `role: 'signal'`. */ export declare function isSignalMessage(message: MastraDBMessage): boolean; /** * Reconstruct the original signal (type, tagName, contents, attributes, metadata) * from a `role: 'signal'` `MastraDBMessage`. Delegates to core's canonical * reconstruction so mastracode never re-parses `content.metadata.signal` by hand. */ export declare function getSignalView(message: MastraDBMessage): CreatedAgentSignal; export type SignalKind = 'state' | 'reminder' | 'notification-summary' | 'notification' | 'reactive' | 'user'; /** * Classify a `role: 'signal'` message into the render branch it drives. Mirrors * the dispatch order of the removed core `convertToControllerMessage` signal * handling: state -> reminder -> notification-summary -> notification -> reactive -> user. */ export declare function getSignalKind(message: MastraDBMessage): SignalKind; /** Flatten a signal message's `contents` to plain text (string or text parts). */ export declare function getSignalContentsText(message: MastraDBMessage): string; export interface UserSignalView { message: string; imageCount: number; fileCount: number; } /** Fields needed to render a user-kind signal as a user message. */ export declare function getUserSignalView(message: MastraDBMessage): UserSignalView; export interface ReminderView { reminderType?: string; path?: string; precedesMessageId?: string; gapText?: string; message: string; goalMaxTurns?: number; judgeModelId?: string; goalEvaluation?: unknown; } /** * Fields the reminder/judge UI needs, sourced from a `system-reminder` signal. * Mirrors the placement the removed core `toSystemReminderContent` helper used: * reminder metadata lives under `attributes` (type/path/gapText/precedesMessageId) * and `metadata` (goalMaxTurns/judgeModelId/goalEvaluation). */ export declare function getReminderView(message: MastraDBMessage): ReminderView; /** True for the persisted mirror of a live goal evaluation lifecycle event. */ export declare function isGoalJudgeEvaluationSignal(message: MastraDBMessage): boolean; export interface StateSignalView { stateId: string; mode: 'snapshot' | 'delta'; cacheKey?: string; version?: number; message: string; } /** Fields the state-signal UI needs, sourced from a `state` signal's `metadata.state`. */ export declare function getStateSignalView(message: MastraDBMessage): StateSignalView; export interface ReactiveSignalView { tagName?: string; message: string; } /** Fields the reactive-signal UI needs, sourced from a reactive signal. */ export declare function getReactiveSignalView(message: MastraDBMessage): ReactiveSignalView; export interface NotificationView { message: string; source?: string; kind?: string; priority?: string; status?: string; } /** Fields the notification UI needs, sourced from a notification signal's `attributes`/`metadata`. */ export declare function getNotificationView(message: MastraDBMessage): NotificationView; export interface NotificationSummaryView { message: string; pending: number; bySource: Record; } /** Fields the notification-summary UI needs, sourced from `metadata.notificationSummary`. */ export declare function getNotificationSummaryView(message: MastraDBMessage): NotificationSummaryView; //# sourceMappingURL=db-message-parts.d.ts.map