@oh-my-pi/pi-ai 15.2.4 → 15.3.1
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 +7 -0
- package/dist/types/provider-models/openai-compat.d.ts +1 -1
- package/dist/types/utils/oauth/deepseek.d.ts +10 -0
- package/dist/types/utils/oauth/types.d.ts +1 -1
- package/dist/types/utils/oauth/xiaomi.d.ts +2 -2
- package/package.json +2 -2
- package/src/auth-storage.ts +6 -0
- package/src/cli.ts +1 -0
- package/src/models.json +18091 -769
- package/src/provider-models/openai-compat.ts +35 -18
- package/src/providers/openai-completions.ts +2 -2
- package/src/providers/openai-responses.ts +15 -3
- package/src/utils/oauth/deepseek.ts +53 -0
- package/src/utils/oauth/index.ts +5 -0
- package/src/utils/oauth/types.ts +1 -0
- package/src/utils/oauth/xiaomi.ts +75 -41
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [15.3.0] - 2026-05-25
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added DeepSeek to the built-in API-key login provider catalog so `omp login deepseek` stores a reusable `DEEPSEEK_API_KEY` credential for the bundled DeepSeek models.
|
|
10
|
+
|
|
5
11
|
## [15.2.4] - 2026-05-22
|
|
6
12
|
|
|
7
13
|
### Fixed
|
|
@@ -68,6 +74,7 @@
|
|
|
68
74
|
|
|
69
75
|
### Fixed
|
|
70
76
|
|
|
77
|
+
- Fixed OpenCode-Go and OpenCode-Zen chat-completions replay to omit stored reasoning fields on Kimi assistant tool-call messages, avoiding provider 400s for rejected `messages[].reasoning` payloads. ([#1157](https://github.com/can1357/oh-my-pi/issues/1157))
|
|
71
78
|
- Fixed OpenAI Responses and Codex tool schema normalization to emit `properties: {}` for no-argument object schemas without rewriting literal payloads. ([#1147](https://github.com/can1357/oh-my-pi/issues/1147))
|
|
72
79
|
- Fixed Anthropic 400 (`unexpected tool_use_id found in tool_result blocks ... Each tool_result block must have a corresponding tool_use block in the previous message`) when handoff/compaction folds an assistant `tool_use` into the handoff summary string but leaves the matching user-side `tool_result` message in the history. `transformMessages` now indexes every `tool_use` id surviving the first pass and drops orphan `tool_result` messages whose originator was compacted away, preserving the text payload as a user-level `<stale-tool-result>` note so the model still sees what the tool returned. The note is emitted with `role: "user"` rather than `role: "developer"` so providers that elevate developer-role messages (Ollama: `developer` → `system`; OpenAI chat-completions reasoning models: `developer` → `developer`) cannot lift stale tool output to an instruction-priority tier above the surrounding user/developer messages.
|
|
73
80
|
- Fixed streaming authentication retry to trigger when a provider emits a 401 `error` event after a `start` event but before any replay-unsafe content is emitted
|
|
@@ -165,7 +165,7 @@ export interface XiaomiModelManagerConfig {
|
|
|
165
165
|
apiKey?: string;
|
|
166
166
|
baseUrl?: string;
|
|
167
167
|
}
|
|
168
|
-
export declare function xiaomiModelManagerOptions(config?: XiaomiModelManagerConfig): ModelManagerOptions<"
|
|
168
|
+
export declare function xiaomiModelManagerOptions(config?: XiaomiModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
169
169
|
export interface LiteLLMModelManagerConfig {
|
|
170
170
|
apiKey?: string;
|
|
171
171
|
baseUrl?: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OAuthController } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Normalize a pasted DeepSeek API key.
|
|
4
|
+
*
|
|
5
|
+
* Users frequently copy keys out of `curl` snippets that include the
|
|
6
|
+
* `Authorization: Bearer …` prefix. Strip it so validation does not fail
|
|
7
|
+
* with a confusing 401, and reject obviously empty input early.
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeDeepSeekApiKey(raw: string): string;
|
|
10
|
+
export declare const loginDeepSeek: (options: OAuthController) => Promise<string>;
|
|
@@ -7,7 +7,7 @@ export type OAuthCredentials = {
|
|
|
7
7
|
email?: string;
|
|
8
8
|
accountId?: string;
|
|
9
9
|
};
|
|
10
|
-
export type OAuthProvider = "alibaba-coding-plan" | "anthropic" | "cerebras" | "cloudflare-ai-gateway" | "cursor" | "fireworks" | "firepass" | "github-copilot" | "google-gemini-cli" | "google-antigravity" | "gitlab-duo" | "huggingface" | "kimi-code" | "kilo" | "kagi" | "litellm" | "lm-studio" | "minimax-code" | "minimax-code-cn" | "moonshot" | "nvidia" | "nanogpt" | "ollama" | "ollama-cloud" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "synthetic" | "tavily" | "together" | "venice" | "vercel-ai-gateway" | "vllm" | "xiaomi" | "zenmux" | "zai";
|
|
10
|
+
export type OAuthProvider = "alibaba-coding-plan" | "anthropic" | "cerebras" | "cloudflare-ai-gateway" | "cursor" | "deepseek" | "fireworks" | "firepass" | "github-copilot" | "google-gemini-cli" | "google-antigravity" | "gitlab-duo" | "huggingface" | "kimi-code" | "kilo" | "kagi" | "litellm" | "lm-studio" | "minimax-code" | "minimax-code-cn" | "moonshot" | "nvidia" | "nanogpt" | "ollama" | "ollama-cloud" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "synthetic" | "tavily" | "together" | "venice" | "vercel-ai-gateway" | "vllm" | "xiaomi" | "zenmux" | "zai";
|
|
11
11
|
export type OAuthProviderId = OAuthProvider | (string & {});
|
|
12
12
|
export type OAuthPrompt = {
|
|
13
13
|
message: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Xiaomi MiMo login flow.
|
|
3
3
|
*
|
|
4
|
-
* Xiaomi MiMo provides
|
|
5
|
-
* https://api.xiaomimimo.com/
|
|
4
|
+
* Xiaomi MiMo provides OpenAI-compatible models via
|
|
5
|
+
* https://api.xiaomimimo.com/v1.
|
|
6
6
|
*
|
|
7
7
|
* This is not OAuth - it's a simple API key flow:
|
|
8
8
|
* 1. Open browser to Xiaomi MiMo API key console
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-ai",
|
|
4
|
-
"version": "15.
|
|
4
|
+
"version": "15.3.1",
|
|
5
5
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@anthropic-ai/sdk": "^0.94.0",
|
|
45
45
|
"@bufbuild/protobuf": "^2.12.0",
|
|
46
|
-
"@oh-my-pi/pi-utils": "15.
|
|
46
|
+
"@oh-my-pi/pi-utils": "15.3.1",
|
|
47
47
|
"openai": "^6.36.0",
|
|
48
48
|
"partial-json": "^0.1.7",
|
|
49
49
|
"zod": "4.4.3"
|
package/src/auth-storage.ts
CHANGED
|
@@ -29,6 +29,7 @@ import { kimiUsageProvider } from "./usage/kimi";
|
|
|
29
29
|
import { codexRankingStrategy, openaiCodexUsageProvider } from "./usage/openai-codex";
|
|
30
30
|
import { zaiUsageProvider } from "./usage/zai";
|
|
31
31
|
import { getOAuthApiKey, getOAuthProvider, refreshOAuthToken } from "./utils/oauth";
|
|
32
|
+
import { loginDeepSeek } from "./utils/oauth/deepseek";
|
|
32
33
|
import { loginOpenAICodexDevice } from "./utils/oauth/openai-codex";
|
|
33
34
|
import type { OAuthController, OAuthCredentials, OAuthProvider, OAuthProviderId } from "./utils/oauth/types";
|
|
34
35
|
|
|
@@ -1378,6 +1379,11 @@ export class AuthStorage {
|
|
|
1378
1379
|
await saveApiKeyCredential(apiKey);
|
|
1379
1380
|
return;
|
|
1380
1381
|
}
|
|
1382
|
+
case "deepseek": {
|
|
1383
|
+
const apiKey = await loginDeepSeek(ctrl);
|
|
1384
|
+
await saveApiKeyCredential(apiKey);
|
|
1385
|
+
return;
|
|
1386
|
+
}
|
|
1381
1387
|
case "fireworks": {
|
|
1382
1388
|
const { loginFireworks } = await import("./utils/oauth/fireworks");
|
|
1383
1389
|
const apiKey = await loginFireworks(ctrl);
|