agent-dj 0.1.1 → 0.1.2
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/cli.js +68 -5
- package/dist/server.js +48 -3
- package/package.json +1 -1
- package/web/dist/assets/{index-D2I1F5Wj.js → index-CVUo4o24.js} +22 -22
- package/web/dist/index.html +1 -1
package/dist/cli.js
CHANGED
|
@@ -124,6 +124,18 @@ var init_defaults = __esm({
|
|
|
124
124
|
ollama: {
|
|
125
125
|
default: "llama3.2",
|
|
126
126
|
options: ["llama3.2", "mistral", "codellama", "phi3"]
|
|
127
|
+
},
|
|
128
|
+
deepseek: {
|
|
129
|
+
default: "deepseek-chat",
|
|
130
|
+
options: ["deepseek-chat", "deepseek-reasoner"]
|
|
131
|
+
},
|
|
132
|
+
xai: {
|
|
133
|
+
default: "grok-3",
|
|
134
|
+
options: ["grok-3", "grok-3-mini", "grok-2", "grok-2-mini"]
|
|
135
|
+
},
|
|
136
|
+
mistral: {
|
|
137
|
+
default: "mistral-large-latest",
|
|
138
|
+
options: ["mistral-large-latest", "codestral-latest", "mistral-small-latest"]
|
|
127
139
|
}
|
|
128
140
|
};
|
|
129
141
|
}
|
|
@@ -519,14 +531,20 @@ var init_setup = __esm({
|
|
|
519
531
|
openai: "OpenAI (GPT)",
|
|
520
532
|
google: "Google (Gemini)",
|
|
521
533
|
groq: "Groq (fast inference)",
|
|
522
|
-
ollama: "Ollama (local, free)"
|
|
534
|
+
ollama: "Ollama (local, free)",
|
|
535
|
+
deepseek: "DeepSeek (cheap & strong)",
|
|
536
|
+
xai: "xAI (Grok)",
|
|
537
|
+
mistral: "Mistral AI"
|
|
523
538
|
};
|
|
524
539
|
API_KEY_HINTS = {
|
|
525
540
|
anthropic: "Get key at console.anthropic.com",
|
|
526
541
|
openai: "Get key at platform.openai.com",
|
|
527
542
|
google: "Get key at aistudio.google.com",
|
|
528
543
|
groq: "Get key at console.groq.com (free tier available)",
|
|
529
|
-
ollama: "No key needed \u2014 runs locally"
|
|
544
|
+
ollama: "No key needed \u2014 runs locally",
|
|
545
|
+
deepseek: "Get key at platform.deepseek.com",
|
|
546
|
+
xai: "Get key at console.x.ai",
|
|
547
|
+
mistral: "Get key at console.mistral.ai"
|
|
530
548
|
};
|
|
531
549
|
}
|
|
532
550
|
});
|
|
@@ -272727,6 +272745,24 @@ async function getOrCreateProvider(config) {
|
|
|
272727
272745
|
baseURL: config.baseUrl ?? "http://localhost:11434/v1"
|
|
272728
272746
|
});
|
|
272729
272747
|
break;
|
|
272748
|
+
case "deepseek":
|
|
272749
|
+
instance = createOpenAI({
|
|
272750
|
+
apiKey: config.apiKey,
|
|
272751
|
+
baseURL: "https://api.deepseek.com/v1"
|
|
272752
|
+
});
|
|
272753
|
+
break;
|
|
272754
|
+
case "xai":
|
|
272755
|
+
instance = createOpenAI({
|
|
272756
|
+
apiKey: config.apiKey,
|
|
272757
|
+
baseURL: "https://api.x.ai/v1"
|
|
272758
|
+
});
|
|
272759
|
+
break;
|
|
272760
|
+
case "mistral":
|
|
272761
|
+
instance = createOpenAI({
|
|
272762
|
+
apiKey: config.apiKey,
|
|
272763
|
+
baseURL: "https://api.mistral.ai/v1"
|
|
272764
|
+
});
|
|
272765
|
+
break;
|
|
272730
272766
|
default:
|
|
272731
272767
|
throw new Error(`Unsupported provider: ${config.provider}`);
|
|
272732
272768
|
}
|
|
@@ -272734,7 +272770,7 @@ async function getOrCreateProvider(config) {
|
|
|
272734
272770
|
return instance;
|
|
272735
272771
|
}
|
|
272736
272772
|
function getLanguageModel(config, modelId) {
|
|
272737
|
-
const model = modelId
|
|
272773
|
+
const model = modelId || config.model || getDefaultModel(config.provider);
|
|
272738
272774
|
if (config.provider === "anthropic" && config.authType === "session_token") {
|
|
272739
272775
|
_lastSessionTokenSupportsTools = false;
|
|
272740
272776
|
if (isClaudeCliAvailable()) {
|
|
@@ -272770,7 +272806,10 @@ function getDefaultModel(provider) {
|
|
|
272770
272806
|
openai: "gpt-4o",
|
|
272771
272807
|
google: "gemini-2.0-flash",
|
|
272772
272808
|
groq: "llama-3.3-70b-versatile",
|
|
272773
|
-
ollama: "llama3.2"
|
|
272809
|
+
ollama: "llama3.2",
|
|
272810
|
+
deepseek: "deepseek-chat",
|
|
272811
|
+
xai: "grok-3",
|
|
272812
|
+
mistral: "mistral-large-latest"
|
|
272774
272813
|
};
|
|
272775
272814
|
return defaults[provider];
|
|
272776
272815
|
}
|
|
@@ -273275,7 +273314,19 @@ var init_models = __esm({
|
|
|
273275
273314
|
{ id: "llama-3.1-8b-instant", name: "Llama 3.1 8B", provider: "groq", contextWindow: 128e3, costTier: "cheap", supportsTools: true, supportsVision: false },
|
|
273276
273315
|
// Ollama
|
|
273277
273316
|
{ id: "llama3.2", name: "Llama 3.2", provider: "ollama", contextWindow: 128e3, costTier: "cheap", supportsTools: true, supportsVision: false },
|
|
273278
|
-
{ id: "mistral", name: "Mistral", provider: "ollama", contextWindow: 32e3, costTier: "cheap", supportsTools: true, supportsVision: false }
|
|
273317
|
+
{ id: "mistral", name: "Mistral", provider: "ollama", contextWindow: 32e3, costTier: "cheap", supportsTools: true, supportsVision: false },
|
|
273318
|
+
// DeepSeek
|
|
273319
|
+
{ id: "deepseek-chat", name: "DeepSeek Chat", provider: "deepseek", contextWindow: 128e3, costTier: "cheap", supportsTools: true, supportsVision: true },
|
|
273320
|
+
{ id: "deepseek-reasoner", name: "DeepSeek Reasoner", provider: "deepseek", contextWindow: 128e3, costTier: "standard", supportsTools: false, supportsVision: false },
|
|
273321
|
+
// xAI
|
|
273322
|
+
{ id: "grok-3", name: "Grok 3", provider: "xai", contextWindow: 131072, costTier: "premium", supportsTools: true, supportsVision: true },
|
|
273323
|
+
{ id: "grok-3-mini", name: "Grok 3 Mini", provider: "xai", contextWindow: 131072, costTier: "standard", supportsTools: true, supportsVision: true },
|
|
273324
|
+
{ id: "grok-2", name: "Grok 2", provider: "xai", contextWindow: 131072, costTier: "standard", supportsTools: true, supportsVision: true },
|
|
273325
|
+
{ id: "grok-2-mini", name: "Grok 2 Mini", provider: "xai", contextWindow: 131072, costTier: "cheap", supportsTools: true, supportsVision: false },
|
|
273326
|
+
// Mistral
|
|
273327
|
+
{ id: "mistral-large-latest", name: "Mistral Large", provider: "mistral", contextWindow: 128e3, costTier: "standard", supportsTools: true, supportsVision: false },
|
|
273328
|
+
{ id: "codestral-latest", name: "Codestral", provider: "mistral", contextWindow: 256e3, costTier: "cheap", supportsTools: true, supportsVision: false },
|
|
273329
|
+
{ id: "mistral-small-latest", name: "Mistral Small", provider: "mistral", contextWindow: 128e3, costTier: "cheap", supportsTools: true, supportsVision: false }
|
|
273279
273330
|
];
|
|
273280
273331
|
}
|
|
273281
273332
|
});
|
|
@@ -274389,6 +274440,18 @@ var init_settings = __esm({
|
|
|
274389
274440
|
saveConfig(updated);
|
|
274390
274441
|
return c.json({ ok: true });
|
|
274391
274442
|
});
|
|
274443
|
+
settingsRoutes.delete("/providers/:name", (c) => {
|
|
274444
|
+
const name = c.req.param("name");
|
|
274445
|
+
const config = loadConfig();
|
|
274446
|
+
const idx = config.providers.findIndex((p2) => p2.provider === name);
|
|
274447
|
+
if (idx < 0) return c.json({ error: "Provider not found" }, 404);
|
|
274448
|
+
if (config.defaultProvider === name) {
|
|
274449
|
+
return c.json({ error: "Cannot delete the default provider. Set another as default first." }, 400);
|
|
274450
|
+
}
|
|
274451
|
+
config.providers.splice(idx, 1);
|
|
274452
|
+
saveConfig(config);
|
|
274453
|
+
return c.json({ ok: true });
|
|
274454
|
+
});
|
|
274392
274455
|
settingsRoutes.get("/system", (c) => {
|
|
274393
274456
|
const stats = getSystemStats();
|
|
274394
274457
|
return c.json(stats);
|
package/dist/server.js
CHANGED
|
@@ -270980,6 +270980,24 @@ async function getOrCreateProvider(config) {
|
|
|
270980
270980
|
baseURL: config.baseUrl ?? "http://localhost:11434/v1"
|
|
270981
270981
|
});
|
|
270982
270982
|
break;
|
|
270983
|
+
case "deepseek":
|
|
270984
|
+
instance = createOpenAI({
|
|
270985
|
+
apiKey: config.apiKey,
|
|
270986
|
+
baseURL: "https://api.deepseek.com/v1"
|
|
270987
|
+
});
|
|
270988
|
+
break;
|
|
270989
|
+
case "xai":
|
|
270990
|
+
instance = createOpenAI({
|
|
270991
|
+
apiKey: config.apiKey,
|
|
270992
|
+
baseURL: "https://api.x.ai/v1"
|
|
270993
|
+
});
|
|
270994
|
+
break;
|
|
270995
|
+
case "mistral":
|
|
270996
|
+
instance = createOpenAI({
|
|
270997
|
+
apiKey: config.apiKey,
|
|
270998
|
+
baseURL: "https://api.mistral.ai/v1"
|
|
270999
|
+
});
|
|
271000
|
+
break;
|
|
270983
271001
|
default:
|
|
270984
271002
|
throw new Error(`Unsupported provider: ${config.provider}`);
|
|
270985
271003
|
}
|
|
@@ -270987,7 +271005,7 @@ async function getOrCreateProvider(config) {
|
|
|
270987
271005
|
return instance;
|
|
270988
271006
|
}
|
|
270989
271007
|
function getLanguageModel(config, modelId) {
|
|
270990
|
-
const model = modelId
|
|
271008
|
+
const model = modelId || config.model || getDefaultModel(config.provider);
|
|
270991
271009
|
if (config.provider === "anthropic" && config.authType === "session_token") {
|
|
270992
271010
|
_lastSessionTokenSupportsTools = false;
|
|
270993
271011
|
if (isClaudeCliAvailable()) {
|
|
@@ -271023,7 +271041,10 @@ function getDefaultModel(provider) {
|
|
|
271023
271041
|
openai: "gpt-4o",
|
|
271024
271042
|
google: "gemini-2.0-flash",
|
|
271025
271043
|
groq: "llama-3.3-70b-versatile",
|
|
271026
|
-
ollama: "llama3.2"
|
|
271044
|
+
ollama: "llama3.2",
|
|
271045
|
+
deepseek: "deepseek-chat",
|
|
271046
|
+
xai: "grok-3",
|
|
271047
|
+
mistral: "mistral-large-latest"
|
|
271027
271048
|
};
|
|
271028
271049
|
return defaults[provider];
|
|
271029
271050
|
}
|
|
@@ -272494,7 +272515,19 @@ var MODEL_CATALOG = [
|
|
|
272494
272515
|
{ id: "llama-3.1-8b-instant", name: "Llama 3.1 8B", provider: "groq", contextWindow: 128e3, costTier: "cheap", supportsTools: true, supportsVision: false },
|
|
272495
272516
|
// Ollama
|
|
272496
272517
|
{ id: "llama3.2", name: "Llama 3.2", provider: "ollama", contextWindow: 128e3, costTier: "cheap", supportsTools: true, supportsVision: false },
|
|
272497
|
-
{ id: "mistral", name: "Mistral", provider: "ollama", contextWindow: 32e3, costTier: "cheap", supportsTools: true, supportsVision: false }
|
|
272518
|
+
{ id: "mistral", name: "Mistral", provider: "ollama", contextWindow: 32e3, costTier: "cheap", supportsTools: true, supportsVision: false },
|
|
272519
|
+
// DeepSeek
|
|
272520
|
+
{ id: "deepseek-chat", name: "DeepSeek Chat", provider: "deepseek", contextWindow: 128e3, costTier: "cheap", supportsTools: true, supportsVision: true },
|
|
272521
|
+
{ id: "deepseek-reasoner", name: "DeepSeek Reasoner", provider: "deepseek", contextWindow: 128e3, costTier: "standard", supportsTools: false, supportsVision: false },
|
|
272522
|
+
// xAI
|
|
272523
|
+
{ id: "grok-3", name: "Grok 3", provider: "xai", contextWindow: 131072, costTier: "premium", supportsTools: true, supportsVision: true },
|
|
272524
|
+
{ id: "grok-3-mini", name: "Grok 3 Mini", provider: "xai", contextWindow: 131072, costTier: "standard", supportsTools: true, supportsVision: true },
|
|
272525
|
+
{ id: "grok-2", name: "Grok 2", provider: "xai", contextWindow: 131072, costTier: "standard", supportsTools: true, supportsVision: true },
|
|
272526
|
+
{ id: "grok-2-mini", name: "Grok 2 Mini", provider: "xai", contextWindow: 131072, costTier: "cheap", supportsTools: true, supportsVision: false },
|
|
272527
|
+
// Mistral
|
|
272528
|
+
{ id: "mistral-large-latest", name: "Mistral Large", provider: "mistral", contextWindow: 128e3, costTier: "standard", supportsTools: true, supportsVision: false },
|
|
272529
|
+
{ id: "codestral-latest", name: "Codestral", provider: "mistral", contextWindow: 256e3, costTier: "cheap", supportsTools: true, supportsVision: false },
|
|
272530
|
+
{ id: "mistral-small-latest", name: "Mistral Small", provider: "mistral", contextWindow: 128e3, costTier: "cheap", supportsTools: true, supportsVision: false }
|
|
272498
272531
|
];
|
|
272499
272532
|
function getModelInfo(modelId) {
|
|
272500
272533
|
return MODEL_CATALOG.find((m) => m.id === modelId);
|
|
@@ -273669,6 +273702,18 @@ settingsRoutes.post("/providers", async (c) => {
|
|
|
273669
273702
|
saveConfig(updated);
|
|
273670
273703
|
return c.json({ ok: true });
|
|
273671
273704
|
});
|
|
273705
|
+
settingsRoutes.delete("/providers/:name", (c) => {
|
|
273706
|
+
const name = c.req.param("name");
|
|
273707
|
+
const config = loadConfig();
|
|
273708
|
+
const idx = config.providers.findIndex((p) => p.provider === name);
|
|
273709
|
+
if (idx < 0) return c.json({ error: "Provider not found" }, 404);
|
|
273710
|
+
if (config.defaultProvider === name) {
|
|
273711
|
+
return c.json({ error: "Cannot delete the default provider. Set another as default first." }, 400);
|
|
273712
|
+
}
|
|
273713
|
+
config.providers.splice(idx, 1);
|
|
273714
|
+
saveConfig(config);
|
|
273715
|
+
return c.json({ ok: true });
|
|
273716
|
+
});
|
|
273672
273717
|
settingsRoutes.get("/system", (c) => {
|
|
273673
273718
|
const stats = getSystemStats();
|
|
273674
273719
|
return c.json(stats);
|
package/package.json
CHANGED