feat(ai): compat entrypoint, core-only root barrel (phase 5)
The root barrel is now core-only and side-effect free: types, createModels/createProvider, auth substrate, lazyStream/lazyApi, faux, utils. Generated catalogs, api-registry, env-api-keys, images, global stream functions, and per-API lazy wrappers leave the root. New @earendil-works/pi-ai/compat preserves the old surface verbatim as a strict superset of the root: api-dispatch stream/complete with env key injection, the builtin registration side effect (skip-if-present so it cannot clobber earlier overrides), deprecated getModel/getModels/ getProviders aliases of the new getBuiltin* reads in providers/all, lazy api wrappers + setBedrockProviderModule, and image generation. Compat dies with the coding-agent ModelManager migration. Packaging: exports map gains ./compat, ./providers/*, ./api/*; sideEffects array lists only the effectful modules. Old-global imports across agent/coding-agent/examples and pi-ai tests switch to /compat (path-only; compat is a superset). The coding-agent extension loader resolves the pi-ai ROOT specifier to compat, so existing user extensions using the old global API keep working at runtime until compat is removed. vitest configs alias /compat to src; browser smoke imports old globals from /compat.
This commit is contained in:
@@ -1,40 +1,29 @@
|
||||
export type { Static, TSchema } from "typebox";
|
||||
export { Type } from "typebox";
|
||||
|
||||
export * from "./api/anthropic-messages.lazy.ts";
|
||||
// Core only, side-effect free: no generated catalogs, no provider factories,
|
||||
// no api-registry, no OAuth implementations, no compat. Provider factories
|
||||
// live under "@earendil-works/pi-ai/providers/*", API implementations under
|
||||
// "@earendil-works/pi-ai/api/*", the old global API under
|
||||
// "@earendil-works/pi-ai/compat".
|
||||
export type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from "./api/anthropic-messages.ts";
|
||||
export * from "./api/azure-openai-responses.lazy.ts";
|
||||
export type { AzureOpenAIResponsesOptions } from "./api/azure-openai-responses.ts";
|
||||
export * from "./api/bedrock-converse-stream.lazy.ts";
|
||||
export type { BedrockOptions, BedrockThinkingDisplay } from "./api/bedrock-converse-stream.ts";
|
||||
export * from "./api/google-generative-ai.lazy.ts";
|
||||
export type { GoogleOptions } from "./api/google-generative-ai.ts";
|
||||
export type { GoogleThinkingLevel } from "./api/google-shared.ts";
|
||||
export * from "./api/google-vertex.lazy.ts";
|
||||
export type { GoogleVertexOptions } from "./api/google-vertex.ts";
|
||||
export * from "./api/lazy.ts";
|
||||
export * from "./api/mistral-conversations.lazy.ts";
|
||||
export type { MistralOptions } from "./api/mistral-conversations.ts";
|
||||
export * from "./api/openai-codex-responses.lazy.ts";
|
||||
export type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from "./api/openai-codex-responses.ts";
|
||||
export * from "./api/openai-completions.lazy.ts";
|
||||
export type { OpenAICompletionsOptions } from "./api/openai-completions.ts";
|
||||
export * from "./api/openai-responses.lazy.ts";
|
||||
export type { OpenAIResponsesOptions } from "./api/openai-responses.ts";
|
||||
export * from "./api-registry.ts";
|
||||
export * from "./auth/context.ts";
|
||||
export * from "./auth/credential-store.ts";
|
||||
export * from "./auth/helpers.ts";
|
||||
export * from "./auth/types.ts";
|
||||
export * from "./env-api-keys.ts";
|
||||
export * from "./image-models.ts";
|
||||
export * from "./images.ts";
|
||||
export * from "./images-api-registry.ts";
|
||||
export * from "./models.ts";
|
||||
export * from "./providers/faux.ts";
|
||||
export * from "./providers/images/register-builtins.ts";
|
||||
export * from "./session-resources.ts";
|
||||
export * from "./stream.ts";
|
||||
export * from "./types.ts";
|
||||
export * from "./utils/diagnostics.ts";
|
||||
export * from "./utils/event-stream.ts";
|
||||
|
||||
Reference in New Issue
Block a user