@absolutejs/ai 0.2.0 → 0.2.2

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 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.2.2 — 2026-09-20
10
+
11
+ ### Added
12
+
13
+ - **Add browser-safe typed model capability metadata with verified provider sources, separate input and output modalities, context windows, and capability descriptions** (`ModelModality`, `ModelFeature`, `ModelMetadata`, `ModelCapability`, `MODEL_CAPABILITY_DESCRIPTIONS`, `MODEL_METADATA`, `modelCapabilities`, `getModelMetadata`)
14
+
15
+ ## 0.2.1 — 2026-09-16
16
+
17
+ ### Fixed
18
+
19
+ - **Preserve provider output reservations and context-error recognition when routing models** (`createAIProviderRouter`)
20
+
9
21
  ## 0.2.0 — 2026-09-16
10
22
 
11
23
  ### Added
package/README.md CHANGED
@@ -514,3 +514,17 @@ const provider = createAIProviderRouter({
514
514
  `streamAIWithTools` includes each completed turn's provider response `metadata`
515
515
  on its `turn` event. Price that turn using the returned `serviceTier`, when
516
516
  available, rather than assuming that the requested processing tier was served.
517
+
518
+ ## Model capability metadata
519
+
520
+ `@absolutejs/ai/models` is a browser-safe, dependency-free catalog.
521
+ Use `getModelMetadata(provider, id)` and `modelCapabilities(metadata)` to build
522
+ model selectors. Metadata separates input modalities, output modalities, and
523
+ provider features, with source URLs and a review date. Unknown IDs return
524
+ `undefined`; absence of a badge is not evidence of unsupported functionality.
525
+
526
+ These are provider capabilities, not application enablement or account entitlement.
527
+ Consumers must separately explain whether attachments, hosted search, structured
528
+ output, and media generation are enabled in their UI and endpoint. Context windows
529
+ are documented provider limits, not a substitute for runtime token budgeting.
530
+ Regional features are omitted when they are not consistently supported.
package/changelog.json CHANGED
@@ -2,6 +2,39 @@
2
2
  "contract": 1,
3
3
  "name": "@absolutejs/ai",
4
4
  "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "kind": "added",
9
+ "summary": "Add browser-safe typed model capability metadata with verified provider sources, separate input and output modalities, context windows, and capability descriptions",
10
+ "symbols": [
11
+ "ModelModality",
12
+ "ModelFeature",
13
+ "ModelMetadata",
14
+ "ModelCapability",
15
+ "MODEL_CAPABILITY_DESCRIPTIONS",
16
+ "MODEL_METADATA",
17
+ "modelCapabilities",
18
+ "getModelMetadata"
19
+ ]
20
+ }
21
+ ],
22
+ "date": "2026-09-20",
23
+ "version": "0.2.2"
24
+ },
25
+ {
26
+ "changes": [
27
+ {
28
+ "kind": "fixed",
29
+ "summary": "Preserve provider output reservations and context-error recognition when routing models",
30
+ "symbols": [
31
+ "createAIProviderRouter"
32
+ ]
33
+ }
34
+ ],
35
+ "date": "2026-09-16",
36
+ "version": "0.2.1"
37
+ },
5
38
  {
6
39
  "changes": [
7
40
  {
package/dist/ai/index.js CHANGED
@@ -8631,6 +8631,8 @@ var createAIProviderRouter = (routes) => {
8631
8631
  };
8632
8632
  return {
8633
8633
  inputCapacity: {
8634
+ outputTokens: (params) => capacity(params).outputTokens?.(params),
8635
+ isContextError: (error) => [...new Set(providers.values())].some((provider) => provider.inputCapacity?.isContextError?.(error) === true),
8634
8636
  getLimits: async (params) => capacity(params).getLimits(params),
8635
8637
  countTokens: async (params) => capacity(params).countTokens(params)
8636
8638
  },
@@ -8747,5 +8749,5 @@ export {
8747
8749
  xai
8748
8750
  };
8749
8751
 
8750
- //# debugId=0CA4631EC8525EB564756E2164756E21
8752
+ //# debugId=165C398044F23C2764756E2164756E21
8751
8753
  //# sourceMappingURL=index.js.map