@oh-my-pi/pi-ai 13.19.0 → 14.0.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
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [14.0.0] - 2026-04-08
6
+ ### Breaking Changes
7
+
8
+ - Removed `coerceNullStrings` function and its automatic null-string coercion behavior from JSON parsing
9
+
10
+ ### Added
11
+
12
+ - Added support for OpenRouter provider with strict mode detection
13
+ - Added automatic cleaning of literal escape sequences (`\n`, `\t`, `\r`) in JSON parsing to handle LLM encoding confusion
14
+ - Added support for healing JSON with trailing junk after balanced containers (e.g., `]\n</invoke>`)
15
+ - Added `CODEX_STARTUP_EVENT_CHANNEL` constant and `CodexStartupEvent` type for monitoring Codex provider initialization status
16
+ - Added automatic healing of malformed JSON with single-character bracket errors at the end of strings, improving LLM tool argument parsing robustness
17
+
5
18
  ## [13.19.0] - 2026-04-05
6
19
 
7
20
  ### Fixed
@@ -1975,4 +1988,4 @@ _Dedicated to Peter's shoulder ([@steipete](https://twitter.com/steipete))_
1975
1988
 
1976
1989
  ## [0.9.4] - 2025-11-26
1977
1990
 
1978
- Initial release with multi-provider LLM support.
1991
+ Initial release with multi-provider LLM support.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-ai",
4
- "version": "13.19.0",
4
+ "version": "14.0.2",
5
5
  "description": "Unified LLM API with automatic model discovery and provider configuration",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -32,16 +32,20 @@
32
32
  "pi-ai": "./src/cli.ts"
33
33
  },
34
34
  "scripts": {
35
- "check": "tsgo -p tsconfig.json",
36
- "generate-models": "bun scripts/generate-models.ts",
37
- "test": "bun test"
35
+ "check": "biome check . && bun run check:types",
36
+ "check:types": "tsgo -p tsconfig.json --noEmit",
37
+ "lint": "biome lint .",
38
+ "test": "bun test",
39
+ "fix": "biome check --write --unsafe .",
40
+ "fmt": "biome format --write .",
41
+ "generate-models": "bun scripts/generate-models.ts"
38
42
  },
39
43
  "dependencies": {
40
44
  "@anthropic-ai/sdk": "^0.78",
41
45
  "@aws-sdk/client-bedrock-runtime": "^3",
42
46
  "@bufbuild/protobuf": "^2.11",
43
47
  "@google/genai": "^1.43",
44
- "@oh-my-pi/pi-utils": "13.19.0",
48
+ "@oh-my-pi/pi-utils": "14.0.2",
45
49
  "@sinclair/typebox": "^0.34",
46
50
  "@smithy/node-http-handler": "^4.4",
47
51
  "ajv": "^8.18",
@@ -125,6 +129,7 @@
125
129
  "./utils/schema/*": {
126
130
  "types": "./src/utils/schema/*.ts",
127
131
  "import": "./src/utils/schema/*.ts"
128
- }
132
+ },
133
+ "./*.js": "./src/*.ts"
129
134
  }
130
135
  }
@@ -2205,7 +2205,7 @@ export class AuthCredentialStore {
2205
2205
  }
2206
2206
 
2207
2207
  #initializeSchema(): void {
2208
- this.#db.exec(`
2208
+ this.#db.run(`
2209
2209
  PRAGMA journal_mode=WAL;
2210
2210
  PRAGMA synchronous=NORMAL;
2211
2211
  PRAGMA busy_timeout=5000;
@@ -2276,7 +2276,7 @@ export class AuthCredentialStore {
2276
2276
  }
2277
2277
 
2278
2278
  #createAuthCredentialsTable(): void {
2279
- this.#db.exec(`
2279
+ this.#db.run(`
2280
2280
  CREATE TABLE IF NOT EXISTS auth_credentials (
2281
2281
  id INTEGER PRIMARY KEY AUTOINCREMENT,
2282
2282
  provider TEXT NOT NULL,
@@ -2292,7 +2292,7 @@ export class AuthCredentialStore {
2292
2292
  }
2293
2293
 
2294
2294
  #createAuthCredentialIndexes(): void {
2295
- this.#db.exec(`
2295
+ this.#db.run(`
2296
2296
  CREATE INDEX IF NOT EXISTS idx_auth_provider ON auth_credentials(provider);
2297
2297
  CREATE INDEX IF NOT EXISTS idx_auth_provider_identity ON auth_credentials(provider, identity_key) WHERE identity_key IS NOT NULL;
2298
2298
  `);
@@ -2315,8 +2315,8 @@ export class AuthCredentialStore {
2315
2315
  const v0Cols = this.#db.prepare("PRAGMA table_info(auth_credentials)").all() as Array<{ name?: string }>;
2316
2316
  const hasDisabled = v0Cols.some(col => col.name === "disabled");
2317
2317
 
2318
- this.#db.exec("ALTER TABLE auth_credentials RENAME TO auth_credentials_v0");
2319
- this.#db.exec(`
2318
+ this.#db.run("ALTER TABLE auth_credentials RENAME TO auth_credentials_v0");
2319
+ this.#db.run(`
2320
2320
  CREATE TABLE auth_credentials (
2321
2321
  id INTEGER PRIMARY KEY AUTOINCREMENT,
2322
2322
  provider TEXT NOT NULL,
@@ -2327,7 +2327,7 @@ export class AuthCredentialStore {
2327
2327
  updated_at INTEGER NOT NULL DEFAULT (${SQLITE_NOW_EPOCH})
2328
2328
  );
2329
2329
  `);
2330
- this.#db.exec(`
2330
+ this.#db.run(`
2331
2331
  INSERT INTO auth_credentials (id, provider, credential_type, data, disabled_cause, created_at, updated_at)
2332
2332
  SELECT
2333
2333
  id,
@@ -2339,16 +2339,16 @@ export class AuthCredentialStore {
2339
2339
  updated_at
2340
2340
  FROM auth_credentials_v0
2341
2341
  `);
2342
- this.#db.exec("DROP TABLE auth_credentials_v0");
2342
+ this.#db.run("DROP TABLE auth_credentials_v0");
2343
2343
  });
2344
2344
  migrate();
2345
2345
  }
2346
2346
 
2347
2347
  #migrateAuthSchemaV1OrV2ToV3(): void {
2348
2348
  const migrate = this.#db.transaction(() => {
2349
- this.#db.exec("ALTER TABLE auth_credentials RENAME TO auth_credentials_legacy");
2349
+ this.#db.run("ALTER TABLE auth_credentials RENAME TO auth_credentials_legacy");
2350
2350
  this.#createAuthCredentialsTable();
2351
- this.#db.exec(`
2351
+ this.#db.run(`
2352
2352
  INSERT INTO auth_credentials (id, provider, credential_type, data, disabled_cause, identity_key, created_at, updated_at)
2353
2353
  SELECT
2354
2354
  id,
@@ -2361,16 +2361,16 @@ export class AuthCredentialStore {
2361
2361
  updated_at
2362
2362
  FROM auth_credentials_legacy
2363
2363
  `);
2364
- this.#db.exec("DROP TABLE auth_credentials_legacy");
2364
+ this.#db.run("DROP TABLE auth_credentials_legacy");
2365
2365
  });
2366
2366
  migrate();
2367
2367
  }
2368
2368
 
2369
2369
  #migrateAuthSchemaV3ToV4(): void {
2370
2370
  const migrate = this.#db.transaction(() => {
2371
- this.#db.exec("ALTER TABLE auth_credentials RENAME TO auth_credentials_v3");
2371
+ this.#db.run("ALTER TABLE auth_credentials RENAME TO auth_credentials_v3");
2372
2372
  this.#createAuthCredentialsTable();
2373
- this.#db.exec(`
2373
+ this.#db.run(`
2374
2374
  INSERT INTO auth_credentials (id, provider, credential_type, data, disabled_cause, identity_key, created_at, updated_at)
2375
2375
  SELECT
2376
2376
  id,
@@ -2383,7 +2383,7 @@ export class AuthCredentialStore {
2383
2383
  updated_at
2384
2384
  FROM auth_credentials_v3
2385
2385
  `);
2386
- this.#db.exec("DROP TABLE auth_credentials_v3");
2386
+ this.#db.run("DROP TABLE auth_credentials_v3");
2387
2387
  });
2388
2388
  migrate();
2389
2389
  }