/** * anthropic-vertex.ts, Claude on Google Cloud Vertex AI. * * `@anthropic-ai/sdk` and `google-auth-library` are both declared under * `optionalDependencies` in packages/sdk/package.json, and this file used to * import both as VALUES at module init: `AnthropicVertexClient extends * BaseAnthropic`, `new Resources.Messages(...)`, `new GoogleAuth(...)`. The * provider registry puts this module on the daemon's graph, so an install * without either package did not lose Vertex, it lost the daemon, at module * init, before anything could report why (see utils/optional-dependency.ts). * * A class cannot extend a dynamically imported base directly, because the * `extends` expression is evaluated when the class declaration is evaluated. * So the class is DECLARED INSIDE an async factory that is called once and * memoised: the declaration, and with it the `extends` expression, runs * after the import resolves, and every later `new` gets the same class object. * The type-only imports below stay type-only and are erased, so no specifier * for either package survives on the module graph. */ import type { BaseAnthropic, ClientOptions } from '@anthropic-ai/sdk/client'; import type * as Resources from '@anthropic-ai/sdk/resources/index'; import type { AuthClient, GoogleAuth } from 'google-auth-library'; import { AnthropicSdkProvider } from './anthropic-sdk-provider.js'; import type { ProviderModelSource } from './interface.js'; import { type LiveModelDiscoveryResult } from './live-model-discovery.js'; /** * Whether the Vertex provider can run in this installation, and why not. * * Every package is checked, not just the first missing one: an install that * skipped both optional packages should be told about both rather than led * through them one error at a time. */ export declare function describeAnthropicVertexAvailability(): Promise<{ available: boolean; reason?: string; }>; /** * Dated fallback model list, used when no Google Cloud credentials are * configured (so a live publisher-model listing call isn't possible) and as * the offline baseline when a live call fails with no prior cache. Re-dated * 2026-07-13 when live discovery (below) was wired up; the entries * themselves are still only cross-checked against the direct Anthropic * API's /v1/models response, not against a live Vertex AI project's actual * publisher-model listing (no Google Cloud credentials were available in * this environment to verify against). `refreshModels()` replaces this list * with the project's real available model ids the first time it runs * successfully against real credentials. */ export declare const VERTEX_DATED_STATIC_MODELS: readonly string[]; export declare const VERTEX_DATED_STATIC_MODELS_AS_OF = "2026-07-13"; interface AnthropicVertexClientOptions extends ClientOptions { readonly projectId?: string | null | undefined; readonly region?: string | null | undefined; readonly googleAuth?: GoogleAuth | undefined; readonly authClient?: AuthClient | undefined; } /** The Vertex client's shape, independent of when its base class is built. */ export interface AnthropicVertexClientLike extends BaseAnthropic { readonly messages: Resources.Messages; readonly beta: Resources.Beta; } /** * Build a Vertex client. Resolves the two optional packages first, so an * install without them fails this one construction with a message naming the * missing package rather than preventing the process from starting. */ export declare function createAnthropicVertexClient(options?: AnthropicVertexClientOptions): Promise; export declare class AnthropicVertexProvider extends AnthropicSdkProvider { readonly modelSource: ProviderModelSource; private readonly modelsCachePath; private readonly discoveryAuthClient; /** * @param discoveryAuthClient Optional override for the `AuthClient` used * by `refreshModels()`'s live publisher-model listing (see * `fetchVertexModelIds`). Production callers leave this unset. */ constructor(modelsCachePath?: string, discoveryAuthClient?: Pick); isConfigured(): boolean; /** * Re-check Vertex's live Anthropic publisher-model list. Called at boot * (background, respects the on-disk TTL cache) and on-demand for a * picker-open re-check or an explicit user refresh (`force: true`, * bypasses the TTL cache). Always resolves, falls back to the on-disk * cache, then to the dated-static list, and reports the honest reason * when live discovery fails rather than silently keeping stale data with * no explanation. */ refreshModels(force?: boolean): Promise; } export {}; //# sourceMappingURL=anthropic-vertex.d.ts.map