@oh-my-pi/pi-ai 12.18.3 → 12.19.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 (39) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.json +2 -2
  3. package/src/auth-storage.ts +1817 -0
  4. package/src/cli.ts +4 -4
  5. package/src/index.ts +3 -0
  6. package/src/model-manager.ts +1 -4
  7. package/src/models.json +346 -4
  8. package/src/provider-models/descriptors.ts +1 -0
  9. package/src/provider-models/openai-compat.ts +13 -37
  10. package/src/providers/amazon-bedrock.ts +5 -24
  11. package/src/providers/anthropic.ts +19 -33
  12. package/src/providers/azure-openai-responses.ts +3 -16
  13. package/src/providers/gitlab-duo.ts +364 -0
  14. package/src/providers/google-vertex.ts +2 -7
  15. package/src/providers/google.ts +2 -7
  16. package/src/providers/kimi.ts +2 -10
  17. package/src/providers/openai-codex/response-handler.ts +2 -6
  18. package/src/providers/openai-codex-responses.ts +4 -24
  19. package/src/providers/openai-completions.ts +2 -7
  20. package/src/providers/openai-responses.ts +3 -30
  21. package/src/providers/synthetic.ts +2 -10
  22. package/src/stream.ts +23 -2
  23. package/src/types.ts +1 -0
  24. package/src/usage/claude.ts +1 -13
  25. package/src/usage/github-copilot.ts +1 -17
  26. package/src/usage/kimi.ts +1 -3
  27. package/src/usage/openai-codex.ts +1 -3
  28. package/src/usage/zai.ts +1 -13
  29. package/src/utils/anthropic-auth.ts +156 -0
  30. package/src/utils/discovery/antigravity.ts +3 -9
  31. package/src/utils/discovery/codex.ts +1 -4
  32. package/src/utils/http-inspector.ts +10 -40
  33. package/src/utils/oauth/gitlab-duo.ts +123 -0
  34. package/src/utils/oauth/index.ts +11 -0
  35. package/src/utils/oauth/pkce.ts +2 -18
  36. package/src/utils/oauth/types.ts +1 -0
  37. package/src/utils/retry.ts +20 -5
  38. package/src/utils.ts +52 -0
  39. package/src/storage.ts +0 -215
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [12.19.0] - 2026-02-22
6
+ ### Added
7
+
8
+ - Added GitLab Duo provider with support for Claude, GPT-5, and other models via GitLab AI Gateway
9
+ - Added OAuth authentication for GitLab Duo with automatic token refresh and direct access caching
10
+ - Added 16 new GitLab Duo models including Claude Opus/Sonnet/Haiku variants and GPT-5 series models
11
+ - Added `isOAuth` option to Anthropic provider to force OAuth bearer auth mode for proxy tokens
12
+ - Added `streamGitLabDuo` function to route requests through GitLab AI Gateway with direct access tokens
13
+ - Added `getGitLabDuoModels` function to retrieve available GitLab Duo model configurations
14
+ - Added `clearGitLabDuoDirectAccessCache` function to manually clear cached direct access tokens
15
+
16
+ ### Changed
17
+
18
+ - Enhanced `getModelMapping()` to support both GitLab Duo alias IDs (e.g., `duo-chat-gpt-5-codex`) and canonical model IDs (e.g., `gpt-5-codex`) for improved model resolution flexibility
19
+ - Migrated `AuthCredentialStore` and `AuthStorage` into `@oh-my-pi/pi-ai` as shared credential primitives for downstream packages
20
+ - Moved Anthropic auth helpers (`findAnthropicAuth`, `isOAuthToken`, `buildAnthropicSearchHeaders`, `buildAnthropicUrl`) into shared AI utilities for reuse across providers
21
+ - Replaced `CliAuthStorage` with `AuthCredentialStore` for improved credential management with multiple credentials per provider
22
+ - Updated models.json pricing for Claude 3.5 Sonnet (input: 0.23→0.45, output: 3→2.2, added cache read: 0.225) and Claude 3 Opus (input: 0.3→0.95)
23
+ - Moved `mapAnthropicToolChoice` function from gitlab-duo provider to stream module for broader reusability
24
+ - Enhanced HTTP status code extraction to handle string-formatted status codes in error objects
25
+
26
+ ### Removed
27
+
28
+ - Removed `CliAuthStorage` class in favor of new `AuthCredentialStore` with enhanced functionality
29
+
5
30
  ## [12.17.2] - 2026-02-21
6
31
  ### Added
7
32
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-ai",
4
- "version": "12.18.3",
4
+ "version": "12.19.0",
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 Bölük",
@@ -44,7 +44,7 @@
44
44
  "@connectrpc/connect-node": "^2.1.1",
45
45
  "@google/genai": "^1.41.0",
46
46
  "@mistralai/mistralai": "^1.14.0",
47
- "@oh-my-pi/pi-utils": "12.18.3",
47
+ "@oh-my-pi/pi-utils": "12.19.0",
48
48
  "@sinclair/typebox": "^0.34.48",
49
49
  "@smithy/node-http-handler": "^4.4.10",
50
50
  "ajv": "^8.18.0",