/** Safe presentation metadata. Native Think messages still own inputs/results. */ export type ToolKind = "memory" | "web" | "browser" | "shell" | "schedule" | "other"; export type ToolActivityStatus = "pending" | "running" | "succeeded" | "failed" | "cancelled"; export type ToolActivityReason = "tool-error" | "turn-cancelled" | "interrupted" | "incomplete"; export interface ToolProgress { text: string; completed?: number; total?: number; } export interface ToolActivity { /** Native tool-call join key, scoped to the conversation. Not an idempotency key. */ toolCallId: string; toolName: string; kind: ToolKind; status: ToolActivityStatus; inputSummary: string; outputSummary?: string; /** Number of observed server executions for this native call (including recovery). */ attempts: number; interruptedAt?: number; createdAt: number; startedAt?: number; endedAt?: number; updatedAt: number; progress?: ToolProgress; reason?: ToolActivityReason; } export interface ToolActivityState { toolActivityVersion: 1; toolActivities: ToolActivity[]; } export interface ToolActivityPage { activities: ToolActivity[]; nextCursor: number | null; } export const TOOL_ACTIVITY_LIVE_LIMIT = 32; export const TOOL_ACTIVITY_PAGE_LIMIT = 100; export const TOOL_ACTIVITY_TEXT_LIMIT = 160;