@x12i/ai-gateway 10.2.2 → 10.3.0

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/README.md CHANGED
@@ -13,7 +13,7 @@ Unified gateway for LLM provider routing, structured logging, optional Activix a
13
13
  | **Activix** | Optional Mongo-backed activity rows; billing written from gateway-computed slice on **`completeRecord`** (`outer.cost` + root fields). No Activix **`autoCost`** re-pricing. |
14
14
  | **Trace mode** | `diagnostics.mode === 'trace'` adds `metadata.attempts[]`, `metadata.usage`, and per-attempt **`costUsd`** / **`costStatus`**. |
15
15
 
16
- Pinned dependency versions are in `package.json` (currently **Activix ^8.6**, **ai-tools ^3.1**, **ai-profiles ^3.2**, **ai-providers-router ^4.9**).
16
+ Pinned dependency versions are in `package.json` (currently **Activix ^9.0**, **ai-tools ^3.3**, **ai-profiles ^3.4**, **ai-providers-router ^4.9**).
17
17
 
18
18
  ---
19
19
 
@@ -262,9 +262,9 @@ Gateway billing helpers (exported for tests/integrators): `resolveCostCompletion
262
262
 
263
263
  ---
264
264
 
265
- ## Activity tracking (@x12i/activix 8.6)
265
+ ## Activity tracking (@x12i/activix 9.0)
266
266
 
267
- When tracking is enabled and no custom tracker is supplied, the gateway constructs Activix with fixed collection names (see `src/config/activity-tracking-config.ts`):
267
+ When tracking is enabled and no custom tracker is supplied, the gateway constructs Activix with fixed collection names (see `src/config/activity-tracking-config.ts`). **`storageMode` is omitted** — Activix 9 infers **`database`** when `MONGO_URI` (or env URI) is set and **`local`** playground when it is not. Configured Mongo that is unreachable causes **`init()` to fail** (no silent playground fallback); the gateway logs a warning and disables persistence for that process.
268
268
 
269
269
  | Collection | Typical use |
270
270
  |------------|-------------|
@@ -281,9 +281,9 @@ When tracking is enabled and no custom tracker is supplied, the gateway construc
281
281
  - `outer.cost`: Activix cost shape (`usd`, `tokens`, `provider`, `model`, `details`)
282
282
  - `response.metadata`: same billing slice as returned to callers
283
283
 
284
- Activix **8.6** runs **`materializeRecordRoutingAndBilling`** on persist (root **`config`** mirror from routing metadata). Gateway resolves billing **before** `completeRecord` and sets **`outer.cost`** from that slice.
284
+ Activix runs **`materializeRecordRoutingAndBilling`** on persist (root **`config`** mirror from routing metadata). Gateway resolves billing **before** `completeRecord` and sets **`outer.cost`** from that slice.
285
285
 
286
- **`autoCost`:** Activix 8.6 default is **`false`**. The gateway keeps **`autoCost: false`** on the default activity manager so billing is not recomputed via ai-tools at persist time (no second pricing path). Custom **`activityTracker`** instances may opt in to Activix **`autoCost`** (uses **@x12i/ai-tools** v3 **`calculateFromRecord`** when enabled).
286
+ **`autoCost`:** Activix default is **`false`**. The gateway keeps **`autoCost: false`** on the default activity manager so billing is not recomputed via ai-tools at persist time (no second pricing path). Custom **`activityTracker`** instances may opt in to Activix **`autoCost`** (uses **@x12i/ai-tools** v3 **`calculateFromRecord`** when enabled). For dev hosts that need probe-then-fallback when Mongo is down, pass a custom **`activityTracker`** with **`storageMode: 'automatic'`**.
287
287
 
288
288
  Mongo env: `MONGO_URI` + `MONGO_LOGS_DB` or `MONGO_DB`.
289
289
 
@@ -331,7 +331,6 @@ export class ActivityManager {
331
331
  timeout: 'timeout'
332
332
  };
333
333
  const activixOptions = {
334
- storageMode: 'automatic',
335
334
  collections: [
336
335
  {
337
336
  name: collectionName,
@@ -331,7 +331,6 @@ export class ActivityManager {
331
331
  timeout: 'timeout'
332
332
  };
333
333
  const activixOptions = {
334
- storageMode: 'automatic',
335
334
  collections: [
336
335
  {
337
336
  name: collectionName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x12i/ai-gateway",
3
- "version": "10.2.2",
3
+ "version": "10.3.0",
4
4
  "description": "AI Gateway - Unified interface for LLM provider routing and management",
5
5
  "type": "module",
6
6
  "exports": {
@@ -41,7 +41,7 @@
41
41
  "author": "x12i",
42
42
  "license": "mit",
43
43
  "dependencies": {
44
- "@x12i/activix": "^8.6.2",
44
+ "@x12i/activix": "^9.0.0",
45
45
  "@x12i/ai-profiles": "^3.4.0",
46
46
  "@x12i/ai-providers-router": "^4.9.2",
47
47
  "@x12i/ai-tools": "^3.3.3",