/** * Error classes for `@gemstack/ai-sdk/computer-use` (#A7 Phase 2). * * Both extend native `Error` so apps can `instanceof`-check from * `try/catch`, error middleware, observers, etc. */ /** * Thrown by {@link computerUseTool} at construction time when the * caller supplies a `model` that isn't an Anthropic-family model * (matches `anthropic/*` or `bedrock/?anthropic.*`). * * Computer-use is Anthropic-only in v1 — see plan * `docs/plans/2026-05-10-ai-computer-use.md`. Other providers either * lack native computer-use entirely (Google, Cohere, …) or only have * preview-quality versions that aren't worth shipping yet (OpenAI's * `computer_use_preview`). * * Apps that wire `computerUseTool({ page, model: this.model() })` * inside `Agent.tools()` get this error at agent boot — fail loud * before the model gets a chance to hallucinate tool calls against a * provider that can't execute them. */ export declare class ComputerUseProviderError extends Error { readonly code: "COMPUTER_USE_PROVIDER_MISMATCH"; readonly model: string; constructor(model: string); } /** * Thrown by {@link computerUseTool}'s execute when the per-run action * counter exceeds {@link ComputerUseToolOptions.maxActions}. * * Bounds runaway agent loops (e.g. a model that keeps clicking the * same broken button forever). Default cap is 50 — most real * computer-use tasks finish well under that. Override via * `computerUseTool({ page, maxActions: 100 })`. */ export declare class ComputerUseLimitError extends Error { readonly code: "COMPUTER_USE_LIMIT_EXCEEDED"; readonly maxActions: number; constructor(maxActions: number); } /** * Returns true when `model` is an Anthropic-family model id — * `anthropic/*` or `bedrock/?anthropic.*` (covers cross-region * inference profiles like `us.anthropic.*`, `eu.anthropic.*`, * `apac.anthropic.*`). * * Used by {@link computerUseTool}'s upfront `model` check. Exported so * apps can guard their own code path symmetrically. * * **Excludes** OpenRouter-routed Anthropic models * (`openrouter/anthropic/*`) — OpenRouter goes through the OpenAI SDK * with a different base URL, so the request never hits Anthropic's * native API and the native computer-use tool block can't be sent. */ export declare function isAnthropicLikeModel(model: string): boolean; //# sourceMappingURL=errors.d.ts.map