/** * Apple Foundation Models: Apple's on-device system language model (macOS 27+, * Apple silicon), driven in-process through the pi-natives Swift bridge * (`crates/pi-natives/src/applefm/bridge.swift`). * * Every request lowers the full conversation into a Foundation Models * `Transcript` — instructions with tool definitions, prompts, responses, tool * calls, and tool outputs — and the bridge streams exactly one model turn back. * Tool calls are returned, not executed, so the agent loop runs them and * resumes by sending their outputs in the next request. */ import type { Effort } from "@oh-my-pi/pi-catalog/effort"; import type { StreamFunction, StreamOptions, ToolChoice } from "../types.js"; /** Options for the `apple-foundation-models` API. */ export interface AppleFoundationModelsOptions extends StreamOptions { toolChoice?: ToolChoice; /** Reasoning effort; only forwarded to models whose capabilities include reasoning. */ reasoning?: Effort; } /** Usability of the on-device model, as reported by the bridge. */ export interface AppleFoundationModelsAvailability { available: boolean; /** Why the model is unusable: `device_not_eligible`, `apple_intelligence_not_enabled`, `model_not_ready`, `unsupported_os`, `not_built`, `unsupported_platform`. */ reason?: string; /** Context window in tokens. */ contextSize?: number; /** Model variant display name, e.g. `AFM 3 Core Advanced`. */ variant?: string; vision?: boolean; toolCalling?: boolean; /** Whether the model reasons in a separate channel (`ContextOptions.reasoningLevel`). */ reasoningCapable?: boolean; } /** Probes whether the on-device model can generate on this machine. */ export declare function getAppleFoundationModelsAvailability(): Promise; /** Streams one turn from the on-device Apple Foundation Model. */ export declare const streamAppleFoundationModels: StreamFunction<"apple-foundation-models">;