@agentskit/cli 0.13.34 → 0.13.35
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/README.md +13 -4
- package/dist/bin.cjs +285 -41
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-54AIH25E.js → chunk-DZKCRKFS.js} +288 -44
- package/dist/chunk-DZKCRKFS.js.map +1 -0
- package/dist/index.cjs +285 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/package.json +11 -11
- package/dist/chunk-54AIH25E.js.map +0 -1
package/dist/bin.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { readdir, stat, mkdir, writeFile, glob, readFile } from 'fs/promises';
|
|
3
3
|
import { homedir } from 'os';
|
|
4
4
|
import path, { join, resolve, isAbsolute, basename, dirname, sep } from 'path';
|
|
5
|
-
import { kimi, grok, deepseek, ollama, gemini, anthropic, openai } from '@agentskit/adapters';
|
|
5
|
+
import { openrouter, groq, kimi, grok, deepseek, ollama, gemini, anthropic, openai } from '@agentskit/adapters';
|
|
6
6
|
import { randomBytes, createHash } from 'crypto';
|
|
7
7
|
import { writeFileSync, existsSync, readdirSync, statSync, readFileSync, mkdirSync, rmSync } from 'fs';
|
|
8
8
|
import { spawn } from 'child_process';
|
|
@@ -97,12 +97,12 @@ var providers = {
|
|
|
97
97
|
anthropic: {
|
|
98
98
|
label: "Anthropic",
|
|
99
99
|
envKeys: ["ANTHROPIC_API_KEY"],
|
|
100
|
-
defaultModel: "claude-
|
|
100
|
+
defaultModel: "claude-sonnet-4-6",
|
|
101
101
|
factory: (c) => anthropic(c)
|
|
102
102
|
},
|
|
103
103
|
gemini: {
|
|
104
104
|
label: "Gemini",
|
|
105
|
-
envKeys: ["GEMINI_API_KEY"],
|
|
105
|
+
envKeys: ["GEMINI_API_KEY", "GOOGLE_API_KEY", "GOOGLE_GENERATIVE_AI_API_KEY"],
|
|
106
106
|
defaultModel: "gemini-2.5-flash",
|
|
107
107
|
factory: (c) => gemini(c)
|
|
108
108
|
},
|
|
@@ -121,14 +121,26 @@ var providers = {
|
|
|
121
121
|
grok: {
|
|
122
122
|
label: "xAI Grok",
|
|
123
123
|
envKeys: ["XAI_API_KEY"],
|
|
124
|
-
|
|
124
|
+
defaultModel: "grok-4.20-0309-non-reasoning",
|
|
125
125
|
factory: (c) => grok(c)
|
|
126
126
|
},
|
|
127
127
|
kimi: {
|
|
128
128
|
label: "Kimi",
|
|
129
129
|
envKeys: ["KIMI_API_KEY", "MOONSHOT_API_KEY"],
|
|
130
|
-
|
|
130
|
+
defaultModel: "kimi-k2-0711-preview",
|
|
131
131
|
factory: (c) => kimi(c)
|
|
132
|
+
},
|
|
133
|
+
groq: {
|
|
134
|
+
label: "Groq",
|
|
135
|
+
envKeys: ["GROQ_API_KEY"],
|
|
136
|
+
defaultModel: "openai/gpt-oss-120b",
|
|
137
|
+
factory: (c) => groq(c)
|
|
138
|
+
},
|
|
139
|
+
openrouter: {
|
|
140
|
+
label: "OpenRouter",
|
|
141
|
+
envKeys: ["OPENROUTER_API_KEY"],
|
|
142
|
+
defaultModel: "~anthropic/claude-haiku-latest",
|
|
143
|
+
factory: (c) => openrouter(c)
|
|
132
144
|
}
|
|
133
145
|
};
|
|
134
146
|
function createDemoAdapter(provider, model) {
|
|
@@ -581,7 +593,7 @@ ${lines.join("\n")}`, "info");
|
|
|
581
593
|
{
|
|
582
594
|
name: "provider",
|
|
583
595
|
description: "Switch the adapter provider.",
|
|
584
|
-
usage: "/provider openai|anthropic|gemini|ollama|deepseek|grok|kimi|demo",
|
|
596
|
+
usage: "/provider openai|anthropic|gemini|ollama|deepseek|grok|kimi|groq|openrouter|demo",
|
|
585
597
|
run(ctx, args) {
|
|
586
598
|
const value = args.trim();
|
|
587
599
|
if (!value) {
|
|
@@ -1443,17 +1455,29 @@ async function runAgent(task, options) {
|
|
|
1443
1455
|
});
|
|
1444
1456
|
process.stdout.write(result.content + "\n");
|
|
1445
1457
|
}
|
|
1458
|
+
|
|
1459
|
+
// src/init-providers.ts
|
|
1446
1460
|
var PROVIDER_IMPORT = {
|
|
1447
1461
|
openai: "openai",
|
|
1448
1462
|
anthropic: "anthropic",
|
|
1449
1463
|
gemini: "gemini",
|
|
1450
|
-
ollama: "ollama"
|
|
1464
|
+
ollama: "ollama",
|
|
1465
|
+
deepseek: "deepseek",
|
|
1466
|
+
grok: "grok",
|
|
1467
|
+
kimi: "kimi",
|
|
1468
|
+
groq: "groq",
|
|
1469
|
+
openrouter: "openrouter"
|
|
1451
1470
|
};
|
|
1452
1471
|
var PROVIDER_DEFAULT_MODEL = {
|
|
1453
1472
|
openai: "gpt-4o-mini",
|
|
1454
1473
|
anthropic: "claude-sonnet-4-6",
|
|
1455
1474
|
gemini: "gemini-2.5-flash",
|
|
1456
1475
|
ollama: "llama3.1",
|
|
1476
|
+
deepseek: "deepseek-chat",
|
|
1477
|
+
grok: "grok-4.20-0309-non-reasoning",
|
|
1478
|
+
kimi: "kimi-k2-0711-preview",
|
|
1479
|
+
groq: "openai/gpt-oss-120b",
|
|
1480
|
+
openrouter: "~anthropic/claude-haiku-latest",
|
|
1457
1481
|
demo: "demo"
|
|
1458
1482
|
};
|
|
1459
1483
|
var PROVIDER_ENV_KEY = {
|
|
@@ -1461,8 +1485,15 @@ var PROVIDER_ENV_KEY = {
|
|
|
1461
1485
|
anthropic: "ANTHROPIC_API_KEY",
|
|
1462
1486
|
gemini: "GEMINI_API_KEY",
|
|
1463
1487
|
ollama: null,
|
|
1488
|
+
deepseek: "DEEPSEEK_API_KEY",
|
|
1489
|
+
grok: "XAI_API_KEY",
|
|
1490
|
+
kimi: "KIMI_API_KEY",
|
|
1491
|
+
groq: "GROQ_API_KEY",
|
|
1492
|
+
openrouter: "OPENROUTER_API_KEY",
|
|
1464
1493
|
demo: null
|
|
1465
1494
|
};
|
|
1495
|
+
|
|
1496
|
+
// src/init.ts
|
|
1466
1497
|
function adapterCall(provider, prefix = "process.env") {
|
|
1467
1498
|
const model = PROVIDER_DEFAULT_MODEL[provider];
|
|
1468
1499
|
if (provider === "demo") return `demoAdapter()`;
|
|
@@ -1470,6 +1501,11 @@ function adapterCall(provider, prefix = "process.env") {
|
|
|
1470
1501
|
const envKey = PROVIDER_ENV_KEY[provider];
|
|
1471
1502
|
return `${PROVIDER_IMPORT[provider]}({ apiKey: ${prefix}.${envKey} ?? '', model: '${model}' })`;
|
|
1472
1503
|
}
|
|
1504
|
+
function denoAdapterCall(provider) {
|
|
1505
|
+
if (provider === "demo") return "demoAdapter()";
|
|
1506
|
+
if (provider === "ollama") return `ollama({ model: '${PROVIDER_DEFAULT_MODEL[provider]}' })`;
|
|
1507
|
+
return `${PROVIDER_IMPORT[provider]}({ apiKey: Deno.env.get('${PROVIDER_ENV_KEY[provider]}') ?? '', model: '${PROVIDER_DEFAULT_MODEL[provider]}' })`;
|
|
1508
|
+
}
|
|
1473
1509
|
function viteAdapterCall(provider) {
|
|
1474
1510
|
if (provider === "demo") return `demoAdapter()`;
|
|
1475
1511
|
if (provider === "ollama") return `ollama({ model: '${PROVIDER_DEFAULT_MODEL[provider]}' })`;
|
|
@@ -2150,7 +2186,7 @@ function cloudflareWorkersStarter(ctx) {
|
|
|
2150
2186
|
"itty-router": "^5.0.0"
|
|
2151
2187
|
};
|
|
2152
2188
|
if (ctx.provider !== "demo") deps["@agentskit/adapters"] = "^0.4.0";
|
|
2153
|
-
const adapterCallEdge =
|
|
2189
|
+
const adapterCallEdge = adapterCall(ctx.provider, "env");
|
|
2154
2190
|
const adapterImport2 = buildAdapterServerImport(ctx.provider);
|
|
2155
2191
|
const demoSnippet = ctx.provider === "demo" ? demoAdapterSnippet() : "";
|
|
2156
2192
|
const envKey = PROVIDER_ENV_KEY[ctx.provider];
|
|
@@ -2633,7 +2669,7 @@ export const useAuth = () => useContext(AuthCtx)
|
|
|
2633
2669
|
};
|
|
2634
2670
|
}
|
|
2635
2671
|
function denoDeployStarter(ctx) {
|
|
2636
|
-
const adapterCallEdge =
|
|
2672
|
+
const adapterCallEdge = denoAdapterCall(ctx.provider);
|
|
2637
2673
|
const adapterImport2 = ctx.provider === "demo" ? "" : `import { ${PROVIDER_IMPORT[ctx.provider]} } from 'npm:@agentskit/adapters'
|
|
2638
2674
|
`;
|
|
2639
2675
|
const demoSnippet = ctx.provider === "demo" ? demoAdapterSnippet() : "";
|
|
@@ -2818,8 +2854,8 @@ ${runCmd}
|
|
|
2818
2854
|
## Next steps
|
|
2819
2855
|
|
|
2820
2856
|
- Open the AgentsKit docs at https://www.agentskit.io/docs
|
|
2821
|
-
- Add a custom skill: https://www.agentskit.io/docs/concepts/skill
|
|
2822
|
-
- Wire up RAG: https://www.agentskit.io/docs/recipes/rag-chat
|
|
2857
|
+
- Add a custom skill: https://www.agentskit.io/docs/get-started/concepts/skill
|
|
2858
|
+
- Wire up RAG: https://www.agentskit.io/docs/reference/recipes/rag-chat
|
|
2823
2859
|
|
|
2824
2860
|
## License
|
|
2825
2861
|
|
|
@@ -2859,20 +2895,206 @@ async function writeStarterProject(options) {
|
|
|
2859
2895
|
})
|
|
2860
2896
|
);
|
|
2861
2897
|
}
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2898
|
+
|
|
2899
|
+
// src/provider-registry.ts
|
|
2900
|
+
var PROVIDER_REGISTRY = [
|
|
2901
|
+
{
|
|
2902
|
+
id: "demo",
|
|
2903
|
+
label: "Demo",
|
|
2904
|
+
runtime: "local",
|
|
2905
|
+
env: { status: "not-required", reason: "Demo adapter does not use provider credentials." },
|
|
2906
|
+
reachability: { status: "unsupported", reason: "Demo adapter has no upstream endpoint." },
|
|
2907
|
+
defaultModel: { status: "known", id: "demo" }
|
|
2908
|
+
},
|
|
2909
|
+
{
|
|
2910
|
+
id: "openai",
|
|
2911
|
+
label: "OpenAI",
|
|
2912
|
+
runtime: "cli",
|
|
2913
|
+
catalogId: "openai",
|
|
2914
|
+
env: { status: "required", keys: ["OPENAI_API_KEY"] },
|
|
2915
|
+
reachability: { status: "supported", url: "https://api.openai.com/v1/models" },
|
|
2916
|
+
defaultModel: { status: "known", id: "gpt-4o-mini" },
|
|
2917
|
+
doctorDefault: true
|
|
2918
|
+
},
|
|
2919
|
+
{
|
|
2920
|
+
id: "anthropic",
|
|
2921
|
+
label: "Anthropic",
|
|
2922
|
+
runtime: "cli",
|
|
2923
|
+
catalogId: "anthropic",
|
|
2924
|
+
env: { status: "required", keys: ["ANTHROPIC_API_KEY"] },
|
|
2925
|
+
reachability: { status: "supported", url: "https://api.anthropic.com/v1/messages" },
|
|
2926
|
+
defaultModel: { status: "known", id: "claude-sonnet-4-6" },
|
|
2927
|
+
doctorDefault: true
|
|
2928
|
+
},
|
|
2929
|
+
{
|
|
2930
|
+
id: "gemini",
|
|
2931
|
+
label: "Gemini",
|
|
2932
|
+
runtime: "cli",
|
|
2933
|
+
catalogId: "google",
|
|
2934
|
+
env: { status: "required", keys: ["GEMINI_API_KEY", "GOOGLE_API_KEY", "GOOGLE_GENERATIVE_AI_API_KEY"] },
|
|
2935
|
+
reachability: { status: "supported", url: "https://generativelanguage.googleapis.com/v1beta/models" },
|
|
2936
|
+
defaultModel: { status: "known", id: "gemini-2.5-flash" },
|
|
2937
|
+
doctorDefault: true
|
|
2938
|
+
},
|
|
2939
|
+
{
|
|
2940
|
+
id: "ollama",
|
|
2941
|
+
label: "Ollama",
|
|
2942
|
+
runtime: "local",
|
|
2943
|
+
env: { status: "not-required", reason: "Ollama runs locally and does not require an API key." },
|
|
2944
|
+
reachability: { status: "supported", url: "http://localhost:11434/api/tags" },
|
|
2945
|
+
defaultModel: { status: "known", id: "llama3.1" },
|
|
2946
|
+
doctorDefault: true
|
|
2947
|
+
},
|
|
2948
|
+
{
|
|
2949
|
+
id: "deepseek",
|
|
2950
|
+
label: "DeepSeek",
|
|
2951
|
+
runtime: "cli",
|
|
2952
|
+
catalogId: "deepseek",
|
|
2953
|
+
env: { status: "required", keys: ["DEEPSEEK_API_KEY"] },
|
|
2954
|
+
reachability: { status: "supported", url: "https://api.deepseek.com/models" },
|
|
2955
|
+
defaultModel: { status: "known", id: "deepseek-chat" }
|
|
2956
|
+
},
|
|
2957
|
+
{
|
|
2958
|
+
id: "grok",
|
|
2959
|
+
label: "xAI Grok",
|
|
2960
|
+
runtime: "cli",
|
|
2961
|
+
catalogId: "xai",
|
|
2962
|
+
env: { status: "required", keys: ["XAI_API_KEY"] },
|
|
2963
|
+
reachability: { status: "supported", url: "https://api.x.ai/v1/models" },
|
|
2964
|
+
defaultModel: { status: "known", id: "grok-4.20-0309-non-reasoning" }
|
|
2965
|
+
},
|
|
2966
|
+
{
|
|
2967
|
+
id: "kimi",
|
|
2968
|
+
label: "Kimi",
|
|
2969
|
+
runtime: "cli",
|
|
2970
|
+
catalogId: "moonshotai",
|
|
2971
|
+
env: { status: "required", keys: ["KIMI_API_KEY", "MOONSHOT_API_KEY"] },
|
|
2972
|
+
reachability: { status: "supported", url: "https://api.moonshot.ai/v1/models" },
|
|
2973
|
+
defaultModel: { status: "known", id: "kimi-k2-0711-preview" }
|
|
2974
|
+
},
|
|
2975
|
+
{
|
|
2976
|
+
id: "groq",
|
|
2977
|
+
label: "Groq",
|
|
2978
|
+
runtime: "cli",
|
|
2979
|
+
catalogId: "groq",
|
|
2980
|
+
env: { status: "required", keys: ["GROQ_API_KEY"] },
|
|
2981
|
+
reachability: { status: "supported", url: "https://api.groq.com/openai/v1/models" },
|
|
2982
|
+
defaultModel: { status: "known", id: "openai/gpt-oss-120b" }
|
|
2983
|
+
},
|
|
2984
|
+
{
|
|
2985
|
+
id: "openrouter",
|
|
2986
|
+
label: "OpenRouter",
|
|
2987
|
+
runtime: "cli",
|
|
2988
|
+
catalogId: "openrouter",
|
|
2989
|
+
env: { status: "required", keys: ["OPENROUTER_API_KEY"] },
|
|
2990
|
+
reachability: { status: "supported", url: "https://openrouter.ai/api/v1/models" },
|
|
2991
|
+
defaultModel: { status: "known", id: "~anthropic/claude-haiku-latest" }
|
|
2992
|
+
},
|
|
2993
|
+
{
|
|
2994
|
+
id: "mistral",
|
|
2995
|
+
label: "Mistral",
|
|
2996
|
+
runtime: "adapter-only",
|
|
2997
|
+
catalogId: "mistral",
|
|
2998
|
+
env: { status: "required", keys: ["MISTRAL_API_KEY"] },
|
|
2999
|
+
reachability: { status: "supported", url: "https://api.mistral.ai/v1/models" },
|
|
3000
|
+
defaultModel: { status: "known", id: "codestral-latest" }
|
|
3001
|
+
},
|
|
3002
|
+
{
|
|
3003
|
+
id: "cohere",
|
|
3004
|
+
label: "Cohere",
|
|
3005
|
+
runtime: "adapter-only",
|
|
3006
|
+
catalogId: "cohere",
|
|
3007
|
+
env: { status: "required", keys: ["COHERE_API_KEY"] },
|
|
3008
|
+
reachability: { status: "supported", url: "https://api.cohere.com/v1/models" },
|
|
3009
|
+
defaultModel: { status: "known", id: "c4ai-aya-expanse-32b" }
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
id: "together",
|
|
3013
|
+
label: "Together",
|
|
3014
|
+
runtime: "adapter-only",
|
|
3015
|
+
catalogId: "togetherai",
|
|
3016
|
+
env: { status: "required", keys: ["TOGETHER_API_KEY"] },
|
|
3017
|
+
reachability: { status: "supported", url: "https://api.together.xyz/v1/models" },
|
|
3018
|
+
defaultModel: { status: "known", id: "deepseek-ai/DeepSeek-R1" }
|
|
3019
|
+
},
|
|
3020
|
+
{
|
|
3021
|
+
id: "fireworks",
|
|
3022
|
+
label: "Fireworks",
|
|
3023
|
+
runtime: "adapter-only",
|
|
3024
|
+
catalogId: "fireworks-ai",
|
|
3025
|
+
env: { status: "required", keys: ["FIREWORKS_API_KEY"] },
|
|
3026
|
+
reachability: { status: "supported", url: "https://api.fireworks.ai/inference/v1/models" },
|
|
3027
|
+
defaultModel: { status: "known", id: "accounts/fireworks/models/deepseek-v4-flash" }
|
|
3028
|
+
},
|
|
3029
|
+
{
|
|
3030
|
+
id: "huggingface",
|
|
3031
|
+
label: "Hugging Face",
|
|
3032
|
+
runtime: "adapter-only",
|
|
3033
|
+
catalogId: "huggingface",
|
|
3034
|
+
env: { status: "required", keys: ["HF_TOKEN"] },
|
|
3035
|
+
reachability: { status: "supported", url: "https://router.huggingface.co/v1/models" },
|
|
3036
|
+
defaultModel: { status: "known", id: "deepseek-ai/DeepSeek-R1-0528" }
|
|
3037
|
+
},
|
|
3038
|
+
{
|
|
3039
|
+
id: "lmstudio",
|
|
3040
|
+
label: "LM Studio",
|
|
3041
|
+
runtime: "local",
|
|
3042
|
+
catalogId: "lmstudio",
|
|
3043
|
+
env: { status: "not-required", reason: "LM Studio runs locally and does not require a provider key." },
|
|
3044
|
+
reachability: { status: "supported", url: "http://127.0.0.1:1234/v1/models" },
|
|
3045
|
+
defaultModel: { status: "known", id: "openai/gpt-oss-20b" }
|
|
3046
|
+
},
|
|
3047
|
+
{
|
|
3048
|
+
id: "vllm",
|
|
3049
|
+
label: "vLLM",
|
|
3050
|
+
runtime: "local",
|
|
3051
|
+
env: { status: "not-required", reason: "vLLM is a local server and does not require a provider key." },
|
|
3052
|
+
reachability: { status: "supported", url: "http://localhost:8000/v1/models" },
|
|
3053
|
+
defaultModel: { status: "known", id: "meta-llama/Llama-3.1-8B-Instruct" }
|
|
3054
|
+
},
|
|
3055
|
+
{
|
|
3056
|
+
id: "llamacpp",
|
|
3057
|
+
label: "llama.cpp",
|
|
3058
|
+
runtime: "local",
|
|
3059
|
+
env: { status: "not-required", reason: "llama.cpp is a local server and does not require a provider key." },
|
|
3060
|
+
reachability: { status: "supported", url: "http://localhost:8080/v1/models" },
|
|
3061
|
+
defaultModel: { status: "known", id: "local-model" }
|
|
3062
|
+
},
|
|
3063
|
+
{
|
|
3064
|
+
id: "cerebras",
|
|
3065
|
+
label: "Cerebras",
|
|
3066
|
+
runtime: "adapter-only",
|
|
3067
|
+
catalogId: "cerebras",
|
|
3068
|
+
env: { status: "required", keys: ["CEREBRAS_API_KEY"] },
|
|
3069
|
+
reachability: { status: "supported", url: "https://api.cerebras.ai/v1/models" },
|
|
3070
|
+
defaultModel: { status: "known", id: "gpt-oss-120b" }
|
|
3071
|
+
}
|
|
3072
|
+
];
|
|
3073
|
+
var DEFAULT_DOCTOR_PROVIDERS = PROVIDER_REGISTRY.filter((entry) => "doctorDefault" in entry && entry.doctorDefault === true).map((entry) => entry.id);
|
|
3074
|
+
function getProviderRegistryEntry(provider) {
|
|
3075
|
+
return PROVIDER_REGISTRY.find((entry) => entry.id === provider.toLowerCase());
|
|
3076
|
+
}
|
|
3077
|
+
function resolveProviderRegistryEntry(provider) {
|
|
3078
|
+
return getProviderRegistryEntry(provider) ?? {
|
|
3079
|
+
id: provider,
|
|
3080
|
+
label: provider,
|
|
3081
|
+
runtime: "adapter-only",
|
|
3082
|
+
env: { status: "unsupported", reason: "Provider is not in the CLI doctor registry." },
|
|
3083
|
+
reachability: { status: "unsupported", reason: "Provider is not in the CLI doctor registry." },
|
|
3084
|
+
defaultModel: { status: "unsupported", reason: "Provider is not in the CLI doctor registry." }
|
|
3085
|
+
};
|
|
3086
|
+
}
|
|
3087
|
+
|
|
3088
|
+
// src/doctor.ts
|
|
3089
|
+
function providerReachabilityFix(entry) {
|
|
3090
|
+
if (entry.id === "ollama") {
|
|
3091
|
+
return "Start Ollama: `ollama serve` (or install from https://ollama.com)";
|
|
3092
|
+
}
|
|
3093
|
+
if (entry.runtime === "local") {
|
|
3094
|
+
return `Start ${entry.label} server and verify its local endpoint`;
|
|
3095
|
+
}
|
|
3096
|
+
return "Check network / firewall / VPN settings";
|
|
3097
|
+
}
|
|
2876
3098
|
async function checkNodeVersion() {
|
|
2877
3099
|
const major = Number(process.versions.node.split(".")[0]);
|
|
2878
3100
|
if (Number.isNaN(major)) {
|
|
@@ -2951,17 +3173,22 @@ async function checkPackageJson() {
|
|
|
2951
3173
|
}
|
|
2952
3174
|
}
|
|
2953
3175
|
async function checkProviderEnv(provider) {
|
|
2954
|
-
const
|
|
2955
|
-
if (
|
|
2956
|
-
return { status: "skip", name: `${provider} API key`, detail:
|
|
3176
|
+
const entry = resolveProviderRegistryEntry(provider);
|
|
3177
|
+
if (entry.env.status === "unsupported") {
|
|
3178
|
+
return { status: "skip", name: `${provider} API key`, detail: entry.env.reason };
|
|
3179
|
+
}
|
|
3180
|
+
if (entry.env.status === "not-required") {
|
|
3181
|
+
return { status: "skip", name: `${provider} API key`, detail: entry.env.reason };
|
|
2957
3182
|
}
|
|
2958
|
-
const
|
|
3183
|
+
const envKey = entry.env.keys.find((key) => process.env[key]);
|
|
3184
|
+
const expectedKeys = entry.env.keys.join(" or ");
|
|
3185
|
+
const value = envKey ? process.env[envKey] : void 0;
|
|
2959
3186
|
if (!value) {
|
|
2960
3187
|
return {
|
|
2961
3188
|
status: "skip",
|
|
2962
3189
|
name: `${provider} API key`,
|
|
2963
|
-
detail: `${
|
|
2964
|
-
fix: `export ${
|
|
3190
|
+
detail: `${expectedKeys} not set`,
|
|
3191
|
+
fix: `export ${entry.env.keys[0]}=... (only needed if you use ${provider})`
|
|
2965
3192
|
};
|
|
2966
3193
|
}
|
|
2967
3194
|
if (value.length < 16) {
|
|
@@ -2975,12 +3202,12 @@ async function checkProviderEnv(provider) {
|
|
|
2975
3202
|
return { status: "pass", name: `${provider} API key`, detail: `${envKey} set (${value.length} chars)` };
|
|
2976
3203
|
}
|
|
2977
3204
|
async function checkProviderReachable(provider, fetchImpl = fetch, timeoutMs = 4e3) {
|
|
2978
|
-
const
|
|
2979
|
-
if (
|
|
2980
|
-
return { status: "skip", name: `${provider} reachable`, detail:
|
|
3205
|
+
const entry = resolveProviderRegistryEntry(provider);
|
|
3206
|
+
if (entry.reachability.status === "unsupported") {
|
|
3207
|
+
return { status: "skip", name: `${provider} reachable`, detail: entry.reachability.reason };
|
|
2981
3208
|
}
|
|
2982
|
-
const
|
|
2983
|
-
if (
|
|
3209
|
+
const url = entry.reachability.url;
|
|
3210
|
+
if (entry.env.status === "required" && !entry.env.keys.some((key) => process.env[key])) {
|
|
2984
3211
|
return { status: "skip", name: `${provider} reachable`, detail: "Skipped \u2014 no API key configured" };
|
|
2985
3212
|
}
|
|
2986
3213
|
const controller = new AbortController();
|
|
@@ -3008,12 +3235,23 @@ async function checkProviderReachable(provider, fetchImpl = fetch, timeoutMs = 4
|
|
|
3008
3235
|
status: "fail",
|
|
3009
3236
|
name: `${provider} reachable`,
|
|
3010
3237
|
detail: `${url} \u2192 ${reason}`,
|
|
3011
|
-
fix:
|
|
3238
|
+
fix: providerReachabilityFix(entry)
|
|
3012
3239
|
};
|
|
3013
3240
|
} finally {
|
|
3014
3241
|
clearTimeout(timer);
|
|
3015
3242
|
}
|
|
3016
3243
|
}
|
|
3244
|
+
async function checkProviderDefaultModel(provider) {
|
|
3245
|
+
const entry = resolveProviderRegistryEntry(provider);
|
|
3246
|
+
if (entry.defaultModel.status === "unsupported") {
|
|
3247
|
+
return { status: "skip", name: `${provider} default model`, detail: entry.defaultModel.reason };
|
|
3248
|
+
}
|
|
3249
|
+
return {
|
|
3250
|
+
status: "pass",
|
|
3251
|
+
name: `${provider} default model`,
|
|
3252
|
+
detail: entry.defaultModel.id
|
|
3253
|
+
};
|
|
3254
|
+
}
|
|
3017
3255
|
async function checkConfig() {
|
|
3018
3256
|
try {
|
|
3019
3257
|
const config = await loadConfig();
|
|
@@ -3034,7 +3272,7 @@ async function checkConfig() {
|
|
|
3034
3272
|
}
|
|
3035
3273
|
}
|
|
3036
3274
|
async function runDoctor(options = {}) {
|
|
3037
|
-
const providers2 = options.providers ??
|
|
3275
|
+
const providers2 = options.providers ?? DEFAULT_DOCTOR_PROVIDERS;
|
|
3038
3276
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
3039
3277
|
const checks = [
|
|
3040
3278
|
checkNodeVersion(),
|
|
@@ -3044,6 +3282,7 @@ async function runDoctor(options = {}) {
|
|
|
3044
3282
|
];
|
|
3045
3283
|
for (const provider of providers2) {
|
|
3046
3284
|
checks.push(checkProviderEnv(provider));
|
|
3285
|
+
checks.push(checkProviderDefaultModel(provider));
|
|
3047
3286
|
if (!options.noNetwork) {
|
|
3048
3287
|
checks.push(checkProviderReachable(provider, fetchImpl));
|
|
3049
3288
|
}
|
|
@@ -3660,7 +3899,12 @@ ${kleur3.bold().green("\u25B2")} ${kleur3.bold("agentskit init")}
|
|
|
3660
3899
|
{ name: "OpenAI", value: "openai" },
|
|
3661
3900
|
{ name: "Anthropic", value: "anthropic" },
|
|
3662
3901
|
{ name: "Gemini", value: "gemini" },
|
|
3663
|
-
{ name: "Ollama (local, no key)", value: "ollama" }
|
|
3902
|
+
{ name: "Ollama (local, no key)", value: "ollama" },
|
|
3903
|
+
{ name: "DeepSeek", value: "deepseek" },
|
|
3904
|
+
{ name: "xAI Grok", value: "grok" },
|
|
3905
|
+
{ name: "Kimi", value: "kimi" },
|
|
3906
|
+
{ name: "Groq", value: "groq" },
|
|
3907
|
+
{ name: "OpenRouter", value: "openrouter" }
|
|
3664
3908
|
]
|
|
3665
3909
|
});
|
|
3666
3910
|
let tools = [];
|
|
@@ -3759,7 +4003,7 @@ function printNextSteps(options) {
|
|
|
3759
4003
|
|
|
3760
4004
|
// src/commands/init.ts
|
|
3761
4005
|
function registerInitCommand(program) {
|
|
3762
|
-
program.command("init").description("Generate a starter project. Run with no flags for interactive mode.").option("--template <template>", "Starter template (react|nextjs|sveltekit|nuxt|ink|vite-ink|cloudflare-workers|bun|deno-deploy|expo|angular|runtime|multi-agent)").option("--dir <directory>", "Target directory", "agentskit-app").option("--provider <provider>", "LLM provider (openai|anthropic|gemini|ollama|demo)").option("--tools <tools>", "Comma-separated tools (web_search,filesystem,shell)").option("--memory <backend>", "Memory backend (none|file|sqlite)").option("--pm <packageManager>", "Package manager (pnpm|npm|yarn|bun)").option("-y, --yes", "Skip interactive prompts; use flag values + defaults").action(async (rawOptions) => {
|
|
4006
|
+
program.command("init").description("Generate a starter project. Run with no flags for interactive mode.").option("--template <template>", "Starter template (react|nextjs|sveltekit|nuxt|ink|vite-ink|cloudflare-workers|bun|deno-deploy|expo|angular|runtime|multi-agent)").option("--dir <directory>", "Target directory", "agentskit-app").option("--provider <provider>", "LLM provider (openai|anthropic|gemini|ollama|deepseek|grok|kimi|groq|openrouter|demo)").option("--tools <tools>", "Comma-separated tools (web_search,filesystem,shell)").option("--memory <backend>", "Memory backend (none|file|sqlite)").option("--pm <packageManager>", "Package manager (pnpm|npm|yarn|bun)").option("-y, --yes", "Skip interactive prompts; use flag values + defaults").action(async (rawOptions) => {
|
|
3763
4007
|
const isCi = !process.stdout.isTTY || rawOptions.yes || rawOptions.template;
|
|
3764
4008
|
let resolved;
|
|
3765
4009
|
if (isCi) {
|
|
@@ -3799,7 +4043,7 @@ function registerInitCommand(program) {
|
|
|
3799
4043
|
function registerDoctorCommand(program) {
|
|
3800
4044
|
program.command("doctor").description("Diagnose your AgentsKit environment.").option("--no-network", "Skip provider reachability checks").option(
|
|
3801
4045
|
"--providers <providers>",
|
|
3802
|
-
|
|
4046
|
+
`Comma-separated providers to check (default: ${DEFAULT_DOCTOR_PROVIDERS.join(",")})`
|
|
3803
4047
|
).option("--json", "Emit JSON instead of formatted output").action(async (options) => {
|
|
3804
4048
|
const providers2 = options.providers ? options.providers.split(",").map((p) => p.trim()).filter(Boolean) : void 0;
|
|
3805
4049
|
const report = await runDoctor({
|
|
@@ -5553,7 +5797,7 @@ async function tryComponentAdd(name, options) {
|
|
|
5553
5797
|
function registerAddCommand(program) {
|
|
5554
5798
|
program.command("add <name>").description(
|
|
5555
5799
|
'Add a ready-made agent or UI component from the AgentsKit registry (registry.agentskit.io). Auto-detects which: a component is scanned/validated against your project and installed transactionally; an agent is copied into ./agents. You own the code. e.g. `agentskit add docs-chat` (component) or `agentskit add research --run "\u2026"` (agent).'
|
|
5556
|
-
).option("--out <dir>", "Directory to install into (component: the port dir; agent: ./agents)").option("-f, --force", "Overwrite existing files").option("--registry <url>", "Registry base URL override (component install)").option("--run <task>", "Run the agent on this task right after adding it").option("--provider <provider>", "Provider for --run (openai, anthropic, gemini, ollama, demo)", "demo").option("--model <model>", "Model for --run").option("--api-key <key>", "API key for --run (else read from the provider env var)").action(
|
|
5800
|
+
).option("--out <dir>", "Directory to install into (component: the port dir; agent: ./agents)").option("-f, --force", "Overwrite existing files").option("--registry <url>", "Registry base URL override (component install)").option("--run <task>", "Run the agent on this task right after adding it").option("--provider <provider>", "Provider for --run (openai, anthropic, gemini, ollama, groq, openrouter, demo)", "demo").option("--model <model>", "Model for --run").option("--api-key <key>", "API key for --run (else read from the provider env var)").action(
|
|
5557
5801
|
async (agent, options) => {
|
|
5558
5802
|
try {
|
|
5559
5803
|
const outcome = await tryComponentAdd(agent, {
|
|
@@ -5715,5 +5959,5 @@ function createCli() {
|
|
|
5715
5959
|
}
|
|
5716
5960
|
|
|
5717
5961
|
export { ChatApp, HookDispatcher, McpClient, applyPolicyToTool, applyPolicyToTools, bridgeMcpServers, buildRagFromConfig, computeCost, configHooksToHandlers, createCli, createOpenAiEmbedder, defaultPolicy, derivePreview, disposeMcpClients, evaluatePolicy, findLatestSession, findSession, forkSession, generateSessionId, getPricing, indexSources, listSessions, loadConfig, loadPlugins, mergePluginsIntoBundle, registerPricing, renameSession, renderChatHeader, renderReport, resolveChatProvider, resolveSession, runAgent, runDoctor, sessionFilePath, startDev, startTunnel, writeSessionMeta, writeStarterProject };
|
|
5718
|
-
//# sourceMappingURL=chunk-
|
|
5719
|
-
//# sourceMappingURL=chunk-
|
|
5962
|
+
//# sourceMappingURL=chunk-DZKCRKFS.js.map
|
|
5963
|
+
//# sourceMappingURL=chunk-DZKCRKFS.js.map
|