fix(ai): remove legacy raw API subpaths
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
- The root entrypoint (`@earendil-works/pi-ai`) is now core-only and side-effect free. The old global API moved to the temporary `@earendil-works/pi-ai/compat` entrypoint, a strict superset of the root: switching a file's import path is the only migration step. Moved symbols include `stream`/`complete`/`streamSimple`/`completeSimple`, `getModel`/`getModels`/`getProviders` (now deprecated aliases of `getBuiltinModel`/`getBuiltinModels`/`getBuiltinProviders` from `@earendil-works/pi-ai/providers/all`), `registerApiProvider`/`unregisterApiProviders`/`resetApiProviders`/`getApiProvider`, `getEnvApiKey`/`findEnvKeys`, `setBedrockProviderModule`, the per-API lazy stream wrappers (`anthropicMessagesApi`, ...), and the image-generation API.
|
||||
- Renamed the `Provider` type to `ProviderId`. `Provider` now names the runtime provider interface (id, name, auth, model listing, stream behavior).
|
||||
- API implementation modules moved from `src/providers/` to `@earendil-works/pi-ai/api/*`, renamed by API id (`anthropic` -> `api/anthropic-messages`, `google` -> `api/google-generative-ai`, `mistral` -> `api/mistral-conversations`, `amazon-bedrock` -> `api/bedrock-converse-stream`), each exporting exactly `stream` and `streamSimple`. The old per-impl export names (`streamAnthropic`, `streamSimpleAnthropic`, ...) are gone; the legacy package subpaths (`./anthropic`, `./google`, ...) keep working and point at the new modules.
|
||||
- API implementation modules moved from `src/providers/` to `@earendil-works/pi-ai/api/*`, renamed by API id (`anthropic` -> `api/anthropic-messages`, `google` -> `api/google-generative-ai`, `mistral` -> `api/mistral-conversations`, `amazon-bedrock` -> `api/bedrock-converse-stream`), each exporting exactly `stream` and `streamSimple`. The old per-impl export names (`streamAnthropic`, `streamSimpleAnthropic`, ...) and legacy raw API subpaths (`./anthropic`, `./google`, `./openai-completions`, ...) are gone; import raw API implementations through `@earendil-works/pi-ai/api/*`.
|
||||
|
||||
Migration guide:
|
||||
|
||||
|
||||
@@ -27,38 +27,6 @@
|
||||
"types": "./dist/api/*.d.ts",
|
||||
"import": "./dist/api/*.js"
|
||||
},
|
||||
"./anthropic": {
|
||||
"types": "./dist/api/anthropic-messages.d.ts",
|
||||
"import": "./dist/api/anthropic-messages.js"
|
||||
},
|
||||
"./azure-openai-responses": {
|
||||
"types": "./dist/api/azure-openai-responses.d.ts",
|
||||
"import": "./dist/api/azure-openai-responses.js"
|
||||
},
|
||||
"./google": {
|
||||
"types": "./dist/api/google-generative-ai.d.ts",
|
||||
"import": "./dist/api/google-generative-ai.js"
|
||||
},
|
||||
"./google-vertex": {
|
||||
"types": "./dist/api/google-vertex.d.ts",
|
||||
"import": "./dist/api/google-vertex.js"
|
||||
},
|
||||
"./mistral": {
|
||||
"types": "./dist/api/mistral-conversations.d.ts",
|
||||
"import": "./dist/api/mistral-conversations.js"
|
||||
},
|
||||
"./openai-codex-responses": {
|
||||
"types": "./dist/api/openai-codex-responses.d.ts",
|
||||
"import": "./dist/api/openai-codex-responses.js"
|
||||
},
|
||||
"./openai-completions": {
|
||||
"types": "./dist/api/openai-completions.d.ts",
|
||||
"import": "./dist/api/openai-completions.js"
|
||||
},
|
||||
"./openai-responses": {
|
||||
"types": "./dist/api/openai-responses.d.ts",
|
||||
"import": "./dist/api/openai-responses.js"
|
||||
},
|
||||
"./oauth": {
|
||||
"types": "./dist/oauth.d.ts",
|
||||
"import": "./dist/oauth.js"
|
||||
|
||||
Reference in New Issue
Block a user