@aria-framework/ai 0.20.0 → 0.21.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/usageStore.js +4 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aria-framework/ai",
3
3
  "description": "Aria App Framework — AI module. A dependency-injected model seam (createAiClient) over several providers (LM Studio / OpenAI-compatible / Anthropic), with a fact-preservation guard, generic Polish and Generate writing engines, and a browser polish widget. Prompts and config stay in the consuming app.",
4
- "version": "0.20.0",
4
+ "version": "0.21.0",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
7
7
  "publishConfig": {
package/usageStore.js CHANGED
@@ -114,7 +114,10 @@ function createUsageStore(opts = {}) {
114
114
 
115
115
  const placeholders = cols.map(() => '?').join(', ');
116
116
  const r = await driver.run(
117
- `INSERT INTO ${table} (${cols.join(', ')}) VALUES (${placeholders})`, values);
117
+ // RETURNING, because the id is read back. Empty on SQLite, ` RETURNING "id"` on Postgres —
118
+ // and without it lastId is undefined there, so every caller gets { id: undefined }.
119
+ `INSERT INTO ${table} (${cols.join(', ')}) VALUES (${placeholders})${driver.dialect.returning('id')}`,
120
+ values);
118
121
  return { id: r.lastId };
119
122
  },
120
123