@phi-code-admin/phi-code 0.96.1 → 0.97.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/CHANGELOG.md +40 -0
- package/dist/core/slash-commands.d.ts +13 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +38 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +24 -4
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/extensions/phi/benchmark.ts +12 -56
- package/extensions/phi/init.ts +86 -673
- package/extensions/phi/providers/catalog.ts +133 -0
- package/extensions/phi/setup.ts +180 -280
- package/extensions/phi/smart-router.ts +0 -17
- package/package.json +3 -3
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single provider catalog shared by /setup, /phi-init and /benchmark.
|
|
3
|
+
*
|
|
4
|
+
* Before 0.97.0 each of those three surfaces hardcoded its own provider list
|
|
5
|
+
* (init.ts, setup.ts, benchmark.ts) and they had already drifted (different
|
|
6
|
+
* ids, env vars and model sets for the same provider). This module is the one
|
|
7
|
+
* source of truth; consumers project the fields they need.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { ALIBABA_ENV_VAR, ALIBABA_MODELS, ALIBABA_PROVIDERS } from "./alibaba.js";
|
|
11
|
+
import { OPENCODE_GO_AUTH_URL, OPENCODE_GO_ENV_VAR } from "./opencode-go.js";
|
|
12
|
+
|
|
13
|
+
export interface ProviderCatalogEntry {
|
|
14
|
+
id: string;
|
|
15
|
+
displayName: string;
|
|
16
|
+
envVar: string;
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
api: string;
|
|
19
|
+
/** Known model ids used as offline fallback by the wizards. */
|
|
20
|
+
staticModels: string[];
|
|
21
|
+
/** Models /benchmark exercises when this provider has a key. */
|
|
22
|
+
benchModels?: string[];
|
|
23
|
+
supportsOAuth?: boolean;
|
|
24
|
+
local?: boolean;
|
|
25
|
+
probeUrl?: string;
|
|
26
|
+
docUrl?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getProviderCatalog(): ProviderCatalogEntry[] {
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
id: "alibaba-codingplan",
|
|
33
|
+
displayName: "Alibaba Coding Plan",
|
|
34
|
+
envVar: ALIBABA_ENV_VAR,
|
|
35
|
+
baseUrl: ALIBABA_PROVIDERS.openai.baseUrl,
|
|
36
|
+
api: "openai-completions",
|
|
37
|
+
staticModels: ALIBABA_MODELS.map((m) => m.id),
|
|
38
|
+
benchModels: [
|
|
39
|
+
"qwen3.5-plus",
|
|
40
|
+
"qwen3-max-2026-01-23",
|
|
41
|
+
"qwen3-coder-plus",
|
|
42
|
+
"qwen3-coder-next",
|
|
43
|
+
"kimi-k2.5",
|
|
44
|
+
"glm-5",
|
|
45
|
+
"glm-4.7",
|
|
46
|
+
"MiniMax-M2.5",
|
|
47
|
+
],
|
|
48
|
+
docUrl: "https://www.alibabacloud.com/help/en/model-studio/coding-plan",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "opencode-go",
|
|
52
|
+
displayName: "OpenCode Go (zen)",
|
|
53
|
+
envVar: OPENCODE_GO_ENV_VAR,
|
|
54
|
+
baseUrl: "https://opencode.ai/zen/go/v1",
|
|
55
|
+
api: "openai-completions",
|
|
56
|
+
staticModels: [],
|
|
57
|
+
docUrl: OPENCODE_GO_AUTH_URL,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "opencode",
|
|
61
|
+
displayName: "OpenCode Zen",
|
|
62
|
+
envVar: "OPENCODE_API_KEY",
|
|
63
|
+
baseUrl: "https://opencode.ai/zen/v1",
|
|
64
|
+
api: "openai-completions",
|
|
65
|
+
staticModels: [],
|
|
66
|
+
docUrl: OPENCODE_GO_AUTH_URL,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "openai",
|
|
70
|
+
displayName: "OpenAI",
|
|
71
|
+
envVar: "OPENAI_API_KEY",
|
|
72
|
+
baseUrl: "https://api.openai.com/v1",
|
|
73
|
+
api: "openai-completions",
|
|
74
|
+
staticModels: ["gpt-4o", "gpt-4o-mini", "o1", "o3-mini", "gpt-5"],
|
|
75
|
+
benchModels: ["gpt-4o", "gpt-4o-mini"],
|
|
76
|
+
supportsOAuth: true,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "anthropic",
|
|
80
|
+
displayName: "Anthropic",
|
|
81
|
+
envVar: "ANTHROPIC_API_KEY",
|
|
82
|
+
baseUrl: "https://api.anthropic.com/v1",
|
|
83
|
+
api: "anthropic-messages",
|
|
84
|
+
staticModels: ["claude-opus-4-6", "claude-sonnet-4-6", "claude-3-5-haiku-20241022"],
|
|
85
|
+
supportsOAuth: true,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "google",
|
|
89
|
+
displayName: "Google Gemini",
|
|
90
|
+
envVar: "GOOGLE_API_KEY",
|
|
91
|
+
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
|
|
92
|
+
api: "google",
|
|
93
|
+
staticModels: ["gemini-2.5-pro", "gemini-2.5-flash"],
|
|
94
|
+
supportsOAuth: true,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "openrouter",
|
|
98
|
+
displayName: "OpenRouter",
|
|
99
|
+
envVar: "OPENROUTER_API_KEY",
|
|
100
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
101
|
+
api: "openai-completions",
|
|
102
|
+
staticModels: [],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: "groq",
|
|
106
|
+
displayName: "Groq",
|
|
107
|
+
envVar: "GROQ_API_KEY",
|
|
108
|
+
baseUrl: "https://api.groq.com/openai/v1",
|
|
109
|
+
api: "openai-completions",
|
|
110
|
+
staticModels: ["llama-3.3-70b-versatile", "openai/gpt-oss-120b"],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "ollama",
|
|
114
|
+
displayName: "Ollama (local)",
|
|
115
|
+
envVar: "OLLAMA",
|
|
116
|
+
baseUrl: "http://localhost:11434/v1",
|
|
117
|
+
api: "openai-completions",
|
|
118
|
+
staticModels: [],
|
|
119
|
+
local: true,
|
|
120
|
+
probeUrl: "http://localhost:11434/v1/models",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: "lm-studio",
|
|
124
|
+
displayName: "LM Studio (local)",
|
|
125
|
+
envVar: "LM_STUDIO",
|
|
126
|
+
baseUrl: "http://localhost:1234/v1",
|
|
127
|
+
api: "openai-completions",
|
|
128
|
+
staticModels: [],
|
|
129
|
+
local: true,
|
|
130
|
+
probeUrl: "http://localhost:1234/v1/models",
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
}
|