@absolutejs/ai 0.6.4 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +18 -0
- package/changelog.json +37 -0
- package/dist/ai/index.js +359 -188
- package/dist/ai/index.js.map +17 -16
- package/dist/ai/providers/anthropic.js +147 -104
- package/dist/ai/providers/anthropic.js.map +8 -8
- package/dist/ai/providers/gemini.js +146 -103
- package/dist/ai/providers/gemini.js.map +7 -7
- package/dist/ai/providers/ollama.js +61 -20
- package/dist/ai/providers/ollama.js.map +5 -5
- package/dist/ai/providers/openai.js +245 -151
- package/dist/ai/providers/openai.js.map +11 -10
- package/dist/ai/providers/openaiCompatible.js +245 -151
- package/dist/ai/providers/openaiCompatible.js.map +11 -10
- package/dist/ai/providers/openaiResponses.js +243 -149
- package/dist/ai/providers/openaiResponses.js.map +10 -9
- package/dist/ai/providers/openrouter.js +246 -152
- package/dist/ai/providers/openrouter.js.map +12 -11
- package/dist/src/ai/contextPolicy.d.ts +2 -0
- package/dist/src/ai/errors/providerError.d.ts +2 -0
- package/dist/src/ai/index.d.ts +3 -0
- package/dist/src/ai/inputCapacity.d.ts +4 -2
- package/dist/src/ai/prepareTextInput.d.ts +2 -0
- package/dist/src/ai/providerFallback.d.ts +27 -8
- package/dist/src/ai/providers/openaiSchema.d.ts +4 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ This file is generated by `absolute-changelog` from the entries in
|
|
|
6
6
|
`changelog/`. Edit an entry, not this file — and add new ones under
|
|
7
7
|
`changelog/unreleased/`.
|
|
8
8
|
|
|
9
|
+
## 0.6.6 — 2026-10-22
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **Recover approved providers in either direction across preparation and streaming; preserve checkpoints, normalize finite-key OpenAI schemas, and clear cancelled billing probes** (`AIInputError`, `PrepareAITextInputOptions`, `AIContextPolicy`, `streamWithProviderFallback`)
|
|
14
|
+
|
|
15
|
+
## 0.6.5 — 2026-10-22
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Preserve Sync 3 peer compatibility alongside provider recovery**
|
|
20
|
+
|
|
9
21
|
## 0.6.4 — 2026-10-22
|
|
10
22
|
|
|
11
23
|
### Added
|
|
@@ -16,6 +28,13 @@ This file is generated by `absolute-changelog` from the entries in
|
|
|
16
28
|
|
|
17
29
|
- **Expose provider billing rejection and credential-scoped suppression** (`ProviderError`, `ProviderErrorInit`)
|
|
18
30
|
|
|
31
|
+
## 0.6.3 — 2026-10-22
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- **Accepts @absolutejs/sync 3**
|
|
36
|
+
The `@absolutejs/sync` peer range stopped below 3, so an app on sync 3 (built against Elysia 2.0.0-rc.0) installed a second copy for ai. sync 3.0.0 changed no API, so the range now runs from 2.14.0 below 4.
|
|
37
|
+
|
|
19
38
|
## 0.6.2 — 2026-10-22
|
|
20
39
|
|
|
21
40
|
### Added
|
package/README.md
CHANGED
|
@@ -593,3 +593,21 @@ polls or subscribes to actual progress, and binds actions to authenticated route
|
|
|
593
593
|
|
|
594
594
|
|
|
595
595
|
`streamWithProviderFallback` accepts approved model IDs, an individually metered `stream(model)` callback, and an optional `onFallback` hook. It never restarts after a chunk or caller cancellation. `ProviderError.billingUnavailable` identifies provider billing failures; `notSent` identifies requests blocked locally. Billing suppression is scoped to the configured provider instance, with a five-minute probe interval.
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
### Recovery across approved providers
|
|
599
|
+
|
|
600
|
+
Set `contextPolicy.providerFallback` on generation helpers and
|
|
601
|
+
`providerFallback` on `prepareAITextInput` / `prepareAITextInputStep` to cover
|
|
602
|
+
both token-capacity checks and generation. `models` accepts an array or a
|
|
603
|
+
function of the current model; the requested model runs first. Use a provider
|
|
604
|
+
router containing every approved model. Each alternate validates its own input
|
|
605
|
+
capacity. Optional `onFallback({ from, to, error })` reports the switch.
|
|
606
|
+
|
|
607
|
+
Recovery stops after any output chunk, including tool/usage chunks, and never
|
|
608
|
+
replays cancellation or accounting/application errors. Completed document
|
|
609
|
+
sections retain validated checkpoints across provider switches. Finite-key
|
|
610
|
+
OpenAI record schemas are translated to optional named properties without
|
|
611
|
+
removing value constraints. `isProviderError` works across package entrypoints;
|
|
612
|
+
`isPermanentAIProviderFailure` classifies terminal provider/preflight failures
|
|
613
|
+
for job runners. Callers own retry budgets, funding, and model approval.
|
package/changelog.json
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
"contract": 1,
|
|
3
3
|
"name": "@absolutejs/ai",
|
|
4
4
|
"releases": [
|
|
5
|
+
{
|
|
6
|
+
"changes": [
|
|
7
|
+
{
|
|
8
|
+
"kind": "changed",
|
|
9
|
+
"summary": "Recover approved providers in either direction across preparation and streaming; preserve checkpoints, normalize finite-key OpenAI schemas, and clear cancelled billing probes",
|
|
10
|
+
"symbols": [
|
|
11
|
+
"AIInputError",
|
|
12
|
+
"PrepareAITextInputOptions",
|
|
13
|
+
"AIContextPolicy",
|
|
14
|
+
"streamWithProviderFallback"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"date": "2026-10-22",
|
|
19
|
+
"version": "0.6.6"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"changes": [
|
|
23
|
+
{
|
|
24
|
+
"kind": "changed",
|
|
25
|
+
"summary": "Preserve Sync 3 peer compatibility alongside provider recovery"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"date": "2026-10-22",
|
|
29
|
+
"version": "0.6.5"
|
|
30
|
+
},
|
|
5
31
|
{
|
|
6
32
|
"changes": [
|
|
7
33
|
{
|
|
@@ -23,6 +49,17 @@
|
|
|
23
49
|
"date": "2026-10-22",
|
|
24
50
|
"version": "0.6.4"
|
|
25
51
|
},
|
|
52
|
+
{
|
|
53
|
+
"changes": [
|
|
54
|
+
{
|
|
55
|
+
"detail": "The `@absolutejs/sync` peer range stopped below 3, so an app on sync 3 (built against Elysia 2.0.0-rc.0) installed a second copy for ai. sync 3.0.0 changed no API, so the range now runs from 2.14.0 below 4.",
|
|
56
|
+
"kind": "changed",
|
|
57
|
+
"summary": "Accepts @absolutejs/sync 3"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"date": "2026-10-22",
|
|
61
|
+
"version": "0.6.3"
|
|
62
|
+
},
|
|
26
63
|
{
|
|
27
64
|
"changes": [
|
|
28
65
|
{
|