@agi-cli/server 0.1.165 → 0.1.166
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agi-cli/server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.166",
|
|
4
4
|
"description": "HTTP API server for AGI CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"typecheck": "tsc --noEmit"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@agi-cli/sdk": "0.1.
|
|
33
|
-
"@agi-cli/database": "0.1.
|
|
32
|
+
"@agi-cli/sdk": "0.1.166",
|
|
33
|
+
"@agi-cli/database": "0.1.166",
|
|
34
34
|
"drizzle-orm": "^0.44.5",
|
|
35
35
|
"hono": "^4.9.9",
|
|
36
36
|
"zod": "^4.1.8"
|
|
@@ -50,7 +50,6 @@ export async function selectProviderAndModel(
|
|
|
50
50
|
: await pickAuthorizedProvider({
|
|
51
51
|
cfg,
|
|
52
52
|
candidate: explicitProvider ?? agentProviderDefault,
|
|
53
|
-
explicitProvider,
|
|
54
53
|
});
|
|
55
54
|
|
|
56
55
|
if (!provider) {
|
|
@@ -77,19 +76,14 @@ export async function selectProviderAndModel(
|
|
|
77
76
|
async function pickAuthorizedProvider(args: {
|
|
78
77
|
cfg: AGIConfig;
|
|
79
78
|
candidate: ProviderId;
|
|
80
|
-
explicitProvider?: ProviderId;
|
|
81
79
|
}): Promise<ProviderId | undefined> {
|
|
82
|
-
const { cfg, candidate
|
|
80
|
+
const { cfg, candidate } = args;
|
|
83
81
|
const candidates = uniqueProviders([
|
|
84
82
|
candidate,
|
|
85
83
|
...FALLBACK_ORDER,
|
|
86
84
|
...providerIds,
|
|
87
85
|
]);
|
|
88
86
|
for (const provider of candidates) {
|
|
89
|
-
const enabled = cfg.providers[provider]?.enabled ?? true;
|
|
90
|
-
const explicitlyRequested =
|
|
91
|
-
explicitProvider != null && provider === explicitProvider;
|
|
92
|
-
if (!enabled && !explicitlyRequested) continue;
|
|
93
87
|
const ok = await isProviderAuthorized(cfg, provider);
|
|
94
88
|
if (ok) return provider;
|
|
95
89
|
}
|