Public declaration syntax from forge-ts/packages/forge-core/src/output.ts Original source SHA-256: b06ca74110c0dcddd0c0737a1543dc77d4957c82cffa2e3ea9d0de63e9f33178 Function bodies and constant values are omitted. This is not the complete implementation. Source line 22 export const FinishReason /* type inferred in source */; Source line 38 export type FinishReason = (typeof FinishReason)[keyof typeof FinishReason]; Source line 46 export function isComplete(reason: FinishReason): boolean; Source line 56 export function isToolCallFinish(reason: FinishReason): boolean; Source line 68 export interface Usage { /** Tokens consumed by the input prompt. */ readonly promptTokens: number; /** Tokens generated in the response. */ readonly completionTokens: number; /** Total tokens (prompt + completion). */ readonly totalTokens: number; } Source line 82 export function zeroUsage(): Usage; Source line 98 export function addUsage(a: Usage, b: Usage): Usage; Source line 121 export interface GenerateResult { /** The model's response message. */ readonly message: ModelMessage; /** Why generation stopped. */ readonly finishReason: FinishReason; /** Token usage statistics. */ readonly usage: Usage; } Source line 133 export interface TextDeltaChunk { readonly type: 'text_delta'; /** The text fragment. */ readonly text: string; } Source line 142 export interface ToolCallDeltaChunk { readonly type: 'tool_call_delta'; /** The tool call index (for parallel tool calls). */ readonly index: number; /** The tool call ID (may be empty until fully received). */ readonly id: string; /** The tool name (may be empty until fully received). */ readonly name: string; /** Partial JSON arguments. */ readonly argumentsDelta: string; } Source line 157 export interface DoneChunk { readonly type: 'done'; /** Why generation stopped. */ readonly finishReason: FinishReason; /** Final usage statistics. */ readonly usage: Usage; } Source line 171 export type StreamChunk = TextDeltaChunk | ToolCallDeltaChunk | DoneChunk; Source line 179 export function textDeltaChunk(text: string): TextDeltaChunk; Source line 190 export function doneChunk(finishReason: FinishReason, usage: Usage): DoneChunk; Source line 200 export function isTextDelta(chunk: StreamChunk): chunk is TextDeltaChunk; Source line 210 export function isDone(chunk: StreamChunk): chunk is DoneChunk; Source line 220 export function chunkText(chunk: StreamChunk): string | undefined;