@phi-code-admin/phi-code 0.60.2 → 0.60.4
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/dist/core/default-models.json +15 -15
- package/extensions/phi/init.ts +50 -12
- package/package.json +1 -1
- package/scripts/postinstall.cjs +14 -8
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"name": "Qwen 3.5 Plus",
|
|
11
11
|
"reasoning": true,
|
|
12
12
|
"input": ["text"],
|
|
13
|
-
"contextWindow":
|
|
13
|
+
"contextWindow": 1000000,
|
|
14
14
|
"maxTokens": 16384
|
|
15
15
|
},
|
|
16
16
|
{
|
|
@@ -18,23 +18,23 @@
|
|
|
18
18
|
"name": "Qwen 3 Max",
|
|
19
19
|
"reasoning": true,
|
|
20
20
|
"input": ["text"],
|
|
21
|
-
"contextWindow":
|
|
21
|
+
"contextWindow": 262144,
|
|
22
22
|
"maxTokens": 16384
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"id": "qwen3-coder-plus",
|
|
26
26
|
"name": "Qwen 3 Coder Plus",
|
|
27
|
-
"reasoning":
|
|
27
|
+
"reasoning": true,
|
|
28
28
|
"input": ["text"],
|
|
29
|
-
"contextWindow":
|
|
29
|
+
"contextWindow": 1000000,
|
|
30
30
|
"maxTokens": 16384
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"id": "qwen3-coder-next",
|
|
34
34
|
"name": "Qwen 3 Coder Next",
|
|
35
|
-
"reasoning":
|
|
35
|
+
"reasoning": true,
|
|
36
36
|
"input": ["text"],
|
|
37
|
-
"contextWindow":
|
|
37
|
+
"contextWindow": 1000000,
|
|
38
38
|
"maxTokens": 16384
|
|
39
39
|
},
|
|
40
40
|
{
|
|
@@ -42,31 +42,31 @@
|
|
|
42
42
|
"name": "Kimi K2.5",
|
|
43
43
|
"reasoning": true,
|
|
44
44
|
"input": ["text"],
|
|
45
|
-
"contextWindow":
|
|
45
|
+
"contextWindow": 262144,
|
|
46
46
|
"maxTokens": 16384
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
"id": "glm-5",
|
|
50
50
|
"name": "GLM 5",
|
|
51
|
-
"reasoning":
|
|
51
|
+
"reasoning": true,
|
|
52
52
|
"input": ["text"],
|
|
53
|
-
"contextWindow":
|
|
54
|
-
"maxTokens":
|
|
53
|
+
"contextWindow": 200000,
|
|
54
|
+
"maxTokens": 128000
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"id": "glm-4.7",
|
|
58
58
|
"name": "GLM 4.7",
|
|
59
|
-
"reasoning":
|
|
59
|
+
"reasoning": true,
|
|
60
60
|
"input": ["text"],
|
|
61
|
-
"contextWindow":
|
|
62
|
-
"maxTokens":
|
|
61
|
+
"contextWindow": 200000,
|
|
62
|
+
"maxTokens": 128000
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"id": "MiniMax-M2.5",
|
|
66
66
|
"name": "MiniMax M2.5",
|
|
67
|
-
"reasoning":
|
|
67
|
+
"reasoning": true,
|
|
68
68
|
"input": ["text"],
|
|
69
|
-
"contextWindow":
|
|
69
|
+
"contextWindow": 1000000,
|
|
70
70
|
"maxTokens": 16384
|
|
71
71
|
}
|
|
72
72
|
]
|
package/extensions/phi/init.ts
CHANGED
|
@@ -37,6 +37,38 @@ interface RoutingConfig {
|
|
|
37
37
|
default: { model: string; agent: string | null };
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
// ─── Model Database ─────────────────────────────────────────────────────
|
|
41
|
+
|
|
42
|
+
const MODEL_DB: Record<string, { contextWindow: number; maxTokens: number; reasoning: boolean }> = {
|
|
43
|
+
// Alibaba / DashScope
|
|
44
|
+
"qwen3.5-plus": { contextWindow: 1000000, maxTokens: 16384, reasoning: true },
|
|
45
|
+
"qwen3-max-2026-01-23": { contextWindow: 262144, maxTokens: 16384, reasoning: true },
|
|
46
|
+
"qwen3-coder-plus": { contextWindow: 1000000, maxTokens: 16384, reasoning: true },
|
|
47
|
+
"qwen3-coder-next": { contextWindow: 1000000, maxTokens: 16384, reasoning: true },
|
|
48
|
+
"kimi-k2.5": { contextWindow: 262144, maxTokens: 16384, reasoning: true },
|
|
49
|
+
"glm-5": { contextWindow: 200000, maxTokens: 128000, reasoning: true },
|
|
50
|
+
"glm-4.7": { contextWindow: 200000, maxTokens: 128000, reasoning: true },
|
|
51
|
+
"MiniMax-M2.5": { contextWindow: 1000000, maxTokens: 16384, reasoning: true },
|
|
52
|
+
// OpenAI
|
|
53
|
+
"gpt-4o": { contextWindow: 128000, maxTokens: 16384, reasoning: false },
|
|
54
|
+
"gpt-4o-mini": { contextWindow: 128000, maxTokens: 16384, reasoning: false },
|
|
55
|
+
"o1": { contextWindow: 200000, maxTokens: 100000, reasoning: true },
|
|
56
|
+
"o3-mini": { contextWindow: 200000, maxTokens: 100000, reasoning: true },
|
|
57
|
+
// Anthropic
|
|
58
|
+
"claude-sonnet-4-20250514": { contextWindow: 200000, maxTokens: 64000, reasoning: true },
|
|
59
|
+
"claude-3-5-haiku-20241022": { contextWindow: 200000, maxTokens: 8192, reasoning: false },
|
|
60
|
+
// Google
|
|
61
|
+
"gemini-2.5-pro": { contextWindow: 1000000, maxTokens: 65536, reasoning: true },
|
|
62
|
+
"gemini-2.5-flash": { contextWindow: 1000000, maxTokens: 65536, reasoning: true },
|
|
63
|
+
// Groq
|
|
64
|
+
"llama-3.3-70b-versatile": { contextWindow: 128000, maxTokens: 32768, reasoning: false },
|
|
65
|
+
"mixtral-8x7b-32768": { contextWindow: 32768, maxTokens: 4096, reasoning: false },
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
function getModelSpec(id: string): { contextWindow: number; maxTokens: number; reasoning: boolean } {
|
|
69
|
+
return MODEL_DB[id] || { contextWindow: 128000, maxTokens: 16384, reasoning: true };
|
|
70
|
+
}
|
|
71
|
+
|
|
40
72
|
// ─── Provider Detection ──────────────────────────────────────────────────
|
|
41
73
|
|
|
42
74
|
function detectProviders(): DetectedProvider[] {
|
|
@@ -698,14 +730,17 @@ _Edit this file to customize Phi Code's behavior for your project._
|
|
|
698
730
|
baseUrl: chosen.baseUrl,
|
|
699
731
|
api: "openai-completions",
|
|
700
732
|
apiKey: apiKey.trim(),
|
|
701
|
-
models: chosen.models.map((id: string) =>
|
|
702
|
-
id
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
733
|
+
models: chosen.models.map((id: string) => {
|
|
734
|
+
const spec = getModelSpec(id);
|
|
735
|
+
return {
|
|
736
|
+
id,
|
|
737
|
+
name: id,
|
|
738
|
+
reasoning: spec.reasoning,
|
|
739
|
+
input: ["text"],
|
|
740
|
+
contextWindow: spec.contextWindow,
|
|
741
|
+
maxTokens: spec.maxTokens,
|
|
742
|
+
};
|
|
743
|
+
}),
|
|
709
744
|
};
|
|
710
745
|
|
|
711
746
|
await writeFile(modelsJsonPath, JSON.stringify(modelsConfig, null, 2), "utf-8");
|
|
@@ -913,10 +948,13 @@ For persistence, set environment variables:
|
|
|
913
948
|
baseUrl: providerDef.baseUrl,
|
|
914
949
|
api: "openai-completions",
|
|
915
950
|
apiKey: key,
|
|
916
|
-
models: providerDef.models.map((id: string) =>
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
951
|
+
models: providerDef.models.map((id: string) => {
|
|
952
|
+
const spec = getModelSpec(id);
|
|
953
|
+
return {
|
|
954
|
+
id, name: id, reasoning: spec.reasoning, input: ["text"],
|
|
955
|
+
contextWindow: spec.contextWindow, maxTokens: spec.maxTokens,
|
|
956
|
+
};
|
|
957
|
+
}),
|
|
920
958
|
};
|
|
921
959
|
writeFileSync(modelsJsonPath, JSON.stringify(modelsConfig, null, 2), "utf-8");
|
|
922
960
|
}
|
package/package.json
CHANGED
package/scripts/postinstall.cjs
CHANGED
|
@@ -58,15 +58,21 @@ for (const pkg of sigmaPackages) {
|
|
|
58
58
|
createLink(srcPkg, destLink, pkg);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
// 3.
|
|
61
|
+
// 3. Ensure settings.json has quietStartup: true
|
|
62
62
|
const settingsPath = join(agentDir, "settings.json");
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
63
|
+
try {
|
|
64
|
+
let settings = {};
|
|
65
|
+
if (existsSync(settingsPath)) {
|
|
66
|
+
try {
|
|
67
|
+
settings = JSON.parse(require("fs").readFileSync(settingsPath, "utf-8"));
|
|
68
|
+
} catch { settings = {}; }
|
|
69
|
+
}
|
|
70
|
+
if (settings.quietStartup !== true) {
|
|
71
|
+
settings.quietStartup = true;
|
|
72
|
+
require("fs").writeFileSync(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
73
|
+
console.log(` Φ Set quietStartup: true in settings.json`);
|
|
74
|
+
}
|
|
75
|
+
} catch { /* skip */ }
|
|
70
76
|
|
|
71
77
|
function createLink(src, dest, name) {
|
|
72
78
|
try {
|